From 934a376050f85b80b91200aad44de6d1768aab85 Mon Sep 17 00:00:00 2001 From: Justin Wilaby Date: Fri, 23 Feb 2024 10:12:48 -0800 Subject: [PATCH 1/2] chore(update-schemma): update to the latest heroku api schema --- .circleci/config.yml | 80 - .eslintrc | 49 +- .github/workflows/ci.yml | 21 + .gitignore | 3 +- .prettier.mjs | 12 + lib/cjs/index.d.ts | 7982 +++++++ lib/cjs/index.js | 2 + .../services/account-delinquency-service.d.ts | 16 + .../services/account-delinquency-service.js | 34 + lib/cjs/services/account-feature-service.d.ts | 31 + lib/cjs/services/account-feature-service.js | 77 + lib/cjs/services/account-service.d.ts | 51 + lib/cjs/services/account-service.js | 140 + lib/cjs/services/add-on-action-service.d.ts | 24 + lib/cjs/services/add-on-action-service.js | 57 + .../services/add-on-attachment-service.d.ts | 66 + lib/cjs/services/add-on-attachment-service.js | 180 + lib/cjs/services/add-on-config-service.d.ts | 25 + lib/cjs/services/add-on-config-service.js | 58 + .../add-on-region-capability-service.d.ts | 30 + .../add-on-region-capability-service.js | 74 + lib/cjs/services/add-on-service-service.d.ts | 23 + lib/cjs/services/add-on-service-service.js | 54 + lib/cjs/services/add-on-service.d.ts | 84 + lib/cjs/services/add-on-service.js | 226 + .../add-on-webhook-delivery-service.d.ts | 25 + .../add-on-webhook-delivery-service.js | 56 + .../add-on-webhook-event-service.d.ts | 25 + .../services/add-on-webhook-event-service.js | 56 + lib/cjs/services/add-on-webhook-service.d.ts | 50 + lib/cjs/services/add-on-webhook-service.js | 125 + .../allowed-add-on-service-service.d.ts | 33 + .../allowed-add-on-service-service.js | 80 + lib/cjs/services/app-feature-service.d.ts | 34 + lib/cjs/services/app-feature-service.js | 80 + lib/cjs/services/app-service.d.ts | 73 + lib/cjs/services/app-service.js | 203 + lib/cjs/services/app-setup-service.d.ts | 24 + lib/cjs/services/app-setup-service.js | 57 + lib/cjs/services/app-transfer-service.d.ts | 45 + lib/cjs/services/app-transfer-service.js | 120 + .../app-webhook-delivery-service.d.ts | 25 + .../services/app-webhook-delivery-service.js | 56 + .../services/app-webhook-event-service.d.ts | 25 + lib/cjs/services/app-webhook-event-service.js | 56 + lib/cjs/services/app-webhook-service.d.ts | 50 + lib/cjs/services/app-webhook-service.js | 125 + lib/cjs/services/archive-service.d.ts | 27 + lib/cjs/services/archive-service.js | 51 + .../services/audit-trail-event-service.d.ts | 16 + lib/cjs/services/audit-trail-event-service.js | 31 + lib/cjs/services/build-service.d.ts | 48 + lib/cjs/services/build-service.js | 118 + .../buildpack-installation-service.d.ts | 25 + .../buildpack-installation-service.js | 58 + lib/cjs/services/collaborator-service.d.ts | 41 + lib/cjs/services/collaborator-service.js | 101 + lib/cjs/services/config-var-service.d.ts | 32 + lib/cjs/services/config-var-service.js | 79 + lib/cjs/services/credit-service.d.ts | 30 + lib/cjs/services/credit-service.js | 76 + lib/cjs/services/domain-service.d.ts | 50 + lib/cjs/services/domain-service.js | 125 + lib/cjs/services/dyno-service.d.ts | 56 + lib/cjs/services/dyno-service.js | 144 + lib/cjs/services/dyno-size-service.d.ts | 23 + lib/cjs/services/dyno-size-service.js | 54 + ...nterprise-account-daily-usage-service.d.ts | 19 + .../enterprise-account-daily-usage-service.js | 38 + .../enterprise-account-member-service.d.ts | 42 + .../enterprise-account-member-service.js | 104 + ...erprise-account-monthly-usage-service.d.ts | 19 + ...nterprise-account-monthly-usage-service.js | 38 + .../services/enterprise-account-service.d.ts | 31 + .../services/enterprise-account-service.js | 77 + lib/cjs/services/filter-apps-service.d.ts | 17 + lib/cjs/services/filter-apps-service.js | 37 + lib/cjs/services/formation-service.d.ts | 42 + lib/cjs/services/formation-service.js | 103 + .../services/identity-provider-service.d.ts | 48 + lib/cjs/services/identity-provider-service.js | 110 + lib/cjs/services/inbound-ruleset-service.d.ts | 40 + lib/cjs/services/inbound-ruleset-service.js | 99 + lib/cjs/services/index.d.ts | 96 + lib/cjs/services/index.js | 99 + lib/cjs/services/invoice-address-service.d.ts | 23 + lib/cjs/services/invoice-address-service.js | 56 + lib/cjs/services/invoice-service.d.ts | 23 + lib/cjs/services/invoice-service.js | 54 + lib/cjs/services/key-service.d.ts | 23 + lib/cjs/services/key-service.js | 54 + lib/cjs/services/log-drain-service.d.ts | 57 + lib/cjs/services/log-drain-service.js | 145 + lib/cjs/services/log-session-service.d.ts | 18 + lib/cjs/services/log-session-service.js | 38 + .../services/oauth-authorization-service.d.ts | 44 + .../services/oauth-authorization-service.js | 118 + lib/cjs/services/oauth-client-service.d.ts | 52 + lib/cjs/services/oauth-client-service.js | 137 + lib/cjs/services/oauth-grant-service.d.ts | 9 + lib/cjs/services/oauth-grant-service.js | 15 + lib/cjs/services/oauth-token-service.d.ts | 24 + lib/cjs/services/oauth-token-service.js | 58 + lib/cjs/services/password-reset-service.d.ts | 26 + lib/cjs/services/password-reset-service.js | 61 + lib/cjs/services/peering-info-service.d.ts | 17 + lib/cjs/services/peering-info-service.js | 35 + lib/cjs/services/peering-service.d.ts | 44 + lib/cjs/services/peering-service.js | 103 + .../services/permission-entity-service.d.ts | 17 + lib/cjs/services/permission-entity-service.js | 35 + lib/cjs/services/pipeline-build-service.d.ts | 18 + lib/cjs/services/pipeline-build-service.js | 36 + .../services/pipeline-config-var-service.d.ts | 30 + .../services/pipeline-config-var-service.js | 64 + .../services/pipeline-coupling-service.d.ts | 73 + lib/cjs/services/pipeline-coupling-service.js | 200 + .../services/pipeline-deployment-service.d.ts | 18 + .../services/pipeline-deployment-service.js | 36 + .../services/pipeline-promotion-service.d.ts | 24 + .../services/pipeline-promotion-service.js | 57 + .../pipeline-promotion-target-service.d.ts | 18 + .../pipeline-promotion-target-service.js | 36 + .../services/pipeline-release-service.d.ts | 18 + lib/cjs/services/pipeline-release-service.js | 36 + lib/cjs/services/pipeline-service.d.ts | 47 + lib/cjs/services/pipeline-service.js | 122 + lib/cjs/services/pipeline-stack-service.d.ts | 18 + lib/cjs/services/pipeline-stack-service.js | 36 + .../services/pipeline-transfer-service.d.ts | 17 + lib/cjs/services/pipeline-transfer-service.js | 37 + lib/cjs/services/plan-service.d.ts | 32 + lib/cjs/services/plan-service.js | 76 + lib/cjs/services/rate-limit-service.d.ts | 16 + lib/cjs/services/rate-limit-service.js | 34 + lib/cjs/services/region-service.d.ts | 23 + lib/cjs/services/region-service.js | 54 + lib/cjs/services/release-service.d.ts | 41 + lib/cjs/services/release-service.js | 102 + .../services/review-app-config-service.d.ts | 44 + lib/cjs/services/review-app-config-service.js | 106 + lib/cjs/services/review-app-service.d.ts | 46 + lib/cjs/services/review-app-service.js | 119 + lib/cjs/services/slug-service.d.ts | 26 + lib/cjs/services/slug-service.js | 59 + lib/cjs/services/sms-number-service.d.ts | 31 + lib/cjs/services/sms-number-service.js | 77 + lib/cjs/services/sni-endpoint-service.d.ts | 50 + lib/cjs/services/sni-endpoint-service.js | 125 + lib/cjs/services/source-service.d.ts | 23 + lib/cjs/services/source-service.js | 56 + .../services/space-app-access-service.d.ts | 34 + lib/cjs/services/space-app-access-service.js | 80 + lib/cjs/services/space-nat-service.d.ts | 17 + lib/cjs/services/space-nat-service.js | 35 + lib/cjs/services/space-service.d.ts | 45 + lib/cjs/services/space-service.js | 120 + lib/cjs/services/space-topology-service.d.ts | 17 + lib/cjs/services/space-topology-service.js | 35 + lib/cjs/services/space-transfer-service.d.ts | 18 + lib/cjs/services/space-transfer-service.js | 38 + lib/cjs/services/stack-service.d.ts | 23 + lib/cjs/services/stack-service.js | 54 + lib/cjs/services/team-add-on-service.d.ts | 17 + lib/cjs/services/team-add-on-service.js | 35 + .../team-app-collaborator-service.d.ts | 54 + .../services/team-app-collaborator-service.js | 129 + .../services/team-app-permission-service.d.ts | 16 + .../services/team-app-permission-service.js | 34 + lib/cjs/services/team-app-service.d.ts | 59 + lib/cjs/services/team-app-service.js | 146 + .../services/team-daily-usage-service.d.ts | 19 + lib/cjs/services/team-daily-usage-service.js | 38 + .../services/team-delinquency-service.d.ts | 17 + lib/cjs/services/team-delinquency-service.js | 35 + lib/cjs/services/team-feature-service.d.ts | 25 + lib/cjs/services/team-feature-service.js | 56 + lib/cjs/services/team-invitation-service.d.ts | 50 + lib/cjs/services/team-invitation-service.js | 124 + lib/cjs/services/team-invoice-service.d.ts | 25 + lib/cjs/services/team-invoice-service.js | 56 + lib/cjs/services/team-member-service.d.ts | 57 + lib/cjs/services/team-member-service.js | 147 + .../services/team-monthly-usage-service.d.ts | 19 + .../services/team-monthly-usage-service.js | 38 + .../services/team-preferences-service.d.ts | 25 + lib/cjs/services/team-preferences-service.js | 58 + lib/cjs/services/team-service.d.ts | 60 + lib/cjs/services/team-service.js | 163 + lib/cjs/services/team-space-service.d.ts | 17 + lib/cjs/services/team-space-service.js | 35 + lib/cjs/services/test-case-service.d.ts | 16 + lib/cjs/services/test-case-service.js | 35 + lib/cjs/services/test-node-service.d.ts | 16 + lib/cjs/services/test-node-service.js | 35 + lib/cjs/services/test-run-service.d.ts | 49 + lib/cjs/services/test-run-service.js | 107 + .../services/user-preferences-service.d.ts | 25 + lib/cjs/services/user-preferences-service.js | 58 + lib/cjs/services/vpn-connection-service.d.ts | 50 + lib/cjs/services/vpn-connection-service.js | 125 + lib/esm/index.d.ts | 7982 +++++++ lib/esm/index.js | 1 + .../services/account-delinquency-service.d.ts | 16 + .../services/account-delinquency-service.js | 31 + lib/esm/services/account-feature-service.d.ts | 31 + lib/esm/services/account-feature-service.js | 74 + lib/esm/services/account-service.d.ts | 51 + lib/esm/services/account-service.js | 137 + lib/esm/services/add-on-action-service.d.ts | 24 + lib/esm/services/add-on-action-service.js | 54 + .../services/add-on-attachment-service.d.ts | 66 + lib/esm/services/add-on-attachment-service.js | 177 + lib/esm/services/add-on-config-service.d.ts | 25 + lib/esm/services/add-on-config-service.js | 55 + .../add-on-region-capability-service.d.ts | 30 + .../add-on-region-capability-service.js | 71 + lib/esm/services/add-on-service-service.d.ts | 23 + lib/esm/services/add-on-service-service.js | 51 + lib/esm/services/add-on-service.d.ts | 84 + lib/esm/services/add-on-service.js | 223 + .../add-on-webhook-delivery-service.d.ts | 25 + .../add-on-webhook-delivery-service.js | 53 + .../add-on-webhook-event-service.d.ts | 25 + .../services/add-on-webhook-event-service.js | 53 + lib/esm/services/add-on-webhook-service.d.ts | 50 + lib/esm/services/add-on-webhook-service.js | 122 + .../allowed-add-on-service-service.d.ts | 33 + .../allowed-add-on-service-service.js | 77 + lib/esm/services/app-feature-service.d.ts | 34 + lib/esm/services/app-feature-service.js | 77 + lib/esm/services/app-service.d.ts | 73 + lib/esm/services/app-service.js | 200 + lib/esm/services/app-setup-service.d.ts | 24 + lib/esm/services/app-setup-service.js | 54 + lib/esm/services/app-transfer-service.d.ts | 45 + lib/esm/services/app-transfer-service.js | 117 + .../app-webhook-delivery-service.d.ts | 25 + .../services/app-webhook-delivery-service.js | 53 + .../services/app-webhook-event-service.d.ts | 25 + lib/esm/services/app-webhook-event-service.js | 53 + lib/esm/services/app-webhook-service.d.ts | 50 + lib/esm/services/app-webhook-service.js | 122 + lib/esm/services/archive-service.d.ts | 27 + lib/esm/services/archive-service.js | 48 + .../services/audit-trail-event-service.d.ts | 16 + lib/esm/services/audit-trail-event-service.js | 28 + lib/esm/services/build-service.d.ts | 48 + lib/esm/services/build-service.js | 115 + .../buildpack-installation-service.d.ts | 25 + .../buildpack-installation-service.js | 55 + lib/esm/services/collaborator-service.d.ts | 41 + lib/esm/services/collaborator-service.js | 98 + lib/esm/services/config-var-service.d.ts | 32 + lib/esm/services/config-var-service.js | 76 + lib/esm/services/credit-service.d.ts | 30 + lib/esm/services/credit-service.js | 73 + lib/esm/services/domain-service.d.ts | 50 + lib/esm/services/domain-service.js | 122 + lib/esm/services/dyno-service.d.ts | 56 + lib/esm/services/dyno-service.js | 141 + lib/esm/services/dyno-size-service.d.ts | 23 + lib/esm/services/dyno-size-service.js | 51 + ...nterprise-account-daily-usage-service.d.ts | 19 + .../enterprise-account-daily-usage-service.js | 35 + .../enterprise-account-member-service.d.ts | 42 + .../enterprise-account-member-service.js | 101 + ...erprise-account-monthly-usage-service.d.ts | 19 + ...nterprise-account-monthly-usage-service.js | 35 + .../services/enterprise-account-service.d.ts | 31 + .../services/enterprise-account-service.js | 74 + lib/esm/services/filter-apps-service.d.ts | 17 + lib/esm/services/filter-apps-service.js | 34 + lib/esm/services/formation-service.d.ts | 42 + lib/esm/services/formation-service.js | 100 + .../services/identity-provider-service.d.ts | 48 + lib/esm/services/identity-provider-service.js | 107 + lib/esm/services/inbound-ruleset-service.d.ts | 40 + lib/esm/services/inbound-ruleset-service.js | 96 + lib/esm/services/index.d.ts | 96 + lib/esm/services/index.js | 96 + lib/esm/services/invoice-address-service.d.ts | 23 + lib/esm/services/invoice-address-service.js | 53 + lib/esm/services/invoice-service.d.ts | 23 + lib/esm/services/invoice-service.js | 51 + lib/esm/services/key-service.d.ts | 23 + lib/esm/services/key-service.js | 51 + lib/esm/services/log-drain-service.d.ts | 57 + lib/esm/services/log-drain-service.js | 142 + lib/esm/services/log-session-service.d.ts | 18 + lib/esm/services/log-session-service.js | 35 + .../services/oauth-authorization-service.d.ts | 44 + .../services/oauth-authorization-service.js | 115 + lib/esm/services/oauth-client-service.d.ts | 52 + lib/esm/services/oauth-client-service.js | 134 + lib/esm/services/oauth-grant-service.d.ts | 9 + lib/esm/services/oauth-grant-service.js | 12 + lib/esm/services/oauth-token-service.d.ts | 24 + lib/esm/services/oauth-token-service.js | 55 + lib/esm/services/password-reset-service.d.ts | 26 + lib/esm/services/password-reset-service.js | 58 + lib/esm/services/peering-info-service.d.ts | 17 + lib/esm/services/peering-info-service.js | 32 + lib/esm/services/peering-service.d.ts | 44 + lib/esm/services/peering-service.js | 100 + .../services/permission-entity-service.d.ts | 17 + lib/esm/services/permission-entity-service.js | 32 + lib/esm/services/pipeline-build-service.d.ts | 18 + lib/esm/services/pipeline-build-service.js | 33 + .../services/pipeline-config-var-service.d.ts | 30 + .../services/pipeline-config-var-service.js | 61 + .../services/pipeline-coupling-service.d.ts | 73 + lib/esm/services/pipeline-coupling-service.js | 197 + .../services/pipeline-deployment-service.d.ts | 18 + .../services/pipeline-deployment-service.js | 33 + .../services/pipeline-promotion-service.d.ts | 24 + .../services/pipeline-promotion-service.js | 54 + .../pipeline-promotion-target-service.d.ts | 18 + .../pipeline-promotion-target-service.js | 33 + .../services/pipeline-release-service.d.ts | 18 + lib/esm/services/pipeline-release-service.js | 33 + lib/esm/services/pipeline-service.d.ts | 47 + lib/esm/services/pipeline-service.js | 119 + lib/esm/services/pipeline-stack-service.d.ts | 18 + lib/esm/services/pipeline-stack-service.js | 33 + .../services/pipeline-transfer-service.d.ts | 17 + lib/esm/services/pipeline-transfer-service.js | 34 + lib/esm/services/plan-service.d.ts | 32 + lib/esm/services/plan-service.js | 73 + lib/esm/services/rate-limit-service.d.ts | 16 + lib/esm/services/rate-limit-service.js | 31 + lib/esm/services/region-service.d.ts | 23 + lib/esm/services/region-service.js | 51 + lib/esm/services/release-service.d.ts | 41 + lib/esm/services/release-service.js | 99 + .../services/review-app-config-service.d.ts | 44 + lib/esm/services/review-app-config-service.js | 103 + lib/esm/services/review-app-service.d.ts | 46 + lib/esm/services/review-app-service.js | 116 + lib/esm/services/slug-service.d.ts | 26 + lib/esm/services/slug-service.js | 56 + lib/esm/services/sms-number-service.d.ts | 31 + lib/esm/services/sms-number-service.js | 74 + lib/esm/services/sni-endpoint-service.d.ts | 50 + lib/esm/services/sni-endpoint-service.js | 122 + lib/esm/services/source-service.d.ts | 23 + lib/esm/services/source-service.js | 53 + .../services/space-app-access-service.d.ts | 34 + lib/esm/services/space-app-access-service.js | 77 + lib/esm/services/space-nat-service.d.ts | 17 + lib/esm/services/space-nat-service.js | 32 + lib/esm/services/space-service.d.ts | 45 + lib/esm/services/space-service.js | 117 + lib/esm/services/space-topology-service.d.ts | 17 + lib/esm/services/space-topology-service.js | 32 + lib/esm/services/space-transfer-service.d.ts | 18 + lib/esm/services/space-transfer-service.js | 35 + lib/esm/services/stack-service.d.ts | 23 + lib/esm/services/stack-service.js | 51 + lib/esm/services/team-add-on-service.d.ts | 17 + lib/esm/services/team-add-on-service.js | 32 + .../team-app-collaborator-service.d.ts | 54 + .../services/team-app-collaborator-service.js | 126 + .../services/team-app-permission-service.d.ts | 16 + .../services/team-app-permission-service.js | 31 + lib/esm/services/team-app-service.d.ts | 59 + lib/esm/services/team-app-service.js | 143 + .../services/team-daily-usage-service.d.ts | 19 + lib/esm/services/team-daily-usage-service.js | 35 + .../services/team-delinquency-service.d.ts | 17 + lib/esm/services/team-delinquency-service.js | 32 + lib/esm/services/team-feature-service.d.ts | 25 + lib/esm/services/team-feature-service.js | 53 + lib/esm/services/team-invitation-service.d.ts | 50 + lib/esm/services/team-invitation-service.js | 121 + lib/esm/services/team-invoice-service.d.ts | 25 + lib/esm/services/team-invoice-service.js | 53 + lib/esm/services/team-member-service.d.ts | 57 + lib/esm/services/team-member-service.js | 144 + .../services/team-monthly-usage-service.d.ts | 19 + .../services/team-monthly-usage-service.js | 35 + .../services/team-preferences-service.d.ts | 25 + lib/esm/services/team-preferences-service.js | 55 + lib/esm/services/team-service.d.ts | 60 + lib/esm/services/team-service.js | 160 + lib/esm/services/team-space-service.d.ts | 17 + lib/esm/services/team-space-service.js | 32 + lib/esm/services/test-case-service.d.ts | 16 + lib/esm/services/test-case-service.js | 32 + lib/esm/services/test-node-service.d.ts | 16 + lib/esm/services/test-node-service.js | 32 + lib/esm/services/test-run-service.d.ts | 49 + lib/esm/services/test-run-service.js | 104 + .../services/user-preferences-service.d.ts | 25 + lib/esm/services/user-preferences-service.js | 55 + lib/esm/services/vpn-connection-service.d.ts | 50 + lib/esm/services/vpn-connection-service.js | 122 + lib/index.d.ts | 5107 ----- package-lock.json | 5725 +++++ package.json | 34 +- schema-builder.mjs | 465 + schema.json | 17591 ++++++++++++++++ src/index.ts | 7984 +++++++ src/services/account-delinquency-service.ts | 32 + src/services/account-feature-service.ts | 83 + src/services/account-service.ts | 154 + src/services/add-on-action-service.ts | 62 + src/services/add-on-attachment-service.ts | 208 + src/services/add-on-config-service.ts | 63 + .../add-on-region-capability-service.ts | 83 + src/services/add-on-service-service.ts | 56 + src/services/add-on-service.ts | 262 + .../add-on-webhook-delivery-service.ts | 65 + src/services/add-on-webhook-event-service.ts | 65 + src/services/add-on-webhook-service.ts | 145 + .../allowed-add-on-service-service.ts | 93 + src/services/app-feature-service.ts | 91 + src/services/app-service.ts | 229 + src/services/app-setup-service.ts | 61 + src/services/app-transfer-service.ts | 133 + src/services/app-webhook-delivery-service.ts | 65 + src/services/app-webhook-event-service.ts | 65 + src/services/app-webhook-service.ts | 145 + src/services/archive-service.ts | 57 + src/services/audit-trail-event-service.ts | 31 + src/services/build-service.ts | 134 + .../buildpack-installation-service.ts | 63 + src/services/collaborator-service.ts | 122 + src/services/config-var-service.ts | 91 + src/services/credit-service.ts | 81 + src/services/domain-service.ts | 145 + src/services/dyno-service.ts | 168 + src/services/dyno-size-service.ts | 56 + .../enterprise-account-daily-usage-service.ts | 39 + .../enterprise-account-member-service.ts | 125 + ...nterprise-account-monthly-usage-service.ts | 39 + src/services/enterprise-account-service.ts | 83 + src/services/filter-apps-service.ts | 37 + src/services/formation-service.ts | 118 + src/services/identity-provider-service.ts | 131 + src/services/inbound-ruleset-service.ts | 116 + src/services/index.ts | 96 + src/services/invoice-address-service.ts | 57 + src/services/invoice-service.ts | 56 + src/services/key-service.ts | 53 + src/services/log-drain-service.ts | 172 + src/services/log-session-service.ts | 39 + src/services/oauth-authorization-service.ts | 134 + src/services/oauth-client-service.ts | 157 + src/services/oauth-grant-service.ts | 10 + src/services/oauth-token-service.ts | 62 + src/services/password-reset-service.ts | 68 + src/services/peering-info-service.ts | 36 + src/services/peering-service.ts | 122 + src/services/permission-entity-service.ts | 36 + src/services/pipeline-build-service.ts | 37 + src/services/pipeline-config-var-service.ts | 76 + src/services/pipeline-coupling-service.ts | 228 + src/services/pipeline-deployment-service.ts | 37 + src/services/pipeline-promotion-service.ts | 61 + .../pipeline-promotion-target-service.ts | 40 + src/services/pipeline-release-service.ts | 37 + src/services/pipeline-service.ts | 135 + src/services/pipeline-stack-service.ts | 37 + src/services/pipeline-transfer-service.ts | 37 + src/services/plan-service.ts | 89 + src/services/rate-limit-service.ts | 32 + src/services/region-service.ts | 56 + src/services/release-service.ts | 116 + src/services/review-app-config-service.ts | 119 + src/services/review-app-service.ts | 135 + src/services/slug-service.ts | 65 + src/services/sms-number-service.ts | 86 + src/services/sni-endpoint-service.ts | 145 + src/services/source-service.ts | 58 + src/services/space-app-access-service.ts | 91 + src/services/space-nat-service.ts | 36 + src/services/space-service.ts | 133 + src/services/space-topology-service.ts | 36 + src/services/space-transfer-service.ts | 39 + src/services/stack-service.ts | 56 + src/services/team-add-on-service.ts | 36 + src/services/team-app-collaborator-service.ts | 158 + src/services/team-app-permission-service.ts | 32 + src/services/team-app-service.ts | 166 + src/services/team-daily-usage-service.ts | 39 + src/services/team-delinquency-service.ts | 36 + src/services/team-feature-service.ts | 62 + src/services/team-invitation-service.ts | 145 + src/services/team-invoice-service.ts | 62 + src/services/team-member-service.ts | 170 + src/services/team-monthly-usage-service.ts | 39 + src/services/team-preferences-service.ts | 63 + src/services/team-service.ts | 184 + src/services/team-space-service.ts | 36 + src/services/test-case-service.ts | 35 + src/services/test-node-service.ts | 35 + src/services/test-run-service.ts | 121 + src/services/user-preferences-service.ts | 63 + src/services/vpn-connection-service.ts | 154 + tsconfig.json | 11 +- tslint.json | 3 - yarn.lock | 2291 -- 503 files changed, 77846 insertions(+), 7493 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .prettier.mjs create mode 100644 lib/cjs/index.d.ts create mode 100644 lib/cjs/index.js create mode 100644 lib/cjs/services/account-delinquency-service.d.ts create mode 100644 lib/cjs/services/account-delinquency-service.js create mode 100644 lib/cjs/services/account-feature-service.d.ts create mode 100644 lib/cjs/services/account-feature-service.js create mode 100644 lib/cjs/services/account-service.d.ts create mode 100644 lib/cjs/services/account-service.js create mode 100644 lib/cjs/services/add-on-action-service.d.ts create mode 100644 lib/cjs/services/add-on-action-service.js create mode 100644 lib/cjs/services/add-on-attachment-service.d.ts create mode 100644 lib/cjs/services/add-on-attachment-service.js create mode 100644 lib/cjs/services/add-on-config-service.d.ts create mode 100644 lib/cjs/services/add-on-config-service.js create mode 100644 lib/cjs/services/add-on-region-capability-service.d.ts create mode 100644 lib/cjs/services/add-on-region-capability-service.js create mode 100644 lib/cjs/services/add-on-service-service.d.ts create mode 100644 lib/cjs/services/add-on-service-service.js create mode 100644 lib/cjs/services/add-on-service.d.ts create mode 100644 lib/cjs/services/add-on-service.js create mode 100644 lib/cjs/services/add-on-webhook-delivery-service.d.ts create mode 100644 lib/cjs/services/add-on-webhook-delivery-service.js create mode 100644 lib/cjs/services/add-on-webhook-event-service.d.ts create mode 100644 lib/cjs/services/add-on-webhook-event-service.js create mode 100644 lib/cjs/services/add-on-webhook-service.d.ts create mode 100644 lib/cjs/services/add-on-webhook-service.js create mode 100644 lib/cjs/services/allowed-add-on-service-service.d.ts create mode 100644 lib/cjs/services/allowed-add-on-service-service.js create mode 100644 lib/cjs/services/app-feature-service.d.ts create mode 100644 lib/cjs/services/app-feature-service.js create mode 100644 lib/cjs/services/app-service.d.ts create mode 100644 lib/cjs/services/app-service.js create mode 100644 lib/cjs/services/app-setup-service.d.ts create mode 100644 lib/cjs/services/app-setup-service.js create mode 100644 lib/cjs/services/app-transfer-service.d.ts create mode 100644 lib/cjs/services/app-transfer-service.js create mode 100644 lib/cjs/services/app-webhook-delivery-service.d.ts create mode 100644 lib/cjs/services/app-webhook-delivery-service.js create mode 100644 lib/cjs/services/app-webhook-event-service.d.ts create mode 100644 lib/cjs/services/app-webhook-event-service.js create mode 100644 lib/cjs/services/app-webhook-service.d.ts create mode 100644 lib/cjs/services/app-webhook-service.js create mode 100644 lib/cjs/services/archive-service.d.ts create mode 100644 lib/cjs/services/archive-service.js create mode 100644 lib/cjs/services/audit-trail-event-service.d.ts create mode 100644 lib/cjs/services/audit-trail-event-service.js create mode 100644 lib/cjs/services/build-service.d.ts create mode 100644 lib/cjs/services/build-service.js create mode 100644 lib/cjs/services/buildpack-installation-service.d.ts create mode 100644 lib/cjs/services/buildpack-installation-service.js create mode 100644 lib/cjs/services/collaborator-service.d.ts create mode 100644 lib/cjs/services/collaborator-service.js create mode 100644 lib/cjs/services/config-var-service.d.ts create mode 100644 lib/cjs/services/config-var-service.js create mode 100644 lib/cjs/services/credit-service.d.ts create mode 100644 lib/cjs/services/credit-service.js create mode 100644 lib/cjs/services/domain-service.d.ts create mode 100644 lib/cjs/services/domain-service.js create mode 100644 lib/cjs/services/dyno-service.d.ts create mode 100644 lib/cjs/services/dyno-service.js create mode 100644 lib/cjs/services/dyno-size-service.d.ts create mode 100644 lib/cjs/services/dyno-size-service.js create mode 100644 lib/cjs/services/enterprise-account-daily-usage-service.d.ts create mode 100644 lib/cjs/services/enterprise-account-daily-usage-service.js create mode 100644 lib/cjs/services/enterprise-account-member-service.d.ts create mode 100644 lib/cjs/services/enterprise-account-member-service.js create mode 100644 lib/cjs/services/enterprise-account-monthly-usage-service.d.ts create mode 100644 lib/cjs/services/enterprise-account-monthly-usage-service.js create mode 100644 lib/cjs/services/enterprise-account-service.d.ts create mode 100644 lib/cjs/services/enterprise-account-service.js create mode 100644 lib/cjs/services/filter-apps-service.d.ts create mode 100644 lib/cjs/services/filter-apps-service.js create mode 100644 lib/cjs/services/formation-service.d.ts create mode 100644 lib/cjs/services/formation-service.js create mode 100644 lib/cjs/services/identity-provider-service.d.ts create mode 100644 lib/cjs/services/identity-provider-service.js create mode 100644 lib/cjs/services/inbound-ruleset-service.d.ts create mode 100644 lib/cjs/services/inbound-ruleset-service.js create mode 100644 lib/cjs/services/index.d.ts create mode 100644 lib/cjs/services/index.js create mode 100644 lib/cjs/services/invoice-address-service.d.ts create mode 100644 lib/cjs/services/invoice-address-service.js create mode 100644 lib/cjs/services/invoice-service.d.ts create mode 100644 lib/cjs/services/invoice-service.js create mode 100644 lib/cjs/services/key-service.d.ts create mode 100644 lib/cjs/services/key-service.js create mode 100644 lib/cjs/services/log-drain-service.d.ts create mode 100644 lib/cjs/services/log-drain-service.js create mode 100644 lib/cjs/services/log-session-service.d.ts create mode 100644 lib/cjs/services/log-session-service.js create mode 100644 lib/cjs/services/oauth-authorization-service.d.ts create mode 100644 lib/cjs/services/oauth-authorization-service.js create mode 100644 lib/cjs/services/oauth-client-service.d.ts create mode 100644 lib/cjs/services/oauth-client-service.js create mode 100644 lib/cjs/services/oauth-grant-service.d.ts create mode 100644 lib/cjs/services/oauth-grant-service.js create mode 100644 lib/cjs/services/oauth-token-service.d.ts create mode 100644 lib/cjs/services/oauth-token-service.js create mode 100644 lib/cjs/services/password-reset-service.d.ts create mode 100644 lib/cjs/services/password-reset-service.js create mode 100644 lib/cjs/services/peering-info-service.d.ts create mode 100644 lib/cjs/services/peering-info-service.js create mode 100644 lib/cjs/services/peering-service.d.ts create mode 100644 lib/cjs/services/peering-service.js create mode 100644 lib/cjs/services/permission-entity-service.d.ts create mode 100644 lib/cjs/services/permission-entity-service.js create mode 100644 lib/cjs/services/pipeline-build-service.d.ts create mode 100644 lib/cjs/services/pipeline-build-service.js create mode 100644 lib/cjs/services/pipeline-config-var-service.d.ts create mode 100644 lib/cjs/services/pipeline-config-var-service.js create mode 100644 lib/cjs/services/pipeline-coupling-service.d.ts create mode 100644 lib/cjs/services/pipeline-coupling-service.js create mode 100644 lib/cjs/services/pipeline-deployment-service.d.ts create mode 100644 lib/cjs/services/pipeline-deployment-service.js create mode 100644 lib/cjs/services/pipeline-promotion-service.d.ts create mode 100644 lib/cjs/services/pipeline-promotion-service.js create mode 100644 lib/cjs/services/pipeline-promotion-target-service.d.ts create mode 100644 lib/cjs/services/pipeline-promotion-target-service.js create mode 100644 lib/cjs/services/pipeline-release-service.d.ts create mode 100644 lib/cjs/services/pipeline-release-service.js create mode 100644 lib/cjs/services/pipeline-service.d.ts create mode 100644 lib/cjs/services/pipeline-service.js create mode 100644 lib/cjs/services/pipeline-stack-service.d.ts create mode 100644 lib/cjs/services/pipeline-stack-service.js create mode 100644 lib/cjs/services/pipeline-transfer-service.d.ts create mode 100644 lib/cjs/services/pipeline-transfer-service.js create mode 100644 lib/cjs/services/plan-service.d.ts create mode 100644 lib/cjs/services/plan-service.js create mode 100644 lib/cjs/services/rate-limit-service.d.ts create mode 100644 lib/cjs/services/rate-limit-service.js create mode 100644 lib/cjs/services/region-service.d.ts create mode 100644 lib/cjs/services/region-service.js create mode 100644 lib/cjs/services/release-service.d.ts create mode 100644 lib/cjs/services/release-service.js create mode 100644 lib/cjs/services/review-app-config-service.d.ts create mode 100644 lib/cjs/services/review-app-config-service.js create mode 100644 lib/cjs/services/review-app-service.d.ts create mode 100644 lib/cjs/services/review-app-service.js create mode 100644 lib/cjs/services/slug-service.d.ts create mode 100644 lib/cjs/services/slug-service.js create mode 100644 lib/cjs/services/sms-number-service.d.ts create mode 100644 lib/cjs/services/sms-number-service.js create mode 100644 lib/cjs/services/sni-endpoint-service.d.ts create mode 100644 lib/cjs/services/sni-endpoint-service.js create mode 100644 lib/cjs/services/source-service.d.ts create mode 100644 lib/cjs/services/source-service.js create mode 100644 lib/cjs/services/space-app-access-service.d.ts create mode 100644 lib/cjs/services/space-app-access-service.js create mode 100644 lib/cjs/services/space-nat-service.d.ts create mode 100644 lib/cjs/services/space-nat-service.js create mode 100644 lib/cjs/services/space-service.d.ts create mode 100644 lib/cjs/services/space-service.js create mode 100644 lib/cjs/services/space-topology-service.d.ts create mode 100644 lib/cjs/services/space-topology-service.js create mode 100644 lib/cjs/services/space-transfer-service.d.ts create mode 100644 lib/cjs/services/space-transfer-service.js create mode 100644 lib/cjs/services/stack-service.d.ts create mode 100644 lib/cjs/services/stack-service.js create mode 100644 lib/cjs/services/team-add-on-service.d.ts create mode 100644 lib/cjs/services/team-add-on-service.js create mode 100644 lib/cjs/services/team-app-collaborator-service.d.ts create mode 100644 lib/cjs/services/team-app-collaborator-service.js create mode 100644 lib/cjs/services/team-app-permission-service.d.ts create mode 100644 lib/cjs/services/team-app-permission-service.js create mode 100644 lib/cjs/services/team-app-service.d.ts create mode 100644 lib/cjs/services/team-app-service.js create mode 100644 lib/cjs/services/team-daily-usage-service.d.ts create mode 100644 lib/cjs/services/team-daily-usage-service.js create mode 100644 lib/cjs/services/team-delinquency-service.d.ts create mode 100644 lib/cjs/services/team-delinquency-service.js create mode 100644 lib/cjs/services/team-feature-service.d.ts create mode 100644 lib/cjs/services/team-feature-service.js create mode 100644 lib/cjs/services/team-invitation-service.d.ts create mode 100644 lib/cjs/services/team-invitation-service.js create mode 100644 lib/cjs/services/team-invoice-service.d.ts create mode 100644 lib/cjs/services/team-invoice-service.js create mode 100644 lib/cjs/services/team-member-service.d.ts create mode 100644 lib/cjs/services/team-member-service.js create mode 100644 lib/cjs/services/team-monthly-usage-service.d.ts create mode 100644 lib/cjs/services/team-monthly-usage-service.js create mode 100644 lib/cjs/services/team-preferences-service.d.ts create mode 100644 lib/cjs/services/team-preferences-service.js create mode 100644 lib/cjs/services/team-service.d.ts create mode 100644 lib/cjs/services/team-service.js create mode 100644 lib/cjs/services/team-space-service.d.ts create mode 100644 lib/cjs/services/team-space-service.js create mode 100644 lib/cjs/services/test-case-service.d.ts create mode 100644 lib/cjs/services/test-case-service.js create mode 100644 lib/cjs/services/test-node-service.d.ts create mode 100644 lib/cjs/services/test-node-service.js create mode 100644 lib/cjs/services/test-run-service.d.ts create mode 100644 lib/cjs/services/test-run-service.js create mode 100644 lib/cjs/services/user-preferences-service.d.ts create mode 100644 lib/cjs/services/user-preferences-service.js create mode 100644 lib/cjs/services/vpn-connection-service.d.ts create mode 100644 lib/cjs/services/vpn-connection-service.js create mode 100644 lib/esm/index.d.ts create mode 100644 lib/esm/index.js create mode 100644 lib/esm/services/account-delinquency-service.d.ts create mode 100644 lib/esm/services/account-delinquency-service.js create mode 100644 lib/esm/services/account-feature-service.d.ts create mode 100644 lib/esm/services/account-feature-service.js create mode 100644 lib/esm/services/account-service.d.ts create mode 100644 lib/esm/services/account-service.js create mode 100644 lib/esm/services/add-on-action-service.d.ts create mode 100644 lib/esm/services/add-on-action-service.js create mode 100644 lib/esm/services/add-on-attachment-service.d.ts create mode 100644 lib/esm/services/add-on-attachment-service.js create mode 100644 lib/esm/services/add-on-config-service.d.ts create mode 100644 lib/esm/services/add-on-config-service.js create mode 100644 lib/esm/services/add-on-region-capability-service.d.ts create mode 100644 lib/esm/services/add-on-region-capability-service.js create mode 100644 lib/esm/services/add-on-service-service.d.ts create mode 100644 lib/esm/services/add-on-service-service.js create mode 100644 lib/esm/services/add-on-service.d.ts create mode 100644 lib/esm/services/add-on-service.js create mode 100644 lib/esm/services/add-on-webhook-delivery-service.d.ts create mode 100644 lib/esm/services/add-on-webhook-delivery-service.js create mode 100644 lib/esm/services/add-on-webhook-event-service.d.ts create mode 100644 lib/esm/services/add-on-webhook-event-service.js create mode 100644 lib/esm/services/add-on-webhook-service.d.ts create mode 100644 lib/esm/services/add-on-webhook-service.js create mode 100644 lib/esm/services/allowed-add-on-service-service.d.ts create mode 100644 lib/esm/services/allowed-add-on-service-service.js create mode 100644 lib/esm/services/app-feature-service.d.ts create mode 100644 lib/esm/services/app-feature-service.js create mode 100644 lib/esm/services/app-service.d.ts create mode 100644 lib/esm/services/app-service.js create mode 100644 lib/esm/services/app-setup-service.d.ts create mode 100644 lib/esm/services/app-setup-service.js create mode 100644 lib/esm/services/app-transfer-service.d.ts create mode 100644 lib/esm/services/app-transfer-service.js create mode 100644 lib/esm/services/app-webhook-delivery-service.d.ts create mode 100644 lib/esm/services/app-webhook-delivery-service.js create mode 100644 lib/esm/services/app-webhook-event-service.d.ts create mode 100644 lib/esm/services/app-webhook-event-service.js create mode 100644 lib/esm/services/app-webhook-service.d.ts create mode 100644 lib/esm/services/app-webhook-service.js create mode 100644 lib/esm/services/archive-service.d.ts create mode 100644 lib/esm/services/archive-service.js create mode 100644 lib/esm/services/audit-trail-event-service.d.ts create mode 100644 lib/esm/services/audit-trail-event-service.js create mode 100644 lib/esm/services/build-service.d.ts create mode 100644 lib/esm/services/build-service.js create mode 100644 lib/esm/services/buildpack-installation-service.d.ts create mode 100644 lib/esm/services/buildpack-installation-service.js create mode 100644 lib/esm/services/collaborator-service.d.ts create mode 100644 lib/esm/services/collaborator-service.js create mode 100644 lib/esm/services/config-var-service.d.ts create mode 100644 lib/esm/services/config-var-service.js create mode 100644 lib/esm/services/credit-service.d.ts create mode 100644 lib/esm/services/credit-service.js create mode 100644 lib/esm/services/domain-service.d.ts create mode 100644 lib/esm/services/domain-service.js create mode 100644 lib/esm/services/dyno-service.d.ts create mode 100644 lib/esm/services/dyno-service.js create mode 100644 lib/esm/services/dyno-size-service.d.ts create mode 100644 lib/esm/services/dyno-size-service.js create mode 100644 lib/esm/services/enterprise-account-daily-usage-service.d.ts create mode 100644 lib/esm/services/enterprise-account-daily-usage-service.js create mode 100644 lib/esm/services/enterprise-account-member-service.d.ts create mode 100644 lib/esm/services/enterprise-account-member-service.js create mode 100644 lib/esm/services/enterprise-account-monthly-usage-service.d.ts create mode 100644 lib/esm/services/enterprise-account-monthly-usage-service.js create mode 100644 lib/esm/services/enterprise-account-service.d.ts create mode 100644 lib/esm/services/enterprise-account-service.js create mode 100644 lib/esm/services/filter-apps-service.d.ts create mode 100644 lib/esm/services/filter-apps-service.js create mode 100644 lib/esm/services/formation-service.d.ts create mode 100644 lib/esm/services/formation-service.js create mode 100644 lib/esm/services/identity-provider-service.d.ts create mode 100644 lib/esm/services/identity-provider-service.js create mode 100644 lib/esm/services/inbound-ruleset-service.d.ts create mode 100644 lib/esm/services/inbound-ruleset-service.js create mode 100644 lib/esm/services/index.d.ts create mode 100644 lib/esm/services/index.js create mode 100644 lib/esm/services/invoice-address-service.d.ts create mode 100644 lib/esm/services/invoice-address-service.js create mode 100644 lib/esm/services/invoice-service.d.ts create mode 100644 lib/esm/services/invoice-service.js create mode 100644 lib/esm/services/key-service.d.ts create mode 100644 lib/esm/services/key-service.js create mode 100644 lib/esm/services/log-drain-service.d.ts create mode 100644 lib/esm/services/log-drain-service.js create mode 100644 lib/esm/services/log-session-service.d.ts create mode 100644 lib/esm/services/log-session-service.js create mode 100644 lib/esm/services/oauth-authorization-service.d.ts create mode 100644 lib/esm/services/oauth-authorization-service.js create mode 100644 lib/esm/services/oauth-client-service.d.ts create mode 100644 lib/esm/services/oauth-client-service.js create mode 100644 lib/esm/services/oauth-grant-service.d.ts create mode 100644 lib/esm/services/oauth-grant-service.js create mode 100644 lib/esm/services/oauth-token-service.d.ts create mode 100644 lib/esm/services/oauth-token-service.js create mode 100644 lib/esm/services/password-reset-service.d.ts create mode 100644 lib/esm/services/password-reset-service.js create mode 100644 lib/esm/services/peering-info-service.d.ts create mode 100644 lib/esm/services/peering-info-service.js create mode 100644 lib/esm/services/peering-service.d.ts create mode 100644 lib/esm/services/peering-service.js create mode 100644 lib/esm/services/permission-entity-service.d.ts create mode 100644 lib/esm/services/permission-entity-service.js create mode 100644 lib/esm/services/pipeline-build-service.d.ts create mode 100644 lib/esm/services/pipeline-build-service.js create mode 100644 lib/esm/services/pipeline-config-var-service.d.ts create mode 100644 lib/esm/services/pipeline-config-var-service.js create mode 100644 lib/esm/services/pipeline-coupling-service.d.ts create mode 100644 lib/esm/services/pipeline-coupling-service.js create mode 100644 lib/esm/services/pipeline-deployment-service.d.ts create mode 100644 lib/esm/services/pipeline-deployment-service.js create mode 100644 lib/esm/services/pipeline-promotion-service.d.ts create mode 100644 lib/esm/services/pipeline-promotion-service.js create mode 100644 lib/esm/services/pipeline-promotion-target-service.d.ts create mode 100644 lib/esm/services/pipeline-promotion-target-service.js create mode 100644 lib/esm/services/pipeline-release-service.d.ts create mode 100644 lib/esm/services/pipeline-release-service.js create mode 100644 lib/esm/services/pipeline-service.d.ts create mode 100644 lib/esm/services/pipeline-service.js create mode 100644 lib/esm/services/pipeline-stack-service.d.ts create mode 100644 lib/esm/services/pipeline-stack-service.js create mode 100644 lib/esm/services/pipeline-transfer-service.d.ts create mode 100644 lib/esm/services/pipeline-transfer-service.js create mode 100644 lib/esm/services/plan-service.d.ts create mode 100644 lib/esm/services/plan-service.js create mode 100644 lib/esm/services/rate-limit-service.d.ts create mode 100644 lib/esm/services/rate-limit-service.js create mode 100644 lib/esm/services/region-service.d.ts create mode 100644 lib/esm/services/region-service.js create mode 100644 lib/esm/services/release-service.d.ts create mode 100644 lib/esm/services/release-service.js create mode 100644 lib/esm/services/review-app-config-service.d.ts create mode 100644 lib/esm/services/review-app-config-service.js create mode 100644 lib/esm/services/review-app-service.d.ts create mode 100644 lib/esm/services/review-app-service.js create mode 100644 lib/esm/services/slug-service.d.ts create mode 100644 lib/esm/services/slug-service.js create mode 100644 lib/esm/services/sms-number-service.d.ts create mode 100644 lib/esm/services/sms-number-service.js create mode 100644 lib/esm/services/sni-endpoint-service.d.ts create mode 100644 lib/esm/services/sni-endpoint-service.js create mode 100644 lib/esm/services/source-service.d.ts create mode 100644 lib/esm/services/source-service.js create mode 100644 lib/esm/services/space-app-access-service.d.ts create mode 100644 lib/esm/services/space-app-access-service.js create mode 100644 lib/esm/services/space-nat-service.d.ts create mode 100644 lib/esm/services/space-nat-service.js create mode 100644 lib/esm/services/space-service.d.ts create mode 100644 lib/esm/services/space-service.js create mode 100644 lib/esm/services/space-topology-service.d.ts create mode 100644 lib/esm/services/space-topology-service.js create mode 100644 lib/esm/services/space-transfer-service.d.ts create mode 100644 lib/esm/services/space-transfer-service.js create mode 100644 lib/esm/services/stack-service.d.ts create mode 100644 lib/esm/services/stack-service.js create mode 100644 lib/esm/services/team-add-on-service.d.ts create mode 100644 lib/esm/services/team-add-on-service.js create mode 100644 lib/esm/services/team-app-collaborator-service.d.ts create mode 100644 lib/esm/services/team-app-collaborator-service.js create mode 100644 lib/esm/services/team-app-permission-service.d.ts create mode 100644 lib/esm/services/team-app-permission-service.js create mode 100644 lib/esm/services/team-app-service.d.ts create mode 100644 lib/esm/services/team-app-service.js create mode 100644 lib/esm/services/team-daily-usage-service.d.ts create mode 100644 lib/esm/services/team-daily-usage-service.js create mode 100644 lib/esm/services/team-delinquency-service.d.ts create mode 100644 lib/esm/services/team-delinquency-service.js create mode 100644 lib/esm/services/team-feature-service.d.ts create mode 100644 lib/esm/services/team-feature-service.js create mode 100644 lib/esm/services/team-invitation-service.d.ts create mode 100644 lib/esm/services/team-invitation-service.js create mode 100644 lib/esm/services/team-invoice-service.d.ts create mode 100644 lib/esm/services/team-invoice-service.js create mode 100644 lib/esm/services/team-member-service.d.ts create mode 100644 lib/esm/services/team-member-service.js create mode 100644 lib/esm/services/team-monthly-usage-service.d.ts create mode 100644 lib/esm/services/team-monthly-usage-service.js create mode 100644 lib/esm/services/team-preferences-service.d.ts create mode 100644 lib/esm/services/team-preferences-service.js create mode 100644 lib/esm/services/team-service.d.ts create mode 100644 lib/esm/services/team-service.js create mode 100644 lib/esm/services/team-space-service.d.ts create mode 100644 lib/esm/services/team-space-service.js create mode 100644 lib/esm/services/test-case-service.d.ts create mode 100644 lib/esm/services/test-case-service.js create mode 100644 lib/esm/services/test-node-service.d.ts create mode 100644 lib/esm/services/test-node-service.js create mode 100644 lib/esm/services/test-run-service.d.ts create mode 100644 lib/esm/services/test-run-service.js create mode 100644 lib/esm/services/user-preferences-service.d.ts create mode 100644 lib/esm/services/user-preferences-service.js create mode 100644 lib/esm/services/vpn-connection-service.d.ts create mode 100644 lib/esm/services/vpn-connection-service.js delete mode 100644 lib/index.d.ts create mode 100644 package-lock.json create mode 100644 schema-builder.mjs create mode 100644 schema.json create mode 100644 src/index.ts create mode 100644 src/services/account-delinquency-service.ts create mode 100644 src/services/account-feature-service.ts create mode 100644 src/services/account-service.ts create mode 100644 src/services/add-on-action-service.ts create mode 100644 src/services/add-on-attachment-service.ts create mode 100644 src/services/add-on-config-service.ts create mode 100644 src/services/add-on-region-capability-service.ts create mode 100644 src/services/add-on-service-service.ts create mode 100644 src/services/add-on-service.ts create mode 100644 src/services/add-on-webhook-delivery-service.ts create mode 100644 src/services/add-on-webhook-event-service.ts create mode 100644 src/services/add-on-webhook-service.ts create mode 100644 src/services/allowed-add-on-service-service.ts create mode 100644 src/services/app-feature-service.ts create mode 100644 src/services/app-service.ts create mode 100644 src/services/app-setup-service.ts create mode 100644 src/services/app-transfer-service.ts create mode 100644 src/services/app-webhook-delivery-service.ts create mode 100644 src/services/app-webhook-event-service.ts create mode 100644 src/services/app-webhook-service.ts create mode 100644 src/services/archive-service.ts create mode 100644 src/services/audit-trail-event-service.ts create mode 100644 src/services/build-service.ts create mode 100644 src/services/buildpack-installation-service.ts create mode 100644 src/services/collaborator-service.ts create mode 100644 src/services/config-var-service.ts create mode 100644 src/services/credit-service.ts create mode 100644 src/services/domain-service.ts create mode 100644 src/services/dyno-service.ts create mode 100644 src/services/dyno-size-service.ts create mode 100644 src/services/enterprise-account-daily-usage-service.ts create mode 100644 src/services/enterprise-account-member-service.ts create mode 100644 src/services/enterprise-account-monthly-usage-service.ts create mode 100644 src/services/enterprise-account-service.ts create mode 100644 src/services/filter-apps-service.ts create mode 100644 src/services/formation-service.ts create mode 100644 src/services/identity-provider-service.ts create mode 100644 src/services/inbound-ruleset-service.ts create mode 100644 src/services/index.ts create mode 100644 src/services/invoice-address-service.ts create mode 100644 src/services/invoice-service.ts create mode 100644 src/services/key-service.ts create mode 100644 src/services/log-drain-service.ts create mode 100644 src/services/log-session-service.ts create mode 100644 src/services/oauth-authorization-service.ts create mode 100644 src/services/oauth-client-service.ts create mode 100644 src/services/oauth-grant-service.ts create mode 100644 src/services/oauth-token-service.ts create mode 100644 src/services/password-reset-service.ts create mode 100644 src/services/peering-info-service.ts create mode 100644 src/services/peering-service.ts create mode 100644 src/services/permission-entity-service.ts create mode 100644 src/services/pipeline-build-service.ts create mode 100644 src/services/pipeline-config-var-service.ts create mode 100644 src/services/pipeline-coupling-service.ts create mode 100644 src/services/pipeline-deployment-service.ts create mode 100644 src/services/pipeline-promotion-service.ts create mode 100644 src/services/pipeline-promotion-target-service.ts create mode 100644 src/services/pipeline-release-service.ts create mode 100644 src/services/pipeline-service.ts create mode 100644 src/services/pipeline-stack-service.ts create mode 100644 src/services/pipeline-transfer-service.ts create mode 100644 src/services/plan-service.ts create mode 100644 src/services/rate-limit-service.ts create mode 100644 src/services/region-service.ts create mode 100644 src/services/release-service.ts create mode 100644 src/services/review-app-config-service.ts create mode 100644 src/services/review-app-service.ts create mode 100644 src/services/slug-service.ts create mode 100644 src/services/sms-number-service.ts create mode 100644 src/services/sni-endpoint-service.ts create mode 100644 src/services/source-service.ts create mode 100644 src/services/space-app-access-service.ts create mode 100644 src/services/space-nat-service.ts create mode 100644 src/services/space-service.ts create mode 100644 src/services/space-topology-service.ts create mode 100644 src/services/space-transfer-service.ts create mode 100644 src/services/stack-service.ts create mode 100644 src/services/team-add-on-service.ts create mode 100644 src/services/team-app-collaborator-service.ts create mode 100644 src/services/team-app-permission-service.ts create mode 100644 src/services/team-app-service.ts create mode 100644 src/services/team-daily-usage-service.ts create mode 100644 src/services/team-delinquency-service.ts create mode 100644 src/services/team-feature-service.ts create mode 100644 src/services/team-invitation-service.ts create mode 100644 src/services/team-invoice-service.ts create mode 100644 src/services/team-member-service.ts create mode 100644 src/services/team-monthly-usage-service.ts create mode 100644 src/services/team-preferences-service.ts create mode 100644 src/services/team-service.ts create mode 100644 src/services/team-space-service.ts create mode 100644 src/services/test-case-service.ts create mode 100644 src/services/test-node-service.ts create mode 100644 src/services/test-run-service.ts create mode 100644 src/services/user-preferences-service.ts create mode 100644 src/services/vpn-connection-service.ts delete mode 100644 tslint.json delete mode 100644 yarn.lock diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 089453a..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -version: 2 -jobs: - update: &update - docker: - - image: node:latest - working_directory: ~/cli - steps: - - add_ssh_keys - - checkout - - restore_cache: &restore_cache - keys: - - v2-npm-{{checksum ".circleci/config.yml"}}-{{ checksum "yarn.lock"}} - - v2-npm-{{checksum ".circleci/config.yml"}} - - run: - name: Install dependencies - command: yarn - - run: - name: Updating schema - command: | - export GH_TOKEN=$(./scripts/github_token.js 290530) - git clone "https://x-access-token:$GH_TOKEN@github.com/heroku/typescript-api-schema.git" repo - cd repo - yarn - git config --global push.default simple - git config --global user.name "$GIT_AUTHOR_NAME" - git config --global user.email "$GIT_AUTHOR_EMAIL" - curl https://api.heroku.com/schema -H "Accept: application/vnd.heroku+json; version=3" > schema.json - cat schema.json | ./node_modules/.bin/json2ts --no-style.semi --style.singleQuote > lib/index.d.ts - ./node_modules/.bin/tslint --fix lib/index.d.ts - sed -i -r "s/Heroku(Platform|Build|Setup|Vault)Api([^ ])/\2/" lib/index.d.ts - git add schema.json lib/index.d.ts - git commit -m "fix: updated schema" || exit 0 - git push -q origin master - release: - <<: *update - steps: - - add_ssh_keys - - checkout - - restore_cache: *restore_cache - - run: - name: Install dependencies - command: | - yarn global add @oclif/semantic-release@3 semantic-release@15 - yarn --frozen-lockfile - - run: - name: Cutting release - command: | - export PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH - semantic-release -e @oclif/semantic-release - - save_cache: - key: v2-yarn-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}} - paths: - - ~/cli/node_modules - - /usr/local/share/.cache/yarn - - /usr/local/share/.config/yarn - -workflows: - version: 2 - "@heroku-cli/typescript-api-schema": - jobs: - - update: - context: org-global - - release: - context: org-global - filters: - branches: {only: master} - requires: - - update - nightly: - triggers: - - schedule: - cron: "0 11 * * *" - filters: - branches: - only: - - master - jobs: - - update: - context: org-global diff --git a/.eslintrc b/.eslintrc index d937685..75a252d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,3 +1,50 @@ { - "extends": ["oclif-typescript"] + "root": true, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module", + "tsconfigRootDir": "." + }, + "plugins": [ + "@typescript-eslint", + "unused-imports" + ], + "extends": [ + "eslint-config-salesforce-typescript", + "prettier" + ], + "rules": { + "no-unused-vars": "off", + "unused-imports/no-unused-imports": "error", + "unused-imports/no-unused-vars": [ + "warn", + { + "vars": "all", + "varsIgnorePattern": "^_", + "args": "after-used", + "argsIgnorePattern": "^_" + } + ], + "@typescript-eslint/naming-convention": [ + "warn", + { + "selector": "import", + "format": [ + "camelCase", + "PascalCase" + ] + } + ], + "@typescript-eslint/semi": "warn", + "curly": "warn", + "eqeqeq": "warn", + "no-throw-literal": "warn", + "semi": "off" + }, + "ignorePatterns": [ + "lib", + "dist", + "**/*.d.ts" + ] } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..56c486e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +name: build-only +on: + workflow_dispatch: + push: + paths: [ '*.ts', '*.js', '*.json', '*.lock' ] +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + node-version: [ 16.x ] + os: [pub-hk-ubuntu-22.04-small] + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: npm + - run: npm i + - run: npm run build diff --git a/.gitignore b/.gitignore index 8af86c0..d0baf2d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *-error.log /.nyc_output /dist -/package-lock.json /tmp node_modules +.idea +.DS_Store diff --git a/.prettier.mjs b/.prettier.mjs new file mode 100644 index 0000000..eceaff0 --- /dev/null +++ b/.prettier.mjs @@ -0,0 +1,12 @@ +const config = { + endOfLine: 'auto', + "singleQuote": true, + "printWidth": 120, + "proseWrap": "always", + "tabWidth": 2, + "useTabs": false, + "trailingComma": "none", + "bracketSpacing": true, + "semi": true +}; +export default config; diff --git a/lib/cjs/index.d.ts b/lib/cjs/index.d.ts new file mode 100644 index 0000000..79ff118 --- /dev/null +++ b/lib/cjs/index.d.ts @@ -0,0 +1,7982 @@ +/** + * + * [Heroku Platform API - account-delinquency](https://devcenter.heroku.com/articles/platform-api-reference#account-delinquency) + * A Heroku account becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent accounts if their invoices remain unpaid. + */ +export interface AccountDelinquency { + /** + * scheduled time of when we will suspend your account due to delinquency + * + * @example "2024-01-01T12:00:00Z" + */ + readonly scheduled_suspension_time: string | null; + /** + * scheduled time of when we will delete your account due to delinquency + * + * @example "2024-01-01T12:00:00Z" + */ + readonly scheduled_deletion_time: string | null; +} +/** + * + * [Heroku Platform API - account-feature](https://devcenter.heroku.com/articles/platform-api-reference#account-feature) + * An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku. + */ +export interface AccountFeature { + /** + * when account feature was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of account feature + * + * @example "Causes account to example." + */ + readonly description: string; + /** + * documentation URL of account feature + * + * @example "http://devcenter.heroku.com/articles/example" + */ + readonly doc_url: string; + /** + * whether or not account feature has been enabled + * + * @example true + */ + enabled: boolean; + /** + * unique identifier of account feature + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of account feature + * + * @example "name" + */ + readonly name: string; + /** + * state of account feature + * + * @example "public" + */ + readonly state: string; + /** + * when account feature was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user readable feature name + * + * @example "My Feature" + */ + readonly display_name: string; + /** + * e-mail to send feedback about the feature + * + * @example "feedback@heroku.com" + */ + readonly feedback_email: string; +} +export interface AccountFeatureUpdatePayload { + /** + * whether or not account feature has been enabled + * + * @example true + */ + enabled: boolean; +} +/** + * + * [Heroku Platform API - account](https://devcenter.heroku.com/articles/platform-api-reference#account) + * An account represents an individual signed up to use the Heroku platform. + */ +export interface Account { + /** + * whether to allow third party web activity tracking + * + * @example true + */ + allow_tracking: boolean; + /** + * whether allowed to utilize beta Heroku features + */ + beta: boolean; + /** + * when account was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated: boolean; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * Identity Provider details for federated users. + */ + identity_provider: IdentityProvider | null; + /** + * when account last authorized with Heroku + * + * @example "2012-01-01T12:00:00Z" + */ + readonly last_login: string | null; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name: string | null; + /** + * SMS number of account + * + * @example "+1 ***-***-1234" + */ + readonly sms_number: string | null; + /** + * when account was suspended + * + * @example "2012-01-01T12:00:00Z" + */ + readonly suspended_at: string | null; + /** + * when account became delinquent + * + * @example "2012-01-01T12:00:00Z" + */ + readonly delinquent_at: string | null; + /** + * whether two-factor auth is enabled on the account + */ + readonly two_factor_authentication: boolean; + /** + * when account was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * whether account has been verified with billing information + */ + readonly verified: boolean; + /** + * country where account owner resides + * + * @example "United States" + */ + country_of_residence: string | null; + /** + * team selected by default + */ + default_organization: DefaultOrganization | null; + /** + * team selected by default + */ + default_team: DefaultTeam | null; +} +/** + * + * [Heroku Platform API - identity-provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) + * Identity Providers represent the SAML configuration of teams or an Enterprise account + */ +export interface IdentityProvider { + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate: string; + /** + * when provider record was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * URL identifier provided by the identity provider + * + * @example "https://customer-domain.idp.com" + */ + entity_id: string; + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * single log out URL for this identity provider + * + * @example "https://example.com/idp/logout" + */ + slo_target_url: string; + /** + * single sign on URL for this identity provider + * + * @example "https://example.com/idp/login" + */ + sso_target_url: string; + /** + * team associated with this identity provider + */ + organization: null | Organization; + /** + * when the identity provider record was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * entity that owns this identity provider + */ + owner: Owner; +} +/** + * + * [Heroku Platform API - team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * Teams allow you to manage access to a shared group of applications and other resources. + */ +export interface Team { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * when the team was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * whether charges incurred by the team are paid by credit card. + * + * @example true + */ + readonly credit_card_collections: boolean; + /** + * whether to use this team when none is specified + * + * @example true + */ + default: boolean; + enterprise_account: null | TeamEnterpriseAccount; + /** + * Identity Provider associated with the Team + */ + identity_provider: null | TeamIdentityProvider; + /** + * upper limit of members allowed in a team. + * + * @example 25 + */ + readonly membership_limit: number | null; + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; + /** + * whether the team is provisioned licenses by salesforce. + * + * @example true + */ + readonly provisioned_licenses: boolean; + /** + * role in the team + * + * @example "admin" + */ + readonly role: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; + /** + * type of team. + * + * @example "team" + */ + readonly type: 'enterprise' | 'team'; + /** + * when the team was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +export interface Organization { + /** + * unique name of team + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * entity that owns this identity provider + */ +export interface Owner { + /** + * unique identifier of the owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * name of the owner + * + * @example "acme" + */ + readonly name?: string; + /** + * type of the owner + * + * @example "team" + */ + readonly type: 'team' | 'enterprise-account'; +} +/** + * + * team selected by default + */ +export interface DefaultOrganization { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; +} +/** + * + * team selected by default + */ +export interface DefaultTeam { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; +} +export interface AccountUpdatePayload { + /** + * whether to allow third party web activity tracking + * + * @example true + */ + allow_tracking?: boolean; + /** + * whether allowed to utilize beta Heroku features + */ + beta?: boolean; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name?: string | null; +} +export interface AccountUpdateByUserPayload { + /** + * whether to allow third party web activity tracking + * + * @example true + */ + allow_tracking?: boolean; + /** + * whether allowed to utilize beta Heroku features + */ + beta?: boolean; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name?: string | null; +} +/** + * + * [Heroku Platform API - add-on-action](https://devcenter.heroku.com/articles/platform-api-reference#add-on-action) + * Add-on Actions are lifecycle operations for add-on provisioning and deprovisioning. They allow add-on providers to (de)provision add-ons in the background and then report back when (de)provisioning is complete. + */ +export interface AddOnAction { +} +/** + * + * Add-ons represent add-ons that have been provisioned and attached to one or more apps. + */ +export interface AddOn { + /** + * provider actions for this specific add-on + */ + readonly actions: Array>; + /** + * identity of add-on serviceAdd-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. + */ + addon_service: { + /** + * unique identifier of this add-on-service + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly name: string; + } | AddOnService; + /** + * billing entity associated with this add-on + */ + billing_entity: BillingEntity; + /** + * billing application associated with this add-on + */ + app: App; + /** + * billed price + */ + billed_price: BilledPrice | null; + /** + * config vars exposed to the owning app by this add-on + * + * @example ["FOO","BAZ"] + */ + readonly config_vars: string[]; + /** + * when add-on was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + name: string; + /** + * identity of add-on planPlans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication. + */ + plan: { + /** + * unique identifier of this plan + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of this plan + * + * @example "heroku-postgresql:dev" + */ + readonly name: string; + } | Plan; + /** + * id of this add-on with its provider + * + * @example "abcd1234" + */ + readonly provider_id: string; + /** + * A provision message + */ + readonly provision_message?: string; + /** + * state in the add-on's lifecycle + * + * @example "provisioned" + */ + readonly state: 'provisioning' | 'provisioned' | 'deprovisioned'; + /** + * when add-on was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * URL for logging into web interface of add-on (e.g. a dashboard) + * + * @example "https://postgres.heroku.com/databases/01234567-89ab-cdef-0123-456789abcdef" + */ + readonly web_url: null | string; +} +/** + * + * [Heroku Platform API - add-on-service](https://devcenter.heroku.com/articles/platform-api-reference#add-on-service) + * Add-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. + */ +export interface AddOnService { + /** + * npm package name of the add-on service's Heroku CLI plugin + * + * @example "heroku-papertrail" + */ + readonly cli_plugin_name: string | null; + /** + * when add-on-service was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * human-readable name of the add-on service provider + * + * @example "Heroku Postgres" + */ + readonly human_name: string; + /** + * unique identifier of this add-on-service + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly name: string; + /** + * release status for add-on service + * + * @example "ga" + */ + readonly state: 'alpha' | 'beta' | 'ga' | 'shutdown'; + /** + * whether or not apps can have access to more than one instance of this add-on at the same time + */ + readonly supports_multiple_installations: boolean; + /** + * whether or not apps can have access to add-ons billed to a different app + */ + readonly supports_sharing: boolean; + /** + * when add-on-service was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * billing entity associated with this add-on + */ +export interface BillingEntity { + /** + * unique identifier of the billing entity + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * name of the billing entity + * + * @example "example" + */ + readonly name: string; + /** + * type of Object of the billing entity; new types allowed at any time. + * + * @example "app" + */ + readonly type: 'app' | 'team'; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * An app represents the program that you would like to deploy and run on Heroku. + */ +export interface App { + /** + * ACM status of this app + */ + readonly acm: boolean; + /** + * when app was archived + * + * @example "2012-01-01T12:00:00Z" + */ + readonly archived_at: null | string; + /** + * description from buildpack of app + * + * @example "Ruby/Rack" + */ + readonly buildpack_provided_description: null | string; + /** + * identity of the stack that will be used for new builds + */ + build_stack: BuildStack; + /** + * when app was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * git repo URL of app + * + * @example "https://git.heroku.com/example.git" + */ + readonly git_url: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * describes whether a Private Spaces app is externally routable or not + */ + internal_routing: boolean | null; + /** + * maintenance status of app + */ + maintenance: boolean; + /** + * unique name of app + * + * @example "example" + */ + name: string; + /** + * identity of app owner + */ + owner: AppOwner; + /** + * identity of team + */ + organization: null | AppOrganization; + /** + * identity of team + */ + team: null | AppTeam; + /** + * identity of app region + */ + region: AppRegion; + /** + * when app was released + * + * @example "2012-01-01T12:00:00Z" + */ + readonly released_at: null | string; + /** + * git repo size in bytes of app + */ + readonly repo_size: number | null; + /** + * slug size in bytes of app + */ + readonly slug_size: number | null; + /** + * identity of space + */ + space: null | Space; + /** + * identity of app stack + */ + stack: Stack; + /** + * when app was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * web URL of app + * + * @example "https://example.herokuapp.com/" + */ + readonly web_url: null | string; +} +/** + * + * billed price + */ +export interface BilledPrice { + /** + * price in cents per unit of plan + */ + readonly cents: number; + /** + * price is negotiated in a contract outside of monthly add-on billing + */ + readonly contract: boolean; + /** + * unit of price for plan + * + * @example "month" + */ + readonly unit: string; +} +/** + * + * [Heroku Platform API - plan](https://devcenter.heroku.com/articles/platform-api-reference#plan) + * Plans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication. + */ +export interface Plan { + /** + * identity of add-on service + */ + addon_service: AddonService; + /** + * when plan was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * the compliance regimes applied to an add-on plan + * + * @example ["HIPAA"] + */ + compliance: null | 'HIPAA' | Array<'PCI'>; + /** + * whether this plan is the default for its add-on service + */ + readonly default: boolean; + /** + * description of plan + * + * @example "Heroku Postgres Dev" + */ + readonly description: string; + /** + * human readable name of the add-on plan + * + * @example "Dev" + */ + readonly human_name: string; + /** + * unique identifier of this plan + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * whether this plan is installable to a Private Spaces app + */ + readonly installable_inside_private_network: boolean; + /** + * whether this plan is installable to a Common Runtime app + * + * @example true + */ + readonly installable_outside_private_network: boolean; + /** + * unique name of this plan + * + * @example "heroku-postgresql:dev" + */ + readonly name: string; + /** + * price + */ + price: Price; + /** + * whether this plan is the default for apps in Private Spaces + */ + readonly space_default: boolean; + /** + * release status for plan + * + * @example "public" + */ + readonly state: string; + /** + * when plan was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * whether this plan is publicly visible + * + * @example true + */ + readonly visible: boolean; +} +/** + * + * identity of add-on service + */ +export interface AddonService { + /** + * unique identifier of this add-on-service + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly name: string; +} +/** + * + * price + */ +export interface Price { + /** + * price in cents per unit of plan + */ + readonly cents: number; + /** + * price is negotiated in a contract outside of monthly add-on billing + */ + readonly contract: boolean; + /** + * unit of price for plan + * + * @example "month" + */ + readonly unit: string; +} +/** + * + * [Heroku Platform API - add-on-attachment](https://devcenter.heroku.com/articles/platform-api-reference#add-on-attachment) + * An add-on attachment represents a connection between an app and an add-on that it has been given access to. + */ +export interface AddOnAttachment { + /** + * identity of add-on + */ + addon: Addon; + /** + * application that is attached to add-on + */ + app: App; + /** + * when add-on attachment was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this add-on attachment + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name for this add-on attachment to this app + * + * @example "DATABASE" + */ + readonly name: string; + /** + * attachment namespace + * + * @example "role:analytics" + */ + readonly namespace: null | string; + /** + * when add-on attachment was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * URL for logging into web interface of add-on in attached app context + * + * @example "https://postgres.heroku.com/databases/01234567-89ab-cdef-0123-456789abcdef" + */ + readonly web_url: null | string; + /** + * URL for add-on partners to write to an add-on's logs + * + * @example "https://token:t.abcdef12-3456-7890-abcd-ef1234567890@1.us.logplex.io/logs" + */ + readonly log_input_url: null | string; +} +/** + * + * identity of add-on + */ +export interface Addon { + /** + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + name: string; + /** + * billing application associated with this add-on + */ + app: App; +} +export interface AddOnAttachmentCreatePayload { + /** + * unique identifier of add-on or globally unique name of the add-on + */ + addon: string; + /** + * unique identifier of app or unique name of app + */ + app: string; + /** + * name of owning app for confirmation + * + * @example "example" + */ + confirm?: string; + /** + * unique name for this add-on attachment to this app + * + * @example "DATABASE" + */ + readonly name?: string; + /** + * attachment namespace + * + * @example "role:analytics" + */ + readonly namespace?: null | string; +} +export interface AddOnAttachmentResolutionPayload { + /** + * unique name for this add-on attachment to this app + * + * @example "DATABASE" + */ + readonly addon_attachment: string; + /** + * unique name of app + * + * @example "example" + */ + app?: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly addon_service?: string; +} +/** + * + * [Heroku Platform API - add-on-config](https://devcenter.heroku.com/articles/platform-api-reference#add-on-config) + * Configuration of an Add-on + */ +export interface AddOnConfig { + /** + * unique name of the config + * + * @example "FOO" + */ + name: string; + /** + * value of the config + * + * @example "bar" + */ + value: string | null; +} +export interface AddOnConfigUpdatePayload { + config?: AddOnConfig[]; +} +/** + * + * [Heroku Platform API - add-on-plan-action](https://devcenter.heroku.com/articles/platform-api-reference#add-on-plan-action) + * Add-on Plan Actions are Provider functionality for specific add-on installations + */ +export interface AddOnPlanAction { + /** + * a unique identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * the display text shown in Dashboard + * + * @example "Example" + */ + readonly label: string; + /** + * identifier of the action to take that is sent via SSO + * + * @example "example" + */ + readonly action: string; + /** + * absolute URL to use instead of an action + * + * @example "http://example.com?resource_id=:resource_id" + */ + readonly url: string; + /** + * if the action requires the user to own the app + * + * @example true + */ + readonly requires_owner: boolean; +} +/** + * + * [Heroku Platform API - add-on-region-capability](https://devcenter.heroku.com/articles/platform-api-reference#add-on-region-capability) + * Add-on region capabilities represent the relationship between an Add-on Service and a specific Region. Only Beta and GA add-ons are returned by these endpoints. + */ +export interface AddOnRegionCapability { + /** + * unique identifier of this add-on-region-capability + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * whether the add-on can be installed to a Space + */ + readonly supports_private_networking: boolean; + /** + * Add-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. + */ + addon_service: AddOnService; + /** + * A region represents a geographic location in which your application may run. + */ + region: Region; +} +/** + * + * [Heroku Platform API - region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * A region represents a geographic location in which your application may run. + */ +export interface Region { + /** + * country where the region exists + * + * @example "United States" + */ + readonly country: string; + /** + * when region was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of region + * + * @example "United States" + */ + readonly description: string; + /** + * unique identifier of region + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * area in the country where the region exists + * + * @example "Virginia" + */ + readonly locale: string; + /** + * unique name of region + * + * @example "us" + */ + readonly name: string; + /** + * whether or not region is available for creating a Private Space + */ + readonly private_capable: boolean; + /** + * provider of underlying substrate + */ + readonly provider: Provider; + /** + * when region was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * provider of underlying substrate + */ +export interface Provider { + /** + * name of provider + * + * @example "amazon-web-services" + */ + readonly name?: string; + /** + * region name used by provider + * + * @example "us-east-1" + */ + readonly region?: 'ap-south-1' | 'eu-west-1' | 'ap-southeast-1' | 'ap-southeast-2' | 'eu-central-1' | 'eu-west-2' | 'ap-northeast-2' | 'ap-northeast-1' | 'us-east-1' | 'sa-east-1' | 'us-west-1' | 'us-west-2' | 'ca-central-1'; +} +/** + * + * Represents the delivery of a webhook notification, including its current status. + */ +export interface AppWebhookDelivery { + /** + * when the delivery was created + */ + created_at: string; + /** + * identity of event + */ + event: Event; + /** + * the delivery's unique identifier + */ + readonly id: string; + /** + * number of times a delivery has been attempted + */ + readonly num_attempts: number; + /** + * when delivery will be attempted again + */ + next_attempt_at: string | null; + /** + * last attempt of a delivery + */ + last_attempt: LastAttempt | null; + /** + * the delivery's status + * + * @example "pending" + */ + status: 'pending' | 'scheduled' | 'retrying' | 'failed' | 'succeeded'; + /** + * when the delivery was last updated + */ + updated_at: string; + /** + * identity of webhook + */ + webhook: Webhook; +} +/** + * + * identity of event + */ +export interface Event { + /** + * the event's unique identifier + */ + readonly id: string; + /** + * the type of entity that the event is related to + * + * @example "api:release" + */ + include: string; +} +/** + * + * last attempt of a delivery + */ +export interface LastAttempt { + /** + * unique identifier of attempt + */ + readonly id: string; + /** + * http response code received during attempt + */ + readonly code: number | null; + /** + * error class encountered during attempt + */ + readonly error_class: string | null; + /** + * status of an attempt + * + * @example "scheduled" + */ + status: 'scheduled' | 'succeeded' | 'failed'; + /** + * when attempt was created + */ + created_at: string; + /** + * when attempt was updated + */ + updated_at: string; +} +/** + * + * identity of webhook + */ +export interface Webhook { + /** + * the webhook's unique identifier + */ + readonly id: string; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level: 'notify' | 'sync'; +} +/** + * + * Represents a webhook event that occurred. + */ +export interface AppWebhookEvent { + /** + * when event was created + */ + created_at: string; + /** + * the event's unique identifier + */ + readonly id: string; + /** + * the type of entity that the event is related to + * + * @example "api:release" + */ + include: string; + /** + * payload of event + */ + payload: Payload; + /** + * when the event was last updated + */ + updated_at: string; +} +/** + * + * payload of event + */ +export interface Payload { + /** + * the type of event that occurred + * + * @example "create" + */ + action: string; + /** + * user that caused event + */ + actor: Actor; + /** + * the current details of the event + */ + data: Record; + /** + * previous details of the event (if any) + */ + previous_data: Record; + /** + * the type of resource associated with the event + * + * @example "release" + */ + resource: string; + /** + * the version of the details provided for the event + * + * @example "1" + */ + version: string; +} +/** + * + * user that caused event + */ +export interface Actor { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - add-on-webhook](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook) + * Represents the details of a webhook subscription + */ +export interface AddOnWebhook { + /** + * when the webhook was created + */ + created_at: string; + /** + * the webhook's unique identifier + */ + readonly id: string; + /** + * the entities that the subscription provides notifications for + */ + include: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level: 'notify' | 'sync'; + /** + * when the webhook was updated + */ + updated_at: string; + /** + * the URL where the webhook's notification requests are sent + */ + url: string; +} +export interface AddOnWebhookCreatePayload { + /** + * a custom `Authorization` header that Heroku will include with all webhook notifications + * + * @example "Bearer 9266671b2767f804c9d5809c2d384ed57d8f8ce1abd1043e1fb3fbbcb8c3" + */ + authorization?: null | string; + /** + * the entities that the subscription provides notifications for + */ + include: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level: 'notify' | 'sync'; + /** + * a value that Heroku will use to sign all webhook notification requests (the signature is included in the request’s `Heroku-Webhook-Hmac-SHA256` header) + * + * @example "dcbff0c4430a2960a2552389d587bc58d30a37a8cf3f75f8fb77abe667ad" + */ + secret?: null | string; + /** + * the URL where the webhook's notification requests are sent + */ + url: string; +} +/** + * + * add-on webhook + */ +export interface AddonWebhook { + /** + * identity of add-on. Only used for add-on partner webhooks. + */ + addon?: AddonWebhookAddon; + /** + * when the webhook was created + */ + created_at?: string; + /** + * the webhook's unique identifier + */ + readonly id?: string; + /** + * the entities that the subscription provides notifications for + */ + include?: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level?: 'notify' | 'sync'; + /** + * when the webhook was updated + */ + updated_at?: string; + /** + * the URL where the webhook's notification requests are sent + */ + url?: string; +} +/** + * + * identity of add-on. Only used for add-on partner webhooks. + */ +export interface AddonWebhookAddon { + /** + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + name: string; +} +export interface AddOnWebhookUpdatePayload { + /** + * a custom `Authorization` header that Heroku will include with all webhook notifications + * + * @example "Bearer 9266671b2767f804c9d5809c2d384ed57d8f8ce1abd1043e1fb3fbbcb8c3" + */ + authorization?: null | string; + /** + * the entities that the subscription provides notifications for + */ + include?: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level?: 'notify' | 'sync'; + /** + * a value that Heroku will use to sign all webhook notification requests (the signature is included in the request’s `Heroku-Webhook-Hmac-SHA256` header) + * + * @example "dcbff0c4430a2960a2552389d587bc58d30a37a8cf3f75f8fb77abe667ad" + */ + secret?: null | string; + /** + * the URL where the webhook's notification requests are sent + */ + url?: string; +} +export interface AddOnCreatePayload { + /** + * name for add-on's initial attachment + * + * @example {"name":"DATABASE_FOLLOWER"} + */ + attachment?: Attachment; + /** + * custom add-on provisioning options + * + * @example {"db-version":"1.2.3"} + */ + config?: Record; + /** + * name of billing entity for confirmation + * + * @example "example" + */ + confirm?: string; + /** + * unique identifier of this plan or unique name of this plan + */ + plan: string; + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + name?: string; +} +/** + * + * name for add-on's initial attachment + */ +export interface Attachment { + /** + * unique name for this add-on attachment to this app + * + * @example "DATABASE" + */ + readonly name?: string; +} +export interface AddOnUpdatePayload { + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + name?: string; + /** + * unique identifier of this plan or unique name of this plan + */ + plan: string; +} +export interface AddOnResolutionPayload { + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + addon: string; + /** + * unique name of app + * + * @example "example" + */ + app?: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly addon_service?: string; +} +/** + * + * [Heroku Platform API - allowed-add-on-service](https://devcenter.heroku.com/articles/platform-api-reference#allowed-add-on-service) + * Entities that have been allowed to be used by a Team + */ +export interface AllowedAddOnService { + /** + * when the add-on service was allowed + * + * @example "2012-01-01T12:00:00Z" + */ + readonly added_at: string; + /** + * the user which allowed the add-on service + */ + readonly added_by: AddedBy; + /** + * the add-on service allowed for use + */ + readonly addon_service: AllowedAddOnServiceAddonService; + /** + * unique identifier for this allowed add-on service record + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * the user which allowed the add-on service + */ +export interface AddedBy { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email?: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * the add-on service allowed for use + */ +export interface AllowedAddOnServiceAddonService { + /** + * unique identifier of this add-on-service + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly name?: string; + /** + * human-readable name of the add-on service provider + * + * @example "Heroku Postgres" + */ + readonly human_name?: string; +} +export interface AllowedAddOnServiceCreateByTeamPayload { + /** + * name of the add-on service to allow + * + * @example "heroku-postgresql" + */ + addon_service?: string; +} +/** + * + * [Heroku Platform API - app-feature](https://devcenter.heroku.com/articles/platform-api-reference#app-feature) + * An app feature represents a Heroku labs capability that can be enabled or disabled for an app on Heroku. + */ +export interface AppFeature { + /** + * when app feature was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of app feature + * + * @example "Causes app to example." + */ + readonly description: string; + /** + * documentation URL of app feature + * + * @example "http://devcenter.heroku.com/articles/example" + */ + readonly doc_url: string; + /** + * whether or not app feature has been enabled + * + * @example true + */ + enabled: boolean; + /** + * unique identifier of app feature + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of app feature + * + * @example "name" + */ + readonly name: string; + /** + * state of app feature + * + * @example "public" + */ + readonly state: string; + /** + * when app feature was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user readable feature name + * + * @example "My Feature" + */ + readonly display_name: string; + /** + * e-mail to send feedback about the feature + * + * @example "feedback@heroku.com" + */ + readonly feedback_email: string; +} +export interface AppFeatureUpdatePayload { + /** + * whether or not app feature has been enabled + * + * @example true + */ + enabled: boolean; +} +/** + * + * [Heroku Platform API - app-setup](https://devcenter.heroku.com/articles/platform-api-reference#app-setup) + * An app setup represents an app on Heroku that is setup using an environment, addons, and scripts described in an app.json manifest file. + */ +export interface AppSetup { + /** + * unique identifier of app setup + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * when app setup was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * when app setup was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * the overall status of app setup + * + * @example "failed" + */ + readonly status: 'failed' | 'pending' | 'succeeded'; + /** + * reason that app setup has failed + * + * @example "invalid app.json" + */ + readonly failure_message: string | null; + /** + * identity of app + */ + app: App; + /** + * identity and status of build + */ + build: null | Build; + /** + * errors associated with invalid app.json manifest file + * + * @example ["config var FOO is required"] + */ + readonly manifest_errors: string[]; + /** + * result of postdeploy script + */ + readonly postdeploy: Postdeploy | null; + /** + * fully qualified success url + * + * @example "https://example.herokuapp.com/welcome" + */ + readonly resolved_success_url: string | null; +} +/** + * + * [Heroku Platform API - build](https://devcenter.heroku.com/articles/platform-api-reference#build) + * A build represents the process of transforming a code tarball into a slug + */ +export interface Build { + /** + * app that the build belongs to + */ + app?: BuildApp; + /** + * buildpacks executed for this build, in order + */ + buildpacks?: Array<{ + /** + * the URL of the buildpack for the app + * + * @example "https://github.com/heroku/heroku-buildpack-ruby" + */ + url?: string; + /** + * Buildpack Registry name of the buildpack for the app + * + * @example "heroku/ruby" + */ + name?: string; + }> | null; + /** + * when build was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of build + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * Build process output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). + * + * @example "https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef" + */ + readonly output_stream_url?: string; + /** + * location of gzipped tarball of source code used to create build + */ + source_blob: BuildSourceBlob; + /** + * release resulting from the build + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} + */ + readonly release?: null | BuildRelease; + /** + * slug created by this build + */ + slug?: Slug | null; + /** + * stack of build + * + * @example "heroku-22" + */ + readonly stack?: string; + /** + * status of build + * + * @example "succeeded" + */ + readonly status: 'failed' | 'pending' | 'succeeded'; + /** + * when build was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user that started the build + */ + user: User; +} +/** + * + * result of postdeploy script + */ +export interface Postdeploy { + /** + * output of the postdeploy script + * + * @example "assets precompiled" + */ + readonly output?: string; + /** + * The exit code of the postdeploy script + * + * @example 1 + */ + readonly exit_code?: number; +} +export interface AppSetupCreatePayload { + /** + * optional parameters for created app + */ + app?: AppSetupCreatePayloadApp; + /** + * gzipped tarball of source code containing app.json manifest file + */ + source_blob: SourceBlob; + /** + * overrides of keys in the app.json manifest file + * + * @example {"buildpacks":[{"url":"https://example.com/buildpack.tgz"}],"env":{"FOO":"bar","BAZ":"qux"}} + */ + overrides?: Overrides; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * optional parameters for created app + */ +export interface AppSetupCreatePayloadApp { + /** + * are other team members forbidden from joining this app. + */ + locked?: boolean; + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique name of team + * + * @example "example" + */ + readonly organization?: string; + /** + * force creation of the app in the user account even if a default team is set. + */ + personal?: boolean; + /** + * unique name of region + * + * @example "us" + */ + readonly region?: string; + /** + * unique name of space + * + * @example "nasa" + */ + space?: string; + /** + * unique name of stack + * + * @example "heroku-18" + */ + readonly stack?: string; +} +/** + * + * gzipped tarball of source code containing app.json manifest file + */ +export interface SourceBlob { + /** + * an optional checksum of the gzipped tarball for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum?: null | string; + /** + * URL of gzipped tarball of source code containing app.json manifest file + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly url?: string; + /** + * Version of the gzipped tarball. + * + * @example "v1.3.0" + */ + readonly version?: string | null; +} +/** + * + * overrides of keys in the app.json manifest file + */ +export interface Overrides { + /** + * overrides the buildpacks specified in the app.json manifest file + * + * @example [{"url":"https://example.com/buildpack.tgz"}] + */ + buildpacks?: BuildpackOverride[]; + /** + * overrides of the env specified in the app.json manifest file + * + * @example {"FOO":"bar","BAZ":"qux"} + */ + readonly env?: Record; +} +/** + * + * a buildpack override + */ +export interface BuildpackOverride { + /** + * location of the buildpack + * + * @example "https://example.com/buildpack.tgz" + */ + url?: string; +} +/** + * + * [Heroku Platform API - app-transfer](https://devcenter.heroku.com/articles/platform-api-reference#app-transfer) + * An app transfer represents a two party interaction for transferring ownership of an app. + */ +export interface AppTransfer { + /** + * app involved in the transfer + */ + app: App; + /** + * when app transfer was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of app transfer + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * identity of the owner of the transfer + */ + owner: AppTransferOwner; + /** + * identity of the recipient of the transfer + */ + recipient: Recipient; + /** + * the current state of an app transfer + * + * @example "pending" + */ + readonly state: 'pending' | 'accepted' | 'declined'; + /** + * when app transfer was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * identity of the owner of the transfer + */ +export interface AppTransferOwner { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * identity of the recipient of the transfer + */ +export interface Recipient { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +export interface AppTransferCreatePayload { + /** + * unique identifier of app or unique name of app + */ + app: string; + /** + * unique email address of account or unique identifier of an account or Implicit reference to currently authorized user + */ + recipient: string; + /** + * whether to suppress email notification when transferring apps + */ + readonly silent?: boolean; +} +export interface AppTransferUpdatePayload { + /** + * the current state of an app transfer + * + * @example "pending" + */ + readonly state: 'pending' | 'accepted' | 'declined'; +} +export interface AppWebhookCreatePayload { + /** + * a custom `Authorization` header that Heroku will include with all webhook notifications + * + * @example "Bearer 9266671b2767f804c9d5809c2d384ed57d8f8ce1abd1043e1fb3fbbcb8c3" + */ + authorization?: null | string; + /** + * the entities that the subscription provides notifications for + */ + include: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level: 'notify' | 'sync'; + /** + * a value that Heroku will use to sign all webhook notification requests (the signature is included in the request’s `Heroku-Webhook-Hmac-SHA256` header) + * + * @example "dcbff0c4430a2960a2552389d587bc58d30a37a8cf3f75f8fb77abe667ad" + */ + secret?: null | string; + /** + * the URL where the webhook's notification requests are sent + */ + url: string; +} +/** + * + * app webhook + */ +export interface AppWebhook { + /** + * identity of app. Only used for customer webhooks. + */ + app?: App; + /** + * when the webhook was created + */ + created_at?: string; + /** + * the webhook's unique identifier + */ + readonly id?: string; + /** + * the entities that the subscription provides notifications for + */ + include?: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level?: 'notify' | 'sync'; + /** + * when the webhook was updated + */ + updated_at?: string; + /** + * the URL where the webhook's notification requests are sent + */ + url?: string; +} +export interface AppWebhookUpdatePayload { + /** + * a custom `Authorization` header that Heroku will include with all webhook notifications + * + * @example "Bearer 9266671b2767f804c9d5809c2d384ed57d8f8ce1abd1043e1fb3fbbcb8c3" + */ + authorization?: null | string; + /** + * the entities that the subscription provides notifications for + */ + include?: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level?: 'notify' | 'sync'; + /** + * a value that Heroku will use to sign all webhook notification requests (the signature is included in the request’s `Heroku-Webhook-Hmac-SHA256` header) + * + * @example "dcbff0c4430a2960a2552389d587bc58d30a37a8cf3f75f8fb77abe667ad" + */ + secret?: null | string; + /** + * the URL where the webhook's notification requests are sent + */ + url?: string; +} +/** + * + * identity of the stack that will be used for new builds + */ +export interface BuildStack { + /** + * unique identifier of stack + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of stack + * + * @example "heroku-18" + */ + readonly name: string; +} +/** + * + * identity of app owner + */ +export interface AppOwner { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * identity of team + */ +export interface AppOrganization { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * [Heroku Platform API - team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * identity of team + */ +export interface AppTeam { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * [Heroku Platform API - region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * identity of app region + */ +export interface AppRegion { + /** + * unique identifier of region + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of region + * + * @example "us" + */ + readonly name: string; +} +/** + * + * A space is an isolated, highly available, secure app execution environment. + */ +export interface Space { + /** + * when space was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of space + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of space + * + * @example "nasa" + */ + name: string; + /** + * organization that owns this space + */ + organization: Organization; + /** + * team that owns this space + */ + team: SpaceTeam; + /** + * identity of space region + */ + region: SpaceRegion; + /** + * true if this space has shield enabled + * + * @example true + */ + readonly shield: boolean; + /** + * availability of this space + * + * @example "allocated" + */ + readonly state: 'allocating' | 'allocated' | 'deleting'; + /** + * when space was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * The RFC-1918 CIDR the Private Space will use. It must be a /16 in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 + * + * @example "172.20.20.30/16" + */ + cidr: string; + /** + * The RFC-1918 CIDR that the Private Space will use for the Heroku-managed peering connection that's automatically created when using Heroku Data add-ons. It must be between a /16 and a /20 + * + * @example "10.2.0.0/16" + */ + data_cidr: string; +} +/** + * + * [Heroku Platform API - stack](https://devcenter.heroku.com/articles/platform-api-reference#stack) + * Stacks are the different application execution environments available in the Heroku platform. + */ +export interface Stack { + /** + * indicates this stack is the default for new apps + * + * @example true + */ + readonly default: boolean; + /** + * when stack was introduced + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of stack + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of stack + * + * @example "heroku-18" + */ + readonly name: string; + /** + * availability of this stack: beta, deprecated or public + * + * @example "public" + */ + readonly state: string; + /** + * when stack was last modified + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +export interface AppCreatePayload { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of region or unique name of region + */ + region?: string; + /** + * unique name of stack or unique identifier of stack + */ + stack?: string; + /** + * unique name of app feature + */ + feature_flags?: string[]; +} +export interface AppUpdatePayload { + /** + * unique name of stack or unique identifier of stack + */ + build_stack?: string; + /** + * maintenance status of app + */ + maintenance?: boolean; + /** + * unique name of app + * + * @example "example" + */ + name?: string; +} +/** + * + * [Heroku Platform API - archive](https://devcenter.heroku.com/articles/platform-api-reference#archive) + * An audit trail archive represents a monthly json zipped file containing events + */ +export interface Archive { + /** + * when archive was created + */ + created_at: string; + /** + * month of the archive + * + * @example "10" + */ + readonly month: '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12'; + /** + * year of the archive + * + * @example 2019 + */ + readonly year: number; + /** + * url where to download the archive + */ + readonly url: string; + /** + * checksum for the archive + */ + readonly checksum: string; + /** + * size of the archive in bytes + * + * @example 100 + */ + readonly size: number; +} +/** + * + * [Heroku Platform API - audit-trail-event](https://devcenter.heroku.com/articles/platform-api-reference#audit-trail-event) + * An audit trail event represents some action on the platform + */ +export interface AuditTrailEvent { + /** + * when event was created + */ + created_at: string; + /** + * unique identifier of event + */ + readonly id: string; + /** + * type of event + */ + readonly type: string; + /** + * action for the event + */ + readonly action: string; + /** + * user who caused event + */ + readonly actor: AuditTrailEventActor; + /** + * app upon which event took place + */ + readonly app: AuditTrailEventApp; + /** + * owner of the app targeted by the event + */ + readonly owner: AuditTrailEventOwner; + /** + * enterprise account on which the event happened + */ + readonly enterprise_account: EnterpriseAccount; + /** + * team on which the event happened + */ + readonly team: AuditTrailEventTeam; + /** + * information about where the action was triggered + */ + readonly request: Request; + /** + * data specific to the event + */ + readonly data: Record; +} +/** + * + * user who caused event + */ +export interface AuditTrailEventActor { + id?: string; + email?: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app upon which event took place + */ +export interface AuditTrailEventApp { + id?: string; + name?: string; +} +/** + * + * owner of the app targeted by the event + */ +export interface AuditTrailEventOwner { + id?: string; + email?: string; +} +/** + * + * [Heroku Platform API - enterprise-account](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account) + * Enterprise accounts allow companies to manage their development teams and billing. + */ +export interface EnterpriseAccount { + /** + * unique identifier of the enterprise account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * when the enterprise account was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique name of the enterprise account + * + * @example "example" + */ + readonly name: string; + /** + * when the enterprise account was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * the current user's permissions for this enterprise account + */ + readonly permissions: string[]; + /** + * whether the enterprise account is a trial or not + */ + readonly trial: boolean; + /** + * Identity Provider associated with the Enterprise Account + */ + identity_provider: null | EnterpriseAccountIdentityProvider; +} +/** + * + * [Heroku Platform API - team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * team on which the event happened + */ +export interface AuditTrailEventTeam { + id?: string; + name?: string; +} +/** + * + * information about where the action was triggered + */ +export interface Request { + ip_address?: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app that the build belongs to + */ +export interface BuildApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * location of gzipped tarball of source code used to create build + */ +export interface BuildSourceBlob { + /** + * an optional checksum of the gzipped tarball for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum: null | string; + /** + * URL where gzipped tar archive of source code for build was downloaded. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly url: string; + /** + * Version of the gzipped tarball. + * + * @example "v1.3.0" + */ + readonly version: string | null; + /** + * Version description of the gzipped tarball. + * + * @example "* Fake User: Change session key" + */ + readonly version_description: string | null; +} +/** + * + * [Heroku Platform API - release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * release resulting from the build + */ +export interface BuildRelease { + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - slug](https://devcenter.heroku.com/articles/platform-api-reference#slug) + * A slug is a snapshot of your application code that is ready to run on the platform. + */ +export interface Slug { + /** + * pointer to the url where clients can fetch or store the actual release binary + */ + blob: Blob; + /** + * description from buildpack of slug + * + * @example "Ruby/Rack" + */ + buildpack_provided_description: null | string; + /** + * an optional checksum of the slug for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum: null | string; + /** + * identification of the code with your version control system (eg: SHA of the git HEAD) + * + * @example "60883d9e8947a57e04dc9124f25df004866a2051" + */ + commit: null | string; + /** + * an optional description of the provided commit + * + * @example "fixed a bug with API documentation" + */ + commit_description: null | string; + /** + * when slug was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of slug + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * hash mapping process type names to their respective command + * + * @example {"web":"./bin/web -p $PORT"} + */ + process_types: Record; + /** + * size of slug, in bytes + * + * @example 2048 + */ + readonly size: number | null; + /** + * identity of slug stack + */ + stack: Stack; + /** + * when slug was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * user that started the build + */ +export interface User { + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; +} +export interface BuildCreatePayload { + /** + * buildpacks executed for this build, in order + */ + buildpacks?: Array<{ + /** + * the URL of the buildpack for the app + * + * @example "https://github.com/heroku/heroku-buildpack-ruby" + */ + url?: string; + /** + * Buildpack Registry name of the buildpack for the app + * + * @example "heroku/ruby" + */ + name?: string; + }> | null; + /** + * location of gzipped tarball of source code used to create build + */ + source_blob: BuildCreatePayloadSourceBlob; +} +/** + * + * location of gzipped tarball of source code used to create build + */ +export interface BuildCreatePayloadSourceBlob { + /** + * an optional checksum of the gzipped tarball for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum: null | string; + /** + * URL where gzipped tar archive of source code for build was downloaded. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly url: string; + /** + * Version of the gzipped tarball. + * + * @example "v1.3.0" + */ + readonly version: string | null; + /** + * Version description of the gzipped tarball. + * + * @example "* Fake User: Change session key" + */ + readonly version_description: string | null; +} +/** + * + * [Heroku Platform API - buildpack-installation](https://devcenter.heroku.com/articles/platform-api-reference#buildpack-installation) + * A buildpack installation represents a buildpack that will be run against an app. + */ +export interface BuildpackInstallation { + /** + * determines the order in which the buildpacks will execute + */ + readonly ordinal: number; + /** + * buildpack + */ + buildpack: Buildpack; +} +/** + * + * buildpack + */ +export interface Buildpack { + /** + * location of the buildpack for the app. Either a url (unofficial buildpacks) or an internal urn (heroku official buildpacks). + * + * @example "https://github.com/heroku/heroku-buildpack-ruby" + */ + url?: string; + /** + * either the Buildpack Registry name or a URL of the buildpack for the app + * + * @example "heroku/ruby" + */ + name?: string; +} +export interface BuildpackInstallationUpdatePayload { + /** + * The buildpack attribute can accept a name, a url, or a urn. + */ + updates: Update[]; +} +/** + * + * Properties to update a buildpack installation + */ +export interface Update { + /** + * location of the buildpack for the app. Either a url (unofficial buildpacks) or an internal urn (heroku official buildpacks). + * + * @example "https://github.com/heroku/heroku-buildpack-ruby" + */ + buildpack: string; +} +/** + * + * [Heroku Platform API - collaborator](https://devcenter.heroku.com/articles/platform-api-reference#collaborator) + * A collaborator represents an account that has been given access to an app on Heroku. + */ +export interface Collaborator { + /** + * app collaborator belongs to + */ + app: CollaboratorApp; + /** + * when collaborator was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of collaborator + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + permissions?: TeamAppPermission[]; + /** + * role in the team + * + * @example "admin" + */ + readonly role?: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; + /** + * when collaborator was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * identity of collaborated account + */ + user: CollaboratorUser; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app collaborator belongs to + */ +export interface CollaboratorApp { + /** + * unique name of app + * + * @example "example" + */ + name: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - team-app-permission](https://devcenter.heroku.com/articles/platform-api-reference#team-app-permission) + * A team app permission is a behavior that is assigned to a user in a team app. + */ +export interface TeamAppPermission { + /** + * The name of the app permission. + * + * @example "view" + */ + readonly name?: string; + /** + * A description of what the app permission allows. + * + * @example "Can manage config, deploy, run commands and restart the app." + */ + readonly description?: string; +} +/** + * + * identity of collaborated account + */ +export interface CollaboratorUser { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated: boolean; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +export interface CollaboratorCreatePayload { + /** + * whether to suppress email invitation when creating collaborator + */ + silent?: boolean; + /** + * unique email address of account or unique identifier of an account or Implicit reference to currently authorized user + */ + user: string; +} +/** + * + * [Heroku Platform API - credit](https://devcenter.heroku.com/articles/platform-api-reference#credit) + * A credit represents value that will be used up before further charges are assigned to an account. + */ +export interface Credit { + /** + * total value of credit in cents + * + * @example 10000 + */ + amount: number; + /** + * remaining value of credit in cents + * + * @example 5000 + */ + balance: number; + /** + * when credit was created + * + * @example "2012-01-01T12:00:00Z" + */ + created_at: string; + /** + * when credit will expire + * + * @example "2012-01-01T12:00:00Z" + */ + expires_at: string; + /** + * unique identifier of credit + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + id: string; + /** + * a name for credit + * + * @example "gift card" + */ + title: string; + /** + * when credit was updated + * + * @example "2012-01-01T12:00:00Z" + */ + updated_at: string; +} +export interface CreditCreatePayload { + /** + * first code from a discount card + * + * @example "012abc" + */ + code1?: string; + /** + * second code from a discount card + * + * @example "012abc" + */ + code2?: string; +} +/** + * + * [Heroku Platform API - domain](https://devcenter.heroku.com/articles/platform-api-reference#domain) + * Domains define what web routes should be routed to an app on Heroku. + */ +export interface Domain { + /** + * status of this record's ACM + * + * @example "pending" + */ + readonly acm_status: null | string; + /** + * reason for the status of this record's ACM + * + * @example "Failing CCA check" + */ + readonly acm_status_reason: null | string; + /** + * app that owns the domain + */ + app: DomainApp; + /** + * canonical name record, the address to point a domain at + * + * @example "example.herokudns.com" + */ + readonly cname: null | string; + /** + * when domain was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * full hostname + * + * @example "subdomain.example.com" + */ + readonly hostname: string; + /** + * unique identifier of this domain + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * type of domain name + * + * @example "custom" + */ + readonly kind: 'heroku' | 'custom'; + /** + * when domain was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * status of this record's cname + * + * @example "pending" + */ + readonly status: string; + /** + * sni endpoint the domain is associated with + */ + sni_endpoint: null | SniEndpoint; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app that owns the domain + */ +export interface DomainApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - sni-endpoint](https://devcenter.heroku.com/articles/platform-api-reference#sni-endpoint) + * SNI Endpoint is a public address serving a custom SSL cert for HTTPS traffic, using the SNI TLS extension, to a Heroku app. + */ +export interface SniEndpoint { + /** + * raw contents of the public certificate chain (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate_chain: string; + /** + * when endpoint was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this SNI endpoint + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name for SNI endpoint + * + * @example "example" + */ + readonly name: string; + /** + * when SNI endpoint was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * unique name for SSL certificate + * + * @example "example" + */ + display_name: string | null; + /** + * domains associated with this SSL certificate + */ + readonly domains: string[]; + /** + * application that this SSL certificate is on + */ + app: SniEndpointApp; + /** + * certificate provided by this endpoint + */ + ssl_cert: SslCert; +} +export interface DomainCreatePayload { + /** + * full hostname + * + * @example "subdomain.example.com" + */ + readonly hostname: string; + /** + * null or unique identifier or name for SNI endpoint + */ + sni_endpoint: null | string; +} +export interface DomainUpdatePayload { + /** + * null or unique identifier or name for SNI endpoint + */ + sni_endpoint: null | string; +} +/** + * + * [Heroku Platform API - dyno-size](https://devcenter.heroku.com/articles/platform-api-reference#dyno-size) + * Dyno sizes are the values and details of sizes that can be assigned to dynos. This information can also be found at : [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +export interface DynoSize { + /** + * minimum vCPUs, non-dedicated may get more depending on load + * + * @example 1 + */ + readonly compute: number; + /** + * price information for this dyno size + */ + readonly cost: null | Record; + /** + * whether this dyno will be dedicated to one user + */ + readonly dedicated: boolean; + /** + * deprecated. See precise_dyno_units instead + */ + readonly dyno_units: number; + /** + * unit of consumption for Heroku Enterprise customers to 2 decimal places + * + * @example 0.28 + */ + readonly precise_dyno_units: number; + /** + * unique identifier of this dyno size + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * amount of RAM in GB + * + * @example 0.5 + */ + readonly memory: number; + /** + * the name of this dyno-size + * + * @example "eco" + */ + readonly name: string; + /** + * whether this dyno can only be provisioned in a private space + */ + readonly private_space_only: boolean; +} +/** + * + * [Heroku Platform API - dyno](https://devcenter.heroku.com/articles/platform-api-reference#dyno) + * Dynos encapsulate running processes of an app on Heroku. Detailed information about dyno sizes can be found at: [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +export interface Dyno { + /** + * a URL to stream output from for attached processes or null for non-attached processes + * + * @example "rendezvous://rendezvous.runtime.heroku.com:5000/{rendezvous-id}" + */ + readonly attach_url: string | null; + /** + * command used to start this process + * + * @example "bash" + */ + command: string; + /** + * when dyno was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this dyno + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * the name of this process on this dyno + * + * @example "run.1" + */ + readonly name: string; + /** + * app release of the dyno + */ + release: Release; + /** + * app formation belongs to + */ + app: DynoApp; + /** + * dyno size + * + * @example "standard-1X" + */ + size: string; + /** + * current status of process (either: crashed, down, idle, starting, or up) + * + * @example "up" + */ + readonly state: string; + /** + * type of process + * + * @example "run" + */ + type: string; + /** + * when process last changed state + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * A release represents a combination of code, config vars and add-ons for an app on Heroku. + */ +export interface Release { + /** + * add-on plans installed on the app for this release + */ + addon_plan_names: string[]; + /** + * app involved in the release + */ + app: ReleaseApp; + /** + * when release was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of changes in this release + * + * @example "Added new feature" + */ + readonly description: string; + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * when release was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * slug running in this release + */ + slug: Slug | null; + /** + * current status of the release + * + * @example "succeeded" + */ + readonly status: 'failed' | 'pending' | 'succeeded'; + /** + * user that created the release + */ + user: User; + /** + * unique version assigned to the release + * + * @example 11 + */ + readonly version: number; + /** + * indicates this release as being the current one for the app + * + * @example true + */ + readonly current: boolean; + /** + * Release command output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). + * + * @example "https://release-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef" + */ + readonly output_stream_url: string | null; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app formation belongs to + */ +export interface DynoApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface DynoCreatePayload { + /** + * whether to stream output or not + * + * @example true + */ + attach?: boolean; + /** + * command used to start this process + * + * @example "bash" + */ + command: string; + /** + * custom environment to add to the dyno config vars + * + * @example {"COLUMNS":"80","LINES":"24"} + */ + env?: Record; + /** + * force an attached one-off dyno to not run in a tty + */ + force_no_tty?: boolean | null; + /** + * dyno size + * + * @example "standard-1X" + */ + size?: string; + /** + * type of process + * + * @example "run" + */ + type?: string; + /** + * seconds until dyno expires, after which it will soon be killed, max 86400 seconds (24 hours) + * + * @example 1800 + */ + time_to_live?: number; +} +/** + * + * [Heroku Platform API - enterprise-account-daily-usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-daily-usage) + * Usage for an enterprise account at a daily resolution. + */ +export interface EnterpriseAccountDailyUsage { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons: number; + /** + * usage by team + */ + teams: Array<{ + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons?: number; + /** + * app usage in the team + */ + apps?: AppUsageDaily[]; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data?: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos?: number; + /** + * team identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of the team + * + * @example "ops" + */ + readonly name?: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner?: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space?: number; + }>; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data: number; + /** + * date of the usage + * + * @example "2019-01-01" + */ + readonly date: string; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos: number; + /** + * enterprise account identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * name of the enterprise account + * + * @example "example-co" + */ + readonly name: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space: number; +} +/** + * + * Usage for an app at a daily resolution. + */ +export interface AppUsageDaily { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons?: number; + /** + * unique name of app + * + * @example "example" + */ + app_name?: string; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data?: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos?: number; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner?: number; +} +export interface EnterpriseAccountDailyUsageInfoPayload { + /** + * range start date + * + * @example "2019-01-25" + */ + readonly start: string; + /** + * range end date + * + * @example "2019-02-25" + */ + readonly end?: string; +} +/** + * + * [Heroku Platform API - enterprise-account-member](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-member) + * Enterprise account members are users with access to an enterprise account. + */ +export interface EnterpriseAccountMember { + enterprise_account: EnterpriseAccountMemberEnterpriseAccount; + /** + * unique identifier of the member + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * enterprise account permissions + */ + permissions: Array<{ + /** + * + * @example "View enterprise account members and teams." + */ + description?: string; + /** + * permission in the enterprise account + * + * @example "view" + */ + readonly name?: 'view' | 'create' | 'manage' | 'billing'; + }>; + /** + * user information for the membership + */ + user: User; + /** + * whether the Enterprise Account member has two factor authentication enabled + * + * @example true + */ + readonly two_factor_authentication: boolean; + /** + * Identity Provider information the member is federated with + */ + identity_provider: null | EnterpriseAccountMemberIdentityProvider; +} +export interface EnterpriseAccountMemberEnterpriseAccount { + /** + * unique identifier of the enterprise account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of the enterprise account + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * Identity Provider information the member is federated with + */ +export interface EnterpriseAccountMemberIdentityProvider { + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of the identity provider + * + * @example "acme" + */ + readonly name?: string; + /** + * whether the identity_provider information is redacted or not + */ + readonly redacted?: boolean; + /** + * entity that owns this identity provider + */ + owner?: Owner; +} +export interface EnterpriseAccountMemberCreatePayload { + /** + * unique email address of account or unique identifier of an account + */ + user: string; + /** + * permissions for enterprise account + * + * @example ["view"] + */ + readonly permissions: 'view' | 'create' | 'manage' | Array<'billing'>; + /** + * whether membership is being created as part of SSO JIT + */ + federated?: boolean; +} +export interface EnterpriseAccountMemberUpdatePayload { + /** + * permissions for enterprise account + * + * @example ["view"] + */ + readonly permissions: 'view' | 'create' | 'manage' | Array<'billing'>; +} +/** + * + * [Heroku Platform API - enterprise-account-monthly-usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-monthly-usage) + * Usage for an enterprise account at a monthly resolution. + */ +export interface EnterpriseAccountMonthlyUsage { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons: number; + /** + * usage by team + */ + teams: Array<{ + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons?: number; + /** + * app usage in the team + */ + apps?: AppUsageMonthly[]; + /** + * average connect rows synced + * + * @example 15000 + */ + readonly connect?: number; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data?: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos?: number; + /** + * team identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of the team + * + * @example "ops" + */ + readonly name?: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner?: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space?: number; + }>; + /** + * average connect rows synced + * + * @example 15000 + */ + readonly connect: number; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos: number; + /** + * enterprise account identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * year and month of the usage + * + * @example "2019-01" + */ + readonly month: string; + /** + * name of the enterprise account + * + * @example "example-co" + */ + readonly name: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space: number; +} +/** + * + * Usage for an app at a monthly resolution. + */ +export interface AppUsageMonthly { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons?: number; + /** + * unique name of app + * + * @example "example" + */ + app_name?: string; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data?: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos?: number; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner?: number; +} +export interface EnterpriseAccountMonthlyUsageInfoPayload { + /** + * range start date + * + * @example "2019-01" + */ + readonly start: string; + /** + * range end date + * + * @example "2019-02" + */ + readonly end?: string; +} +/** + * + * Identity Provider associated with the Enterprise Account + */ +export interface EnterpriseAccountIdentityProvider { + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * user-friendly unique identifier for this identity provider + * + * @example "acme-sso" + */ + name: string; + /** + * entity that owns this identity provider + */ + owner: Owner; +} +export interface EnterpriseAccountUpdatePayload { + /** + * unique name of the enterprise account + * + * @example "example" + */ + readonly name?: string; +} +export interface Filter { + in?: In; +} +export interface In { + id?: string[]; +} +/** + * + * [Heroku Platform API - team-app](https://devcenter.heroku.com/articles/platform-api-reference#team-app) + * A team app encapsulates the team specific functionality of Heroku apps. + */ +export interface TeamApp { + /** + * when app was archived + * + * @example "2012-01-01T12:00:00Z" + */ + readonly archived_at?: null | string; + /** + * description from buildpack of app + * + * @example "Ruby/Rack" + */ + readonly buildpack_provided_description?: null | string; + /** + * identity of the stack that will be used for new builds + */ + build_stack?: BuildStack; + /** + * when app was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * git repo URL of app + * + * @example "https://git.heroku.com/example.git" + */ + readonly git_url?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * describes whether a Private Spaces app is externally routable or not + */ + internal_routing?: boolean | null; + /** + * is the current member a collaborator on this app. + */ + joined?: boolean; + /** + * are other team members forbidden from joining this app. + */ + locked?: boolean; + /** + * maintenance status of app + */ + maintenance?: boolean; + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * team that owns this app + */ + team?: null | Team; + /** + * identity of app owner + */ + owner?: null | TeamAppOwner; + /** + * identity of app region + */ + region?: TeamAppRegion; + /** + * when app was released + * + * @example "2012-01-01T12:00:00Z" + */ + readonly released_at?: null | string; + /** + * git repo size in bytes of app + */ + readonly repo_size?: number | null; + /** + * slug size in bytes of app + */ + readonly slug_size?: number | null; + /** + * identity of space + */ + space?: null | TeamAppSpace; + /** + * identity of app stack + */ + stack?: Stack; + /** + * when app was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; + /** + * web URL of app + * + * @example "https://example.herokuapp.com/" + */ + readonly web_url?: null | string; +} +/** + * + * identity of app owner + */ +export interface TeamAppOwner { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email?: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * identity of app region + */ +export interface TeamAppRegion { + /** + * unique identifier of region + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of region + * + * @example "us" + */ + readonly name?: string; +} +/** + * + * [Heroku Platform API - space](https://devcenter.heroku.com/articles/platform-api-reference#space) + * identity of space + */ +export interface TeamAppSpace { + /** + * unique identifier of space + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of space + * + * @example "nasa" + */ + name?: string; +} +/** + * + * [Heroku Platform API - formation](https://devcenter.heroku.com/articles/platform-api-reference#formation) + * The formation of processes that should be maintained for an app. Update the formation to scale processes or change dyno sizes. Available process type names and commands are defined by the `process_types` attribute for the [slug](#slug) currently released on an app. + */ +export interface Formation { + /** + * app formation belongs to + */ + app: FormationApp; + /** + * command to use to launch this process + * + * @example "bundle exec rails server -p $PORT" + */ + command: string; + /** + * when process type was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this process type + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * number of processes to maintain + * + * @example 1 + */ + quantity: number; + /** + * dyno size + * + * @example "standard-1X" + */ + size: string; + /** + * type of process to maintain + * + * @example "web" + */ + readonly type: string; + /** + * when dyno type was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app formation belongs to + */ +export interface FormationApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface FormationBatchUpdatePayload { + /** + * Array with formation updates. Each element must have "type", the id or name of the process type to be updated, and can optionally update its "quantity" or "size". + */ + updates: FormationBatchUpdatePayloadUpdate[]; +} +/** + * + * Properties to update a process type + */ +export interface FormationBatchUpdatePayloadUpdate { + /** + * number of processes to maintain + * + * @example 1 + */ + quantity?: number; + /** + * dyno size + * + * @example "standard-1X" + */ + size?: string; + /** + * type of process to maintain + * + * @example "web" + */ + readonly type: string; +} +export interface FormationUpdatePayload { + /** + * number of processes to maintain + * + * @example 1 + */ + quantity?: number; + /** + * dyno size + * + * @example "standard-1X" + */ + size?: string; +} +export interface IdentityProviderCreateByTeamPayload { + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate: string; + /** + * URL identifier provided by the identity provider + * + * @example "https://customer-domain.idp.com" + */ + entity_id: string; + /** + * single log out URL for this identity provider + * + * @example "https://example.com/idp/logout" + */ + slo_target_url?: string; + /** + * single sign on URL for this identity provider + * + * @example "https://example.com/idp/login" + */ + sso_target_url: string; +} +export interface IdentityProviderUpdateByTeamPayload { + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate?: string; + /** + * URL identifier provided by the identity provider + * + * @example "https://customer-domain.idp.com" + */ + entity_id?: string; + /** + * single log out URL for this identity provider + * + * @example "https://example.com/idp/logout" + */ + slo_target_url?: string; + /** + * single sign on URL for this identity provider + * + * @example "https://example.com/idp/login" + */ + sso_target_url?: string; +} +/** + * + * [Heroku Platform API - inbound-ruleset](https://devcenter.heroku.com/articles/platform-api-reference#inbound-ruleset) + * An inbound-ruleset is a collection of rules that specify what hosts can or cannot connect to an application. + */ +export interface InboundRuleset { + /** + * unique identifier of an inbound-ruleset + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * identity of space + */ + space: InboundRulesetSpace; + /** + * when inbound-ruleset was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + rules: Rule[]; + /** + * unique email address of account + * + * @example "username@example.com" + */ + created_by: string; +} +/** + * + * [Heroku Platform API - space](https://devcenter.heroku.com/articles/platform-api-reference#space) + * identity of space + */ +export interface InboundRulesetSpace { + /** + * unique identifier of space + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of space + * + * @example "nasa" + */ + name?: string; +} +/** + * + * the combination of an IP address in CIDR notation and whether to allow or deny it's traffic. + */ +export interface Rule { + /** + * states whether the connection is allowed or denied + * + * @example "allow" + */ + action: 'allow' | 'deny'; + /** + * is the request’s source in CIDR notation + * + * @example "1.1.1.1/1" + */ + source: string; +} +export interface InboundRulesetCreatePayload { + rules?: Rule[]; +} +/** + * + * [Heroku Platform API - invoice-address](https://devcenter.heroku.com/articles/platform-api-reference#invoice-address) + * An invoice address represents the address that should be listed on an invoice. + */ +export interface InvoiceAddress { + /** + * invoice street address line 1 + * + * @example "40 Hickory Blvd." + */ + address_1?: string; + /** + * invoice street address line 2 + * + * @example "Suite 300" + */ + address_2?: string; + /** + * invoice city + * + * @example "Seattle" + */ + city?: string; + /** + * country + * + * @example "US" + */ + country?: string; + /** + * heroku_id identifier reference + */ + heroku_id?: string; + /** + * metadata / additional information to go on invoice + * + * @example "Company ABC Inc. VAT 903820" + */ + other?: string; + /** + * invoice zip code + * + * @example "98101" + */ + postal_code?: string; + /** + * invoice state + * + * @example "WA" + */ + state?: string; + /** + * flag to use the invoice address for an account or not + * + * @example true + */ + use_invoice_address?: boolean; +} +export interface InvoiceAddressUpdatePayload { + /** + * invoice street address line 1 + * + * @example "40 Hickory Blvd." + */ + address_1?: string; + /** + * invoice street address line 2 + * + * @example "Suite 300" + */ + address_2?: string; + /** + * invoice city + * + * @example "Seattle" + */ + city?: string; + /** + * country + * + * @example "US" + */ + country?: string; + /** + * metadata / additional information to go on invoice + * + * @example "Company ABC Inc. VAT 903820" + */ + other?: string; + /** + * invoice zip code + * + * @example "98101" + */ + postal_code?: string; + /** + * invoice state + * + * @example "WA" + */ + state?: string; + /** + * flag to use the invoice address for an account or not + * + * @example true + */ + use_invoice_address?: boolean; +} +/** + * + * [Heroku Platform API - invoice](https://devcenter.heroku.com/articles/platform-api-reference#invoice) + * An invoice is an itemized bill of goods for an account which includes pricing and charges. + */ +export interface Invoice { + /** + * total charges on this invoice + * + * @example 100 + */ + readonly charges_total: number; + /** + * when invoice was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * total credits on this invoice + * + * @example 100 + */ + readonly credits_total: number; + /** + * unique identifier of this invoice + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * human readable invoice number + * + * @example 9403943 + */ + readonly number: number; + /** + * the ending date that the invoice covers + * + * @example "01/31/2014" + */ + readonly period_end: string; + /** + * the starting date that this invoice covers + * + * @example "01/01/2014" + */ + readonly period_start: string; + /** + * payment status for this invoice (pending, successful, failed) + * + * @example 1 + */ + readonly state: number; + /** + * combined total of charges and credits on this invoice + * + * @example 100 + */ + readonly total: number; + /** + * when invoice was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - key](https://devcenter.heroku.com/articles/platform-api-reference#key) + * Keys represent public SSH keys associated with an account and are used to authorize accounts as they are performing git operations. + */ +export interface Key { + /** + * comment on the key + * + * @example "username@host" + */ + readonly comment: string; + /** + * when key was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * deprecated. Please refer to 'comment' instead + * + * @example "username@host" + */ + readonly email: string; + /** + * a unique identifying string based on contents + * + * @example "17:63:a4:ba:24:d3:7f:af:17:c8:94:82:7e:80:56:bf" + */ + readonly fingerprint: string; + /** + * unique identifier of this key + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * full public_key as uploaded + * + * @example "ssh-rsa AAAAB3NzaC1ycVc/../839Uv username@example.com" + */ + readonly public_key: string; + /** + * when key was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - log-drain](https://devcenter.heroku.com/articles/platform-api-reference#log-drain) + * [Log drains](https://devcenter.heroku.com/articles/log-drains) provide a way to forward your Heroku logs to an external syslog server for long-term archiving. This external service must be configured to receive syslog packets from Heroku, whereupon its URL can be added to an app using this API. Some add-ons will add a log drain when they are provisioned to an app. These drains can only be removed by removing the add-on. + */ +export interface LogDrain { + /** + * add-on that created the drain + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef","name":"singing-swiftly-1242","app":{"id":"01234567-89ab-cdef-0123-456789abcdef","name":"example"}} + */ + readonly addon: Addon | null; + /** + * application that is attached to this drain + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef","name":"example"} + */ + readonly app: LogDrainApp | null; + /** + * when log drain was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this log drain + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * token associated with the log drain + * + * @example "d.01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token: string; + /** + * when log drain was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * url associated with the log drain + * + * @example "https://example.com/drain" + */ + readonly url: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * application that is attached to this drain + */ +export interface LogDrainApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of app + * + * @example "example" + */ + name: string; +} +export interface LogDrainCreatePayload { + /** + * url associated with the log drain + * + * @example "https://example.com/drain" + */ + readonly url: string; +} +export interface LogDrainUpdatePayload { + /** + * url associated with the log drain + * + * @example "https://example.com/drain" + */ + readonly url: string; +} +/** + * + * [Heroku Platform API - log-session](https://devcenter.heroku.com/articles/platform-api-reference#log-session) + * A log session is a reference to the http based log stream for an app. + */ +export interface LogSession { + /** + * when log connection was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this log session + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * URL for log streaming session + * + * @example "https://logplex.heroku.com/sessions/01234567-89ab-cdef-0123-456789abcdef?srv=1325419200" + */ + readonly logplex_url: string; + /** + * when log session was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +export interface LogSessionCreatePayload { + /** + * dyno to limit results to + * + * @example "web.1" + */ + dyno?: string; + /** + * number of log lines to stream at once + * + * @example 10 + */ + lines?: number; + /** + * log source to limit results to + * + * @example "app" + */ + source?: string; + /** + * whether to stream ongoing logs + * + * @example true + */ + tail?: boolean; +} +/** + * + * [Heroku Platform API - oauth-authorization](https://devcenter.heroku.com/articles/platform-api-reference#oauth-authorization) + * OAuth authorizations represent clients that a Heroku user has authorized to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export interface OauthAuthorization { + /** + * access token for this authorization + */ + access_token: null | AccessToken; + /** + * identifier of the client that obtained this authorization, if any + */ + client: null | Client; + /** + * when OAuth authorization was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * this authorization's grant + */ + grant: null | Grant; + /** + * unique identifier of OAuth authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * refresh token for this authorization + */ + refresh_token: null | RefreshToken; + /** + * The scope of access OAuth authorization allows + * + * @example ["global"] + */ + readonly scope: string[]; + /** + * when OAuth authorization was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * authenticated user associated with this authorization + */ + user: OauthAuthorizationUser; +} +/** + * + * access token for this authorization + */ +export interface AccessToken { + /** + * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime + * + * @example 2592000 + */ + readonly expires_in?: null | number; + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * contents of the token to be used for authorization + * + * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token?: string; +} +/** + * + * identifier of the client that obtained this authorization, if any + */ +export interface Client { + /** + * unique identifier of this OAuth client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * OAuth client name + * + * @example "example" + */ + readonly name?: string; + /** + * endpoint for redirection after authorization with OAuth client + * + * @example "https://example.com/auth/heroku/callback" + */ + readonly redirect_uri?: string; +} +/** + * + * this authorization's grant + */ +export interface Grant { + /** + * grant code received from OAuth web application authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly code: string; + /** + * seconds until OAuth grant expires + * + * @example 2592000 + */ + readonly expires_in: number; + /** + * unique identifier of OAuth grant + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * refresh token for this authorization + */ +export interface RefreshToken { + /** + * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime + * + * @example 2592000 + */ + readonly expires_in: null | number; + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * contents of the token to be used for authorization + * + * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token: string; +} +/** + * + * authenticated user associated with this authorization + */ +export interface OauthAuthorizationUser { + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + full_name: string | null; +} +export interface OauthAuthorizationCreatePayload { + /** + * unique identifier of this OAuth client + */ + client?: string; + /** + * human-friendly description of this OAuth authorization + * + * @example "sample authorization" + */ + readonly description?: string; + /** + * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime + * + * @example 2592000 + */ + readonly expires_in?: null | number; + /** + * The scope of access OAuth authorization allows + * + * @example ["global"] + */ + readonly scope: string[]; +} +/** + * + * [Heroku Platform API - oauth-client](https://devcenter.heroku.com/articles/platform-api-reference#oauth-client) + * OAuth clients are applications that Heroku users can authorize to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth). + */ +export interface OauthClient { + /** + * when OAuth client was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this OAuth client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * whether the client is still operable given a delinquent account + */ + readonly ignores_delinquent: boolean | null; + /** + * OAuth client name + * + * @example "example" + */ + readonly name: string; + /** + * endpoint for redirection after authorization with OAuth client + * + * @example "https://example.com/auth/heroku/callback" + */ + readonly redirect_uri: string; + /** + * secret used to obtain OAuth authorizations under this client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly secret: string; + /** + * when OAuth client was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +export interface OauthClientCreatePayload { + /** + * OAuth client name + * + * @example "example" + */ + readonly name: string; + /** + * endpoint for redirection after authorization with OAuth client + * + * @example "https://example.com/auth/heroku/callback" + */ + readonly redirect_uri: string; +} +export interface OauthClientUpdatePayload { + /** + * OAuth client name + * + * @example "example" + */ + readonly name?: string; + /** + * endpoint for redirection after authorization with OAuth client + * + * @example "https://example.com/auth/heroku/callback" + */ + readonly redirect_uri?: string; +} +/** + * + * [Heroku Platform API - oauth-grant](https://devcenter.heroku.com/articles/platform-api-reference#oauth-grant) + * OAuth grants are used to obtain authorizations on behalf of a user. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export interface OauthGrant { +} +/** + * + * [Heroku Platform API - oauth-token](https://devcenter.heroku.com/articles/platform-api-reference#oauth-token) + * OAuth tokens provide access for authorized clients to act on behalf of a Heroku user to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export interface OauthToken { + /** + * current access token + */ + access_token: AccessToken; + /** + * authorization for this set of tokens + */ + authorization: Authorization; + /** + * OAuth client secret used to obtain token + */ + client: null | OauthTokenClient; + /** + * when OAuth token was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * grant used on the underlying authorization + */ + grant: OauthTokenGrant; + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * refresh token for this authorization + */ + refresh_token: RefreshToken; + /** + * OAuth session using this token + */ + session: Session; + /** + * when OAuth token was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * Reference to the user associated with this token + */ + user: OauthTokenUser; +} +/** + * + * authorization for this set of tokens + */ +export interface Authorization { + /** + * unique identifier of OAuth authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * OAuth client secret used to obtain token + */ +export interface OauthTokenClient { + /** + * secret used to obtain OAuth authorizations under this client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly secret: string; +} +/** + * + * grant used on the underlying authorization + */ +export interface OauthTokenGrant { + /** + * grant code received from OAuth web application authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly code: string; + /** + * type of grant requested, one of `authorization_code` or `refresh_token` + * + * @example "authorization_code" + */ + type: string; +} +/** + * + * OAuth session using this token + */ +export interface Session { + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * Reference to the user associated with this token + */ +export interface OauthTokenUser { + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +export interface OauthTokenCreatePayload { + client: OauthTokenCreatePayloadClient; + grant: OauthTokenCreatePayloadGrant; + refresh_token: OauthTokenCreatePayloadRefreshToken; +} +export interface OauthTokenCreatePayloadClient { + /** + * secret used to obtain OAuth authorizations under this client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly secret?: string; +} +export interface OauthTokenCreatePayloadGrant { + /** + * grant code received from OAuth web application authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly code?: string; + /** + * type of grant requested, one of `authorization_code` or `refresh_token` + * + * @example "authorization_code" + */ + type?: string; +} +export interface OauthTokenCreatePayloadRefreshToken { + /** + * contents of the token to be used for authorization + * + * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token?: string; +} +/** + * + * [Heroku Platform API - password-reset](https://devcenter.heroku.com/articles/platform-api-reference#password-reset) + * A password reset represents a in-process password reset attempt. + */ +export interface PasswordReset { + /** + * when password reset was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + user: User; +} +export interface PasswordResetResetPasswordPayload { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; +} +export interface PasswordResetCompleteResetPasswordPayload { + /** + * current password on the account + * + * @example "currentpassword" + */ + readonly password: string; + /** + * confirmation of the new password + * + * @example "newpassword" + */ + readonly password_confirmation: string; +} +/** + * + * [Heroku Platform API - peering-info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) + * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. + */ +export interface PeeringInfo { + /** + * The AWS account ID of your Private Space. + * + * @example "123456789012" + */ + readonly aws_account_id: string; + /** + * region name used by provider + * + * @example "us-east-1" + */ + readonly aws_region: 'ap-south-1' | 'eu-west-1' | 'ap-southeast-1' | 'ap-southeast-2' | 'eu-central-1' | 'eu-west-2' | 'ap-northeast-2' | 'ap-northeast-1' | 'us-east-1' | 'sa-east-1' | 'us-west-1' | 'us-west-2' | 'ca-central-1'; + /** + * The AWS VPC ID of the peer. + * + * @example "vpc-1234567890" + */ + readonly vpc_id: string; + /** + * An IP address and the number of significant bits that make up the routing or networking portion. + * + * @example "10.0.0.0/16" + */ + vpc_cidr: string; + /** + * The CIDR ranges that should be routed to the Private Space VPC. + */ + dyno_cidr_blocks: string[]; + /** + * The CIDR ranges that you must not conflict with. + */ + unavailable_cidr_blocks: string[]; + /** + * The CIDR ranges that should be routed to the Private Space VPC. + */ + space_cidr_blocks: string[]; +} +/** + * + * [Heroku Platform API - peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) + * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + */ +export interface Peering { + /** + * The type of peering connection. + * + * @example "heroku-managed" + */ + type: 'heroku-managed' | 'customer-managed' | 'unknown'; + /** + * The AWS VPC Peering Connection ID of the peering. + * + * @example "pcx-123456789012" + */ + readonly pcx_id: string; + /** + * The CIDR blocks of the peer. + */ + cidr_blocks: string[]; + /** + * The status of the peering connection. + * + * @example "pending-acceptance" + */ + readonly status: 'initiating-request' | 'pending-acceptance' | 'provisioning' | 'active' | 'failed' | 'expired' | 'rejected' | 'deleted'; + /** + * The AWS VPC ID of the peer. + * + * @example "vpc-1234567890" + */ + readonly aws_vpc_id: string; + /** + * The AWS region of the peer connection. + * + * @example "us-east-1" + */ + readonly aws_region: string; + /** + * The AWS account ID of your Private Space. + * + * @example "123456789012" + */ + readonly aws_account_id: string; + /** + * When a peering connection will expire. + * + * @example "2020-01-01T12:00:00Z" + */ + readonly expires: string; +} +/** + * + * [Heroku Platform API - permission-entity](https://devcenter.heroku.com/articles/platform-api-reference#permission-entity) + * An owned entity including users' permissions. + */ +export interface PermissionEntity { + /** + * ID of the entity. + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * Name of the entity. + * + * @example "polar-lake-12345" + */ + readonly name: string; + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly team_id: string; + /** + * The type of object the entity is referring to. + * + * @example "app" + */ + readonly type: 'app' | 'space'; + /** + * Users that have access to the entity. + */ + users: Array<{ + /** + * unique email address of account + * + * @example "username@example.com" + */ + email?: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * enterprise account permissions + */ + permissions?: string[]; + }>; +} +/** + * + * [Heroku Platform API - pipeline-coupling](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-coupling) + * Information about an app's coupling to a pipeline + */ +export interface PipelineCoupling { + /** + * app involved in the pipeline coupling + */ + app?: PipelineCouplingApp; + /** + * when pipeline coupling was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of pipeline coupling + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * pipeline involved in the coupling + */ + pipeline?: Pipeline; + /** + * target pipeline stage + * + * @example "production" + */ + stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; + /** + * when pipeline coupling was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app involved in the pipeline coupling + */ +export interface PipelineCouplingApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * A pipeline allows grouping of apps into different stages. + */ +export interface Pipeline { + /** + * when pipeline was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of pipeline + * + * @example "example" + */ + name?: string; + /** + * Owner of a pipeline. + */ + owner?: PipelineOwner | null; + /** + * when pipeline was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; +} +export interface PipelineCouplingCreatePayload { + /** + * unique identifier of app or unique name of app + */ + app: string; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly pipeline: string; + /** + * target pipeline stage + * + * @example "production" + */ + stage: 'test' | 'review' | 'development' | 'staging' | 'production'; +} +export interface PipelineCouplingUpdatePayload { + /** + * target pipeline stage + * + * @example "production" + */ + stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app involved in the release + */ +export interface ReleaseApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - pipeline-promotion-target](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion-target) + * Promotion targets represent an individual app being promoted to + */ +export interface PipelinePromotionTarget { + /** + * the app which was promoted to + */ + app: PipelinePromotionTargetApp; + /** + * an error message for why the promotion failed + * + * @example "User does not have access to that app" + */ + error_message: null | string; + /** + * unique identifier of promotion target + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * the promotion which the target belongs to + */ + pipeline_promotion: PipelinePromotion; + /** + * the release which was created on the target app + */ + release: PipelinePromotionTargetRelease | null; + /** + * status of promotion + * + * @example "pending" + */ + readonly status: 'pending' | 'succeeded' | 'failed'; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * the app which was promoted to + */ +export interface PipelinePromotionTargetApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - pipeline-promotion](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion) + * Promotions allow you to move code from an app in a pipeline to all targets + */ +export interface PipelinePromotion { + /** + * when promotion was created + * + * @example "2012-01-01T12:00:00Z" + */ + created_at: string; + /** + * unique identifier of promotion + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * the pipeline which the promotion belongs to + */ + pipeline: Pipeline; + /** + * the app being promoted from + */ + source: Source; + /** + * status of promotion + * + * @example "pending" + */ + readonly status: 'pending' | 'completed'; + /** + * when promotion was updated + * + * @example "2012-01-01T12:00:00Z" + */ + updated_at: string | null; +} +/** + * + * [Heroku Platform API - release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * the release which was created on the target app + */ +export interface PipelinePromotionTargetRelease { + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - source](https://devcenter.heroku.com/articles/platform-api-reference#source) + * A source is a location for uploading and downloading an application's source code. + */ +export interface Source { + /** + * pointer to the URL where clients can fetch or store the source + */ + source_blob: SourceSourceBlob; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * the app which was promoted from + */ +export interface SourceApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * the release used to promoted from + */ +export interface SourceRelease { + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface PipelinePromotionCreatePayload { + /** + * pipeline involved in the promotion + */ + pipeline: Pipeline; + /** + * the app being promoted from + */ + source: PipelinePromotionCreatePayloadSource; + targets: Array<{ + /** + * the app is being promoted to + */ + app?: PipelinePromotionCreatePayloadApp; + }>; +} +/** + * + * [Heroku Platform API - source](https://devcenter.heroku.com/articles/platform-api-reference#source) + * the app being promoted from + */ +export interface PipelinePromotionCreatePayloadSource { + /** + * the app which was promoted from + */ + app?: PipelinePromotionCreatePayloadSourceApp; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * the app which was promoted from + */ +export interface PipelinePromotionCreatePayloadSourceApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * the app is being promoted to + */ +export interface PipelinePromotionCreatePayloadApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - pipeline-stack](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-stack) + * A pipeline's stack is determined by the apps in the pipeline. This is used during creation of CI and Review Apps that have no stack defined in app.json + */ +export interface PipelineStack { + /** + * identity of the stack that will be used for new builds without a stack defined in CI and Review Apps + */ + stack?: Stack | null; +} +/** + * + * [Heroku Platform API - pipeline-transfer](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-transfer) + * A pipeline transfer is the process of changing pipeline ownership along with the contained apps. + */ +export interface PipelineTransfer { + /** + * pipeline being transferred + */ + pipeline?: Pipeline; + /** + * Previous owner of the pipeline. + */ + previous_owner?: Record; + /** + * New owner of the pipeline. + */ + new_owner?: Record; +} +export interface PipelineTransferCreatePayload { + /** + * The pipeline to transfer + */ + pipeline: Pipeline; + /** + * New pipeline owner + */ + new_owner: NewOwner; +} +/** + * + * New pipeline owner + */ +export interface NewOwner { + /** + * unique identifier of a pipeline owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + id?: string; + /** + * type of pipeline owner + * + * @example "team" + */ + type?: string; +} +/** + * + * Owner of a pipeline. + */ +export interface PipelineOwner { + /** + * unique identifier of a pipeline owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + id: string; + /** + * type of pipeline owner + * + * @example "team" + */ + type: string; +} +export interface PipelineCreatePayload { + /** + * name of pipeline + * + * @example "example" + */ + name: string; + /** + * Owner of a pipeline. + */ + owner?: PipelineCreatePayloadOwner | null; +} +/** + * + * Owner of a pipeline. + */ +export interface PipelineCreatePayloadOwner { + /** + * unique identifier of a pipeline owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + id: string; + /** + * type of pipeline owner + * + * @example "team" + */ + type: string; +} +export interface PipelineUpdatePayload { + /** + * name of pipeline + * + * @example "example" + */ + name?: string; +} +/** + * + * [Heroku Platform API - rate-limit](https://devcenter.heroku.com/articles/platform-api-reference#rate-limit) + * Rate Limit represents the number of request tokens each account holds. Requests to this endpoint do not count towards the rate limit. + */ +export interface RateLimit { + /** + * allowed requests remaining in current interval + * + * @example 2399 + */ + readonly remaining: number; +} +export interface ReleaseCreatePayload { + /** + * description of changes in this release + * + * @example "Added new feature" + */ + readonly description?: string; + /** + * unique identifier of slug + */ + slug: string; +} +export interface ReleaseRollbackPayload { + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly release: string; +} +/** + * + * [Heroku Platform API - review-app](https://devcenter.heroku.com/articles/platform-api-reference#review-app) + * An ephemeral app to review a set of changes + */ +export interface ReviewApp { + /** + * the Heroku app associated to this review app + */ + app: null | ReviewAppApp; + /** + * the app setup for this review app + */ + app_setup: null | ReviewAppAppSetup; + /** + * the branch of the repository which the review app is based on + */ + readonly branch: string; + /** + * when test run was created + */ + readonly created_at: string; + /** + * unique identifier of the review app + */ + readonly id: string; + /** + * the pipeline which this review app belongs to + */ + pipeline: ReviewAppPipeline; + /** + * current state of the review app + */ + readonly status: 'pending' | 'creating' | 'created' | 'deleting' | 'deleted' | 'errored'; + /** + * when review app was updated + */ + readonly updated_at: string; + /** + * The user who created the review app + */ + readonly creator: Record; + /** + * wait for ci before building the app + * + * @example true + */ + readonly wait_for_ci: boolean; + /** + * error message from creating the review app if any + */ + readonly error_status: string | null; + /** + * message from creating the review app if any + */ + readonly message: string | null; + fork_repo: ForkRepo | null; + /** + * pull request number the review app is built for + * + * @example 24 + */ + readonly pr_number: number | null; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * the Heroku app associated to this review app + */ +export interface ReviewAppApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * the app setup for this review app + */ +export interface ReviewAppAppSetup { + /** + * unique identifier of app setup + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * the pipeline which this review app belongs to + */ +export interface ReviewAppPipeline { + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface ForkRepo { + /** + * repository id of the fork the branch resides in + * + * @example "123456" + */ + readonly id: number | null; +} +export interface ReviewAppCreatePayload { + /** + * the branch of the repository which the review app is based on + */ + readonly branch: string; + /** + * pull request number the review app is built for + * + * @example 24 + */ + readonly pr_number?: number | null; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly pipeline: string; + /** + * The download location for the review app's source code + */ + source_blob: ReviewAppCreatePayloadSourceBlob; + /** + * hash of config vars + * + * @example {"FOO":"bar","BAZ":"qux"} + */ + environment?: Record | null; + /** + * repository id of the fork the branch resides in + * + * @example "123456" + */ + readonly fork_repo_id?: number | null; +} +/** + * + * The download location for the review app's source code + */ +export interface ReviewAppCreatePayloadSourceBlob { + /** + * URL where gzipped tar archive of source code for build was downloaded. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly url: string; + /** + * The version number (or SHA) of the code to build. + * + * @example "v1.2.0" + */ + version: string | null; +} +/** + * + * [Heroku Platform API - review-app-config](https://devcenter.heroku.com/articles/platform-api-reference#review-app-config) + * Review apps can be configured for pipelines. + */ +export interface ReviewAppConfig { + repo?: Repo; + /** + * enable automatic review apps for pull requests + * + * @example true + */ + readonly automatic_review_apps?: boolean; + /** + * the deploy target for the review apps of a pipeline + */ + deploy_target?: DeployTarget | null; + /** + * automatically destroy review apps when they haven't been deployed for a number of days + * + * @example true + */ + readonly destroy_stale_apps?: boolean; + /** + * number of days without a deployment after which to consider a review app stale + * + * @example "5" + */ + readonly stale_days?: number; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly pipeline_id?: string; + /** + * If true, review apps are created only when CI passes + * + * @example true + */ + readonly wait_for_ci?: boolean; + /** + * A unique prefix that will be used to create review app names + * + * @example "singular-app" + */ + readonly base_name?: null | string; +} +export interface Repo { + /** + * repository id + * + * @example "123456" + */ + readonly id: number; +} +/** + * + * the deploy target for the review apps of a pipeline + */ +export interface DeployTarget { + /** + * unique identifier of deploy target + * + * @example "us" + */ + readonly id: string; + /** + * type of deploy target + * + * @example "region" + */ + readonly type: string; +} +export interface ReviewAppConfigEnablePayload { + /** + * repository name + * + * @example "heroku/homebrew-brew" + */ + readonly repo: string; + /** + * enable automatic review apps for pull requests + * + * @example true + */ + readonly automatic_review_apps?: boolean; + /** + * automatically destroy review apps when they haven't been deployed for a number of days + * + * @example true + */ + readonly destroy_stale_apps?: boolean; + /** + * number of days without a deployment after which to consider a review app stale + * + * @example "5" + */ + readonly stale_days?: number; + /** + * the deploy target for the review apps of a pipeline + */ + deploy_target?: DeployTarget | null; + /** + * If true, review apps are created only when CI passes + * + * @example true + */ + readonly wait_for_ci?: boolean; + /** + * A unique prefix that will be used to create review app names + * + * @example "singular-app" + */ + readonly base_name?: null | string; +} +export interface ReviewAppConfigUpdatePayload { + /** + * enable automatic review apps for pull requests + * + * @example true + */ + readonly automatic_review_apps?: boolean; + /** + * automatically destroy review apps when they haven't been deployed for a number of days + * + * @example true + */ + readonly destroy_stale_apps?: boolean; + /** + * number of days without a deployment after which to consider a review app stale + * + * @example "5" + */ + readonly stale_days?: number; + /** + * the deploy target for the review apps of a pipeline + */ + deploy_target?: DeployTarget | null; + /** + * If true, review apps are created only when CI passes + * + * @example true + */ + readonly wait_for_ci?: boolean; + /** + * A unique prefix that will be used to create review app names + * + * @example "singular-app" + */ + readonly base_name?: null | string; +} +/** + * + * pointer to the url where clients can fetch or store the actual release binary + */ +export interface Blob { + /** + * method to be used to interact with the slug blob + * + * @example "GET" + */ + readonly method: string; + /** + * URL to interact with the slug blob + * + * @example "https://api.heroku.com/slugs/1234.tgz" + */ + readonly url: string; +} +export interface SlugCreatePayload { + /** + * description from buildpack of slug + * + * @example "Ruby/Rack" + */ + buildpack_provided_description?: null | string; + /** + * an optional checksum of the slug for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum?: null | string; + /** + * identification of the code with your version control system (eg: SHA of the git HEAD) + * + * @example "60883d9e8947a57e04dc9124f25df004866a2051" + */ + commit?: null | string; + /** + * an optional description of the provided commit + * + * @example "fixed a bug with API documentation" + */ + commit_description?: null | string; + /** + * hash mapping process type names to their respective command + * + * @example {"web":"./bin/web -p $PORT"} + */ + process_types: Record; + /** + * unique name of stack or unique identifier of stack + */ + stack?: string; +} +/** + * + * [Heroku Platform API - sms-number](https://devcenter.heroku.com/articles/platform-api-reference#sms-number) + * SMS numbers are used for recovery on accounts with two-factor authentication enabled. + */ +export interface SmsNumber { + /** + * SMS number of account + * + * @example "+1 ***-***-1234" + */ + readonly sms_number: string | null; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * application that this SSL certificate is on + */ +export interface SniEndpointApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of app + * + * @example "example" + */ + name: string; +} +/** + * + * certificate provided by this endpoint + */ +export interface SslCert { + readonly 'ca_signed?'?: boolean; + readonly cert_domains?: unknown[]; + readonly expires_at?: string; + readonly issuer?: string; + readonly 'self_signed?'?: boolean; + readonly starts_at?: string; + readonly subject?: string; + /** + * unique identifier of this SSL certificate + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface SniEndpointCreatePayload { + /** + * raw contents of the public certificate chain (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate_chain: string; + /** + * contents of the private key (eg .key file) + * + * @example "-----BEGIN RSA PRIVATE KEY----- ..." + */ + private_key: string; +} +export interface SniEndpointUpdatePayload { + /** + * raw contents of the public certificate chain (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate_chain: string; + /** + * contents of the private key (eg .key file) + * + * @example "-----BEGIN RSA PRIVATE KEY----- ..." + */ + private_key: string; +} +/** + * + * pointer to the URL where clients can fetch or store the source + */ +export interface SourceSourceBlob { + /** + * URL to download the source + * + * @example "https://api.heroku.com/sources/1234.tgz" + */ + readonly get_url: string; + /** + * URL to upload the source + * + * @example "https://api.heroku.com/sources/1234.tgz" + */ + readonly put_url: string; +} +/** + * + * [Heroku Platform API - space-app-access](https://devcenter.heroku.com/articles/platform-api-reference#space-app-access) + * Space access represents the permissions a particular user has on a particular space. + */ +export interface SpaceAppAccess { + /** + * space user belongs to + */ + space?: SpaceAppAccessSpace; + /** + * when space was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of space + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * user space permissions + */ + permissions?: Array<{ + description?: string; + name?: string; + }>; + /** + * when space was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; + /** + * identity of user account + */ + user?: User; +} +/** + * + * [Heroku Platform API - space](https://devcenter.heroku.com/articles/platform-api-reference#space) + * space user belongs to + */ +export interface SpaceAppAccessSpace { + /** + * unique name of app + * + * @example "example" + */ + name: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +export interface SpaceAppAccessUpdatePayload { + permissions: Array<{ + name?: string; + }>; +} +/** + * + * [Heroku Platform API - space-nat](https://devcenter.heroku.com/articles/platform-api-reference#space-nat) + * Network address translation (NAT) for stable outbound IP addresses from a space + */ +export interface SpaceNat { + /** + * when network address translation for a space was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * potential IPs from which outbound network traffic will originate + */ + readonly sources: string[]; + /** + * availability of network address translation for a space + * + * @example "enabled" + */ + readonly state: 'disabled' | 'updating' | 'enabled'; + /** + * when network address translation for a space was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - space-topology](https://devcenter.heroku.com/articles/platform-api-reference#space-topology) + * Space Topology provides you with a mechanism for viewing all the running dynos, formations and applications for a space. This is the same data thats used to power our DNS Service Discovery. + */ +export interface SpaceTopology { + /** + * version of the space topology payload + * + * @example 1 + */ + readonly version: number; + /** + * The apps within this space + */ + readonly apps: Array<{ + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * + * @example ["example.com","example.net"] + */ + readonly domains?: unknown[]; + /** + * formations for application + */ + readonly formation?: SpaceTopologyFormation[]; + }>; +} +/** + * + * formations for application + */ +export interface SpaceTopologyFormation { + /** + * unique identifier of this process type + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * Name of process type + * + * @example "web" + */ + process_type?: string; + /** + * Current dynos for application + */ + dynos?: SpaceTopologyDyno[]; +} +/** + * + * A dyno + */ +export interface SpaceTopologyDyno { + /** + * unique identifier of this dyno + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * process number, e.g. 1 in web.1 + * + * @example 1 + */ + number?: number; + /** + * RFC1918 Address of Dyno + * + * @example "10.0.134.42" + */ + private_ip?: string; + /** + * localspace hostname of resource + * + * @example "1.example-app-90210.app.localspace" + */ + hostname?: string; +} +export interface SpaceTransferTransferPayload { + /** + * unique name of team + * + * @example "example" + */ + readonly new_owner: string; +} +/** + * + * [Heroku Platform API - team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * team that owns this space + */ +export interface SpaceTeam { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * [Heroku Platform API - region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * identity of space region + */ +export interface SpaceRegion { + /** + * unique identifier of region + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of region + * + * @example "us" + */ + readonly name: string; +} +export interface SpaceUpdatePayload { + /** + * unique name of space + * + * @example "nasa" + */ + name?: string; +} +export interface SpaceCreatePayload { + /** + * unique name of space + * + * @example "nasa" + */ + name: string; + /** + * unique name of team + * + * @example "example" + */ + readonly team: string; + /** + * unique identifier of region or unique name of region + */ + region?: string; + /** + * true if this space has shield enabled + * + * @example true + */ + readonly shield?: boolean; + /** + * The RFC-1918 CIDR the Private Space will use. It must be a /16 in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 + * + * @example "172.20.20.30/16" + */ + cidr?: string; + /** + * The RFC-1918 CIDR that the Private Space will use for the Heroku-managed peering connection that's automatically created when using Heroku Data add-ons. It must be between a /16 and a /20 + * + * @example "10.2.0.0/16" + */ + data_cidr?: string; + /** + * URL to which all apps will drain logs. Only settable during space creation and enables direct logging. Must use HTTPS. + * + * @example "https://example.com/logs" + */ + log_drain_url?: string; +} +/** + * + * [Heroku Platform API - team-app-collaborator](https://devcenter.heroku.com/articles/platform-api-reference#team-app-collaborator) + * A team collaborator represents an account that has been given access to a team app on Heroku. + */ +export interface TeamAppCollaborator { + /** + * app collaborator belongs to + */ + app?: TeamAppCollaboratorApp; + /** + * when collaborator was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of collaborator + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * array of permissions for the collaborator (only applicable if the app is on a team) + */ + permissions?: TeamAppPermission[]; + /** + * role in the team + * + * @example "admin" + */ + readonly role?: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; + /** + * when collaborator was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; + /** + * identity of collaborated account + */ + user?: TeamAppCollaboratorUser; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app collaborator belongs to + */ +export interface TeamAppCollaboratorApp { + /** + * unique name of app + * + * @example "example" + */ + name: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * identity of collaborated account + */ +export interface TeamAppCollaboratorUser { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated: boolean; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +export interface TeamAppCollaboratorCreatePayload { + /** + * An array of permissions to give to the collaborator. + */ + permissions?: string[]; + /** + * whether to suppress email invitation when creating collaborator + */ + silent?: boolean; + /** + * unique email address of account or unique identifier of an account or Implicit reference to currently authorized user + */ + user: string; +} +export interface TeamAppCollaboratorUpdatePayload { + /** + * An array of permissions to give to the collaborator. + */ + permissions: string[]; +} +export interface TeamAppCreatePayload { + /** + * are other team members forbidden from joining this app. + */ + locked?: boolean; + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique name of team + * + * @example "example" + */ + readonly team?: string; + /** + * force creation of the app in the user account even if a default team is set. + */ + personal?: boolean; + /** + * unique name of region + * + * @example "us" + */ + readonly region?: string; + /** + * unique name of space + * + * @example "nasa" + */ + space?: string; + /** + * unique name of stack + * + * @example "heroku-18" + */ + readonly stack?: string; + /** + * describes whether a Private Spaces app is externally routable or not + */ + internal_routing?: boolean | null; +} +export interface TeamAppUpdateLockedPayload { + /** + * are other team members forbidden from joining this app. + */ + locked: boolean; +} +export interface TeamAppTransferToAccountPayload { + /** + * unique email address of account or unique identifier of an account or Implicit reference to currently authorized user + */ + owner: string; +} +export interface TeamAppTransferToTeamPayload { + /** + * unique name of team + * + * @example "example" + */ + readonly owner: string; +} +/** + * + * [Heroku Platform API - team-daily-usage](https://devcenter.heroku.com/articles/platform-api-reference#team-daily-usage) + * Usage for an enterprise team at a daily resolution. + */ +export interface TeamDailyUsage { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons: number; + /** + * app usage in the team + */ + apps: AppUsageDaily[]; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data: number; + /** + * date of the usage + * + * @example "2019-01-01" + */ + readonly date: string; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos: number; + /** + * team identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * name of the team + * + * @example "ops" + */ + readonly name: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space: number; +} +export interface TeamDailyUsageInfoPayload { + /** + * range start date + * + * @example "2019-01-25" + */ + readonly start: string; + /** + * range end date + * + * @example "2019-02-25" + */ + readonly end?: string; +} +/** + * + * [Heroku Platform API - team-delinquency](https://devcenter.heroku.com/articles/platform-api-reference#team-delinquency) + * A Heroku team becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent teams if their invoices remain unpaid. + */ +export interface TeamDelinquency { + /** + * scheduled time of when we will suspend your team due to delinquency + * + * @example "2024-01-01T12:00:00Z" + */ + readonly scheduled_suspension_time: string | null; + /** + * scheduled time of when we will delete your team due to delinquency + * + * @example "2024-01-01T12:00:00Z" + */ + readonly scheduled_deletion_time: string | null; +} +/** + * + * [Heroku Platform API - team-feature](https://devcenter.heroku.com/articles/platform-api-reference#team-feature) + * A team feature represents a feature enabled on a team account. + */ +export interface TeamFeature { + /** + * when team feature was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of team feature + * + * @example "Causes account to example." + */ + readonly description: string; + /** + * documentation URL of team feature + * + * @example "http://devcenter.heroku.com/articles/example" + */ + readonly doc_url: string; + /** + * whether or not team feature has been enabled + * + * @example true + */ + enabled: boolean; + /** + * unique identifier of team feature + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of team feature + * + * @example "name" + */ + readonly name: string; + /** + * state of team feature + * + * @example "public" + */ + readonly state: string; + /** + * when team feature was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user readable feature name + * + * @example "My Feature" + */ + readonly display_name: string; + /** + * e-mail to send feedback about the feature + * + * @example "feedback@heroku.com" + */ + readonly feedback_email: string; +} +/** + * + * [Heroku Platform API - team-invitation](https://devcenter.heroku.com/articles/platform-api-reference#team-invitation) + * A team invitation represents an invite to a team. + */ +export interface TeamInvitation { + /** + * when invitation was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of an invitation + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + invited_by: InvitedBy; + team: TeamInvitationTeam; + /** + * role in the team + * + * @example "admin" + */ + readonly role: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; + /** + * when invitation was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + user: TeamInvitationUser; +} +export interface InvitedBy { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name: string | null; +} +export interface TeamInvitationTeam { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; +} +export interface TeamInvitationUser { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name: string | null; +} +export interface TeamInvitationCreatePayload { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * role in the team + * + * @example "admin" + */ + readonly role: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; +} +/** + * + * A team member is an individual with access to a team. + */ +export interface TeamMember { + /** + * when the membership record was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * email address of the team member + * + * @example "someone@example.org" + */ + readonly email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated: boolean; + /** + * unique identifier of the team member + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * Identity Provider information the member is federated with + */ + identity_provider?: null | TeamMemberIdentityProvider; + /** + * role in the team + * + * @example "admin" + */ + readonly role?: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; + /** + * whether the team member has two factor authentication enabled + * + * @example true + */ + readonly two_factor_authentication?: boolean; + /** + * when the membership record was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user information for the membership + */ + user?: TeamMemberUser; +} +/** + * + * Identity Provider information the member is federated with + */ +export interface TeamMemberIdentityProvider { + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of the identity provider + * + * @example "acme" + */ + readonly name?: string; + /** + * whether the identity_provider information is redacted or not + */ + readonly redacted?: boolean; + /** + * entity that owns this identity provider + */ + owner?: Owner; +} +/** + * + * user information for the membership + */ +export interface TeamMemberUser { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name: string | null; +} +/** + * + * [Heroku Platform API - team-invoice](https://devcenter.heroku.com/articles/platform-api-reference#team-invoice) + * A Team Invoice is an itemized bill of goods for a team which includes pricing and charges. + */ +export interface TeamInvoice { + /** + * total add-ons charges in on this invoice + * + * @example 25000 + */ + readonly addons_total: number; + /** + * total database charges on this invoice + * + * @example 25000 + */ + readonly database_total: number; + /** + * total charges on this invoice + */ + readonly charges_total: number; + /** + * when invoice was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * total credits on this invoice + * + * @example 100000 + */ + readonly credits_total: number; + /** + * total amount of dyno units consumed across dyno types. + * + * @example 1.92 + */ + readonly dyno_units: number; + /** + * unique identifier of this invoice + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * human readable invoice number + * + * @example 9403943 + */ + readonly number: number; + /** + * status of the invoice payment + * + * @example "Paid" + */ + readonly payment_status: string; + /** + * the ending date that the invoice covers + * + * @example "01/31/2014" + */ + readonly period_end: string; + /** + * the starting date that this invoice covers + * + * @example "01/01/2014" + */ + readonly period_start: string; + /** + * total platform charges on this invoice + * + * @example 50000 + */ + readonly platform_total: number; + /** + * payment status for this invoice (pending, successful, failed) + * + * @example 1 + */ + readonly state: number; + /** + * combined total of charges and credits on this invoice + * + * @example 100000 + */ + readonly total: number; + /** + * when invoice was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * The total amount of hours consumed across dyno types. + * + * @example 1488 + */ + readonly weighted_dyno_hours: number; +} +export interface TeamMemberCreateOrUpdatePayload { + /** + * email address of the team member + * + * @example "someone@example.org" + */ + readonly email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated?: boolean; + /** + * role in the team + * + * @example "admin" + */ + role: 'admin' | 'viewer' | 'member'; +} +export interface TeamMemberCreatePayload { + /** + * email address of the team member + * + * @example "someone@example.org" + */ + readonly email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated?: boolean; + /** + * role in the team + * + * @example "admin" + */ + role: 'admin' | 'viewer' | 'member'; +} +export interface TeamMemberUpdatePayload { + /** + * email address of the team member + * + * @example "someone@example.org" + */ + readonly email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated?: boolean; + /** + * role in the team + * + * @example "admin" + */ + role: 'admin' | 'viewer' | 'member'; +} +/** + * + * [Heroku Platform API - team-monthly-usage](https://devcenter.heroku.com/articles/platform-api-reference#team-monthly-usage) + * Usage for an enterprise team at a monthly resolution. + */ +export interface TeamMonthlyUsage { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons: number; + /** + * app usage in the team + */ + apps: AppUsageMonthly[]; + /** + * average connect rows synced + * + * @example 15000 + */ + readonly connect: number; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos: number; + /** + * team identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * year and month of the usage + * + * @example "2019-01" + */ + readonly month: string; + /** + * name of the team + * + * @example "ops" + */ + readonly name: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space: number; +} +export interface TeamMonthlyUsageInfoPayload { + /** + * range start date + * + * @example "2019-01" + */ + readonly start: string; + /** + * range end date + * + * @example "2019-02" + */ + readonly end?: string; +} +/** + * + * [Heroku Platform API - team-preferences](https://devcenter.heroku.com/articles/platform-api-reference#team-preferences) + * Tracks a Team's Preferences + */ +export interface TeamPreferences { + /** + * The default permission used when adding new members to the team + * + * @example "member" + */ + 'default-permission': null | 'admin' | 'member' | 'viewer' | ''; + /** + * Whether add-on service rules should be applied to add-on installations + * + * @example true + */ + 'addons-controls': boolean | null; +} +export interface TeamPreferencesUpdatePayload { + /** + * Whether add-on service rules should be applied to add-on installations + * + * @example true + */ + 'addons-controls'?: boolean | null; +} +export interface TeamEnterpriseAccount { + /** + * unique identifier of the enterprise account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of the enterprise account + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * Identity Provider associated with the Team + */ +export interface TeamIdentityProvider { + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * user-friendly unique identifier for this identity provider + * + * @example "acme-sso" + */ + name: string; + /** + * entity that owns this identity provider + */ + owner: Owner; +} +export interface TeamUpdatePayload { + /** + * whether to use this team when none is specified + * + * @example true + */ + default?: boolean; + /** + * unique name of team + * + * @example "example" + */ + readonly name?: string; +} +export interface TeamCreatePayload { + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; + /** + * street address line 1 + * + * @example "40 Hickory Lane" + */ + address_1?: string; + /** + * street address line 2 + * + * @example "Suite 103" + */ + address_2?: string | null; + /** + * encrypted card number of payment method + * + * @example "encrypted-card-number" + */ + card_number?: string | null; + /** + * city + * + * @example "San Francisco" + */ + city?: string; + /** + * country + * + * @example "US" + */ + country?: string; + /** + * card verification value + * + * @example "123" + */ + cvv?: string | null; + /** + * expiration month + * + * @example "11" + */ + expiration_month?: string | null; + /** + * expiration year + * + * @example "2014" + */ + expiration_year?: string | null; + /** + * the first name for payment method + * + * @example "Jason" + */ + first_name?: string; + /** + * the last name for payment method + * + * @example "Walker" + */ + last_name?: string; + /** + * metadata + * + * @example "Additional information for payment method" + */ + other?: string | null; + /** + * postal code + * + * @example "90210" + */ + postal_code?: string; + /** + * state + * + * @example "CA" + */ + state?: string; + /** + * Nonce generated by Braintree hosted fields form + * + * @example "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" + */ + nonce?: string | null; + /** + * Device data string generated by the client + * + * @example "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" + */ + device_data?: string | null; +} +export interface TeamCreateInEnterpriseAccountPayload { + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; +} +/** + * + * [Heroku Platform API - test-case](https://devcenter.heroku.com/articles/platform-api-reference#test-case) + * A single test case belonging to a test run + */ +export interface TestCase { + /** + * unique identifier of a test case + */ + readonly id: string; + /** + * when test case was created + */ + readonly created_at: string; + /** + * when test case was updated + */ + readonly updated_at: string; + /** + * description of the test case + */ + description: string; + /** + * meta information about the test case + */ + diagnostic: string; + /** + * special note about the test case e.g. skipped, todo + */ + directive: string; + /** + * whether the test case was successful + */ + passed: boolean; + /** + * the test number + */ + number: number; + /** + * the test node which executed this test case + */ + test_node: TestNode; + /** + * the test run which owns this test case + */ + test_run: TestRun; +} +/** + * + * [Heroku Platform API - test-node](https://devcenter.heroku.com/articles/platform-api-reference#test-node) + * A single test node belonging to a test run + */ +export interface TestNode { + /** + * when test node was created + */ + readonly created_at: string; + /** + * the dyno which belongs to this test node + */ + dyno: TestNodeDyno | null; + /** + * the status of the test run when the error occured + */ + error_status: string | null; + /** + * the exit code of the test script + */ + exit_code: number | null; + /** + * unique identifier of a test node + */ + id: string; + /** + * The index of the test node + */ + index: number; + /** + * human friendly message indicating reason for an error + */ + message: string | null; + /** + * the streaming output for the test node + * + * @example "https://example.com/output.log" + */ + output_stream_url: string; + /** + * the pipeline which owns this test node + */ + pipeline: TestNodePipeline; + /** + * the streaming test setup output for the test node + * + * @example "https://example.com/test-setup.log" + */ + setup_stream_url: string; + /** + * current state of the test run + */ + readonly status: 'pending' | 'cancelled' | 'creating' | 'building' | 'running' | 'succeeded' | 'failed' | 'errored' | 'debugging'; + /** + * when test node was updated + */ + readonly updated_at: string; + /** + * the test run which owns this test node + */ + test_run: TestRun; +} +/** + * + * [Heroku Platform API - test-run](https://devcenter.heroku.com/articles/platform-api-reference#test-run) + * An execution or trial of one or more tests + */ +export interface TestRun { + /** + * the email of the actor triggering the test run + */ + actor_email: string; + /** + * whether the test was run with an empty cache + */ + clear_cache: boolean | null; + /** + * the branch of the repository that the test run concerns + */ + commit_branch: string; + /** + * the message for the commit under test + */ + commit_message: string; + /** + * the SHA hash of the commit under test + */ + commit_sha: string; + /** + * whether the test run was started for interactive debugging + */ + debug: boolean; + /** + * the app setup for the test run + */ + app_setup: null | Record; + /** + * when test run was created + */ + readonly created_at: string; + /** + * the type of dynos used for this test-run + */ + dyno: null | TestRunDyno; + /** + * unique identifier of a test run + */ + readonly id: string; + /** + * human friendly message indicating reason for an error + */ + message: string | null; + /** + * the auto incrementing test run number + */ + number: number; + /** + * the team that owns this test-run + */ + organization: null | Organization; + /** + * the pipeline which owns this test-run + */ + pipeline: TestRunPipeline; + /** + * current state of the test run + */ + readonly status: 'pending' | 'cancelled' | 'creating' | 'building' | 'running' | 'succeeded' | 'failed' | 'errored' | 'debugging'; + /** + * The download location for the source code to be tested + */ + source_blob_url: string; + /** + * when test-run was updated + */ + readonly updated_at: string; + /** + * An account represents an individual signed up to use the Heroku platform. + */ + user: Account; + /** + * human friently warning emitted during the test run + */ + warning_message: string | null; +} +/** + * + * [Heroku Platform API - dyno](https://devcenter.heroku.com/articles/platform-api-reference#dyno) + * the dyno which belongs to this test node + */ +export interface TestNodeDyno { + /** + * unique identifier of this dyno or the name of this process on this dyno + */ + id?: string; + /** + * a URL to stream output from for debug runs or null for non-debug runs + * + * @example "rendezvous://rendezvous.runtime.heroku.com:5000/{rendezvous-id}" + */ + readonly attach_url?: string | null; +} +/** + * + * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * the pipeline which owns this test node + */ +export interface TestNodePipeline { + /** + * unique identifier of pipeline or name of pipeline + */ + id?: string; +} +/** + * + * [Heroku Platform API - dyno](https://devcenter.heroku.com/articles/platform-api-reference#dyno) + * the type of dynos used for this test-run + */ +export interface TestRunDyno { + /** + * dyno size + * + * @example "standard-1X" + */ + size?: string; +} +/** + * + * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * the pipeline which owns this test-run + */ +export interface TestRunPipeline { + /** + * unique identifier of pipeline or name of pipeline + */ + id?: string; +} +export interface TestRunCreatePayload { + /** + * the branch of the repository that the test run concerns + */ + commit_branch: string; + /** + * the message for the commit under test + */ + commit_message: string; + /** + * the SHA hash of the commit under test + */ + commit_sha: string; + /** + * whether the test run was started for interactive debugging + */ + debug?: boolean; + /** + * unique name of team or unique identifier of team + */ + organization?: string; + /** + * unique identifier of pipeline or name of pipeline + */ + pipeline: string; + /** + * The download location for the source code to be tested + */ + source_blob_url: string; +} +export interface TestRunUpdatePayload { + /** + * current state of the test run + */ + readonly status: 'pending' | 'cancelled' | 'creating' | 'building' | 'running' | 'succeeded' | 'failed' | 'errored' | 'debugging'; + /** + * human friendly message indicating reason for an error + */ + message: string | null; +} +/** + * + * [Heroku Platform API - user-preferences](https://devcenter.heroku.com/articles/platform-api-reference#user-preferences) + * Tracks a user's preferences and message dismissals + */ +export interface UserPreferences { + /** + * User's default timezone + * + * @example "UTC" + */ + timezone: string | null; + /** + * User's default team + * + * @example "sushi-inc" + */ + 'default-organization': string | null; + /** + * Whether the user has dismissed the GitHub link banner + * + * @example true + */ + 'dismissed-github-banner': boolean | null; + /** + * Whether the user has dismissed the getting started banner + * + * @example true + */ + 'dismissed-getting-started': boolean | null; + /** + * Whether the user has dismissed the Organization Access Controls banner + * + * @example true + */ + 'dismissed-org-access-controls': boolean | null; + /** + * Whether the user has dismissed the Organization Wizard + * + * @example true + */ + 'dismissed-org-wizard-notification': boolean | null; + /** + * Whether the user has dismissed the Pipelines banner + * + * @example true + */ + 'dismissed-pipelines-banner': boolean | null; + /** + * Whether the user has dismissed the GitHub banner on a pipeline overview + * + * @example true + */ + 'dismissed-pipelines-github-banner': boolean | null; + /** + * Which pipeline uuids the user has dismissed the GitHub banner for + * + * @example ["96c68759-f310-4910-9867-e0b062064098"] + */ + 'dismissed-pipelines-github-banners': null | string[]; + /** + * Whether the user has dismissed the 2FA SMS banner + * + * @example true + */ + 'dismissed-sms-banner': boolean | null; +} +export interface UserPreferencesUpdatePayload { + /** + * User's default timezone + * + * @example "UTC" + */ + timezone?: string | null; + /** + * User's default team + * + * @example "sushi-inc" + */ + 'default-organization'?: string | null; + /** + * Whether the user has dismissed the GitHub link banner + * + * @example true + */ + 'dismissed-github-banner'?: boolean | null; + /** + * Whether the user has dismissed the getting started banner + * + * @example true + */ + 'dismissed-getting-started'?: boolean | null; + /** + * Whether the user has dismissed the Organization Access Controls banner + * + * @example true + */ + 'dismissed-org-access-controls'?: boolean | null; + /** + * Whether the user has dismissed the Organization Wizard + * + * @example true + */ + 'dismissed-org-wizard-notification'?: boolean | null; + /** + * Whether the user has dismissed the Pipelines banner + * + * @example true + */ + 'dismissed-pipelines-banner'?: boolean | null; + /** + * Whether the user has dismissed the GitHub banner on a pipeline overview + * + * @example true + */ + 'dismissed-pipelines-github-banner'?: boolean | null; + /** + * Which pipeline uuids the user has dismissed the GitHub banner for + * + * @example ["96c68759-f310-4910-9867-e0b062064098"] + */ + 'dismissed-pipelines-github-banners'?: null | string[]; + /** + * Whether the user has dismissed the 2FA SMS banner + * + * @example true + */ + 'dismissed-sms-banner'?: boolean | null; +} +/** + * + * [Heroku Platform API - vpn-connection](https://devcenter.heroku.com/articles/platform-api-reference#vpn-connection) + * [VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN. + */ +export interface VpnConnection { + /** + * VPN ID + * + * @example "123456789012" + */ + readonly id: string; + /** + * VPN Name + * + * @example "office" + */ + name: string; + /** + * Public IP of VPN customer gateway + * + * @example "35.161.69.30" + */ + public_ip: string; + /** + * Routable CIDRs of VPN + */ + routable_cidrs: string[]; + /** + * CIDR Block of the Private Space + * + * @example "10.0.0.0/16" + */ + readonly space_cidr_block: string; + tunnels: Tunnel[]; + /** + * IKE Version + * + * @example 1 + */ + readonly ike_version: number; + /** + * Status of the VPN + * + * @example "active" + */ + readonly status: 'pending' | 'provisioning' | 'active' | 'deprovisioning' | 'failed'; + /** + * Details of the status + * + * @example "supplied CIDR block already in use" + */ + readonly status_message: string; +} +/** + * + * Tunnel info + */ +export interface Tunnel { + /** + * Timestamp of last status changed + * + * @example "2016-10-25T22:09:05Z" + */ + last_status_change?: string; + /** + * Public IP address for the tunnel + * + * @example "52.44.146.197" + */ + ip?: string; + /** + * Public IP address for the customer side of the tunnel + * + * @example "52.44.146.197" + */ + customer_ip?: string; + /** + * Pre-shared key + * + * @example "secret" + */ + pre_shared_key?: string; + /** + * Status of the tunnel + * + * @example "UP" + */ + status?: 'UP' | 'DOWN'; + /** + * Details of the status + * + * @example "status message" + */ + status_message?: string; +} +export interface VpnConnectionCreatePayload { + /** + * VPN Name + * + * @example "office" + */ + name: string; + /** + * Public IP of VPN customer gateway + * + * @example "35.161.69.30" + */ + public_ip: string; + /** + * Routable CIDRs of VPN + */ + routable_cidrs: string[]; +} +export interface VpnConnectionUpdatePayload { + /** + * Routable CIDRs of VPN + */ + routable_cidrs: string[]; +} diff --git a/lib/cjs/index.js b/lib/cjs/index.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/lib/cjs/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/lib/cjs/services/account-delinquency-service.d.ts b/lib/cjs/services/account-delinquency-service.d.ts new file mode 100644 index 0000000..ab9fe60 --- /dev/null +++ b/lib/cjs/services/account-delinquency-service.d.ts @@ -0,0 +1,16 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Account Delinquency](https://devcenter.heroku.com/articles/platform-api-reference#account-delinquency) + * A Heroku account becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent accounts if their invoices remain unpaid. + */ +export default class AccountDelinquencyService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Account delinquency information. + * + * @param requestInit The initializer for the request. + */ + info(requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/account-delinquency-service.js b/lib/cjs/services/account-delinquency-service.js new file mode 100644 index 0000000..23aa98f --- /dev/null +++ b/lib/cjs/services/account-delinquency-service.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Account Delinquency](https://devcenter.heroku.com/articles/platform-api-reference#account-delinquency) + * A Heroku account becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent accounts if their invoices remain unpaid. + */ +class AccountDelinquencyService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Account delinquency information. + * + * @param requestInit The initializer for the request. + */ + async info(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/delinquency`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AccountDelinquencyService; diff --git a/lib/cjs/services/account-feature-service.d.ts b/lib/cjs/services/account-feature-service.d.ts new file mode 100644 index 0000000..bd6fdcd --- /dev/null +++ b/lib/cjs/services/account-feature-service.d.ts @@ -0,0 +1,31 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Account Feature](https://devcenter.heroku.com/articles/platform-api-reference#account-feature) + * An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku. + */ +export default class AccountFeatureService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for an existing account feature. + * + * @param accountFeatureIdentity unique identifier of account feature or unique name of account feature. + * @param requestInit The initializer for the request. + */ + info(accountFeatureIdentity: string, requestInit?: Omit): Promise; + /** + * List existing account features. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Update an existing account feature. + * + * @param accountFeatureIdentity unique identifier of account feature or unique name of account feature. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(accountFeatureIdentity: string, payload: Heroku.AccountFeatureUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/account-feature-service.js b/lib/cjs/services/account-feature-service.js new file mode 100644 index 0000000..3f49745 --- /dev/null +++ b/lib/cjs/services/account-feature-service.js @@ -0,0 +1,77 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Account Feature](https://devcenter.heroku.com/articles/platform-api-reference#account-feature) + * An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku. + */ +class AccountFeatureService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for an existing account feature. + * + * @param accountFeatureIdentity unique identifier of account feature or unique name of account feature. + * @param requestInit The initializer for the request. + */ + async info(accountFeatureIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/features/${accountFeatureIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing account features. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/features`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing account feature. + * + * @param accountFeatureIdentity unique identifier of account feature or unique name of account feature. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(accountFeatureIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/features/${accountFeatureIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AccountFeatureService; diff --git a/lib/cjs/services/account-service.d.ts b/lib/cjs/services/account-service.d.ts new file mode 100644 index 0000000..c025640 --- /dev/null +++ b/lib/cjs/services/account-service.d.ts @@ -0,0 +1,51 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Account](https://devcenter.heroku.com/articles/platform-api-reference#account) + * An account represents an individual signed up to use the Heroku platform. + */ +export default class AccountService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for account. + * + * @param requestInit The initializer for the request. + */ + info(requestInit?: Omit): Promise; + /** + * Update account. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(payload: Heroku.AccountUpdatePayload, requestInit?: Omit): Promise; + /** + * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. + * + * @param requestInit The initializer for the request. + */ + delete(requestInit?: Omit): Promise; + /** + * Info for account. + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + infoByUser(accountIdentity: string, requestInit?: Omit): Promise; + /** + * Update account. + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + updateByUser(accountIdentity: string, payload: Heroku.AccountUpdateByUserPayload, requestInit?: Omit): Promise; + /** + * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + deleteByUser(accountIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/account-service.js b/lib/cjs/services/account-service.js new file mode 100644 index 0000000..ab78c58 --- /dev/null +++ b/lib/cjs/services/account-service.js @@ -0,0 +1,140 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Account](https://devcenter.heroku.com/articles/platform-api-reference#account) + * An account represents an individual signed up to use the Heroku platform. + */ +class AccountService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for account. + * + * @param requestInit The initializer for the request. + */ + async info(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update account. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. + * + * @param requestInit The initializer for the request. + */ + async delete(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for account. + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async infoByUser(accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update account. + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async updateByUser(accountIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async deleteByUser(accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AccountService; diff --git a/lib/cjs/services/add-on-action-service.d.ts b/lib/cjs/services/add-on-action-service.d.ts new file mode 100644 index 0000000..d4323d4 --- /dev/null +++ b/lib/cjs/services/add-on-action-service.d.ts @@ -0,0 +1,24 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Action](https://devcenter.heroku.com/articles/platform-api-reference#add-on-action) + * Add-on Actions are lifecycle operations for add-on provisioning and deprovisioning. They allow add-on providers to (de)provision add-ons in the background and then report back when (de)provisioning is complete. + */ +export default class AddOnActionService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Mark an add-on as provisioned for use. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + provision(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * Mark an add-on as deprovisioned. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + deprovision(addOnIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/add-on-action-service.js b/lib/cjs/services/add-on-action-service.js new file mode 100644 index 0000000..052bdec --- /dev/null +++ b/lib/cjs/services/add-on-action-service.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Add-on Action](https://devcenter.heroku.com/articles/platform-api-reference#add-on-action) + * Add-on Actions are lifecycle operations for add-on provisioning and deprovisioning. They allow add-on providers to (de)provision add-ons in the background and then report back when (de)provisioning is complete. + */ +class AddOnActionService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Mark an add-on as provisioned for use. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async provision(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/actions/provision`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Mark an add-on as deprovisioned. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async deprovision(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/actions/deprovision`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AddOnActionService; diff --git a/lib/cjs/services/add-on-attachment-service.d.ts b/lib/cjs/services/add-on-attachment-service.d.ts new file mode 100644 index 0000000..1db19c0 --- /dev/null +++ b/lib/cjs/services/add-on-attachment-service.d.ts @@ -0,0 +1,66 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Attachment](https://devcenter.heroku.com/articles/platform-api-reference#add-on-attachment) + * An add-on attachment represents a connection between an app and an add-on that it has been given access to. + */ +export default class AddOnAttachmentService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new add-on attachment. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.AddOnAttachmentCreatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing add-on attachment. + * + * @param addOnAttachmentIdentity unique identifier of this add-on attachment. + * @param requestInit The initializer for the request. + */ + delete(addOnAttachmentIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing add-on attachment. + * + * @param addOnAttachmentIdentity unique identifier of this add-on attachment. + * @param requestInit The initializer for the request. + */ + info(addOnAttachmentIdentity: string, requestInit?: Omit): Promise; + /** + * List existing add-on attachments. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * List existing add-on attachments for an add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + listByAddOn(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * List existing add-on attachments for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + listByApp(appIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing add-on attachment for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnAttachmentScopedIdentity unique identifier of this add-on attachment or unique name for this add-on attachment to this app. + * @param requestInit The initializer for the request. + */ + infoByApp(appIdentity: string, addOnAttachmentScopedIdentity: string, requestInit?: Omit): Promise; + /** + * Resolve an add-on attachment from a name, optionally passing an app name. If there are matches it returns at least one add-on attachment (exact match) or many. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + resolution(payload: Heroku.AddOnAttachmentResolutionPayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/add-on-attachment-service.js b/lib/cjs/services/add-on-attachment-service.js new file mode 100644 index 0000000..e57245e --- /dev/null +++ b/lib/cjs/services/add-on-attachment-service.js @@ -0,0 +1,180 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Add-on Attachment](https://devcenter.heroku.com/articles/platform-api-reference#add-on-attachment) + * An add-on attachment represents a connection between an app and an add-on that it has been given access to. + */ +class AddOnAttachmentService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new add-on attachment. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-attachments`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing add-on attachment. + * + * @param addOnAttachmentIdentity unique identifier of this add-on attachment. + * @param requestInit The initializer for the request. + */ + async delete(addOnAttachmentIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-attachments/${addOnAttachmentIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing add-on attachment. + * + * @param addOnAttachmentIdentity unique identifier of this add-on attachment. + * @param requestInit The initializer for the request. + */ + async info(addOnAttachmentIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-attachments/${addOnAttachmentIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing add-on attachments. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-attachments`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing add-on attachments for an add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async listByAddOn(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/addon-attachments`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing add-on attachments for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async listByApp(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addon-attachments`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing add-on attachment for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnAttachmentScopedIdentity unique identifier of this add-on attachment or unique name for this add-on attachment to this app. + * @param requestInit The initializer for the request. + */ + async infoByApp(appIdentity, addOnAttachmentScopedIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addon-attachments/${addOnAttachmentScopedIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Resolve an add-on attachment from a name, optionally passing an app name. If there are matches it returns at least one add-on attachment (exact match) or many. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async resolution(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/actions/addon-attachments/resolve`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AddOnAttachmentService; diff --git a/lib/cjs/services/add-on-config-service.d.ts b/lib/cjs/services/add-on-config-service.d.ts new file mode 100644 index 0000000..68c9532 --- /dev/null +++ b/lib/cjs/services/add-on-config-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Config](https://devcenter.heroku.com/articles/platform-api-reference#add-on-config) + * Configuration of an Add-on + */ +export default class AddOnConfigService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Get an add-on's config. Accessible by customers with access and by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + list(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * Update an add-on's config. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(addOnIdentity: string, payload: Heroku.AddOnConfigUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/add-on-config-service.js b/lib/cjs/services/add-on-config-service.js new file mode 100644 index 0000000..0d608f5 --- /dev/null +++ b/lib/cjs/services/add-on-config-service.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Add-on Config](https://devcenter.heroku.com/articles/platform-api-reference#add-on-config) + * Configuration of an Add-on + */ +class AddOnConfigService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Get an add-on's config. Accessible by customers with access and by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async list(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/config`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an add-on's config. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(addOnIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/config`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AddOnConfigService; diff --git a/lib/cjs/services/add-on-region-capability-service.d.ts b/lib/cjs/services/add-on-region-capability-service.d.ts new file mode 100644 index 0000000..9af404a --- /dev/null +++ b/lib/cjs/services/add-on-region-capability-service.d.ts @@ -0,0 +1,30 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Region Capability](https://devcenter.heroku.com/articles/platform-api-reference#add-on-region-capability) + * Add-on region capabilities represent the relationship between an Add-on Service and a specific Region. Only Beta and GA add-ons are returned by these endpoints. + */ +export default class AddOnRegionCapabilityService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List all existing add-on region capabilities. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * List existing add-on region capabilities for an add-on-service + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + listByAddOnService(addOnServiceIdentity: string, requestInit?: Omit): Promise; + /** + * List existing add-on region capabilities for a region. + * + * @param regionIdentity unique identifier of region or unique name of region. + * @param requestInit The initializer for the request. + */ + listByRegion(regionIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/add-on-region-capability-service.js b/lib/cjs/services/add-on-region-capability-service.js new file mode 100644 index 0000000..5c54ae6 --- /dev/null +++ b/lib/cjs/services/add-on-region-capability-service.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Add-on Region Capability](https://devcenter.heroku.com/articles/platform-api-reference#add-on-region-capability) + * Add-on region capabilities represent the relationship between an Add-on Service and a specific Region. Only Beta and GA add-ons are returned by these endpoints. + */ +class AddOnRegionCapabilityService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List all existing add-on region capabilities. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-region-capabilities`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing add-on region capabilities for an add-on-service + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + async listByAddOnService(addOnServiceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-services/${addOnServiceIdentity}/region-capabilities`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing add-on region capabilities for a region. + * + * @param regionIdentity unique identifier of region or unique name of region. + * @param requestInit The initializer for the request. + */ + async listByRegion(regionIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/regions/${regionIdentity}/addon-region-capabilities`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AddOnRegionCapabilityService; diff --git a/lib/cjs/services/add-on-service-service.d.ts b/lib/cjs/services/add-on-service-service.d.ts new file mode 100644 index 0000000..275c578 --- /dev/null +++ b/lib/cjs/services/add-on-service-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Service](https://devcenter.heroku.com/articles/platform-api-reference#add-on-service) + * Add-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. + */ +export default class AddOnServiceService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing add-on-service. + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + info(addOnServiceIdentity: string, requestInit?: Omit): Promise; + /** + * List existing add-on-services. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/add-on-service-service.js b/lib/cjs/services/add-on-service-service.js new file mode 100644 index 0000000..c68e8a8 --- /dev/null +++ b/lib/cjs/services/add-on-service-service.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Add-on Service](https://devcenter.heroku.com/articles/platform-api-reference#add-on-service) + * Add-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. + */ +class AddOnServiceService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing add-on-service. + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + async info(addOnServiceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-services/${addOnServiceIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing add-on-services. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-services`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AddOnServiceService; diff --git a/lib/cjs/services/add-on-service.d.ts b/lib/cjs/services/add-on-service.d.ts new file mode 100644 index 0000000..ee8368e --- /dev/null +++ b/lib/cjs/services/add-on-service.d.ts @@ -0,0 +1,84 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on](https://devcenter.heroku.com/articles/platform-api-reference#add-on) + * Add-ons represent add-ons that have been provisioned and attached to one or more apps. + */ +export default class AddOnService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List all existing add-ons. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Info for an existing add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + info(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * Create a new add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.AddOnCreatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + delete(appIdentity: string, addOnIdentity: string, requestInit?: Omit): Promise; + /** + * Info for an existing add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + infoByApp(appIdentity: string, addOnIdentity: string, requestInit?: Omit): Promise; + /** + * List existing add-ons for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + listByApp(appIdentity: string, requestInit?: Omit): Promise; + /** + * Change add-on plan. Some add-ons may not support changing plans. In that case, an error will be returned. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, addOnIdentity: string, payload: Heroku.AddOnUpdatePayload, requestInit?: Omit): Promise; + /** + * List all existing add-ons a user has access to + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + listByUser(accountIdentity: string, requestInit?: Omit): Promise; + /** + * List add-ons used across all Team apps + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + listByTeam(teamIdentity: string, requestInit?: Omit): Promise; + /** + * Resolve an add-on from a name, optionally passing an app name. If there are matches it returns at least one add-on (exact match) or many. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + resolution(payload: Heroku.AddOnResolutionPayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/add-on-service.js b/lib/cjs/services/add-on-service.js new file mode 100644 index 0000000..e996dc7 --- /dev/null +++ b/lib/cjs/services/add-on-service.js @@ -0,0 +1,226 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Add-on](https://devcenter.heroku.com/articles/platform-api-reference#add-on) + * Add-ons represent add-ons that have been provisioned and attached to one or more apps. + */ +class AddOnService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List all existing add-ons. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for an existing add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async info(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a new add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async delete(appIdentity, addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons/${addOnIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for an existing add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async infoByApp(appIdentity, addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons/${addOnIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing add-ons for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async listByApp(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Change add-on plan. Some add-ons may not support changing plans. In that case, an error will be returned. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, addOnIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons/${addOnIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List all existing add-ons a user has access to + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async listByUser(accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}/addons`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List add-ons used across all Team apps + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async listByTeam(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/addons`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Resolve an add-on from a name, optionally passing an app name. If there are matches it returns at least one add-on (exact match) or many. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async resolution(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/actions/addons/resolve`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AddOnService; diff --git a/lib/cjs/services/add-on-webhook-delivery-service.d.ts b/lib/cjs/services/add-on-webhook-delivery-service.d.ts new file mode 100644 index 0000000..d419b29 --- /dev/null +++ b/lib/cjs/services/add-on-webhook-delivery-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Webhook Delivery](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook-delivery) + * Represents the delivery of a webhook notification, including its current status. + */ +export default class AddOnWebhookDeliveryService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Returns the info for an existing delivery. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookDeliveryIdentity the delivery's unique identifier. + * @param requestInit The initializer for the request. + */ + info(addOnIdentity: string, appWebhookDeliveryIdentity: string, requestInit?: Omit): Promise; + /** + * Lists existing deliveries for an add-on. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + list(addOnIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/add-on-webhook-delivery-service.js b/lib/cjs/services/add-on-webhook-delivery-service.js new file mode 100644 index 0000000..3733c00 --- /dev/null +++ b/lib/cjs/services/add-on-webhook-delivery-service.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Add-on Webhook Delivery](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook-delivery) + * Represents the delivery of a webhook notification, including its current status. + */ +class AddOnWebhookDeliveryService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Returns the info for an existing delivery. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookDeliveryIdentity the delivery's unique identifier. + * @param requestInit The initializer for the request. + */ + async info(addOnIdentity, appWebhookDeliveryIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhook-deliveries/${appWebhookDeliveryIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Lists existing deliveries for an add-on. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async list(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhook-deliveries`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AddOnWebhookDeliveryService; diff --git a/lib/cjs/services/add-on-webhook-event-service.d.ts b/lib/cjs/services/add-on-webhook-event-service.d.ts new file mode 100644 index 0000000..6fa8e8b --- /dev/null +++ b/lib/cjs/services/add-on-webhook-event-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Webhook Event](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook-event) + * Represents a webhook event that occurred. + */ +export default class AddOnWebhookEventService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Returns the info for a specified webhook event. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookEventIdentity the event's unique identifier. + * @param requestInit The initializer for the request. + */ + info(addOnIdentity: string, appWebhookEventIdentity: string, requestInit?: Omit): Promise; + /** + * Lists existing webhook events for an add-on. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + list(addOnIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/add-on-webhook-event-service.js b/lib/cjs/services/add-on-webhook-event-service.js new file mode 100644 index 0000000..d5cee3a --- /dev/null +++ b/lib/cjs/services/add-on-webhook-event-service.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Add-on Webhook Event](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook-event) + * Represents a webhook event that occurred. + */ +class AddOnWebhookEventService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Returns the info for a specified webhook event. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookEventIdentity the event's unique identifier. + * @param requestInit The initializer for the request. + */ + async info(addOnIdentity, appWebhookEventIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhook-events/${appWebhookEventIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Lists existing webhook events for an add-on. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async list(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhook-events`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AddOnWebhookEventService; diff --git a/lib/cjs/services/add-on-webhook-service.d.ts b/lib/cjs/services/add-on-webhook-service.d.ts new file mode 100644 index 0000000..b6b86cb --- /dev/null +++ b/lib/cjs/services/add-on-webhook-service.d.ts @@ -0,0 +1,50 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Webhook](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook) + * Represents the details of a webhook subscription + */ +export default class AddOnWebhookService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(addOnIdentity: string, payload: Heroku.AddOnWebhookCreatePayload, requestInit?: Omit): Promise; + /** + * Removes an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + delete(addOnIdentity: string, appWebhookIdentity: string, requestInit?: Omit): Promise; + /** + * Returns the info for an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + info(addOnIdentity: string, appWebhookIdentity: string, requestInit?: Omit): Promise; + /** + * List all webhook subscriptions for a particular add-on. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + list(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * Updates the details of an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookIdentity the webhook's unique identifier. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(addOnIdentity: string, appWebhookIdentity: string, payload: Heroku.AddOnWebhookUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/add-on-webhook-service.js b/lib/cjs/services/add-on-webhook-service.js new file mode 100644 index 0000000..0cb60a1 --- /dev/null +++ b/lib/cjs/services/add-on-webhook-service.js @@ -0,0 +1,125 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Add-on Webhook](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook) + * Represents the details of a webhook subscription + */ +class AddOnWebhookService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(addOnIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhooks`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Removes an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + async delete(addOnIdentity, appWebhookIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Returns the info for an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + async info(addOnIdentity, appWebhookIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List all webhook subscriptions for a particular add-on. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async list(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhooks`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Updates the details of an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookIdentity the webhook's unique identifier. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(addOnIdentity, appWebhookIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AddOnWebhookService; diff --git a/lib/cjs/services/allowed-add-on-service-service.d.ts b/lib/cjs/services/allowed-add-on-service-service.d.ts new file mode 100644 index 0000000..be7f3e6 --- /dev/null +++ b/lib/cjs/services/allowed-add-on-service-service.d.ts @@ -0,0 +1,33 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Allowed Add-on Service](https://devcenter.heroku.com/articles/platform-api-reference#allowed-add-on-service) + * Entities that have been allowed to be used by a Team + */ +export default class AllowedAddOnServiceService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List all allowed add-on services for a team + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + listByTeam(teamIdentity: string, requestInit?: Omit): Promise; + /** + * Allow an Add-on Service + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + createByTeam(teamIdentity: string, payload: Heroku.AllowedAddOnServiceCreateByTeamPayload, requestInit?: Omit): Promise; + /** + * Remove an allowed add-on service + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param allowedAddOnServiceIdentity unique identifier for this allowed add-on service record or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + deleteByTeam(teamIdentity: string, allowedAddOnServiceIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/allowed-add-on-service-service.js b/lib/cjs/services/allowed-add-on-service-service.js new file mode 100644 index 0000000..f4d851c --- /dev/null +++ b/lib/cjs/services/allowed-add-on-service-service.js @@ -0,0 +1,80 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Allowed Add-on Service](https://devcenter.heroku.com/articles/platform-api-reference#allowed-add-on-service) + * Entities that have been allowed to be used by a Team + */ +class AllowedAddOnServiceService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List all allowed add-on services for a team + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async listByTeam(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/allowed-addon-services`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Allow an Add-on Service + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async createByTeam(teamIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/allowed-addon-services`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Remove an allowed add-on service + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param allowedAddOnServiceIdentity unique identifier for this allowed add-on service record or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + async deleteByTeam(teamIdentity, allowedAddOnServiceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/allowed-addon-services/${allowedAddOnServiceIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AllowedAddOnServiceService; diff --git a/lib/cjs/services/app-feature-service.d.ts b/lib/cjs/services/app-feature-service.d.ts new file mode 100644 index 0000000..8aab4db --- /dev/null +++ b/lib/cjs/services/app-feature-service.d.ts @@ -0,0 +1,34 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App Feature](https://devcenter.heroku.com/articles/platform-api-reference#app-feature) + * An app feature represents a Heroku labs capability that can be enabled or disabled for an app on Heroku. + */ +export default class AppFeatureService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for an existing app feature. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appFeatureIdentity unique identifier of app feature or unique name of app feature. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, appFeatureIdentity: string, requestInit?: Omit): Promise; + /** + * List existing app features. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing app feature. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appFeatureIdentity unique identifier of app feature or unique name of app feature. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, appFeatureIdentity: string, payload: Heroku.AppFeatureUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/app-feature-service.js b/lib/cjs/services/app-feature-service.js new file mode 100644 index 0000000..350c467 --- /dev/null +++ b/lib/cjs/services/app-feature-service.js @@ -0,0 +1,80 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - App Feature](https://devcenter.heroku.com/articles/platform-api-reference#app-feature) + * An app feature represents a Heroku labs capability that can be enabled or disabled for an app on Heroku. + */ +class AppFeatureService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for an existing app feature. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appFeatureIdentity unique identifier of app feature or unique name of app feature. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, appFeatureIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/features/${appFeatureIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing app features. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/features`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing app feature. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appFeatureIdentity unique identifier of app feature or unique name of app feature. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, appFeatureIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/features/${appFeatureIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AppFeatureService; diff --git a/lib/cjs/services/app-service.d.ts b/lib/cjs/services/app-service.d.ts new file mode 100644 index 0000000..e3fa707 --- /dev/null +++ b/lib/cjs/services/app-service.d.ts @@ -0,0 +1,73 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App](https://devcenter.heroku.com/articles/platform-api-reference#app) + * An app represents the program that you would like to deploy and run on Heroku. + */ +export default class AppService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new app. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.AppCreatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + delete(appIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, requestInit?: Omit): Promise; + /** + * List existing apps. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * List owned and collaborated apps (excludes team apps). + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + listOwnedAndCollaborated(accountIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, payload: Heroku.AppUpdatePayload, requestInit?: Omit): Promise; + /** + * Enable ACM flag for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + enableAcm(appIdentity: string, requestInit?: Omit): Promise; + /** + * Disable ACM flag for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + disableAcm(appIdentity: string, requestInit?: Omit): Promise; + /** + * Refresh ACM for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + refreshAcm(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/app-service.js b/lib/cjs/services/app-service.js new file mode 100644 index 0000000..6cbe682 --- /dev/null +++ b/lib/cjs/services/app-service.js @@ -0,0 +1,203 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - App](https://devcenter.heroku.com/articles/platform-api-reference#app) + * An app represents the program that you would like to deploy and run on Heroku. + */ +class AppService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new app. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async delete(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing apps. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List owned and collaborated apps (excludes team apps). + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async listOwnedAndCollaborated(accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}/apps`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Enable ACM flag for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async enableAcm(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/acm`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Disable ACM flag for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async disableAcm(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/acm`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Refresh ACM for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async refreshAcm(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/acm`, { + ...requestInit, + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AppService; diff --git a/lib/cjs/services/app-setup-service.d.ts b/lib/cjs/services/app-setup-service.d.ts new file mode 100644 index 0000000..7cbb271 --- /dev/null +++ b/lib/cjs/services/app-setup-service.d.ts @@ -0,0 +1,24 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Setup API - App Setup](https://devcenter.heroku.com/articles/platform-api-reference#app-setup) + * An app setup represents an app on Heroku that is setup using an environment, addons, and scripts described in an app.json manifest file. + */ +export default class AppSetupService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new app setup from a gzipped tar archive containing an app.json manifest file. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.AppSetupCreatePayload, requestInit?: Omit): Promise; + /** + * Get the status of an app setup. + * + * @param appSetupIdentity unique identifier of app setup. + * @param requestInit The initializer for the request. + */ + info(appSetupIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/app-setup-service.js b/lib/cjs/services/app-setup-service.js new file mode 100644 index 0000000..5d3443d --- /dev/null +++ b/lib/cjs/services/app-setup-service.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Setup API - App Setup](https://devcenter.heroku.com/articles/platform-api-reference#app-setup) + * An app setup represents an app on Heroku that is setup using an environment, addons, and scripts described in an app.json manifest file. + */ +class AppSetupService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new app setup from a gzipped tar archive containing an app.json manifest file. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/app-setups`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Get the status of an app setup. + * + * @param appSetupIdentity unique identifier of app setup. + * @param requestInit The initializer for the request. + */ + async info(appSetupIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/app-setups/${appSetupIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AppSetupService; diff --git a/lib/cjs/services/app-transfer-service.d.ts b/lib/cjs/services/app-transfer-service.d.ts new file mode 100644 index 0000000..a6309e5 --- /dev/null +++ b/lib/cjs/services/app-transfer-service.d.ts @@ -0,0 +1,45 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App Transfer](https://devcenter.heroku.com/articles/platform-api-reference#app-transfer) + * An app transfer represents a two party interaction for transferring ownership of an app. + */ +export default class AppTransferService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new app transfer. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.AppTransferCreatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing app transfer + * + * @param appTransferIdentity unique identifier of app transfer or unique name of app. + * @param requestInit The initializer for the request. + */ + delete(appTransferIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing app transfer. + * + * @param appTransferIdentity unique identifier of app transfer or unique name of app. + * @param requestInit The initializer for the request. + */ + info(appTransferIdentity: string, requestInit?: Omit): Promise; + /** + * List existing apps transfers. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Update an existing app transfer. + * + * @param appTransferIdentity unique identifier of app transfer or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appTransferIdentity: string, payload: Heroku.AppTransferUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/app-transfer-service.js b/lib/cjs/services/app-transfer-service.js new file mode 100644 index 0000000..e81cd3d --- /dev/null +++ b/lib/cjs/services/app-transfer-service.js @@ -0,0 +1,120 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - App Transfer](https://devcenter.heroku.com/articles/platform-api-reference#app-transfer) + * An app transfer represents a two party interaction for transferring ownership of an app. + */ +class AppTransferService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new app transfer. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/app-transfers`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing app transfer + * + * @param appTransferIdentity unique identifier of app transfer or unique name of app. + * @param requestInit The initializer for the request. + */ + async delete(appTransferIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/app-transfers/${appTransferIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing app transfer. + * + * @param appTransferIdentity unique identifier of app transfer or unique name of app. + * @param requestInit The initializer for the request. + */ + async info(appTransferIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/app-transfers/${appTransferIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing apps transfers. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/app-transfers`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing app transfer. + * + * @param appTransferIdentity unique identifier of app transfer or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appTransferIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/app-transfers/${appTransferIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AppTransferService; diff --git a/lib/cjs/services/app-webhook-delivery-service.d.ts b/lib/cjs/services/app-webhook-delivery-service.d.ts new file mode 100644 index 0000000..6d072b5 --- /dev/null +++ b/lib/cjs/services/app-webhook-delivery-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App Webhook Delivery](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook-delivery) + * Represents the delivery of a webhook notification, including its current status. + */ +export default class AppWebhookDeliveryService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Returns the info for an existing delivery. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookDeliveryIdentity the delivery's unique identifier. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, appWebhookDeliveryIdentity: string, requestInit?: Omit): Promise; + /** + * Lists existing deliveries for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/app-webhook-delivery-service.js b/lib/cjs/services/app-webhook-delivery-service.js new file mode 100644 index 0000000..46f9557 --- /dev/null +++ b/lib/cjs/services/app-webhook-delivery-service.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - App Webhook Delivery](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook-delivery) + * Represents the delivery of a webhook notification, including its current status. + */ +class AppWebhookDeliveryService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Returns the info for an existing delivery. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookDeliveryIdentity the delivery's unique identifier. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, appWebhookDeliveryIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhook-deliveries/${appWebhookDeliveryIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Lists existing deliveries for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhook-deliveries`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AppWebhookDeliveryService; diff --git a/lib/cjs/services/app-webhook-event-service.d.ts b/lib/cjs/services/app-webhook-event-service.d.ts new file mode 100644 index 0000000..bf33134 --- /dev/null +++ b/lib/cjs/services/app-webhook-event-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App Webhook Event](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook-event) + * Represents a webhook event that occurred. + */ +export default class AppWebhookEventService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Returns the info for a specified webhook event. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookEventIdentity the event's unique identifier. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, appWebhookEventIdentity: string, requestInit?: Omit): Promise; + /** + * Lists existing webhook events for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/app-webhook-event-service.js b/lib/cjs/services/app-webhook-event-service.js new file mode 100644 index 0000000..3f11bd2 --- /dev/null +++ b/lib/cjs/services/app-webhook-event-service.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - App Webhook Event](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook-event) + * Represents a webhook event that occurred. + */ +class AppWebhookEventService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Returns the info for a specified webhook event. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookEventIdentity the event's unique identifier. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, appWebhookEventIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhook-events/${appWebhookEventIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Lists existing webhook events for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhook-events`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AppWebhookEventService; diff --git a/lib/cjs/services/app-webhook-service.d.ts b/lib/cjs/services/app-webhook-service.d.ts new file mode 100644 index 0000000..cb9ea2b --- /dev/null +++ b/lib/cjs/services/app-webhook-service.d.ts @@ -0,0 +1,50 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App Webhook](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook) + * Represents the details of a webhook subscription + */ +export default class AppWebhookService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.AppWebhookCreatePayload, requestInit?: Omit): Promise; + /** + * Removes an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + delete(appIdentity: string, appWebhookIdentity: string, requestInit?: Omit): Promise; + /** + * Returns the info for an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, appWebhookIdentity: string, requestInit?: Omit): Promise; + /** + * List all webhook subscriptions for a particular app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; + /** + * Updates the details of an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookIdentity the webhook's unique identifier. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, appWebhookIdentity: string, payload: Heroku.AppWebhookUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/app-webhook-service.js b/lib/cjs/services/app-webhook-service.js new file mode 100644 index 0000000..3961d1c --- /dev/null +++ b/lib/cjs/services/app-webhook-service.js @@ -0,0 +1,125 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - App Webhook](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook) + * Represents the details of a webhook subscription + */ +class AppWebhookService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhooks`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Removes an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + async delete(appIdentity, appWebhookIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Returns the info for an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, appWebhookIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List all webhook subscriptions for a particular app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhooks`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Updates the details of an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookIdentity the webhook's unique identifier. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, appWebhookIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = AppWebhookService; diff --git a/lib/cjs/services/archive-service.d.ts b/lib/cjs/services/archive-service.d.ts new file mode 100644 index 0000000..5445551 --- /dev/null +++ b/lib/cjs/services/archive-service.d.ts @@ -0,0 +1,27 @@ +/** + * [Heroku Platform API - Audit Trail Archive](https://devcenter.heroku.com/articles/platform-api-reference#archive) + * An audit trail archive represents a monthly json zipped file containing events + */ +export default class ArchiveService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Get archive for a single month. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param archiveYear year of the archive + * @example 2019. + * @param archiveMonth month of the archive + * @example "10". + * @param requestInit The initializer for the request. + */ + info(enterpriseAccountIdentity: string, archiveYear: number, archiveMonth: '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12', requestInit?: Omit): Promise; + /** + * List existing archives. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + list(enterpriseAccountIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/archive-service.js b/lib/cjs/services/archive-service.js new file mode 100644 index 0000000..99d1fc4 --- /dev/null +++ b/lib/cjs/services/archive-service.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Audit Trail Archive](https://devcenter.heroku.com/articles/platform-api-reference#archive) + * An audit trail archive represents a monthly json zipped file containing events + */ +class ArchiveService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Get archive for a single month. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param archiveYear year of the archive + * @example 2019. + * @param archiveMonth month of the archive + * @example "10". + * @param requestInit The initializer for the request. + */ + async info(enterpriseAccountIdentity, archiveYear, archiveMonth, requestInit = {}) { + await this.fetchImpl(`/enterprise-accounts/${enterpriseAccountIdentity}/archives/${archiveYear}/${archiveMonth}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } + /** + * List existing archives. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + async list(enterpriseAccountIdentity, requestInit = {}) { + await this.fetchImpl(`/enterprise-accounts/${enterpriseAccountIdentity}/archives`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } +} +exports.default = ArchiveService; diff --git a/lib/cjs/services/audit-trail-event-service.d.ts b/lib/cjs/services/audit-trail-event-service.d.ts new file mode 100644 index 0000000..d6ffa6d --- /dev/null +++ b/lib/cjs/services/audit-trail-event-service.d.ts @@ -0,0 +1,16 @@ +/** + * [Heroku Platform API - Audit Trail Event](https://devcenter.heroku.com/articles/platform-api-reference#audit-trail-event) + * An audit trail event represents some action on the platform + */ +export default class AuditTrailEventService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List existing events. Returns all events for one day, defaulting to current day. Order, actor, action, and type, and day query params can be specified as query parameters. For example, '/enterprise-accounts/:id/events?order=desc&actor=user@example.com&action=create&type=app&day=2020-09-30' would return events in descending order and only return app created events by the user with user@example.com email address. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + list(enterpriseAccountIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/audit-trail-event-service.js b/lib/cjs/services/audit-trail-event-service.js new file mode 100644 index 0000000..9e0f0b0 --- /dev/null +++ b/lib/cjs/services/audit-trail-event-service.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Audit Trail Event](https://devcenter.heroku.com/articles/platform-api-reference#audit-trail-event) + * An audit trail event represents some action on the platform + */ +class AuditTrailEventService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List existing events. Returns all events for one day, defaulting to current day. Order, actor, action, and type, and day query params can be specified as query parameters. For example, '/enterprise-accounts/:id/events?order=desc&actor=user@example.com&action=create&type=app&day=2020-09-30' would return events in descending order and only return app created events by the user with user@example.com email address. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + async list(enterpriseAccountIdentity, requestInit = {}) { + await this.fetchImpl(`/enterprise-accounts/${enterpriseAccountIdentity}/events`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } +} +exports.default = AuditTrailEventService; diff --git a/lib/cjs/services/build-service.d.ts b/lib/cjs/services/build-service.d.ts new file mode 100644 index 0000000..cba4137 --- /dev/null +++ b/lib/cjs/services/build-service.d.ts @@ -0,0 +1,48 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Build API - Build](https://devcenter.heroku.com/articles/platform-api-reference#build) + * A build represents the process of transforming a code tarball into a slug + */ +export default class BuildService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.BuildCreatePayload, requestInit?: Omit): Promise; + /** + * Info for existing build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param buildIdentity unique identifier of build. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, buildIdentity: string, requestInit?: Omit): Promise; + /** + * List existing build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; + /** + * Destroy a build cache. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + deleteCache(appIdentity: string, requestInit?: Omit): Promise; + /** + * Cancel running build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param buildIdentity unique identifier of build. + * @param requestInit The initializer for the request. + */ + cancel(appIdentity: string, buildIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/build-service.js b/lib/cjs/services/build-service.js new file mode 100644 index 0000000..d1a6c8a --- /dev/null +++ b/lib/cjs/services/build-service.js @@ -0,0 +1,118 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Build API - Build](https://devcenter.heroku.com/articles/platform-api-reference#build) + * A build represents the process of transforming a code tarball into a slug + */ +class BuildService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/builds`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param buildIdentity unique identifier of build. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, buildIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/builds/${buildIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/builds`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Destroy a build cache. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async deleteCache(appIdentity, requestInit = {}) { + await this.fetchImpl(`/apps/${appIdentity}/build-cache`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + } + /** + * Cancel running build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param buildIdentity unique identifier of build. + * @param requestInit The initializer for the request. + */ + async cancel(appIdentity, buildIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/builds/${buildIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = BuildService; diff --git a/lib/cjs/services/buildpack-installation-service.d.ts b/lib/cjs/services/buildpack-installation-service.d.ts new file mode 100644 index 0000000..c27f864 --- /dev/null +++ b/lib/cjs/services/buildpack-installation-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Buildpack Installations](https://devcenter.heroku.com/articles/platform-api-reference#buildpack-installation) + * A buildpack installation represents a buildpack that will be run against an app. + */ +export default class BuildpackInstallationService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Update an app's buildpack installations. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, payload: Heroku.BuildpackInstallationUpdatePayload, requestInit?: Omit): Promise; + /** + * List an app's existing buildpack installations. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/buildpack-installation-service.js b/lib/cjs/services/buildpack-installation-service.js new file mode 100644 index 0000000..c67ca67 --- /dev/null +++ b/lib/cjs/services/buildpack-installation-service.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Buildpack Installations](https://devcenter.heroku.com/articles/platform-api-reference#buildpack-installation) + * A buildpack installation represents a buildpack that will be run against an app. + */ +class BuildpackInstallationService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Update an app's buildpack installations. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/buildpack-installations`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List an app's existing buildpack installations. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/buildpack-installations`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = BuildpackInstallationService; diff --git a/lib/cjs/services/collaborator-service.d.ts b/lib/cjs/services/collaborator-service.d.ts new file mode 100644 index 0000000..5460a41 --- /dev/null +++ b/lib/cjs/services/collaborator-service.d.ts @@ -0,0 +1,41 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Collaborator](https://devcenter.heroku.com/articles/platform-api-reference#collaborator) + * A collaborator represents an account that has been given access to an app on Heroku. + */ +export default class CollaboratorService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new collaborator. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.CollaboratorCreatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing collaborator. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param collaboratorIdentity invited email address of collaborator or unique identifier of collaborator. + * @param requestInit The initializer for the request. + */ + delete(appIdentity: string, collaboratorIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing collaborator. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param collaboratorIdentity invited email address of collaborator or unique identifier of collaborator. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, collaboratorIdentity: string, requestInit?: Omit): Promise; + /** + * List existing collaborators. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/collaborator-service.js b/lib/cjs/services/collaborator-service.js new file mode 100644 index 0000000..bc3e855 --- /dev/null +++ b/lib/cjs/services/collaborator-service.js @@ -0,0 +1,101 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Collaborator](https://devcenter.heroku.com/articles/platform-api-reference#collaborator) + * A collaborator represents an account that has been given access to an app on Heroku. + */ +class CollaboratorService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new collaborator. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/collaborators`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing collaborator. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param collaboratorIdentity invited email address of collaborator or unique identifier of collaborator. + * @param requestInit The initializer for the request. + */ + async delete(appIdentity, collaboratorIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/collaborators/${collaboratorIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing collaborator. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param collaboratorIdentity invited email address of collaborator or unique identifier of collaborator. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, collaboratorIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/collaborators/${collaboratorIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing collaborators. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/collaborators`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = CollaboratorService; diff --git a/lib/cjs/services/config-var-service.d.ts b/lib/cjs/services/config-var-service.d.ts new file mode 100644 index 0000000..9f288f3 --- /dev/null +++ b/lib/cjs/services/config-var-service.d.ts @@ -0,0 +1,32 @@ +/** + * [Heroku Platform API - Config Vars](https://devcenter.heroku.com/articles/platform-api-reference#config-var) + * Config Vars allow you to manage the configuration information provided to an app on Heroku. + */ +export default class ConfigVarService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Get config-vars for app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + infoForApp(appIdentity: string, requestInit?: Omit): Promise>; + /** + * Get config-vars for a release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param releaseIdentity unique identifier of release or unique version assigned to the release. + * @param requestInit The initializer for the request. + */ + infoForAppRelease(appIdentity: string, releaseIdentity: string | number, requestInit?: Omit): Promise>; + /** + * Update config-vars for app. You can update existing config-vars by setting them again, and remove by setting it to `null`. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, payload: Record, requestInit?: Omit): Promise>; +} diff --git a/lib/cjs/services/config-var-service.js b/lib/cjs/services/config-var-service.js new file mode 100644 index 0000000..19fe915 --- /dev/null +++ b/lib/cjs/services/config-var-service.js @@ -0,0 +1,79 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Config Vars](https://devcenter.heroku.com/articles/platform-api-reference#config-var) + * Config Vars allow you to manage the configuration information provided to an app on Heroku. + */ +class ConfigVarService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Get config-vars for app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async infoForApp(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/config-vars`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Get config-vars for a release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param releaseIdentity unique identifier of release or unique version assigned to the release. + * @param requestInit The initializer for the request. + */ + async infoForAppRelease(appIdentity, releaseIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/releases/${releaseIdentity}/config-vars`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update config-vars for app. You can update existing config-vars by setting them again, and remove by setting it to `null`. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/config-vars`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = ConfigVarService; diff --git a/lib/cjs/services/credit-service.d.ts b/lib/cjs/services/credit-service.d.ts new file mode 100644 index 0000000..851ca1a --- /dev/null +++ b/lib/cjs/services/credit-service.d.ts @@ -0,0 +1,30 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Credit](https://devcenter.heroku.com/articles/platform-api-reference#credit) + * A credit represents value that will be used up before further charges are assigned to an account. + */ +export default class CreditService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new credit. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.CreditCreatePayload, requestInit?: Omit): Promise; + /** + * Info for existing credit. + * + * @param creditIdentity unique identifier of credit. + * @param requestInit The initializer for the request. + */ + info(creditIdentity: string, requestInit?: Omit): Promise; + /** + * List existing credits. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/credit-service.js b/lib/cjs/services/credit-service.js new file mode 100644 index 0000000..d2bc4a9 --- /dev/null +++ b/lib/cjs/services/credit-service.js @@ -0,0 +1,76 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Credit](https://devcenter.heroku.com/articles/platform-api-reference#credit) + * A credit represents value that will be used up before further charges are assigned to an account. + */ +class CreditService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new credit. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/credits`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing credit. + * + * @param creditIdentity unique identifier of credit. + * @param requestInit The initializer for the request. + */ + async info(creditIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/credits/${creditIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing credits. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/credits`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = CreditService; diff --git a/lib/cjs/services/domain-service.d.ts b/lib/cjs/services/domain-service.d.ts new file mode 100644 index 0000000..792266e --- /dev/null +++ b/lib/cjs/services/domain-service.d.ts @@ -0,0 +1,50 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Domain](https://devcenter.heroku.com/articles/platform-api-reference#domain) + * Domains define what web routes should be routed to an app on Heroku. + */ +export default class DomainService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new domain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.DomainCreatePayload, requestInit?: Omit): Promise; + /** + * Associate an SNI endpoint + * + * @param appIdentity unique identifier of app or unique name of app. + * @param domainIdentity unique identifier of this domain or full hostname. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, domainIdentity: string, payload: Heroku.DomainUpdatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing domain + * + * @param appIdentity unique identifier of app or unique name of app. + * @param domainIdentity unique identifier of this domain or full hostname. + * @param requestInit The initializer for the request. + */ + delete(appIdentity: string, domainIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing domain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param domainIdentity unique identifier of this domain or full hostname. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, domainIdentity: string, requestInit?: Omit): Promise; + /** + * List existing domains. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/domain-service.js b/lib/cjs/services/domain-service.js new file mode 100644 index 0000000..2f8a111 --- /dev/null +++ b/lib/cjs/services/domain-service.js @@ -0,0 +1,125 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Domain](https://devcenter.heroku.com/articles/platform-api-reference#domain) + * Domains define what web routes should be routed to an app on Heroku. + */ +class DomainService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new domain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/domains`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Associate an SNI endpoint + * + * @param appIdentity unique identifier of app or unique name of app. + * @param domainIdentity unique identifier of this domain or full hostname. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, domainIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/domains/${domainIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing domain + * + * @param appIdentity unique identifier of app or unique name of app. + * @param domainIdentity unique identifier of this domain or full hostname. + * @param requestInit The initializer for the request. + */ + async delete(appIdentity, domainIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/domains/${domainIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing domain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param domainIdentity unique identifier of this domain or full hostname. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, domainIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/domains/${domainIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing domains. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/domains`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = DomainService; diff --git a/lib/cjs/services/dyno-service.d.ts b/lib/cjs/services/dyno-service.d.ts new file mode 100644 index 0000000..c19baa0 --- /dev/null +++ b/lib/cjs/services/dyno-service.d.ts @@ -0,0 +1,56 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Dyno](https://devcenter.heroku.com/articles/platform-api-reference#dyno) + * Dynos encapsulate running processes of an app on Heroku. Detailed information about dyno sizes can be found at: [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +export default class DynoService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.DynoCreatePayload, requestInit?: Omit): Promise; + /** + * Restart dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param requestInit The initializer for the request. + */ + restart(appIdentity: string, dynoIdentity: string, requestInit?: Omit): Promise>; + /** + * Restart all dynos. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + restartAll(appIdentity: string, requestInit?: Omit): Promise>; + /** + * Stop dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param requestInit The initializer for the request. + */ + stop(appIdentity: string, dynoIdentity: string, requestInit?: Omit): Promise>; + /** + * Info for existing dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, dynoIdentity: string, requestInit?: Omit): Promise; + /** + * List existing dynos. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/dyno-service.js b/lib/cjs/services/dyno-service.js new file mode 100644 index 0000000..07a4680 --- /dev/null +++ b/lib/cjs/services/dyno-service.js @@ -0,0 +1,144 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Dyno](https://devcenter.heroku.com/articles/platform-api-reference#dyno) + * Dynos encapsulate running processes of an app on Heroku. Detailed information about dyno sizes can be found at: [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +class DynoService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Restart dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param requestInit The initializer for the request. + */ + async restart(appIdentity, dynoIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos/${dynoIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Restart all dynos. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async restartAll(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Stop dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param requestInit The initializer for the request. + */ + async stop(appIdentity, dynoIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos/${dynoIdentity}/actions/stop`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, dynoIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos/${dynoIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing dynos. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = DynoService; diff --git a/lib/cjs/services/dyno-size-service.d.ts b/lib/cjs/services/dyno-size-service.d.ts new file mode 100644 index 0000000..aa9490c --- /dev/null +++ b/lib/cjs/services/dyno-size-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Dyno Size](https://devcenter.heroku.com/articles/platform-api-reference#dyno-size) + * Dyno sizes are the values and details of sizes that can be assigned to dynos. This information can also be found at : [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +export default class DynoSizeService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing dyno size. + * + * @param dynoSizeIdentity unique identifier of this dyno size or the name of this dyno-size. + * @param requestInit The initializer for the request. + */ + info(dynoSizeIdentity: string, requestInit?: Omit): Promise; + /** + * List existing dyno sizes. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/dyno-size-service.js b/lib/cjs/services/dyno-size-service.js new file mode 100644 index 0000000..c2fa21d --- /dev/null +++ b/lib/cjs/services/dyno-size-service.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Dyno Size](https://devcenter.heroku.com/articles/platform-api-reference#dyno-size) + * Dyno sizes are the values and details of sizes that can be assigned to dynos. This information can also be found at : [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +class DynoSizeService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing dyno size. + * + * @param dynoSizeIdentity unique identifier of this dyno size or the name of this dyno-size. + * @param requestInit The initializer for the request. + */ + async info(dynoSizeIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/dyno-sizes/${dynoSizeIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing dyno sizes. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/dyno-sizes`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = DynoSizeService; diff --git a/lib/cjs/services/enterprise-account-daily-usage-service.d.ts b/lib/cjs/services/enterprise-account-daily-usage-service.d.ts new file mode 100644 index 0000000..a14d3c5 --- /dev/null +++ b/lib/cjs/services/enterprise-account-daily-usage-service.d.ts @@ -0,0 +1,19 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Enterprise Account Daily Usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-daily-usage) + * Usage for an enterprise account at a daily resolution. + */ +export default class EnterpriseAccountDailyUsageService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieves usage for an enterprise account for a range of days. Start and end dates can be specified as query parameters using the date format YYYY-MM-DD. The enterprise account identifier can be found from the [enterprise account list](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-list). + * + * @param enterpriseAccountId unique identifier of the enterprise account + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + info(enterpriseAccountId: string, payload: Heroku.EnterpriseAccountDailyUsageInfoPayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/enterprise-account-daily-usage-service.js b/lib/cjs/services/enterprise-account-daily-usage-service.js new file mode 100644 index 0000000..079f0e8 --- /dev/null +++ b/lib/cjs/services/enterprise-account-daily-usage-service.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Enterprise Account Daily Usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-daily-usage) + * Usage for an enterprise account at a daily resolution. + */ +class EnterpriseAccountDailyUsageService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieves usage for an enterprise account for a range of days. Start and end dates can be specified as query parameters using the date format YYYY-MM-DD. The enterprise account identifier can be found from the [enterprise account list](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-list). + * + * @param enterpriseAccountId unique identifier of the enterprise account + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async info(enterpriseAccountId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountId}/usage/daily`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = EnterpriseAccountDailyUsageService; diff --git a/lib/cjs/services/enterprise-account-member-service.d.ts b/lib/cjs/services/enterprise-account-member-service.d.ts new file mode 100644 index 0000000..d548871 --- /dev/null +++ b/lib/cjs/services/enterprise-account-member-service.d.ts @@ -0,0 +1,42 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Enterprise Account Member](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-member) + * Enterprise account members are users with access to an enterprise account. + */ +export default class EnterpriseAccountMemberService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List members in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + list(enterpriseAccountIdentity: string, requestInit?: Omit): Promise; + /** + * Create a member in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(enterpriseAccountIdentity: string, payload: Heroku.EnterpriseAccountMemberCreatePayload, requestInit?: Omit): Promise; + /** + * Update a member in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param enterpriseAccountMemberUserIdentity unique email address of account or unique identifier of an account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(enterpriseAccountIdentity: string, enterpriseAccountMemberUserIdentity: string, payload: Heroku.EnterpriseAccountMemberUpdatePayload, requestInit?: Omit): Promise; + /** + * delete a member in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param enterpriseAccountMemberUserIdentity unique email address of account or unique identifier of an account. + * @param requestInit The initializer for the request. + */ + delete(enterpriseAccountIdentity: string, enterpriseAccountMemberUserIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/enterprise-account-member-service.js b/lib/cjs/services/enterprise-account-member-service.js new file mode 100644 index 0000000..33af5aa --- /dev/null +++ b/lib/cjs/services/enterprise-account-member-service.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Enterprise Account Member](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-member) + * Enterprise account members are users with access to an enterprise account. + */ +class EnterpriseAccountMemberService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List members in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + async list(enterpriseAccountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/members`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a member in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(enterpriseAccountIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/members`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update a member in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param enterpriseAccountMemberUserIdentity unique email address of account or unique identifier of an account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(enterpriseAccountIdentity, enterpriseAccountMemberUserIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/members/${enterpriseAccountMemberUserIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * delete a member in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param enterpriseAccountMemberUserIdentity unique email address of account or unique identifier of an account. + * @param requestInit The initializer for the request. + */ + async delete(enterpriseAccountIdentity, enterpriseAccountMemberUserIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/members/${enterpriseAccountMemberUserIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = EnterpriseAccountMemberService; diff --git a/lib/cjs/services/enterprise-account-monthly-usage-service.d.ts b/lib/cjs/services/enterprise-account-monthly-usage-service.d.ts new file mode 100644 index 0000000..add7493 --- /dev/null +++ b/lib/cjs/services/enterprise-account-monthly-usage-service.d.ts @@ -0,0 +1,19 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Enterprise Account Monthly Usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-monthly-usage) + * Usage for an enterprise account at a monthly resolution. + */ +export default class EnterpriseAccountMonthlyUsageService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieves usage for an enterprise account for a range of months. Start and end dates can be specified as query parameters using the date format YYYY-MM. If no end date is specified, one month of usage is returned. The enterprise account identifier can be found from the [enterprise account list](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-list). + * + * @param enterpriseAccountId unique identifier of the enterprise account + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + info(enterpriseAccountId: string, payload: Heroku.EnterpriseAccountMonthlyUsageInfoPayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/enterprise-account-monthly-usage-service.js b/lib/cjs/services/enterprise-account-monthly-usage-service.js new file mode 100644 index 0000000..69ae43c --- /dev/null +++ b/lib/cjs/services/enterprise-account-monthly-usage-service.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Enterprise Account Monthly Usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-monthly-usage) + * Usage for an enterprise account at a monthly resolution. + */ +class EnterpriseAccountMonthlyUsageService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieves usage for an enterprise account for a range of months. Start and end dates can be specified as query parameters using the date format YYYY-MM. If no end date is specified, one month of usage is returned. The enterprise account identifier can be found from the [enterprise account list](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-list). + * + * @param enterpriseAccountId unique identifier of the enterprise account + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async info(enterpriseAccountId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountId}/usage/monthly`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = EnterpriseAccountMonthlyUsageService; diff --git a/lib/cjs/services/enterprise-account-service.d.ts b/lib/cjs/services/enterprise-account-service.d.ts new file mode 100644 index 0000000..17e5799 --- /dev/null +++ b/lib/cjs/services/enterprise-account-service.d.ts @@ -0,0 +1,31 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Enterprise Account](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account) + * Enterprise accounts allow companies to manage their development teams and billing. + */ +export default class EnterpriseAccountService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List enterprise accounts in which you are a member. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Information about an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + info(enterpriseAccountIdentity: string, requestInit?: Omit): Promise; + /** + * Update enterprise account properties + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(enterpriseAccountIdentity: string, payload: Heroku.EnterpriseAccountUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/enterprise-account-service.js b/lib/cjs/services/enterprise-account-service.js new file mode 100644 index 0000000..4b514b5 --- /dev/null +++ b/lib/cjs/services/enterprise-account-service.js @@ -0,0 +1,77 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Enterprise Account](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account) + * Enterprise accounts allow companies to manage their development teams and billing. + */ +class EnterpriseAccountService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List enterprise accounts in which you are a member. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Information about an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + async info(enterpriseAccountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update enterprise account properties + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(enterpriseAccountIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = EnterpriseAccountService; diff --git a/lib/cjs/services/filter-apps-service.d.ts b/lib/cjs/services/filter-apps-service.d.ts new file mode 100644 index 0000000..a9945df --- /dev/null +++ b/lib/cjs/services/filter-apps-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Filters](https://devcenter.heroku.com/articles/platform-api-reference#filter-apps) + * Filters are special endpoints to allow for API consumers to specify a subset of resources to consume in order to reduce the number of requests that are performed. Each filter endpoint endpoint is responsible for determining its supported request format. The endpoints are over POST in order to handle large request bodies without hitting request uri query length limitations, but the requests themselves are idempotent and will not have side effects. + */ +export default class FilterAppsService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Request an apps list filtered by app id. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + apps(payload: Heroku.Filter, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/filter-apps-service.js b/lib/cjs/services/filter-apps-service.js new file mode 100644 index 0000000..58e7694 --- /dev/null +++ b/lib/cjs/services/filter-apps-service.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Filters](https://devcenter.heroku.com/articles/platform-api-reference#filter-apps) + * Filters are special endpoints to allow for API consumers to specify a subset of resources to consume in order to reduce the number of requests that are performed. Each filter endpoint endpoint is responsible for determining its supported request format. The endpoints are over POST in order to handle large request bodies without hitting request uri query length limitations, but the requests themselves are idempotent and will not have side effects. + */ +class FilterAppsService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Request an apps list filtered by app id. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async apps(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/filters/apps`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = FilterAppsService; diff --git a/lib/cjs/services/formation-service.d.ts b/lib/cjs/services/formation-service.d.ts new file mode 100644 index 0000000..208e548 --- /dev/null +++ b/lib/cjs/services/formation-service.d.ts @@ -0,0 +1,42 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Formation](https://devcenter.heroku.com/articles/platform-api-reference#formation) + * The formation of processes that should be maintained for an app. Update the formation to scale processes or change dyno sizes. Available process type names and commands are defined by the `process_types` attribute for the [slug](#slug) currently released on an app. + */ +export default class FormationService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for a process type + * + * @param appIdentity unique identifier of app or unique name of app. + * @param formationIdentity unique identifier of this process type or type of process to maintain. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, formationIdentity: string, requestInit?: Omit): Promise; + /** + * List process type formation + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; + /** + * Batch update process types + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + batchUpdate(appIdentity: string, payload: Heroku.FormationBatchUpdatePayload, requestInit?: Omit): Promise; + /** + * Update process type + * + * @param appIdentity unique identifier of app or unique name of app. + * @param formationIdentity unique identifier of this process type or type of process to maintain. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, formationIdentity: string, payload: Heroku.FormationUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/formation-service.js b/lib/cjs/services/formation-service.js new file mode 100644 index 0000000..739f702 --- /dev/null +++ b/lib/cjs/services/formation-service.js @@ -0,0 +1,103 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Formation](https://devcenter.heroku.com/articles/platform-api-reference#formation) + * The formation of processes that should be maintained for an app. Update the formation to scale processes or change dyno sizes. Available process type names and commands are defined by the `process_types` attribute for the [slug](#slug) currently released on an app. + */ +class FormationService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for a process type + * + * @param appIdentity unique identifier of app or unique name of app. + * @param formationIdentity unique identifier of this process type or type of process to maintain. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, formationIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formation/${formationIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List process type formation + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formation`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Batch update process types + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async batchUpdate(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formation`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update process type + * + * @param appIdentity unique identifier of app or unique name of app. + * @param formationIdentity unique identifier of this process type or type of process to maintain. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, formationIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formation/${formationIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = FormationService; diff --git a/lib/cjs/services/identity-provider-service.d.ts b/lib/cjs/services/identity-provider-service.d.ts new file mode 100644 index 0000000..144c4d4 --- /dev/null +++ b/lib/cjs/services/identity-provider-service.d.ts @@ -0,0 +1,48 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Identity Provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) + * Identity Providers represent the SAML configuration of teams or an Enterprise account + */ +export default class IdentityProviderService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Get a list of a team's Identity Providers + * + * @param teamName unique name of team + * @example "example". + * @param requestInit The initializer for the request. + */ + listByTeam(teamName: string, requestInit?: Omit): Promise; + /** + * Create an Identity Provider for a team + * + * @param teamName unique name of team + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + createByTeam(teamName: string, payload: Heroku.IdentityProviderCreateByTeamPayload, requestInit?: Omit): Promise; + /** + * Update a team's Identity Provider + * + * @param teamName unique name of team + * @example "example". + * @param identityProviderId unique identifier of this identity provider + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + updateByTeam(teamName: string, identityProviderId: string, payload: Heroku.IdentityProviderUpdateByTeamPayload, requestInit?: Omit): Promise; + /** + * Delete a team's Identity Provider + * + * @param teamName unique name of team + * @example "example". + * @param identityProviderId unique identifier of this identity provider + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + deleteByTeam(teamName: string, identityProviderId: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/identity-provider-service.js b/lib/cjs/services/identity-provider-service.js new file mode 100644 index 0000000..8a29f0d --- /dev/null +++ b/lib/cjs/services/identity-provider-service.js @@ -0,0 +1,110 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Identity Provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) + * Identity Providers represent the SAML configuration of teams or an Enterprise account + */ +class IdentityProviderService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Get a list of a team's Identity Providers + * + * @param teamName unique name of team + * @example "example". + * @param requestInit The initializer for the request. + */ + async listByTeam(teamName, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create an Identity Provider for a team + * + * @param teamName unique name of team + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async createByTeam(teamName, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update a team's Identity Provider + * + * @param teamName unique name of team + * @example "example". + * @param identityProviderId unique identifier of this identity provider + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async updateByTeam(teamName, identityProviderId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers/${identityProviderId}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete a team's Identity Provider + * + * @param teamName unique name of team + * @example "example". + * @param identityProviderId unique identifier of this identity provider + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async deleteByTeam(teamName, identityProviderId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers/${identityProviderId}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = IdentityProviderService; diff --git a/lib/cjs/services/inbound-ruleset-service.d.ts b/lib/cjs/services/inbound-ruleset-service.d.ts new file mode 100644 index 0000000..aeb22e9 --- /dev/null +++ b/lib/cjs/services/inbound-ruleset-service.d.ts @@ -0,0 +1,40 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Inbound Ruleset](https://devcenter.heroku.com/articles/platform-api-reference#inbound-ruleset) + * An inbound-ruleset is a collection of rules that specify what hosts can or cannot connect to an application. + */ +export default class InboundRulesetService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Current inbound ruleset for a space + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + current(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Info on an existing Inbound Ruleset + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param inboundRulesetIdentity unique identifier of an inbound-ruleset. + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, inboundRulesetIdentity: string, requestInit?: Omit): Promise; + /** + * List all inbound rulesets for a space + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + list(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Create a new inbound ruleset + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(spaceIdentity: string, payload: Heroku.InboundRulesetCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/inbound-ruleset-service.js b/lib/cjs/services/inbound-ruleset-service.js new file mode 100644 index 0000000..892e23f --- /dev/null +++ b/lib/cjs/services/inbound-ruleset-service.js @@ -0,0 +1,99 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Inbound Ruleset](https://devcenter.heroku.com/articles/platform-api-reference#inbound-ruleset) + * An inbound-ruleset is a collection of rules that specify what hosts can or cannot connect to an application. + */ +class InboundRulesetService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Current inbound ruleset for a space + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async current(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/inbound-ruleset`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info on an existing Inbound Ruleset + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param inboundRulesetIdentity unique identifier of an inbound-ruleset. + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, inboundRulesetIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/inbound-rulesets/${inboundRulesetIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List all inbound rulesets for a space + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async list(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/inbound-rulesets`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a new inbound ruleset + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(spaceIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/inbound-ruleset`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = InboundRulesetService; diff --git a/lib/cjs/services/index.d.ts b/lib/cjs/services/index.d.ts new file mode 100644 index 0000000..7fce78f --- /dev/null +++ b/lib/cjs/services/index.d.ts @@ -0,0 +1,96 @@ +export * from './account-delinquency-service'; +export * from './account-feature-service'; +export * from './account-service'; +export * from './add-on-action-service'; +export * from './add-on-attachment-service'; +export * from './add-on-config-service'; +export * from './add-on-region-capability-service'; +export * from './add-on-service-service'; +export * from './add-on-webhook-delivery-service'; +export * from './add-on-webhook-event-service'; +export * from './add-on-webhook-service'; +export * from './add-on-service'; +export * from './allowed-add-on-service-service'; +export * from './app-feature-service'; +export * from './app-setup-service'; +export * from './app-transfer-service'; +export * from './app-webhook-delivery-service'; +export * from './app-webhook-event-service'; +export * from './app-webhook-service'; +export * from './app-service'; +export * from './archive-service'; +export * from './audit-trail-event-service'; +export * from './build-service'; +export * from './buildpack-installation-service'; +export * from './collaborator-service'; +export * from './config-var-service'; +export * from './credit-service'; +export * from './domain-service'; +export * from './dyno-size-service'; +export * from './dyno-service'; +export * from './enterprise-account-daily-usage-service'; +export * from './enterprise-account-member-service'; +export * from './enterprise-account-monthly-usage-service'; +export * from './enterprise-account-service'; +export * from './filter-apps-service'; +export * from './formation-service'; +export * from './identity-provider-service'; +export * from './inbound-ruleset-service'; +export * from './invoice-address-service'; +export * from './invoice-service'; +export * from './key-service'; +export * from './log-drain-service'; +export * from './log-session-service'; +export * from './oauth-authorization-service'; +export * from './oauth-client-service'; +export * from './oauth-grant-service'; +export * from './oauth-token-service'; +export * from './password-reset-service'; +export * from './peering-info-service'; +export * from './peering-service'; +export * from './permission-entity-service'; +export * from './pipeline-build-service'; +export * from './pipeline-config-var-service'; +export * from './pipeline-coupling-service'; +export * from './pipeline-deployment-service'; +export * from './pipeline-promotion-target-service'; +export * from './pipeline-promotion-service'; +export * from './pipeline-release-service'; +export * from './pipeline-stack-service'; +export * from './pipeline-transfer-service'; +export * from './pipeline-service'; +export * from './plan-service'; +export * from './rate-limit-service'; +export * from './region-service'; +export * from './release-service'; +export * from './review-app-service'; +export * from './review-app-config-service'; +export * from './slug-service'; +export * from './sms-number-service'; +export * from './sni-endpoint-service'; +export * from './source-service'; +export * from './space-app-access-service'; +export * from './space-nat-service'; +export * from './space-topology-service'; +export * from './space-transfer-service'; +export * from './space-service'; +export * from './stack-service'; +export * from './team-add-on-service'; +export * from './team-app-collaborator-service'; +export * from './team-app-permission-service'; +export * from './team-app-service'; +export * from './team-daily-usage-service'; +export * from './team-delinquency-service'; +export * from './team-feature-service'; +export * from './team-invitation-service'; +export * from './team-invoice-service'; +export * from './team-member-service'; +export * from './team-monthly-usage-service'; +export * from './team-preferences-service'; +export * from './team-space-service'; +export * from './team-service'; +export * from './test-case-service'; +export * from './test-node-service'; +export * from './test-run-service'; +export * from './user-preferences-service'; +export * from './vpn-connection-service'; diff --git a/lib/cjs/services/index.js b/lib/cjs/services/index.js new file mode 100644 index 0000000..c94ec47 --- /dev/null +++ b/lib/cjs/services/index.js @@ -0,0 +1,99 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./account-delinquency-service"), exports); +tslib_1.__exportStar(require("./account-feature-service"), exports); +tslib_1.__exportStar(require("./account-service"), exports); +tslib_1.__exportStar(require("./add-on-action-service"), exports); +tslib_1.__exportStar(require("./add-on-attachment-service"), exports); +tslib_1.__exportStar(require("./add-on-config-service"), exports); +tslib_1.__exportStar(require("./add-on-region-capability-service"), exports); +tslib_1.__exportStar(require("./add-on-service-service"), exports); +tslib_1.__exportStar(require("./add-on-webhook-delivery-service"), exports); +tslib_1.__exportStar(require("./add-on-webhook-event-service"), exports); +tslib_1.__exportStar(require("./add-on-webhook-service"), exports); +tslib_1.__exportStar(require("./add-on-service"), exports); +tslib_1.__exportStar(require("./allowed-add-on-service-service"), exports); +tslib_1.__exportStar(require("./app-feature-service"), exports); +tslib_1.__exportStar(require("./app-setup-service"), exports); +tslib_1.__exportStar(require("./app-transfer-service"), exports); +tslib_1.__exportStar(require("./app-webhook-delivery-service"), exports); +tslib_1.__exportStar(require("./app-webhook-event-service"), exports); +tslib_1.__exportStar(require("./app-webhook-service"), exports); +tslib_1.__exportStar(require("./app-service"), exports); +tslib_1.__exportStar(require("./archive-service"), exports); +tslib_1.__exportStar(require("./audit-trail-event-service"), exports); +tslib_1.__exportStar(require("./build-service"), exports); +tslib_1.__exportStar(require("./buildpack-installation-service"), exports); +tslib_1.__exportStar(require("./collaborator-service"), exports); +tslib_1.__exportStar(require("./config-var-service"), exports); +tslib_1.__exportStar(require("./credit-service"), exports); +tslib_1.__exportStar(require("./domain-service"), exports); +tslib_1.__exportStar(require("./dyno-size-service"), exports); +tslib_1.__exportStar(require("./dyno-service"), exports); +tslib_1.__exportStar(require("./enterprise-account-daily-usage-service"), exports); +tslib_1.__exportStar(require("./enterprise-account-member-service"), exports); +tslib_1.__exportStar(require("./enterprise-account-monthly-usage-service"), exports); +tslib_1.__exportStar(require("./enterprise-account-service"), exports); +tslib_1.__exportStar(require("./filter-apps-service"), exports); +tslib_1.__exportStar(require("./formation-service"), exports); +tslib_1.__exportStar(require("./identity-provider-service"), exports); +tslib_1.__exportStar(require("./inbound-ruleset-service"), exports); +tslib_1.__exportStar(require("./invoice-address-service"), exports); +tslib_1.__exportStar(require("./invoice-service"), exports); +tslib_1.__exportStar(require("./key-service"), exports); +tslib_1.__exportStar(require("./log-drain-service"), exports); +tslib_1.__exportStar(require("./log-session-service"), exports); +tslib_1.__exportStar(require("./oauth-authorization-service"), exports); +tslib_1.__exportStar(require("./oauth-client-service"), exports); +tslib_1.__exportStar(require("./oauth-grant-service"), exports); +tslib_1.__exportStar(require("./oauth-token-service"), exports); +tslib_1.__exportStar(require("./password-reset-service"), exports); +tslib_1.__exportStar(require("./peering-info-service"), exports); +tslib_1.__exportStar(require("./peering-service"), exports); +tslib_1.__exportStar(require("./permission-entity-service"), exports); +tslib_1.__exportStar(require("./pipeline-build-service"), exports); +tslib_1.__exportStar(require("./pipeline-config-var-service"), exports); +tslib_1.__exportStar(require("./pipeline-coupling-service"), exports); +tslib_1.__exportStar(require("./pipeline-deployment-service"), exports); +tslib_1.__exportStar(require("./pipeline-promotion-target-service"), exports); +tslib_1.__exportStar(require("./pipeline-promotion-service"), exports); +tslib_1.__exportStar(require("./pipeline-release-service"), exports); +tslib_1.__exportStar(require("./pipeline-stack-service"), exports); +tslib_1.__exportStar(require("./pipeline-transfer-service"), exports); +tslib_1.__exportStar(require("./pipeline-service"), exports); +tslib_1.__exportStar(require("./plan-service"), exports); +tslib_1.__exportStar(require("./rate-limit-service"), exports); +tslib_1.__exportStar(require("./region-service"), exports); +tslib_1.__exportStar(require("./release-service"), exports); +tslib_1.__exportStar(require("./review-app-service"), exports); +tslib_1.__exportStar(require("./review-app-config-service"), exports); +tslib_1.__exportStar(require("./slug-service"), exports); +tslib_1.__exportStar(require("./sms-number-service"), exports); +tslib_1.__exportStar(require("./sni-endpoint-service"), exports); +tslib_1.__exportStar(require("./source-service"), exports); +tslib_1.__exportStar(require("./space-app-access-service"), exports); +tslib_1.__exportStar(require("./space-nat-service"), exports); +tslib_1.__exportStar(require("./space-topology-service"), exports); +tslib_1.__exportStar(require("./space-transfer-service"), exports); +tslib_1.__exportStar(require("./space-service"), exports); +tslib_1.__exportStar(require("./stack-service"), exports); +tslib_1.__exportStar(require("./team-add-on-service"), exports); +tslib_1.__exportStar(require("./team-app-collaborator-service"), exports); +tslib_1.__exportStar(require("./team-app-permission-service"), exports); +tslib_1.__exportStar(require("./team-app-service"), exports); +tslib_1.__exportStar(require("./team-daily-usage-service"), exports); +tslib_1.__exportStar(require("./team-delinquency-service"), exports); +tslib_1.__exportStar(require("./team-feature-service"), exports); +tslib_1.__exportStar(require("./team-invitation-service"), exports); +tslib_1.__exportStar(require("./team-invoice-service"), exports); +tslib_1.__exportStar(require("./team-member-service"), exports); +tslib_1.__exportStar(require("./team-monthly-usage-service"), exports); +tslib_1.__exportStar(require("./team-preferences-service"), exports); +tslib_1.__exportStar(require("./team-space-service"), exports); +tslib_1.__exportStar(require("./team-service"), exports); +tslib_1.__exportStar(require("./test-case-service"), exports); +tslib_1.__exportStar(require("./test-node-service"), exports); +tslib_1.__exportStar(require("./test-run-service"), exports); +tslib_1.__exportStar(require("./user-preferences-service"), exports); +tslib_1.__exportStar(require("./vpn-connection-service"), exports); diff --git a/lib/cjs/services/invoice-address-service.d.ts b/lib/cjs/services/invoice-address-service.d.ts new file mode 100644 index 0000000..85a750b --- /dev/null +++ b/lib/cjs/services/invoice-address-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Vault API - Invoice Address](https://devcenter.heroku.com/articles/platform-api-reference#invoice-address) + * An invoice address represents the address that should be listed on an invoice. + */ +export default class InvoiceAddressService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieve existing invoice address. + * + * @param requestInit The initializer for the request. + */ + info(requestInit?: Omit): Promise; + /** + * Update invoice address for an account. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(payload: Heroku.InvoiceAddressUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/invoice-address-service.js b/lib/cjs/services/invoice-address-service.js new file mode 100644 index 0000000..7d2b695 --- /dev/null +++ b/lib/cjs/services/invoice-address-service.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Vault API - Invoice Address](https://devcenter.heroku.com/articles/platform-api-reference#invoice-address) + * An invoice address represents the address that should be listed on an invoice. + */ +class InvoiceAddressService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieve existing invoice address. + * + * @param requestInit The initializer for the request. + */ + async info(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/invoice-address`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update invoice address for an account. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/invoice-address`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = InvoiceAddressService; diff --git a/lib/cjs/services/invoice-service.d.ts b/lib/cjs/services/invoice-service.d.ts new file mode 100644 index 0000000..2a859e3 --- /dev/null +++ b/lib/cjs/services/invoice-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Invoice](https://devcenter.heroku.com/articles/platform-api-reference#invoice) + * An invoice is an itemized bill of goods for an account which includes pricing and charges. + */ +export default class InvoiceService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing invoice. + * + * @param invoiceIdentity human readable invoice number. + * @param requestInit The initializer for the request. + */ + info(invoiceIdentity: number, requestInit?: Omit): Promise; + /** + * List existing invoices. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/invoice-service.js b/lib/cjs/services/invoice-service.js new file mode 100644 index 0000000..420c658 --- /dev/null +++ b/lib/cjs/services/invoice-service.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Invoice](https://devcenter.heroku.com/articles/platform-api-reference#invoice) + * An invoice is an itemized bill of goods for an account which includes pricing and charges. + */ +class InvoiceService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing invoice. + * + * @param invoiceIdentity human readable invoice number. + * @param requestInit The initializer for the request. + */ + async info(invoiceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/invoices/${invoiceIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing invoices. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/invoices`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = InvoiceService; diff --git a/lib/cjs/services/key-service.d.ts b/lib/cjs/services/key-service.d.ts new file mode 100644 index 0000000..9ff0eed --- /dev/null +++ b/lib/cjs/services/key-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Key](https://devcenter.heroku.com/articles/platform-api-reference#key) + * Keys represent public SSH keys associated with an account and are used to authorize accounts as they are performing git operations. + */ +export default class KeyService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing key. + * + * @param keyIdentity unique identifier of this key or a unique identifying string based on contents. + * @param requestInit The initializer for the request. + */ + info(keyIdentity: string, requestInit?: Omit): Promise; + /** + * List existing keys. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/key-service.js b/lib/cjs/services/key-service.js new file mode 100644 index 0000000..e6955a5 --- /dev/null +++ b/lib/cjs/services/key-service.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Key](https://devcenter.heroku.com/articles/platform-api-reference#key) + * Keys represent public SSH keys associated with an account and are used to authorize accounts as they are performing git operations. + */ +class KeyService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing key. + * + * @param keyIdentity unique identifier of this key or a unique identifying string based on contents. + * @param requestInit The initializer for the request. + */ + async info(keyIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/keys/${keyIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing keys. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/keys`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = KeyService; diff --git a/lib/cjs/services/log-drain-service.d.ts b/lib/cjs/services/log-drain-service.d.ts new file mode 100644 index 0000000..7bdee78 --- /dev/null +++ b/lib/cjs/services/log-drain-service.d.ts @@ -0,0 +1,57 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Log Drain](https://devcenter.heroku.com/articles/platform-api-reference#log-drain) + * [Log drains](https://devcenter.heroku.com/articles/log-drains) provide a way to forward your Heroku logs to an external syslog server for long-term archiving. This external service must be configured to receive syslog packets from Heroku, whereupon its URL can be added to an app using this API. Some add-ons will add a log drain when they are provisioned to an app. These drains can only be removed by removing the add-on. + */ +export default class LogDrainService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new log drain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.LogDrainCreatePayload, requestInit?: Omit): Promise; + /** + * Update an add-on owned log drain. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param logDrainQueryIdentity unique identifier of this log drain or url associated with the log drain or token associated with the log drain. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(addOnIdentity: string, logDrainQueryIdentity: string, payload: Heroku.LogDrainUpdatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing log drain. Log drains added by add-ons can only be removed by removing the add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param logDrainQueryIdentity unique identifier of this log drain or url associated with the log drain or token associated with the log drain. + * @param requestInit The initializer for the request. + */ + delete(appIdentity: string, logDrainQueryIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing log drain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param logDrainQueryIdentity unique identifier of this log drain or url associated with the log drain or token associated with the log drain. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, logDrainQueryIdentity: string, requestInit?: Omit): Promise; + /** + * List existing log drains for an add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + listByAddOn(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * List existing log drains. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/log-drain-service.js b/lib/cjs/services/log-drain-service.js new file mode 100644 index 0000000..908879b --- /dev/null +++ b/lib/cjs/services/log-drain-service.js @@ -0,0 +1,145 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Log Drain](https://devcenter.heroku.com/articles/platform-api-reference#log-drain) + * [Log drains](https://devcenter.heroku.com/articles/log-drains) provide a way to forward your Heroku logs to an external syslog server for long-term archiving. This external service must be configured to receive syslog packets from Heroku, whereupon its URL can be added to an app using this API. Some add-ons will add a log drain when they are provisioned to an app. These drains can only be removed by removing the add-on. + */ +class LogDrainService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new log drain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/log-drains`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an add-on owned log drain. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param logDrainQueryIdentity unique identifier of this log drain or url associated with the log drain or token associated with the log drain. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(addOnIdentity, logDrainQueryIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/log-drains/${logDrainQueryIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing log drain. Log drains added by add-ons can only be removed by removing the add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param logDrainQueryIdentity unique identifier of this log drain or url associated with the log drain or token associated with the log drain. + * @param requestInit The initializer for the request. + */ + async delete(appIdentity, logDrainQueryIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/log-drains/${logDrainQueryIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing log drain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param logDrainQueryIdentity unique identifier of this log drain or url associated with the log drain or token associated with the log drain. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, logDrainQueryIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/log-drains/${logDrainQueryIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing log drains for an add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async listByAddOn(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/log-drains`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing log drains. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/log-drains`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = LogDrainService; diff --git a/lib/cjs/services/log-session-service.d.ts b/lib/cjs/services/log-session-service.d.ts new file mode 100644 index 0000000..4e9d0bd --- /dev/null +++ b/lib/cjs/services/log-session-service.d.ts @@ -0,0 +1,18 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Log Session](https://devcenter.heroku.com/articles/platform-api-reference#log-session) + * A log session is a reference to the http based log stream for an app. + */ +export default class LogSessionService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new log session. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.LogSessionCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/log-session-service.js b/lib/cjs/services/log-session-service.js new file mode 100644 index 0000000..913d44e --- /dev/null +++ b/lib/cjs/services/log-session-service.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Log Session](https://devcenter.heroku.com/articles/platform-api-reference#log-session) + * A log session is a reference to the http based log stream for an app. + */ +class LogSessionService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new log session. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/log-sessions`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = LogSessionService; diff --git a/lib/cjs/services/oauth-authorization-service.d.ts b/lib/cjs/services/oauth-authorization-service.d.ts new file mode 100644 index 0000000..be4183c --- /dev/null +++ b/lib/cjs/services/oauth-authorization-service.d.ts @@ -0,0 +1,44 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - OAuth Authorization](https://devcenter.heroku.com/articles/platform-api-reference#oauth-authorization) + * OAuth authorizations represent clients that a Heroku user has authorized to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export default class OauthAuthorizationService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new OAuth authorization. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.OauthAuthorizationCreatePayload, requestInit?: Omit): Promise; + /** + * Delete OAuth authorization. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param requestInit The initializer for the request. + */ + delete(oauthAuthorizationIdentity: string, requestInit?: Omit): Promise; + /** + * Info for an OAuth authorization. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param requestInit The initializer for the request. + */ + info(oauthAuthorizationIdentity: string, requestInit?: Omit): Promise; + /** + * List OAuth authorizations. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Regenerate OAuth tokens. This endpoint is only available to direct authorizations or privileged OAuth clients. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param requestInit The initializer for the request. + */ + regenerate(oauthAuthorizationIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/oauth-authorization-service.js b/lib/cjs/services/oauth-authorization-service.js new file mode 100644 index 0000000..dfdea1f --- /dev/null +++ b/lib/cjs/services/oauth-authorization-service.js @@ -0,0 +1,118 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - OAuth Authorization](https://devcenter.heroku.com/articles/platform-api-reference#oauth-authorization) + * OAuth authorizations represent clients that a Heroku user has authorized to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +class OauthAuthorizationService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new OAuth authorization. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete OAuth authorization. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param requestInit The initializer for the request. + */ + async delete(oauthAuthorizationIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations/${oauthAuthorizationIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for an OAuth authorization. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param requestInit The initializer for the request. + */ + async info(oauthAuthorizationIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations/${oauthAuthorizationIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List OAuth authorizations. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Regenerate OAuth tokens. This endpoint is only available to direct authorizations or privileged OAuth clients. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param requestInit The initializer for the request. + */ + async regenerate(oauthAuthorizationIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations/${oauthAuthorizationIdentity}/actions/regenerate-tokens`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = OauthAuthorizationService; diff --git a/lib/cjs/services/oauth-client-service.d.ts b/lib/cjs/services/oauth-client-service.d.ts new file mode 100644 index 0000000..ca9368b --- /dev/null +++ b/lib/cjs/services/oauth-client-service.d.ts @@ -0,0 +1,52 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - OAuth Client](https://devcenter.heroku.com/articles/platform-api-reference#oauth-client) + * OAuth clients are applications that Heroku users can authorize to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth). + */ +export default class OauthClientService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new OAuth client. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.OauthClientCreatePayload, requestInit?: Omit): Promise; + /** + * Delete OAuth client. + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param requestInit The initializer for the request. + */ + delete(oauthClientIdentity: string, requestInit?: Omit): Promise; + /** + * Info for an OAuth client. The output for unauthenticated requests excludes the `secret` parameter. + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param requestInit The initializer for the request. + */ + info(oauthClientIdentity: string, requestInit?: Omit): Promise; + /** + * List OAuth clients + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Update OAuth client + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(oauthClientIdentity: string, payload: Heroku.OauthClientUpdatePayload, requestInit?: Omit): Promise; + /** + * Rotate credentials for an OAuth client + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param requestInit The initializer for the request. + */ + rotateCredentials(oauthClientIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/oauth-client-service.js b/lib/cjs/services/oauth-client-service.js new file mode 100644 index 0000000..a529233 --- /dev/null +++ b/lib/cjs/services/oauth-client-service.js @@ -0,0 +1,137 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - OAuth Client](https://devcenter.heroku.com/articles/platform-api-reference#oauth-client) + * OAuth clients are applications that Heroku users can authorize to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth). + */ +class OauthClientService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new OAuth client. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/clients`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete OAuth client. + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param requestInit The initializer for the request. + */ + async delete(oauthClientIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/clients/${oauthClientIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for an OAuth client. The output for unauthenticated requests excludes the `secret` parameter. + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param requestInit The initializer for the request. + */ + async info(oauthClientIdentity, requestInit = {}) { + await this.fetchImpl(`/oauth/clients/${oauthClientIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } + /** + * List OAuth clients + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/clients`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update OAuth client + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(oauthClientIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/clients/${oauthClientIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Rotate credentials for an OAuth client + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param requestInit The initializer for the request. + */ + async rotateCredentials(oauthClientIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/clients/${oauthClientIdentity}/actions/rotate-credentials`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = OauthClientService; diff --git a/lib/cjs/services/oauth-grant-service.d.ts b/lib/cjs/services/oauth-grant-service.d.ts new file mode 100644 index 0000000..a1db013 --- /dev/null +++ b/lib/cjs/services/oauth-grant-service.d.ts @@ -0,0 +1,9 @@ +/** + * [Heroku Platform API - OAuth Grant](https://devcenter.heroku.com/articles/platform-api-reference#oauth-grant) + * OAuth grants are used to obtain authorizations on behalf of a user. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export default class OauthGrantService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); +} diff --git a/lib/cjs/services/oauth-grant-service.js b/lib/cjs/services/oauth-grant-service.js new file mode 100644 index 0000000..19a732d --- /dev/null +++ b/lib/cjs/services/oauth-grant-service.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - OAuth Grant](https://devcenter.heroku.com/articles/platform-api-reference#oauth-grant) + * OAuth grants are used to obtain authorizations on behalf of a user. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +class OauthGrantService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } +} +exports.default = OauthGrantService; diff --git a/lib/cjs/services/oauth-token-service.d.ts b/lib/cjs/services/oauth-token-service.d.ts new file mode 100644 index 0000000..aa68854 --- /dev/null +++ b/lib/cjs/services/oauth-token-service.d.ts @@ -0,0 +1,24 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - OAuth Token](https://devcenter.heroku.com/articles/platform-api-reference#oauth-token) + * OAuth tokens provide access for authorized clients to act on behalf of a Heroku user to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export default class OauthTokenService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new OAuth token. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.OauthTokenCreatePayload, requestInit?: Omit): Promise; + /** + * Revoke OAuth access token. + * + * @param oauthTokenIdentity unique identifier of OAuth token. + * @param requestInit The initializer for the request. + */ + delete(oauthTokenIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/oauth-token-service.js b/lib/cjs/services/oauth-token-service.js new file mode 100644 index 0000000..ea62010 --- /dev/null +++ b/lib/cjs/services/oauth-token-service.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - OAuth Token](https://devcenter.heroku.com/articles/platform-api-reference#oauth-token) + * OAuth tokens provide access for authorized clients to act on behalf of a Heroku user to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +class OauthTokenService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new OAuth token. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/tokens`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Revoke OAuth access token. + * + * @param oauthTokenIdentity unique identifier of OAuth token. + * @param requestInit The initializer for the request. + */ + async delete(oauthTokenIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/tokens/${oauthTokenIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = OauthTokenService; diff --git a/lib/cjs/services/password-reset-service.d.ts b/lib/cjs/services/password-reset-service.d.ts new file mode 100644 index 0000000..f6138c4 --- /dev/null +++ b/lib/cjs/services/password-reset-service.d.ts @@ -0,0 +1,26 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - PasswordReset](https://devcenter.heroku.com/articles/platform-api-reference#password-reset) + * A password reset represents a in-process password reset attempt. + */ +export default class PasswordResetService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Reset account's password. This will send a reset password link to the user's email address. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + resetPassword(payload: Heroku.PasswordResetResetPasswordPayload, requestInit?: Omit): Promise; + /** + * Complete password reset. + * + * @param passwordResetResetPasswordToken unique identifier of a password reset attempt + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + completeResetPassword(passwordResetResetPasswordToken: string, payload: Heroku.PasswordResetCompleteResetPasswordPayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/password-reset-service.js b/lib/cjs/services/password-reset-service.js new file mode 100644 index 0000000..f5557cc --- /dev/null +++ b/lib/cjs/services/password-reset-service.js @@ -0,0 +1,61 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - PasswordReset](https://devcenter.heroku.com/articles/platform-api-reference#password-reset) + * A password reset represents a in-process password reset attempt. + */ +class PasswordResetService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Reset account's password. This will send a reset password link to the user's email address. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async resetPassword(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/password-resets`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Complete password reset. + * + * @param passwordResetResetPasswordToken unique identifier of a password reset attempt + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async completeResetPassword(passwordResetResetPasswordToken, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/password-resets/${passwordResetResetPasswordToken}/actions/finalize`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = PasswordResetService; diff --git a/lib/cjs/services/peering-info-service.d.ts b/lib/cjs/services/peering-info-service.d.ts new file mode 100644 index 0000000..f0f5743 --- /dev/null +++ b/lib/cjs/services/peering-info-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Peering Info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) + * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. + */ +export default class PeeringInfoService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Provides the necessary information to establish an AWS VPC Peering with your private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/peering-info-service.js b/lib/cjs/services/peering-info-service.js new file mode 100644 index 0000000..13b1d95 --- /dev/null +++ b/lib/cjs/services/peering-info-service.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Peering Info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) + * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. + */ +class PeeringInfoService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Provides the necessary information to establish an AWS VPC Peering with your private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peering-info`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = PeeringInfoService; diff --git a/lib/cjs/services/peering-service.d.ts b/lib/cjs/services/peering-service.d.ts new file mode 100644 index 0000000..8eba208 --- /dev/null +++ b/lib/cjs/services/peering-service.d.ts @@ -0,0 +1,44 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) + * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + */ +export default class PeeringService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List peering connections of a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + list(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Accept a pending peering connection with a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. + * @example "pcx-123456789012". + * @param requestInit The initializer for the request. + */ + accept(spaceIdentity: string, peeringPcxId: string, requestInit?: Omit): Promise; + /** + * Destroy an active peering connection with a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. + * @example "pcx-123456789012". + * @param requestInit The initializer for the request. + */ + destroy(spaceIdentity: string, peeringPcxId: string, requestInit?: Omit): Promise; + /** + * Fetch information for existing peering connection + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. + * @example "pcx-123456789012". + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, peeringPcxId: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/peering-service.js b/lib/cjs/services/peering-service.js new file mode 100644 index 0000000..9c9a7cb --- /dev/null +++ b/lib/cjs/services/peering-service.js @@ -0,0 +1,103 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) + * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + */ +class PeeringService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List peering connections of a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async list(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Accept a pending peering connection with a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. + * @example "pcx-123456789012". + * @param requestInit The initializer for the request. + */ + async accept(spaceIdentity, peeringPcxId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}/actions/accept`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Destroy an active peering connection with a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. + * @example "pcx-123456789012". + * @param requestInit The initializer for the request. + */ + async destroy(spaceIdentity, peeringPcxId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Fetch information for existing peering connection + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. + * @example "pcx-123456789012". + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, peeringPcxId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = PeeringService; diff --git a/lib/cjs/services/permission-entity-service.d.ts b/lib/cjs/services/permission-entity-service.d.ts new file mode 100644 index 0000000..378f399 --- /dev/null +++ b/lib/cjs/services/permission-entity-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Permission Entity](https://devcenter.heroku.com/articles/platform-api-reference#permission-entity) + * An owned entity including users' permissions. + */ +export default class PermissionEntityService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List permission entities for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/permission-entity-service.js b/lib/cjs/services/permission-entity-service.js new file mode 100644 index 0000000..208bb3e --- /dev/null +++ b/lib/cjs/services/permission-entity-service.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Permission Entity](https://devcenter.heroku.com/articles/platform-api-reference#permission-entity) + * An owned entity including users' permissions. + */ +class PermissionEntityService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List permission entities for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/permissions`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = PermissionEntityService; diff --git a/lib/cjs/services/pipeline-build-service.d.ts b/lib/cjs/services/pipeline-build-service.d.ts new file mode 100644 index 0000000..f26ee6d --- /dev/null +++ b/lib/cjs/services/pipeline-build-service.d.ts @@ -0,0 +1,18 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Build](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-build) + * Information about latest builds of apps in a pipeline. + */ +export default class PipelineBuildService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List latest builds for each app in a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + list(pipelineId: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/pipeline-build-service.js b/lib/cjs/services/pipeline-build-service.js new file mode 100644 index 0000000..26629a5 --- /dev/null +++ b/lib/cjs/services/pipeline-build-service.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Pipeline Build](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-build) + * Information about latest builds of apps in a pipeline. + */ +class PipelineBuildService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List latest builds for each app in a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async list(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/latest-builds`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = PipelineBuildService; diff --git a/lib/cjs/services/pipeline-config-var-service.d.ts b/lib/cjs/services/pipeline-config-var-service.d.ts new file mode 100644 index 0000000..3204e16 --- /dev/null +++ b/lib/cjs/services/pipeline-config-var-service.d.ts @@ -0,0 +1,30 @@ +/** + * [Heroku Platform API - Pipeline Config Vars](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-config-var) + * Pipeline Config Vars allow you to manage the configuration information provided to a pipeline. + */ +export default class PipelineConfigVarService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Get config-vars for a pipeline stage. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param pipelineCouplingStage target pipeline stage + * @example "production". + * @param requestInit The initializer for the request. + */ + infoForApp(pipelineId: string, pipelineCouplingStage: 'test' | 'review' | 'development' | 'staging' | 'production', requestInit?: Omit): Promise>; + /** + * Update config-vars for a pipeline stage. You can update existing config-vars by setting them again, and remove by setting it to `null`. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param pipelineCouplingStage target pipeline stage + * @example "production". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(pipelineId: string, pipelineCouplingStage: 'test' | 'review' | 'development' | 'staging' | 'production', payload: Record, requestInit?: Omit): Promise>; +} diff --git a/lib/cjs/services/pipeline-config-var-service.js b/lib/cjs/services/pipeline-config-var-service.js new file mode 100644 index 0000000..dac9dd1 --- /dev/null +++ b/lib/cjs/services/pipeline-config-var-service.js @@ -0,0 +1,64 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Pipeline Config Vars](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-config-var) + * Pipeline Config Vars allow you to manage the configuration information provided to a pipeline. + */ +class PipelineConfigVarService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Get config-vars for a pipeline stage. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param pipelineCouplingStage target pipeline stage + * @example "production". + * @param requestInit The initializer for the request. + */ + async infoForApp(pipelineId, pipelineCouplingStage, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/stage/${pipelineCouplingStage}/config-vars`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update config-vars for a pipeline stage. You can update existing config-vars by setting them again, and remove by setting it to `null`. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param pipelineCouplingStage target pipeline stage + * @example "production". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(pipelineId, pipelineCouplingStage, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/stage/${pipelineCouplingStage}/config-vars`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = PipelineConfigVarService; diff --git a/lib/cjs/services/pipeline-coupling-service.d.ts b/lib/cjs/services/pipeline-coupling-service.d.ts new file mode 100644 index 0000000..53bde99 --- /dev/null +++ b/lib/cjs/services/pipeline-coupling-service.d.ts @@ -0,0 +1,73 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Coupling](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-coupling) + * Information about an app's coupling to a pipeline + */ +export default class PipelineCouplingService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List couplings for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + listByPipeline(pipelineId: string, requestInit?: Omit): Promise; + /** + * List pipeline couplings for the current user. + * + * @param requestInit The initializer for the request. + */ + listByCurrentUser(requestInit?: Omit): Promise; + /** + * List pipeline couplings. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * List pipeline couplings for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + listByTeam(teamIdentity: string, requestInit?: Omit): Promise; + /** + * Create a new pipeline coupling. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.PipelineCouplingCreatePayload, requestInit?: Omit): Promise; + /** + * Info for an existing pipeline coupling. + * + * @param pipelineCouplingIdentity unique identifier of pipeline coupling. + * @param requestInit The initializer for the request. + */ + info(pipelineCouplingIdentity: string, requestInit?: Omit): Promise; + /** + * Delete an existing pipeline coupling. + * + * @param pipelineCouplingIdentity unique identifier of pipeline coupling. + * @param requestInit The initializer for the request. + */ + delete(pipelineCouplingIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing pipeline coupling. + * + * @param pipelineCouplingIdentity unique identifier of pipeline coupling. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(pipelineCouplingIdentity: string, payload: Heroku.PipelineCouplingUpdatePayload, requestInit?: Omit): Promise; + /** + * Info for an existing pipeline coupling. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + infoByApp(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/pipeline-coupling-service.js b/lib/cjs/services/pipeline-coupling-service.js new file mode 100644 index 0000000..2f5f0f8 --- /dev/null +++ b/lib/cjs/services/pipeline-coupling-service.js @@ -0,0 +1,200 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Pipeline Coupling](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-coupling) + * Information about an app's coupling to a pipeline + */ +class PipelineCouplingService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List couplings for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async listByPipeline(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/pipeline-couplings`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List pipeline couplings for the current user. + * + * @param requestInit The initializer for the request. + */ + async listByCurrentUser(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/~/pipeline-couplings`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List pipeline couplings. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-couplings`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List pipeline couplings for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async listByTeam(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/pipeline-couplings`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a new pipeline coupling. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-couplings`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for an existing pipeline coupling. + * + * @param pipelineCouplingIdentity unique identifier of pipeline coupling. + * @param requestInit The initializer for the request. + */ + async info(pipelineCouplingIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-couplings/${pipelineCouplingIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing pipeline coupling. + * + * @param pipelineCouplingIdentity unique identifier of pipeline coupling. + * @param requestInit The initializer for the request. + */ + async delete(pipelineCouplingIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-couplings/${pipelineCouplingIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing pipeline coupling. + * + * @param pipelineCouplingIdentity unique identifier of pipeline coupling. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(pipelineCouplingIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-couplings/${pipelineCouplingIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for an existing pipeline coupling. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async infoByApp(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/pipeline-couplings`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = PipelineCouplingService; diff --git a/lib/cjs/services/pipeline-deployment-service.d.ts b/lib/cjs/services/pipeline-deployment-service.d.ts new file mode 100644 index 0000000..05f283e --- /dev/null +++ b/lib/cjs/services/pipeline-deployment-service.d.ts @@ -0,0 +1,18 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Deployment](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-deployment) + * Information about latest deployments of apps in a pipeline. + */ +export default class PipelineDeploymentService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List latest slug releases for each app in a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + list(pipelineId: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/pipeline-deployment-service.js b/lib/cjs/services/pipeline-deployment-service.js new file mode 100644 index 0000000..0190fa7 --- /dev/null +++ b/lib/cjs/services/pipeline-deployment-service.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Pipeline Deployment](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-deployment) + * Information about latest deployments of apps in a pipeline. + */ +class PipelineDeploymentService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List latest slug releases for each app in a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async list(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/latest-deployments`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = PipelineDeploymentService; diff --git a/lib/cjs/services/pipeline-promotion-service.d.ts b/lib/cjs/services/pipeline-promotion-service.d.ts new file mode 100644 index 0000000..bb8a4db --- /dev/null +++ b/lib/cjs/services/pipeline-promotion-service.d.ts @@ -0,0 +1,24 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Promotion](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion) + * Promotions allow you to move code from an app in a pipeline to all targets + */ +export default class PipelinePromotionService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new promotion. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.PipelinePromotionCreatePayload, requestInit?: Omit): Promise; + /** + * Info for existing pipeline promotion. + * + * @param pipelinePromotionIdentity unique identifier of promotion. + * @param requestInit The initializer for the request. + */ + info(pipelinePromotionIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/pipeline-promotion-service.js b/lib/cjs/services/pipeline-promotion-service.js new file mode 100644 index 0000000..323cc84 --- /dev/null +++ b/lib/cjs/services/pipeline-promotion-service.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Pipeline Promotion](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion) + * Promotions allow you to move code from an app in a pipeline to all targets + */ +class PipelinePromotionService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new promotion. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-promotions`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing pipeline promotion. + * + * @param pipelinePromotionIdentity unique identifier of promotion. + * @param requestInit The initializer for the request. + */ + async info(pipelinePromotionIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-promotions/${pipelinePromotionIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = PipelinePromotionService; diff --git a/lib/cjs/services/pipeline-promotion-target-service.d.ts b/lib/cjs/services/pipeline-promotion-target-service.d.ts new file mode 100644 index 0000000..26f3ca5 --- /dev/null +++ b/lib/cjs/services/pipeline-promotion-target-service.d.ts @@ -0,0 +1,18 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Promotion Target](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion-target) + * Promotion targets represent an individual app being promoted to + */ +export default class PipelinePromotionTargetService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List promotion targets belonging to an existing promotion. + * + * @param pipelinePromotionId unique identifier of promotion + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + list(pipelinePromotionId: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/pipeline-promotion-target-service.js b/lib/cjs/services/pipeline-promotion-target-service.js new file mode 100644 index 0000000..b42f4c8 --- /dev/null +++ b/lib/cjs/services/pipeline-promotion-target-service.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Pipeline Promotion Target](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion-target) + * Promotion targets represent an individual app being promoted to + */ +class PipelinePromotionTargetService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List promotion targets belonging to an existing promotion. + * + * @param pipelinePromotionId unique identifier of promotion + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async list(pipelinePromotionId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-promotions/${pipelinePromotionId}/promotion-targets`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = PipelinePromotionTargetService; diff --git a/lib/cjs/services/pipeline-release-service.d.ts b/lib/cjs/services/pipeline-release-service.d.ts new file mode 100644 index 0000000..a253dec --- /dev/null +++ b/lib/cjs/services/pipeline-release-service.d.ts @@ -0,0 +1,18 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Release](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-release) + * Information about latest releases of apps in a pipeline. + */ +export default class PipelineReleaseService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List latest releases for each app in a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + list(pipelineId: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/pipeline-release-service.js b/lib/cjs/services/pipeline-release-service.js new file mode 100644 index 0000000..e2724f3 --- /dev/null +++ b/lib/cjs/services/pipeline-release-service.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Pipeline Release](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-release) + * Information about latest releases of apps in a pipeline. + */ +class PipelineReleaseService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List latest releases for each app in a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async list(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/latest-releases`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = PipelineReleaseService; diff --git a/lib/cjs/services/pipeline-service.d.ts b/lib/cjs/services/pipeline-service.d.ts new file mode 100644 index 0000000..05ae42d --- /dev/null +++ b/lib/cjs/services/pipeline-service.d.ts @@ -0,0 +1,47 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * A pipeline allows grouping of apps into different stages. + */ +export default class PipelineService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new pipeline. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.PipelineCreatePayload, requestInit?: Omit): Promise; + /** + * Info for existing pipeline. + * + * @param pipelineIdentity unique identifier of pipeline or name of pipeline. + * @param requestInit The initializer for the request. + */ + info(pipelineIdentity: string, requestInit?: Omit): Promise; + /** + * Delete an existing pipeline. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + delete(pipelineId: string, requestInit?: Omit): Promise; + /** + * Update an existing pipeline. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(pipelineId: string, payload: Heroku.PipelineUpdatePayload, requestInit?: Omit): Promise; + /** + * List existing pipelines. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/pipeline-service.js b/lib/cjs/services/pipeline-service.js new file mode 100644 index 0000000..e9d2bc2 --- /dev/null +++ b/lib/cjs/services/pipeline-service.js @@ -0,0 +1,122 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * A pipeline allows grouping of apps into different stages. + */ +class PipelineService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new pipeline. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing pipeline. + * + * @param pipelineIdentity unique identifier of pipeline or name of pipeline. + * @param requestInit The initializer for the request. + */ + async info(pipelineIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing pipeline. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async delete(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing pipeline. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(pipelineId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing pipelines. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = PipelineService; diff --git a/lib/cjs/services/pipeline-stack-service.d.ts b/lib/cjs/services/pipeline-stack-service.d.ts new file mode 100644 index 0000000..8165b53 --- /dev/null +++ b/lib/cjs/services/pipeline-stack-service.d.ts @@ -0,0 +1,18 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Stack](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-stack) + * A pipeline's stack is determined by the apps in the pipeline. This is used during creation of CI and Review Apps that have no stack defined in app.json + */ +export default class PipelineStackService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * The stack for a given pipeline, used for CI and Review Apps that have no stack defined in app.json. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + defaultStack(pipelineId: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/pipeline-stack-service.js b/lib/cjs/services/pipeline-stack-service.js new file mode 100644 index 0000000..25d866e --- /dev/null +++ b/lib/cjs/services/pipeline-stack-service.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Pipeline Stack](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-stack) + * A pipeline's stack is determined by the apps in the pipeline. This is used during creation of CI and Review Apps that have no stack defined in app.json + */ +class PipelineStackService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * The stack for a given pipeline, used for CI and Review Apps that have no stack defined in app.json. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async defaultStack(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/pipeline-stack`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = PipelineStackService; diff --git a/lib/cjs/services/pipeline-transfer-service.d.ts b/lib/cjs/services/pipeline-transfer-service.d.ts new file mode 100644 index 0000000..e2daf93 --- /dev/null +++ b/lib/cjs/services/pipeline-transfer-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Transfer](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-transfer) + * A pipeline transfer is the process of changing pipeline ownership along with the contained apps. + */ +export default class PipelineTransferService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new pipeline transfer. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.PipelineTransferCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/pipeline-transfer-service.js b/lib/cjs/services/pipeline-transfer-service.js new file mode 100644 index 0000000..47c1edc --- /dev/null +++ b/lib/cjs/services/pipeline-transfer-service.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Pipeline Transfer](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-transfer) + * A pipeline transfer is the process of changing pipeline ownership along with the contained apps. + */ +class PipelineTransferService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new pipeline transfer. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-transfers`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = PipelineTransferService; diff --git a/lib/cjs/services/plan-service.d.ts b/lib/cjs/services/plan-service.d.ts new file mode 100644 index 0000000..21b4a35 --- /dev/null +++ b/lib/cjs/services/plan-service.d.ts @@ -0,0 +1,32 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Plan](https://devcenter.heroku.com/articles/platform-api-reference#plan) + * Plans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication. + */ +export default class PlanService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing plan. + * + * @param planIdentity unique identifier of this plan or unique name of this plan. + * @param requestInit The initializer for the request. + */ + info(planIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing plan by Add-on. + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param planIdentity unique identifier of this plan or unique name of this plan. + * @param requestInit The initializer for the request. + */ + infoByAddOn(addOnServiceIdentity: string, planIdentity: string, requestInit?: Omit): Promise; + /** + * List existing plans by Add-on. + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + listByAddOn(addOnServiceIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/plan-service.js b/lib/cjs/services/plan-service.js new file mode 100644 index 0000000..3ff9b61 --- /dev/null +++ b/lib/cjs/services/plan-service.js @@ -0,0 +1,76 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Plan](https://devcenter.heroku.com/articles/platform-api-reference#plan) + * Plans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication. + */ +class PlanService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing plan. + * + * @param planIdentity unique identifier of this plan or unique name of this plan. + * @param requestInit The initializer for the request. + */ + async info(planIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/plans/${planIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing plan by Add-on. + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param planIdentity unique identifier of this plan or unique name of this plan. + * @param requestInit The initializer for the request. + */ + async infoByAddOn(addOnServiceIdentity, planIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-services/${addOnServiceIdentity}/plans/${planIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing plans by Add-on. + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + async listByAddOn(addOnServiceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-services/${addOnServiceIdentity}/plans`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = PlanService; diff --git a/lib/cjs/services/rate-limit-service.d.ts b/lib/cjs/services/rate-limit-service.d.ts new file mode 100644 index 0000000..696619a --- /dev/null +++ b/lib/cjs/services/rate-limit-service.d.ts @@ -0,0 +1,16 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Rate Limit](https://devcenter.heroku.com/articles/platform-api-reference#rate-limit) + * Rate Limit represents the number of request tokens each account holds. Requests to this endpoint do not count towards the rate limit. + */ +export default class RateLimitService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for rate limits. + * + * @param requestInit The initializer for the request. + */ + info(requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/rate-limit-service.js b/lib/cjs/services/rate-limit-service.js new file mode 100644 index 0000000..ba9ba3d --- /dev/null +++ b/lib/cjs/services/rate-limit-service.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Rate Limit](https://devcenter.heroku.com/articles/platform-api-reference#rate-limit) + * Rate Limit represents the number of request tokens each account holds. Requests to this endpoint do not count towards the rate limit. + */ +class RateLimitService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for rate limits. + * + * @param requestInit The initializer for the request. + */ + async info(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/rate-limits`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = RateLimitService; diff --git a/lib/cjs/services/region-service.d.ts b/lib/cjs/services/region-service.d.ts new file mode 100644 index 0000000..d837159 --- /dev/null +++ b/lib/cjs/services/region-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * A region represents a geographic location in which your application may run. + */ +export default class RegionService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing region. + * + * @param regionIdentity unique identifier of region or unique name of region. + * @param requestInit The initializer for the request. + */ + info(regionIdentity: string, requestInit?: Omit): Promise; + /** + * List existing regions. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/region-service.js b/lib/cjs/services/region-service.js new file mode 100644 index 0000000..204cace --- /dev/null +++ b/lib/cjs/services/region-service.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * A region represents a geographic location in which your application may run. + */ +class RegionService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing region. + * + * @param regionIdentity unique identifier of region or unique name of region. + * @param requestInit The initializer for the request. + */ + async info(regionIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/regions/${regionIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing regions. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/regions`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = RegionService; diff --git a/lib/cjs/services/release-service.d.ts b/lib/cjs/services/release-service.d.ts new file mode 100644 index 0000000..a864da3 --- /dev/null +++ b/lib/cjs/services/release-service.d.ts @@ -0,0 +1,41 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * A release represents a combination of code, config vars and add-ons for an app on Heroku. + */ +export default class ReleaseService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param releaseIdentity unique identifier of release or unique version assigned to the release. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, releaseIdentity: string | number, requestInit?: Omit): Promise; + /** + * List existing releases. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; + /** + * Create new release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.ReleaseCreatePayload, requestInit?: Omit): Promise; + /** + * Rollback to an existing release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + rollback(appIdentity: string, payload: Heroku.ReleaseRollbackPayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/release-service.js b/lib/cjs/services/release-service.js new file mode 100644 index 0000000..141c765 --- /dev/null +++ b/lib/cjs/services/release-service.js @@ -0,0 +1,102 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * A release represents a combination of code, config vars and add-ons for an app on Heroku. + */ +class ReleaseService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param releaseIdentity unique identifier of release or unique version assigned to the release. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, releaseIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/releases/${releaseIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing releases. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/releases`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create new release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/releases`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Rollback to an existing release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async rollback(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/releases`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = ReleaseService; diff --git a/lib/cjs/services/review-app-config-service.d.ts b/lib/cjs/services/review-app-config-service.d.ts new file mode 100644 index 0000000..0c3c4d2 --- /dev/null +++ b/lib/cjs/services/review-app-config-service.d.ts @@ -0,0 +1,44 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Review App Configuration](https://devcenter.heroku.com/articles/platform-api-reference#review-app-config) + * Review apps can be configured for pipelines. + */ +export default class ReviewAppConfigService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Enable review apps for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + enable(pipelineId: string, payload: Heroku.ReviewAppConfigEnablePayload, requestInit?: Omit): Promise; + /** + * Get review apps configuration for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + info(pipelineId: string, requestInit?: Omit): Promise; + /** + * Update review app configuration for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(pipelineId: string, payload: Heroku.ReviewAppConfigUpdatePayload, requestInit?: Omit): Promise; + /** + * Disable review apps for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + delete(pipelineId: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/review-app-config-service.js b/lib/cjs/services/review-app-config-service.js new file mode 100644 index 0000000..f851bf0 --- /dev/null +++ b/lib/cjs/services/review-app-config-service.js @@ -0,0 +1,106 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Review App Configuration](https://devcenter.heroku.com/articles/platform-api-reference#review-app-config) + * Review apps can be configured for pipelines. + */ +class ReviewAppConfigService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Enable review apps for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async enable(pipelineId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/review-app-config`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Get review apps configuration for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async info(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/review-app-config`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update review app configuration for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(pipelineId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/review-app-config`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Disable review apps for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async delete(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/review-app-config`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = ReviewAppConfigService; diff --git a/lib/cjs/services/review-app-service.d.ts b/lib/cjs/services/review-app-service.d.ts new file mode 100644 index 0000000..e6bbb98 --- /dev/null +++ b/lib/cjs/services/review-app-service.d.ts @@ -0,0 +1,46 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Review App](https://devcenter.heroku.com/articles/platform-api-reference#review-app) + * An ephemeral app to review a set of changes + */ +export default class ReviewAppService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new review app + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.ReviewAppCreatePayload, requestInit?: Omit): Promise; + /** + * Gets an existing review app + * + * @param reviewAppId unique identifier of the review app. + * @param requestInit The initializer for the request. + */ + getReviewApp(reviewAppId: string, requestInit?: Omit): Promise; + /** + * Delete an existing review app + * + * @param reviewAppId unique identifier of the review app. + * @param requestInit The initializer for the request. + */ + delete(reviewAppId: string, requestInit?: Omit): Promise; + /** + * Get a review app using the associated app_id + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + getReviewAppByAppId(appIdentity: string, requestInit?: Omit): Promise; + /** + * List review apps for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + list(pipelineId: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/review-app-service.js b/lib/cjs/services/review-app-service.js new file mode 100644 index 0000000..b60f58e --- /dev/null +++ b/lib/cjs/services/review-app-service.js @@ -0,0 +1,119 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Review App](https://devcenter.heroku.com/articles/platform-api-reference#review-app) + * An ephemeral app to review a set of changes + */ +class ReviewAppService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new review app + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/review-apps`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Gets an existing review app + * + * @param reviewAppId unique identifier of the review app. + * @param requestInit The initializer for the request. + */ + async getReviewApp(reviewAppId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/review-apps/${reviewAppId}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing review app + * + * @param reviewAppId unique identifier of the review app. + * @param requestInit The initializer for the request. + */ + async delete(reviewAppId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/review-apps/${reviewAppId}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Get a review app using the associated app_id + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async getReviewAppByAppId(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/review-app`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List review apps for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async list(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/review-apps`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = ReviewAppService; diff --git a/lib/cjs/services/slug-service.d.ts b/lib/cjs/services/slug-service.d.ts new file mode 100644 index 0000000..92006d7 --- /dev/null +++ b/lib/cjs/services/slug-service.d.ts @@ -0,0 +1,26 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Slug](https://devcenter.heroku.com/articles/platform-api-reference#slug) + * A slug is a snapshot of your application code that is ready to run on the platform. + */ +export default class SlugService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing slug. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param slugIdentity unique identifier of slug. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, slugIdentity: string, requestInit?: Omit): Promise; + /** + * Create a new slug. For more information please refer to [Deploying Slugs using the Platform API](https://devcenter.heroku.com/articles/platform-api-deploying-slugs). + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.SlugCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/slug-service.js b/lib/cjs/services/slug-service.js new file mode 100644 index 0000000..74401ca --- /dev/null +++ b/lib/cjs/services/slug-service.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Slug](https://devcenter.heroku.com/articles/platform-api-reference#slug) + * A slug is a snapshot of your application code that is ready to run on the platform. + */ +class SlugService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing slug. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param slugIdentity unique identifier of slug. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, slugIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/slugs/${slugIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a new slug. For more information please refer to [Deploying Slugs using the Platform API](https://devcenter.heroku.com/articles/platform-api-deploying-slugs). + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/slugs`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = SlugService; diff --git a/lib/cjs/services/sms-number-service.d.ts b/lib/cjs/services/sms-number-service.d.ts new file mode 100644 index 0000000..025b489 --- /dev/null +++ b/lib/cjs/services/sms-number-service.d.ts @@ -0,0 +1,31 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - SMS Number](https://devcenter.heroku.com/articles/platform-api-reference#sms-number) + * SMS numbers are used for recovery on accounts with two-factor authentication enabled. + */ +export default class SmsNumberService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Recover an account using an SMS recovery code + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + smsNumber(accountIdentity: string, requestInit?: Omit): Promise; + /** + * Recover an account using an SMS recovery code + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + recover(accountIdentity: string, requestInit?: Omit): Promise; + /** + * Confirm an SMS number change with a confirmation code + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + confirm(accountIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/sms-number-service.js b/lib/cjs/services/sms-number-service.js new file mode 100644 index 0000000..4b440e3 --- /dev/null +++ b/lib/cjs/services/sms-number-service.js @@ -0,0 +1,77 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - SMS Number](https://devcenter.heroku.com/articles/platform-api-reference#sms-number) + * SMS numbers are used for recovery on accounts with two-factor authentication enabled. + */ +class SmsNumberService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Recover an account using an SMS recovery code + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async smsNumber(accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}/sms-number`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Recover an account using an SMS recovery code + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async recover(accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}/sms-number/actions/recover`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Confirm an SMS number change with a confirmation code + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async confirm(accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}/sms-number/actions/confirm`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = SmsNumberService; diff --git a/lib/cjs/services/sni-endpoint-service.d.ts b/lib/cjs/services/sni-endpoint-service.d.ts new file mode 100644 index 0000000..090825a --- /dev/null +++ b/lib/cjs/services/sni-endpoint-service.d.ts @@ -0,0 +1,50 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - SNI Endpoint](https://devcenter.heroku.com/articles/platform-api-reference#sni-endpoint) + * SNI Endpoint is a public address serving a custom SSL cert for HTTPS traffic, using the SNI TLS extension, to a Heroku app. + */ +export default class SniEndpointService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.SniEndpointCreatePayload, requestInit?: Omit): Promise; + /** + * Delete existing SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param sniEndpointIdentity unique identifier of this SNI endpoint or unique name for SNI endpoint. + * @param requestInit The initializer for the request. + */ + delete(appIdentity: string, sniEndpointIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param sniEndpointIdentity unique identifier of this SNI endpoint or unique name for SNI endpoint. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, sniEndpointIdentity: string, requestInit?: Omit): Promise; + /** + * List existing SNI endpoints. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param sniEndpointIdentity unique identifier of this SNI endpoint or unique name for SNI endpoint. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, sniEndpointIdentity: string, payload: Heroku.SniEndpointUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/sni-endpoint-service.js b/lib/cjs/services/sni-endpoint-service.js new file mode 100644 index 0000000..121b39e --- /dev/null +++ b/lib/cjs/services/sni-endpoint-service.js @@ -0,0 +1,125 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - SNI Endpoint](https://devcenter.heroku.com/articles/platform-api-reference#sni-endpoint) + * SNI Endpoint is a public address serving a custom SSL cert for HTTPS traffic, using the SNI TLS extension, to a Heroku app. + */ +class SniEndpointService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sni-endpoints`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete existing SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param sniEndpointIdentity unique identifier of this SNI endpoint or unique name for SNI endpoint. + * @param requestInit The initializer for the request. + */ + async delete(appIdentity, sniEndpointIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sni-endpoints/${sniEndpointIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param sniEndpointIdentity unique identifier of this SNI endpoint or unique name for SNI endpoint. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, sniEndpointIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sni-endpoints/${sniEndpointIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing SNI endpoints. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sni-endpoints`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param sniEndpointIdentity unique identifier of this SNI endpoint or unique name for SNI endpoint. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, sniEndpointIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sni-endpoints/${sniEndpointIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = SniEndpointService; diff --git a/lib/cjs/services/source-service.d.ts b/lib/cjs/services/source-service.d.ts new file mode 100644 index 0000000..6c4185d --- /dev/null +++ b/lib/cjs/services/source-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Source](https://devcenter.heroku.com/articles/platform-api-reference#source) + * A source is a location for uploading and downloading an application's source code. + */ +export default class SourceService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create URLs for uploading and downloading source. + * + * @param requestInit The initializer for the request. + */ + create(requestInit?: Omit): Promise; + /** + * Create URLs for uploading and downloading source. Deprecated in favor of `POST /sources` + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + createDeprecated(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/source-service.js b/lib/cjs/services/source-service.js new file mode 100644 index 0000000..da69671 --- /dev/null +++ b/lib/cjs/services/source-service.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Source](https://devcenter.heroku.com/articles/platform-api-reference#source) + * A source is a location for uploading and downloading an application's source code. + */ +class SourceService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create URLs for uploading and downloading source. + * + * @param requestInit The initializer for the request. + */ + async create(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/sources`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create URLs for uploading and downloading source. Deprecated in favor of `POST /sources` + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async createDeprecated(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sources`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = SourceService; diff --git a/lib/cjs/services/space-app-access-service.d.ts b/lib/cjs/services/space-app-access-service.d.ts new file mode 100644 index 0000000..3ca19ec --- /dev/null +++ b/lib/cjs/services/space-app-access-service.d.ts @@ -0,0 +1,34 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Access](https://devcenter.heroku.com/articles/platform-api-reference#space-app-access) + * Space access represents the permissions a particular user has on a particular space. + */ +export default class SpaceAppAccessService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List permissions for a given user on a given space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, accountIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing user's set of permissions on a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(spaceIdentity: string, accountIdentity: string, payload: Heroku.SpaceAppAccessUpdatePayload, requestInit?: Omit): Promise; + /** + * List all users and their permissions on a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + list(spaceIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/space-app-access-service.js b/lib/cjs/services/space-app-access-service.js new file mode 100644 index 0000000..7e3efda --- /dev/null +++ b/lib/cjs/services/space-app-access-service.js @@ -0,0 +1,80 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Space Access](https://devcenter.heroku.com/articles/platform-api-reference#space-app-access) + * Space access represents the permissions a particular user has on a particular space. + */ +class SpaceAppAccessService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List permissions for a given user on a given space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/members/${accountIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing user's set of permissions on a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(spaceIdentity, accountIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/members/${accountIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List all users and their permissions on a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async list(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/members`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = SpaceAppAccessService; diff --git a/lib/cjs/services/space-nat-service.d.ts b/lib/cjs/services/space-nat-service.d.ts new file mode 100644 index 0000000..2ac596f --- /dev/null +++ b/lib/cjs/services/space-nat-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Network Address Translation](https://devcenter.heroku.com/articles/platform-api-reference#space-nat) + * Network address translation (NAT) for stable outbound IP addresses from a space + */ +export default class SpaceNatService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Current state of network address translation for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/space-nat-service.js b/lib/cjs/services/space-nat-service.js new file mode 100644 index 0000000..e3b70d9 --- /dev/null +++ b/lib/cjs/services/space-nat-service.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Space Network Address Translation](https://devcenter.heroku.com/articles/platform-api-reference#space-nat) + * Network address translation (NAT) for stable outbound IP addresses from a space + */ +class SpaceNatService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Current state of network address translation for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/nat`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = SpaceNatService; diff --git a/lib/cjs/services/space-service.d.ts b/lib/cjs/services/space-service.d.ts new file mode 100644 index 0000000..5ccd331 --- /dev/null +++ b/lib/cjs/services/space-service.d.ts @@ -0,0 +1,45 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space](https://devcenter.heroku.com/articles/platform-api-reference#space) + * A space is an isolated, highly available, secure app execution environment. + */ +export default class SpaceService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List existing spaces. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Info for existing space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(spaceIdentity: string, payload: Heroku.SpaceUpdatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + delete(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Create a new space. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.SpaceCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/space-service.js b/lib/cjs/services/space-service.js new file mode 100644 index 0000000..4c0927f --- /dev/null +++ b/lib/cjs/services/space-service.js @@ -0,0 +1,120 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Space](https://devcenter.heroku.com/articles/platform-api-reference#space) + * A space is an isolated, highly available, secure app execution environment. + */ +class SpaceService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List existing spaces. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(spaceIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async delete(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a new space. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = SpaceService; diff --git a/lib/cjs/services/space-topology-service.d.ts b/lib/cjs/services/space-topology-service.d.ts new file mode 100644 index 0000000..5614190 --- /dev/null +++ b/lib/cjs/services/space-topology-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Topology](https://devcenter.heroku.com/articles/platform-api-reference#space-topology) + * Space Topology provides you with a mechanism for viewing all the running dynos, formations and applications for a space. This is the same data thats used to power our DNS Service Discovery. + */ +export default class SpaceTopologyService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Current space topology + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + topology(spaceIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/space-topology-service.js b/lib/cjs/services/space-topology-service.js new file mode 100644 index 0000000..28674a8 --- /dev/null +++ b/lib/cjs/services/space-topology-service.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Space Topology](https://devcenter.heroku.com/articles/platform-api-reference#space-topology) + * Space Topology provides you with a mechanism for viewing all the running dynos, formations and applications for a space. This is the same data thats used to power our DNS Service Discovery. + */ +class SpaceTopologyService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Current space topology + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async topology(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/topology`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = SpaceTopologyService; diff --git a/lib/cjs/services/space-transfer-service.d.ts b/lib/cjs/services/space-transfer-service.d.ts new file mode 100644 index 0000000..60f0189 --- /dev/null +++ b/lib/cjs/services/space-transfer-service.d.ts @@ -0,0 +1,18 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Transfer](https://devcenter.heroku.com/articles/platform-api-reference#space-transfer) + * Transfer spaces between enterprise teams with the same Enterprise Account. + */ +export default class SpaceTransferService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Transfer space between enterprise teams + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + transfer(spaceIdentity: string, payload: Heroku.SpaceTransferTransferPayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/space-transfer-service.js b/lib/cjs/services/space-transfer-service.js new file mode 100644 index 0000000..c83721b --- /dev/null +++ b/lib/cjs/services/space-transfer-service.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Space Transfer](https://devcenter.heroku.com/articles/platform-api-reference#space-transfer) + * Transfer spaces between enterprise teams with the same Enterprise Account. + */ +class SpaceTransferService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Transfer space between enterprise teams + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async transfer(spaceIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/transfer`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = SpaceTransferService; diff --git a/lib/cjs/services/stack-service.d.ts b/lib/cjs/services/stack-service.d.ts new file mode 100644 index 0000000..471c0d8 --- /dev/null +++ b/lib/cjs/services/stack-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Stack](https://devcenter.heroku.com/articles/platform-api-reference#stack) + * Stacks are the different application execution environments available in the Heroku platform. + */ +export default class StackService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Stack info. + * + * @param stackIdentity unique name of stack or unique identifier of stack. + * @param requestInit The initializer for the request. + */ + info(stackIdentity: string, requestInit?: Omit): Promise; + /** + * List available stacks. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/stack-service.js b/lib/cjs/services/stack-service.js new file mode 100644 index 0000000..86196de --- /dev/null +++ b/lib/cjs/services/stack-service.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Stack](https://devcenter.heroku.com/articles/platform-api-reference#stack) + * Stacks are the different application execution environments available in the Heroku platform. + */ +class StackService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Stack info. + * + * @param stackIdentity unique name of stack or unique identifier of stack. + * @param requestInit The initializer for the request. + */ + async info(stackIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/stacks/${stackIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List available stacks. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/stacks`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = StackService; diff --git a/lib/cjs/services/team-add-on-service.d.ts b/lib/cjs/services/team-add-on-service.d.ts new file mode 100644 index 0000000..97465d4 --- /dev/null +++ b/lib/cjs/services/team-add-on-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Add-on](https://devcenter.heroku.com/articles/platform-api-reference#team-add-on) + * + */ +export default class TeamAddOnService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List add-ons used across all Team apps + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + listForTeam(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-add-on-service.js b/lib/cjs/services/team-add-on-service.js new file mode 100644 index 0000000..7e4b9ad --- /dev/null +++ b/lib/cjs/services/team-add-on-service.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team Add-on](https://devcenter.heroku.com/articles/platform-api-reference#team-add-on) + * + */ +class TeamAddOnService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List add-ons used across all Team apps + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async listForTeam(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/addons`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TeamAddOnService; diff --git a/lib/cjs/services/team-app-collaborator-service.d.ts b/lib/cjs/services/team-app-collaborator-service.d.ts new file mode 100644 index 0000000..1b72c6a --- /dev/null +++ b/lib/cjs/services/team-app-collaborator-service.d.ts @@ -0,0 +1,54 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team App Collaborator](https://devcenter.heroku.com/articles/platform-api-reference#team-app-collaborator) + * A team collaborator represents an account that has been given access to a team app on Heroku. + */ +export default class TeamAppCollaboratorService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new collaborator on a team app. Use this endpoint instead of the `/apps/{app_id_or_name}/collaborator` endpoint when you want the collaborator to be granted [permissions] (https://devcenter.heroku.com/articles/org-users-access#roles-and-permissions) according to their role in the team. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.TeamAppCollaboratorCreatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing collaborator from a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param teamAppCollaboratorIdentity invited email address of collaborator. + * @param requestInit The initializer for the request. + */ + delete(teamAppIdentity: string, teamAppCollaboratorIdentity: string, requestInit?: Omit): Promise; + /** + * Info for a collaborator on a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param teamAppCollaboratorIdentity invited email address of collaborator. + * @param requestInit The initializer for the request. + */ + info(teamAppIdentity: string, teamAppCollaboratorIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing collaborator from a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param teamAppCollaboratorIdentity invited email address of collaborator. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(teamAppIdentity: string, teamAppCollaboratorIdentity: string, payload: Heroku.TeamAppCollaboratorUpdatePayload, requestInit?: Omit): Promise; + /** + * List collaborators on a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param requestInit The initializer for the request. + */ + list(teamAppIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-app-collaborator-service.js b/lib/cjs/services/team-app-collaborator-service.js new file mode 100644 index 0000000..9960274 --- /dev/null +++ b/lib/cjs/services/team-app-collaborator-service.js @@ -0,0 +1,129 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team App Collaborator](https://devcenter.heroku.com/articles/platform-api-reference#team-app-collaborator) + * A team collaborator represents an account that has been given access to a team app on Heroku. + */ +class TeamAppCollaboratorService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new collaborator on a team app. Use this endpoint instead of the `/apps/{app_id_or_name}/collaborator` endpoint when you want the collaborator to be granted [permissions] (https://devcenter.heroku.com/articles/org-users-access#roles-and-permissions) according to their role in the team. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${appIdentity}/collaborators`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing collaborator from a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param teamAppCollaboratorIdentity invited email address of collaborator. + * @param requestInit The initializer for the request. + */ + async delete(teamAppIdentity, teamAppCollaboratorIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}/collaborators/${teamAppCollaboratorIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for a collaborator on a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param teamAppCollaboratorIdentity invited email address of collaborator. + * @param requestInit The initializer for the request. + */ + async info(teamAppIdentity, teamAppCollaboratorIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}/collaborators/${teamAppCollaboratorIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing collaborator from a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param teamAppCollaboratorIdentity invited email address of collaborator. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(teamAppIdentity, teamAppCollaboratorIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}/collaborators/${teamAppCollaboratorIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List collaborators on a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param requestInit The initializer for the request. + */ + async list(teamAppIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}/collaborators`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TeamAppCollaboratorService; diff --git a/lib/cjs/services/team-app-permission-service.d.ts b/lib/cjs/services/team-app-permission-service.d.ts new file mode 100644 index 0000000..32b0dd4 --- /dev/null +++ b/lib/cjs/services/team-app-permission-service.d.ts @@ -0,0 +1,16 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team App Permission](https://devcenter.heroku.com/articles/platform-api-reference#team-app-permission) + * A team app permission is a behavior that is assigned to a user in a team app. + */ +export default class TeamAppPermissionService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Lists permissions available to teams. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-app-permission-service.js b/lib/cjs/services/team-app-permission-service.js new file mode 100644 index 0000000..4ffe8ca --- /dev/null +++ b/lib/cjs/services/team-app-permission-service.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team App Permission](https://devcenter.heroku.com/articles/platform-api-reference#team-app-permission) + * A team app permission is a behavior that is assigned to a user in a team app. + */ +class TeamAppPermissionService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Lists permissions available to teams. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/permissions`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TeamAppPermissionService; diff --git a/lib/cjs/services/team-app-service.d.ts b/lib/cjs/services/team-app-service.d.ts new file mode 100644 index 0000000..cd48797 --- /dev/null +++ b/lib/cjs/services/team-app-service.d.ts @@ -0,0 +1,59 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team App](https://devcenter.heroku.com/articles/platform-api-reference#team-app) + * A team app encapsulates the team specific functionality of Heroku apps. + */ +export default class TeamAppService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new app in the specified team, in the default team if unspecified, or in personal account, if default team is not set. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.TeamAppCreatePayload, requestInit?: Omit): Promise; + /** + * Info for a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param requestInit The initializer for the request. + */ + info(teamAppIdentity: string, requestInit?: Omit): Promise; + /** + * Lock or unlock a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + updateLocked(teamAppIdentity: string, payload: Heroku.TeamAppUpdateLockedPayload, requestInit?: Omit): Promise; + /** + * Transfer an existing team app to another Heroku account. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + transferToAccount(teamAppIdentity: string, payload: Heroku.TeamAppTransferToAccountPayload, requestInit?: Omit): Promise; + /** + * Transfer an existing team app to another team. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + transferToTeam(teamAppIdentity: string, payload: Heroku.TeamAppTransferToTeamPayload, requestInit?: Omit): Promise; + /** + * List team apps. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + listByTeam(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-app-service.js b/lib/cjs/services/team-app-service.js new file mode 100644 index 0000000..a2fa1bd --- /dev/null +++ b/lib/cjs/services/team-app-service.js @@ -0,0 +1,146 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team App](https://devcenter.heroku.com/articles/platform-api-reference#team-app) + * A team app encapsulates the team specific functionality of Heroku apps. + */ +class TeamAppService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new app in the specified team, in the default team if unspecified, or in personal account, if default team is not set. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param requestInit The initializer for the request. + */ + async info(teamAppIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Lock or unlock a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async updateLocked(teamAppIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Transfer an existing team app to another Heroku account. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async transferToAccount(teamAppIdentity, payload, requestInit = {}) { + await this.fetchImpl(`/teams/apps/${teamAppIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + } + /** + * Transfer an existing team app to another team. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async transferToTeam(teamAppIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List team apps. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async listByTeam(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/apps`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TeamAppService; diff --git a/lib/cjs/services/team-daily-usage-service.d.ts b/lib/cjs/services/team-daily-usage-service.d.ts new file mode 100644 index 0000000..71dc462 --- /dev/null +++ b/lib/cjs/services/team-daily-usage-service.d.ts @@ -0,0 +1,19 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Daily Usage](https://devcenter.heroku.com/articles/platform-api-reference#team-daily-usage) + * Usage for an enterprise team at a daily resolution. + */ +export default class TeamDailyUsageService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieves usage for an enterprise team for a range of days. Start and end dates can be specified as query parameters using the date format YYYY-MM-DD. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list). + * + * @param teamId unique identifier of team + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + info(teamId: string, payload: Heroku.TeamDailyUsageInfoPayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-daily-usage-service.js b/lib/cjs/services/team-daily-usage-service.js new file mode 100644 index 0000000..cb76607 --- /dev/null +++ b/lib/cjs/services/team-daily-usage-service.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team Daily Usage](https://devcenter.heroku.com/articles/platform-api-reference#team-daily-usage) + * Usage for an enterprise team at a daily resolution. + */ +class TeamDailyUsageService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieves usage for an enterprise team for a range of days. Start and end dates can be specified as query parameters using the date format YYYY-MM-DD. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list). + * + * @param teamId unique identifier of team + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async info(teamId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamId}/usage/daily`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TeamDailyUsageService; diff --git a/lib/cjs/services/team-delinquency-service.d.ts b/lib/cjs/services/team-delinquency-service.d.ts new file mode 100644 index 0000000..ae81ba8 --- /dev/null +++ b/lib/cjs/services/team-delinquency-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Delinquency](https://devcenter.heroku.com/articles/platform-api-reference#team-delinquency) + * A Heroku team becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent teams if their invoices remain unpaid. + */ +export default class TeamDelinquencyService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Team delinquency information. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + info(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-delinquency-service.js b/lib/cjs/services/team-delinquency-service.js new file mode 100644 index 0000000..aebfc22 --- /dev/null +++ b/lib/cjs/services/team-delinquency-service.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team Delinquency](https://devcenter.heroku.com/articles/platform-api-reference#team-delinquency) + * A Heroku team becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent teams if their invoices remain unpaid. + */ +class TeamDelinquencyService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Team delinquency information. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async info(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/delinquency`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TeamDelinquencyService; diff --git a/lib/cjs/services/team-feature-service.d.ts b/lib/cjs/services/team-feature-service.d.ts new file mode 100644 index 0000000..731db5c --- /dev/null +++ b/lib/cjs/services/team-feature-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Feature](https://devcenter.heroku.com/articles/platform-api-reference#team-feature) + * A team feature represents a feature enabled on a team account. + */ +export default class TeamFeatureService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for an existing team feature. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamFeatureIdentity unique identifier of team feature or unique name of team feature. + * @param requestInit The initializer for the request. + */ + info(teamIdentity: string, teamFeatureIdentity: string, requestInit?: Omit): Promise; + /** + * List existing team features. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-feature-service.js b/lib/cjs/services/team-feature-service.js new file mode 100644 index 0000000..91614f3 --- /dev/null +++ b/lib/cjs/services/team-feature-service.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team Feature](https://devcenter.heroku.com/articles/platform-api-reference#team-feature) + * A team feature represents a feature enabled on a team account. + */ +class TeamFeatureService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for an existing team feature. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamFeatureIdentity unique identifier of team feature or unique name of team feature. + * @param requestInit The initializer for the request. + */ + async info(teamIdentity, teamFeatureIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/features/${teamFeatureIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing team features. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/features`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TeamFeatureService; diff --git a/lib/cjs/services/team-invitation-service.d.ts b/lib/cjs/services/team-invitation-service.d.ts new file mode 100644 index 0000000..202932f --- /dev/null +++ b/lib/cjs/services/team-invitation-service.d.ts @@ -0,0 +1,50 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Invitation](https://devcenter.heroku.com/articles/platform-api-reference#team-invitation) + * A team invitation represents an invite to a team. + */ +export default class TeamInvitationService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Get a list of a team's Identity Providers + * + * @param teamName unique name of team + * @example "example". + * @param requestInit The initializer for the request. + */ + list(teamName: string, requestInit?: Omit): Promise; + /** + * Create Team Invitation + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(teamIdentity: string, payload: Heroku.TeamInvitationCreatePayload, requestInit?: Omit): Promise; + /** + * Revoke a team invitation. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamInvitationIdentity unique identifier of an invitation. + * @param requestInit The initializer for the request. + */ + revoke(teamIdentity: string, teamInvitationIdentity: string, requestInit?: Omit): Promise; + /** + * Get an invitation by its token + * + * @param teamInvitationToken special token for invitation + * @example "614ae25aa2d4802096cd7c18625b526c". + * @param requestInit The initializer for the request. + */ + get(teamInvitationToken: string, requestInit?: Omit): Promise; + /** + * Accept Team Invitation + * + * @param teamInvitationToken special token for invitation + * @example "614ae25aa2d4802096cd7c18625b526c". + * @param requestInit The initializer for the request. + */ + accept(teamInvitationToken: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-invitation-service.js b/lib/cjs/services/team-invitation-service.js new file mode 100644 index 0000000..95561a7 --- /dev/null +++ b/lib/cjs/services/team-invitation-service.js @@ -0,0 +1,124 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team Invitation](https://devcenter.heroku.com/articles/platform-api-reference#team-invitation) + * A team invitation represents an invite to a team. + */ +class TeamInvitationService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Get a list of a team's Identity Providers + * + * @param teamName unique name of team + * @example "example". + * @param requestInit The initializer for the request. + */ + async list(teamName, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/invitations`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create Team Invitation + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(teamIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/invitations`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Revoke a team invitation. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamInvitationIdentity unique identifier of an invitation. + * @param requestInit The initializer for the request. + */ + async revoke(teamIdentity, teamInvitationIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/invitations/${teamInvitationIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Get an invitation by its token + * + * @param teamInvitationToken special token for invitation + * @example "614ae25aa2d4802096cd7c18625b526c". + * @param requestInit The initializer for the request. + */ + async get(teamInvitationToken, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/invitations/${teamInvitationToken}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Accept Team Invitation + * + * @param teamInvitationToken special token for invitation + * @example "614ae25aa2d4802096cd7c18625b526c". + * @param requestInit The initializer for the request. + */ + async accept(teamInvitationToken, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/invitations/${teamInvitationToken}/accept`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TeamInvitationService; diff --git a/lib/cjs/services/team-invoice-service.d.ts b/lib/cjs/services/team-invoice-service.d.ts new file mode 100644 index 0000000..e06b37c --- /dev/null +++ b/lib/cjs/services/team-invoice-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Invoice](https://devcenter.heroku.com/articles/platform-api-reference#team-invoice) + * A Team Invoice is an itemized bill of goods for a team which includes pricing and charges. + */ +export default class TeamInvoiceService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing invoice. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamInvoiceIdentity human readable invoice number. + * @param requestInit The initializer for the request. + */ + info(teamIdentity: string, teamInvoiceIdentity: number, requestInit?: Omit): Promise; + /** + * List existing invoices. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-invoice-service.js b/lib/cjs/services/team-invoice-service.js new file mode 100644 index 0000000..e2ed861 --- /dev/null +++ b/lib/cjs/services/team-invoice-service.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team Invoice](https://devcenter.heroku.com/articles/platform-api-reference#team-invoice) + * A Team Invoice is an itemized bill of goods for a team which includes pricing and charges. + */ +class TeamInvoiceService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing invoice. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamInvoiceIdentity human readable invoice number. + * @param requestInit The initializer for the request. + */ + async info(teamIdentity, teamInvoiceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/invoices/${teamInvoiceIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing invoices. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/invoices`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TeamInvoiceService; diff --git a/lib/cjs/services/team-member-service.d.ts b/lib/cjs/services/team-member-service.d.ts new file mode 100644 index 0000000..7a71562 --- /dev/null +++ b/lib/cjs/services/team-member-service.d.ts @@ -0,0 +1,57 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Member](https://devcenter.heroku.com/articles/platform-api-reference#team-member) + * A team member is an individual with access to a team. + */ +export default class TeamMemberService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new team member, or update their role. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + createOrUpdate(teamIdentity: string, payload: Heroku.TeamMemberCreateOrUpdatePayload, requestInit?: Omit): Promise; + /** + * Create a new team member. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(teamIdentity: string, payload: Heroku.TeamMemberCreatePayload, requestInit?: Omit): Promise; + /** + * Update a team member. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(teamIdentity: string, payload: Heroku.TeamMemberUpdatePayload, requestInit?: Omit): Promise; + /** + * Remove a member from the team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamMemberIdentity email address of the team member or unique identifier of the team member. + * @param requestInit The initializer for the request. + */ + delete(teamIdentity: string, teamMemberIdentity: string, requestInit?: Omit): Promise; + /** + * List members of the team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamIdentity: string, requestInit?: Omit): Promise; + /** + * List the apps of a team member. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamMemberIdentity email address of the team member or unique identifier of the team member. + * @param requestInit The initializer for the request. + */ + listByMember(teamIdentity: string, teamMemberIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-member-service.js b/lib/cjs/services/team-member-service.js new file mode 100644 index 0000000..cb53445 --- /dev/null +++ b/lib/cjs/services/team-member-service.js @@ -0,0 +1,147 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team Member](https://devcenter.heroku.com/articles/platform-api-reference#team-member) + * A team member is an individual with access to a team. + */ +class TeamMemberService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new team member, or update their role. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async createOrUpdate(teamIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a new team member. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(teamIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update a team member. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(teamIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Remove a member from the team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamMemberIdentity email address of the team member or unique identifier of the team member. + * @param requestInit The initializer for the request. + */ + async delete(teamIdentity, teamMemberIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members/${teamMemberIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List members of the team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List the apps of a team member. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamMemberIdentity email address of the team member or unique identifier of the team member. + * @param requestInit The initializer for the request. + */ + async listByMember(teamIdentity, teamMemberIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members/${teamMemberIdentity}/apps`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TeamMemberService; diff --git a/lib/cjs/services/team-monthly-usage-service.d.ts b/lib/cjs/services/team-monthly-usage-service.d.ts new file mode 100644 index 0000000..d045d61 --- /dev/null +++ b/lib/cjs/services/team-monthly-usage-service.d.ts @@ -0,0 +1,19 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Monthly Usage](https://devcenter.heroku.com/articles/platform-api-reference#team-monthly-usage) + * Usage for an enterprise team at a monthly resolution. + */ +export default class TeamMonthlyUsageService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieves usage for an enterprise team for a range of months. Start and end dates can be specified as query parameters using the date, YYYY-MM. If no end date is specified, one month of usage is returned. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list). + * + * @param teamId unique identifier of team + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + info(teamId: string, payload: Heroku.TeamMonthlyUsageInfoPayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-monthly-usage-service.js b/lib/cjs/services/team-monthly-usage-service.js new file mode 100644 index 0000000..82a214c --- /dev/null +++ b/lib/cjs/services/team-monthly-usage-service.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team Monthly Usage](https://devcenter.heroku.com/articles/platform-api-reference#team-monthly-usage) + * Usage for an enterprise team at a monthly resolution. + */ +class TeamMonthlyUsageService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieves usage for an enterprise team for a range of months. Start and end dates can be specified as query parameters using the date, YYYY-MM. If no end date is specified, one month of usage is returned. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list). + * + * @param teamId unique identifier of team + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async info(teamId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamId}/usage/monthly`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TeamMonthlyUsageService; diff --git a/lib/cjs/services/team-preferences-service.d.ts b/lib/cjs/services/team-preferences-service.d.ts new file mode 100644 index 0000000..daabf34 --- /dev/null +++ b/lib/cjs/services/team-preferences-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Preferences](https://devcenter.heroku.com/articles/platform-api-reference#team-preferences) + * Tracks a Team's Preferences + */ +export default class TeamPreferencesService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieve Team Preferences + * + * @param teamPreferencesIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamPreferencesIdentity: string, requestInit?: Omit): Promise; + /** + * Update Team Preferences + * + * @param teamPreferencesIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(teamPreferencesIdentity: string, payload: Heroku.TeamPreferencesUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-preferences-service.js b/lib/cjs/services/team-preferences-service.js new file mode 100644 index 0000000..3b645aa --- /dev/null +++ b/lib/cjs/services/team-preferences-service.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team Preferences](https://devcenter.heroku.com/articles/platform-api-reference#team-preferences) + * Tracks a Team's Preferences + */ +class TeamPreferencesService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieve Team Preferences + * + * @param teamPreferencesIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamPreferencesIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamPreferencesIdentity}/preferences`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update Team Preferences + * + * @param teamPreferencesIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(teamPreferencesIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamPreferencesIdentity}/preferences`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TeamPreferencesService; diff --git a/lib/cjs/services/team-service.d.ts b/lib/cjs/services/team-service.d.ts new file mode 100644 index 0000000..de52b88 --- /dev/null +++ b/lib/cjs/services/team-service.d.ts @@ -0,0 +1,60 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * Teams allow you to manage access to a shared group of applications and other resources. + */ +export default class TeamService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List teams in which you are a member. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Info for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + info(teamIdentity: string, requestInit?: Omit): Promise; + /** + * Update team properties. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(teamIdentity: string, payload: Heroku.TeamUpdatePayload, requestInit?: Omit): Promise; + /** + * Create a new team. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.TeamCreatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + delete(teamIdentity: string, requestInit?: Omit): Promise; + /** + * List teams for an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + listByEnterpriseAccount(enterpriseAccountIdentity: string, requestInit?: Omit): Promise; + /** + * Create a team in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + createInEnterpriseAccount(enterpriseAccountIdentity: string, payload: Heroku.TeamCreateInEnterpriseAccountPayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-service.js b/lib/cjs/services/team-service.js new file mode 100644 index 0000000..59013e4 --- /dev/null +++ b/lib/cjs/services/team-service.js @@ -0,0 +1,163 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * Teams allow you to manage access to a shared group of applications and other resources. + */ +class TeamService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List teams in which you are a member. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async info(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update team properties. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(teamIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a new team. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async delete(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List teams for an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + async listByEnterpriseAccount(enterpriseAccountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/teams`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a team in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async createInEnterpriseAccount(enterpriseAccountIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/teams`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TeamService; diff --git a/lib/cjs/services/team-space-service.d.ts b/lib/cjs/services/team-space-service.d.ts new file mode 100644 index 0000000..b2e416a --- /dev/null +++ b/lib/cjs/services/team-space-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Space](https://devcenter.heroku.com/articles/platform-api-reference#team-space) + * A space is an isolated, highly available, secure app execution environment. + */ +export default class TeamSpaceService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List spaces owned by the team + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-space-service.js b/lib/cjs/services/team-space-service.js new file mode 100644 index 0000000..3ee4391 --- /dev/null +++ b/lib/cjs/services/team-space-service.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team Space](https://devcenter.heroku.com/articles/platform-api-reference#team-space) + * A space is an isolated, highly available, secure app execution environment. + */ +class TeamSpaceService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List spaces owned by the team + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/spaces`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TeamSpaceService; diff --git a/lib/cjs/services/test-case-service.d.ts b/lib/cjs/services/test-case-service.d.ts new file mode 100644 index 0000000..0d8d280 --- /dev/null +++ b/lib/cjs/services/test-case-service.d.ts @@ -0,0 +1,16 @@ +/** + * [Test Case](https://devcenter.heroku.com/articles/platform-api-reference#test-case) + * A single test case belonging to a test run + */ +export default class TestCaseService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List test cases + * + * @param testRunId unique identifier of a test run. + * @param requestInit The initializer for the request. + */ + list(testRunId: string, requestInit?: Omit): Promise>; +} diff --git a/lib/cjs/services/test-case-service.js b/lib/cjs/services/test-case-service.js new file mode 100644 index 0000000..b764fd9 --- /dev/null +++ b/lib/cjs/services/test-case-service.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Test Case](https://devcenter.heroku.com/articles/platform-api-reference#test-case) + * A single test case belonging to a test run + */ +class TestCaseService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List test cases + * + * @param testRunId unique identifier of a test run. + * @param requestInit The initializer for the request. + */ + async list(testRunId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/test-runs/${testRunId}/test-cases`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TestCaseService; diff --git a/lib/cjs/services/test-node-service.d.ts b/lib/cjs/services/test-node-service.d.ts new file mode 100644 index 0000000..dc1ebca --- /dev/null +++ b/lib/cjs/services/test-node-service.d.ts @@ -0,0 +1,16 @@ +/** + * [Test Node](https://devcenter.heroku.com/articles/platform-api-reference#test-node) + * A single test node belonging to a test run + */ +export default class TestNodeService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List test nodes + * + * @param testRunIdentity unique identifier of a test run. + * @param requestInit The initializer for the request. + */ + list(testRunIdentity: string, requestInit?: Omit): Promise>; +} diff --git a/lib/cjs/services/test-node-service.js b/lib/cjs/services/test-node-service.js new file mode 100644 index 0000000..e608447 --- /dev/null +++ b/lib/cjs/services/test-node-service.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Test Node](https://devcenter.heroku.com/articles/platform-api-reference#test-node) + * A single test node belonging to a test run + */ +class TestNodeService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List test nodes + * + * @param testRunIdentity unique identifier of a test run. + * @param requestInit The initializer for the request. + */ + async list(testRunIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/test-runs/${testRunIdentity}/test-nodes`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = TestNodeService; diff --git a/lib/cjs/services/test-run-service.d.ts b/lib/cjs/services/test-run-service.d.ts new file mode 100644 index 0000000..c474bc0 --- /dev/null +++ b/lib/cjs/services/test-run-service.d.ts @@ -0,0 +1,49 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Test Run](https://devcenter.heroku.com/articles/platform-api-reference#test-run) + * An execution or trial of one or more tests + */ +export default class TestRunService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new test-run. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.TestRunCreatePayload, requestInit?: Omit): Promise; + /** + * Info for existing test-run. + * + * @param testRunId unique identifier of a test run. + * @param requestInit The initializer for the request. + */ + info(testRunId: string, requestInit?: Omit): Promise; + /** + * List existing test-runs for a pipeline. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + list(pipelineId: string, requestInit?: Omit): Promise>; + /** + * Info for existing test-run by Pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param testRunNumber the auto incrementing test run number. + * @param requestInit The initializer for the request. + */ + infoByPipeline(pipelineId: string, testRunNumber: number, requestInit?: Omit): Promise; + /** + * Update a test-run's status. + * + * @param testRunNumber the auto incrementing test run number. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(testRunNumber: number, payload: Heroku.TestRunUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/test-run-service.js b/lib/cjs/services/test-run-service.js new file mode 100644 index 0000000..1ee1513 --- /dev/null +++ b/lib/cjs/services/test-run-service.js @@ -0,0 +1,107 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Test Run](https://devcenter.heroku.com/articles/platform-api-reference#test-run) + * An execution or trial of one or more tests + */ +class TestRunService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new test-run. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + await this.fetchImpl(`/test-runs`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + } + /** + * Info for existing test-run. + * + * @param testRunId unique identifier of a test run. + * @param requestInit The initializer for the request. + */ + async info(testRunId, requestInit = {}) { + await this.fetchImpl(`/test-runs/${testRunId}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } + /** + * List existing test-runs for a pipeline. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async list(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/test-runs`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing test-run by Pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param testRunNumber the auto incrementing test run number. + * @param requestInit The initializer for the request. + */ + async infoByPipeline(pipelineId, testRunNumber, requestInit = {}) { + await this.fetchImpl(`/pipelines/${pipelineId}/test-runs/${testRunNumber}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } + /** + * Update a test-run's status. + * + * @param testRunNumber the auto incrementing test run number. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(testRunNumber, payload, requestInit = {}) { + await this.fetchImpl(`/test-runs/${testRunNumber}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + } +} +exports.default = TestRunService; diff --git a/lib/cjs/services/user-preferences-service.d.ts b/lib/cjs/services/user-preferences-service.d.ts new file mode 100644 index 0000000..d316b53 --- /dev/null +++ b/lib/cjs/services/user-preferences-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - User Preferences](https://devcenter.heroku.com/articles/platform-api-reference#user-preferences) + * Tracks a user's preferences and message dismissals + */ +export default class UserPreferencesService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieve User Preferences + * + * @param userPreferencesIdentity Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + list(userPreferencesIdentity: string, requestInit?: Omit): Promise; + /** + * Update User Preferences + * + * @param userPreferencesIdentity Implicit reference to currently authorized user. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(userPreferencesIdentity: string, payload: Heroku.UserPreferencesUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/user-preferences-service.js b/lib/cjs/services/user-preferences-service.js new file mode 100644 index 0000000..db8e07a --- /dev/null +++ b/lib/cjs/services/user-preferences-service.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - User Preferences](https://devcenter.heroku.com/articles/platform-api-reference#user-preferences) + * Tracks a user's preferences and message dismissals + */ +class UserPreferencesService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieve User Preferences + * + * @param userPreferencesIdentity Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async list(userPreferencesIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${userPreferencesIdentity}/preferences`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update User Preferences + * + * @param userPreferencesIdentity Implicit reference to currently authorized user. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(userPreferencesIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${userPreferencesIdentity}/preferences`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = UserPreferencesService; diff --git a/lib/cjs/services/vpn-connection-service.d.ts b/lib/cjs/services/vpn-connection-service.d.ts new file mode 100644 index 0000000..f727db1 --- /dev/null +++ b/lib/cjs/services/vpn-connection-service.d.ts @@ -0,0 +1,50 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Private Spaces VPN](https://devcenter.heroku.com/articles/platform-api-reference#vpn-connection) + * [VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN. + */ +export default class VpnConnectionService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new VPN connection in a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(spaceIdentity: string, payload: Heroku.VpnConnectionCreatePayload, requestInit?: Omit): Promise; + /** + * Destroy existing VPN Connection + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param vpnConnectionIdentity VPN ID or VPN Name. + * @param requestInit The initializer for the request. + */ + destroy(spaceIdentity: string, vpnConnectionIdentity: string, requestInit?: Omit): Promise; + /** + * List VPN connections for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + list(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Info for an existing vpn-connection. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param vpnConnectionIdentity VPN ID or VPN Name. + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, vpnConnectionIdentity: string, requestInit?: Omit): Promise; + /** + * Update a VPN connection in a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param vpnConnectionIdentity VPN ID or VPN Name. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(spaceIdentity: string, vpnConnectionIdentity: string, payload: Heroku.VpnConnectionUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/vpn-connection-service.js b/lib/cjs/services/vpn-connection-service.js new file mode 100644 index 0000000..ac51902 --- /dev/null +++ b/lib/cjs/services/vpn-connection-service.js @@ -0,0 +1,125 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Private Spaces VPN](https://devcenter.heroku.com/articles/platform-api-reference#vpn-connection) + * [VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN. + */ +class VpnConnectionService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new VPN connection in a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(spaceIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/vpn-connections`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Destroy existing VPN Connection + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param vpnConnectionIdentity VPN ID or VPN Name. + * @param requestInit The initializer for the request. + */ + async destroy(spaceIdentity, vpnConnectionIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/vpn-connections/${vpnConnectionIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List VPN connections for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async list(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/vpn-connections`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for an existing vpn-connection. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param vpnConnectionIdentity VPN ID or VPN Name. + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, vpnConnectionIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/vpn-connections/${vpnConnectionIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update a VPN connection in a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param vpnConnectionIdentity VPN ID or VPN Name. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(spaceIdentity, vpnConnectionIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/vpn-connections/${vpnConnectionIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} +exports.default = VpnConnectionService; diff --git a/lib/esm/index.d.ts b/lib/esm/index.d.ts new file mode 100644 index 0000000..79ff118 --- /dev/null +++ b/lib/esm/index.d.ts @@ -0,0 +1,7982 @@ +/** + * + * [Heroku Platform API - account-delinquency](https://devcenter.heroku.com/articles/platform-api-reference#account-delinquency) + * A Heroku account becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent accounts if their invoices remain unpaid. + */ +export interface AccountDelinquency { + /** + * scheduled time of when we will suspend your account due to delinquency + * + * @example "2024-01-01T12:00:00Z" + */ + readonly scheduled_suspension_time: string | null; + /** + * scheduled time of when we will delete your account due to delinquency + * + * @example "2024-01-01T12:00:00Z" + */ + readonly scheduled_deletion_time: string | null; +} +/** + * + * [Heroku Platform API - account-feature](https://devcenter.heroku.com/articles/platform-api-reference#account-feature) + * An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku. + */ +export interface AccountFeature { + /** + * when account feature was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of account feature + * + * @example "Causes account to example." + */ + readonly description: string; + /** + * documentation URL of account feature + * + * @example "http://devcenter.heroku.com/articles/example" + */ + readonly doc_url: string; + /** + * whether or not account feature has been enabled + * + * @example true + */ + enabled: boolean; + /** + * unique identifier of account feature + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of account feature + * + * @example "name" + */ + readonly name: string; + /** + * state of account feature + * + * @example "public" + */ + readonly state: string; + /** + * when account feature was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user readable feature name + * + * @example "My Feature" + */ + readonly display_name: string; + /** + * e-mail to send feedback about the feature + * + * @example "feedback@heroku.com" + */ + readonly feedback_email: string; +} +export interface AccountFeatureUpdatePayload { + /** + * whether or not account feature has been enabled + * + * @example true + */ + enabled: boolean; +} +/** + * + * [Heroku Platform API - account](https://devcenter.heroku.com/articles/platform-api-reference#account) + * An account represents an individual signed up to use the Heroku platform. + */ +export interface Account { + /** + * whether to allow third party web activity tracking + * + * @example true + */ + allow_tracking: boolean; + /** + * whether allowed to utilize beta Heroku features + */ + beta: boolean; + /** + * when account was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated: boolean; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * Identity Provider details for federated users. + */ + identity_provider: IdentityProvider | null; + /** + * when account last authorized with Heroku + * + * @example "2012-01-01T12:00:00Z" + */ + readonly last_login: string | null; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name: string | null; + /** + * SMS number of account + * + * @example "+1 ***-***-1234" + */ + readonly sms_number: string | null; + /** + * when account was suspended + * + * @example "2012-01-01T12:00:00Z" + */ + readonly suspended_at: string | null; + /** + * when account became delinquent + * + * @example "2012-01-01T12:00:00Z" + */ + readonly delinquent_at: string | null; + /** + * whether two-factor auth is enabled on the account + */ + readonly two_factor_authentication: boolean; + /** + * when account was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * whether account has been verified with billing information + */ + readonly verified: boolean; + /** + * country where account owner resides + * + * @example "United States" + */ + country_of_residence: string | null; + /** + * team selected by default + */ + default_organization: DefaultOrganization | null; + /** + * team selected by default + */ + default_team: DefaultTeam | null; +} +/** + * + * [Heroku Platform API - identity-provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) + * Identity Providers represent the SAML configuration of teams or an Enterprise account + */ +export interface IdentityProvider { + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate: string; + /** + * when provider record was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * URL identifier provided by the identity provider + * + * @example "https://customer-domain.idp.com" + */ + entity_id: string; + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * single log out URL for this identity provider + * + * @example "https://example.com/idp/logout" + */ + slo_target_url: string; + /** + * single sign on URL for this identity provider + * + * @example "https://example.com/idp/login" + */ + sso_target_url: string; + /** + * team associated with this identity provider + */ + organization: null | Organization; + /** + * when the identity provider record was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * entity that owns this identity provider + */ + owner: Owner; +} +/** + * + * [Heroku Platform API - team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * Teams allow you to manage access to a shared group of applications and other resources. + */ +export interface Team { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * when the team was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * whether charges incurred by the team are paid by credit card. + * + * @example true + */ + readonly credit_card_collections: boolean; + /** + * whether to use this team when none is specified + * + * @example true + */ + default: boolean; + enterprise_account: null | TeamEnterpriseAccount; + /** + * Identity Provider associated with the Team + */ + identity_provider: null | TeamIdentityProvider; + /** + * upper limit of members allowed in a team. + * + * @example 25 + */ + readonly membership_limit: number | null; + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; + /** + * whether the team is provisioned licenses by salesforce. + * + * @example true + */ + readonly provisioned_licenses: boolean; + /** + * role in the team + * + * @example "admin" + */ + readonly role: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; + /** + * type of team. + * + * @example "team" + */ + readonly type: 'enterprise' | 'team'; + /** + * when the team was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +export interface Organization { + /** + * unique name of team + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * entity that owns this identity provider + */ +export interface Owner { + /** + * unique identifier of the owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * name of the owner + * + * @example "acme" + */ + readonly name?: string; + /** + * type of the owner + * + * @example "team" + */ + readonly type: 'team' | 'enterprise-account'; +} +/** + * + * team selected by default + */ +export interface DefaultOrganization { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; +} +/** + * + * team selected by default + */ +export interface DefaultTeam { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; +} +export interface AccountUpdatePayload { + /** + * whether to allow third party web activity tracking + * + * @example true + */ + allow_tracking?: boolean; + /** + * whether allowed to utilize beta Heroku features + */ + beta?: boolean; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name?: string | null; +} +export interface AccountUpdateByUserPayload { + /** + * whether to allow third party web activity tracking + * + * @example true + */ + allow_tracking?: boolean; + /** + * whether allowed to utilize beta Heroku features + */ + beta?: boolean; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name?: string | null; +} +/** + * + * [Heroku Platform API - add-on-action](https://devcenter.heroku.com/articles/platform-api-reference#add-on-action) + * Add-on Actions are lifecycle operations for add-on provisioning and deprovisioning. They allow add-on providers to (de)provision add-ons in the background and then report back when (de)provisioning is complete. + */ +export interface AddOnAction { +} +/** + * + * Add-ons represent add-ons that have been provisioned and attached to one or more apps. + */ +export interface AddOn { + /** + * provider actions for this specific add-on + */ + readonly actions: Array>; + /** + * identity of add-on serviceAdd-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. + */ + addon_service: { + /** + * unique identifier of this add-on-service + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly name: string; + } | AddOnService; + /** + * billing entity associated with this add-on + */ + billing_entity: BillingEntity; + /** + * billing application associated with this add-on + */ + app: App; + /** + * billed price + */ + billed_price: BilledPrice | null; + /** + * config vars exposed to the owning app by this add-on + * + * @example ["FOO","BAZ"] + */ + readonly config_vars: string[]; + /** + * when add-on was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + name: string; + /** + * identity of add-on planPlans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication. + */ + plan: { + /** + * unique identifier of this plan + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of this plan + * + * @example "heroku-postgresql:dev" + */ + readonly name: string; + } | Plan; + /** + * id of this add-on with its provider + * + * @example "abcd1234" + */ + readonly provider_id: string; + /** + * A provision message + */ + readonly provision_message?: string; + /** + * state in the add-on's lifecycle + * + * @example "provisioned" + */ + readonly state: 'provisioning' | 'provisioned' | 'deprovisioned'; + /** + * when add-on was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * URL for logging into web interface of add-on (e.g. a dashboard) + * + * @example "https://postgres.heroku.com/databases/01234567-89ab-cdef-0123-456789abcdef" + */ + readonly web_url: null | string; +} +/** + * + * [Heroku Platform API - add-on-service](https://devcenter.heroku.com/articles/platform-api-reference#add-on-service) + * Add-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. + */ +export interface AddOnService { + /** + * npm package name of the add-on service's Heroku CLI plugin + * + * @example "heroku-papertrail" + */ + readonly cli_plugin_name: string | null; + /** + * when add-on-service was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * human-readable name of the add-on service provider + * + * @example "Heroku Postgres" + */ + readonly human_name: string; + /** + * unique identifier of this add-on-service + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly name: string; + /** + * release status for add-on service + * + * @example "ga" + */ + readonly state: 'alpha' | 'beta' | 'ga' | 'shutdown'; + /** + * whether or not apps can have access to more than one instance of this add-on at the same time + */ + readonly supports_multiple_installations: boolean; + /** + * whether or not apps can have access to add-ons billed to a different app + */ + readonly supports_sharing: boolean; + /** + * when add-on-service was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * billing entity associated with this add-on + */ +export interface BillingEntity { + /** + * unique identifier of the billing entity + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * name of the billing entity + * + * @example "example" + */ + readonly name: string; + /** + * type of Object of the billing entity; new types allowed at any time. + * + * @example "app" + */ + readonly type: 'app' | 'team'; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * An app represents the program that you would like to deploy and run on Heroku. + */ +export interface App { + /** + * ACM status of this app + */ + readonly acm: boolean; + /** + * when app was archived + * + * @example "2012-01-01T12:00:00Z" + */ + readonly archived_at: null | string; + /** + * description from buildpack of app + * + * @example "Ruby/Rack" + */ + readonly buildpack_provided_description: null | string; + /** + * identity of the stack that will be used for new builds + */ + build_stack: BuildStack; + /** + * when app was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * git repo URL of app + * + * @example "https://git.heroku.com/example.git" + */ + readonly git_url: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * describes whether a Private Spaces app is externally routable or not + */ + internal_routing: boolean | null; + /** + * maintenance status of app + */ + maintenance: boolean; + /** + * unique name of app + * + * @example "example" + */ + name: string; + /** + * identity of app owner + */ + owner: AppOwner; + /** + * identity of team + */ + organization: null | AppOrganization; + /** + * identity of team + */ + team: null | AppTeam; + /** + * identity of app region + */ + region: AppRegion; + /** + * when app was released + * + * @example "2012-01-01T12:00:00Z" + */ + readonly released_at: null | string; + /** + * git repo size in bytes of app + */ + readonly repo_size: number | null; + /** + * slug size in bytes of app + */ + readonly slug_size: number | null; + /** + * identity of space + */ + space: null | Space; + /** + * identity of app stack + */ + stack: Stack; + /** + * when app was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * web URL of app + * + * @example "https://example.herokuapp.com/" + */ + readonly web_url: null | string; +} +/** + * + * billed price + */ +export interface BilledPrice { + /** + * price in cents per unit of plan + */ + readonly cents: number; + /** + * price is negotiated in a contract outside of monthly add-on billing + */ + readonly contract: boolean; + /** + * unit of price for plan + * + * @example "month" + */ + readonly unit: string; +} +/** + * + * [Heroku Platform API - plan](https://devcenter.heroku.com/articles/platform-api-reference#plan) + * Plans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication. + */ +export interface Plan { + /** + * identity of add-on service + */ + addon_service: AddonService; + /** + * when plan was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * the compliance regimes applied to an add-on plan + * + * @example ["HIPAA"] + */ + compliance: null | 'HIPAA' | Array<'PCI'>; + /** + * whether this plan is the default for its add-on service + */ + readonly default: boolean; + /** + * description of plan + * + * @example "Heroku Postgres Dev" + */ + readonly description: string; + /** + * human readable name of the add-on plan + * + * @example "Dev" + */ + readonly human_name: string; + /** + * unique identifier of this plan + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * whether this plan is installable to a Private Spaces app + */ + readonly installable_inside_private_network: boolean; + /** + * whether this plan is installable to a Common Runtime app + * + * @example true + */ + readonly installable_outside_private_network: boolean; + /** + * unique name of this plan + * + * @example "heroku-postgresql:dev" + */ + readonly name: string; + /** + * price + */ + price: Price; + /** + * whether this plan is the default for apps in Private Spaces + */ + readonly space_default: boolean; + /** + * release status for plan + * + * @example "public" + */ + readonly state: string; + /** + * when plan was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * whether this plan is publicly visible + * + * @example true + */ + readonly visible: boolean; +} +/** + * + * identity of add-on service + */ +export interface AddonService { + /** + * unique identifier of this add-on-service + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly name: string; +} +/** + * + * price + */ +export interface Price { + /** + * price in cents per unit of plan + */ + readonly cents: number; + /** + * price is negotiated in a contract outside of monthly add-on billing + */ + readonly contract: boolean; + /** + * unit of price for plan + * + * @example "month" + */ + readonly unit: string; +} +/** + * + * [Heroku Platform API - add-on-attachment](https://devcenter.heroku.com/articles/platform-api-reference#add-on-attachment) + * An add-on attachment represents a connection between an app and an add-on that it has been given access to. + */ +export interface AddOnAttachment { + /** + * identity of add-on + */ + addon: Addon; + /** + * application that is attached to add-on + */ + app: App; + /** + * when add-on attachment was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this add-on attachment + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name for this add-on attachment to this app + * + * @example "DATABASE" + */ + readonly name: string; + /** + * attachment namespace + * + * @example "role:analytics" + */ + readonly namespace: null | string; + /** + * when add-on attachment was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * URL for logging into web interface of add-on in attached app context + * + * @example "https://postgres.heroku.com/databases/01234567-89ab-cdef-0123-456789abcdef" + */ + readonly web_url: null | string; + /** + * URL for add-on partners to write to an add-on's logs + * + * @example "https://token:t.abcdef12-3456-7890-abcd-ef1234567890@1.us.logplex.io/logs" + */ + readonly log_input_url: null | string; +} +/** + * + * identity of add-on + */ +export interface Addon { + /** + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + name: string; + /** + * billing application associated with this add-on + */ + app: App; +} +export interface AddOnAttachmentCreatePayload { + /** + * unique identifier of add-on or globally unique name of the add-on + */ + addon: string; + /** + * unique identifier of app or unique name of app + */ + app: string; + /** + * name of owning app for confirmation + * + * @example "example" + */ + confirm?: string; + /** + * unique name for this add-on attachment to this app + * + * @example "DATABASE" + */ + readonly name?: string; + /** + * attachment namespace + * + * @example "role:analytics" + */ + readonly namespace?: null | string; +} +export interface AddOnAttachmentResolutionPayload { + /** + * unique name for this add-on attachment to this app + * + * @example "DATABASE" + */ + readonly addon_attachment: string; + /** + * unique name of app + * + * @example "example" + */ + app?: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly addon_service?: string; +} +/** + * + * [Heroku Platform API - add-on-config](https://devcenter.heroku.com/articles/platform-api-reference#add-on-config) + * Configuration of an Add-on + */ +export interface AddOnConfig { + /** + * unique name of the config + * + * @example "FOO" + */ + name: string; + /** + * value of the config + * + * @example "bar" + */ + value: string | null; +} +export interface AddOnConfigUpdatePayload { + config?: AddOnConfig[]; +} +/** + * + * [Heroku Platform API - add-on-plan-action](https://devcenter.heroku.com/articles/platform-api-reference#add-on-plan-action) + * Add-on Plan Actions are Provider functionality for specific add-on installations + */ +export interface AddOnPlanAction { + /** + * a unique identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * the display text shown in Dashboard + * + * @example "Example" + */ + readonly label: string; + /** + * identifier of the action to take that is sent via SSO + * + * @example "example" + */ + readonly action: string; + /** + * absolute URL to use instead of an action + * + * @example "http://example.com?resource_id=:resource_id" + */ + readonly url: string; + /** + * if the action requires the user to own the app + * + * @example true + */ + readonly requires_owner: boolean; +} +/** + * + * [Heroku Platform API - add-on-region-capability](https://devcenter.heroku.com/articles/platform-api-reference#add-on-region-capability) + * Add-on region capabilities represent the relationship between an Add-on Service and a specific Region. Only Beta and GA add-ons are returned by these endpoints. + */ +export interface AddOnRegionCapability { + /** + * unique identifier of this add-on-region-capability + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * whether the add-on can be installed to a Space + */ + readonly supports_private_networking: boolean; + /** + * Add-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. + */ + addon_service: AddOnService; + /** + * A region represents a geographic location in which your application may run. + */ + region: Region; +} +/** + * + * [Heroku Platform API - region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * A region represents a geographic location in which your application may run. + */ +export interface Region { + /** + * country where the region exists + * + * @example "United States" + */ + readonly country: string; + /** + * when region was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of region + * + * @example "United States" + */ + readonly description: string; + /** + * unique identifier of region + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * area in the country where the region exists + * + * @example "Virginia" + */ + readonly locale: string; + /** + * unique name of region + * + * @example "us" + */ + readonly name: string; + /** + * whether or not region is available for creating a Private Space + */ + readonly private_capable: boolean; + /** + * provider of underlying substrate + */ + readonly provider: Provider; + /** + * when region was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * provider of underlying substrate + */ +export interface Provider { + /** + * name of provider + * + * @example "amazon-web-services" + */ + readonly name?: string; + /** + * region name used by provider + * + * @example "us-east-1" + */ + readonly region?: 'ap-south-1' | 'eu-west-1' | 'ap-southeast-1' | 'ap-southeast-2' | 'eu-central-1' | 'eu-west-2' | 'ap-northeast-2' | 'ap-northeast-1' | 'us-east-1' | 'sa-east-1' | 'us-west-1' | 'us-west-2' | 'ca-central-1'; +} +/** + * + * Represents the delivery of a webhook notification, including its current status. + */ +export interface AppWebhookDelivery { + /** + * when the delivery was created + */ + created_at: string; + /** + * identity of event + */ + event: Event; + /** + * the delivery's unique identifier + */ + readonly id: string; + /** + * number of times a delivery has been attempted + */ + readonly num_attempts: number; + /** + * when delivery will be attempted again + */ + next_attempt_at: string | null; + /** + * last attempt of a delivery + */ + last_attempt: LastAttempt | null; + /** + * the delivery's status + * + * @example "pending" + */ + status: 'pending' | 'scheduled' | 'retrying' | 'failed' | 'succeeded'; + /** + * when the delivery was last updated + */ + updated_at: string; + /** + * identity of webhook + */ + webhook: Webhook; +} +/** + * + * identity of event + */ +export interface Event { + /** + * the event's unique identifier + */ + readonly id: string; + /** + * the type of entity that the event is related to + * + * @example "api:release" + */ + include: string; +} +/** + * + * last attempt of a delivery + */ +export interface LastAttempt { + /** + * unique identifier of attempt + */ + readonly id: string; + /** + * http response code received during attempt + */ + readonly code: number | null; + /** + * error class encountered during attempt + */ + readonly error_class: string | null; + /** + * status of an attempt + * + * @example "scheduled" + */ + status: 'scheduled' | 'succeeded' | 'failed'; + /** + * when attempt was created + */ + created_at: string; + /** + * when attempt was updated + */ + updated_at: string; +} +/** + * + * identity of webhook + */ +export interface Webhook { + /** + * the webhook's unique identifier + */ + readonly id: string; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level: 'notify' | 'sync'; +} +/** + * + * Represents a webhook event that occurred. + */ +export interface AppWebhookEvent { + /** + * when event was created + */ + created_at: string; + /** + * the event's unique identifier + */ + readonly id: string; + /** + * the type of entity that the event is related to + * + * @example "api:release" + */ + include: string; + /** + * payload of event + */ + payload: Payload; + /** + * when the event was last updated + */ + updated_at: string; +} +/** + * + * payload of event + */ +export interface Payload { + /** + * the type of event that occurred + * + * @example "create" + */ + action: string; + /** + * user that caused event + */ + actor: Actor; + /** + * the current details of the event + */ + data: Record; + /** + * previous details of the event (if any) + */ + previous_data: Record; + /** + * the type of resource associated with the event + * + * @example "release" + */ + resource: string; + /** + * the version of the details provided for the event + * + * @example "1" + */ + version: string; +} +/** + * + * user that caused event + */ +export interface Actor { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - add-on-webhook](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook) + * Represents the details of a webhook subscription + */ +export interface AddOnWebhook { + /** + * when the webhook was created + */ + created_at: string; + /** + * the webhook's unique identifier + */ + readonly id: string; + /** + * the entities that the subscription provides notifications for + */ + include: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level: 'notify' | 'sync'; + /** + * when the webhook was updated + */ + updated_at: string; + /** + * the URL where the webhook's notification requests are sent + */ + url: string; +} +export interface AddOnWebhookCreatePayload { + /** + * a custom `Authorization` header that Heroku will include with all webhook notifications + * + * @example "Bearer 9266671b2767f804c9d5809c2d384ed57d8f8ce1abd1043e1fb3fbbcb8c3" + */ + authorization?: null | string; + /** + * the entities that the subscription provides notifications for + */ + include: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level: 'notify' | 'sync'; + /** + * a value that Heroku will use to sign all webhook notification requests (the signature is included in the request’s `Heroku-Webhook-Hmac-SHA256` header) + * + * @example "dcbff0c4430a2960a2552389d587bc58d30a37a8cf3f75f8fb77abe667ad" + */ + secret?: null | string; + /** + * the URL where the webhook's notification requests are sent + */ + url: string; +} +/** + * + * add-on webhook + */ +export interface AddonWebhook { + /** + * identity of add-on. Only used for add-on partner webhooks. + */ + addon?: AddonWebhookAddon; + /** + * when the webhook was created + */ + created_at?: string; + /** + * the webhook's unique identifier + */ + readonly id?: string; + /** + * the entities that the subscription provides notifications for + */ + include?: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level?: 'notify' | 'sync'; + /** + * when the webhook was updated + */ + updated_at?: string; + /** + * the URL where the webhook's notification requests are sent + */ + url?: string; +} +/** + * + * identity of add-on. Only used for add-on partner webhooks. + */ +export interface AddonWebhookAddon { + /** + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + name: string; +} +export interface AddOnWebhookUpdatePayload { + /** + * a custom `Authorization` header that Heroku will include with all webhook notifications + * + * @example "Bearer 9266671b2767f804c9d5809c2d384ed57d8f8ce1abd1043e1fb3fbbcb8c3" + */ + authorization?: null | string; + /** + * the entities that the subscription provides notifications for + */ + include?: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level?: 'notify' | 'sync'; + /** + * a value that Heroku will use to sign all webhook notification requests (the signature is included in the request’s `Heroku-Webhook-Hmac-SHA256` header) + * + * @example "dcbff0c4430a2960a2552389d587bc58d30a37a8cf3f75f8fb77abe667ad" + */ + secret?: null | string; + /** + * the URL where the webhook's notification requests are sent + */ + url?: string; +} +export interface AddOnCreatePayload { + /** + * name for add-on's initial attachment + * + * @example {"name":"DATABASE_FOLLOWER"} + */ + attachment?: Attachment; + /** + * custom add-on provisioning options + * + * @example {"db-version":"1.2.3"} + */ + config?: Record; + /** + * name of billing entity for confirmation + * + * @example "example" + */ + confirm?: string; + /** + * unique identifier of this plan or unique name of this plan + */ + plan: string; + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + name?: string; +} +/** + * + * name for add-on's initial attachment + */ +export interface Attachment { + /** + * unique name for this add-on attachment to this app + * + * @example "DATABASE" + */ + readonly name?: string; +} +export interface AddOnUpdatePayload { + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + name?: string; + /** + * unique identifier of this plan or unique name of this plan + */ + plan: string; +} +export interface AddOnResolutionPayload { + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + addon: string; + /** + * unique name of app + * + * @example "example" + */ + app?: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly addon_service?: string; +} +/** + * + * [Heroku Platform API - allowed-add-on-service](https://devcenter.heroku.com/articles/platform-api-reference#allowed-add-on-service) + * Entities that have been allowed to be used by a Team + */ +export interface AllowedAddOnService { + /** + * when the add-on service was allowed + * + * @example "2012-01-01T12:00:00Z" + */ + readonly added_at: string; + /** + * the user which allowed the add-on service + */ + readonly added_by: AddedBy; + /** + * the add-on service allowed for use + */ + readonly addon_service: AllowedAddOnServiceAddonService; + /** + * unique identifier for this allowed add-on service record + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * the user which allowed the add-on service + */ +export interface AddedBy { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email?: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * the add-on service allowed for use + */ +export interface AllowedAddOnServiceAddonService { + /** + * unique identifier of this add-on-service + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly name?: string; + /** + * human-readable name of the add-on service provider + * + * @example "Heroku Postgres" + */ + readonly human_name?: string; +} +export interface AllowedAddOnServiceCreateByTeamPayload { + /** + * name of the add-on service to allow + * + * @example "heroku-postgresql" + */ + addon_service?: string; +} +/** + * + * [Heroku Platform API - app-feature](https://devcenter.heroku.com/articles/platform-api-reference#app-feature) + * An app feature represents a Heroku labs capability that can be enabled or disabled for an app on Heroku. + */ +export interface AppFeature { + /** + * when app feature was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of app feature + * + * @example "Causes app to example." + */ + readonly description: string; + /** + * documentation URL of app feature + * + * @example "http://devcenter.heroku.com/articles/example" + */ + readonly doc_url: string; + /** + * whether or not app feature has been enabled + * + * @example true + */ + enabled: boolean; + /** + * unique identifier of app feature + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of app feature + * + * @example "name" + */ + readonly name: string; + /** + * state of app feature + * + * @example "public" + */ + readonly state: string; + /** + * when app feature was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user readable feature name + * + * @example "My Feature" + */ + readonly display_name: string; + /** + * e-mail to send feedback about the feature + * + * @example "feedback@heroku.com" + */ + readonly feedback_email: string; +} +export interface AppFeatureUpdatePayload { + /** + * whether or not app feature has been enabled + * + * @example true + */ + enabled: boolean; +} +/** + * + * [Heroku Platform API - app-setup](https://devcenter.heroku.com/articles/platform-api-reference#app-setup) + * An app setup represents an app on Heroku that is setup using an environment, addons, and scripts described in an app.json manifest file. + */ +export interface AppSetup { + /** + * unique identifier of app setup + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * when app setup was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * when app setup was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * the overall status of app setup + * + * @example "failed" + */ + readonly status: 'failed' | 'pending' | 'succeeded'; + /** + * reason that app setup has failed + * + * @example "invalid app.json" + */ + readonly failure_message: string | null; + /** + * identity of app + */ + app: App; + /** + * identity and status of build + */ + build: null | Build; + /** + * errors associated with invalid app.json manifest file + * + * @example ["config var FOO is required"] + */ + readonly manifest_errors: string[]; + /** + * result of postdeploy script + */ + readonly postdeploy: Postdeploy | null; + /** + * fully qualified success url + * + * @example "https://example.herokuapp.com/welcome" + */ + readonly resolved_success_url: string | null; +} +/** + * + * [Heroku Platform API - build](https://devcenter.heroku.com/articles/platform-api-reference#build) + * A build represents the process of transforming a code tarball into a slug + */ +export interface Build { + /** + * app that the build belongs to + */ + app?: BuildApp; + /** + * buildpacks executed for this build, in order + */ + buildpacks?: Array<{ + /** + * the URL of the buildpack for the app + * + * @example "https://github.com/heroku/heroku-buildpack-ruby" + */ + url?: string; + /** + * Buildpack Registry name of the buildpack for the app + * + * @example "heroku/ruby" + */ + name?: string; + }> | null; + /** + * when build was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of build + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * Build process output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). + * + * @example "https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef" + */ + readonly output_stream_url?: string; + /** + * location of gzipped tarball of source code used to create build + */ + source_blob: BuildSourceBlob; + /** + * release resulting from the build + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} + */ + readonly release?: null | BuildRelease; + /** + * slug created by this build + */ + slug?: Slug | null; + /** + * stack of build + * + * @example "heroku-22" + */ + readonly stack?: string; + /** + * status of build + * + * @example "succeeded" + */ + readonly status: 'failed' | 'pending' | 'succeeded'; + /** + * when build was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user that started the build + */ + user: User; +} +/** + * + * result of postdeploy script + */ +export interface Postdeploy { + /** + * output of the postdeploy script + * + * @example "assets precompiled" + */ + readonly output?: string; + /** + * The exit code of the postdeploy script + * + * @example 1 + */ + readonly exit_code?: number; +} +export interface AppSetupCreatePayload { + /** + * optional parameters for created app + */ + app?: AppSetupCreatePayloadApp; + /** + * gzipped tarball of source code containing app.json manifest file + */ + source_blob: SourceBlob; + /** + * overrides of keys in the app.json manifest file + * + * @example {"buildpacks":[{"url":"https://example.com/buildpack.tgz"}],"env":{"FOO":"bar","BAZ":"qux"}} + */ + overrides?: Overrides; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * optional parameters for created app + */ +export interface AppSetupCreatePayloadApp { + /** + * are other team members forbidden from joining this app. + */ + locked?: boolean; + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique name of team + * + * @example "example" + */ + readonly organization?: string; + /** + * force creation of the app in the user account even if a default team is set. + */ + personal?: boolean; + /** + * unique name of region + * + * @example "us" + */ + readonly region?: string; + /** + * unique name of space + * + * @example "nasa" + */ + space?: string; + /** + * unique name of stack + * + * @example "heroku-18" + */ + readonly stack?: string; +} +/** + * + * gzipped tarball of source code containing app.json manifest file + */ +export interface SourceBlob { + /** + * an optional checksum of the gzipped tarball for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum?: null | string; + /** + * URL of gzipped tarball of source code containing app.json manifest file + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly url?: string; + /** + * Version of the gzipped tarball. + * + * @example "v1.3.0" + */ + readonly version?: string | null; +} +/** + * + * overrides of keys in the app.json manifest file + */ +export interface Overrides { + /** + * overrides the buildpacks specified in the app.json manifest file + * + * @example [{"url":"https://example.com/buildpack.tgz"}] + */ + buildpacks?: BuildpackOverride[]; + /** + * overrides of the env specified in the app.json manifest file + * + * @example {"FOO":"bar","BAZ":"qux"} + */ + readonly env?: Record; +} +/** + * + * a buildpack override + */ +export interface BuildpackOverride { + /** + * location of the buildpack + * + * @example "https://example.com/buildpack.tgz" + */ + url?: string; +} +/** + * + * [Heroku Platform API - app-transfer](https://devcenter.heroku.com/articles/platform-api-reference#app-transfer) + * An app transfer represents a two party interaction for transferring ownership of an app. + */ +export interface AppTransfer { + /** + * app involved in the transfer + */ + app: App; + /** + * when app transfer was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of app transfer + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * identity of the owner of the transfer + */ + owner: AppTransferOwner; + /** + * identity of the recipient of the transfer + */ + recipient: Recipient; + /** + * the current state of an app transfer + * + * @example "pending" + */ + readonly state: 'pending' | 'accepted' | 'declined'; + /** + * when app transfer was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * identity of the owner of the transfer + */ +export interface AppTransferOwner { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * identity of the recipient of the transfer + */ +export interface Recipient { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +export interface AppTransferCreatePayload { + /** + * unique identifier of app or unique name of app + */ + app: string; + /** + * unique email address of account or unique identifier of an account or Implicit reference to currently authorized user + */ + recipient: string; + /** + * whether to suppress email notification when transferring apps + */ + readonly silent?: boolean; +} +export interface AppTransferUpdatePayload { + /** + * the current state of an app transfer + * + * @example "pending" + */ + readonly state: 'pending' | 'accepted' | 'declined'; +} +export interface AppWebhookCreatePayload { + /** + * a custom `Authorization` header that Heroku will include with all webhook notifications + * + * @example "Bearer 9266671b2767f804c9d5809c2d384ed57d8f8ce1abd1043e1fb3fbbcb8c3" + */ + authorization?: null | string; + /** + * the entities that the subscription provides notifications for + */ + include: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level: 'notify' | 'sync'; + /** + * a value that Heroku will use to sign all webhook notification requests (the signature is included in the request’s `Heroku-Webhook-Hmac-SHA256` header) + * + * @example "dcbff0c4430a2960a2552389d587bc58d30a37a8cf3f75f8fb77abe667ad" + */ + secret?: null | string; + /** + * the URL where the webhook's notification requests are sent + */ + url: string; +} +/** + * + * app webhook + */ +export interface AppWebhook { + /** + * identity of app. Only used for customer webhooks. + */ + app?: App; + /** + * when the webhook was created + */ + created_at?: string; + /** + * the webhook's unique identifier + */ + readonly id?: string; + /** + * the entities that the subscription provides notifications for + */ + include?: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level?: 'notify' | 'sync'; + /** + * when the webhook was updated + */ + updated_at?: string; + /** + * the URL where the webhook's notification requests are sent + */ + url?: string; +} +export interface AppWebhookUpdatePayload { + /** + * a custom `Authorization` header that Heroku will include with all webhook notifications + * + * @example "Bearer 9266671b2767f804c9d5809c2d384ed57d8f8ce1abd1043e1fb3fbbcb8c3" + */ + authorization?: null | string; + /** + * the entities that the subscription provides notifications for + */ + include?: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level?: 'notify' | 'sync'; + /** + * a value that Heroku will use to sign all webhook notification requests (the signature is included in the request’s `Heroku-Webhook-Hmac-SHA256` header) + * + * @example "dcbff0c4430a2960a2552389d587bc58d30a37a8cf3f75f8fb77abe667ad" + */ + secret?: null | string; + /** + * the URL where the webhook's notification requests are sent + */ + url?: string; +} +/** + * + * identity of the stack that will be used for new builds + */ +export interface BuildStack { + /** + * unique identifier of stack + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of stack + * + * @example "heroku-18" + */ + readonly name: string; +} +/** + * + * identity of app owner + */ +export interface AppOwner { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * identity of team + */ +export interface AppOrganization { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * [Heroku Platform API - team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * identity of team + */ +export interface AppTeam { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * [Heroku Platform API - region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * identity of app region + */ +export interface AppRegion { + /** + * unique identifier of region + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of region + * + * @example "us" + */ + readonly name: string; +} +/** + * + * A space is an isolated, highly available, secure app execution environment. + */ +export interface Space { + /** + * when space was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of space + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of space + * + * @example "nasa" + */ + name: string; + /** + * organization that owns this space + */ + organization: Organization; + /** + * team that owns this space + */ + team: SpaceTeam; + /** + * identity of space region + */ + region: SpaceRegion; + /** + * true if this space has shield enabled + * + * @example true + */ + readonly shield: boolean; + /** + * availability of this space + * + * @example "allocated" + */ + readonly state: 'allocating' | 'allocated' | 'deleting'; + /** + * when space was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * The RFC-1918 CIDR the Private Space will use. It must be a /16 in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 + * + * @example "172.20.20.30/16" + */ + cidr: string; + /** + * The RFC-1918 CIDR that the Private Space will use for the Heroku-managed peering connection that's automatically created when using Heroku Data add-ons. It must be between a /16 and a /20 + * + * @example "10.2.0.0/16" + */ + data_cidr: string; +} +/** + * + * [Heroku Platform API - stack](https://devcenter.heroku.com/articles/platform-api-reference#stack) + * Stacks are the different application execution environments available in the Heroku platform. + */ +export interface Stack { + /** + * indicates this stack is the default for new apps + * + * @example true + */ + readonly default: boolean; + /** + * when stack was introduced + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of stack + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of stack + * + * @example "heroku-18" + */ + readonly name: string; + /** + * availability of this stack: beta, deprecated or public + * + * @example "public" + */ + readonly state: string; + /** + * when stack was last modified + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +export interface AppCreatePayload { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of region or unique name of region + */ + region?: string; + /** + * unique name of stack or unique identifier of stack + */ + stack?: string; + /** + * unique name of app feature + */ + feature_flags?: string[]; +} +export interface AppUpdatePayload { + /** + * unique name of stack or unique identifier of stack + */ + build_stack?: string; + /** + * maintenance status of app + */ + maintenance?: boolean; + /** + * unique name of app + * + * @example "example" + */ + name?: string; +} +/** + * + * [Heroku Platform API - archive](https://devcenter.heroku.com/articles/platform-api-reference#archive) + * An audit trail archive represents a monthly json zipped file containing events + */ +export interface Archive { + /** + * when archive was created + */ + created_at: string; + /** + * month of the archive + * + * @example "10" + */ + readonly month: '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12'; + /** + * year of the archive + * + * @example 2019 + */ + readonly year: number; + /** + * url where to download the archive + */ + readonly url: string; + /** + * checksum for the archive + */ + readonly checksum: string; + /** + * size of the archive in bytes + * + * @example 100 + */ + readonly size: number; +} +/** + * + * [Heroku Platform API - audit-trail-event](https://devcenter.heroku.com/articles/platform-api-reference#audit-trail-event) + * An audit trail event represents some action on the platform + */ +export interface AuditTrailEvent { + /** + * when event was created + */ + created_at: string; + /** + * unique identifier of event + */ + readonly id: string; + /** + * type of event + */ + readonly type: string; + /** + * action for the event + */ + readonly action: string; + /** + * user who caused event + */ + readonly actor: AuditTrailEventActor; + /** + * app upon which event took place + */ + readonly app: AuditTrailEventApp; + /** + * owner of the app targeted by the event + */ + readonly owner: AuditTrailEventOwner; + /** + * enterprise account on which the event happened + */ + readonly enterprise_account: EnterpriseAccount; + /** + * team on which the event happened + */ + readonly team: AuditTrailEventTeam; + /** + * information about where the action was triggered + */ + readonly request: Request; + /** + * data specific to the event + */ + readonly data: Record; +} +/** + * + * user who caused event + */ +export interface AuditTrailEventActor { + id?: string; + email?: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app upon which event took place + */ +export interface AuditTrailEventApp { + id?: string; + name?: string; +} +/** + * + * owner of the app targeted by the event + */ +export interface AuditTrailEventOwner { + id?: string; + email?: string; +} +/** + * + * [Heroku Platform API - enterprise-account](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account) + * Enterprise accounts allow companies to manage their development teams and billing. + */ +export interface EnterpriseAccount { + /** + * unique identifier of the enterprise account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * when the enterprise account was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique name of the enterprise account + * + * @example "example" + */ + readonly name: string; + /** + * when the enterprise account was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * the current user's permissions for this enterprise account + */ + readonly permissions: string[]; + /** + * whether the enterprise account is a trial or not + */ + readonly trial: boolean; + /** + * Identity Provider associated with the Enterprise Account + */ + identity_provider: null | EnterpriseAccountIdentityProvider; +} +/** + * + * [Heroku Platform API - team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * team on which the event happened + */ +export interface AuditTrailEventTeam { + id?: string; + name?: string; +} +/** + * + * information about where the action was triggered + */ +export interface Request { + ip_address?: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app that the build belongs to + */ +export interface BuildApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * location of gzipped tarball of source code used to create build + */ +export interface BuildSourceBlob { + /** + * an optional checksum of the gzipped tarball for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum: null | string; + /** + * URL where gzipped tar archive of source code for build was downloaded. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly url: string; + /** + * Version of the gzipped tarball. + * + * @example "v1.3.0" + */ + readonly version: string | null; + /** + * Version description of the gzipped tarball. + * + * @example "* Fake User: Change session key" + */ + readonly version_description: string | null; +} +/** + * + * [Heroku Platform API - release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * release resulting from the build + */ +export interface BuildRelease { + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - slug](https://devcenter.heroku.com/articles/platform-api-reference#slug) + * A slug is a snapshot of your application code that is ready to run on the platform. + */ +export interface Slug { + /** + * pointer to the url where clients can fetch or store the actual release binary + */ + blob: Blob; + /** + * description from buildpack of slug + * + * @example "Ruby/Rack" + */ + buildpack_provided_description: null | string; + /** + * an optional checksum of the slug for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum: null | string; + /** + * identification of the code with your version control system (eg: SHA of the git HEAD) + * + * @example "60883d9e8947a57e04dc9124f25df004866a2051" + */ + commit: null | string; + /** + * an optional description of the provided commit + * + * @example "fixed a bug with API documentation" + */ + commit_description: null | string; + /** + * when slug was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of slug + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * hash mapping process type names to their respective command + * + * @example {"web":"./bin/web -p $PORT"} + */ + process_types: Record; + /** + * size of slug, in bytes + * + * @example 2048 + */ + readonly size: number | null; + /** + * identity of slug stack + */ + stack: Stack; + /** + * when slug was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * user that started the build + */ +export interface User { + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; +} +export interface BuildCreatePayload { + /** + * buildpacks executed for this build, in order + */ + buildpacks?: Array<{ + /** + * the URL of the buildpack for the app + * + * @example "https://github.com/heroku/heroku-buildpack-ruby" + */ + url?: string; + /** + * Buildpack Registry name of the buildpack for the app + * + * @example "heroku/ruby" + */ + name?: string; + }> | null; + /** + * location of gzipped tarball of source code used to create build + */ + source_blob: BuildCreatePayloadSourceBlob; +} +/** + * + * location of gzipped tarball of source code used to create build + */ +export interface BuildCreatePayloadSourceBlob { + /** + * an optional checksum of the gzipped tarball for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum: null | string; + /** + * URL where gzipped tar archive of source code for build was downloaded. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly url: string; + /** + * Version of the gzipped tarball. + * + * @example "v1.3.0" + */ + readonly version: string | null; + /** + * Version description of the gzipped tarball. + * + * @example "* Fake User: Change session key" + */ + readonly version_description: string | null; +} +/** + * + * [Heroku Platform API - buildpack-installation](https://devcenter.heroku.com/articles/platform-api-reference#buildpack-installation) + * A buildpack installation represents a buildpack that will be run against an app. + */ +export interface BuildpackInstallation { + /** + * determines the order in which the buildpacks will execute + */ + readonly ordinal: number; + /** + * buildpack + */ + buildpack: Buildpack; +} +/** + * + * buildpack + */ +export interface Buildpack { + /** + * location of the buildpack for the app. Either a url (unofficial buildpacks) or an internal urn (heroku official buildpacks). + * + * @example "https://github.com/heroku/heroku-buildpack-ruby" + */ + url?: string; + /** + * either the Buildpack Registry name or a URL of the buildpack for the app + * + * @example "heroku/ruby" + */ + name?: string; +} +export interface BuildpackInstallationUpdatePayload { + /** + * The buildpack attribute can accept a name, a url, or a urn. + */ + updates: Update[]; +} +/** + * + * Properties to update a buildpack installation + */ +export interface Update { + /** + * location of the buildpack for the app. Either a url (unofficial buildpacks) or an internal urn (heroku official buildpacks). + * + * @example "https://github.com/heroku/heroku-buildpack-ruby" + */ + buildpack: string; +} +/** + * + * [Heroku Platform API - collaborator](https://devcenter.heroku.com/articles/platform-api-reference#collaborator) + * A collaborator represents an account that has been given access to an app on Heroku. + */ +export interface Collaborator { + /** + * app collaborator belongs to + */ + app: CollaboratorApp; + /** + * when collaborator was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of collaborator + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + permissions?: TeamAppPermission[]; + /** + * role in the team + * + * @example "admin" + */ + readonly role?: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; + /** + * when collaborator was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * identity of collaborated account + */ + user: CollaboratorUser; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app collaborator belongs to + */ +export interface CollaboratorApp { + /** + * unique name of app + * + * @example "example" + */ + name: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - team-app-permission](https://devcenter.heroku.com/articles/platform-api-reference#team-app-permission) + * A team app permission is a behavior that is assigned to a user in a team app. + */ +export interface TeamAppPermission { + /** + * The name of the app permission. + * + * @example "view" + */ + readonly name?: string; + /** + * A description of what the app permission allows. + * + * @example "Can manage config, deploy, run commands and restart the app." + */ + readonly description?: string; +} +/** + * + * identity of collaborated account + */ +export interface CollaboratorUser { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated: boolean; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +export interface CollaboratorCreatePayload { + /** + * whether to suppress email invitation when creating collaborator + */ + silent?: boolean; + /** + * unique email address of account or unique identifier of an account or Implicit reference to currently authorized user + */ + user: string; +} +/** + * + * [Heroku Platform API - credit](https://devcenter.heroku.com/articles/platform-api-reference#credit) + * A credit represents value that will be used up before further charges are assigned to an account. + */ +export interface Credit { + /** + * total value of credit in cents + * + * @example 10000 + */ + amount: number; + /** + * remaining value of credit in cents + * + * @example 5000 + */ + balance: number; + /** + * when credit was created + * + * @example "2012-01-01T12:00:00Z" + */ + created_at: string; + /** + * when credit will expire + * + * @example "2012-01-01T12:00:00Z" + */ + expires_at: string; + /** + * unique identifier of credit + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + id: string; + /** + * a name for credit + * + * @example "gift card" + */ + title: string; + /** + * when credit was updated + * + * @example "2012-01-01T12:00:00Z" + */ + updated_at: string; +} +export interface CreditCreatePayload { + /** + * first code from a discount card + * + * @example "012abc" + */ + code1?: string; + /** + * second code from a discount card + * + * @example "012abc" + */ + code2?: string; +} +/** + * + * [Heroku Platform API - domain](https://devcenter.heroku.com/articles/platform-api-reference#domain) + * Domains define what web routes should be routed to an app on Heroku. + */ +export interface Domain { + /** + * status of this record's ACM + * + * @example "pending" + */ + readonly acm_status: null | string; + /** + * reason for the status of this record's ACM + * + * @example "Failing CCA check" + */ + readonly acm_status_reason: null | string; + /** + * app that owns the domain + */ + app: DomainApp; + /** + * canonical name record, the address to point a domain at + * + * @example "example.herokudns.com" + */ + readonly cname: null | string; + /** + * when domain was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * full hostname + * + * @example "subdomain.example.com" + */ + readonly hostname: string; + /** + * unique identifier of this domain + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * type of domain name + * + * @example "custom" + */ + readonly kind: 'heroku' | 'custom'; + /** + * when domain was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * status of this record's cname + * + * @example "pending" + */ + readonly status: string; + /** + * sni endpoint the domain is associated with + */ + sni_endpoint: null | SniEndpoint; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app that owns the domain + */ +export interface DomainApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - sni-endpoint](https://devcenter.heroku.com/articles/platform-api-reference#sni-endpoint) + * SNI Endpoint is a public address serving a custom SSL cert for HTTPS traffic, using the SNI TLS extension, to a Heroku app. + */ +export interface SniEndpoint { + /** + * raw contents of the public certificate chain (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate_chain: string; + /** + * when endpoint was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this SNI endpoint + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name for SNI endpoint + * + * @example "example" + */ + readonly name: string; + /** + * when SNI endpoint was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * unique name for SSL certificate + * + * @example "example" + */ + display_name: string | null; + /** + * domains associated with this SSL certificate + */ + readonly domains: string[]; + /** + * application that this SSL certificate is on + */ + app: SniEndpointApp; + /** + * certificate provided by this endpoint + */ + ssl_cert: SslCert; +} +export interface DomainCreatePayload { + /** + * full hostname + * + * @example "subdomain.example.com" + */ + readonly hostname: string; + /** + * null or unique identifier or name for SNI endpoint + */ + sni_endpoint: null | string; +} +export interface DomainUpdatePayload { + /** + * null or unique identifier or name for SNI endpoint + */ + sni_endpoint: null | string; +} +/** + * + * [Heroku Platform API - dyno-size](https://devcenter.heroku.com/articles/platform-api-reference#dyno-size) + * Dyno sizes are the values and details of sizes that can be assigned to dynos. This information can also be found at : [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +export interface DynoSize { + /** + * minimum vCPUs, non-dedicated may get more depending on load + * + * @example 1 + */ + readonly compute: number; + /** + * price information for this dyno size + */ + readonly cost: null | Record; + /** + * whether this dyno will be dedicated to one user + */ + readonly dedicated: boolean; + /** + * deprecated. See precise_dyno_units instead + */ + readonly dyno_units: number; + /** + * unit of consumption for Heroku Enterprise customers to 2 decimal places + * + * @example 0.28 + */ + readonly precise_dyno_units: number; + /** + * unique identifier of this dyno size + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * amount of RAM in GB + * + * @example 0.5 + */ + readonly memory: number; + /** + * the name of this dyno-size + * + * @example "eco" + */ + readonly name: string; + /** + * whether this dyno can only be provisioned in a private space + */ + readonly private_space_only: boolean; +} +/** + * + * [Heroku Platform API - dyno](https://devcenter.heroku.com/articles/platform-api-reference#dyno) + * Dynos encapsulate running processes of an app on Heroku. Detailed information about dyno sizes can be found at: [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +export interface Dyno { + /** + * a URL to stream output from for attached processes or null for non-attached processes + * + * @example "rendezvous://rendezvous.runtime.heroku.com:5000/{rendezvous-id}" + */ + readonly attach_url: string | null; + /** + * command used to start this process + * + * @example "bash" + */ + command: string; + /** + * when dyno was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this dyno + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * the name of this process on this dyno + * + * @example "run.1" + */ + readonly name: string; + /** + * app release of the dyno + */ + release: Release; + /** + * app formation belongs to + */ + app: DynoApp; + /** + * dyno size + * + * @example "standard-1X" + */ + size: string; + /** + * current status of process (either: crashed, down, idle, starting, or up) + * + * @example "up" + */ + readonly state: string; + /** + * type of process + * + * @example "run" + */ + type: string; + /** + * when process last changed state + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * A release represents a combination of code, config vars and add-ons for an app on Heroku. + */ +export interface Release { + /** + * add-on plans installed on the app for this release + */ + addon_plan_names: string[]; + /** + * app involved in the release + */ + app: ReleaseApp; + /** + * when release was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of changes in this release + * + * @example "Added new feature" + */ + readonly description: string; + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * when release was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * slug running in this release + */ + slug: Slug | null; + /** + * current status of the release + * + * @example "succeeded" + */ + readonly status: 'failed' | 'pending' | 'succeeded'; + /** + * user that created the release + */ + user: User; + /** + * unique version assigned to the release + * + * @example 11 + */ + readonly version: number; + /** + * indicates this release as being the current one for the app + * + * @example true + */ + readonly current: boolean; + /** + * Release command output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). + * + * @example "https://release-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef" + */ + readonly output_stream_url: string | null; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app formation belongs to + */ +export interface DynoApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface DynoCreatePayload { + /** + * whether to stream output or not + * + * @example true + */ + attach?: boolean; + /** + * command used to start this process + * + * @example "bash" + */ + command: string; + /** + * custom environment to add to the dyno config vars + * + * @example {"COLUMNS":"80","LINES":"24"} + */ + env?: Record; + /** + * force an attached one-off dyno to not run in a tty + */ + force_no_tty?: boolean | null; + /** + * dyno size + * + * @example "standard-1X" + */ + size?: string; + /** + * type of process + * + * @example "run" + */ + type?: string; + /** + * seconds until dyno expires, after which it will soon be killed, max 86400 seconds (24 hours) + * + * @example 1800 + */ + time_to_live?: number; +} +/** + * + * [Heroku Platform API - enterprise-account-daily-usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-daily-usage) + * Usage for an enterprise account at a daily resolution. + */ +export interface EnterpriseAccountDailyUsage { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons: number; + /** + * usage by team + */ + teams: Array<{ + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons?: number; + /** + * app usage in the team + */ + apps?: AppUsageDaily[]; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data?: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos?: number; + /** + * team identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of the team + * + * @example "ops" + */ + readonly name?: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner?: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space?: number; + }>; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data: number; + /** + * date of the usage + * + * @example "2019-01-01" + */ + readonly date: string; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos: number; + /** + * enterprise account identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * name of the enterprise account + * + * @example "example-co" + */ + readonly name: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space: number; +} +/** + * + * Usage for an app at a daily resolution. + */ +export interface AppUsageDaily { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons?: number; + /** + * unique name of app + * + * @example "example" + */ + app_name?: string; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data?: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos?: number; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner?: number; +} +export interface EnterpriseAccountDailyUsageInfoPayload { + /** + * range start date + * + * @example "2019-01-25" + */ + readonly start: string; + /** + * range end date + * + * @example "2019-02-25" + */ + readonly end?: string; +} +/** + * + * [Heroku Platform API - enterprise-account-member](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-member) + * Enterprise account members are users with access to an enterprise account. + */ +export interface EnterpriseAccountMember { + enterprise_account: EnterpriseAccountMemberEnterpriseAccount; + /** + * unique identifier of the member + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * enterprise account permissions + */ + permissions: Array<{ + /** + * + * @example "View enterprise account members and teams." + */ + description?: string; + /** + * permission in the enterprise account + * + * @example "view" + */ + readonly name?: 'view' | 'create' | 'manage' | 'billing'; + }>; + /** + * user information for the membership + */ + user: User; + /** + * whether the Enterprise Account member has two factor authentication enabled + * + * @example true + */ + readonly two_factor_authentication: boolean; + /** + * Identity Provider information the member is federated with + */ + identity_provider: null | EnterpriseAccountMemberIdentityProvider; +} +export interface EnterpriseAccountMemberEnterpriseAccount { + /** + * unique identifier of the enterprise account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of the enterprise account + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * Identity Provider information the member is federated with + */ +export interface EnterpriseAccountMemberIdentityProvider { + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of the identity provider + * + * @example "acme" + */ + readonly name?: string; + /** + * whether the identity_provider information is redacted or not + */ + readonly redacted?: boolean; + /** + * entity that owns this identity provider + */ + owner?: Owner; +} +export interface EnterpriseAccountMemberCreatePayload { + /** + * unique email address of account or unique identifier of an account + */ + user: string; + /** + * permissions for enterprise account + * + * @example ["view"] + */ + readonly permissions: 'view' | 'create' | 'manage' | Array<'billing'>; + /** + * whether membership is being created as part of SSO JIT + */ + federated?: boolean; +} +export interface EnterpriseAccountMemberUpdatePayload { + /** + * permissions for enterprise account + * + * @example ["view"] + */ + readonly permissions: 'view' | 'create' | 'manage' | Array<'billing'>; +} +/** + * + * [Heroku Platform API - enterprise-account-monthly-usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-monthly-usage) + * Usage for an enterprise account at a monthly resolution. + */ +export interface EnterpriseAccountMonthlyUsage { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons: number; + /** + * usage by team + */ + teams: Array<{ + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons?: number; + /** + * app usage in the team + */ + apps?: AppUsageMonthly[]; + /** + * average connect rows synced + * + * @example 15000 + */ + readonly connect?: number; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data?: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos?: number; + /** + * team identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of the team + * + * @example "ops" + */ + readonly name?: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner?: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space?: number; + }>; + /** + * average connect rows synced + * + * @example 15000 + */ + readonly connect: number; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos: number; + /** + * enterprise account identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * year and month of the usage + * + * @example "2019-01" + */ + readonly month: string; + /** + * name of the enterprise account + * + * @example "example-co" + */ + readonly name: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space: number; +} +/** + * + * Usage for an app at a monthly resolution. + */ +export interface AppUsageMonthly { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons?: number; + /** + * unique name of app + * + * @example "example" + */ + app_name?: string; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data?: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos?: number; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner?: number; +} +export interface EnterpriseAccountMonthlyUsageInfoPayload { + /** + * range start date + * + * @example "2019-01" + */ + readonly start: string; + /** + * range end date + * + * @example "2019-02" + */ + readonly end?: string; +} +/** + * + * Identity Provider associated with the Enterprise Account + */ +export interface EnterpriseAccountIdentityProvider { + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * user-friendly unique identifier for this identity provider + * + * @example "acme-sso" + */ + name: string; + /** + * entity that owns this identity provider + */ + owner: Owner; +} +export interface EnterpriseAccountUpdatePayload { + /** + * unique name of the enterprise account + * + * @example "example" + */ + readonly name?: string; +} +export interface Filter { + in?: In; +} +export interface In { + id?: string[]; +} +/** + * + * [Heroku Platform API - team-app](https://devcenter.heroku.com/articles/platform-api-reference#team-app) + * A team app encapsulates the team specific functionality of Heroku apps. + */ +export interface TeamApp { + /** + * when app was archived + * + * @example "2012-01-01T12:00:00Z" + */ + readonly archived_at?: null | string; + /** + * description from buildpack of app + * + * @example "Ruby/Rack" + */ + readonly buildpack_provided_description?: null | string; + /** + * identity of the stack that will be used for new builds + */ + build_stack?: BuildStack; + /** + * when app was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * git repo URL of app + * + * @example "https://git.heroku.com/example.git" + */ + readonly git_url?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * describes whether a Private Spaces app is externally routable or not + */ + internal_routing?: boolean | null; + /** + * is the current member a collaborator on this app. + */ + joined?: boolean; + /** + * are other team members forbidden from joining this app. + */ + locked?: boolean; + /** + * maintenance status of app + */ + maintenance?: boolean; + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * team that owns this app + */ + team?: null | Team; + /** + * identity of app owner + */ + owner?: null | TeamAppOwner; + /** + * identity of app region + */ + region?: TeamAppRegion; + /** + * when app was released + * + * @example "2012-01-01T12:00:00Z" + */ + readonly released_at?: null | string; + /** + * git repo size in bytes of app + */ + readonly repo_size?: number | null; + /** + * slug size in bytes of app + */ + readonly slug_size?: number | null; + /** + * identity of space + */ + space?: null | TeamAppSpace; + /** + * identity of app stack + */ + stack?: Stack; + /** + * when app was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; + /** + * web URL of app + * + * @example "https://example.herokuapp.com/" + */ + readonly web_url?: null | string; +} +/** + * + * identity of app owner + */ +export interface TeamAppOwner { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email?: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * identity of app region + */ +export interface TeamAppRegion { + /** + * unique identifier of region + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of region + * + * @example "us" + */ + readonly name?: string; +} +/** + * + * [Heroku Platform API - space](https://devcenter.heroku.com/articles/platform-api-reference#space) + * identity of space + */ +export interface TeamAppSpace { + /** + * unique identifier of space + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of space + * + * @example "nasa" + */ + name?: string; +} +/** + * + * [Heroku Platform API - formation](https://devcenter.heroku.com/articles/platform-api-reference#formation) + * The formation of processes that should be maintained for an app. Update the formation to scale processes or change dyno sizes. Available process type names and commands are defined by the `process_types` attribute for the [slug](#slug) currently released on an app. + */ +export interface Formation { + /** + * app formation belongs to + */ + app: FormationApp; + /** + * command to use to launch this process + * + * @example "bundle exec rails server -p $PORT" + */ + command: string; + /** + * when process type was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this process type + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * number of processes to maintain + * + * @example 1 + */ + quantity: number; + /** + * dyno size + * + * @example "standard-1X" + */ + size: string; + /** + * type of process to maintain + * + * @example "web" + */ + readonly type: string; + /** + * when dyno type was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app formation belongs to + */ +export interface FormationApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface FormationBatchUpdatePayload { + /** + * Array with formation updates. Each element must have "type", the id or name of the process type to be updated, and can optionally update its "quantity" or "size". + */ + updates: FormationBatchUpdatePayloadUpdate[]; +} +/** + * + * Properties to update a process type + */ +export interface FormationBatchUpdatePayloadUpdate { + /** + * number of processes to maintain + * + * @example 1 + */ + quantity?: number; + /** + * dyno size + * + * @example "standard-1X" + */ + size?: string; + /** + * type of process to maintain + * + * @example "web" + */ + readonly type: string; +} +export interface FormationUpdatePayload { + /** + * number of processes to maintain + * + * @example 1 + */ + quantity?: number; + /** + * dyno size + * + * @example "standard-1X" + */ + size?: string; +} +export interface IdentityProviderCreateByTeamPayload { + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate: string; + /** + * URL identifier provided by the identity provider + * + * @example "https://customer-domain.idp.com" + */ + entity_id: string; + /** + * single log out URL for this identity provider + * + * @example "https://example.com/idp/logout" + */ + slo_target_url?: string; + /** + * single sign on URL for this identity provider + * + * @example "https://example.com/idp/login" + */ + sso_target_url: string; +} +export interface IdentityProviderUpdateByTeamPayload { + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate?: string; + /** + * URL identifier provided by the identity provider + * + * @example "https://customer-domain.idp.com" + */ + entity_id?: string; + /** + * single log out URL for this identity provider + * + * @example "https://example.com/idp/logout" + */ + slo_target_url?: string; + /** + * single sign on URL for this identity provider + * + * @example "https://example.com/idp/login" + */ + sso_target_url?: string; +} +/** + * + * [Heroku Platform API - inbound-ruleset](https://devcenter.heroku.com/articles/platform-api-reference#inbound-ruleset) + * An inbound-ruleset is a collection of rules that specify what hosts can or cannot connect to an application. + */ +export interface InboundRuleset { + /** + * unique identifier of an inbound-ruleset + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * identity of space + */ + space: InboundRulesetSpace; + /** + * when inbound-ruleset was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + rules: Rule[]; + /** + * unique email address of account + * + * @example "username@example.com" + */ + created_by: string; +} +/** + * + * [Heroku Platform API - space](https://devcenter.heroku.com/articles/platform-api-reference#space) + * identity of space + */ +export interface InboundRulesetSpace { + /** + * unique identifier of space + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of space + * + * @example "nasa" + */ + name?: string; +} +/** + * + * the combination of an IP address in CIDR notation and whether to allow or deny it's traffic. + */ +export interface Rule { + /** + * states whether the connection is allowed or denied + * + * @example "allow" + */ + action: 'allow' | 'deny'; + /** + * is the request’s source in CIDR notation + * + * @example "1.1.1.1/1" + */ + source: string; +} +export interface InboundRulesetCreatePayload { + rules?: Rule[]; +} +/** + * + * [Heroku Platform API - invoice-address](https://devcenter.heroku.com/articles/platform-api-reference#invoice-address) + * An invoice address represents the address that should be listed on an invoice. + */ +export interface InvoiceAddress { + /** + * invoice street address line 1 + * + * @example "40 Hickory Blvd." + */ + address_1?: string; + /** + * invoice street address line 2 + * + * @example "Suite 300" + */ + address_2?: string; + /** + * invoice city + * + * @example "Seattle" + */ + city?: string; + /** + * country + * + * @example "US" + */ + country?: string; + /** + * heroku_id identifier reference + */ + heroku_id?: string; + /** + * metadata / additional information to go on invoice + * + * @example "Company ABC Inc. VAT 903820" + */ + other?: string; + /** + * invoice zip code + * + * @example "98101" + */ + postal_code?: string; + /** + * invoice state + * + * @example "WA" + */ + state?: string; + /** + * flag to use the invoice address for an account or not + * + * @example true + */ + use_invoice_address?: boolean; +} +export interface InvoiceAddressUpdatePayload { + /** + * invoice street address line 1 + * + * @example "40 Hickory Blvd." + */ + address_1?: string; + /** + * invoice street address line 2 + * + * @example "Suite 300" + */ + address_2?: string; + /** + * invoice city + * + * @example "Seattle" + */ + city?: string; + /** + * country + * + * @example "US" + */ + country?: string; + /** + * metadata / additional information to go on invoice + * + * @example "Company ABC Inc. VAT 903820" + */ + other?: string; + /** + * invoice zip code + * + * @example "98101" + */ + postal_code?: string; + /** + * invoice state + * + * @example "WA" + */ + state?: string; + /** + * flag to use the invoice address for an account or not + * + * @example true + */ + use_invoice_address?: boolean; +} +/** + * + * [Heroku Platform API - invoice](https://devcenter.heroku.com/articles/platform-api-reference#invoice) + * An invoice is an itemized bill of goods for an account which includes pricing and charges. + */ +export interface Invoice { + /** + * total charges on this invoice + * + * @example 100 + */ + readonly charges_total: number; + /** + * when invoice was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * total credits on this invoice + * + * @example 100 + */ + readonly credits_total: number; + /** + * unique identifier of this invoice + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * human readable invoice number + * + * @example 9403943 + */ + readonly number: number; + /** + * the ending date that the invoice covers + * + * @example "01/31/2014" + */ + readonly period_end: string; + /** + * the starting date that this invoice covers + * + * @example "01/01/2014" + */ + readonly period_start: string; + /** + * payment status for this invoice (pending, successful, failed) + * + * @example 1 + */ + readonly state: number; + /** + * combined total of charges and credits on this invoice + * + * @example 100 + */ + readonly total: number; + /** + * when invoice was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - key](https://devcenter.heroku.com/articles/platform-api-reference#key) + * Keys represent public SSH keys associated with an account and are used to authorize accounts as they are performing git operations. + */ +export interface Key { + /** + * comment on the key + * + * @example "username@host" + */ + readonly comment: string; + /** + * when key was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * deprecated. Please refer to 'comment' instead + * + * @example "username@host" + */ + readonly email: string; + /** + * a unique identifying string based on contents + * + * @example "17:63:a4:ba:24:d3:7f:af:17:c8:94:82:7e:80:56:bf" + */ + readonly fingerprint: string; + /** + * unique identifier of this key + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * full public_key as uploaded + * + * @example "ssh-rsa AAAAB3NzaC1ycVc/../839Uv username@example.com" + */ + readonly public_key: string; + /** + * when key was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - log-drain](https://devcenter.heroku.com/articles/platform-api-reference#log-drain) + * [Log drains](https://devcenter.heroku.com/articles/log-drains) provide a way to forward your Heroku logs to an external syslog server for long-term archiving. This external service must be configured to receive syslog packets from Heroku, whereupon its URL can be added to an app using this API. Some add-ons will add a log drain when they are provisioned to an app. These drains can only be removed by removing the add-on. + */ +export interface LogDrain { + /** + * add-on that created the drain + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef","name":"singing-swiftly-1242","app":{"id":"01234567-89ab-cdef-0123-456789abcdef","name":"example"}} + */ + readonly addon: Addon | null; + /** + * application that is attached to this drain + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef","name":"example"} + */ + readonly app: LogDrainApp | null; + /** + * when log drain was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this log drain + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * token associated with the log drain + * + * @example "d.01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token: string; + /** + * when log drain was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * url associated with the log drain + * + * @example "https://example.com/drain" + */ + readonly url: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * application that is attached to this drain + */ +export interface LogDrainApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of app + * + * @example "example" + */ + name: string; +} +export interface LogDrainCreatePayload { + /** + * url associated with the log drain + * + * @example "https://example.com/drain" + */ + readonly url: string; +} +export interface LogDrainUpdatePayload { + /** + * url associated with the log drain + * + * @example "https://example.com/drain" + */ + readonly url: string; +} +/** + * + * [Heroku Platform API - log-session](https://devcenter.heroku.com/articles/platform-api-reference#log-session) + * A log session is a reference to the http based log stream for an app. + */ +export interface LogSession { + /** + * when log connection was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this log session + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * URL for log streaming session + * + * @example "https://logplex.heroku.com/sessions/01234567-89ab-cdef-0123-456789abcdef?srv=1325419200" + */ + readonly logplex_url: string; + /** + * when log session was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +export interface LogSessionCreatePayload { + /** + * dyno to limit results to + * + * @example "web.1" + */ + dyno?: string; + /** + * number of log lines to stream at once + * + * @example 10 + */ + lines?: number; + /** + * log source to limit results to + * + * @example "app" + */ + source?: string; + /** + * whether to stream ongoing logs + * + * @example true + */ + tail?: boolean; +} +/** + * + * [Heroku Platform API - oauth-authorization](https://devcenter.heroku.com/articles/platform-api-reference#oauth-authorization) + * OAuth authorizations represent clients that a Heroku user has authorized to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export interface OauthAuthorization { + /** + * access token for this authorization + */ + access_token: null | AccessToken; + /** + * identifier of the client that obtained this authorization, if any + */ + client: null | Client; + /** + * when OAuth authorization was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * this authorization's grant + */ + grant: null | Grant; + /** + * unique identifier of OAuth authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * refresh token for this authorization + */ + refresh_token: null | RefreshToken; + /** + * The scope of access OAuth authorization allows + * + * @example ["global"] + */ + readonly scope: string[]; + /** + * when OAuth authorization was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * authenticated user associated with this authorization + */ + user: OauthAuthorizationUser; +} +/** + * + * access token for this authorization + */ +export interface AccessToken { + /** + * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime + * + * @example 2592000 + */ + readonly expires_in?: null | number; + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * contents of the token to be used for authorization + * + * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token?: string; +} +/** + * + * identifier of the client that obtained this authorization, if any + */ +export interface Client { + /** + * unique identifier of this OAuth client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * OAuth client name + * + * @example "example" + */ + readonly name?: string; + /** + * endpoint for redirection after authorization with OAuth client + * + * @example "https://example.com/auth/heroku/callback" + */ + readonly redirect_uri?: string; +} +/** + * + * this authorization's grant + */ +export interface Grant { + /** + * grant code received from OAuth web application authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly code: string; + /** + * seconds until OAuth grant expires + * + * @example 2592000 + */ + readonly expires_in: number; + /** + * unique identifier of OAuth grant + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * refresh token for this authorization + */ +export interface RefreshToken { + /** + * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime + * + * @example 2592000 + */ + readonly expires_in: null | number; + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * contents of the token to be used for authorization + * + * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token: string; +} +/** + * + * authenticated user associated with this authorization + */ +export interface OauthAuthorizationUser { + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + full_name: string | null; +} +export interface OauthAuthorizationCreatePayload { + /** + * unique identifier of this OAuth client + */ + client?: string; + /** + * human-friendly description of this OAuth authorization + * + * @example "sample authorization" + */ + readonly description?: string; + /** + * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime + * + * @example 2592000 + */ + readonly expires_in?: null | number; + /** + * The scope of access OAuth authorization allows + * + * @example ["global"] + */ + readonly scope: string[]; +} +/** + * + * [Heroku Platform API - oauth-client](https://devcenter.heroku.com/articles/platform-api-reference#oauth-client) + * OAuth clients are applications that Heroku users can authorize to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth). + */ +export interface OauthClient { + /** + * when OAuth client was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this OAuth client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * whether the client is still operable given a delinquent account + */ + readonly ignores_delinquent: boolean | null; + /** + * OAuth client name + * + * @example "example" + */ + readonly name: string; + /** + * endpoint for redirection after authorization with OAuth client + * + * @example "https://example.com/auth/heroku/callback" + */ + readonly redirect_uri: string; + /** + * secret used to obtain OAuth authorizations under this client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly secret: string; + /** + * when OAuth client was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +export interface OauthClientCreatePayload { + /** + * OAuth client name + * + * @example "example" + */ + readonly name: string; + /** + * endpoint for redirection after authorization with OAuth client + * + * @example "https://example.com/auth/heroku/callback" + */ + readonly redirect_uri: string; +} +export interface OauthClientUpdatePayload { + /** + * OAuth client name + * + * @example "example" + */ + readonly name?: string; + /** + * endpoint for redirection after authorization with OAuth client + * + * @example "https://example.com/auth/heroku/callback" + */ + readonly redirect_uri?: string; +} +/** + * + * [Heroku Platform API - oauth-grant](https://devcenter.heroku.com/articles/platform-api-reference#oauth-grant) + * OAuth grants are used to obtain authorizations on behalf of a user. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export interface OauthGrant { +} +/** + * + * [Heroku Platform API - oauth-token](https://devcenter.heroku.com/articles/platform-api-reference#oauth-token) + * OAuth tokens provide access for authorized clients to act on behalf of a Heroku user to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export interface OauthToken { + /** + * current access token + */ + access_token: AccessToken; + /** + * authorization for this set of tokens + */ + authorization: Authorization; + /** + * OAuth client secret used to obtain token + */ + client: null | OauthTokenClient; + /** + * when OAuth token was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * grant used on the underlying authorization + */ + grant: OauthTokenGrant; + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * refresh token for this authorization + */ + refresh_token: RefreshToken; + /** + * OAuth session using this token + */ + session: Session; + /** + * when OAuth token was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * Reference to the user associated with this token + */ + user: OauthTokenUser; +} +/** + * + * authorization for this set of tokens + */ +export interface Authorization { + /** + * unique identifier of OAuth authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * OAuth client secret used to obtain token + */ +export interface OauthTokenClient { + /** + * secret used to obtain OAuth authorizations under this client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly secret: string; +} +/** + * + * grant used on the underlying authorization + */ +export interface OauthTokenGrant { + /** + * grant code received from OAuth web application authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly code: string; + /** + * type of grant requested, one of `authorization_code` or `refresh_token` + * + * @example "authorization_code" + */ + type: string; +} +/** + * + * OAuth session using this token + */ +export interface Session { + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * Reference to the user associated with this token + */ +export interface OauthTokenUser { + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +export interface OauthTokenCreatePayload { + client: OauthTokenCreatePayloadClient; + grant: OauthTokenCreatePayloadGrant; + refresh_token: OauthTokenCreatePayloadRefreshToken; +} +export interface OauthTokenCreatePayloadClient { + /** + * secret used to obtain OAuth authorizations under this client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly secret?: string; +} +export interface OauthTokenCreatePayloadGrant { + /** + * grant code received from OAuth web application authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly code?: string; + /** + * type of grant requested, one of `authorization_code` or `refresh_token` + * + * @example "authorization_code" + */ + type?: string; +} +export interface OauthTokenCreatePayloadRefreshToken { + /** + * contents of the token to be used for authorization + * + * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token?: string; +} +/** + * + * [Heroku Platform API - password-reset](https://devcenter.heroku.com/articles/platform-api-reference#password-reset) + * A password reset represents a in-process password reset attempt. + */ +export interface PasswordReset { + /** + * when password reset was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + user: User; +} +export interface PasswordResetResetPasswordPayload { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; +} +export interface PasswordResetCompleteResetPasswordPayload { + /** + * current password on the account + * + * @example "currentpassword" + */ + readonly password: string; + /** + * confirmation of the new password + * + * @example "newpassword" + */ + readonly password_confirmation: string; +} +/** + * + * [Heroku Platform API - peering-info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) + * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. + */ +export interface PeeringInfo { + /** + * The AWS account ID of your Private Space. + * + * @example "123456789012" + */ + readonly aws_account_id: string; + /** + * region name used by provider + * + * @example "us-east-1" + */ + readonly aws_region: 'ap-south-1' | 'eu-west-1' | 'ap-southeast-1' | 'ap-southeast-2' | 'eu-central-1' | 'eu-west-2' | 'ap-northeast-2' | 'ap-northeast-1' | 'us-east-1' | 'sa-east-1' | 'us-west-1' | 'us-west-2' | 'ca-central-1'; + /** + * The AWS VPC ID of the peer. + * + * @example "vpc-1234567890" + */ + readonly vpc_id: string; + /** + * An IP address and the number of significant bits that make up the routing or networking portion. + * + * @example "10.0.0.0/16" + */ + vpc_cidr: string; + /** + * The CIDR ranges that should be routed to the Private Space VPC. + */ + dyno_cidr_blocks: string[]; + /** + * The CIDR ranges that you must not conflict with. + */ + unavailable_cidr_blocks: string[]; + /** + * The CIDR ranges that should be routed to the Private Space VPC. + */ + space_cidr_blocks: string[]; +} +/** + * + * [Heroku Platform API - peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) + * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + */ +export interface Peering { + /** + * The type of peering connection. + * + * @example "heroku-managed" + */ + type: 'heroku-managed' | 'customer-managed' | 'unknown'; + /** + * The AWS VPC Peering Connection ID of the peering. + * + * @example "pcx-123456789012" + */ + readonly pcx_id: string; + /** + * The CIDR blocks of the peer. + */ + cidr_blocks: string[]; + /** + * The status of the peering connection. + * + * @example "pending-acceptance" + */ + readonly status: 'initiating-request' | 'pending-acceptance' | 'provisioning' | 'active' | 'failed' | 'expired' | 'rejected' | 'deleted'; + /** + * The AWS VPC ID of the peer. + * + * @example "vpc-1234567890" + */ + readonly aws_vpc_id: string; + /** + * The AWS region of the peer connection. + * + * @example "us-east-1" + */ + readonly aws_region: string; + /** + * The AWS account ID of your Private Space. + * + * @example "123456789012" + */ + readonly aws_account_id: string; + /** + * When a peering connection will expire. + * + * @example "2020-01-01T12:00:00Z" + */ + readonly expires: string; +} +/** + * + * [Heroku Platform API - permission-entity](https://devcenter.heroku.com/articles/platform-api-reference#permission-entity) + * An owned entity including users' permissions. + */ +export interface PermissionEntity { + /** + * ID of the entity. + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * Name of the entity. + * + * @example "polar-lake-12345" + */ + readonly name: string; + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly team_id: string; + /** + * The type of object the entity is referring to. + * + * @example "app" + */ + readonly type: 'app' | 'space'; + /** + * Users that have access to the entity. + */ + users: Array<{ + /** + * unique email address of account + * + * @example "username@example.com" + */ + email?: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * enterprise account permissions + */ + permissions?: string[]; + }>; +} +/** + * + * [Heroku Platform API - pipeline-coupling](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-coupling) + * Information about an app's coupling to a pipeline + */ +export interface PipelineCoupling { + /** + * app involved in the pipeline coupling + */ + app?: PipelineCouplingApp; + /** + * when pipeline coupling was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of pipeline coupling + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * pipeline involved in the coupling + */ + pipeline?: Pipeline; + /** + * target pipeline stage + * + * @example "production" + */ + stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; + /** + * when pipeline coupling was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app involved in the pipeline coupling + */ +export interface PipelineCouplingApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * A pipeline allows grouping of apps into different stages. + */ +export interface Pipeline { + /** + * when pipeline was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of pipeline + * + * @example "example" + */ + name?: string; + /** + * Owner of a pipeline. + */ + owner?: PipelineOwner | null; + /** + * when pipeline was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; +} +export interface PipelineCouplingCreatePayload { + /** + * unique identifier of app or unique name of app + */ + app: string; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly pipeline: string; + /** + * target pipeline stage + * + * @example "production" + */ + stage: 'test' | 'review' | 'development' | 'staging' | 'production'; +} +export interface PipelineCouplingUpdatePayload { + /** + * target pipeline stage + * + * @example "production" + */ + stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app involved in the release + */ +export interface ReleaseApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - pipeline-promotion-target](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion-target) + * Promotion targets represent an individual app being promoted to + */ +export interface PipelinePromotionTarget { + /** + * the app which was promoted to + */ + app: PipelinePromotionTargetApp; + /** + * an error message for why the promotion failed + * + * @example "User does not have access to that app" + */ + error_message: null | string; + /** + * unique identifier of promotion target + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * the promotion which the target belongs to + */ + pipeline_promotion: PipelinePromotion; + /** + * the release which was created on the target app + */ + release: PipelinePromotionTargetRelease | null; + /** + * status of promotion + * + * @example "pending" + */ + readonly status: 'pending' | 'succeeded' | 'failed'; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * the app which was promoted to + */ +export interface PipelinePromotionTargetApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - pipeline-promotion](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion) + * Promotions allow you to move code from an app in a pipeline to all targets + */ +export interface PipelinePromotion { + /** + * when promotion was created + * + * @example "2012-01-01T12:00:00Z" + */ + created_at: string; + /** + * unique identifier of promotion + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * the pipeline which the promotion belongs to + */ + pipeline: Pipeline; + /** + * the app being promoted from + */ + source: Source; + /** + * status of promotion + * + * @example "pending" + */ + readonly status: 'pending' | 'completed'; + /** + * when promotion was updated + * + * @example "2012-01-01T12:00:00Z" + */ + updated_at: string | null; +} +/** + * + * [Heroku Platform API - release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * the release which was created on the target app + */ +export interface PipelinePromotionTargetRelease { + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - source](https://devcenter.heroku.com/articles/platform-api-reference#source) + * A source is a location for uploading and downloading an application's source code. + */ +export interface Source { + /** + * pointer to the URL where clients can fetch or store the source + */ + source_blob: SourceSourceBlob; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * the app which was promoted from + */ +export interface SourceApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * the release used to promoted from + */ +export interface SourceRelease { + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface PipelinePromotionCreatePayload { + /** + * pipeline involved in the promotion + */ + pipeline: Pipeline; + /** + * the app being promoted from + */ + source: PipelinePromotionCreatePayloadSource; + targets: Array<{ + /** + * the app is being promoted to + */ + app?: PipelinePromotionCreatePayloadApp; + }>; +} +/** + * + * [Heroku Platform API - source](https://devcenter.heroku.com/articles/platform-api-reference#source) + * the app being promoted from + */ +export interface PipelinePromotionCreatePayloadSource { + /** + * the app which was promoted from + */ + app?: PipelinePromotionCreatePayloadSourceApp; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * the app which was promoted from + */ +export interface PipelinePromotionCreatePayloadSourceApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * the app is being promoted to + */ +export interface PipelinePromotionCreatePayloadApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - pipeline-stack](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-stack) + * A pipeline's stack is determined by the apps in the pipeline. This is used during creation of CI and Review Apps that have no stack defined in app.json + */ +export interface PipelineStack { + /** + * identity of the stack that will be used for new builds without a stack defined in CI and Review Apps + */ + stack?: Stack | null; +} +/** + * + * [Heroku Platform API - pipeline-transfer](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-transfer) + * A pipeline transfer is the process of changing pipeline ownership along with the contained apps. + */ +export interface PipelineTransfer { + /** + * pipeline being transferred + */ + pipeline?: Pipeline; + /** + * Previous owner of the pipeline. + */ + previous_owner?: Record; + /** + * New owner of the pipeline. + */ + new_owner?: Record; +} +export interface PipelineTransferCreatePayload { + /** + * The pipeline to transfer + */ + pipeline: Pipeline; + /** + * New pipeline owner + */ + new_owner: NewOwner; +} +/** + * + * New pipeline owner + */ +export interface NewOwner { + /** + * unique identifier of a pipeline owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + id?: string; + /** + * type of pipeline owner + * + * @example "team" + */ + type?: string; +} +/** + * + * Owner of a pipeline. + */ +export interface PipelineOwner { + /** + * unique identifier of a pipeline owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + id: string; + /** + * type of pipeline owner + * + * @example "team" + */ + type: string; +} +export interface PipelineCreatePayload { + /** + * name of pipeline + * + * @example "example" + */ + name: string; + /** + * Owner of a pipeline. + */ + owner?: PipelineCreatePayloadOwner | null; +} +/** + * + * Owner of a pipeline. + */ +export interface PipelineCreatePayloadOwner { + /** + * unique identifier of a pipeline owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + id: string; + /** + * type of pipeline owner + * + * @example "team" + */ + type: string; +} +export interface PipelineUpdatePayload { + /** + * name of pipeline + * + * @example "example" + */ + name?: string; +} +/** + * + * [Heroku Platform API - rate-limit](https://devcenter.heroku.com/articles/platform-api-reference#rate-limit) + * Rate Limit represents the number of request tokens each account holds. Requests to this endpoint do not count towards the rate limit. + */ +export interface RateLimit { + /** + * allowed requests remaining in current interval + * + * @example 2399 + */ + readonly remaining: number; +} +export interface ReleaseCreatePayload { + /** + * description of changes in this release + * + * @example "Added new feature" + */ + readonly description?: string; + /** + * unique identifier of slug + */ + slug: string; +} +export interface ReleaseRollbackPayload { + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly release: string; +} +/** + * + * [Heroku Platform API - review-app](https://devcenter.heroku.com/articles/platform-api-reference#review-app) + * An ephemeral app to review a set of changes + */ +export interface ReviewApp { + /** + * the Heroku app associated to this review app + */ + app: null | ReviewAppApp; + /** + * the app setup for this review app + */ + app_setup: null | ReviewAppAppSetup; + /** + * the branch of the repository which the review app is based on + */ + readonly branch: string; + /** + * when test run was created + */ + readonly created_at: string; + /** + * unique identifier of the review app + */ + readonly id: string; + /** + * the pipeline which this review app belongs to + */ + pipeline: ReviewAppPipeline; + /** + * current state of the review app + */ + readonly status: 'pending' | 'creating' | 'created' | 'deleting' | 'deleted' | 'errored'; + /** + * when review app was updated + */ + readonly updated_at: string; + /** + * The user who created the review app + */ + readonly creator: Record; + /** + * wait for ci before building the app + * + * @example true + */ + readonly wait_for_ci: boolean; + /** + * error message from creating the review app if any + */ + readonly error_status: string | null; + /** + * message from creating the review app if any + */ + readonly message: string | null; + fork_repo: ForkRepo | null; + /** + * pull request number the review app is built for + * + * @example 24 + */ + readonly pr_number: number | null; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * the Heroku app associated to this review app + */ +export interface ReviewAppApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * the app setup for this review app + */ +export interface ReviewAppAppSetup { + /** + * unique identifier of app setup + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * the pipeline which this review app belongs to + */ +export interface ReviewAppPipeline { + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface ForkRepo { + /** + * repository id of the fork the branch resides in + * + * @example "123456" + */ + readonly id: number | null; +} +export interface ReviewAppCreatePayload { + /** + * the branch of the repository which the review app is based on + */ + readonly branch: string; + /** + * pull request number the review app is built for + * + * @example 24 + */ + readonly pr_number?: number | null; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly pipeline: string; + /** + * The download location for the review app's source code + */ + source_blob: ReviewAppCreatePayloadSourceBlob; + /** + * hash of config vars + * + * @example {"FOO":"bar","BAZ":"qux"} + */ + environment?: Record | null; + /** + * repository id of the fork the branch resides in + * + * @example "123456" + */ + readonly fork_repo_id?: number | null; +} +/** + * + * The download location for the review app's source code + */ +export interface ReviewAppCreatePayloadSourceBlob { + /** + * URL where gzipped tar archive of source code for build was downloaded. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly url: string; + /** + * The version number (or SHA) of the code to build. + * + * @example "v1.2.0" + */ + version: string | null; +} +/** + * + * [Heroku Platform API - review-app-config](https://devcenter.heroku.com/articles/platform-api-reference#review-app-config) + * Review apps can be configured for pipelines. + */ +export interface ReviewAppConfig { + repo?: Repo; + /** + * enable automatic review apps for pull requests + * + * @example true + */ + readonly automatic_review_apps?: boolean; + /** + * the deploy target for the review apps of a pipeline + */ + deploy_target?: DeployTarget | null; + /** + * automatically destroy review apps when they haven't been deployed for a number of days + * + * @example true + */ + readonly destroy_stale_apps?: boolean; + /** + * number of days without a deployment after which to consider a review app stale + * + * @example "5" + */ + readonly stale_days?: number; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly pipeline_id?: string; + /** + * If true, review apps are created only when CI passes + * + * @example true + */ + readonly wait_for_ci?: boolean; + /** + * A unique prefix that will be used to create review app names + * + * @example "singular-app" + */ + readonly base_name?: null | string; +} +export interface Repo { + /** + * repository id + * + * @example "123456" + */ + readonly id: number; +} +/** + * + * the deploy target for the review apps of a pipeline + */ +export interface DeployTarget { + /** + * unique identifier of deploy target + * + * @example "us" + */ + readonly id: string; + /** + * type of deploy target + * + * @example "region" + */ + readonly type: string; +} +export interface ReviewAppConfigEnablePayload { + /** + * repository name + * + * @example "heroku/homebrew-brew" + */ + readonly repo: string; + /** + * enable automatic review apps for pull requests + * + * @example true + */ + readonly automatic_review_apps?: boolean; + /** + * automatically destroy review apps when they haven't been deployed for a number of days + * + * @example true + */ + readonly destroy_stale_apps?: boolean; + /** + * number of days without a deployment after which to consider a review app stale + * + * @example "5" + */ + readonly stale_days?: number; + /** + * the deploy target for the review apps of a pipeline + */ + deploy_target?: DeployTarget | null; + /** + * If true, review apps are created only when CI passes + * + * @example true + */ + readonly wait_for_ci?: boolean; + /** + * A unique prefix that will be used to create review app names + * + * @example "singular-app" + */ + readonly base_name?: null | string; +} +export interface ReviewAppConfigUpdatePayload { + /** + * enable automatic review apps for pull requests + * + * @example true + */ + readonly automatic_review_apps?: boolean; + /** + * automatically destroy review apps when they haven't been deployed for a number of days + * + * @example true + */ + readonly destroy_stale_apps?: boolean; + /** + * number of days without a deployment after which to consider a review app stale + * + * @example "5" + */ + readonly stale_days?: number; + /** + * the deploy target for the review apps of a pipeline + */ + deploy_target?: DeployTarget | null; + /** + * If true, review apps are created only when CI passes + * + * @example true + */ + readonly wait_for_ci?: boolean; + /** + * A unique prefix that will be used to create review app names + * + * @example "singular-app" + */ + readonly base_name?: null | string; +} +/** + * + * pointer to the url where clients can fetch or store the actual release binary + */ +export interface Blob { + /** + * method to be used to interact with the slug blob + * + * @example "GET" + */ + readonly method: string; + /** + * URL to interact with the slug blob + * + * @example "https://api.heroku.com/slugs/1234.tgz" + */ + readonly url: string; +} +export interface SlugCreatePayload { + /** + * description from buildpack of slug + * + * @example "Ruby/Rack" + */ + buildpack_provided_description?: null | string; + /** + * an optional checksum of the slug for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum?: null | string; + /** + * identification of the code with your version control system (eg: SHA of the git HEAD) + * + * @example "60883d9e8947a57e04dc9124f25df004866a2051" + */ + commit?: null | string; + /** + * an optional description of the provided commit + * + * @example "fixed a bug with API documentation" + */ + commit_description?: null | string; + /** + * hash mapping process type names to their respective command + * + * @example {"web":"./bin/web -p $PORT"} + */ + process_types: Record; + /** + * unique name of stack or unique identifier of stack + */ + stack?: string; +} +/** + * + * [Heroku Platform API - sms-number](https://devcenter.heroku.com/articles/platform-api-reference#sms-number) + * SMS numbers are used for recovery on accounts with two-factor authentication enabled. + */ +export interface SmsNumber { + /** + * SMS number of account + * + * @example "+1 ***-***-1234" + */ + readonly sms_number: string | null; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * application that this SSL certificate is on + */ +export interface SniEndpointApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of app + * + * @example "example" + */ + name: string; +} +/** + * + * certificate provided by this endpoint + */ +export interface SslCert { + readonly 'ca_signed?'?: boolean; + readonly cert_domains?: unknown[]; + readonly expires_at?: string; + readonly issuer?: string; + readonly 'self_signed?'?: boolean; + readonly starts_at?: string; + readonly subject?: string; + /** + * unique identifier of this SSL certificate + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface SniEndpointCreatePayload { + /** + * raw contents of the public certificate chain (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate_chain: string; + /** + * contents of the private key (eg .key file) + * + * @example "-----BEGIN RSA PRIVATE KEY----- ..." + */ + private_key: string; +} +export interface SniEndpointUpdatePayload { + /** + * raw contents of the public certificate chain (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate_chain: string; + /** + * contents of the private key (eg .key file) + * + * @example "-----BEGIN RSA PRIVATE KEY----- ..." + */ + private_key: string; +} +/** + * + * pointer to the URL where clients can fetch or store the source + */ +export interface SourceSourceBlob { + /** + * URL to download the source + * + * @example "https://api.heroku.com/sources/1234.tgz" + */ + readonly get_url: string; + /** + * URL to upload the source + * + * @example "https://api.heroku.com/sources/1234.tgz" + */ + readonly put_url: string; +} +/** + * + * [Heroku Platform API - space-app-access](https://devcenter.heroku.com/articles/platform-api-reference#space-app-access) + * Space access represents the permissions a particular user has on a particular space. + */ +export interface SpaceAppAccess { + /** + * space user belongs to + */ + space?: SpaceAppAccessSpace; + /** + * when space was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of space + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * user space permissions + */ + permissions?: Array<{ + description?: string; + name?: string; + }>; + /** + * when space was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; + /** + * identity of user account + */ + user?: User; +} +/** + * + * [Heroku Platform API - space](https://devcenter.heroku.com/articles/platform-api-reference#space) + * space user belongs to + */ +export interface SpaceAppAccessSpace { + /** + * unique name of app + * + * @example "example" + */ + name: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +export interface SpaceAppAccessUpdatePayload { + permissions: Array<{ + name?: string; + }>; +} +/** + * + * [Heroku Platform API - space-nat](https://devcenter.heroku.com/articles/platform-api-reference#space-nat) + * Network address translation (NAT) for stable outbound IP addresses from a space + */ +export interface SpaceNat { + /** + * when network address translation for a space was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * potential IPs from which outbound network traffic will originate + */ + readonly sources: string[]; + /** + * availability of network address translation for a space + * + * @example "enabled" + */ + readonly state: 'disabled' | 'updating' | 'enabled'; + /** + * when network address translation for a space was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - space-topology](https://devcenter.heroku.com/articles/platform-api-reference#space-topology) + * Space Topology provides you with a mechanism for viewing all the running dynos, formations and applications for a space. This is the same data thats used to power our DNS Service Discovery. + */ +export interface SpaceTopology { + /** + * version of the space topology payload + * + * @example 1 + */ + readonly version: number; + /** + * The apps within this space + */ + readonly apps: Array<{ + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * + * @example ["example.com","example.net"] + */ + readonly domains?: unknown[]; + /** + * formations for application + */ + readonly formation?: SpaceTopologyFormation[]; + }>; +} +/** + * + * formations for application + */ +export interface SpaceTopologyFormation { + /** + * unique identifier of this process type + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * Name of process type + * + * @example "web" + */ + process_type?: string; + /** + * Current dynos for application + */ + dynos?: SpaceTopologyDyno[]; +} +/** + * + * A dyno + */ +export interface SpaceTopologyDyno { + /** + * unique identifier of this dyno + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * process number, e.g. 1 in web.1 + * + * @example 1 + */ + number?: number; + /** + * RFC1918 Address of Dyno + * + * @example "10.0.134.42" + */ + private_ip?: string; + /** + * localspace hostname of resource + * + * @example "1.example-app-90210.app.localspace" + */ + hostname?: string; +} +export interface SpaceTransferTransferPayload { + /** + * unique name of team + * + * @example "example" + */ + readonly new_owner: string; +} +/** + * + * [Heroku Platform API - team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * team that owns this space + */ +export interface SpaceTeam { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * [Heroku Platform API - region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * identity of space region + */ +export interface SpaceRegion { + /** + * unique identifier of region + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of region + * + * @example "us" + */ + readonly name: string; +} +export interface SpaceUpdatePayload { + /** + * unique name of space + * + * @example "nasa" + */ + name?: string; +} +export interface SpaceCreatePayload { + /** + * unique name of space + * + * @example "nasa" + */ + name: string; + /** + * unique name of team + * + * @example "example" + */ + readonly team: string; + /** + * unique identifier of region or unique name of region + */ + region?: string; + /** + * true if this space has shield enabled + * + * @example true + */ + readonly shield?: boolean; + /** + * The RFC-1918 CIDR the Private Space will use. It must be a /16 in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 + * + * @example "172.20.20.30/16" + */ + cidr?: string; + /** + * The RFC-1918 CIDR that the Private Space will use for the Heroku-managed peering connection that's automatically created when using Heroku Data add-ons. It must be between a /16 and a /20 + * + * @example "10.2.0.0/16" + */ + data_cidr?: string; + /** + * URL to which all apps will drain logs. Only settable during space creation and enables direct logging. Must use HTTPS. + * + * @example "https://example.com/logs" + */ + log_drain_url?: string; +} +/** + * + * [Heroku Platform API - team-app-collaborator](https://devcenter.heroku.com/articles/platform-api-reference#team-app-collaborator) + * A team collaborator represents an account that has been given access to a team app on Heroku. + */ +export interface TeamAppCollaborator { + /** + * app collaborator belongs to + */ + app?: TeamAppCollaboratorApp; + /** + * when collaborator was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of collaborator + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * array of permissions for the collaborator (only applicable if the app is on a team) + */ + permissions?: TeamAppPermission[]; + /** + * role in the team + * + * @example "admin" + */ + readonly role?: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; + /** + * when collaborator was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; + /** + * identity of collaborated account + */ + user?: TeamAppCollaboratorUser; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app collaborator belongs to + */ +export interface TeamAppCollaboratorApp { + /** + * unique name of app + * + * @example "example" + */ + name: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * identity of collaborated account + */ +export interface TeamAppCollaboratorUser { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated: boolean; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +export interface TeamAppCollaboratorCreatePayload { + /** + * An array of permissions to give to the collaborator. + */ + permissions?: string[]; + /** + * whether to suppress email invitation when creating collaborator + */ + silent?: boolean; + /** + * unique email address of account or unique identifier of an account or Implicit reference to currently authorized user + */ + user: string; +} +export interface TeamAppCollaboratorUpdatePayload { + /** + * An array of permissions to give to the collaborator. + */ + permissions: string[]; +} +export interface TeamAppCreatePayload { + /** + * are other team members forbidden from joining this app. + */ + locked?: boolean; + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique name of team + * + * @example "example" + */ + readonly team?: string; + /** + * force creation of the app in the user account even if a default team is set. + */ + personal?: boolean; + /** + * unique name of region + * + * @example "us" + */ + readonly region?: string; + /** + * unique name of space + * + * @example "nasa" + */ + space?: string; + /** + * unique name of stack + * + * @example "heroku-18" + */ + readonly stack?: string; + /** + * describes whether a Private Spaces app is externally routable or not + */ + internal_routing?: boolean | null; +} +export interface TeamAppUpdateLockedPayload { + /** + * are other team members forbidden from joining this app. + */ + locked: boolean; +} +export interface TeamAppTransferToAccountPayload { + /** + * unique email address of account or unique identifier of an account or Implicit reference to currently authorized user + */ + owner: string; +} +export interface TeamAppTransferToTeamPayload { + /** + * unique name of team + * + * @example "example" + */ + readonly owner: string; +} +/** + * + * [Heroku Platform API - team-daily-usage](https://devcenter.heroku.com/articles/platform-api-reference#team-daily-usage) + * Usage for an enterprise team at a daily resolution. + */ +export interface TeamDailyUsage { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons: number; + /** + * app usage in the team + */ + apps: AppUsageDaily[]; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data: number; + /** + * date of the usage + * + * @example "2019-01-01" + */ + readonly date: string; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos: number; + /** + * team identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * name of the team + * + * @example "ops" + */ + readonly name: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space: number; +} +export interface TeamDailyUsageInfoPayload { + /** + * range start date + * + * @example "2019-01-25" + */ + readonly start: string; + /** + * range end date + * + * @example "2019-02-25" + */ + readonly end?: string; +} +/** + * + * [Heroku Platform API - team-delinquency](https://devcenter.heroku.com/articles/platform-api-reference#team-delinquency) + * A Heroku team becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent teams if their invoices remain unpaid. + */ +export interface TeamDelinquency { + /** + * scheduled time of when we will suspend your team due to delinquency + * + * @example "2024-01-01T12:00:00Z" + */ + readonly scheduled_suspension_time: string | null; + /** + * scheduled time of when we will delete your team due to delinquency + * + * @example "2024-01-01T12:00:00Z" + */ + readonly scheduled_deletion_time: string | null; +} +/** + * + * [Heroku Platform API - team-feature](https://devcenter.heroku.com/articles/platform-api-reference#team-feature) + * A team feature represents a feature enabled on a team account. + */ +export interface TeamFeature { + /** + * when team feature was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of team feature + * + * @example "Causes account to example." + */ + readonly description: string; + /** + * documentation URL of team feature + * + * @example "http://devcenter.heroku.com/articles/example" + */ + readonly doc_url: string; + /** + * whether or not team feature has been enabled + * + * @example true + */ + enabled: boolean; + /** + * unique identifier of team feature + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of team feature + * + * @example "name" + */ + readonly name: string; + /** + * state of team feature + * + * @example "public" + */ + readonly state: string; + /** + * when team feature was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user readable feature name + * + * @example "My Feature" + */ + readonly display_name: string; + /** + * e-mail to send feedback about the feature + * + * @example "feedback@heroku.com" + */ + readonly feedback_email: string; +} +/** + * + * [Heroku Platform API - team-invitation](https://devcenter.heroku.com/articles/platform-api-reference#team-invitation) + * A team invitation represents an invite to a team. + */ +export interface TeamInvitation { + /** + * when invitation was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of an invitation + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + invited_by: InvitedBy; + team: TeamInvitationTeam; + /** + * role in the team + * + * @example "admin" + */ + readonly role: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; + /** + * when invitation was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + user: TeamInvitationUser; +} +export interface InvitedBy { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name: string | null; +} +export interface TeamInvitationTeam { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; +} +export interface TeamInvitationUser { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name: string | null; +} +export interface TeamInvitationCreatePayload { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * role in the team + * + * @example "admin" + */ + readonly role: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; +} +/** + * + * A team member is an individual with access to a team. + */ +export interface TeamMember { + /** + * when the membership record was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * email address of the team member + * + * @example "someone@example.org" + */ + readonly email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated: boolean; + /** + * unique identifier of the team member + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * Identity Provider information the member is federated with + */ + identity_provider?: null | TeamMemberIdentityProvider; + /** + * role in the team + * + * @example "admin" + */ + readonly role?: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; + /** + * whether the team member has two factor authentication enabled + * + * @example true + */ + readonly two_factor_authentication?: boolean; + /** + * when the membership record was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user information for the membership + */ + user?: TeamMemberUser; +} +/** + * + * Identity Provider information the member is federated with + */ +export interface TeamMemberIdentityProvider { + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of the identity provider + * + * @example "acme" + */ + readonly name?: string; + /** + * whether the identity_provider information is redacted or not + */ + readonly redacted?: boolean; + /** + * entity that owns this identity provider + */ + owner?: Owner; +} +/** + * + * user information for the membership + */ +export interface TeamMemberUser { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name: string | null; +} +/** + * + * [Heroku Platform API - team-invoice](https://devcenter.heroku.com/articles/platform-api-reference#team-invoice) + * A Team Invoice is an itemized bill of goods for a team which includes pricing and charges. + */ +export interface TeamInvoice { + /** + * total add-ons charges in on this invoice + * + * @example 25000 + */ + readonly addons_total: number; + /** + * total database charges on this invoice + * + * @example 25000 + */ + readonly database_total: number; + /** + * total charges on this invoice + */ + readonly charges_total: number; + /** + * when invoice was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * total credits on this invoice + * + * @example 100000 + */ + readonly credits_total: number; + /** + * total amount of dyno units consumed across dyno types. + * + * @example 1.92 + */ + readonly dyno_units: number; + /** + * unique identifier of this invoice + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * human readable invoice number + * + * @example 9403943 + */ + readonly number: number; + /** + * status of the invoice payment + * + * @example "Paid" + */ + readonly payment_status: string; + /** + * the ending date that the invoice covers + * + * @example "01/31/2014" + */ + readonly period_end: string; + /** + * the starting date that this invoice covers + * + * @example "01/01/2014" + */ + readonly period_start: string; + /** + * total platform charges on this invoice + * + * @example 50000 + */ + readonly platform_total: number; + /** + * payment status for this invoice (pending, successful, failed) + * + * @example 1 + */ + readonly state: number; + /** + * combined total of charges and credits on this invoice + * + * @example 100000 + */ + readonly total: number; + /** + * when invoice was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * The total amount of hours consumed across dyno types. + * + * @example 1488 + */ + readonly weighted_dyno_hours: number; +} +export interface TeamMemberCreateOrUpdatePayload { + /** + * email address of the team member + * + * @example "someone@example.org" + */ + readonly email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated?: boolean; + /** + * role in the team + * + * @example "admin" + */ + role: 'admin' | 'viewer' | 'member'; +} +export interface TeamMemberCreatePayload { + /** + * email address of the team member + * + * @example "someone@example.org" + */ + readonly email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated?: boolean; + /** + * role in the team + * + * @example "admin" + */ + role: 'admin' | 'viewer' | 'member'; +} +export interface TeamMemberUpdatePayload { + /** + * email address of the team member + * + * @example "someone@example.org" + */ + readonly email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated?: boolean; + /** + * role in the team + * + * @example "admin" + */ + role: 'admin' | 'viewer' | 'member'; +} +/** + * + * [Heroku Platform API - team-monthly-usage](https://devcenter.heroku.com/articles/platform-api-reference#team-monthly-usage) + * Usage for an enterprise team at a monthly resolution. + */ +export interface TeamMonthlyUsage { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons: number; + /** + * app usage in the team + */ + apps: AppUsageMonthly[]; + /** + * average connect rows synced + * + * @example 15000 + */ + readonly connect: number; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos: number; + /** + * team identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * year and month of the usage + * + * @example "2019-01" + */ + readonly month: string; + /** + * name of the team + * + * @example "ops" + */ + readonly name: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space: number; +} +export interface TeamMonthlyUsageInfoPayload { + /** + * range start date + * + * @example "2019-01" + */ + readonly start: string; + /** + * range end date + * + * @example "2019-02" + */ + readonly end?: string; +} +/** + * + * [Heroku Platform API - team-preferences](https://devcenter.heroku.com/articles/platform-api-reference#team-preferences) + * Tracks a Team's Preferences + */ +export interface TeamPreferences { + /** + * The default permission used when adding new members to the team + * + * @example "member" + */ + 'default-permission': null | 'admin' | 'member' | 'viewer' | ''; + /** + * Whether add-on service rules should be applied to add-on installations + * + * @example true + */ + 'addons-controls': boolean | null; +} +export interface TeamPreferencesUpdatePayload { + /** + * Whether add-on service rules should be applied to add-on installations + * + * @example true + */ + 'addons-controls'?: boolean | null; +} +export interface TeamEnterpriseAccount { + /** + * unique identifier of the enterprise account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of the enterprise account + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * Identity Provider associated with the Team + */ +export interface TeamIdentityProvider { + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * user-friendly unique identifier for this identity provider + * + * @example "acme-sso" + */ + name: string; + /** + * entity that owns this identity provider + */ + owner: Owner; +} +export interface TeamUpdatePayload { + /** + * whether to use this team when none is specified + * + * @example true + */ + default?: boolean; + /** + * unique name of team + * + * @example "example" + */ + readonly name?: string; +} +export interface TeamCreatePayload { + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; + /** + * street address line 1 + * + * @example "40 Hickory Lane" + */ + address_1?: string; + /** + * street address line 2 + * + * @example "Suite 103" + */ + address_2?: string | null; + /** + * encrypted card number of payment method + * + * @example "encrypted-card-number" + */ + card_number?: string | null; + /** + * city + * + * @example "San Francisco" + */ + city?: string; + /** + * country + * + * @example "US" + */ + country?: string; + /** + * card verification value + * + * @example "123" + */ + cvv?: string | null; + /** + * expiration month + * + * @example "11" + */ + expiration_month?: string | null; + /** + * expiration year + * + * @example "2014" + */ + expiration_year?: string | null; + /** + * the first name for payment method + * + * @example "Jason" + */ + first_name?: string; + /** + * the last name for payment method + * + * @example "Walker" + */ + last_name?: string; + /** + * metadata + * + * @example "Additional information for payment method" + */ + other?: string | null; + /** + * postal code + * + * @example "90210" + */ + postal_code?: string; + /** + * state + * + * @example "CA" + */ + state?: string; + /** + * Nonce generated by Braintree hosted fields form + * + * @example "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" + */ + nonce?: string | null; + /** + * Device data string generated by the client + * + * @example "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" + */ + device_data?: string | null; +} +export interface TeamCreateInEnterpriseAccountPayload { + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; +} +/** + * + * [Heroku Platform API - test-case](https://devcenter.heroku.com/articles/platform-api-reference#test-case) + * A single test case belonging to a test run + */ +export interface TestCase { + /** + * unique identifier of a test case + */ + readonly id: string; + /** + * when test case was created + */ + readonly created_at: string; + /** + * when test case was updated + */ + readonly updated_at: string; + /** + * description of the test case + */ + description: string; + /** + * meta information about the test case + */ + diagnostic: string; + /** + * special note about the test case e.g. skipped, todo + */ + directive: string; + /** + * whether the test case was successful + */ + passed: boolean; + /** + * the test number + */ + number: number; + /** + * the test node which executed this test case + */ + test_node: TestNode; + /** + * the test run which owns this test case + */ + test_run: TestRun; +} +/** + * + * [Heroku Platform API - test-node](https://devcenter.heroku.com/articles/platform-api-reference#test-node) + * A single test node belonging to a test run + */ +export interface TestNode { + /** + * when test node was created + */ + readonly created_at: string; + /** + * the dyno which belongs to this test node + */ + dyno: TestNodeDyno | null; + /** + * the status of the test run when the error occured + */ + error_status: string | null; + /** + * the exit code of the test script + */ + exit_code: number | null; + /** + * unique identifier of a test node + */ + id: string; + /** + * The index of the test node + */ + index: number; + /** + * human friendly message indicating reason for an error + */ + message: string | null; + /** + * the streaming output for the test node + * + * @example "https://example.com/output.log" + */ + output_stream_url: string; + /** + * the pipeline which owns this test node + */ + pipeline: TestNodePipeline; + /** + * the streaming test setup output for the test node + * + * @example "https://example.com/test-setup.log" + */ + setup_stream_url: string; + /** + * current state of the test run + */ + readonly status: 'pending' | 'cancelled' | 'creating' | 'building' | 'running' | 'succeeded' | 'failed' | 'errored' | 'debugging'; + /** + * when test node was updated + */ + readonly updated_at: string; + /** + * the test run which owns this test node + */ + test_run: TestRun; +} +/** + * + * [Heroku Platform API - test-run](https://devcenter.heroku.com/articles/platform-api-reference#test-run) + * An execution or trial of one or more tests + */ +export interface TestRun { + /** + * the email of the actor triggering the test run + */ + actor_email: string; + /** + * whether the test was run with an empty cache + */ + clear_cache: boolean | null; + /** + * the branch of the repository that the test run concerns + */ + commit_branch: string; + /** + * the message for the commit under test + */ + commit_message: string; + /** + * the SHA hash of the commit under test + */ + commit_sha: string; + /** + * whether the test run was started for interactive debugging + */ + debug: boolean; + /** + * the app setup for the test run + */ + app_setup: null | Record; + /** + * when test run was created + */ + readonly created_at: string; + /** + * the type of dynos used for this test-run + */ + dyno: null | TestRunDyno; + /** + * unique identifier of a test run + */ + readonly id: string; + /** + * human friendly message indicating reason for an error + */ + message: string | null; + /** + * the auto incrementing test run number + */ + number: number; + /** + * the team that owns this test-run + */ + organization: null | Organization; + /** + * the pipeline which owns this test-run + */ + pipeline: TestRunPipeline; + /** + * current state of the test run + */ + readonly status: 'pending' | 'cancelled' | 'creating' | 'building' | 'running' | 'succeeded' | 'failed' | 'errored' | 'debugging'; + /** + * The download location for the source code to be tested + */ + source_blob_url: string; + /** + * when test-run was updated + */ + readonly updated_at: string; + /** + * An account represents an individual signed up to use the Heroku platform. + */ + user: Account; + /** + * human friently warning emitted during the test run + */ + warning_message: string | null; +} +/** + * + * [Heroku Platform API - dyno](https://devcenter.heroku.com/articles/platform-api-reference#dyno) + * the dyno which belongs to this test node + */ +export interface TestNodeDyno { + /** + * unique identifier of this dyno or the name of this process on this dyno + */ + id?: string; + /** + * a URL to stream output from for debug runs or null for non-debug runs + * + * @example "rendezvous://rendezvous.runtime.heroku.com:5000/{rendezvous-id}" + */ + readonly attach_url?: string | null; +} +/** + * + * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * the pipeline which owns this test node + */ +export interface TestNodePipeline { + /** + * unique identifier of pipeline or name of pipeline + */ + id?: string; +} +/** + * + * [Heroku Platform API - dyno](https://devcenter.heroku.com/articles/platform-api-reference#dyno) + * the type of dynos used for this test-run + */ +export interface TestRunDyno { + /** + * dyno size + * + * @example "standard-1X" + */ + size?: string; +} +/** + * + * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * the pipeline which owns this test-run + */ +export interface TestRunPipeline { + /** + * unique identifier of pipeline or name of pipeline + */ + id?: string; +} +export interface TestRunCreatePayload { + /** + * the branch of the repository that the test run concerns + */ + commit_branch: string; + /** + * the message for the commit under test + */ + commit_message: string; + /** + * the SHA hash of the commit under test + */ + commit_sha: string; + /** + * whether the test run was started for interactive debugging + */ + debug?: boolean; + /** + * unique name of team or unique identifier of team + */ + organization?: string; + /** + * unique identifier of pipeline or name of pipeline + */ + pipeline: string; + /** + * The download location for the source code to be tested + */ + source_blob_url: string; +} +export interface TestRunUpdatePayload { + /** + * current state of the test run + */ + readonly status: 'pending' | 'cancelled' | 'creating' | 'building' | 'running' | 'succeeded' | 'failed' | 'errored' | 'debugging'; + /** + * human friendly message indicating reason for an error + */ + message: string | null; +} +/** + * + * [Heroku Platform API - user-preferences](https://devcenter.heroku.com/articles/platform-api-reference#user-preferences) + * Tracks a user's preferences and message dismissals + */ +export interface UserPreferences { + /** + * User's default timezone + * + * @example "UTC" + */ + timezone: string | null; + /** + * User's default team + * + * @example "sushi-inc" + */ + 'default-organization': string | null; + /** + * Whether the user has dismissed the GitHub link banner + * + * @example true + */ + 'dismissed-github-banner': boolean | null; + /** + * Whether the user has dismissed the getting started banner + * + * @example true + */ + 'dismissed-getting-started': boolean | null; + /** + * Whether the user has dismissed the Organization Access Controls banner + * + * @example true + */ + 'dismissed-org-access-controls': boolean | null; + /** + * Whether the user has dismissed the Organization Wizard + * + * @example true + */ + 'dismissed-org-wizard-notification': boolean | null; + /** + * Whether the user has dismissed the Pipelines banner + * + * @example true + */ + 'dismissed-pipelines-banner': boolean | null; + /** + * Whether the user has dismissed the GitHub banner on a pipeline overview + * + * @example true + */ + 'dismissed-pipelines-github-banner': boolean | null; + /** + * Which pipeline uuids the user has dismissed the GitHub banner for + * + * @example ["96c68759-f310-4910-9867-e0b062064098"] + */ + 'dismissed-pipelines-github-banners': null | string[]; + /** + * Whether the user has dismissed the 2FA SMS banner + * + * @example true + */ + 'dismissed-sms-banner': boolean | null; +} +export interface UserPreferencesUpdatePayload { + /** + * User's default timezone + * + * @example "UTC" + */ + timezone?: string | null; + /** + * User's default team + * + * @example "sushi-inc" + */ + 'default-organization'?: string | null; + /** + * Whether the user has dismissed the GitHub link banner + * + * @example true + */ + 'dismissed-github-banner'?: boolean | null; + /** + * Whether the user has dismissed the getting started banner + * + * @example true + */ + 'dismissed-getting-started'?: boolean | null; + /** + * Whether the user has dismissed the Organization Access Controls banner + * + * @example true + */ + 'dismissed-org-access-controls'?: boolean | null; + /** + * Whether the user has dismissed the Organization Wizard + * + * @example true + */ + 'dismissed-org-wizard-notification'?: boolean | null; + /** + * Whether the user has dismissed the Pipelines banner + * + * @example true + */ + 'dismissed-pipelines-banner'?: boolean | null; + /** + * Whether the user has dismissed the GitHub banner on a pipeline overview + * + * @example true + */ + 'dismissed-pipelines-github-banner'?: boolean | null; + /** + * Which pipeline uuids the user has dismissed the GitHub banner for + * + * @example ["96c68759-f310-4910-9867-e0b062064098"] + */ + 'dismissed-pipelines-github-banners'?: null | string[]; + /** + * Whether the user has dismissed the 2FA SMS banner + * + * @example true + */ + 'dismissed-sms-banner'?: boolean | null; +} +/** + * + * [Heroku Platform API - vpn-connection](https://devcenter.heroku.com/articles/platform-api-reference#vpn-connection) + * [VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN. + */ +export interface VpnConnection { + /** + * VPN ID + * + * @example "123456789012" + */ + readonly id: string; + /** + * VPN Name + * + * @example "office" + */ + name: string; + /** + * Public IP of VPN customer gateway + * + * @example "35.161.69.30" + */ + public_ip: string; + /** + * Routable CIDRs of VPN + */ + routable_cidrs: string[]; + /** + * CIDR Block of the Private Space + * + * @example "10.0.0.0/16" + */ + readonly space_cidr_block: string; + tunnels: Tunnel[]; + /** + * IKE Version + * + * @example 1 + */ + readonly ike_version: number; + /** + * Status of the VPN + * + * @example "active" + */ + readonly status: 'pending' | 'provisioning' | 'active' | 'deprovisioning' | 'failed'; + /** + * Details of the status + * + * @example "supplied CIDR block already in use" + */ + readonly status_message: string; +} +/** + * + * Tunnel info + */ +export interface Tunnel { + /** + * Timestamp of last status changed + * + * @example "2016-10-25T22:09:05Z" + */ + last_status_change?: string; + /** + * Public IP address for the tunnel + * + * @example "52.44.146.197" + */ + ip?: string; + /** + * Public IP address for the customer side of the tunnel + * + * @example "52.44.146.197" + */ + customer_ip?: string; + /** + * Pre-shared key + * + * @example "secret" + */ + pre_shared_key?: string; + /** + * Status of the tunnel + * + * @example "UP" + */ + status?: 'UP' | 'DOWN'; + /** + * Details of the status + * + * @example "status message" + */ + status_message?: string; +} +export interface VpnConnectionCreatePayload { + /** + * VPN Name + * + * @example "office" + */ + name: string; + /** + * Public IP of VPN customer gateway + * + * @example "35.161.69.30" + */ + public_ip: string; + /** + * Routable CIDRs of VPN + */ + routable_cidrs: string[]; +} +export interface VpnConnectionUpdatePayload { + /** + * Routable CIDRs of VPN + */ + routable_cidrs: string[]; +} diff --git a/lib/esm/index.js b/lib/esm/index.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/lib/esm/index.js @@ -0,0 +1 @@ +export {}; diff --git a/lib/esm/services/account-delinquency-service.d.ts b/lib/esm/services/account-delinquency-service.d.ts new file mode 100644 index 0000000..ab9fe60 --- /dev/null +++ b/lib/esm/services/account-delinquency-service.d.ts @@ -0,0 +1,16 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Account Delinquency](https://devcenter.heroku.com/articles/platform-api-reference#account-delinquency) + * A Heroku account becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent accounts if their invoices remain unpaid. + */ +export default class AccountDelinquencyService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Account delinquency information. + * + * @param requestInit The initializer for the request. + */ + info(requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/account-delinquency-service.js b/lib/esm/services/account-delinquency-service.js new file mode 100644 index 0000000..5c0b8ab --- /dev/null +++ b/lib/esm/services/account-delinquency-service.js @@ -0,0 +1,31 @@ +/** + * [Heroku Platform API - Account Delinquency](https://devcenter.heroku.com/articles/platform-api-reference#account-delinquency) + * A Heroku account becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent accounts if their invoices remain unpaid. + */ +export default class AccountDelinquencyService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Account delinquency information. + * + * @param requestInit The initializer for the request. + */ + async info(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/delinquency`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/account-feature-service.d.ts b/lib/esm/services/account-feature-service.d.ts new file mode 100644 index 0000000..bd6fdcd --- /dev/null +++ b/lib/esm/services/account-feature-service.d.ts @@ -0,0 +1,31 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Account Feature](https://devcenter.heroku.com/articles/platform-api-reference#account-feature) + * An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku. + */ +export default class AccountFeatureService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for an existing account feature. + * + * @param accountFeatureIdentity unique identifier of account feature or unique name of account feature. + * @param requestInit The initializer for the request. + */ + info(accountFeatureIdentity: string, requestInit?: Omit): Promise; + /** + * List existing account features. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Update an existing account feature. + * + * @param accountFeatureIdentity unique identifier of account feature or unique name of account feature. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(accountFeatureIdentity: string, payload: Heroku.AccountFeatureUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/account-feature-service.js b/lib/esm/services/account-feature-service.js new file mode 100644 index 0000000..0a551ca --- /dev/null +++ b/lib/esm/services/account-feature-service.js @@ -0,0 +1,74 @@ +/** + * [Heroku Platform API - Account Feature](https://devcenter.heroku.com/articles/platform-api-reference#account-feature) + * An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku. + */ +export default class AccountFeatureService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for an existing account feature. + * + * @param accountFeatureIdentity unique identifier of account feature or unique name of account feature. + * @param requestInit The initializer for the request. + */ + async info(accountFeatureIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/features/${accountFeatureIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing account features. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/features`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing account feature. + * + * @param accountFeatureIdentity unique identifier of account feature or unique name of account feature. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(accountFeatureIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/features/${accountFeatureIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/account-service.d.ts b/lib/esm/services/account-service.d.ts new file mode 100644 index 0000000..c025640 --- /dev/null +++ b/lib/esm/services/account-service.d.ts @@ -0,0 +1,51 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Account](https://devcenter.heroku.com/articles/platform-api-reference#account) + * An account represents an individual signed up to use the Heroku platform. + */ +export default class AccountService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for account. + * + * @param requestInit The initializer for the request. + */ + info(requestInit?: Omit): Promise; + /** + * Update account. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(payload: Heroku.AccountUpdatePayload, requestInit?: Omit): Promise; + /** + * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. + * + * @param requestInit The initializer for the request. + */ + delete(requestInit?: Omit): Promise; + /** + * Info for account. + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + infoByUser(accountIdentity: string, requestInit?: Omit): Promise; + /** + * Update account. + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + updateByUser(accountIdentity: string, payload: Heroku.AccountUpdateByUserPayload, requestInit?: Omit): Promise; + /** + * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + deleteByUser(accountIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/account-service.js b/lib/esm/services/account-service.js new file mode 100644 index 0000000..d023bc2 --- /dev/null +++ b/lib/esm/services/account-service.js @@ -0,0 +1,137 @@ +/** + * [Heroku Platform API - Account](https://devcenter.heroku.com/articles/platform-api-reference#account) + * An account represents an individual signed up to use the Heroku platform. + */ +export default class AccountService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for account. + * + * @param requestInit The initializer for the request. + */ + async info(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update account. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. + * + * @param requestInit The initializer for the request. + */ + async delete(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for account. + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async infoByUser(accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update account. + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async updateByUser(accountIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async deleteByUser(accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/add-on-action-service.d.ts b/lib/esm/services/add-on-action-service.d.ts new file mode 100644 index 0000000..d4323d4 --- /dev/null +++ b/lib/esm/services/add-on-action-service.d.ts @@ -0,0 +1,24 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Action](https://devcenter.heroku.com/articles/platform-api-reference#add-on-action) + * Add-on Actions are lifecycle operations for add-on provisioning and deprovisioning. They allow add-on providers to (de)provision add-ons in the background and then report back when (de)provisioning is complete. + */ +export default class AddOnActionService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Mark an add-on as provisioned for use. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + provision(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * Mark an add-on as deprovisioned. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + deprovision(addOnIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/add-on-action-service.js b/lib/esm/services/add-on-action-service.js new file mode 100644 index 0000000..a722638 --- /dev/null +++ b/lib/esm/services/add-on-action-service.js @@ -0,0 +1,54 @@ +/** + * [Heroku Platform API - Add-on Action](https://devcenter.heroku.com/articles/platform-api-reference#add-on-action) + * Add-on Actions are lifecycle operations for add-on provisioning and deprovisioning. They allow add-on providers to (de)provision add-ons in the background and then report back when (de)provisioning is complete. + */ +export default class AddOnActionService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Mark an add-on as provisioned for use. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async provision(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/actions/provision`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Mark an add-on as deprovisioned. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async deprovision(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/actions/deprovision`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/add-on-attachment-service.d.ts b/lib/esm/services/add-on-attachment-service.d.ts new file mode 100644 index 0000000..1db19c0 --- /dev/null +++ b/lib/esm/services/add-on-attachment-service.d.ts @@ -0,0 +1,66 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Attachment](https://devcenter.heroku.com/articles/platform-api-reference#add-on-attachment) + * An add-on attachment represents a connection between an app and an add-on that it has been given access to. + */ +export default class AddOnAttachmentService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new add-on attachment. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.AddOnAttachmentCreatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing add-on attachment. + * + * @param addOnAttachmentIdentity unique identifier of this add-on attachment. + * @param requestInit The initializer for the request. + */ + delete(addOnAttachmentIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing add-on attachment. + * + * @param addOnAttachmentIdentity unique identifier of this add-on attachment. + * @param requestInit The initializer for the request. + */ + info(addOnAttachmentIdentity: string, requestInit?: Omit): Promise; + /** + * List existing add-on attachments. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * List existing add-on attachments for an add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + listByAddOn(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * List existing add-on attachments for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + listByApp(appIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing add-on attachment for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnAttachmentScopedIdentity unique identifier of this add-on attachment or unique name for this add-on attachment to this app. + * @param requestInit The initializer for the request. + */ + infoByApp(appIdentity: string, addOnAttachmentScopedIdentity: string, requestInit?: Omit): Promise; + /** + * Resolve an add-on attachment from a name, optionally passing an app name. If there are matches it returns at least one add-on attachment (exact match) or many. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + resolution(payload: Heroku.AddOnAttachmentResolutionPayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/add-on-attachment-service.js b/lib/esm/services/add-on-attachment-service.js new file mode 100644 index 0000000..b32d21e --- /dev/null +++ b/lib/esm/services/add-on-attachment-service.js @@ -0,0 +1,177 @@ +/** + * [Heroku Platform API - Add-on Attachment](https://devcenter.heroku.com/articles/platform-api-reference#add-on-attachment) + * An add-on attachment represents a connection between an app and an add-on that it has been given access to. + */ +export default class AddOnAttachmentService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new add-on attachment. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-attachments`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing add-on attachment. + * + * @param addOnAttachmentIdentity unique identifier of this add-on attachment. + * @param requestInit The initializer for the request. + */ + async delete(addOnAttachmentIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-attachments/${addOnAttachmentIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing add-on attachment. + * + * @param addOnAttachmentIdentity unique identifier of this add-on attachment. + * @param requestInit The initializer for the request. + */ + async info(addOnAttachmentIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-attachments/${addOnAttachmentIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing add-on attachments. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-attachments`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing add-on attachments for an add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async listByAddOn(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/addon-attachments`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing add-on attachments for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async listByApp(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addon-attachments`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing add-on attachment for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnAttachmentScopedIdentity unique identifier of this add-on attachment or unique name for this add-on attachment to this app. + * @param requestInit The initializer for the request. + */ + async infoByApp(appIdentity, addOnAttachmentScopedIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addon-attachments/${addOnAttachmentScopedIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Resolve an add-on attachment from a name, optionally passing an app name. If there are matches it returns at least one add-on attachment (exact match) or many. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async resolution(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/actions/addon-attachments/resolve`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/add-on-config-service.d.ts b/lib/esm/services/add-on-config-service.d.ts new file mode 100644 index 0000000..68c9532 --- /dev/null +++ b/lib/esm/services/add-on-config-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Config](https://devcenter.heroku.com/articles/platform-api-reference#add-on-config) + * Configuration of an Add-on + */ +export default class AddOnConfigService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Get an add-on's config. Accessible by customers with access and by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + list(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * Update an add-on's config. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(addOnIdentity: string, payload: Heroku.AddOnConfigUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/add-on-config-service.js b/lib/esm/services/add-on-config-service.js new file mode 100644 index 0000000..6759db7 --- /dev/null +++ b/lib/esm/services/add-on-config-service.js @@ -0,0 +1,55 @@ +/** + * [Heroku Platform API - Add-on Config](https://devcenter.heroku.com/articles/platform-api-reference#add-on-config) + * Configuration of an Add-on + */ +export default class AddOnConfigService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Get an add-on's config. Accessible by customers with access and by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async list(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/config`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an add-on's config. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(addOnIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/config`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/add-on-region-capability-service.d.ts b/lib/esm/services/add-on-region-capability-service.d.ts new file mode 100644 index 0000000..9af404a --- /dev/null +++ b/lib/esm/services/add-on-region-capability-service.d.ts @@ -0,0 +1,30 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Region Capability](https://devcenter.heroku.com/articles/platform-api-reference#add-on-region-capability) + * Add-on region capabilities represent the relationship between an Add-on Service and a specific Region. Only Beta and GA add-ons are returned by these endpoints. + */ +export default class AddOnRegionCapabilityService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List all existing add-on region capabilities. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * List existing add-on region capabilities for an add-on-service + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + listByAddOnService(addOnServiceIdentity: string, requestInit?: Omit): Promise; + /** + * List existing add-on region capabilities for a region. + * + * @param regionIdentity unique identifier of region or unique name of region. + * @param requestInit The initializer for the request. + */ + listByRegion(regionIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/add-on-region-capability-service.js b/lib/esm/services/add-on-region-capability-service.js new file mode 100644 index 0000000..7f30d3c --- /dev/null +++ b/lib/esm/services/add-on-region-capability-service.js @@ -0,0 +1,71 @@ +/** + * [Heroku Platform API - Add-on Region Capability](https://devcenter.heroku.com/articles/platform-api-reference#add-on-region-capability) + * Add-on region capabilities represent the relationship between an Add-on Service and a specific Region. Only Beta and GA add-ons are returned by these endpoints. + */ +export default class AddOnRegionCapabilityService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List all existing add-on region capabilities. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-region-capabilities`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing add-on region capabilities for an add-on-service + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + async listByAddOnService(addOnServiceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-services/${addOnServiceIdentity}/region-capabilities`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing add-on region capabilities for a region. + * + * @param regionIdentity unique identifier of region or unique name of region. + * @param requestInit The initializer for the request. + */ + async listByRegion(regionIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/regions/${regionIdentity}/addon-region-capabilities`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/add-on-service-service.d.ts b/lib/esm/services/add-on-service-service.d.ts new file mode 100644 index 0000000..275c578 --- /dev/null +++ b/lib/esm/services/add-on-service-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Service](https://devcenter.heroku.com/articles/platform-api-reference#add-on-service) + * Add-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. + */ +export default class AddOnServiceService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing add-on-service. + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + info(addOnServiceIdentity: string, requestInit?: Omit): Promise; + /** + * List existing add-on-services. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/add-on-service-service.js b/lib/esm/services/add-on-service-service.js new file mode 100644 index 0000000..f7cb2b3 --- /dev/null +++ b/lib/esm/services/add-on-service-service.js @@ -0,0 +1,51 @@ +/** + * [Heroku Platform API - Add-on Service](https://devcenter.heroku.com/articles/platform-api-reference#add-on-service) + * Add-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. + */ +export default class AddOnServiceService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing add-on-service. + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + async info(addOnServiceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-services/${addOnServiceIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing add-on-services. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-services`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/add-on-service.d.ts b/lib/esm/services/add-on-service.d.ts new file mode 100644 index 0000000..ee8368e --- /dev/null +++ b/lib/esm/services/add-on-service.d.ts @@ -0,0 +1,84 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on](https://devcenter.heroku.com/articles/platform-api-reference#add-on) + * Add-ons represent add-ons that have been provisioned and attached to one or more apps. + */ +export default class AddOnService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List all existing add-ons. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Info for an existing add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + info(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * Create a new add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.AddOnCreatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + delete(appIdentity: string, addOnIdentity: string, requestInit?: Omit): Promise; + /** + * Info for an existing add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + infoByApp(appIdentity: string, addOnIdentity: string, requestInit?: Omit): Promise; + /** + * List existing add-ons for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + listByApp(appIdentity: string, requestInit?: Omit): Promise; + /** + * Change add-on plan. Some add-ons may not support changing plans. In that case, an error will be returned. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, addOnIdentity: string, payload: Heroku.AddOnUpdatePayload, requestInit?: Omit): Promise; + /** + * List all existing add-ons a user has access to + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + listByUser(accountIdentity: string, requestInit?: Omit): Promise; + /** + * List add-ons used across all Team apps + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + listByTeam(teamIdentity: string, requestInit?: Omit): Promise; + /** + * Resolve an add-on from a name, optionally passing an app name. If there are matches it returns at least one add-on (exact match) or many. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + resolution(payload: Heroku.AddOnResolutionPayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/add-on-service.js b/lib/esm/services/add-on-service.js new file mode 100644 index 0000000..d4d6f1b --- /dev/null +++ b/lib/esm/services/add-on-service.js @@ -0,0 +1,223 @@ +/** + * [Heroku Platform API - Add-on](https://devcenter.heroku.com/articles/platform-api-reference#add-on) + * Add-ons represent add-ons that have been provisioned and attached to one or more apps. + */ +export default class AddOnService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List all existing add-ons. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for an existing add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async info(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a new add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async delete(appIdentity, addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons/${addOnIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for an existing add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async infoByApp(appIdentity, addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons/${addOnIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing add-ons for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async listByApp(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Change add-on plan. Some add-ons may not support changing plans. In that case, an error will be returned. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, addOnIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons/${addOnIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List all existing add-ons a user has access to + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async listByUser(accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}/addons`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List add-ons used across all Team apps + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async listByTeam(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/addons`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Resolve an add-on from a name, optionally passing an app name. If there are matches it returns at least one add-on (exact match) or many. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async resolution(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/actions/addons/resolve`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/add-on-webhook-delivery-service.d.ts b/lib/esm/services/add-on-webhook-delivery-service.d.ts new file mode 100644 index 0000000..d419b29 --- /dev/null +++ b/lib/esm/services/add-on-webhook-delivery-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Webhook Delivery](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook-delivery) + * Represents the delivery of a webhook notification, including its current status. + */ +export default class AddOnWebhookDeliveryService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Returns the info for an existing delivery. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookDeliveryIdentity the delivery's unique identifier. + * @param requestInit The initializer for the request. + */ + info(addOnIdentity: string, appWebhookDeliveryIdentity: string, requestInit?: Omit): Promise; + /** + * Lists existing deliveries for an add-on. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + list(addOnIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/add-on-webhook-delivery-service.js b/lib/esm/services/add-on-webhook-delivery-service.js new file mode 100644 index 0000000..44a7fb2 --- /dev/null +++ b/lib/esm/services/add-on-webhook-delivery-service.js @@ -0,0 +1,53 @@ +/** + * [Heroku Platform API - Add-on Webhook Delivery](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook-delivery) + * Represents the delivery of a webhook notification, including its current status. + */ +export default class AddOnWebhookDeliveryService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Returns the info for an existing delivery. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookDeliveryIdentity the delivery's unique identifier. + * @param requestInit The initializer for the request. + */ + async info(addOnIdentity, appWebhookDeliveryIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhook-deliveries/${appWebhookDeliveryIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Lists existing deliveries for an add-on. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async list(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhook-deliveries`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/add-on-webhook-event-service.d.ts b/lib/esm/services/add-on-webhook-event-service.d.ts new file mode 100644 index 0000000..6fa8e8b --- /dev/null +++ b/lib/esm/services/add-on-webhook-event-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Webhook Event](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook-event) + * Represents a webhook event that occurred. + */ +export default class AddOnWebhookEventService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Returns the info for a specified webhook event. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookEventIdentity the event's unique identifier. + * @param requestInit The initializer for the request. + */ + info(addOnIdentity: string, appWebhookEventIdentity: string, requestInit?: Omit): Promise; + /** + * Lists existing webhook events for an add-on. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + list(addOnIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/add-on-webhook-event-service.js b/lib/esm/services/add-on-webhook-event-service.js new file mode 100644 index 0000000..b44db01 --- /dev/null +++ b/lib/esm/services/add-on-webhook-event-service.js @@ -0,0 +1,53 @@ +/** + * [Heroku Platform API - Add-on Webhook Event](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook-event) + * Represents a webhook event that occurred. + */ +export default class AddOnWebhookEventService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Returns the info for a specified webhook event. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookEventIdentity the event's unique identifier. + * @param requestInit The initializer for the request. + */ + async info(addOnIdentity, appWebhookEventIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhook-events/${appWebhookEventIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Lists existing webhook events for an add-on. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async list(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhook-events`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/add-on-webhook-service.d.ts b/lib/esm/services/add-on-webhook-service.d.ts new file mode 100644 index 0000000..b6b86cb --- /dev/null +++ b/lib/esm/services/add-on-webhook-service.d.ts @@ -0,0 +1,50 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Webhook](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook) + * Represents the details of a webhook subscription + */ +export default class AddOnWebhookService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(addOnIdentity: string, payload: Heroku.AddOnWebhookCreatePayload, requestInit?: Omit): Promise; + /** + * Removes an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + delete(addOnIdentity: string, appWebhookIdentity: string, requestInit?: Omit): Promise; + /** + * Returns the info for an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + info(addOnIdentity: string, appWebhookIdentity: string, requestInit?: Omit): Promise; + /** + * List all webhook subscriptions for a particular add-on. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + list(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * Updates the details of an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookIdentity the webhook's unique identifier. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(addOnIdentity: string, appWebhookIdentity: string, payload: Heroku.AddOnWebhookUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/add-on-webhook-service.js b/lib/esm/services/add-on-webhook-service.js new file mode 100644 index 0000000..a70e3ee --- /dev/null +++ b/lib/esm/services/add-on-webhook-service.js @@ -0,0 +1,122 @@ +/** + * [Heroku Platform API - Add-on Webhook](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook) + * Represents the details of a webhook subscription + */ +export default class AddOnWebhookService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(addOnIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhooks`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Removes an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + async delete(addOnIdentity, appWebhookIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Returns the info for an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + async info(addOnIdentity, appWebhookIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List all webhook subscriptions for a particular add-on. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async list(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhooks`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Updates the details of an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookIdentity the webhook's unique identifier. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(addOnIdentity, appWebhookIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/allowed-add-on-service-service.d.ts b/lib/esm/services/allowed-add-on-service-service.d.ts new file mode 100644 index 0000000..be7f3e6 --- /dev/null +++ b/lib/esm/services/allowed-add-on-service-service.d.ts @@ -0,0 +1,33 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Allowed Add-on Service](https://devcenter.heroku.com/articles/platform-api-reference#allowed-add-on-service) + * Entities that have been allowed to be used by a Team + */ +export default class AllowedAddOnServiceService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List all allowed add-on services for a team + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + listByTeam(teamIdentity: string, requestInit?: Omit): Promise; + /** + * Allow an Add-on Service + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + createByTeam(teamIdentity: string, payload: Heroku.AllowedAddOnServiceCreateByTeamPayload, requestInit?: Omit): Promise; + /** + * Remove an allowed add-on service + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param allowedAddOnServiceIdentity unique identifier for this allowed add-on service record or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + deleteByTeam(teamIdentity: string, allowedAddOnServiceIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/allowed-add-on-service-service.js b/lib/esm/services/allowed-add-on-service-service.js new file mode 100644 index 0000000..0916ba6 --- /dev/null +++ b/lib/esm/services/allowed-add-on-service-service.js @@ -0,0 +1,77 @@ +/** + * [Heroku Platform API - Allowed Add-on Service](https://devcenter.heroku.com/articles/platform-api-reference#allowed-add-on-service) + * Entities that have been allowed to be used by a Team + */ +export default class AllowedAddOnServiceService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List all allowed add-on services for a team + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async listByTeam(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/allowed-addon-services`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Allow an Add-on Service + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async createByTeam(teamIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/allowed-addon-services`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Remove an allowed add-on service + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param allowedAddOnServiceIdentity unique identifier for this allowed add-on service record or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + async deleteByTeam(teamIdentity, allowedAddOnServiceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/allowed-addon-services/${allowedAddOnServiceIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/app-feature-service.d.ts b/lib/esm/services/app-feature-service.d.ts new file mode 100644 index 0000000..8aab4db --- /dev/null +++ b/lib/esm/services/app-feature-service.d.ts @@ -0,0 +1,34 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App Feature](https://devcenter.heroku.com/articles/platform-api-reference#app-feature) + * An app feature represents a Heroku labs capability that can be enabled or disabled for an app on Heroku. + */ +export default class AppFeatureService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for an existing app feature. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appFeatureIdentity unique identifier of app feature or unique name of app feature. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, appFeatureIdentity: string, requestInit?: Omit): Promise; + /** + * List existing app features. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing app feature. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appFeatureIdentity unique identifier of app feature or unique name of app feature. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, appFeatureIdentity: string, payload: Heroku.AppFeatureUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/app-feature-service.js b/lib/esm/services/app-feature-service.js new file mode 100644 index 0000000..c9b1bfa --- /dev/null +++ b/lib/esm/services/app-feature-service.js @@ -0,0 +1,77 @@ +/** + * [Heroku Platform API - App Feature](https://devcenter.heroku.com/articles/platform-api-reference#app-feature) + * An app feature represents a Heroku labs capability that can be enabled or disabled for an app on Heroku. + */ +export default class AppFeatureService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for an existing app feature. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appFeatureIdentity unique identifier of app feature or unique name of app feature. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, appFeatureIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/features/${appFeatureIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing app features. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/features`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing app feature. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appFeatureIdentity unique identifier of app feature or unique name of app feature. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, appFeatureIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/features/${appFeatureIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/app-service.d.ts b/lib/esm/services/app-service.d.ts new file mode 100644 index 0000000..e3fa707 --- /dev/null +++ b/lib/esm/services/app-service.d.ts @@ -0,0 +1,73 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App](https://devcenter.heroku.com/articles/platform-api-reference#app) + * An app represents the program that you would like to deploy and run on Heroku. + */ +export default class AppService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new app. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.AppCreatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + delete(appIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, requestInit?: Omit): Promise; + /** + * List existing apps. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * List owned and collaborated apps (excludes team apps). + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + listOwnedAndCollaborated(accountIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, payload: Heroku.AppUpdatePayload, requestInit?: Omit): Promise; + /** + * Enable ACM flag for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + enableAcm(appIdentity: string, requestInit?: Omit): Promise; + /** + * Disable ACM flag for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + disableAcm(appIdentity: string, requestInit?: Omit): Promise; + /** + * Refresh ACM for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + refreshAcm(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/app-service.js b/lib/esm/services/app-service.js new file mode 100644 index 0000000..b39beea --- /dev/null +++ b/lib/esm/services/app-service.js @@ -0,0 +1,200 @@ +/** + * [Heroku Platform API - App](https://devcenter.heroku.com/articles/platform-api-reference#app) + * An app represents the program that you would like to deploy and run on Heroku. + */ +export default class AppService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new app. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async delete(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing apps. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List owned and collaborated apps (excludes team apps). + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async listOwnedAndCollaborated(accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}/apps`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Enable ACM flag for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async enableAcm(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/acm`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Disable ACM flag for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async disableAcm(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/acm`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Refresh ACM for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async refreshAcm(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/acm`, { + ...requestInit, + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/app-setup-service.d.ts b/lib/esm/services/app-setup-service.d.ts new file mode 100644 index 0000000..7cbb271 --- /dev/null +++ b/lib/esm/services/app-setup-service.d.ts @@ -0,0 +1,24 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Setup API - App Setup](https://devcenter.heroku.com/articles/platform-api-reference#app-setup) + * An app setup represents an app on Heroku that is setup using an environment, addons, and scripts described in an app.json manifest file. + */ +export default class AppSetupService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new app setup from a gzipped tar archive containing an app.json manifest file. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.AppSetupCreatePayload, requestInit?: Omit): Promise; + /** + * Get the status of an app setup. + * + * @param appSetupIdentity unique identifier of app setup. + * @param requestInit The initializer for the request. + */ + info(appSetupIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/app-setup-service.js b/lib/esm/services/app-setup-service.js new file mode 100644 index 0000000..adcbb22 --- /dev/null +++ b/lib/esm/services/app-setup-service.js @@ -0,0 +1,54 @@ +/** + * [Heroku Setup API - App Setup](https://devcenter.heroku.com/articles/platform-api-reference#app-setup) + * An app setup represents an app on Heroku that is setup using an environment, addons, and scripts described in an app.json manifest file. + */ +export default class AppSetupService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new app setup from a gzipped tar archive containing an app.json manifest file. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/app-setups`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Get the status of an app setup. + * + * @param appSetupIdentity unique identifier of app setup. + * @param requestInit The initializer for the request. + */ + async info(appSetupIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/app-setups/${appSetupIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/app-transfer-service.d.ts b/lib/esm/services/app-transfer-service.d.ts new file mode 100644 index 0000000..a6309e5 --- /dev/null +++ b/lib/esm/services/app-transfer-service.d.ts @@ -0,0 +1,45 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App Transfer](https://devcenter.heroku.com/articles/platform-api-reference#app-transfer) + * An app transfer represents a two party interaction for transferring ownership of an app. + */ +export default class AppTransferService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new app transfer. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.AppTransferCreatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing app transfer + * + * @param appTransferIdentity unique identifier of app transfer or unique name of app. + * @param requestInit The initializer for the request. + */ + delete(appTransferIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing app transfer. + * + * @param appTransferIdentity unique identifier of app transfer or unique name of app. + * @param requestInit The initializer for the request. + */ + info(appTransferIdentity: string, requestInit?: Omit): Promise; + /** + * List existing apps transfers. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Update an existing app transfer. + * + * @param appTransferIdentity unique identifier of app transfer or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appTransferIdentity: string, payload: Heroku.AppTransferUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/app-transfer-service.js b/lib/esm/services/app-transfer-service.js new file mode 100644 index 0000000..aef53f5 --- /dev/null +++ b/lib/esm/services/app-transfer-service.js @@ -0,0 +1,117 @@ +/** + * [Heroku Platform API - App Transfer](https://devcenter.heroku.com/articles/platform-api-reference#app-transfer) + * An app transfer represents a two party interaction for transferring ownership of an app. + */ +export default class AppTransferService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new app transfer. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/app-transfers`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing app transfer + * + * @param appTransferIdentity unique identifier of app transfer or unique name of app. + * @param requestInit The initializer for the request. + */ + async delete(appTransferIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/app-transfers/${appTransferIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing app transfer. + * + * @param appTransferIdentity unique identifier of app transfer or unique name of app. + * @param requestInit The initializer for the request. + */ + async info(appTransferIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/app-transfers/${appTransferIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing apps transfers. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/app-transfers`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing app transfer. + * + * @param appTransferIdentity unique identifier of app transfer or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appTransferIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/app-transfers/${appTransferIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/app-webhook-delivery-service.d.ts b/lib/esm/services/app-webhook-delivery-service.d.ts new file mode 100644 index 0000000..6d072b5 --- /dev/null +++ b/lib/esm/services/app-webhook-delivery-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App Webhook Delivery](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook-delivery) + * Represents the delivery of a webhook notification, including its current status. + */ +export default class AppWebhookDeliveryService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Returns the info for an existing delivery. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookDeliveryIdentity the delivery's unique identifier. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, appWebhookDeliveryIdentity: string, requestInit?: Omit): Promise; + /** + * Lists existing deliveries for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/app-webhook-delivery-service.js b/lib/esm/services/app-webhook-delivery-service.js new file mode 100644 index 0000000..a0bcc73 --- /dev/null +++ b/lib/esm/services/app-webhook-delivery-service.js @@ -0,0 +1,53 @@ +/** + * [Heroku Platform API - App Webhook Delivery](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook-delivery) + * Represents the delivery of a webhook notification, including its current status. + */ +export default class AppWebhookDeliveryService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Returns the info for an existing delivery. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookDeliveryIdentity the delivery's unique identifier. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, appWebhookDeliveryIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhook-deliveries/${appWebhookDeliveryIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Lists existing deliveries for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhook-deliveries`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/app-webhook-event-service.d.ts b/lib/esm/services/app-webhook-event-service.d.ts new file mode 100644 index 0000000..bf33134 --- /dev/null +++ b/lib/esm/services/app-webhook-event-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App Webhook Event](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook-event) + * Represents a webhook event that occurred. + */ +export default class AppWebhookEventService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Returns the info for a specified webhook event. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookEventIdentity the event's unique identifier. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, appWebhookEventIdentity: string, requestInit?: Omit): Promise; + /** + * Lists existing webhook events for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/app-webhook-event-service.js b/lib/esm/services/app-webhook-event-service.js new file mode 100644 index 0000000..871b7aa --- /dev/null +++ b/lib/esm/services/app-webhook-event-service.js @@ -0,0 +1,53 @@ +/** + * [Heroku Platform API - App Webhook Event](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook-event) + * Represents a webhook event that occurred. + */ +export default class AppWebhookEventService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Returns the info for a specified webhook event. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookEventIdentity the event's unique identifier. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, appWebhookEventIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhook-events/${appWebhookEventIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Lists existing webhook events for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhook-events`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/app-webhook-service.d.ts b/lib/esm/services/app-webhook-service.d.ts new file mode 100644 index 0000000..cb9ea2b --- /dev/null +++ b/lib/esm/services/app-webhook-service.d.ts @@ -0,0 +1,50 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App Webhook](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook) + * Represents the details of a webhook subscription + */ +export default class AppWebhookService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.AppWebhookCreatePayload, requestInit?: Omit): Promise; + /** + * Removes an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + delete(appIdentity: string, appWebhookIdentity: string, requestInit?: Omit): Promise; + /** + * Returns the info for an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, appWebhookIdentity: string, requestInit?: Omit): Promise; + /** + * List all webhook subscriptions for a particular app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; + /** + * Updates the details of an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookIdentity the webhook's unique identifier. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, appWebhookIdentity: string, payload: Heroku.AppWebhookUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/app-webhook-service.js b/lib/esm/services/app-webhook-service.js new file mode 100644 index 0000000..6a20b85 --- /dev/null +++ b/lib/esm/services/app-webhook-service.js @@ -0,0 +1,122 @@ +/** + * [Heroku Platform API - App Webhook](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook) + * Represents the details of a webhook subscription + */ +export default class AppWebhookService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhooks`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Removes an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + async delete(appIdentity, appWebhookIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Returns the info for an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, appWebhookIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List all webhook subscriptions for a particular app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhooks`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Updates the details of an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookIdentity the webhook's unique identifier. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, appWebhookIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/archive-service.d.ts b/lib/esm/services/archive-service.d.ts new file mode 100644 index 0000000..5445551 --- /dev/null +++ b/lib/esm/services/archive-service.d.ts @@ -0,0 +1,27 @@ +/** + * [Heroku Platform API - Audit Trail Archive](https://devcenter.heroku.com/articles/platform-api-reference#archive) + * An audit trail archive represents a monthly json zipped file containing events + */ +export default class ArchiveService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Get archive for a single month. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param archiveYear year of the archive + * @example 2019. + * @param archiveMonth month of the archive + * @example "10". + * @param requestInit The initializer for the request. + */ + info(enterpriseAccountIdentity: string, archiveYear: number, archiveMonth: '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12', requestInit?: Omit): Promise; + /** + * List existing archives. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + list(enterpriseAccountIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/archive-service.js b/lib/esm/services/archive-service.js new file mode 100644 index 0000000..ecab29c --- /dev/null +++ b/lib/esm/services/archive-service.js @@ -0,0 +1,48 @@ +/** + * [Heroku Platform API - Audit Trail Archive](https://devcenter.heroku.com/articles/platform-api-reference#archive) + * An audit trail archive represents a monthly json zipped file containing events + */ +export default class ArchiveService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Get archive for a single month. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param archiveYear year of the archive + * @example 2019. + * @param archiveMonth month of the archive + * @example "10". + * @param requestInit The initializer for the request. + */ + async info(enterpriseAccountIdentity, archiveYear, archiveMonth, requestInit = {}) { + await this.fetchImpl(`/enterprise-accounts/${enterpriseAccountIdentity}/archives/${archiveYear}/${archiveMonth}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } + /** + * List existing archives. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + async list(enterpriseAccountIdentity, requestInit = {}) { + await this.fetchImpl(`/enterprise-accounts/${enterpriseAccountIdentity}/archives`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } +} diff --git a/lib/esm/services/audit-trail-event-service.d.ts b/lib/esm/services/audit-trail-event-service.d.ts new file mode 100644 index 0000000..d6ffa6d --- /dev/null +++ b/lib/esm/services/audit-trail-event-service.d.ts @@ -0,0 +1,16 @@ +/** + * [Heroku Platform API - Audit Trail Event](https://devcenter.heroku.com/articles/platform-api-reference#audit-trail-event) + * An audit trail event represents some action on the platform + */ +export default class AuditTrailEventService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List existing events. Returns all events for one day, defaulting to current day. Order, actor, action, and type, and day query params can be specified as query parameters. For example, '/enterprise-accounts/:id/events?order=desc&actor=user@example.com&action=create&type=app&day=2020-09-30' would return events in descending order and only return app created events by the user with user@example.com email address. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + list(enterpriseAccountIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/audit-trail-event-service.js b/lib/esm/services/audit-trail-event-service.js new file mode 100644 index 0000000..9c103f3 --- /dev/null +++ b/lib/esm/services/audit-trail-event-service.js @@ -0,0 +1,28 @@ +/** + * [Heroku Platform API - Audit Trail Event](https://devcenter.heroku.com/articles/platform-api-reference#audit-trail-event) + * An audit trail event represents some action on the platform + */ +export default class AuditTrailEventService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List existing events. Returns all events for one day, defaulting to current day. Order, actor, action, and type, and day query params can be specified as query parameters. For example, '/enterprise-accounts/:id/events?order=desc&actor=user@example.com&action=create&type=app&day=2020-09-30' would return events in descending order and only return app created events by the user with user@example.com email address. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + async list(enterpriseAccountIdentity, requestInit = {}) { + await this.fetchImpl(`/enterprise-accounts/${enterpriseAccountIdentity}/events`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } +} diff --git a/lib/esm/services/build-service.d.ts b/lib/esm/services/build-service.d.ts new file mode 100644 index 0000000..cba4137 --- /dev/null +++ b/lib/esm/services/build-service.d.ts @@ -0,0 +1,48 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Build API - Build](https://devcenter.heroku.com/articles/platform-api-reference#build) + * A build represents the process of transforming a code tarball into a slug + */ +export default class BuildService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.BuildCreatePayload, requestInit?: Omit): Promise; + /** + * Info for existing build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param buildIdentity unique identifier of build. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, buildIdentity: string, requestInit?: Omit): Promise; + /** + * List existing build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; + /** + * Destroy a build cache. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + deleteCache(appIdentity: string, requestInit?: Omit): Promise; + /** + * Cancel running build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param buildIdentity unique identifier of build. + * @param requestInit The initializer for the request. + */ + cancel(appIdentity: string, buildIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/build-service.js b/lib/esm/services/build-service.js new file mode 100644 index 0000000..3555ce0 --- /dev/null +++ b/lib/esm/services/build-service.js @@ -0,0 +1,115 @@ +/** + * [Heroku Build API - Build](https://devcenter.heroku.com/articles/platform-api-reference#build) + * A build represents the process of transforming a code tarball into a slug + */ +export default class BuildService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/builds`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param buildIdentity unique identifier of build. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, buildIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/builds/${buildIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/builds`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Destroy a build cache. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async deleteCache(appIdentity, requestInit = {}) { + await this.fetchImpl(`/apps/${appIdentity}/build-cache`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + } + /** + * Cancel running build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param buildIdentity unique identifier of build. + * @param requestInit The initializer for the request. + */ + async cancel(appIdentity, buildIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/builds/${buildIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/buildpack-installation-service.d.ts b/lib/esm/services/buildpack-installation-service.d.ts new file mode 100644 index 0000000..c27f864 --- /dev/null +++ b/lib/esm/services/buildpack-installation-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Buildpack Installations](https://devcenter.heroku.com/articles/platform-api-reference#buildpack-installation) + * A buildpack installation represents a buildpack that will be run against an app. + */ +export default class BuildpackInstallationService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Update an app's buildpack installations. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, payload: Heroku.BuildpackInstallationUpdatePayload, requestInit?: Omit): Promise; + /** + * List an app's existing buildpack installations. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/buildpack-installation-service.js b/lib/esm/services/buildpack-installation-service.js new file mode 100644 index 0000000..7768889 --- /dev/null +++ b/lib/esm/services/buildpack-installation-service.js @@ -0,0 +1,55 @@ +/** + * [Heroku Platform API - Buildpack Installations](https://devcenter.heroku.com/articles/platform-api-reference#buildpack-installation) + * A buildpack installation represents a buildpack that will be run against an app. + */ +export default class BuildpackInstallationService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Update an app's buildpack installations. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/buildpack-installations`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List an app's existing buildpack installations. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/buildpack-installations`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/collaborator-service.d.ts b/lib/esm/services/collaborator-service.d.ts new file mode 100644 index 0000000..5460a41 --- /dev/null +++ b/lib/esm/services/collaborator-service.d.ts @@ -0,0 +1,41 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Collaborator](https://devcenter.heroku.com/articles/platform-api-reference#collaborator) + * A collaborator represents an account that has been given access to an app on Heroku. + */ +export default class CollaboratorService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new collaborator. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.CollaboratorCreatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing collaborator. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param collaboratorIdentity invited email address of collaborator or unique identifier of collaborator. + * @param requestInit The initializer for the request. + */ + delete(appIdentity: string, collaboratorIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing collaborator. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param collaboratorIdentity invited email address of collaborator or unique identifier of collaborator. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, collaboratorIdentity: string, requestInit?: Omit): Promise; + /** + * List existing collaborators. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/collaborator-service.js b/lib/esm/services/collaborator-service.js new file mode 100644 index 0000000..f05ddbd --- /dev/null +++ b/lib/esm/services/collaborator-service.js @@ -0,0 +1,98 @@ +/** + * [Heroku Platform API - Collaborator](https://devcenter.heroku.com/articles/platform-api-reference#collaborator) + * A collaborator represents an account that has been given access to an app on Heroku. + */ +export default class CollaboratorService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new collaborator. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/collaborators`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing collaborator. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param collaboratorIdentity invited email address of collaborator or unique identifier of collaborator. + * @param requestInit The initializer for the request. + */ + async delete(appIdentity, collaboratorIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/collaborators/${collaboratorIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing collaborator. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param collaboratorIdentity invited email address of collaborator or unique identifier of collaborator. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, collaboratorIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/collaborators/${collaboratorIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing collaborators. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/collaborators`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/config-var-service.d.ts b/lib/esm/services/config-var-service.d.ts new file mode 100644 index 0000000..9f288f3 --- /dev/null +++ b/lib/esm/services/config-var-service.d.ts @@ -0,0 +1,32 @@ +/** + * [Heroku Platform API - Config Vars](https://devcenter.heroku.com/articles/platform-api-reference#config-var) + * Config Vars allow you to manage the configuration information provided to an app on Heroku. + */ +export default class ConfigVarService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Get config-vars for app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + infoForApp(appIdentity: string, requestInit?: Omit): Promise>; + /** + * Get config-vars for a release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param releaseIdentity unique identifier of release or unique version assigned to the release. + * @param requestInit The initializer for the request. + */ + infoForAppRelease(appIdentity: string, releaseIdentity: string | number, requestInit?: Omit): Promise>; + /** + * Update config-vars for app. You can update existing config-vars by setting them again, and remove by setting it to `null`. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, payload: Record, requestInit?: Omit): Promise>; +} diff --git a/lib/esm/services/config-var-service.js b/lib/esm/services/config-var-service.js new file mode 100644 index 0000000..e7d3b1b --- /dev/null +++ b/lib/esm/services/config-var-service.js @@ -0,0 +1,76 @@ +/** + * [Heroku Platform API - Config Vars](https://devcenter.heroku.com/articles/platform-api-reference#config-var) + * Config Vars allow you to manage the configuration information provided to an app on Heroku. + */ +export default class ConfigVarService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Get config-vars for app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async infoForApp(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/config-vars`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Get config-vars for a release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param releaseIdentity unique identifier of release or unique version assigned to the release. + * @param requestInit The initializer for the request. + */ + async infoForAppRelease(appIdentity, releaseIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/releases/${releaseIdentity}/config-vars`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update config-vars for app. You can update existing config-vars by setting them again, and remove by setting it to `null`. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/config-vars`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/credit-service.d.ts b/lib/esm/services/credit-service.d.ts new file mode 100644 index 0000000..851ca1a --- /dev/null +++ b/lib/esm/services/credit-service.d.ts @@ -0,0 +1,30 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Credit](https://devcenter.heroku.com/articles/platform-api-reference#credit) + * A credit represents value that will be used up before further charges are assigned to an account. + */ +export default class CreditService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new credit. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.CreditCreatePayload, requestInit?: Omit): Promise; + /** + * Info for existing credit. + * + * @param creditIdentity unique identifier of credit. + * @param requestInit The initializer for the request. + */ + info(creditIdentity: string, requestInit?: Omit): Promise; + /** + * List existing credits. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/credit-service.js b/lib/esm/services/credit-service.js new file mode 100644 index 0000000..521d63c --- /dev/null +++ b/lib/esm/services/credit-service.js @@ -0,0 +1,73 @@ +/** + * [Heroku Platform API - Credit](https://devcenter.heroku.com/articles/platform-api-reference#credit) + * A credit represents value that will be used up before further charges are assigned to an account. + */ +export default class CreditService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new credit. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/credits`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing credit. + * + * @param creditIdentity unique identifier of credit. + * @param requestInit The initializer for the request. + */ + async info(creditIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/credits/${creditIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing credits. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/credits`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/domain-service.d.ts b/lib/esm/services/domain-service.d.ts new file mode 100644 index 0000000..792266e --- /dev/null +++ b/lib/esm/services/domain-service.d.ts @@ -0,0 +1,50 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Domain](https://devcenter.heroku.com/articles/platform-api-reference#domain) + * Domains define what web routes should be routed to an app on Heroku. + */ +export default class DomainService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new domain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.DomainCreatePayload, requestInit?: Omit): Promise; + /** + * Associate an SNI endpoint + * + * @param appIdentity unique identifier of app or unique name of app. + * @param domainIdentity unique identifier of this domain or full hostname. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, domainIdentity: string, payload: Heroku.DomainUpdatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing domain + * + * @param appIdentity unique identifier of app or unique name of app. + * @param domainIdentity unique identifier of this domain or full hostname. + * @param requestInit The initializer for the request. + */ + delete(appIdentity: string, domainIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing domain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param domainIdentity unique identifier of this domain or full hostname. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, domainIdentity: string, requestInit?: Omit): Promise; + /** + * List existing domains. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/domain-service.js b/lib/esm/services/domain-service.js new file mode 100644 index 0000000..4587116 --- /dev/null +++ b/lib/esm/services/domain-service.js @@ -0,0 +1,122 @@ +/** + * [Heroku Platform API - Domain](https://devcenter.heroku.com/articles/platform-api-reference#domain) + * Domains define what web routes should be routed to an app on Heroku. + */ +export default class DomainService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new domain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/domains`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Associate an SNI endpoint + * + * @param appIdentity unique identifier of app or unique name of app. + * @param domainIdentity unique identifier of this domain or full hostname. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, domainIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/domains/${domainIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing domain + * + * @param appIdentity unique identifier of app or unique name of app. + * @param domainIdentity unique identifier of this domain or full hostname. + * @param requestInit The initializer for the request. + */ + async delete(appIdentity, domainIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/domains/${domainIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing domain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param domainIdentity unique identifier of this domain or full hostname. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, domainIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/domains/${domainIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing domains. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/domains`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/dyno-service.d.ts b/lib/esm/services/dyno-service.d.ts new file mode 100644 index 0000000..c19baa0 --- /dev/null +++ b/lib/esm/services/dyno-service.d.ts @@ -0,0 +1,56 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Dyno](https://devcenter.heroku.com/articles/platform-api-reference#dyno) + * Dynos encapsulate running processes of an app on Heroku. Detailed information about dyno sizes can be found at: [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +export default class DynoService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.DynoCreatePayload, requestInit?: Omit): Promise; + /** + * Restart dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param requestInit The initializer for the request. + */ + restart(appIdentity: string, dynoIdentity: string, requestInit?: Omit): Promise>; + /** + * Restart all dynos. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + restartAll(appIdentity: string, requestInit?: Omit): Promise>; + /** + * Stop dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param requestInit The initializer for the request. + */ + stop(appIdentity: string, dynoIdentity: string, requestInit?: Omit): Promise>; + /** + * Info for existing dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, dynoIdentity: string, requestInit?: Omit): Promise; + /** + * List existing dynos. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/dyno-service.js b/lib/esm/services/dyno-service.js new file mode 100644 index 0000000..8e4aa5f --- /dev/null +++ b/lib/esm/services/dyno-service.js @@ -0,0 +1,141 @@ +/** + * [Heroku Platform API - Dyno](https://devcenter.heroku.com/articles/platform-api-reference#dyno) + * Dynos encapsulate running processes of an app on Heroku. Detailed information about dyno sizes can be found at: [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +export default class DynoService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Restart dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param requestInit The initializer for the request. + */ + async restart(appIdentity, dynoIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos/${dynoIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Restart all dynos. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async restartAll(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Stop dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param requestInit The initializer for the request. + */ + async stop(appIdentity, dynoIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos/${dynoIdentity}/actions/stop`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, dynoIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos/${dynoIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing dynos. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/dyno-size-service.d.ts b/lib/esm/services/dyno-size-service.d.ts new file mode 100644 index 0000000..aa9490c --- /dev/null +++ b/lib/esm/services/dyno-size-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Dyno Size](https://devcenter.heroku.com/articles/platform-api-reference#dyno-size) + * Dyno sizes are the values and details of sizes that can be assigned to dynos. This information can also be found at : [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +export default class DynoSizeService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing dyno size. + * + * @param dynoSizeIdentity unique identifier of this dyno size or the name of this dyno-size. + * @param requestInit The initializer for the request. + */ + info(dynoSizeIdentity: string, requestInit?: Omit): Promise; + /** + * List existing dyno sizes. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/dyno-size-service.js b/lib/esm/services/dyno-size-service.js new file mode 100644 index 0000000..7f5f022 --- /dev/null +++ b/lib/esm/services/dyno-size-service.js @@ -0,0 +1,51 @@ +/** + * [Heroku Platform API - Dyno Size](https://devcenter.heroku.com/articles/platform-api-reference#dyno-size) + * Dyno sizes are the values and details of sizes that can be assigned to dynos. This information can also be found at : [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +export default class DynoSizeService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing dyno size. + * + * @param dynoSizeIdentity unique identifier of this dyno size or the name of this dyno-size. + * @param requestInit The initializer for the request. + */ + async info(dynoSizeIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/dyno-sizes/${dynoSizeIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing dyno sizes. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/dyno-sizes`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/enterprise-account-daily-usage-service.d.ts b/lib/esm/services/enterprise-account-daily-usage-service.d.ts new file mode 100644 index 0000000..a14d3c5 --- /dev/null +++ b/lib/esm/services/enterprise-account-daily-usage-service.d.ts @@ -0,0 +1,19 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Enterprise Account Daily Usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-daily-usage) + * Usage for an enterprise account at a daily resolution. + */ +export default class EnterpriseAccountDailyUsageService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieves usage for an enterprise account for a range of days. Start and end dates can be specified as query parameters using the date format YYYY-MM-DD. The enterprise account identifier can be found from the [enterprise account list](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-list). + * + * @param enterpriseAccountId unique identifier of the enterprise account + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + info(enterpriseAccountId: string, payload: Heroku.EnterpriseAccountDailyUsageInfoPayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/enterprise-account-daily-usage-service.js b/lib/esm/services/enterprise-account-daily-usage-service.js new file mode 100644 index 0000000..fc2532c --- /dev/null +++ b/lib/esm/services/enterprise-account-daily-usage-service.js @@ -0,0 +1,35 @@ +/** + * [Heroku Platform API - Enterprise Account Daily Usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-daily-usage) + * Usage for an enterprise account at a daily resolution. + */ +export default class EnterpriseAccountDailyUsageService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieves usage for an enterprise account for a range of days. Start and end dates can be specified as query parameters using the date format YYYY-MM-DD. The enterprise account identifier can be found from the [enterprise account list](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-list). + * + * @param enterpriseAccountId unique identifier of the enterprise account + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async info(enterpriseAccountId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountId}/usage/daily`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/enterprise-account-member-service.d.ts b/lib/esm/services/enterprise-account-member-service.d.ts new file mode 100644 index 0000000..d548871 --- /dev/null +++ b/lib/esm/services/enterprise-account-member-service.d.ts @@ -0,0 +1,42 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Enterprise Account Member](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-member) + * Enterprise account members are users with access to an enterprise account. + */ +export default class EnterpriseAccountMemberService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List members in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + list(enterpriseAccountIdentity: string, requestInit?: Omit): Promise; + /** + * Create a member in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(enterpriseAccountIdentity: string, payload: Heroku.EnterpriseAccountMemberCreatePayload, requestInit?: Omit): Promise; + /** + * Update a member in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param enterpriseAccountMemberUserIdentity unique email address of account or unique identifier of an account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(enterpriseAccountIdentity: string, enterpriseAccountMemberUserIdentity: string, payload: Heroku.EnterpriseAccountMemberUpdatePayload, requestInit?: Omit): Promise; + /** + * delete a member in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param enterpriseAccountMemberUserIdentity unique email address of account or unique identifier of an account. + * @param requestInit The initializer for the request. + */ + delete(enterpriseAccountIdentity: string, enterpriseAccountMemberUserIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/enterprise-account-member-service.js b/lib/esm/services/enterprise-account-member-service.js new file mode 100644 index 0000000..8468013 --- /dev/null +++ b/lib/esm/services/enterprise-account-member-service.js @@ -0,0 +1,101 @@ +/** + * [Heroku Platform API - Enterprise Account Member](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-member) + * Enterprise account members are users with access to an enterprise account. + */ +export default class EnterpriseAccountMemberService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List members in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + async list(enterpriseAccountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/members`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a member in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(enterpriseAccountIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/members`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update a member in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param enterpriseAccountMemberUserIdentity unique email address of account or unique identifier of an account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(enterpriseAccountIdentity, enterpriseAccountMemberUserIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/members/${enterpriseAccountMemberUserIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * delete a member in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param enterpriseAccountMemberUserIdentity unique email address of account or unique identifier of an account. + * @param requestInit The initializer for the request. + */ + async delete(enterpriseAccountIdentity, enterpriseAccountMemberUserIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/members/${enterpriseAccountMemberUserIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/enterprise-account-monthly-usage-service.d.ts b/lib/esm/services/enterprise-account-monthly-usage-service.d.ts new file mode 100644 index 0000000..add7493 --- /dev/null +++ b/lib/esm/services/enterprise-account-monthly-usage-service.d.ts @@ -0,0 +1,19 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Enterprise Account Monthly Usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-monthly-usage) + * Usage for an enterprise account at a monthly resolution. + */ +export default class EnterpriseAccountMonthlyUsageService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieves usage for an enterprise account for a range of months. Start and end dates can be specified as query parameters using the date format YYYY-MM. If no end date is specified, one month of usage is returned. The enterprise account identifier can be found from the [enterprise account list](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-list). + * + * @param enterpriseAccountId unique identifier of the enterprise account + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + info(enterpriseAccountId: string, payload: Heroku.EnterpriseAccountMonthlyUsageInfoPayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/enterprise-account-monthly-usage-service.js b/lib/esm/services/enterprise-account-monthly-usage-service.js new file mode 100644 index 0000000..9c925c9 --- /dev/null +++ b/lib/esm/services/enterprise-account-monthly-usage-service.js @@ -0,0 +1,35 @@ +/** + * [Heroku Platform API - Enterprise Account Monthly Usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-monthly-usage) + * Usage for an enterprise account at a monthly resolution. + */ +export default class EnterpriseAccountMonthlyUsageService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieves usage for an enterprise account for a range of months. Start and end dates can be specified as query parameters using the date format YYYY-MM. If no end date is specified, one month of usage is returned. The enterprise account identifier can be found from the [enterprise account list](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-list). + * + * @param enterpriseAccountId unique identifier of the enterprise account + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async info(enterpriseAccountId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountId}/usage/monthly`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/enterprise-account-service.d.ts b/lib/esm/services/enterprise-account-service.d.ts new file mode 100644 index 0000000..17e5799 --- /dev/null +++ b/lib/esm/services/enterprise-account-service.d.ts @@ -0,0 +1,31 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Enterprise Account](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account) + * Enterprise accounts allow companies to manage their development teams and billing. + */ +export default class EnterpriseAccountService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List enterprise accounts in which you are a member. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Information about an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + info(enterpriseAccountIdentity: string, requestInit?: Omit): Promise; + /** + * Update enterprise account properties + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(enterpriseAccountIdentity: string, payload: Heroku.EnterpriseAccountUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/enterprise-account-service.js b/lib/esm/services/enterprise-account-service.js new file mode 100644 index 0000000..bf3c0a3 --- /dev/null +++ b/lib/esm/services/enterprise-account-service.js @@ -0,0 +1,74 @@ +/** + * [Heroku Platform API - Enterprise Account](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account) + * Enterprise accounts allow companies to manage their development teams and billing. + */ +export default class EnterpriseAccountService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List enterprise accounts in which you are a member. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Information about an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + async info(enterpriseAccountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update enterprise account properties + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(enterpriseAccountIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/filter-apps-service.d.ts b/lib/esm/services/filter-apps-service.d.ts new file mode 100644 index 0000000..a9945df --- /dev/null +++ b/lib/esm/services/filter-apps-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Filters](https://devcenter.heroku.com/articles/platform-api-reference#filter-apps) + * Filters are special endpoints to allow for API consumers to specify a subset of resources to consume in order to reduce the number of requests that are performed. Each filter endpoint endpoint is responsible for determining its supported request format. The endpoints are over POST in order to handle large request bodies without hitting request uri query length limitations, but the requests themselves are idempotent and will not have side effects. + */ +export default class FilterAppsService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Request an apps list filtered by app id. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + apps(payload: Heroku.Filter, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/filter-apps-service.js b/lib/esm/services/filter-apps-service.js new file mode 100644 index 0000000..4ad7a39 --- /dev/null +++ b/lib/esm/services/filter-apps-service.js @@ -0,0 +1,34 @@ +/** + * [Heroku Platform API - Filters](https://devcenter.heroku.com/articles/platform-api-reference#filter-apps) + * Filters are special endpoints to allow for API consumers to specify a subset of resources to consume in order to reduce the number of requests that are performed. Each filter endpoint endpoint is responsible for determining its supported request format. The endpoints are over POST in order to handle large request bodies without hitting request uri query length limitations, but the requests themselves are idempotent and will not have side effects. + */ +export default class FilterAppsService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Request an apps list filtered by app id. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async apps(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/filters/apps`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/formation-service.d.ts b/lib/esm/services/formation-service.d.ts new file mode 100644 index 0000000..208e548 --- /dev/null +++ b/lib/esm/services/formation-service.d.ts @@ -0,0 +1,42 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Formation](https://devcenter.heroku.com/articles/platform-api-reference#formation) + * The formation of processes that should be maintained for an app. Update the formation to scale processes or change dyno sizes. Available process type names and commands are defined by the `process_types` attribute for the [slug](#slug) currently released on an app. + */ +export default class FormationService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for a process type + * + * @param appIdentity unique identifier of app or unique name of app. + * @param formationIdentity unique identifier of this process type or type of process to maintain. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, formationIdentity: string, requestInit?: Omit): Promise; + /** + * List process type formation + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; + /** + * Batch update process types + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + batchUpdate(appIdentity: string, payload: Heroku.FormationBatchUpdatePayload, requestInit?: Omit): Promise; + /** + * Update process type + * + * @param appIdentity unique identifier of app or unique name of app. + * @param formationIdentity unique identifier of this process type or type of process to maintain. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, formationIdentity: string, payload: Heroku.FormationUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/formation-service.js b/lib/esm/services/formation-service.js new file mode 100644 index 0000000..e497819 --- /dev/null +++ b/lib/esm/services/formation-service.js @@ -0,0 +1,100 @@ +/** + * [Heroku Platform API - Formation](https://devcenter.heroku.com/articles/platform-api-reference#formation) + * The formation of processes that should be maintained for an app. Update the formation to scale processes or change dyno sizes. Available process type names and commands are defined by the `process_types` attribute for the [slug](#slug) currently released on an app. + */ +export default class FormationService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for a process type + * + * @param appIdentity unique identifier of app or unique name of app. + * @param formationIdentity unique identifier of this process type or type of process to maintain. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, formationIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formation/${formationIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List process type formation + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formation`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Batch update process types + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async batchUpdate(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formation`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update process type + * + * @param appIdentity unique identifier of app or unique name of app. + * @param formationIdentity unique identifier of this process type or type of process to maintain. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, formationIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formation/${formationIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/identity-provider-service.d.ts b/lib/esm/services/identity-provider-service.d.ts new file mode 100644 index 0000000..144c4d4 --- /dev/null +++ b/lib/esm/services/identity-provider-service.d.ts @@ -0,0 +1,48 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Identity Provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) + * Identity Providers represent the SAML configuration of teams or an Enterprise account + */ +export default class IdentityProviderService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Get a list of a team's Identity Providers + * + * @param teamName unique name of team + * @example "example". + * @param requestInit The initializer for the request. + */ + listByTeam(teamName: string, requestInit?: Omit): Promise; + /** + * Create an Identity Provider for a team + * + * @param teamName unique name of team + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + createByTeam(teamName: string, payload: Heroku.IdentityProviderCreateByTeamPayload, requestInit?: Omit): Promise; + /** + * Update a team's Identity Provider + * + * @param teamName unique name of team + * @example "example". + * @param identityProviderId unique identifier of this identity provider + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + updateByTeam(teamName: string, identityProviderId: string, payload: Heroku.IdentityProviderUpdateByTeamPayload, requestInit?: Omit): Promise; + /** + * Delete a team's Identity Provider + * + * @param teamName unique name of team + * @example "example". + * @param identityProviderId unique identifier of this identity provider + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + deleteByTeam(teamName: string, identityProviderId: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/identity-provider-service.js b/lib/esm/services/identity-provider-service.js new file mode 100644 index 0000000..c5a4e61 --- /dev/null +++ b/lib/esm/services/identity-provider-service.js @@ -0,0 +1,107 @@ +/** + * [Heroku Platform API - Identity Provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) + * Identity Providers represent the SAML configuration of teams or an Enterprise account + */ +export default class IdentityProviderService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Get a list of a team's Identity Providers + * + * @param teamName unique name of team + * @example "example". + * @param requestInit The initializer for the request. + */ + async listByTeam(teamName, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create an Identity Provider for a team + * + * @param teamName unique name of team + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async createByTeam(teamName, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update a team's Identity Provider + * + * @param teamName unique name of team + * @example "example". + * @param identityProviderId unique identifier of this identity provider + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async updateByTeam(teamName, identityProviderId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers/${identityProviderId}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete a team's Identity Provider + * + * @param teamName unique name of team + * @example "example". + * @param identityProviderId unique identifier of this identity provider + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async deleteByTeam(teamName, identityProviderId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers/${identityProviderId}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/inbound-ruleset-service.d.ts b/lib/esm/services/inbound-ruleset-service.d.ts new file mode 100644 index 0000000..aeb22e9 --- /dev/null +++ b/lib/esm/services/inbound-ruleset-service.d.ts @@ -0,0 +1,40 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Inbound Ruleset](https://devcenter.heroku.com/articles/platform-api-reference#inbound-ruleset) + * An inbound-ruleset is a collection of rules that specify what hosts can or cannot connect to an application. + */ +export default class InboundRulesetService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Current inbound ruleset for a space + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + current(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Info on an existing Inbound Ruleset + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param inboundRulesetIdentity unique identifier of an inbound-ruleset. + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, inboundRulesetIdentity: string, requestInit?: Omit): Promise; + /** + * List all inbound rulesets for a space + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + list(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Create a new inbound ruleset + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(spaceIdentity: string, payload: Heroku.InboundRulesetCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/inbound-ruleset-service.js b/lib/esm/services/inbound-ruleset-service.js new file mode 100644 index 0000000..b626489 --- /dev/null +++ b/lib/esm/services/inbound-ruleset-service.js @@ -0,0 +1,96 @@ +/** + * [Heroku Platform API - Inbound Ruleset](https://devcenter.heroku.com/articles/platform-api-reference#inbound-ruleset) + * An inbound-ruleset is a collection of rules that specify what hosts can or cannot connect to an application. + */ +export default class InboundRulesetService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Current inbound ruleset for a space + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async current(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/inbound-ruleset`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info on an existing Inbound Ruleset + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param inboundRulesetIdentity unique identifier of an inbound-ruleset. + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, inboundRulesetIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/inbound-rulesets/${inboundRulesetIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List all inbound rulesets for a space + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async list(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/inbound-rulesets`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a new inbound ruleset + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(spaceIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/inbound-ruleset`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/index.d.ts b/lib/esm/services/index.d.ts new file mode 100644 index 0000000..7fce78f --- /dev/null +++ b/lib/esm/services/index.d.ts @@ -0,0 +1,96 @@ +export * from './account-delinquency-service'; +export * from './account-feature-service'; +export * from './account-service'; +export * from './add-on-action-service'; +export * from './add-on-attachment-service'; +export * from './add-on-config-service'; +export * from './add-on-region-capability-service'; +export * from './add-on-service-service'; +export * from './add-on-webhook-delivery-service'; +export * from './add-on-webhook-event-service'; +export * from './add-on-webhook-service'; +export * from './add-on-service'; +export * from './allowed-add-on-service-service'; +export * from './app-feature-service'; +export * from './app-setup-service'; +export * from './app-transfer-service'; +export * from './app-webhook-delivery-service'; +export * from './app-webhook-event-service'; +export * from './app-webhook-service'; +export * from './app-service'; +export * from './archive-service'; +export * from './audit-trail-event-service'; +export * from './build-service'; +export * from './buildpack-installation-service'; +export * from './collaborator-service'; +export * from './config-var-service'; +export * from './credit-service'; +export * from './domain-service'; +export * from './dyno-size-service'; +export * from './dyno-service'; +export * from './enterprise-account-daily-usage-service'; +export * from './enterprise-account-member-service'; +export * from './enterprise-account-monthly-usage-service'; +export * from './enterprise-account-service'; +export * from './filter-apps-service'; +export * from './formation-service'; +export * from './identity-provider-service'; +export * from './inbound-ruleset-service'; +export * from './invoice-address-service'; +export * from './invoice-service'; +export * from './key-service'; +export * from './log-drain-service'; +export * from './log-session-service'; +export * from './oauth-authorization-service'; +export * from './oauth-client-service'; +export * from './oauth-grant-service'; +export * from './oauth-token-service'; +export * from './password-reset-service'; +export * from './peering-info-service'; +export * from './peering-service'; +export * from './permission-entity-service'; +export * from './pipeline-build-service'; +export * from './pipeline-config-var-service'; +export * from './pipeline-coupling-service'; +export * from './pipeline-deployment-service'; +export * from './pipeline-promotion-target-service'; +export * from './pipeline-promotion-service'; +export * from './pipeline-release-service'; +export * from './pipeline-stack-service'; +export * from './pipeline-transfer-service'; +export * from './pipeline-service'; +export * from './plan-service'; +export * from './rate-limit-service'; +export * from './region-service'; +export * from './release-service'; +export * from './review-app-service'; +export * from './review-app-config-service'; +export * from './slug-service'; +export * from './sms-number-service'; +export * from './sni-endpoint-service'; +export * from './source-service'; +export * from './space-app-access-service'; +export * from './space-nat-service'; +export * from './space-topology-service'; +export * from './space-transfer-service'; +export * from './space-service'; +export * from './stack-service'; +export * from './team-add-on-service'; +export * from './team-app-collaborator-service'; +export * from './team-app-permission-service'; +export * from './team-app-service'; +export * from './team-daily-usage-service'; +export * from './team-delinquency-service'; +export * from './team-feature-service'; +export * from './team-invitation-service'; +export * from './team-invoice-service'; +export * from './team-member-service'; +export * from './team-monthly-usage-service'; +export * from './team-preferences-service'; +export * from './team-space-service'; +export * from './team-service'; +export * from './test-case-service'; +export * from './test-node-service'; +export * from './test-run-service'; +export * from './user-preferences-service'; +export * from './vpn-connection-service'; diff --git a/lib/esm/services/index.js b/lib/esm/services/index.js new file mode 100644 index 0000000..7fce78f --- /dev/null +++ b/lib/esm/services/index.js @@ -0,0 +1,96 @@ +export * from './account-delinquency-service'; +export * from './account-feature-service'; +export * from './account-service'; +export * from './add-on-action-service'; +export * from './add-on-attachment-service'; +export * from './add-on-config-service'; +export * from './add-on-region-capability-service'; +export * from './add-on-service-service'; +export * from './add-on-webhook-delivery-service'; +export * from './add-on-webhook-event-service'; +export * from './add-on-webhook-service'; +export * from './add-on-service'; +export * from './allowed-add-on-service-service'; +export * from './app-feature-service'; +export * from './app-setup-service'; +export * from './app-transfer-service'; +export * from './app-webhook-delivery-service'; +export * from './app-webhook-event-service'; +export * from './app-webhook-service'; +export * from './app-service'; +export * from './archive-service'; +export * from './audit-trail-event-service'; +export * from './build-service'; +export * from './buildpack-installation-service'; +export * from './collaborator-service'; +export * from './config-var-service'; +export * from './credit-service'; +export * from './domain-service'; +export * from './dyno-size-service'; +export * from './dyno-service'; +export * from './enterprise-account-daily-usage-service'; +export * from './enterprise-account-member-service'; +export * from './enterprise-account-monthly-usage-service'; +export * from './enterprise-account-service'; +export * from './filter-apps-service'; +export * from './formation-service'; +export * from './identity-provider-service'; +export * from './inbound-ruleset-service'; +export * from './invoice-address-service'; +export * from './invoice-service'; +export * from './key-service'; +export * from './log-drain-service'; +export * from './log-session-service'; +export * from './oauth-authorization-service'; +export * from './oauth-client-service'; +export * from './oauth-grant-service'; +export * from './oauth-token-service'; +export * from './password-reset-service'; +export * from './peering-info-service'; +export * from './peering-service'; +export * from './permission-entity-service'; +export * from './pipeline-build-service'; +export * from './pipeline-config-var-service'; +export * from './pipeline-coupling-service'; +export * from './pipeline-deployment-service'; +export * from './pipeline-promotion-target-service'; +export * from './pipeline-promotion-service'; +export * from './pipeline-release-service'; +export * from './pipeline-stack-service'; +export * from './pipeline-transfer-service'; +export * from './pipeline-service'; +export * from './plan-service'; +export * from './rate-limit-service'; +export * from './region-service'; +export * from './release-service'; +export * from './review-app-service'; +export * from './review-app-config-service'; +export * from './slug-service'; +export * from './sms-number-service'; +export * from './sni-endpoint-service'; +export * from './source-service'; +export * from './space-app-access-service'; +export * from './space-nat-service'; +export * from './space-topology-service'; +export * from './space-transfer-service'; +export * from './space-service'; +export * from './stack-service'; +export * from './team-add-on-service'; +export * from './team-app-collaborator-service'; +export * from './team-app-permission-service'; +export * from './team-app-service'; +export * from './team-daily-usage-service'; +export * from './team-delinquency-service'; +export * from './team-feature-service'; +export * from './team-invitation-service'; +export * from './team-invoice-service'; +export * from './team-member-service'; +export * from './team-monthly-usage-service'; +export * from './team-preferences-service'; +export * from './team-space-service'; +export * from './team-service'; +export * from './test-case-service'; +export * from './test-node-service'; +export * from './test-run-service'; +export * from './user-preferences-service'; +export * from './vpn-connection-service'; diff --git a/lib/esm/services/invoice-address-service.d.ts b/lib/esm/services/invoice-address-service.d.ts new file mode 100644 index 0000000..85a750b --- /dev/null +++ b/lib/esm/services/invoice-address-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Vault API - Invoice Address](https://devcenter.heroku.com/articles/platform-api-reference#invoice-address) + * An invoice address represents the address that should be listed on an invoice. + */ +export default class InvoiceAddressService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieve existing invoice address. + * + * @param requestInit The initializer for the request. + */ + info(requestInit?: Omit): Promise; + /** + * Update invoice address for an account. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(payload: Heroku.InvoiceAddressUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/invoice-address-service.js b/lib/esm/services/invoice-address-service.js new file mode 100644 index 0000000..aeae79e --- /dev/null +++ b/lib/esm/services/invoice-address-service.js @@ -0,0 +1,53 @@ +/** + * [Heroku Vault API - Invoice Address](https://devcenter.heroku.com/articles/platform-api-reference#invoice-address) + * An invoice address represents the address that should be listed on an invoice. + */ +export default class InvoiceAddressService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieve existing invoice address. + * + * @param requestInit The initializer for the request. + */ + async info(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/invoice-address`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update invoice address for an account. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/invoice-address`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/invoice-service.d.ts b/lib/esm/services/invoice-service.d.ts new file mode 100644 index 0000000..2a859e3 --- /dev/null +++ b/lib/esm/services/invoice-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Invoice](https://devcenter.heroku.com/articles/platform-api-reference#invoice) + * An invoice is an itemized bill of goods for an account which includes pricing and charges. + */ +export default class InvoiceService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing invoice. + * + * @param invoiceIdentity human readable invoice number. + * @param requestInit The initializer for the request. + */ + info(invoiceIdentity: number, requestInit?: Omit): Promise; + /** + * List existing invoices. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/invoice-service.js b/lib/esm/services/invoice-service.js new file mode 100644 index 0000000..88b59a7 --- /dev/null +++ b/lib/esm/services/invoice-service.js @@ -0,0 +1,51 @@ +/** + * [Heroku Platform API - Invoice](https://devcenter.heroku.com/articles/platform-api-reference#invoice) + * An invoice is an itemized bill of goods for an account which includes pricing and charges. + */ +export default class InvoiceService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing invoice. + * + * @param invoiceIdentity human readable invoice number. + * @param requestInit The initializer for the request. + */ + async info(invoiceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/invoices/${invoiceIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing invoices. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/invoices`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/key-service.d.ts b/lib/esm/services/key-service.d.ts new file mode 100644 index 0000000..9ff0eed --- /dev/null +++ b/lib/esm/services/key-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Key](https://devcenter.heroku.com/articles/platform-api-reference#key) + * Keys represent public SSH keys associated with an account and are used to authorize accounts as they are performing git operations. + */ +export default class KeyService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing key. + * + * @param keyIdentity unique identifier of this key or a unique identifying string based on contents. + * @param requestInit The initializer for the request. + */ + info(keyIdentity: string, requestInit?: Omit): Promise; + /** + * List existing keys. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/key-service.js b/lib/esm/services/key-service.js new file mode 100644 index 0000000..7d60c6a --- /dev/null +++ b/lib/esm/services/key-service.js @@ -0,0 +1,51 @@ +/** + * [Heroku Platform API - Key](https://devcenter.heroku.com/articles/platform-api-reference#key) + * Keys represent public SSH keys associated with an account and are used to authorize accounts as they are performing git operations. + */ +export default class KeyService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing key. + * + * @param keyIdentity unique identifier of this key or a unique identifying string based on contents. + * @param requestInit The initializer for the request. + */ + async info(keyIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/keys/${keyIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing keys. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/keys`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/log-drain-service.d.ts b/lib/esm/services/log-drain-service.d.ts new file mode 100644 index 0000000..7bdee78 --- /dev/null +++ b/lib/esm/services/log-drain-service.d.ts @@ -0,0 +1,57 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Log Drain](https://devcenter.heroku.com/articles/platform-api-reference#log-drain) + * [Log drains](https://devcenter.heroku.com/articles/log-drains) provide a way to forward your Heroku logs to an external syslog server for long-term archiving. This external service must be configured to receive syslog packets from Heroku, whereupon its URL can be added to an app using this API. Some add-ons will add a log drain when they are provisioned to an app. These drains can only be removed by removing the add-on. + */ +export default class LogDrainService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new log drain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.LogDrainCreatePayload, requestInit?: Omit): Promise; + /** + * Update an add-on owned log drain. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param logDrainQueryIdentity unique identifier of this log drain or url associated with the log drain or token associated with the log drain. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(addOnIdentity: string, logDrainQueryIdentity: string, payload: Heroku.LogDrainUpdatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing log drain. Log drains added by add-ons can only be removed by removing the add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param logDrainQueryIdentity unique identifier of this log drain or url associated with the log drain or token associated with the log drain. + * @param requestInit The initializer for the request. + */ + delete(appIdentity: string, logDrainQueryIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing log drain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param logDrainQueryIdentity unique identifier of this log drain or url associated with the log drain or token associated with the log drain. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, logDrainQueryIdentity: string, requestInit?: Omit): Promise; + /** + * List existing log drains for an add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + listByAddOn(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * List existing log drains. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/log-drain-service.js b/lib/esm/services/log-drain-service.js new file mode 100644 index 0000000..9043b94 --- /dev/null +++ b/lib/esm/services/log-drain-service.js @@ -0,0 +1,142 @@ +/** + * [Heroku Platform API - Log Drain](https://devcenter.heroku.com/articles/platform-api-reference#log-drain) + * [Log drains](https://devcenter.heroku.com/articles/log-drains) provide a way to forward your Heroku logs to an external syslog server for long-term archiving. This external service must be configured to receive syslog packets from Heroku, whereupon its URL can be added to an app using this API. Some add-ons will add a log drain when they are provisioned to an app. These drains can only be removed by removing the add-on. + */ +export default class LogDrainService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new log drain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/log-drains`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an add-on owned log drain. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param logDrainQueryIdentity unique identifier of this log drain or url associated with the log drain or token associated with the log drain. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(addOnIdentity, logDrainQueryIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/log-drains/${logDrainQueryIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing log drain. Log drains added by add-ons can only be removed by removing the add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param logDrainQueryIdentity unique identifier of this log drain or url associated with the log drain or token associated with the log drain. + * @param requestInit The initializer for the request. + */ + async delete(appIdentity, logDrainQueryIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/log-drains/${logDrainQueryIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing log drain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param logDrainQueryIdentity unique identifier of this log drain or url associated with the log drain or token associated with the log drain. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, logDrainQueryIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/log-drains/${logDrainQueryIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing log drains for an add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async listByAddOn(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/log-drains`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing log drains. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/log-drains`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/log-session-service.d.ts b/lib/esm/services/log-session-service.d.ts new file mode 100644 index 0000000..4e9d0bd --- /dev/null +++ b/lib/esm/services/log-session-service.d.ts @@ -0,0 +1,18 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Log Session](https://devcenter.heroku.com/articles/platform-api-reference#log-session) + * A log session is a reference to the http based log stream for an app. + */ +export default class LogSessionService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new log session. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.LogSessionCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/log-session-service.js b/lib/esm/services/log-session-service.js new file mode 100644 index 0000000..13129bb --- /dev/null +++ b/lib/esm/services/log-session-service.js @@ -0,0 +1,35 @@ +/** + * [Heroku Platform API - Log Session](https://devcenter.heroku.com/articles/platform-api-reference#log-session) + * A log session is a reference to the http based log stream for an app. + */ +export default class LogSessionService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new log session. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/log-sessions`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/oauth-authorization-service.d.ts b/lib/esm/services/oauth-authorization-service.d.ts new file mode 100644 index 0000000..be4183c --- /dev/null +++ b/lib/esm/services/oauth-authorization-service.d.ts @@ -0,0 +1,44 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - OAuth Authorization](https://devcenter.heroku.com/articles/platform-api-reference#oauth-authorization) + * OAuth authorizations represent clients that a Heroku user has authorized to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export default class OauthAuthorizationService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new OAuth authorization. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.OauthAuthorizationCreatePayload, requestInit?: Omit): Promise; + /** + * Delete OAuth authorization. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param requestInit The initializer for the request. + */ + delete(oauthAuthorizationIdentity: string, requestInit?: Omit): Promise; + /** + * Info for an OAuth authorization. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param requestInit The initializer for the request. + */ + info(oauthAuthorizationIdentity: string, requestInit?: Omit): Promise; + /** + * List OAuth authorizations. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Regenerate OAuth tokens. This endpoint is only available to direct authorizations or privileged OAuth clients. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param requestInit The initializer for the request. + */ + regenerate(oauthAuthorizationIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/oauth-authorization-service.js b/lib/esm/services/oauth-authorization-service.js new file mode 100644 index 0000000..5a22530 --- /dev/null +++ b/lib/esm/services/oauth-authorization-service.js @@ -0,0 +1,115 @@ +/** + * [Heroku Platform API - OAuth Authorization](https://devcenter.heroku.com/articles/platform-api-reference#oauth-authorization) + * OAuth authorizations represent clients that a Heroku user has authorized to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export default class OauthAuthorizationService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new OAuth authorization. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete OAuth authorization. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param requestInit The initializer for the request. + */ + async delete(oauthAuthorizationIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations/${oauthAuthorizationIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for an OAuth authorization. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param requestInit The initializer for the request. + */ + async info(oauthAuthorizationIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations/${oauthAuthorizationIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List OAuth authorizations. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Regenerate OAuth tokens. This endpoint is only available to direct authorizations or privileged OAuth clients. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param requestInit The initializer for the request. + */ + async regenerate(oauthAuthorizationIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations/${oauthAuthorizationIdentity}/actions/regenerate-tokens`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/oauth-client-service.d.ts b/lib/esm/services/oauth-client-service.d.ts new file mode 100644 index 0000000..ca9368b --- /dev/null +++ b/lib/esm/services/oauth-client-service.d.ts @@ -0,0 +1,52 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - OAuth Client](https://devcenter.heroku.com/articles/platform-api-reference#oauth-client) + * OAuth clients are applications that Heroku users can authorize to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth). + */ +export default class OauthClientService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new OAuth client. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.OauthClientCreatePayload, requestInit?: Omit): Promise; + /** + * Delete OAuth client. + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param requestInit The initializer for the request. + */ + delete(oauthClientIdentity: string, requestInit?: Omit): Promise; + /** + * Info for an OAuth client. The output for unauthenticated requests excludes the `secret` parameter. + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param requestInit The initializer for the request. + */ + info(oauthClientIdentity: string, requestInit?: Omit): Promise; + /** + * List OAuth clients + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Update OAuth client + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(oauthClientIdentity: string, payload: Heroku.OauthClientUpdatePayload, requestInit?: Omit): Promise; + /** + * Rotate credentials for an OAuth client + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param requestInit The initializer for the request. + */ + rotateCredentials(oauthClientIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/oauth-client-service.js b/lib/esm/services/oauth-client-service.js new file mode 100644 index 0000000..d9e617e --- /dev/null +++ b/lib/esm/services/oauth-client-service.js @@ -0,0 +1,134 @@ +/** + * [Heroku Platform API - OAuth Client](https://devcenter.heroku.com/articles/platform-api-reference#oauth-client) + * OAuth clients are applications that Heroku users can authorize to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth). + */ +export default class OauthClientService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new OAuth client. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/clients`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete OAuth client. + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param requestInit The initializer for the request. + */ + async delete(oauthClientIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/clients/${oauthClientIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for an OAuth client. The output for unauthenticated requests excludes the `secret` parameter. + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param requestInit The initializer for the request. + */ + async info(oauthClientIdentity, requestInit = {}) { + await this.fetchImpl(`/oauth/clients/${oauthClientIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } + /** + * List OAuth clients + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/clients`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update OAuth client + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(oauthClientIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/clients/${oauthClientIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Rotate credentials for an OAuth client + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param requestInit The initializer for the request. + */ + async rotateCredentials(oauthClientIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/clients/${oauthClientIdentity}/actions/rotate-credentials`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/oauth-grant-service.d.ts b/lib/esm/services/oauth-grant-service.d.ts new file mode 100644 index 0000000..a1db013 --- /dev/null +++ b/lib/esm/services/oauth-grant-service.d.ts @@ -0,0 +1,9 @@ +/** + * [Heroku Platform API - OAuth Grant](https://devcenter.heroku.com/articles/platform-api-reference#oauth-grant) + * OAuth grants are used to obtain authorizations on behalf of a user. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export default class OauthGrantService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); +} diff --git a/lib/esm/services/oauth-grant-service.js b/lib/esm/services/oauth-grant-service.js new file mode 100644 index 0000000..ca7eced --- /dev/null +++ b/lib/esm/services/oauth-grant-service.js @@ -0,0 +1,12 @@ +/** + * [Heroku Platform API - OAuth Grant](https://devcenter.heroku.com/articles/platform-api-reference#oauth-grant) + * OAuth grants are used to obtain authorizations on behalf of a user. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export default class OauthGrantService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } +} diff --git a/lib/esm/services/oauth-token-service.d.ts b/lib/esm/services/oauth-token-service.d.ts new file mode 100644 index 0000000..aa68854 --- /dev/null +++ b/lib/esm/services/oauth-token-service.d.ts @@ -0,0 +1,24 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - OAuth Token](https://devcenter.heroku.com/articles/platform-api-reference#oauth-token) + * OAuth tokens provide access for authorized clients to act on behalf of a Heroku user to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export default class OauthTokenService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new OAuth token. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.OauthTokenCreatePayload, requestInit?: Omit): Promise; + /** + * Revoke OAuth access token. + * + * @param oauthTokenIdentity unique identifier of OAuth token. + * @param requestInit The initializer for the request. + */ + delete(oauthTokenIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/oauth-token-service.js b/lib/esm/services/oauth-token-service.js new file mode 100644 index 0000000..0e046b4 --- /dev/null +++ b/lib/esm/services/oauth-token-service.js @@ -0,0 +1,55 @@ +/** + * [Heroku Platform API - OAuth Token](https://devcenter.heroku.com/articles/platform-api-reference#oauth-token) + * OAuth tokens provide access for authorized clients to act on behalf of a Heroku user to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export default class OauthTokenService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new OAuth token. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/tokens`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Revoke OAuth access token. + * + * @param oauthTokenIdentity unique identifier of OAuth token. + * @param requestInit The initializer for the request. + */ + async delete(oauthTokenIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/tokens/${oauthTokenIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/password-reset-service.d.ts b/lib/esm/services/password-reset-service.d.ts new file mode 100644 index 0000000..f6138c4 --- /dev/null +++ b/lib/esm/services/password-reset-service.d.ts @@ -0,0 +1,26 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - PasswordReset](https://devcenter.heroku.com/articles/platform-api-reference#password-reset) + * A password reset represents a in-process password reset attempt. + */ +export default class PasswordResetService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Reset account's password. This will send a reset password link to the user's email address. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + resetPassword(payload: Heroku.PasswordResetResetPasswordPayload, requestInit?: Omit): Promise; + /** + * Complete password reset. + * + * @param passwordResetResetPasswordToken unique identifier of a password reset attempt + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + completeResetPassword(passwordResetResetPasswordToken: string, payload: Heroku.PasswordResetCompleteResetPasswordPayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/password-reset-service.js b/lib/esm/services/password-reset-service.js new file mode 100644 index 0000000..5b3cec8 --- /dev/null +++ b/lib/esm/services/password-reset-service.js @@ -0,0 +1,58 @@ +/** + * [Heroku Platform API - PasswordReset](https://devcenter.heroku.com/articles/platform-api-reference#password-reset) + * A password reset represents a in-process password reset attempt. + */ +export default class PasswordResetService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Reset account's password. This will send a reset password link to the user's email address. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async resetPassword(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/password-resets`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Complete password reset. + * + * @param passwordResetResetPasswordToken unique identifier of a password reset attempt + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async completeResetPassword(passwordResetResetPasswordToken, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/password-resets/${passwordResetResetPasswordToken}/actions/finalize`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/peering-info-service.d.ts b/lib/esm/services/peering-info-service.d.ts new file mode 100644 index 0000000..f0f5743 --- /dev/null +++ b/lib/esm/services/peering-info-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Peering Info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) + * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. + */ +export default class PeeringInfoService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Provides the necessary information to establish an AWS VPC Peering with your private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/peering-info-service.js b/lib/esm/services/peering-info-service.js new file mode 100644 index 0000000..072b0a1 --- /dev/null +++ b/lib/esm/services/peering-info-service.js @@ -0,0 +1,32 @@ +/** + * [Heroku Platform API - Peering Info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) + * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. + */ +export default class PeeringInfoService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Provides the necessary information to establish an AWS VPC Peering with your private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peering-info`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/peering-service.d.ts b/lib/esm/services/peering-service.d.ts new file mode 100644 index 0000000..8eba208 --- /dev/null +++ b/lib/esm/services/peering-service.d.ts @@ -0,0 +1,44 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) + * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + */ +export default class PeeringService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List peering connections of a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + list(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Accept a pending peering connection with a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. + * @example "pcx-123456789012". + * @param requestInit The initializer for the request. + */ + accept(spaceIdentity: string, peeringPcxId: string, requestInit?: Omit): Promise; + /** + * Destroy an active peering connection with a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. + * @example "pcx-123456789012". + * @param requestInit The initializer for the request. + */ + destroy(spaceIdentity: string, peeringPcxId: string, requestInit?: Omit): Promise; + /** + * Fetch information for existing peering connection + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. + * @example "pcx-123456789012". + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, peeringPcxId: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/peering-service.js b/lib/esm/services/peering-service.js new file mode 100644 index 0000000..edc2327 --- /dev/null +++ b/lib/esm/services/peering-service.js @@ -0,0 +1,100 @@ +/** + * [Heroku Platform API - Peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) + * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + */ +export default class PeeringService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List peering connections of a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async list(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Accept a pending peering connection with a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. + * @example "pcx-123456789012". + * @param requestInit The initializer for the request. + */ + async accept(spaceIdentity, peeringPcxId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}/actions/accept`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Destroy an active peering connection with a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. + * @example "pcx-123456789012". + * @param requestInit The initializer for the request. + */ + async destroy(spaceIdentity, peeringPcxId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Fetch information for existing peering connection + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. + * @example "pcx-123456789012". + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, peeringPcxId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/permission-entity-service.d.ts b/lib/esm/services/permission-entity-service.d.ts new file mode 100644 index 0000000..378f399 --- /dev/null +++ b/lib/esm/services/permission-entity-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Permission Entity](https://devcenter.heroku.com/articles/platform-api-reference#permission-entity) + * An owned entity including users' permissions. + */ +export default class PermissionEntityService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List permission entities for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/permission-entity-service.js b/lib/esm/services/permission-entity-service.js new file mode 100644 index 0000000..8fbb476 --- /dev/null +++ b/lib/esm/services/permission-entity-service.js @@ -0,0 +1,32 @@ +/** + * [Heroku Platform API - Permission Entity](https://devcenter.heroku.com/articles/platform-api-reference#permission-entity) + * An owned entity including users' permissions. + */ +export default class PermissionEntityService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List permission entities for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/permissions`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/pipeline-build-service.d.ts b/lib/esm/services/pipeline-build-service.d.ts new file mode 100644 index 0000000..f26ee6d --- /dev/null +++ b/lib/esm/services/pipeline-build-service.d.ts @@ -0,0 +1,18 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Build](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-build) + * Information about latest builds of apps in a pipeline. + */ +export default class PipelineBuildService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List latest builds for each app in a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + list(pipelineId: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/pipeline-build-service.js b/lib/esm/services/pipeline-build-service.js new file mode 100644 index 0000000..40c001c --- /dev/null +++ b/lib/esm/services/pipeline-build-service.js @@ -0,0 +1,33 @@ +/** + * [Heroku Platform API - Pipeline Build](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-build) + * Information about latest builds of apps in a pipeline. + */ +export default class PipelineBuildService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List latest builds for each app in a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async list(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/latest-builds`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/pipeline-config-var-service.d.ts b/lib/esm/services/pipeline-config-var-service.d.ts new file mode 100644 index 0000000..3204e16 --- /dev/null +++ b/lib/esm/services/pipeline-config-var-service.d.ts @@ -0,0 +1,30 @@ +/** + * [Heroku Platform API - Pipeline Config Vars](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-config-var) + * Pipeline Config Vars allow you to manage the configuration information provided to a pipeline. + */ +export default class PipelineConfigVarService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Get config-vars for a pipeline stage. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param pipelineCouplingStage target pipeline stage + * @example "production". + * @param requestInit The initializer for the request. + */ + infoForApp(pipelineId: string, pipelineCouplingStage: 'test' | 'review' | 'development' | 'staging' | 'production', requestInit?: Omit): Promise>; + /** + * Update config-vars for a pipeline stage. You can update existing config-vars by setting them again, and remove by setting it to `null`. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param pipelineCouplingStage target pipeline stage + * @example "production". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(pipelineId: string, pipelineCouplingStage: 'test' | 'review' | 'development' | 'staging' | 'production', payload: Record, requestInit?: Omit): Promise>; +} diff --git a/lib/esm/services/pipeline-config-var-service.js b/lib/esm/services/pipeline-config-var-service.js new file mode 100644 index 0000000..5e81087 --- /dev/null +++ b/lib/esm/services/pipeline-config-var-service.js @@ -0,0 +1,61 @@ +/** + * [Heroku Platform API - Pipeline Config Vars](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-config-var) + * Pipeline Config Vars allow you to manage the configuration information provided to a pipeline. + */ +export default class PipelineConfigVarService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Get config-vars for a pipeline stage. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param pipelineCouplingStage target pipeline stage + * @example "production". + * @param requestInit The initializer for the request. + */ + async infoForApp(pipelineId, pipelineCouplingStage, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/stage/${pipelineCouplingStage}/config-vars`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update config-vars for a pipeline stage. You can update existing config-vars by setting them again, and remove by setting it to `null`. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param pipelineCouplingStage target pipeline stage + * @example "production". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(pipelineId, pipelineCouplingStage, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/stage/${pipelineCouplingStage}/config-vars`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/pipeline-coupling-service.d.ts b/lib/esm/services/pipeline-coupling-service.d.ts new file mode 100644 index 0000000..53bde99 --- /dev/null +++ b/lib/esm/services/pipeline-coupling-service.d.ts @@ -0,0 +1,73 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Coupling](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-coupling) + * Information about an app's coupling to a pipeline + */ +export default class PipelineCouplingService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List couplings for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + listByPipeline(pipelineId: string, requestInit?: Omit): Promise; + /** + * List pipeline couplings for the current user. + * + * @param requestInit The initializer for the request. + */ + listByCurrentUser(requestInit?: Omit): Promise; + /** + * List pipeline couplings. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * List pipeline couplings for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + listByTeam(teamIdentity: string, requestInit?: Omit): Promise; + /** + * Create a new pipeline coupling. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.PipelineCouplingCreatePayload, requestInit?: Omit): Promise; + /** + * Info for an existing pipeline coupling. + * + * @param pipelineCouplingIdentity unique identifier of pipeline coupling. + * @param requestInit The initializer for the request. + */ + info(pipelineCouplingIdentity: string, requestInit?: Omit): Promise; + /** + * Delete an existing pipeline coupling. + * + * @param pipelineCouplingIdentity unique identifier of pipeline coupling. + * @param requestInit The initializer for the request. + */ + delete(pipelineCouplingIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing pipeline coupling. + * + * @param pipelineCouplingIdentity unique identifier of pipeline coupling. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(pipelineCouplingIdentity: string, payload: Heroku.PipelineCouplingUpdatePayload, requestInit?: Omit): Promise; + /** + * Info for an existing pipeline coupling. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + infoByApp(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/pipeline-coupling-service.js b/lib/esm/services/pipeline-coupling-service.js new file mode 100644 index 0000000..b69e0b4 --- /dev/null +++ b/lib/esm/services/pipeline-coupling-service.js @@ -0,0 +1,197 @@ +/** + * [Heroku Platform API - Pipeline Coupling](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-coupling) + * Information about an app's coupling to a pipeline + */ +export default class PipelineCouplingService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List couplings for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async listByPipeline(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/pipeline-couplings`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List pipeline couplings for the current user. + * + * @param requestInit The initializer for the request. + */ + async listByCurrentUser(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/~/pipeline-couplings`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List pipeline couplings. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-couplings`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List pipeline couplings for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async listByTeam(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/pipeline-couplings`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a new pipeline coupling. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-couplings`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for an existing pipeline coupling. + * + * @param pipelineCouplingIdentity unique identifier of pipeline coupling. + * @param requestInit The initializer for the request. + */ + async info(pipelineCouplingIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-couplings/${pipelineCouplingIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing pipeline coupling. + * + * @param pipelineCouplingIdentity unique identifier of pipeline coupling. + * @param requestInit The initializer for the request. + */ + async delete(pipelineCouplingIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-couplings/${pipelineCouplingIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing pipeline coupling. + * + * @param pipelineCouplingIdentity unique identifier of pipeline coupling. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(pipelineCouplingIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-couplings/${pipelineCouplingIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for an existing pipeline coupling. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async infoByApp(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/pipeline-couplings`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/pipeline-deployment-service.d.ts b/lib/esm/services/pipeline-deployment-service.d.ts new file mode 100644 index 0000000..05f283e --- /dev/null +++ b/lib/esm/services/pipeline-deployment-service.d.ts @@ -0,0 +1,18 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Deployment](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-deployment) + * Information about latest deployments of apps in a pipeline. + */ +export default class PipelineDeploymentService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List latest slug releases for each app in a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + list(pipelineId: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/pipeline-deployment-service.js b/lib/esm/services/pipeline-deployment-service.js new file mode 100644 index 0000000..be4cee4 --- /dev/null +++ b/lib/esm/services/pipeline-deployment-service.js @@ -0,0 +1,33 @@ +/** + * [Heroku Platform API - Pipeline Deployment](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-deployment) + * Information about latest deployments of apps in a pipeline. + */ +export default class PipelineDeploymentService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List latest slug releases for each app in a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async list(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/latest-deployments`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/pipeline-promotion-service.d.ts b/lib/esm/services/pipeline-promotion-service.d.ts new file mode 100644 index 0000000..bb8a4db --- /dev/null +++ b/lib/esm/services/pipeline-promotion-service.d.ts @@ -0,0 +1,24 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Promotion](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion) + * Promotions allow you to move code from an app in a pipeline to all targets + */ +export default class PipelinePromotionService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new promotion. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.PipelinePromotionCreatePayload, requestInit?: Omit): Promise; + /** + * Info for existing pipeline promotion. + * + * @param pipelinePromotionIdentity unique identifier of promotion. + * @param requestInit The initializer for the request. + */ + info(pipelinePromotionIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/pipeline-promotion-service.js b/lib/esm/services/pipeline-promotion-service.js new file mode 100644 index 0000000..f1a12ee --- /dev/null +++ b/lib/esm/services/pipeline-promotion-service.js @@ -0,0 +1,54 @@ +/** + * [Heroku Platform API - Pipeline Promotion](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion) + * Promotions allow you to move code from an app in a pipeline to all targets + */ +export default class PipelinePromotionService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new promotion. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-promotions`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing pipeline promotion. + * + * @param pipelinePromotionIdentity unique identifier of promotion. + * @param requestInit The initializer for the request. + */ + async info(pipelinePromotionIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-promotions/${pipelinePromotionIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/pipeline-promotion-target-service.d.ts b/lib/esm/services/pipeline-promotion-target-service.d.ts new file mode 100644 index 0000000..26f3ca5 --- /dev/null +++ b/lib/esm/services/pipeline-promotion-target-service.d.ts @@ -0,0 +1,18 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Promotion Target](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion-target) + * Promotion targets represent an individual app being promoted to + */ +export default class PipelinePromotionTargetService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List promotion targets belonging to an existing promotion. + * + * @param pipelinePromotionId unique identifier of promotion + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + list(pipelinePromotionId: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/pipeline-promotion-target-service.js b/lib/esm/services/pipeline-promotion-target-service.js new file mode 100644 index 0000000..0bed9c1 --- /dev/null +++ b/lib/esm/services/pipeline-promotion-target-service.js @@ -0,0 +1,33 @@ +/** + * [Heroku Platform API - Pipeline Promotion Target](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion-target) + * Promotion targets represent an individual app being promoted to + */ +export default class PipelinePromotionTargetService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List promotion targets belonging to an existing promotion. + * + * @param pipelinePromotionId unique identifier of promotion + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async list(pipelinePromotionId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-promotions/${pipelinePromotionId}/promotion-targets`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/pipeline-release-service.d.ts b/lib/esm/services/pipeline-release-service.d.ts new file mode 100644 index 0000000..a253dec --- /dev/null +++ b/lib/esm/services/pipeline-release-service.d.ts @@ -0,0 +1,18 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Release](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-release) + * Information about latest releases of apps in a pipeline. + */ +export default class PipelineReleaseService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List latest releases for each app in a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + list(pipelineId: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/pipeline-release-service.js b/lib/esm/services/pipeline-release-service.js new file mode 100644 index 0000000..51c2585 --- /dev/null +++ b/lib/esm/services/pipeline-release-service.js @@ -0,0 +1,33 @@ +/** + * [Heroku Platform API - Pipeline Release](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-release) + * Information about latest releases of apps in a pipeline. + */ +export default class PipelineReleaseService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List latest releases for each app in a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async list(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/latest-releases`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/pipeline-service.d.ts b/lib/esm/services/pipeline-service.d.ts new file mode 100644 index 0000000..05ae42d --- /dev/null +++ b/lib/esm/services/pipeline-service.d.ts @@ -0,0 +1,47 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * A pipeline allows grouping of apps into different stages. + */ +export default class PipelineService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new pipeline. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.PipelineCreatePayload, requestInit?: Omit): Promise; + /** + * Info for existing pipeline. + * + * @param pipelineIdentity unique identifier of pipeline or name of pipeline. + * @param requestInit The initializer for the request. + */ + info(pipelineIdentity: string, requestInit?: Omit): Promise; + /** + * Delete an existing pipeline. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + delete(pipelineId: string, requestInit?: Omit): Promise; + /** + * Update an existing pipeline. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(pipelineId: string, payload: Heroku.PipelineUpdatePayload, requestInit?: Omit): Promise; + /** + * List existing pipelines. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/pipeline-service.js b/lib/esm/services/pipeline-service.js new file mode 100644 index 0000000..541fe37 --- /dev/null +++ b/lib/esm/services/pipeline-service.js @@ -0,0 +1,119 @@ +/** + * [Heroku Platform API - Pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * A pipeline allows grouping of apps into different stages. + */ +export default class PipelineService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new pipeline. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing pipeline. + * + * @param pipelineIdentity unique identifier of pipeline or name of pipeline. + * @param requestInit The initializer for the request. + */ + async info(pipelineIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing pipeline. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async delete(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing pipeline. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(pipelineId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing pipelines. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/pipeline-stack-service.d.ts b/lib/esm/services/pipeline-stack-service.d.ts new file mode 100644 index 0000000..8165b53 --- /dev/null +++ b/lib/esm/services/pipeline-stack-service.d.ts @@ -0,0 +1,18 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Stack](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-stack) + * A pipeline's stack is determined by the apps in the pipeline. This is used during creation of CI and Review Apps that have no stack defined in app.json + */ +export default class PipelineStackService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * The stack for a given pipeline, used for CI and Review Apps that have no stack defined in app.json. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + defaultStack(pipelineId: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/pipeline-stack-service.js b/lib/esm/services/pipeline-stack-service.js new file mode 100644 index 0000000..511a36e --- /dev/null +++ b/lib/esm/services/pipeline-stack-service.js @@ -0,0 +1,33 @@ +/** + * [Heroku Platform API - Pipeline Stack](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-stack) + * A pipeline's stack is determined by the apps in the pipeline. This is used during creation of CI and Review Apps that have no stack defined in app.json + */ +export default class PipelineStackService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * The stack for a given pipeline, used for CI and Review Apps that have no stack defined in app.json. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async defaultStack(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/pipeline-stack`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/pipeline-transfer-service.d.ts b/lib/esm/services/pipeline-transfer-service.d.ts new file mode 100644 index 0000000..e2daf93 --- /dev/null +++ b/lib/esm/services/pipeline-transfer-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Transfer](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-transfer) + * A pipeline transfer is the process of changing pipeline ownership along with the contained apps. + */ +export default class PipelineTransferService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new pipeline transfer. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.PipelineTransferCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/pipeline-transfer-service.js b/lib/esm/services/pipeline-transfer-service.js new file mode 100644 index 0000000..c0eb11e --- /dev/null +++ b/lib/esm/services/pipeline-transfer-service.js @@ -0,0 +1,34 @@ +/** + * [Heroku Platform API - Pipeline Transfer](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-transfer) + * A pipeline transfer is the process of changing pipeline ownership along with the contained apps. + */ +export default class PipelineTransferService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new pipeline transfer. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-transfers`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/plan-service.d.ts b/lib/esm/services/plan-service.d.ts new file mode 100644 index 0000000..21b4a35 --- /dev/null +++ b/lib/esm/services/plan-service.d.ts @@ -0,0 +1,32 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Plan](https://devcenter.heroku.com/articles/platform-api-reference#plan) + * Plans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication. + */ +export default class PlanService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing plan. + * + * @param planIdentity unique identifier of this plan or unique name of this plan. + * @param requestInit The initializer for the request. + */ + info(planIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing plan by Add-on. + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param planIdentity unique identifier of this plan or unique name of this plan. + * @param requestInit The initializer for the request. + */ + infoByAddOn(addOnServiceIdentity: string, planIdentity: string, requestInit?: Omit): Promise; + /** + * List existing plans by Add-on. + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + listByAddOn(addOnServiceIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/plan-service.js b/lib/esm/services/plan-service.js new file mode 100644 index 0000000..fac0b20 --- /dev/null +++ b/lib/esm/services/plan-service.js @@ -0,0 +1,73 @@ +/** + * [Heroku Platform API - Plan](https://devcenter.heroku.com/articles/platform-api-reference#plan) + * Plans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication. + */ +export default class PlanService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing plan. + * + * @param planIdentity unique identifier of this plan or unique name of this plan. + * @param requestInit The initializer for the request. + */ + async info(planIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/plans/${planIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing plan by Add-on. + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param planIdentity unique identifier of this plan or unique name of this plan. + * @param requestInit The initializer for the request. + */ + async infoByAddOn(addOnServiceIdentity, planIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-services/${addOnServiceIdentity}/plans/${planIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing plans by Add-on. + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + async listByAddOn(addOnServiceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-services/${addOnServiceIdentity}/plans`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/rate-limit-service.d.ts b/lib/esm/services/rate-limit-service.d.ts new file mode 100644 index 0000000..696619a --- /dev/null +++ b/lib/esm/services/rate-limit-service.d.ts @@ -0,0 +1,16 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Rate Limit](https://devcenter.heroku.com/articles/platform-api-reference#rate-limit) + * Rate Limit represents the number of request tokens each account holds. Requests to this endpoint do not count towards the rate limit. + */ +export default class RateLimitService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for rate limits. + * + * @param requestInit The initializer for the request. + */ + info(requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/rate-limit-service.js b/lib/esm/services/rate-limit-service.js new file mode 100644 index 0000000..c6c5875 --- /dev/null +++ b/lib/esm/services/rate-limit-service.js @@ -0,0 +1,31 @@ +/** + * [Heroku Platform API - Rate Limit](https://devcenter.heroku.com/articles/platform-api-reference#rate-limit) + * Rate Limit represents the number of request tokens each account holds. Requests to this endpoint do not count towards the rate limit. + */ +export default class RateLimitService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for rate limits. + * + * @param requestInit The initializer for the request. + */ + async info(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/rate-limits`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/region-service.d.ts b/lib/esm/services/region-service.d.ts new file mode 100644 index 0000000..d837159 --- /dev/null +++ b/lib/esm/services/region-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * A region represents a geographic location in which your application may run. + */ +export default class RegionService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing region. + * + * @param regionIdentity unique identifier of region or unique name of region. + * @param requestInit The initializer for the request. + */ + info(regionIdentity: string, requestInit?: Omit): Promise; + /** + * List existing regions. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/region-service.js b/lib/esm/services/region-service.js new file mode 100644 index 0000000..31a7673 --- /dev/null +++ b/lib/esm/services/region-service.js @@ -0,0 +1,51 @@ +/** + * [Heroku Platform API - Region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * A region represents a geographic location in which your application may run. + */ +export default class RegionService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing region. + * + * @param regionIdentity unique identifier of region or unique name of region. + * @param requestInit The initializer for the request. + */ + async info(regionIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/regions/${regionIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing regions. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/regions`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/release-service.d.ts b/lib/esm/services/release-service.d.ts new file mode 100644 index 0000000..a864da3 --- /dev/null +++ b/lib/esm/services/release-service.d.ts @@ -0,0 +1,41 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * A release represents a combination of code, config vars and add-ons for an app on Heroku. + */ +export default class ReleaseService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param releaseIdentity unique identifier of release or unique version assigned to the release. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, releaseIdentity: string | number, requestInit?: Omit): Promise; + /** + * List existing releases. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; + /** + * Create new release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.ReleaseCreatePayload, requestInit?: Omit): Promise; + /** + * Rollback to an existing release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + rollback(appIdentity: string, payload: Heroku.ReleaseRollbackPayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/release-service.js b/lib/esm/services/release-service.js new file mode 100644 index 0000000..9182a37 --- /dev/null +++ b/lib/esm/services/release-service.js @@ -0,0 +1,99 @@ +/** + * [Heroku Platform API - Release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * A release represents a combination of code, config vars and add-ons for an app on Heroku. + */ +export default class ReleaseService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param releaseIdentity unique identifier of release or unique version assigned to the release. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, releaseIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/releases/${releaseIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing releases. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/releases`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create new release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/releases`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Rollback to an existing release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async rollback(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/releases`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/review-app-config-service.d.ts b/lib/esm/services/review-app-config-service.d.ts new file mode 100644 index 0000000..0c3c4d2 --- /dev/null +++ b/lib/esm/services/review-app-config-service.d.ts @@ -0,0 +1,44 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Review App Configuration](https://devcenter.heroku.com/articles/platform-api-reference#review-app-config) + * Review apps can be configured for pipelines. + */ +export default class ReviewAppConfigService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Enable review apps for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + enable(pipelineId: string, payload: Heroku.ReviewAppConfigEnablePayload, requestInit?: Omit): Promise; + /** + * Get review apps configuration for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + info(pipelineId: string, requestInit?: Omit): Promise; + /** + * Update review app configuration for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(pipelineId: string, payload: Heroku.ReviewAppConfigUpdatePayload, requestInit?: Omit): Promise; + /** + * Disable review apps for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + delete(pipelineId: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/review-app-config-service.js b/lib/esm/services/review-app-config-service.js new file mode 100644 index 0000000..4761fc4 --- /dev/null +++ b/lib/esm/services/review-app-config-service.js @@ -0,0 +1,103 @@ +/** + * [Heroku Platform API - Review App Configuration](https://devcenter.heroku.com/articles/platform-api-reference#review-app-config) + * Review apps can be configured for pipelines. + */ +export default class ReviewAppConfigService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Enable review apps for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async enable(pipelineId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/review-app-config`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Get review apps configuration for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async info(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/review-app-config`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update review app configuration for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(pipelineId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/review-app-config`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Disable review apps for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async delete(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/review-app-config`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/review-app-service.d.ts b/lib/esm/services/review-app-service.d.ts new file mode 100644 index 0000000..e6bbb98 --- /dev/null +++ b/lib/esm/services/review-app-service.d.ts @@ -0,0 +1,46 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Review App](https://devcenter.heroku.com/articles/platform-api-reference#review-app) + * An ephemeral app to review a set of changes + */ +export default class ReviewAppService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new review app + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.ReviewAppCreatePayload, requestInit?: Omit): Promise; + /** + * Gets an existing review app + * + * @param reviewAppId unique identifier of the review app. + * @param requestInit The initializer for the request. + */ + getReviewApp(reviewAppId: string, requestInit?: Omit): Promise; + /** + * Delete an existing review app + * + * @param reviewAppId unique identifier of the review app. + * @param requestInit The initializer for the request. + */ + delete(reviewAppId: string, requestInit?: Omit): Promise; + /** + * Get a review app using the associated app_id + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + getReviewAppByAppId(appIdentity: string, requestInit?: Omit): Promise; + /** + * List review apps for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + list(pipelineId: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/review-app-service.js b/lib/esm/services/review-app-service.js new file mode 100644 index 0000000..ffe1c8a --- /dev/null +++ b/lib/esm/services/review-app-service.js @@ -0,0 +1,116 @@ +/** + * [Review App](https://devcenter.heroku.com/articles/platform-api-reference#review-app) + * An ephemeral app to review a set of changes + */ +export default class ReviewAppService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new review app + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/review-apps`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Gets an existing review app + * + * @param reviewAppId unique identifier of the review app. + * @param requestInit The initializer for the request. + */ + async getReviewApp(reviewAppId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/review-apps/${reviewAppId}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing review app + * + * @param reviewAppId unique identifier of the review app. + * @param requestInit The initializer for the request. + */ + async delete(reviewAppId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/review-apps/${reviewAppId}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Get a review app using the associated app_id + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async getReviewAppByAppId(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/review-app`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List review apps for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async list(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/review-apps`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/slug-service.d.ts b/lib/esm/services/slug-service.d.ts new file mode 100644 index 0000000..92006d7 --- /dev/null +++ b/lib/esm/services/slug-service.d.ts @@ -0,0 +1,26 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Slug](https://devcenter.heroku.com/articles/platform-api-reference#slug) + * A slug is a snapshot of your application code that is ready to run on the platform. + */ +export default class SlugService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing slug. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param slugIdentity unique identifier of slug. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, slugIdentity: string, requestInit?: Omit): Promise; + /** + * Create a new slug. For more information please refer to [Deploying Slugs using the Platform API](https://devcenter.heroku.com/articles/platform-api-deploying-slugs). + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.SlugCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/slug-service.js b/lib/esm/services/slug-service.js new file mode 100644 index 0000000..2c02ce9 --- /dev/null +++ b/lib/esm/services/slug-service.js @@ -0,0 +1,56 @@ +/** + * [Heroku Platform API - Slug](https://devcenter.heroku.com/articles/platform-api-reference#slug) + * A slug is a snapshot of your application code that is ready to run on the platform. + */ +export default class SlugService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing slug. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param slugIdentity unique identifier of slug. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, slugIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/slugs/${slugIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a new slug. For more information please refer to [Deploying Slugs using the Platform API](https://devcenter.heroku.com/articles/platform-api-deploying-slugs). + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/slugs`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/sms-number-service.d.ts b/lib/esm/services/sms-number-service.d.ts new file mode 100644 index 0000000..025b489 --- /dev/null +++ b/lib/esm/services/sms-number-service.d.ts @@ -0,0 +1,31 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - SMS Number](https://devcenter.heroku.com/articles/platform-api-reference#sms-number) + * SMS numbers are used for recovery on accounts with two-factor authentication enabled. + */ +export default class SmsNumberService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Recover an account using an SMS recovery code + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + smsNumber(accountIdentity: string, requestInit?: Omit): Promise; + /** + * Recover an account using an SMS recovery code + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + recover(accountIdentity: string, requestInit?: Omit): Promise; + /** + * Confirm an SMS number change with a confirmation code + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + confirm(accountIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/sms-number-service.js b/lib/esm/services/sms-number-service.js new file mode 100644 index 0000000..4400509 --- /dev/null +++ b/lib/esm/services/sms-number-service.js @@ -0,0 +1,74 @@ +/** + * [Heroku Platform API - SMS Number](https://devcenter.heroku.com/articles/platform-api-reference#sms-number) + * SMS numbers are used for recovery on accounts with two-factor authentication enabled. + */ +export default class SmsNumberService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Recover an account using an SMS recovery code + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async smsNumber(accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}/sms-number`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Recover an account using an SMS recovery code + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async recover(accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}/sms-number/actions/recover`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Confirm an SMS number change with a confirmation code + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async confirm(accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}/sms-number/actions/confirm`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/sni-endpoint-service.d.ts b/lib/esm/services/sni-endpoint-service.d.ts new file mode 100644 index 0000000..090825a --- /dev/null +++ b/lib/esm/services/sni-endpoint-service.d.ts @@ -0,0 +1,50 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - SNI Endpoint](https://devcenter.heroku.com/articles/platform-api-reference#sni-endpoint) + * SNI Endpoint is a public address serving a custom SSL cert for HTTPS traffic, using the SNI TLS extension, to a Heroku app. + */ +export default class SniEndpointService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.SniEndpointCreatePayload, requestInit?: Omit): Promise; + /** + * Delete existing SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param sniEndpointIdentity unique identifier of this SNI endpoint or unique name for SNI endpoint. + * @param requestInit The initializer for the request. + */ + delete(appIdentity: string, sniEndpointIdentity: string, requestInit?: Omit): Promise; + /** + * Info for existing SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param sniEndpointIdentity unique identifier of this SNI endpoint or unique name for SNI endpoint. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, sniEndpointIdentity: string, requestInit?: Omit): Promise; + /** + * List existing SNI endpoints. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param sniEndpointIdentity unique identifier of this SNI endpoint or unique name for SNI endpoint. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, sniEndpointIdentity: string, payload: Heroku.SniEndpointUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/sni-endpoint-service.js b/lib/esm/services/sni-endpoint-service.js new file mode 100644 index 0000000..e8dc637 --- /dev/null +++ b/lib/esm/services/sni-endpoint-service.js @@ -0,0 +1,122 @@ +/** + * [Heroku Platform API - SNI Endpoint](https://devcenter.heroku.com/articles/platform-api-reference#sni-endpoint) + * SNI Endpoint is a public address serving a custom SSL cert for HTTPS traffic, using the SNI TLS extension, to a Heroku app. + */ +export default class SniEndpointService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sni-endpoints`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete existing SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param sniEndpointIdentity unique identifier of this SNI endpoint or unique name for SNI endpoint. + * @param requestInit The initializer for the request. + */ + async delete(appIdentity, sniEndpointIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sni-endpoints/${sniEndpointIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param sniEndpointIdentity unique identifier of this SNI endpoint or unique name for SNI endpoint. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, sniEndpointIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sni-endpoints/${sniEndpointIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing SNI endpoints. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sni-endpoints`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param sniEndpointIdentity unique identifier of this SNI endpoint or unique name for SNI endpoint. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, sniEndpointIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sni-endpoints/${sniEndpointIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/source-service.d.ts b/lib/esm/services/source-service.d.ts new file mode 100644 index 0000000..6c4185d --- /dev/null +++ b/lib/esm/services/source-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Source](https://devcenter.heroku.com/articles/platform-api-reference#source) + * A source is a location for uploading and downloading an application's source code. + */ +export default class SourceService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create URLs for uploading and downloading source. + * + * @param requestInit The initializer for the request. + */ + create(requestInit?: Omit): Promise; + /** + * Create URLs for uploading and downloading source. Deprecated in favor of `POST /sources` + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + createDeprecated(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/source-service.js b/lib/esm/services/source-service.js new file mode 100644 index 0000000..7b7d1af --- /dev/null +++ b/lib/esm/services/source-service.js @@ -0,0 +1,53 @@ +/** + * [Heroku Platform API - Source](https://devcenter.heroku.com/articles/platform-api-reference#source) + * A source is a location for uploading and downloading an application's source code. + */ +export default class SourceService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create URLs for uploading and downloading source. + * + * @param requestInit The initializer for the request. + */ + async create(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/sources`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create URLs for uploading and downloading source. Deprecated in favor of `POST /sources` + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async createDeprecated(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sources`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/space-app-access-service.d.ts b/lib/esm/services/space-app-access-service.d.ts new file mode 100644 index 0000000..3ca19ec --- /dev/null +++ b/lib/esm/services/space-app-access-service.d.ts @@ -0,0 +1,34 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Access](https://devcenter.heroku.com/articles/platform-api-reference#space-app-access) + * Space access represents the permissions a particular user has on a particular space. + */ +export default class SpaceAppAccessService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List permissions for a given user on a given space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, accountIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing user's set of permissions on a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(spaceIdentity: string, accountIdentity: string, payload: Heroku.SpaceAppAccessUpdatePayload, requestInit?: Omit): Promise; + /** + * List all users and their permissions on a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + list(spaceIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/space-app-access-service.js b/lib/esm/services/space-app-access-service.js new file mode 100644 index 0000000..e152256 --- /dev/null +++ b/lib/esm/services/space-app-access-service.js @@ -0,0 +1,77 @@ +/** + * [Heroku Platform API - Space Access](https://devcenter.heroku.com/articles/platform-api-reference#space-app-access) + * Space access represents the permissions a particular user has on a particular space. + */ +export default class SpaceAppAccessService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List permissions for a given user on a given space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, accountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/members/${accountIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing user's set of permissions on a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(spaceIdentity, accountIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/members/${accountIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List all users and their permissions on a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async list(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/members`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/space-nat-service.d.ts b/lib/esm/services/space-nat-service.d.ts new file mode 100644 index 0000000..2ac596f --- /dev/null +++ b/lib/esm/services/space-nat-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Network Address Translation](https://devcenter.heroku.com/articles/platform-api-reference#space-nat) + * Network address translation (NAT) for stable outbound IP addresses from a space + */ +export default class SpaceNatService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Current state of network address translation for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/space-nat-service.js b/lib/esm/services/space-nat-service.js new file mode 100644 index 0000000..19ae7fc --- /dev/null +++ b/lib/esm/services/space-nat-service.js @@ -0,0 +1,32 @@ +/** + * [Heroku Platform API - Space Network Address Translation](https://devcenter.heroku.com/articles/platform-api-reference#space-nat) + * Network address translation (NAT) for stable outbound IP addresses from a space + */ +export default class SpaceNatService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Current state of network address translation for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/nat`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/space-service.d.ts b/lib/esm/services/space-service.d.ts new file mode 100644 index 0000000..5ccd331 --- /dev/null +++ b/lib/esm/services/space-service.d.ts @@ -0,0 +1,45 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space](https://devcenter.heroku.com/articles/platform-api-reference#space) + * A space is an isolated, highly available, secure app execution environment. + */ +export default class SpaceService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List existing spaces. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Info for existing space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(spaceIdentity: string, payload: Heroku.SpaceUpdatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + delete(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Create a new space. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.SpaceCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/space-service.js b/lib/esm/services/space-service.js new file mode 100644 index 0000000..d8bae1d --- /dev/null +++ b/lib/esm/services/space-service.js @@ -0,0 +1,117 @@ +/** + * [Heroku Platform API - Space](https://devcenter.heroku.com/articles/platform-api-reference#space) + * A space is an isolated, highly available, secure app execution environment. + */ +export default class SpaceService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List existing spaces. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(spaceIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async delete(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a new space. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/space-topology-service.d.ts b/lib/esm/services/space-topology-service.d.ts new file mode 100644 index 0000000..5614190 --- /dev/null +++ b/lib/esm/services/space-topology-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Topology](https://devcenter.heroku.com/articles/platform-api-reference#space-topology) + * Space Topology provides you with a mechanism for viewing all the running dynos, formations and applications for a space. This is the same data thats used to power our DNS Service Discovery. + */ +export default class SpaceTopologyService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Current space topology + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + topology(spaceIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/space-topology-service.js b/lib/esm/services/space-topology-service.js new file mode 100644 index 0000000..ea51643 --- /dev/null +++ b/lib/esm/services/space-topology-service.js @@ -0,0 +1,32 @@ +/** + * [Heroku Platform API - Space Topology](https://devcenter.heroku.com/articles/platform-api-reference#space-topology) + * Space Topology provides you with a mechanism for viewing all the running dynos, formations and applications for a space. This is the same data thats used to power our DNS Service Discovery. + */ +export default class SpaceTopologyService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Current space topology + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async topology(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/topology`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/space-transfer-service.d.ts b/lib/esm/services/space-transfer-service.d.ts new file mode 100644 index 0000000..60f0189 --- /dev/null +++ b/lib/esm/services/space-transfer-service.d.ts @@ -0,0 +1,18 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Transfer](https://devcenter.heroku.com/articles/platform-api-reference#space-transfer) + * Transfer spaces between enterprise teams with the same Enterprise Account. + */ +export default class SpaceTransferService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Transfer space between enterprise teams + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + transfer(spaceIdentity: string, payload: Heroku.SpaceTransferTransferPayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/space-transfer-service.js b/lib/esm/services/space-transfer-service.js new file mode 100644 index 0000000..7d98f63 --- /dev/null +++ b/lib/esm/services/space-transfer-service.js @@ -0,0 +1,35 @@ +/** + * [Heroku Platform API - Space Transfer](https://devcenter.heroku.com/articles/platform-api-reference#space-transfer) + * Transfer spaces between enterprise teams with the same Enterprise Account. + */ +export default class SpaceTransferService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Transfer space between enterprise teams + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async transfer(spaceIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/transfer`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/stack-service.d.ts b/lib/esm/services/stack-service.d.ts new file mode 100644 index 0000000..471c0d8 --- /dev/null +++ b/lib/esm/services/stack-service.d.ts @@ -0,0 +1,23 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Stack](https://devcenter.heroku.com/articles/platform-api-reference#stack) + * Stacks are the different application execution environments available in the Heroku platform. + */ +export default class StackService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Stack info. + * + * @param stackIdentity unique name of stack or unique identifier of stack. + * @param requestInit The initializer for the request. + */ + info(stackIdentity: string, requestInit?: Omit): Promise; + /** + * List available stacks. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/stack-service.js b/lib/esm/services/stack-service.js new file mode 100644 index 0000000..3a4d107 --- /dev/null +++ b/lib/esm/services/stack-service.js @@ -0,0 +1,51 @@ +/** + * [Heroku Platform API - Stack](https://devcenter.heroku.com/articles/platform-api-reference#stack) + * Stacks are the different application execution environments available in the Heroku platform. + */ +export default class StackService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Stack info. + * + * @param stackIdentity unique name of stack or unique identifier of stack. + * @param requestInit The initializer for the request. + */ + async info(stackIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/stacks/${stackIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List available stacks. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/stacks`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/team-add-on-service.d.ts b/lib/esm/services/team-add-on-service.d.ts new file mode 100644 index 0000000..97465d4 --- /dev/null +++ b/lib/esm/services/team-add-on-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Add-on](https://devcenter.heroku.com/articles/platform-api-reference#team-add-on) + * + */ +export default class TeamAddOnService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List add-ons used across all Team apps + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + listForTeam(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-add-on-service.js b/lib/esm/services/team-add-on-service.js new file mode 100644 index 0000000..96ef71c --- /dev/null +++ b/lib/esm/services/team-add-on-service.js @@ -0,0 +1,32 @@ +/** + * [Heroku Platform API - Team Add-on](https://devcenter.heroku.com/articles/platform-api-reference#team-add-on) + * + */ +export default class TeamAddOnService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List add-ons used across all Team apps + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async listForTeam(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/addons`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/team-app-collaborator-service.d.ts b/lib/esm/services/team-app-collaborator-service.d.ts new file mode 100644 index 0000000..1b72c6a --- /dev/null +++ b/lib/esm/services/team-app-collaborator-service.d.ts @@ -0,0 +1,54 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team App Collaborator](https://devcenter.heroku.com/articles/platform-api-reference#team-app-collaborator) + * A team collaborator represents an account that has been given access to a team app on Heroku. + */ +export default class TeamAppCollaboratorService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new collaborator on a team app. Use this endpoint instead of the `/apps/{app_id_or_name}/collaborator` endpoint when you want the collaborator to be granted [permissions] (https://devcenter.heroku.com/articles/org-users-access#roles-and-permissions) according to their role in the team. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.TeamAppCollaboratorCreatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing collaborator from a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param teamAppCollaboratorIdentity invited email address of collaborator. + * @param requestInit The initializer for the request. + */ + delete(teamAppIdentity: string, teamAppCollaboratorIdentity: string, requestInit?: Omit): Promise; + /** + * Info for a collaborator on a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param teamAppCollaboratorIdentity invited email address of collaborator. + * @param requestInit The initializer for the request. + */ + info(teamAppIdentity: string, teamAppCollaboratorIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing collaborator from a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param teamAppCollaboratorIdentity invited email address of collaborator. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(teamAppIdentity: string, teamAppCollaboratorIdentity: string, payload: Heroku.TeamAppCollaboratorUpdatePayload, requestInit?: Omit): Promise; + /** + * List collaborators on a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param requestInit The initializer for the request. + */ + list(teamAppIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-app-collaborator-service.js b/lib/esm/services/team-app-collaborator-service.js new file mode 100644 index 0000000..5946d64 --- /dev/null +++ b/lib/esm/services/team-app-collaborator-service.js @@ -0,0 +1,126 @@ +/** + * [Heroku Platform API - Team App Collaborator](https://devcenter.heroku.com/articles/platform-api-reference#team-app-collaborator) + * A team collaborator represents an account that has been given access to a team app on Heroku. + */ +export default class TeamAppCollaboratorService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new collaborator on a team app. Use this endpoint instead of the `/apps/{app_id_or_name}/collaborator` endpoint when you want the collaborator to be granted [permissions] (https://devcenter.heroku.com/articles/org-users-access#roles-and-permissions) according to their role in the team. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${appIdentity}/collaborators`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing collaborator from a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param teamAppCollaboratorIdentity invited email address of collaborator. + * @param requestInit The initializer for the request. + */ + async delete(teamAppIdentity, teamAppCollaboratorIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}/collaborators/${teamAppCollaboratorIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for a collaborator on a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param teamAppCollaboratorIdentity invited email address of collaborator. + * @param requestInit The initializer for the request. + */ + async info(teamAppIdentity, teamAppCollaboratorIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}/collaborators/${teamAppCollaboratorIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update an existing collaborator from a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param teamAppCollaboratorIdentity invited email address of collaborator. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(teamAppIdentity, teamAppCollaboratorIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}/collaborators/${teamAppCollaboratorIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List collaborators on a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param requestInit The initializer for the request. + */ + async list(teamAppIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}/collaborators`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/team-app-permission-service.d.ts b/lib/esm/services/team-app-permission-service.d.ts new file mode 100644 index 0000000..32b0dd4 --- /dev/null +++ b/lib/esm/services/team-app-permission-service.d.ts @@ -0,0 +1,16 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team App Permission](https://devcenter.heroku.com/articles/platform-api-reference#team-app-permission) + * A team app permission is a behavior that is assigned to a user in a team app. + */ +export default class TeamAppPermissionService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Lists permissions available to teams. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-app-permission-service.js b/lib/esm/services/team-app-permission-service.js new file mode 100644 index 0000000..1a67519 --- /dev/null +++ b/lib/esm/services/team-app-permission-service.js @@ -0,0 +1,31 @@ +/** + * [Heroku Platform API - Team App Permission](https://devcenter.heroku.com/articles/platform-api-reference#team-app-permission) + * A team app permission is a behavior that is assigned to a user in a team app. + */ +export default class TeamAppPermissionService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Lists permissions available to teams. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/permissions`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/team-app-service.d.ts b/lib/esm/services/team-app-service.d.ts new file mode 100644 index 0000000..cd48797 --- /dev/null +++ b/lib/esm/services/team-app-service.d.ts @@ -0,0 +1,59 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team App](https://devcenter.heroku.com/articles/platform-api-reference#team-app) + * A team app encapsulates the team specific functionality of Heroku apps. + */ +export default class TeamAppService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new app in the specified team, in the default team if unspecified, or in personal account, if default team is not set. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.TeamAppCreatePayload, requestInit?: Omit): Promise; + /** + * Info for a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param requestInit The initializer for the request. + */ + info(teamAppIdentity: string, requestInit?: Omit): Promise; + /** + * Lock or unlock a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + updateLocked(teamAppIdentity: string, payload: Heroku.TeamAppUpdateLockedPayload, requestInit?: Omit): Promise; + /** + * Transfer an existing team app to another Heroku account. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + transferToAccount(teamAppIdentity: string, payload: Heroku.TeamAppTransferToAccountPayload, requestInit?: Omit): Promise; + /** + * Transfer an existing team app to another team. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + transferToTeam(teamAppIdentity: string, payload: Heroku.TeamAppTransferToTeamPayload, requestInit?: Omit): Promise; + /** + * List team apps. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + listByTeam(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-app-service.js b/lib/esm/services/team-app-service.js new file mode 100644 index 0000000..076eeee --- /dev/null +++ b/lib/esm/services/team-app-service.js @@ -0,0 +1,143 @@ +/** + * [Heroku Platform API - Team App](https://devcenter.heroku.com/articles/platform-api-reference#team-app) + * A team app encapsulates the team specific functionality of Heroku apps. + */ +export default class TeamAppService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new app in the specified team, in the default team if unspecified, or in personal account, if default team is not set. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param requestInit The initializer for the request. + */ + async info(teamAppIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Lock or unlock a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async updateLocked(teamAppIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Transfer an existing team app to another Heroku account. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async transferToAccount(teamAppIdentity, payload, requestInit = {}) { + await this.fetchImpl(`/teams/apps/${teamAppIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + } + /** + * Transfer an existing team app to another team. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async transferToTeam(teamAppIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List team apps. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async listByTeam(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/apps`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/team-daily-usage-service.d.ts b/lib/esm/services/team-daily-usage-service.d.ts new file mode 100644 index 0000000..71dc462 --- /dev/null +++ b/lib/esm/services/team-daily-usage-service.d.ts @@ -0,0 +1,19 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Daily Usage](https://devcenter.heroku.com/articles/platform-api-reference#team-daily-usage) + * Usage for an enterprise team at a daily resolution. + */ +export default class TeamDailyUsageService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieves usage for an enterprise team for a range of days. Start and end dates can be specified as query parameters using the date format YYYY-MM-DD. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list). + * + * @param teamId unique identifier of team + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + info(teamId: string, payload: Heroku.TeamDailyUsageInfoPayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-daily-usage-service.js b/lib/esm/services/team-daily-usage-service.js new file mode 100644 index 0000000..d55eb9a --- /dev/null +++ b/lib/esm/services/team-daily-usage-service.js @@ -0,0 +1,35 @@ +/** + * [Heroku Platform API - Team Daily Usage](https://devcenter.heroku.com/articles/platform-api-reference#team-daily-usage) + * Usage for an enterprise team at a daily resolution. + */ +export default class TeamDailyUsageService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieves usage for an enterprise team for a range of days. Start and end dates can be specified as query parameters using the date format YYYY-MM-DD. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list). + * + * @param teamId unique identifier of team + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async info(teamId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamId}/usage/daily`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/team-delinquency-service.d.ts b/lib/esm/services/team-delinquency-service.d.ts new file mode 100644 index 0000000..ae81ba8 --- /dev/null +++ b/lib/esm/services/team-delinquency-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Delinquency](https://devcenter.heroku.com/articles/platform-api-reference#team-delinquency) + * A Heroku team becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent teams if their invoices remain unpaid. + */ +export default class TeamDelinquencyService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Team delinquency information. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + info(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-delinquency-service.js b/lib/esm/services/team-delinquency-service.js new file mode 100644 index 0000000..fd1f225 --- /dev/null +++ b/lib/esm/services/team-delinquency-service.js @@ -0,0 +1,32 @@ +/** + * [Heroku Platform API - Team Delinquency](https://devcenter.heroku.com/articles/platform-api-reference#team-delinquency) + * A Heroku team becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent teams if their invoices remain unpaid. + */ +export default class TeamDelinquencyService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Team delinquency information. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async info(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/delinquency`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/team-feature-service.d.ts b/lib/esm/services/team-feature-service.d.ts new file mode 100644 index 0000000..731db5c --- /dev/null +++ b/lib/esm/services/team-feature-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Feature](https://devcenter.heroku.com/articles/platform-api-reference#team-feature) + * A team feature represents a feature enabled on a team account. + */ +export default class TeamFeatureService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for an existing team feature. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamFeatureIdentity unique identifier of team feature or unique name of team feature. + * @param requestInit The initializer for the request. + */ + info(teamIdentity: string, teamFeatureIdentity: string, requestInit?: Omit): Promise; + /** + * List existing team features. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-feature-service.js b/lib/esm/services/team-feature-service.js new file mode 100644 index 0000000..0b3b3ed --- /dev/null +++ b/lib/esm/services/team-feature-service.js @@ -0,0 +1,53 @@ +/** + * [Heroku Platform API - Team Feature](https://devcenter.heroku.com/articles/platform-api-reference#team-feature) + * A team feature represents a feature enabled on a team account. + */ +export default class TeamFeatureService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for an existing team feature. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamFeatureIdentity unique identifier of team feature or unique name of team feature. + * @param requestInit The initializer for the request. + */ + async info(teamIdentity, teamFeatureIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/features/${teamFeatureIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing team features. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/features`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/team-invitation-service.d.ts b/lib/esm/services/team-invitation-service.d.ts new file mode 100644 index 0000000..202932f --- /dev/null +++ b/lib/esm/services/team-invitation-service.d.ts @@ -0,0 +1,50 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Invitation](https://devcenter.heroku.com/articles/platform-api-reference#team-invitation) + * A team invitation represents an invite to a team. + */ +export default class TeamInvitationService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Get a list of a team's Identity Providers + * + * @param teamName unique name of team + * @example "example". + * @param requestInit The initializer for the request. + */ + list(teamName: string, requestInit?: Omit): Promise; + /** + * Create Team Invitation + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(teamIdentity: string, payload: Heroku.TeamInvitationCreatePayload, requestInit?: Omit): Promise; + /** + * Revoke a team invitation. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamInvitationIdentity unique identifier of an invitation. + * @param requestInit The initializer for the request. + */ + revoke(teamIdentity: string, teamInvitationIdentity: string, requestInit?: Omit): Promise; + /** + * Get an invitation by its token + * + * @param teamInvitationToken special token for invitation + * @example "614ae25aa2d4802096cd7c18625b526c". + * @param requestInit The initializer for the request. + */ + get(teamInvitationToken: string, requestInit?: Omit): Promise; + /** + * Accept Team Invitation + * + * @param teamInvitationToken special token for invitation + * @example "614ae25aa2d4802096cd7c18625b526c". + * @param requestInit The initializer for the request. + */ + accept(teamInvitationToken: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-invitation-service.js b/lib/esm/services/team-invitation-service.js new file mode 100644 index 0000000..d03c6b6 --- /dev/null +++ b/lib/esm/services/team-invitation-service.js @@ -0,0 +1,121 @@ +/** + * [Heroku Platform API - Team Invitation](https://devcenter.heroku.com/articles/platform-api-reference#team-invitation) + * A team invitation represents an invite to a team. + */ +export default class TeamInvitationService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Get a list of a team's Identity Providers + * + * @param teamName unique name of team + * @example "example". + * @param requestInit The initializer for the request. + */ + async list(teamName, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/invitations`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create Team Invitation + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(teamIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/invitations`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Revoke a team invitation. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamInvitationIdentity unique identifier of an invitation. + * @param requestInit The initializer for the request. + */ + async revoke(teamIdentity, teamInvitationIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/invitations/${teamInvitationIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Get an invitation by its token + * + * @param teamInvitationToken special token for invitation + * @example "614ae25aa2d4802096cd7c18625b526c". + * @param requestInit The initializer for the request. + */ + async get(teamInvitationToken, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/invitations/${teamInvitationToken}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Accept Team Invitation + * + * @param teamInvitationToken special token for invitation + * @example "614ae25aa2d4802096cd7c18625b526c". + * @param requestInit The initializer for the request. + */ + async accept(teamInvitationToken, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/invitations/${teamInvitationToken}/accept`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/team-invoice-service.d.ts b/lib/esm/services/team-invoice-service.d.ts new file mode 100644 index 0000000..e06b37c --- /dev/null +++ b/lib/esm/services/team-invoice-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Invoice](https://devcenter.heroku.com/articles/platform-api-reference#team-invoice) + * A Team Invoice is an itemized bill of goods for a team which includes pricing and charges. + */ +export default class TeamInvoiceService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for existing invoice. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamInvoiceIdentity human readable invoice number. + * @param requestInit The initializer for the request. + */ + info(teamIdentity: string, teamInvoiceIdentity: number, requestInit?: Omit): Promise; + /** + * List existing invoices. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-invoice-service.js b/lib/esm/services/team-invoice-service.js new file mode 100644 index 0000000..7af4864 --- /dev/null +++ b/lib/esm/services/team-invoice-service.js @@ -0,0 +1,53 @@ +/** + * [Heroku Platform API - Team Invoice](https://devcenter.heroku.com/articles/platform-api-reference#team-invoice) + * A Team Invoice is an itemized bill of goods for a team which includes pricing and charges. + */ +export default class TeamInvoiceService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for existing invoice. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamInvoiceIdentity human readable invoice number. + * @param requestInit The initializer for the request. + */ + async info(teamIdentity, teamInvoiceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/invoices/${teamInvoiceIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List existing invoices. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/invoices`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/team-member-service.d.ts b/lib/esm/services/team-member-service.d.ts new file mode 100644 index 0000000..7a71562 --- /dev/null +++ b/lib/esm/services/team-member-service.d.ts @@ -0,0 +1,57 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Member](https://devcenter.heroku.com/articles/platform-api-reference#team-member) + * A team member is an individual with access to a team. + */ +export default class TeamMemberService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new team member, or update their role. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + createOrUpdate(teamIdentity: string, payload: Heroku.TeamMemberCreateOrUpdatePayload, requestInit?: Omit): Promise; + /** + * Create a new team member. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(teamIdentity: string, payload: Heroku.TeamMemberCreatePayload, requestInit?: Omit): Promise; + /** + * Update a team member. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(teamIdentity: string, payload: Heroku.TeamMemberUpdatePayload, requestInit?: Omit): Promise; + /** + * Remove a member from the team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamMemberIdentity email address of the team member or unique identifier of the team member. + * @param requestInit The initializer for the request. + */ + delete(teamIdentity: string, teamMemberIdentity: string, requestInit?: Omit): Promise; + /** + * List members of the team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamIdentity: string, requestInit?: Omit): Promise; + /** + * List the apps of a team member. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamMemberIdentity email address of the team member or unique identifier of the team member. + * @param requestInit The initializer for the request. + */ + listByMember(teamIdentity: string, teamMemberIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-member-service.js b/lib/esm/services/team-member-service.js new file mode 100644 index 0000000..b11c6b9 --- /dev/null +++ b/lib/esm/services/team-member-service.js @@ -0,0 +1,144 @@ +/** + * [Heroku Platform API - Team Member](https://devcenter.heroku.com/articles/platform-api-reference#team-member) + * A team member is an individual with access to a team. + */ +export default class TeamMemberService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new team member, or update their role. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async createOrUpdate(teamIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a new team member. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(teamIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update a team member. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(teamIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Remove a member from the team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamMemberIdentity email address of the team member or unique identifier of the team member. + * @param requestInit The initializer for the request. + */ + async delete(teamIdentity, teamMemberIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members/${teamMemberIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List members of the team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List the apps of a team member. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamMemberIdentity email address of the team member or unique identifier of the team member. + * @param requestInit The initializer for the request. + */ + async listByMember(teamIdentity, teamMemberIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members/${teamMemberIdentity}/apps`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/team-monthly-usage-service.d.ts b/lib/esm/services/team-monthly-usage-service.d.ts new file mode 100644 index 0000000..d045d61 --- /dev/null +++ b/lib/esm/services/team-monthly-usage-service.d.ts @@ -0,0 +1,19 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Monthly Usage](https://devcenter.heroku.com/articles/platform-api-reference#team-monthly-usage) + * Usage for an enterprise team at a monthly resolution. + */ +export default class TeamMonthlyUsageService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieves usage for an enterprise team for a range of months. Start and end dates can be specified as query parameters using the date, YYYY-MM. If no end date is specified, one month of usage is returned. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list). + * + * @param teamId unique identifier of team + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + info(teamId: string, payload: Heroku.TeamMonthlyUsageInfoPayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-monthly-usage-service.js b/lib/esm/services/team-monthly-usage-service.js new file mode 100644 index 0000000..0522373 --- /dev/null +++ b/lib/esm/services/team-monthly-usage-service.js @@ -0,0 +1,35 @@ +/** + * [Heroku Platform API - Team Monthly Usage](https://devcenter.heroku.com/articles/platform-api-reference#team-monthly-usage) + * Usage for an enterprise team at a monthly resolution. + */ +export default class TeamMonthlyUsageService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieves usage for an enterprise team for a range of months. Start and end dates can be specified as query parameters using the date, YYYY-MM. If no end date is specified, one month of usage is returned. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list). + * + * @param teamId unique identifier of team + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async info(teamId, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamId}/usage/monthly`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/team-preferences-service.d.ts b/lib/esm/services/team-preferences-service.d.ts new file mode 100644 index 0000000..daabf34 --- /dev/null +++ b/lib/esm/services/team-preferences-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Preferences](https://devcenter.heroku.com/articles/platform-api-reference#team-preferences) + * Tracks a Team's Preferences + */ +export default class TeamPreferencesService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieve Team Preferences + * + * @param teamPreferencesIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamPreferencesIdentity: string, requestInit?: Omit): Promise; + /** + * Update Team Preferences + * + * @param teamPreferencesIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(teamPreferencesIdentity: string, payload: Heroku.TeamPreferencesUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-preferences-service.js b/lib/esm/services/team-preferences-service.js new file mode 100644 index 0000000..a5cbdd6 --- /dev/null +++ b/lib/esm/services/team-preferences-service.js @@ -0,0 +1,55 @@ +/** + * [Heroku Platform API - Team Preferences](https://devcenter.heroku.com/articles/platform-api-reference#team-preferences) + * Tracks a Team's Preferences + */ +export default class TeamPreferencesService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieve Team Preferences + * + * @param teamPreferencesIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamPreferencesIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamPreferencesIdentity}/preferences`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update Team Preferences + * + * @param teamPreferencesIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(teamPreferencesIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamPreferencesIdentity}/preferences`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/team-service.d.ts b/lib/esm/services/team-service.d.ts new file mode 100644 index 0000000..de52b88 --- /dev/null +++ b/lib/esm/services/team-service.d.ts @@ -0,0 +1,60 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * Teams allow you to manage access to a shared group of applications and other resources. + */ +export default class TeamService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List teams in which you are a member. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * Info for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + info(teamIdentity: string, requestInit?: Omit): Promise; + /** + * Update team properties. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(teamIdentity: string, payload: Heroku.TeamUpdatePayload, requestInit?: Omit): Promise; + /** + * Create a new team. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.TeamCreatePayload, requestInit?: Omit): Promise; + /** + * Delete an existing team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + delete(teamIdentity: string, requestInit?: Omit): Promise; + /** + * List teams for an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + listByEnterpriseAccount(enterpriseAccountIdentity: string, requestInit?: Omit): Promise; + /** + * Create a team in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + createInEnterpriseAccount(enterpriseAccountIdentity: string, payload: Heroku.TeamCreateInEnterpriseAccountPayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-service.js b/lib/esm/services/team-service.js new file mode 100644 index 0000000..b124686 --- /dev/null +++ b/lib/esm/services/team-service.js @@ -0,0 +1,160 @@ +/** + * [Heroku Platform API - Team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * Teams allow you to manage access to a shared group of applications and other resources. + */ +export default class TeamService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List teams in which you are a member. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async info(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update team properties. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(teamIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a new team. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Delete an existing team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async delete(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List teams for an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + async listByEnterpriseAccount(enterpriseAccountIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/teams`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Create a team in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async createInEnterpriseAccount(enterpriseAccountIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/teams`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/team-space-service.d.ts b/lib/esm/services/team-space-service.d.ts new file mode 100644 index 0000000..b2e416a --- /dev/null +++ b/lib/esm/services/team-space-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Space](https://devcenter.heroku.com/articles/platform-api-reference#team-space) + * A space is an isolated, highly available, secure app execution environment. + */ +export default class TeamSpaceService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List spaces owned by the team + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-space-service.js b/lib/esm/services/team-space-service.js new file mode 100644 index 0000000..ae54768 --- /dev/null +++ b/lib/esm/services/team-space-service.js @@ -0,0 +1,32 @@ +/** + * [Heroku Platform API - Team Space](https://devcenter.heroku.com/articles/platform-api-reference#team-space) + * A space is an isolated, highly available, secure app execution environment. + */ +export default class TeamSpaceService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List spaces owned by the team + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/spaces`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/test-case-service.d.ts b/lib/esm/services/test-case-service.d.ts new file mode 100644 index 0000000..0d8d280 --- /dev/null +++ b/lib/esm/services/test-case-service.d.ts @@ -0,0 +1,16 @@ +/** + * [Test Case](https://devcenter.heroku.com/articles/platform-api-reference#test-case) + * A single test case belonging to a test run + */ +export default class TestCaseService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List test cases + * + * @param testRunId unique identifier of a test run. + * @param requestInit The initializer for the request. + */ + list(testRunId: string, requestInit?: Omit): Promise>; +} diff --git a/lib/esm/services/test-case-service.js b/lib/esm/services/test-case-service.js new file mode 100644 index 0000000..f5c939f --- /dev/null +++ b/lib/esm/services/test-case-service.js @@ -0,0 +1,32 @@ +/** + * [Test Case](https://devcenter.heroku.com/articles/platform-api-reference#test-case) + * A single test case belonging to a test run + */ +export default class TestCaseService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List test cases + * + * @param testRunId unique identifier of a test run. + * @param requestInit The initializer for the request. + */ + async list(testRunId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/test-runs/${testRunId}/test-cases`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/test-node-service.d.ts b/lib/esm/services/test-node-service.d.ts new file mode 100644 index 0000000..dc1ebca --- /dev/null +++ b/lib/esm/services/test-node-service.d.ts @@ -0,0 +1,16 @@ +/** + * [Test Node](https://devcenter.heroku.com/articles/platform-api-reference#test-node) + * A single test node belonging to a test run + */ +export default class TestNodeService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List test nodes + * + * @param testRunIdentity unique identifier of a test run. + * @param requestInit The initializer for the request. + */ + list(testRunIdentity: string, requestInit?: Omit): Promise>; +} diff --git a/lib/esm/services/test-node-service.js b/lib/esm/services/test-node-service.js new file mode 100644 index 0000000..e98e620 --- /dev/null +++ b/lib/esm/services/test-node-service.js @@ -0,0 +1,32 @@ +/** + * [Test Node](https://devcenter.heroku.com/articles/platform-api-reference#test-node) + * A single test node belonging to a test run + */ +export default class TestNodeService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List test nodes + * + * @param testRunIdentity unique identifier of a test run. + * @param requestInit The initializer for the request. + */ + async list(testRunIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/test-runs/${testRunIdentity}/test-nodes`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/test-run-service.d.ts b/lib/esm/services/test-run-service.d.ts new file mode 100644 index 0000000..c474bc0 --- /dev/null +++ b/lib/esm/services/test-run-service.d.ts @@ -0,0 +1,49 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Test Run](https://devcenter.heroku.com/articles/platform-api-reference#test-run) + * An execution or trial of one or more tests + */ +export default class TestRunService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new test-run. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.TestRunCreatePayload, requestInit?: Omit): Promise; + /** + * Info for existing test-run. + * + * @param testRunId unique identifier of a test run. + * @param requestInit The initializer for the request. + */ + info(testRunId: string, requestInit?: Omit): Promise; + /** + * List existing test-runs for a pipeline. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + list(pipelineId: string, requestInit?: Omit): Promise>; + /** + * Info for existing test-run by Pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param testRunNumber the auto incrementing test run number. + * @param requestInit The initializer for the request. + */ + infoByPipeline(pipelineId: string, testRunNumber: number, requestInit?: Omit): Promise; + /** + * Update a test-run's status. + * + * @param testRunNumber the auto incrementing test run number. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(testRunNumber: number, payload: Heroku.TestRunUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/test-run-service.js b/lib/esm/services/test-run-service.js new file mode 100644 index 0000000..30fffc1 --- /dev/null +++ b/lib/esm/services/test-run-service.js @@ -0,0 +1,104 @@ +/** + * [Test Run](https://devcenter.heroku.com/articles/platform-api-reference#test-run) + * An execution or trial of one or more tests + */ +export default class TestRunService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new test-run. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + await this.fetchImpl(`/test-runs`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + } + /** + * Info for existing test-run. + * + * @param testRunId unique identifier of a test run. + * @param requestInit The initializer for the request. + */ + async info(testRunId, requestInit = {}) { + await this.fetchImpl(`/test-runs/${testRunId}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } + /** + * List existing test-runs for a pipeline. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + async list(pipelineId, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/test-runs`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for existing test-run by Pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param testRunNumber the auto incrementing test run number. + * @param requestInit The initializer for the request. + */ + async infoByPipeline(pipelineId, testRunNumber, requestInit = {}) { + await this.fetchImpl(`/pipelines/${pipelineId}/test-runs/${testRunNumber}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } + /** + * Update a test-run's status. + * + * @param testRunNumber the auto incrementing test run number. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(testRunNumber, payload, requestInit = {}) { + await this.fetchImpl(`/test-runs/${testRunNumber}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + } +} diff --git a/lib/esm/services/user-preferences-service.d.ts b/lib/esm/services/user-preferences-service.d.ts new file mode 100644 index 0000000..d316b53 --- /dev/null +++ b/lib/esm/services/user-preferences-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - User Preferences](https://devcenter.heroku.com/articles/platform-api-reference#user-preferences) + * Tracks a user's preferences and message dismissals + */ +export default class UserPreferencesService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieve User Preferences + * + * @param userPreferencesIdentity Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + list(userPreferencesIdentity: string, requestInit?: Omit): Promise; + /** + * Update User Preferences + * + * @param userPreferencesIdentity Implicit reference to currently authorized user. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(userPreferencesIdentity: string, payload: Heroku.UserPreferencesUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/user-preferences-service.js b/lib/esm/services/user-preferences-service.js new file mode 100644 index 0000000..682f201 --- /dev/null +++ b/lib/esm/services/user-preferences-service.js @@ -0,0 +1,55 @@ +/** + * [Heroku Platform API - User Preferences](https://devcenter.heroku.com/articles/platform-api-reference#user-preferences) + * Tracks a user's preferences and message dismissals + */ +export default class UserPreferencesService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieve User Preferences + * + * @param userPreferencesIdentity Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + async list(userPreferencesIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${userPreferencesIdentity}/preferences`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update User Preferences + * + * @param userPreferencesIdentity Implicit reference to currently authorized user. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(userPreferencesIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/${userPreferencesIdentity}/preferences`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/esm/services/vpn-connection-service.d.ts b/lib/esm/services/vpn-connection-service.d.ts new file mode 100644 index 0000000..f727db1 --- /dev/null +++ b/lib/esm/services/vpn-connection-service.d.ts @@ -0,0 +1,50 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Private Spaces VPN](https://devcenter.heroku.com/articles/platform-api-reference#vpn-connection) + * [VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN. + */ +export default class VpnConnectionService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new VPN connection in a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(spaceIdentity: string, payload: Heroku.VpnConnectionCreatePayload, requestInit?: Omit): Promise; + /** + * Destroy existing VPN Connection + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param vpnConnectionIdentity VPN ID or VPN Name. + * @param requestInit The initializer for the request. + */ + destroy(spaceIdentity: string, vpnConnectionIdentity: string, requestInit?: Omit): Promise; + /** + * List VPN connections for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + list(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Info for an existing vpn-connection. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param vpnConnectionIdentity VPN ID or VPN Name. + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, vpnConnectionIdentity: string, requestInit?: Omit): Promise; + /** + * Update a VPN connection in a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param vpnConnectionIdentity VPN ID or VPN Name. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(spaceIdentity: string, vpnConnectionIdentity: string, payload: Heroku.VpnConnectionUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/vpn-connection-service.js b/lib/esm/services/vpn-connection-service.js new file mode 100644 index 0000000..5277bd9 --- /dev/null +++ b/lib/esm/services/vpn-connection-service.js @@ -0,0 +1,122 @@ +/** + * [Heroku Platform API - Private Spaces VPN](https://devcenter.heroku.com/articles/platform-api-reference#vpn-connection) + * [VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN. + */ +export default class VpnConnectionService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new VPN connection in a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(spaceIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/vpn-connections`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Destroy existing VPN Connection + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param vpnConnectionIdentity VPN ID or VPN Name. + * @param requestInit The initializer for the request. + */ + async destroy(spaceIdentity, vpnConnectionIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/vpn-connections/${vpnConnectionIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * List VPN connections for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async list(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/vpn-connections`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Info for an existing vpn-connection. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param vpnConnectionIdentity VPN ID or VPN Name. + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, vpnConnectionIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/vpn-connections/${vpnConnectionIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } + /** + * Update a VPN connection in a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param vpnConnectionIdentity VPN ID or VPN Name. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(spaceIdentity, vpnConnectionIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/vpn-connections/${vpnConnectionIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + throw new Error(response.statusText); + } +} diff --git a/lib/index.d.ts b/lib/index.d.ts deleted file mode 100644 index c5c03b5..0000000 --- a/lib/index.d.ts +++ /dev/null @@ -1,5107 +0,0 @@ -/* This file was automatically generated by json-schema-to-typescript. */ - -/** - * the entities that the subscription provides notifications for - */ -export type Include = string[] -/** - * provider actions for this specific add-on - */ -export type Actions = { - [k: string]: unknown - /** - * identifier of the action to take that is sent via SSO - */ - action?: string - /** - * a unique identifier - */ - id?: string - /** - * the display text shown in Dashboard - */ - label?: string - /** - * if the action requires the user to own the app - */ - requires_owner?: boolean - /** - * absolute URL to use instead of an action - */ - url?: string -} & { - [k: string]: unknown -}[] -/** - * config vars exposed to the owning app by this add-on - */ -export type AddonConfigVars = string[] -/** - * the compliance regimes applied to an add-on plan - */ -export type Compliance = ('HIPAA' | 'PCI')[] | null -/** - * errors associated with invalid app.json manifest file - */ -export type ManifestErrors = string[] -/** - * result of postdeploy script - */ -export type Postdeploy = { - [k: string]: unknown - /** - * The exit code of the postdeploy script - */ - exit_code?: number - /** - * output of the postdeploy script - */ - output?: string -} & ({ - [k: string]: unknown - /** - * The exit code of the postdeploy script - */ - exit_code?: number - /** - * output of the postdeploy script - */ - output?: string -} | null) -/** - * buildpacks executed for this build, in order - */ -export type Buildpacks = - | { - [k: string]: unknown - /** - * Buildpack Registry name of the buildpack for the app - */ - name?: string - /** - * the URL of the buildpack for the app - */ - url?: string - }[] - | null - /** - * release resulting from the build - */ -export type BuildRelease = { - [k: string]: unknown - /** - * unique identifier of release - */ - id?: string -} & ({ - [k: string]: unknown - /** - * unique identifier of release - */ - id?: string -} | null) -/** - * price information for this dyno size - */ -export type Cost = { - [k: string]: unknown -} | null -/** - * enterprise account permissions - */ -export type ExpandedPermissions = { - [k: string]: unknown - description?: string - /** - * permission in the enterprise account - */ - name?: 'billing' | 'create' | 'manage' | 'view' -}[] -/** - * Identity Provider information the member is federated with - */ -export type MemberIdentityProvider = { - [k: string]: unknown - /** - * unique identifier of this identity provider - */ - id?: string - /** - * name of the identity provider - */ - name?: string - owner?: Owner - /** - * whether the identity_provider information is redacted or not - */ - redacted?: boolean -} & ({ - [k: string]: unknown - /** - * unique identifier of this identity provider - */ - id?: string - /** - * name of the identity provider - */ - name?: string - owner?: Owner - /** - * whether the identity_provider information is redacted or not - */ - redacted?: boolean -} | null) -/** - * the current user's permissions for this enterprise account - */ -export type Permissions = string[] -/** - * Identity Provider associated with the Enterprise Account - */ -export type IdentityProvider1 = { - [k: string]: unknown - /** - * unique identifier of this identity provider - */ - id?: string - /** - * user-friendly unique identifier for this identity provider - */ - name?: string - owner?: Owner -} & ({ - [k: string]: unknown - /** - * unique identifier of this identity provider - */ - id?: string - /** - * user-friendly unique identifier for this identity provider - */ - name?: string - owner?: Owner -} | null) -/** - * add-on that created the drain - */ -export type Addon = { - [k: string]: unknown - /** - * billing application associated with this add-on - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string - } - /** - * unique identifier of add-on - */ - id?: string - /** - * globally unique name of the add-on - */ - name?: string -} & ({ - [k: string]: unknown - /** - * billing application associated with this add-on - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string - } - /** - * unique identifier of add-on - */ - id?: string - /** - * globally unique name of the add-on - */ - name?: string -} | null) -/** - * application that is attached to this drain - */ -export type App1 = { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string -} & ({ - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string -} | null) -/** - * The scope of access OAuth authorization allows - */ -export type Scope = string[] -/** - * Owner of a pipeline. - */ -export type Owner2 = { - [k: string]: unknown - /** - * unique identifier of a pipeline owner - */ - id: string - /** - * type of pipeline owner - */ - type: string -} & ({ - [k: string]: unknown - /** - * unique identifier of a pipeline owner - */ - id: string - /** - * type of pipeline owner - */ - type: string -} | null) -/** - * the deploy target for the review apps of a pipeline - */ -export type DeployTarget = { - [k: string]: unknown - /** - * unique identifier of deploy target - */ - id: string - /** - * type of deploy target - */ - type: string -} & ({ - [k: string]: unknown - /** - * unique identifier of deploy target - */ - id: string - /** - * type of deploy target - */ - type: string -} | null) -/** - * domains associated with this SSL certificate - */ -export type Domains = string[] -export type CertDomains = unknown[] -/** - * potential IPs from which outbound network traffic will originate - */ -export type Sources = string[] -export type EnterpriseAccount1 = { - [k: string]: unknown - /** - * unique identifier of the enterprise account - */ - id?: string - /** - * unique name of the enterprise account - */ - name?: string -} & ({ - [k: string]: unknown - /** - * unique identifier of the enterprise account - */ - id?: string - /** - * unique name of the enterprise account - */ - name?: string -} | null) -/** - * Identity Provider associated with the Team - */ -export type IdentityProvider2 = { - [k: string]: unknown - /** - * unique identifier of this identity provider - */ - id?: string - /** - * user-friendly unique identifier for this identity provider - */ - name?: string - owner?: Owner -} & ({ - [k: string]: unknown - /** - * unique identifier of this identity provider - */ - id?: string - /** - * user-friendly unique identifier for this identity provider - */ - name?: string - owner?: Owner -} | null) - -/** - * Which pipeline uuids the user has dismissed the GitHub banner for - */ -export type DismissedPipelinesGithubBanners = null | string[] -/** - * Routable CIDRs of VPN - */ -export type RoutableCidrs = string[] - -/** - * The platform API empowers developers to automate, extend and combine Heroku with other services. - */ -export interface HerokuPlatformAPI { - [k: string]: unknown - account?: Account - 'account-delinquency'?: AccountDelinquency - 'account-feature'?: AccountFeature - 'add-on'?: AddOn - 'add-on-action'?: AddOnAction - 'add-on-attachment'?: AddOnAttachment - 'add-on-config'?: AddOnConfig - 'add-on-plan-action'?: AddOnPlanAction - 'add-on-region-capability'?: AddOnRegionCapability - 'add-on-service'?: AddOnService - 'add-on-webhook'?: AddOnWebhook - 'add-on-webhook-delivery'?: AddOnWebhookDelivery - 'add-on-webhook-event'?: AddOnWebhookEvent - 'allowed-add-on-service'?: AllowedAddOnService - app?: App - 'app-feature'?: AppFeature - 'app-setup'?: AppSetup - 'app-transfer'?: AppTransfer - 'app-webhook'?: AppWebhook - 'app-webhook-delivery'?: AppWebhookDelivery - 'app-webhook-event'?: AppWebhookEvent - archive?: AuditTrailArchive - 'audit-trail-event'?: AuditTrailEvent - build?: Build - 'buildpack-installation'?: BuildpackInstallations - collaborator?: Collaborator - 'config-var'?: ConfigVars - credit?: Credit - domain?: Domain - dyno?: Dyno - 'dyno-size'?: DynoSize - 'enterprise-account'?: EnterpriseAccount - 'enterprise-account-daily-usage'?: EnterpriseAccountDailyUsage - 'enterprise-account-member'?: EnterpriseAccountMember - 'enterprise-account-monthly-usage'?: EnterpriseAccountMonthlyUsage - 'filter-apps'?: Filters - formation?: Formation - 'identity-provider'?: IdentityProvider - 'inbound-ruleset'?: InboundRuleset - invoice?: Invoice - 'invoice-address'?: InvoiceAddress - key?: Key - 'log-drain'?: LogDrain - 'log-session'?: LogSession - 'oauth-authorization'?: OAuthAuthorization - 'oauth-client'?: OAuthClient - 'oauth-grant'?: OAuthGrant - 'oauth-token'?: OAuthToken - 'password-reset'?: PasswordReset - peering?: Peering - 'peering-info'?: PeeringInfo - 'permission-entity'?: PermissionEntity - pipeline?: Pipeline - 'pipeline-build'?: PipelineBuild - 'pipeline-config-var'?: PipelineConfigVars - 'pipeline-coupling'?: PipelineCoupling - 'pipeline-deployment'?: PipelineDeployment - 'pipeline-promotion'?: PipelinePromotion - 'pipeline-promotion-target'?: PipelinePromotionTarget - 'pipeline-release'?: PipelineRelease - 'pipeline-stack'?: PipelineStack - 'pipeline-transfer'?: PipelineTransfer - plan?: Plan - 'rate-limit'?: RateLimit - region?: Region - release?: Release - 'review-app'?: ReviewApp - 'review-app-config'?: ReviewAppConfiguration - slug?: Slug - 'sms-number'?: SMSNumber - 'sni-endpoint'?: SNIEndpoint - source?: Source - space?: Space - 'space-app-access'?: SpaceAccess - 'space-nat'?: SpaceNetworkAddressTranslation - 'space-topology'?: SpaceTopology - 'space-transfer'?: SpaceTransfer - stack?: Stack - team?: Team - 'team-add-on'?: TeamAddOn - 'team-app'?: TeamApp - 'team-app-collaborator'?: TeamAppCollaborator - 'team-app-permission'?: TeamAppPermission - 'team-daily-usage'?: TeamDailyUsage - 'team-delinquency'?: TeamDelinquency - 'team-feature'?: TeamFeature - 'team-invitation'?: TeamInvitation - 'team-invoice'?: TeamInvoice - 'team-member'?: TeamMember - 'team-monthly-usage'?: TeamMonthlyUsage - 'team-preferences'?: TeamPreferences - 'team-space'?: TeamSpace - 'test-case'?: TestCase - 'test-node'?: TestNode - 'test-run'?: TestRun - 'user-preferences'?: UserPreferences - 'vpn-connection'?: PrivateSpacesVPN -} -/** - * A Heroku account becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent accounts if their invoices remain unpaid. - */ -export interface AccountDelinquency { - [k: string]: unknown - /** - * scheduled time of when we will delete your account due to delinquency - */ - scheduled_deletion_time?: null | string - /** - * scheduled time of when we will suspend your account due to delinquency - */ - scheduled_suspension_time?: null | string -} -/** - * An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku. - */ -export interface AccountFeature { - [k: string]: unknown - /** - * when account feature was created - */ - created_at?: string - /** - * description of account feature - */ - description?: string - /** - * user readable feature name - */ - display_name?: string - /** - * documentation URL of account feature - */ - doc_url?: string - /** - * whether or not account feature has been enabled - */ - enabled?: boolean - /** - * e-mail to send feedback about the feature - */ - feedback_email?: string - /** - * unique identifier of account feature - */ - id?: string - /** - * unique name of account feature - */ - name?: string - /** - * state of account feature - */ - state?: string - /** - * when account feature was updated - */ - updated_at?: string -} -/** - * An account represents an individual signed up to use the Heroku platform. - */ -export interface Account { - [k: string]: unknown - /** - * whether to allow third party web activity tracking - */ - allow_tracking?: boolean - /** - * whether allowed to utilize beta Heroku features - */ - beta?: boolean - /** - * country where account owner resides - */ - country_of_residence?: null | string - /** - * when account was created - */ - created_at?: string - /** - * team selected by default - */ - default_organization?: { - [k: string]: unknown - /** - * unique identifier of team - */ - id?: string - /** - * unique name of team - */ - name?: string - } | null - /** - * team selected by default - */ - default_team?: { - [k: string]: unknown - /** - * unique identifier of team - */ - id?: string - /** - * unique name of team - */ - name?: string - } | null - /** - * when account became delinquent - */ - delinquent_at?: null | string - /** - * unique email address of account - */ - email?: string - /** - * whether the user is federated and belongs to an Identity Provider - */ - federated?: boolean - /** - * unique identifier of an account - */ - id?: string - /** - * Identity Provider details for federated users. - */ - identity_provider?: { - [k: string]: unknown - /** - * unique identifier of this identity provider - */ - id?: string - /** - * user-friendly unique identifier for this identity provider - */ - name?: string - organization?: { - [k: string]: unknown - /** - * unique name of team - */ - name?: string - } - owner?: Owner - team?: { - [k: string]: unknown - /** - * unique name of team - */ - name?: string - } - } | null - /** - * when account last authorized with Heroku - */ - last_login?: null | string - /** - * full name of the account owner - */ - name?: null | string - /** - * SMS number of account - */ - sms_number?: null | string - /** - * when account was suspended - */ - suspended_at?: null | string - /** - * whether two-factor auth is enabled on the account - */ - two_factor_authentication?: boolean - /** - * when account was updated - */ - updated_at?: string - /** - * whether account has been verified with billing information - */ - verified?: boolean -} -/** - * entity that owns this identity provider - */ -export interface Owner { - [k: string]: unknown - /** - * unique identifier of the owner - */ - id: string - /** - * name of the owner - */ - name?: string - /** - * type of the owner - */ - type: 'enterprise-account' | 'team' -} -/** - * Add-on Actions are lifecycle operations for add-on provisioning and deprovisioning. They allow add-on providers to (de)provision add-ons in the background and then report back when (de)provisioning is complete. - */ -export interface AddOnAction { - [k: string]: unknown -} -/** - * An add-on attachment represents a connection between an app and an add-on that it has been given access to. - */ -export interface AddOnAttachment { - [k: string]: unknown - /** - * identity of add-on - */ - addon?: { - /** - * billing application associated with this add-on - */ - app: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string - } - /** - * unique identifier of add-on - */ - id: string - /** - * globally unique name of the add-on - */ - name: string - } - /** - * application that is attached to add-on - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string - } - /** - * when add-on attachment was created - */ - created_at?: string - /** - * unique identifier of this add-on attachment - */ - id?: string - /** - * URL for add-on partners to write to an add-on's logs - */ - log_input_url?: null | string - /** - * unique name for this add-on attachment to this app - */ - name?: string - /** - * attachment namespace - */ - namespace?: null | string - /** - * when add-on attachment was updated - */ - updated_at?: string - /** - * URL for logging into web interface of add-on in attached app context - */ - web_url?: null | string -} -/** - * Configuration of an Add-on - */ -export interface AddOnConfig { - [k: string]: unknown - /** - * unique name of the config - */ - name?: string - /** - * value of the config - */ - value?: null | string -} -/** - * Add-on Plan Actions are Provider functionality for specific add-on installations - */ -export interface AddOnPlanAction { - [k: string]: unknown - /** - * identifier of the action to take that is sent via SSO - */ - action?: string - /** - * a unique identifier - */ - id?: string - /** - * the display text shown in Dashboard - */ - label?: string - /** - * if the action requires the user to own the app - */ - requires_owner?: boolean - /** - * absolute URL to use instead of an action - */ - url?: string -} -/** - * Add-on region capabilities represent the relationship between an Add-on Service and a specific Region. Only Beta and GA add-ons are returned by these endpoints. - */ -export interface AddOnRegionCapability { - [k: string]: unknown - addon_service?: AddOnService - /** - * unique identifier of this add-on-region-capability - */ - id?: string - region?: Region - /** - * whether the add-on can be installed to a Space - */ - supports_private_networking?: boolean -} -/** - * Add-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. - */ -export interface AddOnService { - [k: string]: unknown - /** - * npm package name of the add-on service's Heroku CLI plugin - */ - cli_plugin_name?: null | string - /** - * when add-on-service was created - */ - created_at?: string - /** - * human-readable name of the add-on service provider - */ - human_name?: string - /** - * unique identifier of this add-on-service - */ - id?: string - /** - * unique name of this add-on-service - */ - name?: string - /** - * release status for add-on service - */ - state?: 'alpha' | 'beta' | 'ga' | 'shutdown' - /** - * whether or not apps can have access to more than one instance of this add-on at the same time - */ - supports_multiple_installations?: boolean - /** - * whether or not apps can have access to add-ons billed to a different app - */ - supports_sharing?: boolean - /** - * when add-on-service was updated - */ - updated_at?: string -} -/** - * A region represents a geographic location in which your application may run. - */ -export interface Region { - [k: string]: unknown - /** - * country where the region exists - */ - country?: string - /** - * when region was created - */ - created_at?: string - /** - * description of region - */ - description?: string - /** - * unique identifier of region - */ - id?: string - /** - * area in the country where the region exists - */ - locale?: string - /** - * unique name of region - */ - name?: string - /** - * whether or not region is available for creating a Private Space - */ - private_capable?: boolean - provider?: Provider - /** - * when region was updated - */ - updated_at?: string -} -/** - * provider of underlying substrate - */ -export interface Provider { - [k: string]: unknown - /** - * name of provider - */ - name?: string - /** - * region name used by provider - */ - region?: - | 'ap-northeast-1' - | 'ap-northeast-2' - | 'ap-south-1' - | 'ap-southeast-1' - | 'ap-southeast-2' - | 'ca-central-1' - | 'eu-central-1' - | 'eu-west-1' - | 'eu-west-2' - | 'sa-east-1' - | 'us-east-1' - | 'us-west-1' - | 'us-west-2' -} -/** - * Represents the delivery of a webhook notification, including its current status. - */ -export interface AddOnWebhookDelivery { - [k: string]: unknown -} -/** - * Represents a webhook event that occurred. - */ -export interface AddOnWebhookEvent { - [k: string]: unknown -} -/** - * Represents the details of a webhook subscription - */ -export interface AddOnWebhook { - /** - * when the webhook was created - */ - created_at: string - /** - * the webhook's unique identifier - */ - id: string - include: Include - /** - * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached - */ - level: 'notify' | 'sync' - /** - * when the webhook was updated - */ - updated_at: string - /** - * the URL where the webhook's notification requests are sent - */ - url: string -} -/** - * Add-ons represent add-ons that have been provisioned and attached to one or more apps. - */ -export interface AddOn { - actions: Actions - /** - * identity of add-on service - */ - addon_service: - | { - [k: string]: unknown - /** - * unique identifier of this add-on-service - */ - id?: string - /** - * unique name of this add-on-service - */ - name?: string - } - | AddOnService - /** - * billing application associated with this add-on - */ - app: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string - } - /** - * billed price - */ - billed_price: { - [k: string]: unknown - /** - * price in cents per unit of plan - */ - cents?: number - /** - * price is negotiated in a contract outside of monthly add-on billing - */ - contract?: boolean - /** - * unit of price for plan - */ - unit?: string - } | null - /** - * billing entity associated with this add-on - */ - billing_entity: { - [k: string]: unknown - /** - * unique identifier of the billing entity - */ - id?: string - /** - * name of the billing entity - */ - name?: string - /** - * type of Object of the billing entity; new types allowed at any time. - */ - type?: 'app' | 'team' - } - config_vars: AddonConfigVars - /** - * when add-on was created - */ - created_at: string - /** - * unique identifier of add-on - */ - id: string - /** - * globally unique name of the add-on - */ - name: string - /** - * identity of add-on plan - */ - plan: - | { - [k: string]: unknown - /** - * unique identifier of this plan - */ - id?: string - /** - * unique name of this plan - */ - name?: string - } - | Plan - /** - * id of this add-on with its provider - */ - provider_id: string - /** - * A provision message - */ - provision_message?: string - /** - * state in the add-on's lifecycle - */ - state: 'deprovisioned' | 'provisioned' | 'provisioning' - /** - * when add-on was updated - */ - updated_at: string - /** - * URL for logging into web interface of add-on (e.g. a dashboard) - */ - web_url: null | string -} -/** - * Plans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication. - */ -export interface Plan { - [k: string]: unknown - /** - * identity of add-on service - */ - addon_service?: { - [k: string]: unknown - /** - * unique identifier of this add-on-service - */ - id?: string - /** - * unique name of this add-on-service - */ - name?: string - } - compliance?: Compliance - /** - * when plan was created - */ - created_at?: string - /** - * whether this plan is the default for its add-on service - */ - default?: boolean - /** - * description of plan - */ - description?: string - /** - * human readable name of the add-on plan - */ - human_name?: string - /** - * unique identifier of this plan - */ - id?: string - /** - * whether this plan is installable to a Private Spaces app - */ - installable_inside_private_network?: boolean - /** - * whether this plan is installable to a Common Runtime app - */ - installable_outside_private_network?: boolean - /** - * unique name of this plan - */ - name?: string - /** - * price - */ - price?: { - [k: string]: unknown - /** - * price in cents per unit of plan - */ - cents?: number - /** - * price is negotiated in a contract outside of monthly add-on billing - */ - contract?: boolean - /** - * unit of price for plan - */ - unit?: string - } - /** - * whether this plan is the default for apps in Private Spaces - */ - space_default?: boolean - /** - * release status for plan - */ - state?: string - /** - * when plan was updated - */ - updated_at?: string - /** - * whether this plan is publicly visible - */ - visible?: boolean -} -/** - * Entities that have been allowed to be used by a Team - */ -export interface AllowedAddOnService { - [k: string]: unknown - /** - * when the add-on service was allowed - */ - added_at?: string - added_by?: AddedBy - addon_service?: AddonService - /** - * unique identifier for this allowed add-on service record - */ - id?: string -} -/** - * the user which allowed the add-on service - */ -export interface AddedBy { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * unique identifier of an account - */ - id?: string -} -/** - * the add-on service allowed for use - */ -export interface AddonService { - [k: string]: unknown - /** - * human-readable name of the add-on service provider - */ - human_name?: string - /** - * unique identifier of this add-on-service - */ - id?: string - /** - * unique name of this add-on-service - */ - name?: string -} -/** - * An app feature represents a Heroku labs capability that can be enabled or disabled for an app on Heroku. - */ -export interface AppFeature { - [k: string]: unknown - /** - * when app feature was created - */ - created_at?: string - /** - * description of app feature - */ - description?: string - /** - * user readable feature name - */ - display_name?: string - /** - * documentation URL of app feature - */ - doc_url?: string - /** - * whether or not app feature has been enabled - */ - enabled?: boolean - /** - * e-mail to send feedback about the feature - */ - feedback_email?: string - /** - * unique identifier of app feature - */ - id?: string - /** - * unique name of app feature - */ - name?: string - /** - * state of app feature - */ - state?: string - /** - * when app feature was updated - */ - updated_at?: string -} -/** - * An app setup represents an app on Heroku that is setup using an environment, addons, and scripts described in an app.json manifest file. - */ -export interface AppSetup { - [k: string]: unknown - /** - * identity of app - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string - } - /** - * identity and status of build - */ - build?: { - [k: string]: unknown - /** - * unique identifier of build - */ - id?: string - /** - * Build process output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). - */ - output_stream_url?: string - /** - * status of build - */ - status?: 'failed' | 'pending' | 'succeeded' - } | null - /** - * when app setup was created - */ - created_at?: string - /** - * reason that app setup has failed - */ - failure_message?: null | string - /** - * unique identifier of app setup - */ - id?: string - manifest_errors?: ManifestErrors - postdeploy?: Postdeploy - /** - * fully qualified success url - */ - resolved_success_url?: null | string - /** - * the overall status of app setup - */ - status?: 'failed' | 'pending' | 'succeeded' - /** - * when app setup was updated - */ - updated_at?: string -} -/** - * An app transfer represents a two party interaction for transferring ownership of an app. - */ -export interface AppTransfer { - [k: string]: unknown - /** - * app involved in the transfer - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string - } - /** - * when app transfer was created - */ - created_at?: string - /** - * unique identifier of app transfer - */ - id?: string - /** - * identity of the owner of the transfer - */ - owner?: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * unique identifier of an account - */ - id?: string - } - /** - * identity of the recipient of the transfer - */ - recipient?: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * unique identifier of an account - */ - id?: string - } - /** - * the current state of an app transfer - */ - state?: 'accepted' | 'declined' | 'pending' - /** - * when app transfer was updated - */ - updated_at?: string -} -/** - * Represents the delivery of a webhook notification, including its current status. - */ -export interface AppWebhookDelivery { - [k: string]: unknown - /** - * when the delivery was created - */ - created_at?: string - /** - * identity of event - */ - event?: { - [k: string]: unknown - /** - * the event's unique identifier - */ - id?: string - /** - * the type of entity that the event is related to - */ - include?: string - } - /** - * the delivery's unique identifier - */ - id?: string - /** - * last attempt of a delivery - */ - last_attempt?: { - [k: string]: unknown - /** - * http response code received during attempt - */ - code?: null | number - /** - * when attempt was created - */ - created_at?: string - /** - * error class encountered during attempt - */ - error_class?: null | string - /** - * unique identifier of attempt - */ - id?: string - /** - * status of an attempt - */ - status?: 'failed' | 'scheduled' | 'succeeded' - /** - * when attempt was updated - */ - updated_at?: string - } | null - /** - * when delivery will be attempted again - */ - next_attempt_at?: null | string - /** - * number of times a delivery has been attempted - */ - num_attempts?: number - /** - * the delivery's status - */ - status?: 'failed' | 'pending' | 'retrying' | 'scheduled' | 'succeeded' - /** - * when the delivery was last updated - */ - updated_at?: string - /** - * identity of webhook - */ - webhook?: { - [k: string]: unknown - /** - * the webhook's unique identifier - */ - id?: string - /** - * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached - */ - level?: 'notify' | 'sync' - } -} -/** - * Represents a webhook event that occurred. - */ -export interface AppWebhookEvent { - [k: string]: unknown - /** - * when event was created - */ - created_at?: string - /** - * the event's unique identifier - */ - id?: string - /** - * the type of entity that the event is related to - */ - include?: string - payload?: Payload - /** - * when the event was last updated - */ - updated_at?: string -} -/** - * payload of event - */ -export interface Payload { - [k: string]: unknown - /** - * the type of event that occurred - */ - action?: string - actor?: Actor - data?: Data - previous_data?: PreviousData - /** - * the type of resource associated with the event - */ - resource?: string - /** - * the version of the details provided for the event - */ - version?: string -} -/** - * user that caused event - */ -export interface Actor { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * unique identifier of an account - */ - id?: string -} -/** - * the current details of the event - */ -export interface Data { - [k: string]: unknown -} -/** - * previous details of the event (if any) - */ -export interface PreviousData { - [k: string]: unknown -} -/** - * Represents the details of a webhook subscription - */ -export interface AppWebhook {} -/** - * An app represents the program that you would like to deploy and run on Heroku. - */ -export interface App { - [k: string]: unknown - /** - * ACM status of this app - */ - acm?: boolean - /** - * when app was archived - */ - archived_at?: null | string - /** - * identity of the stack that will be used for new builds - */ - build_stack?: { - [k: string]: unknown - /** - * unique identifier of stack - */ - id?: string - /** - * unique name of stack - */ - name?: string - } - /** - * description from buildpack of app - */ - buildpack_provided_description?: null | string - /** - * when app was created - */ - created_at?: string - /** - * git repo URL of app - */ - git_url?: string - /** - * unique identifier of app - */ - id?: string - /** - * describes whether a Private Spaces app is externally routable or not - */ - internal_routing?: boolean | null - /** - * maintenance status of app - */ - maintenance?: boolean - /** - * unique name of app - */ - name?: string - /** - * identity of team - */ - organization?: { - [k: string]: unknown - /** - * unique identifier of team - */ - id?: string - /** - * unique name of team - */ - name?: string - } | null - /** - * identity of app owner - */ - owner?: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * unique identifier of an account - */ - id?: string - } - /** - * identity of app region - */ - region?: { - [k: string]: unknown - /** - * unique identifier of region - */ - id?: string - /** - * unique name of region - */ - name?: string - } - /** - * when app was released - */ - released_at?: null | string - /** - * git repo size in bytes of app - */ - repo_size?: null | number - /** - * slug size in bytes of app - */ - slug_size?: null | number - /** - * identity of space - */ - space?: { - [k: string]: unknown - /** - * unique identifier of space - */ - id?: string - /** - * unique name of space - */ - name?: string - /** - * true if this space has shield enabled - */ - shield?: boolean - } | null - /** - * identity of app stack - */ - stack?: { - [k: string]: unknown - /** - * unique identifier of stack - */ - id?: string - /** - * unique name of stack - */ - name?: string - } - /** - * identity of team - */ - team?: { - [k: string]: unknown - /** - * unique identifier of team - */ - id?: string - /** - * unique name of team - */ - name?: string - } | null - /** - * when app was updated - */ - updated_at?: string - /** - * web URL of app - */ - web_url?: null | string -} -/** - * An audit trail archive represents a monthly json zipped file containing events - */ -export interface AuditTrailArchive { - [k: string]: unknown - /** - * checksum for the archive - */ - checksum?: string - /** - * when archive was created - */ - created_at?: string - /** - * month of the archive - */ - month?: '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12' - /** - * size of the archive in bytes - */ - size?: number - /** - * url where to download the archive - */ - url?: string - /** - * year of the archive - */ - year?: number -} -/** - * An audit trail event represents some action on the platform - */ -export interface AuditTrailEvent { - [k: string]: unknown - /** - * action for the event - */ - action?: string - actor?: Actor1 - app?: AuditTrailApp - /** - * when event was created - */ - created_at?: string - data?: Data1 - enterprise_account?: EnterpriseAccount - /** - * unique identifier of event - */ - id?: string - owner?: Owner1 - request?: Request - team?: Team - /** - * type of event - */ - type?: string -} -/** - * user who caused event - */ -export interface Actor1 { - [k: string]: unknown - email?: string - id?: string -} -/** - * app upon which event took place - */ -export interface AuditTrailApp { - [k: string]: unknown - id?: string - name?: string -} -/** - * owner of the app targeted by the event - */ -export interface Owner1 { - [k: string]: unknown - email?: string - id?: string -} -/** - * enterprise account on which the event happened - */ -export interface EnterpriseAccount { - [k: string]: unknown - id?: string - name?: string -} -/** - * team on which the event happened - */ -export interface Team { - [k: string]: unknown - id?: string - name?: string -} -/** - * information about where the action was triggered - */ -export interface Request { - [k: string]: unknown - ip_address?: string -} -/** - * data specific to the event - */ -export interface Data1 { - [k: string]: unknown -} -/** - * A build represents the process of transforming a code tarball into a slug - */ -export interface Build { - [k: string]: unknown - /** - * app that the build belongs to - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - } - buildpacks?: Buildpacks - /** - * when build was created - */ - created_at: string - /** - * unique identifier of build - */ - id: string - /** - * Build process output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). - */ - output_stream_url?: string - release?: BuildRelease - /** - * slug created by this build - */ - slug?: { - [k: string]: unknown - /** - * unique identifier of slug - */ - id?: string - } | null - source_blob: SourceBlob - /** - * stack of build - */ - stack?: string - /** - * status of build - */ - status: 'failed' | 'pending' | 'succeeded' - /** - * when build was updated - */ - updated_at: string - /** - * user that started the build - */ - user: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * unique identifier of an account - */ - id?: string - } -} -/** - * location of gzipped tarball of source code used to create build - */ -export interface SourceBlob { - [k: string]: unknown - /** - * an optional checksum of the gzipped tarball for verifying its integrity - */ - checksum?: null | string - /** - * URL where gzipped tar archive of source code for build was downloaded. - */ - url?: string - /** - * Version of the gzipped tarball. - */ - version?: null | string - /** - * Version description of the gzipped tarball. - */ - version_description?: null | string -} -/** - * A buildpack installation represents a buildpack that will be run against an app. - */ -export interface BuildpackInstallations { - [k: string]: unknown - /** - * buildpack - */ - buildpack?: { - [k: string]: unknown - /** - * either the Buildpack Registry name or a URL of the buildpack for the app - */ - name?: string - /** - * location of the buildpack for the app. Either a url (unofficial buildpacks) or an internal urn (heroku official buildpacks). - */ - url?: string - } - /** - * determines the order in which the buildpacks will execute - */ - ordinal?: number -} -/** - * A collaborator represents an account that has been given access to an app on Heroku. - */ -export interface Collaborator { - /** - * app collaborator belongs to - */ - app: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string - } - /** - * when collaborator was created - */ - created_at: string - /** - * unique identifier of collaborator - */ - id: string - permissions?: TeamAppPermission[] - /** - * role in the team - */ - role?: 'admin' | 'collaborator' | 'member' | 'owner' | null - /** - * when collaborator was updated - */ - updated_at: string - /** - * identity of collaborated account - */ - user: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * whether the user is federated and belongs to an Identity Provider - */ - federated?: boolean - /** - * unique identifier of an account - */ - id?: string - } -} -/** - * A team app permission is a behavior that is assigned to a user in a team app. - */ -export interface TeamAppPermission { - [k: string]: unknown - /** - * A description of what the app permission allows. - */ - description?: string - /** - * The name of the app permission. - */ - name?: string -} -/** - * Config Vars allow you to manage the configuration information provided to an app on Heroku. - */ -export interface ConfigVars { - /** - * This interface was referenced by `ConfigVars`'s JSON-Schema definition - * via the `patternProperty` "^\w+$". - */ - [k: string]: string -} -/** - * A credit represents value that will be used up before further charges are assigned to an account. - */ -export interface Credit { - [k: string]: unknown - /** - * total value of credit in cents - */ - amount?: number - /** - * remaining value of credit in cents - */ - balance?: number - /** - * when credit was created - */ - created_at?: string - /** - * when credit will expire - */ - expires_at?: string - /** - * unique identifier of credit - */ - id?: string - /** - * a name for credit - */ - title?: string - /** - * when credit was updated - */ - updated_at?: string -} -/** - * Domains define what web routes should be routed to an app on Heroku. - */ -export interface Domain { - [k: string]: unknown - /** - * status of this record's ACM - */ - acm_status?: null | string - /** - * reason for the status of this record's ACM - */ - acm_status_reason?: null | string - /** - * app that owns the domain - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string - } - /** - * canonical name record, the address to point a domain at - */ - cname?: null | string - /** - * when domain was created - */ - created_at?: string - /** - * full hostname - */ - hostname?: string - /** - * unique identifier of this domain - */ - id?: string - /** - * type of domain name - */ - kind?: 'custom' | 'heroku' - /** - * sni endpoint the domain is associated with - */ - sni_endpoint?: { - [k: string]: unknown - /** - * unique identifier of this SNI endpoint - */ - id?: string - /** - * unique name for SNI endpoint - */ - name?: string - } | null - /** - * status of this record's cname - */ - status?: string - /** - * when domain was updated - */ - updated_at?: string -} -/** - * Dyno sizes are the values and details of sizes that can be assigned to dynos. This information can also be found at : [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). - */ -export interface DynoSize { - [k: string]: unknown - /** - * minimum vCPUs, non-dedicated may get more depending on load - */ - compute?: number - cost?: Cost - /** - * whether this dyno will be dedicated to one user - */ - dedicated?: boolean - /** - * @deprecated - * deprecated. See precise_dyno_units instead - */ - dyno_units?: number - /** - * unique identifier of this dyno size - */ - id?: string - /** - * amount of RAM in GB - */ - memory?: number - /** - * the name of this dyno-size - */ - name?: string - /** - * unit of consumption for Heroku Enterprise customers to 2 decimal places - */ - precise_dyno_units?: number - /** - * whether this dyno can only be provisioned in a private space - */ - private_space_only?: boolean -} -/** - * Dynos encapsulate running processes of an app on Heroku. Detailed information about dyno sizes can be found at: [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). - */ -export interface Dyno { - [k: string]: unknown - /** - * app formation belongs to - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string - } - /** - * a URL to stream output from for attached processes or null for non-attached processes - */ - attach_url?: null | string - /** - * command used to start this process - */ - command?: string - /** - * when dyno was created - */ - created_at?: string - /** - * unique identifier of this dyno - */ - id?: string - /** - * the name of this process on this dyno - */ - name?: string - /** - * app release of the dyno - */ - release?: { - [k: string]: unknown - /** - * unique identifier of release - */ - id?: string - /** - * unique version assigned to the release - */ - version?: number - } - /** - * dyno size - */ - size?: string - /** - * current status of process (either: crashed, down, idle, starting, or up) - */ - state?: string - /** - * type of process - */ - type?: string - /** - * when process last changed state - */ - updated_at?: string -} -/** - * Usage for an enterprise account at a daily resolution. - */ -export interface EnterpriseAccountDailyUsage { - [k: string]: unknown - /** - * total add-on credits used - */ - addons?: number - /** - * total add-on credits used for first party add-ons - */ - data?: number - /** - * date of the usage - */ - date?: string - /** - * dynos used - */ - dynos?: number - /** - * enterprise account identifier - */ - id?: string - /** - * name of the enterprise account - */ - name?: string - /** - * total add-on credits used for third party add-ons - */ - partner?: number - /** - * space credits used - */ - space?: number - /** - * usage by team - */ - teams?: { - [k: string]: unknown - /** - * total add-on credits used - */ - addons?: number - /** - * app usage in the team - */ - apps?: AppUsageDaily[] - /** - * total add-on credits used for first party add-ons - */ - data?: number - /** - * dynos used - */ - dynos?: number - /** - * team identifier - */ - id?: string - /** - * name of the team - */ - name?: string - /** - * total add-on credits used for third party add-ons - */ - partner?: number - /** - * space credits used - */ - space?: number - }[] -} -/** - * Usage for an app at a daily resolution. - */ -export interface AppUsageDaily { - [k: string]: unknown - /** - * total add-on credits used - */ - addons?: number - /** - * unique name of app - */ - app_name?: string - /** - * total add-on credits used for first party add-ons - */ - data?: number - /** - * dynos used - */ - dynos?: number - /** - * total add-on credits used for third party add-ons - */ - partner?: number -} -/** - * Enterprise account members are users with access to an enterprise account. - */ -export interface EnterpriseAccountMember { - [k: string]: unknown - enterprise_account?: { - [k: string]: unknown - /** - * unique identifier of the enterprise account - */ - id?: string - /** - * unique name of the enterprise account - */ - name?: string - } - /** - * unique identifier of the member - */ - id?: string - identity_provider?: MemberIdentityProvider - permissions?: ExpandedPermissions - /** - * whether the Enterprise Account member has two factor authentication enabled - */ - two_factor_authentication?: boolean - /** - * user information for the membership - */ - user?: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * unique identifier of an account - */ - id?: string - } -} -/** - * Usage for an enterprise account at a monthly resolution. - */ -export interface EnterpriseAccountMonthlyUsage { - [k: string]: unknown - /** - * total add-on credits used - */ - addons?: number - /** - * average connect rows synced - */ - connect?: number - /** - * total add-on credits used for first party add-ons - */ - data?: number - /** - * dynos used - */ - dynos?: number - /** - * enterprise account identifier - */ - id?: string - /** - * year and month of the usage - */ - month?: string - /** - * name of the enterprise account - */ - name?: string - /** - * total add-on credits used for third party add-ons - */ - partner?: number - /** - * space credits used - */ - space?: number - /** - * usage by team - */ - teams?: { - [k: string]: unknown - /** - * total add-on credits used - */ - addons?: number - /** - * app usage in the team - */ - apps?: AppUsageMonthly[] - /** - * average connect rows synced - */ - connect?: number - /** - * total add-on credits used for first party add-ons - */ - data?: number - /** - * dynos used - */ - dynos?: number - /** - * team identifier - */ - id?: string - /** - * name of the team - */ - name?: string - /** - * total add-on credits used for third party add-ons - */ - partner?: number - /** - * space credits used - */ - space?: number - }[] -} -/** - * Usage for an app at a monthly resolution. - */ -export interface AppUsageMonthly { - [k: string]: unknown - /** - * total add-on credits used - */ - addons?: number - /** - * unique name of app - */ - app_name?: string - /** - * total add-on credits used for first party add-ons - */ - data?: number - /** - * dynos used - */ - dynos?: number - /** - * total add-on credits used for third party add-ons - */ - partner?: number -} -/** - * Enterprise accounts allow companies to manage their development teams and billing. - */ -export interface EnterpriseAccount { - [k: string]: unknown - /** - * when the enterprise account was created - */ - created_at?: string - /** - * unique identifier of the enterprise account - */ - id?: string - identity_provider?: IdentityProvider1 - /** - * unique name of the enterprise account - */ - name?: string - permissions?: Permissions - /** - * whether the enterprise account is a trial or not - */ - trial?: boolean - /** - * when the enterprise account was updated - */ - updated_at?: string -} -/** - * Filters are special endpoints to allow for API consumers to specify a subset of resources to consume in order to reduce the number of requests that are performed. Each filter endpoint endpoint is responsible for determining its supported request format. The endpoints are over POST in order to handle large request bodies without hitting request uri query length limitations, but the requests themselves are idempotent and will not have side effects. - */ -export interface Filters { - [k: string]: unknown -} -/** - * The formation of processes that should be maintained for an app. Update the formation to scale processes or change dyno sizes. Available process type names and commands are defined by the `process_types` attribute for the [slug](#slug) currently released on an app. - */ -export interface Formation { - [k: string]: unknown - /** - * app formation belongs to - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string - } - /** - * command to use to launch this process - */ - command?: string - /** - * when process type was created - */ - created_at?: string - /** - * unique identifier of this process type - */ - id?: string - /** - * number of processes to maintain - */ - quantity?: number - /** - * dyno size - */ - size?: string - /** - * type of process to maintain - */ - type?: string - /** - * when dyno type was updated - */ - updated_at?: string -} -/** - * Identity Providers represent the SAML configuration of teams or an Enterprise account - */ -export interface IdentityProvider { - [k: string]: unknown - /** - * raw contents of the public certificate (eg: .crt or .pem file) - */ - certificate?: string - /** - * when provider record was created - */ - created_at?: string - /** - * URL identifier provided by the identity provider - */ - entity_id?: string - /** - * unique identifier of this identity provider - */ - id?: string - /** - * team associated with this identity provider - */ - organization?: { - [k: string]: unknown - /** - * unique name of team - */ - name?: string - } | null - owner?: Owner - /** - * single log out URL for this identity provider - */ - slo_target_url?: string - /** - * single sign on URL for this identity provider - */ - sso_target_url?: string - /** - * when the identity provider record was updated - */ - updated_at?: string -} -/** - * An inbound-ruleset is a collection of rules that specify what hosts can or cannot connect to an application. - */ -export interface InboundRuleset { - [k: string]: unknown - /** - * when inbound-ruleset was created - */ - created_at?: string - /** - * unique email address of account - */ - created_by?: string - /** - * unique identifier of an inbound-ruleset - */ - id?: string - rules?: Rule[] - /** - * identity of space - */ - space?: { - [k: string]: unknown - /** - * unique identifier of space - */ - id?: string - /** - * unique name of space - */ - name?: string - } -} -/** - * the combination of an IP address in CIDR notation and whether to allow or deny it's traffic. - */ -export interface Rule { - [k: string]: unknown - /** - * states whether the connection is allowed or denied - */ - action: 'allow' | 'deny' - /** - * is the request’s source in CIDR notation - */ - source: string -} -/** - * An invoice address represents the address that should be listed on an invoice. - */ -export interface InvoiceAddress { - [k: string]: unknown - /** - * invoice street address line 1 - */ - address_1?: string - /** - * invoice street address line 2 - */ - address_2?: string - /** - * invoice city - */ - city?: string - /** - * country - */ - country?: string - heroku_id?: string - /** - * metadata / additional information to go on invoice - */ - other?: string - /** - * invoice zip code - */ - postal_code?: string - /** - * invoice state - */ - state?: string - /** - * flag to use the invoice address for an account or not - */ - use_invoice_address?: boolean -} -/** - * An invoice is an itemized bill of goods for an account which includes pricing and charges. - */ -export interface Invoice { - [k: string]: unknown - /** - * total charges on this invoice - */ - charges_total?: number - /** - * when invoice was created - */ - created_at?: string - /** - * total credits on this invoice - */ - credits_total?: number - /** - * unique identifier of this invoice - */ - id?: string - /** - * human readable invoice number - */ - number?: number - /** - * the ending date that the invoice covers - */ - period_end?: string - /** - * the starting date that this invoice covers - */ - period_start?: string - /** - * payment status for this invoice (pending, successful, failed) - */ - state?: number - /** - * combined total of charges and credits on this invoice - */ - total?: number - /** - * when invoice was updated - */ - updated_at?: string -} -/** - * Keys represent public SSH keys associated with an account and are used to authorize accounts as they are performing git operations. - */ -export interface Key { - [k: string]: unknown - /** - * comment on the key - */ - comment?: string - /** - * when key was created - */ - created_at?: string - /** - * @deprecated - * deprecated. Please refer to 'comment' instead - */ - email?: string - /** - * a unique identifying string based on contents - */ - fingerprint?: string - /** - * unique identifier of this key - */ - id?: string - /** - * full public_key as uploaded - */ - public_key?: string - /** - * when key was updated - */ - updated_at?: string -} -/** - * [Log drains](https://devcenter.heroku.com/articles/log-drains) provide a way to forward your Heroku logs to an external syslog server for long-term archiving. This external service must be configured to receive syslog packets from Heroku, whereupon its URL can be added to an app using this API. Some add-ons will add a log drain when they are provisioned to an app. These drains can only be removed by removing the add-on. - */ -export interface LogDrain { - [k: string]: unknown - addon?: Addon - app?: App1 - /** - * when log drain was created - */ - created_at?: string - /** - * unique identifier of this log drain - */ - id?: string - /** - * token associated with the log drain - */ - token?: string - /** - * when log drain was updated - */ - updated_at?: string - /** - * url associated with the log drain - */ - url?: string -} -/** - * A log session is a reference to the http based log stream for an app. - */ -export interface LogSession { - [k: string]: unknown - /** - * when log connection was created - */ - created_at?: string - /** - * unique identifier of this log session - */ - id?: string - /** - * URL for log streaming session - */ - logplex_url?: string - /** - * when log session was updated - */ - updated_at?: string -} -/** - * OAuth authorizations represent clients that a Heroku user has authorized to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) - */ -export interface OAuthAuthorization { - [k: string]: unknown - /** - * access token for this authorization - */ - access_token?: { - [k: string]: unknown - /** - * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime - */ - expires_in?: null | number - /** - * unique identifier of OAuth token - */ - id?: string - /** - * contents of the token to be used for authorization - */ - token?: string - } | null - /** - * identifier of the client that obtained this authorization, if any - */ - client?: { - [k: string]: unknown - /** - * unique identifier of this OAuth client - */ - id?: string - /** - * OAuth client name - */ - name?: string - /** - * endpoint for redirection after authorization with OAuth client - */ - redirect_uri?: string - } | null - /** - * when OAuth authorization was created - */ - created_at?: string - /** - * this authorization's grant - */ - grant?: { - [k: string]: unknown - /** - * grant code received from OAuth web application authorization - */ - code?: string - /** - * seconds until OAuth grant expires - */ - expires_in?: number - /** - * unique identifier of OAuth grant - */ - id?: string - } | null - /** - * unique identifier of OAuth authorization - */ - id?: string - /** - * refresh token for this authorization - */ - refresh_token?: { - [k: string]: unknown - /** - * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime - */ - expires_in?: null | number - /** - * unique identifier of OAuth token - */ - id?: string - /** - * contents of the token to be used for authorization - */ - token?: string - } | null - scope?: Scope - /** - * when OAuth authorization was updated - */ - updated_at?: string - /** - * authenticated user associated with this authorization - */ - user?: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * full name of the account owner - */ - full_name?: null | string - /** - * unique identifier of an account - */ - id?: string - } -} -/** - * OAuth clients are applications that Heroku users can authorize to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth). - */ -export interface OAuthClient { - [k: string]: unknown - /** - * when OAuth client was created - */ - created_at?: string - /** - * unique identifier of this OAuth client - */ - id?: string - /** - * whether the client is still operable given a delinquent account - */ - ignores_delinquent?: boolean | null - /** - * OAuth client name - */ - name?: string - /** - * endpoint for redirection after authorization with OAuth client - */ - redirect_uri?: string - /** - * secret used to obtain OAuth authorizations under this client - */ - secret?: string - /** - * when OAuth client was updated - */ - updated_at?: string -} -/** - * OAuth grants are used to obtain authorizations on behalf of a user. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) - */ -export interface OAuthGrant { - [k: string]: unknown -} -/** - * OAuth tokens provide access for authorized clients to act on behalf of a Heroku user to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) - */ -export interface OAuthToken { - [k: string]: unknown - /** - * current access token - */ - access_token?: { - [k: string]: unknown - /** - * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime - */ - expires_in?: null | number - /** - * unique identifier of OAuth token - */ - id?: string - /** - * contents of the token to be used for authorization - */ - token?: string - } - /** - * authorization for this set of tokens - */ - authorization?: { - [k: string]: unknown - /** - * unique identifier of OAuth authorization - */ - id?: string - } - /** - * OAuth client secret used to obtain token - */ - client?: { - [k: string]: unknown - /** - * secret used to obtain OAuth authorizations under this client - */ - secret?: string - } | null - /** - * when OAuth token was created - */ - created_at?: string - /** - * grant used on the underlying authorization - */ - grant?: { - [k: string]: unknown - /** - * grant code received from OAuth web application authorization - */ - code?: string - /** - * type of grant requested, one of `authorization_code` or `refresh_token` - */ - type?: string - } - /** - * unique identifier of OAuth token - */ - id?: string - /** - * refresh token for this authorization - */ - refresh_token?: { - [k: string]: unknown - /** - * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime - */ - expires_in?: null | number - /** - * unique identifier of OAuth token - */ - id?: string - /** - * contents of the token to be used for authorization - */ - token?: string - } - /** - * OAuth session using this token - */ - session?: { - [k: string]: unknown - /** - * unique identifier of OAuth token - */ - id?: string - } - /** - * when OAuth token was updated - */ - updated_at?: string - /** - * Reference to the user associated with this token - */ - user?: { - [k: string]: unknown - /** - * unique identifier of an account - */ - id?: string - } -} -/** - * A password reset represents a in-process password reset attempt. - */ -export interface PasswordReset { - [k: string]: unknown - /** - * when password reset was created - */ - created_at?: string - user?: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * unique identifier of an account - */ - id?: string - } -} -/** - * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. - */ -export interface PeeringInfo { - [k: string]: unknown - /** - * The AWS account ID of your Private Space. - */ - aws_account_id?: string - /** - * region name used by provider - */ - aws_region?: - | 'ap-northeast-1' - | 'ap-northeast-2' - | 'ap-south-1' - | 'ap-southeast-1' - | 'ap-southeast-2' - | 'ca-central-1' - | 'eu-central-1' - | 'eu-west-1' - | 'eu-west-2' - | 'sa-east-1' - | 'us-east-1' - | 'us-west-1' - | 'us-west-2' - /** - * The CIDR ranges that should be routed to the Private Space VPC. - */ - dyno_cidr_blocks?: string[] - /** - * The CIDR ranges that should be routed to the Private Space VPC. - */ - space_cidr_blocks?: string[] - /** - * The CIDR ranges that you must not conflict with. - */ - unavailable_cidr_blocks?: string[] - /** - * The CIDR range of the Private Space VPC - */ - vpc_cidr?: string - /** - * The AWS VPC ID of the peer. - */ - vpc_id?: string -} -/** - * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. - */ -export interface Peering { - [k: string]: unknown - /** - * The AWS account ID of your Private Space. - */ - aws_account_id?: string - /** - * The AWS region of the peer connection. - */ - aws_region?: string - /** - * The AWS VPC ID of the peer. - */ - aws_vpc_id?: string - /** - * The CIDR blocks of the peer. - */ - cidr_blocks?: string[] - /** - * When a peering connection will expire. - */ - expires?: string - /** - * The AWS VPC Peering Connection ID of the peering. - */ - pcx_id?: string - /** - * The status of the peering connection. - */ - status?: - | 'active' - | 'deleted' - | 'expired' - | 'failed' - | 'initiating-request' - | 'pending-acceptance' - | 'provisioning' - | 'rejected' - /** - * The type of peering connection. - */ - type?: 'customer-managed' | 'heroku-managed' | 'unknown' -} -/** - * An owned entity including users' permissions. - */ -export interface PermissionEntity { - [k: string]: unknown - /** - * ID of the entity. - */ - id?: string - /** - * Name of the entity. - */ - name?: string - /** - * unique identifier of team - */ - team_id?: string - /** - * The type of object the entity is referring to. - */ - type?: 'app' | 'space' - /** - * Users that have access to the entity. - */ - users?: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * unique identifier of an account - */ - id?: string - /** - * enterprise account permissions - */ - permissions?: string[] - }[] -} -/** - * Information about latest builds of apps in a pipeline. - */ -export interface PipelineBuild { - [k: string]: unknown -} -/** - * Pipeline Config Vars allow you to manage the configuration information provided to a pipeline. - */ -export interface PipelineConfigVars { - /** - * This interface was referenced by `PipelineConfigVars`'s JSON-Schema definition - * via the `patternProperty` "^\w+$". - */ - [k: string]: string -} -/** - * Information about an app's coupling to a pipeline - */ -export interface PipelineCoupling { - [k: string]: unknown - /** - * app involved in the pipeline coupling - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - } - /** - * when pipeline coupling was created - */ - created_at?: string - /** - * unique identifier of pipeline coupling - */ - id?: string - /** - * pipeline involved in the coupling - */ - pipeline?: { - [k: string]: unknown - /** - * unique identifier of pipeline - */ - id?: string - } - /** - * target pipeline stage - */ - stage?: 'development' | 'production' | 'review' | 'staging' | 'test' - /** - * when pipeline coupling was updated - */ - updated_at?: string -} -/** - * Information about latest deployments of apps in a pipeline. - */ -export interface PipelineDeployment { - [k: string]: unknown -} -/** - * Promotion targets represent an individual app being promoted to - */ -export interface PipelinePromotionTarget { - [k: string]: unknown - /** - * the app which was promoted to - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - } - /** - * an error message for why the promotion failed - */ - error_message?: null | string - /** - * unique identifier of promotion target - */ - id?: string - /** - * the promotion which the target belongs to - */ - pipeline_promotion?: { - [k: string]: unknown - /** - * unique identifier of promotion - */ - id?: string - } - /** - * the release which was created on the target app - */ - release?: { - [k: string]: unknown - /** - * unique identifier of release - */ - id?: string - } | null - /** - * status of promotion - */ - status?: 'failed' | 'pending' | 'succeeded' -} -/** - * Promotions allow you to move code from an app in a pipeline to all targets - */ -export interface PipelinePromotion { - [k: string]: unknown - /** - * when promotion was created - */ - created_at?: string - /** - * unique identifier of promotion - */ - id?: string - /** - * the pipeline which the promotion belongs to - */ - pipeline?: { - [k: string]: unknown - /** - * unique identifier of pipeline - */ - id?: string - } - /** - * the app being promoted from - */ - source?: { - [k: string]: unknown - /** - * the app which was promoted from - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - } - /** - * the release used to promoted from - */ - release?: { - [k: string]: unknown - /** - * unique identifier of release - */ - id?: string - } - } - /** - * status of promotion - */ - status?: 'completed' | 'pending' - /** - * when promotion was updated - */ - updated_at?: null | string -} -/** - * Information about latest releases of apps in a pipeline. - */ -export interface PipelineRelease { - [k: string]: unknown -} -/** - * A pipeline's stack is determined by the apps in the pipeline. This is used during creation of CI and Review Apps that have no stack defined in app.json - */ -export interface PipelineStack { - [k: string]: unknown - /** - * identity of the stack that will be used for new builds without a stack defined in CI and Review Apps - */ - stack?: { - [k: string]: unknown - /** - * unique identifier of stack - */ - id?: string - /** - * unique name of stack - */ - name?: string - } | null -} -/** - * A pipeline transfer is the process of changing pipeline ownership along with the contained apps. - */ -export interface PipelineTransfer { - [k: string]: unknown - new_owner?: NewOwner - /** - * pipeline being transferred - */ - pipeline?: { - [k: string]: unknown - /** - * unique identifier of pipeline - */ - id?: string - } - previous_owner?: PreviousOwner -} -/** - * Previous owner of the pipeline. - */ -export interface PreviousOwner { - [k: string]: unknown - /** - * unique identifier of a pipeline owner - */ - id: string - /** - * type of pipeline owner - */ - type: string -} -/** - * New owner of the pipeline. - */ -export interface NewOwner { - [k: string]: unknown - /** - * unique identifier of a pipeline owner - */ - id: string - /** - * type of pipeline owner - */ - type: string -} -/** - * A pipeline allows grouping of apps into different stages. - */ -export interface Pipeline { - [k: string]: unknown - /** - * when pipeline was created - */ - created_at?: string - /** - * unique identifier of pipeline - */ - id?: string - /** - * name of pipeline - */ - name?: string - owner?: Owner2 - /** - * when pipeline was updated - */ - updated_at?: string -} -/** - * Rate Limit represents the number of request tokens each account holds. Requests to this endpoint do not count towards the rate limit. - */ -export interface RateLimit { - [k: string]: unknown - /** - * allowed requests remaining in current interval - */ - remaining?: number -} -/** - * A release represents a combination of code, config vars and add-ons for an app on Heroku. - */ -export interface Release { - [k: string]: unknown - /** - * add-on plans installed on the app for this release - */ - addon_plan_names?: string[] - /** - * app involved in the release - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string - } - /** - * when release was created - */ - created_at?: string - /** - * indicates this release as being the current one for the app - */ - current?: boolean - /** - * description of changes in this release - */ - description?: string - /** - * unique identifier of release - */ - id?: string - /** - * Release command output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). - */ - output_stream_url?: null | string - /** - * slug running in this release - */ - slug?: { - [k: string]: unknown - /** - * unique identifier of slug - */ - id?: string - } | null - /** - * current status of the release - */ - status?: 'failed' | 'pending' | 'succeeded' - /** - * when release was updated - */ - updated_at?: string - /** - * user that created the release - */ - user?: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * unique identifier of an account - */ - id?: string - } - /** - * unique version assigned to the release - */ - version?: number -} -/** - * An ephemeral app to review a set of changes - */ -export interface ReviewApp { - [k: string]: unknown - /** - * the Heroku app associated to this review app - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - } | null - /** - * the app setup for this review app - */ - app_setup?: { - [k: string]: unknown - /** - * unique identifier of app setup - */ - id?: string - } | null - /** - * the branch of the repository which the review app is based on - */ - branch?: string - /** - * when test run was created - */ - created_at?: string - creator?: Creator - /** - * error message from creating the review app if any - */ - error_status?: null | string - fork_repo?: { - [k: string]: unknown - /** - * repository id of the fork the branch resides in - */ - id?: null | number - } | null - /** - * unique identifier of the review app - */ - id?: string - /** - * message from creating the review app if any - */ - message?: null | string - /** - * the pipeline which this review app belongs to - */ - pipeline?: { - [k: string]: unknown - /** - * unique identifier of pipeline - */ - id?: string - } - /** - * pull request number the review app is built for - */ - pr_number?: null | number - /** - * current state of the review app - */ - status?: 'created' | 'creating' | 'deleted' | 'deleting' | 'errored' | 'pending' - /** - * when review app was updated - */ - updated_at?: string - /** - * wait for ci before building the app - */ - wait_for_ci?: boolean -} -/** - * The user who created the review app - */ -export interface Creator { - [k: string]: unknown -} -/** - * Review apps can be configured for pipelines. - */ -export interface ReviewAppConfiguration { - [k: string]: unknown - /** - * enable automatic review apps for pull requests - */ - automatic_review_apps?: boolean - /** - * A unique prefix that will be used to create review app names - */ - base_name?: null | string - deploy_target?: DeployTarget - /** - * automatically destroy review apps when they haven't been deployed for a number of days - */ - destroy_stale_apps?: boolean - /** - * unique identifier of pipeline - */ - pipeline_id?: string - repo?: { - [k: string]: unknown - /** - * repository id - */ - id?: number - } - /** - * number of days without a deployment after which to consider a review app stale - */ - stale_days?: number - /** - * If true, review apps are created only when CI passes - */ - wait_for_ci?: boolean -} -/** - * A slug is a snapshot of your application code that is ready to run on the platform. - */ -export interface Slug { - [k: string]: unknown - /** - * pointer to the url where clients can fetch or store the actual release binary - */ - blob?: { - [k: string]: unknown - /** - * method to be used to interact with the slug blob - */ - method?: string - /** - * URL to interact with the slug blob - */ - url?: string - } - /** - * description from buildpack of slug - */ - buildpack_provided_description?: null | string - /** - * an optional checksum of the slug for verifying its integrity - */ - checksum?: null | string - /** - * identification of the code with your version control system (eg: SHA of the git HEAD) - */ - commit?: null | string - /** - * an optional description of the provided commit - */ - commit_description?: null | string - /** - * when slug was created - */ - created_at?: string - /** - * unique identifier of slug - */ - id?: string - process_types?: ProcessTypes - /** - * size of slug, in bytes - */ - size?: null | number - /** - * identity of slug stack - */ - stack?: { - [k: string]: unknown - /** - * unique identifier of stack - */ - id?: string - /** - * unique name of stack - */ - name?: string - } - /** - * when slug was updated - */ - updated_at?: string -} -/** - * hash mapping process type names to their respective command - */ -export interface ProcessTypes { - /** - * This interface was referenced by `ProcessTypes`'s JSON-Schema definition - * via the `patternProperty` "^[-\w]{1,128}$". - */ - [k: string]: string -} -/** - * SMS numbers are used for recovery on accounts with two-factor authentication enabled. - */ -export interface SMSNumber { - [k: string]: unknown - /** - * SMS number of account - */ - sms_number?: null | string -} -/** - * SNI Endpoint is a public address serving a custom SSL cert for HTTPS traffic, using the SNI TLS extension, to a Heroku app. - */ -export interface SNIEndpoint { - [k: string]: unknown - /** - * application that this SSL certificate is on - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string - } - /** - * raw contents of the public certificate chain (eg: .crt or .pem file) - */ - certificate_chain?: string - /** - * when endpoint was created - */ - created_at?: string - /** - * unique name for SSL certificate - */ - display_name?: null | string - domains?: Domains - /** - * unique identifier of this SNI endpoint - */ - id?: string - /** - * unique name for SNI endpoint - */ - name?: string - /** - * certificate provided by this endpoint - */ - ssl_cert?: { - [k: string]: unknown - 'ca_signed?'?: boolean - cert_domains?: CertDomains - expires_at?: string - /** - * unique identifier of this SSL certificate - */ - id?: string - issuer?: string - 'self_signed?'?: boolean - starts_at?: string - subject?: string - } - /** - * when SNI endpoint was updated - */ - updated_at?: string -} -/** - * A source is a location for uploading and downloading an application's source code. - */ -export interface Source { - [k: string]: unknown - /** - * pointer to the URL where clients can fetch or store the source - */ - source_blob?: { - [k: string]: unknown - /** - * URL to download the source - */ - get_url?: string - /** - * URL to upload the source - */ - put_url?: string - } -} -/** - * Space access represents the permissions a particular user has on a particular space. - */ -export interface SpaceAccess { - [k: string]: unknown - /** - * when space was created - */ - created_at?: string - /** - * unique identifier of space - */ - id?: string - /** - * user space permissions - */ - permissions?: { - [k: string]: unknown - description?: string - name?: string - }[] - /** - * space user belongs to - */ - space?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string - } - /** - * when space was updated - */ - updated_at?: string - /** - * identity of user account - */ - user?: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * unique identifier of an account - */ - id?: string - } -} -/** - * Network address translation (NAT) for stable outbound IP addresses from a space - */ -export interface SpaceNetworkAddressTranslation { - [k: string]: unknown - /** - * when network address translation for a space was created - */ - created_at?: string - sources?: Sources - /** - * availability of network address translation for a space - */ - state?: 'disabled' | 'enabled' | 'updating' - /** - * when network address translation for a space was updated - */ - updated_at?: string -} -/** - * Space Topology provides you with a mechanism for viewing all the running dynos, formations and applications for a space. This is the same data thats used to power our DNS Service Discovery. - */ -export interface SpaceTopology { - [k: string]: unknown - /** - * The apps within this space - */ - apps?: { - [k: string]: unknown - domains?: unknown[] - /** - * formations for application - */ - formation?: Formation[] - /** - * unique identifier of app - */ - id?: string - }[] - /** - * version of the space topology payload - */ - version?: number -} -/** - * formations for application - */ -export interface Formation { - [k: string]: unknown - /** - * Current dynos for application - */ - dynos?: Dyno[] - /** - * unique identifier of this process type - */ - id?: string - /** - * Name of process type - */ - process_type?: string -} -/** - * A dyno - */ -export interface Dyno { - [k: string]: unknown - /** - * localspace hostname of resource - */ - hostname?: string - /** - * unique identifier of this dyno - */ - id?: string - /** - * process number, e.g. 1 in web.1 - */ - number?: number - /** - * RFC1918 Address of Dyno - */ - private_ip?: string -} -/** - * Transfer spaces between enterprise teams with the same Enterprise Account. - */ -export interface SpaceTransfer { - [k: string]: unknown -} -/** - * A space is an isolated, highly available, secure app execution environment. - */ -export interface Space { - [k: string]: unknown - /** - * The RFC-1918 CIDR the Private Space will use. It must be a /16 in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 - */ - cidr?: string - /** - * when space was created - */ - created_at?: string - /** - * The RFC-1918 CIDR that the Private Space will use for the Heroku-managed peering connection that's automatically created when using Heroku Data add-ons. It must be between a /16 and a /20 - */ - data_cidr?: string - /** - * unique identifier of space - */ - id?: string - /** - * unique name of space - */ - name?: string - /** - * organization that owns this space - */ - organization?: { - [k: string]: unknown - /** - * unique name of team - */ - name?: string - } - /** - * identity of space region - */ - region?: { - [k: string]: unknown - /** - * unique identifier of region - */ - id?: string - /** - * unique name of region - */ - name?: string - } - /** - * true if this space has shield enabled - */ - shield?: boolean - /** - * availability of this space - */ - state?: 'allocated' | 'allocating' | 'deleting' - /** - * team that owns this space - */ - team?: { - [k: string]: unknown - /** - * unique identifier of team - */ - id?: string - /** - * unique name of team - */ - name?: string - } - /** - * when space was updated - */ - updated_at?: string -} -/** - * Stacks are the different application execution environments available in the Heroku platform. - */ -export interface Stack { - [k: string]: unknown - /** - * when stack was introduced - */ - created_at?: string - /** - * indicates this stack is the default for new apps - */ - default?: boolean - /** - * unique identifier of stack - */ - id?: string - /** - * unique name of stack - */ - name?: string - /** - * availability of this stack: beta, deprecated or public - */ - state?: string - /** - * when stack was last modified - */ - updated_at?: string -} -export interface TeamAddOn { - [k: string]: unknown -} -/** - * A team collaborator represents an account that has been given access to a team app on Heroku. - */ -export interface TeamAppCollaborator { - [k: string]: unknown - /** - * app collaborator belongs to - */ - app?: { - [k: string]: unknown - /** - * unique identifier of app - */ - id?: string - /** - * unique name of app - */ - name?: string - } - /** - * when collaborator was created - */ - created_at?: string - /** - * unique identifier of collaborator - */ - id?: string - /** - * array of permissions for the collaborator (only applicable if the app is on a team) - */ - permissions?: TeamAppPermission[] - /** - * role in the team - */ - role?: 'admin' | 'collaborator' | 'member' | 'owner' | null - /** - * when collaborator was updated - */ - updated_at?: string - /** - * identity of collaborated account - */ - user?: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * whether the user is federated and belongs to an Identity Provider - */ - federated?: boolean - /** - * unique identifier of an account - */ - id?: string - } -} -/** - * A team app encapsulates the team specific functionality of Heroku apps. - */ -export interface TeamApp { - [k: string]: unknown - /** - * when app was archived - */ - archived_at?: null | string - /** - * identity of the stack that will be used for new builds - */ - build_stack?: { - [k: string]: unknown - /** - * unique identifier of stack - */ - id?: string - /** - * unique name of stack - */ - name?: string - } - /** - * description from buildpack of app - */ - buildpack_provided_description?: null | string - /** - * when app was created - */ - created_at?: string - /** - * git repo URL of app - */ - git_url?: string - /** - * unique identifier of app - */ - id?: string - /** - * describes whether a Private Spaces app is externally routable or not - */ - internal_routing?: boolean | null - /** - * is the current member a collaborator on this app. - */ - joined?: boolean - /** - * are other team members forbidden from joining this app. - */ - locked?: boolean - /** - * maintenance status of app - */ - maintenance?: boolean - /** - * unique name of app - */ - name?: string - /** - * identity of app owner - */ - owner?: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * unique identifier of an account - */ - id?: string - } | null - /** - * identity of app region - */ - region?: { - [k: string]: unknown - /** - * unique identifier of region - */ - id?: string - /** - * unique name of region - */ - name?: string - } - /** - * when app was released - */ - released_at?: null | string - /** - * git repo size in bytes of app - */ - repo_size?: null | number - /** - * slug size in bytes of app - */ - slug_size?: null | number - /** - * identity of space - */ - space?: { - [k: string]: unknown - /** - * unique identifier of space - */ - id?: string - /** - * unique name of space - */ - name?: string - } | null - /** - * identity of app stack - */ - stack?: { - [k: string]: unknown - /** - * unique identifier of stack - */ - id?: string - /** - * unique name of stack - */ - name?: string - } - /** - * team that owns this app - */ - team?: { - [k: string]: unknown - /** - * unique name of team - */ - name?: string - } | null - /** - * when app was updated - */ - updated_at?: string - /** - * web URL of app - */ - web_url?: null | string -} -/** - * Usage for an enterprise team at a daily resolution. - */ -export interface TeamDailyUsage { - [k: string]: unknown - /** - * total add-on credits used - */ - addons?: number - /** - * app usage in the team - */ - apps?: AppUsageDaily[] - /** - * total add-on credits used for first party add-ons - */ - data?: number - /** - * date of the usage - */ - date?: string - /** - * dynos used - */ - dynos?: number - /** - * team identifier - */ - id?: string - /** - * name of the team - */ - name?: string - /** - * total add-on credits used for third party add-ons - */ - partner?: number - /** - * space credits used - */ - space?: number -} -/** - * A Heroku team becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent teams if their invoices remain unpaid. - */ -export interface TeamDelinquency { - [k: string]: unknown - /** - * scheduled time of when we will delete your team due to delinquency - */ - scheduled_deletion_time?: null | string - /** - * scheduled time of when we will suspend your team due to delinquency - */ - scheduled_suspension_time?: null | string -} -/** - * A team feature represents a feature enabled on a team account. - */ -export interface TeamFeature { - [k: string]: unknown - /** - * when team feature was created - */ - created_at?: string - /** - * description of team feature - */ - description?: string - /** - * user readable feature name - */ - display_name?: string - /** - * documentation URL of team feature - */ - doc_url?: string - /** - * whether or not team feature has been enabled - */ - enabled?: boolean - /** - * e-mail to send feedback about the feature - */ - feedback_email?: string - /** - * unique identifier of team feature - */ - id?: string - /** - * unique name of team feature - */ - name?: string - /** - * state of team feature - */ - state?: string - /** - * when team feature was updated - */ - updated_at?: string -} -/** - * A team invitation represents an invite to a team. - */ -export interface TeamInvitation { - [k: string]: unknown - /** - * when invitation was created - */ - created_at?: string - /** - * unique identifier of an invitation - */ - id?: string - invited_by?: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * unique identifier of an account - */ - id?: string - /** - * full name of the account owner - */ - name?: null | string - } - /** - * role in the team - */ - role?: 'admin' | 'collaborator' | 'member' | 'owner' | null - team?: { - [k: string]: unknown - /** - * unique identifier of team - */ - id?: string - /** - * unique name of team - */ - name?: string - } - /** - * when invitation was updated - */ - updated_at?: string - user?: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * unique identifier of an account - */ - id?: string - /** - * full name of the account owner - */ - name?: null | string - } -} -/** - * A Team Invoice is an itemized bill of goods for a team which includes pricing and charges. - */ -export interface TeamInvoice { - [k: string]: unknown - /** - * total add-ons charges in on this invoice - */ - addons_total?: number - /** - * total charges on this invoice - */ - charges_total?: number - /** - * when invoice was created - */ - created_at?: string - /** - * total credits on this invoice - */ - credits_total?: number - /** - * total database charges on this invoice - */ - database_total?: number - /** - * total amount of dyno units consumed across dyno types. - */ - dyno_units?: number - /** - * unique identifier of this invoice - */ - id?: string - /** - * human readable invoice number - */ - number?: number - /** - * status of the invoice payment - */ - payment_status?: string - /** - * the ending date that the invoice covers - */ - period_end?: string - /** - * the starting date that this invoice covers - */ - period_start?: string - /** - * total platform charges on this invoice - */ - platform_total?: number - /** - * payment status for this invoice (pending, successful, failed) - */ - state?: number - /** - * combined total of charges and credits on this invoice - */ - total?: number - /** - * when invoice was updated - */ - updated_at?: string - /** - * The total amount of hours consumed across dyno types. - */ - weighted_dyno_hours?: number -} -/** - * A team member is an individual with access to a team. - */ -export interface TeamMember { - /** - * when the membership record was created - */ - created_at: string - /** - * email address of the team member - */ - email: string - /** - * whether the user is federated and belongs to an Identity Provider - */ - federated: boolean - /** - * unique identifier of the team member - */ - id?: string - /** - * Identity Provider information the member is federated with - */ - identity_provider?: { - [k: string]: unknown - /** - * unique identifier of this identity provider - */ - id?: string - /** - * name of the identity provider - */ - name?: string - owner?: Owner - /** - * whether the identity_provider information is redacted or not - */ - redacted?: boolean - } | null - /** - * role in the team - */ - role?: 'admin' | 'collaborator' | 'member' | 'owner' | null - /** - * whether the team member has two factor authentication enabled - */ - two_factor_authentication?: boolean - /** - * when the membership record was updated - */ - updated_at: string - /** - * user information for the membership - */ - user?: { - [k: string]: unknown - /** - * unique email address of account - */ - email?: string - /** - * unique identifier of an account - */ - id?: string - /** - * full name of the account owner - */ - name?: null | string - } -} -/** - * Usage for an enterprise team at a monthly resolution. - */ -export interface TeamMonthlyUsage { - [k: string]: unknown - /** - * total add-on credits used - */ - addons?: number - /** - * app usage in the team - */ - apps?: AppUsageMonthly[] - /** - * average connect rows synced - */ - connect?: number - /** - * total add-on credits used for first party add-ons - */ - data?: number - /** - * dynos used - */ - dynos?: number - /** - * team identifier - */ - id?: string - /** - * year and month of the usage - */ - month?: string - /** - * name of the team - */ - name?: string - /** - * total add-on credits used for third party add-ons - */ - partner?: number - /** - * space credits used - */ - space?: number -} -/** - * Tracks a Team's Preferences - */ -export interface TeamPreferences { - [k: string]: unknown - /** - * Whether add-on service rules should be applied to add-on installations - */ - 'addons-controls'?: boolean | null - /** - * The default permission used when adding new members to the team - */ - 'default-permission'?: 'admin' | 'member' | 'viewer' | null -} -/** - * A space is an isolated, highly available, secure app execution environment. - */ -export interface TeamSpace { - [k: string]: unknown -} -/** - * Teams allow you to manage access to a shared group of applications and other resources. - */ -export interface Team { - [k: string]: unknown - /** - * when the team was created - */ - created_at?: string - /** - * whether charges incurred by the team are paid by credit card. - */ - credit_card_collections?: boolean - /** - * whether to use this team when none is specified - */ - default?: boolean - enterprise_account?: EnterpriseAccount1 - /** - * unique identifier of team - */ - id?: string - identity_provider?: IdentityProvider2 - /** - * upper limit of members allowed in a team. - */ - membership_limit?: null | number - /** - * unique name of team - */ - name?: string - /** - * whether the team is provisioned licenses by salesforce. - */ - provisioned_licenses?: boolean - /** - * role in the team - */ - role?: 'admin' | 'collaborator' | 'member' | 'owner' | null - /** - * type of team. - */ - type?: 'enterprise' | 'team' - /** - * when the team was updated - */ - updated_at?: string -} -/** - * A single test case belonging to a test run - */ -export interface TestCase { - [k: string]: unknown - /** - * when test case was created - */ - created_at?: string - /** - * description of the test case - */ - description?: string - /** - * meta information about the test case - */ - diagnostic?: string - /** - * special note about the test case e.g. skipped, todo - */ - directive?: string - /** - * unique identifier of a test case - */ - id?: string - /** - * the test number - */ - number?: number - /** - * whether the test case was successful - */ - passed?: boolean - /** - * the test node which executed this test case - */ - test_node?: { - [k: string]: unknown - id?: string - } - /** - * the test run which owns this test case - */ - test_run?: { - [k: string]: unknown - id?: string - } - /** - * when test case was updated - */ - updated_at?: string -} -/** - * A single test node belonging to a test run - */ -export interface TestNode { - [k: string]: unknown - /** - * when test node was created - */ - created_at?: string - /** - * the dyno which belongs to this test node - */ - dyno?: { - [k: string]: unknown - /** - * a URL to stream output from for debug runs or null for non-debug runs - */ - attach_url?: null | string - id?: string - } | null - /** - * the status of the test run when the error occured - */ - error_status?: null | string - /** - * the exit code of the test script - */ - exit_code?: null | number - id?: string - /** - * The index of the test node - */ - index?: number - /** - * human friendly message indicating reason for an error - */ - message?: null | string - /** - * the streaming output for the test node - */ - output_stream_url?: string - /** - * the pipeline which owns this test node - */ - pipeline?: { - [k: string]: unknown - id?: string - } - /** - * the streaming test setup output for the test node - */ - setup_stream_url?: string - /** - * current state of the test run - */ - status?: - | 'building' - | 'cancelled' - | 'creating' - | 'debugging' - | 'errored' - | 'failed' - | 'pending' - | 'running' - | 'succeeded' - /** - * the test run which owns this test node - */ - test_run?: { - [k: string]: unknown - id?: string - } - /** - * when test node was updated - */ - updated_at?: string -} -/** - * An execution or trial of one or more tests - */ -export interface TestRun { - [k: string]: unknown - /** - * the email of the actor triggering the test run - */ - actor_email?: string - app_setup?: AppSetup - /** - * whether the test was run with an empty cache - */ - clear_cache?: boolean | null - /** - * the branch of the repository that the test run concerns - */ - commit_branch?: string - /** - * the message for the commit under test - */ - commit_message?: string - /** - * the SHA hash of the commit under test - */ - commit_sha?: string - /** - * when test run was created - */ - created_at?: string - /** - * whether the test run was started for interactive debugging - */ - debug?: boolean - /** - * the type of dynos used for this test-run - */ - dyno?: { - [k: string]: unknown - /** - * dyno size - */ - size?: string - } | null - /** - * unique identifier of a test run - */ - id?: string - /** - * human friendly message indicating reason for an error - */ - message?: null | string - /** - * the auto incrementing test run number - */ - number?: number - /** - * the team that owns this test-run - */ - organization?: { - [k: string]: unknown - /** - * unique name of team - */ - name?: string - } | null - /** - * the pipeline which owns this test-run - */ - pipeline?: { - [k: string]: unknown - id?: string - } - /** - * The download location for the source code to be tested - */ - source_blob_url?: string - /** - * current state of the test run - */ - status?: - | 'building' - | 'cancelled' - | 'creating' - | 'debugging' - | 'errored' - | 'failed' - | 'pending' - | 'running' - | 'succeeded' - /** - * when test-run was updated - */ - updated_at?: string - user?: Account - /** - * human friently warning emitted during the test run - */ - warning_message?: null | string -} -/** - * Tracks a user's preferences and message dismissals - */ -export interface UserPreferences { - [k: string]: unknown - /** - * User's default team - */ - 'default-organization'?: null | string - /** - * Whether the user has dismissed the getting started banner - */ - 'dismissed-getting-started'?: boolean | null - /** - * Whether the user has dismissed the GitHub link banner - */ - 'dismissed-github-banner'?: boolean | null - /** - * Whether the user has dismissed the Organization Access Controls banner - */ - 'dismissed-org-access-controls'?: boolean | null - /** - * Whether the user has dismissed the Organization Wizard - */ - 'dismissed-org-wizard-notification'?: boolean | null - /** - * Whether the user has dismissed the Pipelines banner - */ - 'dismissed-pipelines-banner'?: boolean | null - /** - * Whether the user has dismissed the GitHub banner on a pipeline overview - */ - 'dismissed-pipelines-github-banner'?: boolean | null - 'dismissed-pipelines-github-banners'?: DismissedPipelinesGithubBanners - /** - * Whether the user has dismissed the 2FA SMS banner - */ - 'dismissed-sms-banner'?: boolean | null - /** - * User's default timezone - */ - timezone?: null | string -} -/** - * [VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN. - */ -export interface PrivateSpacesVPN { - [k: string]: unknown - /** - * VPN ID - */ - id?: string - /** - * IKE Version - */ - ike_version?: number - /** - * VPN Name - */ - name?: string - /** - * Public IP of VPN customer gateway - */ - public_ip?: string - routable_cidrs?: RoutableCidrs - /** - * CIDR Block of the Private Space - */ - space_cidr_block?: string - /** - * Status of the VPN - */ - status?: 'active' | 'deprovisioning' | 'failed' | 'pending' | 'provisioning' - /** - * Details of the status - */ - status_message?: string - tunnels?: Tunnel[] -} -/** - * Tunnel info - */ -export interface Tunnel { - [k: string]: unknown - /** - * Public IP address for the customer side of the tunnel - */ - customer_ip?: string - /** - * Public IP address for the tunnel - */ - ip?: string - /** - * Timestamp of last status changed - */ - last_status_change?: string - /** - * Pre-shared key - */ - pre_shared_key?: string - /** - * Status of the tunnel - */ - status?: 'DOWN' | 'UP' - /** - * Details of the status - */ - status_message?: string -} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..9e6c533 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,5725 @@ +{ + "name": "@heroku-cli/schema", + "version": "1.0.25", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "@heroku-cli/schema", + "version": "1.0.25", + "license": "MIT", + "devDependencies": { + "@typescript-eslint/parser": "^6.15.0", + "camelcase": "^8.0.0", + "dashify": "^2.0.0", + "eslint": "^8.56.0", + "eslint-config-salesforce-typescript": "3.2.3", + "eslint-plugin-unused-imports": "^3.1.0", + "http-call": "^5.2.2", + "jsonwebtoken": "9.0.0", + "pascal-case": "^4.0.0", + "prettier": "3.2.4", + "typescript": "^5.3.3" + }, + "engines": { + "node": ">=16.20.1" + }, + "peerDependencies": { + "tslib": "^2.6.3" + } + }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.23.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.23.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.41.0", + "dev": true, + "license": "MIT", + "dependencies": { + "comment-parser": "1.4.1", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.56.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.2", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/semver": { + "version": "7.5.7", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/type-utils": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.21.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.3", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "dev": true, + "license": "ISC" + }, + "node_modules/acorn": { + "version": "8.11.3", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.filter": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-array-method-boxes-properly": "^1.0.0", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.4", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.23.0", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/builtin-modules": { + "version": "3.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "8.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001589", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "2.4.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ci-info": { + "version": "4.0.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/clean-regexp": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "dev": true, + "license": "MIT" + }, + "node_modules/comment-parser": { + "version": "1.4.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/content-type": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/core-js-compat": { + "version": "3.36.0", + "dev": true, + "license": "MIT", + "dependencies": { + "browserslist": "^4.22.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/dashify": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/deep-is": { + "version": "0.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.4.680", + "dev": true, + "license": "ISC" + }, + "node_modules/error-ex": { + "version": "1.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.22.4", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.6", + "call-bind": "^1.0.7", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.2", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.1", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.0", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.1", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-array-method-boxes-properly": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.0" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "8.56.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.56.0", + "@humanwhocodes/config-array": "^0.11.13", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-config-salesforce": { + "version": "2.0.2", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/eslint-config-salesforce-license": { + "version": "0.2.0", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/eslint-config-salesforce-typescript": { + "version": "3.2.3", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@typescript-eslint/eslint-plugin": "^6.18.1", + "@typescript-eslint/parser": "^6.18.1", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-config-salesforce": "^2.0.2", + "eslint-config-salesforce-license": "^0.2.0", + "eslint-plugin-header": "^3.1.1", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jsdoc": "^46.10.1", + "eslint-plugin-unicorn": "^50.0.1" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.8.0", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-header": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": ">=7.7.0" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.29.1", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-jsdoc": { + "version": "46.10.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@es-joy/jsdoccomment": "~0.41.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.3.4", + "escape-string-regexp": "^4.0.0", + "esquery": "^1.5.0", + "is-builtin-module": "^3.2.1", + "semver": "^7.5.4", + "spdx-expression-parse": "^4.0.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/escape-string-regexp": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/spdx-expression-parse": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/eslint-plugin-unicorn": { + "version": "50.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.20", + "@eslint-community/eslint-utils": "^4.4.0", + "@eslint/eslintrc": "^2.1.4", + "ci-info": "^4.0.0", + "clean-regexp": "^1.0.0", + "core-js-compat": "^3.34.0", + "esquery": "^1.5.0", + "indent-string": "^4.0.0", + "is-builtin-module": "^3.2.1", + "jsesc": "^3.0.2", + "pluralize": "^8.0.0", + "read-pkg-up": "^7.0.1", + "regexp-tree": "^0.1.27", + "regjsparser": "^0.10.0", + "semver": "^7.5.4", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" + }, + "peerDependencies": { + "eslint": ">=8.56.0" + } + }, + "node_modules/eslint-plugin-unused-imports": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-rule-composer": "^0.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "6 - 7", + "eslint": "8" + }, + "peerDependenciesMeta": { + "@typescript-eslint/eslint-plugin": { + "optional": true + } + } + }, + "node_modules/eslint-rule-composer": { + "version": "0.3.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.2", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.17.1", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "dev": true, + "license": "ISC" + }, + "node_modules/for-each": { + "version": "0.3.3", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/function-bind": { + "version": "1.1.2", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "dev": true, + "license": "MIT" + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "dev": true, + "license": "ISC" + }, + "node_modules/http-call": { + "version": "5.3.0", + "dev": true, + "license": "ISC", + "dependencies": { + "content-type": "^1.0.4", + "debug": "^4.1.1", + "is-retry-allowed": "^1.1.0", + "is-stream": "^2.0.0", + "parse-json": "^4.0.0", + "tunnel-agent": "^0.6.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.3", + "dev": true, + "license": "ISC" + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "dev": true, + "license": "MIT" + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-builtin-module": { + "version": "3.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "builtin-modules": "^3.3.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-retry-allowed": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsdoc-type-pratt-parser": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/jsesc": { + "version": "3.0.2", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/jsonwebtoken": { + "version": "9.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "jws": "^3.2.2", + "lodash": "^4.17.21", + "ms": "^2.1.1", + "semver": "^7.3.8" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jwa": { + "version": "1.4.1", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "dev": true, + "license": "MIT", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "dev": true, + "license": "MIT" + }, + "node_modules/locate-path": { + "version": "6.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ms": { + "version": "2.1.1", + "dev": true, + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "dev": true, + "license": "MIT" + }, + "node_modules/no-case": { + "version": "4.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.14", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "array.prototype.filter": "^1.0.3", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.0.0" + } + }, + "node_modules/object.values": { + "version": "1.1.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pascal-case": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "no-case": "^4.0.0" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "dev": true, + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pluralize": { + "version": "8.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.2.4", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/read-pkg": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up": { + "version": "7.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/find-up": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/locate-path": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/p-limit": { + "version": "2.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/p-locate": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg/node_modules/parse-json": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/regexp-tree": { + "version": "0.1.27", + "dev": true, + "license": "MIT", + "bin": { + "regexp-tree": "bin/regexp-tree" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regjsparser": { + "version": "0.10.0", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/regjsparser/node_modules/jsesc": { + "version": "0.5.0", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "get-intrinsic": "^1.2.2", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/semver": { + "version": "7.6.0", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-function-length": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.2", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.17", + "dev": true, + "license": "CC0-1.0" + }, + "node_modules/string.prototype.trim": { + "version": "1.2.8", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.7", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "dev": true, + "license": "MIT" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-api-utils": { + "version": "1.2.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tslib": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "peer": true + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.3.3", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.0.13", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.14", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.6", + "call-bind": "^1.0.5", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "dev": true, + "license": "ISC" + }, + "node_modules/yallist": { + "version": "4.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + }, + "dependencies": { + "@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "dev": true + }, + "@babel/code-frame": { + "version": "7.23.5", + "dev": true, + "requires": { + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.22.20", + "dev": true + }, + "@babel/highlight": { + "version": "7.23.4", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + } + }, + "@es-joy/jsdoccomment": { + "version": "0.41.0", + "dev": true, + "requires": { + "comment-parser": "1.4.1", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" + } + }, + "@eslint-community/eslint-utils": { + "version": "4.4.0", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.3.0" + } + }, + "@eslint-community/regexpp": { + "version": "4.10.0", + "dev": true + }, + "@eslint/eslintrc": { + "version": "2.1.4", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + } + }, + "@eslint/js": { + "version": "8.56.0", + "dev": true + }, + "@humanwhocodes/config-array": { + "version": "0.11.14", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + } + }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "dev": true + }, + "@humanwhocodes/object-schema": { + "version": "2.0.2", + "dev": true + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@types/json-schema": { + "version": "7.0.15", + "dev": true + }, + "@types/json5": { + "version": "0.0.29", + "dev": true + }, + "@types/normalize-package-data": { + "version": "2.4.4", + "dev": true + }, + "@types/semver": { + "version": "7.5.7", + "dev": true + }, + "@typescript-eslint/eslint-plugin": { + "version": "6.21.0", + "dev": true, + "requires": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/type-utils": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + } + }, + "@typescript-eslint/parser": { + "version": "6.21.0", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4" + } + }, + "@typescript-eslint/scope-manager": { + "version": "6.21.0", + "dev": true, + "requires": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + } + }, + "@typescript-eslint/type-utils": { + "version": "6.21.0", + "dev": true, + "requires": { + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + } + }, + "@typescript-eslint/types": { + "version": "6.21.0", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "dev": true, + "requires": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "9.0.3", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, + "@typescript-eslint/utils": { + "version": "6.21.0", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "semver": "^7.5.4" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "dev": true, + "requires": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + } + }, + "@ungap/structured-clone": { + "version": "1.2.0", + "dev": true + }, + "acorn": { + "version": "8.11.3", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "dev": true, + "requires": {} + }, + "ajv": { + "version": "6.12.6", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "5.0.1", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "are-docs-informative": { + "version": "0.0.2", + "dev": true + }, + "argparse": { + "version": "2.0.1", + "dev": true + }, + "array-buffer-byte-length": { + "version": "1.0.1", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + } + }, + "array-includes": { + "version": "3.1.7", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-string": "^1.0.7" + } + }, + "array-union": { + "version": "2.1.0", + "dev": true + }, + "array.prototype.filter": { + "version": "1.0.3", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-array-method-boxes-properly": "^1.0.0", + "is-string": "^1.0.7" + } + }, + "array.prototype.findlastindex": { + "version": "1.2.4", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + } + }, + "array.prototype.flat": { + "version": "1.3.2", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + } + }, + "array.prototype.flatmap": { + "version": "1.3.2", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + } + }, + "arraybuffer.prototype.slice": { + "version": "1.0.3", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + } + }, + "available-typed-arrays": { + "version": "1.0.7", + "dev": true, + "requires": { + "possible-typed-array-names": "^1.0.0" + } + }, + "balanced-match": { + "version": "1.0.0", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "requires": { + "fill-range": "^7.1.1" + } + }, + "browserslist": { + "version": "4.23.0", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" + } + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "dev": true + }, + "builtin-modules": { + "version": "3.3.0", + "dev": true + }, + "call-bind": { + "version": "1.0.7", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + } + }, + "callsites": { + "version": "3.1.0", + "dev": true + }, + "camelcase": { + "version": "8.0.0", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001589", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "ci-info": { + "version": "4.0.0", + "dev": true + }, + "clean-regexp": { + "version": "1.0.0", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "color-convert": { + "version": "1.9.3", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "dev": true + }, + "comment-parser": { + "version": "1.4.1", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "dev": true + }, + "content-type": { + "version": "1.0.4", + "dev": true + }, + "core-js-compat": { + "version": "3.36.0", + "dev": true, + "requires": { + "browserslist": "^4.22.3" + } + }, + "cross-spawn": { + "version": "7.0.3", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "dashify": { + "version": "2.0.0", + "dev": true + }, + "debug": { + "version": "4.3.4", + "dev": true, + "requires": { + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "dev": true + } + } + }, + "deep-is": { + "version": "0.1.4", + "dev": true + }, + "define-data-property": { + "version": "1.1.4", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "define-properties": { + "version": "1.2.1", + "dev": true, + "requires": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "dir-glob": { + "version": "3.0.1", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "doctrine": { + "version": "3.0.0", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "electron-to-chromium": { + "version": "1.4.680", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.22.4", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.6", + "call-bind": "^1.0.7", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.2", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.1", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.0", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.1", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.14" + } + }, + "es-array-method-boxes-properly": { + "version": "1.0.0", + "dev": true + }, + "es-define-property": { + "version": "1.0.0", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "dev": true + }, + "es-set-tostringtag": { + "version": "2.0.3", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + } + }, + "es-shim-unscopables": { + "version": "1.0.2", + "dev": true, + "requires": { + "hasown": "^2.0.0" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escalade": { + "version": "3.1.2", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "dev": true + }, + "eslint": { + "version": "8.56.0", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.56.0", + "@humanwhocodes/config-array": "^0.11.13", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "eslint-config-prettier": { + "version": "9.1.0", + "dev": true, + "requires": {} + }, + "eslint-config-salesforce": { + "version": "2.0.2", + "dev": true + }, + "eslint-config-salesforce-license": { + "version": "0.2.0", + "dev": true + }, + "eslint-config-salesforce-typescript": { + "version": "3.2.3", + "dev": true, + "requires": { + "@typescript-eslint/eslint-plugin": "^6.18.1", + "@typescript-eslint/parser": "^6.18.1", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-config-salesforce": "^2.0.2", + "eslint-config-salesforce-license": "^0.2.0", + "eslint-plugin-header": "^3.1.1", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jsdoc": "^46.10.1", + "eslint-plugin-unicorn": "^50.0.1" + } + }, + "eslint-import-resolver-node": { + "version": "0.3.9", + "dev": true, + "requires": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "eslint-module-utils": { + "version": "2.8.0", + "dev": true, + "requires": { + "debug": "^3.2.7" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "eslint-plugin-header": { + "version": "3.1.1", + "dev": true, + "requires": {} + }, + "eslint-plugin-import": { + "version": "2.29.1", + "dev": true, + "requires": { + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "doctrine": { + "version": "2.1.0", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "semver": { + "version": "6.3.1", + "dev": true + } + } + }, + "eslint-plugin-jsdoc": { + "version": "46.10.1", + "dev": true, + "requires": { + "@es-joy/jsdoccomment": "~0.41.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.3.4", + "escape-string-regexp": "^4.0.0", + "esquery": "^1.5.0", + "is-builtin-module": "^3.2.1", + "semver": "^7.5.4", + "spdx-expression-parse": "^4.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "4.0.0", + "dev": true + }, + "spdx-expression-parse": { + "version": "4.0.0", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + } + } + }, + "eslint-plugin-unicorn": { + "version": "50.0.1", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.22.20", + "@eslint-community/eslint-utils": "^4.4.0", + "@eslint/eslintrc": "^2.1.4", + "ci-info": "^4.0.0", + "clean-regexp": "^1.0.0", + "core-js-compat": "^3.34.0", + "esquery": "^1.5.0", + "indent-string": "^4.0.0", + "is-builtin-module": "^3.2.1", + "jsesc": "^3.0.2", + "pluralize": "^8.0.0", + "read-pkg-up": "^7.0.1", + "regexp-tree": "^0.1.27", + "regjsparser": "^0.10.0", + "semver": "^7.5.4", + "strip-indent": "^3.0.0" + } + }, + "eslint-plugin-unused-imports": { + "version": "3.1.0", + "dev": true, + "requires": { + "eslint-rule-composer": "^0.3.0" + } + }, + "eslint-rule-composer": { + "version": "0.3.0", + "dev": true + }, + "eslint-scope": { + "version": "7.2.2", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "eslint-visitor-keys": { + "version": "3.4.3", + "dev": true + }, + "espree": { + "version": "9.6.1", + "dev": true, + "requires": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + } + }, + "esquery": { + "version": "1.5.0", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + } + }, + "esrecurse": { + "version": "4.3.0", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "dev": true + }, + "fast-glob": { + "version": "3.3.2", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "dev": true + }, + "fastq": { + "version": "1.17.1", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "file-entry-cache": { + "version": "6.0.1", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "5.0.0", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "flat-cache": { + "version": "3.2.0", + "dev": true, + "requires": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.3.1", + "dev": true + }, + "for-each": { + "version": "0.3.3", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "dev": true + }, + "function-bind": { + "version": "1.1.2", + "dev": true + }, + "function.prototype.name": { + "version": "1.1.6", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + } + }, + "functions-have-names": { + "version": "1.2.3", + "dev": true + }, + "get-intrinsic": { + "version": "1.2.4", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + }, + "get-symbol-description": { + "version": "1.0.2", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + } + }, + "glob": { + "version": "7.2.3", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "6.0.2", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } + }, + "globals": { + "version": "13.24.0", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "globalthis": { + "version": "1.0.3", + "dev": true, + "requires": { + "define-properties": "^1.1.3" + } + }, + "globby": { + "version": "11.1.0", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + } + }, + "gopd": { + "version": "1.0.1", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, + "graphemer": { + "version": "1.4.0", + "dev": true + }, + "has-bigints": { + "version": "1.0.2", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "dev": true + }, + "has-property-descriptors": { + "version": "1.0.2", + "dev": true, + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.0.3", + "dev": true + }, + "has-symbols": { + "version": "1.0.3", + "dev": true + }, + "has-tostringtag": { + "version": "1.0.2", + "dev": true, + "requires": { + "has-symbols": "^1.0.3" + } + }, + "hasown": { + "version": "2.0.1", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, + "hosted-git-info": { + "version": "2.8.9", + "dev": true + }, + "http-call": { + "version": "5.3.0", + "dev": true, + "requires": { + "content-type": "^1.0.4", + "debug": "^4.1.1", + "is-retry-allowed": "^1.1.0", + "is-stream": "^2.0.0", + "parse-json": "^4.0.0", + "tunnel-agent": "^0.6.0" + } + }, + "ignore": { + "version": "5.3.1", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "dev": true + }, + "internal-slot": { + "version": "1.0.7", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + } + }, + "is-array-buffer": { + "version": "3.0.4", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + } + }, + "is-arrayish": { + "version": "0.2.1", + "dev": true + }, + "is-bigint": { + "version": "1.0.4", + "dev": true, + "requires": { + "has-bigints": "^1.0.1" + } + }, + "is-boolean-object": { + "version": "1.1.2", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-builtin-module": { + "version": "3.2.1", + "dev": true, + "requires": { + "builtin-modules": "^3.3.0" + } + }, + "is-callable": { + "version": "1.2.7", + "dev": true + }, + "is-core-module": { + "version": "2.13.1", + "dev": true, + "requires": { + "hasown": "^2.0.0" + } + }, + "is-date-object": { + "version": "1.0.5", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-negative-zero": { + "version": "2.0.3", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-number-object": { + "version": "1.0.7", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-path-inside": { + "version": "3.0.3", + "dev": true + }, + "is-regex": { + "version": "1.1.4", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-retry-allowed": { + "version": "1.1.0", + "dev": true + }, + "is-shared-array-buffer": { + "version": "1.0.3", + "dev": true, + "requires": { + "call-bind": "^1.0.7" + } + }, + "is-stream": { + "version": "2.0.1", + "dev": true + }, + "is-string": { + "version": "1.0.7", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-symbol": { + "version": "1.0.4", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, + "is-typed-array": { + "version": "1.1.13", + "dev": true, + "requires": { + "which-typed-array": "^1.1.14" + } + }, + "is-weakref": { + "version": "1.0.2", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, + "isarray": { + "version": "2.0.5", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "jsdoc-type-pratt-parser": { + "version": "4.0.0", + "dev": true + }, + "jsesc": { + "version": "3.0.2", + "dev": true + }, + "json-buffer": { + "version": "3.0.1", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "dev": true + }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "dev": true + }, + "json5": { + "version": "1.0.2", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "jsonwebtoken": { + "version": "9.0.0", + "dev": true, + "requires": { + "jws": "^3.2.2", + "lodash": "^4.17.21", + "ms": "^2.1.1", + "semver": "^7.3.8" + } + }, + "jwa": { + "version": "1.4.1", + "dev": true, + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "dev": true, + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "keyv": { + "version": "4.5.4", + "dev": true, + "requires": { + "json-buffer": "3.0.1" + } + }, + "levn": { + "version": "0.4.1", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "lines-and-columns": { + "version": "1.2.4", + "dev": true + }, + "locate-path": { + "version": "6.0.0", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "merge2": { + "version": "1.4.1", + "dev": true + }, + "micromatch": { + "version": "4.0.5", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "min-indent": { + "version": "1.0.1", + "dev": true + }, + "minimatch": { + "version": "3.1.2", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.8", + "dev": true + }, + "ms": { + "version": "2.1.1", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "dev": true + }, + "no-case": { + "version": "4.0.0", + "dev": true + }, + "node-releases": { + "version": "2.0.14", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.2", + "dev": true + } + } + }, + "object-inspect": { + "version": "1.13.1", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "dev": true + }, + "object.assign": { + "version": "4.1.5", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + } + }, + "object.fromentries": { + "version": "2.0.7", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "object.groupby": { + "version": "1.0.2", + "dev": true, + "requires": { + "array.prototype.filter": "^1.0.3", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.0.0" + } + }, + "object.values": { + "version": "1.1.7", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "once": { + "version": "1.4.0", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optionator": { + "version": "0.9.3", + "dev": true, + "requires": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + } + }, + "p-limit": { + "version": "3.1.0", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "p-try": { + "version": "2.2.0", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "pascal-case": { + "version": "4.0.0", + "dev": true, + "requires": { + "no-case": "^4.0.0" + } + }, + "path-exists": { + "version": "4.0.0", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "dev": true + }, + "picocolors": { + "version": "1.0.0", + "dev": true + }, + "picomatch": { + "version": "2.3.1", + "dev": true + }, + "pluralize": { + "version": "8.0.0", + "dev": true + }, + "possible-typed-array-names": { + "version": "1.0.0", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "dev": true + }, + "prettier": { + "version": "3.2.4", + "dev": true + }, + "punycode": { + "version": "2.3.1", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "dev": true + }, + "read-pkg": { + "version": "5.2.0", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "parse-json": { + "version": "5.2.0", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "type-fest": { + "version": "0.6.0", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "type-fest": { + "version": "0.8.1", + "dev": true + } + } + }, + "regexp-tree": { + "version": "0.1.27", + "dev": true + }, + "regexp.prototype.flags": { + "version": "1.5.2", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + } + }, + "regjsparser": { + "version": "0.10.0", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "dev": true + } + } + }, + "resolve": { + "version": "1.22.8", + "dev": true, + "requires": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-from": { + "version": "4.0.0", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "run-parallel": { + "version": "1.2.0", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "safe-array-concat": { + "version": "1.1.0", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "get-intrinsic": "^1.2.2", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + } + }, + "safe-buffer": { + "version": "5.1.2", + "dev": true + }, + "safe-regex-test": { + "version": "1.0.3", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + } + }, + "semver": { + "version": "7.6.0", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "set-function-length": { + "version": "1.2.1", + "dev": true, + "requires": { + "define-data-property": "^1.1.2", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + } + }, + "set-function-name": { + "version": "2.0.2", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + } + }, + "shebang-command": { + "version": "2.0.0", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "dev": true + }, + "side-channel": { + "version": "1.0.5", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + } + }, + "slash": { + "version": "3.0.0", + "dev": true + }, + "spdx-correct": { + "version": "3.2.0", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.5.0", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.17", + "dev": true + }, + "string.prototype.trim": { + "version": "1.2.8", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "string.prototype.trimend": { + "version": "1.0.7", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "string.prototype.trimstart": { + "version": "1.0.7", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom": { + "version": "3.0.0", + "dev": true + }, + "strip-indent": { + "version": "3.0.0", + "dev": true, + "requires": { + "min-indent": "^1.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "dev": true + }, + "text-table": { + "version": "0.2.0", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "ts-api-utils": { + "version": "1.2.1", + "dev": true, + "requires": {} + }, + "tsconfig-paths": { + "version": "3.15.0", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "tslib": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "peer": true + }, + "tunnel-agent": { + "version": "0.6.0", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "type-check": { + "version": "0.4.0", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.20.2", + "dev": true + }, + "typed-array-buffer": { + "version": "1.0.2", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-byte-length": { + "version": "1.0.1", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-byte-offset": { + "version": "1.0.2", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-length": { + "version": "1.0.5", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + } + }, + "typescript": { + "version": "5.3.3", + "dev": true + }, + "unbox-primitive": { + "version": "1.0.2", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + } + }, + "update-browserslist-db": { + "version": "1.0.13", + "dev": true, + "requires": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + } + }, + "uri-js": { + "version": "4.4.1", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which": { + "version": "2.0.2", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.0.2", + "dev": true, + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + } + }, + "which-typed-array": { + "version": "1.1.14", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.6", + "call-bind": "^1.0.5", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "dev": true + } + } +} diff --git a/package.json b/package.json index f2b495f..4d85948 100644 --- a/package.json +++ b/package.json @@ -4,15 +4,33 @@ "author": "Heroku", "bugs": "https://github.com/heroku/typescript-api-schema/issues", "devDependencies": { - "eslint": "^8.57.0", - "eslint-config-oclif-typescript": "3.1.7", + "@typescript-eslint/parser": "^6.15.0", + "camelcase": "^8.0.0", + "eslint": "^8.56.0", + "eslint-config-salesforce-typescript": "3.2.3", + "eslint-plugin-unused-imports": "^3.1.0", + "pascal-case": "^4.0.0", + "dashify": "^2.0.0", + "prettier": "3.2.4", "http-call": "^5.2.2", - "json-schema-to-typescript": "^14.1.0", - "jsonwebtoken": "^8.3.0", - "typescript": "^4.9.5" + "jsonwebtoken": "9.0.0", + "typescript": "^5.3.3" + }, + "peerDependencies": { + "tslib": "2.x" + }, + "exports": { + ".": { + "import": "./lib/esm/index.js", + "require": "./lib/cjs/index.js" + }, + "./services/*.js": { + "import": "./lib/esm/services/*.js", + "require": "./lib/cjs/services/*.js" + } }, "engines": { - "node": ">=18.0.0" + "node": ">=16.20.1" }, "files": [ "/lib" @@ -25,6 +43,8 @@ "repository": "heroku/typescript-api-schema", "types": "lib/index.d.ts", "scripts": { - "updateTypes": "./scripts/update_platform_api_types" + "build:cjs": "tsc --module commonjs --outDir lib/cjs --target esnext", + "build:esm": "tsc --module esnext --outDir lib/esm --target esnext", + "build": "node schema-builder.mjs && eslint . --config .eslintrc --fix && prettier -w --config ./.prettier.mjs ./src/**/*.ts && (npm run build:cjs & npm run build:esm)" } } diff --git a/schema-builder.mjs b/schema-builder.mjs new file mode 100644 index 0000000..4b4b19d --- /dev/null +++ b/schema-builder.mjs @@ -0,0 +1,465 @@ +import schema from './schema.json' assert {type: 'json'}; + +import {pascalCase} from 'pascal-case'; +import fs from 'node:fs/promises'; +import path from 'node:path'; +import camelcase from 'camelcase'; +import dashify from 'dashify'; + +const {definitions} = schema; + +/** + * Gets the value from the schema base on the $ref path. + * + * @param ref The path to the schema value + * @returns {Record} + */ +function getValueFromSchema(ref) { + const schemaPath = ref.replace('#/', '').split('/'); + return schemaPath.reduce((acc, fragment) => acc[fragment], schema); +} + +/** + * Determines if the 2 objects are equal based + * on the key/value pairs recursively. Node that + * arrays which are not sorted may return false + * if indices are not aligned. + * + * @param a The reference object. + * @param b The object to check for equivalency. + * @returns {boolean} True if the 2 objects are functionally equivalent. + */ +function isDeepEqual(a, b) { + if (typeof a === 'object' && typeof b === 'object') { + return Object.keys(a).every(key => b[key] && isDeepEqual(a[key], b[key])) + && Object.keys(b).every(key => a[key] && isDeepEqual(b[key], a[key])); + } + return a === b; +} + +/** + * Resolves the types from the schema items to + * TypeScript types. If a type is 'object' and + * has properties, a new interface is created and + * the interface name is returned. + * + * When more than 1 type is defined, this method + * returns an array of union TypeScript type definitions. + * + * @param items + * @returns {(*|undefined)[]} + */ +function resolveTypes(items) { + if (!Array.isArray(items)) { + items = [items]; + } + return [...new Set(items.map(item => { + const {$ref} = item; + const schemaValue = $ref ? getValueFromSchema($ref) : item; + if (schemaValue) { + const {type: types} = schemaValue; + const proposedInterfaceName = buildNameFromRef($ref); + return types.map(resolvedType => getTypeDefinition(resolvedType, proposedInterfaceName, item)).join(' | '); + } + }))]; +} + +/** + * Gets the TypeScript type definition for the + * specified resolved type. If this is a non-primitive + * type, a new interface is created and the interface name + * is used. If more than 1 type is allowed, a union is + * returned. + * + * @param {'string' | 'array' | 'object' | 'integer' | 'number' | string} typeName The name of the type. + * @param {undefined | string} proposedInterfaceName The proposed interface name for this type. Required only if `typeName === object` + * @param {Record} schemaInfo The schema value belonging to this type definition. + * @returns {string} + */ +function getTypeDefinition(typeName, proposedInterfaceName, schemaInfo) { + const {$ref} = schemaInfo; + const schemaValue = $ref ? getValueFromSchema($ref) : schemaInfo; + + switch (typeName) { + case 'object': + return createInterfaceFromSchemaInfo(proposedInterfaceName, schemaInfo); + + case 'array': + try { + const resolvedTypes = resolveTypes(schemaValue.items); + return resolvedTypes.length > 1 ? `(${resolvedTypes})[]` : `${resolvedTypes}[]`; + } catch (e) { + return 'unknown[]'; + } + + case 'string': + case 'number': + case 'integer': + const {enum: enumValues} = schemaValue; + if (enumValues) { + const filteredValues = enumValues.filter(val => val !== '~'); + return filteredValues.length ? `'${filteredValues.join(`' | '`)}'` : typeName; + } + return typeName.replace('integer', 'number'); + + default: + return typeName; + } +} + +/** + * Creates a TypeScript interface member string + * based on the specified schema info. + * + * @param {string} propName The name of the interface member. + * @param {Record} schemaInfo The schema info belonging to this member + * @param {boolean} required Boolean indicating whether this property is required. + * @returns {string} + */ +function createInterfaceMemberFromProp(propName, schemaInfo, required) { + if (/\W/g.test(propName)) { + propName = `'${propName}'`; + } + + const {description, typeScriptType, readOnly} = createInterfaceMemberDescriptor(propName, schemaInfo); + const docBlock = description ? `/**\n * ${description}\n */\n ` : ''; + return `${docBlock}${readOnly ? 'readonly ' : ''}${propName}${required ? '' : '?'}: ${typeScriptType};`; +} + +/** + * Creates a descriptor for an interface member + * based on the specified schema fragment. + * + * @param propName {string} The name of the interface member. + * @param schemaInfo {Record} The schema to base this interface member on. + * @returns {{description: string, typeScriptType: string, readOnly: boolean, propName: string}} + */ +function createInterfaceMemberDescriptor(propName, schemaInfo) { + const {$ref} = schemaInfo; + const schemaValue = $ref ? getValueFromSchema($ref) : schemaInfo; + const {type, readOnly, anyOf} = schemaValue; + let {description = '', example = ''} = schemaValue; + + let resolvedTypes = anyOf ? resolveTypes(anyOf) : type; + if (anyOf) { + description += anyOf + .filter(anyOfRef => anyOfRef.$ref) + .map(anyOfRef => getValueFromSchema(anyOfRef.$ref).description) + .join(' or '); + } + description += example ? '\n * @example ' + JSON.stringify(example) : ''; + const unionOrIntersection = resolvedTypes.some(type => /(null|string|number|boolean)/.test(type)) ? '|' : '&'; + const typeDefinitions = resolvedTypes.map((resolvedType) => getTypeDefinition(resolvedType, propName, schemaInfo)); + return { + description, + typeScriptType: typeDefinitions.join(` ${unionOrIntersection} `), + propName, + readOnly, + }; +} + +// Storage for interfaces to write out. +/** + * + * @type {Map}>} + */ +const interfaceMap = new Map(); + +/** + * + * @type {string[]} + */ +const paths = []; + +/** + * + * @param ref {string | undefined} + * @param useShallowCheck {boolean} + * @returns {string | undefined} + */ +function buildNameFromRef(ref = '', useShallowCheck = true) { + const pathParts = ref + ?.split('/') + .filter(part => part !== 'definitions' && part !== '#'); + + if (useShallowCheck) { + const shallowName = [...pathParts].pop(); + + if (!definitions[shallowName] && !interfaceMap.has(shallowName)) { + return shallowName; + } + } + return pathParts?.join('-'); +} + +/** + * Creates a TypeScript interface from the specified schema info. + * If the interface name cannot be determined or if it conflicts + * with an existing interface, it will be anonymous and inlined. + * + * @param {undefined | string} propName The property name for this type. Required only if `typeName === object` + * @param {Record} schemaInfo The schema info belonging to this type definition. + * @return string + */ +function createInterfaceFromSchemaInfo(propName, schemaInfo) { + let {properties, strictProperties, description = '', required, $ref} = schemaInfo; + let interfaceName = pascalCase(propName ?? ''); + + // $ref will always reference a single definition + // and are safe to use as-is + if ($ref) { + interfaceName = pascalCase(buildNameFromRef($ref)); + schemaInfo = getValueFromSchema($ref); + ({properties, strictProperties, required, description} = schemaInfo); + } + const alternateInterfaceName = interfaceName + ? `${[...paths.filter(path => !!path)].pop() ?? ''}${interfaceName}` + : ''; + // We may have created an interface by this + // name already. Determine if it's a conflict + // or a duplicate. + if (interfaceMap.has(interfaceName)) { + const {schemaInfo: existingSchema} = (interfaceMap.get(interfaceName) ?? {}); + const isEq = isDeepEqual(schemaInfo?.properties || true, existingSchema?.properties || false); + // Duplicate, just use the interface + if (isEq || schemaInfo === existingSchema) { + return interfaceName; + } + // Conflict, use the alternate interface name + interfaceName = alternateInterfaceName; + } + + // Check the alternate interface name against + // an existing schema next. + if (interfaceMap.has(alternateInterfaceName)) { + const {schemaInfo: alternateExistingSchema} = interfaceMap.get(alternateInterfaceName); + const isEq = isDeepEqual(schemaInfo.properties, alternateExistingSchema.properties); + if (isEq || schemaInfo === alternateExistingSchema) { + return alternateInterfaceName; + } + } + // Anonymous object with unknown values + if (!properties) { + return 'Record'; + } + + // By the time we get here, a new + // interface is being created and + // will be written as output. + paths.push(interfaceName); + if (interfaceName) { + interfaceMap.set(interfaceName, {interfaceDefinition: '', schemaInfo}); + } + // interfaceMap.set(interfaceName, {interfaceDefinition: 'reserved', schemaInfo}); + // Interface members are primitives, other interfaces, + // intersection types or enums. + const interfaceMembers = properties + ? Object.keys(properties).map((propName => createInterfaceMemberFromProp(propName, properties[propName], strictProperties || required?.includes(propName)))) + : ['[k: string]: unknown']; + + // Build the entire interface + // definition including doc blocks. + const title = definitions[propName] ? `\n * [Heroku Platform API - ${propName}](https://devcenter.heroku.com/articles/platform-api-reference#${propName})` : ''; + let interfaceDefinition = (description && interfaceName) ? `/**\n * ${title}\n * ${description}\n */\n` : ''; + interfaceDefinition += interfaceName ? `export interface ${interfaceName} ` : ''; + interfaceDefinition += `{\n ${interfaceMembers.join('\n ')}\n}`; + // Anonymous interfaces will be inlined and therefore not stored + if (interfaceName) { + const sc = interfaceMap.get(interfaceName)?.schemaInfo; + if (interfaceMap.has(interfaceName) && sc !== schemaInfo) { + console.group(interfaceName); + console.log('duplicate definition', sc, schemaInfo, alternateInterfaceName, interfaceMap.has(alternateInterfaceName)); + console.groupEnd(); + } + interfaceMap.set(interfaceName, {interfaceDefinition, schemaInfo}); + } + paths.pop(); + // Return either the interface name or the inlined definition + return interfaceName || interfaceDefinition; +} + +/** + * Gets the targetSchema type from a link fragment. + * Any interfaces are created as needed. + * + * @param targetSchema + * @returns {string} + */ +function getTargetSchemaType(targetSchema) { + if (!targetSchema) { + return 'void'; + } + const {type: types} = targetSchema; + if (types) { + return types + .map(type => getTypeDefinition(type, undefined, targetSchema)) + .join(' | '); + } + return createInterfaceFromSchemaInfo(undefined, targetSchema); +} + +/** + * Creates descriptors for the url params based + * on the specified tokenized url. + * + * @param tokenizedUrl The URL containing the $ref tokens to create descriptors for + * @returns {{parameterizedUrl, paramDescriptors: {description: string, typeScriptType: string, readOnly: boolean, propName: string}[]}} + */ +function createParamDescriptors(tokenizedUrl) { + const tokenRegex = /{\((#[\w+/\-_]+)\)}/g; + const hrefTokens = [...tokenizedUrl.matchAll(tokenRegex)]; + let parameterizedUrl = tokenizedUrl; + const paramDescriptors = hrefTokens.map(hrefToken => { + const [token, ref] = hrefToken; + const proposedInterfaceName = camelcase(buildNameFromRef(ref, false)); + parameterizedUrl = parameterizedUrl.replace(token, '${' + proposedInterfaceName + '}'); + return createInterfaceMemberDescriptor(proposedInterfaceName, getValueFromSchema(ref)); + }); + return {parameterizedUrl, paramDescriptors}; +} + +/** + * Builds the service class members from the + * array of link definitions. Any interfaces + * specified with $ref are built and added + * as type definitions to function arguments + * or return types. + * + * @example + * + * ```ts + * public async info(accountFeatureIdentity: string, requestInit: RequestInit & {headers?: Headers} = {}): Promise { + * requestInit.method = 'GET'; + * if (!requestInit.headers) { + * requestInit.headers = new Headers(); + * } + * requestInit.headers.append('Accept', 'application/vnd.heroku+json; version=3'); + * return await this.fetch(`/account/features/${accountFeatureIdentity}`, requestInit); + * } + * ``` + * + * @param entityName The name of the target entity for this API + * @param {Array<{ + * description: string, + * title: string, + * href:string, method: 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT' | 'UPDATE' + * schema: Record, + * targetSchema: Record + * }>} links + * @return string[] + */ +function buildClassMembersFromLinks(entityName, links) { + const members = []; + for (const link of links) { + const {description, method, href, schema, title, targetSchema} = link; + let payloadType = schema + ? createInterfaceFromSchemaInfo(`${entityName}-${title}-payload`, schema) + : ''; + if (payloadType && !payloadType.startsWith('Record')) { + payloadType = `Heroku.${payloadType}`; + } + + let targetSchemaType = getTargetSchemaType(targetSchema); + if (targetSchemaType !== 'void' && !targetSchemaType.startsWith('Record')) { + targetSchemaType = `Heroku.${targetSchemaType}`; + } + const {paramDescriptors, parameterizedUrl} = createParamDescriptors(decodeURIComponent(href)); + + // Doc blocks are composed of the schema + // description for the method declaration + // and the interface descriptor for each param. + let docBlock = description ? `/**\n * ${description}\n *` : ''; + docBlock += paramDescriptors.map(descriptor => `\n * @param ${descriptor.propName} ${descriptor.description}.`).join(''); + docBlock += payloadType ? `\n * @param payload Object to send to the endpoint.` : ''; + docBlock += `\n * @param requestInit The initializer for the request.` + docBlock += ` \n */`; + + // Params consist of the data needed to + // build the endpoint url and the body + // in cases where POST, PUT, PATCH and UPDATE + // methods are used. + const params = paramDescriptors + .map(descriptor => `${descriptor.propName}:${descriptor.typeScriptType}`); + if (payloadType) { + params.push(`payload: ${payloadType}`); + } + params.push(`requestInit: Omit = {}`); + + // Options consist of the body if a payload + // is sent to the endpoint and the headers. + let requestInit = `{ + ...requestInit, + ${payloadType ? `body: JSON.stringify(payload, null, 2),` : ''} + method: '${method}', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + ${method !== 'GET' ? `,'Content-Type': 'application/json'` : ''} + } }`; + + const returnVal = targetSchemaType !== 'void' ? ` + const response = await this.fetchImpl(\`${`\${this.endpoint}` + parameterizedUrl}\`, ${requestInit}); + if (response.ok) { + return await response.json() as Promise<${targetSchemaType}>; + } + throw new Error(response.statusText);` : `await this.fetchImpl(\`${parameterizedUrl}\`, ${requestInit});`; + + // Finally the class member is constructed + let member = `${docBlock} + public async ${camelcase(title)}(${params}): Promise<${targetSchemaType}> { + ${returnVal} + }`; + members.push(member); + } + return members; +} + +const serviceClasses = new Map(); + +/** + * Creates a TypeScript service class from the specified schema info. + * This class can be used to interact with the Heroku API. + * + * @param {undefined | string} propName The property name for this type. Required only if `typeName === object` + * @param {Record} schemaInfo The schema info belonging to this type definition. + */ +function createServiceClass(propName, schemaInfo) { + let {links, description, title} = schemaInfo; + const className = pascalCase(propName + '-service'); + const classMembers = buildClassMembersFromLinks(propName, links); + const clazz = `import * as Heroku from '@heroku-cli/schema'; + /** + * [${title}](https://devcenter.heroku.com/articles/platform-api-reference#${propName})\n * ${description ?? ''} + */ + export default class ${className} { + public constructor(protected readonly fetchImpl: typeof fetch, protected readonly endpoint: string) {} + + ${classMembers.join('\n')} + } + `; + serviceClasses.set(className, clazz); +} + +// Initialization and job +for (const definitionKey in definitions) { + const definition = definitions[definitionKey]; + createInterfaceFromSchemaInfo(definitionKey, definition); + if (definition.links) { + createServiceClass(definitionKey, definition); + } +} + +await fs.mkdir('src/services', {recursive: true}); + +let schemaStr = ''; +for (const [, {interfaceDefinition}] of interfaceMap) { + schemaStr += interfaceDefinition + '\n'; +} +await fs.writeFile(path.join('src', 'index.ts'), schemaStr); +let serviceIndex = ''; +for (const [fileName, serviceClass] of serviceClasses) { + const dashedFileName = dashify(fileName); + serviceIndex += `export * from './${dashedFileName}';`; + await fs.writeFile(path.join('src/services', `${dashedFileName}.ts`), serviceClass); +} +await fs.writeFile(path.join('src/services', `index.ts`), serviceIndex); diff --git a/schema.json b/schema.json new file mode 100644 index 0000000..42f0b2a --- /dev/null +++ b/schema.json @@ -0,0 +1,17591 @@ +{ + "$schema": "http://interagent.github.io/interagent-hyper-schema", + "type": [ + "object" + ], + "definitions": { + "account-delinquency": { + "description": "A Heroku account becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent accounts if their invoices remain unpaid.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Account Delinquency", + "type": [ + "object" + ], + "definitions": { + "scheduled_suspension_time": { + "description": "scheduled time of when we will suspend your account due to delinquency", + "example": "2024-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "scheduled_deletion_time": { + "description": "scheduled time of when we will delete your account due to delinquency", + "example": "2024-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] + } + }, + "links": [ + { + "description": "Account delinquency information.", + "href": "/account/delinquency", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/account-delinquency" + }, + "title": "Info" + } + ], + "properties": { + "scheduled_suspension_time": { + "$ref": "#/definitions/account-delinquency/definitions/scheduled_suspension_time" + }, + "scheduled_deletion_time": { + "$ref": "#/definitions/account-delinquency/definitions/scheduled_deletion_time" + } + } + }, + "account-feature": { + "description": "An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Account Feature", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when account feature was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "description": { + "description": "description of account feature", + "example": "Causes account to example.", + "readOnly": true, + "type": [ + "string" + ] + }, + "doc_url": { + "description": "documentation URL of account feature", + "example": "http://devcenter.heroku.com/articles/example", + "readOnly": true, + "type": [ + "string" + ] + }, + "enabled": { + "description": "whether or not account feature has been enabled", + "example": true, + "readOnly": false, + "type": [ + "boolean" + ] + }, + "id": { + "description": "unique identifier of account feature", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/account-feature/definitions/id" + }, + { + "$ref": "#/definitions/account-feature/definitions/name" + } + ] + }, + "name": { + "description": "unique name of account feature", + "example": "name", + "readOnly": true, + "type": [ + "string" + ] + }, + "state": { + "description": "state of account feature", + "example": "public", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when account feature was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "display_name": { + "description": "user readable feature name", + "example": "My Feature", + "readOnly": true, + "type": [ + "string" + ] + }, + "feedback_email": { + "description": "e-mail to send feedback about the feature", + "example": "feedback@heroku.com", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Info for an existing account feature.", + "href": "/account/features/{(%23%2Fdefinitions%2Faccount-feature%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/account-feature" + }, + "title": "Info" + }, + { + "description": "List existing account features.", + "href": "/account/features", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/account-feature" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Update an existing account feature.", + "href": "/account/features/{(%23%2Fdefinitions%2Faccount-feature%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "enabled": { + "$ref": "#/definitions/account-feature/definitions/enabled" + } + }, + "required": [ + "enabled" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/account-feature" + }, + "title": "Update" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/account-feature/definitions/created_at" + }, + "description": { + "$ref": "#/definitions/account-feature/definitions/description" + }, + "doc_url": { + "$ref": "#/definitions/account-feature/definitions/doc_url" + }, + "enabled": { + "$ref": "#/definitions/account-feature/definitions/enabled" + }, + "id": { + "$ref": "#/definitions/account-feature/definitions/id" + }, + "name": { + "$ref": "#/definitions/account-feature/definitions/name" + }, + "state": { + "$ref": "#/definitions/account-feature/definitions/state" + }, + "updated_at": { + "$ref": "#/definitions/account-feature/definitions/updated_at" + }, + "display_name": { + "$ref": "#/definitions/account-feature/definitions/display_name" + }, + "feedback_email": { + "$ref": "#/definitions/account-feature/definitions/feedback_email" + } + } + }, + "account": { + "description": "An account represents an individual signed up to use the Heroku platform.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Account", + "type": [ + "object" + ], + "definitions": { + "allow_tracking": { + "default": true, + "description": "whether to allow third party web activity tracking", + "example": true, + "readOnly": false, + "type": [ + "boolean" + ] + }, + "beta": { + "default": false, + "description": "whether allowed to utilize beta Heroku features", + "example": false, + "readOnly": false, + "type": [ + "boolean" + ] + }, + "created_at": { + "description": "when account was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "country_of_residence": { + "description": "country where account owner resides", + "example": "United States", + "readOnly": false, + "type": [ + "string", + "null" + ] + }, + "email": { + "description": "unique email address of account", + "example": "username@example.com", + "format": "email", + "readOnly": false, + "type": [ + "string" + ] + }, + "federated": { + "description": "whether the user is federated and belongs to an Identity Provider", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "id": { + "description": "unique identifier of an account", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/account/definitions/email" + }, + { + "$ref": "#/definitions/account/definitions/id" + }, + { + "$ref": "#/definitions/account/definitions/self" + } + ] + }, + "last_login": { + "description": "when account last authorized with Heroku", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "name": { + "description": "full name of the account owner", + "example": "Tina Edmonds", + "readOnly": false, + "type": [ + "string", + "null" + ] + }, + "password": { + "description": "current password on the account", + "example": "currentpassword", + "readOnly": true, + "type": [ + "string" + ] + }, + "self": { + "description": "Implicit reference to currently authorized user", + "enum": [ + "~" + ], + "example": "~", + "readOnly": true, + "type": [ + "string" + ] + }, + "sms_number": { + "description": "SMS number of account", + "example": "+1 ***-***-1234", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "suspended_at": { + "description": "when account was suspended", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "delinquent_at": { + "description": "when account became delinquent", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "two_factor_authentication": { + "description": "whether two-factor auth is enabled on the account", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "updated_at": { + "description": "when account was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "verified": { + "default": false, + "description": "whether account has been verified with billing information", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + } + }, + "links": [ + { + "description": "Info for account.", + "href": "/account", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/account" + }, + "title": "Info" + }, + { + "description": "Update account.", + "href": "/account", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "allow_tracking": { + "$ref": "#/definitions/account/definitions/allow_tracking" + }, + "beta": { + "$ref": "#/definitions/account/definitions/beta" + }, + "name": { + "$ref": "#/definitions/account/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/account" + }, + "title": "Update" + }, + { + "description": "Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account.", + "href": "/account", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/account" + }, + "title": "Delete" + }, + { + "description": "Info for account.", + "href": "/users/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/account" + }, + "title": "Info By User" + }, + { + "description": "Update account.", + "href": "/users/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "allow_tracking": { + "$ref": "#/definitions/account/definitions/allow_tracking" + }, + "beta": { + "$ref": "#/definitions/account/definitions/beta" + }, + "name": { + "$ref": "#/definitions/account/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/account" + }, + "title": "Update By User" + }, + { + "description": "Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account.", + "href": "/users/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/account" + }, + "title": "Delete By User" + } + ], + "properties": { + "allow_tracking": { + "$ref": "#/definitions/account/definitions/allow_tracking" + }, + "beta": { + "$ref": "#/definitions/account/definitions/beta" + }, + "created_at": { + "$ref": "#/definitions/account/definitions/created_at" + }, + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "federated": { + "$ref": "#/definitions/account/definitions/federated" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + }, + "identity_provider": { + "description": "Identity Provider details for federated users.", + "strictProperties": true, + "properties": { + "id": { + "$ref": "#/definitions/identity-provider/definitions/id" + }, + "name": { + "$ref": "#/definitions/identity-provider/definitions/name" + }, + "team": { + "type": [ + "object" + ], + "properties": { + "name": { + "$ref": "#/definitions/team/definitions/name" + } + } + }, + "organization": { + "type": [ + "object" + ], + "properties": { + "name": { + "$ref": "#/definitions/team/definitions/name" + } + } + }, + "owner": { + "$ref": "#/definitions/identity-provider/definitions/owner" + } + }, + "type": [ + "object", + "null" + ] + }, + "last_login": { + "$ref": "#/definitions/account/definitions/last_login" + }, + "name": { + "$ref": "#/definitions/account/definitions/name" + }, + "sms_number": { + "$ref": "#/definitions/account/definitions/sms_number" + }, + "suspended_at": { + "$ref": "#/definitions/account/definitions/suspended_at" + }, + "delinquent_at": { + "$ref": "#/definitions/account/definitions/delinquent_at" + }, + "two_factor_authentication": { + "$ref": "#/definitions/account/definitions/two_factor_authentication" + }, + "updated_at": { + "$ref": "#/definitions/account/definitions/updated_at" + }, + "verified": { + "$ref": "#/definitions/account/definitions/verified" + }, + "country_of_residence": { + "$ref": "#/definitions/account/definitions/country_of_residence" + }, + "default_organization": { + "description": "team selected by default", + "properties": { + "id": { + "$ref": "#/definitions/team/definitions/id" + }, + "name": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object", + "null" + ] + }, + "default_team": { + "description": "team selected by default", + "properties": { + "id": { + "$ref": "#/definitions/team/definitions/id" + }, + "name": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object", + "null" + ] + } + } + }, + "add-on-action": { + "description": "Add-on Actions are lifecycle operations for add-on provisioning and deprovisioning. They allow add-on providers to (de)provision add-ons in the background and then report back when (de)provisioning is complete.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Add-on Action", + "type": [ + "object" + ], + "definitions": { + }, + "links": [ + { + "description": "Mark an add-on as provisioned for use.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/actions/provision", + "method": "POST", + "rel": "update", + "targetSchema": { + "$ref": "#/definitions/add-on" + }, + "title": "Provision" + }, + { + "description": "Mark an add-on as deprovisioned.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/actions/deprovision", + "method": "POST", + "rel": "update", + "targetSchema": { + "$ref": "#/definitions/add-on" + }, + "title": "Deprovision" + } + ], + "properties": { + } + }, + "add-on-attachment": { + "description": "An add-on attachment represents a connection between an app and an add-on that it has been given access to.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Add-on Attachment", + "type": [ + "object" + ], + "definitions": { + "confirm": { + "description": "name of owning app for confirmation", + "example": "example", + "type": [ + "string" + ] + }, + "created_at": { + "description": "when add-on attachment was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of this add-on attachment", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/add-on-attachment/definitions/id" + } + ] + }, + "scopedIdentity": { + "anyOf": [ + { + "$ref": "#/definitions/add-on-attachment/definitions/id" + }, + { + "$ref": "#/definitions/add-on-attachment/definitions/name" + } + ] + }, + "name": { + "description": "unique name for this add-on attachment to this app", + "example": "DATABASE", + "readOnly": true, + "type": [ + "string" + ] + }, + "namespace": { + "description": "attachment namespace", + "example": "role:analytics", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "updated_at": { + "description": "when add-on attachment was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "web_url": { + "description": "URL for logging into web interface of add-on in attached app context", + "example": "https://postgres.heroku.com/databases/01234567-89ab-cdef-0123-456789abcdef", + "format": "uri", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "log_input_url": { + "description": "URL for add-on partners to write to an add-on's logs", + "example": "https://token:t.abcdef12-3456-7890-abcd-ef1234567890@1.us.logplex.io/logs", + "type": [ + "null", + "string" + ], + "readOnly": true + } + }, + "links": [ + { + "description": "Create a new add-on attachment.", + "href": "/addon-attachments", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "addon": { + "$ref": "#/definitions/add-on/definitions/identity" + }, + "app": { + "$ref": "#/definitions/app/definitions/identity" + }, + "confirm": { + "$ref": "#/definitions/add-on-attachment/definitions/confirm" + }, + "name": { + "$ref": "#/definitions/add-on-attachment/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/add-on-attachment/definitions/namespace" + } + }, + "required": [ + "addon", + "app" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/add-on-attachment" + }, + "title": "Create" + }, + { + "description": "Delete an existing add-on attachment.", + "href": "/addon-attachments/{(%23%2Fdefinitions%2Fadd-on-attachment%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/add-on-attachment" + }, + "title": "Delete" + }, + { + "description": "Info for existing add-on attachment.", + "href": "/addon-attachments/{(%23%2Fdefinitions%2Fadd-on-attachment%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/add-on-attachment" + }, + "title": "Info" + }, + { + "description": "List existing add-on attachments.", + "href": "/addon-attachments", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on-attachment" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "List existing add-on attachments for an add-on.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/addon-attachments", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on-attachment" + }, + "type": [ + "array" + ] + }, + "title": "List by Add-on" + }, + { + "description": "List existing add-on attachments for an app.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/addon-attachments", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on-attachment" + }, + "type": [ + "array" + ] + }, + "title": "List by App" + }, + { + "description": "Info for existing add-on attachment for an app.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/addon-attachments/{(%23%2Fdefinitions%2Fadd-on-attachment%2Fdefinitions%2FscopedIdentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/add-on-attachment" + }, + "title": "Info by App" + }, + { + "description": "Resolve an add-on attachment from a name, optionally passing an app name. If there are matches it returns at least one add-on attachment (exact match) or many.", + "href": "/actions/addon-attachments/resolve", + "method": "POST", + "rel": "resolve", + "schema": { + "properties": { + "addon_attachment": { + "$ref": "#/definitions/add-on-attachment/definitions/name" + }, + "app": { + "$ref": "#/definitions/app/definitions/name" + }, + "addon_service": { + "$ref": "#/definitions/add-on-service/definitions/name" + } + }, + "required": [ + "addon_attachment" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on-attachment" + }, + "type": [ + "array" + ] + }, + "title": "Resolution" + } + ], + "properties": { + "addon": { + "description": "identity of add-on", + "properties": { + "id": { + "$ref": "#/definitions/add-on/definitions/id" + }, + "name": { + "$ref": "#/definitions/add-on/definitions/name" + }, + "app": { + "description": "billing application associated with this add-on", + "type": [ + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + } + }, + "strictProperties": true + } + }, + "additionalProperties": false, + "required": [ + "id", + "name", + "app" + ], + "type": [ + "object" + ] + }, + "app": { + "description": "application that is attached to add-on", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/add-on-attachment/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/add-on-attachment/definitions/id" + }, + "name": { + "$ref": "#/definitions/add-on-attachment/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/add-on-attachment/definitions/namespace" + }, + "updated_at": { + "$ref": "#/definitions/add-on-attachment/definitions/updated_at" + }, + "web_url": { + "$ref": "#/definitions/add-on-attachment/definitions/web_url" + }, + "log_input_url": { + "$ref": "#/definitions/add-on-attachment/definitions/log_input_url" + } + } + }, + "add-on-config": { + "description": "Configuration of an Add-on", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Add-on Config", + "type": [ + "object" + ], + "definitions": { + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/add-on-config/definitions/name" + } + ] + }, + "name": { + "description": "unique name of the config", + "example": "FOO", + "type": [ + "string" + ] + }, + "value": { + "description": "value of the config", + "example": "bar", + "type": [ + "string", + "null" + ] + } + }, + "links": [ + { + "description": "Get an add-on's config. Accessible by customers with access and by the add-on partner providing this add-on.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/config", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on-config" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Update an add-on's config. Can only be accessed by the add-on partner providing this add-on.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/config", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "config": { + "items": { + "$ref": "#/definitions/add-on-config" + }, + "type": [ + "array" + ] + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/add-on-config" + } + }, + "title": "Update" + } + ], + "properties": { + "name": { + "$ref": "#/definitions/add-on-config/definitions/name" + }, + "value": { + "$ref": "#/definitions/add-on-config/definitions/value" + } + } + }, + "add-on-plan-action": { + "description": "Add-on Plan Actions are Provider functionality for specific add-on installations", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Add-on Plan Action", + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "a unique identifier", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "$ref": "#/definitions/add-on-plan-action/definitions/id" + }, + "label": { + "description": "the display text shown in Dashboard", + "example": "Example", + "readOnly": true, + "type": [ + "string" + ] + }, + "action": { + "description": "identifier of the action to take that is sent via SSO", + "example": "example", + "readOnly": true, + "type": [ + "string" + ] + }, + "url": { + "description": "absolute URL to use instead of an action", + "example": "http://example.com?resource_id=:resource_id", + "readOnly": true, + "type": [ + "string" + ] + }, + "requires_owner": { + "description": "if the action requires the user to own the app", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + } + }, + "properties": { + "id": { + "$ref": "#/definitions/add-on-plan-action/definitions/id" + }, + "label": { + "$ref": "#/definitions/add-on-plan-action/definitions/label" + }, + "action": { + "$ref": "#/definitions/add-on-plan-action/definitions/action" + }, + "url": { + "$ref": "#/definitions/add-on-plan-action/definitions/url" + }, + "requires_owner": { + "$ref": "#/definitions/add-on-plan-action/definitions/requires_owner" + } + } + }, + "add-on-region-capability": { + "description": "Add-on region capabilities represent the relationship between an Add-on Service and a specific Region. Only Beta and GA add-ons are returned by these endpoints.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Add-on Region Capability", + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "unique identifier of this add-on-region-capability", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "supports_private_networking": { + "description": "whether the add-on can be installed to a Space", + "readOnly": true, + "type": [ + "boolean" + ] + }, + "identity": { + "$ref": "#/definitions/add-on-region-capability/definitions/id" + } + }, + "links": [ + { + "description": "List all existing add-on region capabilities.", + "href": "/addon-region-capabilities", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on-region-capability" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "List existing add-on region capabilities for an add-on-service", + "href": "/addon-services/{(%23%2Fdefinitions%2Fadd-on-service%2Fdefinitions%2Fidentity)}/region-capabilities", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on-region-capability" + }, + "type": [ + "array" + ] + }, + "title": "List by Add-on Service" + }, + { + "description": "List existing add-on region capabilities for a region.", + "href": "/regions/{(%23%2Fdefinitions%2Fregion%2Fdefinitions%2Fidentity)}/addon-region-capabilities", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on-region-capability" + }, + "type": [ + "array" + ] + }, + "title": "List By Region" + } + ], + "properties": { + "id": { + "$ref": "#/definitions/add-on-region-capability/definitions/id" + }, + "supports_private_networking": { + "$ref": "#/definitions/add-on-region-capability/definitions/supports_private_networking" + }, + "addon_service": { + "$ref": "#/definitions/add-on-service" + }, + "region": { + "$ref": "#/definitions/region" + } + } + }, + "add-on-service": { + "description": "Add-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Add-on Service", + "type": [ + "object" + ], + "definitions": { + "cli_plugin_name": { + "description": "npm package name of the add-on service's Heroku CLI plugin", + "example": "heroku-papertrail", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "created_at": { + "description": "when add-on-service was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "human_name": { + "description": "human-readable name of the add-on service provider", + "example": "Heroku Postgres", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of this add-on-service", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/add-on-service/definitions/id" + }, + { + "$ref": "#/definitions/add-on-service/definitions/name" + } + ] + }, + "name": { + "description": "unique name of this add-on-service", + "example": "heroku-postgresql", + "readOnly": true, + "type": [ + "string" + ] + }, + "state": { + "description": "release status for add-on service", + "enum": [ + "alpha", + "beta", + "ga", + "shutdown" + ], + "example": "ga", + "readOnly": true, + "type": [ + "string" + ] + }, + "supports_multiple_installations": { + "default": false, + "description": "whether or not apps can have access to more than one instance of this add-on at the same time", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "supports_sharing": { + "default": false, + "description": "whether or not apps can have access to add-ons billed to a different app", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "updated_at": { + "description": "when add-on-service was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Info for existing add-on-service.", + "href": "/addon-services/{(%23%2Fdefinitions%2Fadd-on-service%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/add-on-service" + }, + "title": "Info" + }, + { + "description": "List existing add-on-services.", + "href": "/addon-services", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on-service" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "cli_plugin_name": { + "$ref": "#/definitions/add-on-service/definitions/cli_plugin_name" + }, + "created_at": { + "$ref": "#/definitions/add-on-service/definitions/created_at" + }, + "human_name": { + "$ref": "#/definitions/add-on-service/definitions/human_name" + }, + "id": { + "$ref": "#/definitions/add-on-service/definitions/id" + }, + "name": { + "$ref": "#/definitions/add-on-service/definitions/name" + }, + "state": { + "$ref": "#/definitions/add-on-service/definitions/state" + }, + "supports_multiple_installations": { + "$ref": "#/definitions/add-on-service/definitions/supports_multiple_installations" + }, + "supports_sharing": { + "$ref": "#/definitions/add-on-service/definitions/supports_sharing" + }, + "updated_at": { + "$ref": "#/definitions/add-on-service/definitions/updated_at" + } + } + }, + "add-on-webhook-delivery": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Heroku Platform API - Add-on Webhook Delivery", + "description": "Represents the delivery of a webhook notification, including its current status.", + "stability": "production", + "strictProperties": true, + "type": [ + "object" + ], + "links": [ + { + "description": "Returns the info for an existing delivery. Can only be accessed by the add-on partner providing this add-on.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/webhook-deliveries/{(%23%2Fdefinitions%2Fapp-webhook-delivery%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/app-webhook-delivery" + }, + "title": "Info" + }, + { + "description": "Lists existing deliveries for an add-on. Can only be accessed by the add-on partner providing this add-on.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/webhook-deliveries", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/app-webhook-delivery" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ] + }, + "add-on-webhook-event": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Heroku Platform API - Add-on Webhook Event", + "description": "Represents a webhook event that occurred.", + "stability": "production", + "strictProperties": true, + "type": [ + "object" + ], + "links": [ + { + "description": "Returns the info for a specified webhook event. Can only be accessed by the add-on partner providing this add-on.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/webhook-events/{(%23%2Fdefinitions%2Fapp-webhook-event%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/app-webhook-event" + }, + "title": "Info" + }, + { + "description": "Lists existing webhook events for an add-on. Can only be accessed by the add-on partner providing this add-on.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/webhook-events", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/app-webhook-event" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ] + }, + "add-on-webhook": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Heroku Platform API - Add-on Webhook", + "description": "Represents the details of a webhook subscription", + "stability": "production", + "strictProperties": false, + "additionalProperties": false, + "required": [ + "created_at", + "id", + "include", + "level", + "updated_at", + "url" + ], + "type": [ + "object" + ], + "definitions": { + "addon_webhook": { + "properties": { + "addon": { + "description": "identity of add-on. Only used for add-on partner webhooks.", + "properties": { + "id": { + "$ref": "#/definitions/add-on/definitions/id" + }, + "name": { + "$ref": "#/definitions/add-on/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/app-webhook/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/app-webhook/definitions/id" + }, + "include": { + "$ref": "#/definitions/app-webhook/definitions/include" + }, + "level": { + "$ref": "#/definitions/app-webhook/definitions/level" + }, + "updated_at": { + "$ref": "#/definitions/app-webhook/definitions/updated_at" + }, + "url": { + "$ref": "#/definitions/app-webhook/definitions/url" + } + }, + "description": "add-on webhook", + "type": [ + "object" + ] + } + }, + "links": [ + { + "description": "Create an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/webhooks", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "authorization": { + "$ref": "#/definitions/app-webhook/definitions/authorization" + }, + "include": { + "$ref": "#/definitions/app-webhook/definitions/include" + }, + "level": { + "$ref": "#/definitions/app-webhook/definitions/level" + }, + "secret": { + "$ref": "#/definitions/app-webhook/definitions/secret" + }, + "url": { + "$ref": "#/definitions/app-webhook/definitions/url" + } + }, + "additionalProperties": false, + "required": [ + "include", + "level", + "url" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/add-on-webhook/definitions/addon_webhook" + }, + "title": "Create" + }, + { + "description": "Removes an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/webhooks/{(%23%2Fdefinitions%2Fapp-webhook%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/add-on-webhook/definitions/addon_webhook" + }, + "title": "Delete" + }, + { + "description": "Returns the info for an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/webhooks/{(%23%2Fdefinitions%2Fapp-webhook%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/add-on-webhook/definitions/addon_webhook" + }, + "title": "Info" + }, + { + "description": "List all webhook subscriptions for a particular add-on. Can only be accessed by the add-on partner providing this add-on.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/webhooks", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on-webhook/definitions/addon_webhook" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Updates the details of an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/webhooks/{(%23%2Fdefinitions%2Fapp-webhook%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "authorization": { + "$ref": "#/definitions/app-webhook/definitions/authorization" + }, + "include": { + "$ref": "#/definitions/app-webhook/definitions/include" + }, + "level": { + "$ref": "#/definitions/app-webhook/definitions/level" + }, + "secret": { + "$ref": "#/definitions/app-webhook/definitions/secret" + }, + "url": { + "$ref": "#/definitions/app-webhook/definitions/url" + } + }, + "strictProperties": false, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/add-on-webhook/definitions/addon_webhook" + }, + "title": "Update" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/app-webhook/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/app-webhook/definitions/id" + }, + "include": { + "$ref": "#/definitions/app-webhook/definitions/include" + }, + "level": { + "$ref": "#/definitions/app-webhook/definitions/level" + }, + "updated_at": { + "$ref": "#/definitions/app-webhook/definitions/updated_at" + }, + "url": { + "$ref": "#/definitions/app-webhook/definitions/url" + } + } + }, + "add-on": { + "description": "Add-ons represent add-ons that have been provisioned and attached to one or more apps.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "title": "Heroku Platform API - Add-on", + "additionalProperties": false, + "required": [ + "actions", + "addon_service", + "billing_entity", + "app", + "billed_price", + "config_vars", + "created_at", + "id", + "name", + "plan", + "provider_id", + "state", + "updated_at", + "web_url" + ], + "type": [ + "object" + ], + "definitions": { + "actions": { + "description": "provider actions for this specific add-on", + "type": [ + "array" + ], + "items": { + "type": [ + "object" + ] + }, + "readOnly": true, + "properties": { + "id": { + "$ref": "#/definitions/add-on-plan-action/definitions/id" + }, + "label": { + "$ref": "#/definitions/add-on-plan-action/definitions/label" + }, + "action": { + "$ref": "#/definitions/add-on-plan-action/definitions/action" + }, + "url": { + "$ref": "#/definitions/add-on-plan-action/definitions/url" + }, + "requires_owner": { + "$ref": "#/definitions/add-on-plan-action/definitions/requires_owner" + } + } + }, + "cents": { + "description": "price in cents per unit of add-on", + "example": 0, + "readOnly": true, + "type": [ + "integer" + ] + }, + "config": { + "additionalProperties": false, + "description": "custom add-on provisioning options", + "example": { + "db-version": "1.2.3" + }, + "patternProperties": { + "^\\w+$": { + "type": [ + "string" + ] + } + }, + "type": [ + "object" + ] + }, + "config_vars": { + "description": "config vars exposed to the owning app by this add-on", + "example": [ + "FOO", + "BAZ" + ], + "items": { + "type": [ + "string" + ] + }, + "readOnly": true, + "type": [ + "array" + ] + }, + "confirm": { + "description": "name of billing entity for confirmation", + "example": "example", + "type": [ + "string" + ] + }, + "created_at": { + "description": "when add-on was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of add-on", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/add-on/definitions/id" + }, + { + "$ref": "#/definitions/add-on/definitions/name" + } + ] + }, + "name": { + "description": "globally unique name of the add-on", + "example": "acme-inc-primary-database", + "pattern": "^[a-zA-Z][A-Za-z0-9_-]+$", + "type": [ + "string" + ] + }, + "provider_id": { + "description": "id of this add-on with its provider", + "example": "abcd1234", + "readOnly": true, + "type": [ + "string" + ] + }, + "state": { + "description": "state in the add-on's lifecycle", + "enum": [ + "provisioning", + "provisioned", + "deprovisioned" + ], + "example": "provisioned", + "readOnly": true, + "type": [ + "string" + ] + }, + "unit": { + "description": "unit of price for add-on", + "example": "month", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when add-on was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "web_url": { + "description": "URL for logging into web interface of add-on (e.g. a dashboard)", + "example": "https://postgres.heroku.com/databases/01234567-89ab-cdef-0123-456789abcdef", + "format": "uri", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "addon_service": { + "description": "identity of add-on service", + "anyOf": [ + { + "properties": { + "id": { + "$ref": "#/definitions/add-on-service/definitions/id" + }, + "name": { + "$ref": "#/definitions/add-on-service/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + { + "$ref": "#/definitions/add-on-service" + } + ] + }, + "plan": { + "description": "identity of add-on plan", + "anyOf": [ + { + "properties": { + "id": { + "$ref": "#/definitions/plan/definitions/id" + }, + "name": { + "$ref": "#/definitions/plan/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + { + "$ref": "#/definitions/plan" + } + ] + }, + "provision_message": { + "description": "A provision message", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "List all existing add-ons.", + "href": "/addons", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Info for an existing add-on.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/add-on" + }, + "title": "Info" + }, + { + "description": "Create a new add-on.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/addons", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "attachment": { + "description": "name for add-on's initial attachment", + "example": { + "name": "DATABASE_FOLLOWER" + }, + "properties": { + "name": { + "$ref": "#/definitions/add-on-attachment/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "config": { + "$ref": "#/definitions/add-on/definitions/config" + }, + "confirm": { + "$ref": "#/definitions/add-on/definitions/confirm" + }, + "plan": { + "$ref": "#/definitions/plan/definitions/identity" + }, + "name": { + "$ref": "#/definitions/add-on/definitions/name" + } + }, + "required": [ + "plan" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/add-on" + }, + "title": "Create" + }, + { + "description": "Delete an existing add-on.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/add-on" + }, + "title": "Delete" + }, + { + "description": "Info for an existing add-on.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/add-on" + }, + "title": "Info By App" + }, + { + "description": "List existing add-ons for an app.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/addons", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on" + }, + "type": [ + "array" + ] + }, + "title": "List By App" + }, + { + "description": "Change add-on plan. Some add-ons may not support changing plans. In that case, an error will be returned.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/add-on/definitions/name" + }, + "plan": { + "$ref": "#/definitions/plan/definitions/identity" + } + }, + "required": [ + "plan" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/add-on" + }, + "title": "Update" + }, + { + "description": "List all existing add-ons a user has access to", + "href": "/users/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}/addons", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on" + }, + "type": [ + "array" + ] + }, + "title": "List By User" + }, + { + "description": "List add-ons used across all Team apps", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/addons", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on" + }, + "type": [ + "array" + ] + }, + "title": "List By Team" + }, + { + "description": "Resolve an add-on from a name, optionally passing an app name. If there are matches it returns at least one add-on (exact match) or many.", + "href": "/actions/addons/resolve", + "method": "POST", + "rel": "resolve", + "schema": { + "properties": { + "addon": { + "$ref": "#/definitions/add-on/definitions/name" + }, + "app": { + "$ref": "#/definitions/app/definitions/name" + }, + "addon_service": { + "$ref": "#/definitions/add-on-service/definitions/name" + } + }, + "required": [ + "addon" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on" + }, + "type": [ + "array" + ] + }, + "title": "Resolution" + } + ], + "properties": { + "actions": { + "$ref": "#/definitions/add-on/definitions/actions" + }, + "addon_service": { + "$ref": "#/definitions/add-on/definitions/addon_service" + }, + "billing_entity": { + "description": "billing entity associated with this add-on", + "type": [ + "object" + ], + "properties": { + "id": { + "description": "unique identifier of the billing entity", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "name": { + "description": "name of the billing entity", + "example": "example", + "readOnly": true, + "type": [ + "string" + ] + }, + "type": { + "description": "type of Object of the billing entity; new types allowed at any time.", + "enum": [ + "app", + "team" + ], + "example": "app", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "strictProperties": true + }, + "app": { + "description": "billing application associated with this add-on", + "type": [ + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + } + }, + "strictProperties": true + }, + "billed_price": { + "description": "billed price", + "properties": { + "cents": { + "$ref": "#/definitions/plan/definitions/cents" + }, + "contract": { + "$ref": "#/definitions/plan/definitions/contract" + }, + "unit": { + "$ref": "#/definitions/plan/definitions/unit" + } + }, + "strictProperties": true, + "type": [ + "object", + "null" + ] + }, + "config_vars": { + "$ref": "#/definitions/add-on/definitions/config_vars" + }, + "created_at": { + "$ref": "#/definitions/add-on/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/add-on/definitions/id" + }, + "name": { + "$ref": "#/definitions/add-on/definitions/name" + }, + "plan": { + "$ref": "#/definitions/add-on/definitions/plan" + }, + "provider_id": { + "$ref": "#/definitions/add-on/definitions/provider_id" + }, + "provision_message": { + "$ref": "#/definitions/add-on/definitions/provision_message" + }, + "state": { + "$ref": "#/definitions/add-on/definitions/state" + }, + "updated_at": { + "$ref": "#/definitions/add-on/definitions/updated_at" + }, + "web_url": { + "$ref": "#/definitions/add-on/definitions/web_url" + } + } + }, + "allowed-add-on-service": { + "description": "Entities that have been allowed to be used by a Team", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Allowed Add-on Service", + "type": [ + "object" + ], + "definitions": { + "added_at": { + "description": "when the add-on service was allowed", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "added_by": { + "description": "the user which allowed the add-on service", + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email", + "type": [ + "string", + "null" + ] + }, + "id": { + "$ref": "#/definitions/account/definitions/id", + "type": [ + "string", + "null" + ] + } + }, + "readOnly": true, + "type": [ + "object" + ] + }, + "addon_service": { + "description": "the add-on service allowed for use", + "properties": { + "id": { + "$ref": "#/definitions/add-on-service/definitions/id" + }, + "name": { + "$ref": "#/definitions/add-on-service/definitions/name" + }, + "human_name": { + "$ref": "#/definitions/add-on-service/definitions/human_name" + } + }, + "readOnly": true, + "type": [ + "object" + ] + }, + "id": { + "description": "unique identifier for this allowed add-on service record", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/allowed-add-on-service/definitions/id" + }, + { + "$ref": "#/definitions/add-on-service/definitions/name" + } + ] + } + }, + "links": [ + { + "description": "List all allowed add-on services for a team", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/allowed-addon-services", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/allowed-add-on-service" + }, + "type": [ + "array" + ] + }, + "title": "List By Team" + }, + { + "description": "Allow an Add-on Service", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/allowed-addon-services", + "method": "POST", + "rel": "create", + "schema": { + "type": [ + "object" + ], + "properties": { + "addon_service": { + "description": "name of the add-on service to allow", + "example": "heroku-postgresql", + "type": [ + "string" + ] + } + } + }, + "targetSchema": { + "items": { + "$ref": "#/definitions/allowed-add-on-service" + }, + "type": [ + "array" + ] + }, + "title": "Create By Team" + }, + { + "description": "Remove an allowed add-on service", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/allowed-addon-services/{(%23%2Fdefinitions%2Fallowed-add-on-service%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/allowed-add-on-service" + }, + "title": "Delete By Team" + } + ], + "properties": { + "added_at": { + "$ref": "#/definitions/allowed-add-on-service/definitions/added_at" + }, + "added_by": { + "$ref": "#/definitions/allowed-add-on-service/definitions/added_by" + }, + "addon_service": { + "$ref": "#/definitions/allowed-add-on-service/definitions/addon_service" + }, + "id": { + "$ref": "#/definitions/allowed-add-on-service/definitions/id" + } + } + }, + "app-feature": { + "description": "An app feature represents a Heroku labs capability that can be enabled or disabled for an app on Heroku.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - App Feature", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when app feature was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "description": { + "description": "description of app feature", + "example": "Causes app to example.", + "readOnly": true, + "type": [ + "string" + ] + }, + "doc_url": { + "description": "documentation URL of app feature", + "example": "http://devcenter.heroku.com/articles/example", + "readOnly": true, + "type": [ + "string" + ] + }, + "enabled": { + "description": "whether or not app feature has been enabled", + "example": true, + "readOnly": false, + "type": [ + "boolean" + ] + }, + "id": { + "description": "unique identifier of app feature", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/app-feature/definitions/id" + }, + { + "$ref": "#/definitions/app-feature/definitions/name" + } + ] + }, + "name": { + "description": "unique name of app feature", + "example": "name", + "readOnly": true, + "type": [ + "string" + ] + }, + "state": { + "description": "state of app feature", + "example": "public", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when app feature was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "display_name": { + "description": "user readable feature name", + "example": "My Feature", + "readOnly": true, + "type": [ + "string" + ] + }, + "feedback_email": { + "description": "e-mail to send feedback about the feature", + "example": "feedback@heroku.com", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Info for an existing app feature.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/features/{(%23%2Fdefinitions%2Fapp-feature%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/app-feature" + }, + "title": "Info" + }, + { + "description": "List existing app features.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/features", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/app-feature" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Update an existing app feature.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/features/{(%23%2Fdefinitions%2Fapp-feature%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "enabled": { + "$ref": "#/definitions/app-feature/definitions/enabled" + } + }, + "required": [ + "enabled" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/app-feature" + }, + "title": "Update" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/app-feature/definitions/created_at" + }, + "description": { + "$ref": "#/definitions/app-feature/definitions/description" + }, + "doc_url": { + "$ref": "#/definitions/app-feature/definitions/doc_url" + }, + "enabled": { + "$ref": "#/definitions/app-feature/definitions/enabled" + }, + "id": { + "$ref": "#/definitions/app-feature/definitions/id" + }, + "name": { + "$ref": "#/definitions/app-feature/definitions/name" + }, + "state": { + "$ref": "#/definitions/app-feature/definitions/state" + }, + "updated_at": { + "$ref": "#/definitions/app-feature/definitions/updated_at" + }, + "display_name": { + "$ref": "#/definitions/app-feature/definitions/display_name" + }, + "feedback_email": { + "$ref": "#/definitions/app-feature/definitions/feedback_email" + } + } + }, + "app-setup": { + "description": "An app setup represents an app on Heroku that is setup using an environment, addons, and scripts described in an app.json manifest file.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Setup API - App Setup", + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "unique identifier of app setup", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "readOnly": true, + "type": [ + "string" + ], + "format": "uuid" + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/app-setup/definitions/id" + } + ] + }, + "buildpack_override": { + "description": "a buildpack override", + "properties": { + "url": { + "description": "location of the buildpack", + "example": "https://example.com/buildpack.tgz", + "type": [ + "string" + ] + } + }, + "type": [ + "object" + ] + }, + "created_at": { + "description": "when app setup was created", + "example": "2012-01-01T12:00:00Z", + "readOnly": true, + "type": [ + "string" + ], + "format": "date-time" + }, + "updated_at": { + "description": "when app setup was updated", + "example": "2012-01-01T12:00:00Z", + "readOnly": true, + "type": [ + "string" + ], + "format": "date-time" + }, + "status": { + "description": "the overall status of app setup", + "example": "failed", + "enum": [ + "failed", + "pending", + "succeeded" + ], + "readOnly": true, + "type": [ + "string" + ] + }, + "resolved_success_url": { + "description": "fully qualified success url", + "example": "https://example.herokuapp.com/welcome", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "failure_message": { + "description": "reason that app setup has failed", + "example": "invalid app.json", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "manifest_errors": { + "description": "errors associated with invalid app.json manifest file", + "example": [ + "config var FOO is required" + ], + "readOnly": true, + "items": { + "type": [ + "string" + ] + }, + "type": [ + "array" + ] + }, + "overrides": { + "description": "overrides of keys in the app.json manifest file", + "example": { + "buildpacks": [ + { + "url": "https://example.com/buildpack.tgz" + } + ], + "env": { + "FOO": "bar", + "BAZ": "qux" + } + }, + "properties": { + "buildpacks": { + "description": "overrides the buildpacks specified in the app.json manifest file", + "example": [ + { + "url": "https://example.com/buildpack.tgz" + } + ], + "items": { + "$ref": "#/definitions/app-setup/definitions/buildpack_override" + }, + "type": [ + "array" + ] + }, + "env": { + "description": "overrides of the env specified in the app.json manifest file", + "example": { + "FOO": "bar", + "BAZ": "qux" + }, + "readOnly": true, + "additionalProperties": false, + "patternProperties": { + "^\\w+$": { + "type": [ + "string" + ] + } + }, + "type": [ + "object" + ] + } + }, + "type": [ + "object" + ] + }, + "postdeploy": { + "description": "result of postdeploy script", + "type": [ + "object", + "null" + ], + "properties": { + "output": { + "description": "output of the postdeploy script", + "example": "assets precompiled", + "readOnly": true, + "type": [ + "string" + ] + }, + "exit_code": { + "description": "The exit code of the postdeploy script", + "example": 1, + "readOnly": true, + "type": [ + "integer" + ] + } + }, + "readOnly": true + } + }, + "properties": { + "id": { + "$ref": "#/definitions/app-setup/definitions/id" + }, + "created_at": { + "$ref": "#/definitions/app-setup/definitions/created_at" + }, + "updated_at": { + "$ref": "#/definitions/app-setup/definitions/updated_at" + }, + "status": { + "$ref": "#/definitions/app-setup/definitions/status" + }, + "failure_message": { + "$ref": "#/definitions/app-setup/definitions/failure_message" + }, + "app": { + "description": "identity of app", + "strictProperties": true, + "type": [ + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + } + } + }, + "build": { + "description": "identity and status of build", + "strictProperties": true, + "type": [ + "null", + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/build/definitions/id" + }, + "status": { + "$ref": "#/definitions/build/definitions/status" + }, + "output_stream_url": { + "$ref": "#/definitions/build/definitions/output_stream_url" + } + } + }, + "manifest_errors": { + "$ref": "#/definitions/app-setup/definitions/manifest_errors" + }, + "postdeploy": { + "$ref": "#/definitions/app-setup/definitions/postdeploy" + }, + "resolved_success_url": { + "$ref": "#/definitions/app-setup/definitions/resolved_success_url" + } + }, + "links": [ + { + "description": "Create a new app setup from a gzipped tar archive containing an app.json manifest file.", + "title": "Create", + "rel": "create", + "method": "POST", + "href": "/app-setups", + "schema": { + "required": [ + "source_blob" + ], + "type": [ + "object" + ], + "properties": { + "app": { + "description": "optional parameters for created app", + "properties": { + "locked": { + "$ref": "#/definitions/team-app/definitions/locked" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "organization": { + "$ref": "#/definitions/team/definitions/name" + }, + "personal": { + "$ref": "#/definitions/team-app/definitions/personal" + }, + "region": { + "$ref": "#/definitions/region/definitions/name" + }, + "space": { + "$ref": "#/definitions/space/definitions/name" + }, + "stack": { + "$ref": "#/definitions/stack/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "source_blob": { + "description": "gzipped tarball of source code containing app.json manifest file", + "properties": { + "checksum": { + "description": "an optional checksum of the gzipped tarball for verifying its integrity", + "example": "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "url": { + "description": "URL of gzipped tarball of source code containing app.json manifest file", + "example": "https://example.com/source.tgz?token=xyz", + "readOnly": true, + "type": [ + "string" + ] + }, + "version": { + "description": "Version of the gzipped tarball.", + "example": "v1.3.0", + "readOnly": true, + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object" + ] + }, + "overrides": { + "$ref": "#/definitions/app-setup/definitions/overrides" + } + } + }, + "targetSchema": { + "$ref": "#/definitions/app-setup" + } + }, + { + "description": "Get the status of an app setup.", + "title": "Info", + "rel": "self", + "method": "GET", + "href": "/app-setups/{(%23%2Fdefinitions%2Fapp-setup%2Fdefinitions%2Fidentity)}", + "targetSchema": { + "$ref": "#/definitions/app-setup" + } + } + ] + }, + "app-transfer": { + "description": "An app transfer represents a two party interaction for transferring ownership of an app.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - App Transfer", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when app transfer was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of app transfer", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/app-transfer/definitions/id" + }, + { + "$ref": "#/definitions/app/definitions/name" + } + ] + }, + "silent": { + "default": false, + "description": "whether to suppress email notification when transferring apps", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "state": { + "description": "the current state of an app transfer", + "enum": [ + "pending", + "accepted", + "declined" + ], + "example": "pending", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when app transfer was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Create a new app transfer.", + "href": "/account/app-transfers", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "app": { + "$ref": "#/definitions/app/definitions/identity" + }, + "recipient": { + "$ref": "#/definitions/account/definitions/identity" + }, + "silent": { + "$ref": "#/definitions/app-transfer/definitions/silent" + } + }, + "required": [ + "app", + "recipient" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/app-transfer" + }, + "title": "Create" + }, + { + "description": "Delete an existing app transfer", + "href": "/account/app-transfers/{(%23%2Fdefinitions%2Fapp-transfer%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/app-transfer" + }, + "title": "Delete" + }, + { + "description": "Info for existing app transfer.", + "href": "/account/app-transfers/{(%23%2Fdefinitions%2Fapp-transfer%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/app-transfer" + }, + "title": "Info" + }, + { + "description": "List existing apps transfers.", + "href": "/account/app-transfers", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/app-transfer" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Update an existing app transfer.", + "href": "/account/app-transfers/{(%23%2Fdefinitions%2Fapp-transfer%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "state": { + "$ref": "#/definitions/app-transfer/definitions/state" + } + }, + "required": [ + "state" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/app-transfer" + }, + "title": "Update" + } + ], + "properties": { + "app": { + "description": "app involved in the transfer", + "properties": { + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/app-transfer/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/app-transfer/definitions/id" + }, + "owner": { + "description": "identity of the owner of the transfer", + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "recipient": { + "description": "identity of the recipient of the transfer", + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "state": { + "$ref": "#/definitions/app-transfer/definitions/state" + }, + "updated_at": { + "$ref": "#/definitions/app-transfer/definitions/updated_at" + } + } + }, + "app-webhook-delivery": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Heroku Platform API - App Webhook Delivery", + "description": "Represents the delivery of a webhook notification, including its current status.", + "stability": "production", + "strictProperties": true, + "type": [ + "object" + ], + "definitions": { + "attempt_id": { + "description": "unique identifier of attempt", + "readOnly": true, + "format": "uuid", + "type": [ + "string" + ] + }, + "attempt_error_class": { + "description": "error class encountered during attempt", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "attempt_code": { + "description": "http response code received during attempt", + "readOnly": true, + "type": [ + "integer", + "null" + ] + }, + "attempt_created_at": { + "description": "when attempt was created", + "format": "date-time", + "type": [ + "string" + ] + }, + "attempt_updated_at": { + "description": "when attempt was updated", + "format": "date-time", + "type": [ + "string" + ] + }, + "attempt_status": { + "description": "status of an attempt", + "enum": [ + "scheduled", + "succeeded", + "failed" + ], + "example": "scheduled", + "type": [ + "string" + ] + }, + "created_at": { + "description": "when the delivery was created", + "format": "date-time", + "type": [ + "string" + ] + }, + "id": { + "description": "the delivery's unique identifier", + "readOnly": true, + "format": "uuid", + "type": [ + "string" + ] + }, + "num_attempts": { + "description": "number of times a delivery has been attempted", + "readOnly": true, + "type": [ + "integer" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/app-webhook-delivery/definitions/id" + } + ] + }, + "next_attempt_at": { + "description": "when delivery will be attempted again", + "format": "date-time", + "type": [ + "string", + "null" + ] + }, + "status": { + "description": "the delivery's status", + "enum": [ + "pending", + "scheduled", + "retrying", + "failed", + "succeeded" + ], + "example": "pending", + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when the delivery was last updated", + "format": "date-time", + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Returns the info for an existing delivery.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/webhook-deliveries/{(%23%2Fdefinitions%2Fapp-webhook-delivery%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/app-webhook-delivery" + }, + "title": "Info" + }, + { + "description": "Lists existing deliveries for an app.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/webhook-deliveries", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/app-webhook-delivery" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/app-webhook-delivery/definitions/created_at" + }, + "event": { + "description": "identity of event", + "properties": { + "id": { + "$ref": "#/definitions/app-webhook-event/definitions/id" + }, + "include": { + "$ref": "#/definitions/app-webhook-event/definitions/include" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "id": { + "$ref": "#/definitions/app-webhook-delivery/definitions/id" + }, + "num_attempts": { + "$ref": "#/definitions/app-webhook-delivery/definitions/num_attempts" + }, + "next_attempt_at": { + "$ref": "#/definitions/app-webhook-delivery/definitions/next_attempt_at" + }, + "last_attempt": { + "description": "last attempt of a delivery", + "properties": { + "id": { + "$ref": "#/definitions/app-webhook-delivery/definitions/attempt_id" + }, + "code": { + "$ref": "#/definitions/app-webhook-delivery/definitions/attempt_code" + }, + "error_class": { + "$ref": "#/definitions/app-webhook-delivery/definitions/attempt_error_class" + }, + "status": { + "$ref": "#/definitions/app-webhook-delivery/definitions/attempt_status" + }, + "created_at": { + "$ref": "#/definitions/app-webhook-delivery/definitions/attempt_created_at" + }, + "updated_at": { + "$ref": "#/definitions/app-webhook-delivery/definitions/attempt_updated_at" + } + }, + "strictProperties": true, + "type": [ + "object", + "null" + ] + }, + "status": { + "$ref": "#/definitions/app-webhook-delivery/definitions/status" + }, + "updated_at": { + "$ref": "#/definitions/app-webhook-delivery/definitions/updated_at" + }, + "webhook": { + "description": "identity of webhook", + "properties": { + "id": { + "$ref": "#/definitions/app-webhook/definitions/id" + }, + "level": { + "$ref": "#/definitions/app-webhook/definitions/level" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + } + }, + "app-webhook-event": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Heroku Platform API - App Webhook Event", + "description": "Represents a webhook event that occurred.", + "stability": "production", + "strictProperties": true, + "type": [ + "object" + ], + "definitions": { + "action": { + "description": "the type of event that occurred", + "example": "create", + "type": [ + "string" + ] + }, + "actor": { + "description": "user that caused event", + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "created_at": { + "description": "when event was created", + "format": "date-time", + "type": [ + "string" + ] + }, + "data": { + "description": "the current details of the event", + "type": [ + "object" + ] + }, + "id": { + "description": "the event's unique identifier", + "readOnly": true, + "format": "uuid", + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/app-webhook-event/definitions/id" + } + ] + }, + "include": { + "description": "the type of entity that the event is related to", + "example": "api:release", + "type": [ + "string" + ] + }, + "payload": { + "description": "payload of event", + "properties": { + "action": { + "$ref": "#/definitions/app-webhook-event/definitions/action" + }, + "actor": { + "$ref": "#/definitions/app-webhook-event/definitions/actor" + }, + "data": { + "$ref": "#/definitions/app-webhook-event/definitions/data" + }, + "previous_data": { + "$ref": "#/definitions/app-webhook-event/definitions/previous_data" + }, + "resource": { + "$ref": "#/definitions/app-webhook-event/definitions/resource" + }, + "version": { + "$ref": "#/definitions/app-webhook-event/definitions/version" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "previous_data": { + "description": "previous details of the event (if any)", + "type": [ + "object" + ] + }, + "resource": { + "description": "the type of resource associated with the event", + "example": "release", + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when the event was last updated", + "format": "date-time", + "type": [ + "string" + ] + }, + "version": { + "description": "the version of the details provided for the event", + "example": "1", + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Returns the info for a specified webhook event.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/webhook-events/{(%23%2Fdefinitions%2Fapp-webhook-event%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/app-webhook-event" + }, + "title": "Info" + }, + { + "description": "Lists existing webhook events for an app.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/webhook-events", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/app-webhook-event" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/app-webhook-event/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/app-webhook-event/definitions/id" + }, + "include": { + "$ref": "#/definitions/app-webhook-event/definitions/include" + }, + "payload": { + "$ref": "#/definitions/app-webhook-event/definitions/payload" + }, + "updated_at": { + "$ref": "#/definitions/app-webhook-event/definitions/updated_at" + } + } + }, + "app-webhook": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Heroku Platform API - App Webhook", + "description": "Represents the details of a webhook subscription", + "stability": "production", + "strictProperties": false, + "additionalProperties": false, + "required": [ + "created_at", + "id", + "include", + "level", + "updated_at", + "url" + ], + "type": [ + "object" + ], + "definitions": { + "authorization": { + "description": "a custom `Authorization` header that Heroku will include with all webhook notifications", + "example": "Bearer 9266671b2767f804c9d5809c2d384ed57d8f8ce1abd1043e1fb3fbbcb8c3", + "type": [ + "null", + "string" + ] + }, + "created_at": { + "description": "when the webhook was created", + "format": "date-time", + "type": [ + "string" + ] + }, + "id": { + "description": "the webhook's unique identifier", + "readOnly": true, + "format": "uuid", + "type": [ + "string" + ] + }, + "include": { + "description": "the entities that the subscription provides notifications for", + "items": { + "example": "api:release", + "type": [ + "string" + ] + }, + "type": [ + "array" + ] + }, + "level": { + "description": "if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached", + "enum": [ + "notify", + "sync" + ], + "example": "notify", + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/app-webhook/definitions/id" + } + ] + }, + "secret": { + "description": "a value that Heroku will use to sign all webhook notification requests (the signature is included in the request’s `Heroku-Webhook-Hmac-SHA256` header)", + "example": "dcbff0c4430a2960a2552389d587bc58d30a37a8cf3f75f8fb77abe667ad", + "type": [ + "null", + "string" + ] + }, + "updated_at": { + "description": "when the webhook was updated", + "format": "date-time", + "type": [ + "string" + ] + }, + "url": { + "description": "the URL where the webhook's notification requests are sent", + "format": "uri", + "type": [ + "string" + ] + }, + "app_webhook": { + "properties": { + "app": { + "description": "identity of app. Only used for customer webhooks.", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/app-webhook/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/app-webhook/definitions/id" + }, + "include": { + "$ref": "#/definitions/app-webhook/definitions/include" + }, + "level": { + "$ref": "#/definitions/app-webhook/definitions/level" + }, + "updated_at": { + "$ref": "#/definitions/app-webhook/definitions/updated_at" + }, + "url": { + "$ref": "#/definitions/app-webhook/definitions/url" + } + }, + "description": "app webhook", + "type": [ + "object" + ] + } + }, + "links": [ + { + "description": "Create an app webhook subscription.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/webhooks", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "authorization": { + "$ref": "#/definitions/app-webhook/definitions/authorization" + }, + "include": { + "$ref": "#/definitions/app-webhook/definitions/include" + }, + "level": { + "$ref": "#/definitions/app-webhook/definitions/level" + }, + "secret": { + "$ref": "#/definitions/app-webhook/definitions/secret" + }, + "url": { + "$ref": "#/definitions/app-webhook/definitions/url" + } + }, + "additionalProperties": false, + "required": [ + "include", + "level", + "url" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/app-webhook/definitions/app_webhook" + }, + "title": "Create" + }, + { + "description": "Removes an app webhook subscription.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/webhooks/{(%23%2Fdefinitions%2Fapp-webhook%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/app-webhook/definitions/app_webhook" + }, + "title": "Delete" + }, + { + "description": "Returns the info for an app webhook subscription.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/webhooks/{(%23%2Fdefinitions%2Fapp-webhook%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/app-webhook/definitions/app_webhook" + }, + "title": "Info" + }, + { + "description": "List all webhook subscriptions for a particular app.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/webhooks", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/app-webhook/definitions/app_webhook" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Updates the details of an app webhook subscription.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/webhooks/{(%23%2Fdefinitions%2Fapp-webhook%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "authorization": { + "$ref": "#/definitions/app-webhook/definitions/authorization" + }, + "include": { + "$ref": "#/definitions/app-webhook/definitions/include" + }, + "level": { + "$ref": "#/definitions/app-webhook/definitions/level" + }, + "secret": { + "$ref": "#/definitions/app-webhook/definitions/secret" + }, + "url": { + "$ref": "#/definitions/app-webhook/definitions/url" + } + }, + "strictProperties": false, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/app-webhook/definitions/app_webhook" + }, + "title": "Update" + } + ] + }, + "app": { + "description": "An app represents the program that you would like to deploy and run on Heroku.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - App", + "type": [ + "object" + ], + "definitions": { + "archived_at": { + "description": "when app was archived", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "buildpack_provided_description": { + "description": "description from buildpack of app", + "example": "Ruby/Rack", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "created_at": { + "description": "when app was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "git_url": { + "description": "git repo URL of app", + "example": "https://git.heroku.com/example.git", + "pattern": "^https://git\\.heroku\\.com/[a-z][a-z0-9-]{2,29}\\.git$", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of app", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/app/definitions/id" + }, + { + "$ref": "#/definitions/app/definitions/name" + } + ] + }, + "maintenance": { + "default": false, + "description": "maintenance status of app", + "example": false, + "readOnly": false, + "type": [ + "boolean" + ] + }, + "name": { + "description": "unique name of app", + "example": "example", + "pattern": "^[a-z][a-z0-9-]{1,28}[a-z0-9]$", + "readOnly": false, + "type": [ + "string" + ] + }, + "released_at": { + "default": null, + "description": "when app was released", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "repo_size": { + "default": null, + "description": "git repo size in bytes of app", + "example": 0, + "readOnly": true, + "type": [ + "integer", + "null" + ] + }, + "slug_size": { + "default": null, + "description": "slug size in bytes of app", + "example": 0, + "readOnly": true, + "type": [ + "integer", + "null" + ] + }, + "updated_at": { + "description": "when app was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "web_url": { + "description": "web URL of app", + "example": "https://example.herokuapp.com/", + "format": "uri", + "pattern": "^https?://[a-z][a-z0-9-]{3,43}\\.herokuapp\\.com/$", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "acm": { + "description": "ACM status of this app", + "default": false, + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + } + }, + "links": [ + { + "description": "Create a new app.", + "href": "/apps", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "region": { + "$ref": "#/definitions/region/definitions/identity" + }, + "stack": { + "$ref": "#/definitions/stack/definitions/identity" + }, + "feature_flags": { + "description": "unique name of app feature", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/app-feature/definitions/name" + } + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/app" + }, + "title": "Create" + }, + { + "description": "Delete an existing app.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/app" + }, + "title": "Delete" + }, + { + "description": "Info for existing app.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/app" + }, + "title": "Info" + }, + { + "description": "List existing apps.", + "href": "/apps", + "method": "GET", + "ranges": [ + "id", + "name", + "updated_at" + ], + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/app" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "List owned and collaborated apps (excludes team apps).", + "href": "/users/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}/apps", + "method": "GET", + "ranges": [ + "id", + "name", + "updated_at" + ], + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/app" + }, + "type": [ + "array" + ] + }, + "title": "List Owned and Collaborated" + }, + { + "description": "Update an existing app.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "build_stack": { + "$ref": "#/definitions/stack/definitions/identity" + }, + "maintenance": { + "$ref": "#/definitions/app/definitions/maintenance" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/app" + }, + "title": "Update" + }, + { + "description": "Enable ACM flag for an app", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/acm", + "method": "POST", + "rel": "update", + "targetSchema": { + "$ref": "#/definitions/app" + }, + "title": "Enable ACM" + }, + { + "description": "Disable ACM flag for an app", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/acm", + "method": "DELETE", + "rel": "delete", + "targetSchema": { + "$ref": "#/definitions/app" + }, + "title": "Disable ACM" + }, + { + "description": "Refresh ACM for an app", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/acm", + "method": "PATCH", + "rel": "update", + "targetSchema": { + "$ref": "#/definitions/app" + }, + "title": "Refresh ACM" + } + ], + "properties": { + "acm": { + "$ref": "#/definitions/app/definitions/acm" + }, + "archived_at": { + "$ref": "#/definitions/app/definitions/archived_at" + }, + "buildpack_provided_description": { + "$ref": "#/definitions/app/definitions/buildpack_provided_description" + }, + "build_stack": { + "description": "identity of the stack that will be used for new builds", + "properties": { + "id": { + "$ref": "#/definitions/stack/definitions/id" + }, + "name": { + "$ref": "#/definitions/stack/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/app/definitions/created_at" + }, + "git_url": { + "$ref": "#/definitions/app/definitions/git_url" + }, + "id": { + "$ref": "#/definitions/app/definitions/id" + }, + "internal_routing": { + "$ref": "#/definitions/team-app/definitions/internal_routing" + }, + "maintenance": { + "$ref": "#/definitions/app/definitions/maintenance" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "owner": { + "description": "identity of app owner", + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "organization": { + "description": "identity of team", + "properties": { + "id": { + "$ref": "#/definitions/team/definitions/id" + }, + "name": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "type": [ + "null", + "object" + ] + }, + "team": { + "description": "identity of team", + "properties": { + "id": { + "$ref": "#/definitions/team/definitions/id" + }, + "name": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "type": [ + "null", + "object" + ] + }, + "region": { + "description": "identity of app region", + "properties": { + "id": { + "$ref": "#/definitions/region/definitions/id" + }, + "name": { + "$ref": "#/definitions/region/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "released_at": { + "$ref": "#/definitions/app/definitions/released_at" + }, + "repo_size": { + "$ref": "#/definitions/app/definitions/repo_size" + }, + "slug_size": { + "$ref": "#/definitions/app/definitions/slug_size" + }, + "space": { + "description": "identity of space", + "properties": { + "id": { + "$ref": "#/definitions/space/definitions/id" + }, + "name": { + "$ref": "#/definitions/space/definitions/name" + }, + "shield": { + "$ref": "#/definitions/space/definitions/shield" + } + }, + "type": [ + "null", + "object" + ] + }, + "stack": { + "description": "identity of app stack", + "properties": { + "id": { + "$ref": "#/definitions/stack/definitions/id" + }, + "name": { + "$ref": "#/definitions/stack/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "updated_at": { + "$ref": "#/definitions/app/definitions/updated_at" + }, + "web_url": { + "$ref": "#/definitions/app/definitions/web_url" + } + } + }, + "archive": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Heroku Platform API - Audit Trail Archive", + "description": "An audit trail archive represents a monthly json zipped file containing events", + "stability": "production", + "strictProperties": true, + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "unique identifier of enterprise_account", + "readOnly": true, + "format": "uuid", + "type": [ + "string" + ] + }, + "identity": { + "$ref": "#/definitions/archive/definitions/id" + }, + "month": { + "description": "month of the archive", + "enum": [ + "01", + "02", + "03", + "04", + "05", + "06", + "07", + "08", + "09", + "10", + "11", + "12" + ], + "example": "10", + "readOnly": true, + "type": [ + "string" + ] + }, + "year": { + "description": "year of the archive", + "example": 2019, + "readOnly": true, + "minimum": 2017, + "type": [ + "integer" + ] + }, + "created_at": { + "description": "when archive was created", + "format": "date-time", + "type": [ + "string" + ] + }, + "url": { + "description": "url where to download the archive", + "readOnly": true, + "type": [ + "string" + ] + }, + "checksum": { + "description": "checksum for the archive", + "readOnly": true, + "type": [ + "string" + ] + }, + "size": { + "description": "size of the archive in bytes", + "example": 100, + "readOnly": true, + "type": [ + "integer" + ] + } + }, + "links": [ + { + "description": "Get archive for a single month.", + "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fidentity)}/archives/{(%23%2Fdefinitions%2Farchive%2Fdefinitions%2Fyear)}/{(%23%2Fdefinitions%2Farchive%2Fdefinitions%2Fmonth)}", + "method": "GET", + "rel": "self", + "title": "Info" + }, + { + "description": "List existing archives.", + "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fidentity)}/archives", + "method": "GET", + "rel": "instances", + "title": "List" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/archive/definitions/created_at" + }, + "month": { + "$ref": "#/definitions/archive/definitions/month" + }, + "year": { + "$ref": "#/definitions/archive/definitions/year" + }, + "url": { + "$ref": "#/definitions/archive/definitions/url" + }, + "checksum": { + "$ref": "#/definitions/archive/definitions/checksum" + }, + "size": { + "$ref": "#/definitions/archive/definitions/size" + } + } + }, + "audit-trail-event": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Heroku Platform API - Audit Trail Event", + "description": "An audit trail event represents some action on the platform", + "stability": "production", + "strictProperties": true, + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "unique identifier of event", + "readOnly": true, + "format": "uuid", + "type": [ + "string" + ] + }, + "type": { + "description": "type of event", + "readOnly": true, + "type": [ + "string" + ] + }, + "action": { + "description": "action for the event", + "readOnly": true, + "type": [ + "string" + ] + }, + "actor": { + "description": "user who caused event", + "readOnly": true, + "type": [ + "object" + ], + "properties": { + "id": { + "format": "uuid", + "type": [ + "string" + ] + }, + "email": { + "format": "email", + "type": [ + "string" + ] + } + } + }, + "app": { + "description": "app upon which event took place", + "readOnly": true, + "type": [ + "object" + ], + "properties": { + "id": { + "format": "uuid", + "type": [ + "string" + ] + }, + "name": { + "type": [ + "string" + ] + } + } + }, + "owner": { + "description": "owner of the app targeted by the event", + "readOnly": true, + "type": [ + "object" + ], + "properties": { + "id": { + "format": "uuid", + "type": [ + "string" + ] + }, + "email": { + "format": "email", + "type": [ + "string" + ] + } + } + }, + "enterprise_account": { + "description": "enterprise account on which the event happened", + "readOnly": true, + "type": [ + "object" + ], + "properties": { + "id": { + "format": "uuid", + "type": [ + "string" + ] + }, + "name": { + "type": [ + "string" + ] + } + } + }, + "team": { + "description": "team on which the event happened", + "readOnly": true, + "type": [ + "object" + ], + "properties": { + "id": { + "format": "uuid", + "type": [ + "string" + ] + }, + "name": { + "type": [ + "string" + ] + } + } + }, + "request": { + "description": "information about where the action was triggered", + "readOnly": true, + "type": [ + "object" + ], + "properties": { + "ip_address": { + "format": "ipv4", + "type": [ + "string" + ] + } + } + }, + "data": { + "description": "data specific to the event", + "readOnly": true, + "type": [ + "object" + ] + }, + "created_at": { + "description": "when event was created", + "format": "date-time", + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "List existing events. Returns all events for one day, defaulting to current day. Order, actor, action, and type, and day query params can be specified as query parameters. For example, '/enterprise-accounts/:id/events?order=desc&actor=user@example.com&action=create&type=app&day=2020-09-30' would return events in descending order and only return app created events by the user with user@example.com email address.", + "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fidentity)}/events", + "method": "GET", + "rel": "instances", + "title": "List" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/audit-trail-event/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/audit-trail-event/definitions/id" + }, + "type": { + "$ref": "#/definitions/audit-trail-event/definitions/type" + }, + "action": { + "$ref": "#/definitions/audit-trail-event/definitions/action" + }, + "actor": { + "$ref": "#/definitions/audit-trail-event/definitions/actor" + }, + "app": { + "$ref": "#/definitions/audit-trail-event/definitions/app" + }, + "owner": { + "$ref": "#/definitions/audit-trail-event/definitions/owner" + }, + "enterprise_account": { + "$ref": "#/definitions/audit-trail-event/definitions/enterprise_account" + }, + "team": { + "$ref": "#/definitions/audit-trail-event/definitions/team" + }, + "request": { + "$ref": "#/definitions/audit-trail-event/definitions/request" + }, + "data": { + "$ref": "#/definitions/audit-trail-event/definitions/data" + } + } + }, + "build": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "A build represents the process of transforming a code tarball into a slug", + "title": "Heroku Build API - Build", + "stability": "production", + "strictProperties": false, + "required": [ + "created_at", + "id", + "source_blob", + "status", + "updated_at", + "user" + ], + "type": [ + "object" + ], + "definitions": { + "buildpacks": { + "description": "buildpacks executed for this build, in order", + "type": [ + "array", + "null" + ], + "items": { + "description": "Buildpack to execute in a build", + "type": [ + "object" + ], + "properties": { + "url": { + "description": "the URL of the buildpack for the app", + "example": "https://github.com/heroku/heroku-buildpack-ruby", + "readOnly": false, + "type": [ + "string" + ] + }, + "name": { + "description": "Buildpack Registry name of the buildpack for the app", + "example": "heroku/ruby", + "readOnly": false, + "type": [ + "string" + ] + } + } + } + }, + "created_at": { + "description": "when build was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of build", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/build/definitions/id" + } + ] + }, + "output_stream_url": { + "description": "Build process output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`).", + "example": "https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef", + "readOnly": true, + "type": [ + "string" + ] + }, + "release": { + "description": "release resulting from the build", + "strictProperties": true, + "properties": { + "id": { + "$ref": "#/definitions/release/definitions/id" + } + }, + "example": { + "id": "01234567-89ab-cdef-0123-456789abcdef" + }, + "readOnly": true, + "type": [ + "null", + "object" + ], + "definitions": { + "id": { + "description": "unique identifier of release", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "type": [ + "string" + ] + } + } + }, + "source_blob": { + "description": "location of gzipped tarball of source code used to create build", + "properties": { + "checksum": { + "description": "an optional checksum of the gzipped tarball for verifying its integrity", + "example": "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "url": { + "description": "URL where gzipped tar archive of source code for build was downloaded.", + "example": "https://example.com/source.tgz?token=xyz", + "readOnly": true, + "type": [ + "string" + ] + }, + "version": { + "description": "Version of the gzipped tarball.", + "example": "v1.3.0", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "version_description": { + "description": "Version description of the gzipped tarball.", + "example": "* Fake User: Change session key", + "readOnly": true, + "type": [ + "string", + "null" + ] + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "stack": { + "description": "stack of build", + "example": "heroku-22", + "readOnly": true, + "type": [ + "string" + ] + }, + "status": { + "description": "status of build", + "enum": [ + "failed", + "pending", + "succeeded" + ], + "example": "succeeded", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when build was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Create a new build.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/builds", + "method": "POST", + "rel": "create", + "schema": { + "type": [ + "object" + ], + "properties": { + "buildpacks": { + "$ref": "#/definitions/build/definitions/buildpacks" + }, + "source_blob": { + "$ref": "#/definitions/build/definitions/source_blob" + } + }, + "required": [ + "source_blob" + ] + }, + "targetSchema": { + "$ref": "#/definitions/build" + }, + "title": "Create" + }, + { + "description": "Info for existing build.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/builds/{(%23%2Fdefinitions%2Fbuild%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/build" + }, + "title": "Info" + }, + { + "description": "List existing build.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/builds", + "method": "GET", + "ranges": [ + "id", + "started_at" + ], + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/build" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Destroy a build cache.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/build-cache", + "method": "DELETE", + "rel": "empty", + "title": "Delete cache" + }, + { + "description": "Cancel running build.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/builds/{(%23%2Fdefinitions%2Fbuild%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/build" + }, + "title": "Cancel" + } + ], + "properties": { + "app": { + "description": "app that the build belongs to", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "buildpacks": { + "$ref": "#/definitions/build/definitions/buildpacks" + }, + "created_at": { + "$ref": "#/definitions/build/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/build/definitions/id" + }, + "output_stream_url": { + "$ref": "#/definitions/build/definitions/output_stream_url" + }, + "source_blob": { + "$ref": "#/definitions/build/definitions/source_blob" + }, + "release": { + "$ref": "#/definitions/build/definitions/release" + }, + "slug": { + "description": "slug created by this build", + "properties": { + "id": { + "$ref": "#/definitions/slug/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object", + "null" + ] + }, + "stack": { + "$ref": "#/definitions/build/definitions/stack" + }, + "status": { + "$ref": "#/definitions/build/definitions/status" + }, + "updated_at": { + "$ref": "#/definitions/build/definitions/updated_at" + }, + "user": { + "description": "user that started the build", + "properties": { + "id": { + "$ref": "#/definitions/account/definitions/id" + }, + "email": { + "$ref": "#/definitions/account/definitions/email" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + } + }, + "buildpack-installation": { + "description": "A buildpack installation represents a buildpack that will be run against an app.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Buildpack Installations", + "type": [ + "object" + ], + "definitions": { + "ordinal": { + "description": "determines the order in which the buildpacks will execute", + "example": 0, + "readOnly": true, + "type": [ + "integer" + ] + }, + "update": { + "additionalProperties": false, + "description": "Properties to update a buildpack installation", + "properties": { + "buildpack": { + "$ref": "#/definitions/buildpack-installation/definitions/url" + } + }, + "readOnly": false, + "required": [ + "buildpack" + ], + "type": [ + "object" + ] + }, + "url": { + "description": "location of the buildpack for the app. Either a url (unofficial buildpacks) or an internal urn (heroku official buildpacks).", + "example": "https://github.com/heroku/heroku-buildpack-ruby", + "readOnly": false, + "type": [ + "string" + ] + }, + "name": { + "description": "either the Buildpack Registry name or a URL of the buildpack for the app", + "example": "heroku/ruby", + "readOnly": false, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Update an app's buildpack installations.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/buildpack-installations", + "method": "PUT", + "rel": "update", + "schema": { + "properties": { + "updates": { + "description": "The buildpack attribute can accept a name, a url, or a urn.", + "items": { + "$ref": "#/definitions/buildpack-installation/definitions/update" + }, + "type": [ + "array" + ] + } + }, + "required": [ + "updates" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "items": { + "$ref": "#/definitions/buildpack-installation" + }, + "type": [ + "array" + ] + }, + "title": "Update" + }, + { + "description": "List an app's existing buildpack installations.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/buildpack-installations", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/buildpack-installation" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "ordinal": { + "$ref": "#/definitions/buildpack-installation/definitions/ordinal" + }, + "buildpack": { + "description": "buildpack", + "properties": { + "url": { + "$ref": "#/definitions/buildpack-installation/definitions/url" + }, + "name": { + "$ref": "#/definitions/buildpack-installation/definitions/name" + } + }, + "type": [ + "object" + ] + } + } + }, + "collaborator": { + "description": "A collaborator represents an account that has been given access to an app on Heroku.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "additionalProperties": false, + "required": [ + "app", + "created_at", + "id", + "updated_at", + "user" + ], + "stability": "production", + "title": "Heroku Platform API - Collaborator", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when collaborator was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "email": { + "description": "invited email address of collaborator", + "example": "collaborator@example.com", + "format": "email", + "readOnly": false, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of collaborator", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/collaborator/definitions/email" + }, + { + "$ref": "#/definitions/collaborator/definitions/id" + } + ] + }, + "silent": { + "default": false, + "description": "whether to suppress email invitation when creating collaborator", + "example": false, + "readOnly": false, + "type": [ + "boolean" + ] + }, + "updated_at": { + "description": "when collaborator was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Create a new collaborator.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/collaborators", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "silent": { + "$ref": "#/definitions/collaborator/definitions/silent" + }, + "user": { + "$ref": "#/definitions/account/definitions/identity" + } + }, + "required": [ + "user" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/collaborator" + }, + "title": "Create" + }, + { + "description": "Delete an existing collaborator.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/collaborators/{(%23%2Fdefinitions%2Fcollaborator%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/collaborator" + }, + "title": "Delete" + }, + { + "description": "Info for existing collaborator.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/collaborators/{(%23%2Fdefinitions%2Fcollaborator%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/collaborator" + }, + "title": "Info" + }, + { + "description": "List existing collaborators.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/collaborators", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/collaborator" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "app": { + "description": "app collaborator belongs to", + "properties": { + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/collaborator/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/collaborator/definitions/id" + }, + "permissions": { + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/team-app-permission" + } + }, + "role": { + "$ref": "#/definitions/team/definitions/role" + }, + "updated_at": { + "$ref": "#/definitions/collaborator/definitions/updated_at" + }, + "user": { + "description": "identity of collaborated account", + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "federated": { + "$ref": "#/definitions/account/definitions/federated" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + } + }, + "config-var": { + "description": "Config Vars allow you to manage the configuration information provided to an app on Heroku.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Config Vars", + "type": [ + "object" + ], + "definitions": { + "config_vars": { + "additionalProperties": false, + "description": "hash of config vars", + "example": { + "FOO": "bar", + "BAZ": "qux" + }, + "patternProperties": { + "^\\w+$": { + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object" + ] + } + }, + "links": [ + { + "description": "Get config-vars for app.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/config-vars", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/config-var/definitions/config_vars" + }, + "title": "Info for App" + }, + { + "description": "Get config-vars for a release.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/releases/{(%23%2Fdefinitions%2Frelease%2Fdefinitions%2Fidentity)}/config-vars", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/config-var/definitions/config_vars" + }, + "title": "Info for App Release" + }, + { + "description": "Update config-vars for app. You can update existing config-vars by setting them again, and remove by setting it to `null`.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/config-vars", + "method": "PATCH", + "rel": "update", + "schema": { + "additionalProperties": false, + "description": "hash of config changes – update values or delete by seting it to `null`", + "example": { + "FOO": "bar", + "BAZ": "qux" + }, + "patternProperties": { + "^\\w+$": { + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/config-var/definitions/config_vars" + }, + "title": "Update" + } + ], + "example": { + "FOO": "bar", + "BAZ": "qux" + }, + "patternProperties": { + "^\\w+$": { + "type": [ + "string" + ] + } + } + }, + "credit": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "A credit represents value that will be used up before further charges are assigned to an account.", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Credit", + "type": [ + "object" + ], + "definitions": { + "amount": { + "description": "total value of credit in cents", + "example": 10000, + "type": [ + "number" + ] + }, + "balance": { + "description": "remaining value of credit in cents", + "example": 5000, + "type": [ + "number" + ] + }, + "created_at": { + "description": "when credit was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "type": [ + "string" + ] + }, + "expires_at": { + "description": "when credit will expire", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of credit", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/credit/definitions/id" + } + ] + }, + "title": { + "description": "a name for credit", + "example": "gift card", + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when credit was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Create a new credit.", + "href": "/account/credits", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "code1": { + "description": "first code from a discount card", + "example": "012abc", + "type": [ + "string" + ] + }, + "code2": { + "description": "second code from a discount card", + "example": "012abc", + "type": [ + "string" + ] + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/credit" + }, + "title": "Create" + }, + { + "description": "Info for existing credit.", + "href": "/account/credits/{(%23%2Fdefinitions%2Fcredit%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/credit" + }, + "title": "Info" + }, + { + "description": "List existing credits.", + "href": "/account/credits", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/credit" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "amount": { + "$ref": "#/definitions/credit/definitions/amount" + }, + "balance": { + "$ref": "#/definitions/credit/definitions/balance" + }, + "created_at": { + "$ref": "#/definitions/credit/definitions/created_at" + }, + "expires_at": { + "$ref": "#/definitions/credit/definitions/expires_at" + }, + "id": { + "$ref": "#/definitions/credit/definitions/id" + }, + "title": { + "$ref": "#/definitions/credit/definitions/title" + }, + "updated_at": { + "$ref": "#/definitions/credit/definitions/updated_at" + } + } + }, + "domain": { + "description": "Domains define what web routes should be routed to an app on Heroku.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Domain", + "type": [ + "object" + ], + "definitions": { + "acm_status": { + "description": "status of this record's ACM", + "example": "pending", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "acm_status_reason": { + "description": "reason for the status of this record's ACM", + "example": "Failing CCA check", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "created_at": { + "description": "when domain was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "cname": { + "description": "canonical name record, the address to point a domain at", + "example": "example.herokudns.com", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "status": { + "description": "status of this record's cname", + "example": "pending", + "readOnly": true, + "type": [ + "string" + ] + }, + "hostname": { + "description": "full hostname", + "example": "subdomain.example.com", + "format": "uri", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of this domain", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/domain/definitions/id" + }, + { + "$ref": "#/definitions/domain/definitions/hostname" + } + ] + }, + "kind": { + "description": "type of domain name", + "enum": [ + "heroku", + "custom" + ], + "example": "custom", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when domain was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "sni_endpoint": { + "description": "null or unique identifier or name for SNI endpoint", + "type": [ + "null", + "string" + ] + } + }, + "links": [ + { + "description": "Create a new domain.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/domains", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "hostname": { + "$ref": "#/definitions/domain/definitions/hostname" + }, + "sni_endpoint": { + "$ref": "#/definitions/domain/definitions/sni_endpoint" + } + }, + "required": [ + "hostname", + "sni_endpoint" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/domain" + }, + "title": "Create" + }, + { + "description": "Associate an SNI endpoint", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/domains/{(%23%2Fdefinitions%2Fdomain%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "sni_endpoint": { + "$ref": "#/definitions/domain/definitions/sni_endpoint" + } + }, + "required": [ + "sni_endpoint" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/domain" + }, + "title": "Update" + }, + { + "description": "Delete an existing domain", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/domains/{(%23%2Fdefinitions%2Fdomain%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/domain" + }, + "title": "Delete" + }, + { + "description": "Info for existing domain.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/domains/{(%23%2Fdefinitions%2Fdomain%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/domain" + }, + "title": "Info" + }, + { + "description": "List existing domains.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/domains", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/domain" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "acm_status": { + "$ref": "#/definitions/domain/definitions/acm_status" + }, + "acm_status_reason": { + "$ref": "#/definitions/domain/definitions/acm_status_reason" + }, + "app": { + "description": "app that owns the domain", + "properties": { + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "cname": { + "$ref": "#/definitions/domain/definitions/cname" + }, + "created_at": { + "$ref": "#/definitions/domain/definitions/created_at" + }, + "hostname": { + "$ref": "#/definitions/domain/definitions/hostname" + }, + "id": { + "$ref": "#/definitions/domain/definitions/id" + }, + "kind": { + "$ref": "#/definitions/domain/definitions/kind" + }, + "updated_at": { + "$ref": "#/definitions/domain/definitions/updated_at" + }, + "status": { + "$ref": "#/definitions/domain/definitions/status" + }, + "sni_endpoint": { + "description": "sni endpoint the domain is associated with", + "properties": { + "name": { + "$ref": "#/definitions/sni-endpoint/definitions/name" + }, + "id": { + "$ref": "#/definitions/sni-endpoint/definitions/id" + } + }, + "type": [ + "null", + "object" + ] + } + } + }, + "dyno-size": { + "description": "Dyno sizes are the values and details of sizes that can be assigned to dynos. This information can also be found at : [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types).", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Dyno Size", + "type": [ + "object" + ], + "definitions": { + "compute": { + "description": "minimum vCPUs, non-dedicated may get more depending on load", + "example": 1, + "readOnly": true, + "type": [ + "integer" + ] + }, + "dedicated": { + "description": "whether this dyno will be dedicated to one user", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "id": { + "description": "unique identifier of this dyno size", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/dyno-size/definitions/id" + }, + { + "$ref": "#/definitions/dyno-size/definitions/name" + } + ] + }, + "memory": { + "description": "amount of RAM in GB", + "example": 0.5, + "readOnly": true, + "type": [ + "number" + ] + }, + "name": { + "description": "the name of this dyno-size", + "example": "eco", + "readOnly": true, + "type": [ + "string" + ] + }, + "cost": { + "description": "price information for this dyno size", + "readOnly": true, + "type": [ + "null", + "object" + ], + "definitions": { + "cents": { + "description": "price in cents per unit time", + "example": 0, + "readOnly": true, + "type": [ + "integer" + ] + }, + "unit": { + "description": "unit of price for dyno", + "readOnly": true, + "example": "month", + "type": [ + "string" + ] + } + } + }, + "dyno_units": { + "deprecated": true, + "description": "deprecated. See precise_dyno_units instead", + "example": 0, + "readOnly": true, + "type": [ + "integer" + ] + }, + "precise_dyno_units": { + "description": "unit of consumption for Heroku Enterprise customers to 2 decimal places", + "example": 0.28, + "readOnly": true, + "type": [ + "number" + ] + }, + "private_space_only": { + "description": "whether this dyno can only be provisioned in a private space", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + } + }, + "links": [ + { + "description": "Info for existing dyno size.", + "href": "/dyno-sizes/{(%23%2Fdefinitions%2Fdyno-size%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/dyno-size" + }, + "title": "Info" + }, + { + "description": "List existing dyno sizes.", + "href": "/dyno-sizes", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/dyno-size" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "compute": { + "$ref": "#/definitions/dyno-size/definitions/compute" + }, + "cost": { + "$ref": "#/definitions/dyno-size/definitions/cost" + }, + "dedicated": { + "$ref": "#/definitions/dyno-size/definitions/dedicated" + }, + "dyno_units": { + "$ref": "#/definitions/dyno-size/definitions/dyno_units" + }, + "precise_dyno_units": { + "$ref": "#/definitions/dyno-size/definitions/precise_dyno_units" + }, + "id": { + "$ref": "#/definitions/dyno-size/definitions/id" + }, + "memory": { + "$ref": "#/definitions/dyno-size/definitions/memory" + }, + "name": { + "$ref": "#/definitions/dyno-size/definitions/name" + }, + "private_space_only": { + "$ref": "#/definitions/dyno-size/definitions/private_space_only" + } + } + }, + "dyno": { + "description": "Dynos encapsulate running processes of an app on Heroku. Detailed information about dyno sizes can be found at: [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types).", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Dyno", + "type": [ + "object" + ], + "definitions": { + "attach": { + "description": "whether to stream output or not", + "example": true, + "readOnly": false, + "type": [ + "boolean" + ] + }, + "attach_url": { + "description": "a URL to stream output from for attached processes or null for non-attached processes", + "example": "rendezvous://rendezvous.runtime.heroku.com:5000/{rendezvous-id}", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "command used to start this process", + "example": "bash", + "readOnly": false, + "type": [ + "string" + ] + }, + "created_at": { + "description": "when dyno was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "env": { + "additionalProperties": false, + "description": "custom environment to add to the dyno config vars", + "example": { + "COLUMNS": "80", + "LINES": "24" + }, + "patternProperties": { + "^\\w+$": { + "type": [ + "string" + ] + } + }, + "readOnly": false, + "strictProperties": true, + "type": [ + "object" + ] + }, + "id": { + "description": "unique identifier of this dyno", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/dyno/definitions/id" + }, + { + "$ref": "#/definitions/dyno/definitions/name" + } + ] + }, + "name": { + "description": "the name of this process on this dyno", + "example": "run.1", + "readOnly": true, + "type": [ + "string" + ] + }, + "force_no_tty": { + "description": "force an attached one-off dyno to not run in a tty", + "example": null, + "readOnly": false, + "type": [ + "boolean", + "null" + ] + }, + "size": { + "description": "dyno size", + "example": "standard-1X", + "readOnly": false, + "type": [ + "string" + ] + }, + "state": { + "description": "current status of process (either: crashed, down, idle, starting, or up)", + "example": "up", + "readOnly": true, + "type": [ + "string" + ] + }, + "type": { + "description": "type of process", + "example": "run", + "readOnly": false, + "type": [ + "string" + ] + }, + "time_to_live": { + "description": "seconds until dyno expires, after which it will soon be killed, max 86400 seconds (24 hours)", + "example": 1800, + "readOnly": false, + "type": [ + "integer" + ] + }, + "updated_at": { + "description": "when process last changed state", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Create a new dyno.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/dynos", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "attach": { + "$ref": "#/definitions/dyno/definitions/attach" + }, + "command": { + "$ref": "#/definitions/dyno/definitions/command" + }, + "env": { + "$ref": "#/definitions/dyno/definitions/env" + }, + "force_no_tty": { + "$ref": "#/definitions/dyno/definitions/force_no_tty" + }, + "size": { + "$ref": "#/definitions/dyno/definitions/size" + }, + "type": { + "$ref": "#/definitions/dyno/definitions/type" + }, + "time_to_live": { + "$ref": "#/definitions/dyno/definitions/time_to_live" + } + }, + "required": [ + "command" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/dyno" + }, + "title": "Create" + }, + { + "description": "Restart dyno.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/dynos/{(%23%2Fdefinitions%2Fdyno%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "empty", + "targetSchema": { + "additionalProperties": false, + "type": [ + "object" + ] + }, + "title": "Restart" + }, + { + "description": "Restart all dynos.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/dynos", + "method": "DELETE", + "rel": "empty", + "targetSchema": { + "additionalProperties": false, + "type": [ + "object" + ] + }, + "title": "Restart all" + }, + { + "description": "Stop dyno.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/dynos/{(%23%2Fdefinitions%2Fdyno%2Fdefinitions%2Fidentity)}/actions/stop", + "method": "POST", + "rel": "empty", + "targetSchema": { + "additionalProperties": false, + "type": [ + "object" + ] + }, + "title": "Stop" + }, + { + "description": "Info for existing dyno.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/dynos/{(%23%2Fdefinitions%2Fdyno%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/dyno" + }, + "title": "Info" + }, + { + "description": "List existing dynos.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/dynos", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/dyno" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "attach_url": { + "$ref": "#/definitions/dyno/definitions/attach_url" + }, + "command": { + "$ref": "#/definitions/dyno/definitions/command" + }, + "created_at": { + "$ref": "#/definitions/dyno/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/dyno/definitions/id" + }, + "name": { + "$ref": "#/definitions/dyno/definitions/name" + }, + "release": { + "description": "app release of the dyno", + "properties": { + "id": { + "$ref": "#/definitions/release/definitions/id" + }, + "version": { + "$ref": "#/definitions/release/definitions/version" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "app": { + "description": "app formation belongs to", + "properties": { + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "size": { + "$ref": "#/definitions/dyno/definitions/size" + }, + "state": { + "$ref": "#/definitions/dyno/definitions/state" + }, + "type": { + "$ref": "#/definitions/dyno/definitions/type" + }, + "updated_at": { + "$ref": "#/definitions/dyno/definitions/updated_at" + } + } + }, + "enterprise-account-daily-usage": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "Usage for an enterprise account at a daily resolution.", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Enterprise Account Daily Usage", + "type": [ + "object" + ], + "definitions": { + "addons": { + "description": "total add-on credits used", + "example": 250.0, + "readOnly": true, + "type": [ + "number" + ] + }, + "data": { + "description": "total add-on credits used for first party add-ons", + "example": 34.89, + "readOnly": true, + "type": [ + "number" + ] + }, + "date": { + "description": "date of the usage", + "example": "2019-01-01", + "format": "date", + "readOnly": true, + "type": [ + "string" + ] + }, + "dynos": { + "description": "dynos used", + "example": 1.548, + "readOnly": true, + "type": [ + "number" + ] + }, + "id": { + "description": "enterprise account identifier", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "name": { + "description": "name of the enterprise account", + "example": "example-co", + "readOnly": true, + "type": [ + "string" + ] + }, + "partner": { + "description": "total add-on credits used for third party add-ons", + "example": 12.34, + "readOnly": true, + "type": [ + "number" + ] + }, + "space": { + "description": "space credits used", + "example": 1.548, + "readOnly": true, + "type": [ + "number" + ] + }, + "start_date": { + "description": "range start date", + "example": "2019-01-25", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$", + "readOnly": true, + "type": [ + "string" + ] + }, + "end_date": { + "description": "range end date", + "example": "2019-02-25", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Retrieves usage for an enterprise account for a range of days. Start and end dates can be specified as query parameters using the date format YYYY-MM-DD. The enterprise account identifier can be found from the [enterprise account list](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-list).\n", + "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fid)}/usage/daily", + "method": "GET", + "rel": "instances", + "title": "Info", + "schema": { + "properties": { + "start": { + "$ref": "#/definitions/enterprise-account-daily-usage/definitions/start_date" + }, + "end": { + "$ref": "#/definitions/enterprise-account-daily-usage/definitions/end_date" + } + }, + "required": [ + "start" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "items": { + "$ref": "#/definitions/enterprise-account-daily-usage" + }, + "type": [ + "array" + ] + } + } + ], + "properties": { + "addons": { + "$ref": "#/definitions/enterprise-account-daily-usage/definitions/addons" + }, + "teams": { + "description": "usage by team", + "type": [ + "array" + ], + "items": { + "type": [ + "object" + ], + "properties": { + "addons": { + "$ref": "#/definitions/team-daily-usage/definitions/addons" + }, + "apps": { + "description": "app usage in the team", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/team-daily-usage/definitions/app_usage_daily" + } + }, + "data": { + "$ref": "#/definitions/team-daily-usage/definitions/data" + }, + "dynos": { + "$ref": "#/definitions/team-daily-usage/definitions/dynos" + }, + "id": { + "$ref": "#/definitions/team-daily-usage/definitions/id" + }, + "name": { + "$ref": "#/definitions/team-daily-usage/definitions/name" + }, + "partner": { + "$ref": "#/definitions/team-daily-usage/definitions/partner" + }, + "space": { + "$ref": "#/definitions/team-daily-usage/definitions/space" + } + } + } + }, + "data": { + "$ref": "#/definitions/enterprise-account-daily-usage/definitions/data" + }, + "date": { + "$ref": "#/definitions/enterprise-account-daily-usage/definitions/date" + }, + "dynos": { + "$ref": "#/definitions/enterprise-account-daily-usage/definitions/dynos" + }, + "id": { + "$ref": "#/definitions/enterprise-account-daily-usage/definitions/id" + }, + "name": { + "$ref": "#/definitions/enterprise-account-daily-usage/definitions/name" + }, + "partner": { + "$ref": "#/definitions/enterprise-account-daily-usage/definitions/partner" + }, + "space": { + "$ref": "#/definitions/enterprise-account-daily-usage/definitions/space" + } + } + }, + "enterprise-account-member": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "Enterprise account members are users with access to an enterprise account.", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Enterprise Account Member", + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "unique identifier of the member", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/enterprise-account-member/definitions/id" + } + ] + }, + "permission": { + "description": "permission in the enterprise account", + "enum": [ + "view", + "create", + "manage", + "billing" + ], + "example": "view", + "readOnly": true, + "type": [ + "string" + ] + }, + "permissions": { + "description": "permissions for enterprise account", + "example": [ + "view" + ], + "readOnly": true, + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/enterprise-account-member/definitions/permission" + } + }, + "expanded_permissions": { + "description": "enterprise account permissions", + "type": [ + "array" + ], + "items": { + "type": [ + "object" + ], + "properties": { + "description": { + "type": [ + "string" + ], + "example": "View enterprise account members and teams." + }, + "name": { + "$ref": "#/definitions/enterprise-account-member/definitions/permission", + "example": "view" + } + } + } + }, + "user_identity": { + "anyOf": [ + { + "$ref": "#/definitions/account/definitions/email" + }, + { + "$ref": "#/definitions/account/definitions/id" + } + ] + }, + "two_factor_authentication": { + "description": "whether the Enterprise Account member has two factor authentication enabled", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "identity_provider": { + "description": "Identity Provider information the member is federated with", + "properties": { + "id": { + "$ref": "#/definitions/identity-provider/definitions/id" + }, + "name": { + "description": "name of the identity provider", + "example": "acme", + "readOnly": true, + "type": [ + "string" + ] + }, + "redacted": { + "description": "whether the identity_provider information is redacted or not", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "owner": { + "$ref": "#/definitions/identity-provider/definitions/owner" + } + }, + "type": [ + "null", + "object" + ] + } + }, + "links": [ + { + "description": "List members in an enterprise account.", + "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fidentity)}/members", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/enterprise-account-member" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Create a member in an enterprise account.", + "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fidentity)}/members", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "user": { + "$ref": "#/definitions/enterprise-account-member/definitions/user_identity" + }, + "permissions": { + "$ref": "#/definitions/enterprise-account-member/definitions/permissions" + }, + "federated": { + "description": "whether membership is being created as part of SSO JIT", + "example": false, + "type": [ + "boolean" + ] + } + }, + "required": [ + "user", + "permissions" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/enterprise-account-member" + }, + "title": "Create" + }, + { + "description": "Update a member in an enterprise account.", + "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fidentity)}/members/{(%23%2Fdefinitions%2Fenterprise-account-member%2Fdefinitions%2Fuser_identity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "permissions": { + "$ref": "#/definitions/enterprise-account-member/definitions/permissions" + } + }, + "required": [ + "permissions" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/enterprise-account-member" + }, + "title": "Update" + }, + { + "description": "delete a member in an enterprise account.", + "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fidentity)}/members/{(%23%2Fdefinitions%2Fenterprise-account-member%2Fdefinitions%2Fuser_identity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/enterprise-account-member" + }, + "title": "Delete" + } + ], + "properties": { + "enterprise_account": { + "type": [ + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/enterprise-account/definitions/id" + }, + "name": { + "$ref": "#/definitions/enterprise-account/definitions/name" + } + } + }, + "id": { + "$ref": "#/definitions/enterprise-account-member/definitions/id" + }, + "permissions": { + "$ref": "#/definitions/enterprise-account-member/definitions/expanded_permissions" + }, + "user": { + "description": "user information for the membership", + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "two_factor_authentication": { + "$ref": "#/definitions/enterprise-account-member/definitions/two_factor_authentication" + }, + "identity_provider": { + "$ref": "#/definitions/enterprise-account-member/definitions/identity_provider" + } + } + }, + "enterprise-account-monthly-usage": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "Usage for an enterprise account at a monthly resolution.", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Enterprise Account Monthly Usage", + "type": [ + "object" + ], + "definitions": { + "addons": { + "description": "total add-on credits used", + "example": 250.0, + "readOnly": true, + "type": [ + "number" + ] + }, + "connect": { + "description": "average connect rows synced", + "example": 15000, + "readOnly": true, + "type": [ + "number" + ] + }, + "data": { + "description": "total add-on credits used for first party add-ons", + "example": 34.89, + "readOnly": true, + "type": [ + "number" + ] + }, + "dynos": { + "description": "dynos used", + "example": 1.548, + "readOnly": true, + "type": [ + "number" + ] + }, + "month": { + "description": "year and month of the usage", + "example": "2019-01", + "pattern": "^[0-9]{4}-[0-9]{2}$", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "enterprise account identifier", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "name": { + "description": "name of the enterprise account", + "example": "example-co", + "readOnly": true, + "type": [ + "string" + ] + }, + "partner": { + "description": "total add-on credits used for third party add-ons", + "example": 12.34, + "readOnly": true, + "type": [ + "number" + ] + }, + "space": { + "description": "space credits used", + "example": 1.548, + "readOnly": true, + "type": [ + "number" + ] + }, + "start_date": { + "description": "range start date", + "example": "2019-01", + "pattern": "^[0-9]{4}-[0-9]{2}$", + "readOnly": true, + "type": [ + "string" + ] + }, + "end_date": { + "description": "range end date", + "example": "2019-02", + "pattern": "^[0-9]{4}-[0-9]{2}$", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Retrieves usage for an enterprise account for a range of months. Start and end dates can be specified as query parameters using the date format YYYY-MM. If no end date is specified, one month of usage is returned. The enterprise account identifier can be found from the [enterprise account list](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-list).\n", + "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fid)}/usage/monthly", + "method": "GET", + "rel": "instances", + "title": "Info", + "schema": { + "properties": { + "start": { + "$ref": "#/definitions/enterprise-account-monthly-usage/definitions/start_date" + }, + "end": { + "$ref": "#/definitions/enterprise-account-monthly-usage/definitions/end_date" + } + }, + "required": [ + "start" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "items": { + "$ref": "#/definitions/enterprise-account-monthly-usage" + }, + "type": [ + "array" + ] + } + } + ], + "properties": { + "addons": { + "$ref": "#/definitions/enterprise-account-monthly-usage/definitions/addons" + }, + "teams": { + "description": "usage by team", + "type": [ + "array" + ], + "items": { + "type": [ + "object" + ], + "properties": { + "addons": { + "$ref": "#/definitions/team-monthly-usage/definitions/addons" + }, + "apps": { + "description": "app usage in the team", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/team-monthly-usage/definitions/app_usage_monthly" + } + }, + "connect": { + "$ref": "#/definitions/team-monthly-usage/definitions/connect" + }, + "data": { + "$ref": "#/definitions/team-monthly-usage/definitions/data" + }, + "dynos": { + "$ref": "#/definitions/team-monthly-usage/definitions/dynos" + }, + "id": { + "$ref": "#/definitions/team-monthly-usage/definitions/id" + }, + "name": { + "$ref": "#/definitions/team-monthly-usage/definitions/name" + }, + "partner": { + "$ref": "#/definitions/team-monthly-usage/definitions/partner" + }, + "space": { + "$ref": "#/definitions/team-monthly-usage/definitions/space" + } + } + } + }, + "connect": { + "$ref": "#/definitions/enterprise-account-monthly-usage/definitions/connect" + }, + "data": { + "$ref": "#/definitions/enterprise-account-monthly-usage/definitions/data" + }, + "dynos": { + "$ref": "#/definitions/enterprise-account-monthly-usage/definitions/dynos" + }, + "id": { + "$ref": "#/definitions/enterprise-account-monthly-usage/definitions/id" + }, + "month": { + "$ref": "#/definitions/enterprise-account-monthly-usage/definitions/month" + }, + "name": { + "$ref": "#/definitions/enterprise-account-monthly-usage/definitions/name" + }, + "partner": { + "$ref": "#/definitions/enterprise-account-monthly-usage/definitions/partner" + }, + "space": { + "$ref": "#/definitions/enterprise-account-monthly-usage/definitions/space" + } + } + }, + "enterprise-account": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "Enterprise accounts allow companies to manage their development teams and billing.", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Enterprise Account", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when the enterprise account was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of the enterprise account", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/enterprise-account/definitions/id" + }, + { + "$ref": "#/definitions/enterprise-account/definitions/name" + } + ] + }, + "identity_provider": { + "description": "Identity Provider associated with the Enterprise Account", + "strictProperties": true, + "type": [ + "null", + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/identity-provider/definitions/id" + }, + "name": { + "$ref": "#/definitions/identity-provider/definitions/name" + }, + "owner": { + "$ref": "#/definitions/identity-provider/definitions/owner" + } + } + }, + "name": { + "description": "unique name of the enterprise account", + "example": "example", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when the enterprise account was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "permissions": { + "description": "the current user's permissions for this enterprise account", + "readOnly": true, + "type": [ + "array" + ], + "items": { + "example": "view", + "type": [ + "string" + ] + } + }, + "trial": { + "description": "whether the enterprise account is a trial or not", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + } + }, + "links": [ + { + "description": "List enterprise accounts in which you are a member.", + "href": "/enterprise-accounts", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/enterprise-account" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Information about an enterprise account.", + "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/enterprise-account" + }, + "title": "Info" + }, + { + "description": "Update enterprise account properties", + "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/enterprise-account/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/enterprise-account" + }, + "title": "Update" + } + ], + "properties": { + "id": { + "$ref": "#/definitions/enterprise-account/definitions/id" + }, + "created_at": { + "$ref": "#/definitions/enterprise-account/definitions/created_at" + }, + "name": { + "$ref": "#/definitions/enterprise-account/definitions/name" + }, + "updated_at": { + "$ref": "#/definitions/enterprise-account/definitions/updated_at" + }, + "permissions": { + "$ref": "#/definitions/enterprise-account/definitions/permissions" + }, + "trial": { + "$ref": "#/definitions/enterprise-account/definitions/trial" + }, + "identity_provider": { + "$ref": "#/definitions/enterprise-account/definitions/identity_provider" + } + } + }, + "filter-apps": { + "description": "Filters are special endpoints to allow for API consumers to specify a subset of resources to consume in order to reduce the number of requests that are performed. Each filter endpoint endpoint is responsible for determining its supported request format. The endpoints are over POST in order to handle large request bodies without hitting request uri query length limitations, but the requests themselves are idempotent and will not have side effects.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "title": "Heroku Platform API - Filters", + "type": [ + "object" + ], + "definitions": { + "filter": { + "type": [ + "object" + ], + "properties": { + "in": { + "$ref": "#/definitions/filter-apps/definitions/in" + } + } + }, + "in": { + "type": [ + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/filter-apps/definitions/id" + } + } + }, + "id": { + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/app/definitions/id" + } + } + }, + "links": [ + { + "description": "Request an apps list filtered by app id.", + "title": "Apps", + "href": "/filters/apps", + "method": "POST", + "ranges": [ + "id", + "name", + "updated_at" + ], + "rel": "instances", + "schema": { + "$ref": "#/definitions/filter-apps/definitions/filter" + }, + "targetSchema": { + "items": { + "$ref": "#/definitions/team-app" + }, + "type": [ + "array" + ] + } + } + ] + }, + "formation": { + "description": "The formation of processes that should be maintained for an app. Update the formation to scale processes or change dyno sizes. Available process type names and commands are defined by the `process_types` attribute for the [slug](#slug) currently released on an app.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Formation", + "type": [ + "object" + ], + "definitions": { + "command": { + "description": "command to use to launch this process", + "example": "bundle exec rails server -p $PORT", + "readOnly": false, + "type": [ + "string" + ] + }, + "created_at": { + "description": "when process type was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of this process type", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/formation/definitions/id" + }, + { + "$ref": "#/definitions/formation/definitions/type" + } + ] + }, + "quantity": { + "description": "number of processes to maintain", + "example": 1, + "readOnly": false, + "type": [ + "integer" + ] + }, + "size": { + "description": "dyno size", + "example": "standard-1X", + "readOnly": false, + "type": [ + "string" + ] + }, + "type": { + "description": "type of process to maintain", + "example": "web", + "readOnly": true, + "pattern": "^[-\\w]{1,128}$", + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when dyno type was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "update": { + "additionalProperties": false, + "description": "Properties to update a process type", + "properties": { + "quantity": { + "$ref": "#/definitions/formation/definitions/quantity" + }, + "size": { + "$ref": "#/definitions/formation/definitions/size" + }, + "type": { + "$ref": "#/definitions/formation/definitions/type" + } + }, + "readOnly": false, + "required": [ + "type" + ], + "type": [ + "object" + ] + } + }, + "links": [ + { + "description": "Info for a process type", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/formation/{(%23%2Fdefinitions%2Fformation%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/formation" + }, + "title": "Info" + }, + { + "description": "List process type formation", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/formation", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/formation" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Batch update process types", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/formation", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "updates": { + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/formation/definitions/update" + }, + "description": "Array with formation updates. Each element must have \"type\", the id or name of the process type to be updated, and can optionally update its \"quantity\" or \"size\"." + } + }, + "required": [ + "updates" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "items": { + "$ref": "#/definitions/formation" + }, + "type": [ + "array" + ] + }, + "title": "Batch Update" + }, + { + "description": "Update process type", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/formation/{(%23%2Fdefinitions%2Fformation%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "quantity": { + "$ref": "#/definitions/formation/definitions/quantity" + }, + "size": { + "$ref": "#/definitions/formation/definitions/size" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/formation" + }, + "title": "Update", + "type": [ + "object" + ] + } + ], + "properties": { + "app": { + "description": "app formation belongs to", + "properties": { + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "command": { + "$ref": "#/definitions/formation/definitions/command" + }, + "created_at": { + "$ref": "#/definitions/formation/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/formation/definitions/id" + }, + "quantity": { + "$ref": "#/definitions/formation/definitions/quantity" + }, + "size": { + "$ref": "#/definitions/formation/definitions/size" + }, + "type": { + "$ref": "#/definitions/formation/definitions/type" + }, + "updated_at": { + "$ref": "#/definitions/formation/definitions/updated_at" + } + } + }, + "identity-provider": { + "description": "Identity Providers represent the SAML configuration of teams or an Enterprise account", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Identity Provider", + "type": [ + "object" + ], + "definitions": { + "certificate": { + "description": "raw contents of the public certificate (eg: .crt or .pem file)", + "example": "-----BEGIN CERTIFICATE----- ...", + "readOnly": false, + "type": [ + "string" + ] + }, + "created_at": { + "description": "when provider record was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "entity_id": { + "description": "URL identifier provided by the identity provider", + "example": "https://customer-domain.idp.com", + "readOnly": false, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of this identity provider", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "name": { + "description": "user-friendly unique identifier for this identity provider", + "example": "acme-sso", + "type": [ + "string" + ] + }, + "slo_target_url": { + "description": "single log out URL for this identity provider", + "example": "https://example.com/idp/logout", + "readOnly": false, + "type": [ + "string" + ] + }, + "sso_target_url": { + "description": "single sign on URL for this identity provider", + "example": "https://example.com/idp/login", + "readOnly": false, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when the identity provider record was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "owner": { + "description": "entity that owns this identity provider", + "properties": { + "id": { + "description": "unique identifier of the owner", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "name": { + "description": "name of the owner", + "example": "acme", + "readOnly": true, + "type": [ + "string" + ] + }, + "type": { + "description": "type of the owner", + "enum": [ + "team", + "enterprise-account" + ], + "example": "team", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "readOnly": false, + "required": [ + "id", + "type" + ], + "type": [ + "object" + ] + } + }, + "links": [ + { + "description": "Get a list of a team's Identity Providers", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fname)}/identity-providers", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/identity-provider" + }, + "type": [ + "array" + ] + }, + "title": "List By Team" + }, + { + "description": "Create an Identity Provider for a team", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fname)}/identity-providers", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "certificate": { + "$ref": "#/definitions/identity-provider/definitions/certificate" + }, + "entity_id": { + "$ref": "#/definitions/identity-provider/definitions/entity_id" + }, + "slo_target_url": { + "$ref": "#/definitions/identity-provider/definitions/slo_target_url" + }, + "sso_target_url": { + "$ref": "#/definitions/identity-provider/definitions/sso_target_url" + } + }, + "required": [ + "certificate", + "sso_target_url", + "entity_id" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/identity-provider" + }, + "title": "Create By Team" + }, + { + "description": "Update a team's Identity Provider", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fname)}/identity-providers/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fid)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "certificate": { + "$ref": "#/definitions/identity-provider/definitions/certificate" + }, + "entity_id": { + "$ref": "#/definitions/identity-provider/definitions/entity_id" + }, + "slo_target_url": { + "$ref": "#/definitions/identity-provider/definitions/slo_target_url" + }, + "sso_target_url": { + "$ref": "#/definitions/identity-provider/definitions/sso_target_url" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/identity-provider" + }, + "title": "Update By Team" + }, + { + "description": "Delete a team's Identity Provider", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fname)}/identity-providers/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fid)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/identity-provider" + }, + "title": "Delete By Team" + } + ], + "properties": { + "certificate": { + "$ref": "#/definitions/identity-provider/definitions/certificate" + }, + "created_at": { + "$ref": "#/definitions/identity-provider/definitions/created_at" + }, + "entity_id": { + "$ref": "#/definitions/identity-provider/definitions/entity_id" + }, + "id": { + "$ref": "#/definitions/identity-provider/definitions/id" + }, + "slo_target_url": { + "$ref": "#/definitions/identity-provider/definitions/slo_target_url" + }, + "sso_target_url": { + "$ref": "#/definitions/identity-provider/definitions/sso_target_url" + }, + "organization": { + "description": "team associated with this identity provider", + "properties": { + "name": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "type": [ + "null", + "object" + ] + }, + "updated_at": { + "$ref": "#/definitions/identity-provider/definitions/updated_at" + }, + "owner": { + "$ref": "#/definitions/identity-provider/definitions/owner" + } + } + }, + "inbound-ruleset": { + "description": "An inbound-ruleset is a collection of rules that specify what hosts can or cannot connect to an application.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Inbound Ruleset", + "type": [ + "object" + ], + "definitions": { + "action": { + "description": "states whether the connection is allowed or denied", + "example": "allow", + "readOnly": false, + "type": [ + "string" + ], + "enum": [ + "allow", + "deny" + ] + }, + "source": { + "description": "is the request’s source in CIDR notation", + "example": "1.1.1.1/1", + "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/([0-9]|[1-2][0-9]|3[0-2]))$", + "readOnly": false, + "type": [ + "string" + ] + }, + "created_at": { + "description": "when inbound-ruleset was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of an inbound-ruleset", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/inbound-ruleset/definitions/id" + } + ] + }, + "rule": { + "description": "the combination of an IP address in CIDR notation and whether to allow or deny it's traffic.", + "type": [ + "object" + ], + "properties": { + "action": { + "$ref": "#/definitions/inbound-ruleset/definitions/action" + }, + "source": { + "$ref": "#/definitions/inbound-ruleset/definitions/source" + } + }, + "required": [ + "source", + "action" + ] + } + }, + "links": [ + { + "description": "Current inbound ruleset for a space", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/inbound-ruleset", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/inbound-ruleset" + }, + "title": "Current" + }, + { + "description": "Info on an existing Inbound Ruleset", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/inbound-rulesets/{(%23%2Fdefinitions%2Finbound-ruleset%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/inbound-ruleset" + }, + "title": "Info" + }, + { + "description": "List all inbound rulesets for a space", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/inbound-rulesets", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/inbound-ruleset" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Create a new inbound ruleset", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/inbound-ruleset", + "method": "PUT", + "rel": "create", + "targetSchema": { + "$ref": "#/definitions/inbound-ruleset" + }, + "schema": { + "type": [ + "object" + ], + "properties": { + "rules": { + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/inbound-ruleset/definitions/rule" + } + } + } + }, + "title": "Create" + } + ], + "properties": { + "id": { + "$ref": "#/definitions/inbound-ruleset/definitions/id" + }, + "space": { + "description": "identity of space", + "properties": { + "id": { + "$ref": "#/definitions/space/definitions/id" + }, + "name": { + "$ref": "#/definitions/space/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/inbound-ruleset/definitions/created_at" + }, + "rules": { + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/inbound-ruleset/definitions/rule" + } + }, + "created_by": { + "$ref": "#/definitions/account/definitions/email" + } + } + }, + "invoice-address": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "An invoice address represents the address that should be listed on an invoice.", + "title": "Heroku Vault API - Invoice Address", + "stability": "development", + "type": [ + "object" + ], + "definitions": { + "address_1": { + "type": [ + "string" + ], + "description": "invoice street address line 1", + "example": "40 Hickory Blvd." + }, + "address_2": { + "type": [ + "string" + ], + "description": "invoice street address line 2", + "example": "Suite 300" + }, + "city": { + "type": [ + "string" + ], + "description": "invoice city", + "example": "Seattle" + }, + "country": { + "type": [ + "string" + ], + "description": "country", + "example": "US" + }, + "heroku_id": { + "type": [ + "string" + ], + "description": "heroku_id identifier reference", + "example": "user930223902@heroku.com", + "readOnly": true + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/invoice-address/definitions/heroku_id" + } + ] + }, + "other": { + "type": [ + "string" + ], + "description": "metadata / additional information to go on invoice", + "example": "Company ABC Inc. VAT 903820" + }, + "postal_code": { + "type": [ + "string" + ], + "description": "invoice zip code", + "example": "98101" + }, + "state": { + "type": [ + "string" + ], + "description": "invoice state", + "example": "WA" + }, + "use_invoice_address": { + "type": [ + "boolean" + ], + "description": "flag to use the invoice address for an account or not", + "example": true, + "default": false + } + }, + "links": [ + { + "description": "Retrieve existing invoice address.", + "href": "/account/invoice-address", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/invoice-address" + }, + "title": "info" + }, + { + "description": "Update invoice address for an account.", + "href": "/account/invoice-address", + "method": "PUT", + "rel": "self", + "title": "update", + "schema": { + "properties": { + "address_1": { + "$ref": "#/definitions/invoice-address/definitions/address_1" + }, + "address_2": { + "$ref": "#/definitions/invoice-address/definitions/address_2" + }, + "city": { + "$ref": "#/definitions/invoice-address/definitions/city" + }, + "country": { + "$ref": "#/definitions/invoice-address/definitions/country" + }, + "other": { + "$ref": "#/definitions/invoice-address/definitions/other" + }, + "postal_code": { + "$ref": "#/definitions/invoice-address/definitions/postal_code" + }, + "state": { + "$ref": "#/definitions/invoice-address/definitions/state" + }, + "use_invoice_address": { + "$ref": "#/definitions/invoice-address/definitions/use_invoice_address" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/invoice-address" + } + } + ], + "properties": { + "address_1": { + "$ref": "#/definitions/invoice-address/definitions/address_1" + }, + "address_2": { + "$ref": "#/definitions/invoice-address/definitions/address_2" + }, + "city": { + "$ref": "#/definitions/invoice-address/definitions/city" + }, + "country": { + "$ref": "#/definitions/invoice-address/definitions/country" + }, + "heroku_id": { + "$ref": "#/definitions/invoice-address/definitions/identity" + }, + "other": { + "$ref": "#/definitions/invoice-address/definitions/other" + }, + "postal_code": { + "$ref": "#/definitions/invoice-address/definitions/postal_code" + }, + "state": { + "$ref": "#/definitions/invoice-address/definitions/state" + }, + "use_invoice_address": { + "$ref": "#/definitions/invoice-address/definitions/use_invoice_address" + } + } + }, + "invoice": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "An invoice is an itemized bill of goods for an account which includes pricing and charges.", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Invoice", + "type": [ + "object" + ], + "definitions": { + "charges_total": { + "description": "total charges on this invoice", + "example": 100.0, + "readOnly": true, + "type": [ + "number" + ] + }, + "created_at": { + "description": "when invoice was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "credits_total": { + "description": "total credits on this invoice", + "example": 100.0, + "readOnly": true, + "type": [ + "number" + ] + }, + "id": { + "description": "unique identifier of this invoice", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/invoice/definitions/number" + } + ] + }, + "number": { + "description": "human readable invoice number", + "example": 9403943, + "readOnly": true, + "type": [ + "integer" + ] + }, + "period_end": { + "description": "the ending date that the invoice covers", + "example": "01/31/2014", + "readOnly": true, + "type": [ + "string" + ] + }, + "period_start": { + "description": "the starting date that this invoice covers", + "example": "01/01/2014", + "readOnly": true, + "type": [ + "string" + ] + }, + "state": { + "description": "payment status for this invoice (pending, successful, failed)", + "example": 1, + "readOnly": true, + "type": [ + "integer" + ] + }, + "total": { + "description": "combined total of charges and credits on this invoice", + "example": 100.0, + "readOnly": true, + "type": [ + "number" + ] + }, + "updated_at": { + "description": "when invoice was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Info for existing invoice.", + "href": "/account/invoices/{(%23%2Fdefinitions%2Finvoice%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/invoice" + }, + "title": "Info" + }, + { + "description": "List existing invoices.", + "href": "/account/invoices", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/invoice" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "charges_total": { + "$ref": "#/definitions/invoice/definitions/charges_total" + }, + "created_at": { + "$ref": "#/definitions/invoice/definitions/created_at" + }, + "credits_total": { + "$ref": "#/definitions/invoice/definitions/credits_total" + }, + "id": { + "$ref": "#/definitions/invoice/definitions/id" + }, + "number": { + "$ref": "#/definitions/invoice/definitions/number" + }, + "period_end": { + "$ref": "#/definitions/invoice/definitions/period_end" + }, + "period_start": { + "$ref": "#/definitions/invoice/definitions/period_start" + }, + "state": { + "$ref": "#/definitions/invoice/definitions/state" + }, + "total": { + "$ref": "#/definitions/invoice/definitions/total" + }, + "updated_at": { + "$ref": "#/definitions/invoice/definitions/updated_at" + } + } + }, + "key": { + "description": "Keys represent public SSH keys associated with an account and are used to authorize accounts as they are performing git operations.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Key", + "type": [ + "object" + ], + "definitions": { + "comment": { + "description": "comment on the key", + "example": "username@host", + "readOnly": true, + "type": [ + "string" + ] + }, + "created_at": { + "description": "when key was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "email": { + "deprecated": true, + "description": "deprecated. Please refer to 'comment' instead", + "example": "username@host", + "readOnly": true, + "type": [ + "string" + ] + }, + "fingerprint": { + "description": "a unique identifying string based on contents", + "example": "17:63:a4:ba:24:d3:7f:af:17:c8:94:82:7e:80:56:bf", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of this key", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/key/definitions/id" + }, + { + "$ref": "#/definitions/key/definitions/fingerprint" + } + ] + }, + "public_key": { + "description": "full public_key as uploaded", + "example": "ssh-rsa AAAAB3NzaC1ycVc/../839Uv username@example.com", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when key was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Info for existing key.", + "href": "/account/keys/{(%23%2Fdefinitions%2Fkey%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/key" + }, + "title": "Info" + }, + { + "description": "List existing keys.", + "href": "/account/keys", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/key" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "comment": { + "$ref": "#/definitions/key/definitions/comment" + }, + "created_at": { + "$ref": "#/definitions/key/definitions/created_at" + }, + "email": { + "$ref": "#/definitions/key/definitions/email" + }, + "fingerprint": { + "$ref": "#/definitions/key/definitions/fingerprint" + }, + "id": { + "$ref": "#/definitions/key/definitions/id" + }, + "public_key": { + "$ref": "#/definitions/key/definitions/public_key" + }, + "updated_at": { + "$ref": "#/definitions/key/definitions/updated_at" + } + } + }, + "log-drain": { + "description": "[Log drains](https://devcenter.heroku.com/articles/log-drains) provide a way to forward your Heroku logs to an external syslog server for long-term archiving. This external service must be configured to receive syslog packets from Heroku, whereupon its URL can be added to an app using this API. Some add-ons will add a log drain when they are provisioned to an app. These drains can only be removed by removing the add-on.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Log Drain", + "type": [ + "object" + ], + "definitions": { + "addon": { + "description": "add-on that created the drain", + "example": { + "id": "01234567-89ab-cdef-0123-456789abcdef", + "name": "singing-swiftly-1242", + "app": { + "id": "01234567-89ab-cdef-0123-456789abcdef", + "name": "example" + } + }, + "properties": { + "id": { + "$ref": "#/definitions/add-on/definitions/id" + }, + "name": { + "$ref": "#/definitions/add-on/definitions/name" + }, + "app": { + "description": "billing application associated with this add-on", + "type": [ + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + } + }, + "strictProperties": true + } + }, + "readOnly": true, + "type": [ + "object", + "null" + ] + }, + "app": { + "description": "application that is attached to this drain", + "example": { + "id": "01234567-89ab-cdef-0123-456789abcdef", + "name": "example" + }, + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + } + }, + "strictProperties": true, + "readOnly": true, + "type": [ + "object", + "null" + ] + }, + "created_at": { + "description": "when log drain was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of this log drain", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "query_identity": { + "anyOf": [ + { + "$ref": "#/definitions/log-drain/definitions/id" + }, + { + "$ref": "#/definitions/log-drain/definitions/url" + }, + { + "$ref": "#/definitions/log-drain/definitions/token" + } + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/log-drain/definitions/url" + } + ] + }, + "token": { + "description": "token associated with the log drain", + "example": "d.01234567-89ab-cdef-0123-456789abcdef", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when log drain was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "url": { + "description": "url associated with the log drain", + "example": "https://example.com/drain", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Create a new log drain.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/log-drains", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "url": { + "$ref": "#/definitions/log-drain/definitions/url" + } + }, + "required": [ + "url" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/log-drain" + }, + "title": "Create" + }, + { + "description": "Update an add-on owned log drain.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/log-drains/{(%23%2Fdefinitions%2Flog-drain%2Fdefinitions%2Fquery_identity)}", + "method": "PUT", + "rel": "update", + "schema": { + "properties": { + "url": { + "$ref": "#/definitions/log-drain/definitions/url" + } + }, + "required": [ + "url" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/log-drain" + }, + "title": "Update" + }, + { + "description": "Delete an existing log drain. Log drains added by add-ons can only be removed by removing the add-on.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/log-drains/{(%23%2Fdefinitions%2Flog-drain%2Fdefinitions%2Fquery_identity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/log-drain" + }, + "title": "Delete" + }, + { + "description": "Info for existing log drain.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/log-drains/{(%23%2Fdefinitions%2Flog-drain%2Fdefinitions%2Fquery_identity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/log-drain" + }, + "title": "Info" + }, + { + "description": "List existing log drains for an add-on.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/log-drains", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/log-drain" + }, + "type": [ + "array" + ] + }, + "title": "List By Add-on" + }, + { + "description": "List existing log drains.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/log-drains", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/log-drain" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "addon": { + "$ref": "#/definitions/log-drain/definitions/addon" + }, + "app": { + "$ref": "#/definitions/log-drain/definitions/app" + }, + "created_at": { + "$ref": "#/definitions/log-drain/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/log-drain/definitions/id" + }, + "token": { + "$ref": "#/definitions/log-drain/definitions/token" + }, + "updated_at": { + "$ref": "#/definitions/log-drain/definitions/updated_at" + }, + "url": { + "$ref": "#/definitions/log-drain/definitions/url" + } + } + }, + "log-session": { + "description": "A log session is a reference to the http based log stream for an app.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Log Session", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when log connection was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "dyno": { + "description": "dyno to limit results to", + "example": "web.1", + "readOnly": false, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of this log session", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/log-session/definitions/id" + } + ] + }, + "lines": { + "description": "number of log lines to stream at once", + "example": 10, + "readOnly": false, + "type": [ + "integer" + ] + }, + "logplex_url": { + "description": "URL for log streaming session", + "example": "https://logplex.heroku.com/sessions/01234567-89ab-cdef-0123-456789abcdef?srv=1325419200", + "readOnly": true, + "type": [ + "string" + ] + }, + "source": { + "description": "log source to limit results to", + "example": "app", + "readOnly": false, + "type": [ + "string" + ] + }, + "tail": { + "description": "whether to stream ongoing logs", + "example": true, + "readOnly": false, + "type": [ + "boolean" + ] + }, + "updated_at": { + "description": "when log session was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Create a new log session.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/log-sessions", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "dyno": { + "$ref": "#/definitions/log-session/definitions/dyno" + }, + "lines": { + "$ref": "#/definitions/log-session/definitions/lines" + }, + "source": { + "$ref": "#/definitions/log-session/definitions/source" + }, + "tail": { + "$ref": "#/definitions/log-session/definitions/tail" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/log-session" + }, + "title": "Create" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/log-session/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/log-session/definitions/id" + }, + "logplex_url": { + "$ref": "#/definitions/log-session/definitions/logplex_url" + }, + "updated_at": { + "$ref": "#/definitions/log-session/definitions/updated_at" + } + } + }, + "oauth-authorization": { + "description": "OAuth authorizations represent clients that a Heroku user has authorized to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth)", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - OAuth Authorization", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when OAuth authorization was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "description": { + "description": "human-friendly description of this OAuth authorization", + "example": "sample authorization", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of OAuth authorization", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/oauth-authorization/definitions/id" + } + ] + }, + "scope": { + "description": "The scope of access OAuth authorization allows", + "example": [ + "global" + ], + "readOnly": true, + "type": [ + "array" + ], + "items": { + "type": [ + "string" + ] + } + }, + "updated_at": { + "description": "when OAuth authorization was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Create a new OAuth authorization.", + "href": "/oauth/authorizations", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "client": { + "$ref": "#/definitions/oauth-client/definitions/identity" + }, + "description": { + "$ref": "#/definitions/oauth-authorization/definitions/description" + }, + "expires_in": { + "$ref": "#/definitions/oauth-token/definitions/expires_in" + }, + "scope": { + "$ref": "#/definitions/oauth-authorization/definitions/scope" + } + }, + "required": [ + "scope" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/oauth-authorization" + }, + "title": "Create" + }, + { + "description": "Delete OAuth authorization.", + "href": "/oauth/authorizations/{(%23%2Fdefinitions%2Foauth-authorization%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/oauth-authorization" + }, + "title": "Delete" + }, + { + "description": "Info for an OAuth authorization.", + "href": "/oauth/authorizations/{(%23%2Fdefinitions%2Foauth-authorization%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/oauth-authorization" + }, + "title": "Info" + }, + { + "description": "List OAuth authorizations.", + "href": "/oauth/authorizations", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/oauth-authorization" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Regenerate OAuth tokens. This endpoint is only available to direct authorizations or privileged OAuth clients.", + "href": "/oauth/authorizations/{(%23%2Fdefinitions%2Foauth-authorization%2Fdefinitions%2Fidentity)}/actions/regenerate-tokens", + "method": "POST", + "rel": "update", + "targetSchema": { + "$ref": "#/definitions/oauth-authorization" + }, + "title": "Regenerate" + } + ], + "properties": { + "access_token": { + "description": "access token for this authorization", + "properties": { + "expires_in": { + "$ref": "#/definitions/oauth-token/definitions/expires_in" + }, + "id": { + "$ref": "#/definitions/oauth-token/definitions/id" + }, + "token": { + "$ref": "#/definitions/oauth-token/definitions/token" + } + }, + "type": [ + "null", + "object" + ] + }, + "client": { + "description": "identifier of the client that obtained this authorization, if any", + "properties": { + "id": { + "$ref": "#/definitions/oauth-client/definitions/id" + }, + "name": { + "$ref": "#/definitions/oauth-client/definitions/name" + }, + "redirect_uri": { + "$ref": "#/definitions/oauth-client/definitions/redirect_uri" + } + }, + "type": [ + "null", + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/oauth-authorization/definitions/created_at" + }, + "grant": { + "description": "this authorization's grant", + "properties": { + "code": { + "$ref": "#/definitions/oauth-grant/definitions/code" + }, + "expires_in": { + "$ref": "#/definitions/oauth-grant/definitions/expires_in" + }, + "id": { + "$ref": "#/definitions/oauth-grant/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "null", + "object" + ] + }, + "id": { + "$ref": "#/definitions/oauth-authorization/definitions/id" + }, + "refresh_token": { + "description": "refresh token for this authorization", + "properties": { + "expires_in": { + "$ref": "#/definitions/oauth-token/definitions/expires_in" + }, + "id": { + "$ref": "#/definitions/oauth-token/definitions/id" + }, + "token": { + "$ref": "#/definitions/oauth-token/definitions/token" + } + }, + "strictProperties": true, + "type": [ + "null", + "object" + ] + }, + "scope": { + "$ref": "#/definitions/oauth-authorization/definitions/scope" + }, + "updated_at": { + "$ref": "#/definitions/oauth-authorization/definitions/updated_at" + }, + "user": { + "description": "authenticated user associated with this authorization", + "properties": { + "id": { + "$ref": "#/definitions/account/definitions/id" + }, + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "full_name": { + "$ref": "#/definitions/account/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + } + }, + "oauth-client": { + "description": "OAuth clients are applications that Heroku users can authorize to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth).", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - OAuth Client", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when OAuth client was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of this OAuth client", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/oauth-client/definitions/id" + } + ] + }, + "ignores_delinquent": { + "description": "whether the client is still operable given a delinquent account", + "example": false, + "readOnly": true, + "type": [ + "boolean", + "null" + ] + }, + "name": { + "description": "OAuth client name", + "example": "example", + "readOnly": true, + "type": [ + "string" + ] + }, + "redirect_uri": { + "description": "endpoint for redirection after authorization with OAuth client", + "example": "https://example.com/auth/heroku/callback", + "readOnly": true, + "type": [ + "string" + ] + }, + "secret": { + "description": "secret used to obtain OAuth authorizations under this client", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when OAuth client was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Create a new OAuth client.", + "href": "/oauth/clients", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/oauth-client/definitions/name" + }, + "redirect_uri": { + "$ref": "#/definitions/oauth-client/definitions/redirect_uri" + } + }, + "required": [ + "name", + "redirect_uri" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/oauth-client" + }, + "title": "Create" + }, + { + "description": "Delete OAuth client.", + "href": "/oauth/clients/{(%23%2Fdefinitions%2Foauth-client%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/oauth-client" + }, + "title": "Delete" + }, + { + "description": "Info for an OAuth client. The output for unauthenticated requests excludes the `secret` parameter.", + "href": "/oauth/clients/{(%23%2Fdefinitions%2Foauth-client%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "title": "Info" + }, + { + "description": "List OAuth clients", + "href": "/oauth/clients", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/oauth-client" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Update OAuth client", + "href": "/oauth/clients/{(%23%2Fdefinitions%2Foauth-client%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/oauth-client/definitions/name" + }, + "redirect_uri": { + "$ref": "#/definitions/oauth-client/definitions/redirect_uri" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/oauth-client" + }, + "title": "Update" + }, + { + "description": "Rotate credentials for an OAuth client", + "href": "/oauth/clients/{(%23%2Fdefinitions%2Foauth-client%2Fdefinitions%2Fidentity)}/actions/rotate-credentials", + "method": "POST", + "rel": "update", + "targetSchema": { + "$ref": "#/definitions/oauth-client" + }, + "title": "Rotate Credentials" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/oauth-client/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/oauth-client/definitions/id" + }, + "ignores_delinquent": { + "$ref": "#/definitions/oauth-client/definitions/ignores_delinquent" + }, + "name": { + "$ref": "#/definitions/oauth-client/definitions/name" + }, + "redirect_uri": { + "$ref": "#/definitions/oauth-client/definitions/redirect_uri" + }, + "secret": { + "$ref": "#/definitions/oauth-client/definitions/secret" + }, + "updated_at": { + "$ref": "#/definitions/oauth-client/definitions/updated_at" + } + } + }, + "oauth-grant": { + "description": "OAuth grants are used to obtain authorizations on behalf of a user. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth)", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - OAuth Grant", + "type": [ + "object" + ], + "definitions": { + "code": { + "description": "grant code received from OAuth web application authorization", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "readOnly": true, + "type": [ + "string" + ] + }, + "expires_in": { + "description": "seconds until OAuth grant expires", + "example": 2592000, + "readOnly": true, + "type": [ + "integer" + ] + }, + "id": { + "description": "unique identifier of OAuth grant", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/oauth-grant/definitions/id" + } + ] + }, + "type": { + "description": "type of grant requested, one of `authorization_code` or `refresh_token`", + "example": "authorization_code", + "readOnly": false, + "type": [ + "string" + ] + } + }, + "links": [ + ], + "properties": { + } + }, + "oauth-token": { + "description": "OAuth tokens provide access for authorized clients to act on behalf of a Heroku user to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth)", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - OAuth Token", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when OAuth token was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "expires_in": { + "description": "seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime", + "example": 2592000, + "readOnly": true, + "type": [ + "null", + "integer" + ] + }, + "id": { + "description": "unique identifier of OAuth token", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/oauth-token/definitions/id" + } + ] + }, + "token": { + "description": "contents of the token to be used for authorization", + "example": "HRKU-01234567-89ab-cdef-0123-456789abcdef", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when OAuth token was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Create a new OAuth token.", + "href": "/oauth/tokens", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "client": { + "type": [ + "object" + ], + "properties": { + "secret": { + "$ref": "#/definitions/oauth-client/definitions/secret" + } + } + }, + "grant": { + "type": [ + "object" + ], + "properties": { + "code": { + "$ref": "#/definitions/oauth-grant/definitions/code" + }, + "type": { + "$ref": "#/definitions/oauth-grant/definitions/type" + } + } + }, + "refresh_token": { + "type": [ + "object" + ], + "properties": { + "token": { + "$ref": "#/definitions/oauth-token/definitions/token" + } + } + } + }, + "required": [ + "grant", + "client", + "refresh_token" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/oauth-token" + }, + "title": "Create" + }, + { + "description": "Revoke OAuth access token.", + "href": "/oauth/tokens/{(%23%2Fdefinitions%2Foauth-token%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/oauth-token" + }, + "title": "Delete" + } + ], + "properties": { + "access_token": { + "description": "current access token", + "properties": { + "expires_in": { + "$ref": "#/definitions/oauth-token/definitions/expires_in" + }, + "id": { + "$ref": "#/definitions/oauth-token/definitions/id" + }, + "token": { + "$ref": "#/definitions/oauth-token/definitions/token" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "authorization": { + "description": "authorization for this set of tokens", + "properties": { + "id": { + "$ref": "#/definitions/oauth-authorization/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "client": { + "description": "OAuth client secret used to obtain token", + "properties": { + "secret": { + "$ref": "#/definitions/oauth-client/definitions/secret" + } + }, + "strictProperties": true, + "type": [ + "null", + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/oauth-token/definitions/created_at" + }, + "grant": { + "description": "grant used on the underlying authorization", + "properties": { + "code": { + "$ref": "#/definitions/oauth-grant/definitions/code" + }, + "type": { + "$ref": "#/definitions/oauth-grant/definitions/type" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "id": { + "$ref": "#/definitions/oauth-token/definitions/id" + }, + "refresh_token": { + "description": "refresh token for this authorization", + "properties": { + "expires_in": { + "$ref": "#/definitions/oauth-token/definitions/expires_in" + }, + "id": { + "$ref": "#/definitions/oauth-token/definitions/id" + }, + "token": { + "$ref": "#/definitions/oauth-token/definitions/token" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "session": { + "description": "OAuth session using this token", + "properties": { + "id": { + "$ref": "#/definitions/oauth-token/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "updated_at": { + "$ref": "#/definitions/oauth-token/definitions/updated_at" + }, + "user": { + "description": "Reference to the user associated with this token", + "properties": { + "id": { + "$ref": "#/definitions/account/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + } + }, + "password-reset": { + "description": "A password reset represents a in-process password reset attempt.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - PasswordReset", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when password reset was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/account/definitions/email" + } + ] + }, + "password_confirmation": { + "description": "confirmation of the new password", + "example": "newpassword", + "readOnly": true, + "type": [ + "string" + ] + }, + "reset_password_token": { + "description": "unique identifier of a password reset attempt", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Reset account's password. This will send a reset password link to the user's email address.", + "href": "/password-resets", + "method": "POST", + "rel": "self", + "schema": { + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + } + }, + "required": [ + "email" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/password-reset" + }, + "title": "Reset Password" + }, + { + "description": "Complete password reset.", + "href": "/password-resets/{(%23%2Fdefinitions%2Fpassword-reset%2Fdefinitions%2Freset_password_token)}/actions/finalize", + "method": "POST", + "rel": "self", + "schema": { + "properties": { + "password": { + "$ref": "#/definitions/account/definitions/password" + }, + "password_confirmation": { + "$ref": "#/definitions/password-reset/definitions/password_confirmation" + } + }, + "required": [ + "password", + "password_confirmation" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/password-reset" + }, + "title": "Complete Reset Password" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/password-reset/definitions/created_at" + }, + "user": { + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + } + }, + "peering-info": { + "description": "[Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Peering Info", + "type": [ + "object" + ], + "properties": { + "aws_account_id": { + "$ref": "#/definitions/peering/definitions/aws_account_id" + }, + "aws_region": { + "$ref": "#/definitions/region/definitions/provider/properties/region" + }, + "vpc_id": { + "$ref": "#/definitions/peering/definitions/vpc_id" + }, + "vpc_cidr": { + "description": "The CIDR range of the Private Space VPC", + "$ref": "#/definitions/peering/definitions/cidr" + }, + "dyno_cidr_blocks": { + "description": "The CIDR ranges that should be routed to the Private Space VPC.", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/peering/definitions/cidr" + } + }, + "unavailable_cidr_blocks": { + "description": "The CIDR ranges that you must not conflict with.", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/peering/definitions/cidr" + } + }, + "space_cidr_blocks": { + "description": "The CIDR ranges that should be routed to the Private Space VPC.", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/peering/definitions/cidr" + } + } + }, + "links": [ + { + "description": "Provides the necessary information to establish an AWS VPC Peering with your private space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/peering-info", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/peering-info" + }, + "title": "Info" + } + ] + }, + "peering": { + "description": "[Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Peering", + "type": [ + "object" + ], + "definitions": { + "aws_account_id": { + "description": "The AWS account ID of your Private Space.", + "example": "123456789012", + "readOnly": true, + "type": [ + "string" + ] + }, + "aws_region": { + "description": "The AWS region of the peer connection.", + "example": "us-east-1", + "readOnly": true, + "type": [ + "string" + ] + }, + "vpc_id": { + "description": "The AWS VPC ID of the peer.", + "example": "vpc-1234567890", + "readOnly": true, + "type": [ + "string" + ] + }, + "type": { + "description": "The type of peering connection.", + "example": "heroku-managed", + "type": [ + "string" + ], + "enum": [ + "heroku-managed", + "customer-managed", + "unknown" + ] + }, + "status": { + "description": "The status of the peering connection.", + "example": "pending-acceptance", + "enum": [ + "initiating-request", + "pending-acceptance", + "provisioning", + "active", + "failed", + "expired", + "rejected", + "deleted" + ], + "type": [ + "string" + ], + "readOnly": true + }, + "pcx_id": { + "description": "The AWS VPC Peering Connection ID of the peering.", + "example": "pcx-123456789012", + "readOnly": true, + "type": [ + "string" + ] + }, + "cidr": { + "description": "An IP address and the number of significant bits that make up the routing or networking portion.", + "example": "10.0.0.0/16", + "type": [ + "string" + ] + }, + "expires": { + "description": "When a peering connection will expire.", + "example": "2020-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "properties": { + "type": { + "$ref": "#/definitions/peering/definitions/type" + }, + "pcx_id": { + "$ref": "#/definitions/peering/definitions/pcx_id" + }, + "cidr_blocks": { + "description": "The CIDR blocks of the peer.", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/peering/definitions/cidr" + } + }, + "status": { + "$ref": "#/definitions/peering/definitions/status" + }, + "aws_vpc_id": { + "$ref": "#/definitions/peering/definitions/vpc_id" + }, + "aws_region": { + "$ref": "#/definitions/peering/definitions/aws_region" + }, + "aws_account_id": { + "$ref": "#/definitions/peering/definitions/aws_account_id" + }, + "expires": { + "$ref": "#/definitions/peering/definitions/expires" + } + }, + "links": [ + { + "description": "List peering connections of a private space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/peerings", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/peering" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Accept a pending peering connection with a private space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/peerings/{(%23%2Fdefinitions%2Fpeering%2Fdefinitions%2Fpcx_id)}/actions/accept", + "method": "POST", + "rel": "empty", + "title": "Accept", + "targetSchema": { + "$ref": "#/definitions/peering" + } + }, + { + "description": "Destroy an active peering connection with a private space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/peerings/{(%23%2Fdefinitions%2Fpeering%2Fdefinitions%2Fpcx_id)}", + "rel": "empty", + "method": "DELETE", + "title": "Destroy", + "targetSchema": { + "$ref": "#/definitions/peering" + } + }, + { + "description": "Fetch information for existing peering connection", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/peerings/{(%23%2Fdefinitions%2Fpeering%2Fdefinitions%2Fpcx_id)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/peering" + }, + "title": "Info" + } + ] + }, + "permission-entity": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "An owned entity including users' permissions.", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Permission Entity", + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "ID of the entity.", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "type": { + "description": "The type of object the entity is referring to.", + "example": "app", + "readOnly": true, + "type": [ + "string" + ], + "enum": [ + "app", + "space" + ] + }, + "name": { + "description": "Name of the entity.", + "example": "polar-lake-12345", + "readOnly": true, + "type": [ + "string" + ] + }, + "permissions": { + "description": "A list of permissions the user has on the entity.", + "example": "app", + "readOnly": true, + "type": [ + "array" + ] + } + }, + "links": [ + { + "description": "List permission entities for a team.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/permissions", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/permission-entity" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "id": { + "$ref": "#/definitions/permission-entity/definitions/id" + }, + "name": { + "$ref": "#/definitions/permission-entity/definitions/name" + }, + "team_id": { + "$ref": "#/definitions/team/definitions/id" + }, + "type": { + "$ref": "#/definitions/permission-entity/definitions/type" + }, + "users": { + "description": "Users that have access to the entity.", + "items": { + "type": [ + "object" + ], + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + }, + "permissions": { + "description": "enterprise account permissions", + "type": [ + "array" + ], + "items": { + "type": [ + "string" + ] + } + } + } + }, + "type": [ + "array" + ] + } + } + }, + "pipeline-build": { + "description": "Information about latest builds of apps in a pipeline.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Pipeline Build", + "type": [ + "object" + ], + "definitions": { + }, + "links": [ + { + "description": "List latest builds for each app in a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/latest-builds", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/build" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ] + }, + "pipeline-config-var": { + "description": "Pipeline Config Vars allow you to manage the configuration information provided to a pipeline.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Pipeline Config Vars", + "type": [ + "object" + ], + "definitions": { + "config_vars": { + "additionalProperties": false, + "description": "hash of config vars", + "example": { + "FOO": "bar", + "BAZ": "qux" + }, + "patternProperties": { + "^[\\w\\.\\:\\[\\]]+$": { + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object" + ] + } + }, + "links": [ + { + "description": "Get config-vars for a pipeline stage.", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/stage/{(%23%2Fdefinitions%2Fpipeline-coupling%2Fdefinitions%2Fstage)}/config-vars", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/pipeline-config-var/definitions/config_vars" + }, + "title": "Info for App" + }, + { + "description": "Update config-vars for a pipeline stage. You can update existing config-vars by setting them again, and remove by setting it to `null`.", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/stage/{(%23%2Fdefinitions%2Fpipeline-coupling%2Fdefinitions%2Fstage)}/config-vars", + "method": "PATCH", + "rel": "update", + "schema": { + "additionalProperties": false, + "description": "hash of config changes – update values or delete by seting it to `null`", + "example": { + "FOO": "bar", + "BAZ": "qux" + }, + "patternProperties": { + "^[\\w\\.\\:\\[\\]]+$": { + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/pipeline-config-var/definitions/config_vars" + }, + "title": "Update" + } + ], + "example": { + "FOO": "bar", + "BAZ": "qux" + }, + "patternProperties": { + "^\\w+$": { + "type": [ + "string" + ] + } + } + }, + "pipeline-coupling": { + "description": "Information about an app's coupling to a pipeline", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "title": "Heroku Platform API - Pipeline Coupling", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when pipeline coupling was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of pipeline coupling", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/pipeline-coupling/definitions/id" + } + ] + }, + "stage": { + "description": "target pipeline stage", + "example": "production", + "enum": [ + "test", + "review", + "development", + "staging", + "production" + ], + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when pipeline coupling was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "List couplings for a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/pipeline-couplings", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/pipeline-coupling" + }, + "type": [ + "array" + ] + }, + "title": "List By Pipeline" + }, + { + "description": "List pipeline couplings for the current user.", + "href": "/users/~/pipeline-couplings", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/pipeline-coupling" + }, + "type": [ + "array" + ] + }, + "title": "List By Current User" + }, + { + "description": "List pipeline couplings.", + "href": "/pipeline-couplings", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/pipeline-coupling" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "List pipeline couplings for a team.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/pipeline-couplings", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/pipeline-coupling" + }, + "type": [ + "array" + ] + }, + "title": "List By Team" + }, + { + "description": "Create a new pipeline coupling.", + "href": "/pipeline-couplings", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "app": { + "$ref": "#/definitions/app/definitions/identity" + }, + "pipeline": { + "$ref": "#/definitions/pipeline/definitions/id" + }, + "stage": { + "$ref": "#/definitions/pipeline-coupling/definitions/stage" + } + }, + "required": [ + "app", + "pipeline", + "stage" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/pipeline-coupling" + }, + "title": "Create" + }, + { + "description": "Info for an existing pipeline coupling.", + "href": "/pipeline-couplings/{(%23%2Fdefinitions%2Fpipeline-coupling%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/pipeline-coupling" + }, + "title": "Info" + }, + { + "description": "Delete an existing pipeline coupling.", + "href": "/pipeline-couplings/{(%23%2Fdefinitions%2Fpipeline-coupling%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "delete", + "targetSchema": { + "$ref": "#/definitions/pipeline-coupling" + }, + "title": "Delete" + }, + { + "description": "Update an existing pipeline coupling.", + "href": "/pipeline-couplings/{(%23%2Fdefinitions%2Fpipeline-coupling%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "stage": { + "$ref": "#/definitions/pipeline-coupling/definitions/stage" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/pipeline-coupling" + }, + "title": "Update" + }, + { + "description": "Info for an existing pipeline coupling.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/pipeline-couplings", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/pipeline-coupling" + }, + "title": "Info By App" + } + ], + "properties": { + "app": { + "description": "app involved in the pipeline coupling", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/pipeline-coupling/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/pipeline-coupling/definitions/id" + }, + "pipeline": { + "description": "pipeline involved in the coupling", + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "stage": { + "$ref": "#/definitions/pipeline-coupling/definitions/stage" + }, + "updated_at": { + "$ref": "#/definitions/pipeline-coupling/definitions/updated_at" + } + } + }, + "pipeline-deployment": { + "description": "Information about latest deployments of apps in a pipeline.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Pipeline Deployment", + "type": [ + "object" + ], + "definitions": { + }, + "links": [ + { + "description": "List latest slug releases for each app in a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/latest-deployments", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/release" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ] + }, + "pipeline-promotion-target": { + "description": "Promotion targets represent an individual app being promoted to", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Pipeline Promotion Target", + "type": [ + "object" + ], + "definitions": { + "error_message": { + "description": "an error message for why the promotion failed", + "example": "User does not have access to that app", + "type": [ + "null", + "string" + ] + }, + "id": { + "description": "unique identifier of promotion target", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "readOnly": true, + "format": "uuid", + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/pipeline-promotion-target/definitions/id" + } + ] + }, + "status": { + "description": "status of promotion", + "example": "pending", + "readOnly": true, + "enum": [ + "pending", + "succeeded", + "failed" + ], + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "List promotion targets belonging to an existing promotion.", + "href": "/pipeline-promotions/{(%23%2Fdefinitions%2Fpipeline-promotion%2Fdefinitions%2Fid)}/promotion-targets", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/pipeline-promotion-target" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "app": { + "description": "the app which was promoted to", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "error_message": { + "$ref": "#/definitions/pipeline-promotion-target/definitions/error_message" + }, + "id": { + "$ref": "#/definitions/pipeline-promotion-target/definitions/id" + }, + "pipeline_promotion": { + "description": "the promotion which the target belongs to", + "properties": { + "id": { + "$ref": "#/definitions/pipeline-promotion/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "release": { + "description": "the release which was created on the target app", + "properties": { + "id": { + "$ref": "#/definitions/release/definitions/id" + } + }, + "type": [ + "object", + "null" + ] + }, + "status": { + "$ref": "#/definitions/pipeline-promotion-target/definitions/status" + } + } + }, + "pipeline-promotion": { + "description": "Promotions allow you to move code from an app in a pipeline to all targets", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Pipeline Promotion", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when promotion was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of promotion", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "readOnly": true, + "format": "uuid", + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/pipeline-promotion/definitions/id" + } + ] + }, + "status": { + "description": "status of promotion", + "example": "pending", + "readOnly": true, + "enum": [ + "pending", + "completed" + ], + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when promotion was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "type": [ + "string", + "null" + ] + } + }, + "links": [ + { + "description": "Create a new promotion.", + "href": "/pipeline-promotions", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "pipeline": { + "description": "pipeline involved in the promotion", + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/id" + } + }, + "required": [ + "id" + ], + "type": [ + "object" + ] + }, + "source": { + "description": "the app being promoted from", + "properties": { + "app": { + "description": "the app which was promoted from", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + }, + "type": [ + "object" + ] + }, + "targets": { + "items": { + "properties": { + "app": { + "description": "the app is being promoted to", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + }, + "type": [ + "object" + ] + }, + "type": [ + "array" + ] + } + }, + "required": [ + "pipeline", + "source", + "targets" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/pipeline-promotion" + }, + "title": "Create" + }, + { + "description": "Info for existing pipeline promotion.", + "href": "/pipeline-promotions/{(%23%2Fdefinitions%2Fpipeline-promotion%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/pipeline-promotion" + }, + "title": "Info" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/pipeline-promotion/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/pipeline-promotion/definitions/id" + }, + "pipeline": { + "description": "the pipeline which the promotion belongs to", + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "source": { + "description": "the app being promoted from", + "properties": { + "app": { + "description": "the app which was promoted from", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "release": { + "description": "the release used to promoted from", + "properties": { + "id": { + "$ref": "#/definitions/release/definitions/id" + } + }, + "type": [ + "object" + ] + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "status": { + "$ref": "#/definitions/pipeline-promotion/definitions/status" + }, + "updated_at": { + "$ref": "#/definitions/pipeline-promotion/definitions/updated_at" + } + } + }, + "pipeline-release": { + "description": "Information about latest releases of apps in a pipeline.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Pipeline Release", + "type": [ + "object" + ], + "definitions": { + }, + "links": [ + { + "description": "List latest releases for each app in a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/latest-releases", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/release" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ] + }, + "pipeline-stack": { + "description": "A pipeline's stack is determined by the apps in the pipeline. This is used during creation of CI and Review Apps that have no stack defined in app.json", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": false, + "title": "Heroku Platform API - Pipeline Stack", + "type": [ + "object" + ], + "links": [ + { + "description": "The stack for a given pipeline, used for CI and Review Apps that have no stack defined in app.json.", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/pipeline-stack", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/pipeline-stack" + }, + "title": "Default Stack" + } + ], + "properties": { + "stack": { + "description": "identity of the stack that will be used for new builds without a stack defined in CI and Review Apps", + "properties": { + "id": { + "$ref": "#/definitions/stack/definitions/id" + }, + "name": { + "$ref": "#/definitions/stack/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object", + "null" + ] + } + } + }, + "pipeline-transfer": { + "description": "A pipeline transfer is the process of changing pipeline ownership along with the contained apps.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": false, + "title": "Heroku Platform API - Pipeline Transfer", + "type": [ + "object" + ], + "definitions": { + "new_owner": { + "description": "New owner of the pipeline.", + "$ref": "#/definitions/pipeline/definitions/owner", + "type": [ + "object" + ] + }, + "previous_owner": { + "description": "Previous owner of the pipeline.", + "$ref": "#/definitions/pipeline/definitions/owner", + "type": [ + "object" + ] + } + }, + "links": [ + { + "description": "Create a new pipeline transfer.", + "href": "/pipeline-transfers", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "pipeline": { + "description": "The pipeline to transfer", + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "new_owner": { + "description": "New pipeline owner", + "properties": { + "id": { + "description": "unique identifier of a pipeline owner", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "type": [ + "string" + ] + }, + "type": { + "description": "type of pipeline owner", + "example": "team", + "pattern": "(^team$|^user$)", + "type": [ + "string" + ] + } + }, + "type": [ + "object" + ] + } + }, + "required": [ + "pipeline", + "new_owner" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/pipeline-transfer" + }, + "title": "Create" + } + ], + "properties": { + "pipeline": { + "description": "pipeline being transferred", + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "previous_owner": { + "$ref": "#/definitions/pipeline-transfer/definitions/previous_owner" + }, + "new_owner": { + "$ref": "#/definitions/pipeline-transfer/definitions/new_owner" + } + } + }, + "pipeline": { + "description": "A pipeline allows grouping of apps into different stages.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": false, + "title": "Heroku Platform API - Pipeline", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when pipeline was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of pipeline", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/pipeline/definitions/id" + }, + { + "$ref": "#/definitions/pipeline/definitions/name" + } + ] + }, + "name": { + "description": "name of pipeline", + "example": "example", + "pattern": "^[a-z][a-z0-9-]{2,29}$", + "readOnly": false, + "type": [ + "string" + ] + }, + "owner": { + "description": "Owner of a pipeline.", + "definitions": { + "id": { + "description": "unique identifier of a pipeline owner", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": false, + "type": [ + "string" + ] + }, + "type": { + "description": "type of pipeline owner", + "example": "team", + "pattern": "(^team$|^user$)", + "readOnly": false, + "type": [ + "string" + ] + } + }, + "links": [ + ], + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/owner/definitions/id" + }, + "type": { + "$ref": "#/definitions/pipeline/definitions/owner/definitions/type" + } + }, + "required": [ + "id", + "type" + ], + "type": [ + "object", + "null" + ] + }, + "updated_at": { + "description": "when pipeline was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Create a new pipeline.", + "href": "/pipelines", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/pipeline/definitions/name" + }, + "owner": { + "description": "Pipeline owner", + "$ref": "#/definitions/pipeline/definitions/owner", + "type": [ + "object", + "null" + ] + } + }, + "required": [ + "name" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/pipeline" + }, + "title": "Create" + }, + { + "description": "Info for existing pipeline.", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/pipeline" + }, + "title": "Info" + }, + { + "description": "Delete an existing pipeline.", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}", + "method": "DELETE", + "rel": "delete", + "targetSchema": { + "$ref": "#/definitions/pipeline" + }, + "title": "Delete" + }, + { + "description": "Update an existing pipeline.", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/pipeline/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/pipeline" + }, + "title": "Update" + }, + { + "description": "List existing pipelines.", + "href": "/pipelines", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/pipeline" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/pipeline/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/pipeline/definitions/id" + }, + "name": { + "$ref": "#/definitions/pipeline/definitions/name" + }, + "owner": { + "$ref": "#/definitions/pipeline/definitions/owner" + }, + "updated_at": { + "$ref": "#/definitions/pipeline/definitions/updated_at" + } + } + }, + "plan": { + "description": "Plans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Plan", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when plan was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "compliance": { + "description": "the compliance regimes applied to an add-on plan", + "example": [ + "HIPAA" + ], + "readOnly": false, + "type": [ + "null", + "array" + ], + "items": { + "$ref": "#/definitions/plan/definitions/regime" + } + }, + "default": { + "description": "whether this plan is the default for its add-on service", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "description": { + "description": "description of plan", + "example": "Heroku Postgres Dev", + "readOnly": true, + "type": [ + "string" + ] + }, + "human_name": { + "description": "human readable name of the add-on plan", + "example": "Dev", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of this plan", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "installable_inside_private_network": { + "description": "whether this plan is installable to a Private Spaces app", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "installable_outside_private_network": { + "description": "whether this plan is installable to a Common Runtime app", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/plan/definitions/id" + }, + { + "$ref": "#/definitions/plan/definitions/name" + } + ] + }, + "name": { + "description": "unique name of this plan", + "example": "heroku-postgresql:dev", + "readOnly": true, + "type": [ + "string" + ] + }, + "regime": { + "description": "compliance requirements an add-on plan must adhere to", + "readOnly": true, + "example": "HIPAA", + "type": [ + "string" + ], + "enum": [ + "HIPAA", + "PCI" + ] + }, + "cents": { + "description": "price in cents per unit of plan", + "example": 0, + "readOnly": true, + "type": [ + "integer" + ] + }, + "contract": { + "description": "price is negotiated in a contract outside of monthly add-on billing", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "unit": { + "description": "unit of price for plan", + "example": "month", + "readOnly": true, + "type": [ + "string" + ] + }, + "space_default": { + "description": "whether this plan is the default for apps in Private Spaces", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "state": { + "description": "release status for plan", + "example": "public", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when plan was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "visible": { + "description": "whether this plan is publicly visible", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + } + }, + "links": [ + { + "description": "Info for existing plan.", + "href": "/plans/{(%23%2Fdefinitions%2Fplan%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/plan" + }, + "title": "Info" + }, + { + "description": "Info for existing plan by Add-on.", + "href": "/addon-services/{(%23%2Fdefinitions%2Fadd-on-service%2Fdefinitions%2Fidentity)}/plans/{(%23%2Fdefinitions%2Fplan%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/plan" + }, + "title": "Info By Add-on" + }, + { + "description": "List existing plans by Add-on.", + "href": "/addon-services/{(%23%2Fdefinitions%2Fadd-on-service%2Fdefinitions%2Fidentity)}/plans", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/plan" + }, + "type": [ + "array" + ] + }, + "title": "List By Add-on" + } + ], + "properties": { + "addon_service": { + "description": "identity of add-on service", + "properties": { + "id": { + "$ref": "#/definitions/add-on-service/definitions/id" + }, + "name": { + "$ref": "#/definitions/add-on-service/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/plan/definitions/created_at" + }, + "compliance": { + "$ref": "#/definitions/plan/definitions/compliance" + }, + "default": { + "$ref": "#/definitions/plan/definitions/default" + }, + "description": { + "$ref": "#/definitions/plan/definitions/description" + }, + "human_name": { + "$ref": "#/definitions/plan/definitions/human_name" + }, + "id": { + "$ref": "#/definitions/plan/definitions/id" + }, + "installable_inside_private_network": { + "$ref": "#/definitions/plan/definitions/installable_inside_private_network" + }, + "installable_outside_private_network": { + "$ref": "#/definitions/plan/definitions/installable_outside_private_network" + }, + "name": { + "$ref": "#/definitions/plan/definitions/name" + }, + "price": { + "description": "price", + "properties": { + "cents": { + "$ref": "#/definitions/plan/definitions/cents" + }, + "contract": { + "$ref": "#/definitions/plan/definitions/contract" + }, + "unit": { + "$ref": "#/definitions/plan/definitions/unit" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "space_default": { + "$ref": "#/definitions/plan/definitions/space_default" + }, + "state": { + "$ref": "#/definitions/plan/definitions/state" + }, + "updated_at": { + "$ref": "#/definitions/plan/definitions/updated_at" + }, + "visible": { + "$ref": "#/definitions/plan/definitions/visible" + } + } + }, + "rate-limit": { + "description": "Rate Limit represents the number of request tokens each account holds. Requests to this endpoint do not count towards the rate limit.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Rate Limit", + "type": [ + "object" + ], + "definitions": { + "identity": { + }, + "remaining": { + "description": "allowed requests remaining in current interval", + "example": 2399, + "readOnly": true, + "type": [ + "integer" + ] + } + }, + "links": [ + { + "description": "Info for rate limits.", + "href": "/account/rate-limits", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/rate-limit" + }, + "title": "Info" + } + ], + "properties": { + "remaining": { + "$ref": "#/definitions/rate-limit/definitions/remaining" + } + } + }, + "region": { + "description": "A region represents a geographic location in which your application may run.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Region", + "type": [ + "object" + ], + "definitions": { + "country": { + "description": "country where the region exists", + "example": "United States", + "readOnly": true, + "type": [ + "string" + ] + }, + "created_at": { + "description": "when region was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "description": { + "description": "description of region", + "example": "United States", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of region", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/region/definitions/id" + }, + { + "$ref": "#/definitions/region/definitions/name" + } + ] + }, + "locale": { + "description": "area in the country where the region exists", + "example": "Virginia", + "readOnly": true, + "type": [ + "string" + ] + }, + "name": { + "description": "unique name of region", + "example": "us", + "readOnly": true, + "type": [ + "string" + ] + }, + "private_capable": { + "description": "whether or not region is available for creating a Private Space", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "provider": { + "description": "provider of underlying substrate", + "type": [ + "object" + ], + "properties": { + "name": { + "description": "name of provider", + "example": "amazon-web-services", + "readOnly": true, + "type": [ + "string" + ] + }, + "region": { + "description": "region name used by provider", + "example": "us-east-1", + "readOnly": true, + "type": [ + "string" + ], + "enum": [ + "ap-south-1", + "eu-west-1", + "ap-southeast-1", + "ap-southeast-2", + "eu-central-1", + "eu-west-2", + "ap-northeast-2", + "ap-northeast-1", + "us-east-1", + "sa-east-1", + "us-west-1", + "us-west-2", + "ca-central-1" + ] + } + }, + "readOnly": true + }, + "updated_at": { + "description": "when region was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Info for existing region.", + "href": "/regions/{(%23%2Fdefinitions%2Fregion%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/region" + }, + "title": "Info" + }, + { + "description": "List existing regions.", + "href": "/regions", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/region" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "country": { + "$ref": "#/definitions/region/definitions/country" + }, + "created_at": { + "$ref": "#/definitions/region/definitions/created_at" + }, + "description": { + "$ref": "#/definitions/region/definitions/description" + }, + "id": { + "$ref": "#/definitions/region/definitions/id" + }, + "locale": { + "$ref": "#/definitions/region/definitions/locale" + }, + "name": { + "$ref": "#/definitions/region/definitions/name" + }, + "private_capable": { + "$ref": "#/definitions/region/definitions/private_capable" + }, + "provider": { + "$ref": "#/definitions/region/definitions/provider" + }, + "updated_at": { + "$ref": "#/definitions/region/definitions/updated_at" + } + } + }, + "release": { + "description": "A release represents a combination of code, config vars and add-ons for an app on Heroku.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Release", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when release was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "description": { + "description": "description of changes in this release", + "example": "Added new feature", + "readOnly": true, + "type": [ + "string" + ] + }, + "status": { + "description": "current status of the release", + "enum": [ + "failed", + "pending", + "succeeded" + ], + "example": "succeeded", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of release", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/release/definitions/id" + }, + { + "$ref": "#/definitions/release/definitions/version" + } + ] + }, + "updated_at": { + "description": "when release was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "version": { + "description": "unique version assigned to the release", + "example": 11, + "readOnly": true, + "type": [ + "integer" + ] + }, + "current": { + "description": "indicates this release as being the current one for the app", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "output_stream_url": { + "description": "Release command output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`).", + "example": "https://release-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef", + "readOnly": true, + "type": [ + "string", + "null" + ] + } + }, + "links": [ + { + "description": "Info for existing release.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/releases/{(%23%2Fdefinitions%2Frelease%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/release" + }, + "title": "Info" + }, + { + "description": "List existing releases.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/releases", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/release" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Create new release.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/releases", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "description": { + "$ref": "#/definitions/release/definitions/description" + }, + "slug": { + "$ref": "#/definitions/slug/definitions/identity" + } + }, + "required": [ + "slug" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/release" + }, + "title": "Create" + }, + { + "description": "Rollback to an existing release.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/releases", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "release": { + "$ref": "#/definitions/release/definitions/id" + } + }, + "required": [ + "release" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/release" + }, + "title": "Rollback" + } + ], + "properties": { + "addon_plan_names": { + "description": "add-on plans installed on the app for this release", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/plan/definitions/name" + } + }, + "app": { + "description": "app involved in the release", + "properties": { + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/release/definitions/created_at" + }, + "description": { + "$ref": "#/definitions/release/definitions/description" + }, + "id": { + "$ref": "#/definitions/release/definitions/id" + }, + "updated_at": { + "$ref": "#/definitions/release/definitions/updated_at" + }, + "slug": { + "description": "slug running in this release", + "properties": { + "id": { + "$ref": "#/definitions/slug/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object", + "null" + ] + }, + "status": { + "$ref": "#/definitions/release/definitions/status" + }, + "user": { + "description": "user that created the release", + "properties": { + "id": { + "$ref": "#/definitions/account/definitions/id" + }, + "email": { + "$ref": "#/definitions/account/definitions/email" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "version": { + "$ref": "#/definitions/release/definitions/version" + }, + "current": { + "$ref": "#/definitions/release/definitions/current" + }, + "output_stream_url": { + "$ref": "#/definitions/release/definitions/output_stream_url" + } + } + }, + "review-app": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Review App", + "description": "An ephemeral app to review a set of changes", + "stability": "production", + "strictProperties": true, + "type": [ + "object" + ], + "definitions": { + "app_setup": { + "readOnly": true, + "type": [ + "null", + "object" + ] + }, + "branch": { + "description": "the branch of the repository which the review app is based on", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of the review app", + "readOnly": true, + "format": "uuid", + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/review-app/definitions/id" + } + ] + }, + "creator": { + "description": "The user who created the review app", + "readOnly": true, + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "unique identifier of a review app owner", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": false, + "type": [ + "string" + ] + } + } + }, + "created_at": { + "description": "when test run was created", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "source_blob": { + "description": "The download location for the review app's source code", + "properties": { + "url": { + "description": "URL where gzipped tar archive of source code for build was downloaded.", + "example": "https://example.com/source.tgz?token=xyz", + "readOnly": true, + "type": [ + "string" + ] + }, + "version": { + "description": "The version number (or SHA) of the code to build.", + "example": "v1.2.0", + "type": [ + "string", + "null" + ] + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "status": { + "description": "current state of the review app", + "enum": [ + "pending", + "creating", + "created", + "deleting", + "deleted", + "errored" + ], + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when review app was updated", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "wait_for_ci": { + "description": "wait for ci before building the app", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "error_status": { + "description": "error message from creating the review app if any", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "message": { + "description": "message from creating the review app if any", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "config_vars": { + "additionalProperties": false, + "description": "hash of config vars", + "example": { + "FOO": "bar", + "BAZ": "qux" + }, + "patternProperties": { + "^[\\w\\.\\:\\[\\]]+$": { + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object", + "null" + ] + }, + "fork_repo_id": { + "description": "repository id of the fork the branch resides in", + "example": "123456", + "readOnly": true, + "type": [ + "integer", + "null" + ] + }, + "pr_number": { + "description": "pull request number the review app is built for", + "example": 24, + "readOnly": true, + "type": [ + "integer", + "null" + ] + } + }, + "links": [ + { + "description": "Create a new review app", + "href": "/review-apps", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "branch": { + "$ref": "#/definitions/review-app/definitions/branch" + }, + "pr_number": { + "$ref": "#/definitions/review-app/definitions/pr_number" + }, + "pipeline": { + "$ref": "#/definitions/pipeline/definitions/id" + }, + "source_blob": { + "$ref": "#/definitions/review-app/definitions/source_blob" + }, + "environment": { + "$ref": "#/definitions/review-app/definitions/config_vars", + "description": "A set of key value pairs which will be put into the environment of the spawned review app process." + }, + "fork_repo_id": { + "$ref": "#/definitions/review-app/definitions/fork_repo_id" + } + }, + "required": [ + "branch", + "pipeline", + "source_blob" + ], + "type": [ + "object" + ] + }, + "title": "Create", + "targetSchema": { + "$ref": "#/definitions/review-app" + } + }, + { + "description": "Gets an existing review app", + "href": "/review-apps/{(%23%2Fdefinitions%2Freview-app%2Fdefinitions%2Fid)}", + "method": "GET", + "targetSchema": { + "$ref": "#/definitions/review-app" + }, + "title": "Get review app" + }, + { + "description": "Delete an existing review app", + "href": "/review-apps/{(%23%2Fdefinitions%2Freview-app%2Fdefinitions%2Fid)}", + "method": "DELETE", + "rel": "delete", + "targetSchema": { + "$ref": "#/definitions/review-app" + }, + "title": "Delete" + }, + { + "description": "Get a review app using the associated app_id", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/review-app", + "method": "GET", + "title": "Get review app by app_id", + "targetSchema": { + "$ref": "#/definitions/review-app" + } + }, + { + "description": "List review apps for a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/review-apps", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/review-app" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "app": { + "description": "the Heroku app associated to this review app", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "type": [ + "null", + "object" + ] + }, + "app_setup": { + "description": "the app setup for this review app", + "properties": { + "id": { + "$ref": "#/definitions/app-setup/definitions/id" + } + }, + "type": [ + "null", + "object" + ] + }, + "branch": { + "$ref": "#/definitions/review-app/definitions/branch" + }, + "created_at": { + "$ref": "#/definitions/review-app/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/review-app/definitions/id" + }, + "pipeline": { + "description": "the pipeline which this review app belongs to", + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "status": { + "$ref": "#/definitions/review-app/definitions/status" + }, + "updated_at": { + "$ref": "#/definitions/review-app/definitions/updated_at" + }, + "creator": { + "$ref": "#/definitions/review-app/definitions/creator" + }, + "wait_for_ci": { + "$ref": "#/definitions/review-app/definitions/wait_for_ci" + }, + "error_status": { + "$ref": "#/definitions/review-app/definitions/error_status" + }, + "message": { + "$ref": "#/definitions/review-app/definitions/message" + }, + "fork_repo": { + "properties": { + "id": { + "$ref": "#/definitions/review-app/definitions/fork_repo_id" + } + }, + "strictProperties": true, + "type": [ + "object", + "null" + ] + }, + "pr_number": { + "$ref": "#/definitions/review-app/definitions/pr_number" + } + } + }, + "review-app-config": { + "description": "Review apps can be configured for pipelines.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": false, + "title": "Heroku Platform API - Review App Configuration", + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "unique identifier of pipeline", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "repo": { + "description": "repository name", + "example": "heroku/homebrew-brew", + "readOnly": true, + "type": [ + "string" + ] + }, + "automatic_review_apps": { + "description": "enable automatic review apps for pull requests", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "repo_id": { + "description": "repository id", + "example": "123456", + "readOnly": true, + "type": [ + "integer" + ] + }, + "destroy_stale_apps": { + "description": "automatically destroy review apps when they haven't been deployed for a number of days", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "stale_days": { + "description": "number of days without a deployment after which to consider a review app stale", + "example": "5", + "readOnly": true, + "type": [ + "integer" + ] + }, + "wait_for_ci": { + "description": "If true, review apps are created only when CI passes", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "base_name": { + "description": "A unique prefix that will be used to create review app names", + "example": "singular-app", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "deploy_target": { + "description": "the deploy target for the review apps of a pipeline", + "definitions": { + "id": { + "description": "unique identifier of deploy target", + "example": "us", + "pattern": "(^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$|^[a-z]{2}$)", + "readOnly": true, + "type": [ + "string" + ] + }, + "type": { + "description": "type of deploy target", + "example": "region", + "pattern": "(^space$|^region$)", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + ], + "properties": { + "id": { + "$ref": "#/definitions/review-app-config/definitions/deploy_target/definitions/id" + }, + "type": { + "$ref": "#/definitions/review-app-config/definitions/deploy_target/definitions/type" + } + }, + "required": [ + "id", + "type" + ], + "type": [ + "object", + "null" + ] + } + }, + "links": [ + { + "description": "Enable review apps for a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/review-app-config", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "repo": { + "$ref": "#/definitions/review-app-config/definitions/repo", + "description": "The full_name of the repository that you want enable review-apps from." + }, + "automatic_review_apps": { + "$ref": "#/definitions/review-app-config/definitions/automatic_review_apps", + "description": "If true, this will trigger the creation of review apps when pull-requests are opened in the repo." + }, + "destroy_stale_apps": { + "$ref": "#/definitions/review-app-config/definitions/destroy_stale_apps", + "description": "If true, this will trigger automatic deletion of review apps when they're stale" + }, + "stale_days": { + "$ref": "#/definitions/review-app-config/definitions/stale_days", + "description": "If destroy_stale_apps is true, then apps will be destroyed after this many days" + }, + "deploy_target": { + "$ref": "#/definitions/review-app-config/definitions/deploy_target", + "description": "Provides a key/value pair to specify whether to use a common runtime or a private space" + }, + "wait_for_ci": { + "$ref": "#/definitions/review-app-config/definitions/wait_for_ci", + "description": "If true, review apps will only be created when CI passes" + }, + "base_name": { + "$ref": "#/definitions/review-app-config/definitions/base_name", + "description": "A unique prefix that will be used to create review app names" + } + }, + "required": [ + "repo" + ], + "type": [ + "object" + ] + }, + "title": "Enable", + "targetSchema": { + "$ref": "#/definitions/review-app-config" + } + }, + { + "description": "Get review apps configuration for a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/review-app-config", + "method": "GET", + "rel": "self", + "title": "Info", + "targetSchema": { + "$ref": "#/definitions/review-app-config" + } + }, + { + "description": "Update review app configuration for a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/review-app-config", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "automatic_review_apps": { + "$ref": "#/definitions/review-app-config/definitions/automatic_review_apps", + "description": "If true, this will trigger the creation of review apps when pull-requests are opened in the repo" + }, + "destroy_stale_apps": { + "$ref": "#/definitions/review-app-config/definitions/destroy_stale_apps", + "description": "If true, this will trigger automatic deletion of review apps when they're stale" + }, + "stale_days": { + "$ref": "#/definitions/review-app-config/definitions/stale_days", + "description": "If destroy_stale_apps is true, then apps will be destroyed after this many days" + }, + "deploy_target": { + "$ref": "#/definitions/review-app-config/definitions/deploy_target", + "description": "Provides a key/value pair to specify whether to use a common runtime or a private space" + }, + "wait_for_ci": { + "$ref": "#/definitions/review-app-config/definitions/wait_for_ci", + "description": "If true, review apps will only be created when CI passes" + }, + "base_name": { + "$ref": "#/definitions/review-app-config/definitions/base_name", + "description": "A unique prefix that will be used to create review app names" + } + }, + "type": [ + "object" + ] + }, + "title": "Update", + "targetSchema": { + "$ref": "#/definitions/review-app-config" + } + }, + { + "description": "Disable review apps for a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/review-app-config", + "method": "DELETE", + "rel": "destroy", + "title": "Delete", + "targetSchema": { + "$ref": "#/definitions/review-app-config" + } + } + ], + "properties": { + "repo": { + "properties": { + "id": { + "$ref": "#/definitions/review-app-config/definitions/repo_id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "automatic_review_apps": { + "$ref": "#/definitions/review-app-config/definitions/automatic_review_apps" + }, + "deploy_target": { + "$ref": "#/definitions/review-app-config/definitions/deploy_target" + }, + "destroy_stale_apps": { + "$ref": "#/definitions/review-app-config/definitions/destroy_stale_apps" + }, + "stale_days": { + "$ref": "#/definitions/review-app-config/definitions/stale_days" + }, + "pipeline_id": { + "$ref": "#/definitions/review-app-config/definitions/id" + }, + "wait_for_ci": { + "$ref": "#/definitions/review-app-config/definitions/wait_for_ci" + }, + "base_name": { + "$ref": "#/definitions/review-app-config/definitions/base_name" + } + } + }, + "slug": { + "description": "A slug is a snapshot of your application code that is ready to run on the platform.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Slug", + "type": [ + "object" + ], + "definitions": { + "buildpack_provided_description": { + "description": "description from buildpack of slug", + "example": "Ruby/Rack", + "readOnly": false, + "type": [ + "null", + "string" + ] + }, + "checksum": { + "description": "an optional checksum of the slug for verifying its integrity", + "example": "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "commit": { + "description": "identification of the code with your version control system (eg: SHA of the git HEAD)", + "example": "60883d9e8947a57e04dc9124f25df004866a2051", + "readOnly": false, + "type": [ + "null", + "string" + ] + }, + "commit_description": { + "description": "an optional description of the provided commit", + "example": "fixed a bug with API documentation", + "readOnly": false, + "type": [ + "null", + "string" + ] + }, + "created_at": { + "description": "when slug was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of slug", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/slug/definitions/id" + } + ] + }, + "method": { + "description": "method to be used to interact with the slug blob", + "example": "GET", + "readOnly": true, + "type": [ + "string" + ] + }, + "process_types": { + "additionalProperties": false, + "description": "hash mapping process type names to their respective command", + "example": { + "web": "./bin/web -p $PORT" + }, + "patternProperties": { + "^[-\\w]{1,128}$": { + "type": [ + "string" + ] + } + }, + "readOnly": false, + "type": [ + "object" + ] + }, + "size": { + "default": null, + "description": "size of slug, in bytes", + "example": 2048, + "readOnly": true, + "type": [ + "integer", + "null" + ] + }, + "updated_at": { + "description": "when slug was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "url": { + "description": "URL to interact with the slug blob", + "example": "https://api.heroku.com/slugs/1234.tgz", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Info for existing slug.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/slugs/{(%23%2Fdefinitions%2Fslug%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/slug" + }, + "title": "Info" + }, + { + "description": "Create a new slug. For more information please refer to [Deploying Slugs using the Platform API](https://devcenter.heroku.com/articles/platform-api-deploying-slugs).", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/slugs", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "buildpack_provided_description": { + "$ref": "#/definitions/slug/definitions/buildpack_provided_description" + }, + "checksum": { + "$ref": "#/definitions/slug/definitions/checksum" + }, + "commit": { + "$ref": "#/definitions/slug/definitions/commit" + }, + "commit_description": { + "$ref": "#/definitions/slug/definitions/commit_description" + }, + "process_types": { + "$ref": "#/definitions/slug/definitions/process_types" + }, + "stack": { + "$ref": "#/definitions/stack/definitions/identity" + } + }, + "required": [ + "process_types" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/slug", + "example": { + "blob": { + "method": "PUT", + "url": "https://api.heroku.com/slugs/1234.tgz" + }, + "buildpack_provided_description": "Ruby/Rack", + "checksum": "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "commit": "60883d9e8947a57e04dc9124f25df004866a2051", + "commit_description": "fixed a bug with API documentation", + "created_at": "2012-01-01T12:00:00Z", + "id": "01234567-89ab-cdef-0123-456789abcdef", + "process_types": { + "web": "./bin/web -p $PORT" + }, + "size": 2048, + "stack": { + "id": "01234567-89ab-cdef-0123-456789abcdef", + "name": "heroku-18" + }, + "updated_at": "2012-01-01T12:00:00Z" + } + }, + "title": "Create" + } + ], + "properties": { + "blob": { + "description": "pointer to the url where clients can fetch or store the actual release binary", + "properties": { + "method": { + "$ref": "#/definitions/slug/definitions/method" + }, + "url": { + "$ref": "#/definitions/slug/definitions/url" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "buildpack_provided_description": { + "$ref": "#/definitions/slug/definitions/buildpack_provided_description" + }, + "checksum": { + "$ref": "#/definitions/slug/definitions/checksum" + }, + "commit": { + "$ref": "#/definitions/slug/definitions/commit" + }, + "commit_description": { + "$ref": "#/definitions/slug/definitions/commit_description" + }, + "created_at": { + "$ref": "#/definitions/slug/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/slug/definitions/id" + }, + "process_types": { + "$ref": "#/definitions/slug/definitions/process_types" + }, + "size": { + "$ref": "#/definitions/slug/definitions/size" + }, + "stack": { + "description": "identity of slug stack", + "properties": { + "id": { + "$ref": "#/definitions/stack/definitions/id" + }, + "name": { + "$ref": "#/definitions/stack/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "updated_at": { + "$ref": "#/definitions/slug/definitions/updated_at" + } + } + }, + "sms-number": { + "description": "SMS numbers are used for recovery on accounts with two-factor authentication enabled.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - SMS Number", + "type": [ + "object" + ], + "definitions": { + "sms_number": { + "$ref": "#/definitions/account/definitions/sms_number" + } + }, + "links": [ + { + "description": "Recover an account using an SMS recovery code", + "href": "/users/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}/sms-number", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/sms-number" + }, + "title": "SMS Number" + }, + { + "description": "Recover an account using an SMS recovery code", + "href": "/users/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}/sms-number/actions/recover", + "method": "POST", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/sms-number" + }, + "title": "Recover" + }, + { + "description": "Confirm an SMS number change with a confirmation code", + "href": "/users/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}/sms-number/actions/confirm", + "method": "POST", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/sms-number" + }, + "title": "Confirm" + } + ], + "properties": { + "sms_number": { + "$ref": "#/definitions/account/definitions/sms_number" + } + } + }, + "sni-endpoint": { + "description": "SNI Endpoint is a public address serving a custom SSL cert for HTTPS traffic, using the SNI TLS extension, to a Heroku app.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Heroku Platform API - SNI Endpoint", + "stability": "development", + "strictProperties": true, + "type": [ + "object" + ], + "definitions": { + "ca_signed?": { + "readOnly": true, + "type": [ + "boolean" + ] + }, + "cert_domains": { + "readOnly": true, + "type": [ + "array" + ] + }, + "certificate_chain": { + "description": "raw contents of the public certificate chain (eg: .crt or .pem file)", + "example": "-----BEGIN CERTIFICATE----- ...", + "readOnly": false, + "type": [ + "string" + ] + }, + "created_at": { + "description": "when endpoint was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "domains": { + "description": "domains associated with this SSL certificate", + "type": [ + "array" + ], + "readOnly": true, + "items": { + "$ref": "#/definitions/domain/definitions/id" + } + }, + "display_name": { + "description": "unique name for SSL certificate", + "example": "example", + "pattern": "^[a-z][a-z0-9-]{2,29}$", + "readOnly": false, + "type": [ + "string", + "null" + ] + }, + "expires_at": { + "readOnly": true, + "format": "date-time", + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of this SNI endpoint", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/sni-endpoint/definitions/id" + }, + { + "$ref": "#/definitions/sni-endpoint/definitions/name" + } + ] + }, + "issuer": { + "readOnly": true, + "type": [ + "string" + ] + }, + "name": { + "description": "unique name for SNI endpoint", + "example": "example", + "pattern": "^[a-z][a-z0-9-]{2,29}$", + "readOnly": true, + "type": [ + "string" + ] + }, + "private_key": { + "description": "contents of the private key (eg .key file)", + "example": "-----BEGIN RSA PRIVATE KEY----- ...", + "readOnly": false, + "type": [ + "string" + ] + }, + "self_signed?": { + "readOnly": true, + "type": [ + "boolean" + ] + }, + "starts_at": { + "readOnly": true, + "format": "date-time", + "type": [ + "string" + ] + }, + "subject": { + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when SNI endpoint was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Create a new SNI endpoint.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sni-endpoints", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "certificate_chain": { + "$ref": "#/definitions/sni-endpoint/definitions/certificate_chain" + }, + "private_key": { + "$ref": "#/definitions/sni-endpoint/definitions/private_key" + } + }, + "required": [ + "certificate_chain", + "private_key" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/sni-endpoint" + }, + "title": "Create" + }, + { + "description": "Delete existing SNI endpoint.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sni-endpoints/{(%23%2Fdefinitions%2Fsni-endpoint%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/sni-endpoint" + }, + "title": "Delete" + }, + { + "description": "Info for existing SNI endpoint.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sni-endpoints/{(%23%2Fdefinitions%2Fsni-endpoint%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/sni-endpoint" + }, + "title": "Info" + }, + { + "description": "List existing SNI endpoints.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sni-endpoints", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/sni-endpoint" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Update an existing SNI endpoint.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sni-endpoints/{(%23%2Fdefinitions%2Fsni-endpoint%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "certificate_chain": { + "$ref": "#/definitions/sni-endpoint/definitions/certificate_chain" + }, + "private_key": { + "$ref": "#/definitions/sni-endpoint/definitions/private_key" + } + }, + "required": [ + "certificate_chain", + "private_key" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/sni-endpoint" + }, + "title": "Update" + } + ], + "properties": { + "certificate_chain": { + "$ref": "#/definitions/sni-endpoint/definitions/certificate_chain" + }, + "created_at": { + "$ref": "#/definitions/sni-endpoint/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/sni-endpoint/definitions/id" + }, + "name": { + "$ref": "#/definitions/sni-endpoint/definitions/name" + }, + "updated_at": { + "$ref": "#/definitions/sni-endpoint/definitions/updated_at" + }, + "display_name": { + "$ref": "#/definitions/sni-endpoint/definitions/display_name" + }, + "domains": { + "$ref": "#/definitions/sni-endpoint/definitions/domains" + }, + "app": { + "description": "application that this SSL certificate is on", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "ssl_cert": { + "description": "certificate provided by this endpoint", + "type": [ + "object" + ], + "properties": { + "ca_signed?": { + "$ref": "#/definitions/sni-endpoint/definitions/ca_signed?" + }, + "cert_domains": { + "$ref": "#/definitions/sni-endpoint/definitions/cert_domains" + }, + "expires_at": { + "$ref": "#/definitions/sni-endpoint/definitions/expires_at" + }, + "issuer": { + "$ref": "#/definitions/sni-endpoint/definitions/issuer" + }, + "self_signed?": { + "$ref": "#/definitions/sni-endpoint/definitions/self_signed?" + }, + "starts_at": { + "$ref": "#/definitions/sni-endpoint/definitions/starts_at" + }, + "subject": { + "$ref": "#/definitions/sni-endpoint/definitions/subject" + }, + "id": { + "description": "unique identifier of this SSL certificate", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + } + } + } + } + }, + "source": { + "description": "A source is a location for uploading and downloading an application's source code.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Source", + "type": [ + "object" + ], + "definitions": { + "get_url": { + "description": "URL to download the source", + "example": "https://api.heroku.com/sources/1234.tgz", + "readOnly": true, + "type": [ + "string" + ] + }, + "put_url": { + "description": "URL to upload the source", + "example": "https://api.heroku.com/sources/1234.tgz", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Create URLs for uploading and downloading source.", + "href": "/sources", + "method": "POST", + "rel": "create", + "targetSchema": { + "$ref": "#/definitions/source" + }, + "title": "Create" + }, + { + "deactivate_on": "2017-08-01", + "description": "Create URLs for uploading and downloading source. Deprecated in favor of `POST /sources`", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sources", + "method": "POST", + "rel": "create", + "targetSchema": { + "$ref": "#/definitions/source" + }, + "title": "Create - Deprecated" + } + ], + "properties": { + "source_blob": { + "description": "pointer to the URL where clients can fetch or store the source", + "properties": { + "get_url": { + "$ref": "#/definitions/source/definitions/get_url" + }, + "put_url": { + "$ref": "#/definitions/source/definitions/put_url" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + } + }, + "space-app-access": { + "description": "Space access represents the permissions a particular user has on a particular space.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "title": "Heroku Platform API - Space Access", + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "unique identifier of the space a user has permissions on", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/space-app-access/definitions/id" + } + ] + } + }, + "links": [ + { + "description": "List permissions for a given user on a given space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/members/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/space-app-access" + }, + "title": "Info" + }, + { + "description": "Update an existing user's set of permissions on a space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/members/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "type": [ + "object" + ], + "required": [ + "permissions" + ], + "properties": { + "permissions": { + "type": [ + "array" + ], + "items": { + "type": [ + "object" + ], + "properties": { + "name": { + "type": [ + "string" + ] + } + } + } + } + } + }, + "targetSchema": { + "$ref": "#/definitions/space-app-access" + }, + "title": "Update" + }, + { + "description": "List all users and their permissions on a space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/members", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/space-app-access" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "space": { + "description": "space user belongs to", + "properties": { + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/space/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/space/definitions/id" + }, + "permissions": { + "description": "user space permissions", + "type": [ + "array" + ], + "items": { + "type": [ + "object" + ], + "properties": { + "description": { + "type": [ + "string" + ] + }, + "name": { + "type": [ + "string" + ] + } + } + } + }, + "updated_at": { + "$ref": "#/definitions/space/definitions/updated_at" + }, + "user": { + "description": "identity of user account", + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + } + }, + "space-nat": { + "description": "Network address translation (NAT) for stable outbound IP addresses from a space", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Space Network Address Translation", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when network address translation for a space was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "ip_v4_address": { + "example": "123.123.123.123", + "format": "ipv4", + "pattern": "^(([01]?\\d?\\d|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d?\\d|2[0-4]\\d|25[0-5])$", + "type": [ + "string" + ] + }, + "sources": { + "description": "potential IPs from which outbound network traffic will originate", + "readOnly": true, + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/space-nat/definitions/ip_v4_address" + } + }, + "state": { + "description": "availability of network address translation for a space", + "enum": [ + "disabled", + "updating", + "enabled" + ], + "example": "enabled", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when network address translation for a space was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Current state of network address translation for a space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/nat", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/space-nat" + }, + "title": "Info" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/space-nat/definitions/created_at" + }, + "sources": { + "$ref": "#/definitions/space-nat/definitions/sources" + }, + "state": { + "$ref": "#/definitions/space-nat/definitions/state" + }, + "updated_at": { + "$ref": "#/definitions/space-nat/definitions/updated_at" + } + } + }, + "space-topology": { + "description": "Space Topology provides you with a mechanism for viewing all the running dynos, formations and applications for a space. This is the same data thats used to power our DNS Service Discovery.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Space Topology", + "type": [ + "object" + ], + "definitions": { + "version": { + "description": "version of the space topology payload", + "example": 1, + "readOnly": true, + "type": [ + "integer" + ] + }, + "dyno": { + "description": "A dyno", + "properties": { + "id": { + "$ref": "#/definitions/dyno/definitions/id" + }, + "number": { + "description": "process number, e.g. 1 in web.1", + "example": 1, + "type": [ + "integer" + ] + }, + "private_ip": { + "description": "RFC1918 Address of Dyno", + "example": "10.0.134.42", + "type": [ + "string" + ] + }, + "hostname": { + "description": "localspace hostname of resource", + "example": "1.example-app-90210.app.localspace", + "type": [ + "string" + ] + } + }, + "type": [ + "object" + ] + }, + "formation": { + "description": "formations for application", + "properties": { + "id": { + "$ref": "#/definitions/formation/definitions/id" + }, + "process_type": { + "description": "Name of process type", + "example": "web", + "type": [ + "string" + ] + }, + "dynos": { + "description": "Current dynos for application", + "items": { + "$ref": "#/definitions/space-topology/definitions/dyno" + }, + "type": [ + "array" + ] + } + }, + "type": [ + "object" + ] + } + }, + "links": [ + { + "description": "Current space topology", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/topology", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/space-topology" + }, + "title": "Topology" + } + ], + "properties": { + "version": { + "$ref": "#/definitions/space-topology/definitions/version" + }, + "apps": { + "description": "The apps within this space", + "type": [ + "array" + ], + "readOnly": true, + "items": { + "type": [ + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id", + "readOnly": true + }, + "domains": { + "example": [ + "example.com", + "example.net" + ], + "readOnly": true, + "type": [ + "array" + ] + }, + "formation": { + "description": "formations for application", + "items": { + "$ref": "#/definitions/space-topology/definitions/formation" + }, + "type": [ + "array" + ], + "readOnly": true + } + } + } + } + } + }, + "space-transfer": { + "description": "Transfer spaces between enterprise teams with the same Enterprise Account.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Space Transfer", + "type": [ + "object" + ], + "links": [ + { + "description": "Transfer space between enterprise teams", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/transfer", + "method": "POST", + "rel": "transfer", + "schema": { + "properties": { + "new_owner": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "required": [ + "new_owner" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/space" + }, + "title": "transfer" + } + ] + }, + "space": { + "description": "A space is an isolated, highly available, secure app execution environment.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Space", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when space was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of space", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/space/definitions/id" + }, + { + "$ref": "#/definitions/space/definitions/name" + } + ] + }, + "name": { + "description": "unique name of space", + "example": "nasa", + "readOnly": false, + "pattern": "^[a-z0-9](?:[a-z0-9]|-(?!-))+[a-z0-9]$", + "type": [ + "string" + ] + }, + "shield": { + "description": "true if this space has shield enabled", + "readOnly": true, + "example": true, + "type": [ + "boolean" + ] + }, + "state": { + "description": "availability of this space", + "enum": [ + "allocating", + "allocated", + "deleting" + ], + "example": "allocated", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when space was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "log_drain_url": { + "description": "URL to which all apps will drain logs. Only settable during space creation and enables direct logging. Must use HTTPS.", + "example": "https://example.com/logs", + "type": [ + "string" + ] + }, + "cidr": { + "description": "The RFC-1918 CIDR the Private Space will use. It must be a /16 in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16", + "example": "172.20.20.30/16", + "default": "10.0.0.0/16", + "pattern": "^((?:10|172\\.(?:1[6-9]|2[0-9]|3[01])|192\\.168)\\..*.+\\/16)$", + "readOnly": false, + "type": [ + "string" + ] + }, + "data_cidr": { + "description": "The RFC-1918 CIDR that the Private Space will use for the Heroku-managed peering connection that's automatically created when using Heroku Data add-ons. It must be between a /16 and a /20", + "example": "10.2.0.0/16", + "readOnly": false, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "List existing spaces.", + "href": "/spaces", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/space" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Info for existing space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/space" + }, + "title": "Info" + }, + { + "description": "Update an existing space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/space/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/space" + }, + "title": "Update" + }, + { + "description": "Delete an existing space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/space" + }, + "title": "Delete" + }, + { + "description": "Create a new space.", + "href": "/spaces", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/space/definitions/name" + }, + "team": { + "$ref": "#/definitions/team/definitions/name" + }, + "region": { + "$ref": "#/definitions/region/definitions/identity" + }, + "shield": { + "$ref": "#/definitions/space/definitions/shield" + }, + "cidr": { + "$ref": "#/definitions/space/definitions/cidr" + }, + "data_cidr": { + "$ref": "#/definitions/space/definitions/data_cidr" + }, + "log_drain_url": { + "$ref": "#/definitions/space/definitions/log_drain_url" + } + }, + "required": [ + "name", + "team" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/space" + }, + "title": "Create" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/space/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/space/definitions/id" + }, + "name": { + "$ref": "#/definitions/space/definitions/name" + }, + "organization": { + "description": "organization that owns this space", + "properties": { + "name": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "team": { + "description": "team that owns this space", + "properties": { + "id": { + "$ref": "#/definitions/team/definitions/id" + }, + "name": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "region": { + "description": "identity of space region", + "properties": { + "id": { + "$ref": "#/definitions/region/definitions/id" + }, + "name": { + "$ref": "#/definitions/region/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "shield": { + "$ref": "#/definitions/space/definitions/shield" + }, + "state": { + "$ref": "#/definitions/space/definitions/state" + }, + "updated_at": { + "$ref": "#/definitions/space/definitions/updated_at" + }, + "cidr": { + "$ref": "#/definitions/space/definitions/cidr" + }, + "data_cidr": { + "$ref": "#/definitions/space/definitions/data_cidr" + } + } + }, + "stack": { + "description": "Stacks are the different application execution environments available in the Heroku platform.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Stack", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when stack was introduced", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "default": { + "description": "indicates this stack is the default for new apps", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "id": { + "description": "unique identifier of stack", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/stack/definitions/name" + }, + { + "$ref": "#/definitions/stack/definitions/id" + } + ] + }, + "name": { + "description": "unique name of stack", + "example": "heroku-18", + "readOnly": true, + "type": [ + "string" + ] + }, + "state": { + "description": "availability of this stack: beta, deprecated or public", + "example": "public", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when stack was last modified", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Stack info.", + "href": "/stacks/{(%23%2Fdefinitions%2Fstack%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/stack" + }, + "title": "Info" + }, + { + "description": "List available stacks.", + "href": "/stacks", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/stack" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "default": { + "$ref": "#/definitions/stack/definitions/default" + }, + "created_at": { + "$ref": "#/definitions/stack/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/stack/definitions/id" + }, + "name": { + "$ref": "#/definitions/stack/definitions/name" + }, + "state": { + "$ref": "#/definitions/stack/definitions/state" + }, + "updated_at": { + "$ref": "#/definitions/stack/definitions/updated_at" + } + } + }, + "team-add-on": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "title": "Heroku Platform API - Team Add-on", + "type": [ + "object" + ], + "links": [ + { + "description": "List add-ons used across all Team apps", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/addons", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on" + }, + "type": [ + "array" + ] + }, + "title": "List For Team" + } + ] + }, + "team-app-collaborator": { + "description": "A team collaborator represents an account that has been given access to a team app on Heroku.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "title": "Heroku Platform API - Team App Collaborator", + "type": [ + "object" + ], + "definitions": { + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/collaborator/definitions/email" + } + ] + } + }, + "links": [ + { + "description": "Create a new collaborator on a team app. Use this endpoint instead of the `/apps/{app_id_or_name}/collaborator` endpoint when you want the collaborator to be granted [permissions] (https://devcenter.heroku.com/articles/org-users-access#roles-and-permissions) according to their role in the team.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/collaborators", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "permissions": { + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/team-app-permission/definitions/name" + }, + "description": "An array of permissions to give to the collaborator." + }, + "silent": { + "$ref": "#/definitions/collaborator/definitions/silent" + }, + "user": { + "$ref": "#/definitions/account/definitions/identity" + } + }, + "required": [ + "user" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team-app-collaborator" + }, + "title": "Create" + }, + { + "description": "Delete an existing collaborator from a team app.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}/collaborators/{(%23%2Fdefinitions%2Fteam-app-collaborator%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/team-app-collaborator" + }, + "title": "Delete" + }, + { + "description": "Info for a collaborator on a team app.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}/collaborators/{(%23%2Fdefinitions%2Fteam-app-collaborator%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/team-app-collaborator" + }, + "title": "Info" + }, + { + "description": "Update an existing collaborator from a team app.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}/collaborators/{(%23%2Fdefinitions%2Fteam-app-collaborator%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "permissions": { + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/team-app-permission/definitions/name" + }, + "description": "An array of permissions to give to the collaborator." + } + }, + "required": [ + "permissions" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team-app-collaborator" + }, + "title": "Update" + }, + { + "description": "List collaborators on a team app.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}/collaborators", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-app-collaborator" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "app": { + "description": "app collaborator belongs to", + "properties": { + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/collaborator/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/collaborator/definitions/id" + }, + "permissions": { + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/team-app-permission" + }, + "description": "array of permissions for the collaborator (only applicable if the app is on a team)" + }, + "role": { + "$ref": "#/definitions/team/definitions/role" + }, + "updated_at": { + "$ref": "#/definitions/collaborator/definitions/updated_at" + }, + "user": { + "description": "identity of collaborated account", + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "federated": { + "$ref": "#/definitions/account/definitions/federated" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + } + }, + "team-app-permission": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "A team app permission is a behavior that is assigned to a user in a team app.", + "stability": "prototype", + "title": "Heroku Platform API - Team App Permission", + "type": [ + "object" + ], + "definitions": { + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/team-app-permission/definitions/name" + } + ] + }, + "name": { + "description": "The name of the app permission.", + "example": "view", + "readOnly": true, + "type": [ + "string" + ] + }, + "description": { + "description": "A description of what the app permission allows.", + "example": "Can manage config, deploy, run commands and restart the app.", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Lists permissions available to teams.", + "href": "/teams/permissions", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-app-permission" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "name": { + "$ref": "#/definitions/team-app-permission/definitions/name" + }, + "description": { + "$ref": "#/definitions/team-app-permission/definitions/description" + } + } + }, + "team-app": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "A team app encapsulates the team specific functionality of Heroku apps.", + "stability": "development", + "title": "Heroku Platform API - Team App", + "type": [ + "object" + ], + "definitions": { + "locked": { + "default": false, + "description": "are other team members forbidden from joining this app.", + "example": false, + "type": [ + "boolean" + ] + }, + "identity": { + "$ref": "#/definitions/app/definitions/name" + }, + "internal_routing": { + "default": false, + "description": "describes whether a Private Spaces app is externally routable or not", + "example": false, + "readOnly": false, + "type": [ + "boolean", + "null" + ] + }, + "joined": { + "default": false, + "description": "is the current member a collaborator on this app.", + "example": false, + "type": [ + "boolean" + ] + }, + "personal": { + "default": false, + "description": "force creation of the app in the user account even if a default team is set.", + "example": false, + "type": [ + "boolean" + ] + } + }, + "links": [ + { + "description": "Create a new app in the specified team, in the default team if unspecified, or in personal account, if default team is not set.", + "href": "/teams/apps", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "locked": { + "$ref": "#/definitions/team-app/definitions/locked" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "team": { + "$ref": "#/definitions/team/definitions/name" + }, + "personal": { + "$ref": "#/definitions/team-app/definitions/personal" + }, + "region": { + "$ref": "#/definitions/region/definitions/name" + }, + "space": { + "$ref": "#/definitions/space/definitions/name" + }, + "stack": { + "$ref": "#/definitions/stack/definitions/name" + }, + "internal_routing": { + "$ref": "#/definitions/team-app/definitions/internal_routing" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team-app" + }, + "title": "Create" + }, + { + "description": "Info for a team app.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/team-app" + }, + "title": "Info" + }, + { + "description": "Lock or unlock a team app.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "locked": { + "$ref": "#/definitions/team-app/definitions/locked" + } + }, + "required": [ + "locked" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team-app" + }, + "title": "Update Locked" + }, + { + "description": "Transfer an existing team app to another Heroku account.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "owner": { + "$ref": "#/definitions/account/definitions/identity" + } + }, + "required": [ + "owner" + ], + "type": [ + "object" + ] + }, + "title": "Transfer to Account" + }, + { + "description": "Transfer an existing team app to another team.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "owner": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "required": [ + "owner" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team-app" + }, + "title": "Transfer to Team" + }, + { + "description": "List team apps.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/apps", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-app" + }, + "type": [ + "array" + ] + }, + "title": "List By Team" + } + ], + "properties": { + "archived_at": { + "$ref": "#/definitions/app/definitions/archived_at" + }, + "buildpack_provided_description": { + "$ref": "#/definitions/app/definitions/buildpack_provided_description" + }, + "build_stack": { + "description": "identity of the stack that will be used for new builds", + "properties": { + "id": { + "$ref": "#/definitions/stack/definitions/id" + }, + "name": { + "$ref": "#/definitions/stack/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/app/definitions/created_at" + }, + "git_url": { + "$ref": "#/definitions/app/definitions/git_url" + }, + "id": { + "$ref": "#/definitions/app/definitions/id" + }, + "internal_routing": { + "$ref": "#/definitions/team-app/definitions/internal_routing" + }, + "joined": { + "$ref": "#/definitions/team-app/definitions/joined" + }, + "locked": { + "$ref": "#/definitions/team-app/definitions/locked" + }, + "maintenance": { + "$ref": "#/definitions/app/definitions/maintenance" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "team": { + "description": "team that owns this app", + "properties": { + "name": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "type": [ + "null", + "object" + ] + }, + "owner": { + "description": "identity of app owner", + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + } + }, + "type": [ + "null", + "object" + ] + }, + "region": { + "description": "identity of app region", + "properties": { + "id": { + "$ref": "#/definitions/region/definitions/id" + }, + "name": { + "$ref": "#/definitions/region/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "released_at": { + "$ref": "#/definitions/app/definitions/released_at" + }, + "repo_size": { + "$ref": "#/definitions/app/definitions/repo_size" + }, + "slug_size": { + "$ref": "#/definitions/app/definitions/slug_size" + }, + "space": { + "description": "identity of space", + "properties": { + "id": { + "$ref": "#/definitions/space/definitions/id" + }, + "name": { + "$ref": "#/definitions/space/definitions/name" + } + }, + "type": [ + "null", + "object" + ] + }, + "stack": { + "description": "identity of app stack", + "properties": { + "id": { + "$ref": "#/definitions/stack/definitions/id" + }, + "name": { + "$ref": "#/definitions/stack/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "updated_at": { + "$ref": "#/definitions/app/definitions/updated_at" + }, + "web_url": { + "$ref": "#/definitions/app/definitions/web_url" + } + } + }, + "team-daily-usage": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "Usage for an enterprise team at a daily resolution.", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Team Daily Usage", + "type": [ + "object" + ], + "definitions": { + "addons": { + "description": "total add-on credits used", + "example": 250.0, + "readOnly": true, + "type": [ + "number" + ] + }, + "app_usage_daily": { + "description": "Usage for an app at a daily resolution.", + "type": [ + "object" + ], + "properties": { + "addons": { + "$ref": "#/definitions/team-daily-usage/definitions/addons" + }, + "app_name": { + "$ref": "#/definitions/app/definitions/name" + }, + "data": { + "$ref": "#/definitions/team-daily-usage/definitions/data" + }, + "dynos": { + "$ref": "#/definitions/team-daily-usage/definitions/dynos" + }, + "partner": { + "$ref": "#/definitions/team-daily-usage/definitions/partner" + } + } + }, + "data": { + "description": "total add-on credits used for first party add-ons", + "example": 34.89, + "readOnly": true, + "type": [ + "number" + ] + }, + "date": { + "description": "date of the usage", + "example": "2019-01-01", + "format": "date", + "readOnly": true, + "type": [ + "string" + ] + }, + "dynos": { + "description": "dynos used", + "example": 1.548, + "readOnly": true, + "type": [ + "number" + ] + }, + "id": { + "description": "team identifier", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "name": { + "description": "name of the team", + "example": "ops", + "readOnly": true, + "type": [ + "string" + ] + }, + "partner": { + "description": "total add-on credits used for third party add-ons", + "example": 12.34, + "readOnly": true, + "type": [ + "number" + ] + }, + "space": { + "description": "space credits used", + "example": 1.548, + "readOnly": true, + "type": [ + "number" + ] + }, + "start_date": { + "description": "range start date", + "example": "2019-01-25", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$", + "readOnly": true, + "type": [ + "string" + ] + }, + "end_date": { + "description": "range end date", + "example": "2019-02-25", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Retrieves usage for an enterprise team for a range of days. Start and end dates can be specified as query parameters using the date format YYYY-MM-DD. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list).\n", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fid)}/usage/daily", + "method": "GET", + "title": "Info", + "schema": { + "properties": { + "start": { + "$ref": "#/definitions/team-daily-usage/definitions/start_date" + }, + "end": { + "$ref": "#/definitions/team-daily-usage/definitions/end_date" + } + }, + "required": [ + "start" + ], + "type": [ + "object" + ] + }, + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-daily-usage" + }, + "type": [ + "array" + ] + } + } + ], + "properties": { + "addons": { + "$ref": "#/definitions/team-daily-usage/definitions/addons" + }, + "apps": { + "description": "app usage in the team", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/team-daily-usage/definitions/app_usage_daily" + } + }, + "data": { + "$ref": "#/definitions/team-daily-usage/definitions/data" + }, + "date": { + "$ref": "#/definitions/team-daily-usage/definitions/date" + }, + "dynos": { + "$ref": "#/definitions/team-daily-usage/definitions/dynos" + }, + "id": { + "$ref": "#/definitions/team-daily-usage/definitions/id" + }, + "name": { + "$ref": "#/definitions/team-daily-usage/definitions/name" + }, + "partner": { + "$ref": "#/definitions/team-daily-usage/definitions/partner" + }, + "space": { + "$ref": "#/definitions/team-daily-usage/definitions/space" + } + } + }, + "team-delinquency": { + "description": "A Heroku team becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent teams if their invoices remain unpaid.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Team Delinquency", + "type": [ + "object" + ], + "definitions": { + "scheduled_suspension_time": { + "description": "scheduled time of when we will suspend your team due to delinquency", + "example": "2024-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "scheduled_deletion_time": { + "description": "scheduled time of when we will delete your team due to delinquency", + "example": "2024-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] + } + }, + "links": [ + { + "description": "Team delinquency information.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/delinquency", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/team-delinquency" + }, + "title": "Info" + } + ], + "properties": { + "scheduled_suspension_time": { + "$ref": "#/definitions/team-delinquency/definitions/scheduled_suspension_time" + }, + "scheduled_deletion_time": { + "$ref": "#/definitions/team-delinquency/definitions/scheduled_deletion_time" + } + } + }, + "team-feature": { + "description": "A team feature represents a feature enabled on a team account.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Team Feature", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when team feature was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "description": { + "description": "description of team feature", + "example": "Causes account to example.", + "readOnly": true, + "type": [ + "string" + ] + }, + "doc_url": { + "description": "documentation URL of team feature", + "example": "http://devcenter.heroku.com/articles/example", + "readOnly": true, + "type": [ + "string" + ] + }, + "enabled": { + "description": "whether or not team feature has been enabled", + "example": true, + "readOnly": false, + "type": [ + "boolean" + ] + }, + "id": { + "description": "unique identifier of team feature", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/team-feature/definitions/id" + }, + { + "$ref": "#/definitions/team-feature/definitions/name" + } + ] + }, + "name": { + "description": "unique name of team feature", + "example": "name", + "readOnly": true, + "type": [ + "string" + ] + }, + "state": { + "description": "state of team feature", + "example": "public", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when team feature was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "display_name": { + "description": "user readable feature name", + "example": "My Feature", + "readOnly": true, + "type": [ + "string" + ] + }, + "feedback_email": { + "description": "e-mail to send feedback about the feature", + "example": "feedback@heroku.com", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Info for an existing team feature.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/features/{(%23%2Fdefinitions%2Fteam-feature%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/team-feature" + }, + "title": "Info" + }, + { + "description": "List existing team features.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/features", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-feature" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/team-feature/definitions/created_at" + }, + "description": { + "$ref": "#/definitions/team-feature/definitions/description" + }, + "doc_url": { + "$ref": "#/definitions/team-feature/definitions/doc_url" + }, + "enabled": { + "$ref": "#/definitions/team-feature/definitions/enabled" + }, + "id": { + "$ref": "#/definitions/team-feature/definitions/id" + }, + "name": { + "$ref": "#/definitions/team-feature/definitions/name" + }, + "state": { + "$ref": "#/definitions/team-feature/definitions/state" + }, + "updated_at": { + "$ref": "#/definitions/team-feature/definitions/updated_at" + }, + "display_name": { + "$ref": "#/definitions/team-feature/definitions/display_name" + }, + "feedback_email": { + "$ref": "#/definitions/team-feature/definitions/feedback_email" + } + } + }, + "team-invitation": { + "description": "A team invitation represents an invite to a team.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Team Invitation", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when invitation was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/team-invitation/definitions/id" + } + ] + }, + "id": { + "description": "unique identifier of an invitation", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "token": { + "description": "special token for invitation", + "example": "614ae25aa2d4802096cd7c18625b526c", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when invitation was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Get a list of a team's Identity Providers", + "title": "List", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fname)}/invitations", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-invitation" + }, + "type": [ + "array" + ] + } + }, + { + "description": "Create Team Invitation", + "title": "Create", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/invitations", + "method": "PUT", + "rel": "update", + "schema": { + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "role": { + "$ref": "#/definitions/team/definitions/role" + } + }, + "required": [ + "email", + "role" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team-invitation" + } + }, + { + "description": "Revoke a team invitation.", + "title": "Revoke", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/invitations/{(%23%2Fdefinitions%2Fteam-invitation%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/team-invitation" + } + }, + { + "description": "Get an invitation by its token", + "title": "Get", + "href": "/teams/invitations/{(%23%2Fdefinitions%2Fteam-invitation%2Fdefinitions%2Ftoken)}", + "method": "GET", + "rel": "instances", + "targetSchema": { + "$ref": "#/definitions/team-invitation" + } + }, + { + "description": "Accept Team Invitation", + "title": "Accept", + "href": "/teams/invitations/{(%23%2Fdefinitions%2Fteam-invitation%2Fdefinitions%2Ftoken)}/accept", + "method": "POST", + "rel": "create", + "targetSchema": { + "$ref": "#/definitions/team-member" + } + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/team-invitation/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/team-invitation/definitions/id" + }, + "invited_by": { + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + }, + "name": { + "$ref": "#/definitions/account/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "team": { + "properties": { + "id": { + "$ref": "#/definitions/team/definitions/id" + }, + "name": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "role": { + "$ref": "#/definitions/team/definitions/role" + }, + "updated_at": { + "$ref": "#/definitions/team-invitation/definitions/updated_at" + }, + "user": { + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + }, + "name": { + "$ref": "#/definitions/account/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + } + }, + "team-invoice": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "A Team Invoice is an itemized bill of goods for a team which includes pricing and charges.", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Team Invoice", + "type": [ + "object" + ], + "definitions": { + "addons_total": { + "description": "total add-ons charges in on this invoice", + "example": 25000, + "readOnly": true, + "type": [ + "integer" + ] + }, + "database_total": { + "description": "total database charges on this invoice", + "example": 25000, + "readOnly": true, + "type": [ + "integer" + ] + }, + "charges_total": { + "description": "total charges on this invoice", + "example": 0, + "readOnly": true, + "type": [ + "integer" + ] + }, + "created_at": { + "description": "when invoice was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "credits_total": { + "description": "total credits on this invoice", + "example": 100000, + "readOnly": true, + "type": [ + "integer" + ] + }, + "dyno_units": { + "description": "total amount of dyno units consumed across dyno types.", + "example": 1.92, + "readOnly": true, + "type": [ + "number" + ] + }, + "id": { + "description": "unique identifier of this invoice", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/team-invoice/definitions/number" + } + ] + }, + "number": { + "description": "human readable invoice number", + "example": 9403943, + "readOnly": true, + "type": [ + "integer" + ] + }, + "payment_status": { + "description": "status of the invoice payment", + "example": "Paid", + "readOnly": true, + "type": [ + "string" + ] + }, + "platform_total": { + "description": "total platform charges on this invoice", + "example": 50000, + "readOnly": true, + "type": [ + "integer" + ] + }, + "period_end": { + "description": "the ending date that the invoice covers", + "example": "01/31/2014", + "readOnly": true, + "type": [ + "string" + ] + }, + "period_start": { + "description": "the starting date that this invoice covers", + "example": "01/01/2014", + "readOnly": true, + "type": [ + "string" + ] + }, + "state": { + "description": "payment status for this invoice (pending, successful, failed)", + "example": 1, + "readOnly": true, + "type": [ + "integer" + ] + }, + "total": { + "description": "combined total of charges and credits on this invoice", + "example": 100000, + "readOnly": true, + "type": [ + "integer" + ] + }, + "updated_at": { + "description": "when invoice was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "weighted_dyno_hours": { + "description": "The total amount of hours consumed across dyno types.", + "example": 1488, + "readOnly": true, + "type": [ + "number" + ] + } + }, + "links": [ + { + "description": "Info for existing invoice.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/invoices/{(%23%2Fdefinitions%2Fteam-invoice%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/team-invoice" + }, + "title": "Info" + }, + { + "description": "List existing invoices.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/invoices", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-invoice" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "addons_total": { + "$ref": "#/definitions/team-invoice/definitions/addons_total" + }, + "database_total": { + "$ref": "#/definitions/team-invoice/definitions/database_total" + }, + "charges_total": { + "$ref": "#/definitions/team-invoice/definitions/charges_total" + }, + "created_at": { + "$ref": "#/definitions/team-invoice/definitions/created_at" + }, + "credits_total": { + "$ref": "#/definitions/team-invoice/definitions/credits_total" + }, + "dyno_units": { + "$ref": "#/definitions/team-invoice/definitions/dyno_units" + }, + "id": { + "$ref": "#/definitions/team-invoice/definitions/id" + }, + "number": { + "$ref": "#/definitions/team-invoice/definitions/number" + }, + "payment_status": { + "$ref": "#/definitions/team-invoice/definitions/payment_status" + }, + "period_end": { + "$ref": "#/definitions/team-invoice/definitions/period_end" + }, + "period_start": { + "$ref": "#/definitions/team-invoice/definitions/period_start" + }, + "platform_total": { + "$ref": "#/definitions/team-invoice/definitions/platform_total" + }, + "state": { + "$ref": "#/definitions/team-invoice/definitions/state" + }, + "total": { + "$ref": "#/definitions/team-invoice/definitions/total" + }, + "updated_at": { + "$ref": "#/definitions/team-invoice/definitions/updated_at" + }, + "weighted_dyno_hours": { + "$ref": "#/definitions/team-invoice/definitions/weighted_dyno_hours" + } + } + }, + "team-member": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "A team member is an individual with access to a team.", + "stability": "development", + "additionalProperties": false, + "required": [ + "created_at", + "email", + "federated", + "updated_at" + ], + "title": "Heroku Platform API - Team Member", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when the membership record was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "email": { + "description": "email address of the team member", + "example": "someone@example.org", + "readOnly": true, + "type": [ + "string" + ] + }, + "federated": { + "description": "whether the user is federated and belongs to an Identity Provider", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "id": { + "description": "unique identifier of the team member", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/team-member/definitions/email" + }, + { + "$ref": "#/definitions/team-member/definitions/id" + } + ] + }, + "name": { + "description": "full name of the team member", + "example": "Tina Edmonds", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "team_role": { + "description": "role in the team", + "enum": [ + "admin", + "viewer", + "member" + ], + "example": "admin", + "type": [ + "string" + ] + }, + "two_factor_authentication": { + "description": "whether the team member has two factor authentication enabled", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "updated_at": { + "description": "when the membership record was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Create a new team member, or update their role.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members", + "method": "PUT", + "rel": "create", + "schema": { + "properties": { + "email": { + "$ref": "#/definitions/team-member/definitions/email" + }, + "federated": { + "$ref": "#/definitions/team-member/definitions/federated" + }, + "role": { + "$ref": "#/definitions/team-member/definitions/team_role" + } + }, + "required": [ + "email", + "role" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team-member" + }, + "title": "Create or Update" + }, + { + "description": "Create a new team member.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "email": { + "$ref": "#/definitions/team-member/definitions/email" + }, + "federated": { + "$ref": "#/definitions/team-member/definitions/federated" + }, + "role": { + "$ref": "#/definitions/team-member/definitions/team_role" + } + }, + "required": [ + "email", + "role" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team-member" + }, + "title": "Create" + }, + { + "description": "Update a team member.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "email": { + "$ref": "#/definitions/team-member/definitions/email" + }, + "federated": { + "$ref": "#/definitions/team-member/definitions/federated" + }, + "role": { + "$ref": "#/definitions/team-member/definitions/team_role" + } + }, + "required": [ + "email", + "role" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team-member" + }, + "title": "Update" + }, + { + "description": "Remove a member from the team.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members/{(%23%2Fdefinitions%2Fteam-member%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/team-member" + }, + "title": "Delete" + }, + { + "description": "List members of the team.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members", + "method": "GET", + "ranges": [ + "email" + ], + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-member" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "List the apps of a team member.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members/{(%23%2Fdefinitions%2Fteam-member%2Fdefinitions%2Fidentity)}/apps", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-app" + }, + "type": [ + "array" + ] + }, + "title": "List By Member" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/team-member/definitions/created_at" + }, + "email": { + "$ref": "#/definitions/team-member/definitions/email" + }, + "federated": { + "$ref": "#/definitions/team-member/definitions/federated" + }, + "id": { + "$ref": "#/definitions/team-member/definitions/id" + }, + "identity_provider": { + "description": "Identity Provider information the member is federated with", + "properties": { + "id": { + "$ref": "#/definitions/identity-provider/definitions/id" + }, + "name": { + "description": "name of the identity provider", + "example": "acme", + "readOnly": true, + "type": [ + "string" + ] + }, + "redacted": { + "description": "whether the identity_provider information is redacted or not", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "owner": { + "$ref": "#/definitions/identity-provider/definitions/owner" + } + }, + "type": [ + "null", + "object" + ] + }, + "role": { + "$ref": "#/definitions/team/definitions/role" + }, + "two_factor_authentication": { + "$ref": "#/definitions/team-member/definitions/two_factor_authentication" + }, + "updated_at": { + "$ref": "#/definitions/team-member/definitions/updated_at" + }, + "user": { + "description": "user information for the membership", + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + }, + "name": { + "$ref": "#/definitions/account/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + } + }, + "team-monthly-usage": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "Usage for an enterprise team at a monthly resolution.", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Team Monthly Usage", + "type": [ + "object" + ], + "definitions": { + "addons": { + "description": "total add-on credits used", + "example": 250.0, + "readOnly": true, + "type": [ + "number" + ] + }, + "app_usage_monthly": { + "description": "Usage for an app at a monthly resolution.", + "type": [ + "object" + ], + "properties": { + "addons": { + "$ref": "#/definitions/team-monthly-usage/definitions/addons" + }, + "app_name": { + "$ref": "#/definitions/app/definitions/name" + }, + "data": { + "$ref": "#/definitions/team-monthly-usage/definitions/data" + }, + "dynos": { + "$ref": "#/definitions/team-monthly-usage/definitions/dynos" + }, + "partner": { + "$ref": "#/definitions/team-monthly-usage/definitions/partner" + } + } + }, + "connect": { + "description": "average connect rows synced", + "example": 15000, + "readOnly": true, + "type": [ + "number" + ] + }, + "data": { + "description": "total add-on credits used for first party add-ons", + "example": 34.89, + "readOnly": true, + "type": [ + "number" + ] + }, + "dynos": { + "description": "dynos used", + "example": 1.548, + "readOnly": true, + "type": [ + "number" + ] + }, + "id": { + "description": "team identifier", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "month": { + "description": "year and month of the usage", + "example": "2019-01", + "pattern": "^[0-9]{4}-[0-9]{2}$", + "readOnly": true, + "type": [ + "string" + ] + }, + "name": { + "description": "name of the team", + "example": "ops", + "readOnly": true, + "type": [ + "string" + ] + }, + "partner": { + "description": "total add-on credits used for third party add-ons", + "example": 12.34, + "readOnly": true, + "type": [ + "number" + ] + }, + "space": { + "description": "space credits used", + "example": 1.548, + "readOnly": true, + "type": [ + "number" + ] + }, + "start_date": { + "description": "range start date", + "example": "2019-01", + "pattern": "^[0-9]{4}-[0-9]{2}$", + "readOnly": true, + "type": [ + "string" + ] + }, + "end_date": { + "description": "range end date", + "example": "2019-02", + "pattern": "^[0-9]{4}-[0-9]{2}$", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Retrieves usage for an enterprise team for a range of months. Start and end dates can be specified as query parameters using the date, YYYY-MM. If no end date is specified, one month of usage is returned. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list).\n", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fid)}/usage/monthly", + "method": "GET", + "title": "Info", + "schema": { + "properties": { + "start": { + "$ref": "#/definitions/team-monthly-usage/definitions/start_date" + }, + "end": { + "$ref": "#/definitions/team-monthly-usage/definitions/end_date" + } + }, + "required": [ + "start" + ], + "type": [ + "object" + ] + }, + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-monthly-usage" + }, + "type": [ + "array" + ] + } + } + ], + "properties": { + "addons": { + "$ref": "#/definitions/team-monthly-usage/definitions/addons" + }, + "apps": { + "description": "app usage in the team", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/team-monthly-usage/definitions/app_usage_monthly" + } + }, + "connect": { + "$ref": "#/definitions/team-monthly-usage/definitions/connect" + }, + "data": { + "$ref": "#/definitions/team-monthly-usage/definitions/data" + }, + "dynos": { + "$ref": "#/definitions/team-monthly-usage/definitions/dynos" + }, + "id": { + "$ref": "#/definitions/team-monthly-usage/definitions/id" + }, + "month": { + "$ref": "#/definitions/team-monthly-usage/definitions/month" + }, + "name": { + "$ref": "#/definitions/team-monthly-usage/definitions/name" + }, + "partner": { + "$ref": "#/definitions/team-monthly-usage/definitions/partner" + }, + "space": { + "$ref": "#/definitions/team-monthly-usage/definitions/space" + } + } + }, + "team-preferences": { + "description": "Tracks a Team's Preferences", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Team Preferences", + "type": [ + "object" + ], + "definitions": { + "default-permission": { + "description": "The default permission used when adding new members to the team", + "example": "member", + "readOnly": false, + "enum": [ + "admin", + "member", + "viewer", + null + ], + "type": [ + "null", + "string" + ] + }, + "identity": { + "$ref": "#/definitions/team/definitions/identity" + }, + "addons-controls": { + "description": "Whether add-on service rules should be applied to add-on installations", + "example": true, + "readOnly": false, + "type": [ + "boolean", + "null" + ] + } + }, + "links": [ + { + "description": "Retrieve Team Preferences", + "href": "/teams/{(%23%2Fdefinitions%2Fteam-preferences%2Fdefinitions%2Fidentity)}/preferences", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/team-preferences" + }, + "title": "List" + }, + { + "description": "Update Team Preferences", + "href": "/teams/{(%23%2Fdefinitions%2Fteam-preferences%2Fdefinitions%2Fidentity)}/preferences", + "method": "PATCH", + "rel": "update", + "schema": { + "type": [ + "object" + ], + "properties": { + "addons-controls": { + "$ref": "#/definitions/team-preferences/definitions/addons-controls" + } + } + }, + "targetSchema": { + "$ref": "#/definitions/team-preferences" + }, + "title": "Update" + } + ], + "properties": { + "default-permission": { + "$ref": "#/definitions/team-preferences/definitions/default-permission" + }, + "addons-controls": { + "$ref": "#/definitions/team-preferences/definitions/addons-controls" + } + } + }, + "team-space": { + "description": "A space is an isolated, highly available, secure app execution environment.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Team Space", + "type": [ + "object" + ], + "links": [ + { + "description": "List spaces owned by the team", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/spaces", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/space" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ] + }, + "team": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "Teams allow you to manage access to a shared group of applications and other resources.", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Team", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when the team was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "credit_card_collections": { + "description": "whether charges incurred by the team are paid by credit card.", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "default": { + "description": "whether to use this team when none is specified", + "example": true, + "readOnly": false, + "type": [ + "boolean" + ] + }, + "enterprise_account": { + "type": [ + "null", + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/enterprise-account/definitions/id" + }, + "name": { + "$ref": "#/definitions/enterprise-account/definitions/name" + } + } + }, + "id": { + "description": "unique identifier of team", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/team/definitions/name" + }, + { + "$ref": "#/definitions/team/definitions/id" + } + ] + }, + "identity_provider": { + "description": "Identity Provider associated with the Team", + "strictProperties": true, + "type": [ + "null", + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/identity-provider/definitions/id" + }, + "name": { + "$ref": "#/definitions/identity-provider/definitions/name" + }, + "owner": { + "$ref": "#/definitions/identity-provider/definitions/owner" + } + } + }, + "device_data": { + "type": [ + "string", + "null" + ], + "description": "Device data string generated by the client", + "example": "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" + }, + "nonce": { + "type": [ + "string", + "null" + ], + "description": "Nonce generated by Braintree hosted fields form", + "example": "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" + }, + "address_1": { + "type": [ + "string" + ], + "description": "street address line 1", + "example": "40 Hickory Lane" + }, + "address_2": { + "type": [ + "string", + "null" + ], + "description": "street address line 2", + "example": "Suite 103" + }, + "card_number": { + "type": [ + "string", + "null" + ], + "description": "encrypted card number of payment method", + "example": "encrypted-card-number" + }, + "city": { + "type": [ + "string" + ], + "description": "city", + "example": "San Francisco" + }, + "country": { + "type": [ + "string" + ], + "description": "country", + "example": "US" + }, + "cvv": { + "type": [ + "string", + "null" + ], + "description": "card verification value", + "example": "123" + }, + "expiration_month": { + "type": [ + "string", + "null" + ], + "description": "expiration month", + "example": "11" + }, + "expiration_year": { + "type": [ + "string", + "null" + ], + "description": "expiration year", + "example": "2014" + }, + "first_name": { + "type": [ + "string" + ], + "description": "the first name for payment method", + "example": "Jason" + }, + "last_name": { + "type": [ + "string" + ], + "description": "the last name for payment method", + "example": "Walker" + }, + "other": { + "type": [ + "string", + "null" + ], + "description": "metadata", + "example": "Additional information for payment method" + }, + "postal_code": { + "type": [ + "string" + ], + "description": "postal code", + "example": "90210" + }, + "state": { + "type": [ + "string" + ], + "description": "state", + "example": "CA" + }, + "membership_limit": { + "description": "upper limit of members allowed in a team.", + "example": 25, + "readOnly": true, + "type": [ + "number", + "null" + ] + }, + "name": { + "description": "unique name of team", + "example": "example", + "readOnly": true, + "type": [ + "string" + ] + }, + "provisioned_licenses": { + "description": "whether the team is provisioned licenses by salesforce.", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "role": { + "description": "role in the team", + "enum": [ + "admin", + "collaborator", + "member", + "owner", + null + ], + "example": "admin", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "type": { + "description": "type of team.", + "example": "team", + "enum": [ + "enterprise", + "team" + ], + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when the team was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "List teams in which you are a member.", + "href": "/teams", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Info for a team.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/team" + }, + "title": "Info" + }, + { + "description": "Update team properties.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "default": { + "$ref": "#/definitions/team/definitions/default" + }, + "name": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team" + }, + "title": "Update" + }, + { + "description": "Create a new team.", + "href": "/teams", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/team/definitions/name" + }, + "address_1": { + "$ref": "#/definitions/team/definitions/address_1" + }, + "address_2": { + "$ref": "#/definitions/team/definitions/address_2" + }, + "card_number": { + "$ref": "#/definitions/team/definitions/card_number" + }, + "city": { + "$ref": "#/definitions/team/definitions/city" + }, + "country": { + "$ref": "#/definitions/team/definitions/country" + }, + "cvv": { + "$ref": "#/definitions/team/definitions/cvv" + }, + "expiration_month": { + "$ref": "#/definitions/team/definitions/expiration_month" + }, + "expiration_year": { + "$ref": "#/definitions/team/definitions/expiration_year" + }, + "first_name": { + "$ref": "#/definitions/team/definitions/first_name" + }, + "last_name": { + "$ref": "#/definitions/team/definitions/last_name" + }, + "other": { + "$ref": "#/definitions/team/definitions/other" + }, + "postal_code": { + "$ref": "#/definitions/team/definitions/postal_code" + }, + "state": { + "$ref": "#/definitions/team/definitions/state" + }, + "nonce": { + "$ref": "#/definitions/team/definitions/nonce" + }, + "device_data": { + "$ref": "#/definitions/team/definitions/device_data" + } + }, + "required": [ + "name" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team" + }, + "title": "Create" + }, + { + "description": "Delete an existing team.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/team" + }, + "title": "Delete" + }, + { + "description": "List teams for an enterprise account.", + "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fidentity)}/teams", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team" + }, + "type": [ + "array" + ] + }, + "title": "List by Enterprise Account" + }, + { + "description": "Create a team in an enterprise account.", + "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fidentity)}/teams", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "required": [ + "name" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team" + }, + "title": "Create in Enterprise Account" + } + ], + "properties": { + "id": { + "$ref": "#/definitions/team/definitions/id" + }, + "created_at": { + "$ref": "#/definitions/team/definitions/created_at" + }, + "credit_card_collections": { + "$ref": "#/definitions/team/definitions/credit_card_collections" + }, + "default": { + "$ref": "#/definitions/team/definitions/default" + }, + "enterprise_account": { + "$ref": "#/definitions/team/definitions/enterprise_account" + }, + "identity_provider": { + "$ref": "#/definitions/team/definitions/identity_provider" + }, + "membership_limit": { + "$ref": "#/definitions/team/definitions/membership_limit" + }, + "name": { + "$ref": "#/definitions/team/definitions/name" + }, + "provisioned_licenses": { + "$ref": "#/definitions/team/definitions/provisioned_licenses" + }, + "role": { + "$ref": "#/definitions/team/definitions/role" + }, + "type": { + "$ref": "#/definitions/team/definitions/type" + }, + "updated_at": { + "$ref": "#/definitions/team/definitions/updated_at" + } + } + }, + "test-case": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Test Case", + "description": "A single test case belonging to a test run", + "stability": "prototype", + "strictProperties": true, + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "unique identifier of a test case", + "readOnly": true, + "format": "uuid", + "type": [ + "string" + ] + }, + "description": { + "description": "description of the test case", + "type": [ + "string" + ] + }, + "diagnostic": { + "description": "meta information about the test case", + "type": [ + "string" + ] + }, + "directive": { + "description": "special note about the test case e.g. skipped, todo", + "type": [ + "string" + ] + }, + "passed": { + "description": "whether the test case was successful", + "type": [ + "boolean" + ] + }, + "number": { + "description": "the test number", + "type": [ + "integer" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/test-case/definitions/id" + } + ] + }, + "created_at": { + "description": "when test case was created", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when test case was updated", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "List test cases", + "href": "/test-runs/{(%23%2Fdefinitions%2Ftest-run%2Fdefinitions%2Fid)}/test-cases", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/test-case" + } + }, + "type": [ + "array" + ], + "title": "List" + } + ], + "properties": { + "id": { + "$ref": "#/definitions/test-case/definitions/id" + }, + "created_at": { + "$ref": "#/definitions/test-case/definitions/created_at" + }, + "updated_at": { + "$ref": "#/definitions/test-case/definitions/updated_at" + }, + "description": { + "$ref": "#/definitions/test-case/definitions/description" + }, + "diagnostic": { + "$ref": "#/definitions/test-case/definitions/diagnostic" + }, + "directive": { + "$ref": "#/definitions/test-case/definitions/directive" + }, + "passed": { + "$ref": "#/definitions/test-case/definitions/passed" + }, + "number": { + "$ref": "#/definitions/test-case/definitions/number" + }, + "test_node": { + "description": "the test node which executed this test case", + "properties": { + "id": { + "$ref": "#/definitions/test-node/definitions/identity" + } + }, + "type": [ + "object" + ] + }, + "test_run": { + "description": "the test run which owns this test case", + "properties": { + "id": { + "$ref": "#/definitions/test-run/definitions/identity" + } + }, + "type": [ + "object" + ] + } + } + }, + "test-node": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Test Node", + "description": "A single test node belonging to a test run", + "stability": "prototype", + "strictProperties": true, + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "unique identifier of a test node", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "attach_url": { + "description": "a URL to stream output from for debug runs or null for non-debug runs", + "example": "rendezvous://rendezvous.runtime.heroku.com:5000/{rendezvous-id}", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "created_at": { + "description": "when test node was created", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "error_status": { + "description": "the status of the test run when the error occured", + "type": [ + "string", + "null" + ] + }, + "exit_code": { + "description": "the exit code of the test script", + "type": [ + "integer", + "null" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/test-node/definitions/id" + } + ] + }, + "index": { + "description": "The index of the test node", + "type": [ + "integer" + ] + }, + "message": { + "description": "human friendly message indicating reason for an error", + "type": [ + "string", + "null" + ] + }, + "output_stream_url": { + "description": "the streaming output for the test node", + "example": "https://example.com/output.log", + "type": [ + "string" + ] + }, + "setup_stream_url": { + "description": "the streaming test setup output for the test node", + "example": "https://example.com/test-setup.log", + "type": [ + "string" + ] + }, + "status": { + "description": "current state of the test run", + "enum": [ + "pending", + "cancelled", + "creating", + "building", + "running", + "succeeded", + "failed", + "errored", + "debugging" + ], + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when test node was updated", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "List test nodes", + "href": "/test-runs/{(%23%2Fdefinitions%2Ftest-run%2Fdefinitions%2Fidentity)}/test-nodes", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/test-node" + } + }, + "type": [ + "array" + ], + "title": "List" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/test-node/definitions/created_at" + }, + "dyno": { + "description": "the dyno which belongs to this test node", + "properties": { + "id": { + "$ref": "#/definitions/dyno/definitions/identity" + }, + "attach_url": { + "$ref": "#/definitions/test-node/definitions/attach_url" + } + }, + "type": [ + "object", + "null" + ] + }, + "error_status": { + "$ref": "#/definitions/test-node/definitions/error_status" + }, + "exit_code": { + "$ref": "#/definitions/test-node/definitions/exit_code" + }, + "id": { + "$ref": "#/definitions/test-node/definitions/identity" + }, + "index": { + "$ref": "#/definitions/test-node/definitions/index" + }, + "message": { + "$ref": "#/definitions/test-node/definitions/message" + }, + "output_stream_url": { + "$ref": "#/definitions/test-node/definitions/output_stream_url" + }, + "pipeline": { + "description": "the pipeline which owns this test node", + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/identity" + } + }, + "type": [ + "object" + ] + }, + "setup_stream_url": { + "$ref": "#/definitions/test-node/definitions/setup_stream_url" + }, + "status": { + "$ref": "#/definitions/test-node/definitions/status" + }, + "updated_at": { + "$ref": "#/definitions/test-node/definitions/updated_at" + }, + "test_run": { + "description": "the test run which owns this test node", + "properties": { + "id": { + "$ref": "#/definitions/test-run/definitions/identity" + } + }, + "type": [ + "object" + ] + } + } + }, + "test-run": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Test Run", + "description": "An execution or trial of one or more tests", + "stability": "prototype", + "strictProperties": true, + "type": [ + "object" + ], + "definitions": { + "actor_email": { + "description": "the email of the actor triggering the test run", + "type": [ + "string" + ], + "format": "email" + }, + "clear_cache": { + "description": "whether the test was run with an empty cache", + "type": [ + "boolean", + "null" + ] + }, + "commit_branch": { + "description": "the branch of the repository that the test run concerns", + "type": [ + "string" + ] + }, + "commit_message": { + "description": "the message for the commit under test", + "type": [ + "string" + ] + }, + "commit_sha": { + "description": "the SHA hash of the commit under test", + "type": [ + "string" + ] + }, + "debug": { + "description": "whether the test run was started for interactive debugging", + "type": [ + "boolean" + ] + }, + "app_setup": { + "description": "the app setup for the test run", + "type": [ + "null", + "object" + ] + }, + "id": { + "description": "unique identifier of a test run", + "readOnly": true, + "format": "uuid", + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/test-run/definitions/id" + } + ] + }, + "created_at": { + "description": "when test run was created", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "message": { + "description": "human friendly message indicating reason for an error", + "type": [ + "string", + "null" + ] + }, + "number": { + "description": "the auto incrementing test run number", + "type": [ + "integer" + ] + }, + "source_blob_url": { + "description": "The download location for the source code to be tested", + "type": [ + "string" + ] + }, + "status": { + "description": "current state of the test run", + "enum": [ + "pending", + "cancelled", + "creating", + "building", + "running", + "succeeded", + "failed", + "errored", + "debugging" + ], + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when test-run was updated", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "warning_message": { + "description": "human friently warning emitted during the test run", + "type": [ + "string", + "null" + ] + } + }, + "links": [ + { + "description": "Create a new test-run.", + "href": "/test-runs", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "commit_branch": { + "$ref": "#/definitions/test-run/definitions/commit_branch" + }, + "commit_message": { + "$ref": "#/definitions/test-run/definitions/commit_message" + }, + "commit_sha": { + "$ref": "#/definitions/test-run/definitions/commit_sha" + }, + "debug": { + "$ref": "#/definitions/test-run/definitions/debug" + }, + "organization": { + "$ref": "#/definitions/team/definitions/identity" + }, + "pipeline": { + "$ref": "#/definitions/pipeline/definitions/identity" + }, + "source_blob_url": { + "$ref": "#/definitions/test-run/definitions/source_blob_url" + } + }, + "required": [ + "commit_branch", + "commit_message", + "commit_sha", + "pipeline", + "source_blob_url" + ], + "type": [ + "object" + ] + }, + "title": "Create" + }, + { + "description": "Info for existing test-run.", + "href": "/test-runs/{(%23%2Fdefinitions%2Ftest-run%2Fdefinitions%2Fid)}", + "method": "GET", + "rel": "self", + "title": "Info" + }, + { + "description": "List existing test-runs for a pipeline.", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/test-runs", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/test-run" + } + }, + "type": [ + "array" + ], + "title": "List" + }, + { + "description": "Info for existing test-run by Pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/test-runs/{(%23%2Fdefinitions%2Ftest-run%2Fdefinitions%2Fnumber)}", + "method": "GET", + "rel": "self", + "title": "Info By Pipeline" + }, + { + "description": "Update a test-run's status.", + "href": "/test-runs/{(%23%2Fdefinitions%2Ftest-run%2Fdefinitions%2Fnumber)}", + "method": "PATCH", + "rel": "self", + "title": "Update", + "schema": { + "properties": { + "status": { + "$ref": "#/definitions/test-run/definitions/status" + }, + "message": { + "$ref": "#/definitions/test-run/definitions/message" + } + }, + "required": [ + "status", + "message" + ], + "type": [ + "object" + ] + } + } + ], + "properties": { + "actor_email": { + "$ref": "#/definitions/test-run/definitions/actor_email" + }, + "clear_cache": { + "$ref": "#/definitions/test-run/definitions/clear_cache" + }, + "commit_branch": { + "$ref": "#/definitions/test-run/definitions/commit_branch" + }, + "commit_message": { + "$ref": "#/definitions/test-run/definitions/commit_message" + }, + "commit_sha": { + "$ref": "#/definitions/test-run/definitions/commit_sha" + }, + "debug": { + "$ref": "#/definitions/test-run/definitions/debug" + }, + "app_setup": { + "$ref": "#/definitions/test-run/definitions/app_setup" + }, + "created_at": { + "$ref": "#/definitions/test-run/definitions/created_at" + }, + "dyno": { + "description": "the type of dynos used for this test-run", + "properties": { + "size": { + "$ref": "#/definitions/dyno/definitions/size" + } + }, + "type": [ + "null", + "object" + ] + }, + "id": { + "$ref": "#/definitions/test-run/definitions/id" + }, + "message": { + "$ref": "#/definitions/test-run/definitions/message" + }, + "number": { + "$ref": "#/definitions/test-run/definitions/number" + }, + "organization": { + "description": "the team that owns this test-run", + "properties": { + "name": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "type": [ + "null", + "object" + ] + }, + "pipeline": { + "description": "the pipeline which owns this test-run", + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/identity" + } + }, + "type": [ + "object" + ] + }, + "status": { + "$ref": "#/definitions/test-run/definitions/status" + }, + "source_blob_url": { + "$ref": "#/definitions/test-run/definitions/source_blob_url" + }, + "updated_at": { + "$ref": "#/definitions/test-run/definitions/updated_at" + }, + "user": { + "$ref": "#/definitions/account" + }, + "warning_message": { + "$ref": "#/definitions/test-run/definitions/warning_message" + } + } + }, + "user-preferences": { + "description": "Tracks a user's preferences and message dismissals", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - User Preferences", + "type": [ + "object" + ], + "definitions": { + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/user-preferences/definitions/self" + } + ] + }, + "self": { + "description": "Implicit reference to currently authorized user", + "enum": [ + "~" + ], + "example": "~", + "readOnly": true, + "type": [ + "string" + ] + }, + "timezone": { + "description": "User's default timezone", + "example": "UTC", + "readOnly": false, + "type": [ + "string", + "null" + ] + }, + "default-organization": { + "description": "User's default team", + "example": "sushi-inc", + "readOnly": false, + "type": [ + "string", + "null" + ] + }, + "dismissed-github-banner": { + "description": "Whether the user has dismissed the GitHub link banner", + "example": true, + "readOnly": false, + "type": [ + "boolean", + "null" + ] + }, + "dismissed-getting-started": { + "description": "Whether the user has dismissed the getting started banner", + "example": true, + "readOnly": false, + "type": [ + "boolean", + "null" + ] + }, + "dismissed-org-access-controls": { + "description": "Whether the user has dismissed the Organization Access Controls banner", + "example": true, + "readOnly": false, + "type": [ + "boolean", + "null" + ] + }, + "dismissed-org-wizard-notification": { + "description": "Whether the user has dismissed the Organization Wizard", + "example": true, + "readOnly": false, + "type": [ + "boolean", + "null" + ] + }, + "dismissed-pipelines-banner": { + "description": "Whether the user has dismissed the Pipelines banner", + "example": true, + "readOnly": false, + "type": [ + "boolean", + "null" + ] + }, + "dismissed-pipelines-github-banner": { + "description": "Whether the user has dismissed the GitHub banner on a pipeline overview", + "example": true, + "readOnly": false, + "type": [ + "boolean", + "null" + ] + }, + "dismissed-pipelines-github-banners": { + "description": "Which pipeline uuids the user has dismissed the GitHub banner for", + "example": [ + "96c68759-f310-4910-9867-e0b062064098" + ], + "readOnly": false, + "type": [ + "null", + "array" + ], + "items": { + "$ref": "#/definitions/pipeline/definitions/id" + } + }, + "dismissed-sms-banner": { + "description": "Whether the user has dismissed the 2FA SMS banner", + "example": true, + "readOnly": false, + "type": [ + "boolean", + "null" + ] + } + }, + "links": [ + { + "description": "Retrieve User Preferences", + "href": "/users/{(%23%2Fdefinitions%2Fuser-preferences%2Fdefinitions%2Fidentity)}/preferences", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/user-preferences" + }, + "title": "List" + }, + { + "description": "Update User Preferences", + "href": "/users/{(%23%2Fdefinitions%2Fuser-preferences%2Fdefinitions%2Fidentity)}/preferences", + "method": "PATCH", + "rel": "update", + "schema": { + "type": [ + "object" + ], + "properties": { + "timezone": { + "$ref": "#/definitions/user-preferences/definitions/timezone" + }, + "default-organization": { + "$ref": "#/definitions/user-preferences/definitions/default-organization" + }, + "dismissed-github-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-github-banner" + }, + "dismissed-getting-started": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-getting-started" + }, + "dismissed-org-access-controls": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-org-access-controls" + }, + "dismissed-org-wizard-notification": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-org-wizard-notification" + }, + "dismissed-pipelines-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-banner" + }, + "dismissed-pipelines-github-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-github-banner" + }, + "dismissed-pipelines-github-banners": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-github-banners" + }, + "dismissed-sms-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-sms-banner" + } + } + }, + "targetSchema": { + "$ref": "#/definitions/user-preferences" + }, + "title": "Update" + } + ], + "properties": { + "timezone": { + "$ref": "#/definitions/user-preferences/definitions/timezone" + }, + "default-organization": { + "$ref": "#/definitions/user-preferences/definitions/default-organization" + }, + "dismissed-github-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-github-banner" + }, + "dismissed-getting-started": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-getting-started" + }, + "dismissed-org-access-controls": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-org-access-controls" + }, + "dismissed-org-wizard-notification": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-org-wizard-notification" + }, + "dismissed-pipelines-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-banner" + }, + "dismissed-pipelines-github-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-github-banner" + }, + "dismissed-pipelines-github-banners": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-github-banners" + }, + "dismissed-sms-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-sms-banner" + } + } + }, + "vpn-connection": { + "description": "[VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Private Spaces VPN", + "type": [ + "object" + ], + "definitions": { + "name": { + "description": "VPN Name", + "example": "office", + "type": [ + "string" + ] + }, + "public_ip": { + "description": "Public IP of VPN customer gateway", + "example": "35.161.69.30", + "type": [ + "string" + ] + }, + "routable_cidrs": { + "description": "Routable CIDRs of VPN", + "type": [ + "array" + ], + "items": { + "example": "172.16.0.0/16", + "type": [ + "string" + ] + } + }, + "id": { + "description": "VPN ID", + "example": "123456789012", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/vpn-connection/definitions/id" + }, + { + "$ref": "#/definitions/vpn-connection/definitions/name" + } + ] + }, + "space_cidr_block": { + "description": "CIDR Block of the Private Space", + "example": "10.0.0.0/16", + "readOnly": true, + "type": [ + "string" + ] + }, + "ike_version": { + "description": "IKE Version", + "example": 1, + "readOnly": true, + "type": [ + "integer" + ] + }, + "tunnel": { + "description": "Tunnel info", + "readOnly": true, + "type": [ + "object" + ], + "properties": { + "last_status_change": { + "description": "Timestamp of last status changed", + "example": "2016-10-25T22:09:05Z", + "type": [ + "string" + ] + }, + "ip": { + "description": "Public IP address for the tunnel", + "example": "52.44.146.197", + "type": [ + "string" + ] + }, + "customer_ip": { + "description": "Public IP address for the customer side of the tunnel", + "example": "52.44.146.197", + "type": [ + "string" + ] + }, + "pre_shared_key": { + "description": "Pre-shared key", + "example": "secret", + "type": [ + "string" + ] + }, + "status": { + "description": "Status of the tunnel", + "enum": [ + "UP", + "DOWN" + ], + "example": "UP", + "type": [ + "string" + ] + }, + "status_message": { + "description": "Details of the status", + "example": "status message", + "type": [ + "string" + ] + } + } + }, + "status": { + "description": "Status of the VPN", + "enum": [ + "pending", + "provisioning", + "active", + "deprovisioning", + "failed" + ], + "example": "active", + "readOnly": true, + "type": [ + "string" + ] + }, + "status_message": { + "description": "Details of the status", + "example": "supplied CIDR block already in use", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "properties": { + "id": { + "$ref": "#/definitions/vpn-connection/definitions/id" + }, + "name": { + "$ref": "#/definitions/vpn-connection/definitions/name" + }, + "public_ip": { + "$ref": "#/definitions/vpn-connection/definitions/public_ip" + }, + "routable_cidrs": { + "$ref": "#/definitions/vpn-connection/definitions/routable_cidrs" + }, + "space_cidr_block": { + "$ref": "#/definitions/vpn-connection/definitions/space_cidr_block" + }, + "tunnels": { + "items": { + "$ref": "#/definitions/vpn-connection/definitions/tunnel" + }, + "type": [ + "array" + ] + }, + "ike_version": { + "$ref": "#/definitions/vpn-connection/definitions/ike_version" + }, + "status": { + "$ref": "#/definitions/vpn-connection/definitions/status" + }, + "status_message": { + "$ref": "#/definitions/vpn-connection/definitions/status_message" + } + }, + "links": [ + { + "description": "Create a new VPN connection in a private space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/vpn-connections", + "rel": "create", + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/vpn-connection/definitions/name" + }, + "public_ip": { + "$ref": "#/definitions/vpn-connection/definitions/public_ip" + }, + "routable_cidrs": { + "$ref": "#/definitions/vpn-connection/definitions/routable_cidrs" + } + }, + "required": [ + "name", + "public_ip", + "routable_cidrs" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/vpn-connection" + }, + "method": "POST", + "title": "Create" + }, + { + "description": "Destroy existing VPN Connection", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/vpn-connections/{(%23%2Fdefinitions%2Fvpn-connection%2Fdefinitions%2Fidentity)}", + "rel": "empty", + "method": "DELETE", + "targetSchema": { + "$ref": "#/definitions/vpn-connection" + }, + "title": "Destroy" + }, + { + "description": "List VPN connections for a space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/vpn-connections", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/vpn-connection" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Info for an existing vpn-connection.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/vpn-connections/{(%23%2Fdefinitions%2Fvpn-connection%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/vpn-connection" + }, + "title": "Info" + }, + { + "description": "Update a VPN connection in a private space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/vpn-connections/{(%23%2Fdefinitions%2Fvpn-connection%2Fdefinitions%2Fidentity)}", + "rel": "update", + "schema": { + "properties": { + "routable_cidrs": { + "$ref": "#/definitions/vpn-connection/definitions/routable_cidrs" + } + }, + "required": [ + "routable_cidrs" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/vpn-connection" + }, + "method": "PATCH", + "title": "Update" + } + ] + } + }, + "properties": { + "account-delinquency": { + "$ref": "#/definitions/account-delinquency" + }, + "account-feature": { + "$ref": "#/definitions/account-feature" + }, + "account": { + "$ref": "#/definitions/account" + }, + "add-on-action": { + "$ref": "#/definitions/add-on-action" + }, + "add-on-attachment": { + "$ref": "#/definitions/add-on-attachment" + }, + "add-on-config": { + "$ref": "#/definitions/add-on-config" + }, + "add-on-plan-action": { + "$ref": "#/definitions/add-on-plan-action" + }, + "add-on-region-capability": { + "$ref": "#/definitions/add-on-region-capability" + }, + "add-on-service": { + "$ref": "#/definitions/add-on-service" + }, + "add-on-webhook-delivery": { + "$ref": "#/definitions/add-on-webhook-delivery" + }, + "add-on-webhook-event": { + "$ref": "#/definitions/add-on-webhook-event" + }, + "add-on-webhook": { + "$ref": "#/definitions/add-on-webhook" + }, + "add-on": { + "$ref": "#/definitions/add-on" + }, + "allowed-add-on-service": { + "$ref": "#/definitions/allowed-add-on-service" + }, + "app-feature": { + "$ref": "#/definitions/app-feature" + }, + "app-setup": { + "$ref": "#/definitions/app-setup" + }, + "app-transfer": { + "$ref": "#/definitions/app-transfer" + }, + "app-webhook-delivery": { + "$ref": "#/definitions/app-webhook-delivery" + }, + "app-webhook-event": { + "$ref": "#/definitions/app-webhook-event" + }, + "app-webhook": { + "$ref": "#/definitions/app-webhook" + }, + "app": { + "$ref": "#/definitions/app" + }, + "archive": { + "$ref": "#/definitions/archive" + }, + "audit-trail-event": { + "$ref": "#/definitions/audit-trail-event" + }, + "build": { + "$ref": "#/definitions/build" + }, + "buildpack-installation": { + "$ref": "#/definitions/buildpack-installation" + }, + "collaborator": { + "$ref": "#/definitions/collaborator" + }, + "config-var": { + "$ref": "#/definitions/config-var" + }, + "credit": { + "$ref": "#/definitions/credit" + }, + "domain": { + "$ref": "#/definitions/domain" + }, + "dyno-size": { + "$ref": "#/definitions/dyno-size" + }, + "dyno": { + "$ref": "#/definitions/dyno" + }, + "enterprise-account-daily-usage": { + "$ref": "#/definitions/enterprise-account-daily-usage" + }, + "enterprise-account-member": { + "$ref": "#/definitions/enterprise-account-member" + }, + "enterprise-account-monthly-usage": { + "$ref": "#/definitions/enterprise-account-monthly-usage" + }, + "enterprise-account": { + "$ref": "#/definitions/enterprise-account" + }, + "filter-apps": { + "$ref": "#/definitions/filter-apps" + }, + "formation": { + "$ref": "#/definitions/formation" + }, + "identity-provider": { + "$ref": "#/definitions/identity-provider" + }, + "inbound-ruleset": { + "$ref": "#/definitions/inbound-ruleset" + }, + "invoice-address": { + "$ref": "#/definitions/invoice-address" + }, + "invoice": { + "$ref": "#/definitions/invoice" + }, + "key": { + "$ref": "#/definitions/key" + }, + "log-drain": { + "$ref": "#/definitions/log-drain" + }, + "log-session": { + "$ref": "#/definitions/log-session" + }, + "oauth-authorization": { + "$ref": "#/definitions/oauth-authorization" + }, + "oauth-client": { + "$ref": "#/definitions/oauth-client" + }, + "oauth-grant": { + "$ref": "#/definitions/oauth-grant" + }, + "oauth-token": { + "$ref": "#/definitions/oauth-token" + }, + "password-reset": { + "$ref": "#/definitions/password-reset" + }, + "peering-info": { + "$ref": "#/definitions/peering-info" + }, + "peering": { + "$ref": "#/definitions/peering" + }, + "permission-entity": { + "$ref": "#/definitions/permission-entity" + }, + "pipeline-build": { + "$ref": "#/definitions/pipeline-build" + }, + "pipeline-config-var": { + "$ref": "#/definitions/pipeline-config-var" + }, + "pipeline-coupling": { + "$ref": "#/definitions/pipeline-coupling" + }, + "pipeline-deployment": { + "$ref": "#/definitions/pipeline-deployment" + }, + "pipeline-promotion-target": { + "$ref": "#/definitions/pipeline-promotion-target" + }, + "pipeline-promotion": { + "$ref": "#/definitions/pipeline-promotion" + }, + "pipeline-release": { + "$ref": "#/definitions/pipeline-release" + }, + "pipeline-stack": { + "$ref": "#/definitions/pipeline-stack" + }, + "pipeline-transfer": { + "$ref": "#/definitions/pipeline-transfer" + }, + "pipeline": { + "$ref": "#/definitions/pipeline" + }, + "plan": { + "$ref": "#/definitions/plan" + }, + "rate-limit": { + "$ref": "#/definitions/rate-limit" + }, + "region": { + "$ref": "#/definitions/region" + }, + "release": { + "$ref": "#/definitions/release" + }, + "review-app": { + "$ref": "#/definitions/review-app" + }, + "review-app-config": { + "$ref": "#/definitions/review-app-config" + }, + "slug": { + "$ref": "#/definitions/slug" + }, + "sms-number": { + "$ref": "#/definitions/sms-number" + }, + "sni-endpoint": { + "$ref": "#/definitions/sni-endpoint" + }, + "source": { + "$ref": "#/definitions/source" + }, + "space-app-access": { + "$ref": "#/definitions/space-app-access" + }, + "space-nat": { + "$ref": "#/definitions/space-nat" + }, + "space-topology": { + "$ref": "#/definitions/space-topology" + }, + "space-transfer": { + "$ref": "#/definitions/space-transfer" + }, + "space": { + "$ref": "#/definitions/space" + }, + "stack": { + "$ref": "#/definitions/stack" + }, + "team-add-on": { + "$ref": "#/definitions/team-add-on" + }, + "team-app-collaborator": { + "$ref": "#/definitions/team-app-collaborator" + }, + "team-app-permission": { + "$ref": "#/definitions/team-app-permission" + }, + "team-app": { + "$ref": "#/definitions/team-app" + }, + "team-daily-usage": { + "$ref": "#/definitions/team-daily-usage" + }, + "team-delinquency": { + "$ref": "#/definitions/team-delinquency" + }, + "team-feature": { + "$ref": "#/definitions/team-feature" + }, + "team-invitation": { + "$ref": "#/definitions/team-invitation" + }, + "team-invoice": { + "$ref": "#/definitions/team-invoice" + }, + "team-member": { + "$ref": "#/definitions/team-member" + }, + "team-monthly-usage": { + "$ref": "#/definitions/team-monthly-usage" + }, + "team-preferences": { + "$ref": "#/definitions/team-preferences" + }, + "team-space": { + "$ref": "#/definitions/team-space" + }, + "team": { + "$ref": "#/definitions/team" + }, + "test-case": { + "$ref": "#/definitions/test-case" + }, + "test-node": { + "$ref": "#/definitions/test-node" + }, + "test-run": { + "$ref": "#/definitions/test-run" + }, + "user-preferences": { + "$ref": "#/definitions/user-preferences" + }, + "vpn-connection": { + "$ref": "#/definitions/vpn-connection" + } + }, + "description": "The platform API empowers developers to automate, extend and combine Heroku with other services.", + "id": "http://api.heroku.com/schema#", + "links": [ + { + "href": "https://api.heroku.com", + "rel": "self", + "title": "Index" + }, + { + "href": "/schema", + "method": "GET", + "rel": "self", + "title": "Schema", + "targetSchema": { + "additionalProperties": true + } + } + ], + "title": "Heroku Platform API" +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..c591755 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,7984 @@ +/** + * + * [Heroku Platform API - account-delinquency](https://devcenter.heroku.com/articles/platform-api-reference#account-delinquency) + * A Heroku account becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent accounts if their invoices remain unpaid. + */ +export interface AccountDelinquency { + /** + * scheduled time of when we will suspend your account due to delinquency + * + * @example "2024-01-01T12:00:00Z" + */ + readonly scheduled_suspension_time: string | null; + /** + * scheduled time of when we will delete your account due to delinquency + * + * @example "2024-01-01T12:00:00Z" + */ + readonly scheduled_deletion_time: string | null; +} +/** + * + * [Heroku Platform API - account-feature](https://devcenter.heroku.com/articles/platform-api-reference#account-feature) + * An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku. + */ +export interface AccountFeature { + /** + * when account feature was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of account feature + * + * @example "Causes account to example." + */ + readonly description: string; + /** + * documentation URL of account feature + * + * @example "http://devcenter.heroku.com/articles/example" + */ + readonly doc_url: string; + /** + * whether or not account feature has been enabled + * + * @example true + */ + enabled: boolean; + /** + * unique identifier of account feature + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of account feature + * + * @example "name" + */ + readonly name: string; + /** + * state of account feature + * + * @example "public" + */ + readonly state: string; + /** + * when account feature was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user readable feature name + * + * @example "My Feature" + */ + readonly display_name: string; + /** + * e-mail to send feedback about the feature + * + * @example "feedback@heroku.com" + */ + readonly feedback_email: string; +} +export interface AccountFeatureUpdatePayload { + /** + * whether or not account feature has been enabled + * + * @example true + */ + enabled: boolean; +} +/** + * + * [Heroku Platform API - account](https://devcenter.heroku.com/articles/platform-api-reference#account) + * An account represents an individual signed up to use the Heroku platform. + */ +export interface Account { + /** + * whether to allow third party web activity tracking + * + * @example true + */ + allow_tracking: boolean; + /** + * whether allowed to utilize beta Heroku features + */ + beta: boolean; + /** + * when account was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated: boolean; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * Identity Provider details for federated users. + */ + identity_provider: IdentityProvider | null; + /** + * when account last authorized with Heroku + * + * @example "2012-01-01T12:00:00Z" + */ + readonly last_login: string | null; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name: string | null; + /** + * SMS number of account + * + * @example "+1 ***-***-1234" + */ + readonly sms_number: string | null; + /** + * when account was suspended + * + * @example "2012-01-01T12:00:00Z" + */ + readonly suspended_at: string | null; + /** + * when account became delinquent + * + * @example "2012-01-01T12:00:00Z" + */ + readonly delinquent_at: string | null; + /** + * whether two-factor auth is enabled on the account + */ + readonly two_factor_authentication: boolean; + /** + * when account was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * whether account has been verified with billing information + */ + readonly verified: boolean; + /** + * country where account owner resides + * + * @example "United States" + */ + country_of_residence: string | null; + /** + * team selected by default + */ + default_organization: DefaultOrganization | null; + /** + * team selected by default + */ + default_team: DefaultTeam | null; +} +/** + * + * [Heroku Platform API - identity-provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) + * Identity Providers represent the SAML configuration of teams or an Enterprise account + */ +export interface IdentityProvider { + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate: string; + /** + * when provider record was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * URL identifier provided by the identity provider + * + * @example "https://customer-domain.idp.com" + */ + entity_id: string; + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * single log out URL for this identity provider + * + * @example "https://example.com/idp/logout" + */ + slo_target_url: string; + /** + * single sign on URL for this identity provider + * + * @example "https://example.com/idp/login" + */ + sso_target_url: string; + /** + * team associated with this identity provider + */ + organization: null | Organization; + /** + * when the identity provider record was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * entity that owns this identity provider + */ + owner: Owner; +} +/** + * + * [Heroku Platform API - team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * Teams allow you to manage access to a shared group of applications and other resources. + */ +export interface Team { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * when the team was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * whether charges incurred by the team are paid by credit card. + * + * @example true + */ + readonly credit_card_collections: boolean; + /** + * whether to use this team when none is specified + * + * @example true + */ + default: boolean; + enterprise_account: null | TeamEnterpriseAccount; + /** + * Identity Provider associated with the Team + */ + identity_provider: null | TeamIdentityProvider; + /** + * upper limit of members allowed in a team. + * + * @example 25 + */ + readonly membership_limit: number | null; + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; + /** + * whether the team is provisioned licenses by salesforce. + * + * @example true + */ + readonly provisioned_licenses: boolean; + /** + * role in the team + * + * @example "admin" + */ + readonly role: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; + /** + * type of team. + * + * @example "team" + */ + readonly type: 'enterprise' | 'team'; + /** + * when the team was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +export interface Organization { + /** + * unique name of team + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * entity that owns this identity provider + */ +export interface Owner { + /** + * unique identifier of the owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * name of the owner + * + * @example "acme" + */ + readonly name?: string; + /** + * type of the owner + * + * @example "team" + */ + readonly type: 'team' | 'enterprise-account'; +} +/** + * + * team selected by default + */ +export interface DefaultOrganization { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; +} +/** + * + * team selected by default + */ +export interface DefaultTeam { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; +} +export interface AccountUpdatePayload { + /** + * whether to allow third party web activity tracking + * + * @example true + */ + allow_tracking?: boolean; + /** + * whether allowed to utilize beta Heroku features + */ + beta?: boolean; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name?: string | null; +} +export interface AccountUpdateByUserPayload { + /** + * whether to allow third party web activity tracking + * + * @example true + */ + allow_tracking?: boolean; + /** + * whether allowed to utilize beta Heroku features + */ + beta?: boolean; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name?: string | null; +} +/** + * + * [Heroku Platform API - add-on-action](https://devcenter.heroku.com/articles/platform-api-reference#add-on-action) + * Add-on Actions are lifecycle operations for add-on provisioning and deprovisioning. They allow add-on providers to (de)provision add-ons in the background and then report back when (de)provisioning is complete. + */ +export interface AddOnAction { + +} +/** + * + * Add-ons represent add-ons that have been provisioned and attached to one or more apps. + */ +export interface AddOn { + /** + * provider actions for this specific add-on + */ + readonly actions: Array>; + /** + * identity of add-on serviceAdd-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. + */ + addon_service: { + /** + * unique identifier of this add-on-service + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly name: string; +} | AddOnService; + /** + * billing entity associated with this add-on + */ + billing_entity: BillingEntity; + /** + * billing application associated with this add-on + */ + app: App; + /** + * billed price + */ + billed_price: BilledPrice | null; + /** + * config vars exposed to the owning app by this add-on + * + * @example ["FOO","BAZ"] + */ + readonly config_vars: string[]; + /** + * when add-on was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + name: string; + /** + * identity of add-on planPlans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication. + */ + plan: { + /** + * unique identifier of this plan + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of this plan + * + * @example "heroku-postgresql:dev" + */ + readonly name: string; +} | Plan; + /** + * id of this add-on with its provider + * + * @example "abcd1234" + */ + readonly provider_id: string; + /** + * A provision message + */ + readonly provision_message?: string; + /** + * state in the add-on's lifecycle + * + * @example "provisioned" + */ + readonly state: 'provisioning' | 'provisioned' | 'deprovisioned'; + /** + * when add-on was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * URL for logging into web interface of add-on (e.g. a dashboard) + * + * @example "https://postgres.heroku.com/databases/01234567-89ab-cdef-0123-456789abcdef" + */ + readonly web_url: null | string; +} +/** + * + * [Heroku Platform API - add-on-service](https://devcenter.heroku.com/articles/platform-api-reference#add-on-service) + * Add-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. + */ +export interface AddOnService { + /** + * npm package name of the add-on service's Heroku CLI plugin + * + * @example "heroku-papertrail" + */ + readonly cli_plugin_name: string | null; + /** + * when add-on-service was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * human-readable name of the add-on service provider + * + * @example "Heroku Postgres" + */ + readonly human_name: string; + /** + * unique identifier of this add-on-service + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly name: string; + /** + * release status for add-on service + * + * @example "ga" + */ + readonly state: 'alpha' | 'beta' | 'ga' | 'shutdown'; + /** + * whether or not apps can have access to more than one instance of this add-on at the same time + */ + readonly supports_multiple_installations: boolean; + /** + * whether or not apps can have access to add-ons billed to a different app + */ + readonly supports_sharing: boolean; + /** + * when add-on-service was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * billing entity associated with this add-on + */ +export interface BillingEntity { + /** + * unique identifier of the billing entity + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * name of the billing entity + * + * @example "example" + */ + readonly name: string; + /** + * type of Object of the billing entity; new types allowed at any time. + * + * @example "app" + */ + readonly type: 'app' | 'team'; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * An app represents the program that you would like to deploy and run on Heroku. + */ +export interface App { + /** + * ACM status of this app + */ + readonly acm: boolean; + /** + * when app was archived + * + * @example "2012-01-01T12:00:00Z" + */ + readonly archived_at: null | string; + /** + * description from buildpack of app + * + * @example "Ruby/Rack" + */ + readonly buildpack_provided_description: null | string; + /** + * identity of the stack that will be used for new builds + */ + build_stack: BuildStack; + /** + * when app was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * git repo URL of app + * + * @example "https://git.heroku.com/example.git" + */ + readonly git_url: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * describes whether a Private Spaces app is externally routable or not + */ + internal_routing: boolean | null; + /** + * maintenance status of app + */ + maintenance: boolean; + /** + * unique name of app + * + * @example "example" + */ + name: string; + /** + * identity of app owner + */ + owner: AppOwner; + /** + * identity of team + */ + organization: null | AppOrganization; + /** + * identity of team + */ + team: null | AppTeam; + /** + * identity of app region + */ + region: AppRegion; + /** + * when app was released + * + * @example "2012-01-01T12:00:00Z" + */ + readonly released_at: null | string; + /** + * git repo size in bytes of app + */ + readonly repo_size: number | null; + /** + * slug size in bytes of app + */ + readonly slug_size: number | null; + /** + * identity of space + */ + space: null | Space; + /** + * identity of app stack + */ + stack: Stack; + /** + * when app was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * web URL of app + * + * @example "https://example.herokuapp.com/" + */ + readonly web_url: null | string; +} +/** + * + * billed price + */ +export interface BilledPrice { + /** + * price in cents per unit of plan + */ + readonly cents: number; + /** + * price is negotiated in a contract outside of monthly add-on billing + */ + readonly contract: boolean; + /** + * unit of price for plan + * + * @example "month" + */ + readonly unit: string; +} +/** + * + * [Heroku Platform API - plan](https://devcenter.heroku.com/articles/platform-api-reference#plan) + * Plans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication. + */ +export interface Plan { + /** + * identity of add-on service + */ + addon_service: AddonService; + /** + * when plan was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * the compliance regimes applied to an add-on plan + * + * @example ["HIPAA"] + */ + compliance: null | 'HIPAA' | Array<'PCI'>; + /** + * whether this plan is the default for its add-on service + */ + readonly default: boolean; + /** + * description of plan + * + * @example "Heroku Postgres Dev" + */ + readonly description: string; + /** + * human readable name of the add-on plan + * + * @example "Dev" + */ + readonly human_name: string; + /** + * unique identifier of this plan + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * whether this plan is installable to a Private Spaces app + */ + readonly installable_inside_private_network: boolean; + /** + * whether this plan is installable to a Common Runtime app + * + * @example true + */ + readonly installable_outside_private_network: boolean; + /** + * unique name of this plan + * + * @example "heroku-postgresql:dev" + */ + readonly name: string; + /** + * price + */ + price: Price; + /** + * whether this plan is the default for apps in Private Spaces + */ + readonly space_default: boolean; + /** + * release status for plan + * + * @example "public" + */ + readonly state: string; + /** + * when plan was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * whether this plan is publicly visible + * + * @example true + */ + readonly visible: boolean; +} +/** + * + * identity of add-on service + */ +export interface AddonService { + /** + * unique identifier of this add-on-service + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly name: string; +} +/** + * + * price + */ +export interface Price { + /** + * price in cents per unit of plan + */ + readonly cents: number; + /** + * price is negotiated in a contract outside of monthly add-on billing + */ + readonly contract: boolean; + /** + * unit of price for plan + * + * @example "month" + */ + readonly unit: string; +} +/** + * + * [Heroku Platform API - add-on-attachment](https://devcenter.heroku.com/articles/platform-api-reference#add-on-attachment) + * An add-on attachment represents a connection between an app and an add-on that it has been given access to. + */ +export interface AddOnAttachment { + /** + * identity of add-on + */ + addon: Addon; + /** + * application that is attached to add-on + */ + app: App; + /** + * when add-on attachment was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this add-on attachment + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name for this add-on attachment to this app + * + * @example "DATABASE" + */ + readonly name: string; + /** + * attachment namespace + * + * @example "role:analytics" + */ + readonly namespace: null | string; + /** + * when add-on attachment was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * URL for logging into web interface of add-on in attached app context + * + * @example "https://postgres.heroku.com/databases/01234567-89ab-cdef-0123-456789abcdef" + */ + readonly web_url: null | string; + /** + * URL for add-on partners to write to an add-on's logs + * + * @example "https://token:t.abcdef12-3456-7890-abcd-ef1234567890@1.us.logplex.io/logs" + */ + readonly log_input_url: null | string; +} +/** + * + * identity of add-on + */ +export interface Addon { + /** + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + name: string; + /** + * billing application associated with this add-on + */ + app: App; +} +export interface AddOnAttachmentCreatePayload { + /** + * unique identifier of add-on or globally unique name of the add-on + */ + addon: string; + /** + * unique identifier of app or unique name of app + */ + app: string; + /** + * name of owning app for confirmation + * + * @example "example" + */ + confirm?: string; + /** + * unique name for this add-on attachment to this app + * + * @example "DATABASE" + */ + readonly name?: string; + /** + * attachment namespace + * + * @example "role:analytics" + */ + readonly namespace?: null | string; +} +export interface AddOnAttachmentResolutionPayload { + /** + * unique name for this add-on attachment to this app + * + * @example "DATABASE" + */ + readonly addon_attachment: string; + /** + * unique name of app + * + * @example "example" + */ + app?: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly addon_service?: string; +} +/** + * + * [Heroku Platform API - add-on-config](https://devcenter.heroku.com/articles/platform-api-reference#add-on-config) + * Configuration of an Add-on + */ +export interface AddOnConfig { + /** + * unique name of the config + * + * @example "FOO" + */ + name: string; + /** + * value of the config + * + * @example "bar" + */ + value: string | null; +} +export interface AddOnConfigUpdatePayload { + config?: AddOnConfig[]; +} +/** + * + * [Heroku Platform API - add-on-plan-action](https://devcenter.heroku.com/articles/platform-api-reference#add-on-plan-action) + * Add-on Plan Actions are Provider functionality for specific add-on installations + */ +export interface AddOnPlanAction { + /** + * a unique identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * the display text shown in Dashboard + * + * @example "Example" + */ + readonly label: string; + /** + * identifier of the action to take that is sent via SSO + * + * @example "example" + */ + readonly action: string; + /** + * absolute URL to use instead of an action + * + * @example "http://example.com?resource_id=:resource_id" + */ + readonly url: string; + /** + * if the action requires the user to own the app + * + * @example true + */ + readonly requires_owner: boolean; +} +/** + * + * [Heroku Platform API - add-on-region-capability](https://devcenter.heroku.com/articles/platform-api-reference#add-on-region-capability) + * Add-on region capabilities represent the relationship between an Add-on Service and a specific Region. Only Beta and GA add-ons are returned by these endpoints. + */ +export interface AddOnRegionCapability { + /** + * unique identifier of this add-on-region-capability + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * whether the add-on can be installed to a Space + */ + readonly supports_private_networking: boolean; + /** + * Add-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. + */ + addon_service: AddOnService; + /** + * A region represents a geographic location in which your application may run. + */ + region: Region; +} +/** + * + * [Heroku Platform API - region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * A region represents a geographic location in which your application may run. + */ +export interface Region { + /** + * country where the region exists + * + * @example "United States" + */ + readonly country: string; + /** + * when region was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of region + * + * @example "United States" + */ + readonly description: string; + /** + * unique identifier of region + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * area in the country where the region exists + * + * @example "Virginia" + */ + readonly locale: string; + /** + * unique name of region + * + * @example "us" + */ + readonly name: string; + /** + * whether or not region is available for creating a Private Space + */ + readonly private_capable: boolean; + /** + * provider of underlying substrate + */ + readonly provider: Provider; + /** + * when region was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * provider of underlying substrate + */ +export interface Provider { + /** + * name of provider + * + * @example "amazon-web-services" + */ + readonly name?: string; + /** + * region name used by provider + * + * @example "us-east-1" + */ + readonly region?: 'ap-south-1' | 'eu-west-1' | 'ap-southeast-1' | 'ap-southeast-2' | 'eu-central-1' | 'eu-west-2' | 'ap-northeast-2' | 'ap-northeast-1' | 'us-east-1' | 'sa-east-1' | 'us-west-1' | 'us-west-2' | 'ca-central-1'; +} +/** + * + * Represents the delivery of a webhook notification, including its current status. + */ +export interface AppWebhookDelivery { + /** + * when the delivery was created + */ + created_at: string; + /** + * identity of event + */ + event: Event; + /** + * the delivery's unique identifier + */ + readonly id: string; + /** + * number of times a delivery has been attempted + */ + readonly num_attempts: number; + /** + * when delivery will be attempted again + */ + next_attempt_at: string | null; + /** + * last attempt of a delivery + */ + last_attempt: LastAttempt | null; + /** + * the delivery's status + * + * @example "pending" + */ + status: 'pending' | 'scheduled' | 'retrying' | 'failed' | 'succeeded'; + /** + * when the delivery was last updated + */ + updated_at: string; + /** + * identity of webhook + */ + webhook: Webhook; +} +/** + * + * identity of event + */ +export interface Event { + /** + * the event's unique identifier + */ + readonly id: string; + /** + * the type of entity that the event is related to + * + * @example "api:release" + */ + include: string; +} +/** + * + * last attempt of a delivery + */ +export interface LastAttempt { + /** + * unique identifier of attempt + */ + readonly id: string; + /** + * http response code received during attempt + */ + readonly code: number | null; + /** + * error class encountered during attempt + */ + readonly error_class: string | null; + /** + * status of an attempt + * + * @example "scheduled" + */ + status: 'scheduled' | 'succeeded' | 'failed'; + /** + * when attempt was created + */ + created_at: string; + /** + * when attempt was updated + */ + updated_at: string; +} +/** + * + * identity of webhook + */ +export interface Webhook { + /** + * the webhook's unique identifier + */ + readonly id: string; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level: 'notify' | 'sync'; +} +/** + * + * Represents a webhook event that occurred. + */ +export interface AppWebhookEvent { + /** + * when event was created + */ + created_at: string; + /** + * the event's unique identifier + */ + readonly id: string; + /** + * the type of entity that the event is related to + * + * @example "api:release" + */ + include: string; + /** + * payload of event + */ + payload: Payload; + /** + * when the event was last updated + */ + updated_at: string; +} +/** + * + * payload of event + */ +export interface Payload { + /** + * the type of event that occurred + * + * @example "create" + */ + action: string; + /** + * user that caused event + */ + actor: Actor; + /** + * the current details of the event + */ + data: Record; + /** + * previous details of the event (if any) + */ + previous_data: Record; + /** + * the type of resource associated with the event + * + * @example "release" + */ + resource: string; + /** + * the version of the details provided for the event + * + * @example "1" + */ + version: string; +} +/** + * + * user that caused event + */ +export interface Actor { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - add-on-webhook](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook) + * Represents the details of a webhook subscription + */ +export interface AddOnWebhook { + /** + * when the webhook was created + */ + created_at: string; + /** + * the webhook's unique identifier + */ + readonly id: string; + /** + * the entities that the subscription provides notifications for + */ + include: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level: 'notify' | 'sync'; + /** + * when the webhook was updated + */ + updated_at: string; + /** + * the URL where the webhook's notification requests are sent + */ + url: string; +} +export interface AddOnWebhookCreatePayload { + /** + * a custom `Authorization` header that Heroku will include with all webhook notifications + * + * @example "Bearer 9266671b2767f804c9d5809c2d384ed57d8f8ce1abd1043e1fb3fbbcb8c3" + */ + authorization?: null | string; + /** + * the entities that the subscription provides notifications for + */ + include: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level: 'notify' | 'sync'; + /** + * a value that Heroku will use to sign all webhook notification requests (the signature is included in the request’s `Heroku-Webhook-Hmac-SHA256` header) + * + * @example "dcbff0c4430a2960a2552389d587bc58d30a37a8cf3f75f8fb77abe667ad" + */ + secret?: null | string; + /** + * the URL where the webhook's notification requests are sent + */ + url: string; +} +/** + * + * add-on webhook + */ +export interface AddonWebhook { + /** + * identity of add-on. Only used for add-on partner webhooks. + */ + addon?: AddonWebhookAddon; + /** + * when the webhook was created + */ + created_at?: string; + /** + * the webhook's unique identifier + */ + readonly id?: string; + /** + * the entities that the subscription provides notifications for + */ + include?: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level?: 'notify' | 'sync'; + /** + * when the webhook was updated + */ + updated_at?: string; + /** + * the URL where the webhook's notification requests are sent + */ + url?: string; +} +/** + * + * identity of add-on. Only used for add-on partner webhooks. + */ +export interface AddonWebhookAddon { + /** + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + name: string; +} +export interface AddOnWebhookUpdatePayload { + /** + * a custom `Authorization` header that Heroku will include with all webhook notifications + * + * @example "Bearer 9266671b2767f804c9d5809c2d384ed57d8f8ce1abd1043e1fb3fbbcb8c3" + */ + authorization?: null | string; + /** + * the entities that the subscription provides notifications for + */ + include?: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level?: 'notify' | 'sync'; + /** + * a value that Heroku will use to sign all webhook notification requests (the signature is included in the request’s `Heroku-Webhook-Hmac-SHA256` header) + * + * @example "dcbff0c4430a2960a2552389d587bc58d30a37a8cf3f75f8fb77abe667ad" + */ + secret?: null | string; + /** + * the URL where the webhook's notification requests are sent + */ + url?: string; +} +export interface AddOnCreatePayload { + /** + * name for add-on's initial attachment + * + * @example {"name":"DATABASE_FOLLOWER"} + */ + attachment?: Attachment; + /** + * custom add-on provisioning options + * + * @example {"db-version":"1.2.3"} + */ + config?: Record; + /** + * name of billing entity for confirmation + * + * @example "example" + */ + confirm?: string; + /** + * unique identifier of this plan or unique name of this plan + */ + plan: string; + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + name?: string; +} +/** + * + * name for add-on's initial attachment + */ +export interface Attachment { + /** + * unique name for this add-on attachment to this app + * + * @example "DATABASE" + */ + readonly name?: string; +} +export interface AddOnUpdatePayload { + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + name?: string; + /** + * unique identifier of this plan or unique name of this plan + */ + plan: string; +} +export interface AddOnResolutionPayload { + /** + * globally unique name of the add-on + * + * @example "acme-inc-primary-database" + */ + addon: string; + /** + * unique name of app + * + * @example "example" + */ + app?: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly addon_service?: string; +} +/** + * + * [Heroku Platform API - allowed-add-on-service](https://devcenter.heroku.com/articles/platform-api-reference#allowed-add-on-service) + * Entities that have been allowed to be used by a Team + */ +export interface AllowedAddOnService { + /** + * when the add-on service was allowed + * + * @example "2012-01-01T12:00:00Z" + */ + readonly added_at: string; + /** + * the user which allowed the add-on service + */ + readonly added_by: AddedBy; + /** + * the add-on service allowed for use + */ + readonly addon_service: AllowedAddOnServiceAddonService; + /** + * unique identifier for this allowed add-on service record + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * the user which allowed the add-on service + */ +export interface AddedBy { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email?: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * the add-on service allowed for use + */ +export interface AllowedAddOnServiceAddonService { + /** + * unique identifier of this add-on-service + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of this add-on-service + * + * @example "heroku-postgresql" + */ + readonly name?: string; + /** + * human-readable name of the add-on service provider + * + * @example "Heroku Postgres" + */ + readonly human_name?: string; +} +export interface AllowedAddOnServiceCreateByTeamPayload { + /** + * name of the add-on service to allow + * + * @example "heroku-postgresql" + */ + addon_service?: string; +} +/** + * + * [Heroku Platform API - app-feature](https://devcenter.heroku.com/articles/platform-api-reference#app-feature) + * An app feature represents a Heroku labs capability that can be enabled or disabled for an app on Heroku. + */ +export interface AppFeature { + /** + * when app feature was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of app feature + * + * @example "Causes app to example." + */ + readonly description: string; + /** + * documentation URL of app feature + * + * @example "http://devcenter.heroku.com/articles/example" + */ + readonly doc_url: string; + /** + * whether or not app feature has been enabled + * + * @example true + */ + enabled: boolean; + /** + * unique identifier of app feature + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of app feature + * + * @example "name" + */ + readonly name: string; + /** + * state of app feature + * + * @example "public" + */ + readonly state: string; + /** + * when app feature was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user readable feature name + * + * @example "My Feature" + */ + readonly display_name: string; + /** + * e-mail to send feedback about the feature + * + * @example "feedback@heroku.com" + */ + readonly feedback_email: string; +} +export interface AppFeatureUpdatePayload { + /** + * whether or not app feature has been enabled + * + * @example true + */ + enabled: boolean; +} +/** + * + * [Heroku Platform API - app-setup](https://devcenter.heroku.com/articles/platform-api-reference#app-setup) + * An app setup represents an app on Heroku that is setup using an environment, addons, and scripts described in an app.json manifest file. + */ +export interface AppSetup { + /** + * unique identifier of app setup + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * when app setup was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * when app setup was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * the overall status of app setup + * + * @example "failed" + */ + readonly status: 'failed' | 'pending' | 'succeeded'; + /** + * reason that app setup has failed + * + * @example "invalid app.json" + */ + readonly failure_message: string | null; + /** + * identity of app + */ + app: App; + /** + * identity and status of build + */ + build: null | Build; + /** + * errors associated with invalid app.json manifest file + * + * @example ["config var FOO is required"] + */ + readonly manifest_errors: string[]; + /** + * result of postdeploy script + */ + readonly postdeploy: Postdeploy | null; + /** + * fully qualified success url + * + * @example "https://example.herokuapp.com/welcome" + */ + readonly resolved_success_url: string | null; +} +/** + * + * [Heroku Platform API - build](https://devcenter.heroku.com/articles/platform-api-reference#build) + * A build represents the process of transforming a code tarball into a slug + */ +export interface Build { + /** + * app that the build belongs to + */ + app?: BuildApp; + /** + * buildpacks executed for this build, in order + */ + buildpacks?: Array<{ + /** + * the URL of the buildpack for the app + * + * @example "https://github.com/heroku/heroku-buildpack-ruby" + */ + url?: string; + /** + * Buildpack Registry name of the buildpack for the app + * + * @example "heroku/ruby" + */ + name?: string; +}> | null; + /** + * when build was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of build + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * Build process output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). + * + * @example "https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef" + */ + readonly output_stream_url?: string; + /** + * location of gzipped tarball of source code used to create build + */ + source_blob: BuildSourceBlob; + /** + * release resulting from the build + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} + */ + readonly release?: null | BuildRelease; + /** + * slug created by this build + */ + slug?: Slug | null; + /** + * stack of build + * + * @example "heroku-22" + */ + readonly stack?: string; + /** + * status of build + * + * @example "succeeded" + */ + readonly status: 'failed' | 'pending' | 'succeeded'; + /** + * when build was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user that started the build + */ + user: User; +} +/** + * + * result of postdeploy script + */ +export interface Postdeploy { + /** + * output of the postdeploy script + * + * @example "assets precompiled" + */ + readonly output?: string; + /** + * The exit code of the postdeploy script + * + * @example 1 + */ + readonly exit_code?: number; +} +export interface AppSetupCreatePayload { + /** + * optional parameters for created app + */ + app?: AppSetupCreatePayloadApp; + /** + * gzipped tarball of source code containing app.json manifest file + */ + source_blob: SourceBlob; + /** + * overrides of keys in the app.json manifest file + * + * @example {"buildpacks":[{"url":"https://example.com/buildpack.tgz"}],"env":{"FOO":"bar","BAZ":"qux"}} + */ + overrides?: Overrides; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * optional parameters for created app + */ +export interface AppSetupCreatePayloadApp { + /** + * are other team members forbidden from joining this app. + */ + locked?: boolean; + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique name of team + * + * @example "example" + */ + readonly organization?: string; + /** + * force creation of the app in the user account even if a default team is set. + */ + personal?: boolean; + /** + * unique name of region + * + * @example "us" + */ + readonly region?: string; + /** + * unique name of space + * + * @example "nasa" + */ + space?: string; + /** + * unique name of stack + * + * @example "heroku-18" + */ + readonly stack?: string; +} +/** + * + * gzipped tarball of source code containing app.json manifest file + */ +export interface SourceBlob { + /** + * an optional checksum of the gzipped tarball for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum?: null | string; + /** + * URL of gzipped tarball of source code containing app.json manifest file + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly url?: string; + /** + * Version of the gzipped tarball. + * + * @example "v1.3.0" + */ + readonly version?: string | null; +} +/** + * + * overrides of keys in the app.json manifest file + */ +export interface Overrides { + /** + * overrides the buildpacks specified in the app.json manifest file + * + * @example [{"url":"https://example.com/buildpack.tgz"}] + */ + buildpacks?: BuildpackOverride[]; + /** + * overrides of the env specified in the app.json manifest file + * + * @example {"FOO":"bar","BAZ":"qux"} + */ + readonly env?: Record; +} +/** + * + * a buildpack override + */ +export interface BuildpackOverride { + /** + * location of the buildpack + * + * @example "https://example.com/buildpack.tgz" + */ + url?: string; +} +/** + * + * [Heroku Platform API - app-transfer](https://devcenter.heroku.com/articles/platform-api-reference#app-transfer) + * An app transfer represents a two party interaction for transferring ownership of an app. + */ +export interface AppTransfer { + /** + * app involved in the transfer + */ + app: App; + /** + * when app transfer was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of app transfer + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * identity of the owner of the transfer + */ + owner: AppTransferOwner; + /** + * identity of the recipient of the transfer + */ + recipient: Recipient; + /** + * the current state of an app transfer + * + * @example "pending" + */ + readonly state: 'pending' | 'accepted' | 'declined'; + /** + * when app transfer was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * identity of the owner of the transfer + */ +export interface AppTransferOwner { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * identity of the recipient of the transfer + */ +export interface Recipient { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +export interface AppTransferCreatePayload { + /** + * unique identifier of app or unique name of app + */ + app: string; + /** + * unique email address of account or unique identifier of an account or Implicit reference to currently authorized user + */ + recipient: string; + /** + * whether to suppress email notification when transferring apps + */ + readonly silent?: boolean; +} +export interface AppTransferUpdatePayload { + /** + * the current state of an app transfer + * + * @example "pending" + */ + readonly state: 'pending' | 'accepted' | 'declined'; +} +export interface AppWebhookCreatePayload { + /** + * a custom `Authorization` header that Heroku will include with all webhook notifications + * + * @example "Bearer 9266671b2767f804c9d5809c2d384ed57d8f8ce1abd1043e1fb3fbbcb8c3" + */ + authorization?: null | string; + /** + * the entities that the subscription provides notifications for + */ + include: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level: 'notify' | 'sync'; + /** + * a value that Heroku will use to sign all webhook notification requests (the signature is included in the request’s `Heroku-Webhook-Hmac-SHA256` header) + * + * @example "dcbff0c4430a2960a2552389d587bc58d30a37a8cf3f75f8fb77abe667ad" + */ + secret?: null | string; + /** + * the URL where the webhook's notification requests are sent + */ + url: string; +} +/** + * + * app webhook + */ +export interface AppWebhook { + /** + * identity of app. Only used for customer webhooks. + */ + app?: App; + /** + * when the webhook was created + */ + created_at?: string; + /** + * the webhook's unique identifier + */ + readonly id?: string; + /** + * the entities that the subscription provides notifications for + */ + include?: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level?: 'notify' | 'sync'; + /** + * when the webhook was updated + */ + updated_at?: string; + /** + * the URL where the webhook's notification requests are sent + */ + url?: string; +} +export interface AppWebhookUpdatePayload { + /** + * a custom `Authorization` header that Heroku will include with all webhook notifications + * + * @example "Bearer 9266671b2767f804c9d5809c2d384ed57d8f8ce1abd1043e1fb3fbbcb8c3" + */ + authorization?: null | string; + /** + * the entities that the subscription provides notifications for + */ + include?: string[]; + /** + * if `notify`, Heroku makes a single, fire-and-forget delivery attempt. If `sync`, Heroku attempts multiple deliveries until the request is successful or a limit is reached + * + * @example "notify" + */ + level?: 'notify' | 'sync'; + /** + * a value that Heroku will use to sign all webhook notification requests (the signature is included in the request’s `Heroku-Webhook-Hmac-SHA256` header) + * + * @example "dcbff0c4430a2960a2552389d587bc58d30a37a8cf3f75f8fb77abe667ad" + */ + secret?: null | string; + /** + * the URL where the webhook's notification requests are sent + */ + url?: string; +} +/** + * + * identity of the stack that will be used for new builds + */ +export interface BuildStack { + /** + * unique identifier of stack + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of stack + * + * @example "heroku-18" + */ + readonly name: string; +} +/** + * + * identity of app owner + */ +export interface AppOwner { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * identity of team + */ +export interface AppOrganization { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * [Heroku Platform API - team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * identity of team + */ +export interface AppTeam { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * [Heroku Platform API - region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * identity of app region + */ +export interface AppRegion { + /** + * unique identifier of region + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of region + * + * @example "us" + */ + readonly name: string; +} +/** + * + * A space is an isolated, highly available, secure app execution environment. + */ +export interface Space { + /** + * when space was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of space + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of space + * + * @example "nasa" + */ + name: string; + /** + * organization that owns this space + */ + organization: Organization; + /** + * team that owns this space + */ + team: SpaceTeam; + /** + * identity of space region + */ + region: SpaceRegion; + /** + * true if this space has shield enabled + * + * @example true + */ + readonly shield: boolean; + /** + * availability of this space + * + * @example "allocated" + */ + readonly state: 'allocating' | 'allocated' | 'deleting'; + /** + * when space was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * The RFC-1918 CIDR the Private Space will use. It must be a /16 in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 + * + * @example "172.20.20.30/16" + */ + cidr: string; + /** + * The RFC-1918 CIDR that the Private Space will use for the Heroku-managed peering connection that's automatically created when using Heroku Data add-ons. It must be between a /16 and a /20 + * + * @example "10.2.0.0/16" + */ + data_cidr: string; +} +/** + * + * [Heroku Platform API - stack](https://devcenter.heroku.com/articles/platform-api-reference#stack) + * Stacks are the different application execution environments available in the Heroku platform. + */ +export interface Stack { + /** + * indicates this stack is the default for new apps + * + * @example true + */ + readonly default: boolean; + /** + * when stack was introduced + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of stack + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of stack + * + * @example "heroku-18" + */ + readonly name: string; + /** + * availability of this stack: beta, deprecated or public + * + * @example "public" + */ + readonly state: string; + /** + * when stack was last modified + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +export interface AppCreatePayload { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of region or unique name of region + */ + region?: string; + /** + * unique name of stack or unique identifier of stack + */ + stack?: string; + /** + * unique name of app feature + */ + feature_flags?: string[]; +} +export interface AppUpdatePayload { + /** + * unique name of stack or unique identifier of stack + */ + build_stack?: string; + /** + * maintenance status of app + */ + maintenance?: boolean; + /** + * unique name of app + * + * @example "example" + */ + name?: string; +} +/** + * + * [Heroku Platform API - archive](https://devcenter.heroku.com/articles/platform-api-reference#archive) + * An audit trail archive represents a monthly json zipped file containing events + */ +export interface Archive { + /** + * when archive was created + */ + created_at: string; + /** + * month of the archive + * + * @example "10" + */ + readonly month: '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12'; + /** + * year of the archive + * + * @example 2019 + */ + readonly year: number; + /** + * url where to download the archive + */ + readonly url: string; + /** + * checksum for the archive + */ + readonly checksum: string; + /** + * size of the archive in bytes + * + * @example 100 + */ + readonly size: number; +} +/** + * + * [Heroku Platform API - audit-trail-event](https://devcenter.heroku.com/articles/platform-api-reference#audit-trail-event) + * An audit trail event represents some action on the platform + */ +export interface AuditTrailEvent { + /** + * when event was created + */ + created_at: string; + /** + * unique identifier of event + */ + readonly id: string; + /** + * type of event + */ + readonly type: string; + /** + * action for the event + */ + readonly action: string; + /** + * user who caused event + */ + readonly actor: AuditTrailEventActor; + /** + * app upon which event took place + */ + readonly app: AuditTrailEventApp; + /** + * owner of the app targeted by the event + */ + readonly owner: AuditTrailEventOwner; + /** + * enterprise account on which the event happened + */ + readonly enterprise_account: EnterpriseAccount; + /** + * team on which the event happened + */ + readonly team: AuditTrailEventTeam; + /** + * information about where the action was triggered + */ + readonly request: Request; + /** + * data specific to the event + */ + readonly data: Record; +} +/** + * + * user who caused event + */ +export interface AuditTrailEventActor { + id?: string; + email?: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app upon which event took place + */ +export interface AuditTrailEventApp { + id?: string; + name?: string; +} +/** + * + * owner of the app targeted by the event + */ +export interface AuditTrailEventOwner { + id?: string; + email?: string; +} +/** + * + * [Heroku Platform API - enterprise-account](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account) + * Enterprise accounts allow companies to manage their development teams and billing. + */ +export interface EnterpriseAccount { + /** + * unique identifier of the enterprise account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * when the enterprise account was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique name of the enterprise account + * + * @example "example" + */ + readonly name: string; + /** + * when the enterprise account was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * the current user's permissions for this enterprise account + */ + readonly permissions: string[]; + /** + * whether the enterprise account is a trial or not + */ + readonly trial: boolean; + /** + * Identity Provider associated with the Enterprise Account + */ + identity_provider: null | EnterpriseAccountIdentityProvider; +} +/** + * + * [Heroku Platform API - team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * team on which the event happened + */ +export interface AuditTrailEventTeam { + id?: string; + name?: string; +} +/** + * + * information about where the action was triggered + */ +export interface Request { + ip_address?: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app that the build belongs to + */ +export interface BuildApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * location of gzipped tarball of source code used to create build + */ +export interface BuildSourceBlob { + /** + * an optional checksum of the gzipped tarball for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum: null | string; + /** + * URL where gzipped tar archive of source code for build was downloaded. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly url: string; + /** + * Version of the gzipped tarball. + * + * @example "v1.3.0" + */ + readonly version: string | null; + /** + * Version description of the gzipped tarball. + * + * @example "* Fake User: Change session key" + */ + readonly version_description: string | null; +} +/** + * + * [Heroku Platform API - release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * release resulting from the build + */ +export interface BuildRelease { + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - slug](https://devcenter.heroku.com/articles/platform-api-reference#slug) + * A slug is a snapshot of your application code that is ready to run on the platform. + */ +export interface Slug { + /** + * pointer to the url where clients can fetch or store the actual release binary + */ + blob: Blob; + /** + * description from buildpack of slug + * + * @example "Ruby/Rack" + */ + buildpack_provided_description: null | string; + /** + * an optional checksum of the slug for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum: null | string; + /** + * identification of the code with your version control system (eg: SHA of the git HEAD) + * + * @example "60883d9e8947a57e04dc9124f25df004866a2051" + */ + commit: null | string; + /** + * an optional description of the provided commit + * + * @example "fixed a bug with API documentation" + */ + commit_description: null | string; + /** + * when slug was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of slug + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * hash mapping process type names to their respective command + * + * @example {"web":"./bin/web -p $PORT"} + */ + process_types: Record; + /** + * size of slug, in bytes + * + * @example 2048 + */ + readonly size: number | null; + /** + * identity of slug stack + */ + stack: Stack; + /** + * when slug was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * user that started the build + */ +export interface User { + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; +} +export interface BuildCreatePayload { + /** + * buildpacks executed for this build, in order + */ + buildpacks?: Array<{ + /** + * the URL of the buildpack for the app + * + * @example "https://github.com/heroku/heroku-buildpack-ruby" + */ + url?: string; + /** + * Buildpack Registry name of the buildpack for the app + * + * @example "heroku/ruby" + */ + name?: string; +}> | null; + /** + * location of gzipped tarball of source code used to create build + */ + source_blob: BuildCreatePayloadSourceBlob; +} +/** + * + * location of gzipped tarball of source code used to create build + */ +export interface BuildCreatePayloadSourceBlob { + /** + * an optional checksum of the gzipped tarball for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum: null | string; + /** + * URL where gzipped tar archive of source code for build was downloaded. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly url: string; + /** + * Version of the gzipped tarball. + * + * @example "v1.3.0" + */ + readonly version: string | null; + /** + * Version description of the gzipped tarball. + * + * @example "* Fake User: Change session key" + */ + readonly version_description: string | null; +} +/** + * + * [Heroku Platform API - buildpack-installation](https://devcenter.heroku.com/articles/platform-api-reference#buildpack-installation) + * A buildpack installation represents a buildpack that will be run against an app. + */ +export interface BuildpackInstallation { + /** + * determines the order in which the buildpacks will execute + */ + readonly ordinal: number; + /** + * buildpack + */ + buildpack: Buildpack; +} +/** + * + * buildpack + */ +export interface Buildpack { + /** + * location of the buildpack for the app. Either a url (unofficial buildpacks) or an internal urn (heroku official buildpacks). + * + * @example "https://github.com/heroku/heroku-buildpack-ruby" + */ + url?: string; + /** + * either the Buildpack Registry name or a URL of the buildpack for the app + * + * @example "heroku/ruby" + */ + name?: string; +} +export interface BuildpackInstallationUpdatePayload { + /** + * The buildpack attribute can accept a name, a url, or a urn. + */ + updates: Update[]; +} +/** + * + * Properties to update a buildpack installation + */ +export interface Update { + /** + * location of the buildpack for the app. Either a url (unofficial buildpacks) or an internal urn (heroku official buildpacks). + * + * @example "https://github.com/heroku/heroku-buildpack-ruby" + */ + buildpack: string; +} +/** + * + * [Heroku Platform API - collaborator](https://devcenter.heroku.com/articles/platform-api-reference#collaborator) + * A collaborator represents an account that has been given access to an app on Heroku. + */ +export interface Collaborator { + /** + * app collaborator belongs to + */ + app: CollaboratorApp; + /** + * when collaborator was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of collaborator + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + permissions?: TeamAppPermission[]; + /** + * role in the team + * + * @example "admin" + */ + readonly role?: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; + /** + * when collaborator was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * identity of collaborated account + */ + user: CollaboratorUser; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app collaborator belongs to + */ +export interface CollaboratorApp { + /** + * unique name of app + * + * @example "example" + */ + name: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - team-app-permission](https://devcenter.heroku.com/articles/platform-api-reference#team-app-permission) + * A team app permission is a behavior that is assigned to a user in a team app. + */ +export interface TeamAppPermission { + /** + * The name of the app permission. + * + * @example "view" + */ + readonly name?: string; + /** + * A description of what the app permission allows. + * + * @example "Can manage config, deploy, run commands and restart the app." + */ + readonly description?: string; +} +/** + * + * identity of collaborated account + */ +export interface CollaboratorUser { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated: boolean; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +export interface CollaboratorCreatePayload { + /** + * whether to suppress email invitation when creating collaborator + */ + silent?: boolean; + /** + * unique email address of account or unique identifier of an account or Implicit reference to currently authorized user + */ + user: string; +} +/** + * + * [Heroku Platform API - credit](https://devcenter.heroku.com/articles/platform-api-reference#credit) + * A credit represents value that will be used up before further charges are assigned to an account. + */ +export interface Credit { + /** + * total value of credit in cents + * + * @example 10000 + */ + amount: number; + /** + * remaining value of credit in cents + * + * @example 5000 + */ + balance: number; + /** + * when credit was created + * + * @example "2012-01-01T12:00:00Z" + */ + created_at: string; + /** + * when credit will expire + * + * @example "2012-01-01T12:00:00Z" + */ + expires_at: string; + /** + * unique identifier of credit + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + id: string; + /** + * a name for credit + * + * @example "gift card" + */ + title: string; + /** + * when credit was updated + * + * @example "2012-01-01T12:00:00Z" + */ + updated_at: string; +} +export interface CreditCreatePayload { + /** + * first code from a discount card + * + * @example "012abc" + */ + code1?: string; + /** + * second code from a discount card + * + * @example "012abc" + */ + code2?: string; +} +/** + * + * [Heroku Platform API - domain](https://devcenter.heroku.com/articles/platform-api-reference#domain) + * Domains define what web routes should be routed to an app on Heroku. + */ +export interface Domain { + /** + * status of this record's ACM + * + * @example "pending" + */ + readonly acm_status: null | string; + /** + * reason for the status of this record's ACM + * + * @example "Failing CCA check" + */ + readonly acm_status_reason: null | string; + /** + * app that owns the domain + */ + app: DomainApp; + /** + * canonical name record, the address to point a domain at + * + * @example "example.herokudns.com" + */ + readonly cname: null | string; + /** + * when domain was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * full hostname + * + * @example "subdomain.example.com" + */ + readonly hostname: string; + /** + * unique identifier of this domain + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * type of domain name + * + * @example "custom" + */ + readonly kind: 'heroku' | 'custom'; + /** + * when domain was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * status of this record's cname + * + * @example "pending" + */ + readonly status: string; + /** + * sni endpoint the domain is associated with + */ + sni_endpoint: null | SniEndpoint; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app that owns the domain + */ +export interface DomainApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - sni-endpoint](https://devcenter.heroku.com/articles/platform-api-reference#sni-endpoint) + * SNI Endpoint is a public address serving a custom SSL cert for HTTPS traffic, using the SNI TLS extension, to a Heroku app. + */ +export interface SniEndpoint { + /** + * raw contents of the public certificate chain (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate_chain: string; + /** + * when endpoint was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this SNI endpoint + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name for SNI endpoint + * + * @example "example" + */ + readonly name: string; + /** + * when SNI endpoint was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * unique name for SSL certificate + * + * @example "example" + */ + display_name: string | null; + /** + * domains associated with this SSL certificate + */ + readonly domains: string[]; + /** + * application that this SSL certificate is on + */ + app: SniEndpointApp; + /** + * certificate provided by this endpoint + */ + ssl_cert: SslCert; +} +export interface DomainCreatePayload { + /** + * full hostname + * + * @example "subdomain.example.com" + */ + readonly hostname: string; + /** + * null or unique identifier or name for SNI endpoint + */ + sni_endpoint: null | string; +} +export interface DomainUpdatePayload { + /** + * null or unique identifier or name for SNI endpoint + */ + sni_endpoint: null | string; +} +/** + * + * [Heroku Platform API - dyno-size](https://devcenter.heroku.com/articles/platform-api-reference#dyno-size) + * Dyno sizes are the values and details of sizes that can be assigned to dynos. This information can also be found at : [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +export interface DynoSize { + /** + * minimum vCPUs, non-dedicated may get more depending on load + * + * @example 1 + */ + readonly compute: number; + /** + * price information for this dyno size + */ + readonly cost: null | Record; + /** + * whether this dyno will be dedicated to one user + */ + readonly dedicated: boolean; + /** + * deprecated. See precise_dyno_units instead + */ + readonly dyno_units: number; + /** + * unit of consumption for Heroku Enterprise customers to 2 decimal places + * + * @example 0.28 + */ + readonly precise_dyno_units: number; + /** + * unique identifier of this dyno size + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * amount of RAM in GB + * + * @example 0.5 + */ + readonly memory: number; + /** + * the name of this dyno-size + * + * @example "eco" + */ + readonly name: string; + /** + * whether this dyno can only be provisioned in a private space + */ + readonly private_space_only: boolean; +} +/** + * + * [Heroku Platform API - dyno](https://devcenter.heroku.com/articles/platform-api-reference#dyno) + * Dynos encapsulate running processes of an app on Heroku. Detailed information about dyno sizes can be found at: [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +export interface Dyno { + /** + * a URL to stream output from for attached processes or null for non-attached processes + * + * @example "rendezvous://rendezvous.runtime.heroku.com:5000/{rendezvous-id}" + */ + readonly attach_url: string | null; + /** + * command used to start this process + * + * @example "bash" + */ + command: string; + /** + * when dyno was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this dyno + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * the name of this process on this dyno + * + * @example "run.1" + */ + readonly name: string; + /** + * app release of the dyno + */ + release: Release; + /** + * app formation belongs to + */ + app: DynoApp; + /** + * dyno size + * + * @example "standard-1X" + */ + size: string; + /** + * current status of process (either: crashed, down, idle, starting, or up) + * + * @example "up" + */ + readonly state: string; + /** + * type of process + * + * @example "run" + */ + type: string; + /** + * when process last changed state + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * A release represents a combination of code, config vars and add-ons for an app on Heroku. + */ +export interface Release { + /** + * add-on plans installed on the app for this release + */ + addon_plan_names: string[]; + /** + * app involved in the release + */ + app: ReleaseApp; + /** + * when release was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of changes in this release + * + * @example "Added new feature" + */ + readonly description: string; + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * when release was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * slug running in this release + */ + slug: Slug | null; + /** + * current status of the release + * + * @example "succeeded" + */ + readonly status: 'failed' | 'pending' | 'succeeded'; + /** + * user that created the release + */ + user: User; + /** + * unique version assigned to the release + * + * @example 11 + */ + readonly version: number; + /** + * indicates this release as being the current one for the app + * + * @example true + */ + readonly current: boolean; + /** + * Release command output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). + * + * @example "https://release-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef" + */ + readonly output_stream_url: string | null; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app formation belongs to + */ +export interface DynoApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface DynoCreatePayload { + /** + * whether to stream output or not + * + * @example true + */ + attach?: boolean; + /** + * command used to start this process + * + * @example "bash" + */ + command: string; + /** + * custom environment to add to the dyno config vars + * + * @example {"COLUMNS":"80","LINES":"24"} + */ + env?: Record; + /** + * force an attached one-off dyno to not run in a tty + */ + force_no_tty?: boolean | null; + /** + * dyno size + * + * @example "standard-1X" + */ + size?: string; + /** + * type of process + * + * @example "run" + */ + type?: string; + /** + * seconds until dyno expires, after which it will soon be killed, max 86400 seconds (24 hours) + * + * @example 1800 + */ + time_to_live?: number; +} +/** + * + * [Heroku Platform API - enterprise-account-daily-usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-daily-usage) + * Usage for an enterprise account at a daily resolution. + */ +export interface EnterpriseAccountDailyUsage { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons: number; + /** + * usage by team + */ + teams: Array<{ + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons?: number; + /** + * app usage in the team + */ + apps?: AppUsageDaily[]; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data?: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos?: number; + /** + * team identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of the team + * + * @example "ops" + */ + readonly name?: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner?: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space?: number; +}>; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data: number; + /** + * date of the usage + * + * @example "2019-01-01" + */ + readonly date: string; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos: number; + /** + * enterprise account identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * name of the enterprise account + * + * @example "example-co" + */ + readonly name: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space: number; +} +/** + * + * Usage for an app at a daily resolution. + */ +export interface AppUsageDaily { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons?: number; + /** + * unique name of app + * + * @example "example" + */ + app_name?: string; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data?: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos?: number; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner?: number; +} +export interface EnterpriseAccountDailyUsageInfoPayload { + /** + * range start date + * + * @example "2019-01-25" + */ + readonly start: string; + /** + * range end date + * + * @example "2019-02-25" + */ + readonly end?: string; +} +/** + * + * [Heroku Platform API - enterprise-account-member](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-member) + * Enterprise account members are users with access to an enterprise account. + */ +export interface EnterpriseAccountMember { + enterprise_account: EnterpriseAccountMemberEnterpriseAccount; + /** + * unique identifier of the member + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * enterprise account permissions + */ + permissions: Array<{ + /** + * + * @example "View enterprise account members and teams." + */ + description?: string; + /** + * permission in the enterprise account + * + * @example "view" + */ + readonly name?: 'view' | 'create' | 'manage' | 'billing'; +}>; + /** + * user information for the membership + */ + user: User; + /** + * whether the Enterprise Account member has two factor authentication enabled + * + * @example true + */ + readonly two_factor_authentication: boolean; + /** + * Identity Provider information the member is federated with + */ + identity_provider: null | EnterpriseAccountMemberIdentityProvider; +} +export interface EnterpriseAccountMemberEnterpriseAccount { + /** + * unique identifier of the enterprise account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of the enterprise account + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * Identity Provider information the member is federated with + */ +export interface EnterpriseAccountMemberIdentityProvider { + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of the identity provider + * + * @example "acme" + */ + readonly name?: string; + /** + * whether the identity_provider information is redacted or not + */ + readonly redacted?: boolean; + /** + * entity that owns this identity provider + */ + owner?: Owner; +} +export interface EnterpriseAccountMemberCreatePayload { + /** + * unique email address of account or unique identifier of an account + */ + user: string; + /** + * permissions for enterprise account + * + * @example ["view"] + */ + readonly permissions: 'view' | 'create' | 'manage' | Array<'billing'>; + /** + * whether membership is being created as part of SSO JIT + */ + federated?: boolean; +} +export interface EnterpriseAccountMemberUpdatePayload { + /** + * permissions for enterprise account + * + * @example ["view"] + */ + readonly permissions: 'view' | 'create' | 'manage' | Array<'billing'>; +} +/** + * + * [Heroku Platform API - enterprise-account-monthly-usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-monthly-usage) + * Usage for an enterprise account at a monthly resolution. + */ +export interface EnterpriseAccountMonthlyUsage { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons: number; + /** + * usage by team + */ + teams: Array<{ + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons?: number; + /** + * app usage in the team + */ + apps?: AppUsageMonthly[]; + /** + * average connect rows synced + * + * @example 15000 + */ + readonly connect?: number; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data?: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos?: number; + /** + * team identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of the team + * + * @example "ops" + */ + readonly name?: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner?: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space?: number; +}>; + /** + * average connect rows synced + * + * @example 15000 + */ + readonly connect: number; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos: number; + /** + * enterprise account identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * year and month of the usage + * + * @example "2019-01" + */ + readonly month: string; + /** + * name of the enterprise account + * + * @example "example-co" + */ + readonly name: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space: number; +} +/** + * + * Usage for an app at a monthly resolution. + */ +export interface AppUsageMonthly { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons?: number; + /** + * unique name of app + * + * @example "example" + */ + app_name?: string; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data?: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos?: number; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner?: number; +} +export interface EnterpriseAccountMonthlyUsageInfoPayload { + /** + * range start date + * + * @example "2019-01" + */ + readonly start: string; + /** + * range end date + * + * @example "2019-02" + */ + readonly end?: string; +} +/** + * + * Identity Provider associated with the Enterprise Account + */ +export interface EnterpriseAccountIdentityProvider { + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * user-friendly unique identifier for this identity provider + * + * @example "acme-sso" + */ + name: string; + /** + * entity that owns this identity provider + */ + owner: Owner; +} +export interface EnterpriseAccountUpdatePayload { + /** + * unique name of the enterprise account + * + * @example "example" + */ + readonly name?: string; +} +export interface Filter { + in?: In; +} +export interface In { + id?: string[]; +} +/** + * + * [Heroku Platform API - team-app](https://devcenter.heroku.com/articles/platform-api-reference#team-app) + * A team app encapsulates the team specific functionality of Heroku apps. + */ +export interface TeamApp { + /** + * when app was archived + * + * @example "2012-01-01T12:00:00Z" + */ + readonly archived_at?: null | string; + /** + * description from buildpack of app + * + * @example "Ruby/Rack" + */ + readonly buildpack_provided_description?: null | string; + /** + * identity of the stack that will be used for new builds + */ + build_stack?: BuildStack; + /** + * when app was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * git repo URL of app + * + * @example "https://git.heroku.com/example.git" + */ + readonly git_url?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * describes whether a Private Spaces app is externally routable or not + */ + internal_routing?: boolean | null; + /** + * is the current member a collaborator on this app. + */ + joined?: boolean; + /** + * are other team members forbidden from joining this app. + */ + locked?: boolean; + /** + * maintenance status of app + */ + maintenance?: boolean; + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * team that owns this app + */ + team?: null | Team; + /** + * identity of app owner + */ + owner?: null | TeamAppOwner; + /** + * identity of app region + */ + region?: TeamAppRegion; + /** + * when app was released + * + * @example "2012-01-01T12:00:00Z" + */ + readonly released_at?: null | string; + /** + * git repo size in bytes of app + */ + readonly repo_size?: number | null; + /** + * slug size in bytes of app + */ + readonly slug_size?: number | null; + /** + * identity of space + */ + space?: null | TeamAppSpace; + /** + * identity of app stack + */ + stack?: Stack; + /** + * when app was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; + /** + * web URL of app + * + * @example "https://example.herokuapp.com/" + */ + readonly web_url?: null | string; +} +/** + * + * identity of app owner + */ +export interface TeamAppOwner { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email?: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * identity of app region + */ +export interface TeamAppRegion { + /** + * unique identifier of region + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of region + * + * @example "us" + */ + readonly name?: string; +} +/** + * + * [Heroku Platform API - space](https://devcenter.heroku.com/articles/platform-api-reference#space) + * identity of space + */ +export interface TeamAppSpace { + /** + * unique identifier of space + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of space + * + * @example "nasa" + */ + name?: string; +} +/** + * + * [Heroku Platform API - formation](https://devcenter.heroku.com/articles/platform-api-reference#formation) + * The formation of processes that should be maintained for an app. Update the formation to scale processes or change dyno sizes. Available process type names and commands are defined by the `process_types` attribute for the [slug](#slug) currently released on an app. + */ +export interface Formation { + /** + * app formation belongs to + */ + app: FormationApp; + /** + * command to use to launch this process + * + * @example "bundle exec rails server -p $PORT" + */ + command: string; + /** + * when process type was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this process type + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * number of processes to maintain + * + * @example 1 + */ + quantity: number; + /** + * dyno size + * + * @example "standard-1X" + */ + size: string; + /** + * type of process to maintain + * + * @example "web" + */ + readonly type: string; + /** + * when dyno type was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app formation belongs to + */ +export interface FormationApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface FormationBatchUpdatePayload { + /** + * Array with formation updates. Each element must have "type", the id or name of the process type to be updated, and can optionally update its "quantity" or "size". + */ + updates: FormationBatchUpdatePayloadUpdate[]; +} +/** + * + * Properties to update a process type + */ +export interface FormationBatchUpdatePayloadUpdate { + /** + * number of processes to maintain + * + * @example 1 + */ + quantity?: number; + /** + * dyno size + * + * @example "standard-1X" + */ + size?: string; + /** + * type of process to maintain + * + * @example "web" + */ + readonly type: string; +} +export interface FormationUpdatePayload { + /** + * number of processes to maintain + * + * @example 1 + */ + quantity?: number; + /** + * dyno size + * + * @example "standard-1X" + */ + size?: string; +} +export interface IdentityProviderCreateByTeamPayload { + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate: string; + /** + * URL identifier provided by the identity provider + * + * @example "https://customer-domain.idp.com" + */ + entity_id: string; + /** + * single log out URL for this identity provider + * + * @example "https://example.com/idp/logout" + */ + slo_target_url?: string; + /** + * single sign on URL for this identity provider + * + * @example "https://example.com/idp/login" + */ + sso_target_url: string; +} +export interface IdentityProviderUpdateByTeamPayload { + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate?: string; + /** + * URL identifier provided by the identity provider + * + * @example "https://customer-domain.idp.com" + */ + entity_id?: string; + /** + * single log out URL for this identity provider + * + * @example "https://example.com/idp/logout" + */ + slo_target_url?: string; + /** + * single sign on URL for this identity provider + * + * @example "https://example.com/idp/login" + */ + sso_target_url?: string; +} +/** + * + * [Heroku Platform API - inbound-ruleset](https://devcenter.heroku.com/articles/platform-api-reference#inbound-ruleset) + * An inbound-ruleset is a collection of rules that specify what hosts can or cannot connect to an application. + */ +export interface InboundRuleset { + /** + * unique identifier of an inbound-ruleset + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * identity of space + */ + space: InboundRulesetSpace; + /** + * when inbound-ruleset was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + rules: Rule[]; + /** + * unique email address of account + * + * @example "username@example.com" + */ + created_by: string; +} +/** + * + * [Heroku Platform API - space](https://devcenter.heroku.com/articles/platform-api-reference#space) + * identity of space + */ +export interface InboundRulesetSpace { + /** + * unique identifier of space + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of space + * + * @example "nasa" + */ + name?: string; +} +/** + * + * the combination of an IP address in CIDR notation and whether to allow or deny it's traffic. + */ +export interface Rule { + /** + * states whether the connection is allowed or denied + * + * @example "allow" + */ + action: 'allow' | 'deny'; + /** + * is the request’s source in CIDR notation + * + * @example "1.1.1.1/1" + */ + source: string; +} +export interface InboundRulesetCreatePayload { + rules?: Rule[]; +} +/** + * + * [Heroku Platform API - invoice-address](https://devcenter.heroku.com/articles/platform-api-reference#invoice-address) + * An invoice address represents the address that should be listed on an invoice. + */ +export interface InvoiceAddress { + /** + * invoice street address line 1 + * + * @example "40 Hickory Blvd." + */ + address_1?: string; + /** + * invoice street address line 2 + * + * @example "Suite 300" + */ + address_2?: string; + /** + * invoice city + * + * @example "Seattle" + */ + city?: string; + /** + * country + * + * @example "US" + */ + country?: string; + /** + * heroku_id identifier reference + */ + heroku_id?: string; + /** + * metadata / additional information to go on invoice + * + * @example "Company ABC Inc. VAT 903820" + */ + other?: string; + /** + * invoice zip code + * + * @example "98101" + */ + postal_code?: string; + /** + * invoice state + * + * @example "WA" + */ + state?: string; + /** + * flag to use the invoice address for an account or not + * + * @example true + */ + use_invoice_address?: boolean; +} +export interface InvoiceAddressUpdatePayload { + /** + * invoice street address line 1 + * + * @example "40 Hickory Blvd." + */ + address_1?: string; + /** + * invoice street address line 2 + * + * @example "Suite 300" + */ + address_2?: string; + /** + * invoice city + * + * @example "Seattle" + */ + city?: string; + /** + * country + * + * @example "US" + */ + country?: string; + /** + * metadata / additional information to go on invoice + * + * @example "Company ABC Inc. VAT 903820" + */ + other?: string; + /** + * invoice zip code + * + * @example "98101" + */ + postal_code?: string; + /** + * invoice state + * + * @example "WA" + */ + state?: string; + /** + * flag to use the invoice address for an account or not + * + * @example true + */ + use_invoice_address?: boolean; +} +/** + * + * [Heroku Platform API - invoice](https://devcenter.heroku.com/articles/platform-api-reference#invoice) + * An invoice is an itemized bill of goods for an account which includes pricing and charges. + */ +export interface Invoice { + /** + * total charges on this invoice + * + * @example 100 + */ + readonly charges_total: number; + /** + * when invoice was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * total credits on this invoice + * + * @example 100 + */ + readonly credits_total: number; + /** + * unique identifier of this invoice + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * human readable invoice number + * + * @example 9403943 + */ + readonly number: number; + /** + * the ending date that the invoice covers + * + * @example "01/31/2014" + */ + readonly period_end: string; + /** + * the starting date that this invoice covers + * + * @example "01/01/2014" + */ + readonly period_start: string; + /** + * payment status for this invoice (pending, successful, failed) + * + * @example 1 + */ + readonly state: number; + /** + * combined total of charges and credits on this invoice + * + * @example 100 + */ + readonly total: number; + /** + * when invoice was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - key](https://devcenter.heroku.com/articles/platform-api-reference#key) + * Keys represent public SSH keys associated with an account and are used to authorize accounts as they are performing git operations. + */ +export interface Key { + /** + * comment on the key + * + * @example "username@host" + */ + readonly comment: string; + /** + * when key was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * deprecated. Please refer to 'comment' instead + * + * @example "username@host" + */ + readonly email: string; + /** + * a unique identifying string based on contents + * + * @example "17:63:a4:ba:24:d3:7f:af:17:c8:94:82:7e:80:56:bf" + */ + readonly fingerprint: string; + /** + * unique identifier of this key + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * full public_key as uploaded + * + * @example "ssh-rsa AAAAB3NzaC1ycVc/../839Uv username@example.com" + */ + readonly public_key: string; + /** + * when key was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - log-drain](https://devcenter.heroku.com/articles/platform-api-reference#log-drain) + * [Log drains](https://devcenter.heroku.com/articles/log-drains) provide a way to forward your Heroku logs to an external syslog server for long-term archiving. This external service must be configured to receive syslog packets from Heroku, whereupon its URL can be added to an app using this API. Some add-ons will add a log drain when they are provisioned to an app. These drains can only be removed by removing the add-on. + */ +export interface LogDrain { + /** + * add-on that created the drain + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef","name":"singing-swiftly-1242","app":{"id":"01234567-89ab-cdef-0123-456789abcdef","name":"example"}} + */ + readonly addon: Addon | null; + /** + * application that is attached to this drain + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef","name":"example"} + */ + readonly app: LogDrainApp | null; + /** + * when log drain was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this log drain + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * token associated with the log drain + * + * @example "d.01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token: string; + /** + * when log drain was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * url associated with the log drain + * + * @example "https://example.com/drain" + */ + readonly url: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * application that is attached to this drain + */ +export interface LogDrainApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of app + * + * @example "example" + */ + name: string; +} +export interface LogDrainCreatePayload { + /** + * url associated with the log drain + * + * @example "https://example.com/drain" + */ + readonly url: string; +} +export interface LogDrainUpdatePayload { + /** + * url associated with the log drain + * + * @example "https://example.com/drain" + */ + readonly url: string; +} +/** + * + * [Heroku Platform API - log-session](https://devcenter.heroku.com/articles/platform-api-reference#log-session) + * A log session is a reference to the http based log stream for an app. + */ +export interface LogSession { + /** + * when log connection was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this log session + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * URL for log streaming session + * + * @example "https://logplex.heroku.com/sessions/01234567-89ab-cdef-0123-456789abcdef?srv=1325419200" + */ + readonly logplex_url: string; + /** + * when log session was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +export interface LogSessionCreatePayload { + /** + * dyno to limit results to + * + * @example "web.1" + */ + dyno?: string; + /** + * number of log lines to stream at once + * + * @example 10 + */ + lines?: number; + /** + * log source to limit results to + * + * @example "app" + */ + source?: string; + /** + * whether to stream ongoing logs + * + * @example true + */ + tail?: boolean; +} +/** + * + * [Heroku Platform API - oauth-authorization](https://devcenter.heroku.com/articles/platform-api-reference#oauth-authorization) + * OAuth authorizations represent clients that a Heroku user has authorized to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export interface OauthAuthorization { + /** + * access token for this authorization + */ + access_token: null | AccessToken; + /** + * identifier of the client that obtained this authorization, if any + */ + client: null | Client; + /** + * when OAuth authorization was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * this authorization's grant + */ + grant: null | Grant; + /** + * unique identifier of OAuth authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * refresh token for this authorization + */ + refresh_token: null | RefreshToken; + /** + * The scope of access OAuth authorization allows + * + * @example ["global"] + */ + readonly scope: string[]; + /** + * when OAuth authorization was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * authenticated user associated with this authorization + */ + user: OauthAuthorizationUser; +} +/** + * + * access token for this authorization + */ +export interface AccessToken { + /** + * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime + * + * @example 2592000 + */ + readonly expires_in?: null | number; + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * contents of the token to be used for authorization + * + * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token?: string; +} +/** + * + * identifier of the client that obtained this authorization, if any + */ +export interface Client { + /** + * unique identifier of this OAuth client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * OAuth client name + * + * @example "example" + */ + readonly name?: string; + /** + * endpoint for redirection after authorization with OAuth client + * + * @example "https://example.com/auth/heroku/callback" + */ + readonly redirect_uri?: string; +} +/** + * + * this authorization's grant + */ +export interface Grant { + /** + * grant code received from OAuth web application authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly code: string; + /** + * seconds until OAuth grant expires + * + * @example 2592000 + */ + readonly expires_in: number; + /** + * unique identifier of OAuth grant + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * refresh token for this authorization + */ +export interface RefreshToken { + /** + * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime + * + * @example 2592000 + */ + readonly expires_in: null | number; + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * contents of the token to be used for authorization + * + * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token: string; +} +/** + * + * authenticated user associated with this authorization + */ +export interface OauthAuthorizationUser { + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + full_name: string | null; +} +export interface OauthAuthorizationCreatePayload { + /** + * unique identifier of this OAuth client + */ + client?: string; + /** + * human-friendly description of this OAuth authorization + * + * @example "sample authorization" + */ + readonly description?: string; + /** + * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime + * + * @example 2592000 + */ + readonly expires_in?: null | number; + /** + * The scope of access OAuth authorization allows + * + * @example ["global"] + */ + readonly scope: string[]; +} +/** + * + * [Heroku Platform API - oauth-client](https://devcenter.heroku.com/articles/platform-api-reference#oauth-client) + * OAuth clients are applications that Heroku users can authorize to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth). + */ +export interface OauthClient { + /** + * when OAuth client was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this OAuth client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * whether the client is still operable given a delinquent account + */ + readonly ignores_delinquent: boolean | null; + /** + * OAuth client name + * + * @example "example" + */ + readonly name: string; + /** + * endpoint for redirection after authorization with OAuth client + * + * @example "https://example.com/auth/heroku/callback" + */ + readonly redirect_uri: string; + /** + * secret used to obtain OAuth authorizations under this client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly secret: string; + /** + * when OAuth client was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +export interface OauthClientCreatePayload { + /** + * OAuth client name + * + * @example "example" + */ + readonly name: string; + /** + * endpoint for redirection after authorization with OAuth client + * + * @example "https://example.com/auth/heroku/callback" + */ + readonly redirect_uri: string; +} +export interface OauthClientUpdatePayload { + /** + * OAuth client name + * + * @example "example" + */ + readonly name?: string; + /** + * endpoint for redirection after authorization with OAuth client + * + * @example "https://example.com/auth/heroku/callback" + */ + readonly redirect_uri?: string; +} +/** + * + * [Heroku Platform API - oauth-grant](https://devcenter.heroku.com/articles/platform-api-reference#oauth-grant) + * OAuth grants are used to obtain authorizations on behalf of a user. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export interface OauthGrant { + +} +/** + * + * [Heroku Platform API - oauth-token](https://devcenter.heroku.com/articles/platform-api-reference#oauth-token) + * OAuth tokens provide access for authorized clients to act on behalf of a Heroku user to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export interface OauthToken { + /** + * current access token + */ + access_token: AccessToken; + /** + * authorization for this set of tokens + */ + authorization: Authorization; + /** + * OAuth client secret used to obtain token + */ + client: null | OauthTokenClient; + /** + * when OAuth token was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * grant used on the underlying authorization + */ + grant: OauthTokenGrant; + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * refresh token for this authorization + */ + refresh_token: RefreshToken; + /** + * OAuth session using this token + */ + session: Session; + /** + * when OAuth token was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * Reference to the user associated with this token + */ + user: OauthTokenUser; +} +/** + * + * authorization for this set of tokens + */ +export interface Authorization { + /** + * unique identifier of OAuth authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * OAuth client secret used to obtain token + */ +export interface OauthTokenClient { + /** + * secret used to obtain OAuth authorizations under this client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly secret: string; +} +/** + * + * grant used on the underlying authorization + */ +export interface OauthTokenGrant { + /** + * grant code received from OAuth web application authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly code: string; + /** + * type of grant requested, one of `authorization_code` or `refresh_token` + * + * @example "authorization_code" + */ + type: string; +} +/** + * + * OAuth session using this token + */ +export interface Session { + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * Reference to the user associated with this token + */ +export interface OauthTokenUser { + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +export interface OauthTokenCreatePayload { + client: OauthTokenCreatePayloadClient; + grant: OauthTokenCreatePayloadGrant; + refresh_token: OauthTokenCreatePayloadRefreshToken; +} +export interface OauthTokenCreatePayloadClient { + /** + * secret used to obtain OAuth authorizations under this client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly secret?: string; +} +export interface OauthTokenCreatePayloadGrant { + /** + * grant code received from OAuth web application authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly code?: string; + /** + * type of grant requested, one of `authorization_code` or `refresh_token` + * + * @example "authorization_code" + */ + type?: string; +} +export interface OauthTokenCreatePayloadRefreshToken { + /** + * contents of the token to be used for authorization + * + * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token?: string; +} +/** + * + * [Heroku Platform API - password-reset](https://devcenter.heroku.com/articles/platform-api-reference#password-reset) + * A password reset represents a in-process password reset attempt. + */ +export interface PasswordReset { + /** + * when password reset was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + user: User; +} +export interface PasswordResetResetPasswordPayload { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; +} +export interface PasswordResetCompleteResetPasswordPayload { + /** + * current password on the account + * + * @example "currentpassword" + */ + readonly password: string; + /** + * confirmation of the new password + * + * @example "newpassword" + */ + readonly password_confirmation: string; +} +/** + * + * [Heroku Platform API - peering-info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) + * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. + */ +export interface PeeringInfo { + /** + * The AWS account ID of your Private Space. + * + * @example "123456789012" + */ + readonly aws_account_id: string; + /** + * region name used by provider + * + * @example "us-east-1" + */ + readonly aws_region: 'ap-south-1' | 'eu-west-1' | 'ap-southeast-1' | 'ap-southeast-2' | 'eu-central-1' | 'eu-west-2' | 'ap-northeast-2' | 'ap-northeast-1' | 'us-east-1' | 'sa-east-1' | 'us-west-1' | 'us-west-2' | 'ca-central-1'; + /** + * The AWS VPC ID of the peer. + * + * @example "vpc-1234567890" + */ + readonly vpc_id: string; + /** + * An IP address and the number of significant bits that make up the routing or networking portion. + * + * @example "10.0.0.0/16" + */ + vpc_cidr: string; + /** + * The CIDR ranges that should be routed to the Private Space VPC. + */ + dyno_cidr_blocks: string[]; + /** + * The CIDR ranges that you must not conflict with. + */ + unavailable_cidr_blocks: string[]; + /** + * The CIDR ranges that should be routed to the Private Space VPC. + */ + space_cidr_blocks: string[]; +} +/** + * + * [Heroku Platform API - peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) + * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + */ +export interface Peering { + /** + * The type of peering connection. + * + * @example "heroku-managed" + */ + type: 'heroku-managed' | 'customer-managed' | 'unknown'; + /** + * The AWS VPC Peering Connection ID of the peering. + * + * @example "pcx-123456789012" + */ + readonly pcx_id: string; + /** + * The CIDR blocks of the peer. + */ + cidr_blocks: string[]; + /** + * The status of the peering connection. + * + * @example "pending-acceptance" + */ + readonly status: 'initiating-request' | 'pending-acceptance' | 'provisioning' | 'active' | 'failed' | 'expired' | 'rejected' | 'deleted'; + /** + * The AWS VPC ID of the peer. + * + * @example "vpc-1234567890" + */ + readonly aws_vpc_id: string; + /** + * The AWS region of the peer connection. + * + * @example "us-east-1" + */ + readonly aws_region: string; + /** + * The AWS account ID of your Private Space. + * + * @example "123456789012" + */ + readonly aws_account_id: string; + /** + * When a peering connection will expire. + * + * @example "2020-01-01T12:00:00Z" + */ + readonly expires: string; +} +/** + * + * [Heroku Platform API - permission-entity](https://devcenter.heroku.com/articles/platform-api-reference#permission-entity) + * An owned entity including users' permissions. + */ +export interface PermissionEntity { + /** + * ID of the entity. + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * Name of the entity. + * + * @example "polar-lake-12345" + */ + readonly name: string; + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly team_id: string; + /** + * The type of object the entity is referring to. + * + * @example "app" + */ + readonly type: 'app' | 'space'; + /** + * Users that have access to the entity. + */ + users: Array<{ + /** + * unique email address of account + * + * @example "username@example.com" + */ + email?: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * enterprise account permissions + */ + permissions?: string[]; +}>; +} +/** + * + * [Heroku Platform API - pipeline-coupling](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-coupling) + * Information about an app's coupling to a pipeline + */ +export interface PipelineCoupling { + /** + * app involved in the pipeline coupling + */ + app?: PipelineCouplingApp; + /** + * when pipeline coupling was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of pipeline coupling + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * pipeline involved in the coupling + */ + pipeline?: Pipeline; + /** + * target pipeline stage + * + * @example "production" + */ + stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; + /** + * when pipeline coupling was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app involved in the pipeline coupling + */ +export interface PipelineCouplingApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * A pipeline allows grouping of apps into different stages. + */ +export interface Pipeline { + /** + * when pipeline was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of pipeline + * + * @example "example" + */ + name?: string; + /** + * Owner of a pipeline. + */ + owner?: PipelineOwner | null; + /** + * when pipeline was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; +} +export interface PipelineCouplingCreatePayload { + /** + * unique identifier of app or unique name of app + */ + app: string; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly pipeline: string; + /** + * target pipeline stage + * + * @example "production" + */ + stage: 'test' | 'review' | 'development' | 'staging' | 'production'; +} +export interface PipelineCouplingUpdatePayload { + /** + * target pipeline stage + * + * @example "production" + */ + stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app involved in the release + */ +export interface ReleaseApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - pipeline-promotion-target](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion-target) + * Promotion targets represent an individual app being promoted to + */ +export interface PipelinePromotionTarget { + /** + * the app which was promoted to + */ + app: PipelinePromotionTargetApp; + /** + * an error message for why the promotion failed + * + * @example "User does not have access to that app" + */ + error_message: null | string; + /** + * unique identifier of promotion target + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * the promotion which the target belongs to + */ + pipeline_promotion: PipelinePromotion; + /** + * the release which was created on the target app + */ + release: PipelinePromotionTargetRelease | null; + /** + * status of promotion + * + * @example "pending" + */ + readonly status: 'pending' | 'succeeded' | 'failed'; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * the app which was promoted to + */ +export interface PipelinePromotionTargetApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - pipeline-promotion](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion) + * Promotions allow you to move code from an app in a pipeline to all targets + */ +export interface PipelinePromotion { + /** + * when promotion was created + * + * @example "2012-01-01T12:00:00Z" + */ + created_at: string; + /** + * unique identifier of promotion + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * the pipeline which the promotion belongs to + */ + pipeline: Pipeline; + /** + * the app being promoted from + */ + source: Source; + /** + * status of promotion + * + * @example "pending" + */ + readonly status: 'pending' | 'completed'; + /** + * when promotion was updated + * + * @example "2012-01-01T12:00:00Z" + */ + updated_at: string | null; +} +/** + * + * [Heroku Platform API - release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * the release which was created on the target app + */ +export interface PipelinePromotionTargetRelease { + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - source](https://devcenter.heroku.com/articles/platform-api-reference#source) + * A source is a location for uploading and downloading an application's source code. + */ +export interface Source { + /** + * pointer to the URL where clients can fetch or store the source + */ + source_blob: SourceSourceBlob; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * the app which was promoted from + */ +export interface SourceApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * the release used to promoted from + */ +export interface SourceRelease { + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface PipelinePromotionCreatePayload { + /** + * pipeline involved in the promotion + */ + pipeline: Pipeline; + /** + * the app being promoted from + */ + source: PipelinePromotionCreatePayloadSource; + targets: Array<{ + /** + * the app is being promoted to + */ + app?: PipelinePromotionCreatePayloadApp; +}>; +} +/** + * + * [Heroku Platform API - source](https://devcenter.heroku.com/articles/platform-api-reference#source) + * the app being promoted from + */ +export interface PipelinePromotionCreatePayloadSource { + /** + * the app which was promoted from + */ + app?: PipelinePromotionCreatePayloadSourceApp; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * the app which was promoted from + */ +export interface PipelinePromotionCreatePayloadSourceApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * the app is being promoted to + */ +export interface PipelinePromotionCreatePayloadApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - pipeline-stack](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-stack) + * A pipeline's stack is determined by the apps in the pipeline. This is used during creation of CI and Review Apps that have no stack defined in app.json + */ +export interface PipelineStack { + /** + * identity of the stack that will be used for new builds without a stack defined in CI and Review Apps + */ + stack?: Stack | null; +} +/** + * + * [Heroku Platform API - pipeline-transfer](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-transfer) + * A pipeline transfer is the process of changing pipeline ownership along with the contained apps. + */ +export interface PipelineTransfer { + /** + * pipeline being transferred + */ + pipeline?: Pipeline; + /** + * Previous owner of the pipeline. + */ + previous_owner?: Record; + /** + * New owner of the pipeline. + */ + new_owner?: Record; +} +export interface PipelineTransferCreatePayload { + /** + * The pipeline to transfer + */ + pipeline: Pipeline; + /** + * New pipeline owner + */ + new_owner: NewOwner; +} +/** + * + * New pipeline owner + */ +export interface NewOwner { + /** + * unique identifier of a pipeline owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + id?: string; + /** + * type of pipeline owner + * + * @example "team" + */ + type?: string; +} +/** + * + * Owner of a pipeline. + */ +export interface PipelineOwner { + /** + * unique identifier of a pipeline owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + id: string; + /** + * type of pipeline owner + * + * @example "team" + */ + type: string; +} +export interface PipelineCreatePayload { + /** + * name of pipeline + * + * @example "example" + */ + name: string; + /** + * Owner of a pipeline. + */ + owner?: PipelineCreatePayloadOwner | null; +} +/** + * + * Owner of a pipeline. + */ +export interface PipelineCreatePayloadOwner { + /** + * unique identifier of a pipeline owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + id: string; + /** + * type of pipeline owner + * + * @example "team" + */ + type: string; +} +export interface PipelineUpdatePayload { + /** + * name of pipeline + * + * @example "example" + */ + name?: string; +} +/** + * + * [Heroku Platform API - rate-limit](https://devcenter.heroku.com/articles/platform-api-reference#rate-limit) + * Rate Limit represents the number of request tokens each account holds. Requests to this endpoint do not count towards the rate limit. + */ +export interface RateLimit { + /** + * allowed requests remaining in current interval + * + * @example 2399 + */ + readonly remaining: number; +} +export interface ReleaseCreatePayload { + /** + * description of changes in this release + * + * @example "Added new feature" + */ + readonly description?: string; + /** + * unique identifier of slug + */ + slug: string; +} +export interface ReleaseRollbackPayload { + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly release: string; +} +/** + * + * [Heroku Platform API - review-app](https://devcenter.heroku.com/articles/platform-api-reference#review-app) + * An ephemeral app to review a set of changes + */ +export interface ReviewApp { + /** + * the Heroku app associated to this review app + */ + app: null | ReviewAppApp; + /** + * the app setup for this review app + */ + app_setup: null | ReviewAppAppSetup; + /** + * the branch of the repository which the review app is based on + */ + readonly branch: string; + /** + * when test run was created + */ + readonly created_at: string; + /** + * unique identifier of the review app + */ + readonly id: string; + /** + * the pipeline which this review app belongs to + */ + pipeline: ReviewAppPipeline; + /** + * current state of the review app + */ + readonly status: 'pending' | 'creating' | 'created' | 'deleting' | 'deleted' | 'errored'; + /** + * when review app was updated + */ + readonly updated_at: string; + /** + * The user who created the review app + */ + readonly creator: Record; + /** + * wait for ci before building the app + * + * @example true + */ + readonly wait_for_ci: boolean; + /** + * error message from creating the review app if any + */ + readonly error_status: string | null; + /** + * message from creating the review app if any + */ + readonly message: string | null; + fork_repo: ForkRepo | null; + /** + * pull request number the review app is built for + * + * @example 24 + */ + readonly pr_number: number | null; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * the Heroku app associated to this review app + */ +export interface ReviewAppApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * the app setup for this review app + */ +export interface ReviewAppAppSetup { + /** + * unique identifier of app setup + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * the pipeline which this review app belongs to + */ +export interface ReviewAppPipeline { + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface ForkRepo { + /** + * repository id of the fork the branch resides in + * + * @example "123456" + */ + readonly id: number | null; +} +export interface ReviewAppCreatePayload { + /** + * the branch of the repository which the review app is based on + */ + readonly branch: string; + /** + * pull request number the review app is built for + * + * @example 24 + */ + readonly pr_number?: number | null; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly pipeline: string; + /** + * The download location for the review app's source code + */ + source_blob: ReviewAppCreatePayloadSourceBlob; + /** + * hash of config vars + * + * @example {"FOO":"bar","BAZ":"qux"} + */ + environment?: Record | null; + /** + * repository id of the fork the branch resides in + * + * @example "123456" + */ + readonly fork_repo_id?: number | null; +} +/** + * + * The download location for the review app's source code + */ +export interface ReviewAppCreatePayloadSourceBlob { + /** + * URL where gzipped tar archive of source code for build was downloaded. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly url: string; + /** + * The version number (or SHA) of the code to build. + * + * @example "v1.2.0" + */ + version: string | null; +} +/** + * + * [Heroku Platform API - review-app-config](https://devcenter.heroku.com/articles/platform-api-reference#review-app-config) + * Review apps can be configured for pipelines. + */ +export interface ReviewAppConfig { + repo?: Repo; + /** + * enable automatic review apps for pull requests + * + * @example true + */ + readonly automatic_review_apps?: boolean; + /** + * the deploy target for the review apps of a pipeline + */ + deploy_target?: DeployTarget | null; + /** + * automatically destroy review apps when they haven't been deployed for a number of days + * + * @example true + */ + readonly destroy_stale_apps?: boolean; + /** + * number of days without a deployment after which to consider a review app stale + * + * @example "5" + */ + readonly stale_days?: number; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly pipeline_id?: string; + /** + * If true, review apps are created only when CI passes + * + * @example true + */ + readonly wait_for_ci?: boolean; + /** + * A unique prefix that will be used to create review app names + * + * @example "singular-app" + */ + readonly base_name?: null | string; +} +export interface Repo { + /** + * repository id + * + * @example "123456" + */ + readonly id: number; +} +/** + * + * the deploy target for the review apps of a pipeline + */ +export interface DeployTarget { + /** + * unique identifier of deploy target + * + * @example "us" + */ + readonly id: string; + /** + * type of deploy target + * + * @example "region" + */ + readonly type: string; +} +export interface ReviewAppConfigEnablePayload { + /** + * repository name + * + * @example "heroku/homebrew-brew" + */ + readonly repo: string; + /** + * enable automatic review apps for pull requests + * + * @example true + */ + readonly automatic_review_apps?: boolean; + /** + * automatically destroy review apps when they haven't been deployed for a number of days + * + * @example true + */ + readonly destroy_stale_apps?: boolean; + /** + * number of days without a deployment after which to consider a review app stale + * + * @example "5" + */ + readonly stale_days?: number; + /** + * the deploy target for the review apps of a pipeline + */ + deploy_target?: DeployTarget | null; + /** + * If true, review apps are created only when CI passes + * + * @example true + */ + readonly wait_for_ci?: boolean; + /** + * A unique prefix that will be used to create review app names + * + * @example "singular-app" + */ + readonly base_name?: null | string; +} +export interface ReviewAppConfigUpdatePayload { + /** + * enable automatic review apps for pull requests + * + * @example true + */ + readonly automatic_review_apps?: boolean; + /** + * automatically destroy review apps when they haven't been deployed for a number of days + * + * @example true + */ + readonly destroy_stale_apps?: boolean; + /** + * number of days without a deployment after which to consider a review app stale + * + * @example "5" + */ + readonly stale_days?: number; + /** + * the deploy target for the review apps of a pipeline + */ + deploy_target?: DeployTarget | null; + /** + * If true, review apps are created only when CI passes + * + * @example true + */ + readonly wait_for_ci?: boolean; + /** + * A unique prefix that will be used to create review app names + * + * @example "singular-app" + */ + readonly base_name?: null | string; +} +/** + * + * pointer to the url where clients can fetch or store the actual release binary + */ +export interface Blob { + /** + * method to be used to interact with the slug blob + * + * @example "GET" + */ + readonly method: string; + /** + * URL to interact with the slug blob + * + * @example "https://api.heroku.com/slugs/1234.tgz" + */ + readonly url: string; +} +export interface SlugCreatePayload { + /** + * description from buildpack of slug + * + * @example "Ruby/Rack" + */ + buildpack_provided_description?: null | string; + /** + * an optional checksum of the slug for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum?: null | string; + /** + * identification of the code with your version control system (eg: SHA of the git HEAD) + * + * @example "60883d9e8947a57e04dc9124f25df004866a2051" + */ + commit?: null | string; + /** + * an optional description of the provided commit + * + * @example "fixed a bug with API documentation" + */ + commit_description?: null | string; + /** + * hash mapping process type names to their respective command + * + * @example {"web":"./bin/web -p $PORT"} + */ + process_types: Record; + /** + * unique name of stack or unique identifier of stack + */ + stack?: string; +} +/** + * + * [Heroku Platform API - sms-number](https://devcenter.heroku.com/articles/platform-api-reference#sms-number) + * SMS numbers are used for recovery on accounts with two-factor authentication enabled. + */ +export interface SmsNumber { + /** + * SMS number of account + * + * @example "+1 ***-***-1234" + */ + readonly sms_number: string | null; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * application that this SSL certificate is on + */ +export interface SniEndpointApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of app + * + * @example "example" + */ + name: string; +} +/** + * + * certificate provided by this endpoint + */ +export interface SslCert { + readonly 'ca_signed?'?: boolean; + readonly cert_domains?: unknown[]; + readonly expires_at?: string; + readonly issuer?: string; + readonly 'self_signed?'?: boolean; + readonly starts_at?: string; + readonly subject?: string; + /** + * unique identifier of this SSL certificate + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface SniEndpointCreatePayload { + /** + * raw contents of the public certificate chain (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate_chain: string; + /** + * contents of the private key (eg .key file) + * + * @example "-----BEGIN RSA PRIVATE KEY----- ..." + */ + private_key: string; +} +export interface SniEndpointUpdatePayload { + /** + * raw contents of the public certificate chain (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate_chain: string; + /** + * contents of the private key (eg .key file) + * + * @example "-----BEGIN RSA PRIVATE KEY----- ..." + */ + private_key: string; +} +/** + * + * pointer to the URL where clients can fetch or store the source + */ +export interface SourceSourceBlob { + /** + * URL to download the source + * + * @example "https://api.heroku.com/sources/1234.tgz" + */ + readonly get_url: string; + /** + * URL to upload the source + * + * @example "https://api.heroku.com/sources/1234.tgz" + */ + readonly put_url: string; +} +/** + * + * [Heroku Platform API - space-app-access](https://devcenter.heroku.com/articles/platform-api-reference#space-app-access) + * Space access represents the permissions a particular user has on a particular space. + */ +export interface SpaceAppAccess { + /** + * space user belongs to + */ + space?: SpaceAppAccessSpace; + /** + * when space was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of space + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * user space permissions + */ + permissions?: Array<{ + description?: string; + name?: string; +}>; + /** + * when space was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; + /** + * identity of user account + */ + user?: User; +} +/** + * + * [Heroku Platform API - space](https://devcenter.heroku.com/articles/platform-api-reference#space) + * space user belongs to + */ +export interface SpaceAppAccessSpace { + /** + * unique name of app + * + * @example "example" + */ + name: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +export interface SpaceAppAccessUpdatePayload { + permissions: Array<{ + name?: string; +}>; +} +/** + * + * [Heroku Platform API - space-nat](https://devcenter.heroku.com/articles/platform-api-reference#space-nat) + * Network address translation (NAT) for stable outbound IP addresses from a space + */ +export interface SpaceNat { + /** + * when network address translation for a space was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * potential IPs from which outbound network traffic will originate + */ + readonly sources: string[]; + /** + * availability of network address translation for a space + * + * @example "enabled" + */ + readonly state: 'disabled' | 'updating' | 'enabled'; + /** + * when network address translation for a space was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - space-topology](https://devcenter.heroku.com/articles/platform-api-reference#space-topology) + * Space Topology provides you with a mechanism for viewing all the running dynos, formations and applications for a space. This is the same data thats used to power our DNS Service Discovery. + */ +export interface SpaceTopology { + /** + * version of the space topology payload + * + * @example 1 + */ + readonly version: number; + /** + * The apps within this space + */ + readonly apps: Array<{ + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * + * @example ["example.com","example.net"] + */ + readonly domains?: unknown[]; + /** + * formations for application + */ + readonly formation?: SpaceTopologyFormation[]; +}>; +} +/** + * + * formations for application + */ +export interface SpaceTopologyFormation { + /** + * unique identifier of this process type + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * Name of process type + * + * @example "web" + */ + process_type?: string; + /** + * Current dynos for application + */ + dynos?: SpaceTopologyDyno[]; +} +/** + * + * A dyno + */ +export interface SpaceTopologyDyno { + /** + * unique identifier of this dyno + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * process number, e.g. 1 in web.1 + * + * @example 1 + */ + number?: number; + /** + * RFC1918 Address of Dyno + * + * @example "10.0.134.42" + */ + private_ip?: string; + /** + * localspace hostname of resource + * + * @example "1.example-app-90210.app.localspace" + */ + hostname?: string; +} +export interface SpaceTransferTransferPayload { + /** + * unique name of team + * + * @example "example" + */ + readonly new_owner: string; +} +/** + * + * [Heroku Platform API - team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * team that owns this space + */ +export interface SpaceTeam { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * [Heroku Platform API - region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * identity of space region + */ +export interface SpaceRegion { + /** + * unique identifier of region + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of region + * + * @example "us" + */ + readonly name: string; +} +export interface SpaceUpdatePayload { + /** + * unique name of space + * + * @example "nasa" + */ + name?: string; +} +export interface SpaceCreatePayload { + /** + * unique name of space + * + * @example "nasa" + */ + name: string; + /** + * unique name of team + * + * @example "example" + */ + readonly team: string; + /** + * unique identifier of region or unique name of region + */ + region?: string; + /** + * true if this space has shield enabled + * + * @example true + */ + readonly shield?: boolean; + /** + * The RFC-1918 CIDR the Private Space will use. It must be a /16 in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 + * + * @example "172.20.20.30/16" + */ + cidr?: string; + /** + * The RFC-1918 CIDR that the Private Space will use for the Heroku-managed peering connection that's automatically created when using Heroku Data add-ons. It must be between a /16 and a /20 + * + * @example "10.2.0.0/16" + */ + data_cidr?: string; + /** + * URL to which all apps will drain logs. Only settable during space creation and enables direct logging. Must use HTTPS. + * + * @example "https://example.com/logs" + */ + log_drain_url?: string; +} +/** + * + * [Heroku Platform API - team-app-collaborator](https://devcenter.heroku.com/articles/platform-api-reference#team-app-collaborator) + * A team collaborator represents an account that has been given access to a team app on Heroku. + */ +export interface TeamAppCollaborator { + /** + * app collaborator belongs to + */ + app?: TeamAppCollaboratorApp; + /** + * when collaborator was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of collaborator + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * array of permissions for the collaborator (only applicable if the app is on a team) + */ + permissions?: TeamAppPermission[]; + /** + * role in the team + * + * @example "admin" + */ + readonly role?: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; + /** + * when collaborator was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; + /** + * identity of collaborated account + */ + user?: TeamAppCollaboratorUser; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app collaborator belongs to + */ +export interface TeamAppCollaboratorApp { + /** + * unique name of app + * + * @example "example" + */ + name: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * identity of collaborated account + */ +export interface TeamAppCollaboratorUser { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated: boolean; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +export interface TeamAppCollaboratorCreatePayload { + /** + * An array of permissions to give to the collaborator. + */ + permissions?: string[]; + /** + * whether to suppress email invitation when creating collaborator + */ + silent?: boolean; + /** + * unique email address of account or unique identifier of an account or Implicit reference to currently authorized user + */ + user: string; +} +export interface TeamAppCollaboratorUpdatePayload { + /** + * An array of permissions to give to the collaborator. + */ + permissions: string[]; +} +export interface TeamAppCreatePayload { + /** + * are other team members forbidden from joining this app. + */ + locked?: boolean; + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique name of team + * + * @example "example" + */ + readonly team?: string; + /** + * force creation of the app in the user account even if a default team is set. + */ + personal?: boolean; + /** + * unique name of region + * + * @example "us" + */ + readonly region?: string; + /** + * unique name of space + * + * @example "nasa" + */ + space?: string; + /** + * unique name of stack + * + * @example "heroku-18" + */ + readonly stack?: string; + /** + * describes whether a Private Spaces app is externally routable or not + */ + internal_routing?: boolean | null; +} +export interface TeamAppUpdateLockedPayload { + /** + * are other team members forbidden from joining this app. + */ + locked: boolean; +} +export interface TeamAppTransferToAccountPayload { + /** + * unique email address of account or unique identifier of an account or Implicit reference to currently authorized user + */ + owner: string; +} +export interface TeamAppTransferToTeamPayload { + /** + * unique name of team + * + * @example "example" + */ + readonly owner: string; +} +/** + * + * [Heroku Platform API - team-daily-usage](https://devcenter.heroku.com/articles/platform-api-reference#team-daily-usage) + * Usage for an enterprise team at a daily resolution. + */ +export interface TeamDailyUsage { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons: number; + /** + * app usage in the team + */ + apps: AppUsageDaily[]; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data: number; + /** + * date of the usage + * + * @example "2019-01-01" + */ + readonly date: string; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos: number; + /** + * team identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * name of the team + * + * @example "ops" + */ + readonly name: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space: number; +} +export interface TeamDailyUsageInfoPayload { + /** + * range start date + * + * @example "2019-01-25" + */ + readonly start: string; + /** + * range end date + * + * @example "2019-02-25" + */ + readonly end?: string; +} +/** + * + * [Heroku Platform API - team-delinquency](https://devcenter.heroku.com/articles/platform-api-reference#team-delinquency) + * A Heroku team becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent teams if their invoices remain unpaid. + */ +export interface TeamDelinquency { + /** + * scheduled time of when we will suspend your team due to delinquency + * + * @example "2024-01-01T12:00:00Z" + */ + readonly scheduled_suspension_time: string | null; + /** + * scheduled time of when we will delete your team due to delinquency + * + * @example "2024-01-01T12:00:00Z" + */ + readonly scheduled_deletion_time: string | null; +} +/** + * + * [Heroku Platform API - team-feature](https://devcenter.heroku.com/articles/platform-api-reference#team-feature) + * A team feature represents a feature enabled on a team account. + */ +export interface TeamFeature { + /** + * when team feature was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of team feature + * + * @example "Causes account to example." + */ + readonly description: string; + /** + * documentation URL of team feature + * + * @example "http://devcenter.heroku.com/articles/example" + */ + readonly doc_url: string; + /** + * whether or not team feature has been enabled + * + * @example true + */ + enabled: boolean; + /** + * unique identifier of team feature + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of team feature + * + * @example "name" + */ + readonly name: string; + /** + * state of team feature + * + * @example "public" + */ + readonly state: string; + /** + * when team feature was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user readable feature name + * + * @example "My Feature" + */ + readonly display_name: string; + /** + * e-mail to send feedback about the feature + * + * @example "feedback@heroku.com" + */ + readonly feedback_email: string; +} +/** + * + * [Heroku Platform API - team-invitation](https://devcenter.heroku.com/articles/platform-api-reference#team-invitation) + * A team invitation represents an invite to a team. + */ +export interface TeamInvitation { + /** + * when invitation was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of an invitation + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + invited_by: InvitedBy; + team: TeamInvitationTeam; + /** + * role in the team + * + * @example "admin" + */ + readonly role: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; + /** + * when invitation was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + user: TeamInvitationUser; +} +export interface InvitedBy { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name: string | null; +} +export interface TeamInvitationTeam { + /** + * unique identifier of team + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; +} +export interface TeamInvitationUser { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name: string | null; +} +export interface TeamInvitationCreatePayload { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * role in the team + * + * @example "admin" + */ + readonly role: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; +} +/** + * + * A team member is an individual with access to a team. + */ +export interface TeamMember { + /** + * when the membership record was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * email address of the team member + * + * @example "someone@example.org" + */ + readonly email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated: boolean; + /** + * unique identifier of the team member + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * Identity Provider information the member is federated with + */ + identity_provider?: null | TeamMemberIdentityProvider; + /** + * role in the team + * + * @example "admin" + */ + readonly role?: null | 'admin' | 'collaborator' | 'member' | 'owner' | ''; + /** + * whether the team member has two factor authentication enabled + * + * @example true + */ + readonly two_factor_authentication?: boolean; + /** + * when the membership record was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user information for the membership + */ + user?: TeamMemberUser; +} +/** + * + * Identity Provider information the member is federated with + */ +export interface TeamMemberIdentityProvider { + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of the identity provider + * + * @example "acme" + */ + readonly name?: string; + /** + * whether the identity_provider information is redacted or not + */ + readonly redacted?: boolean; + /** + * entity that owns this identity provider + */ + owner?: Owner; +} +/** + * + * user information for the membership + */ +export interface TeamMemberUser { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * full name of the account owner + * + * @example "Tina Edmonds" + */ + name: string | null; +} +/** + * + * [Heroku Platform API - team-invoice](https://devcenter.heroku.com/articles/platform-api-reference#team-invoice) + * A Team Invoice is an itemized bill of goods for a team which includes pricing and charges. + */ +export interface TeamInvoice { + /** + * total add-ons charges in on this invoice + * + * @example 25000 + */ + readonly addons_total: number; + /** + * total database charges on this invoice + * + * @example 25000 + */ + readonly database_total: number; + /** + * total charges on this invoice + */ + readonly charges_total: number; + /** + * when invoice was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * total credits on this invoice + * + * @example 100000 + */ + readonly credits_total: number; + /** + * total amount of dyno units consumed across dyno types. + * + * @example 1.92 + */ + readonly dyno_units: number; + /** + * unique identifier of this invoice + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * human readable invoice number + * + * @example 9403943 + */ + readonly number: number; + /** + * status of the invoice payment + * + * @example "Paid" + */ + readonly payment_status: string; + /** + * the ending date that the invoice covers + * + * @example "01/31/2014" + */ + readonly period_end: string; + /** + * the starting date that this invoice covers + * + * @example "01/01/2014" + */ + readonly period_start: string; + /** + * total platform charges on this invoice + * + * @example 50000 + */ + readonly platform_total: number; + /** + * payment status for this invoice (pending, successful, failed) + * + * @example 1 + */ + readonly state: number; + /** + * combined total of charges and credits on this invoice + * + * @example 100000 + */ + readonly total: number; + /** + * when invoice was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * The total amount of hours consumed across dyno types. + * + * @example 1488 + */ + readonly weighted_dyno_hours: number; +} +export interface TeamMemberCreateOrUpdatePayload { + /** + * email address of the team member + * + * @example "someone@example.org" + */ + readonly email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated?: boolean; + /** + * role in the team + * + * @example "admin" + */ + role: 'admin' | 'viewer' | 'member'; +} +export interface TeamMemberCreatePayload { + /** + * email address of the team member + * + * @example "someone@example.org" + */ + readonly email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated?: boolean; + /** + * role in the team + * + * @example "admin" + */ + role: 'admin' | 'viewer' | 'member'; +} +export interface TeamMemberUpdatePayload { + /** + * email address of the team member + * + * @example "someone@example.org" + */ + readonly email: string; + /** + * whether the user is federated and belongs to an Identity Provider + */ + readonly federated?: boolean; + /** + * role in the team + * + * @example "admin" + */ + role: 'admin' | 'viewer' | 'member'; +} +/** + * + * [Heroku Platform API - team-monthly-usage](https://devcenter.heroku.com/articles/platform-api-reference#team-monthly-usage) + * Usage for an enterprise team at a monthly resolution. + */ +export interface TeamMonthlyUsage { + /** + * total add-on credits used + * + * @example 250 + */ + readonly addons: number; + /** + * app usage in the team + */ + apps: AppUsageMonthly[]; + /** + * average connect rows synced + * + * @example 15000 + */ + readonly connect: number; + /** + * total add-on credits used for first party add-ons + * + * @example 34.89 + */ + readonly data: number; + /** + * dynos used + * + * @example 1.548 + */ + readonly dynos: number; + /** + * team identifier + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * year and month of the usage + * + * @example "2019-01" + */ + readonly month: string; + /** + * name of the team + * + * @example "ops" + */ + readonly name: string; + /** + * total add-on credits used for third party add-ons + * + * @example 12.34 + */ + readonly partner: number; + /** + * space credits used + * + * @example 1.548 + */ + readonly space: number; +} +export interface TeamMonthlyUsageInfoPayload { + /** + * range start date + * + * @example "2019-01" + */ + readonly start: string; + /** + * range end date + * + * @example "2019-02" + */ + readonly end?: string; +} +/** + * + * [Heroku Platform API - team-preferences](https://devcenter.heroku.com/articles/platform-api-reference#team-preferences) + * Tracks a Team's Preferences + */ +export interface TeamPreferences { + /** + * The default permission used when adding new members to the team + * + * @example "member" + */ + 'default-permission': null | 'admin' | 'member' | 'viewer' | ''; + /** + * Whether add-on service rules should be applied to add-on installations + * + * @example true + */ + 'addons-controls': boolean | null; +} +export interface TeamPreferencesUpdatePayload { + /** + * Whether add-on service rules should be applied to add-on installations + * + * @example true + */ + 'addons-controls'?: boolean | null; +} +export interface TeamEnterpriseAccount { + /** + * unique identifier of the enterprise account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of the enterprise account + * + * @example "example" + */ + readonly name?: string; +} +/** + * + * Identity Provider associated with the Team + */ +export interface TeamIdentityProvider { + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * user-friendly unique identifier for this identity provider + * + * @example "acme-sso" + */ + name: string; + /** + * entity that owns this identity provider + */ + owner: Owner; +} +export interface TeamUpdatePayload { + /** + * whether to use this team when none is specified + * + * @example true + */ + default?: boolean; + /** + * unique name of team + * + * @example "example" + */ + readonly name?: string; +} +export interface TeamCreatePayload { + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; + /** + * street address line 1 + * + * @example "40 Hickory Lane" + */ + address_1?: string; + /** + * street address line 2 + * + * @example "Suite 103" + */ + address_2?: string | null; + /** + * encrypted card number of payment method + * + * @example "encrypted-card-number" + */ + card_number?: string | null; + /** + * city + * + * @example "San Francisco" + */ + city?: string; + /** + * country + * + * @example "US" + */ + country?: string; + /** + * card verification value + * + * @example "123" + */ + cvv?: string | null; + /** + * expiration month + * + * @example "11" + */ + expiration_month?: string | null; + /** + * expiration year + * + * @example "2014" + */ + expiration_year?: string | null; + /** + * the first name for payment method + * + * @example "Jason" + */ + first_name?: string; + /** + * the last name for payment method + * + * @example "Walker" + */ + last_name?: string; + /** + * metadata + * + * @example "Additional information for payment method" + */ + other?: string | null; + /** + * postal code + * + * @example "90210" + */ + postal_code?: string; + /** + * state + * + * @example "CA" + */ + state?: string; + /** + * Nonce generated by Braintree hosted fields form + * + * @example "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" + */ + nonce?: string | null; + /** + * Device data string generated by the client + * + * @example "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" + */ + device_data?: string | null; +} +export interface TeamCreateInEnterpriseAccountPayload { + /** + * unique name of team + * + * @example "example" + */ + readonly name: string; +} +/** + * + * [Heroku Platform API - test-case](https://devcenter.heroku.com/articles/platform-api-reference#test-case) + * A single test case belonging to a test run + */ +export interface TestCase { + /** + * unique identifier of a test case + */ + readonly id: string; + /** + * when test case was created + */ + readonly created_at: string; + /** + * when test case was updated + */ + readonly updated_at: string; + /** + * description of the test case + */ + description: string; + /** + * meta information about the test case + */ + diagnostic: string; + /** + * special note about the test case e.g. skipped, todo + */ + directive: string; + /** + * whether the test case was successful + */ + passed: boolean; + /** + * the test number + */ + number: number; + /** + * the test node which executed this test case + */ + test_node: TestNode; + /** + * the test run which owns this test case + */ + test_run: TestRun; +} +/** + * + * [Heroku Platform API - test-node](https://devcenter.heroku.com/articles/platform-api-reference#test-node) + * A single test node belonging to a test run + */ +export interface TestNode { + /** + * when test node was created + */ + readonly created_at: string; + /** + * the dyno which belongs to this test node + */ + dyno: TestNodeDyno | null; + /** + * the status of the test run when the error occured + */ + error_status: string | null; + /** + * the exit code of the test script + */ + exit_code: number | null; + /** + * unique identifier of a test node + */ + id: string; + /** + * The index of the test node + */ + index: number; + /** + * human friendly message indicating reason for an error + */ + message: string | null; + /** + * the streaming output for the test node + * + * @example "https://example.com/output.log" + */ + output_stream_url: string; + /** + * the pipeline which owns this test node + */ + pipeline: TestNodePipeline; + /** + * the streaming test setup output for the test node + * + * @example "https://example.com/test-setup.log" + */ + setup_stream_url: string; + /** + * current state of the test run + */ + readonly status: 'pending' | 'cancelled' | 'creating' | 'building' | 'running' | 'succeeded' | 'failed' | 'errored' | 'debugging'; + /** + * when test node was updated + */ + readonly updated_at: string; + /** + * the test run which owns this test node + */ + test_run: TestRun; +} +/** + * + * [Heroku Platform API - test-run](https://devcenter.heroku.com/articles/platform-api-reference#test-run) + * An execution or trial of one or more tests + */ +export interface TestRun { + /** + * the email of the actor triggering the test run + */ + actor_email: string; + /** + * whether the test was run with an empty cache + */ + clear_cache: boolean | null; + /** + * the branch of the repository that the test run concerns + */ + commit_branch: string; + /** + * the message for the commit under test + */ + commit_message: string; + /** + * the SHA hash of the commit under test + */ + commit_sha: string; + /** + * whether the test run was started for interactive debugging + */ + debug: boolean; + /** + * the app setup for the test run + */ + app_setup: null | Record; + /** + * when test run was created + */ + readonly created_at: string; + /** + * the type of dynos used for this test-run + */ + dyno: null | TestRunDyno; + /** + * unique identifier of a test run + */ + readonly id: string; + /** + * human friendly message indicating reason for an error + */ + message: string | null; + /** + * the auto incrementing test run number + */ + number: number; + /** + * the team that owns this test-run + */ + organization: null | Organization; + /** + * the pipeline which owns this test-run + */ + pipeline: TestRunPipeline; + /** + * current state of the test run + */ + readonly status: 'pending' | 'cancelled' | 'creating' | 'building' | 'running' | 'succeeded' | 'failed' | 'errored' | 'debugging'; + /** + * The download location for the source code to be tested + */ + source_blob_url: string; + /** + * when test-run was updated + */ + readonly updated_at: string; + /** + * An account represents an individual signed up to use the Heroku platform. + */ + user: Account; + /** + * human friently warning emitted during the test run + */ + warning_message: string | null; +} +/** + * + * [Heroku Platform API - dyno](https://devcenter.heroku.com/articles/platform-api-reference#dyno) + * the dyno which belongs to this test node + */ +export interface TestNodeDyno { + /** + * unique identifier of this dyno or the name of this process on this dyno + */ + id?: string; + /** + * a URL to stream output from for debug runs or null for non-debug runs + * + * @example "rendezvous://rendezvous.runtime.heroku.com:5000/{rendezvous-id}" + */ + readonly attach_url?: string | null; +} +/** + * + * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * the pipeline which owns this test node + */ +export interface TestNodePipeline { + /** + * unique identifier of pipeline or name of pipeline + */ + id?: string; +} +/** + * + * [Heroku Platform API - dyno](https://devcenter.heroku.com/articles/platform-api-reference#dyno) + * the type of dynos used for this test-run + */ +export interface TestRunDyno { + /** + * dyno size + * + * @example "standard-1X" + */ + size?: string; +} +/** + * + * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * the pipeline which owns this test-run + */ +export interface TestRunPipeline { + /** + * unique identifier of pipeline or name of pipeline + */ + id?: string; +} +export interface TestRunCreatePayload { + /** + * the branch of the repository that the test run concerns + */ + commit_branch: string; + /** + * the message for the commit under test + */ + commit_message: string; + /** + * the SHA hash of the commit under test + */ + commit_sha: string; + /** + * whether the test run was started for interactive debugging + */ + debug?: boolean; + /** + * unique name of team or unique identifier of team + */ + organization?: string; + /** + * unique identifier of pipeline or name of pipeline + */ + pipeline: string; + /** + * The download location for the source code to be tested + */ + source_blob_url: string; +} +export interface TestRunUpdatePayload { + /** + * current state of the test run + */ + readonly status: 'pending' | 'cancelled' | 'creating' | 'building' | 'running' | 'succeeded' | 'failed' | 'errored' | 'debugging'; + /** + * human friendly message indicating reason for an error + */ + message: string | null; +} +/** + * + * [Heroku Platform API - user-preferences](https://devcenter.heroku.com/articles/platform-api-reference#user-preferences) + * Tracks a user's preferences and message dismissals + */ +export interface UserPreferences { + /** + * User's default timezone + * + * @example "UTC" + */ + timezone: string | null; + /** + * User's default team + * + * @example "sushi-inc" + */ + 'default-organization': string | null; + /** + * Whether the user has dismissed the GitHub link banner + * + * @example true + */ + 'dismissed-github-banner': boolean | null; + /** + * Whether the user has dismissed the getting started banner + * + * @example true + */ + 'dismissed-getting-started': boolean | null; + /** + * Whether the user has dismissed the Organization Access Controls banner + * + * @example true + */ + 'dismissed-org-access-controls': boolean | null; + /** + * Whether the user has dismissed the Organization Wizard + * + * @example true + */ + 'dismissed-org-wizard-notification': boolean | null; + /** + * Whether the user has dismissed the Pipelines banner + * + * @example true + */ + 'dismissed-pipelines-banner': boolean | null; + /** + * Whether the user has dismissed the GitHub banner on a pipeline overview + * + * @example true + */ + 'dismissed-pipelines-github-banner': boolean | null; + /** + * Which pipeline uuids the user has dismissed the GitHub banner for + * + * @example ["96c68759-f310-4910-9867-e0b062064098"] + */ + 'dismissed-pipelines-github-banners': null | string[]; + /** + * Whether the user has dismissed the 2FA SMS banner + * + * @example true + */ + 'dismissed-sms-banner': boolean | null; +} +export interface UserPreferencesUpdatePayload { + /** + * User's default timezone + * + * @example "UTC" + */ + timezone?: string | null; + /** + * User's default team + * + * @example "sushi-inc" + */ + 'default-organization'?: string | null; + /** + * Whether the user has dismissed the GitHub link banner + * + * @example true + */ + 'dismissed-github-banner'?: boolean | null; + /** + * Whether the user has dismissed the getting started banner + * + * @example true + */ + 'dismissed-getting-started'?: boolean | null; + /** + * Whether the user has dismissed the Organization Access Controls banner + * + * @example true + */ + 'dismissed-org-access-controls'?: boolean | null; + /** + * Whether the user has dismissed the Organization Wizard + * + * @example true + */ + 'dismissed-org-wizard-notification'?: boolean | null; + /** + * Whether the user has dismissed the Pipelines banner + * + * @example true + */ + 'dismissed-pipelines-banner'?: boolean | null; + /** + * Whether the user has dismissed the GitHub banner on a pipeline overview + * + * @example true + */ + 'dismissed-pipelines-github-banner'?: boolean | null; + /** + * Which pipeline uuids the user has dismissed the GitHub banner for + * + * @example ["96c68759-f310-4910-9867-e0b062064098"] + */ + 'dismissed-pipelines-github-banners'?: null | string[]; + /** + * Whether the user has dismissed the 2FA SMS banner + * + * @example true + */ + 'dismissed-sms-banner'?: boolean | null; +} +/** + * + * [Heroku Platform API - vpn-connection](https://devcenter.heroku.com/articles/platform-api-reference#vpn-connection) + * [VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN. + */ +export interface VpnConnection { + /** + * VPN ID + * + * @example "123456789012" + */ + readonly id: string; + /** + * VPN Name + * + * @example "office" + */ + name: string; + /** + * Public IP of VPN customer gateway + * + * @example "35.161.69.30" + */ + public_ip: string; + /** + * Routable CIDRs of VPN + */ + routable_cidrs: string[]; + /** + * CIDR Block of the Private Space + * + * @example "10.0.0.0/16" + */ + readonly space_cidr_block: string; + tunnels: Tunnel[]; + /** + * IKE Version + * + * @example 1 + */ + readonly ike_version: number; + /** + * Status of the VPN + * + * @example "active" + */ + readonly status: 'pending' | 'provisioning' | 'active' | 'deprovisioning' | 'failed'; + /** + * Details of the status + * + * @example "supplied CIDR block already in use" + */ + readonly status_message: string; +} +/** + * + * Tunnel info + */ +export interface Tunnel { + /** + * Timestamp of last status changed + * + * @example "2016-10-25T22:09:05Z" + */ + last_status_change?: string; + /** + * Public IP address for the tunnel + * + * @example "52.44.146.197" + */ + ip?: string; + /** + * Public IP address for the customer side of the tunnel + * + * @example "52.44.146.197" + */ + customer_ip?: string; + /** + * Pre-shared key + * + * @example "secret" + */ + pre_shared_key?: string; + /** + * Status of the tunnel + * + * @example "UP" + */ + status?: 'UP' | 'DOWN'; + /** + * Details of the status + * + * @example "status message" + */ + status_message?: string; +} +export interface VpnConnectionCreatePayload { + /** + * VPN Name + * + * @example "office" + */ + name: string; + /** + * Public IP of VPN customer gateway + * + * @example "35.161.69.30" + */ + public_ip: string; + /** + * Routable CIDRs of VPN + */ + routable_cidrs: string[]; +} +export interface VpnConnectionUpdatePayload { + /** + * Routable CIDRs of VPN + */ + routable_cidrs: string[]; +} diff --git a/src/services/account-delinquency-service.ts b/src/services/account-delinquency-service.ts new file mode 100644 index 0000000..394e471 --- /dev/null +++ b/src/services/account-delinquency-service.ts @@ -0,0 +1,32 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Account Delinquency](https://devcenter.heroku.com/articles/platform-api-reference#account-delinquency) + * A Heroku account becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent accounts if their invoices remain unpaid. + */ +export default class AccountDelinquencyService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Account delinquency information. + * + * @param requestInit The initializer for the request. + */ + public async info(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/delinquency`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/account-feature-service.ts b/src/services/account-feature-service.ts new file mode 100644 index 0000000..622304f --- /dev/null +++ b/src/services/account-feature-service.ts @@ -0,0 +1,83 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Account Feature](https://devcenter.heroku.com/articles/platform-api-reference#account-feature) + * An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku. + */ +export default class AccountFeatureService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for an existing account feature. + * + * @param accountFeatureIdentity unique identifier of account feature or unique name of account feature. + * @param requestInit The initializer for the request. + */ + public async info( + accountFeatureIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/features/${accountFeatureIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing account features. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/features`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update an existing account feature. + * + * @param accountFeatureIdentity unique identifier of account feature or unique name of account feature. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + accountFeatureIdentity: string, + payload: Heroku.AccountFeatureUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/features/${accountFeatureIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/account-service.ts b/src/services/account-service.ts new file mode 100644 index 0000000..f444001 --- /dev/null +++ b/src/services/account-service.ts @@ -0,0 +1,154 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Account](https://devcenter.heroku.com/articles/platform-api-reference#account) + * An account represents an individual signed up to use the Heroku platform. + */ +export default class AccountService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for account. + * + * @param requestInit The initializer for the request. + */ + public async info(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update account. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + payload: Heroku.AccountUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. + * + * @param requestInit The initializer for the request. + */ + public async delete(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for account. + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + public async infoByUser( + accountIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update account. + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async updateByUser( + accountIdentity: string, + payload: Heroku.AccountUpdateByUserPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + public async deleteByUser( + accountIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/add-on-action-service.ts b/src/services/add-on-action-service.ts new file mode 100644 index 0000000..91a2973 --- /dev/null +++ b/src/services/add-on-action-service.ts @@ -0,0 +1,62 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Action](https://devcenter.heroku.com/articles/platform-api-reference#add-on-action) + * Add-on Actions are lifecycle operations for add-on provisioning and deprovisioning. They allow add-on providers to (de)provision add-ons in the background and then report back when (de)provisioning is complete. + */ +export default class AddOnActionService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Mark an add-on as provisioned for use. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + public async provision( + addOnIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/actions/provision`, { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Mark an add-on as deprovisioned. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + public async deprovision( + addOnIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/actions/deprovision`, { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/add-on-attachment-service.ts b/src/services/add-on-attachment-service.ts new file mode 100644 index 0000000..4750fb6 --- /dev/null +++ b/src/services/add-on-attachment-service.ts @@ -0,0 +1,208 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Attachment](https://devcenter.heroku.com/articles/platform-api-reference#add-on-attachment) + * An add-on attachment represents a connection between an app and an add-on that it has been given access to. + */ +export default class AddOnAttachmentService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new add-on attachment. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.AddOnAttachmentCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addon-attachments`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete an existing add-on attachment. + * + * @param addOnAttachmentIdentity unique identifier of this add-on attachment. + * @param requestInit The initializer for the request. + */ + public async delete( + addOnAttachmentIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addon-attachments/${addOnAttachmentIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for existing add-on attachment. + * + * @param addOnAttachmentIdentity unique identifier of this add-on attachment. + * @param requestInit The initializer for the request. + */ + public async info( + addOnAttachmentIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addon-attachments/${addOnAttachmentIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing add-on attachments. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addon-attachments`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing add-on attachments for an add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + public async listByAddOn( + addOnIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/addon-attachments`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing add-on attachments for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async listByApp( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addon-attachments`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for existing add-on attachment for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnAttachmentScopedIdentity unique identifier of this add-on attachment or unique name for this add-on attachment to this app. + * @param requestInit The initializer for the request. + */ + public async infoByApp( + appIdentity: string, + addOnAttachmentScopedIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/apps/${appIdentity}/addon-attachments/${addOnAttachmentScopedIdentity}`, + { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Resolve an add-on attachment from a name, optionally passing an app name. If there are matches it returns at least one add-on attachment (exact match) or many. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async resolution( + payload: Heroku.AddOnAttachmentResolutionPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/actions/addon-attachments/resolve`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/add-on-config-service.ts b/src/services/add-on-config-service.ts new file mode 100644 index 0000000..8b8f76c --- /dev/null +++ b/src/services/add-on-config-service.ts @@ -0,0 +1,63 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Config](https://devcenter.heroku.com/articles/platform-api-reference#add-on-config) + * Configuration of an Add-on + */ +export default class AddOnConfigService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Get an add-on's config. Accessible by customers with access and by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + public async list( + addOnIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/config`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update an add-on's config. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + addOnIdentity: string, + payload: Heroku.AddOnConfigUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/config`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/add-on-region-capability-service.ts b/src/services/add-on-region-capability-service.ts new file mode 100644 index 0000000..0bc10d3 --- /dev/null +++ b/src/services/add-on-region-capability-service.ts @@ -0,0 +1,83 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Region Capability](https://devcenter.heroku.com/articles/platform-api-reference#add-on-region-capability) + * Add-on region capabilities represent the relationship between an Add-on Service and a specific Region. Only Beta and GA add-ons are returned by these endpoints. + */ +export default class AddOnRegionCapabilityService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List all existing add-on region capabilities. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addon-region-capabilities`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing add-on region capabilities for an add-on-service + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + public async listByAddOnService( + addOnServiceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/addon-services/${addOnServiceIdentity}/region-capabilities`, + { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing add-on region capabilities for a region. + * + * @param regionIdentity unique identifier of region or unique name of region. + * @param requestInit The initializer for the request. + */ + public async listByRegion( + regionIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/regions/${regionIdentity}/addon-region-capabilities`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/add-on-service-service.ts b/src/services/add-on-service-service.ts new file mode 100644 index 0000000..5e7d288 --- /dev/null +++ b/src/services/add-on-service-service.ts @@ -0,0 +1,56 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Service](https://devcenter.heroku.com/articles/platform-api-reference#add-on-service) + * Add-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. + */ +export default class AddOnServiceService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for existing add-on-service. + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + public async info( + addOnServiceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addon-services/${addOnServiceIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing add-on-services. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addon-services`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/add-on-service.ts b/src/services/add-on-service.ts new file mode 100644 index 0000000..915934a --- /dev/null +++ b/src/services/add-on-service.ts @@ -0,0 +1,262 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on](https://devcenter.heroku.com/articles/platform-api-reference#add-on) + * Add-ons represent add-ons that have been provisioned and attached to one or more apps. + */ +export default class AddOnService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List all existing add-ons. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for an existing add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + public async info( + addOnIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Create a new add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + appIdentity: string, + payload: Heroku.AddOnCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete an existing add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + public async delete( + appIdentity: string, + addOnIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons/${addOnIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for an existing add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + public async infoByApp( + appIdentity: string, + addOnIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons/${addOnIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing add-ons for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async listByApp( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Change add-on plan. Some add-ons may not support changing plans. In that case, an error will be returned. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + appIdentity: string, + addOnIdentity: string, + payload: Heroku.AddOnUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons/${addOnIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List all existing add-ons a user has access to + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + public async listByUser( + accountIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}/addons`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List add-ons used across all Team apps + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async listByTeam( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/addons`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Resolve an add-on from a name, optionally passing an app name. If there are matches it returns at least one add-on (exact match) or many. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async resolution( + payload: Heroku.AddOnResolutionPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/actions/addons/resolve`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/add-on-webhook-delivery-service.ts b/src/services/add-on-webhook-delivery-service.ts new file mode 100644 index 0000000..3c26a3f --- /dev/null +++ b/src/services/add-on-webhook-delivery-service.ts @@ -0,0 +1,65 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Webhook Delivery](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook-delivery) + * Represents the delivery of a webhook notification, including its current status. + */ +export default class AddOnWebhookDeliveryService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Returns the info for an existing delivery. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookDeliveryIdentity the delivery's unique identifier. + * @param requestInit The initializer for the request. + */ + public async info( + addOnIdentity: string, + appWebhookDeliveryIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/addons/${addOnIdentity}/webhook-deliveries/${appWebhookDeliveryIdentity}`, + { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Lists existing deliveries for an add-on. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + public async list( + addOnIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhook-deliveries`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/add-on-webhook-event-service.ts b/src/services/add-on-webhook-event-service.ts new file mode 100644 index 0000000..a4df8fa --- /dev/null +++ b/src/services/add-on-webhook-event-service.ts @@ -0,0 +1,65 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Webhook Event](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook-event) + * Represents a webhook event that occurred. + */ +export default class AddOnWebhookEventService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Returns the info for a specified webhook event. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookEventIdentity the event's unique identifier. + * @param requestInit The initializer for the request. + */ + public async info( + addOnIdentity: string, + appWebhookEventIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/addons/${addOnIdentity}/webhook-events/${appWebhookEventIdentity}`, + { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Lists existing webhook events for an add-on. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + public async list( + addOnIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhook-events`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/add-on-webhook-service.ts b/src/services/add-on-webhook-service.ts new file mode 100644 index 0000000..ab05142 --- /dev/null +++ b/src/services/add-on-webhook-service.ts @@ -0,0 +1,145 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on Webhook](https://devcenter.heroku.com/articles/platform-api-reference#add-on-webhook) + * Represents the details of a webhook subscription + */ +export default class AddOnWebhookService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + addOnIdentity: string, + payload: Heroku.AddOnWebhookCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhooks`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Removes an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + public async delete( + addOnIdentity: string, + appWebhookIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Returns the info for an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + public async info( + addOnIdentity: string, + appWebhookIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List all webhook subscriptions for a particular add-on. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + public async list( + addOnIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhooks`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Updates the details of an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param appWebhookIdentity the webhook's unique identifier. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + addOnIdentity: string, + appWebhookIdentity: string, + payload: Heroku.AddOnWebhookUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/allowed-add-on-service-service.ts b/src/services/allowed-add-on-service-service.ts new file mode 100644 index 0000000..2096c13 --- /dev/null +++ b/src/services/allowed-add-on-service-service.ts @@ -0,0 +1,93 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Allowed Add-on Service](https://devcenter.heroku.com/articles/platform-api-reference#allowed-add-on-service) + * Entities that have been allowed to be used by a Team + */ +export default class AllowedAddOnServiceService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List all allowed add-on services for a team + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async listByTeam( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/allowed-addon-services`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Allow an Add-on Service + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async createByTeam( + teamIdentity: string, + payload: Heroku.AllowedAddOnServiceCreateByTeamPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/allowed-addon-services`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Remove an allowed add-on service + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param allowedAddOnServiceIdentity unique identifier for this allowed add-on service record or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + public async deleteByTeam( + teamIdentity: string, + allowedAddOnServiceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/teams/${teamIdentity}/allowed-addon-services/${allowedAddOnServiceIdentity}`, + { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/app-feature-service.ts b/src/services/app-feature-service.ts new file mode 100644 index 0000000..5652588 --- /dev/null +++ b/src/services/app-feature-service.ts @@ -0,0 +1,91 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App Feature](https://devcenter.heroku.com/articles/platform-api-reference#app-feature) + * An app feature represents a Heroku labs capability that can be enabled or disabled for an app on Heroku. + */ +export default class AppFeatureService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for an existing app feature. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appFeatureIdentity unique identifier of app feature or unique name of app feature. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + appFeatureIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/features/${appFeatureIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing app features. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async list( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/features`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update an existing app feature. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appFeatureIdentity unique identifier of app feature or unique name of app feature. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + appIdentity: string, + appFeatureIdentity: string, + payload: Heroku.AppFeatureUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/features/${appFeatureIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/app-service.ts b/src/services/app-service.ts new file mode 100644 index 0000000..c591809 --- /dev/null +++ b/src/services/app-service.ts @@ -0,0 +1,229 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App](https://devcenter.heroku.com/articles/platform-api-reference#app) + * An app represents the program that you would like to deploy and run on Heroku. + */ +export default class AppService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new app. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.AppCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete an existing app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async delete( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for existing app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async info(appIdentity: string, requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing apps. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List owned and collaborated apps (excludes team apps). + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + public async listOwnedAndCollaborated( + accountIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}/apps`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update an existing app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + appIdentity: string, + payload: Heroku.AppUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Enable ACM flag for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async enableAcm( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/acm`, { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Disable ACM flag for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async disableAcm( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/acm`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Refresh ACM for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async refreshAcm( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/acm`, { + ...requestInit, + + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/app-setup-service.ts b/src/services/app-setup-service.ts new file mode 100644 index 0000000..e555c33 --- /dev/null +++ b/src/services/app-setup-service.ts @@ -0,0 +1,61 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Setup API - App Setup](https://devcenter.heroku.com/articles/platform-api-reference#app-setup) + * An app setup represents an app on Heroku that is setup using an environment, addons, and scripts described in an app.json manifest file. + */ +export default class AppSetupService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new app setup from a gzipped tar archive containing an app.json manifest file. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.AppSetupCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/app-setups`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Get the status of an app setup. + * + * @param appSetupIdentity unique identifier of app setup. + * @param requestInit The initializer for the request. + */ + public async info( + appSetupIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/app-setups/${appSetupIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/app-transfer-service.ts b/src/services/app-transfer-service.ts new file mode 100644 index 0000000..d131854 --- /dev/null +++ b/src/services/app-transfer-service.ts @@ -0,0 +1,133 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App Transfer](https://devcenter.heroku.com/articles/platform-api-reference#app-transfer) + * An app transfer represents a two party interaction for transferring ownership of an app. + */ +export default class AppTransferService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new app transfer. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.AppTransferCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/app-transfers`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete an existing app transfer + * + * @param appTransferIdentity unique identifier of app transfer or unique name of app. + * @param requestInit The initializer for the request. + */ + public async delete( + appTransferIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/app-transfers/${appTransferIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for existing app transfer. + * + * @param appTransferIdentity unique identifier of app transfer or unique name of app. + * @param requestInit The initializer for the request. + */ + public async info( + appTransferIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/app-transfers/${appTransferIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing apps transfers. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/app-transfers`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update an existing app transfer. + * + * @param appTransferIdentity unique identifier of app transfer or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + appTransferIdentity: string, + payload: Heroku.AppTransferUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/app-transfers/${appTransferIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/app-webhook-delivery-service.ts b/src/services/app-webhook-delivery-service.ts new file mode 100644 index 0000000..404abab --- /dev/null +++ b/src/services/app-webhook-delivery-service.ts @@ -0,0 +1,65 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App Webhook Delivery](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook-delivery) + * Represents the delivery of a webhook notification, including its current status. + */ +export default class AppWebhookDeliveryService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Returns the info for an existing delivery. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookDeliveryIdentity the delivery's unique identifier. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + appWebhookDeliveryIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/apps/${appIdentity}/webhook-deliveries/${appWebhookDeliveryIdentity}`, + { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Lists existing deliveries for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async list( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhook-deliveries`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/app-webhook-event-service.ts b/src/services/app-webhook-event-service.ts new file mode 100644 index 0000000..0234ecb --- /dev/null +++ b/src/services/app-webhook-event-service.ts @@ -0,0 +1,65 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App Webhook Event](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook-event) + * Represents a webhook event that occurred. + */ +export default class AppWebhookEventService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Returns the info for a specified webhook event. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookEventIdentity the event's unique identifier. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + appWebhookEventIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/apps/${appIdentity}/webhook-events/${appWebhookEventIdentity}`, + { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Lists existing webhook events for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async list( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhook-events`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/app-webhook-service.ts b/src/services/app-webhook-service.ts new file mode 100644 index 0000000..0bb68fb --- /dev/null +++ b/src/services/app-webhook-service.ts @@ -0,0 +1,145 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - App Webhook](https://devcenter.heroku.com/articles/platform-api-reference#app-webhook) + * Represents the details of a webhook subscription + */ +export default class AppWebhookService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + appIdentity: string, + payload: Heroku.AppWebhookCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhooks`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Removes an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + public async delete( + appIdentity: string, + appWebhookIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Returns the info for an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookIdentity the webhook's unique identifier. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + appWebhookIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List all webhook subscriptions for a particular app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async list( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhooks`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Updates the details of an app webhook subscription. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param appWebhookIdentity the webhook's unique identifier. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + appIdentity: string, + appWebhookIdentity: string, + payload: Heroku.AppWebhookUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/webhooks/${appWebhookIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/archive-service.ts b/src/services/archive-service.ts new file mode 100644 index 0000000..50f2141 --- /dev/null +++ b/src/services/archive-service.ts @@ -0,0 +1,57 @@ +/** + * [Heroku Platform API - Audit Trail Archive](https://devcenter.heroku.com/articles/platform-api-reference#archive) + * An audit trail archive represents a monthly json zipped file containing events + */ +export default class ArchiveService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Get archive for a single month. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param archiveYear year of the archive + * @example 2019. + * @param archiveMonth month of the archive + * @example "10". + * @param requestInit The initializer for the request. + */ + public async info( + enterpriseAccountIdentity: string, + archiveYear: number, + archiveMonth: '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12', + requestInit: Omit = {} + ): Promise { + await this.fetchImpl(`/enterprise-accounts/${enterpriseAccountIdentity}/archives/${archiveYear}/${archiveMonth}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } + /** + * List existing archives. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + public async list( + enterpriseAccountIdentity: string, + requestInit: Omit = {} + ): Promise { + await this.fetchImpl(`/enterprise-accounts/${enterpriseAccountIdentity}/archives`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } +} diff --git a/src/services/audit-trail-event-service.ts b/src/services/audit-trail-event-service.ts new file mode 100644 index 0000000..c00a61a --- /dev/null +++ b/src/services/audit-trail-event-service.ts @@ -0,0 +1,31 @@ +/** + * [Heroku Platform API - Audit Trail Event](https://devcenter.heroku.com/articles/platform-api-reference#audit-trail-event) + * An audit trail event represents some action on the platform + */ +export default class AuditTrailEventService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List existing events. Returns all events for one day, defaulting to current day. Order, actor, action, and type, and day query params can be specified as query parameters. For example, '/enterprise-accounts/:id/events?order=desc&actor=user@example.com&action=create&type=app&day=2020-09-30' would return events in descending order and only return app created events by the user with user@example.com email address. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + public async list( + enterpriseAccountIdentity: string, + requestInit: Omit = {} + ): Promise { + await this.fetchImpl(`/enterprise-accounts/${enterpriseAccountIdentity}/events`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } +} diff --git a/src/services/build-service.ts b/src/services/build-service.ts new file mode 100644 index 0000000..7582212 --- /dev/null +++ b/src/services/build-service.ts @@ -0,0 +1,134 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Build API - Build](https://devcenter.heroku.com/articles/platform-api-reference#build) + * A build represents the process of transforming a code tarball into a slug + */ +export default class BuildService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + appIdentity: string, + payload: Heroku.BuildCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/builds`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for existing build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param buildIdentity unique identifier of build. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + buildIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/builds/${buildIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async list( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/builds`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Destroy a build cache. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async deleteCache(appIdentity: string, requestInit: Omit = {}): Promise { + await this.fetchImpl(`/apps/${appIdentity}/build-cache`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + } + /** + * Cancel running build. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param buildIdentity unique identifier of build. + * @param requestInit The initializer for the request. + */ + public async cancel( + appIdentity: string, + buildIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/builds/${buildIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/buildpack-installation-service.ts b/src/services/buildpack-installation-service.ts new file mode 100644 index 0000000..6149ff1 --- /dev/null +++ b/src/services/buildpack-installation-service.ts @@ -0,0 +1,63 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Buildpack Installations](https://devcenter.heroku.com/articles/platform-api-reference#buildpack-installation) + * A buildpack installation represents a buildpack that will be run against an app. + */ +export default class BuildpackInstallationService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Update an app's buildpack installations. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + appIdentity: string, + payload: Heroku.BuildpackInstallationUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/buildpack-installations`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List an app's existing buildpack installations. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async list( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/buildpack-installations`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/collaborator-service.ts b/src/services/collaborator-service.ts new file mode 100644 index 0000000..11e0e36 --- /dev/null +++ b/src/services/collaborator-service.ts @@ -0,0 +1,122 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Collaborator](https://devcenter.heroku.com/articles/platform-api-reference#collaborator) + * A collaborator represents an account that has been given access to an app on Heroku. + */ +export default class CollaboratorService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new collaborator. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + appIdentity: string, + payload: Heroku.CollaboratorCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/collaborators`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete an existing collaborator. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param collaboratorIdentity invited email address of collaborator or unique identifier of collaborator. + * @param requestInit The initializer for the request. + */ + public async delete( + appIdentity: string, + collaboratorIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/apps/${appIdentity}/collaborators/${collaboratorIdentity}`, + { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for existing collaborator. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param collaboratorIdentity invited email address of collaborator or unique identifier of collaborator. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + collaboratorIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/apps/${appIdentity}/collaborators/${collaboratorIdentity}`, + { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing collaborators. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async list( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/collaborators`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/config-var-service.ts b/src/services/config-var-service.ts new file mode 100644 index 0000000..fad1dc1 --- /dev/null +++ b/src/services/config-var-service.ts @@ -0,0 +1,91 @@ +/** + * [Heroku Platform API - Config Vars](https://devcenter.heroku.com/articles/platform-api-reference#config-var) + * Config Vars allow you to manage the configuration information provided to an app on Heroku. + */ +export default class ConfigVarService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Get config-vars for app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async infoForApp( + appIdentity: string, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/config-vars`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise>; + } + throw new Error(response.statusText); + } + /** + * Get config-vars for a release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param releaseIdentity unique identifier of release or unique version assigned to the release. + * @param requestInit The initializer for the request. + */ + public async infoForAppRelease( + appIdentity: string, + releaseIdentity: string | number, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl( + `${this.endpoint}/apps/${appIdentity}/releases/${releaseIdentity}/config-vars`, + { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise>; + } + throw new Error(response.statusText); + } + /** + * Update config-vars for app. You can update existing config-vars by setting them again, and remove by setting it to `null`. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + appIdentity: string, + payload: Record, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/config-vars`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise>; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/credit-service.ts b/src/services/credit-service.ts new file mode 100644 index 0000000..2433183 --- /dev/null +++ b/src/services/credit-service.ts @@ -0,0 +1,81 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Credit](https://devcenter.heroku.com/articles/platform-api-reference#credit) + * A credit represents value that will be used up before further charges are assigned to an account. + */ +export default class CreditService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new credit. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.CreditCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/credits`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for existing credit. + * + * @param creditIdentity unique identifier of credit. + * @param requestInit The initializer for the request. + */ + public async info( + creditIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/credits/${creditIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing credits. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/credits`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/domain-service.ts b/src/services/domain-service.ts new file mode 100644 index 0000000..c5f0021 --- /dev/null +++ b/src/services/domain-service.ts @@ -0,0 +1,145 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Domain](https://devcenter.heroku.com/articles/platform-api-reference#domain) + * Domains define what web routes should be routed to an app on Heroku. + */ +export default class DomainService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new domain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + appIdentity: string, + payload: Heroku.DomainCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/domains`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Associate an SNI endpoint + * + * @param appIdentity unique identifier of app or unique name of app. + * @param domainIdentity unique identifier of this domain or full hostname. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + appIdentity: string, + domainIdentity: string, + payload: Heroku.DomainUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/domains/${domainIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete an existing domain + * + * @param appIdentity unique identifier of app or unique name of app. + * @param domainIdentity unique identifier of this domain or full hostname. + * @param requestInit The initializer for the request. + */ + public async delete( + appIdentity: string, + domainIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/domains/${domainIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for existing domain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param domainIdentity unique identifier of this domain or full hostname. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + domainIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/domains/${domainIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing domains. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async list( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/domains`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/dyno-service.ts b/src/services/dyno-service.ts new file mode 100644 index 0000000..bbeaafd --- /dev/null +++ b/src/services/dyno-service.ts @@ -0,0 +1,168 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Dyno](https://devcenter.heroku.com/articles/platform-api-reference#dyno) + * Dynos encapsulate running processes of an app on Heroku. Detailed information about dyno sizes can be found at: [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +export default class DynoService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + appIdentity: string, + payload: Heroku.DynoCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Restart dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param requestInit The initializer for the request. + */ + public async restart( + appIdentity: string, + dynoIdentity: string, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos/${dynoIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise>; + } + throw new Error(response.statusText); + } + /** + * Restart all dynos. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async restartAll( + appIdentity: string, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise>; + } + throw new Error(response.statusText); + } + /** + * Stop dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param requestInit The initializer for the request. + */ + public async stop( + appIdentity: string, + dynoIdentity: string, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos/${dynoIdentity}/actions/stop`, { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise>; + } + throw new Error(response.statusText); + } + /** + * Info for existing dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + dynoIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos/${dynoIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing dynos. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async list( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/dyno-size-service.ts b/src/services/dyno-size-service.ts new file mode 100644 index 0000000..c85c29b --- /dev/null +++ b/src/services/dyno-size-service.ts @@ -0,0 +1,56 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Dyno Size](https://devcenter.heroku.com/articles/platform-api-reference#dyno-size) + * Dyno sizes are the values and details of sizes that can be assigned to dynos. This information can also be found at : [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). + */ +export default class DynoSizeService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for existing dyno size. + * + * @param dynoSizeIdentity unique identifier of this dyno size or the name of this dyno-size. + * @param requestInit The initializer for the request. + */ + public async info( + dynoSizeIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/dyno-sizes/${dynoSizeIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing dyno sizes. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/dyno-sizes`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/enterprise-account-daily-usage-service.ts b/src/services/enterprise-account-daily-usage-service.ts new file mode 100644 index 0000000..23f6447 --- /dev/null +++ b/src/services/enterprise-account-daily-usage-service.ts @@ -0,0 +1,39 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Enterprise Account Daily Usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-daily-usage) + * Usage for an enterprise account at a daily resolution. + */ +export default class EnterpriseAccountDailyUsageService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Retrieves usage for an enterprise account for a range of days. Start and end dates can be specified as query parameters using the date format YYYY-MM-DD. The enterprise account identifier can be found from the [enterprise account list](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-list). + * + * @param enterpriseAccountId unique identifier of the enterprise account + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async info( + enterpriseAccountId: string, + payload: Heroku.EnterpriseAccountDailyUsageInfoPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountId}/usage/daily`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/enterprise-account-member-service.ts b/src/services/enterprise-account-member-service.ts new file mode 100644 index 0000000..fe50098 --- /dev/null +++ b/src/services/enterprise-account-member-service.ts @@ -0,0 +1,125 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Enterprise Account Member](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-member) + * Enterprise account members are users with access to an enterprise account. + */ +export default class EnterpriseAccountMemberService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List members in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + public async list( + enterpriseAccountIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/members`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Create a member in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + enterpriseAccountIdentity: string, + payload: Heroku.EnterpriseAccountMemberCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/members`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update a member in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param enterpriseAccountMemberUserIdentity unique email address of account or unique identifier of an account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + enterpriseAccountIdentity: string, + enterpriseAccountMemberUserIdentity: string, + payload: Heroku.EnterpriseAccountMemberUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/members/${enterpriseAccountMemberUserIdentity}`, + { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * delete a member in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param enterpriseAccountMemberUserIdentity unique email address of account or unique identifier of an account. + * @param requestInit The initializer for the request. + */ + public async delete( + enterpriseAccountIdentity: string, + enterpriseAccountMemberUserIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/members/${enterpriseAccountMemberUserIdentity}`, + { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/enterprise-account-monthly-usage-service.ts b/src/services/enterprise-account-monthly-usage-service.ts new file mode 100644 index 0000000..d77af9e --- /dev/null +++ b/src/services/enterprise-account-monthly-usage-service.ts @@ -0,0 +1,39 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Enterprise Account Monthly Usage](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-monthly-usage) + * Usage for an enterprise account at a monthly resolution. + */ +export default class EnterpriseAccountMonthlyUsageService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Retrieves usage for an enterprise account for a range of months. Start and end dates can be specified as query parameters using the date format YYYY-MM. If no end date is specified, one month of usage is returned. The enterprise account identifier can be found from the [enterprise account list](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account-list). + * + * @param enterpriseAccountId unique identifier of the enterprise account + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async info( + enterpriseAccountId: string, + payload: Heroku.EnterpriseAccountMonthlyUsageInfoPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountId}/usage/monthly`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/enterprise-account-service.ts b/src/services/enterprise-account-service.ts new file mode 100644 index 0000000..91cad6a --- /dev/null +++ b/src/services/enterprise-account-service.ts @@ -0,0 +1,83 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Enterprise Account](https://devcenter.heroku.com/articles/platform-api-reference#enterprise-account) + * Enterprise accounts allow companies to manage their development teams and billing. + */ +export default class EnterpriseAccountService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List enterprise accounts in which you are a member. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Information about an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + public async info( + enterpriseAccountIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update enterprise account properties + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + enterpriseAccountIdentity: string, + payload: Heroku.EnterpriseAccountUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/filter-apps-service.ts b/src/services/filter-apps-service.ts new file mode 100644 index 0000000..9fa6b68 --- /dev/null +++ b/src/services/filter-apps-service.ts @@ -0,0 +1,37 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Filters](https://devcenter.heroku.com/articles/platform-api-reference#filter-apps) + * Filters are special endpoints to allow for API consumers to specify a subset of resources to consume in order to reduce the number of requests that are performed. Each filter endpoint endpoint is responsible for determining its supported request format. The endpoints are over POST in order to handle large request bodies without hitting request uri query length limitations, but the requests themselves are idempotent and will not have side effects. + */ +export default class FilterAppsService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Request an apps list filtered by app id. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async apps( + payload: Heroku.Filter, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/filters/apps`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/formation-service.ts b/src/services/formation-service.ts new file mode 100644 index 0000000..dfb6eb5 --- /dev/null +++ b/src/services/formation-service.ts @@ -0,0 +1,118 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Formation](https://devcenter.heroku.com/articles/platform-api-reference#formation) + * The formation of processes that should be maintained for an app. Update the formation to scale processes or change dyno sizes. Available process type names and commands are defined by the `process_types` attribute for the [slug](#slug) currently released on an app. + */ +export default class FormationService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for a process type + * + * @param appIdentity unique identifier of app or unique name of app. + * @param formationIdentity unique identifier of this process type or type of process to maintain. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + formationIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formation/${formationIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List process type formation + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async list( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formation`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Batch update process types + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async batchUpdate( + appIdentity: string, + payload: Heroku.FormationBatchUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formation`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update process type + * + * @param appIdentity unique identifier of app or unique name of app. + * @param formationIdentity unique identifier of this process type or type of process to maintain. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + appIdentity: string, + formationIdentity: string, + payload: Heroku.FormationUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formation/${formationIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/identity-provider-service.ts b/src/services/identity-provider-service.ts new file mode 100644 index 0000000..df58138 --- /dev/null +++ b/src/services/identity-provider-service.ts @@ -0,0 +1,131 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Identity Provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) + * Identity Providers represent the SAML configuration of teams or an Enterprise account + */ +export default class IdentityProviderService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Get a list of a team's Identity Providers + * + * @param teamName unique name of team + * @example "example". + * @param requestInit The initializer for the request. + */ + public async listByTeam( + teamName: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Create an Identity Provider for a team + * + * @param teamName unique name of team + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async createByTeam( + teamName: string, + payload: Heroku.IdentityProviderCreateByTeamPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update a team's Identity Provider + * + * @param teamName unique name of team + * @example "example". + * @param identityProviderId unique identifier of this identity provider + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async updateByTeam( + teamName: string, + identityProviderId: string, + payload: Heroku.IdentityProviderUpdateByTeamPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/teams/${teamName}/identity-providers/${identityProviderId}`, + { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete a team's Identity Provider + * + * @param teamName unique name of team + * @example "example". + * @param identityProviderId unique identifier of this identity provider + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + public async deleteByTeam( + teamName: string, + identityProviderId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/teams/${teamName}/identity-providers/${identityProviderId}`, + { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/inbound-ruleset-service.ts b/src/services/inbound-ruleset-service.ts new file mode 100644 index 0000000..d3a6f7f --- /dev/null +++ b/src/services/inbound-ruleset-service.ts @@ -0,0 +1,116 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Inbound Ruleset](https://devcenter.heroku.com/articles/platform-api-reference#inbound-ruleset) + * An inbound-ruleset is a collection of rules that specify what hosts can or cannot connect to an application. + */ +export default class InboundRulesetService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Current inbound ruleset for a space + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + public async current( + spaceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/inbound-ruleset`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info on an existing Inbound Ruleset + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param inboundRulesetIdentity unique identifier of an inbound-ruleset. + * @param requestInit The initializer for the request. + */ + public async info( + spaceIdentity: string, + inboundRulesetIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/spaces/${spaceIdentity}/inbound-rulesets/${inboundRulesetIdentity}`, + { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List all inbound rulesets for a space + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + public async list( + spaceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/inbound-rulesets`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Create a new inbound ruleset + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + spaceIdentity: string, + payload: Heroku.InboundRulesetCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/inbound-ruleset`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/index.ts b/src/services/index.ts new file mode 100644 index 0000000..7fce78f --- /dev/null +++ b/src/services/index.ts @@ -0,0 +1,96 @@ +export * from './account-delinquency-service'; +export * from './account-feature-service'; +export * from './account-service'; +export * from './add-on-action-service'; +export * from './add-on-attachment-service'; +export * from './add-on-config-service'; +export * from './add-on-region-capability-service'; +export * from './add-on-service-service'; +export * from './add-on-webhook-delivery-service'; +export * from './add-on-webhook-event-service'; +export * from './add-on-webhook-service'; +export * from './add-on-service'; +export * from './allowed-add-on-service-service'; +export * from './app-feature-service'; +export * from './app-setup-service'; +export * from './app-transfer-service'; +export * from './app-webhook-delivery-service'; +export * from './app-webhook-event-service'; +export * from './app-webhook-service'; +export * from './app-service'; +export * from './archive-service'; +export * from './audit-trail-event-service'; +export * from './build-service'; +export * from './buildpack-installation-service'; +export * from './collaborator-service'; +export * from './config-var-service'; +export * from './credit-service'; +export * from './domain-service'; +export * from './dyno-size-service'; +export * from './dyno-service'; +export * from './enterprise-account-daily-usage-service'; +export * from './enterprise-account-member-service'; +export * from './enterprise-account-monthly-usage-service'; +export * from './enterprise-account-service'; +export * from './filter-apps-service'; +export * from './formation-service'; +export * from './identity-provider-service'; +export * from './inbound-ruleset-service'; +export * from './invoice-address-service'; +export * from './invoice-service'; +export * from './key-service'; +export * from './log-drain-service'; +export * from './log-session-service'; +export * from './oauth-authorization-service'; +export * from './oauth-client-service'; +export * from './oauth-grant-service'; +export * from './oauth-token-service'; +export * from './password-reset-service'; +export * from './peering-info-service'; +export * from './peering-service'; +export * from './permission-entity-service'; +export * from './pipeline-build-service'; +export * from './pipeline-config-var-service'; +export * from './pipeline-coupling-service'; +export * from './pipeline-deployment-service'; +export * from './pipeline-promotion-target-service'; +export * from './pipeline-promotion-service'; +export * from './pipeline-release-service'; +export * from './pipeline-stack-service'; +export * from './pipeline-transfer-service'; +export * from './pipeline-service'; +export * from './plan-service'; +export * from './rate-limit-service'; +export * from './region-service'; +export * from './release-service'; +export * from './review-app-service'; +export * from './review-app-config-service'; +export * from './slug-service'; +export * from './sms-number-service'; +export * from './sni-endpoint-service'; +export * from './source-service'; +export * from './space-app-access-service'; +export * from './space-nat-service'; +export * from './space-topology-service'; +export * from './space-transfer-service'; +export * from './space-service'; +export * from './stack-service'; +export * from './team-add-on-service'; +export * from './team-app-collaborator-service'; +export * from './team-app-permission-service'; +export * from './team-app-service'; +export * from './team-daily-usage-service'; +export * from './team-delinquency-service'; +export * from './team-feature-service'; +export * from './team-invitation-service'; +export * from './team-invoice-service'; +export * from './team-member-service'; +export * from './team-monthly-usage-service'; +export * from './team-preferences-service'; +export * from './team-space-service'; +export * from './team-service'; +export * from './test-case-service'; +export * from './test-node-service'; +export * from './test-run-service'; +export * from './user-preferences-service'; +export * from './vpn-connection-service'; diff --git a/src/services/invoice-address-service.ts b/src/services/invoice-address-service.ts new file mode 100644 index 0000000..5f673f2 --- /dev/null +++ b/src/services/invoice-address-service.ts @@ -0,0 +1,57 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Vault API - Invoice Address](https://devcenter.heroku.com/articles/platform-api-reference#invoice-address) + * An invoice address represents the address that should be listed on an invoice. + */ +export default class InvoiceAddressService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Retrieve existing invoice address. + * + * @param requestInit The initializer for the request. + */ + public async info(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/invoice-address`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update invoice address for an account. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + payload: Heroku.InvoiceAddressUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/invoice-address`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/invoice-service.ts b/src/services/invoice-service.ts new file mode 100644 index 0000000..92e50e5 --- /dev/null +++ b/src/services/invoice-service.ts @@ -0,0 +1,56 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Invoice](https://devcenter.heroku.com/articles/platform-api-reference#invoice) + * An invoice is an itemized bill of goods for an account which includes pricing and charges. + */ +export default class InvoiceService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for existing invoice. + * + * @param invoiceIdentity human readable invoice number. + * @param requestInit The initializer for the request. + */ + public async info( + invoiceIdentity: number, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/invoices/${invoiceIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing invoices. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/invoices`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/key-service.ts b/src/services/key-service.ts new file mode 100644 index 0000000..0cd30c3 --- /dev/null +++ b/src/services/key-service.ts @@ -0,0 +1,53 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Key](https://devcenter.heroku.com/articles/platform-api-reference#key) + * Keys represent public SSH keys associated with an account and are used to authorize accounts as they are performing git operations. + */ +export default class KeyService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for existing key. + * + * @param keyIdentity unique identifier of this key or a unique identifying string based on contents. + * @param requestInit The initializer for the request. + */ + public async info(keyIdentity: string, requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/keys/${keyIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing keys. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/keys`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/log-drain-service.ts b/src/services/log-drain-service.ts new file mode 100644 index 0000000..c004558 --- /dev/null +++ b/src/services/log-drain-service.ts @@ -0,0 +1,172 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Log Drain](https://devcenter.heroku.com/articles/platform-api-reference#log-drain) + * [Log drains](https://devcenter.heroku.com/articles/log-drains) provide a way to forward your Heroku logs to an external syslog server for long-term archiving. This external service must be configured to receive syslog packets from Heroku, whereupon its URL can be added to an app using this API. Some add-ons will add a log drain when they are provisioned to an app. These drains can only be removed by removing the add-on. + */ +export default class LogDrainService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new log drain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + appIdentity: string, + payload: Heroku.LogDrainCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/log-drains`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update an add-on owned log drain. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param logDrainQueryIdentity unique identifier of this log drain or url associated with the log drain or token associated with the log drain. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + addOnIdentity: string, + logDrainQueryIdentity: string, + payload: Heroku.LogDrainUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/addons/${addOnIdentity}/log-drains/${logDrainQueryIdentity}`, + { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete an existing log drain. Log drains added by add-ons can only be removed by removing the add-on. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param logDrainQueryIdentity unique identifier of this log drain or url associated with the log drain or token associated with the log drain. + * @param requestInit The initializer for the request. + */ + public async delete( + appIdentity: string, + logDrainQueryIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/log-drains/${logDrainQueryIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for existing log drain. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param logDrainQueryIdentity unique identifier of this log drain or url associated with the log drain or token associated with the log drain. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + logDrainQueryIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/log-drains/${logDrainQueryIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing log drains for an add-on. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + public async listByAddOn( + addOnIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/log-drains`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing log drains. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async list( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/log-drains`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/log-session-service.ts b/src/services/log-session-service.ts new file mode 100644 index 0000000..0bd1946 --- /dev/null +++ b/src/services/log-session-service.ts @@ -0,0 +1,39 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Log Session](https://devcenter.heroku.com/articles/platform-api-reference#log-session) + * A log session is a reference to the http based log stream for an app. + */ +export default class LogSessionService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new log session. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + appIdentity: string, + payload: Heroku.LogSessionCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/log-sessions`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/oauth-authorization-service.ts b/src/services/oauth-authorization-service.ts new file mode 100644 index 0000000..b6d02e6 --- /dev/null +++ b/src/services/oauth-authorization-service.ts @@ -0,0 +1,134 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - OAuth Authorization](https://devcenter.heroku.com/articles/platform-api-reference#oauth-authorization) + * OAuth authorizations represent clients that a Heroku user has authorized to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export default class OauthAuthorizationService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new OAuth authorization. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.OauthAuthorizationCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete OAuth authorization. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param requestInit The initializer for the request. + */ + public async delete( + oauthAuthorizationIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations/${oauthAuthorizationIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for an OAuth authorization. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param requestInit The initializer for the request. + */ + public async info( + oauthAuthorizationIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations/${oauthAuthorizationIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List OAuth authorizations. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Regenerate OAuth tokens. This endpoint is only available to direct authorizations or privileged OAuth clients. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param requestInit The initializer for the request. + */ + public async regenerate( + oauthAuthorizationIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/oauth/authorizations/${oauthAuthorizationIdentity}/actions/regenerate-tokens`, + { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/oauth-client-service.ts b/src/services/oauth-client-service.ts new file mode 100644 index 0000000..99887b1 --- /dev/null +++ b/src/services/oauth-client-service.ts @@ -0,0 +1,157 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - OAuth Client](https://devcenter.heroku.com/articles/platform-api-reference#oauth-client) + * OAuth clients are applications that Heroku users can authorize to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth). + */ +export default class OauthClientService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new OAuth client. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.OauthClientCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/oauth/clients`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete OAuth client. + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param requestInit The initializer for the request. + */ + public async delete( + oauthClientIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/oauth/clients/${oauthClientIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for an OAuth client. The output for unauthenticated requests excludes the `secret` parameter. + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param requestInit The initializer for the request. + */ + public async info( + oauthClientIdentity: string, + requestInit: Omit = {} + ): Promise { + await this.fetchImpl(`/oauth/clients/${oauthClientIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } + /** + * List OAuth clients + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/oauth/clients`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update OAuth client + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + oauthClientIdentity: string, + payload: Heroku.OauthClientUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/oauth/clients/${oauthClientIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Rotate credentials for an OAuth client + * + * @param oauthClientIdentity unique identifier of this OAuth client. + * @param requestInit The initializer for the request. + */ + public async rotateCredentials( + oauthClientIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/oauth/clients/${oauthClientIdentity}/actions/rotate-credentials`, + { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/oauth-grant-service.ts b/src/services/oauth-grant-service.ts new file mode 100644 index 0000000..fccb19f --- /dev/null +++ b/src/services/oauth-grant-service.ts @@ -0,0 +1,10 @@ +/** + * [Heroku Platform API - OAuth Grant](https://devcenter.heroku.com/articles/platform-api-reference#oauth-grant) + * OAuth grants are used to obtain authorizations on behalf of a user. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export default class OauthGrantService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} +} diff --git a/src/services/oauth-token-service.ts b/src/services/oauth-token-service.ts new file mode 100644 index 0000000..23b9845 --- /dev/null +++ b/src/services/oauth-token-service.ts @@ -0,0 +1,62 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - OAuth Token](https://devcenter.heroku.com/articles/platform-api-reference#oauth-token) + * OAuth tokens provide access for authorized clients to act on behalf of a Heroku user to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth) + */ +export default class OauthTokenService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new OAuth token. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.OauthTokenCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/oauth/tokens`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Revoke OAuth access token. + * + * @param oauthTokenIdentity unique identifier of OAuth token. + * @param requestInit The initializer for the request. + */ + public async delete( + oauthTokenIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/oauth/tokens/${oauthTokenIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/password-reset-service.ts b/src/services/password-reset-service.ts new file mode 100644 index 0000000..95abbe0 --- /dev/null +++ b/src/services/password-reset-service.ts @@ -0,0 +1,68 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - PasswordReset](https://devcenter.heroku.com/articles/platform-api-reference#password-reset) + * A password reset represents a in-process password reset attempt. + */ +export default class PasswordResetService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Reset account's password. This will send a reset password link to the user's email address. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async resetPassword( + payload: Heroku.PasswordResetResetPasswordPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/password-resets`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Complete password reset. + * + * @param passwordResetResetPasswordToken unique identifier of a password reset attempt + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async completeResetPassword( + passwordResetResetPasswordToken: string, + payload: Heroku.PasswordResetCompleteResetPasswordPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/password-resets/${passwordResetResetPasswordToken}/actions/finalize`, + { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/peering-info-service.ts b/src/services/peering-info-service.ts new file mode 100644 index 0000000..7106973 --- /dev/null +++ b/src/services/peering-info-service.ts @@ -0,0 +1,36 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Peering Info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) + * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. + */ +export default class PeeringInfoService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Provides the necessary information to establish an AWS VPC Peering with your private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + public async info( + spaceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peering-info`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/peering-service.ts b/src/services/peering-service.ts new file mode 100644 index 0000000..b8dfd7f --- /dev/null +++ b/src/services/peering-service.ts @@ -0,0 +1,122 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) + * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + */ +export default class PeeringService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List peering connections of a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + public async list( + spaceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Accept a pending peering connection with a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. + * @example "pcx-123456789012". + * @param requestInit The initializer for the request. + */ + public async accept( + spaceIdentity: string, + peeringPcxId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}/actions/accept`, + { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Destroy an active peering connection with a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. + * @example "pcx-123456789012". + * @param requestInit The initializer for the request. + */ + public async destroy( + spaceIdentity: string, + peeringPcxId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Fetch information for existing peering connection + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. + * @example "pcx-123456789012". + * @param requestInit The initializer for the request. + */ + public async info( + spaceIdentity: string, + peeringPcxId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/permission-entity-service.ts b/src/services/permission-entity-service.ts new file mode 100644 index 0000000..437115d --- /dev/null +++ b/src/services/permission-entity-service.ts @@ -0,0 +1,36 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Permission Entity](https://devcenter.heroku.com/articles/platform-api-reference#permission-entity) + * An owned entity including users' permissions. + */ +export default class PermissionEntityService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List permission entities for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async list( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/permissions`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/pipeline-build-service.ts b/src/services/pipeline-build-service.ts new file mode 100644 index 0000000..7f7ab8f --- /dev/null +++ b/src/services/pipeline-build-service.ts @@ -0,0 +1,37 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Build](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-build) + * Information about latest builds of apps in a pipeline. + */ +export default class PipelineBuildService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List latest builds for each app in a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + public async list( + pipelineId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/latest-builds`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/pipeline-config-var-service.ts b/src/services/pipeline-config-var-service.ts new file mode 100644 index 0000000..59521ae --- /dev/null +++ b/src/services/pipeline-config-var-service.ts @@ -0,0 +1,76 @@ +/** + * [Heroku Platform API - Pipeline Config Vars](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-config-var) + * Pipeline Config Vars allow you to manage the configuration information provided to a pipeline. + */ +export default class PipelineConfigVarService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Get config-vars for a pipeline stage. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param pipelineCouplingStage target pipeline stage + * @example "production". + * @param requestInit The initializer for the request. + */ + public async infoForApp( + pipelineId: string, + pipelineCouplingStage: 'test' | 'review' | 'development' | 'staging' | 'production', + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl( + `${this.endpoint}/pipelines/${pipelineId}/stage/${pipelineCouplingStage}/config-vars`, + { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise>; + } + throw new Error(response.statusText); + } + /** + * Update config-vars for a pipeline stage. You can update existing config-vars by setting them again, and remove by setting it to `null`. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param pipelineCouplingStage target pipeline stage + * @example "production". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + pipelineId: string, + pipelineCouplingStage: 'test' | 'review' | 'development' | 'staging' | 'production', + payload: Record, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl( + `${this.endpoint}/pipelines/${pipelineId}/stage/${pipelineCouplingStage}/config-vars`, + { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise>; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/pipeline-coupling-service.ts b/src/services/pipeline-coupling-service.ts new file mode 100644 index 0000000..a122bb5 --- /dev/null +++ b/src/services/pipeline-coupling-service.ts @@ -0,0 +1,228 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Coupling](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-coupling) + * Information about an app's coupling to a pipeline + */ +export default class PipelineCouplingService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List couplings for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + public async listByPipeline( + pipelineId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/pipeline-couplings`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List pipeline couplings for the current user. + * + * @param requestInit The initializer for the request. + */ + public async listByCurrentUser( + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/users/~/pipeline-couplings`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List pipeline couplings. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-couplings`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List pipeline couplings for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async listByTeam( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/pipeline-couplings`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Create a new pipeline coupling. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.PipelineCouplingCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-couplings`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for an existing pipeline coupling. + * + * @param pipelineCouplingIdentity unique identifier of pipeline coupling. + * @param requestInit The initializer for the request. + */ + public async info( + pipelineCouplingIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-couplings/${pipelineCouplingIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete an existing pipeline coupling. + * + * @param pipelineCouplingIdentity unique identifier of pipeline coupling. + * @param requestInit The initializer for the request. + */ + public async delete( + pipelineCouplingIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-couplings/${pipelineCouplingIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update an existing pipeline coupling. + * + * @param pipelineCouplingIdentity unique identifier of pipeline coupling. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + pipelineCouplingIdentity: string, + payload: Heroku.PipelineCouplingUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-couplings/${pipelineCouplingIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for an existing pipeline coupling. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async infoByApp( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/pipeline-couplings`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/pipeline-deployment-service.ts b/src/services/pipeline-deployment-service.ts new file mode 100644 index 0000000..96a0ee9 --- /dev/null +++ b/src/services/pipeline-deployment-service.ts @@ -0,0 +1,37 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Deployment](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-deployment) + * Information about latest deployments of apps in a pipeline. + */ +export default class PipelineDeploymentService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List latest slug releases for each app in a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + public async list( + pipelineId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/latest-deployments`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/pipeline-promotion-service.ts b/src/services/pipeline-promotion-service.ts new file mode 100644 index 0000000..5fc7d43 --- /dev/null +++ b/src/services/pipeline-promotion-service.ts @@ -0,0 +1,61 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Promotion](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion) + * Promotions allow you to move code from an app in a pipeline to all targets + */ +export default class PipelinePromotionService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new promotion. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.PipelinePromotionCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-promotions`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for existing pipeline promotion. + * + * @param pipelinePromotionIdentity unique identifier of promotion. + * @param requestInit The initializer for the request. + */ + public async info( + pipelinePromotionIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-promotions/${pipelinePromotionIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/pipeline-promotion-target-service.ts b/src/services/pipeline-promotion-target-service.ts new file mode 100644 index 0000000..962f463 --- /dev/null +++ b/src/services/pipeline-promotion-target-service.ts @@ -0,0 +1,40 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Promotion Target](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion-target) + * Promotion targets represent an individual app being promoted to + */ +export default class PipelinePromotionTargetService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List promotion targets belonging to an existing promotion. + * + * @param pipelinePromotionId unique identifier of promotion + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + public async list( + pipelinePromotionId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/pipeline-promotions/${pipelinePromotionId}/promotion-targets`, + { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/pipeline-release-service.ts b/src/services/pipeline-release-service.ts new file mode 100644 index 0000000..ce1081c --- /dev/null +++ b/src/services/pipeline-release-service.ts @@ -0,0 +1,37 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Release](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-release) + * Information about latest releases of apps in a pipeline. + */ +export default class PipelineReleaseService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List latest releases for each app in a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + public async list( + pipelineId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/latest-releases`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/pipeline-service.ts b/src/services/pipeline-service.ts new file mode 100644 index 0000000..209f1e9 --- /dev/null +++ b/src/services/pipeline-service.ts @@ -0,0 +1,135 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * A pipeline allows grouping of apps into different stages. + */ +export default class PipelineService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new pipeline. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.PipelineCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipelines`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for existing pipeline. + * + * @param pipelineIdentity unique identifier of pipeline or name of pipeline. + * @param requestInit The initializer for the request. + */ + public async info( + pipelineIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete an existing pipeline. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + public async delete( + pipelineId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update an existing pipeline. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + pipelineId: string, + payload: Heroku.PipelineUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing pipelines. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipelines`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/pipeline-stack-service.ts b/src/services/pipeline-stack-service.ts new file mode 100644 index 0000000..2a36da4 --- /dev/null +++ b/src/services/pipeline-stack-service.ts @@ -0,0 +1,37 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Stack](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-stack) + * A pipeline's stack is determined by the apps in the pipeline. This is used during creation of CI and Review Apps that have no stack defined in app.json + */ +export default class PipelineStackService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * The stack for a given pipeline, used for CI and Review Apps that have no stack defined in app.json. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + public async defaultStack( + pipelineId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/pipeline-stack`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/pipeline-transfer-service.ts b/src/services/pipeline-transfer-service.ts new file mode 100644 index 0000000..b11f303 --- /dev/null +++ b/src/services/pipeline-transfer-service.ts @@ -0,0 +1,37 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Transfer](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-transfer) + * A pipeline transfer is the process of changing pipeline ownership along with the contained apps. + */ +export default class PipelineTransferService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new pipeline transfer. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.PipelineTransferCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipeline-transfers`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/plan-service.ts b/src/services/plan-service.ts new file mode 100644 index 0000000..c50549e --- /dev/null +++ b/src/services/plan-service.ts @@ -0,0 +1,89 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Plan](https://devcenter.heroku.com/articles/platform-api-reference#plan) + * Plans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication. + */ +export default class PlanService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for existing plan. + * + * @param planIdentity unique identifier of this plan or unique name of this plan. + * @param requestInit The initializer for the request. + */ + public async info( + planIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/plans/${planIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for existing plan by Add-on. + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param planIdentity unique identifier of this plan or unique name of this plan. + * @param requestInit The initializer for the request. + */ + public async infoByAddOn( + addOnServiceIdentity: string, + planIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/addon-services/${addOnServiceIdentity}/plans/${planIdentity}`, + { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing plans by Add-on. + * + * @param addOnServiceIdentity unique identifier of this add-on-service or unique name of this add-on-service. + * @param requestInit The initializer for the request. + */ + public async listByAddOn( + addOnServiceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addon-services/${addOnServiceIdentity}/plans`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/rate-limit-service.ts b/src/services/rate-limit-service.ts new file mode 100644 index 0000000..7a703db --- /dev/null +++ b/src/services/rate-limit-service.ts @@ -0,0 +1,32 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Rate Limit](https://devcenter.heroku.com/articles/platform-api-reference#rate-limit) + * Rate Limit represents the number of request tokens each account holds. Requests to this endpoint do not count towards the rate limit. + */ +export default class RateLimitService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for rate limits. + * + * @param requestInit The initializer for the request. + */ + public async info(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/rate-limits`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/region-service.ts b/src/services/region-service.ts new file mode 100644 index 0000000..4965c7a --- /dev/null +++ b/src/services/region-service.ts @@ -0,0 +1,56 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Region](https://devcenter.heroku.com/articles/platform-api-reference#region) + * A region represents a geographic location in which your application may run. + */ +export default class RegionService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for existing region. + * + * @param regionIdentity unique identifier of region or unique name of region. + * @param requestInit The initializer for the request. + */ + public async info( + regionIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/regions/${regionIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing regions. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/regions`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/release-service.ts b/src/services/release-service.ts new file mode 100644 index 0000000..9949d52 --- /dev/null +++ b/src/services/release-service.ts @@ -0,0 +1,116 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * A release represents a combination of code, config vars and add-ons for an app on Heroku. + */ +export default class ReleaseService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for existing release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param releaseIdentity unique identifier of release or unique version assigned to the release. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + releaseIdentity: string | number, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/releases/${releaseIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing releases. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async list( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/releases`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Create new release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + appIdentity: string, + payload: Heroku.ReleaseCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/releases`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Rollback to an existing release. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async rollback( + appIdentity: string, + payload: Heroku.ReleaseRollbackPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/releases`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/review-app-config-service.ts b/src/services/review-app-config-service.ts new file mode 100644 index 0000000..51ca3d8 --- /dev/null +++ b/src/services/review-app-config-service.ts @@ -0,0 +1,119 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Review App Configuration](https://devcenter.heroku.com/articles/platform-api-reference#review-app-config) + * Review apps can be configured for pipelines. + */ +export default class ReviewAppConfigService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Enable review apps for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async enable( + pipelineId: string, + payload: Heroku.ReviewAppConfigEnablePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/review-app-config`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Get review apps configuration for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + public async info( + pipelineId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/review-app-config`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update review app configuration for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + pipelineId: string, + payload: Heroku.ReviewAppConfigUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/review-app-config`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Disable review apps for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + public async delete( + pipelineId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/review-app-config`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/review-app-service.ts b/src/services/review-app-service.ts new file mode 100644 index 0000000..d96d8a9 --- /dev/null +++ b/src/services/review-app-service.ts @@ -0,0 +1,135 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Review App](https://devcenter.heroku.com/articles/platform-api-reference#review-app) + * An ephemeral app to review a set of changes + */ +export default class ReviewAppService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new review app + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.ReviewAppCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/review-apps`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Gets an existing review app + * + * @param reviewAppId unique identifier of the review app. + * @param requestInit The initializer for the request. + */ + public async getReviewApp( + reviewAppId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/review-apps/${reviewAppId}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete an existing review app + * + * @param reviewAppId unique identifier of the review app. + * @param requestInit The initializer for the request. + */ + public async delete( + reviewAppId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/review-apps/${reviewAppId}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Get a review app using the associated app_id + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async getReviewAppByAppId( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/review-app`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List review apps for a pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + public async list( + pipelineId: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/review-apps`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/slug-service.ts b/src/services/slug-service.ts new file mode 100644 index 0000000..31d4050 --- /dev/null +++ b/src/services/slug-service.ts @@ -0,0 +1,65 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Slug](https://devcenter.heroku.com/articles/platform-api-reference#slug) + * A slug is a snapshot of your application code that is ready to run on the platform. + */ +export default class SlugService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for existing slug. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param slugIdentity unique identifier of slug. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + slugIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/slugs/${slugIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Create a new slug. For more information please refer to [Deploying Slugs using the Platform API](https://devcenter.heroku.com/articles/platform-api-deploying-slugs). + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + appIdentity: string, + payload: Heroku.SlugCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/slugs`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/sms-number-service.ts b/src/services/sms-number-service.ts new file mode 100644 index 0000000..ff5dc2e --- /dev/null +++ b/src/services/sms-number-service.ts @@ -0,0 +1,86 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - SMS Number](https://devcenter.heroku.com/articles/platform-api-reference#sms-number) + * SMS numbers are used for recovery on accounts with two-factor authentication enabled. + */ +export default class SmsNumberService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Recover an account using an SMS recovery code + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + public async smsNumber( + accountIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}/sms-number`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Recover an account using an SMS recovery code + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + public async recover( + accountIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}/sms-number/actions/recover`, { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Confirm an SMS number change with a confirmation code + * + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + public async confirm( + accountIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/users/${accountIdentity}/sms-number/actions/confirm`, { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/sni-endpoint-service.ts b/src/services/sni-endpoint-service.ts new file mode 100644 index 0000000..bbc571b --- /dev/null +++ b/src/services/sni-endpoint-service.ts @@ -0,0 +1,145 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - SNI Endpoint](https://devcenter.heroku.com/articles/platform-api-reference#sni-endpoint) + * SNI Endpoint is a public address serving a custom SSL cert for HTTPS traffic, using the SNI TLS extension, to a Heroku app. + */ +export default class SniEndpointService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + appIdentity: string, + payload: Heroku.SniEndpointCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sni-endpoints`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete existing SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param sniEndpointIdentity unique identifier of this SNI endpoint or unique name for SNI endpoint. + * @param requestInit The initializer for the request. + */ + public async delete( + appIdentity: string, + sniEndpointIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sni-endpoints/${sniEndpointIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for existing SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param sniEndpointIdentity unique identifier of this SNI endpoint or unique name for SNI endpoint. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + sniEndpointIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sni-endpoints/${sniEndpointIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing SNI endpoints. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async list( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sni-endpoints`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update an existing SNI endpoint. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param sniEndpointIdentity unique identifier of this SNI endpoint or unique name for SNI endpoint. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + appIdentity: string, + sniEndpointIdentity: string, + payload: Heroku.SniEndpointUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sni-endpoints/${sniEndpointIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/source-service.ts b/src/services/source-service.ts new file mode 100644 index 0000000..409d7a7 --- /dev/null +++ b/src/services/source-service.ts @@ -0,0 +1,58 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Source](https://devcenter.heroku.com/articles/platform-api-reference#source) + * A source is a location for uploading and downloading an application's source code. + */ +export default class SourceService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create URLs for uploading and downloading source. + * + * @param requestInit The initializer for the request. + */ + public async create(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/sources`, { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Create URLs for uploading and downloading source. Deprecated in favor of `POST /sources` + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async createDeprecated( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/sources`, { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/space-app-access-service.ts b/src/services/space-app-access-service.ts new file mode 100644 index 0000000..519bd7d --- /dev/null +++ b/src/services/space-app-access-service.ts @@ -0,0 +1,91 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Access](https://devcenter.heroku.com/articles/platform-api-reference#space-app-access) + * Space access represents the permissions a particular user has on a particular space. + */ +export default class SpaceAppAccessService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List permissions for a given user on a given space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + public async info( + spaceIdentity: string, + accountIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/members/${accountIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update an existing user's set of permissions on a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param accountIdentity unique email address of account or unique identifier of an account or Implicit reference to currently authorized user. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + spaceIdentity: string, + accountIdentity: string, + payload: Heroku.SpaceAppAccessUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/members/${accountIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List all users and their permissions on a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + public async list( + spaceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/members`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/space-nat-service.ts b/src/services/space-nat-service.ts new file mode 100644 index 0000000..e63d52f --- /dev/null +++ b/src/services/space-nat-service.ts @@ -0,0 +1,36 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Network Address Translation](https://devcenter.heroku.com/articles/platform-api-reference#space-nat) + * Network address translation (NAT) for stable outbound IP addresses from a space + */ +export default class SpaceNatService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Current state of network address translation for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + public async info( + spaceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/nat`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/space-service.ts b/src/services/space-service.ts new file mode 100644 index 0000000..6cfb66c --- /dev/null +++ b/src/services/space-service.ts @@ -0,0 +1,133 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space](https://devcenter.heroku.com/articles/platform-api-reference#space) + * A space is an isolated, highly available, secure app execution environment. + */ +export default class SpaceService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List existing spaces. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for existing space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + public async info( + spaceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update an existing space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + spaceIdentity: string, + payload: Heroku.SpaceUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete an existing space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + public async delete( + spaceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Create a new space. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.SpaceCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/space-topology-service.ts b/src/services/space-topology-service.ts new file mode 100644 index 0000000..1e2581c --- /dev/null +++ b/src/services/space-topology-service.ts @@ -0,0 +1,36 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Topology](https://devcenter.heroku.com/articles/platform-api-reference#space-topology) + * Space Topology provides you with a mechanism for viewing all the running dynos, formations and applications for a space. This is the same data thats used to power our DNS Service Discovery. + */ +export default class SpaceTopologyService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Current space topology + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + public async topology( + spaceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/topology`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/space-transfer-service.ts b/src/services/space-transfer-service.ts new file mode 100644 index 0000000..1fbab8f --- /dev/null +++ b/src/services/space-transfer-service.ts @@ -0,0 +1,39 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Transfer](https://devcenter.heroku.com/articles/platform-api-reference#space-transfer) + * Transfer spaces between enterprise teams with the same Enterprise Account. + */ +export default class SpaceTransferService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Transfer space between enterprise teams + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async transfer( + spaceIdentity: string, + payload: Heroku.SpaceTransferTransferPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/transfer`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/stack-service.ts b/src/services/stack-service.ts new file mode 100644 index 0000000..4211e3b --- /dev/null +++ b/src/services/stack-service.ts @@ -0,0 +1,56 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Stack](https://devcenter.heroku.com/articles/platform-api-reference#stack) + * Stacks are the different application execution environments available in the Heroku platform. + */ +export default class StackService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Stack info. + * + * @param stackIdentity unique name of stack or unique identifier of stack. + * @param requestInit The initializer for the request. + */ + public async info( + stackIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/stacks/${stackIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List available stacks. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/stacks`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/team-add-on-service.ts b/src/services/team-add-on-service.ts new file mode 100644 index 0000000..eba5bd4 --- /dev/null +++ b/src/services/team-add-on-service.ts @@ -0,0 +1,36 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Add-on](https://devcenter.heroku.com/articles/platform-api-reference#team-add-on) + * + */ +export default class TeamAddOnService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List add-ons used across all Team apps + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async listForTeam( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/addons`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/team-app-collaborator-service.ts b/src/services/team-app-collaborator-service.ts new file mode 100644 index 0000000..e86ab86 --- /dev/null +++ b/src/services/team-app-collaborator-service.ts @@ -0,0 +1,158 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team App Collaborator](https://devcenter.heroku.com/articles/platform-api-reference#team-app-collaborator) + * A team collaborator represents an account that has been given access to a team app on Heroku. + */ +export default class TeamAppCollaboratorService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new collaborator on a team app. Use this endpoint instead of the `/apps/{app_id_or_name}/collaborator` endpoint when you want the collaborator to be granted [permissions] (https://devcenter.heroku.com/articles/org-users-access#roles-and-permissions) according to their role in the team. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + appIdentity: string, + payload: Heroku.TeamAppCollaboratorCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${appIdentity}/collaborators`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete an existing collaborator from a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param teamAppCollaboratorIdentity invited email address of collaborator. + * @param requestInit The initializer for the request. + */ + public async delete( + teamAppIdentity: string, + teamAppCollaboratorIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/teams/apps/${teamAppIdentity}/collaborators/${teamAppCollaboratorIdentity}`, + { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for a collaborator on a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param teamAppCollaboratorIdentity invited email address of collaborator. + * @param requestInit The initializer for the request. + */ + public async info( + teamAppIdentity: string, + teamAppCollaboratorIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/teams/apps/${teamAppIdentity}/collaborators/${teamAppCollaboratorIdentity}`, + { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update an existing collaborator from a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param teamAppCollaboratorIdentity invited email address of collaborator. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + teamAppIdentity: string, + teamAppCollaboratorIdentity: string, + payload: Heroku.TeamAppCollaboratorUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/teams/apps/${teamAppIdentity}/collaborators/${teamAppCollaboratorIdentity}`, + { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List collaborators on a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param requestInit The initializer for the request. + */ + public async list( + teamAppIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}/collaborators`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/team-app-permission-service.ts b/src/services/team-app-permission-service.ts new file mode 100644 index 0000000..d29e5da --- /dev/null +++ b/src/services/team-app-permission-service.ts @@ -0,0 +1,32 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team App Permission](https://devcenter.heroku.com/articles/platform-api-reference#team-app-permission) + * A team app permission is a behavior that is assigned to a user in a team app. + */ +export default class TeamAppPermissionService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Lists permissions available to teams. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/permissions`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/team-app-service.ts b/src/services/team-app-service.ts new file mode 100644 index 0000000..0436919 --- /dev/null +++ b/src/services/team-app-service.ts @@ -0,0 +1,166 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team App](https://devcenter.heroku.com/articles/platform-api-reference#team-app) + * A team app encapsulates the team specific functionality of Heroku apps. + */ +export default class TeamAppService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new app in the specified team, in the default team if unspecified, or in personal account, if default team is not set. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.TeamAppCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param requestInit The initializer for the request. + */ + public async info( + teamAppIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Lock or unlock a team app. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async updateLocked( + teamAppIdentity: string, + payload: Heroku.TeamAppUpdateLockedPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Transfer an existing team app to another Heroku account. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async transferToAccount( + teamAppIdentity: string, + payload: Heroku.TeamAppTransferToAccountPayload, + requestInit: Omit = {} + ): Promise { + await this.fetchImpl(`/teams/apps/${teamAppIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + } + /** + * Transfer an existing team app to another team. + * + * @param teamAppIdentity unique name of app + * @example "example". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async transferToTeam( + teamAppIdentity: string, + payload: Heroku.TeamAppTransferToTeamPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/apps/${teamAppIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List team apps. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async listByTeam( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/apps`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/team-daily-usage-service.ts b/src/services/team-daily-usage-service.ts new file mode 100644 index 0000000..72c5e41 --- /dev/null +++ b/src/services/team-daily-usage-service.ts @@ -0,0 +1,39 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Daily Usage](https://devcenter.heroku.com/articles/platform-api-reference#team-daily-usage) + * Usage for an enterprise team at a daily resolution. + */ +export default class TeamDailyUsageService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Retrieves usage for an enterprise team for a range of days. Start and end dates can be specified as query parameters using the date format YYYY-MM-DD. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list). + * + * @param teamId unique identifier of team + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async info( + teamId: string, + payload: Heroku.TeamDailyUsageInfoPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamId}/usage/daily`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/team-delinquency-service.ts b/src/services/team-delinquency-service.ts new file mode 100644 index 0000000..9a363e2 --- /dev/null +++ b/src/services/team-delinquency-service.ts @@ -0,0 +1,36 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Delinquency](https://devcenter.heroku.com/articles/platform-api-reference#team-delinquency) + * A Heroku team becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent teams if their invoices remain unpaid. + */ +export default class TeamDelinquencyService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Team delinquency information. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async info( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/delinquency`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/team-feature-service.ts b/src/services/team-feature-service.ts new file mode 100644 index 0000000..d37012d --- /dev/null +++ b/src/services/team-feature-service.ts @@ -0,0 +1,62 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Feature](https://devcenter.heroku.com/articles/platform-api-reference#team-feature) + * A team feature represents a feature enabled on a team account. + */ +export default class TeamFeatureService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for an existing team feature. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamFeatureIdentity unique identifier of team feature or unique name of team feature. + * @param requestInit The initializer for the request. + */ + public async info( + teamIdentity: string, + teamFeatureIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/features/${teamFeatureIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing team features. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async list( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/features`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/team-invitation-service.ts b/src/services/team-invitation-service.ts new file mode 100644 index 0000000..b566325 --- /dev/null +++ b/src/services/team-invitation-service.ts @@ -0,0 +1,145 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Invitation](https://devcenter.heroku.com/articles/platform-api-reference#team-invitation) + * A team invitation represents an invite to a team. + */ +export default class TeamInvitationService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Get a list of a team's Identity Providers + * + * @param teamName unique name of team + * @example "example". + * @param requestInit The initializer for the request. + */ + public async list( + teamName: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/invitations`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Create Team Invitation + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + teamIdentity: string, + payload: Heroku.TeamInvitationCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/invitations`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Revoke a team invitation. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamInvitationIdentity unique identifier of an invitation. + * @param requestInit The initializer for the request. + */ + public async revoke( + teamIdentity: string, + teamInvitationIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/teams/${teamIdentity}/invitations/${teamInvitationIdentity}`, + { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Get an invitation by its token + * + * @param teamInvitationToken special token for invitation + * @example "614ae25aa2d4802096cd7c18625b526c". + * @param requestInit The initializer for the request. + */ + public async get( + teamInvitationToken: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/invitations/${teamInvitationToken}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Accept Team Invitation + * + * @param teamInvitationToken special token for invitation + * @example "614ae25aa2d4802096cd7c18625b526c". + * @param requestInit The initializer for the request. + */ + public async accept( + teamInvitationToken: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/invitations/${teamInvitationToken}/accept`, { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/team-invoice-service.ts b/src/services/team-invoice-service.ts new file mode 100644 index 0000000..145fc03 --- /dev/null +++ b/src/services/team-invoice-service.ts @@ -0,0 +1,62 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Invoice](https://devcenter.heroku.com/articles/platform-api-reference#team-invoice) + * A Team Invoice is an itemized bill of goods for a team which includes pricing and charges. + */ +export default class TeamInvoiceService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for existing invoice. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamInvoiceIdentity human readable invoice number. + * @param requestInit The initializer for the request. + */ + public async info( + teamIdentity: string, + teamInvoiceIdentity: number, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/invoices/${teamInvoiceIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List existing invoices. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async list( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/invoices`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/team-member-service.ts b/src/services/team-member-service.ts new file mode 100644 index 0000000..6297a08 --- /dev/null +++ b/src/services/team-member-service.ts @@ -0,0 +1,170 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Member](https://devcenter.heroku.com/articles/platform-api-reference#team-member) + * A team member is an individual with access to a team. + */ +export default class TeamMemberService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new team member, or update their role. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async createOrUpdate( + teamIdentity: string, + payload: Heroku.TeamMemberCreateOrUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Create a new team member. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + teamIdentity: string, + payload: Heroku.TeamMemberCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update a team member. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + teamIdentity: string, + payload: Heroku.TeamMemberUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Remove a member from the team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamMemberIdentity email address of the team member or unique identifier of the team member. + * @param requestInit The initializer for the request. + */ + public async delete( + teamIdentity: string, + teamMemberIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members/${teamMemberIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List members of the team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async list( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List the apps of a team member. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamMemberIdentity email address of the team member or unique identifier of the team member. + * @param requestInit The initializer for the request. + */ + public async listByMember( + teamIdentity: string, + teamMemberIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/members/${teamMemberIdentity}/apps`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/team-monthly-usage-service.ts b/src/services/team-monthly-usage-service.ts new file mode 100644 index 0000000..c9b9b22 --- /dev/null +++ b/src/services/team-monthly-usage-service.ts @@ -0,0 +1,39 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Monthly Usage](https://devcenter.heroku.com/articles/platform-api-reference#team-monthly-usage) + * Usage for an enterprise team at a monthly resolution. + */ +export default class TeamMonthlyUsageService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Retrieves usage for an enterprise team for a range of months. Start and end dates can be specified as query parameters using the date, YYYY-MM. If no end date is specified, one month of usage is returned. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list). + * + * @param teamId unique identifier of team + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async info( + teamId: string, + payload: Heroku.TeamMonthlyUsageInfoPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamId}/usage/monthly`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/team-preferences-service.ts b/src/services/team-preferences-service.ts new file mode 100644 index 0000000..13731dd --- /dev/null +++ b/src/services/team-preferences-service.ts @@ -0,0 +1,63 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Preferences](https://devcenter.heroku.com/articles/platform-api-reference#team-preferences) + * Tracks a Team's Preferences + */ +export default class TeamPreferencesService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Retrieve Team Preferences + * + * @param teamPreferencesIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async list( + teamPreferencesIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamPreferencesIdentity}/preferences`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update Team Preferences + * + * @param teamPreferencesIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + teamPreferencesIdentity: string, + payload: Heroku.TeamPreferencesUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamPreferencesIdentity}/preferences`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/team-service.ts b/src/services/team-service.ts new file mode 100644 index 0000000..a2d4900 --- /dev/null +++ b/src/services/team-service.ts @@ -0,0 +1,184 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team](https://devcenter.heroku.com/articles/platform-api-reference#team) + * Teams allow you to manage access to a shared group of applications and other resources. + */ +export default class TeamService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List teams in which you are a member. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async info( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update team properties. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + teamIdentity: string, + payload: Heroku.TeamUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Create a new team. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.TeamCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Delete an existing team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async delete( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List teams for an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param requestInit The initializer for the request. + */ + public async listByEnterpriseAccount( + enterpriseAccountIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/teams`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Create a team in an enterprise account. + * + * @param enterpriseAccountIdentity unique identifier of the enterprise account or unique name of the enterprise account. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async createInEnterpriseAccount( + enterpriseAccountIdentity: string, + payload: Heroku.TeamCreateInEnterpriseAccountPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/enterprise-accounts/${enterpriseAccountIdentity}/teams`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/team-space-service.ts b/src/services/team-space-service.ts new file mode 100644 index 0000000..a46e9d8 --- /dev/null +++ b/src/services/team-space-service.ts @@ -0,0 +1,36 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team Space](https://devcenter.heroku.com/articles/platform-api-reference#team-space) + * A space is an isolated, highly available, secure app execution environment. + */ +export default class TeamSpaceService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List spaces owned by the team + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async list( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/spaces`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/test-case-service.ts b/src/services/test-case-service.ts new file mode 100644 index 0000000..0f7609d --- /dev/null +++ b/src/services/test-case-service.ts @@ -0,0 +1,35 @@ +/** + * [Test Case](https://devcenter.heroku.com/articles/platform-api-reference#test-case) + * A single test case belonging to a test run + */ +export default class TestCaseService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List test cases + * + * @param testRunId unique identifier of a test run. + * @param requestInit The initializer for the request. + */ + public async list( + testRunId: string, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl(`${this.endpoint}/test-runs/${testRunId}/test-cases`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise>; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/test-node-service.ts b/src/services/test-node-service.ts new file mode 100644 index 0000000..7545895 --- /dev/null +++ b/src/services/test-node-service.ts @@ -0,0 +1,35 @@ +/** + * [Test Node](https://devcenter.heroku.com/articles/platform-api-reference#test-node) + * A single test node belonging to a test run + */ +export default class TestNodeService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List test nodes + * + * @param testRunIdentity unique identifier of a test run. + * @param requestInit The initializer for the request. + */ + public async list( + testRunIdentity: string, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl(`${this.endpoint}/test-runs/${testRunIdentity}/test-nodes`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise>; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/test-run-service.ts b/src/services/test-run-service.ts new file mode 100644 index 0000000..21a8190 --- /dev/null +++ b/src/services/test-run-service.ts @@ -0,0 +1,121 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Test Run](https://devcenter.heroku.com/articles/platform-api-reference#test-run) + * An execution or trial of one or more tests + */ +export default class TestRunService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new test-run. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.TestRunCreatePayload, + requestInit: Omit = {} + ): Promise { + await this.fetchImpl(`/test-runs`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + } + /** + * Info for existing test-run. + * + * @param testRunId unique identifier of a test run. + * @param requestInit The initializer for the request. + */ + public async info(testRunId: string, requestInit: Omit = {}): Promise { + await this.fetchImpl(`/test-runs/${testRunId}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } + /** + * List existing test-runs for a pipeline. + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param requestInit The initializer for the request. + */ + public async list( + pipelineId: string, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/test-runs`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise>; + } + throw new Error(response.statusText); + } + /** + * Info for existing test-run by Pipeline + * + * @param pipelineId unique identifier of pipeline + * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param testRunNumber the auto incrementing test run number. + * @param requestInit The initializer for the request. + */ + public async infoByPipeline( + pipelineId: string, + testRunNumber: number, + requestInit: Omit = {} + ): Promise { + await this.fetchImpl(`/pipelines/${pipelineId}/test-runs/${testRunNumber}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + } + /** + * Update a test-run's status. + * + * @param testRunNumber the auto incrementing test run number. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + testRunNumber: number, + payload: Heroku.TestRunUpdatePayload, + requestInit: Omit = {} + ): Promise { + await this.fetchImpl(`/test-runs/${testRunNumber}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + } +} diff --git a/src/services/user-preferences-service.ts b/src/services/user-preferences-service.ts new file mode 100644 index 0000000..0f781eb --- /dev/null +++ b/src/services/user-preferences-service.ts @@ -0,0 +1,63 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - User Preferences](https://devcenter.heroku.com/articles/platform-api-reference#user-preferences) + * Tracks a user's preferences and message dismissals + */ +export default class UserPreferencesService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Retrieve User Preferences + * + * @param userPreferencesIdentity Implicit reference to currently authorized user. + * @param requestInit The initializer for the request. + */ + public async list( + userPreferencesIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/users/${userPreferencesIdentity}/preferences`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update User Preferences + * + * @param userPreferencesIdentity Implicit reference to currently authorized user. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + userPreferencesIdentity: string, + payload: Heroku.UserPreferencesUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/users/${userPreferencesIdentity}/preferences`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/src/services/vpn-connection-service.ts b/src/services/vpn-connection-service.ts new file mode 100644 index 0000000..e6e1960 --- /dev/null +++ b/src/services/vpn-connection-service.ts @@ -0,0 +1,154 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Private Spaces VPN](https://devcenter.heroku.com/articles/platform-api-reference#vpn-connection) + * [VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN. + */ +export default class VpnConnectionService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new VPN connection in a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + spaceIdentity: string, + payload: Heroku.VpnConnectionCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/vpn-connections`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Destroy existing VPN Connection + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param vpnConnectionIdentity VPN ID or VPN Name. + * @param requestInit The initializer for the request. + */ + public async destroy( + spaceIdentity: string, + vpnConnectionIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/spaces/${spaceIdentity}/vpn-connections/${vpnConnectionIdentity}`, + { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * List VPN connections for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + public async list( + spaceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/vpn-connections`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Info for an existing vpn-connection. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param vpnConnectionIdentity VPN ID or VPN Name. + * @param requestInit The initializer for the request. + */ + public async info( + spaceIdentity: string, + vpnConnectionIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/spaces/${spaceIdentity}/vpn-connections/${vpnConnectionIdentity}`, + { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } + /** + * Update a VPN connection in a private space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param vpnConnectionIdentity VPN ID or VPN Name. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + spaceIdentity: string, + vpnConnectionIdentity: string, + payload: Heroku.VpnConnectionUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/spaces/${spaceIdentity}/vpn-connections/${vpnConnectionIdentity}`, + { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + throw new Error(response.statusText); + } +} diff --git a/tsconfig.json b/tsconfig.json index 505effc..642c716 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,17 +3,22 @@ "declaration": true, "forceConsistentCasingInFileNames": true, "importHelpers": true, - "module": "commonjs", + "moduleResolution": "Node", "outDir": "./lib", "pretty": true, "rootDirs": [ "./src" ], + "skipLibCheck": true, "strict": true, - "target": "es2017", + "target": "ESNext", "typeRoots": [ "./node_modules/@types" - ] + ], + "baseUrl": "./", + "paths": { + "@heroku-cli/schema": ["src/index.ts"] + } }, "include": [ "./src/**/*" diff --git a/tslint.json b/tslint.json deleted file mode 100644 index f570354..0000000 --- a/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "@oclif/tslint" -} diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index 94dac63..0000000 --- a/yarn.lock +++ /dev/null @@ -1,2291 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@apidevtools/json-schema-ref-parser@^11.5.5": - version "11.6.4" - resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.6.4.tgz#0f3e02302f646471d621a8850e6a346d63c8ebd4" - dependencies: - "@jsdevtools/ono" "^7.1.3" - "@types/json-schema" "^7.0.15" - js-yaml "^4.1.0" - -"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": - version "4.4.0" - resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" - integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== - dependencies: - eslint-visitor-keys "^3.3.0" - -"@eslint-community/regexpp@^4.5.1", "@eslint-community/regexpp@^4.6.1": - version "4.10.1" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.1.tgz#361461e5cb3845d874e61731c11cfedd664d83a0" - integrity sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA== - -"@eslint/eslintrc@^2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad" - integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== - dependencies: - ajv "^6.12.4" - debug "^4.3.2" - espree "^9.6.0" - globals "^13.19.0" - ignore "^5.2.0" - import-fresh "^3.2.1" - js-yaml "^4.1.0" - minimatch "^3.1.2" - strip-json-comments "^3.1.1" - -"@eslint/js@8.57.0": - version "8.57.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" - integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== - -"@humanwhocodes/config-array@^0.11.14": - version "0.11.14" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" - integrity sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg== - dependencies: - "@humanwhocodes/object-schema" "^2.0.2" - debug "^4.3.1" - minimatch "^3.0.5" - -"@humanwhocodes/module-importer@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" - integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== - -"@humanwhocodes/object-schema@^2.0.2": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" - integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== - -"@isaacs/cliui@^8.0.2": - version "8.0.2" - resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" - dependencies: - string-width "^5.1.2" - string-width-cjs "npm:string-width@^4.2.0" - strip-ansi "^7.0.1" - strip-ansi-cjs "npm:strip-ansi@^6.0.1" - wrap-ansi "^8.1.0" - wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" - -"@jsdevtools/ono@^7.1.3": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" - -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - -"@pkgjs/parseargs@^0.11.0": - version "0.11.0" - resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" - -"@types/json-schema@^7.0.12", "@types/json-schema@^7.0.15": - version "7.0.15" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" - integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== - -"@types/json5@^0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" - integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== - -"@types/lodash@^4.17.0": - version "4.17.5" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.5.tgz#e6c29b58e66995d57cd170ce3e2a61926d55ee04" - -"@types/semver@^7.5.0": - version "7.5.8" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" - integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ== - -"@typescript-eslint/eslint-plugin@^6.21.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz#30830c1ca81fd5f3c2714e524c4303e0194f9cd3" - integrity sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA== - dependencies: - "@eslint-community/regexpp" "^4.5.1" - "@typescript-eslint/scope-manager" "6.21.0" - "@typescript-eslint/type-utils" "6.21.0" - "@typescript-eslint/utils" "6.21.0" - "@typescript-eslint/visitor-keys" "6.21.0" - debug "^4.3.4" - graphemer "^1.4.0" - ignore "^5.2.4" - natural-compare "^1.4.0" - semver "^7.5.4" - ts-api-utils "^1.0.1" - -"@typescript-eslint/parser@^6.21.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.21.0.tgz#af8fcf66feee2edc86bc5d1cf45e33b0630bf35b" - integrity sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ== - dependencies: - "@typescript-eslint/scope-manager" "6.21.0" - "@typescript-eslint/types" "6.21.0" - "@typescript-eslint/typescript-estree" "6.21.0" - "@typescript-eslint/visitor-keys" "6.21.0" - debug "^4.3.4" - -"@typescript-eslint/scope-manager@6.21.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz#ea8a9bfc8f1504a6ac5d59a6df308d3a0630a2b1" - integrity sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg== - dependencies: - "@typescript-eslint/types" "6.21.0" - "@typescript-eslint/visitor-keys" "6.21.0" - -"@typescript-eslint/scope-manager@7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.13.0.tgz#6927d6451537ce648c6af67a2327378d4cc18462" - integrity sha512-ZrMCe1R6a01T94ilV13egvcnvVJ1pxShkE0+NDjDzH4nvG1wXpwsVI5bZCvE7AEDH1mXEx5tJSVR68bLgG7Dng== - dependencies: - "@typescript-eslint/types" "7.13.0" - "@typescript-eslint/visitor-keys" "7.13.0" - -"@typescript-eslint/type-utils@6.21.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz#6473281cfed4dacabe8004e8521cee0bd9d4c01e" - integrity sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag== - dependencies: - "@typescript-eslint/typescript-estree" "6.21.0" - "@typescript-eslint/utils" "6.21.0" - debug "^4.3.4" - ts-api-utils "^1.0.1" - -"@typescript-eslint/types@6.21.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" - integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg== - -"@typescript-eslint/types@7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.13.0.tgz#0cca95edf1f1fdb0cfe1bb875e121b49617477c5" - integrity sha512-QWuwm9wcGMAuTsxP+qz6LBBd3Uq8I5Nv8xb0mk54jmNoCyDspnMvVsOxI6IsMmway5d1S9Su2+sCKv1st2l6eA== - -"@typescript-eslint/typescript-estree@6.21.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46" - integrity sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ== - dependencies: - "@typescript-eslint/types" "6.21.0" - "@typescript-eslint/visitor-keys" "6.21.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - minimatch "9.0.3" - semver "^7.5.4" - ts-api-utils "^1.0.1" - -"@typescript-eslint/typescript-estree@7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.13.0.tgz#4cc24fc155088ebf3b3adbad62c7e60f72c6de1c" - integrity sha512-cAvBvUoobaoIcoqox1YatXOnSl3gx92rCZoMRPzMNisDiM12siGilSM4+dJAekuuHTibI2hVC2fYK79iSFvWjw== - dependencies: - "@typescript-eslint/types" "7.13.0" - "@typescript-eslint/visitor-keys" "7.13.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - minimatch "^9.0.4" - semver "^7.6.0" - ts-api-utils "^1.3.0" - -"@typescript-eslint/utils@6.21.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134" - integrity sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ== - dependencies: - "@eslint-community/eslint-utils" "^4.4.0" - "@types/json-schema" "^7.0.12" - "@types/semver" "^7.5.0" - "@typescript-eslint/scope-manager" "6.21.0" - "@typescript-eslint/types" "6.21.0" - "@typescript-eslint/typescript-estree" "6.21.0" - semver "^7.5.4" - -"@typescript-eslint/utils@^6.13.0 || ^7.0.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.13.0.tgz#f84e7e8aeceae945a9a3f40d077fd95915308004" - integrity sha512-jceD8RgdKORVnB4Y6BqasfIkFhl4pajB1wVxrF4akxD2QPM8GNYjgGwEzYS+437ewlqqrg7Dw+6dhdpjMpeBFQ== - dependencies: - "@eslint-community/eslint-utils" "^4.4.0" - "@typescript-eslint/scope-manager" "7.13.0" - "@typescript-eslint/types" "7.13.0" - "@typescript-eslint/typescript-estree" "7.13.0" - -"@typescript-eslint/visitor-keys@6.21.0": - version "6.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz#87a99d077aa507e20e238b11d56cc26ade45fe47" - integrity sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A== - dependencies: - "@typescript-eslint/types" "6.21.0" - eslint-visitor-keys "^3.4.1" - -"@typescript-eslint/visitor-keys@7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.13.0.tgz#2eb7ce8eb38c2b0d4a494d1fe1908e7071a1a353" - integrity sha512-nxn+dozQx+MK61nn/JP+M4eCkHDSxSLDpgE3WcQo0+fkjEolnaB5jswvIKC4K56By8MMgIho7f1PVxERHEo8rw== - dependencies: - "@typescript-eslint/types" "7.13.0" - eslint-visitor-keys "^3.4.3" - -"@ungap/structured-clone@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" - integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== - -acorn-jsx@^5.3.2: - version "5.3.2" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" - integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== - -acorn@^8.9.0: - version "8.11.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" - integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== - -ajv@^6.12.4: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - -ansi-regex@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -ansi-styles@^6.1.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - -array-buffer-byte-length@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz#1e5583ec16763540a27ae52eed99ff899223568f" - integrity sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg== - dependencies: - call-bind "^1.0.5" - is-array-buffer "^3.0.4" - -array-includes@^3.1.7: - version "3.1.8" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.8.tgz#5e370cbe172fdd5dd6530c1d4aadda25281ba97d" - integrity sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.2" - es-object-atoms "^1.0.0" - get-intrinsic "^1.2.4" - is-string "^1.0.7" - -array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - -array.prototype.findlastindex@^1.2.3: - version "1.2.5" - resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz#8c35a755c72908719453f87145ca011e39334d0d" - integrity sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.2" - es-errors "^1.3.0" - es-object-atoms "^1.0.0" - es-shim-unscopables "^1.0.2" - -array.prototype.flat@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz#1476217df8cff17d72ee8f3ba06738db5b387d18" - integrity sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA== - dependencies: - call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.22.1" - es-shim-unscopables "^1.0.0" - -array.prototype.flatmap@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz#c9a7c6831db8e719d6ce639190146c24bbd3e527" - integrity sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ== - dependencies: - call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.22.1" - es-shim-unscopables "^1.0.0" - -arraybuffer.prototype.slice@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz#097972f4255e41bc3425e37dc3f6421cf9aefde6" - integrity sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A== - dependencies: - array-buffer-byte-length "^1.0.1" - call-bind "^1.0.5" - define-properties "^1.2.1" - es-abstract "^1.22.3" - es-errors "^1.2.1" - get-intrinsic "^1.2.3" - is-array-buffer "^3.0.4" - is-shared-array-buffer "^1.0.2" - -available-typed-arrays@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" - integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== - dependencies: - possible-typed-array-names "^1.0.0" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - dependencies: - balanced-match "^1.0.0" - -braces@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" - integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== - dependencies: - fill-range "^7.1.1" - -buffer-equal-constant-time@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" - -builtins@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/builtins/-/builtins-5.1.0.tgz#6d85eeb360c4ebc166c3fdef922a15aa7316a5e8" - integrity sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg== - dependencies: - semver "^7.0.0" - -call-bind@^1.0.2, call-bind@^1.0.5, call-bind@^1.0.6, call-bind@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" - integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== - dependencies: - es-define-property "^1.0.0" - es-errors "^1.3.0" - function-bind "^1.1.2" - get-intrinsic "^1.2.4" - set-function-length "^1.2.1" - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -chalk@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -cli-color@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-2.0.4.tgz#d658080290968816b322248b7306fad2346fb2c8" - dependencies: - d "^1.0.1" - es5-ext "^0.10.64" - es6-iterator "^2.0.3" - memoizee "^0.4.15" - timers-ext "^0.1.7" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -confusing-browser-globals@1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81" - integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== - -content-type@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - -cross-spawn@^7.0.0, cross-spawn@^7.0.2: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -d@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" - dependencies: - es5-ext "^0.10.9" - -d@^1.0.1, d@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.2.tgz#2aefd554b81981e7dccf72d6842ae725cb17e5de" - dependencies: - es5-ext "^0.10.64" - type "^2.7.2" - -data-uri-to-buffer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" - -data-view-buffer@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/data-view-buffer/-/data-view-buffer-1.0.1.tgz#8ea6326efec17a2e42620696e671d7d5a8bc66b2" - integrity sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA== - dependencies: - call-bind "^1.0.6" - es-errors "^1.3.0" - is-data-view "^1.0.1" - -data-view-byte-length@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz#90721ca95ff280677eb793749fce1011347669e2" - integrity sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ== - dependencies: - call-bind "^1.0.7" - es-errors "^1.3.0" - is-data-view "^1.0.1" - -data-view-byte-offset@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz#5e0bbfb4828ed2d1b9b400cd8a7d119bca0ff18a" - integrity sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA== - dependencies: - call-bind "^1.0.6" - es-errors "^1.3.0" - is-data-view "^1.0.1" - -debug@^3.1.0: - version "3.2.5" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.5.tgz#c2418fbfd7a29f4d4f70ff4cea604d4b64c46407" - dependencies: - ms "^2.1.1" - -debug@^3.2.7: - version "3.2.7" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" - integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== - dependencies: - ms "^2.1.1" - -debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: - version "4.3.5" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" - integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== - dependencies: - ms "2.1.2" - -deep-is@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" - integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== - -define-data-property@^1.0.1, define-data-property@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" - integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== - dependencies: - es-define-property "^1.0.0" - es-errors "^1.3.0" - gopd "^1.0.1" - -define-properties@^1.2.0, define-properties@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" - integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== - dependencies: - define-data-property "^1.0.1" - has-property-descriptors "^1.0.0" - object-keys "^1.1.1" - -dir-glob@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" - integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== - dependencies: - path-type "^4.0.0" - -doctrine@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" - integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== - dependencies: - esutils "^2.0.2" - -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - -eastasianwidth@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" - -ecdsa-sig-formatter@1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz#1c595000f04a8897dfb85000892a0f4c33af86c3" - dependencies: - safe-buffer "^5.0.1" - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - -emoji-regex@^9.2.2: - version "9.2.2" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" - -enhanced-resolve@^5.12.0: - version "5.17.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz#d037603789dd9555b89aaec7eb78845c49089bc5" - integrity sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA== - dependencies: - graceful-fs "^4.2.4" - tapable "^2.2.0" - -es-abstract@^1.22.1, es-abstract@^1.22.3, es-abstract@^1.23.0, es-abstract@^1.23.2: - version "1.23.3" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.23.3.tgz#8f0c5a35cd215312573c5a27c87dfd6c881a0aa0" - integrity sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A== - dependencies: - array-buffer-byte-length "^1.0.1" - arraybuffer.prototype.slice "^1.0.3" - available-typed-arrays "^1.0.7" - call-bind "^1.0.7" - data-view-buffer "^1.0.1" - data-view-byte-length "^1.0.1" - data-view-byte-offset "^1.0.0" - es-define-property "^1.0.0" - es-errors "^1.3.0" - es-object-atoms "^1.0.0" - es-set-tostringtag "^2.0.3" - es-to-primitive "^1.2.1" - function.prototype.name "^1.1.6" - get-intrinsic "^1.2.4" - get-symbol-description "^1.0.2" - globalthis "^1.0.3" - gopd "^1.0.1" - has-property-descriptors "^1.0.2" - has-proto "^1.0.3" - has-symbols "^1.0.3" - hasown "^2.0.2" - internal-slot "^1.0.7" - is-array-buffer "^3.0.4" - is-callable "^1.2.7" - is-data-view "^1.0.1" - is-negative-zero "^2.0.3" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.3" - is-string "^1.0.7" - is-typed-array "^1.1.13" - is-weakref "^1.0.2" - object-inspect "^1.13.1" - object-keys "^1.1.1" - object.assign "^4.1.5" - regexp.prototype.flags "^1.5.2" - safe-array-concat "^1.1.2" - safe-regex-test "^1.0.3" - string.prototype.trim "^1.2.9" - string.prototype.trimend "^1.0.8" - string.prototype.trimstart "^1.0.8" - typed-array-buffer "^1.0.2" - typed-array-byte-length "^1.0.1" - typed-array-byte-offset "^1.0.2" - typed-array-length "^1.0.6" - unbox-primitive "^1.0.2" - which-typed-array "^1.1.15" - -es-define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" - integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== - dependencies: - get-intrinsic "^1.2.4" - -es-errors@^1.2.1, es-errors@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" - integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== - -es-object-atoms@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.0.0.tgz#ddb55cd47ac2e240701260bc2a8e31ecb643d941" - integrity sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw== - dependencies: - es-errors "^1.3.0" - -es-set-tostringtag@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz#8bb60f0a440c2e4281962428438d58545af39777" - integrity sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ== - dependencies: - get-intrinsic "^1.2.4" - has-tostringtag "^1.0.2" - hasown "^2.0.1" - -es-shim-unscopables@^1.0.0, es-shim-unscopables@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz#1f6942e71ecc7835ed1c8a83006d8771a63a3763" - integrity sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw== - dependencies: - hasown "^2.0.0" - -es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - -es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.62, es5-ext@^0.10.64, es5-ext@^0.10.9, es5-ext@~0.10.14, es5-ext@~0.10.2: - version "0.10.64" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.64.tgz#12e4ffb48f1ba2ea777f1fcdd1918ef73ea21714" - dependencies: - es6-iterator "^2.0.3" - es6-symbol "^3.1.3" - esniff "^2.0.1" - next-tick "^1.1.0" - -es6-iterator@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" - -es6-symbol@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" - dependencies: - d "1" - es5-ext "~0.10.14" - -es6-symbol@^3.1.3: - version "3.1.4" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.4.tgz#f4e7d28013770b4208ecbf3e0bf14d3bcb557b8c" - dependencies: - d "^1.0.2" - ext "^1.7.0" - -es6-weak-map@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" - dependencies: - d "1" - es5-ext "^0.10.46" - es6-iterator "^2.0.3" - es6-symbol "^3.1.1" - -escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -eslint-config-oclif-typescript@3.1.7: - version "3.1.7" - resolved "https://registry.yarnpkg.com/eslint-config-oclif-typescript/-/eslint-config-oclif-typescript-3.1.7.tgz#24a663d12d4ba05c92b190bd76f6d081172b5d23" - integrity sha512-5q6Q1NjQt6WrAANGO9Go3uuxZTzf7ywmecRNW7e+bTnlkTk0/ClPd6SogH+qkwOkFJaMHmBp45ZmzvwGzy/Txg== - dependencies: - "@typescript-eslint/eslint-plugin" "^6.21.0" - "@typescript-eslint/parser" "^6.21.0" - eslint-config-xo-space "^0.35.0" - eslint-import-resolver-typescript "^3.6.1" - eslint-plugin-import "^2.29.1" - eslint-plugin-mocha "^10.4.3" - eslint-plugin-n "^15" - eslint-plugin-perfectionist "^2.10.0" - -eslint-config-xo-space@^0.35.0: - version "0.35.0" - resolved "https://registry.yarnpkg.com/eslint-config-xo-space/-/eslint-config-xo-space-0.35.0.tgz#fdc2741c601a011e3ba185f07e2e78b6eed9d3dc" - integrity sha512-+79iVcoLi3PvGcjqYDpSPzbLfqYpNcMlhsCBRsnmDoHAn4npJG6YxmHpelQKpXM7v/EeZTUKb4e1xotWlei8KA== - dependencies: - eslint-config-xo "^0.44.0" - -eslint-config-xo@^0.44.0: - version "0.44.0" - resolved "https://registry.yarnpkg.com/eslint-config-xo/-/eslint-config-xo-0.44.0.tgz#b4a68da791ecfd329bc7e1f88f9edea3d4dca70c" - integrity sha512-YG4gdaor0mJJi8UBeRJqDPO42MedTWYMaUyucF5bhm2pi/HS98JIxfFQmTLuyj6hGpQlAazNfyVnn7JuDn+Sew== - dependencies: - confusing-browser-globals "1.0.11" - -eslint-import-resolver-node@^0.3.9: - version "0.3.9" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz#d4eaac52b8a2e7c3cd1903eb00f7e053356118ac" - integrity sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g== - dependencies: - debug "^3.2.7" - is-core-module "^2.13.0" - resolve "^1.22.4" - -eslint-import-resolver-typescript@^3.6.1: - version "3.6.1" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz#7b983680edd3f1c5bce1a5829ae0bc2d57fe9efa" - integrity sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg== - dependencies: - debug "^4.3.4" - enhanced-resolve "^5.12.0" - eslint-module-utils "^2.7.4" - fast-glob "^3.3.1" - get-tsconfig "^4.5.0" - is-core-module "^2.11.0" - is-glob "^4.0.3" - -eslint-module-utils@^2.7.4, eslint-module-utils@^2.8.0: - version "2.8.1" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz#52f2404300c3bd33deece9d7372fb337cc1d7c34" - integrity sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q== - dependencies: - debug "^3.2.7" - -eslint-plugin-es@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz#f0822f0c18a535a97c3e714e89f88586a7641ec9" - integrity sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ== - dependencies: - eslint-utils "^2.0.0" - regexpp "^3.0.0" - -eslint-plugin-import@^2.29.1: - version "2.29.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz#d45b37b5ef5901d639c15270d74d46d161150643" - integrity sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw== - dependencies: - array-includes "^3.1.7" - array.prototype.findlastindex "^1.2.3" - array.prototype.flat "^1.3.2" - array.prototype.flatmap "^1.3.2" - debug "^3.2.7" - doctrine "^2.1.0" - eslint-import-resolver-node "^0.3.9" - eslint-module-utils "^2.8.0" - hasown "^2.0.0" - is-core-module "^2.13.1" - is-glob "^4.0.3" - minimatch "^3.1.2" - object.fromentries "^2.0.7" - object.groupby "^1.0.1" - object.values "^1.1.7" - semver "^6.3.1" - tsconfig-paths "^3.15.0" - -eslint-plugin-mocha@^10.4.3: - version "10.4.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-10.4.3.tgz#bf641379d9f1c7d6a84646a3fc1a0baa50da8bfd" - integrity sha512-emc4TVjq5Ht0/upR+psftuz6IBG5q279p+1dSRDeHf+NS9aaerBi3lXKo1SEzwC29hFIW21gO89CEWSvRsi8IQ== - dependencies: - eslint-utils "^3.0.0" - globals "^13.24.0" - rambda "^7.4.0" - -eslint-plugin-n@^15: - version "15.7.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz#e29221d8f5174f84d18f2eb94765f2eeea033b90" - integrity sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q== - dependencies: - builtins "^5.0.1" - eslint-plugin-es "^4.1.0" - eslint-utils "^3.0.0" - ignore "^5.1.1" - is-core-module "^2.11.0" - minimatch "^3.1.2" - resolve "^1.22.1" - semver "^7.3.8" - -eslint-plugin-perfectionist@^2.10.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-perfectionist/-/eslint-plugin-perfectionist-2.11.0.tgz#d5cc32e0d12b649357ca5b104a105793956759ba" - integrity sha512-XrtBtiu5rbQv88gl+1e2RQud9te9luYNvKIgM9emttQ2zutHPzY/AQUucwxscDKV4qlTkvLTxjOFvxqeDpPorw== - dependencies: - "@typescript-eslint/utils" "^6.13.0 || ^7.0.0" - minimatch "^9.0.3" - natural-compare-lite "^1.4.0" - -eslint-scope@^7.2.2: - version "7.2.2" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" - integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== - dependencies: - esrecurse "^4.3.0" - estraverse "^5.2.0" - -eslint-utils@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== - dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-utils@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" - integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== - dependencies: - eslint-visitor-keys "^2.0.0" - -eslint-visitor-keys@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - -eslint-visitor-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" - integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== - -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" - integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== - -eslint@^8.57.0: - version "8.57.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.57.0.tgz#c786a6fd0e0b68941aaf624596fb987089195668" - integrity sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ== - dependencies: - "@eslint-community/eslint-utils" "^4.2.0" - "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.4" - "@eslint/js" "8.57.0" - "@humanwhocodes/config-array" "^0.11.14" - "@humanwhocodes/module-importer" "^1.0.1" - "@nodelib/fs.walk" "^1.2.8" - "@ungap/structured-clone" "^1.2.0" - ajv "^6.12.4" - chalk "^4.0.0" - cross-spawn "^7.0.2" - debug "^4.3.2" - doctrine "^3.0.0" - escape-string-regexp "^4.0.0" - eslint-scope "^7.2.2" - eslint-visitor-keys "^3.4.3" - espree "^9.6.1" - esquery "^1.4.2" - esutils "^2.0.2" - fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" - find-up "^5.0.0" - glob-parent "^6.0.2" - globals "^13.19.0" - graphemer "^1.4.0" - ignore "^5.2.0" - imurmurhash "^0.1.4" - is-glob "^4.0.0" - is-path-inside "^3.0.3" - js-yaml "^4.1.0" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" - lodash.merge "^4.6.2" - minimatch "^3.1.2" - natural-compare "^1.4.0" - optionator "^0.9.3" - strip-ansi "^6.0.1" - text-table "^0.2.0" - -esniff@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/esniff/-/esniff-2.0.1.tgz#a4d4b43a5c71c7ec51c51098c1d8a29081f9b308" - dependencies: - d "^1.0.1" - es5-ext "^0.10.62" - event-emitter "^0.3.5" - type "^2.7.2" - -espree@^9.6.0, espree@^9.6.1: - version "9.6.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" - integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== - dependencies: - acorn "^8.9.0" - acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.4.1" - -esquery@^1.4.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" - integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== - dependencies: - estraverse "^5.1.0" - -esrecurse@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^5.1.0, estraverse@^5.2.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" - integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - -event-emitter@^0.3.5: - version "0.3.5" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" - dependencies: - d "1" - es5-ext "~0.10.14" - -ext@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/ext/-/ext-1.7.0.tgz#0ea4383c0103d60e70be99e9a7f11027a33c4f5f" - dependencies: - type "^2.7.2" - -fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-glob@^3.2.9, fast-glob@^3.3.1: - version "3.3.2" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" - integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== - -fastq@^1.6.0: - version "1.17.1" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.17.1.tgz#2a523f07a4e7b1e81a42b91b8bf2254107753b47" - integrity sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w== - dependencies: - reusify "^1.0.4" - -fetch-blob@^3.1.2, fetch-blob@^3.1.4: - version "3.2.0" - resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" - dependencies: - node-domexception "^1.0.0" - web-streams-polyfill "^3.0.3" - -file-entry-cache@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== - dependencies: - flat-cache "^3.0.4" - -fill-range@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" - integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== - dependencies: - to-regex-range "^5.0.1" - -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -flat-cache@^3.0.4: - version "3.2.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" - integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== - dependencies: - flatted "^3.2.9" - keyv "^4.5.3" - rimraf "^3.0.2" - -flatted@^3.2.9: - version "3.3.1" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a" - integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== - -for-each@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" - integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== - dependencies: - is-callable "^1.1.3" - -foreground-child@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" - dependencies: - cross-spawn "^7.0.0" - signal-exit "^4.0.1" - -formdata-polyfill@^4.0.10: - version "4.0.10" - resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" - dependencies: - fetch-blob "^3.1.2" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -function-bind@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" - integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== - -function.prototype.name@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.6.tgz#cdf315b7d90ee77a4c6ee216c3c3362da07533fd" - integrity sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.22.1" - functions-have-names "^1.2.3" - -functions-have-names@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" - integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== - -get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" - integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== - dependencies: - es-errors "^1.3.0" - function-bind "^1.1.2" - has-proto "^1.0.1" - has-symbols "^1.0.3" - hasown "^2.0.0" - -get-symbol-description@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.2.tgz#533744d5aa20aca4e079c8e5daf7fd44202821f5" - integrity sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg== - dependencies: - call-bind "^1.0.5" - es-errors "^1.3.0" - get-intrinsic "^1.2.4" - -get-tsconfig@^4.5.0: - version "4.7.5" - resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.7.5.tgz#5e012498579e9a6947511ed0cd403272c7acbbaf" - integrity sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw== - dependencies: - resolve-pkg-maps "^1.0.0" - -glob-parent@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob-parent@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" - integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== - dependencies: - is-glob "^4.0.3" - -glob@^10.3.12: - version "10.4.1" - resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.1.tgz#0cfb01ab6a6b438177bfe6a58e2576f6efe909c2" - dependencies: - foreground-child "^3.1.0" - jackspeak "^3.1.2" - minimatch "^9.0.4" - minipass "^7.1.2" - path-scurry "^1.11.1" - -glob@^7.1.3: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^13.19.0, globals@^13.24.0: - version "13.24.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171" - integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== - dependencies: - type-fest "^0.20.2" - -globalthis@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236" - integrity sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ== - dependencies: - define-properties "^1.2.1" - gopd "^1.0.1" - -globby@^11.1.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" - integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.2.9" - ignore "^5.2.0" - merge2 "^1.4.1" - slash "^3.0.0" - -gopd@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" - integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== - dependencies: - get-intrinsic "^1.1.3" - -graceful-fs@^4.2.4: - version "4.2.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" - integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== - -graphemer@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" - integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== - -has-bigints@^1.0.1, has-bigints@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" - integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" - integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== - dependencies: - es-define-property "^1.0.0" - -has-proto@^1.0.1, has-proto@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" - integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== - -has-symbols@^1.0.2, has-symbols@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" - integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== - -has-tostringtag@^1.0.0, has-tostringtag@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" - integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== - dependencies: - has-symbols "^1.0.3" - -hasown@^2.0.0, hasown@^2.0.1, hasown@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" - integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== - dependencies: - function-bind "^1.1.2" - -http-call@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/http-call/-/http-call-5.2.2.tgz#d8eb37eef701e566d44373ef19b22444ebb7c02e" - dependencies: - content-type "^1.0.4" - debug "^3.1.0" - is-retry-allowed "^1.1.0" - is-stream "^1.1.0" - tunnel-agent "^0.6.0" - -ignore@^5.1.1, ignore@^5.2.0, ignore@^5.2.4: - version "5.3.1" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" - integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== - -import-fresh@^3.2.1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -internal-slot@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.7.tgz#c06dcca3ed874249881007b0a5523b172a190802" - integrity sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g== - dependencies: - es-errors "^1.3.0" - hasown "^2.0.0" - side-channel "^1.0.4" - -is-array-buffer@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.4.tgz#7a1f92b3d61edd2bc65d24f130530ea93d7fae98" - integrity sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.2.1" - -is-bigint@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" - integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== - dependencies: - has-bigints "^1.0.1" - -is-boolean-object@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" - integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" - integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== - -is-core-module@^2.11.0, is-core-module@^2.13.0, is-core-module@^2.13.1: - version "2.13.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" - integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== - dependencies: - hasown "^2.0.0" - -is-data-view@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-data-view/-/is-data-view-1.0.1.tgz#4b4d3a511b70f3dc26d42c03ca9ca515d847759f" - integrity sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w== - dependencies: - is-typed-array "^1.1.13" - -is-date-object@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" - integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== - dependencies: - has-tostringtag "^1.0.0" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-negative-zero@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.3.tgz#ced903a027aca6381b777a5743069d7376a49747" - integrity sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw== - -is-number-object@^1.0.4: - version "1.0.7" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" - integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== - dependencies: - has-tostringtag "^1.0.0" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-path-inside@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" - integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== - -is-promise@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" - -is-regex@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" - integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-retry-allowed@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" - -is-shared-array-buffer@^1.0.2, is-shared-array-buffer@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz#1237f1cba059cdb62431d378dcc37d9680181688" - integrity sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg== - dependencies: - call-bind "^1.0.7" - -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - -is-string@^1.0.5, is-string@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" - integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== - dependencies: - has-tostringtag "^1.0.0" - -is-symbol@^1.0.2, is-symbol@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" - integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== - dependencies: - has-symbols "^1.0.2" - -is-typed-array@^1.1.13: - version "1.1.13" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.13.tgz#d6c5ca56df62334959322d7d7dd1cca50debe229" - integrity sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw== - dependencies: - which-typed-array "^1.1.14" - -is-weakref@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" - integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== - dependencies: - call-bind "^1.0.2" - -isarray@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" - integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - -jackspeak@^3.1.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-3.4.0.tgz#a75763ff36ad778ede6a156d8ee8b124de445b4a" - dependencies: - "@isaacs/cliui" "^8.0.2" - optionalDependencies: - "@pkgjs/parseargs" "^0.11.0" - -js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - dependencies: - argparse "^2.0.1" - -json-buffer@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" - integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== - -json-schema-to-typescript@^14.1.0: - version "14.1.0" - resolved "https://registry.yarnpkg.com/json-schema-to-typescript/-/json-schema-to-typescript-14.1.0.tgz#31160d9cf13bf8f948a7ccefdf97e995bc183591" - integrity sha512-VIeAFQkn88gFh26MSHWG4uX7TjK/arTw0NVLMZn6vX1WrSF+P6xu5MyEdovu+9PJ0uiS5gm0wzwQvYW9eSq1uw== - dependencies: - "@apidevtools/json-schema-ref-parser" "^11.5.5" - "@types/json-schema" "^7.0.15" - "@types/lodash" "^4.17.0" - cli-color "^2.0.4" - glob "^10.3.12" - is-glob "^4.0.3" - js-yaml "^4.1.0" - lodash "^4.17.21" - minimist "^1.2.8" - mkdirp "^3.0.1" - node-fetch "^3.3.2" - prettier "^3.2.5" - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== - -json5@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" - integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== - dependencies: - minimist "^1.2.0" - -jsonwebtoken@^8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-8.3.0.tgz#056c90eee9a65ed6e6c72ddb0a1d325109aaf643" - dependencies: - jws "^3.1.5" - lodash.includes "^4.3.0" - lodash.isboolean "^3.0.3" - lodash.isinteger "^4.0.4" - lodash.isnumber "^3.0.3" - lodash.isplainobject "^4.0.6" - lodash.isstring "^4.0.1" - lodash.once "^4.0.0" - ms "^2.1.1" - -jwa@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.1.6.tgz#87240e76c9808dbde18783cf2264ef4929ee50e6" - dependencies: - buffer-equal-constant-time "1.0.1" - ecdsa-sig-formatter "1.0.10" - safe-buffer "^5.0.1" - -jws@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/jws/-/jws-3.1.5.tgz#80d12d05b293d1e841e7cb8b4e69e561adcf834f" - dependencies: - jwa "^1.1.5" - safe-buffer "^5.0.1" - -keyv@^4.5.3: - version "4.5.4" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" - integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== - dependencies: - json-buffer "3.0.1" - -levn@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" - integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== - dependencies: - prelude-ls "^1.2.1" - type-check "~0.4.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash.includes@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" - -lodash.isboolean@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6" - -lodash.isinteger@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343" - -lodash.isnumber@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz#3ce76810c5928d03352301ac287317f11c0b1ffc" - -lodash.isplainobject@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" - -lodash.isstring@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" - -lodash.merge@^4.6.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" - integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== - -lodash.once@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" - -lodash@^4.17.21: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - -lru-cache@^10.2.0: - version "10.2.2" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.2.tgz#48206bc114c1252940c41b25b41af5b545aca878" - -lru-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" - dependencies: - es5-ext "~0.10.2" - -memoizee@^0.4.15: - version "0.4.17" - resolved "https://registry.yarnpkg.com/memoizee/-/memoizee-0.4.17.tgz#942a5f8acee281fa6fb9c620bddc57e3b7382949" - dependencies: - d "^1.0.2" - es5-ext "^0.10.64" - es6-weak-map "^2.0.3" - event-emitter "^0.3.5" - is-promise "^2.2.2" - lru-queue "^0.1.0" - next-tick "^1.1.0" - timers-ext "^0.1.7" - -merge2@^1.3.0, merge2@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -micromatch@^4.0.4: - version "4.0.7" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.7.tgz#33e8190d9fe474a9895525f5618eee136d46c2e5" - integrity sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q== - dependencies: - braces "^3.0.3" - picomatch "^2.3.1" - -minimatch@9.0.3: - version "9.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" - integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== - dependencies: - brace-expansion "^2.0.1" - -minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimatch@^9.0.3, minimatch@^9.0.4: - version "9.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.4.tgz#8e49c731d1749cbec05050ee5145147b32496a51" - integrity sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw== - dependencies: - brace-expansion "^2.0.1" - -minimist@^1.2.0, minimist@^1.2.6, minimist@^1.2.8: - version "1.2.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" - integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== - -"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" - -mkdirp@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50" - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - -natural-compare-lite@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" - integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== - -next-tick@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" - -node-domexception@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" - -node-fetch@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" - dependencies: - data-uri-to-buffer "^4.0.0" - fetch-blob "^3.1.4" - formdata-polyfill "^4.0.10" - -object-inspect@^1.13.1: - version "1.13.1" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2" - integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ== - -object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -object.assign@^4.1.5: - version "4.1.5" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0" - integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== - dependencies: - call-bind "^1.0.5" - define-properties "^1.2.1" - has-symbols "^1.0.3" - object-keys "^1.1.1" - -object.fromentries@^2.0.7: - version "2.0.8" - resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.8.tgz#f7195d8a9b97bd95cbc1999ea939ecd1a2b00c65" - integrity sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.2" - es-object-atoms "^1.0.0" - -object.groupby@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/object.groupby/-/object.groupby-1.0.3.tgz#9b125c36238129f6f7b61954a1e7176148d5002e" - integrity sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.2" - -object.values@^1.1.7: - version "1.2.0" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.2.0.tgz#65405a9d92cee68ac2d303002e0b8470a4d9ab1b" - integrity sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-object-atoms "^1.0.0" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -optionator@^0.9.3: - version "0.9.4" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734" - integrity sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g== - dependencies: - deep-is "^0.1.3" - fast-levenshtein "^2.0.6" - levn "^0.4.1" - prelude-ls "^1.2.1" - type-check "^0.4.0" - word-wrap "^1.2.5" - -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - -path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - -path-parse@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-scurry@^1.11.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" - dependencies: - lru-cache "^10.2.0" - minipass "^5.0.0 || ^6.0.2 || ^7.0.0" - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -possible-typed-array-names@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" - integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== - -prelude-ls@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" - integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== - -prettier@^3.2.5: - version "3.3.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.2.tgz#03ff86dc7c835f2d2559ee76876a3914cec4a90a" - -punycode@^2.1.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" - integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -rambda@^7.4.0: - version "7.5.0" - resolved "https://registry.yarnpkg.com/rambda/-/rambda-7.5.0.tgz#1865044c59bc0b16f63026c6e5a97e4b1bbe98fe" - integrity sha512-y/M9weqWAH4iopRd7EHDEQQvpFPHj1AA3oHozE9tfITHUtTR7Z9PSlIRRG2l1GuW7sefC1cXFfIcF+cgnShdBA== - -regexp.prototype.flags@^1.5.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz#138f644a3350f981a858c44f6bb1a61ff59be334" - integrity sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw== - dependencies: - call-bind "^1.0.6" - define-properties "^1.2.1" - es-errors "^1.3.0" - set-function-name "^2.0.1" - -regexpp@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" - integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve-pkg-maps@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" - integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== - -resolve@^1.22.1, resolve@^1.22.4: - version "1.22.8" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" - integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== - dependencies: - is-core-module "^2.13.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -safe-array-concat@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.1.2.tgz#81d77ee0c4e8b863635227c721278dd524c20edb" - integrity sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q== - dependencies: - call-bind "^1.0.7" - get-intrinsic "^1.2.4" - has-symbols "^1.0.3" - isarray "^2.0.5" - -safe-buffer@^5.0.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - -safe-regex-test@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.3.tgz#a5b4c0f06e0ab50ea2c395c14d8371232924c377" - integrity sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw== - dependencies: - call-bind "^1.0.6" - es-errors "^1.3.0" - is-regex "^1.1.4" - -semver@^6.3.1: - version "6.3.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - -semver@^7.0.0, semver@^7.3.8, semver@^7.5.4, semver@^7.6.0: - version "7.6.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" - integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== - -set-function-length@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" - integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== - dependencies: - define-data-property "^1.1.4" - es-errors "^1.3.0" - function-bind "^1.1.2" - get-intrinsic "^1.2.4" - gopd "^1.0.1" - has-property-descriptors "^1.0.2" - -set-function-name@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.2.tgz#16a705c5a0dc2f5e638ca96d8a8cd4e1c2b90985" - integrity sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ== - dependencies: - define-data-property "^1.1.4" - es-errors "^1.3.0" - functions-have-names "^1.2.3" - has-property-descriptors "^1.0.2" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - -side-channel@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" - integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== - dependencies: - call-bind "^1.0.7" - es-errors "^1.3.0" - get-intrinsic "^1.2.4" - object-inspect "^1.13.1" - -signal-exit@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.1.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^5.0.1, string-width@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" - dependencies: - eastasianwidth "^0.2.0" - emoji-regex "^9.2.2" - strip-ansi "^7.0.1" - -string.prototype.trim@^1.2.9: - version "1.2.9" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz#b6fa326d72d2c78b6df02f7759c73f8f6274faa4" - integrity sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-abstract "^1.23.0" - es-object-atoms "^1.0.0" - -string.prototype.trimend@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz#3651b8513719e8a9f48de7f2f77640b26652b229" - integrity sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-object-atoms "^1.0.0" - -string.prototype.trimstart@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz#7ee834dda8c7c17eff3118472bb35bfedaa34dde" - integrity sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-object-atoms "^1.0.0" - -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^7.0.1: - version "7.1.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" - dependencies: - ansi-regex "^6.0.1" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== - -strip-json-comments@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - -tapable@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" - integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== - -timers-ext@^0.1.7: - version "0.1.8" - resolved "https://registry.yarnpkg.com/timers-ext/-/timers-ext-0.1.8.tgz#b4e442f10b7624a29dd2aa42c295e257150cf16c" - dependencies: - es5-ext "^0.10.64" - next-tick "^1.1.0" - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -ts-api-utils@^1.0.1, ts-api-utils@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" - integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== - -tsconfig-paths@^3.15.0: - version "3.15.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" - integrity sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg== - dependencies: - "@types/json5" "^0.0.29" - json5 "^1.0.2" - minimist "^1.2.6" - strip-bom "^3.0.0" - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - dependencies: - safe-buffer "^5.0.1" - -type-check@^0.4.0, type-check@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" - integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== - dependencies: - prelude-ls "^1.2.1" - -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - -type@^2.7.2: - version "2.7.3" - resolved "https://registry.yarnpkg.com/type/-/type-2.7.3.tgz#436981652129285cc3ba94f392886c2637ea0486" - -typed-array-buffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz#1867c5d83b20fcb5ccf32649e5e2fc7424474ff3" - integrity sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ== - dependencies: - call-bind "^1.0.7" - es-errors "^1.3.0" - is-typed-array "^1.1.13" - -typed-array-byte-length@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz#d92972d3cff99a3fa2e765a28fcdc0f1d89dec67" - integrity sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw== - dependencies: - call-bind "^1.0.7" - for-each "^0.3.3" - gopd "^1.0.1" - has-proto "^1.0.3" - is-typed-array "^1.1.13" - -typed-array-byte-offset@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz#f9ec1acb9259f395093e4567eb3c28a580d02063" - integrity sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA== - dependencies: - available-typed-arrays "^1.0.7" - call-bind "^1.0.7" - for-each "^0.3.3" - gopd "^1.0.1" - has-proto "^1.0.3" - is-typed-array "^1.1.13" - -typed-array-length@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.6.tgz#57155207c76e64a3457482dfdc1c9d1d3c4c73a3" - integrity sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g== - dependencies: - call-bind "^1.0.7" - for-each "^0.3.3" - gopd "^1.0.1" - has-proto "^1.0.3" - is-typed-array "^1.1.13" - possible-typed-array-names "^1.0.0" - -typescript@^4.9.5: - version "4.9.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" - integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== - -unbox-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" - integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== - dependencies: - call-bind "^1.0.2" - has-bigints "^1.0.2" - has-symbols "^1.0.3" - which-boxed-primitive "^1.0.2" - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -web-streams-polyfill@^3.0.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz#2073b91a2fdb1fbfbd401e7de0ac9f8214cecb4b" - -which-boxed-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" - integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== - dependencies: - is-bigint "^1.0.1" - is-boolean-object "^1.1.0" - is-number-object "^1.0.4" - is-string "^1.0.5" - is-symbol "^1.0.3" - -which-typed-array@^1.1.14, which-typed-array@^1.1.15: - version "1.1.15" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.15.tgz#264859e9b11a649b388bfaaf4f767df1f779b38d" - integrity sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA== - dependencies: - available-typed-arrays "^1.0.7" - call-bind "^1.0.7" - for-each "^0.3.3" - gopd "^1.0.1" - has-tostringtag "^1.0.2" - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - dependencies: - isexe "^2.0.0" - -word-wrap@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" - integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== - -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrap-ansi@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" - dependencies: - ansi-styles "^6.1.0" - string-width "^5.0.1" - strip-ansi "^7.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From 8003088eaf3d09d44af7f5c1633027a80c13fc64 Mon Sep 17 00:00:00 2001 From: Justin Wilaby Date: Thu, 29 May 2025 10:40:14 -0700 Subject: [PATCH 2/2] 3.sdk --- MIA-schema.json | 394 + buttons.json | 596 + heroku-cli-schema-1.0.25.tgz | Bin 0 -> 128568 bytes lib/cjs/index.d.ts | 3019 ++- .../services/account-delinquency-service.js | 11 +- lib/cjs/services/account-feature-service.js | 33 +- lib/cjs/services/account-service.js | 66 +- lib/cjs/services/add-on-action-service.d.ts | 16 + lib/cjs/services/add-on-action-service.js | 82 +- lib/cjs/services/add-on-attachment-service.js | 88 +- lib/cjs/services/add-on-config-service.js | 22 +- .../add-on-region-capability-service.js | 33 +- lib/cjs/services/add-on-service-service.js | 22 +- lib/cjs/services/add-on-service.js | 110 +- lib/cjs/services/add-on-sso-service.d.ts | 25 + lib/cjs/services/add-on-sso-service.js | 70 + .../add-on-webhook-delivery-service.js | 22 +- .../services/add-on-webhook-event-service.js | 22 +- lib/cjs/services/add-on-webhook-service.js | 55 +- .../allowed-add-on-service-service.js | 33 +- lib/cjs/services/app-feature-service.js | 33 +- lib/cjs/services/app-service.js | 99 +- lib/cjs/services/app-setup-service.js | 22 +- lib/cjs/services/app-transfer-service.js | 55 +- .../services/app-webhook-delivery-service.js | 22 +- lib/cjs/services/app-webhook-event-service.js | 22 +- lib/cjs/services/app-webhook-service.js | 55 +- lib/cjs/services/archive-service.js | 4 +- lib/cjs/services/audit-trail-event-service.js | 2 +- lib/cjs/services/build-metadata-service.d.ts | 17 + lib/cjs/services/build-metadata-service.js | 42 + lib/cjs/services/build-service.d.ts | 2 +- lib/cjs/services/build-service.js | 48 +- .../buildpack-installation-service.js | 22 +- lib/cjs/services/capability-service.d.ts | 20 + lib/cjs/services/capability-service.js | 47 + lib/cjs/services/collaborator-service.js | 44 +- lib/cjs/services/config-var-service.js | 33 +- .../config-vars-settings-service.d.ts | 25 + .../services/config-vars-settings-service.js | 72 + lib/cjs/services/credit-service.js | 33 +- lib/cjs/services/domain-service.js | 55 +- lib/cjs/services/dyno-processes-service.d.ts | 19 + lib/cjs/services/dyno-processes-service.js | 46 + lib/cjs/services/dyno-service.d.ts | 18 + lib/cjs/services/dyno-service.js | 126 +- lib/cjs/services/dyno-size-service.d.ts | 9 +- lib/cjs/services/dyno-size-service.js | 51 +- .../enterprise-account-daily-usage-service.js | 11 +- .../enterprise-account-member-service.js | 44 +- ...nterprise-account-monthly-usage-service.js | 11 +- .../services/enterprise-account-service.js | 33 +- lib/cjs/services/filter-apps-service.js | 11 +- lib/cjs/services/formation-service.js | 44 +- lib/cjs/services/gateway-token-service.d.ts | 26 + lib/cjs/services/gateway-token-service.js | 73 + lib/cjs/services/generation-service.d.ts | 30 + lib/cjs/services/generation-service.js | 95 + .../identity-provider-actions-service.d.ts | 17 + .../identity-provider-actions-service.js | 43 + ...identity-provider-certificate-service.d.ts | 43 + .../identity-provider-certificate-service.js | 134 + .../services/identity-provider-service.d.ts | 34 +- lib/cjs/services/identity-provider-service.js | 85 +- lib/cjs/services/inbound-ruleset-service.js | 44 +- lib/cjs/services/index.d.ts | 20 +- lib/cjs/services/index.js | 20 +- lib/cjs/services/invoice-address-service.js | 22 +- lib/cjs/services/invoice-service.js | 22 +- lib/cjs/services/key-service.js | 22 +- lib/cjs/services/log-drain-service.js | 66 +- lib/cjs/services/log-session-service.js | 11 +- .../services/oauth-authorization-service.d.ts | 8 + .../services/oauth-authorization-service.js | 85 +- lib/cjs/services/oauth-client-service.js | 57 +- lib/cjs/services/oauth-token-service.js | 22 +- lib/cjs/services/oci-image-service.d.ts | 26 + lib/cjs/services/oci-image-service.js | 73 + lib/cjs/services/password-reset-service.js | 22 +- lib/cjs/services/payment-method-service.d.ts | 29 + lib/cjs/services/payment-method-service.js | 96 + lib/cjs/services/payment-service.d.ts | 25 + lib/cjs/services/payment-service.js | 74 + lib/cjs/services/peering-info-service.d.ts | 17 - lib/cjs/services/peering-info-service.js | 35 - lib/cjs/services/peering-service.d.ts | 23 +- lib/cjs/services/peering-service.js | 82 +- lib/cjs/services/permission-entity-service.js | 11 +- lib/cjs/services/pipeline-build-service.d.ts | 4 +- lib/cjs/services/pipeline-build-service.js | 13 +- .../services/pipeline-config-var-service.d.ts | 2 +- .../services/pipeline-config-var-service.js | 24 +- lib/cjs/services/pipeline-coupling-service.js | 99 +- .../services/pipeline-deployment-service.d.ts | 4 +- .../services/pipeline-deployment-service.js | 15 +- .../services/pipeline-promotion-service.js | 22 +- .../pipeline-promotion-target-service.js | 11 +- .../services/pipeline-release-service.d.ts | 2 +- lib/cjs/services/pipeline-release-service.js | 13 +- lib/cjs/services/pipeline-service.js | 55 +- lib/cjs/services/pipeline-stack-service.js | 11 +- lib/cjs/services/pipeline-transfer-service.js | 11 +- lib/cjs/services/plan-service.js | 33 +- lib/cjs/services/rate-limit-service.js | 11 +- lib/cjs/services/region-service.js | 22 +- lib/cjs/services/release-service.js | 44 +- lib/cjs/services/review-app-config-service.js | 44 +- lib/cjs/services/review-app-service.js | 55 +- lib/cjs/services/slug-service.js | 22 +- lib/cjs/services/sms-number-service.js | 33 +- lib/cjs/services/sni-endpoint-service.js | 55 +- lib/cjs/services/source-service.js | 22 +- lib/cjs/services/space-app-access-service.js | 33 +- lib/cjs/services/space-host-service.d.ts | 17 + lib/cjs/services/space-host-service.js | 42 + lib/cjs/services/space-log-drain-service.d.ts | 25 + lib/cjs/services/space-log-drain-service.js | 72 + lib/cjs/services/space-nat-service.js | 11 +- lib/cjs/services/space-service.js | 55 +- lib/cjs/services/space-topology-service.js | 11 +- lib/cjs/services/space-transfer-service.js | 11 +- lib/cjs/services/stack-service.d.ts | 7 + lib/cjs/services/stack-service.js | 49 +- lib/cjs/services/team-add-on-service.js | 11 +- .../services/team-app-collaborator-service.js | 55 +- .../services/team-app-permission-service.js | 11 +- lib/cjs/services/team-app-service.js | 57 +- lib/cjs/services/team-daily-usage-service.js | 11 +- lib/cjs/services/team-delinquency-service.js | 11 +- lib/cjs/services/team-feature-service.js | 22 +- lib/cjs/services/team-invitation-service.js | 55 +- lib/cjs/services/team-invoice-service.js | 22 +- .../team-license-collection-service.d.ts | 17 + .../team-license-collection-service.js | 42 + lib/cjs/services/team-license-service.d.ts | 17 + lib/cjs/services/team-license-service.js | 42 + lib/cjs/services/team-member-service.js | 66 +- .../services/team-monthly-usage-service.js | 11 +- lib/cjs/services/team-preferences-service.js | 22 +- lib/cjs/services/team-service.js | 77 +- lib/cjs/services/team-space-service.js | 11 +- lib/cjs/services/telemetry-drain-service.d.ts | 53 + lib/cjs/services/telemetry-drain-service.js | 183 + .../telemetry-ingress-info-service.d.ts | 17 + .../telemetry-ingress-info-service.js | 42 + lib/cjs/services/test-case-service.js | 11 +- lib/cjs/services/test-node-service.js | 11 +- lib/cjs/services/test-run-service.js | 19 +- lib/cjs/services/usage-service.d.ts | 33 + lib/cjs/services/usage-service.js | 98 + lib/cjs/services/user-preferences-service.js | 22 +- lib/cjs/services/vpn-connection-service.js | 55 +- lib/esm/index.d.ts | 3019 ++- .../services/account-delinquency-service.js | 11 +- lib/esm/services/account-feature-service.js | 33 +- lib/esm/services/account-service.js | 66 +- lib/esm/services/add-on-action-service.d.ts | 16 + lib/esm/services/add-on-action-service.js | 82 +- lib/esm/services/add-on-attachment-service.js | 88 +- lib/esm/services/add-on-config-service.js | 22 +- .../add-on-region-capability-service.js | 33 +- lib/esm/services/add-on-service-service.js | 22 +- lib/esm/services/add-on-service.js | 110 +- lib/esm/services/add-on-sso-service.d.ts | 25 + lib/esm/services/add-on-sso-service.js | 67 + .../add-on-webhook-delivery-service.js | 22 +- .../services/add-on-webhook-event-service.js | 22 +- lib/esm/services/add-on-webhook-service.js | 55 +- .../allowed-add-on-service-service.js | 33 +- lib/esm/services/app-feature-service.js | 33 +- lib/esm/services/app-service.js | 99 +- lib/esm/services/app-setup-service.js | 22 +- lib/esm/services/app-transfer-service.js | 55 +- .../services/app-webhook-delivery-service.js | 22 +- lib/esm/services/app-webhook-event-service.js | 22 +- lib/esm/services/app-webhook-service.js | 55 +- lib/esm/services/archive-service.js | 4 +- lib/esm/services/audit-trail-event-service.js | 2 +- lib/esm/services/build-metadata-service.d.ts | 17 + lib/esm/services/build-metadata-service.js | 39 + lib/esm/services/build-service.d.ts | 2 +- lib/esm/services/build-service.js | 48 +- .../buildpack-installation-service.js | 22 +- lib/esm/services/capability-service.d.ts | 20 + lib/esm/services/capability-service.js | 44 + lib/esm/services/collaborator-service.js | 44 +- lib/esm/services/config-var-service.js | 33 +- .../config-vars-settings-service.d.ts | 25 + .../services/config-vars-settings-service.js | 69 + lib/esm/services/credit-service.js | 33 +- lib/esm/services/domain-service.js | 55 +- lib/esm/services/dyno-processes-service.d.ts | 19 + lib/esm/services/dyno-processes-service.js | 43 + lib/esm/services/dyno-service.d.ts | 18 + lib/esm/services/dyno-service.js | 126 +- lib/esm/services/dyno-size-service.d.ts | 9 +- lib/esm/services/dyno-size-service.js | 51 +- .../enterprise-account-daily-usage-service.js | 11 +- .../enterprise-account-member-service.js | 44 +- ...nterprise-account-monthly-usage-service.js | 11 +- .../services/enterprise-account-service.js | 33 +- lib/esm/services/filter-apps-service.js | 11 +- lib/esm/services/formation-service.js | 44 +- lib/esm/services/gateway-token-service.d.ts | 26 + lib/esm/services/gateway-token-service.js | 70 + lib/esm/services/generation-service.d.ts | 30 + lib/esm/services/generation-service.js | 92 + .../identity-provider-actions-service.d.ts | 17 + .../identity-provider-actions-service.js | 40 + ...identity-provider-certificate-service.d.ts | 43 + .../identity-provider-certificate-service.js | 131 + .../services/identity-provider-service.d.ts | 34 +- lib/esm/services/identity-provider-service.js | 85 +- lib/esm/services/inbound-ruleset-service.js | 44 +- lib/esm/services/index.d.ts | 20 +- lib/esm/services/index.js | 20 +- lib/esm/services/invoice-address-service.js | 22 +- lib/esm/services/invoice-service.js | 22 +- lib/esm/services/key-service.js | 22 +- lib/esm/services/log-drain-service.js | 66 +- lib/esm/services/log-session-service.js | 11 +- .../services/oauth-authorization-service.d.ts | 8 + .../services/oauth-authorization-service.js | 85 +- lib/esm/services/oauth-client-service.js | 57 +- lib/esm/services/oauth-token-service.js | 22 +- lib/esm/services/oci-image-service.d.ts | 26 + lib/esm/services/oci-image-service.js | 70 + lib/esm/services/password-reset-service.js | 22 +- lib/esm/services/payment-method-service.d.ts | 29 + lib/esm/services/payment-method-service.js | 93 + lib/esm/services/payment-service.d.ts | 25 + lib/esm/services/payment-service.js | 71 + lib/esm/services/peering-info-service.d.ts | 17 - lib/esm/services/peering-info-service.js | 32 - lib/esm/services/peering-service.d.ts | 23 +- lib/esm/services/peering-service.js | 82 +- lib/esm/services/permission-entity-service.js | 11 +- lib/esm/services/pipeline-build-service.d.ts | 4 +- lib/esm/services/pipeline-build-service.js | 13 +- .../services/pipeline-config-var-service.d.ts | 2 +- .../services/pipeline-config-var-service.js | 24 +- lib/esm/services/pipeline-coupling-service.js | 99 +- .../services/pipeline-deployment-service.d.ts | 4 +- .../services/pipeline-deployment-service.js | 15 +- .../services/pipeline-promotion-service.js | 22 +- .../pipeline-promotion-target-service.js | 11 +- .../services/pipeline-release-service.d.ts | 2 +- lib/esm/services/pipeline-release-service.js | 13 +- lib/esm/services/pipeline-service.js | 55 +- lib/esm/services/pipeline-stack-service.js | 11 +- lib/esm/services/pipeline-transfer-service.js | 11 +- lib/esm/services/plan-service.js | 33 +- lib/esm/services/rate-limit-service.js | 11 +- lib/esm/services/region-service.js | 22 +- lib/esm/services/release-service.js | 44 +- lib/esm/services/review-app-config-service.js | 44 +- lib/esm/services/review-app-service.js | 55 +- lib/esm/services/slug-service.js | 22 +- lib/esm/services/sms-number-service.js | 33 +- lib/esm/services/sni-endpoint-service.js | 55 +- lib/esm/services/source-service.js | 22 +- lib/esm/services/space-app-access-service.js | 33 +- lib/esm/services/space-host-service.d.ts | 17 + lib/esm/services/space-host-service.js | 39 + lib/esm/services/space-log-drain-service.d.ts | 25 + lib/esm/services/space-log-drain-service.js | 69 + lib/esm/services/space-nat-service.js | 11 +- lib/esm/services/space-service.js | 55 +- lib/esm/services/space-topology-service.js | 11 +- lib/esm/services/space-transfer-service.js | 11 +- lib/esm/services/stack-service.d.ts | 7 + lib/esm/services/stack-service.js | 49 +- lib/esm/services/team-add-on-service.js | 11 +- .../services/team-app-collaborator-service.js | 55 +- .../services/team-app-permission-service.js | 11 +- lib/esm/services/team-app-service.js | 57 +- lib/esm/services/team-daily-usage-service.js | 11 +- lib/esm/services/team-delinquency-service.js | 11 +- lib/esm/services/team-feature-service.js | 22 +- lib/esm/services/team-invitation-service.js | 55 +- lib/esm/services/team-invoice-service.js | 22 +- .../team-license-collection-service.d.ts | 17 + .../team-license-collection-service.js | 39 + lib/esm/services/team-license-service.d.ts | 17 + lib/esm/services/team-license-service.js | 39 + lib/esm/services/team-member-service.js | 66 +- .../services/team-monthly-usage-service.js | 11 +- lib/esm/services/team-preferences-service.js | 22 +- lib/esm/services/team-service.js | 77 +- lib/esm/services/team-space-service.js | 11 +- lib/esm/services/telemetry-drain-service.d.ts | 53 + lib/esm/services/telemetry-drain-service.js | 180 + .../telemetry-ingress-info-service.d.ts | 17 + .../telemetry-ingress-info-service.js | 39 + lib/esm/services/test-case-service.js | 11 +- lib/esm/services/test-node-service.js | 11 +- lib/esm/services/test-run-service.js | 19 +- lib/esm/services/usage-service.d.ts | 33 + lib/esm/services/usage-service.js | 95 + lib/esm/services/user-preferences-service.js | 22 +- lib/esm/services/vpn-connection-service.js | 55 +- package.json | 42 +- schema-builder.mjs | 60 +- schema.json | 17880 ++++++++++------ scripts/package.json | 3 + src/index.ts | 2641 ++- src/services/account-delinquency-service.ts | 10 +- src/services/account-feature-service.ts | 30 +- src/services/account-service.ts | 60 +- src/services/add-on-action-service.ts | 86 +- src/services/add-on-attachment-service.ts | 80 +- src/services/add-on-config-service.ts | 20 +- .../add-on-region-capability-service.ts | 30 +- src/services/add-on-service-service.ts | 20 +- src/services/add-on-service.ts | 100 +- src/services/add-on-sso-service.ts | 74 + .../add-on-webhook-delivery-service.ts | 20 +- src/services/add-on-webhook-event-service.ts | 20 +- src/services/add-on-webhook-service.ts | 50 +- .../allowed-add-on-service-service.ts | 30 +- src/services/app-feature-service.ts | 30 +- src/services/app-service.ts | 90 +- src/services/app-setup-service.ts | 20 +- src/services/app-transfer-service.ts | 50 +- src/services/app-webhook-delivery-service.ts | 20 +- src/services/app-webhook-event-service.ts | 20 +- src/services/app-webhook-service.ts | 50 +- src/services/archive-service.ts | 4 +- src/services/audit-trail-event-service.ts | 2 +- src/services/build-metadata-service.ts | 42 + src/services/build-service.ts | 44 +- .../buildpack-installation-service.ts | 20 +- src/services/capability-service.ts | 46 + src/services/collaborator-service.ts | 40 +- src/services/config-var-service.ts | 30 +- src/services/config-vars-settings-service.ts | 75 + src/services/credit-service.ts | 30 +- src/services/domain-service.ts | 50 +- src/services/dyno-processes-service.ts | 47 + src/services/dyno-service.ts | 131 +- src/services/dyno-size-service.ts | 52 +- .../enterprise-account-daily-usage-service.ts | 10 +- .../enterprise-account-member-service.ts | 40 +- ...nterprise-account-monthly-usage-service.ts | 10 +- src/services/enterprise-account-service.ts | 30 +- src/services/filter-apps-service.ts | 10 +- src/services/formation-service.ts | 40 +- src/services/gateway-token-service.ts | 70 + src/services/generation-service.ts | 98 + .../identity-provider-actions-service.ts | 43 + .../identity-provider-certificate-service.ts | 158 + src/services/identity-provider-service.ts | 121 +- src/services/inbound-ruleset-service.ts | 40 +- src/services/index.ts | 20 +- src/services/invoice-address-service.ts | 20 +- src/services/invoice-service.ts | 20 +- src/services/key-service.ts | 20 +- src/services/log-drain-service.ts | 60 +- src/services/log-session-service.ts | 10 +- src/services/oauth-authorization-service.ts | 83 +- src/services/oauth-client-service.ts | 52 +- src/services/oauth-token-service.ts | 20 +- src/services/oci-image-service.ts | 77 + src/services/password-reset-service.ts | 20 +- src/services/payment-method-service.ts | 95 + src/services/payment-service.ts | 76 + src/services/peering-info-service.ts | 36 - src/services/peering-service.ts | 101 +- src/services/permission-entity-service.ts | 10 +- src/services/pipeline-build-service.ts | 16 +- src/services/pipeline-config-var-service.ts | 22 +- src/services/pipeline-coupling-service.ts | 90 +- src/services/pipeline-deployment-service.ts | 14 +- src/services/pipeline-promotion-service.ts | 20 +- .../pipeline-promotion-target-service.ts | 10 +- src/services/pipeline-release-service.ts | 12 +- src/services/pipeline-service.ts | 50 +- src/services/pipeline-stack-service.ts | 10 +- src/services/pipeline-transfer-service.ts | 10 +- src/services/plan-service.ts | 30 +- src/services/rate-limit-service.ts | 10 +- src/services/region-service.ts | 20 +- src/services/release-service.ts | 40 +- src/services/review-app-config-service.ts | 40 +- src/services/review-app-service.ts | 50 +- src/services/slug-service.ts | 20 +- src/services/sms-number-service.ts | 30 +- src/services/sni-endpoint-service.ts | 50 +- src/services/source-service.ts | 20 +- src/services/space-app-access-service.ts | 30 +- src/services/space-host-service.ts | 42 + src/services/space-log-drain-service.ts | 75 + src/services/space-nat-service.ts | 10 +- src/services/space-service.ts | 50 +- src/services/space-topology-service.ts | 10 +- src/services/space-transfer-service.ts | 10 +- src/services/stack-service.ts | 50 +- src/services/team-add-on-service.ts | 10 +- src/services/team-app-collaborator-service.ts | 50 +- src/services/team-app-permission-service.ts | 10 +- src/services/team-app-service.ts | 52 +- src/services/team-daily-usage-service.ts | 10 +- src/services/team-delinquency-service.ts | 10 +- src/services/team-feature-service.ts | 20 +- src/services/team-invitation-service.ts | 50 +- src/services/team-invoice-service.ts | 20 +- .../team-license-collection-service.ts | 42 + src/services/team-license-service.ts | 42 + src/services/team-member-service.ts | 60 +- src/services/team-monthly-usage-service.ts | 10 +- src/services/team-preferences-service.ts | 20 +- src/services/team-service.ts | 70 +- src/services/team-space-service.ts | 10 +- src/services/telemetry-drain-service.ts | 197 + .../telemetry-ingress-info-service.ts | 45 + src/services/test-case-service.ts | 10 +- src/services/test-node-service.ts | 10 +- src/services/test-run-service.ts | 18 +- src/services/usage-service.ts | 105 + src/services/user-preferences-service.ts | 20 +- src/services/vpn-connection-service.ts | 50 +- 421 files changed, 32902 insertions(+), 10313 deletions(-) create mode 100644 MIA-schema.json create mode 100644 buttons.json create mode 100644 heroku-cli-schema-1.0.25.tgz create mode 100644 lib/cjs/services/add-on-sso-service.d.ts create mode 100644 lib/cjs/services/add-on-sso-service.js create mode 100644 lib/cjs/services/build-metadata-service.d.ts create mode 100644 lib/cjs/services/build-metadata-service.js create mode 100644 lib/cjs/services/capability-service.d.ts create mode 100644 lib/cjs/services/capability-service.js create mode 100644 lib/cjs/services/config-vars-settings-service.d.ts create mode 100644 lib/cjs/services/config-vars-settings-service.js create mode 100644 lib/cjs/services/dyno-processes-service.d.ts create mode 100644 lib/cjs/services/dyno-processes-service.js create mode 100644 lib/cjs/services/gateway-token-service.d.ts create mode 100644 lib/cjs/services/gateway-token-service.js create mode 100644 lib/cjs/services/generation-service.d.ts create mode 100644 lib/cjs/services/generation-service.js create mode 100644 lib/cjs/services/identity-provider-actions-service.d.ts create mode 100644 lib/cjs/services/identity-provider-actions-service.js create mode 100644 lib/cjs/services/identity-provider-certificate-service.d.ts create mode 100644 lib/cjs/services/identity-provider-certificate-service.js create mode 100644 lib/cjs/services/oci-image-service.d.ts create mode 100644 lib/cjs/services/oci-image-service.js create mode 100644 lib/cjs/services/payment-method-service.d.ts create mode 100644 lib/cjs/services/payment-method-service.js create mode 100644 lib/cjs/services/payment-service.d.ts create mode 100644 lib/cjs/services/payment-service.js delete mode 100644 lib/cjs/services/peering-info-service.d.ts delete mode 100644 lib/cjs/services/peering-info-service.js create mode 100644 lib/cjs/services/space-host-service.d.ts create mode 100644 lib/cjs/services/space-host-service.js create mode 100644 lib/cjs/services/space-log-drain-service.d.ts create mode 100644 lib/cjs/services/space-log-drain-service.js create mode 100644 lib/cjs/services/team-license-collection-service.d.ts create mode 100644 lib/cjs/services/team-license-collection-service.js create mode 100644 lib/cjs/services/team-license-service.d.ts create mode 100644 lib/cjs/services/team-license-service.js create mode 100644 lib/cjs/services/telemetry-drain-service.d.ts create mode 100644 lib/cjs/services/telemetry-drain-service.js create mode 100644 lib/cjs/services/telemetry-ingress-info-service.d.ts create mode 100644 lib/cjs/services/telemetry-ingress-info-service.js create mode 100644 lib/cjs/services/usage-service.d.ts create mode 100644 lib/cjs/services/usage-service.js create mode 100644 lib/esm/services/add-on-sso-service.d.ts create mode 100644 lib/esm/services/add-on-sso-service.js create mode 100644 lib/esm/services/build-metadata-service.d.ts create mode 100644 lib/esm/services/build-metadata-service.js create mode 100644 lib/esm/services/capability-service.d.ts create mode 100644 lib/esm/services/capability-service.js create mode 100644 lib/esm/services/config-vars-settings-service.d.ts create mode 100644 lib/esm/services/config-vars-settings-service.js create mode 100644 lib/esm/services/dyno-processes-service.d.ts create mode 100644 lib/esm/services/dyno-processes-service.js create mode 100644 lib/esm/services/gateway-token-service.d.ts create mode 100644 lib/esm/services/gateway-token-service.js create mode 100644 lib/esm/services/generation-service.d.ts create mode 100644 lib/esm/services/generation-service.js create mode 100644 lib/esm/services/identity-provider-actions-service.d.ts create mode 100644 lib/esm/services/identity-provider-actions-service.js create mode 100644 lib/esm/services/identity-provider-certificate-service.d.ts create mode 100644 lib/esm/services/identity-provider-certificate-service.js create mode 100644 lib/esm/services/oci-image-service.d.ts create mode 100644 lib/esm/services/oci-image-service.js create mode 100644 lib/esm/services/payment-method-service.d.ts create mode 100644 lib/esm/services/payment-method-service.js create mode 100644 lib/esm/services/payment-service.d.ts create mode 100644 lib/esm/services/payment-service.js delete mode 100644 lib/esm/services/peering-info-service.d.ts delete mode 100644 lib/esm/services/peering-info-service.js create mode 100644 lib/esm/services/space-host-service.d.ts create mode 100644 lib/esm/services/space-host-service.js create mode 100644 lib/esm/services/space-log-drain-service.d.ts create mode 100644 lib/esm/services/space-log-drain-service.js create mode 100644 lib/esm/services/team-license-collection-service.d.ts create mode 100644 lib/esm/services/team-license-collection-service.js create mode 100644 lib/esm/services/team-license-service.d.ts create mode 100644 lib/esm/services/team-license-service.js create mode 100644 lib/esm/services/telemetry-drain-service.d.ts create mode 100644 lib/esm/services/telemetry-drain-service.js create mode 100644 lib/esm/services/telemetry-ingress-info-service.d.ts create mode 100644 lib/esm/services/telemetry-ingress-info-service.js create mode 100644 lib/esm/services/usage-service.d.ts create mode 100644 lib/esm/services/usage-service.js create mode 100644 scripts/package.json create mode 100644 src/services/add-on-sso-service.ts create mode 100644 src/services/build-metadata-service.ts create mode 100644 src/services/capability-service.ts create mode 100644 src/services/config-vars-settings-service.ts create mode 100644 src/services/dyno-processes-service.ts create mode 100644 src/services/gateway-token-service.ts create mode 100644 src/services/generation-service.ts create mode 100644 src/services/identity-provider-actions-service.ts create mode 100644 src/services/identity-provider-certificate-service.ts create mode 100644 src/services/oci-image-service.ts create mode 100644 src/services/payment-method-service.ts create mode 100644 src/services/payment-service.ts delete mode 100644 src/services/peering-info-service.ts create mode 100644 src/services/space-host-service.ts create mode 100644 src/services/space-log-drain-service.ts create mode 100644 src/services/team-license-collection-service.ts create mode 100644 src/services/team-license-service.ts create mode 100644 src/services/telemetry-drain-service.ts create mode 100644 src/services/telemetry-ingress-info-service.ts create mode 100644 src/services/usage-service.ts diff --git a/MIA-schema.json b/MIA-schema.json new file mode 100644 index 0000000..714bfbb --- /dev/null +++ b/MIA-schema.json @@ -0,0 +1,394 @@ +{ + "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "title": "Heroku Managed Inference and Agent API", + "description": "API endpoints for generating conversational completions and vector embeddings using the Heroku Managed Inference and Agent add-on.", + "definitions": { + "chat_completions": { + "links": [ + { + "rel": "chat_completions", + "href": "/v1/chat/completions", + "method": "POST", + "title": "Generate conversational completions", + "schema": { + "$ref": "#/definitions/chat_completions" + } + } + ], + "type": "object", + "properties": { + "model": { + "type": "string", + "description": "The model used for completion. Typically, you'll use your INFERENCE_MODEL_ID config variable for this value.", + "examples": [ + "claude-3-5-sonnet" + ] + }, + "messages": { + "type": "array", + "description": "An array of message objects representing the conversation history.", + "items": { + "type": "object", + "properties": { + "role": { + "type": "string", + "enum": [ + "user", + "assistant", + "system", + "tool" + ], + "description": "The role of the message sender." + }, + "content": { + "type": [ + "string", + "array" + ], + "description": "The content of the message." + }, + "refusal": { + "type": [ + "string", + "null" + ], + "description": "A refusal message by the assistant." + }, + "tool_calls": { + "type": "array", + "description": "Tool calls generated by the model.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the tool call." + }, + "type": { + "type": "string", + "enum": [ + "function", + "heroku_tool" + ], + "description": "The type of tool call." + }, + "function": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the function to be called." + }, + "arguments": { + "type": "string", + "description": "The arguments for the function call." + } + }, + "required": [ + "name", + "arguments" + ] + } + }, + "required": [ + "id", + "type", + "function" + ] + } + }, + "tool_call_id": { + "type": "string", + "description": "The ID of the tool call that this message is responding to." + } + }, + "required": [ + "role", + "content" + ] + } + }, + "max_tokens": { + "type": "integer", + "description": "The maximum number of tokens the model is allowed to generate before stopping.", + "maximum": 4096, + "default": 4096, + "examples": [ + 100 + ] + }, + "stop": { + "type": "array", + "description": "A list of strings where the model will stop generating further tokens once any of the strings is encountered in the response.", + "items": { + "type": "string" + }, + "examples": [ + [ + "foo" + ] + ] + }, + "stream": { + "type": "boolean", + "description": "Whether to stream responses incrementally via server-sent events.", + "default": false, + "examples": [ + true + ] + }, + "system": { + "type": "string", + "description": "An optional system prompt used to provide additional context or set behavior for the model.", + "examples": [ + "Be concise and avoid waffling." + ] + }, + "temperature": { + "type": "number", + "description": "Controls the randomness of the response. Values closer to 0 make the response more focused, while values closer to 1.0 encourage more diverse responses.", + "minimum": 0.0, + "maximum": 1.0, + "default": 1.0, + "examples": [ + 0.2 + ] + }, + "tool_choice": { + "type": [ + "string", + "object" + ], + "description": "Specifies how the model should use the provided tools.", + "oneOf": [ + { + "type": "string", + "enum": [ + "none", + "auto", + "required" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "function", + "heroku_tool" + ] + }, + "function": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the function to be called." + } + }, + "required": [ + "name" + ] + } + }, + "required": [ + "type", + "function" + ] + } + ], + "default": { + "type": "auto", + "disable_parallel_tool_use": false + }, + "examples": [ + { + "type": "any" + } + ] + }, + "tools": { + "type": "array", + "description": "The tools that the model may call.", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "function", + "heroku_tool" + ] + }, + "function": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the function to be called." + }, + "description": { + "type": "string", + "description": "A description of what the function does." + }, + "parameters": { + "type": "object", + "description": "The parameters the function accepts, described as a JSON Schema object." + } + }, + "required": [ + "name", + "description", + "parameters" + ] + } + }, + "required": [ + "type", + "function" + ] + }, + "examples": [ + [ + { + "type": "function", + "function": { + "name": "get_current_weather", + "description": "Get the current weather in a given location", + "parameters": { + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "The city and state, e.g. Portland, OR" + } + }, + "required": [ + "location" + ] + } + } + } + ] + ] + }, + "top_p": { + "type": "number", + "description": "Specifies the proportion of tokens to consider when generating the next token, in terms of cumulative probability.", + "minimum": 0.0, + "maximum": 1.0, + "default": 0.999, + "examples": [ + 0.95 + ] + } + }, + "required": [ + "model", + "messages" + ] + }, + "embeddings": { + "links": [ + { + "rel": "embeddings", + "href": "/v1/embeddings", + "method": "POST", + "title": "Generate vector embeddings", + "schema": { + "$ref": "#/definitions/embeddings" + } + } + ], + "type": "object", + "properties": { + "model": { + "type": "string", + "description": "ID of the embedding model to use.", + "examples": [ + "cohere-embed-multilingual" + ] + }, + "input": { + "type": "array", + "description": "An array of strings (up to 96) for the model to embed. Recommended length is less than 512 tokens per string.", + "items": { + "type": "string" + }, + "examples": [ + [ + "example string 1", + "example string 2" + ] + ] + }, + "input_type": { + "type": "string", + "description": "Specifies the type of input passed to the model. Prepends special tokens to the input.", + "enum": [ + "search_document", + "search_query", + "classification", + "clustering" + ], + "default": "search_document", + "examples": [ + "search_query" + ] + }, + "encoding_format": { + "type": "string", + "description": "Determines the encoding format of the output.", + "enum": [ + "raw", + "base64" + ], + "default": "raw", + "examples": [ + "base64" + ] + }, + "embedding_type": { + "type": "string", + "description": "Specifies the type(s) of embeddings to return.", + "enum": [ + "float", + "int8", + "uint8", + "binary", + "ubinary" + ], + "default": "float", + "examples": [ + "int8" + ] + } + }, + "required": [ + "model", + "input" + ] + } + }, + "links": [ + { + "rel": "chat_completions", + "href": "/v1/chat/completions", + "method": "POST", + "title": "Generate conversational completions", + "schema": { + "$ref": "#/definitions/chat_completions" + } + }, + { + "rel": "embeddings", + "href": "/v1/embeddings", + "method": "POST", + "title": "Generate vector embeddings", + "schema": { + "$ref": "#/definitions/embeddings" + } + } + ] +} diff --git a/buttons.json b/buttons.json new file mode 100644 index 0000000..9d6bf13 --- /dev/null +++ b/buttons.json @@ -0,0 +1,596 @@ +[ + { + "id": "51666ec9-5d05-4970-8b6e-67469c857b8c", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/nightscout/cgm-remote-monitor/tree/master", + "public_description": "", + "public_name": "CGM Remote Monitor", + "public_repository": "https://github.com/nightscout/cgm-remote-monitor", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/7661012?v=3", + "public_username": "nightscout", + "public_logo": null, + "recent_deploys": 1882, + "repo_name": "cgm-remote-monitor", + "logo": { + "icon_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg", + "icon_retina_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg" + }, + "forks": 71819, + "stars": 2432, + "subscribers": 287, + "created_at": "2014-09-15T16:53:09.167Z", + "updated_at": "2024-12-05T12:11:22.500Z", + "language": "JavaScript" + }, + { + "id": "c19c53d9-1682-4afd-9c40-e8580d82e6e0", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/juice-shop/juice-shop/tree/master", + "public_description": "Probably the most modern and sophisticated insecure web application", + "public_name": "OWASP Juice Shop", + "public_repository": "https://github.com/juice-shop/juice-shop", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/83415759?v=4", + "public_username": "juice-shop", + "public_logo": "https://raw.githubusercontent.com/juice-shop/juice-shop/master/frontend/src/assets/public/images/JuiceShop_Logo.png", + "recent_deploys": 1292, + "repo_name": "juice-shop", + "logo": { + "icon_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/140491/icon.png?1733400662", + "icon_retina_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/140491/icon_retina.png?1733400662" + }, + "forks": 11167, + "stars": 10544, + "subscribers": 161, + "created_at": "2021-09-20T16:14:58.050Z", + "updated_at": "2024-12-05T12:11:03.542Z", + "language": "TypeScript" + }, + { + "id": "b6505f2b-4b89-4308-a770-c102f31727e6", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/nocodb/nocodb-seed-heroku/tree/main", + "public_description": "Create APIs at the speed of thoughts", + "public_name": "nocodb", + "public_repository": "https://github.com/nocodb/nocodb-seed-heroku", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/50206778?v=4", + "public_username": "nocodb", + "public_logo": "https://nocodb.com/brand/favicon-64.png", + "recent_deploys": 924, + "repo_name": "nocodb-seed-heroku", + "logo": { + "icon_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/137273/icon.png?1697037052", + "icon_retina_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/137273/icon_retina.png?1697037052" + }, + "forks": 124, + "stars": 15, + "subscribers": 5, + "created_at": "2021-09-10T14:12:34.487Z", + "updated_at": "2024-12-05T12:11:02.150Z", + "language": "Dockerfile" + }, + { + "id": "e79fee58-2ecd-4e97-8e56-ce3728539586", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/hasura/graphql-engine-heroku/tree/master", + "public_description": "Blazing fast, instant realtime GraphQL APIs on Postgres with fine grained access control and webhook triggers for async b", + "public_name": "Hasura GraphQL Engine", + "public_repository": "https://github.com/hasura/graphql-engine-heroku", + "public_user_avatar_url": "https://avatars0.githubusercontent.com/u/13966722?v=4", + "public_username": "hasura", + "public_logo": "https://storage.googleapis.com/hasura-graphql-engine/console/assets/favicon.png", + "recent_deploys": 376, + "repo_name": "graphql-engine-heroku", + "logo": { + "icon_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/29542/icon.png?1724346652", + "icon_retina_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/29542/icon_retina.png?1724346652" + }, + "forks": 234, + "stars": 231, + "subscribers": 29, + "created_at": "2018-06-21T08:24:59.162Z", + "updated_at": "2024-12-05T12:11:08.060Z", + "language": "Dockerfile" + }, + { + "id": "4aa75dc8-5a4b-4860-a456-cc3ed0049386", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/heroku/node-js-getting-started/tree/main", + "public_description": "A barebones Node.js app using Express 4", + "public_name": "Start on Heroku: Node.js", + "public_repository": "https://github.com/heroku/node-js-getting-started", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/23211?v=3", + "public_username": "heroku", + "public_logo": "https://cdn.rawgit.com/heroku/node-js-getting-started/main/public/node.svg", + "recent_deploys": 263, + "repo_name": "node-js-getting-started", + "logo": { + "icon_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/2550/icon.png?1476395955", + "icon_retina_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/2550/icon_retina.png?1476395955" + }, + "forks": 3751, + "stars": 1077, + "subscribers": 112, + "created_at": "2015-05-14T01:54:26.634Z", + "updated_at": "2024-12-05T12:11:08.499Z", + "language": "EJS" + }, + { + "id": "87b9eb24-b6a5-46ab-97bd-fa50ab912a4d", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/calcom/cal.com/tree/main", + "public_description": "Open Source Scheduling", + "public_name": "Cal.com", + "public_repository": "https://github.com/calcom/cal.com", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/79145102?v=4", + "public_username": "calcom", + "public_logo": "https://cal.com/android-chrome-512x512.png", + "recent_deploys": 172, + "repo_name": "cal.com", + "logo": { + "icon_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/201272/icon.png?1724346650", + "icon_retina_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/201272/icon_retina.png?1724346650" + }, + "forks": 7362, + "stars": 30672, + "subscribers": 158, + "created_at": "2022-02-01T13:13:05.424Z", + "updated_at": "2024-12-05T12:10:59.435Z", + "language": "TypeScript" + }, + { + "id": "766a0ef4-54b7-4c07-b12b-4e95b732431e", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/timoschlueter/nightscout-librelink-up/tree/main", + "public_description": "Uploads your Blood Glucose from LibreLinkUp to your Nightscout", + "public_name": "Nightscout LibreLinkUp Uploader", + "public_repository": "https://github.com/timoschlueter/nightscout-librelink-up", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/3465220?v=4", + "public_username": "timoschlueter", + "public_logo": "", + "recent_deploys": 137, + "repo_name": "nightscout-librelink-up", + "logo": { + "icon_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg", + "icon_retina_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg" + }, + "forks": 259, + "stars": 210, + "subscribers": 19, + "created_at": "2022-01-21T00:10:41.649Z", + "updated_at": "2024-12-05T12:11:11.057Z", + "language": "TypeScript" + }, + { + "id": "8daa42d6-c863-4bdc-8b06-dc44099df2a7", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/strapi/strapi-heroku-template/tree/master", + "public_description": "Strapi Heroku 1 click deploy button", + "public_name": "Strapi", + "public_repository": "https://github.com/strapi/strapi-heroku-template", + "public_user_avatar_url": "https://avatars2.githubusercontent.com/u/19872173?v=4", + "public_username": "strapi", + "public_logo": "", + "recent_deploys": 117, + "repo_name": "strapi-heroku-template", + "logo": { + "icon_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg", + "icon_retina_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg" + }, + "forks": 122, + "stars": 95, + "subscribers": 10, + "created_at": "2020-07-08T17:03:08.405Z", + "updated_at": "2024-12-05T12:11:15.897Z", + "language": "JavaScript" + }, + { + "id": "17e1cfdf-8b71-4a10-bf6e-0f11555fa400", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/doccano/doccano/tree/master", + "public_description": "Open source text annotation tool for machine learning practitioner.", + "public_name": "doccano", + "public_repository": "https://github.com/doccano/doccano", + "public_user_avatar_url": "https://avatars1.githubusercontent.com/u/58067660?v=4", + "public_username": "doccano", + "public_logo": "https://github.com/doccano/doccano/wiki/images/doccano.png", + "recent_deploys": 117, + "repo_name": "doccano", + "logo": { + "icon_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/59510/icon.png?1733400670", + "icon_retina_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/59510/icon_retina.png?1733400670" + }, + "forks": 1730, + "stars": 9621, + "subscribers": 134, + "created_at": "2019-12-03T21:04:26.165Z", + "updated_at": "2024-12-05T12:11:11.495Z", + "language": "Python" + }, + { + "id": "fc4d0f42-47c3-44f9-a578-a5a54c676375", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/appsmithorg/appsmith/tree/release", + "public_description": "Appsmith is an open-source platform to build and deploy internal tools or admin panels.", + "public_name": "Appsmith", + "public_repository": "https://github.com/appsmithorg/appsmith", + "public_user_avatar_url": "https://avatars3.githubusercontent.com/u/67620218?v=4", + "public_username": "appsmithorg", + "public_logo": "https://raw.githubusercontent.com/appsmithorg/appsmith/master/static/logo.png", + "recent_deploys": 94, + "repo_name": "appsmith", + "logo": { + "icon_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/84867/icon.png?1733400673", + "icon_retina_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/84867/icon_retina.png?1733400673" + }, + "forks": 3768, + "stars": 34801, + "subscribers": 288, + "created_at": "2020-12-01T05:03:11.191Z", + "updated_at": "2024-12-05T12:11:14.730Z", + "language": "TypeScript" + }, + { + "id": "ef852fcb-001a-4e23-b0e2-31500a9cb56a", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/stripe/example-terminal-backend/tree/master", + "public_description": "For testing the Stripe Terminal SDK example apps. https://stripe.com/docs/terminal", + "public_name": "Example Terminal Backend", + "public_repository": "https://github.com/stripe/example-terminal-backend", + "public_user_avatar_url": "https://avatars1.githubusercontent.com/u/856813?v=4", + "public_username": "stripe", + "public_logo": "", + "recent_deploys": 90, + "repo_name": "example-terminal-backend", + "logo": { + "icon_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg", + "icon_retina_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg" + }, + "forks": 122, + "stars": 89, + "subscribers": 15, + "created_at": "2018-11-18T14:35:26.902Z", + "updated_at": "2024-12-05T12:11:12.044Z", + "language": "Ruby" + }, + { + "id": "ad810d4d-130e-41b4-b848-c54f59ce4626", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/heroku/webhooks-demo/tree/master", + "public_description": "Explore Heroku Webhooks", + "public_name": "Heroku Webhooks Demo", + "public_repository": "https://github.com/heroku/webhooks-demo", + "public_user_avatar_url": "https://avatars0.githubusercontent.com/u/23211?v=3", + "public_username": "heroku", + "public_logo": "https://raw.githubusercontent.com/heroku/webhooks-demo/master/app/assets/images/heroku_webhooks.png", + "recent_deploys": 84, + "repo_name": "webhooks-demo", + "logo": { + "icon_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/17137/icon.png?1733400659", + "icon_retina_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/17137/icon_retina.png?1733400659" + }, + "forks": 25, + "stars": 18, + "subscribers": 86, + "created_at": "2017-06-29T21:24:58.449Z", + "updated_at": "2024-12-05T12:10:59.220Z", + "language": "Ruby" + }, + { + "id": "d39a6bf6-042d-4bce-ad73-2b39f41b21c7", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/heroku/python-getting-started/tree/main", + "public_description": "A barebones Python app, which can easily be deployed to Heroku.", + "public_name": "Start on Heroku: Python", + "public_repository": "https://github.com/heroku/python-getting-started", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/23211?v=3", + "public_username": "heroku", + "public_logo": "https://photos-1.dropbox.com/t/2/AABCmL8w0GvyYBEjfGa49LRXCNIVv7jQ2yg_0J5qnv93HQ/12/1636974/png/32x32/1/1446253200/0/2/heroku-logo-stroke-purple.png/EN6UqwEYpKq3MyAHKAc/j4JHowjJ5xrFapcyO-1V_jJ_lR_4spjZEfBvaPPArTs?size_mode=2&size=1280x960", + "recent_deploys": 73, + "repo_name": "python-getting-started", + "logo": { + "icon_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg", + "icon_retina_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg" + }, + "forks": 1788, + "stars": 843, + "subscribers": 107, + "created_at": "2015-12-03T19:20:55.737Z", + "updated_at": "2024-12-05T12:11:22.289Z", + "language": "Python" + }, + { + "id": "dd4c222e-68a0-4e9d-bbd0-209f4ab1425b", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/heroku/php-getting-started/tree/main", + "public_description": "A barebones PHP app that makes use of the Slim web framework", + "public_name": "Start on Heroku: PHP", + "public_repository": "https://github.com/heroku/php-getting-started", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/23211?v=3", + "public_username": "heroku", + "public_logo": "", + "recent_deploys": 35, + "repo_name": "php-getting-started", + "logo": { + "icon_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg", + "icon_retina_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg" + }, + "forks": 778, + "stars": 194, + "subscribers": 92, + "created_at": "2016-04-26T20:24:21.612Z", + "updated_at": "2024-12-05T12:11:21.063Z", + "language": "Twig" + }, + { + "id": "24dcf2a1-d8ce-4fc3-8366-d803e6e31e95", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/trailheadapps/ecars/tree/main", + "public_description": "eCars - Salesforce Platform application demo", + "public_name": "eCars Sample App", + "public_repository": "https://github.com/trailheadapps/ecars", + "public_user_avatar_url": "https://avatars2.githubusercontent.com/u/29558898?v=4", + "public_username": "trailheadapps", + "public_logo": "https://avatars0.githubusercontent.com/u/29558898?s=200&v=4", + "recent_deploys": 23, + "repo_name": "ecars", + "logo": { + "icon_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/82078/icon.png?1733400657", + "icon_retina_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/82078/icon_retina.png?1733400657" + }, + "forks": 131, + "stars": 181, + "subscribers": 12, + "created_at": "2020-10-21T11:01:55.729Z", + "updated_at": "2024-12-05T12:10:58.926Z", + "language": "JavaScript" + }, + { + "id": "ade2e73f-2948-449d-b961-821851dcf548", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/dzuelke/wordpress-12factor/tree/master", + "public_description": "WordPress, fully managed using Composer and configured using environment variables.", + "public_name": "Twelve-Factor WordPress", + "public_repository": "https://github.com/dzuelke/wordpress-12factor", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/27900?v=3", + "public_username": "dzuelke", + "public_logo": "https://s.w.org/about/images/logos/wordpress-logo-notext-rgb.png", + "recent_deploys": 21, + "repo_name": "wordpress-12factor", + "logo": { + "icon_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/5330/icon.png?1733400680", + "icon_retina_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/5330/icon_retina.png?1733400680" + }, + "forks": 102, + "stars": 272, + "subscribers": 10, + "created_at": "2016-02-03T17:21:51.943Z", + "updated_at": "2024-12-05T12:11:20.787Z", + "language": "PHP" + }, + { + "id": "1fba8062-c1ee-4099-b247-8c2e365c663b", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/okta/samples-js-react/tree/master", + "public_description": "Sample applications that demonstrate various Okta use-cases in your React application.", + "public_name": "React Sample Applications for O", + "public_repository": "https://github.com/okta/samples-js-react", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/362460?v=4", + "public_username": "okta", + "public_logo": "", + "recent_deploys": 20, + "repo_name": "samples-js-react", + "logo": { + "icon_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg", + "icon_retina_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg" + }, + "forks": 259, + "stars": 175, + "subscribers": 151, + "created_at": "2021-09-14T20:09:43.151Z", + "updated_at": "2024-12-05T12:11:17.800Z", + "language": "JavaScript" + }, + { + "id": "9c8de521-40b2-4eb4-84c1-db405cec74a8", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/heroku/java-getting-started/tree/main", + "public_description": "A barebones Java app, which can easily be deployed to Heroku.", + "public_name": "Start on Heroku: Java", + "public_repository": "https://github.com/heroku/java-getting-started", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/23211?v=3", + "public_username": "heroku", + "public_logo": "", + "recent_deploys": 10, + "repo_name": "java-getting-started", + "logo": { + "icon_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg", + "icon_retina_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg" + }, + "forks": 1361, + "stars": 253, + "subscribers": 112, + "created_at": "2016-02-16T16:22:27.359Z", + "updated_at": "2024-12-05T12:11:17.827Z", + "language": "HTML" + }, + { + "id": "d70bb7c5-8cf3-4e93-97db-b6618a0ac585", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/stripe/stripe-payments-demo/tree/master", + "public_description": "Sample store accepting universal payments on the web with Stripe Elements, Payment Request, Apple Pay, Google Pay, and th", + "public_name": "Stripe Payments Demo", + "public_repository": "https://github.com/stripe/stripe-payments-demo", + "public_user_avatar_url": "https://avatars1.githubusercontent.com/u/856813?v=4", + "public_username": "stripe", + "public_logo": "https://stripe-payments-demo.appspot.com/images/logo.png", + "recent_deploys": 9, + "repo_name": "stripe-payments-demo", + "logo": { + "icon_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/24240/icon.png?1724346653", + "icon_retina_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/24240/icon_retina.png?1724346653" + }, + "forks": 550, + "stars": 1468, + "subscribers": 45, + "created_at": "2018-02-07T15:24:50.962Z", + "updated_at": "2024-12-05T12:11:06.643Z", + "language": "JavaScript" + }, + { + "id": "7c563f05-1d5d-4f3b-8eb9-9164b6a6e096", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/sendgrid/eventkit-rails/tree/master", + "public_description": "An open source project for consuming notifications from SendGrid's Event Webhook.", + "public_name": "EventKit Rails", + "public_repository": "https://github.com/sendgrid/eventkit-rails", + "public_user_avatar_url": "https://www.gravatar.com/avatar/5cfbf6c16fcc17002c7226ef99c4d643", + "public_username": "sendgrid", + "public_logo": "https://sendgrid.com/brand/sg-logo-300.png", + "recent_deploys": 5, + "repo_name": "eventkit-rails", + "logo": { + "icon_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/278/icon.png?1700068237", + "icon_retina_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/278/icon_retina.png?1700068237" + }, + "forks": 73, + "stars": 52, + "subscribers": 181, + "created_at": "2014-09-17T03:25:30.655Z", + "updated_at": "2024-12-05T12:11:00.554Z", + "language": "Ruby" + }, + { + "id": "57aa4ce0-53cc-4313-9433-aaf776caacfd", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/heroku/go-getting-started/tree/main", + "public_description": "Go Getting Started Example App", + "public_name": "Start on Heroku: Go", + "public_repository": "https://github.com/heroku/go-getting-started", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/23211?v=3", + "public_username": "heroku", + "public_logo": "", + "recent_deploys": 5, + "repo_name": "go-getting-started", + "logo": { + "icon_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg", + "icon_retina_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg" + }, + "forks": 347, + "stars": 246, + "subscribers": 96, + "created_at": "2015-07-08T17:23:07.864Z", + "updated_at": "2024-12-05T12:10:55.155Z", + "language": "Dockerfile" + }, + { + "id": "790fc185-62b0-4087-bd5f-57b2a59f58c7", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/cobyism/ghost-on-heroku/tree/master", + "public_description": "Just a blogging platform", + "public_name": "Ghost on Heroku", + "public_repository": "https://github.com/cobyism/ghost-on-heroku", + "public_user_avatar_url": "https://www.gravatar.com/avatar/ee5bae7fa46b3195869c285ecbb4619e", + "public_username": "cobyism", + "public_logo": "https://cdn.rawgit.com/TryGhost/Ghost-Admin/61fe83dff375a145d5272a5382aa2c72bd994830/public/assets/img/large.png", + "recent_deploys": 5, + "repo_name": "ghost-on-heroku", + "logo": { + "icon_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/47/icon.png?1724346668", + "icon_retina_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/47/icon_retina.png?1724346668" + }, + "forks": 688, + "stars": 743, + "subscribers": 27, + "created_at": "2014-09-15T16:53:09.375Z", + "updated_at": "2024-12-05T12:11:19.219Z", + "language": "JavaScript" + }, + { + "id": "6eebac2e-0c13-40b5-a17a-d08e722ea820", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/heroku/ruby-getting-started/tree/main", + "public_description": "A barebones Rails app, which can easily be deployed to Heroku", + "public_name": "Start on Heroku: Ruby", + "public_repository": "https://github.com/heroku/ruby-getting-started", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/23211?v=3", + "public_username": "heroku", + "public_logo": "", + "recent_deploys": 4, + "repo_name": "ruby-getting-started", + "logo": { + "icon_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg", + "icon_retina_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg" + }, + "forks": 434, + "stars": 123, + "subscribers": 86, + "created_at": "2015-12-08T12:21:29.451Z", + "updated_at": "2024-12-05T12:10:54.078Z", + "language": "Ruby" + }, + { + "id": "a94f751b-72a2-4f72-83a0-b0b2833885ae", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/outsideris/slack-invite-automation/tree/master", + "public_description": "A tiny web application to invite a user into your slack team.", + "public_name": "Slack Invite Automation", + "public_repository": "https://github.com/outsideris/slack-invite-automation", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/390146?v=3", + "public_username": "outsideris", + "public_logo": null, + "recent_deploys": 4, + "repo_name": "slack-invite-automation", + "logo": { + "icon_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg", + "icon_retina_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg" + }, + "forks": 882, + "stars": 1495, + "subscribers": 39, + "created_at": "2015-01-19T15:24:25.470Z", + "updated_at": "2024-12-05T12:11:18.746Z", + "language": "JavaScript" + }, + { + "id": "24f34c6f-a0be-4cf0-b0f8-77ed0964704d", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/redis-developer/basic-redis-chat-app-demo-nodejs/tree/main", + "public_description": "", + "public_name": "Node.JS Redis chat", + "public_repository": "https://github.com/redis-developer/basic-redis-chat-app-demo-nodejs", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/69006381?v=4", + "public_username": "redis-developer", + "public_logo": "", + "recent_deploys": 2, + "repo_name": "basic-redis-chat-app-demo-nodejs", + "logo": { + "icon_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg", + "icon_retina_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg" + }, + "forks": 51, + "stars": 115, + "subscribers": 8, + "created_at": "2021-01-21T14:04:24.550Z", + "updated_at": "2024-12-05T12:11:09.761Z", + "language": "JavaScript" + }, + { + "id": "444df7a5-5cad-47d7-86db-c1bd5e03f69f", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/heroku/clojure-getting-started/tree/main", + "public_description": "A barebones Clojure app, which can easily be deployed to Heroku.", + "public_name": "Start on Heroku: Clojure", + "public_repository": "https://github.com/heroku/clojure-getting-started", + "public_user_avatar_url": "https://avatars.githubusercontent.com/u/23211?v=3", + "public_username": "heroku", + "public_logo": "", + "recent_deploys": 1, + "repo_name": "clojure-getting-started", + "logo": { + "icon_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg", + "icon_retina_url": "https://heroku-elements.s3.amazonaws.com/buttons/github-mark.svg" + }, + "forks": 35, + "stars": 42, + "subscribers": 87, + "created_at": "2016-04-26T20:24:21.483Z", + "updated_at": "2024-12-05T12:11:06.166Z", + "language": "Clojure" + }, + { + "id": "d62322bc-3081-4a13-94cc-99d7d5953711", + "deploy_url": "https://www.heroku.com/deploy?template=https://github.com/tableau/TabPy/tree/master", + "public_description": "Analytics Extension implementation which expands Tableau's capabilities by allowing users to execute Python scripts and s", + "public_name": "TabPy", + "public_repository": "https://github.com/tableau/TabPy", + "public_user_avatar_url": "https://avatars3.githubusercontent.com/u/828667?v=4", + "public_username": "tableau", + "public_logo": "https://raw.githubusercontent.com/tableau/TabPy/master/tabpy/tabpy_server/static/TabPy_logo.png", + "recent_deploys": 1, + "repo_name": "TabPy", + "logo": { + "icon_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/81208/icon.png?1733400669", + "icon_retina_url": "https://s3.amazonaws.com/assets.heroku.com/addons.heroku.com/uploaded_logos/81208/icon_retina.png?1733400669" + }, + "forks": 602, + "stars": 1577, + "subscribers": 103, + "created_at": "2020-10-07T07:03:52.200Z", + "updated_at": "2024-12-05T12:11:09.409Z", + "language": "Python" + } +] diff --git a/heroku-cli-schema-1.0.25.tgz b/heroku-cli-schema-1.0.25.tgz new file mode 100644 index 0000000000000000000000000000000000000000..9428303358f829a2d5976fdf09be5874f61ed93e GIT binary patch literal 128568 zcmY&=1z1#3*Dj4ngMc92f`oJrB1njIh@?meNOulMcXxLQC`iZ9AzjklLpKb=oC|*6 z|KEFOJwVXIpb3A1^!Pvl4qB}p7v9xzh-KfiH#w-YT#4m%lf{a~ zmrgZ?RWOS5{koSs8~X5JDUHuBX||7+!XKl6`(^fuPkA#kQB{E=5~CysSneCqSH85? zYXi^2*@EhdmEW~zG#1K6jniOIIHM{mHO#f_t-aP)Ww+1;X*z6-Is zG61e_7Cj5n&7O^e9|LvZnt)-0mYa4sdU70gvYq_)ka-PL<8|o^?z@1++XzB?*&o7} z$8%U%Xt_smZbQkPOva=tM-JCnD#lp0w^EC-Mk7qI>zr-{5)4zdScz&MGcbmj>wb2k zJEBsQ>@3*_%b)S2@SaV7aO%^px_JBTT_)Kg6SVn;{jA@=@d@fWFZs=)+LsK1qfbg- z%Z0lQMZG%mSxOcz+4{-+Xmd?iJhE6!=)UW?ZJ<`*56qT}W<#X;ly8b21S1Pqe7<{mo;o5QGe30__h z1L-<`Fll`s7D`#MGVPiGE62-sXA5LpHaihxscuFv{h{cCFkfA>#!LLw3h?wUyKr&T zTeDZ6xXp-!i{d2qdUvaM48bn}cYsIAfCn&B3)!Qp<5NNQ~AD>-eaj6jA4 z5X9d4(qYfFwr!OSSlIovYx+=>e;fa}Y5@J#&feSe61K4rZgsY{aT$Cqn7p~Z^y2L3 zzPa2Lq-WTAcY3xn=vrUA38iws&eB61o-J`S-tMg*>Ry(Rk~Wbkr2 z8nhIby$tboboYMS24S?V;%ozZT2Nm;d=A)Q&-5tE=5Ws_8OQ+Iyu5;Na=(|-H#3t( zASMf8a^lD9RE=&A=Yq)eh@3fISu!weX%nZbKd!RXu1DNMx6cCf^bD6u&~MjZ_oFOa zQx0vw8-0gMrKRhmiHN+Uv;v>l>lxSzjV-4(YMfv)nQhhby<5JGR@HMuFW9>BjpHkD zOFu%?%f;-zUMzkHyh<8xK2F?js27B9I?SLS(U}oSZ^mbicPC|&Uff(^!&#Qr6+~Kp!GxwThRp5F{?1|Xz z;auu4^{Z`+AyDRix-!Qvp?sfqj^F`aE{alF@#XV5s`FHu}ju^&+RB`SDFB#3he<4Y2JhYtM~zLBExrHbvcVn zW-*gwo1^AjuYwiGxlD|yY$J@~Kn4U-{Z!aLZl^mP5oN%D-U9I=?hxeF+Mjm(3dtKT zZL+K%oE{{Rxd>JjyQZcfuVgAW=MP@Ix18rcM_~{T-4YPk;Lxv|>s>>+&!@;%rTqQ% zL7-mNyNOofPP^a4ZtKjKm9|U2@&p6Oyxml~!T6PGwN5y40hH=BCHb@uZa!a$1xc_N zYE*?vg=E<=F{}{6Qn%d#n`I}R#H|bj+T)3t~ct?n_Y>s z^=WCjXTG1#P))x*TNwI!O9*W6HC-^et_7OD=DJDpdMiG+bIFbQm_6(+7>ib_rme9v39*Fzq5 z!RRI(1qIiZhuW_Fz8JYJrV#Yd!)-3!XwTa|=ce zQS+IFD2N%d5A$GVvWIQEfoNz)M1KaZPcfOBKgU}aq<44XV&grSj|nL}COeJBn0Id>8PNP4f4r~TJZqFueLJm}pevVG{uOkb z+|}(TV@C!?cU~oZQ|fzjyc&`kYex%2CC)Q_e2&GhIVjm;9`z$1&)Kh)x{v#OHh9MD zQ!glzQk>E}HrUe}{XPwiZ2?co*I+BI8MkcDW9~HrXbg8I(AgW-e7%M{z zWV5{QWluLis5VG8UWAMNawoc+{%Yfi!|nFLgR5H--58z7YbErQG~($PKMs3`^WV#= zq_-HNpE2=TAS>W~*(;f24Dzs0h&1LaR?_K9{h7QH2eh~YM;dgWuCrD+3@Z(~ajA9! za10Y!Bk{@VtH73_^Zn6h!&Yk;L%1IG@1wor$v@yCYfjRyOB|xZFJ)xmfD{7a4uJVG zH}3($b%0|Xh#oRs=^p6v55~mDr|w6l787%Of+^sxow)YvMXp7zZKkWVbxJ}g=naSxa(C_ROF5MdUXVbJpK4-B zO3jdR^3Hg_x0&W=$1Zgty-wu|y1%;W0)d-ad;mil;C5|&d;9pfYK7IcZTB4P1GaY* z7LFFE^oTG){uOY{%Wjv%zJ|wSHQSVy7kD){BbaQWvY$=ckZy_cw6mEi?wiOdNdWZ_t4N(;5Bu;3w2>7}6&M9scEb_JQS5 zPpCI39Uh+P-6a1?{ta2B`;J+U)P!M!Oz#%5`bIu?4F3|m2Lmk}Vbz=Sxzw_*Zr`jJ z@g42JfQwPg5P(YeK6_bpQ|h>+jIL+%h|jNQb2qL8^_Slcb-8&8W&&k=gLd3 z)AmHp8GZDNHROS4r9^xEvW=teFHllb@q`W^iyH0n7kTWAp?I_zs{50zT%Egm-;GA} zNKQ4@6fQ~JHE0Unsno2-eKcNsiJHl#@cZz((!F*hfFE3hV2Sh``lH%ta9r|6o%MaX zV9E8;L`??{yO+ap2)T2HX`Q)0jATfYAGKuKvqf>ZCbvJv8e7}Hc(dji$B*mtIZK{q zzf$~TTN~s;q(YaA>ocjWvD~4f0ymcB99)#F6g+84`ZiZW$WLdh9&Y2<(7qHJDy{>b zuAN=fEQZfwA>A|qtXkNyngqklq2K&bB5pkk!g958v|O~=XTIesF>p<>xVC*1lZ_;5 zs+fFfrZC1f#zw_9(*KJIjE)TNxuo&j00)Pi51&GIR>8U|0P>%!!Iul`dC#~TjO;pA zQC|CXp!;JJ28Z}Rju>Q?=s29u^|%|x*yKifvIVvQ4CLBvY^_4#v3Cg9SsEn_VT7y5 zbALd50=_aGRTipZ5Ls`@{Y;g-oNGchjM?Z<1bTEtBSooOmYMgAMhK_wI&!MIycx92 z6VdKO70m|2l9qVmdf7gr(o*GZ<|S1)?7088i1Sra*52TDu7>ej`5fk)BBg14=4g4Z zJif`_(D{RyRJM`o*nR6FHJ)GMp*{yHTP(iSGW|DibbnF$g`{t^M89tzw?~gt2vfQk z`J=Woa#4vEPDc|H&6R*3f4XHBa<5cK%laAaQ)=PoUqmbEMAw8#s6WacuRFRxUz?S@ zn@{}S(zxA2X6oF4xo9fJ%_EC+ zNnQyNhdX+xM2gMim&yah@1xPLK7RRat5M_5f3I%+zHpN_ICd`XV=hj&lyf6^vqNme zO>IuK#`HS_6ZIu(@~x`27y1@a)JJpo`L{&Bx37H#F}gK+UfezBH|Hd{n3-bgbWSqq zrEfH&ih*|hHk>Y>4ZA8AEeW)wUg$a8&t9#5gRIHfB)7)!Oi%0>7QKBBIUjI}y9Rn0 zZon0#fKbGsmO&9RJ{~otn2?*@$?9rHhrd5&aE|VmQ=06h@^di9f3oUg2gz&%z_OuA z3gBbD#Vzy$qPY={6|T?RTjy0TZ%7&=)5MHtz2vnF9hhg(w`1iUhAg@qkC?26@{x@V z-zKLM@4XIRv1j*4RzEW!zdqKHyhH~X{7@p*B7gm^yy8`x-hxu9s8lCTgF*VpjgUxr ziii@Y^Dm=4Q5~`PCBqE5B{Ga=gd&_?Gm)(*6!!!pn|6XiS!p^l_>~+sXG2+|Ncz`h zu5g3AfwT#d-B2&zp?pyGn;SYfCJACUU2U+mZSmF7_?SDEamiQqLf|V5k$~*j59+6M^GWjSw96e>b+j&r&Ym~u z)9!8}<4SwRW-m|=-Om#AdTk`I^wV#DX&Odas0t=_7ppnTJSU*Qa5SxqSRM_$%y&J) zAyfGq!n!Z%wCt?o`pY`D2IV8_NA>zI)$>l71xM=xZ+U3RF9QxHNN;bogl)osLu3Gd zRMs61>bzAx3RY3DAO8`Ism#PwPE&1;Qq4h&+<9$wa9%*uu?@n2KZ1(X^ zK>6Q!_|3D+MSD$5k*qS#kG_smx!hN{N7UpU?&9 zMEfW$-8tWV3T`UieD`Wrfm(ASiXDaituo8>M<@o z>DiCAZ_=-(0}Ppqry~^0SXfgPC9qJi{Jw4HzIV)3K3PrFPnAWU&nNW;~2F2n4Hl2ldV6om&V}Yaa%KgD@^N8M&8oD z8rUiMI1}4}eJcCt&;|6b%KUex3iWZt!z*9he=Ga~Bp=>{yd~t7lylC?G4CG0F0)0s z%CQ4hylX^2;>VpHH@7%&yzTt~GgK~COnNh@`5KQw5WcJlw3u_ATeLIYy50XhNtm+l z&Of`XP{AN4#4aa%WkQJL@;=E^?3{o~l1@^()*}bU2M3_aIO}X*1%< z!LAa_|05b_wq^3$fu?H3g{LF#9cTbK{?%x~GrJ^Tw=$vkwNIeD@<|~wZI@WYDmW@Q z{G_~;SJ!_{Rn?zw#0bQ2_;L6jM*^{DU5?mh z-!=f6xo@1^#aY9Yh<5lE=SaI597KIpa|0II%|-=iUIKt?O}@r(&a&#I8|j>P*;2%Q z!*Ixy87o35U5sccmnY*^zd%y?i7N-oZ_TGD_$C>?vJsm*H^8puy5L>}i#-*S656~0 znTBx>yR$;S6_jXAWN?ZcT4RbrNDvM48}yp|EmNhxK6~6HL_c-T0~&$q3}l`}4uL%I zt!e(4*BctLFz{u_7?qefu->5{N;6VkI(`bOao$TN+^)3D6rtduih=c)qdpNsYs-p} zd95KO+FN%GUi1fMMlZpXc(5-w;D-p{v}DR24YWUmbxeFb-v@h)^$&kTeJNN1ygUJB z{n_FdIEd}S0l{7T8iXO3FRc?0J-S&be2DBGaUStzOZ~MAB@hAkz|IMuJbluM$@u*S zLAipySAk&%7f&hu-j{&05Wi z(xIuLd20X_cd~}`@Is634+&53%Ry)m$s~a`GuPplSh+9}~$g(|ti;P#&S8_*t z6% z0f{r<(s=FErEp~%{_NvtnDdLkXOWam804CTxEmZ*i5NU6847LH^j8R6(7;UQOjO#Q zU!L?G+CydF?bRb%$~%~ih~?(lPFUn=lKUHwIym&Y!)$g0ElCUU0bWTM6H+L8W`}a$ zD>EzY9UsWd-ruoHZ-4QX;#UdR3p-GoVVU8Msl%t?S?^0U)5UmYScXQ>{s#;&nm|Jw zD34zefpab{w~73=CNOT1HNjS~fUrF9Na))SEl09IW*>ZofNkUn41q4zCq1FhMv`xa zh}!h+3f#ZT>A2H;=r+YBnGA9jYpGVFl)i-%GzFT8=-Jqno(DWzi`oQ^B7wc@Vstn@ z3|vPC)Uzjiuvg-KPRT7~WasPLzUte7?2ih&Gmcz~%@*smPrF`X>9!AaE*n=0B&ZNnUWdJoS4#u$)L*{(|r{o@GGV(SBEvDBQ!T zmn#10dsJgp?Nj-oLf&ADP2&eXfqLeJJ2jyVpB(h3%4qmN$#+D&_#<%D!kX_E`8?k>LSj@A zl|-f8ZJIqN?6>bXJ=`g^$b^Im@Ar%*_|@92czbTcCvWzH>Qax*%7fBsH%gv=|0`l= zp#1mnjmYS)ZQvjrNL7@b6a#o461v43#HhWBK+oJ8BfH1%#E%RM0}}`D;hiua$H(tx zl&#AA3qn=~0>~o(JMN6_Gf;0AG7Lib86oRTL?=&uvp0zWHb*p7`rFx{V+0aNJ_!qu6l*HWnWznA zq6{7hP)5D<+mSzuyEhZgt!Ogl{^GJ(&J%BAwEQ`}cnmG#0LZ<70-_st|@_l6i5;CkHcvPX=Rap6?8}xNB7FdO+DTE}E^rM%e9s z8#}3s@gHZ>jyDr$jbw7hyqERlHCV3sskkhsw68q(txF5sqnwMBV^c8 z1NX;^=P4ghpu|vJM@0LS7wVs-uek4%HygLAQ@ukY1Xh39xG96GCErJpv*J0SL2zH#YfHn*Q$z zZAS{U3BgGc%6x9my7PU0GU|zkd{Tf=d?C@VvP&OXz23_3w0fIHceOF+I>Q@ccr)kc z84u5%ux!6=ztyi4H^g#$ITC$2?NS0!%edoE7*(>1?zHv#et@P@i-%?VVHzf2wPb)5 z-3tE_Yuj*7Fjf8iI?=?r@}iZ8Imk;=B1?n7Q}Vsbs@hx&`XVG-H~6JA2S>u6jv7-Q z_zRDAfefJL0d#Ovke&cw7TsBo6S%=oh@7ZgoioSEmt>>FCVIw;?sQBKRb00=E&3!!#Ykf1KpBgNZFdqGA2s+ zcFe@ynhQQ5Nkuw%6Keci6*02?U#Q5Hd*t$ayNe@lL3bU%Mu$5xLKdO?{tPUFJ2!ad z``_RB`F}>b=uv_7Q$|F#c**Mghz!!g3E=e5e9Bg82WWT!aH)$%WLCg(u8yGbp}=m{ z2U*q67N8E!qKnHGkt1A!z1Q#OY((!7o=#X7JVkJ1aeq`%)KZ;88r@wcIZxzL@(y&Q z&5}uUIV{kkFBh3+Kf~s)cSN92j!)`Ma7F|~2M(5a)d_rA1zb)6Yrg|sR&QFje}?g& zv7g}&Y1uhIqKve#2$=H;jjjO$o0K~M^=rT|`-N(T$TO9rey8mi9P{k}Zq7w1D8!M& zPZ21{ySAdFrmP-Rd8)&1$!@#Ahu)z%bw0-l$Go z6q!o^8*PO43n>9zH3&h+8#GKpN?LYlyMJyP3L)jAi>wpz1dm=QWL1)t@IOo3@KrST zjg!w{_$z7Wm|BTtbl0smEOf(qs zxb~iUAz3Hx_DCG-03*b4^ou~_2A=vhZO)=5e{zu>w+@~0JE)@Fnk?y$Wr;H8ouk&S zp@rle?AD8{QKn|@9cAlYir%5V`k39JGL#!tug`d~DSL>{66GW)XgqU#r@Va5)@e;R z0_V;jk`QrP;~{@uw(#!OattWLYRYxuP>$pBh)X*)`>lqfH1Zc8DuZ3lEw{Jv(5umB zNW4^(r~*oN91f(r>xk*{Wh@H|rq+~gXS44X17snCPl-*`dJE9!UT@vfcy@tz7*-*5 z+h8Z$Y7+Ahqz>f&HE;6op1t>m38qIDgNxsQzBMPI;cIaBt+MPeFg>Bj)BHAEve1Gd z)i*)yRf3Hc%d;k*pvNm8f+yU@+uEGRtc{t$H+L z=cuF)$;F$kw!DE(Q+FBC`z}%?VOJdDW(c!Mrd#cj5$FW75>a@QNiUK9t5QXSc9iWw z^)vqy`G8HOe!)PqU0s{(R4gD^h4^;FYyu`Io_Z`b0Dq2Ec7JAT=CG2=xB*t5yo>T! zhRiwLF8u@@T*JV7k+78*SwayPO13a9|7PjPAwBPu6rThi-Uq02qef!L|7GFSnwMBu zlb0@9EG7OR@Rb?Rw*kLB?oH@K)Q12T zRRf&N-bNjt|5*pi!6q;&bu`fwH6=Ym8#2Xfg4pmlRZS&DaFWPJDV}qQqTD7O;-Z*_yu4MbTl;D*(!acIBlDAvi z7Rxlq7#$zPDI&Ye&F5q@a}=M9c=CxtvSeP>{})V-_!H(B!%|TLTN$#Q0m0~m;sX?` z9ub?%0Dh6dK?BnODo|gFfSkv)ipioqq5l62aVtZia0~ti0H|NFv-sJH0@h;vnScN_ z18_Hc1I(0DX^w+G+79=de+0)|5!2uIA8e9zPOr!j!blmW2#;DV?%_h_9T|n+B6&ia z1TQiaHmrVNDoCULwf#$uxjx^Lb3`g({+C6nmQZus{W2^gmGZtJv%w%V`8^>lPS~|d zNps_>yVId|^Gyk!8L{iBqd_H?kWK{*)R=h_3_ZVxYNX#!!)xD@4W+)=Q&@mYC&0`4 z9A~Rcm;<^>UV!9mrPks_p>mGjsPq4}*kPBL+mqu}lW#{_^swwi6cOI*uHJJckOHmuS@)wlXQ6fxtIwT-M2BBqK&Y+gc>F+-w5X?`W7&Z1Ohh3Qco;s;bBkg-UGo1Rxsk&$oB>qKLv+U zX_6>02ZbSE?ypPBO2Ix z;~Co9={I2dE*XoqsB)^m%t5^nSvwTTbDC@*xFTrt2z7?VnHhg|YS~(CvZ_xR)ch4u zOS)4;@?rc1rQCkTL%VkTn+h-1(nJ)VfC`7<7_j}71lu7qhb}B_y`YZr3~%3+kJc}y zy)(r%YvYDJWO}C?DB1w-*1>o276|xEhusrIJ^CrYsaDs6?DOA^Zi?)Wo%YZea>91P ze!K#V>~iVaSHE`zqDf3<%;4T;A5lS$#Z@3{uxtwu7%{Wy^&NJ+F$idghQT9Y)jY}1 zk3S4EGGj15uw@K7VJh~T*ibg)84_+-+L+){!83((vhCw6F6xHigG1pQ%K*su(O593 z+V@AYf~8~1&m3$10chXtn;Wt$SJtkUPdq86DO+sq4Js(1qm=KqB=G3QN9V*oIjI_V zf5j$bV}iKOg*Z$=Tsk`^!F0{Yw#)l(wnSw-RTj1_mrC=gaQsWx&%=oJ z9iQ>L&GN^#iZzA4?50dQs4IlXEDuux>^+!kzuOj(^ST@L*;6)#y3_vJm zA*Tks+ZKhWNdcFD!oq*EW%X;VR!#fHcRVZkA+hip5kfJr6ujO7u;n8sy#a>+b?gZ2 z!E72b_Yrt{6e!z}6@eD?)W z0#Q?rw$s8vMdM#;KK8&vVyWM<$kN7*xacl0LbeBo4HP|mMP6hUX19^O(Gnk0Q7b`W z<3G9sRI!dnL4qs#V@D+f4P~M5)KK>ot84l-fRXP5ngJ}tQt5%~*>#BR!>8I+OtUV{ zl;_Q2G^^WG^^E!U&WjL3kw};<_Y1qL8u(`|q@KJo9WPIZB;)Dq$E0)}qnn(QH_d(_ zTm{caqj~IXm-Qtth*RPb5x+iyTFiXCS>GyMV*r z;_N^WBO<4-YGW97AZ|IFs@iWV*J4c_3QDTnb#MEblAx#+hWf1%pus)Aq?tUIxB~5rCV_iQo+$rFJ4}bX)N_kkd&7?^STkVa;(|R z^BOkgxsSCv^{CTcPmnNH51)R8g}WVf>Ko3^m&lx%;=iFSYb{stGN#BT97p0B%k7Rw zu?~mF3v7cAaDmIwJM(rhqR>PtrlHyrmbbENtRN?S^whuHYPp$5JA2 z8ec-+U&Ob_Gm1Jht8VbwFt%>N{a*u2hfyqH5pPODVbcK})|*)%?&KeIY2W2M$7w;` z(HhM%gN`0VFQ$7e#jalHyWuey-sawE@+z3{kGBZOw{{^k{#fQ3x5lMmCSWHF(j{U$ zXJ|6!PTz*cdKn6h_*FlH%=Y;Hl=`?&_%~hB?SzzGh8A_L_OGT;e$wkp%cN!t>=^7Z z66f8g4LHiNZ1Vb+0IcPW=@LHx}0LsztX=1A{0}?7G^3eWKJ>+^hlK*HU6T3Gb9tfhf=MPS! zWaB@sh(PPVYsN?(_@hBz9L}%LzdkH@;EKrg2t5BeM8SWJZX9P3hHzIcajb8Sz|4Rh z&(Jpb!@DmRfJiUGa5D%Pf$q|jyKJ*nyi!2UZ#!MO{LPqK`QclpXwe?J|^2uT}~d8O^t()XndGCcJWlqEFJflO!S{2#NY6Cf!pqMCf|#cjb~mvT>2 zD(;z+z|xs*YA!y*NWZ7IqrCGr8P>><3#Sjr$ZJ2+$2m9f4L`*~LqSp1q1{E@!pjtX zm8x8MRX-qejAU=O=KfkLCYX*;%WBr&PD*IM@~JL^p+?YQEy9Wh@j&~qo&fd;!}n0g zYW0jZJ_bHDwHP-cH=&rD5Ej9c#{fi^(f_nPo3t0Gg>2mFRa4i#B5ZmyTC}KhB~^>x z7V>P?0kLnwJ#qtdt=$SgFrvC}z@aujfm2&FtVLBc%u7SGjK1rqd$Z;I8xZq5^!XuKKCf&@XL$KpP8r7DxFowt9C}L`d7h-pqr`InV)?{@7)z_ z6zPhr%6ACTG4@A9C%zK{+|9UuMGUQRMjw1=+moa!O8;%7z1d-3s)Y@O_>?Z zGPw)^0!KWOhL1d;`B^YU?*fV2G7^1fzIwG21n%|U0YLKU1nJPmdFnFM{L}C288=MU z=k`CODXp4Mh2*}L^C4%z)Kl%*AKX3z*j~eh$h>eVWnw;GoEOUp?c<9)&!{S0~jo?(j4}t4O^Rf z$2`^|XU<)Km)1MjzBEDRL$5TSbfoTkd}cqrj-6go&FSrr+La+h^x~fTNgK*m~Zbzttb4IKSm_64d#WP#RDy}nI86cFcwx#)@iE5vSCV$LYRy~ZJq}o zyMc~4b+eYVvVBPdGcl`L#tZ28^ikkz2tX4Nb_2Y;0kj@qesneX6Z4ZtlI}kg-2**` zL6h~IkLZ7<-j;rU-EHHWY1uvA|%FWHS*v%tfiqMSjTN!zuXr2I8j^8T7qh+S%`Z(3-oP;#t=nE;!L zs^7dFx@7@{ivQCmOL2@TEvL768Yx_VfUg)pB+1{wb+oidP<8- zM%t`k)~mVx@%2NbKk+&{7(DSxcc7tNCOD?3*1--K;hhcU4V{9q6erZN=|0=b?vI2z z7?~?O4;vBz7X1Jy`|2D48Ud`$;l=8lcawRbM$s1X`=h>bOlmZ*sgw@^ z?#uMO6?ay<8HoajN5P__e*qlk_y=VN5ZeQQ$3zvhObCeX)YLJ@OXd%!-Giod=9DMN z70;ji5i7G`-5}wd!u_)iZRuvpl@8(^Krw}AVp#0z2HAyFYT?zLSZ|k)dYJ_$G1G;- zfO=SaC)Z)dp*bc-LwVO<8x9+6@x{Hj91cyrv9#HT?80R$jBkcsyJyrX{MNJ6-qJaf zBqH~KvKYC*b6EGz5~Q)>Pw&cD!ZEjrr+1k64~3nrg9(FS*X%JlKZ^3SG`RS;D2Ck$ zN@RNtgC(M?K~&qzn2zfw==i_aVp&W`G32{*moqsS9W@ln(lG1iI*I={SeR|cisISJ zNIqye2nVd+%`Q>Zprj5}af5aOcLwm7*3+idrlDCZ{NhCS^Fz!vg|Gy>=I$P`Cqx?O zUURIoyvJOlQ}JU-Rirt-QilNi$DQIH`LIoZk_sSu&@0;UP|Nzun~KiR`PdhufT1c#q{yO= z^;~(_8v2%vWaHpLgI1cyvIV6Sj@kw*gNr2`U)xPV^9D`d>LeG9HTwCeZ|K=UGzgoWbGdCzJ*Ky z288Sv-rE>WBTJt(c+#H;`ouDZl0sz72~rd$L!eXf`yX){N_MRA{<1YBMGvLPC`A5- zb=0GS8x?^z=*~C*(FJpAiT((cj_Q7&y}7f5gQhWde6SB9ibk~5VVfHQvFR9R!oDkP zTaLTW`VtB%u0BpS3frioeAh|`0CK?hf|>S6w)>Bjtqpu zM+LfpH**3?bEKH#9S_*^fqNmsdekaDp$Wi$998JYNFF7P53saJ%8U!amj-w$qh84+ zw@P{$lL)U4Um9+_0eK=OjYJOe0pQmbfcWb2tWonJ(dA~$XQpXrJ;%d5%OkC87Y!}^2zkgPF<>(edr!>UHlVZPeh7L1ATxTqmEoK_otS&>ljz6}O zeF8PeJLm8hv4Nc%+Ej6w(AS#2X-$Y0VW<O>wBr#HrEMEGRdO%B@f zSJ2(Y)X@^_s91HtDZo>i5Uf4&SvvvDcLbL#8K84mQkK=p3&*d2;?1eKfi?4hrb^#ST9ml14HnI!~q zX(iUJ_)^@!WQLdOtH{SdOgK=8=ktmX|57tGP;DiVqGU6L|Ia)Het+^nBmbAui_nzE zOT=qpr)FC1inf4Y;#2;2o!{XpMtvLLN7OjEcsuGp;1-4etU~~CvgB4FwkMBK-Iu_Z zK+LTl%>?D2ihVCuCh+|RL~Pzce3T4-QESIl$D_u(QM6$TUhi`Rk6tqpqizR8t8b1K z62T!4yO~?GEYDV_Nj`1MY?c%O@*#BCMU@U0@6a0kG2Q($(XmVg9r0 zMNuAH|fj z@R_uJ#iwg^D;u_ru;H&SSK^)>x^uq3uk4H_tk9YbHsBE zwXLB2c0;Paak|3AxFr=8Pk&3?1Yw-2RAC+z6HC_Db=6M~z)!w~*Kq0}F<~-kn`^zx ziuCd@>m}<3($|5$ogHBW(1MSEJTPZUYFEl(*AKnRKgf@jkjj7Cnkw=t^8Z^kT|Rv* zkshli6^A~bs7ta<;CKj|@jR;AjmYB~1rF0M66_wJ{8=4GYtQVoYl=m$w0qg1i zNGSfRtswA!)SO^o&hNULWF+i>8+ZwuTt@M!m~~XP2>ORFv+oC3bphd&sL|pRAesZ{ zI$(9McG1veqiY3y*!Y@kBEhUj#b$xk_gPDka<^(oK5pU*DMU9;_A>f`qhKU;PGqVr z*$CJsPoG&g<2=KXy&hMZ`fKnmm*-$Ruu=$hZov5_tQ}TYlZE za=If9dft>tcuviwK52=8L)5(Ha=iBN^{mhv;y4}U z8Wet?cOuseF~Je2CTNYSNtIYn3?j4cLR65S$<|(!(W86@4QOuNf;=~X5ta=xAozUc zQ!L=A4&(?mO^%fs11v}L2le`L zZJGN3%>PXk@B%LunCXCn5++>?5X5k>b(j$^0HTTr*0}}IT*$@%BLk2(0e((52id5& zI0zDl>{hq}_+t9uHo1^C(fb|HaE>7IrC}wfsCa%+M7=q0a5L~U)rw=Ie^R?jNscd` z>-p|K!BFiRm*%-T&(1?ts_qhj0EtVp4z`hQ4Ha#QPV;N1>AxF}G%6Gm$MZbdBTxIy z9O)$XaL?P}rX2pig3GL^qBXkCyw+Ny7^qX1%1uMXtMcG(2Flg67cLO-lT!BMze_A_ zUIA$?a>fO03k-w@|Wfy)&9+1(g??+Bm9Ha@yH``YeB;o^Lb4{C-Eu}i>)VOY{+n-ERE)8l| z>o1(M#&zYDtQ1NO9W7V#M|>kxt|;5rB|8IDm;{Kt??a2c$+sj&T-GcXfnCqcnY{OC z@ukRREEgo=tLJG&m*Am?UxO&^S8DDvw+xp!Qximih=;t}QjB2mLU;z=8(~yaw$;3T z&9Hd)dmhQ}rrX6EGyM9-*nE0b^(9T9?KOON!iaPZLUQAo`;~5@=ZPQ14^m($wT_ikL4}R6xfMOdUPk+&7+RccPRqq5f zZ;0=m8BiuH+M^M|n(2|K?xxCRIjqbHjNjQ?sBB$Hx^)s>4=Q}oATr?XwW&X(S!*2qYhm}9e7mtEPNA&Bj%iyRI zZX%?s)zDb1mog;Gb{!~|lfFlCd72SYKlE{HWBmS%Cy}_l9wqw|a||nAob(l+FeL%= zjs8kmjsIcQ(B0wD+|<&W$Wy94-CN?zr!l9Jc*kDN{RvfM(YVrtKjJ56Vp*A1qh}S? z>%?M6c@SHzQh)8P6mX5Y3BJV4_d?7(QtaOF&_8s*4GwZ3ym%jSodEDZ&rrrbgQx(l z%C`XT1L^SHtL8Q8embO$wN-4R#J0(4l1WBbJ)LvN^qqBs&CKs*%WyVH(3e8l7nguEtNSL9kpKvOF26WsuDH%yJZvb$jTn)mBAI0C{s2~pSmv>ck3L&@F1-4gwuYOIz}wv2ymhgFPWH(;jGp9#&1cUH z^iqU>p8hGe$eDQM8%ehF<^Ba1SNJaIw5V7wGxWr!MSuir!EHJ8u~ohFg*l2*)Smz zVbgGiwZKe5#@1rAz{wHvC&^HY$aBf6!J67@ZBd)O?5&_^#iH# z#?31+k&PrMH!SXL>Fef&U&YCo*aHe=e*G-YolxxFw-6-ht_|~3Q@ya9Ow{E!Js4Q~J_{p3F>C^N2BRK4V`gZ<}tsZ(lv2(8iw_{0$Z|@*prY>2+dZH%D#3axuX$dRO}xO*3PCC;BQovKMSF1#>a zBx*fA*E~*_8dlY!M9I>_t}pan5D50CI{|VLlrK!UERONf{$GnO zYPvbsKtNEA!1M^3%~2rjf~6lg5(BbD6%~(5Jm4WefE+wrM=bo=@4(16o{gw{io+G` z&*r&E?ir3&N{{`aVa8K0o0oPU^wU2&CjMc<-UUY7aACW2m%Tbwxo9XdE0uUWDZ$uK zqHNXlkqrJHJf%t>D4!&xwi}$p2(PnT>SY|F4yoOL%l3T)SLh$s7jJ}4L z&<)-h@E~qS5ZpjG;NTg$J7yToW53!6-3a{&wG?tL5=k^D{RWVJ={(KJy>JE|alFrd z&~!fBlN1R6Ty;No<-CmFA4taUcKlK^ac2EcH;lPk_Vo zl2JL<)Tpz*%ez-?QcD$z*J_5_uMI!E&Gqx7Ca9&JH!DOz1A3CETsS0tnPRoyb|a4FVP88w-vIY(z#DK{AMiELtZ~hNoZygoY_lAAb9RgC)4N3{p zF?0$;h;%94-7<7Zij;Jhgdj*a(hXA5(%m)8c?bRep7pHvUF%)^arWMGhPBR|nZ5UY z-`D3lw7#YR2#;5pgPH@sN(}0*fC$7JNZN5yQ!{CGBXDmfIJgZ&s{y`lP(a@qyj%h= z$rtJzzCP4}O5>ITw|}rUXAsVaBYipul&E(#8c997AO&qI$@CYB7xb|WDGQfQnD-ne zZOT;iDU$@(GMMsaO;l^k*GOAj5xX}dOZS>C2xgDv9gtrDmGbHZ`T2F+oZk(L7}X>NEG;19_Lf;z%lM-;7<)ONo}esw})M z_x6GIo3;F@Xqa8h;pLpQ%`QdKEIZt^X;ng?zHAv0Pq}jrp@F~&<&WZG_R{ucg)5il z>l~^IwV`EM#TnmvkU=acZgH1o$Bt^%Si}0?Fbqo-D^4Q3-h6Q_udhD5J|g)*5VM`= zD?ePa!Cu?MP-vmqEs{|707!3vLb3EHkPCDDSo(%a@?Pk*~gyIgYxLNS)qH9 ztSG_-teiVv6Tk*54Fp54_9=foiGuoj=WeCCm*Z{lOTMKmSLwIe_}Lbl5%Ag2UI>gm zAACT}^k9J`-47KrgB`=xfrnjhaTth<0S38&8iyQY`}VhS8$ToPlQ|*iL|^)dAx?i2 zvC0sHZyxb~njB&OHF*O6HKgAXbjqX9)P(0jpu0v7?PeN^Ix{!{BMB>KDl!W-0O!p}nQ{F^#zNIxvzc35+c{On) z*N{IW5#6kQ@U(&_?{|(&bCOlsFGqzs6xfS?;5RmmLUr`~A-m{-?!;K+477+hKgjbm z@V^AE#P`D<0At3onN(o$S36KCXyW?NcYEQN`VHuY-I84ab2r)7q^8^~qyuna)SIUV z>bRW4i5l4~>0|nM+G4|s+{K8w&b{!TJb3F(CB<;x;Z|=D+Cc~$NDL7!Pu_|CBtbDC zv>}dJ=MpJZcWMA0!0%$gUgOOaSmU}7jo9XXo`xv$EhdI^czBWIZG(x!iR_Dlly$A3 zZl5Y~1r85^1hq~_-Jl4($oJ1eIq!amDLYzr5W|^db3%||w5+PL{go?!w1MNO{cX<` z%N2Z*P#4E7n3w9o|6-xMq&n27>L~V>O}+@PhfjZ}K`BY3WSY9>i&NtFW2&iH)~lH( zz$4`tfSzMgR@!yMaC5-~W@Z*|Jjj6OTuvJ8?>M^Jotxc}h`4vbfsO zcv}AZJpSvXz~PfGT`XB+G!5NHX;iq+US?!UF2iiJgag{gO3W+u#+oesdzU^VWAIyj zE+aQAv;*pgD<`4Z552(8L~C)FfRH@&_~aIZF@MNnrk&aiCpR8J4MY>#N2Y_`>xuIt z@{Jsc;Vg@SParCDl4J6h=%@+&cVg#4US3t?9VkESIX}W2B|xDfmuU9@du91(%-RsTQ_tndA=w%)?xD9 zk$?cjWYDStJp&c#OxADV|q5rI&&U5nls+nR6@OmGlJ7|Jtb*;yqs#HQI%xY=Yv#RMf(QDeWs#qzOa?NhmM z{?2V!5aTInzWOoO;bU-}qO+AAh+337eWv{WJa=!r1EW>Skdm{75vh=qJ$tuRnMyZg zMlZJ7?}4yt_IRAL&z1_9I6q(_p+KbVhaxIBXowz(H@P^L0t@ocZ9if52p|Vm&Ua~y zF+WXG!^U+X^{79UaS9Opt3RE@-j)3~@SigEuNYNW`rjDsIqTZI@xxdv_(eFRJ_8UU z!$H42U+EJB9t8Ix{_qlBvd*XF^hmW&upg0(p_6V%Piq5Q1hgIZKar#kUNgMc`p2JC?=!0n~dNR}l$Fn}fdT+V1n+kZypMh;wys zX|BVkTA*O&cp$$A^20`cChzsd@@rP2sm@@pHm_BFhUuEr=#mt7-yJOmYsnH~vrDC# zD!17&{~7G1O+WevU-2=wJgP4fwCNZJvuk?q#3I1ucoTBR4xfy^O@hJJ`bp191I_ZL zWxk~BrB0}dk)+AQ|L%TE&A5i7LwN%7J%0)rok>eH}N0Si%yC0 zi1{*-ep-~-Qul`Tt&6qgTz`FjxAF`i&)PnRgu$soN<--OC2^w$yfkvjv|dpv7KyDL z2R&=;Gsv4J-sC(VNaANfgqT!CwCTA2DV9N-t}Au49qa1wv$uzreG}bEY>Cp#nbJb< ztf*d4Ypx`+YiJjREhwYvJ&bE*DGuf<$eFQM8n^OV`D?u^T2`p2GLkO+z^TpAh1s~F z+TmxBIL~8xsf>UOU)mG`eW)jhZSO=Tpx%Zy5!j$W?tM3O*A`=f$|78#91dKTj%H`g{h|X zct&ZZE(&u>er$e03@;w4DA~e5LV9)dkHEnQK*8$CwhzR>vo(580Pkc@eK=3~|54*C ztb3KMt^u3t5bC5e^&1Z`-B%l?9Q_T*?Kx-+9ZucJlfcE2hb6XkxzFzscbBX)ln5aT z7vZ+Y5<&^T553#Qy*bi`te#Ydk}~GIm!^6ATx;g9djE*GIQ}{&&wLH*r|Jt}dDePs zLq~b!A4Qj>Q~;GDgoCMc({SyqdAi2U#q1M^f3+-P*r7iRrIU3cbB>w@}J-Cd{9T zC{dnsG}xQ&i{bjsJj*3)S~73&{Ct5NHEbgoA+Kre{-GZ!aftG+jd0H}q&Y8jxz<8; zvt063LOxC)8$l}i)(a2mS>Jvwb9tL`J|+&*ES785m%_$m?~uQh(*6Dt-huIh9@Z=m zKt##G*z4^(fOo`=qp#uBCvL9)d8Yg=G-{*#RW9Ln9rFEzyzm6(ePG>g@Q_D%90&(I z?M{t#<0u*jsrfseC-ApC;nXKo7R0MXsu#OiY~3JUPa$y_3^r(8s};7RdvBPqhE4NL zKgNBqN65rYoqcF8-Oe?$Au#r?vO(+Zh55&YeHpA9^Ro}nMtim5G{_qU>t;g~ly=_=5Pannw9n$0h9rP4|B$Rp^O>X<$rckp)bo(|4*1H45cdCpJ} z84lVl40v$800f(0aTfAg?kvNs3z;{4DR{f*=+CONE=qcR@Uvz<%H89SS>k7i`3rav z)5ui_$BSxwPzz{^V3*xV#J50j$w#Aw+@I*t2pvY5jQY8pUQ=AEmn9UCxAAfghTkkD zJ$R<=wMsph?@1g;JYhx_c5TRb(L&Vf4lVnWfbLqWGhsv2y1-=3dDlEr(RIm$I?|=t z{cC;>#8+%#673(-^|I9RgAtn{AHEqn!uvO;;AI!`cq{4Bm_44UxAZo!39&V|1{^)w z428u&ledJg&(qn+%_=Jr+g+t>zV4V7T+oIf&DefQI+805(d(r&L%JBqy%?ZiMmAiD?r`u|6Wu;fixK#IPsPte+iljmjV8_V;nzpKPY?ITcfo7geEal^ zUoBP1nT$5LpDAAADZhT#*WJ2o(AL`08qyZnR{GgL{vE#>kDni0_y(7YPB|k2BAvG& z`yBw9!MeE4Nc5jt+Ul>RNN0%2-y$6v=^e^{mLdXFV9-)Lu*=o(2IMw&u)dVm0WZpR zp9=cIuB$<0DjfioA|$1f|DQ)?#N^I@ECZa?d}=8y2aI9VV)}e za@uF%l4%O1Pd2HmziSmrEQ;mS;+-_3QlgrcXo@$ByJXnsK(s+9sta4S%H_0v|Jh9% z>S%lgw17CPfgNBv>c&_^#Y3?KkA(8yUpUz>HDEw&%PHm3g3j~H0RYO#0-tRIF=~Lf z8w~P2zaK8V*ODbHJuEft(W37Q9hI^2!4i38!b5w<1E+9XLmSIWF07(8T}<1+9)%M) z9&XSUo>X!7!e=YhXZ1XBfe{XxiLLo>06J5P43{HPFg#P-kAbggQ`5e*OwY;vfvzK=35=l%v((jT%f z?oqF3wt?@R0ECmdIaTd{dVSElJ=12u5%W5B<(j&r{RPIH2W-VHegg>Cynu-50YDwx zSjTZX#a%M$l6j`#-6iX}katcS+LMVMBV&TS=Q}xA5jag4OjG1FaIvm^Ufl8Iby!;< z%K+B1?xCt`g}^CCqf^J}V;nm*OYRD7b&KVM{($9_LW(1DPOox4JTdth3)DN(e3%$E z4-uz=*hMJS-s|3~XCL z8_A%o{5hs*MSlIE!L`l!D3oAXy>0vlagZOYD3zN|0X%`1Ybp%ch9^m^~24O z(|3FTci$QZJGTL@kV$!%cKIGeFQulg&g+aNc1W4 zFWA|HEGhRmZsL~k2#T6HbyEJ11l2(NDgXB^$vd&3=MckRwQ1WCn^I{Fa(AFOv_yDH z_jZ-?*0^s0*dKxKM3YqOm-83nhz*R(aokV8dF^?1_PC3B)~`y5${4EDZexCVU00&W z`nOojr!c`LxgWaoXE$h{c)_j5#GixhG_AYjjaaj_#8)BrWYe|5sK^AB4r_t$NV?w%@4D|9PuxKc}XfKIGk^A?ENXos2T1OV~C zN)Z&W#F^*+MgBiRDlnrvn_&|WHD(X_G@pqrAprNVJ8f8n`#C(hIo7#t$3KlN!&a`W zFA-AYgrzV(dQ1c{-DL>6uf{Xk$sPH9i?De;r6A8B*%w)z!=7{SHrNyGxX?9eV;8hY zxjBPHt4NNCL#1reZ^>nswEcBq;S)&`Rb}MwKfevGm`^c(unAxmut+QIGql!n=hkIh zd%%9c*UT>@nSdx7%#i?CCJH| z)RFhbQIMQuwf*H8M1KJAK&=srK|=dand{s3dD;WUGI+7_a1&>L1@XzM1A=$WaA4b3 zx7oI}`FmYYCeW6Q?ncSs($WE&KQJt0TEQ z0mg6hiDt2RNz!y)` zKeR=3c$cBc>bxg7=Ro=vfIhV*I0j@h09CT5z?Iq+Mex;sHEJ@X$KtgE=09bhsnH{m z3s?5>Aw3qZb9gj{+Ft=8Z~=u9`$;_vGUZ1`5tc!3(b6dEh07@87FAU z^RetnxFMZ}@R&!#_B`Sp|F(4HV86q*LD|0afZe-rtnXwbZ)OT3Mb7S`)MlAy58#M{ zOYYBcOPW!*lS5?$wbk3vU%hX$irr<^iyE8idClr-qP7k{ixoV|ojvPZSS)&{wMDol z5*iMK8FL|v!AXUMy-4GTuAK+Ga=YWBtim;j1ZV32E-D>+Z<|Mnx$+e{(dBS2)jBKOL% z8SaNF*9e1bOgx1F6Sn|fg`Z!GbUyM1)gE&ksvaq}URUeJbuM_s`K+v9yxw=O>dS!9 zI8)lo%QW#9{Rk*7?yb9l1L9o~`)TAfc*+iT)ivf4fFD&@z|*zA;ESI`yYUS+;JAOcIhB;uA>G7nYq zvQT!(y;O^&)mZeW*-vG`D44MRrpQG!a-mh6necF<V#qM8YwMX>IgUZPAD;ee#Jc zQ6MY;X4SSTDVI0dN8f zLe1&xY=`g|mFPI=IQ+vbq#+%Tn1xUn>bI__H)Hbn4^n$ zW)}dexdG}1b$rV`-pDGMw({|PtEToG;Y>Y{6fhW$#*BW$iP^)lHMpZ@FhrP35#Q)! z2RB(7VVeBY?cC_n7|9Xw;;Bk*C0-B1r9E%k7mNua#W2{6--TOKAN5z`l3WkPg#pK& z!E_ql+`cd>kC;&SEtme3?fmJ{sj&QdRa2CM+p`L58pjsHn8pvL9 zRR^PWSis>+L7L5VU*da@*+fmHjQp zJZAW%0{4F-fnJ**rCWOlo;kiPoW3jP66nLuGam`Zm}Hp6X8kl}!~Db~E0-Q&x0ucc zJyrev1?PeVm8}5v$g?~I^^(yvCJt7;P>;{RA_eUDdJOvnfY)D8p~j1JzArzZKNgVY zkmit3@YMrY19H~XD2>k2tLI%(1C6IQ}w*x@@pzZLDdn=~c;9%xBpma}^ ztTWuuER5Dc$S)EZg)@MBS$O13lR~x^d()I4M!@-!7aWd!K_q;rvLnFyg5jiPq%FiK zErTKV8L%CY;6KVg)&n)!Ctx@SKPvFe%l$*rtY>%28JBMvMGnKFo``}|sK3%cg??54 z%v2mfgyBdSRKTL=t$fE3W(@PA?T)mc(s{-=KX)Om+tkWG9@?X>DRoqOOL2IjpFW;9 z%k{lG_j`ApQ%0Jwgfibt=WG0N{JiJTox)sp_@c_*CYVUCDE=xz=^GuaoeSnDiU7II%r% zvF`3yZg4P=n@qJ9y5c5$6by(oK|yu-{h`|lvjed}(tPi*93NHKaQA1r$T*~kIC7Kv zdY{wWZ#k6RV#Y61?4~3g)nLFt_C^LnA4gE0E_mC&~5HB zt^Yqc{7L9;p?9PIOxU*}8{<;uweoQP(HCzJ$Pv<1y~IE@w1v7F+jZa7$EIE2bA_>+ zyh^}C$c070b-v{bIaiL3!<3ca)eyC+sq>$hk4~*fY5`^Q>N72CHP{Xcva+VU;pR_e z(Gk1;sji-QVEERd^wPJXh-Js-0#jKxaJOlL4qzQR>+uItpH{;$aE0<{IElkq{fv_L z{~~J9NF@-<(EchrMF`)ta|5*#=QQZS)}6O;8{&KI&FMg65w0x*mda^^a;ktO_Lipn z#;U|ucH#u~@xl$)y=7kA&r|c{oZQc)^3}=p?4p!kA0rO+Jqw-Pr=j7a;V#XjTQDo) zv8%nf`{wdodQ|SohNKP2hA+w2?;ArsZ=R7_Exk0o6m(M#nA39Aualmo>-;D>J{n2s zr>bDHsqj=qV?OuIWLZzB5*xcJvPC%;Y~V0iKt%D`*l~(p8Q#o2BZXMBeaw6WzE@}TK;<^~wyD`UH z(Msp*=jTVMRiEcU%iLoG%1pOP&I2LRS<@XNrA8vuO~pT;FDS#NzN$*5;;@@|PJ#&q zF*#OZzXFTP@Y#9SD+8X%ok{CB0q~Z93T#e&)1OcN`7BA#e2zVJ#`w zwyonHoO#}fyw%3e{2yCksbPcgB&IzKjeKsEnM>WVm!pC&pGI>H>95jyR0AOE+HU97 ze~9uQp_Tjz`ZF}V$cIcYO<@%s??1O4ViVepNMW=q>Vo037P+}qr_ZouIju2S5cT}B z$Aids^}|lo^FJXre0yB)W=uRR-uPOp5%7H|e4o7Ty&JtVvslcV7b$5eVM)n4n0^X* zviE`HbmhY-C~?;buE&!@J^^t=03NY5Y_VwnY4!ejAelI=#svNo?+GKz{)GEBa31$A zw$dZR3(Ff;uSRA7)%$I@W{(rtSR!tWhHLhO>Anf!=EjpP7Nq*Z{rrCoCht;xHR1av zMIM3L*yydyzJg+&&%$K zs0(6tj{H#>pAe=dbi`$;@KQC#O$*b6L||N=iFcOKBxja%w`enPa5@+RC^X16Up267 zV^d`b_v@i!t-X-2ZbeBb`enO)KOnjuui{+9`e^n6Cl}fOM=s_|MUNa8HmJu`1WIENLigScF!HQA+y09`*$DZJs*z$=n}2;d*Nt3Pk+8SLF37Rc5!-F@w*0L>w|K& zu~=>zvq@}Py$mh~LVs?oyH}G_g23>3nk+K>fd`*N?r6VfpO-I0nAN4|j|P!h8?_Gx zk`Z8tqX0RL?-d!H+^pYk-WvOM1Nm#!2mpQ{pdSy+;PxA345B_R?$UVwG$Nhy2MCb1 z2;dr?8=XG)f!A<86N?6NY`4c03Be%3au0o{r+|&T^~eiztrYrNAr;9;>J>i;Kl2Ml z&BN}?go$Ber_#@joUbM}!tpNMX_R=1H3TTZ{<$;>Q5YrooT6hb5|&V`%&;WC51|yS zjobLce2!Hszo8=jyYz4J+ZSDozQa(@`kDC-UjCq+vCb+D6{hpGmM_aL)fD@L5BSxa zG!6Jm=4&vfAnML!7!;u>P4Kd-xui`C>Gg{GZo2fd*V!wTPEgi`)e+T9<)GuIZ>dtr zE4NJhX>eQq27QH1*p@e&usjV^`}^X*u^{=u90tTw68++2!X@r=9-iQ zX#ZI4aRO1&N87c(2sbs#;~*L8t;i}Q>I||ag_dNCz<&QNxJK5}&j#%QZf!c9rp8)P5*1KR5&kfCB`43K8Jm>wB1BrZ>G=44V4up!;e7^#Q~TUkd>} zB0$I`(UAH@(0?W!pm#p+J_5%P_gROUM{f}k_4fdle7}b=3^)mN2RQbMdBdYKj)-@4 zAQfRu&tob%N@wszIJ0J#^Be1mH|{N;{kU1XUNi51YbU<;v01WyW`dM5FL0!hlgGOD zE?dx~E;s-+0M$mJSg?S#o>gp(b{?a70Pfrn9A^ba$W+fn9F~Y{{T85q)Ba%71nG(U@tBJi2DRU`hw)w zAoQf_m}3=S!(FSGw;z4iG!oxE0kLorWBnSV<61HN-8Px5j^?(-P2Xk03@2!{Y1S!H z8R1^opP8;(^Ch?aa0(AzT{sDR#r++}6~fMmyXu7?GcAo=IWw3=*1-W?5kCNK-BN!5 z$Qi)QGg#FSb92V?kpDhM$nvWW5}-YH1H!)ubefd44LvT`swVJwAE-j+?vcl|CMr}V zbiqvNQg3`m%rAwaSbAauTPXRyTxx_8T}yRzvVJCVV= zk#Ly_`ZN(S)AFy{uYdZ}KVr0u=3%VIzn1K}x z$o`E}l6Ft&1Qa1m= zHG#66r$lEE*xIyj>nJ8Ip1T=dI{NNndFOHJTGd&NqA2eurj>o8`{Bw- zTw3un9;5T>jw$_+^yl8iOZ_hnML(~f|o zs(PWFn&ImPKOI9fpze?sTU&`nW5Yytj0BFlVc<7a?HLd95018b5Yw6=6%TKmXa5D& zElY(xi%`gn_G;`c?gF3=(QtzG3H{B_z#SLRU&{nra}&f-7OE$ZV^foBdcQ|J7t2tXTIFrEo3!}WQaZP6UiqwRM{AyMG1T&GpiHweeeE7 ztR<)tw0M)fbqXgU`uiYq?^oNePC$l%b`<^phbygC0B=H&Y(6YVKNv$qslex#kZsL5 z;Qa<hPFht zLrrhn%UN(00~n`SG0R+5?AQ}M*UG?3D8W9<7RFk*$=7d)kbkkhLwnoudbpH4xFGh2 zDBMDz$5lMLBDo4ZE#&pD-gTA}TSQ;uQQ&9AlYp1k{{irL1faWf$n9ZWt+S^N{ADMvQXf_~74G;3EbfL$|6QRP=HQKjx z{XNTXV$JFGinE+e7mt@5+!6SW&wx4Ksl)mNcH9#PNH)3&JYV_J{L_M+mR8drrgE`F z-K&I5-OS8lJ#v&Fv(J(UkqC^uwI4=Xezq)&4rKT;R6Bmg2r6*X`e;TNA$Ig|?dgmR2KCzvi#!D? zFzb);*~gr3da%8AmR{nNG{X8$cN$Uwb5T($^@r_yHsD^|H&aMGvm>gDjjvZO9%2Eq z3_L;3{Vq0dZV--V`iqo*`^g7J1OCKWq;?`D$q?+>!yL3lzPH=mc|SX^Yh4$zqq*j% zs~eNfeh>HH&*MLFL}7FNR9{#w)oC9>@7n1-Qnq{vze#Ful>q z{S!?r1?^dDICVM(KXwBJR{F!iM-w{Y6YWcI{kr#Q&^)aMy&7_B52E5d7K| zeDVZ^A5Jz+yyh`EF*`7i57njM^|9kUbr^kJGco=g_onPC^L%UZtJbHcbwB1$TxIN@ zd3|Ijs31k)8vM*C&GCt}hqUd4suORR20eVn-dtCGveK=J>51mI)k#EaJ_Oj7itGF3 z*FPV+o@VpM)S^#nlBotl3-I6I#<|=ORm|JCvoE7eQB#LXZcFEJ72MKGsp}8!w*`K( zPsVPhD%}NV?8R-VA@bxoEV`?YP#rE4sF8}VGCi*`zmv!bt~3|G<4y8$8YFLMhk?ZA zfY{MdIrICK)HC298W?+cIX~k|nSdI{?q$}=fK45l`1hcD(jO%MJ?y_h0<42WtaM)eF$(ZdQ^%CTrdnfwyZDTf%GZj!m7u3Y;DO2p5`B(w zMf~aY6!Ozwoi}1%B9WB{{Z3!O1jD2o1YHK{1-wt#ZiJOcxx<3oqgw5=yIgOtpSrfj zvl0BFjkUj%zA~$2;F9NQJWSu7fa%PaEd}}fs7a8J@^s{I{Xwd|;j&s~8Pv}!-YB^G9LLEcout`Uf~ZZ?&R?cNz4%!zcbDYnPUa5 zvPcYq7^8@vOZeW>7t3P83yOp8>&ZPFk^0NOvR^S%?m2;?*jw}*e*EmRuhV9nn{2f` zNy>f2b-e&sPF=O<*Ct}!ue{uZ%+mqchJ5pUw>Ryi<-ZM-#c+xjvy_0j>n=Mw!K?N#suCgC{mxE7DgbfwaFIG)x#ofG<7Tj4 zA!n3uMk}QuNBv~7)7e)t3{$xaeDkxqNBSpu8{&1hD}9b;?;IB;Eq|>5T7fbFnuY;( zZ(h-^Ev`$)68V`*I@b){J=qzp+3&hsB8z;c(REIQYbut6K|J9H9DJ)8w|I$2^O z@~B^ZW{O+0@^kZZ@!|J^1%c6$If{^PtPrw0841Hy&ea z9Qv)%=)Ed;-yGKbfUei0e_>l1aY+W0-_H%kk(*3#>pP#A-TidP{ z>QcjEjo%oHy|GOBw1mt(`=(=<7na9Oh-Jh)TRl_E+-V3-$`2{39CSH{Pr zLy^L;4RlNFXqH&<3D{nIJ((GPDfY9Z_Xbu;>eXsz2~wkXq<`wk^fYCC;hz1SmW5Bi z{p3+$PpNJvsdVA*RbhG>#7fCf!Ya`Q4)w&F=1H%kk`dqYtL7is%Y^f^HO}%ifn*?G zrg^ggvl5-14>{mA^Q<2t*kBx#(7AeVR zev_;4UO$@kiDED~57E%@Z$Fi9$!k!uwG03;3N1RpvNy_Zj3<$RRw#kv={d5sWCoSl)9+iNsivO| zU&&HFA-r=-%rRESM^KQV+T{^W&rQl$u-(fLm;4a8YdYa0|6Dl^J z5MM1dUfAulc2lihaAK44$$@66tWZ0^ z?(tiN*+~>e`}j3;pecow!oV@Gm4sxcBr=_>4UGLtX9W98NNhMNT-Fuy^D}U6vLLg+e* z9aXO2Pdz&}b9)m7h=@@o!T_T|U}Yn64@r5aHZ7F!E^#h#u5PpLJHt^m1^MX9NyE~+ z1(1)4Z!r1mpFFW4FM02aF%bPI+Hkg|(AZBhj0{45qz)c@I6)rux@Q}?U{(|6RdTNe zd*ds=`4g`}vn(JiDWo2u_B&I}3ihneWXYADKum|*`E>UZLYPGR+lLb0XyW9?oh!KzzqXPyDG~GpiSYxbpGzTTYTPF1pdDW47)mZZ^n;>It_zrP+u-DsogDq|L^N2iyI&@feeu$Nfedk zd7QZnU~T8-Pf033kS8?&^W@q9T}HkGbwuv<6s3ygS?To@xet(~nCAP_CYe%-qOASG zp?@+6Ux~qmR%#C@{B;5(z5iz=W*YBxLpmCb&)s-eB7ODpk7NX!fCLErj<=Wns3vlp z?`tt3j|=OSEn^Uqbl3|igv*2=4dM>{wZh_q;%xsr>ywA;@Pnn#jYgBt$h;H7vUtXb zn{3H~sjJ?EMPc7RxfQ?@2u2uoDl+=BP-?SonJABfWtob)$E+QRmHi5-zz63I=Ybey zOk6BjbqsCH_++4?rq>OD26vVB218tE4s*%6=#OfZ@DzM~ek#hFQVYst%cVVg|Kjdj z(f}ZKX<>T`>>&eGxP9hO&(|jZ~I7k@u&>lZAZ<`nK($O3AiB9yk z+8*8`e!nRCx^(AazjpW~z49}}bwZ4fm!maCnVwHQ$?y+`x^mY|! zmc9aqsPGbR`3YzSGDrMyoJ{9i5ti~ql+H`)q{j_DjRdhgP9r#ka4dTEHMCX(mOZ83 z2wNPO*o{8{#HImHS_!LM#PUMtzEg*}$&UeCoDJAA4C${FM!ae5__161`{q(U3qQX| zJn3r07%yhTV*lEdTuX599#v?!CcW|dRs*}J!h3I9O1h>esQhT?7=uLDhUkOsuEklW z$qR|8Q_;t&$IcdRi#zr1w1OK+r+i-V51)BH^eb8@kTC0dfn8^2;=}B>k`|#4h0)G# zhS%#&ZJj9cWRMftvM16gSI9EjMHUOrWGa!#J53((yQuCGo7HptA2x$21{Tih1w;Gl5*KjT6q+egy^%~ys8HA%b|yVBOWkuao8@Qy zKe7UuzAs$9si){HX!|9f%6?6T=!&m5JpsvV0`WP~56*u+2p zbd_Yq-q&UIi#n#7ToeN?C`nDu9>Y&!m#)0*PJ#VkfF@-R6r&m!2N&xdE5OFYOy)0P zkjG&AZ{RZ+t3L$9>O^qs;2i`gds00aKY+`f#i^3cAla0ePk?sMvvwi%1Kf;~Is(}v zzh^oLeuF2Pt9k;W)x^HX*aB1%WC*ohSd_H!$v#mDsIdawv>}D0s2%tt@MZlSU ztqKTZ-w}&GAnqB@Qwt%e2>JF zp}*AT83n%Qpt0fff>uoMyBrMLV_h{_;7@*eYLtyswfuFq6z2|)BW-JkzoBKK3E^$T{R2}xvK$UOL15dc_P_#6`!AhCgx;R=B@yk`I28F~`Q;Q)w*^onodFrtfne@aKr9IW zVG`HO8dPNSjc0TUTIaY~;+b`8(gnxO%LrzPbT`RSKSK!ElXp8VbcGb4 zk*$=}d-{~5SI~)!z_UP{LND59ffl#zq%e>; zh4u-g2Ds(|9MjEb2Z8_dTYDDhzX{N~%vu5*P~c$a=4%ho2jBI2-U2)>%^if2W`v=Q zX-EMbYe)lBCZDoC&c7lt$}tUlt^lM=P#2vd@sNWd#;#sk3?WYm)Ep`uq@wqw-}RD~ zN`)+p$Xo0GWFGx09r?Zu>4Iy~eZl5a@@qFE?GJ zZ47grPOrp;#f8KuL?N9l$U`Jkh<>jE##R|_{+JNuDGUD@QQ&aCcPg7~Yge?gZ*fs(p7og zjbkfdR~BAF_yn^QH~=kb%}?t=6oRFnQBJPLqlLc`Ea;@e#j|$$zlW~nf~BKU4bOqd z02YrNsPzo|JBAC6y30;X%zr-#98>^ccb;!Ft1=a(#$B3`gG_cRALZM!m0KfM4r01? z2=~aNY;$!!k6Ljl`R`sBES6k_zK}(t#B|!naJnR|BFkT8(2Am@u2wsd<*?ZLxZWGh zMdO#!nAl5?Y@I&;lXH+%%r$MOCiiy31bLQHac|=QCz~X^q4Wf?ZG2qhP&gMel;DXW zZBsQ{6GBq(4=}NC!vJYp6&7h@yRY(f;*q65XOnI;c$q5w1lR$?Xp%M{s;VV0`F0r1 zBH{dtOmT%E7R;=81Uke|tBOG^O%iT_j9#Bscl|YL@a}e}U|d0g*%8h*xLOjmP>3Ht z=O!R7Lh!5FAth&DN}|DbRFbg~ zfWfn|D1s_u9a@g4@;Tcg$le5JQtIcsHsn+@SxMU8}FLjDGC2=S{gVXcQKE_P$J@=*gL>>g-R!D9}9bQL@zcV<_6;C zhLhS3FL|k!!umc;0T7HoeAVM|;^=n3MtFM_o9dr9RxBdWN|BaWR$$O64pz)d&`D(> zE)PcYnzGr{oqqjAUXEbe_!LbueamUk*nyr)stG^)sr<@^%Zzd}T3?-WJC45?QlBPZ755p`HpdIT5JT|m5D`*=vloSoJZL3f_$z>(VXw>8}_p>haHT0gNS$bv$kbQ==arA^3!*aOG|)U zy5c(TVLSQ&B(e%znyBz6Et{Kl(qZH2I$_8rpoX&x!h3m=GQocvxbP^UKS-K{vI+R_ zBzW)X$H}n6^oKs^Pw5GFnvqjLzS{+MJTZXT3tXQeYu_W>oOKF`+>{rkA`c~uedZ&@ z_D2Xg>ljz{GIJ9YrOe)mbN~L_udG7;Zc6c$=83M|MB0E8waR#GemaDN^F!`ei90&I za5wN+fkuK_Qw(a#+@dLA3bUcUpAb|V+8QgVl!Y*44#Pai-$T6TeicV{ej+*Shlhu+ zA?`*?dSWk4dh^tYl{_Ns+xq*F{E0tDrQ|X;K@SYyCwK~=-6I=i-u3UC(pY#IpaQ&u z$cTz>WGyxg#(uW7-45+sIEjiO zYg>A|T!F$llU3O@3Ucn+8#`_cZ*C$wqCsL~saj|eTP{gq(S_@6Scu*$ew3IFBW^J$ zqCaa;cW?XC`)-<4HM~?D{CR|&wKt=4@Q2a|_!pmHi~d2U$3g7CciI z?eMwk1Bu^nm`138JRVTr2CMuEdkEYF5!swFijmeg_%ryeEp*kHU9ms#)e`x*jrmct z28L`wRPp6m!n?gDNsKZ2)_owr_U#(?gHpSVI7o=Y-;|kO?KgqV9%?dK!9$n6eE3Fp zewRoa5&RKW5x*5MeRHZ9vH}4iVah_W8w1_n;^LAk0N+&t}cS&lzqmCKiUWq$M4zWjoSM8Q?ti_3`%M$>cahFY=SqA5+$p#S+&8Z zYovZz0do(1kQ7I*Wk2A`$<#3?&I0ZsO_j3Ojt7n%#Q-i(&yR<_U@fpCD&&c41`V7G z;5Op*pB32Q7|>_ZA%*YNBLG|-Hwk})scmb|(zIWZU>_|gLEfi9)>7O?uDAf+AM9K% z-GTqhvofm&1Yn9Z1Nj?M`CSh*_~5vHpelt1_uU)~x%Nw@RJ7$FvFAfUaSMc^20IMh z%LVclDxRHD(h=gpq^CL~$aeJXj&x6zsd3V%OkJ2}UD3sjIYTI@Yakd`wNX!VsE0W$ zvE@V3khERbZst#0Tm9}gHk*%O`|~3i;lV=JAJ)nOGw}YHj8^s1x_sa~4Ag!8n2Gg- zXJSp|N+blxMniFQpk&x6{f(~$CRaVJe(}|Q_1=~Sok*F6c3A|j)^Ed~B58k;frxWa zbe9O45u@2p983GP&o9WirSGTbGgETRQxtY%VCF$k;n*1@kV=01HCMjd=&ifo=rWht z&Gu0A+jKD`tt*DB_Jf39V9?#xfYALDFYMBu?8`M__NsdUNRy*Z!!N*h=mNNj*a1yI z@&Fki66Qz@fKl=DC4MJe{g?ty=XZ65fb-pm9iVLzaJ)>|jkrojF4=8MSMxi6i5)_N z!4%MS=7olr&1&JC4K6@dWn9Y$A71B750J*l7VJWcBh-KX;AtQ@`RcH-DA(hQT~U+q zMZ@G}RduC%p{?tbL+LyHxzebp`k4Oz&>Cz)4wS?#f@AEc|wI ze?NTphgo{R`*uC&K$DYY*d48@v)IX-FKn4qUZH&@9Xh1rS^O&4RByB0{uJ{6(DjyK zbwtV5FcJd6g1bwCLm;?YAh^2+cL^>B2<{R*Sa5fD2yOv_ySuxb)8EORxp(H?cfNo9 z^wU4Ockf+QYt^c%X#f*=4^e!{eh|I{Z2=t@fXpKZt+R^=5QgHyY_jOjkabPSI@&tx z)iYCeC>^e@fh_+Px~lV@SO*UI8K-Go=(E*p0{5wjq5Gt7$5ZF6$PHNmA7eoLH*Fz8 z4l!&gn)_%=v8zD(K}c(7DU0#OW&Z?QAdx2QLuI$jdZc2u zkREt{dGsE*f2&E(BINfn_$-TBS^D&HG}}MeR5bYR6Jo0}m1#2mtKL8p$x9tEyDWK9 z3A>!d6J@S?T(lQHj#Z7d3Mr76lO^88{`eac|7<4!*W02FE`;_C6e_aXE4_8lE$+~AeTa%?Dzbe zCZS0Y|TZbjT;)_+_$BsA$_ZTYYq1=-k+oavPDp16rhL%U_;)& zC_ZFg2ycRVfgs=w^hQzk+AUx_RKaUH+0usk8~Rvm>|nu*VjlJtu%!EvO_CO4>Yv~7 z>-|_x?oOl+j$;U?oP-B;P~=L_J!Wx{C33|yyQxd%!mF(GVVeMRo$A9714a?Wr*+o2 ztTH4$ozc~ce)a~hGEr%E4Z%cvQsOJYKm0tV;)a@f;#m%DgfW)x;jPJSSLLOI)30GX zXVTxXXnA+!^PTv-$E(NiF!*tW9-6gpp@HkY#??fVDUM!p9v+5@@@O4iR_%n@l4o`Y zZsoiKC*$6MOLHLgJ(bBb_v99@XP#9mMb@75#^J)BETOXt&c%2mR}U+SeXyM1d}cQH ztjXt=#_fKXPu@JJ&`q}BX{#HUA1i|bWFNkJ3c+aRa|vn6*iY(9(Mp${uiD8Y96 zv)hS%_(~JBg?XcfR}i)a&8H8FBd355}4T-t~Uh6oAV%PVJ*KEyI)<4yRr)9WIv+ zUW5CQQ%NgtD7-`t3vkfkFO#&df}i#%=b*L*>T=eT~z`!7^u z8exJ9Va&TjoxzhOYf-4s_;$IDIX8?z2C{^|Luc7({gag=6%hkpCD2%}o2FOR! zufigKyoPEQo#KI5slhK>!1D;edO1`*KOBGf8u`0|2^WJFC~fW~LCawA;T3`P&H>D3 z%T1j*{dU*uScQ`;7Al9<_?5^?9UB8s?-(?3%C z>2bcGb=RD^5BjKj(`}CKf!X9!nkd$trOGNbH=O*8d@DW%yFxABWaGv9RO$u!rf@GP z2tWcbA=EEY53zoYxc~=XFbcC^0uX1BrksEVae%s}hsld?_Db2j?%L(}}~c*w0#6Id+f7C7*Cam;Sg*E^{yMhC=)n-Xyg*;m?@+&#qKnApeT6=pj^GRyCB zIL7`A?A?3upNSZpfzc}xL~`flOR=Kqrlg7YeFXQHqBFX_h5~+A&=1X3S2} zY`3cMnU2U#Zwm%_9X{#YD=~MR*&j21Xu}Bjl%N}csO%ThC-lY_tahsr6v!I!9Jhky z(O`eNIU19K5%R>tpOZCL^~1wrd(rKVr+?xd_Ho>_W9%sid<+yr-W~$dfYg)lG!PGo zy@8HtqXv`z$6E&$*AUQ%t}f!j7E~gjG6!U;K&rsE0PxUBy$;$n14D#m-1m^~lqd8a z_MznBMy}FH=;--JzulPaRU-tpL;`H2lI`)-ubWjWjiFKzt6^{ITGAB-$QCMEMR!ki ziIh7&Mb#;>1R+26lFRXQBNb?>rp>-=UbP9%)H>Bs6VKQCs;zNnXfJwK8HL?jM#{YI z@DAcXvjfT9=0|2}$ug9hMk2O$2C=DoHL4JbXC1KaXJ&`IJ&c`D%Zsj0Xv;64ce z#K{S(!?vMk5EbVw71g)V`V;QoIS>5#?qlt+$*e=WVFAyIXPebc7*Y-ib~p((p)AQAG<=;j}9zTW!6S{Y2dHih-O7f>ANe*tZ8 z(hmdPlfZg!{9*FrHa(LwK~OgC_a?iaL#oZ>Io}c#Rb)=%lkOI0Vhv?UZEnGCrKaQ zNxInDE88N#Uu#ghcimQHN`m(=k0B2Ba7vHhifj5n-anvU)wno?xd1n^J^(9Cbye2L zS7~-c%^FQYhVk2-yGvHxc#ls?oG|6LdPQfcu1vqvGvnGTIIhH0YFRWcR@ur@;8Yiq z_vG+@W1WACetZ`Jij=@=MAAR74#_~wK#@hkL-thI3+PS}G9y*E&9{-XkFnd+6qEO+5v z;jm=$z#SGdCqej`83qKn_pHzke&3J(xkJIxNa>KBcfKyMN({DfU|U-s35ldW8#>ZW zOKkkOH_q+p#Xs%JOZ=N%fwqcj5;_~*>YyOM*hO4JMdN}wO*Z&t z-#%26MlJk>(^2;!rU|MJ(#B{h``HRc1xzZNhimgP!}3ZuU^BuJufXic9^bgisE`-* zf8ijK+F@|`skh?7|w?^@do_Jy0R|`+YSVekGW%jwu#p=Hw-{f~CRsh2<=cO}U4Oi<!8(9DMGcSB)De6Hai2 zY%W~l23!x=szQn$g#UBg^Usjzu!!{;MBti(U|9li@-aSwva-Q}9K&+z>`$YD` zIl7+k<%$_D?1SjUY28Lki7T8++I#BYuo1J~j^u!SDEbvb7&>Y>qKEsE86^Kfx7!fg znBy>A<1J7ikiy)|SR@u~%Ro9+D29|LI8UAG+E=k}dzW$JisyKppa!-48oz|qrH4I56CyWra3-V&@>Wzxi}Grj%H?EsGgB%G4~ z2*~>di29eW#s-SAD~15$ZhcPNo^*_yG^h$=aQ9*I@~^!k1RjS;($JMee4c7WC?HJa za71e!sqcJ;X}X~=X`_87CH<~zChN^*ls#s3 zTL*kCXPyVR$C@H0<3oZ)48^ANG;j)4YJkcA1quEKBRm~y0_6ChreNwS$?EnzlHVqP zFcB&4aToN|4h8}Dm_Wu-l7Gp?5LD2GqiF2P>;cyABxpZ|HLT_dgNJ$+$_s>tXjF9) zM-!&HacBQDHGv{97UGe$^!pWVgEk@OU0e-zO(8Baska4LHnq#MQI#&;ng>Nh_a)Ql z!_6VFZOZ}P#EOX8TEY@(uXJ1I0Xt}bSpq@)Uty^JqoE!OcY7OVb?{#u6)i;g-6N>$ z5zysfCuIi-1WHb1JA1w8Ai{d!)w+4pCdc%(zkT@u6;z6BpT4Bu4E=Fpb|E2^s&<9C zl=(sr%>QyJy5eK)_5Qzx-Blp#Z~%0J{_D@qOeXIF(R0vrWw6dV0>UIN9-Ka;zI69pC(8NZJ7u6WM{dBMD}-Y^&LaiVhIWP*w~De547A z@0h$j`(xJGJRj=Y6p=M&kl@8tPsnk5WNMoLk#!9 zCqG{sMS=lS0Vr!P`11t-ztmGa4TZGfi1ZYp_)^SC-nAyt6d}4{m>@b8F6vpw2JeTs zSPZi*mVcH-DKW2mv~1vPfW1BrxktGW-&^pIj0!ev<&ZkSEy>+%CWVSNnu{w}lZp<~ zQwOTl{#-_c``mt`ZLJD@PTYXi?FG`f$M=V4wonWoVvM#o48Me^>8WBrIPw4%;{*hDC~$XjB*8?^vYjl()bSL>Z3KVK>4>F^SxRs6g`r#{BgJu@BQa^VkKmN?l#_X+1UiZi z^}obZn4BrB<|3j5k~Y#}Q|b|>=cVf1fwqhVVn|Gx#s0KkA>zyQw}2OfQWh{Q;x&Hp zCF!*@k2vV}x93PM01O*)kALw2sI@E zjq-qE7z7*q{z>sB`vAbZ1R<^oS6qVfF0JAr**}!Q=Ylyv`i5y32>+vD*(=W532Rv8 zQ+$tPC4!9{8v)NAI51x7?qXoDK&rp9Tx+fckv~h(ina6G-uQE;aN!>Z;xUjuv=xyJ z^2RoqfHprj7;h_kM(#MYtNj%vuI|R=m+w#77o^dMeYmB_2;S6c1Rk;jXs30}ocL{R zGJGC4oT$$5k?N;scj;}(j#?NkXM&y0coWVxnkjL29aDhqTObkmH$vsVPa5dyP#bu= zj-Fp8cE+P6d8q&=stZ=UxE+25Vq%IR^I1!v&7o@dH0r!o3}hL^4~(=%DT}Pvl)nx+ zw8(cp@u4?2ypA7zKt&xg)(Og0{^ZY9%dyOwCR#+puIig_ovg6RE&7wbNwt7Nd1V(Z z-?{Xp2zly|$?7s@ck>*t(LM#%Y1bJGOIs0W5`-w;c7^>HX#ZzG44s{bcmF8C$F5gt z_sTXB5ag$S1icL{f`Z9tpi3cUES*VM&^u(jh)T6W;v%y9{K?Q_L8m8v!4@K+l_mtvy1dv(>Gy&?RUEOd$j+s0&A&3$15>YKMgiSD zfO-Uw{BI)m7jS5Sa@DoZ{qz0kO6AM_xjI|(bI8&2zHy~>x`;b;@EZZJXU!5~}o#P5vm3jst z9|@&X&k)+mDN@2o=Xj}uX=$(_fvNEXS_ZOC-(Gd$8FT%VIZz6hI~Kr@8xH>J0mCXV zT9ZL%x}t1AwsaJi@mG{qXc3~wiUzOic&mL)14g|u`sw(C){pT-{dYygya`~$(q#9> zyN6VQE`50Lkd@u$?)&F?XR7kEhPyx^rDMa(dbM5haF+qov6uH7ImO0`;k8uTMP;mx#vH@$SI|3{r+l_SY8JEwuWMY8KZ3CSK~w$r zXCD+ffDI{Z3Efm+%9)|tR<9O{6x9G5;DVei%@vcJ3v2LYL%4QID7|C{>+ut^bHjrz zRiOdJ!bfDb>`2c29y!aLWX__3OEGyPWd61N-{e2KV@!Web(IBzTd7xhA3VEYnK4Ghw0o7@U%h+%%9R5jYIYEuhTkHtGgp9oXXO@JmmD9JkA`G&UPsf&3VfXX@k!x?-3vYrP49eTkFUr>10D%lLfjzc8_ zI?BNLP3jSFMhXEivhnUF)Ti-I#;0%RqG5)!#lNGlP@~SV`F>v2lnKe1dAHK_wZk;u z8x~kZy zvRSSJV$pU3H2}gG|MZ_Ahnub_pzSxLX$snwrjYbB@vELbSRPTeNL$ z_*=GVw)$g^n#UsycqX`9&izmYvk$OUbNA25oMgB{=~S=hPWiM;*+PXL80U>BP9YvivVNtU5B42DT+K^;qQhl?I@DSX&B2~bWa`(qb+ zh<$H6crA`2H76()G^ZJW_GEN!%iih1pngm3$o`Tpizr)Tic@W67MnRBf!|3!sd&qv zbRYa(=R{a{8=x))6#nI^!v6}ss1dH=OMZ3d%aSkX@r{b+Kb*MbzGEqE8`z_61xoEXBNqHQQg^v_6Z!t`I6Q z?)>Q?vbJ~&Qz)=i`^JWch@3S0M;2OE*G6K1S>z#%5K*_q1*VU4wOJQ|gcL4E)qRXr zvy?vpziXP+K_nAKQ#{Z#3QR)x`@b*FdB{r_Mr1gWy~A5*4Ew$>(F9U-c@T94T1SBZ zf@EoDCAC5kL$~Y6ya5o6WfUp|(CUyQy5YC=GzDyfcY{r$a9#$_!Ej21#H`W7MCuJl zjLxlG!M+HgEXOuwcZ1r8hPc(n&f3;h9ryHHH~AnQT9BxoU9T4$u}wekjN* z?nciqj^2OWmb_&GDN)hIh%+^RC1^T@A@wc7^~EpeJ&PgXPAu^Y-frx5UU{;$r)UF@ zSj=!8o*mj&`f$z5m#^Q_FQ0f)P8|jugPy+w3PV8T4wOofhEPAo{-2Ay?9)X+fcwXK z4}5Vyu>VlL1Gsz?qJBI#7y>;F*^a=|xl?K0!?IVcPN58q9a28RZU)+oVIRbGWU$Z6 zE}5znj0>7UQ^PPuG+rAjH6lUE8^{?xVPu7GmGAKE*COebmpiVgTazG7iqN1^_6#|?zizsg;bzqy3iS1P=kwdYs^Ih|NGlLaEu9LqQ?GDF6UoP zQWLzc#+QrqdgXq$mC#@J1d2ACJ^<&7mL6gc4(k`|O&+Fy(sNi{E-+5hG%)jX)Wi7S ze36@6ih08F)H_LL36_C+lz8wv;tF1*o{H z@o%5~n=$y=-_?qnkLh0eNhTMXg&7kDhnh9Zj^GS?Ys?NF>j$nKMHkvJ4F4g%ZM zbu4gU%c2l~UK4*IW8n77wvMp%nPdzaBol>YHBOf9Au$=BH|lmO_^Fo+IzC9EkdxJD zjzrLaLtS%0Ql*2YQa7?7T(qIwPCB_s%W-~=X$nvE1XTMA;`iZP&$uVskl<~fhyv9q zY+0sK681Rc@nL;)9^3q{h!8_Rk+dhNI#;GLO&T6Mx~QROH_*f0j$0q&9q%hfoDUPH zytZldvY9?-v_+MnSOW#|?l#MxW0d77vsX-LzIf(vMkn@{vWs_a<#KZ4Wv$ef$X97h z4mrbN&%SE(Dv>SbFlf{~%*Z6FB)Z=Xy^2}Ewyq=H-nA=HJGENa5v54mQTQ7~K-Ibb zIflrFfCj{!`cl3@RZ4T;VV8~o(aNeoFz}Fi0(gf4Kw&KE^DC(MhmgYkMG4*GlyXzm zXly>&C(Y?D_Iv6lbS!3ZtrVk!y;OkEiSKu9YR*7fPQbwy{Ios>IW31!eme<)~a?$RG zwT3sB1gWk>8)D$zy};$w!IadOZhgn7lTJU?HaABY;a6)ZwAUW_brHmSFWSuvgyoaC zVGh&dRbP7pgnJfU`q6#_uwHUW_uJ;~jLA<@lHBt)hrAk#SH&Dbu#d@DMG@%T5ZjXW z!Aw^nOFZ!U`Jg89g^l7tFdAA3l6tz@9gpSHW0FqJjqe>PjgQAYyuu#9QCe5sElfI@ z`9aEHP_VSp9WMo+J1=q7H~XWMzYzj>z3~ws{MVNJE3xSUJsOhVv!MD{JPJ?BynuM# zJ+DJ9ft{i9(U-)KxNF1e8+bem&0i{~Y{Ec!b{GL>TXzAU9R zUuL=ev~|VdyH4lCl8NP;8Z*B#+AtZ@uYAUrKegS9`pT!y760^xPz~u&#d`0x;VdcA zL*<=->GFwb?lf=d;G(kKks12$UzxjWn>5nKp7x3pgOBnHXn^$i7&{o*a zDy6^&GIVI+1u39N*MsO{x)3bHZqpmElvg|z0Lcg@`ID8UOBUi4QNO)Cc;C%Y^%wl`V$h5|23JYyLVMP&a!>`V2b7XMq zHji%O%5jt|j}tqJUKgSB=&*bPEn<~`DzyIcIbDno>w$kdRIM(RR$>r8&H#zqQ%>QK z>;$j_v@_W8jsI80D~=+?Hh42W**Clx+yw%!6~*gGoA#EHex@H($eeRzp5l*#{xULg zFw7jmzLa;a)I_J0Kus{U#+GnH;u=%r2uW;h#0BS**6BXw5ii?Fb6&%_%LklNWAU3S zcOnwkvQutl7YXsZD~ZY|AI%(rCZ2lYu!FYQTyO@`;V=7) zu`j~^$*um=(Kea`Z7u{Nvf%woORZAC=c~kB7x*4H&_R;usXAGU#{^2j0u)>86?BSd zYFCMO5(es6EAyxsZ>RRZNS@VE#>Ns6TJJ_L#B5AQTyU{Q{z0Me_6c*xy=gjif6JCN z{oy1O(xv$#^+^5(YAXIqfA9~Vbu-fhnauQvw|N^lgeenrOap7x11hp8qW!B-#DpyK zzZAuyw*8SZ*S|>-_UD@$H4BdY;PSpsU=ULy>h^+Bm1GD9rYit6CP-&u=Y%f{cEq<< z*UdU63M?Nz;W2t^8UA`koNZ=>RpLQMlOQ4`zJIh>Rgf-QmotR@r8F&eiyBw`!^QQP ze?(T#_KH8>Czlp9NFkBNaj)D~q?(pWhvUPuwnQ4SC3J|~^y(oGx$Lc<+S{6S@HD*w zNs-6VEE%cy*z1|)v?>{#L=RZexuss2yE>0$%y4VGj-VedD9vwpOFTx}M8$-;Gxh26+0*2knX`o$mC+En?2GI|;gPT+`B=37P`_3`_A>0XQPP z2Bg-B=*}!8!u*|0DGs1^pZisiAiNS!s>?clCDG8K2zt)O$Ul^lJzdiscOn#C38W!} zxh7cHZ%6(6V{1f2!ZiwshXbVFpl~8MTZ~OQOe3%zd=R&Tby<#wpR!R&{FT9rvx3>W zry#HityUTiOq(5MvW;hnWcAtP4}^{l-QI?lM-apaMGx%vZ9Y0atRwOsrEE-@(rC7- z4mJBAe2cK6d^X(s6mwmqs~~!=+Qrc=WHSidu4{CntM>HKVUX%0%;+#}|0**Un%HmW z+ID_;WlH#0^0*4P(+YsAZRDP&~cv_bLMv?_F)kc7h`Kc*~P z<}Fj_zd{Im4l15c6-7e=`rMx;TO;6#+%#YW1KSE>%KGDR@y-ALf_{}cis?%INR!nwTtxWE`L9qj=~g5rGSPG}6#Fiw z{%DA>ey)CemRt4t)mLW@c~yCCY@380lvH&AGQ@I~QFnY*ri zM-facqe~*9#-lb?QY*%V$Ob!o3ZG=ua6K&d^lwLzM}&&+kUIGT#(l_wWZkIWpK#yt)*(wpqEjzEsuNLLx1ITAx0t@n zw>|Dy?|h}N8>GjlGniC~R36Vzd_GpDS#!PQIeglHzO|2@*(W-V_s?|iv2;58YCmPr zUKNSMyH&29FGRcwI-zhQoxh6j2bkMX-+g(c(VtjbLYZt(_e0eVQJp^=JQrr?){%3* zC~T|(Tz)|w28Gc#K#n9wJYX^XL#|~n)>S`h3O5%Zaey7is32Z02w^!cVnRRaot<67 zrsb34Hd-Oc*n1C&067|ygbYENS>F)uwIn|-I%p;plO|_V=aoq1 z82E?uV8HGuj%wu@yI+N0?}8%C02e0C83{^If?Mz8hzrn@B$6ovSI?{`G;@-~-7#I! zoUG+J|D_V9F82PpV)ujhp_k_w1JgOOaECRnB?OkAm>VozfcEY-ZdL#}x0hvGwRpuQ z|3Xpp2tcOW4_Yynr-G(DeGjl6}?n)o-jiZ@YbHCs?nWnw3TL-b! z0!Qw#I|#T845reesAVI2Gut=R>D8cAwpF-%*E*+yJGd~*(1FrI-7@-LLOlDP(r^1S zB@$GQ%s+N<)jr>g8_x$|u8ym(jN`h^9HL?wzKl=6yn=Dhe8XchP(e!!@`j~aj{N~L zT?ct9V@x7vvKF>yPOIhWUP>~(C_$Uwvl{6pz+$BcNcNFkYlkHZFJY56(O$oR1(f&Ts3>PmbHm7K(Bs|q*qK48}C43xDJ1saU5^qv($pHcKUCi zZ@iD)(5~-39QRQ(c(2d6I(0^rXm*0DGISlBt?$_r)po@VkGXcBxNad-o^es(6%d*@ zN11TSReGZ0v1$-|Vtx)X}fFxM?g}@Z+%f^u+KLtRdAD2O(ObPpD3Q zu;$dAKCZvodW;xTe70C*pTe=Lx=-xj_VbD>o7hSdfXCu`k z79Pq>|Wi)8f%^eO9h`4CTkKn+iA$K)6&|@(X5>Ksh>1KUJq%d75ik z=S{85TGmDRpfpmJGBZ5jQV_4j`KG3J6YFXkb?Wvw0bS~*-iq3IU=&KdqF`8qXN<|((L^0=!F%ME*=gUuj{9To#Kk$Q~~ zgW=eVx3bHjmhJzV^!uFLe-~Rzef{1_)O-J)e%v0IujXHcB1_h*(s1L(uio;vF zl7eajLg>Y0t?fc#jC>UGt;nf&%1KKA1C_*kL!1$#@l|$Yw~*eV!gtbm<~~M`X9ib8 zO~$am8eTbuI<;!Y%6()C^`%YywcdA@rr~0PRHEyepMDEUX$?T|W0jF7(6|hH$a<2l zn8H6H{SoN>=_fO(UBOH>V~4qw@*(6r(*G}j{f>`tFrf;^vfAo3cX<`1X#Goabz1L9 zbK%Le{J5&;EW3OAGx^~TkBvS7I=s)qFL?vfA|e(NlIu%HpYOtJ?z0UYlGOTodBnk1 zr$XPOF5I?fzMoe`@QcZJbeFPislUZ-omieY4$)KAYj@)rw`Y$&U@LRz>5rG8hIRD9 z=5ooW)pI0GXVNxrZR&!geX82}bbRi&!MoA)1GS6{V>yzFLAEvMQ^N8MQnrLIq7u2# zB^;SofRkuQVl;^As=tfjhVm2rj7K*5#&SBWDE$73vW#^#wa4ZZ@``aEOigbvby4S| zZ{7PFGfo<9ZLg9ofUc_?8D{TizfLP5PF%wh*Zo^*hX#al{-z53`fPoHa!2bKaRIiM zD`mg^qgyX^UG)OC744ly`la@}t5dFx)s@;=Pl<{H*G8xN;*^Z*SZhl!Y6D8v=W2;BBM$Cp<3BT%UsTt4FA*cPkE!1 zVta@S$rNGBM#zSrY9lW#4Dojdue>PgUdc1V2AePChl{~IE^sK_Yw6wU{Z#n-8kRE> zx0ca4Q(68cl;>f|_lG-;r!AU=;VyUHNrY8B5t?`jUA4e$hRGH5pwPL|a4@RR-T6~> zv~%w@l<~CRB|+|WUo7n26QUiA2s*6`Ti|yZE*4j(k>hlP-{5OL1e2vz3wH}24OKOM zsk0&T&j>lEkC%Aw&0R^@tU-r2sP!{hnB3T>P>yOcuTW&_c==i6@g9%Z&8t-Y~Fc@AY~ z-|AcR$#^wgg?PkZ&myFx&gA#>D~DFuL^Z*K8DBh2^BfUn-y!Y!74Jf z^?c*=>l!}!8b58;h#_;SoiTkjB5+qryER&EEm$JOfPi`%U`QWo83Xb9ZgyN8IMf~i zO!%W23tQ8ofQj_J*wk;2n=gTRZZK|(Fep0S$M$cY#5tL}aAtc5RA<*Oz4lcMt`jL{ z+KXhZ@M?S=(1M9=_u*s2A6)`;w8D?>HN^hbM59!HR=cSha#*ri>C2w3Df{7pM*nl6V$mwCd3Qp>}cILR)~d$dp1kLr=gM zeWJB_|MSw5Go^6C9G#R4(QwY2d^g2rw6swdl}<>^+{(}O%tQk@h`Jd|x-IWV*uoq* zs;L_G?7=1Gh71SmVNec;_ySMX@G0=QvvYy2ryvHAE-%<+DCPBlnP%`xLj=lDv)i^> zbz_`*E=%ALqDf9AUOcwUI;Q4A*7gPN_!{$E z%Rk<5D}PL_86-oV6;r(Wt-d$=8vi%)%;&o6{dtG0_H!;1Biz`bVNesB#_sd#&sppK zfO6yf7&NVSXc}f+AhBmbfiy2+N4nU~U$Qz5RlA+*wpUx7*$p$5f!;nK{p#)K&l}C> z7T*S@g847Z;|@@!&^(k^jg0)Mg)>aqJK<@6f6z@^&U*ZHKRS4}b$kEeQenuDRDN^r zXLQtq&@?)kmW$^q+GW_X*pYH~AzG0-3ygh$?3V--GzxZ?2dwXLdnNZ(>xb`k7j~c` z8y^8Ot+Rad{NE7VM)PWkYs)%k4)%16`i$mzr+R&MAD(NdT*OUO{VlovX5{_}?#njy z%WA6pYiffF$?p7t<4U)ulqu84lLX!D<2@2?oM%o^hM#gWX?wKNYn7{UV*-~g`Td%g zQVkK5E_l!VmG8of$ZCYz;$Gt>=>8h4wrTu@|Q~Ehz}@C#RnD%3{HDe#My?NkgquV|VMxnr#J7nASBpG_Y41(_|Q@JRK+o z$)Gu&h*MOFnq6VmGE=$E*4R_#hdTcDrAJo&JtbWo=dUL0hVa(RST7Sg#uG2s5p%Ne zYlrkShhjrvfV9dR&T@0wNke_BgJ<4tV-~K>-utpXZ0DW21G}_X6%HEs^bsGwHau4e zoh7VhqxuO3j5_CqN7TWuo6ji^796+ia2oG-80~Ek6w>vq5#D_{tR2Sctz(E$DRfhG?*t!lp4z(JF z-NMHwV|);7uVeB?I5CO)H{nCDsei=2;Yy_^xz!DHcrBlSI-eb#l&g;mnTza~9!Q3k zb-r95^c}m$c50t8^cZdTA~+&;|Cp;rOuOMzho!vz%uRf*AzC-K7Iw_3V*B%TI%i2c zF{0}FqfY7RfDktxllt0)RvxnKH{{>!g_VbNzLA6ep0oa*2^B;ocwguX&(i~&VtyEEwqvhQ|!XeGdH)`YdK7$^s^*CcG%m}a(h zL}Lp&uhe064G#b5g z<}#k9WwggSe;dnx^JCa1lR#cqi?}0rrc*NxW@Koc0y4cg>g9QKS@MJR((Z>q-I+pK z!xCobP`jug*(x5r$CjqPK`qa&QsV2~@&2MnO?>k8H3T-Z*1&y+NDf+3V!x`vvWj>y1tS!B2sV@ojpzH?o^~F_8an+gpUc%^=+azs`Zljx zeOOcS(pq^f;^K^wPtJY&7-&ec*p+czwHEHiX}F@=eOP5ab-_iLj_4JbXzt(04j1+J z4wd=kGqH|qr?EGl!rv=nVE-+py_^EhPU;j|pCHXJ>3Wb=e7VL_p zs~~&<+Kb%?FI{=n@(7K2aHqhe5Mn23nFFnKRc1(-InkKcW}YAoF;n`EX!<7>zp)y7 z{FO_w6ROdc0WK1R1M2WUOe&r19EXHLInyedC&vC#l*Z?1KWDj}NTg1~*0{W+_x=BK^XNlSdLFVUApr?)&mC@Rsdv=GM5zlY1M{JesY!PuOMgJQMQS;(aI z?s03BXLLEK9&pZjl*+80+CZmq8U3QdU-r?1q}SD9g{!OBtHN?+E6GWvMVzha4xTVS z_^h?1zQDXrQxlYiH=p=3wT=g4&v~LCTfHpxwaF~Awbt}<1*tarqPJFtW}G1m*~7A= zN!za0F>4eY_hDI>R-09ZSc`L#0<+5m5n_A8c4U=&WJS*|HU%DW%v{gy9!k`|u zKL<-)??0?WPtD_BmWpt6}u0%eyP3m2p{mj}tqL=?59HiYANq{OTOTbhkC9=8S2F_Q%1TE@WQr8Rral zU>Ty>>3j1q%(t&%``pjHko~^*$h9WSTYqOd3sXnPOI8p2!*_@-@0gT^R~=--((p)z zi{NOW9q3^E8?bd zN;Hm_EPc|}tfg3k-0?gh0OKx*+$LC~<3|ca*mbrGtOM$D8q!!~B>@`@BvID-*11zD z1cD!x3~(k8sWZ7)iB^z2Facap$ua}zW6V0N8U!*Sv8B836;%NZ{k_P#KO~BNlxwSo7rRk=w3O&&h&E_fBHNcHQ79N?5clB8?~%Y317vM zR7^gPNOQ(K&yXzeF*dXAycwBwjNf(k%N1j#qDsfDZnNV9dPL{4aXv*)5JbZ;t~rno z!U#>9M0KS*6M`zKMzMM;$GMdG5}HvxkIE5i0>hcSS;kLCIE{t)E%sXf5L=CvRJPiA zRF2}Kz6*44buRr-Q4xMP_Rd4z3pOT->b;BzT5iVGO0yFwPVX20u|LfdA4&U5X@|3V zaieLU4t1+ghTg{gSqrsw9J{iGF-Z2OlQNg`=pf1n;a>VlDS-jg?bIA7;2Cz)O>SOr zce%>w({$QtVG^|>mbdFG$D%vlKV~>^Gi_%7CE9G+cA01;=g&lGQ`6ZMt!C3vd0LsS zFYI_mrk*ITSr>(k0p#lA1Z(X^c6|QWj$2_k#)Gmr>3TX;br%9T^zqC{X8u7G}g(q8oxhv zGhekG`ej|HWUXkDsAMvG*qah|#Z}v!y+%=zd(B3GGL+NKC5i#((#BHM2~C6z7Te%C+O0vl@UQu7xe ze{rA9jb65C=Yq=o(!vfsdOsu7^Z2*50D;ApL={50uFnRaqpN>ipSP)G`Hf0$X>!*S zw5~^c_J6#~S7A~(lNzxV5yWCdB#t6!aHOCNb^2y=mBx~bV1Tf}rc(TU(A0v&kThuq z-3av)wrt6e)y0O<7{mTX%oXiNc=Kho4Sw z$iI!L-uwoF#}S&oAX~Yiy5jA1TPAmt7O9}9SCM(pdQiaKnfQ2ld2yvjO)5+lPKFN7 zp*-(AUIcSC#%7U2FUS0ZeC@+AvlsFjgrDWpVJETf*eNWc`8|xIhGuH3($cKfIvKC`Uzc&S(1CJowXG!;uY(=1pY!rJm zA;^CJ!_G&cncHw7I~(>)^os56JWBE|9@4AJ;o*k^-XG(2;jULJLPS@29FUcCGWkh` z!pWkJtxJAGCxQX-~!DW>$4$ zH$Ts;<8nTsZFJjvvw5F;Gf>q1E<7y-EB7xi!@F*8!>p=xKg$vP=}unJrnJ1ehxd5i5O@>W{B#F)U+(}0 zmq))2HrAk83Fg3RLuN*Py0H&uub}C%-h`j3KAy_N zb%ROtpJhPX9}gdu5r+JqKmJ)UIkhoW*1BA?Gh%fgMY^l?b6TEQjc9UDnfchU;+9pI z(x%l^i0~$lE} z56wI~QLoQQO(P;o?oOddG(9{NsFn z9lRXn1Qb8vTyq`mxNv(1kjH%BFtfUGm+*xAcB>A3%LtWTcGP=L4{We=ZR5|LTM`&+ znP_{9zd4JxW-_()zI7fe?RH@IgxwgHJ}h08Yo2Gn(4#0;6IMwg27stw~d@~pm8lu!Q7n!7Sz?*vuJ|9=2jK&QV^ zn9jnkE5{u-e5FUyV0R0If>h2B*XgOy6e!c=q$cP!dF&je9rH@fUQ8p+$ZBJ;nac9? zY4tDhMOaao_*g@ZU-%LNNtqXbHT+sdWV@E1uL;4trTH4w*OI z#h+FP`Cq?jteC48VMj8qW@$`cO!PaDij@d;aXCNmpnl_F=q((L5VQ-5t|ozLFu#=n zE9~20y-`sYKGSsT>Y4}Y;2dz-*V-gX>K67zeae%|6NP@17U0XI3xJv7$po>Jqa#5W z2);PPtj+rGe1-w8n2-oSe}ObnaIvNP3!qW`Z*=w_=r?~kWUn2GcUjG`$|GiE5k3#J zE`H8k+rhk3Ch@UC-eO_d2o)`asUe8Nm@E;o>)Zd!C3j~caVvQ|_3{IHq8$@{f%wM( zMmi1N*;S9{#{1;3mEz*I4fKj;DV=U%twgN4(JS53RrwxgBa-7BD&CaMev`fr>uG2q zREpAZCP*UD*b#c>>Q!)Slap%Vc$2u^B7XA9@g}u}2Q*KFy)b7;G~dzR52Sr?zS>Rw z+F0r9Wgb{u>QAc+av5@yl-$)ctweR?5>XA33VaPc{=QqemQ%>w%{A z`DLS;pp3mLLQ`Wr+C82vu!t?_4v<@`kYi2d;`uXPED92j{GcFbKo-z60=mj@y7aLU zaxla-&S77J5Gzc}N(m@s02Zr--yn794(d+>P-^i-hWfhSb{wOcXz4F9yn+T_rfCkP7JlGW&tFrMb%+*2xA;UJ8aWdU{v7&+;HcE(3Jz z^QP>xSgP20>~^Ay0Ro8T4$go6{U8dQgYy!=2Nsh&co@!pJNWv~rw78lJ~;m!Q-hvk z8qcQ(uP*-k;QZj%=*z*^JRMEO`|_N}4WtTbNS8|MK*Ch#hwFKJ|`geHLJp+hi5d)op%h)y~@{yv$Y%t?zH@;Z?!3QMuZ> z@rg!yYs|kG%?YlkJgIRM8jz?&m|sU<1PZo$^_9G9-mD~L(P~TDoLSoCs*nXNP9eQw z>zN9hwY-1yd_~@$y`bw8x~j{S61j@&;s)(ddR0c!uCGCf0b2%I{u0X|{N>B?xB9fO^{4O0 ze1vyl4)qev_2}^Ea9Go$@ppaMs2I963#>YQ2`{RE4arvtzSEi&lcY6u*uJH@@HSkw zUh|SvYmcW;p*zeik&YI)UU&Gl48I1-xz|magIrWwI>BV*4QjOP+{?R{l~Hs1cdJ{H z-;Nanh8iqZT8k)x4vbcDQ(3!J{8`@5BE0c1HfgC>(4=riwV-((?-(Xt#w^9g;|hUE z4IcUw_f)CNlS-xkBn-U4qSu|53TTX|eZsuU07f zj?pKU^g(Ub*n095-fjJ7V-A(nxxig*9V-*g6+H}c3Ij-(3@P{UAGWX@>DH&WDju&M z^M0vL+eOjTb6nclg;B0^?-B1aN3VQ%Zfq!TSNDxql3*dzA{al z)8fvvBNX~;Q>Hk|bV8X;7?7_O{+2Yt^FFaQO>WCf{PscSJL8p9RsRaLJn%xRCR=y_fOfuxJS?8i2}yq25CHd?s$M-k-^E9!*fqZl;%- zRR-mm#vQGa91N5ipp~mds-&}9NoQA|7Qy%5XPgRF4Ww>zVdyDx`tDv74J4+<&;*^W zX<&jTp4@6*AnKX+qn8?oMVb@4t<>yHUBSZLDWJEJ@^#sbxzIi|=t~YY>pZO0@RZHv zYz|u9*uVTK;4%P_u&kPMW9_~)s;|Z(iY4x9V$5~dJ7U6Y_C4xldvELh)EG~j^)WNW zByO+>D~L6vx`WxL&smn0l#w^kv(^UTsdK&iKmZ$!tNI+|4tKt6DmD|>PAv{6fUTTn z#)08`YA%Ii-#X$pRnp`8^$v38X6VEW-n6_76`sWox?VK8eS=-VJeQaT;@6CAz!CV> zpIWX|zpmfl?0os{>%r*7=sA1+?#(4)&s?3$M1nnJ??SeSRER+@?AhoP#L?045dZV+ z`BOGJ8y}8N@n54cNZz9t@WFHa$!UE#jI;6KcnJSJg69fp_@o`&YWzmYQ9X&IK!=f< z7u@ADVKZL{G*p?unfUTOQlN10Abp^PInQF(THG}qC2e@*8xA$Cb}TU){b~#k$7aP2N<~?&8kZvzZvpdcKG#zj$!q9J7m5~tIKY%Hrty7^e* zYT?=F>9{$so+`k-nnT29-S?|deTBzGEgHF<{;by9B75?Z%7jh9Wv%IMbSvhwtEt0h zDyL+x-jWtG$C`7}!L%(iTW}bW%fZJamlGn_ROYGvB0yGgUJb0dyk0vym~JI;S&eKN zf}aVfz4TXk&(($Jh9ID!ce3#;2jAqZFFc0O)@Yo#7Zt22;nVY4&g)jvanWwSe|IgmrFE?&u z`=ayrc?y=#sd6&MQd_dy-S(W>-fnky;yp>X$L=KiPHIYlNJ!$CA{m0TTj`ss`x^K4 z?vvbFYXKzq0g$w0*`4X^orxuZ0Emx;h4u0Ksrn5Y32OTQl|3kLXQRBW(=B$QQqyTB zo1cavX2nK}l5gaEEKp`U5K-POA~O%AUK0{hmIu3;pAt^SEXL?T0DhHhn&2gk17?KU z#gO|-^$h_orHEvV1!UlUR=Mof;ZSksy1pI_R{THJf}D{&%Yxz^$96%iHC7zqNO>s8wBe zREG}ePQ*t0n*3`Pa6t+Cmy+!4 zGKuC%?o6$|C>5GadB|seD$M=3P>zyIiR0Z!Q>}@RvxWgy-j<011JA>&YBE8!r<&Wk zW4&Dg>2MTiPWL{CQGey6IZuiL2xa^6L`JSW=HYGu(KCiiH3E5JHUb}SCo^7a4d1W9Myg%Uijb7T&d-lhODc`$=) zzODl^$mSAw6`}G_nGqq2#Ues&0|Q-kA0`2=O4M!W`3mG6#Kcw%SSGI}G*cVtIKmR@ z=3H1WU5OkCV30GOx(iUUL>d*RWX6Jg@~3{tl2zF!K!Ao#*j@VW!NsD%Ud(VjjFWto zO;^vZn0vF+3=E<)AFsSo?6S}%@o{!OUoo$?P#FsZ*Agm~xXe_*GB_2IC~(9|qh`~}}X^xWgo_;5CU?#=f14__V~ zvGM-%QI$Axx%AUMlhh!7)x68vEKv*}0qM+{W^)<=*wQ5qkfzS{Sxw}Jg=OS1p23nmuMlEpFX7lnh17HQDRg%meF;Iv>e0O%Yr(k!$)Yjuc>_YYsTdqle6zvD_VxQS0F)}&>LZ4tS{ z3jNu1>VTHh^>PtDlF4an*$2NH^q`h_i9Z6S`NJY6mj+M=4c*Rd($M^utL2xg<-gI@ zG8Z8OKNKko0^DtzV5q27s#8|rwL$-}96?i*Ddlv+y@|~kJZFb`%M%JO^d>&luQVyx zv_lD&NV3@1t(%$@$4*F5ZbFXr{1D96hA5M2wqHevpEP$n|FS%vT4kL_z>;Ta1RgBn zR{)CQ4bd1dymNk)h0$#0yI{;O28vh&Lh1|1%q$6=uW0o+P34F8NPd*jpT$C}r$Acq zKP4RlyjL+Oki;O;WF#{6Mvee91Q^kU*s@s zdXMIAk6tfJ!eIm4gE(=hJqk@M7TskM#XL!+&yxz5wyVCS4Z0;g^lz{LwT<1wOyx#F zz@|~c(r8`0O}#29eD$xYOmWhACRxBGE8g4(=xRpnO2GBnjl%R?Z>JG#v(ytaZO}=n zDkH2-skSF_gV+1CjmwedpFKT6miDtazRbUDBI$~XEDCFGDf5=TiA4=6DG(ucu_%Ue z>hF(V5UxD_iGd~f*KWrN-LCIkzv~xW0UK0<1D7Z>^mSUN&)A9|(YUADwy4dSxK_A! zZ=~8M;3$BdFaWILVnc1feO{?i%477W!_*bOkXK>K7wp!LlH7T~1c1fR4VRHg2e>%% z8VrKCCI*^yhZ4besXLbYlh5z&MUQ?~y)NA;|9531FwV-%2exz0LKS#LoM4!@6GW>$ zyedfBBt>5(9F1SOCecnl-2pqJSv0imHmiAU>u?%+EDbFy;mo+lqBs=o z9tlbRt;|37>B?K?L&&{zett%dkk(F3sMXfE1{Jj_VOF@D>$>@ZMz+at;j%Ca0daz) z0lm;3DX8*@Pa}%;frU#m#99N_<=XN>QP%_un+9FZI>bcCcDHX+0g7*D5s4JKYN6|# zQV)kl^*3)+Ro3rdz|~fo-EFzJRWhKQ0_!*s;H{yJ8$a|;oLyQNWSha_yRB2cU8{>} zi@VlWZwK_xgt^JkcX;U0E-Uu2ym9NH{AGdVd{u}w-V+E1d#F1IpKbXzu z^obaK`kmDx^apB2*9{ZZsv@|XcNdOY8D!oe#E@Lh3!dB(N4Es7zP|p>ad|@6Gv9vr zaCr?$(crt-lYm5+*z)ee`S9Jf!#}1x1dGWYS%(y)ve7D}toP!_u8H>;()Ct z`dgbKK|HCO*Au{C5j6IqYI>v^EV*@hWVy^4s#gvICTdVbwLRacjcPUIVY!L}zOriM z87P7YJayt+i{P9mY2%%c4x6?+;r4YsJhPkaW{GvnSQG%u)tH8%#f$&2eQLk1uEJ;l zk+AFDSXDiAXPqvmRfC$($^qg8YdkRlM(VRby8UDFr|Rv2%wAu;WD_w_s89HSvY|jpaO0- zt;dNE5WCun%A<7i4w_z86x*z8zgTo(gSQBpqjwDO`sRTjJjmPGpG*ywiG5Z z#zQZz&b|i=`!}!51Mu8{ip7^vvNFE2?r3d)P3}hbRKzNa47LIqbB9Q~3k>(;(VS?JZQ{MzVajkKrAZFe}7H7Y;ap3Fzl};%SF3*RLARJ^xqXeGfew5A$V#G!{n7v!}=Aa51cq| z!o&h7IUogU&+$DZ7XMByJ}4f(S$HVk(kH zz1c>ds^K__{g?yg@_=Idmg~chHq>`w|HI@PT*;@T-q#(lBW$!e+<~&l(W6D zT2%^iP3g~O8zn@*MZvAkWY|y}Y-u?H#;|@h9ov`hl?YYZ3xZy#HthAzoOxhA1=0YC z`Q09F+7}yrE4V6cld@go{`>O_q7lrM$maQwv^lOn!P5CUd++)e__#rP!Q^~H)kEi9 zlvYx-AtPJ5yY1PF*{O4X7dPM2UNhj>V?vq>7`mTZ@&~qhEterI8fg=rm0m96$s%3o&t~wT^Y`EV@cp~%os*rH`#XC( z-(9?W10TkR74#q;-kx>`4I(I5P|}rQB?|c)3l4QorZ0S&HcDfR3O7_C=}Ri5bT7!b5P#MgbC>b%g|f4bM>vhJ+M(bEM#Zf&1MEhV|UQ4uaQ5i`Nd@pRV+b z;eu9D)Paa96`z)CmUlr!Fp6V*IeblZwX6{VG(2DY4%TK{ftr!NEp4$07~0kVI>;&o zey@ul<80y5p%e*dZKdoArdd2V9KJlZu_hR15kVN_^#W(qc7;2pE8LE;9kW>pXT-V= zN5khPR5pCr_zF$H-}%A6<%{upSo4GXxq0o2C|&r8*KHAv#>0a{D;BzO5{T2Zi@dSS zGgi_p=1cMvbkIHmv?Nd-USyuOMLOJD>t%5~v1`8D5-8?(Tz{vV>)zr@FR2@Sj^vAQ z78y1DgiyUu?e<#C=_qZ-&&{@+#B3p>b~psqwYM@hx57hjT{@Nl!F_CA<)V5G>Yky~|IkgD$2 z45wgHymkRng7TB_;!LP92=IV^N(P->qgo|lF{-hAY7oW3kGt9_by$QtfrqRRagx%z z$eAGt8fMVL{3!sMBwhE>=fHV% z`e-ym1_8XzME8(!)p_kaH4vYzx)_%sLbf(F`kZv{40D(KUVt{btf+0E()6I6*ki8b zl{WGpsX`W;o_s4k?awmw(j|6B8jj>O?7maGkwdS6PhtTZsfJfpIIOzwxt|HL=${?v zty)eZI_C28$Q30r^yDAk&?jHC(bOkhl2&WqAH^C7HgoyDP7>V-N325E za*wWI`&38mo)_tD*d6~p?14yG4j#7>)p{pGtDSBAi~aE_*dIH~_KKwYVuSo*gWS9g zQr8zYYK7c_39`5S@&1&nopi6y;M!|8NC=(`W{J;358^3n{mg@g`(23#LPR}~eeZoQ z?R70}x!!EmHdE{ETR%t(vU9L}UNqm`F2XtwZWVLC1*LdH(8N_dVl87!x6DrbXwxGMypP3OTL~ar2SFoeG0aH=O_r=O57BN&VNkKaDmg*}Z0JJ$@iPK8 z{Ie1?M|DnU)b%<~Pn>2N^HJz-Uo@#sLnQzKIE$T71Hz!ozNU^P0c~uHV z4qePCK$y9onmXdA6DuXmqs5LkZnr5Hxe<{$moh{D8ZIh=a%=>`egVM=k}zZ`Muj&R zl@$-l1Pb}#ygg>I5)&`|39QU7pmGZdWlU@DUy&bLE!W_hjmTgQhl=vp&Z1=Mdmfik z2C5;Tv!+IZ$i1;P0&qJi4*~L6%cdyild925wZm^eP|z|CLPcGw_7ln!!V8X4>yd!j zXP`_qTK~0L&f-`qT`jdGeC}6JrRb}IYUBz(+a;L{lHZ6ZQ+0JY-g6OygrSNjv}r|X z)yL69hTz(XL5U2sbHz}+Tg4^D(Hb~MVO-Rw6GcSpbQ-8jPp#agY7!qL>C56>Osx#lIf0_oNf1;KV1;>7P_Fk!S1HZJ zBV^$>;)5X!7D0F9!>J&odH}WP@3!r90aE+QTP(`ARX5bdUo(b6)a(rb5DUZ!+#|{# zXk#}YyBzVF(x4LNgw?uYtL7A(` ziXPFXkA@t#NxaAwr-d4xS1ffGE&de@{ULW-u|Oqx@X&d~+=asfj=8_fOaPzkEq8Wc zlkV)vFv%R#SV7F|M@@=&zH$TZ(diEmmN7XU^3Cah6Lv>Q!X2n{Cl_!#25w`^oA#nT zE*~J)C1+}>fs?##l0WVE-p)z4_4a%7xp~@Q42%crM$aybyZr%Ak^2aZwsCqo!em3T zDQqJHt}8M6hHj8~(zlKd z_mAAoWY$m)oU!LfpUs|=;(3}TD>@CyHz`&kHefqMoy=+fZs6d8>x6ORJ*fDr`t4=t$nR zE!wWrHXJo@>}f|pnR%#B@}4@{6`jREQU&>5+~6*w6g}I;8&Dks?gY^sK)JA=_lTdY zIwe8R@V)q15Y3~k5~?DCXp#a=bxWX%>>1!Dg3WsKJ@YGoQ9^X<*!q#5O=o4}GC(NA zAc*b=&rF89nPQ1C3%ezat}1?7ZY*Ec?H^~|KG-s=wDX-Wh?7S@tqOw@v4OLc|HWY; z92LGuF<(?Kj>vTCO5!;So^XvpDBx+OdzHhjV{ow_PJvNjkYoWDd|kNhN^Nv|3agC} zF(!nVaaTDY@h9ng#L(jvkzND48<9UmNEZd8q7vwG(rZPPXSf|*Q1e%^^-o=6CMwv<3_TrM6$Lm53Xg{?$4_^K;?gzY@@GNASR)OBC}BNFkt2Z} z)ImWl`Iaq&B`eu=F2TF(;%}HJ58d50#pWjb*Nltw|NDRbU*U)-OOV5^JPyX@M??I- zXO;Xes>XgtD=o^V8yary(_(LTI&5wu-{k{2pKBjBrP_+a2EWc1jb^Yz3!MDA66X^5 zBF!U1WEIBa1b;n~6@97$MpFj>=$EH?gFr)(Ta4>db-3?*>$^8mvT|Mpw_fFpbNw7Ox1oB@(zNPecF9O?0u=_)pO~xs;kp{#g5}K> z(vq6^o-RG}WmKvwFKVt$*{z&sFi1XmDa*h-kuwKgM>RsmH#rB(Ot^B+UY$D^p*wVb zJp14r?;pGzS7rl4=-X%FH$O(o5@UnMFGtl>&o~0kkqJE3Wog;+Jbyadsm2+nmP%&< zo9FRQppsYitqM0QfMxmsWoM9OMKw-jjcwP$(zb576n@#`Piv2V*_D5cUD;KI*o^8> zRT)6F3mre@OaC{p@W5>wTtrdi)!tlUqbuhgkP9Pa2E?x{z!V|u>VpX&LOz@)U9~LN zkr5w;>X~4zHk#(*^|v4ODPLJaEUf*?R8Pw*TeA9FB*Vkp^B38Yg;)|JqSa(j?@fI< zKHNVzK0GjZCGk;nybY$vBf*Od;+7OOxwMbKuWcEIX9uHakUEH`}B zZVm%usYw`9b#}}64PQM90iOz9A3B$clu^a7%YL^Z|r=ua({H6 z4TsNO9vuI0>$IDB3t68x-ED zlNkS`)>V^+bKtvZ{u6pLnK*{t<4V#N z))Qhd&wI6P8uRFehmCMloo_&6lQqfo0#cpu z8;Xs|3o9Z`Xi#24urP6mY8m;)y>cz<{bUq&ns585olSC3w!C{)yjn5RcoS^ti&_&w zG>-%Ru|!);k9OlNJ{8IBUq=Vy=ZB-?an)y&cVD(LDJ^5u46C)Zm79-c5w=Jx%o;+O z33v$p5|Nxl7Ni=$LcPPgcYHb=?K)qbbB`qhEq4dJ6Y%Q*MjZzi{$kTz=c~7VspL*A zk<9ENsb;TMJL-G|Yp2`*@yElUece5!(H^Z|q^!XVg9lJ(?81m$4cw~Ko9fVX=+CHZ zK*R>jIh?r4C^)6h+|{!Ou#OJ=D+P~oIFDd^!mYHkA1Wmbr9O_Q2#kIMW%=7gmRUoM zcpkhz%fS4of3Mpub6WQWPO|JR@?il-Rc@P9mda?!Qobj-n!#oX93UT4fNiEs9AbY^ z83eMgLr6$;mQgu_#)&KTIfPr0U7&t@k(+_VuGa|RP<-8dhP{X1&h*h}xF0LdH@H^h zHvG~MR${OSL56Mv5)kYRzx)8-8GD*9{#tTmI<3rNSo4*`g_nGpRc2yTX|#tim;f-{gb-4SedR zj`Vr8htWt9K1;Y*bYI}|fyxTMqHmj*IAB8MDPVF#HLX4jTNGx_pm`8YSzuxf!WJy~ zgpG4qR=uh<(vSH|N?oJhcG~VWUt{{?9*OSyrN=tI#G6$YjYM#$A7`CJVu>-x3>sjJC*G=4?$30?0VTIyh{c7*6kmb-nhOjHuG5(7BG2F}-}HB2XKA7%$y z57hX!7lht6-h(znTTsj0^Ww-4Q(RsURglQbKbrxSK}9ygUhOm{P4*Y4OM>D*b6F5f z%>ePLBa0=LlNvXS^ z0@>|)4LW4^B*_N_mTof}KNP;UJM41!AAWPS`^gH4;|oWmn9&6B=#XkM_irHz z3(!RT@Yf6qmG!4;d-E`YBdsXk$}hD^lg4Lk(fG_{pgp3Xw%@iNQlJTi77h5z0<0`R z`)IbPdtWS+Rtu$7NkFsNMsx(MNmCK)aP zyt-{_{xZh;thKTO+1ECdfi}&;&rX@67+&9v{Fkjs;`(lM4>}$La{`)84K7{f)6J_He1&o7*>-p4$2 z&Lbj=PMnL-Pkom9xBP1d3sYjN;+aL`8CkM$ya3&U%@u&2=L_O=Mo@fJCqARQK=*Js z5T_)`LZvF^Ml*x_cKr+NPj^N&ct3oHM`To^G0fK&d{)`LbVgDWMXxCApVFy=freCJ0W(Kkw~di>Raq4);BcAeJt4c`Oyhy2SZ_sFJ3mhNE*cx z>`rTph|5w<|3D$@hXj11bQ4&LNfbyjHlo(K{`O2g17Kg@zBzks&hb3jfBEvjJLWHs z4_~n7FZlkU=N^y7hqLi>Z??aG`10t8jrX6A>ipflC7YyRORWds@Pe>}sQq)UQUeIX}&4tpHDDsd$I6d-Z)#Vyh(v8`e6#gvVh%LmhgNk7>{w2jd!sA2Qs=GqHV1`uZ%%UAcnu$|iO=07&L>Q4KKZ0T zb>P$9j^~RwV5^C{1Xv!O&pytUtl+WV+mYn;J10BO+;I9#cH$XTa~CByemI|aegXyH zBk~cz&yZWZx8v~{%Yt<01ag2Y7(}uzq(uXg3hqXU_kUmpgG@slOXi-f~i!yqZVw5EweKT^lq}T_Rps%3Y-519{NC!&tIBs=$EiwKT-m zwo`$?9$1$O1nNL7sl#@(DJ!@kyOM%H*~caYvG##Ra4>p#Z?<7IE-k?y54E0Jx$d5X z=63o=QQb~Id)@8y=__xipON-<`bSaU`UzApj%2N;#~Fmjyd^o=R1~fwfDluBPR7JRa^3$HV<+R-SaI`ZkgKcE|51Pi%Vj7qY_x&xI}@0kHWS=^eDj_A`zI{ zd3M3uEOeEpRCY&0WF58{QI;%ZbM7@o?Ch3{p!CSO$Mr9zc1)rti0-^8{wW^^F0y&T z#jk<>Eo4Io{fiqmyJ7klE)#-On?>p ztX+iBc5IUO)wy_a4zGY#KuI&FNSH+-wFR0cT@R6GNy0w&;-q*<>0I+Ia=GD#ynRVI_Nen zJ$MQ#-%kt7My;QiwbfPvyUlJlIH5n((qIek~_hA^Iys>BK&#@qyRlRmZp91DY`~^bM)MQ^seMY8Od(k*fJYESuB>C|oJpTqg*06m z5MlKtEEI~~PI_7(_)WUnQh&zW)VRZCLuf&5fN_rFf{l`DoN^$N(m=$eHx9UWO0}KE zvCX;*25G$P!RYA&r`G)4w))`Kv1|OPbbKgKzHl|FDt= z(NH`QXbbGjmgO$3mwXjwX`H2`6#&pe%qXkxPl&mwO*tvENOw0@!q(Rf1i;qA%-FT|qX_3E-wH zO^}txAjsy`mxm_}GDbQV+qSm6*N?~Mo1NvhT3jvdtsu=V_qf+~f7EV$^3F(FgL;0q zO_pw%+6zGd(EbL5#FD_TK6hp3)^>ThY=>{_asH(Exb%@*Te`HqdLdaFbQ&$d!(DLq zMr6x8=%msc5aYKzk<_zbXo3dkiJzMJT(7@9!}yzn>Arh-I6i(kb4Tvz@R-e}vqSgg z@$u1YdOSWHzhL}u#1D@SkEh26hb}ujetvvBn!b4Xd^~;m+;lrpJL>hZRr zm(Mg_y8ZAr3Lu-%mpN3$qM^sCm+#Y)TFp%ta0(KtR`zf=+0%YkS<`E7Eo?gPKy?Bd z$6b}y2EQKK%aS=yi;6{R3vG;($jjV%cql$~dgAP+$}K|zLb_6Jc@V`ASxOprikW-L zO(QGZ?XwsjL=``MJc8RU8>-80eF8f5>AlXi4T(e*-l#^85U`zj5@j*ETXQRB8abXn z!{<|4zHK&0Q%Ixw`Kbx1ZObMVdfeK+k-^x)bOUJlgpsGI4%*`gr?1I5dcbBQEzR3Q z%aewD3e89?b$Gc$)DkZ&&y^9CSZn$7+G~H4f7$G#tcZ*IumOOyD&orPjMbXG{i&>4 zRkwLQHg^cFdj@uxwHD0Pr*xv1(77r;pFF!sS~LyFT&naZ6I_I<&-jWt{y-nPT;pZX zm{eg-2IzYzKCEhC9d2nzw&@XTk<|Ab@NH`;MKWuWg&`W%LXyEMfAC+#!0k{ zUNa_hEA=*AWm)L(Bmo#+2*aO~74vSfQvPxI(&Uve&OTyBc@Y;F>syOo z07mC(cm%dOk*&7bVVlq5%9L!`d0QSJni}2aogg?m5GQZH+p%2tbgCGd(iuMqNM0vb5F`za#7do zAn76e)Iris0Op$N<6HM=Nv`Yi!%C!OPr8K>8!q?LgJzY*a2w76;iQk4KINg4APeQxLS z!)|=#3GF<5PjzRvOQsgnq0v!QJ$xSQ7_|3TKP06BR1e23`z@O*%CCMMW4Sji60O71 z>5OR@mtObe+6;6Vwp@CA4x+B(t9(|1aPvb7@i+Ih&Qy2Q=XurJ%-K?{u02CToj%db z;mlpsZ+eiXp$b6~sz46MIEYqDw6f*F?P&yDY6HxFY4L^{PcG(p1LT@wA^2HE%7UQK zfT3@>U#oncN#WsnQ84^UqrR5tFh_5^|V-s0Q`t^3 zAqP?`H8b2@uwMB`{U%HIrGCOjI@6!g|`?==#z6Z|RlZRye)sH0m%lpK(O}CV-pEl~tk;!Q_Y; zbG~pqoi@T5I|!40?MOB$;$}f0!~b+!^trGD+b(96;St$?Xg*@=q6?24xPj^A~uKje4qRsY^TU@bPw54sNz zbV>PGUrQytRe8#r-{u5LVxVeyX*WIJv>w#cU9Ba}o!W#9wuJ@fSY_QB2T+j~S|%-A zt1&Ftws)S)fIaMZ^*RZQNa8hxWl>RX7`#`Mvuy&42& zC*%>xb^*G62EgVL07_jgX9KJ!K^iLlw-P7DfoTa#-)MSB7f&xBcLx5_UpIWUs0gLn z6(st92Oq1TM+N?)#3xk5vSgK)hco$mnx4Yf|F7VwIPx)07tgg&WOQ+HnpwSDBu0ovRf4y3a`lb?5ar zIh~ZdP4F};Io(XvPOxNS<=5~_V++%Sg%IwfybL+NOA!QFw1_@pMl|is(@)j4u#TbA zGiwSp-4JA1x!0Qs1}zPJdpKx5`o?Rf?&slMd)*wniH0TpgARhLeo%&64~lyGZV^@7M)sG*vQg6A9&yKf@*=ywGvzY~-$PTD65{vr=0K%res_Jd zN2ii10x{caR%&|)=)qS8b3f*Os7bcFAJ%RxPcdm|XBH(lk~s5il-ykLI5PDk263Y_ zCaFU;h>gq-aBhsc$)O?nGnr7ON;BzWPTXviOm}&2Jxrc%l7ELIr|r$~r0J20j7|Mf zkqmksB-XJt!x%g+ia>*InoEpNb=<{VzwkYE=7FrybrDJN;`m_znm}d03kbQzkyH~E z=7DXw&1_#u+Lk~)tqs$YPxJ>>LgfaO^9RZURL&AG2ktj70t;~Hf(cv)8n{*$jHKNF_7q9@3gZ&OT}a;M zp=?af4b$wV9$VdGtYph@?Fo3>K$RQQLKO6X=vj)lO+1?;SWF-Rp{v>vime$p(sOed zWxyxU^r@X?OViOoTEF~cd?D@`y)1Lir7aM^_!KfgdeMlRO6EL$e=OpQ^T@R|Ry zArhs)A~vO0`V7F2}7(?RyqjYpp-YN_S#g!qG)AekCuFz@Vf#0kJ0=MCKJO* zJhemT%K`8(2f$+-=3m5nfAL9m)FJtA7YZbmm;enjvj1F# z+H0B`I5X7L%j%4MocSLiFyEPGGGZT$TVCX5aNe*wbShQXYeAt|c*){e=FbztA6$G; zFiLUdLtK%FIWpO*d_S}K_>NC^PIiXRrhfSBj!&II?EJ6G_g5b(7G&An1ez1wedU#a zRmlluz(&Pi8#6rmD0_qSrYC>w>()v^12M)6H;v6 zMFYqj2Nftw7x1cbzmT5inSh0s;vMNQH6d5@0<{Bb&bTK3_sIG4pZ`37e?k756qcpP zo!|Yfw;N6TQ}|0NZ`Bvh_4Rj-%M&SVFzeBjpL8AiZ)AMrlY)nMfLz4pEuoK7F1Hlz zjS3w#jGYM1d6MQvZTT9zE}Kx^^yzL@pDRuco}?2mg4j;bc@+pll^D4Wc3zB@5E;4( z8-LvuJeak20~ye4t%wZyWqZeQ)>q+U_`9{$-J%I4>`q0J7Od;pH1OTh3UL?A59u@> zx=9LRc^LDhGxGy(K8pwN&#O1zT)cD6-&}pTczbbv_TdeF>kNm(${|-YH^JtNLtpE! z?CSc=xxBjg@$ADJ=WlQRFGKHS8N@f*_xCR&zt+ebZ(zMK z^vqytZO&bw{7~NI8Y*A+OAkKPdhMC>)JkD0J4CRB58oX?CaB!R+Vw5q(?(}2K~Ar$ zbycb(-3z`{kk(Za>4G^MtR+}KSOF*)bioAbW%>`;gh};+-yp_}+N!M(e3q&<1m|K2 zNJ=i%grAz@V5!Qd!V81F*?L+Vj3G>p{PZIiKOvKKvh9*3i> z+ZSjzr#)y~@ohG-AqoAVdF{7vBig>79##*2GEi_WgVCfxXp6hPwhgPdvuF-kx)GTi zGD>ZG$J09q{$ie&paB9B-~+n0ef93_!`FB#7Abl%qAZ<8S?D zj->`5@zBx-@;E%OR5gcHMxadjEO0I^<%^P+As-3V_cUR%neUR>J4*by9~L)@>J^>N zZyU@V!8Q4Tlp!5Q$h_moLSe!A0um$77g!9_Jy6W4JP`T3A@`%t{5>$>TIYR~MsXBG z^VLQ+ld4QpZ$8Mc)XiNWNId~$ zRn%*9i&I(5ZHI}-YwwJT;ER%>dE1KNJCzRJr4L}qHrlMsZJf&tIov$;LDjvkP@+0x zuUBCNlci7685Zp@A@FdYxu9yd%qAgfg93GCFEen2Zej^AP4@l-LB9STuG~q3m>(NmDiTBgv z{qbmj2#8rledWHW%1_(XLj^vh{@a#mog;v7w(O@h7l0lG!cdR15E@+b1cWLmaS8Aq z(b6B?g`y;o%{vF4>9}KTW3wfImNllQKb8dsHLe{zKUc^+`jwP+3;k%BohvNR86RN2 zeF~n+1hw?R7>Qc-!88v?i?z7w9JMOsArq_x?WDOA-RN7_>BJUx13cOnE*h6&orJbD z<*J#v72gBGopSh9d2le{h=tDsPdRh@$4b%jmM|$$S+Cxn5AbL_zj%Fx+VZ6|(9^X6 zuaBAFL+2uOmYIM6Jcl{YMn`Z&<2kuM+<*3R&l$ZK4@XD%X*7m`86CqHFX@{j^Rf40 zJRI-C{~tiPil4#vl2dEWQS}8RAaV0sZ6IBHk615JeTs zhPTWNBEnQY^=r7=5bV4tjn$N=cM!5jV}=(d=h=AQrh1I!kd=o5E>9Etcu0FbSp?wr zCNCsG;CKo6go0=;hR%Cj9Xur)iUjtgb(h0?LPu%k3CHsj?xyfCAW06L@8Q*8G{61u z;qtm)wi)!G{9ZvcpJ4C6H(-7@xS)nS&?5JWtDQx}ifG9P^4ZGLqAw?Q>|G824DC)< z`8D$^@Ma}`Y(oo47N-7^E1)2euTgtjKg;q1=>I><&8n)j`=Rb+$YK!Wi1X?9ZWhjS zOVfGflS(H#Dt|JsE(q8(N&q-x1KMD%PKlq23ZnkK?)+hSxQzm}6%>0s_iuTq5uh@v z2Pw%zDGm%~3(zhxR$FWGQxoq)sZ$0|5HZ{|RB0rCDAoE@JVJV>wyjPxu)d%HK=bmc zeNY;$uawOOZtfs8{h7`=gFZlc@i2Oozh;h%VGHT$1fRF@PMXD$FW>^Q4BYZ~SoX%ZABnxl*2m&4N3P@N8B=J^GFtTEw!^ z=atV=gjx+Q4q7UHcwCTB{YC`;$;O9vvWBbrpu+35JgBY*099+#ON z|B48d6z}6;fvwzE+#Bw-Pvygsfo#a=VQyy@CHj3Z()69M5L{~Q0S6A^v;n^Y%Yu{! z80;B5t<9-`Y>4h7cwZ}8o84ti+ms5$>R5Yf;m(oS*@Mwbvq!v?snD35H02@}TC8jV z5lU0#A5%EH0#p+-8AXu**l!ukIiz9}DCCFpVzO*-RB{uNRQL|}$riR^iAl)Rr`!V) zozaqQvsgZ&B(Awl+FuI3*n(5%eh!_1$NXS5$N;Eu6W4jII@GU!AP7lttwQcg%9A+p z1()}7OwENS&;u7_AkHlJ^Vd+6YOKSkMJWpuxulzL&zF%5M)B3LE zZYyLo9v+y$`dE^N1@`G*nxme(>?g}4VkK7K_ww!rHd{-gML6e_@q_EGb=8h7>H3K| zoR8Y!q1UCAvAGo<_5=zgISQHozh*piR~r$_MRn4^D%-{#H05ptS)_TX)bTPr6vHSS z#0-HGhR#pi`B`KFkfHG+On}ct_ZB>e^`5=Cdh_Ge#drVx>~6u*!Ggsx55>Tr4g3Kh zMhvnrX1+I&`V|oW`7Re<>)l9^qLK`He&VPyl1{*(8f+&<@!ky){qBN$8ITX7kw2Qz zjqy(Uq|~coLNkt&929LZEz4qj*wMh2cVj{=!j)Yp9W0Tf zENN@dI+wEH(HGjaJFp5`7lB*|-~dz$+?4aru*V>?20b5P1qs#|* zPX-$)oMSW2J)m-N*c3pK5X!e@nsSxa7HK}_ernZZc)WspR1>FVw7`%H1`QOc5#p%27^XnG5b+6HyPAEr}&Moum3<% zbhWp0{4mcW)D}&7lwf66_+zOWg@%|EA#BCURBfrIKA!-(e8K4Z6>k3NUF29{-1)-?X<1#9eKIcd0Jpd-8Md~0 z^`pLfXPCR}m{?}n2(=Agnh|6e^O%d!!Sw(IEy#lkS(dhZt4b=M>21qY-bk)pUP+x6 zr+vwM(Lf(x1MO@x0&mcU3`S6uv=-sr?1H{hdRxku7!fi>%#N8ek0MWDD&Vm}nLU2! z1{okY#EI`BP($cJI!iJ)k_$=g8XL2QH3(G^9HNngF_1mCL^?J zWDLOSMWM)+7{8rFf&d2)bwLcxF8|}PIc#Hs_4Z>i>M{xsB-<9*l7)qxUM&sky{Rw9 zhx-S|hX;n^wnQu2=mg2~JCbTodfSaJf606kG>?3=LhswiKtSZq6atjzWvVV9yo<05 z|FeV9v+@4Ogen~K#E-lQ5A6)t7=BUhMKS#yy0PD-8}=v<+7Rk!=qulzoA;xtvSmZc zIa7-vr^Ho*@Rj7@-g88Trh-`(>^U>$2i*I*CrplXl^J^CM$4%mBJvLm2~pSMVBit9 zIZ4%1E^qgC18K`uA-RaMW=&K1#|@kB{t9+A4TdZS>N8bh4=sA?J$-* z#aea-GyrO51pwUQC4)kz3HmZIPi|tq?3l-#m~L0PWfZ21O~#{_D(o1ME}!WZlm0yw z{@kL{Ww#sR(wFR`!rE|>=uS9d6}pzNU-K1D*3xzvdBh0#KWb$9iUTus=+RQ{736Q? zj)IE5M8a<;5?+@n8;ynELLmG`qu}FQnu|>w23mD^6nsdSdjkQ$FzCC&xh#G+3w*6m zeL|3-US?Sq39__Q@n*w3ym*KFE>EkInYPw_LuJcjyDJ+S6bW45t#$o*;B=JCFVih0^Jjz`*rHxXoz*cArm5U{oFl>J^6qe%V>Fj`W`~7 zD|RqTd>(pW-Kh1muqO5L9u9ghi9lKCyiHi>0up-_lQCUcaQZ+DC+3QOxULdaVtGr2FjmN8s^Vg9 zS&&&^l*g3`a&K?jrv^CWsCK-Cm}{@-x5a}Ke6UYTaD%d`x`)Q5;K|mOF!=&6xVUSP z-@DsF`!6P{e4?AVr+Z`c$*;n z5JViVxBwN4t|7Bn|M8ne?5?}&|SmFuieayoT`HyJ=2sC@J*Am|qduTNRAXreVFm*V(3zhFH z89HyH#Chu{0}XqX2j>iG^;ESdBPwVCc3@*&pWh^cJ_AULfZLf1!E1XK5=%bpfpTiQTUs< zR(4_G?fyqgH)(fMfzNCwu~5B8|Xml-r+C zOqQEg0@G{=PlFhwzWrTQDGFjwgLt3^TL!7c0JrT$c)IOX zcxqaPM!jC71DA>QBNt>nQkMrZ3$Rpjkvj0T3&MM@kLDR32-7QRT&;i+y5oE7c# zUZ_&3Qr)a8@cmWthAPX-S^pTnDk{!`8(z5!vJDtIN*0U)UBghR&*otyQr|V37{F%D z0!XakP4y8Go4E1gn0tFp8hKHr2_OaWZ+WL!qw?SuVWwr%2ou7V{Fql%ikH?I;LM>C z`J<7?Wf}$l$lVNV3{t)~4J3R!foD!|iNA|HZmv7YLdC|a9UI1KlPsiKud=ZF)`!k) zV(UXa4O<__r}x%}aWSG(<)glVoeE=(L9sN>TCiF%+F@alD~J_~`9o4fi^;ScGOtan zv>@;#i4rGr-7KlR2>w!ujJLJKKl&-!4@-@aIH;Tzeu@@DwZ2WY+JtRwSS&L314in5 z{9~zS^%|gvanDh*L+(0Uav@{KJT&BobC`LdD0xE~zEb`2kuGBit{k?6LQ$5+S(+#1 zReRozridyT22mxR1FPl?)kSmTsPvTzfJM3PBUZzxYo$$6J1KBaGf z13XHcWt7m{3G*3om4(fQ4+@ITlRZZs8 zlo%~&ir`5n3q6EV7im+y6+zlq@%6W7fJczOM5l_yf^{E!9C%RwAQVvAwQ!9vR3x2z zLsk^zX*Rbjg%Frb;;$t4YAYs=Cs-_xU^7~2jPgLe!zL6Nb>%KXgo|hzwf!0tnH&@Y z_Y|lzz4QR1^li;s+|p4Fl#7t#oNzF=<>woW{CySwIuUT=_(sW`h5m0Wl|=72&hND^ z`=9c)Hp++mRTdi0_|N$O#TeD-E<~da5LlOh5{L+!R9~`l!)sM`6BU|FgJ{}@tQzJ+ zy^*8(tYC7eVmRi&N?8BtnB}u1o z1<3Lf(>Cj%H-KKC>gcpa!}ReOQOqt$hIJqsO-2X^5$SVD`4cG%J%}Y7{deV-=l|A|9{y3*OzXgGX~meDZ}H`Qxj8)i&7oh2 zwUOPamg=bMiajZBJFl`rSG3sa9!kwJuj&?;-RG>gKHNp8g9yb`i_N8@RjVtfqrtDc zpc)mKW|+(=-`Mj7kmaUt>fN@6f2!uv1Dc~8H}ooT=Nmu$Hk(3X!HqKoy7{Dgo>yMeVD6`j zY&xI{c3bUH9r`urDK2IuPuJ)h)ijVbZKQYljTm@KRVn$epv}h zX@4V8q~jWij62N3`0bf<{r&YC%R?+J3*-0J1EfW#*w|@u`e?_==@UIqPM`LHa{8H_ zD5synk#hQE&y>^8@lZMa1D-0UPw!Z11UhKFRNcnmK!OCVPyAG_3@=na|9JVXbFDDP1Q}yHZ z$IExl#cNwiEd>|vkH-BYi=py&HYT!YHuGKH0}bF3$=aNYORz3L^=>B8Xvq_2&QgBI z%-P2W&xfO<(eUVacu>vD#5yN_Y;5&P@ui<%yuK2$=?Y94m6*7`m*gQ}4O<6la9#m@ zxw4OxX4gCs`$PP{XQQJX3-}MV4<;S=ru;T(7KR)m?LXij4L!T~+Z*Rco(Kz#mjU_H zzu}WxdeZ2Py)MPp6~otr5dnt1ogU^Q+&<8{`hu#E7N6R$(l*qPjhZq)$ooi5Su{Wi z>w+_iBkr&OI=TXov`pAvp>AH)B^pf<2L2k1+*F{B5achpNZB%mx4>L88Pw=50B6aX za&|Nr?GMJ!Ka9sG`^P8y&;QYomMuF^wVig@rV3#p56{4k8@us*JUl!cjt-B8qvIFl z_Wk%i?d9@8_*%5(y*r_*n^=33@PSycgnP~nH%lbJ-GrwVS(NYzJqlS!<|fM9spWls zxU6T5XPEEs!zJ#B*YAINxAuOZ9?50h)Sz1OcK=D~ylU~Hd^um*hp^>(y-oB3p_R=Mw*0UU5^=+3{Q99nS6S%ZY7 z4AI-uXV|F^Yh(sOy^}6PK@e+sx8Mm^Fm~XVC72nCI~;V(?wZHN_ws-% zwKO2g8jwueA>pR32aER}xPWPN!$S=*rYZyE2~hB$anWrTsU6e&`Nd1qY(al|?rs{d zhuGIjLQgtCE7C~j#D*(Ugx4 z_Pw^=RR^tuQh}RppfI4;R4mGsp>pvGH?{f-Y%wYGLm|U-aY?fQ2c~uV+NWA8^s*eG~0Fv!>bgiX;Nxhz54?zToo6Z5ptzd zm(0j3g%X7jEM1vjXhL~qVd#CCNR1x4S!$#|BQZ7-a4Y?A-o3eh%R>T8ml3V`VgJs{@+4;H^k2vkqhy*of}7-8n>doKe343zDU~`ez$-4| zC~QI$GOj@7?I{*VZl5$R!&7}7b~I-bsMFw0C^mqrc*w@@TEE>oG1p`lPIV~i&)-yk`oP+EzG(4gR2?JNO1@zM_% z8qJ?+J$0rTnASx^_I1?*-1jnFhe|tG8h&{Ak&7|PQ)o!hGHGSQ1Wkp2?*j6 z_(z{ET&P+YL?EPkUgl4J>YJ^sTpU{K)vV=ukw?p3?t;u-8jzMy0mwasgGV`Th}BHb z5w{3ZvDm34GBOMQH2InxUO>l6@+ZZ{h55PK0yZPmp1=R@hwtBA@0{$s+~3*T`R?M~ z8~89jtl-b`@Yaq!+q&>&fWrU{RBNvLQeC+0&y^7!Zf2;!>8OU8;IoX@p_ElCn0v}q zLxn+4mZrdKnmk2iih2l5?SkEM!xs96`tZeN&b(l5w0Sln+| z2{1BuG~y@h7o1txH_u_InJ;sEbZ`iMMMIaEnJ}||mn6p-(v$Etdc{A+#$Nqk;w2Lq z-Vh(++!EQ;Y!^25=Yjq6#tyw{Viw+1zydaIN7^zD$osPlptdp~&{P=>D1H@(EUcl2 z7%^xvQcY?@XVQ5uay5}0#tyiXoxq1w_JYQbgS>KkFntvlVwUm=RyUy=n?+^4DwfL$%5YbvsSa?2j9Knsq;T; z1X|^8Py&2AsZWRb!mYH=Bs8_4|swrhF0`bebx~q-w8zc~UngAtJ}+iA)QFG%g+Ww*$YT{_u%}N2lftV0aa$ zojt;*sv4jfzOjyJ!aeRzZ4I>X^`$26X8y9*5&YEqm8_5F@i zMxFK64j_hb)zsu-ZdjD0UELW$)y7ldxdSg+GCv&pUR+m8s8X9U^o33Jq1jZcVDc1C z3=!1;B(I_-dcH|h%!Kd7&w^+kWtCWH5k!-eC2jE=TA(us-OYE*uka)a(Wzg#C9>8D zeK&8BA*%CXsY$7gADCL*WG>K;r~DWMr-eGa3VRkgGis-5x6@Kemn>Q?EkvfNt=g)oGYHq?kAT}vD&aJ=# z#t@psn?T)%?Kw$$i!FxxA1|)YY%PL!!IFOTc~GW*VKe{2X8wm^GylCs+_s!ue`wju zLpNE)6b6|~TZEJCwp8=y2QGp{;qw(?15%NGXnpO^L_FeH-SQ*{#Igq=?bHn7?(J5xc8b@bBW{ z8}D{H{`>qN-@JW(@$J>^#Wz>+KmPvLzg8{~(DG@!^9ev4C^u7|^)(@vHqS^a}qm@F3?K4yYKWPZJgj3P9N4Gy`yH zud|JiE_3MI@s5u;KX#cpMhB{~`Nr8T^MgF$Q?@Ov zsFU)Mz=mbWPn_Mn9Ewq-e;EL!w-B%-rJPNcECl1LE`1Xoa3&->hx#z6m#x1{94FC7 ze+h>}-a6)Yxp_XT99p>SBoy$@oR}xDP}tn~(nl{0QH83NiE3q1RAyIY;ON4hz(JfZ zrcE5hd1dV+_j(`HNN=JGs;-KIxp`}R7tLS8eWA&8qjQ#Z)engD!ExrxCDPtS7GZ2pOoEE5QmdbHKJ-63D-X7Nn(l*rEwCRdpd+k4v@$j!7 zdF@;AylA7gDZw&E3AJF2(^oElL?)ofIea#=B_V+2&Af4_lg5ScooXx(T*}`{H*U#N zC;Dr3Om<6oz?VEtRs%nr!x=dM+t%7M+*Bz!Th&j_1^wh)gtI6I>7<;*m?bG7(HA+* zdOUy0`X*5tP%pbnz?Pmy&Rajh)aD?X3*!Qi{gBTlTlZn;$Q}|K{((o8{_kIQahT*X-BH^VQ#fO&LELPha{k*q!lGMF445 zJ85}*Y%m==uQ*Gp*3mM4ogGW$hpX>sIX28yJ^^4`!k-1sfuS+Drogm_cD+R=Kmou9 zMZegRcAu{iN7IR_jm`Pm{A_GaYQ_&aFC&X%(`uzc^@}S_K_+?X6hKwglN5#GgsM1$ z4^_#K6+H-ZG(ux9u!@d%n}>row1Pq+-(?DGvW{WJTRQb=N2E~#_|+$$c9bfyb28fB z-~avh3fUht(KY2VE75PlR99o}x#Sya1RI9(pBipJ##+kofZ|jwfH<~Ke;oJem#VYt zde{OK*S)uhHbk4)CbE__%lH?><*tvhupveVy0g+9=fZ6Tok*1`5(sOGtSZsC@0#B+KLds zJ{gX?6wHxBIuw@BLG1+-K8NND6s-==$Pyh&-tp-oif(X#Z+Wun@d&@|_NJ@n??ysqr_fLp>J7Bp^?N^g7WLEB>=QW_`mV?LgwG` zP827;;DcPOF+W%hP?75SZiTjJYijmp-IA8%=HKUvSsPTOo+QE@dioTWW}5(NRDbNk^prgjD}n=w!)JBanLH# z@{-*okXAg4gSIZK!XA%tu?OKUj<3bmHN z5CrJEOwVmOiARG0h#O+s}k-d3ig zLP2G_-Knr_2Spmo`QfdfwjMvKXxjmb<=QnJD%MrE!P0R-w%%H{brn%5+waQz(|X(k zWyZj55ieLMjJ)u+ zef_jj33}7-AuX-ct|;k=n_Wt_N=gWZX)o1DZ!P(>yOt}w+ugR4?o73>^Ri6%)0cmq zzWtYr2UYv;`1!%;i~V;S|Fkpu)a}9RGW^tQlz}(02eN=ONbEZpa=gbU8m!G1Cy$2&OHEDlrka(&Mj-0cc1Z z1z4FZfUpvuLa{Is;f_-Xf_mXqlqLCq$01xM!WbmiRfDe}eN z;%S;N7YJTDk1W~<@Ua#I@{l=i zyk!)6qCa%z_4n5r0#4f^_}?Sv&wu{&0RFY0kcp*`;5VHhnf2W-FNmAj|9NGa1nAV0 zDR*HSimUS`dQ;Tatve(i?xKOD3VlrNuelhu&g?*HekD%qGvgd#b(f2Iaqd$Z`NT+L1ZABxX z(j=NqsFu*>oo8LAn^p7u#*K*Ms(j425s_-P^JDy^azdc$T~Sm>hK(tA#3D<*=q_~F zEamwve7T_wP;^zb({*1ex4z>-7A_>NDRh%1^Y|wErdpUl3lrHwkA12ySLQ-=cEG(k zC-SB5uOT}xS)yhky$gn%WbM((Qgqdu`nI}W-gKppn;NBylm$Ku9R+9Kz4L4~^HB)g z@?bTAI0HauGbtm~%tSRa!Dcr41_eU!gT8@GAiMtyNUWam+cUVb{m9t0^Znbi%Jr;D zAvt61lBP+!b~6!q#(&IBSu$C(zWG`6+k6P3FM&B_<9oF=ZEFXS^{$Y;Kg&wL@D+4N=E z)Tc79Ynk}4hC$P!&e3Tqd4IDcXdQJSBK-&!Y#BULi~gA(`l$(q3!j+~29IqrWRK)a z``%hTvUjFkb}dx=hgg4bW`4-PtZwfUb47W0IzrNH0Dneek+7v)U&u|LM$VFjkmarT zg%Rs*!2n-moZ;`~ zK!gEGrJE&51=WWofdA>^mm2NEus?q!Jv~8u^CAjUbhrvCcbG5aP{F{3QHTIxBIYid z={omF-X$sx7x`!tdC|==Utt*)%DL3dJNP4-^7}tjks=y=5n8iV6~C@y#DKd*)U|M5 z#7Oo+fcv4t6g-*%n#+LuC2LyvF%j4*j4qSz{()$iU`gl8nQUR$4TxdmcV%;&uxvP3 z=HvY;>f(KEZN%0rw>e#=DSRmJVZZ*7|rui z?NGP3;NbWY>kES3xK}`LO;?Wgy8XAmR_UYw&ob@(Bnooq5bLWmZ&}sK3XH@k;Q4Oa z#gb_6&@*W83tH>=Cu+XV}7NC1=?d^l6*KGhz>$bIt_O*+P6;^FMf4c(U zZMN$*O;wY@@X2a!4<(z|9=@lo@IKtInIfV(Mx8x)c+}~`#Yb7Hevqh;(`|U7JB-&o z9lJ15eH^)`rO-k9I(xMOE`=|v?aON0%xY^7RMpX=)(uzH>!P4lg7G_ZrP(C`Al?~w zS8l+aD3%y1WnfaJa2~C3M7*wRk!x|qG@jAW70Z&;=H2IZ}6kB5zPYHxg{3ICjevGSSk0M zIH^Vx(GL^+fqKThOZZ@9AVfd511a&~2#o}-d3n>29VdfgwU0Gv`SZ@(_wRT1c3z$R zW9Oen!1$RzpFneJvH&u)F~Et|)DvM!e@LuRV^8KmG-W~IdMq8z_70&}!4KU*ocK!y zuo5g~Qzm#1$76#G0RWxLfR#k5=g;sAO3OhJqIj$scbG8>!x_aTbMKc9vX-|DU~gUv3-8(!~GYr$Fep5h~A5q($mt ziM>4>S+=V*Q)O!FNsaFyO@FPP6M{20L7`BYH>@_q6h@6Y=dvm6#LrU8qb7mdC_V5J183RUNmn>K#A zhJd-_Q}P%JLuv=dVG-46GYYCGOw~}IhAyI2>V*DK)$ROnX$d%r8rdwHup7%;+4+wb zR_LX3*Kcr4^gLqUI z@rjB}+rsVL&{iqogf5R^6S*o?hTE?;3qmZK5;tr2{C1Dc9IQ2#ZI=-W^_QOPp^5UU zAq2F>bz%z_*#CYH4KThxLw^9L+c3vI2gSiR%i_G%z*;0Q9Uj(zP>u`v9fLA9zPws-~rlS|?7c zV+M`-S(kpQy0j_u^pYDw$3HH(b@uDE^~>eCbxE9b)_KO1V_m$-z+LD^y|*K@Klj9L zI62)P40TaN_UA$XQHNmUjG=Zz0m)f;nL|XnVdW1+xcHnw2qM<+AUs!)tYc(u_CDSl zTm>d@?%onG8hKca(ZYG%Ep7l+&0lEzf2(1a&!Rl3eQ_a{xJ!_y8t$Zw)e{MbEIQO> z>mE^pXK~flA(N0pCJV}&vyW%5&#vFzM`2Q`g6C8lRkb2aYGpq2R*7rJhU$ujEhBb% z?IL-?;c>2??+V!12yyi}d3rH&noi2A8=>%FILBS&CcJQ;hUm#)9yfLhIm1RtpBgwA z_Mj6zknTPBst4amdH-*Nej4|^U>bKeaB)JC_4ykI_Y{V+`$jeKp?1$rMqgKs5><{UK_yXoiC{OMU#BA#WG#@lx)hRS1nWECr|| z%hW7OzUpDJW%U7#mc-a&fj$a=y?3aszL9wx+7`VvMn`&V%Dsk|2{ks9W(Q>^yW!bY z5`Aj7E&~YKd&X%}$@=4Git?VLsw;rIU~)NgGO`fk=__c#6!68dM0uOI&fiDM2i;}E z5Dw%PhDSg<$9eKNr0d@KO>t3rtEen-B7#)zk<2aF;d7$9&1~9AvFg^PA9Hd&mzOb% zBQ7@Q!VOikiYP#uZqdS$?`{fY>02LQY+eJt06g&hS?0TC$n}?`k)OfN#lYq#+_okY z43&MJ^8t1@8&}5U(R^B&H&1w^g*=pT{nwSKm1;bH$uVRM?f*t{xQ*G@XL0~*K$O4L z7L0#$4w2E}!nG|g5LYPI7oh4yys2ESpo39bYJ?2Ll2KSKwl2N0=0>GL1TpL;`&PGw zsB_glQ)D!uosUoQ&#nm&&%kD)81=DivzJU%_vpl$g$TX-^|y_Gzg9*y)cr8Rh((;q z^xgZef?wQd?)om%T9j<&@wOMEhEYi4b>I#~a+T;790|9~CHFlV3ShmU<)G+s)@4bP z=*5G?Gepj2U>?DYq^7rmO5$`HCqN%z&gdRlS`^Uo)_HKKK-Cf1)TeqMrH-;dPJeSA z{F40<_`N$mmG|cOUKSHEY*;VmRZLregr{+jvpDGuv>~-n=oqtydU22@i{5}>^U~fO zhZpga{E^D4el?Wuz;O~WuT;oTzTpQ^;f=yq^iI}dN|j{2;%`c$c1W=iG7slO^_ zB>_v>Esw|y3?}hK5Zu5vBO(Sj@b>^?*h?KW@F#JW6hR>v`t+nP_dzkqxS&{(7j1HsS zPnQ$%h~ATr1DFq76`mVl}L}%0+F>9N=3>;@z}`vk;TcG zct^(`Qyg(xNqX-$_hIqvlw-G(GzNeP`js|_WKhRX5l^C({AtEq`F)()Hs_8OZKARy zaTtoynHtf;MW(JxvAYUIi0?+0*e-e}jab!nyA9WMb%Q}i@U4xkYJ{~FIh`uNYgP-K z$av+%8;~J&(;bO0uANeP42T&`=!|J8)(wfe3R^l$=;_Ym0`~_1wGROe&awjs6fc`Y zmZRmQxV?-;!y8T65Il-N!SPrOIC-e)K|D;W^6}jXzT33ll^i3#RA_Y`v(2X2n8nSQ zZ#rc+YCPLw+SWJ?D&@4@y}HepZQZ)HCbn+<1{7~@WDB}8>k}T$t516pUu4N{@Q5KE zl|5_bM!d&-r#B0L<0O}4VmSKN#mxE?uY5Z%L!LC2gguaNflUd5VLfr5_&wz@86{IR z5zJB#v~nh}>`?%qhhNW4kIgSG8IRwBp>&siqvf*lZN1`>D=H*-2x!_SCWJ>t{v&e6&KsXcTKP7b+q^vXGzo!ET9rp{ph@PH3y z(}US`YEMt>5?>Khn>}s{4}IP^+uJxyg!fdI5K@f=L?WqMLHQ2&4rj=n`-qoMnSeO- zj`XF7NB{5t{y(wxi7M)e)!+MJ$?V?s4`;)pW4WgFK%b61oz3>`!^4ApHatDvXTzhT z;lT;4%~wsjyFqTVxZ76}bEpe!pQ%LxMx zY?pa0k|w|Gz}q{cEG=U4?!%8ie)#q6)y~)Ae$9#kB`Et)gJFnbsgCO>2#qr4%Z@Yc z35(axXlKwL_76&p$O7Hlngyj0FX8WQC(lO%ic*udR0iHq873a}xY8&J?N(f^N?=He zezf!`-M(u$gSS2f+gN5_wV~9FNm>s-9rJ;2eS)2=Y7$EGcByNTYEAJB14b-OF>pyz{n;nS?4+cC5&D!02cj z@YBi?vP8FauJDV(VO2VB6kGs!GL4C~+v5JM8wEZH)IBE1B`#tbM`O( zncHcS#aIKzFZ>9Jq*f4tH~c#?k`eNOfL}l74vTsU*A+lkywEU*jjQC4Mc1ADw&s%m z^_~ z67dYSRMMonkJXH1iJ=nAtoa{q7{Yi8SqMx~lxKn>5}h4M zAhur3X)Q3Rrd}|We2e(aYcH5;i3jLRgt-uFh@1E5mmSyH8MWJ~UyV#(vF zatU#hQSOpVt4Li~4K2hj6geJQ*HE%PbCl>O%>ql<5r;#)qG{iZjb?(X?p2eTD)rIL z>$9aJ;t^~Icv{B^Lr&%L`V&zsF#wPJ90O*6s?Zn}y4rNQ{IQDWAcU*Lu-9maHLm42 z=0Ift9;;<&xOGqk`qcoEntyf^+U{N3G0RSOf9&mW|8{5e1))Jl2;;f8^ZM++c1AnDr=NGe z7UgKx-tox#AphPnBXp~EV6wZEmqLvqA8{)nWI9k9mK@eD)-rV+hYPCUe+IN3WWY`_ zrrrze8xBsnhh!0L@AJ!9JG%m2s*Iuf`ep%c6@-l{aO=tyjq+Bwe=(aALQz@9ag+!p zG3H5e977((Fx~A(^1irP8DvqrAvGgQ`z$V@fJq4HmZd8Uo7%H~aMJSZS2yVTg060J zB-C<*n`7U zHk-~4?UU2fvcFLDFom!5agX46=NTGzfqHy!t~A3#(s!zZ5gPOMTGaXl@7ngZ{pzMiK8iHX4RH zAAxnNFFT8B)Q0S*Our+`iU4WN1GYPw3%i`Mddo}3)-JnHV>>Ji5oHV9uG@U=fv-{J z{9BXdppey;cQ9+Y!HlN%y*hj99knojopwoaI$9rx&J(c% zs%_e`Ij}&a4&Ei0Ecu~!cyqFMIae)6-!c2dc0(|m8B5Qe!o5v@8ZlJz-~zwhIMxEr zl_Lxa1_J<02FN}9;Beb>eLcKYd3kLS_p{|(Htal{&1dkE7UOGJ(e(h&^6}@vH3f{w zg?KMcq_ug98m2-iT{mj*$OW)y+b+Nvi?bDt)g-gPOe^v+xr5hGod|3~sSglr9-BxF zE+oTI9KU)LgY{P<_gs&X&6HRf)8sUS^E?p={ndmN_l$J%jCAshbn;h4ItjxDn3GIS zG=Q9hVHvi8Ff2{au+tNN`4Ez*cr% z`uvW}sHWh?Yb>DMEzs<$+D=a6dhRj<8U)1d0n9OmVM3sfkSMMX2Ka<>xK#fR#-5?V z01^Pf3i7a0-vLT0;;M3&Y~ExT*C|6P)nN;hIClSKluk>V+%&)?%-`l(hW-7rC#dWI zswRd8OCGX0?{40oyU8M*qM2QEFL$f-sy&qzwE+hMqXt;zw3_O(&90TrP7jL^h98um zg0_j&rVxfLWlrBeiozgbG>#^yY)uCf6!D_dyg=6T^L%WDFpZ+WXz{kW6T7Z#2u2b!nLNtJE%TAvecubs(FJvYb+3+8qw^705m#R zX&n?6cab&~i;>)^<>o{%l{2Lsn7$V;T<$rYGj4MuJ-)9GkP|zDfEj{Wbr@kGTxK`ezIBmU z%QQ|f>BV|EIEL%!V84(5eR;BH4PFiVgJb+O7{bkaa0*|X&^O0=I*eDt{%{}ucL2|o zVE9}o>ePN=;89tK~2#sq`GBvGA*hxf#Wu>~auKtGa`VQ2`rL4rKTuJ0X zvAWWVp!hdC2rE&FURsfCz=}aOxPB4^PHI2$iTiLyj_uhv^xVg_2L#kNf}PCvEC)i- zP_l!FBiN7!LlwyZgPUW`K2b7lL(i5BTI4f`F)3g|6pB)w+Fk}oo8Z;R zUbwewqk~Z?S;%VYxCz9WfZ2K7u9R!zJItmAmeaDwkKcw}@C!*;#S0GqirxsfXpzuk69&9-avJDED@2;rb=yKZ zsI;0Dn|vAmcdHq|jhm)T@3Oq#O5Y4>Roflaq5-NCaTCLvZ=jyoKx>Y6wLpoEUfS#e zN817j0_F=G8!|D$n7EPUKrl%V62k!?oS;ES@K$K-6P3;18gH4`2&Bir&Z}?9AwY>4WtC^q326AQx!SD}BoB0j1G}ZsurH(yGCo z{sST|JPP1K6L71ny98X{sU81fy<;~Vaj{0$`2v9SteE3z2q+Hb22N@q?Yp3c3KX}s zV{x#Q7yqplB%O8_3h=nrkvaJEHU*H*gXyL7bsd;qIv2pJ2$hG*Ozg8TUIeIZV4$n& z!z92}fw~PXUxB=XnAnm5OXszOYAPcg2Ka=$Ip@|(TOdaQ803s6_5zfwI0^DoGG$&i z`BT?t(W>YZAV9-9>@Icp;9^l=FJ?F%+DX1jr>mD&%)Z&F2L_Rvk5k+zW?5*G_&7V? zu9%lwsE7rEYYCM~TxK$08Jr4H;92o1PWaOLj?YKd^$%y6gmV+?hqq^M^yvY|`zI#{ z&M7}RJ$%KEUh(}y$37hl4`;(8XSTn8cyfHqhWkf@GI8Q^=_Xw!sYd+Dc^9P_q8L5{ z(wQ|)=QIMar3)M&b&cz?n#d0e%jT(syqPxC!`$K*EM8bk7KX52Bn~cGq(Li>g}8A6 zrv;M%K<9vwX1)Q!^o~z=MmznNQ`dia$EQ{=wEp|$hpUezFq^qH81wUiA{GIk z+5$2&jeP4nT0K_X^Zk1yKZ@wje4$lSAdUE+f{p?Dl@AIeF~mu<5}qUIrocGWj!5?$ z)Mk>-+No;@1^ifOAWM?Sou&y#Ljb`SSq!V*qq*Co?xm66uYr4rM;6sbp^5pTyNrU6 zM~U!x(!+)As%~kGZb>iw1s0&Pu{)Tl?7;KbG>BLdtc$m)7A1tQ`c;`JPB_m53%Fp# zo4WvA&4^tIxL(^)n4YWk)PijmTB4^78WoDt!rBx{dm=Y@wN2Z&94Y?U@d#Pk&%*FB z`?8LtE6B4bjJc)ES-LtFH7F!UgxJMLF_cs7KYl^D^7tnPmf&BzEhlulzH{}ipEm_; zP&E!*qRdd&X_Y=>D}F@no@&~nCTHSW;o6;%YM+3k0CqwTu!{2ywE_2esYD@<(Vq@e zm;XXug(+XKTQ`U@=K+fWEQW5lj7&Pf#hI0$5yTZSP_H`_2)+x=G2EYAes?c=^t1AH z=}!8;OCy1CR(d|Lopa{Pz$@Ye!@M0YSnc6eLD(iK`YPgR{K_&9eKAyRk6531Ix0C5#ypVH8p@)>wNXK949 zWG^6al`>8Xk~AA2ogzz>Rv~DEgn6O?APDF&*SBoS>(ORplyWlIl48F#CW8p39217R zR&`XaY05mv&(c;U*D4gg84bEE=drAm3@o8*pb>AblnRKuYwOsE4ayvY?}D!4lEukX z?cALumd&CPEJ5NX9&b0O8®W|7inX%L(7D@F%wA3;hoaddA?UxQ`R6`OdBG&&Uzd*r*BB z+8Ea$qc#Q13Kw%-HDA!k))_8r<_A6?PLMR94(*YGDvtOhpjaPRxHLnoF>qb1Eys_m znqY3zpvzf{mZ04?wz2EYfc|N$uhMrd?mM*0@_j6B+-fL) zQDgVriF_^FM%TXkR($tZLF5&2q!;!NX7d?85u;DHvpV+Oo}AHj!$g&$2=3<)tp@roq_^{BnjB#KMqaHVp63ODTA5neF+AzvcWfj-!< z2mg8f_WO(X*7@73j~DMQ&d)x+#c!>CzhsqBs+(YSW|cSF$4|rofI2GQ!k3n-??z7lPVi|Sow&TX3$5s=y*Sbg$N9g9&1Ta_xwXGydg@b?zY7|jr&(~_BN(ot5uH=9(tr~F##@+Y&iLZ+%=KQhuHZh!GB69KiFlAO+yP#2Q(@wd(;k6=ROu_Bns! zh3+oB@`G!LORmiC`Q^_PQI~KVQU9~+#mW!#&ev#pe5kv)Dy8Y+eq7&Orc3Mg{PO2` z&+-Gm=Wv3(bF3v>S-{b-1aqmwg)$8W16ZS4L#F1W43=S<7;TKg*C0BLlMac=2zi%S z2`qM)Qb2J8P{v+tGq}Qc$KA7;KYN*?e+pKNCdUXV( z?wP9#E+;*41HV@DeTI=$D zf2fJ12iQD7HG#fOpcSzmbxDV3P#*YgDNJOHhgMvj{R9^F?_cW&;7Egt#g{>}()L+( zv^IB>+rd2*vC<-gErst*#pw>W1)>^ZumuoAwF(rh%ql)I!ABF#n zmC?r%X-^gFZgH&Vqqyd|o)?4%`~BwGbYdzcwg*3%-+#G18jk;_n{7j`$i|TWp}q~M zfSL9O_XnGWaSHhL5SigC31-CdUU5@cZ%{Er5mknLaB_`OD2h_?dvv|8j*ARph#^WK zi4Z&^O~N!GcNEMpOA=(OQpY1Atpag}1HV^&M7t0o?mPUC+aQGwnFzr)^;HfYSlUG6x>vxnsFtY53#S5V1fE1`b%XN^91J*p=0^lki>TRKE zcrVCk=@x3*P*GaaW{k*@xS3=J5r*2vR3wL5vyD7e&2bdEAqUFk9>w-8*M}diDN)22 z<+vD1Hj*7I0V+YB)es1jbNrk z*3XBa&9U7HKAo+z54L-OuWPgyOwQL7-M8KcNhw7eGO~p`?%WGf$9m5Y6d}vtDseMI z`6I$~(dkc>GpD+L>I~zy&ADSFuK^$UE(OOCSY^H(QR&u z7NsnR`qeDaOH>nYi>?j^4e7cXvrA6%;m!)vD!D%7z=PqfMSh>b>_`Ra%_DdnkOA+q z6;f{&w*$H>fEv`t@O*K1a8>pb7RxNgPYM5=z**<|pFroJ&j`%dqc=bGt;>jqOo0eW z0&Bs12Y7ZNBn}C2=p+MxA|9tpF2b&`>gfvjSsijxf4Tx`n9(WEf@&L>_31|zCp`rG z>s>fC4;LHQn1d&Vsz*bl9`|CjUaleYsL%HYQ2Xy;^qXK&}ni}!Eg!|o3IaeL4pf`SDlT^d#b zpZ9{X2|5hD#>pMWJcS>B={S6k802) zq==g%1^>sm-?d;^M;dkzygnMdc3A&(rDhE0w32ZZh^SQXxLC5d3nGG17-HwJoAPQ| zAp)p*KmQ%9&87z`M*60-#X4YUQw8WCD?RYFDuT4Lg-eH0B%rpHv@7Ul@!+t3a%y5t z(99x&Fo^2~&Zy}McS={d9c?{&vl7mTaUBl&M>LX z=0%h&+{kIShz7&{!J!cgT{{WHY1&5K80HxZsTcDFc?vpc7XexjC=V|($4!wA_ttt@ z7*5QZ@3sVrzK`qgbbZ-dTl=jASEb22`|os8iN22_@`jd+1095 z0v4kj%O?jhUbtafJEaPXP$lpX1tLyTau--LBtgRrdYC`SV0>SK^W-j=P?3{jkzJ@r z)N#nipa}0!No?vsMnWsQj*_J9KKd3okH(KiGo%r~>r8Y98CRay)>8xV*|LdY5h7%3 zQ=`sF`^GSP$?pYdqsofP1}aPs+KC-z3tnk0|B-yiVAB)5Qq%qnLoZxncckG6Uc>e~ zwH-P18u%mzu#s|jWr@S8{hs@cAdCLdg5Ij(B%)(3JCF2X-ubx$Q$OVh10$SgEN7{@ zzW!kS`^Co+S+v-@yr-f`e9I4I;wu#2-pD6epu3y-exf)3{DwZ! z(OOfVa7h}ieSa2fAlS@Bf2}CEi>-L&+lG5|1>2`QYWKWIZ^Q2R*RTg7WjT1<3RLT@ z46SCi^=JFzQ?Ng_mhB};_iTfFwn1**2C3=`8?{1i!35da{&;`N)mFOKH*oFM8zf>L z^=6UFeFx$xEA7mJhPz#fdvP3eK=!@&y|mM{wBdTQRohIZweMUn$;r;a@_A8zcf0Vb zJh)}d{RWic4M7u^@rad-tvJI6w}AEwKq9PJ>f1z#Bam=&$eGxTL|hvMMMoEJhe3tcZ4QO(C++V=M3{h^Mk(^Jacu~r+GR0`sRe{8%VYlBdKk+U+*wab`qh z)}_eMzlMuSOgT0&!hQk436e0R2}Xt27?mXt$^;&A{dsfDVkstG_!C%>UqI#-63UoT z-#-J_H(IX2H5-t@91a!fv7H6c)O8##qzn{8KxcK8c!7OmtOVe867B=!v64-Z&nFe5 zJk<=p{Xjv>I0z+msoYL@CKq0Clp2o&%svBUs@D3ilyVk^Lg{KKE#h;xgepZ}vQ0bL7TF zbvjW*G)||6x^!&hE|rt`AW2^a?;4+WIT?yDxF9&-fY8)`$EV^{Fu-MLc9ucO#XYrk ziifUeo4+;Bc`J_l`T7VYRLG0}W)NV8St9|~n%G_uh>sO>(9no9-WVnb3Y&FtQK5{= zkZG8QD&(mp5|uBM3QOT`O1p@I; z3I(FPvi%0OeiATu7uf+#L7%YPB$c9rwNOb^eQTw*-bOBQP zid!tmwpBaS#otqgLR9Y!0T2ts3EU&fAE;wD8@*kGmf(7j$9v+YloHe0bZqC2>nvl< zpe2;FCl}}gBN9B}oLg12{3Vgy8&KvdvZ6z@>7yaXZ4xiC!D%6f=QT_0MT36@Lx0HK zmM>629^ALyGJ9chk7MrdGL3;x_Lf^aut|6JM3`iTX)Gb;)uSdsJYTT^_vrKo2+NS1 z4%z0kzzMq}CE*T~xswUF9Syg!p{Jc_kBbM0amndws^KJWn&dA#uCp_0x8Ay~K5hfdwCD*#c|2{IML7Z%R(HEMt^_6~~)T%H2;Vw7+&^`o)-(0$$SV7sB6Q|c@6LA z%d+;Swn4n7=H%4xoocZ)bRA-`)Ks7ks0zc0;&klfClne{m+BI}41k8$_yM~k_x`BYTH4aqrnpoVE(RCcO2|iO_9viY6w4oCn zatd;G+M1`PfwQXly09t=uELsBf|lf6+oJ6nH{qy(V^28(ip)b@lK14%F6k_Kf-1;$ z!WwrOrRbS1-hk@pamx$l0Lq2!yhr?G*(nKnhUra7Ep%MD1VN#!Qr&z2$pKi;$pEscZESLAdD4Q?MluA67TApnWx$ zhlh)jk?onTo__2@%^dzULm)5`wTQsaeCy&eTNgvb%V4)UO&nq0#c!Y51FbvD7f?BZ{jC=bou)y3vU z{P&c{$^ZS||0lNMAdQg2t~d_b>IZ%N@5@qt7Zqc^qZJlq-3<-5_Bh|$tqz;pz_oc# z%;(yNO`){>u)(jhMWYz(&;lpEF2%WcZk%M1A)*NFae}{|iGsdV0i&q_0QAd~tU{on z$SlUysXE-ZesJxZAX-_ky<4Yr(GrDB2Ks$zs&=Ti!=`S+t%Lpj`uc{=_1SKQnp;ym zXGv0aFxzA#*MSOy=#TV8{(N1IZo%jE1=5n5xQ;44vt?8$D|=L5nzUP4FJX{e@=_Lo zc>-$=ypD2&v^_Zo%Z$IW&R(Be7rx!MemVPSo$eo;3`?_tA@t2N@rN5CWr?=J)006t z)iVr$b7TUqwOLxGJkMXxcFJ+aiJ{P$$L3l56R6~+eJjJwa$uP*K-no|Sy71-QDW1z zu&}KgE``r~{Aum+=Uw^d*p+Qnh|Q=DWt9O`JKu5>zI6Wp3lH43!9^4VPNnAp8(lj0 zfLs_UGa!Ct0j7x9tUl-fBE-vC(pAH99cb}ksGJFwYNBb*yTARYPtj!ov9NZRshox` z8?yQvB*Vkp^B3uo`S>J8M9ayb*6Z4GdbodZdU&AmO5&^fcpFTSM}ij-#4RXlGHD-x zU)wMYFAoMUhx-E^Re8uGH*kQU-k5kQ+4Bmm$fu!2Gxpmw!;E1OG9-nQiG#VBQZ(W_ z!I-pXAze}&&r)yCB1WYb9XZnl*`H=w=;n*&N7xiZMTVjPWy*&3NJnw-_%XIOe6^;q zzu_ws^#8$E%56~k%C4_}fI8v|xQHU_k@YX)8L0{&wFVJ{<%lQXZCKMQd@SSNy;c= z*hRaWBiP#v0va0iB&VgLVFeQ?e4104HzGZ*dXvkm(ec5E9ge1KG&~$R2cuWB5u1$$ zuSWLC==5-OG910)qm%v7(eY@iJ1=IgKSvA`|31XDrp59whu92qDrrYeU=^Y0fUA>X z6~*zQ7sbpvJ3BjjeenJdc0O3yzt}JP{g)>Pr$66X&1T+Q)@N0>Tj7r{*Suifb0X%h z8>^O;gEH>7AA`AtA6r}3vI624(i>(m>yE)$0q5ZziyUheq>&77^MZK>uP$&2AUqBH zkRlBUPEm-==p{T_3UC(Jp99040%m|u!$E^_<5Mn(qSA;9W;&Y##iA%05Ii{WmI7h` zwPX+GG~#Ipx4I-oKck=tXUNK#Ifw*xBW{kf%Zt8s9V~f9;weZGPortG5$%l%PKYJz>mTF4c4uriLEd)V$GX~q}|(r zjkYt|fpK#Ec`v?mXNkA!4TguqojnZm8QrTunPT$ws{zbzWSzl3y3i5D#V2Aa1REV8C+S`Jx$a?T(VN7H&-Ny@@{LJa0vtF}#J9^7!h7S64?MNWT>Heto)BceD{ z+oiotBk!K0QWq?NZ|E8md5@Rs)_OCWq@*eLZA;l{ZGEKoO2IR_=j0$Xp|wBOdeSzy z3C-`xZU9h|Vvcy{8_?K9Ng};~R44p~Vq>z0C6OjnC@vxRFmZ?~8Ts11axKdJq7`AIx4WY~gJOp=%NKSF;B?`bowZXf0eA*xETHl>>hebUl zcL%%^@M{l79S0ZwV$)sgyLWEk$(>3fnchQE&R#7y)cOwAPO$>wkB32f(LSZo9Ici87=r%avo)W9>Dg5 zTWM=QR6-a^T^vsV82x(E^0$dBvzij|Jos>yg85PXUbS0hwC)R>WYJpW!vc<~%r+@4 zmBErFd{1ySgUu2+Kt3k`+f11_#Qq>N2t-@^kdSCCgJK4a6_)IC2)81dK<#z{I|Ykf zrxC)Tcu{|beSqK2)X}K9A4|?RxK?B~{K62HVz3B7hHe7_5bO-U{0QG^f-%)JOPU4| z0zVZHIn`?SfHj`^MP6xoH>>y@Kh}%yn#J%4r!@Mga=>X7CsrQUH4W8U{^;Mr!#c{@ zyefk;sXXetu{DoaiE9YI$p-y<_|#4v>C&}_(MTdbi+H?fzre){r4@cf-_|d2z=X)ZdiQrH@&RU7aT0)Cl9M*)$7P#YSRH+J)_x3ky$R_#Agy>S1 zyLqs5R1%^P4LHIE&eys%Oebp>W(QgiRQa|SgjzS=gEm83P|4kM!oc+tTwV}W5Q)n_ zn*o(UNjAb>Z8au!_7^Bifa1TjndeRQ0P(URlQeR*=>hsW(#7PE zQ;E6>7__R1^1(MCv_zjtS0iVs148hvDKtm-5SFTD^+dOoT%=e%!~ZB&0Mu(>usm!sJ4mm(>4W+I~|x${bKS+H}6&p ztifOR#8<<;uNAfCx`xq_X1tBuYg!BIY74%V>rTw=h$mT4Ee%G!^*i+)F0{UfYb&*< z8{{0>@TpB3aR*RQiXT9l`ymQVxt9q0zheET0JJQcdRWEkt1fnuzQFp29;#{i$5v+z;SL%b#!Lm)fLB;~TbU zd}A`u98pl&Z`%(kP=rE*2K>ALOAF9EnhomSvxU-Vp)@K9Xg1r3j({a8Dgu6v3mHm6 zkd#CSQVT4YH^YktY7I}!&o6DZtw$BFZW|d@EJ+zvaVgAFBIsVG8nn2R2V(?)>rx(I zH8$f<6pW!Ur%Dn@)#GT0y2y(%1zr?4duICu2rC#QoTFkT>I);Qa9J{|C-rA>wHu}A zjl3VtaU5ic*uIWRE`wC$u)#V(ZNkG8H~qy|L`>v8>>M=l7)I%JgC+9r8sjCXgEF*I zNieFem@Gu0MQlR8M7A4~a8(XD)?1aU9aO>*aImUj2=&6jEMmU32!vte=eRL(IwL5)EEC^RU7&k79EejArM^@ZGozVCe%tN^wx>O#8uSnQ@Q93RG=|yw zg0CPQ*z(v4T)(YbDs0{K&uBR8*?uYQ5Q?2(Arqt11Mx@PIVYwA+6kex4B~_uCBMaH zVtIXi+{c0qkBUL=$G@IH3{%Uxz&-dA@li_qW930Q4hsQ_z`+PV6B+gg+2UEt5 zr)+w{?Ag#hX2XNotCO0JBtbaA<}}8L*ep@>4-~SlPrx@)H-V)X1)d;dBWj)NAI{`E z0QU96+p{bkI9JKCycTuNXf%7#tlO4v$|VZC)wZj#f2P*}7V4ogYOxb^go<%HQcs&XrI-g0X*P+0qB zl*z_x_-IUgZZC1ZU}E#=iv-nyPkTF#8;2fSP3$GW@~C|FVY*~FkNw_`Ag|vU?Yy-8 z=}XawmsHGM5Z$=`eB!tfJOCe&j{ts#+~U0*htF8*B|9U?0WM(>iL#Iu4M-}u9YoIm zpaI>pQvb#e?))n87OpHfu(X39GJPX~cGI&_s2Kcwq^* zk%|xGLGun{(ek(i1FDu%6IRUH~3dWH}k*_Fp z?J#Wqe5%~|A$7TNNttV*N`x$q?}EtbMH`^lD;6dI#N?M2ep%!wcm1B6?$To{0n*?^ zV<@>44`0=j=Apt^DsW3`D@7Z~7z1;|@&Czhn)0L`KAo(oxj;Sw)Q;_%ErTkuX%Hr` zre=%x^8U4HlX!3zw@k3n$}gbaDGpU+_nvk1+d@Fu7Z zXTM%szg(VUaG`Zc6KUYe=yX{ zEW3**qJoLR_9@!}sz%@w&~r^wK=8PZJ`H{+jeB=IPI?1FbEpnrZ5Lw*|WYR3##1kD|)keo;Q z8H070&zjDy8rr70IxCPgGKytY0P27T7?pHCv8JwsE?cr2Zlxh{90p|T2Rb312vxv> zwM(q7y5)8{?CIG=-(ZU>=qwE>5*}d zt6vK3m_&~k+&NSHQ@jpbWb=r}zkBMpkPQ*5U)-?S4O73cSsXLpiI`bX$$>e~QD}>@ z3y1@>qY&Dkdo2!~(Ej|539x*hHH$FXj&<_BTvn5;5G+W=(QmaJ1x->9;(Nn{`L-_g zhpHG^yRPsM`}3ZN4Zzh?Er`CB1Prb}r$f{R=Q93DY)o|gVwe{F9r1s1I}slQWBL{k zP0%bF4$hL2qtxAM%rm8-g>KW(f~TPJ{kp(x)at4uf)1M6zTsjy+;4fY6v2GvYZ*1; z440wy2KMNZtkuCAEnUnz=n)_J+DCAyJQ)W97$}YLo>WVJ%Mlsx6;o(a3&Ox-QO{#HoaXgDiKX=+DV!}IB&3M5Ws|g$no2MQ*{X~K zg!kYQ!7Y#k{q~s8c>_poVPQzB2ne34!2TJr4)6qCuv?yIl+?^ho}Chptg|R$tN%f3 zDl^TLY@}v~7g`$gWjrpQreFWH-G+2S$e`yvv?{K<8w-WuR=iNm25cInG*2Fo+9zbm zj0GzN@Cbs)6=n3TGvPBUk)}%nBCNiM`LU$86P^|beiN>?#GNra(e7|j5n51dV4TA+ zXQQMNryPi+6cBOYjRWqTLTP7VXtM5tK^iYRS(G~dxCa9eL=X-7oh0>v_%eV;NP>FY z^cPw$e|d$aQQi8g@y&hxS0i~44aF0Iw!p@0S?)5h(~^X^#$R50!L%l2RHjk`WdTfySW4Wy+`G_?ecP&4&TP({7La~ zsUx?xbZP8*E?H`H8YRHPUU2&+PM2BGNvSm;#&3BfsAs{@1QpIBH_`LCUjJ~0@izz4 zef#imczQCk2ln9bl+C8IL;K|P^msNs9Ucx}F@8AUhsTGf)6;`Pn;o7Wot_S+uTGAJ z(~~3J?L@XX6Hf-pB=XTHeG<%{ygbU#&3qd=!JSV`vHecaEmUGZng21yWQf0iUj5OA z>#NlAQr=llB23y8k3#!3#56n&as$ZSY6s=%%dKr>SC~) zY$^pnK?`r0ml`6I-hKE0(MK#Q=~=tK?Yuwx>Fv%xM%HgTSjNsjb`9}C-R3S0y$!gu z%H?S;@x=7E8(Z=@a{J5In}%MzQ+w%l{oBBUY(iJ$Q00q;UMpX|$D>Ngbr*075-Jz= za5vd;x2vqKn_CN;&KgjjfZB1FPb-684ee#ooF{p~abgN>45PqF?P_=^zBL|MyNPtm zkbn@blv{M2V~{36yQbT=-P7IEwmt1>Thq2}+qP}nwr$(C@osiS{KkLb= zh^orxy05$jClXGMAI{P}&URb~1##)135Jv(8i^6L-7pqvTC0-fFCo~u(AOWcdH ze}n?wNEa2r$?sro&?oadYGwB1%RAaI3|I_e8PCZ{k6mxJjL#d1da}TdgqLFXO_s%S z3qQ~8jJACb&n&={Vw>;p^xec)@OAvuwPYE;UlW{l(E}LXf*}kI#7!>i>_g$I6(@eXhHbYF zyFGljO|AHYiaUQ=(iR1CToR&Wz#@~{=^z;uz86Ccs~;RmL}tVW279xZ@M7Cs1gzoL zhx1av_7Ezm@JqUfLSlSay9}f_+@U7yse%4;hKb8#*VVM9Vej zu%5F~(~)!jc?2iA%;HS(l2uHkrdl1_$yJSWr)rJn4>XXRXgltuq5G#0DF=5p7q}F+ z<#&#iZJ13Y+ggv|;N9NAm?M}y;&$rtyH#Ky#C^O@K^RCTlmZ=D%~@ zqpqe#K-cSxpQZu$#hN}inmm<%uiJsh)Iy!MK-m8Y2 zR_KYb5hnCUTW0JiaoV}C8V~&`3?SbTHi`5OCShC79_vxWpj zb#zv)ogt>aMZ(*uGFY zwCFj2{FDJ?O^2ZpE(n%DVm#SacXSJO-{+Oq*xOKPz7zn2vJtiC)=0rg39Q*0M(N0b z9PA^a_i7^dH+%0IGG7pz@FpL+5is*lw1(6~@u#hanp#=NBv51!#8k!>-~i4me;5f$ zj1G~nnxSarLyJe*R1%=amjNZgeS$j?AA6KUB6akl04>L~BR?|?Tjz;YfOZgss}9#G z5YHcOl1VzMI`8=OPEoO_v2{vJw}D|-;-L9T8t4I@%Qrqd(GNoFS2o{(iXF6uA^pVL zW1-kRbCVwNz0RWx&o&WLj)>?eey6S~N%~mMarD%M-Ist>s;;^2bhAnTQQ>gMMV0-pkY9 zCX~4KWl%*Jfuy%k)eM|^xcvyN23D`;Tb%=3+Xm(lL3WkdY^gp)MjnC2 z^xo;a{fQxgRa5h1fw|DwmwK9p2EotK$p4%)S81LUvdeHin(SAmH>T;fk&sMHbDnIr zFcJb;Qo^N#BA+QyR34FFjYP7+uIkbWz%+|7e*kW;7lR@)?id`gkLe5ypIfDwA5zkU zPLONC%Y|fFH4$ja^5@#cSku^%OTzq31mo7aD@hP`>cC>5u-{>rgju1Of(eAUl3tZ~ zfG0u6%)7^xLiwzmlK^!-JznF$CGMgznb5fFxPZ>xM{WVz6Rcxyk@|Ns#FqTbX!KR< z{?};d-$!KTe6yMyZ>nlPC%CL^Gp*9I;9nErRohYwrh2Ct0|E_mE85J;e26w1=kKf1 zEHq_=N=TY-0m6eKtD2*Xv%~IGUzP7m?H=QQB+jooMC9yo)3_sMAmlwf2Js!nA}l+W z6K8&TB1)?%gzijafClBiZ8<*?WGR$G4O&j9m0c3$Lh6`Jex-g8k*{5P|Ldry87eH! zRzuo?+Mje0aC8_N;9rSG8jM;@4Mb2TVN+NcXq!7H3rRnmF%=Awm@16mv}=%Ox;pB* zV{mI1|E7)3EY98&Um!xqu6S=C#&+Zpi!`VRVRY3*^TXLyB@v_2a6BTS$<7gj5zhhCq9O3BgZ`%bZR4P$M0OlZ>8u!1bo#a4qAzK83O0edL1VtXDOXA2e?NN^ss3!%?L7G2gAV$=IF@i zK@;6XusBbG0oq^BWAExP;W0+HB+3C_doQrciy6h--C0zbUsH{?B8j%>=B$H%(Vexx zo7}(7X~518_4Hm^I_S~PSs9SFNSf4LYuA_fKSlobBON57Blx#a95t19F(uVf;H0ev zkmmgTtcC>0T6{w!gc<+NUe9~*1mc+lzQqc8YjC}x+lH;r@B8}dbjf+Se%SUZ?8>MR zBLxd#xnC#ZVBiLZVoJ+pbn?QeI!`Kbzvz!Aj{xGXi3IH)1aqMmQ4zx9T}^H@xcl0O z;pXyzQ(|P2r`v3haWgZ?(-2F)n|J#}QBr2mYh=`143!_nJ4HhJ0ox*lDj0Kisj{lI zwHZH*OR@tkh)+GT#2N7hBh!udPkZM)+XwNYyb{d2v_g4=Kai`j4&M`($wJM;KxV>K z?fO%eT|EDQG$>;9osumh+RSWs&N{!l0uB#*IgiLoLTXm$sJnemS4#r+_AFfwC!b#s zWus%(YyqW%|6t0jt>?|s%{iD47bEr?tuotkh!}R#i;49KBQ<1nOKi7msT`@$SIh+R z)Lh5<js!L3@$3!jlis}DAMWsTt|Oh_=}W2s_tCOd+NNJG6NsvW zk{E{n9oPC8mjtfxN0kVO3h!Aqc6A(cQ6J{za$1>kABPeA*n5&)*=H$HWR^4vYsKHZ zHw7QNAoirk(0`yi6*%T7*m-;uEqT$YTdKY5#mz^+ad`NGW#8j~;{9X~KUC z{`hzptzo@i$Ngsl$IF|lp5TBEuN4uNdBH^2@V3oXH3 zXY2+0+Bml+5xa0BfmE`vC$=^=gK+rI?^ksm{mLMriX*O2|?`4jh{1fbOCh()fOL zwbj(Q6>Yj#vZXNDN2J2W_QN59e^2Uxu&J*vm}^Y6)lS#Xa)HhIOkp- zD)RIj0kP5?$GHM=pFx3-ZM884b;Be0SAIS~1u9ppd8~$+l3#FWH2PPtnKx|J@_60w z8G+d4`u%Mx-&3UIVFS!T)KqW6FUoeY=7!Bbl zL_2Fqs5JM>btUkPu8ikvr)gx4ds=Hq39GnUD1oulVWqcJVRfgR?OLq^C0kZasq2ii zjm8d4DdHHJRLfciO=JntP9y z{RnXGXiS8aD?2>jdfRoh)z1n8B}!GZk@CX7e0li@2pIU@tKF{O4SpvOm~9nhGC>{; zQ{pGtwrwML9LjO!eHBO-fO?_EOrV8>R+qRSk44>KZFv( zpB5~&okB$l&mAP~^$?cyu{{|9_p99Dyp@^2H^9lD1#YZlEdl;a_BsO{av9J^hL zrLpmJA`II@wU1AzBSGGKY7?bX&5uw+Q7G{}tm6=cf?|5Pw5@t)@PXG9z!$zWo}c)U zcWx*qgmf7CaOPZ%G3_9c8FjBOZG4Q)-p;3$!|G|r!v>T z#lKb>S;o3v0-(P8M+qOf4C*`L8StB%0_N?^Ne&QRzWe)mPgG%L?UUV=YZ>xDMzHyR z68;Qi7FA3z_zT{f_Go!3-I5$@_0uQgRZqNge3P?&8(ib82EKW0ERkGnwT_&YFonw-y8 zswS`KKidAUA2_HqR}d<%TZ+t7Vpbh2?gP@rc5BIY%Q2%20(OwhL?Vkq=wMP3lDGmi zU1@gh^mTy5=bQ@xGYuaA2bG9+bD---yQO-Gd(9$yG!XA+IeMB`V}c=k?!_SYh|h@SQaZ^;X7}=5PFhL?O$1E0M})y7hajU@sG4tvd;(0Al#NI{ zh|n&_QjZ!VHPF#&oaa{`HtiZVUx-d~vxbSA84L`PjO8i`N5k4Kv)`5CL{1U-~GB$8VXI~UN5Dx$gm z9Eb7OKBtvd^N?W2FEPSt(I?v-GsOux9oQFckf3`v;`K&FROnGBhn_CF(*Z)d zJ-08-{AJmoy#f!~SMN;_oFD4@a?R#Dt&9PG@NfhJ@Sl?@4O@C8jpyg{D|%H-zVDNX z4sc0#Sd8G!7?119lV>2t{FHYhhpg<`8sFEMCbv&PtH1teNrtlyB$9tfPQhrX`W*ES zzpBGdTQE1p{XDUvKKmlABVGE*Njt)!r#NKvX>dE_fnZ^f*DV(LR%V?Cv~RGX;pBTq*;_z zROs;R%x$iii#4MVER>Vp-g>cQWX9)8(n5J+U(a}MjA!vdw>4bpBNfP#8i z7RaMDJrYiVT8xb8hZtu!5@aO^NCB5r@vGFcvwE_ntqLAH^&tW3SLN)QYE?Y z|Mu?6&!I@I;E26F+smxNeQ8Q2bA_!BtON`RBvj9j6Hh^Wp0zF#tko&AWe?cP)m*0; z&5C)x%sr(&EvrFvqh9bfNn@<;m-{@L9@By|v#(1=T)h9F6lX~rbmguW4o@sHk@|G8 z`+tBT5wi!QJubL>(Z$}pivF<%oZq3=KnBNiWX{WiKJFp=JM#KND5N=a;^#XJ>(2Jh znDB)ja|Nuop!Li(e;}fXsGemVy{i%A)tiPFfKfLL5=stP@H?S4yfpU4hLS z!T#NVRb+LNx>hg#f{0te#nf zc9H_HQx~m*8%dk99chz#<}v9*rQe@!i1l@2uorCx&oCJ)V>X9a#+D3X=Gxez;kj>)Fgq?jn{tSZKE7NJH0wxJLp!~Bh# zNJq6ckq)W4@a~A*%ZPShK)G40x?k%?aaHH+su}`J!y&jZ$<26p&sP^?`8xeI+x8rg zA0O*?Xd+EGGR=k3+yl2Tv5Y_!n6Gy2gRfTB0wVT#7f35!R z`5A5yYccV)EKC#$RIM}}J^q}!_;}0ju!&)6WRdmD%vm)43EHNk`5|R;N#G$=Rr0aB z2@Xv7T8fBYO}p3Z=4vHtuU3j4U0)alM`wOn&6t3T4qj(L9&b2VpubVo1Uxx5K1+znAEv8 zv;7Y-pf?uDi5CHaKrbUf3IFKc*@iu~Sra4vCkuE@PKYSWf-LW{nMI#VNkLKPKm1Ce zAUpQ{oJZLSkhKY6+@xHtXU+wdW26S!#h}MRQ0(;4Oi{9g8Ep}xf7<8PKgtZ^aV8h zEw15UQ2aokJ(3al=DMb!IORm~=8n59ms&HW`NRO(W5)p}G@j?#9@NW43lZ%b30-4H z0)h+Z#??r9yK(oc;Ze#$GAzYZOLp_8p;hi&V}PXJ{(&Cm&xMPt>~>}whU&J^(Vy~K;~st%RDFjjZINl7{Sm&7F{(d719Z|QP%T%xzwY8NaZV-CK_~O zYBOLpKBl#Lv^X z7*MueRX-{y$AMo=H*W4gz?|t#Ii`M-7s4l5-X9CdeB9`RVgDzp=kw5q-yKAt%vD80 zK---E1=Qp2{sF|j6~TyLC-k){S_$#88^Zu^27Cp)y9XZ>Yf@cr%u#{0={1bXhd%%8 zy^bov=f3TK5p>e8f=cE()7XOrPS? z3+NOTBs?AqR|j;P42lm7IfR;ye<;HvCw*K_hg0C*h?ZK^2boE&f zSQji3Q>o=HhedWP|C-UN;;grK^=%=RHaQw&YLlGAxal&A4rF2h@o3{Xs6$|LW~5~he>J2AmdxX z-*S6!h_`Lt(yOK|dlE#INVPUu4zi;~T0>c1n&}jCM_sT_(^@=X6>HTyD_^U7c#4xQ zsKxdYz+q?A6$Wg%JQ*;EqpeDSTsOpSjb(2#BLPBAp$uI3>zdXE-9ia(lV`Hg6i3g_ zQo?%@hH6l<0?zhbF6?rtcaJ#A-{;sFh7E#f=K=zyJFAzQM05WJG~{9;T0y72j%p;h zdG+T{Xt83^rspY-F=O>zPG)L(PyUue;$>_bLJAK?odE*Q{TJt?Ck>^W7f!d}+kO(8 z0dzH9b6|)+3-rQo$#LqIPJC%(^!XQmg;Y{6zP$BFUmZD@(_p+Ti6(_Srp)_0&noS3 z8=Q8ji(qoI*0k*c-`@Lj5?`GbY#=|U%3WK^4e=ZvAPp1M-@oOiSs$#f#W75wn_>uy z%Px#&pp*6I|LpnhMZ1PDVTZEgET_J1>@A>SS2+Wg1?{UUkXUk1lAdaZDUpl5$q>RQ z(2KQoGL!uu=)yE5c7PyVk<=!Boa*RYXAUbd(HcX4SXCmkCTDupFiWJ_5V!eQUQX z@D(7(ueZ|A+AkN^SP!qJ5L~P%SQ!9+rb->{x*L~?du6j;EaIacc!+X$k1d3*$6u?aw#l^3y1tjr{*iyl3Y#M%x z>Wa+Wl=F zs{!)8_H9vyZzzxz5r0tuPwUYf4O(^U)Y^~Qd>jiyd=gm~I2bh4 z8QafsJ>6#5Lqd8u9bxO1>$#N`@RhadNRF&7l#?&QA-K1M%GBPKw|474lAo4CI!+sr z@>0#~+8i70?S>p#UY#(N3V0Ua5;#R-@Y#bs>5t85xO{buClx-@#%E4}wnzaaw@;#T zGlVk{qOqO@XXF2>N6`$hOYZuw+PbU8>=oIctQCiPk{!-~r{p7X-IH3Mx-vdvWr*r_ zhtol}JQx4WP*az&yCjHkUC9G?L_L>cT%|vNVKyX|STsgSoQK7;&2v2s!()=kZOw?Z zZ{SG7=exz^+DgCqTClySz93?7zF2MJcW*re{GM=L6+V4)2gZC*)P)5^R(jO$8ijg$|5@u z<(3(iedNLBy8<=(jLM=ou-O&E=38Sn`lKbGI^f$YWAb(%k)WLwI4C-2d-MSLZR)jO zqOa$g_kNW!@skWAmAEE=7bnJ}&|r`a9B`{?2Ve*CmJir^#rr)js)t zbl*kBcb+oKH&b3tP}8H?-9opWs$fpp>gvOANuUN7)Wgmg2i}lo@ql0olp?lltflGi z1RUP7zyY1iQ-4ge=OUHkh16FB#!4JJ`kxQTQ9M^w&POkqSe<>%&Hlr^<_e*!a&L+G|Tw&(~$qaxDC^cIf z^66~y-jlb?y_^5#)6VW`FKJ`mRksqf+V1&!&OqE-+p^H78Mpyyo}wd%+`q5*ro0+# zUN4V&?5>7eMil@-p{r&4*KUyZSU^Y>C_Z`km`-V`qFlH@yuVi`DlUVdlo+f{l7QS2 zTacb%MGA~{9ky4EsW=n=<>%(@&5i8YHu`X_^S#%kH(JiQQdw>4XGjDF(eQxcR$C3v z)%v)u65~gpX-9Tg2(b%oa?v=pe2j(tFNH-cwbF>y;Agn>f3Jy;6}L-ls&zK-7loGLOsAR27cV`&!u7q-lf96BU}h& z9flauwmp$r3d`ry0dc2njoD9W=Lg$JT}7#fYF%MAX~80;btV4rx$?S5*!UZN;@RDk zFZdyFAGAugCf!_>RaZm1maRPzUrg#TbFms*;b)FQjpQp2wDGw4d4rjz?8>(W1|=x* zm!pylHb_uqKP6^-^j6}?Z+}cU5|5>7 zK3DKL(8U^}&?f50Mc)Kvj_63&ScB4kr~iBy_S#mfNs%hjwKB41FfkkGPZrFS&5axf zYN*jKY+BJKBEoEUYgY^rcFNtUZUs%HRNBT63nvXiY{(f74$RyC8ROZa*FgxY36U-w z$J@39Lr;GAw)^^h2ym2zGrGaeqWn4wAT#V}p>Q`C2Xueto44rldUS7vYkPIBAPe@` z$g9iCGZpJdSSnXvK0oWXp|vnOxLIWC&`hpbx^uEm!#i{{Oq(=xyj`kHPL~)joZkyu zu8hZwe^k6Sf&jKy!?SyU}NYo3KA!?Q|7gjqF3rT77Vdg&HJ z8l3*r%#-@rx8XHN`o}aQrm406x|y+w=SJ=)f1YT!6v-D=3gN(lE^?6FlB1xYgI25A zy}VgaVLwF6HnL05(_~4#ir*?aCd?JY{YIQnA8R^zhU`j=5vDy%#HM3q!*#8o1I_u?e`U7NQ&^cVe!1k`*?Y-;ib~{D0-Gkvbs@S z!RaVTIIJIq#)`YA6ds*(Sghu#Yxz_!EiL16Cl1R-KVtoP;O<^!S%srqw>{c4Dh+*o zY1OmI-Mr7CmJ8K&1q3!pT(32{?1TEI$C5YBv*vhCI>|yX9R9jB z+K9hTp1G%KvfV%>SD&uvw8YoFQ~FMDn?0zU{Kn#wUUF1Il_(HzBYCjc=cScS8OLp&P+_ne9D(y z(7jqwMZPp1v|u4SkW(LENQbv%%KZK=FyR)5qTNCn-S7&2_0B3-uMv;sn$bX|%5 zk@gYawZu0}dS7Ub8dIaa%LHXDAGbML%tb_^97JV5oVxx1KYGTsF6juto=D8f{n97f zS!Wq7^Dv`GZPY^4x?EK8c`*lb+qH7WWzI4%ciYg1-@JDpP!3!%+>76+gXp=T>5Zg} z;35M3OIRud#DjvI0K-M)JzQc~rQM=Fy98)tbIqvg^mW~Y^rcyrp)J!BZml93>gqt7J)QQ|lL+;zoqaGXaRk=xO zQYzWl-|+a0lvxvTTc5)>WZ$gnnsDV-K4zi%;p8*l2w5fb(MyqXxofRq%OiGwikHc_ zDThsM0lBge198Dt9r|reE)o%(A4b=4OsNUjq^*z{>-mX!8D(FfRn~F+wl9ohZ47BS z4@=?`-VwyV73?mg2#!vPmg*Oh0`JbC>bJv=< z7!vpClsrr8%ppB$?3d*9#Khu&{}0LFyuyi8vdrpkqczxYdpzYDJh`|_x)SKAdxSg> z`viyC(%R~oTynTUMLKS{DX{osmo%_g!|Md+lu-+b+vWV&RC>{JOi#|R{l)=FZfJyE z+~1voksMaVWQ(;Oe@AT?61mognq_vJPKdOZo&CwIPUn>hzuw};E_iXfY1THs*e`*C z!YJQ=5n<_``b1fj<$Q-`mmi{~u%X?vJlw3)E9+s!kkl?nCc%agd#lEjMTo$J)!cq>S-B61g>vUYES?2-=cKKx(is8b|(do zi+($;oc!#># zdFLI-O`Gr?F>o%>Q|BHA>J@VNag~d3-nbxgbH)%_WT5NzNs^BCx_uhrG|5tdYCm?0VF^Es*}wsBPF^ufFLTBj;My*(ixzJ})dF*3hSZU?+%Mf#QXHoWPs5_slr))M?ciC^=b2Mf3 zCWa~^;{iX(8w;yyy0Y~r8KvWeJXSL1grSj3T^5bz(I$v!s;;x}US(_%*Rh!Ma36xE z3b&-+XJu_}&?FPSS_}*7YUj$#o_c}?356qWR(gKpNH{y5hz>d|C%=nsR(D$gZ|_&i zTljm9d1POvc(e;;8Jtec0Mqs~Kn1WhuHlMkR98RaXI9CNa;kC2zW(YTYqz()ZX8AD zA4oRe@bi%25dvr);;QEU7+C!!NFrV;j=`uaXF|i@aAa@<><}kp9^gTvij*xa+|TeV zI^c^27MMadH#B+~SP2?he0L`|E7^4)5Z@X)J~q}iCxCxnD=#~=)d25?uJ7;Rj~buP zD;rKwkn2yUhdop@JGr(rcSGYk)9ZDWExpxmN#?uao4sNWm1)(;g(&%gAC0rI6e*~c zrYJwVUURYjZVa$+vrb_wS=2H)$TjA?A^4Y`CcP_T;#m*3cc&rME`}t%{oov(l-8ZJu!_ zQsDTJIYxD+z!gTxo`9#{Y4&QY|3XSO8%fbv4+ITPN)~Z z>w7wwViC)`DaniF?zG9Ksd}D0f!mmUGQ5J8bN!3OYJtuJ8Y(Rca>z&jnEf3*a#;V&-#XSGJ9Lxx*tD zb^H@#QN8wU`&@E8tJe1Ik~?k}f1$BhyGgboYc_%sCD_K|O_QLWUquu10Y^TTNQoD( zgbgghttJ_e*4OA2F;Vs^dp$17uI|)xcVyNA>KZy$>PhwndJZi;2|EprO}Fd43N%>W zxqOKo35UmdKJQMtZ~A2G5t6YQvcR|za;)GTFetdNu+}Bh0w-xNV=7%bHB(XMQ^4QC zoo1VFDenw%XRgKDa~R51?nsP+U4M8=H@&#K6 z)&bs+fs6dw5q4C`|5v8B#pxCyMYyBd*#Nx!Y*KH9b-N*DjW7C?mYJEKLk7Aa|7Cq<-5CiZm2}p7B)?3VGY{(t&+W8&{ z*y(&R=d{ULv;myb)XfP22R;()~0r<%?hnm)^x2 z9?Pf~?oM(0e&9_Ojh^c68N_D<2b7F{<_vaec z9J#($dhDmZcQLFK=?0`eq*u>9C%b09f+Zs02VQ-W|M4d^7*2qW*N{NmcD`S|bb2kL zPpu^rM$3g?^wo%k3u|?fxnsC1u6I%TyrJZMDdfjZc=EJmqXj4KTJvvD?2$u*`N8N*j1bBnLW_QeqFf8?HKy6c*opMFD2Q~RDY zT^=i!>CZ`n0>J@X?ibD|5qS{dOWz^47Y7qEIKP;uCqu zJ>QulyZ4j~7l*Uhtam|GDtzv=C+Q_`xe?iIblZiu_`9R#3{--fO>Pk)@+Z7qfQzL_ zPl-{Z+`87`A~>4!PDn!xc@c4_VK^+B&62s%cob6p<9_4XT>l+D6Ea|Tw$$$z9S08? zc8%zRE&9^}kM+?5+rTWTJojWR*>bVp6A#@{*F^?uk68l`k*8&}I{RSAau`4S6oXTM z)5nN7N#PL529cb(>*<=bWHdxZf5Vnm0vj^oi>J%Mes@LW1TVcgvpS(g6Am>f|0f&C z#^{padO9OpjTao0Yld!H%(}e9MmheR7`T(`AG6rOGWn_T+{S_T9d-p#nw4n#N^zyB zdS^Tgm@0ffBB)yDt%nx7%7K7m0l$m3=8p9ytTlhD#nE;9#qRgfxb3HO85mvFA5_K1=L-CfgrhWU?wUY#4 z@$!Qk2I{w9&cX`-2SBp$y`wO2Nkp)x4!Ci2cGJEEXlwh+rhfK(`BX-EJG4b|J(an< z0!j-E8PxbvhSe=!4}4ZcJiSt zcq^x{C{`dET!2CSm>yI#lxdT;3z5}d#VZi74fICZidQDgck9M2{Y-jwypRDKes@1u zn_)Qb>r&kL^jLZw#Tg|C6M&Q74Ur4F6(5R}g-!8RQSd^mad0Jzp zh-;`Te66Vd%qeoO6HbR&rm^K`iz?keaYB7)@oI?3_SPcvf9xtE(zx|G>{%Daf4pGP8vI|l;B)5M@o2~ubXZX zRNN;(-fhk&-~U{c=l~${I|rtSiv^~04&abI0vG~+^BE2S@P!KDPWT{|7knb>r&PCA zQVP@@_~l$DS4xL*FK~&q>@kMW=k34L_%kQZW5G>lN!9jB1#X-uzIjV8g=F=NGYWHqCz)UbipfKwskta z9O5dT42o&3q(`ocy$WCV5_7>^*;22q%~(?{3mdzYVJ77CKE<2!4Ex8wD(*AzF^(%i z&gsg+gH0scpTC#!jKfoyOivndx=)pg04};8fc?x%pL)R9H~B}-|8H````uCqw=cvC z1b?T4nG*CFGqJ`wY`yN|TjgVzy1?>GH% z&^P_V*-_%HkK-%goeFOGl4^F#GDb{?Fj7`@5q2`tk5a{s;40qs>m*s}X@w}V%+T^*#!Ji`2d{*lBVkx(pT zsj3afD5UX$YZ0Q~Lncd1m#m-Jd0(MMYGdEof6d5g!|nx3#6AfEW$(z6L~*XpPB6%- zRFTb%ugBkXx(cm%?W|6*JHFbO74q{tz7oaKGf#)L_XH@pC+o~I@Xh|F5kyOFSQ5QI zP8i;f84sc7lwVfv|2;JpL-yZqOO5pRWTE!`3cHW}`Q|t1O6)Z%J_7wXbVOMRIcL_G zz@XMU7jJTA0=c|3aEFWd1;~HD6MX@|TLPviz7sC_>H(wQBp)&V&!k|6aRyKiA3=x( zq+kQk(#)QLy(4@eT>=o6eZAnR6{8Nw+Ubn%N5FB9>KtU72u=JQRBL=xaL$&P6ASN& znwsXeV0c7}6SdhZ`{MChkcsP{&ybng)}366AD1pRiz8HE(<>R)a3LBvmmST?bJg4kvHm7t0l6$1Gs4Ksk*X9H(O;$MjNem2Kf_u!uQz1%dZ zF2pbNAdU+Z&SaF{!zQs1GyfukXzHS3CkFrgWMrn&HO6iYgscAwqB>@!_N<+Axp8`M zpF>{3$Hvginuas&6TAQ@1HhgE3IPeKC(}km4{sCApy!{k6<`WP24G{lM_#}Vh6aMVcldgo<3HwnJ zPhzG#=mT=z5)T2VhkyqQXLuSCM05c1P1$}7!u0216FJ`Vrc*B;g{O1WKeT@uci01c zf_V5Oo%L25di zy*h(UAj&gslw+#`yvrjxuiltdUm2LGk6>j;{$j$o%O-a4<4CuZ05xCDe z{68w?YyY~jqrB1D$?Uzb{|6nd&1hgIkaHp8qdl@0ifz+NCq<`hpV|%CR za*ldUq`7uS$jogr5P<0)fV0kXHQd^TUE)542JZ#S+;X@%YyGdjzB8`rW!+kO7gVa0 zAV?Ds1f)YyniQo=6GIb_-aCd4qKJSLsR~GwD$;uwY0^Q#P^21qOG3!p?0xpW=j{95 z`~K$3d`)Kl>silQYi4Rl&n|F(_PigTE?u`89D9LjM43a2S8~3quCwj+fkf6`!-fN# zvJExVw@?t{8~5Ywk2m)W{8p?AAEfTzpfIVm^R_i6pQbE)way54Hz5v^$Q~XQVH_MB zV1ga|cy1NfOc8uLYo@66>TiOBj98IfflM@Zm3q0u22{S4xTQUFdF zK}M(;`I?q@K-1e`^xdksYZR?4agO5v3VY+w*9U|e=kUn|d=VV&o}h|DvUcGh4{;Od z|5y?H-pe|NyC1>wvALaYji~lRuPvaUi56*2#8!91?s$EjX!l^RwuyH7p^4iOz^Z3( zGF|HO5tCKIP8Ma}EZY33ERm9f{@7Z=NRAgvSg=V6?l1CY7wZqw@1Cz{^fWxplh=T1 zWUse?;cH6@j%RRAH2lsv>|gu-k3R_-LRtl)F63;&a4>C=G*z_DI^cc@41~OjN#EJs zp;?>>DLN__rtMJ)oTp1Jx7R*$h6T0Fnl0npYDV)gcjzSiM{m{Bl2&K4Vvz9}p{-FA zv!iY~HYuF_G}B%7#sJOOR!Vi<(2q4OX`eTbES6DSiJa%u?`@M>*kB|zs@!GZcC7yW z=NkcYtqf%h1jiRe=ff!1WpEF3??o$X>JNxb_$FthnclA#@XwHc{m^tw?oJJ#^9OEf zi{Fgh=Y1;b$nkGb_CYb0N@`_)0y=GJUXB+G{G|G{;L)*7ABFm-jTm3cG5*7B?TVn)`uwa?& zVTg~36_tQ#<4g(J=IWE{!#Hky!6*X;SlWLe z$N?H0ZlaTxfm$(87wT?PO_iCw{H5B`@Zz^tzsLcJ4fBiMND}A1K1714=i4%)seC=h z@|E$q+5_eZ)~8k!3pCff*cR3=omySBL9_TsiQQ;!q*ujV0Hg0vaE*P~-wc>&6QuGv z4_-?C@$J*u5Xct3X%~e>^d{}WgHe^H(IG@aUi>I~6m24qT}@o8cP-XubKxLo5oP1` zX|x)67bW^)P1?qI>(ra`maMCHuV|=LuH5A{;}QNV9YXHMPpW3+T#0K5RT0#XXOZLA zwbYf|I^%DrdXLc6aLt;4K$ldlg!!o$#xhy$z3VTwO^^kqmTY20W&pwnL!!Vgb~ z-Xjqt`u54To}N7Ava-P5^^k7%4U4?Y#(C3^-;Bk$*gNyET-8br(H_S=P%ro+-HTDM z%U{3Fdnx-B7)_aC60gm_pkNP_B)(75@M0czCuMmkTx(=1WQKa58K+k?ri5t3rL3n= z#*QB=+9cd@%zLEU@*GI?KAf!}V{u1G$w#f0?I8xnArO8a*T^Nz8Z4hAdW5XM)vpax zS{i7`4Xc99zh;>qi^@!TIe@=}O^#QU?pWu$Xxnn?p<#PAtDoRFx6sP~^e~0XS$#t0 zHtCIWA0f4Po0uEv6;cm*E4MpNfD#7M3s1(WV<4OG0+9Hx$q~yCD4H#oNVt~UGpo)dZ?RzFSyQ?LRFs#Cc9pA*-X!DQ#`HqoOabO`p7sT zqLcb0#rmxG*2F}Qx-?5%>M<)zbYA!Osj0JX#KIv*w>O#08rG+F86pW84vQPted2B) zkR3#6X4<@lE|$v_<8$OF_gic<)8)Djz?V4l_hKV~d!hywgQ5~9E=rhUDcmFeeaGROtVV~}mZ zc-U?i308W6)TKdh5^#&Q)UbL(WT3&N`Sb!;Iyvb8pGgx5)gms$g!etL#Hn*$gZyhO*VXs!_}zCuGzb}hpZL-o)&*AtM5#2eWX#j zs~~Vdc_VZ+eR^6<*)?C%U65{k|EdtACWi7IhuzC~F3Rgo40XTD@^m-7tG?jGD(*C8 zzp1%hi_GbLZ=ISfLfD*e?x&5-)jK!tg8w-{*fBiBIY@~tmKU4L^cy;|hgT6+df*|% z3k*o7i_WjGv0T)S-HLg4SaElhOzz&$4#RWzLvz-J$gW#_vw9V(mNCy3_tktH@^ld~ z+>wu7Y6A!g9)#mqP z6>$Yq=8IwzP2InVjG7v091_qf&=MPHxa}EkWdBsA&Fv+NTS_4kg=2drufUQDO=UV^^>nGp3IfaGu&^YL!vhb*=+sBvEB0hISALg!#!GM)-V?zN7f&YqINK!Yqj>ym=MO2EZ)a}t-goWgh z?bU2ncUNTme}8^htSQ^W2i=`cjohD=9H$OJI+2x9u<BS7NPFWpLu61aVIJGeh zc^uQ=1*iH?qKz9!_;q6G+m0FT_)|akl_ZXPO69k{ey8LsTr*HrMQwK4vbH`9lZ!Y1 z(d-)Lx4G(G5_JwG#)%Zs11*%!p93y|6`27HU4 z&qHHL4mp-K&XO=LCNQDo*6p8iU1?5(Hf)}dS$rYSFWfhAA5!TY>+)bz_^H0A^h!gT zQpZyT#i8(ZOjt3+`NZxV&WSC;i2Qfu>IL8DH#tx8Rk8iZ;M7wfl==oJ+{M!pOuDq-ns#JK0rVrUT6<^%|CfSDBu2gVcto!tUy&8 zYu^9LgbR66R+~*1Zn&gjq zoWm7qdwS|5AG%jD&bs5oVK*t!u(Wl0ASZjiOFF{zm~fD-n1r__rpZ#wEsw602*Ni% zf1_Y(qnGeB!oA?8l{K^L2C?(@_dckO9`S&$kr^Um6|=kkz?1NzLc zKdMUjl*jJ6y56<)_A)bq<_B-|bonl-nS5>4=2)~b%(e`A+$y2u$e=<{;L7y+^6tcS zb8icre_#0?PwHOUxS0&s2>*a^Gwajj!0(@n2ZZD?Vdv0oL*!?%;2H`2)zgG3ix~1c z%DcYiO6~G46iKPCdMCQCE2LbO%BA=~F{Mms$W!#Qp)Q2#Hk)Vmvf}u{-to##E#y*s z;P*t1+Z|WW;3nq@2XKvlFZ^FS;MF#W2zR}*6L5vc^sE$k-Xej)+Q16WCY*Z`0Ti?4Ef_bC3 zutqK8c=|2>y$2L#;z>R0SE`^Dcl6<%SsWNf!(%4FIto4xGyvau?$JLdMWbWq;Cv09 zD>6E&bpjPM5u_L*OZKIZ$?#OyZ)+I0258jJ?bfX32%U^fy)_vPlf0V0`=v4G5 zP2m!ENS6BVMy(XPw{me6MX8WsBc79~2=!!dwYn7Y<$nJpGZme#79)dogAXaw{?YF) zGh4~Kutr|yk1GFF;7#*_tW>5aXi$FcLbgO@NR2Y#2}`AchBmb`#$?L#W%!nb0Mw48 zRT77|b_6Z`gI4_ySoX68xu3hI^f1sNkvKH$#VW}rJYNpLonk%`9p71$%|?@e$i7!u z8Zkkh+j%F({Ck80u+qZ_9zBB}@5h;CUvEdI;vH zj7I#tDxMKYNR^Zu@-;wDX`bUH-7qy|f63tkuy;V~93$@iDOLQdngaqPh|en4BoE02 zLpRrX)}fQYKKKCi*CQG5->R9?P*5>dN6VJZK!b=0zfWYl2(_OemOVCb0eQ#zw;JPo zbF$n;eaV?Fz5bX?pYI)NrA5qXn(q0rVYRN_D^xtr4H5J&pOaiQh$_~dS?!IQbsvll zlx=%mx>T40O}r}ee7PW|W5tA2a`zi6HCH!zh{O8RUH6Db2#i5`Rn0T|17)={)b-Ox z?1I!|E^T?jPlYPpbNE-$bh_KauZ+R!6ZH7LQc5>yQpX-O>O8SIQiizM@c+b4oEdCt+@ODkY*bhPqBVH1 z2NLG~?)tt#nb*~^yV>D}j&ZLT%AfXBuPKFNmxlQQqTe9xAnFVd)P2oF}O(Z$>I0Iz0V5DdgB>uPj=uG|(K{9_daRkhN zlahT3zP|xd**7WoVKpS#Abu35oGLSU(5;cjri4|V3#xOvUfZNhYk5CvJblP}H~ZJF zci^H8%P>JAn@=IztE(RvPA7)7=9K7FBWgsy+j50^_i?_TD0A|j9?&V=2)Z<&@j4kRvJWl_g0x?N=RZki2kx}tS`}7Y ziu&3rL57mS`TEm+?CC)ges}VLuqU$&p9b+8^wrrUi|9yYo28;s0sZU!D5Gb1&U2k@ zad}R31oC~pUxK1;?Xp+TICN2XOM(z}{`GM3@THb`M@_thhT)~@lv;*YdF1-a=j@mA zw7HhuXc*w`#&P<$#JBt3-i}Z=XSvM7)r8Q_pmwX1EeRtdb1`Ai(>Wyl)WtVS+|7nY z4$4On|~di4qbo* zOMAH(DBWL{5p4-OLb(6%jF2Q%+I)98?UYst>atRV z)3+;_pOs)U>dIx~%@*za^Fv|6g#^{GCc#IWU%GH_v;=jcJfuyw9u-<}27LaIqBwS~ z#8+RjPv6*DrHw=Wc}e#B*zW3Cc*FpplKtm0f5rKsmUa+oU^ie4;DZ6z(a;BIph>(^_Et42z@+rsOJZ-yfDY5D zwXn!0vRJ*GAX;}046^rQy^ub>IUIMd??T+(d^ctgfApHdkN11om9)q)v7of5v7DR( zJ^hGtC^Ie>FHip6RlUPNiJ#9?v>RjFrA3yZQ*bt6oKxy1DLA%`1!F_sHwRo*-9?BS z0*RJ_+IUE)h!OYjH~UxNB++QiDI+Ihn~;2uFppIElu0zdMf9ay05 z2xy}L9_jwgJE8dg$fgHAG&;J@vk$>Hh~03@x5`$KHQk>as5IMoCe-)LY4%qXDyd5W9CI%SsqBDYsyw)1B^ZXuYU==4OIl zNi_5ydh-4@e2?LN!_xb($4pFz#);_#CYkj4Cy=F5U1LEm{LV|)$ zwKiW8XMeOTlx^(hc}SChcd3jJv7-&uhIwp^?)?NGrl-z3^bQ?SiXX1}U%mcn{R70q z_STQh;34Ycs{2kVFU3!;sJvAA6(qq|!^T4HnkQ;Xb@F4K^MfMbJ8d~lMgKfTM6h9I z);BfaS`}?DD)rtiuX*~!)}X~t=A91}{X!Yr3o-pT{3ABX73~?85VM8bSVZs)qh}Yp zS5n4~xGgmzQu_i!f;F02O>JcP^E>2lf~0nxQ^~q8gw3F9S>bw5>ih?zI-lsL-X#6$ zPd^$Jeq0{;;LF#hgzc2d5uU|EuDboI*M~IrQ70L5s`UDA1G24a72-`^v}w*x!&}!EHg}x%vs@|Ct~XN5SRc&G#Oh_xB-#;pb8oLi{**%LyVg z{Yld&++|+vAJ5)7^R-)kaPSqJ4t84lF-(Nj)O1=c=DN=oE*w0?FHNFCQ}_5ldgX;! zq5$ECLoTJVJCdjYwN54n9V^am6d>(_mjcbdT5xC;4(?Cs-i;m&Rut~R(`*4;&}S6l z(#Cq?V`__?2iMdluwPZ|X0^_%}Og=9@P>7GLJEtf&V^6MY`zW6EIW zL=q$9Yo{e$@YrzNYXE)T>TpX~C!|0U=V%08pTXk`gH^eqPnxQT4A^2%I3KW0$qm;^TFF~xEinu+jn`I-xkqfr{O&dF ze?s^(wxho1q0)Kr)g=C!p7jyRCouzl2h^0LX9OoL#BFO&dsnK6uQxciEZLp^c8kHUle&Fbl z7}5K^u`XF#=M$D2PqO&&wk++x4a=fY-IMkz;q_Bp>AngnG}QdT3pAugW);L6;`oFn zo?~?iC)PVLKlv40qn2DFZTE{q-(KUDlCBWnM_v3*kX;Svk;W{Vw7Sd%Ii*>zh1`Ul zMOr_(xwW06*D$N#9Q$lIVjv?Z$Ng7NQ>IDsZA6^LhX1@6U&h_k8lR;Uv`{PcRP1!q z#HwoEt)ZAK@0b#n48!DKbL!L28Bcg?z4-H#jC8kVH)UH4@;-|g`#Bou+_@(?3-4Zn zu7bbgFSNw~e_cpqo3tqD=T0C6h5cHAimWpk0(ce*WLv+zSq1Zg$zC*srwAM|!v)yx zxkygx4qPf$B5q)_ynP(#umfiOJZJ4pbQ_WH#b4(}Bw$QFncQvJUnqY< z*Bw2nrxuKCZ|L%iCg*;U!cvH9 zTo!1##=j@eoSDcvf2xb#;dn5xeDS9sB)3h?Ncd*u=*-$j&lU}+Z1ch`!O#;Kh|0p? z71-WI($dAdt{(?q^FG8eXcLTj`gZmPccSN8P}Z`!&l)9$v}{g#J=+>AhSJphVn1It zs~oO4ZBS_wqh2Bj;+(h_JGkHYN*Mv^U3-YKmGfQ&th#^?K>jyFs{lX{fY$1xLM|AM z!vHqVa18({!qEy%Bp%QjJROEA$es9jq%*|E9~X(vl|T8xnQL6(^wnFS?X31m+1piS zUkAzod4$;F5JPxJ{OwcYyONpY?%j!fq&+c18E@1lixz$NvwpjGvj_V-E9M(_XVEQU zOvrGJstObJyM|5OG#MAM`Hw<%&dXrQFGesr-+|O?Y!T`|41As3_el5;u}JP-VoU?o z%KP;BP*j8;(O1 z0XN@giozJMRsa&N0y*Myu>u6y&mUHpdx?)Ozp;OxHLszt0s8v^p7Q-&)5#`*6thl% z1Jy<}Zj|Z8G8%Ympr8-1#@8AwI@+zYf6RG=ZEeem5qw_Zlli18bo9~BfM_kYke{AEM)Zb|6D$D41wW@%TNrytU$))f91X<$pPabuW zz{He8`+lFglv3+}`|buO1c5_k0^%x@-FD>1CFb05kDssl6Q|im;@nz zb@tvpp8HbFWF^MLmxr3A==7!D@#jqJfs4Gro*pRwJE*ZK{`!2kw=zb4k*=W{XM7C= z$!0!I!a_b^;mK9nOrcrJN^j10gI$9|3v+i3htDRrw|Igb7o|yp!&;{FZ`|I9%-ZJp zxb@R2vq@vM5m6P%wnJCtOY~Lc*;aVYMf^QpK6{ayV{iSk%bN_%qMFZQpC|ZpBy*NmD3)M>F)WNmRMMX!f-u(Y?&p-p`^CD zql3?e#+UCT7z&_n=FE9^yLU%Qc_w5~x9G2IH9x%JIyjom<*I!+9>(5(^ehvGP5#=y z`Ha=ktgCNWUHvmd1m{rg;XC27z7I(hXQ4Mf-8{u7MC<|Hs`~$I)BGF|fL+{aA3jDb z)t8;uw`A!9gh$_>#tqj2S%8i)-sV#G$t`d?yzoh5dYUpR7=>>*k5WRu7Kq-32nves z$B2p^#!%Qhp(|=G#YWbiK<4ct)i{&X#ZG??JZuAzPVS2j^%)1=aFG&(pg=1yI6msdVMpm8Bpubv;g3|Yq@Omd93ZRJSsJP`;aFu3CTE2Qqt;qrn|0wmc_XQ(b6WRNO_~P-S~r!%nZi(6%(%C38mVi}vhd z!OdKc4X=(*WW`=0Mg6Cqk|qiCV|uguQX6~8Re}1Dh`_hfq1E4X$cU+xTFF>tZsT&T zj^SH)0r#JAw7C2eT@5klPlvLVeH0!aOzqs%hK8i=a zyXJIHcEgQAzp^mXx(E@p(whu4Aj5VoEh(?wZcMyuWLEyP&9@>vl+{Vv!i_SdcKQC& z{_O>8x8CqTLd4|5gp;hsC}2;Hg%+W7{&qJym*KXew;JT-u{9LHo@wGPc6~Ygj}#r3 z3Y^cjBgZSif1}VYlizc~^P!{)_t((Q86-Y{P}9|;G*x0sIz*c-YnwtK#Y}!{ryTPi}X)Du!tQU}M;!W2-#t~l7 z@_Tehj%w#$gA1n`f=v_(e7!B#3AfC=jE$*;M1!iT>Sd_B&lTK^TJ(`HiR^LWYavwn z(H~OOLHoZp=caf8Za3xu*=v%4@2Xi}$v@ zhwSS)YCRp_JJ-UDel2p~PsO zYP%-mYxIF?;RmAbc-GMtx)I~B-?1}9F|qniZVBV&dr3y~RIsMSK9Hcbg{j1lyw)gz zCz*iuu4%&M7+u%m>#_P74;Q`CG-&Zp+x5Wpak&J?K z+ASXIW7jEugH<#PN-)UgaGCSRdxg*%frY-qE&WRO#RfwhE5FwDy1So51HN9Vgydf? z!`xtx$V5$XM1Cc^?El5|{qT9dPgeMDMI37~*E79|3E)4uS;x75Bkt)sqs)B89hvf_ zQzWM>EFcG2Z6~7*cV_=M4x~O~@oelLLIvGP`ySt8>Y;-RM(^(6Mybwo*Cys<@H(+B zjw-iR!(`3Uh;uNkbnV4xJZ+K(X}e;o(6QV!YJvRuYa2698x4Fuv`Cs9T08GiN=H(f z7U7T{GR>^Bw3cc`B7~!PH%A@ zDK*AC|4u5y)!=td>+Iy=-;rVSJXc{oAh`LG`gMR^W6;{@6Cz`)¥So)gpF@KQ}k zYq1=1_N8@sE_Rr9d^Is_cPHtc(JcPumKEo3lC6FIk4*-SsnUsX$8l~dG25DZB_B_U zy%iR=QfYpK6a1Jvwf7!=g+Y40xdt;$&M%;PnY`!A_+?a4f30t2I(Zc-{R?AQ(5-xG z&)ogn>dZ{gJFu$vKwc?zmhTr}pT)@)VG{l?u>lgYp$x%%D@q;(WM^F>q!%JNF8miM C_;Zs0 literal 0 HcmV?d00001 diff --git a/lib/cjs/index.d.ts b/lib/cjs/index.d.ts index 79ff118..5179299 100644 --- a/lib/cjs/index.d.ts +++ b/lib/cjs/index.d.ts @@ -184,6 +184,64 @@ export interface Account { * @example "United States" */ country_of_residence: string | null; + /** + * whether the user has enabled Eco dynos + */ + eco_dynos_enabled: boolean; + /** + * When the user's Eco dynos will be shutdown after disablement + * + * @example "2012-01-01T12:00:00Z" + */ + readonly eco_dynos_shutdown_at: string | null; + /** + * when pipeline cost consent was made + * + * @example "2012-01-01T12:00:00Z" + */ + readonly pipeline_cost_consent_at: string | null; + /** + * whether account has acknowledged the MSA terms of service + */ + readonly acknowledged_msa: boolean; + /** + * when account has acknowledged the MSA terms of service + * + * @example "2012-01-01T12:00:00Z" + */ + readonly acknowledged_msa_at: string | null; + /** + * whether account has acknowledged the Italian customer terms of service + * + * @example "affirmatively_accepted" + */ + readonly italian_customer_terms: string | null; + /** + * whether account has acknowledged the Italian provider terms of service + * + * @example "affirmatively_accepted" + */ + readonly italian_partner_terms: string | null; + /** + * whether account has legacy 2FA or VaaS MFA enabled + */ + readonly mfa_enabled: boolean; + /** + * whether the user is exempt from MFA requirements + */ + mfa_exemption: boolean; + /** + * the reason why a user may be exempt from MFA requirements + * + * @example "federated" + */ + mfa_exemption_reason: string | null; + /** + * which type of mfa the user should see + * + * @example "vaas" + */ + readonly mfa_experience: 'vaas' | 'legacy'; /** * team selected by default */ @@ -196,7 +254,7 @@ export interface Account { /** * * [Heroku Platform API - identity-provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) - * Identity Providers represent the SAML configuration of teams or an Enterprise account + * Identity Providers represent the SSO configuration of an Enterprise Account or Team. */ export interface IdentityProvider { /** @@ -204,7 +262,17 @@ export interface IdentityProvider { * * @example "-----BEGIN CERTIFICATE----- ..." */ - certificate: string; + certificate: string | null; + /** + * Array of sso certificates belonging to this identity provider + */ + certificates: Array<{ + readonly created_at?: string; + readonly id?: string; + readonly expires_at?: string; + body?: string; + name?: string | null; + }>; /** * when provider record was created * @@ -223,6 +291,16 @@ export interface IdentityProvider { * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly id: string; + /** + * user-friendly unique identifier for this identity provider + * + * @example "acme-sso" + */ + name: string; + /** + * entity that owns this identity provider + */ + owner: Owner; /** * single log out URL for this identity provider * @@ -235,10 +313,6 @@ export interface IdentityProvider { * @example "https://example.com/idp/login" */ sso_target_url: string; - /** - * team associated with this identity provider - */ - organization: null | Organization; /** * when the identity provider record was updated * @@ -246,9 +320,27 @@ export interface IdentityProvider { */ readonly updated_at: string; /** - * entity that owns this identity provider + * when the identity provider is allowed to be used */ - owner: Owner; + readonly enabled: boolean; + /** + * heroku start url + * + * @example "https://sso.heroku.com/saml/acme-sso/init" + */ + readonly heroku_start_url: string; + /** + * heroku entity id + * + * @example "https://sso.heroku.com/saml/acme-sso" + */ + readonly heroku_entity_id: string; + /** + * heroku acs url + * + * @example "https://sso.heroku.com/saml/acme-sso/finalize" + */ + readonly heroku_acs_url: string; } /** * @@ -291,6 +383,18 @@ export interface Team { * @example 25 */ readonly membership_limit: number | null; + /** + * Time when team was consented into new pipeline costs + * + * @example "01-01-2023" + */ + pipeline_cost_consent_at: string | null; + /** + * Email of team user that consented to new pipeline costs + * + * @example "heroku@salesforce.com" + */ + pipeline_cost_consent_user_email: string | null; /** * unique name of team * @@ -407,6 +511,16 @@ export interface AccountUpdatePayload { * @example "Tina Edmonds" */ name?: string | null; + /** + * whether the user has enabled Eco dynos + */ + eco_dynos_enabled?: boolean; + /** + * whether pipeline cost consent was made + * + * @example "true" + */ + readonly pipeline_cost_consent?: boolean; } export interface AccountUpdateByUserPayload { /** @@ -425,6 +539,16 @@ export interface AccountUpdateByUserPayload { * @example "Tina Edmonds" */ name?: string | null; + /** + * whether the user has enabled Eco dynos + */ + eco_dynos_enabled?: boolean; + /** + * whether pipeline cost consent was made + * + * @example "true" + */ + readonly pipeline_cost_consent?: boolean; } /** * @@ -446,17 +570,7 @@ export interface AddOn { * identity of add-on serviceAdd-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. */ addon_service: { - /** - * unique identifier of this add-on-service - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ readonly id: string; - /** - * unique name of this add-on-service - * - * @example "heroku-postgresql" - */ readonly name: string; } | AddOnService; /** @@ -499,17 +613,7 @@ export interface AddOn { * identity of add-on planPlans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication. */ plan: { - /** - * unique identifier of this plan - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ readonly id: string; - /** - * unique name of this plan - * - * @example "heroku-postgresql:dev" - */ readonly name: string; } | Plan; /** @@ -597,6 +701,13 @@ export interface AddOnService { * @example "2012-01-01T12:00:00Z" */ readonly updated_at: string; + /** + * generations supported by this add-on + */ + supported_generations: Array<{ + readonly name?: string; + readonly id?: string; + }>; } /** * @@ -638,6 +749,16 @@ export interface App { * @example "2012-01-01T12:00:00Z" */ readonly archived_at: null | string; + /** + * name of the image used for the base layers of the OCI image + * + * @example "heroku/heroku:22-cnb" + */ + readonly base_image_name: null | string; + /** + * identity of the stack that will be used for new builds + */ + build_stack: BuildStack; /** * description from buildpack of app * @@ -645,15 +766,27 @@ export interface App { */ readonly buildpack_provided_description: null | string; /** - * identity of the stack that will be used for new builds + * buildpacks of the OCI image */ - build_stack: BuildStack; + buildpacks: null | Buildpack[]; /** * when app was created * * @example "2012-01-01T12:00:00Z" */ readonly created_at: string; + /** + * current build architecture for the app + * + * @example "[arm64]" + */ + current_build_architecture: []; + /** + * the generation of the app + * + * @example "fir" + */ + readonly generation: string; /** * git repo URL of app * @@ -744,6 +877,10 @@ export interface BilledPrice { * price is negotiated in a contract outside of monthly add-on billing */ readonly contract: boolean; + /** + * whether this plan is billed per use + */ + readonly metered: boolean; /** * unit of price for plan * @@ -869,6 +1006,10 @@ export interface Price { * price is negotiated in a contract outside of monthly add-on billing */ readonly contract: boolean; + /** + * whether this plan is billed per use + */ + readonly metered: boolean; /** * unit of price for plan * @@ -876,6 +1017,14 @@ export interface Price { */ readonly unit: string; } +export interface AddOnActionPeerPayload { + /** + * The AWS VPC Peering Connection ID of the peering. + * + * @example "pcx-123456789012" + */ + readonly pcx_id: string; +} /** * * [Heroku Platform API - add-on-attachment](https://devcenter.heroku.com/articles/platform-api-reference#add-on-attachment) @@ -1785,7 +1934,7 @@ export interface AppSetup { /** * * [Heroku Platform API - build](https://devcenter.heroku.com/articles/platform-api-reference#build) - * A build represents the process of transforming a code tarball into a slug + * A build represents the process of transforming a code tarball into build artifacts */ export interface Build { /** @@ -1793,20 +1942,10 @@ export interface Build { */ app?: BuildApp; /** - * buildpacks executed for this build, in order + * buildpacks executed for this build, in order (only applicable to Cedar-generation apps) */ buildpacks?: Array<{ - /** - * the URL of the buildpack for the app - * - * @example "https://github.com/heroku/heroku-buildpack-ruby" - */ url?: string; - /** - * Buildpack Registry name of the buildpack for the app - * - * @example "heroku/ruby" - */ name?: string; }> | null; /** @@ -1821,6 +1960,12 @@ export interface Build { * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly id: string; + /** + * Labs set from project.toml file. Only applies to Fir generation apps. + * + * @example {"build_config_vars":true} + */ + readonly labs?: Record; /** * Build process output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). * @@ -1838,7 +1983,7 @@ export interface Build { */ readonly release?: null | BuildRelease; /** - * slug created by this build + * slug created by this build (only applicable for Cedar-generation apps) */ slug?: Slug | null; /** @@ -2200,13 +2345,37 @@ export interface BuildStack { * * @example "01234567-89ab-cdef-0123-456789abcdef" */ - readonly id: string; + readonly id?: string; /** * unique name of stack * * @example "heroku-18" */ - readonly name: string; + readonly name?: string; +} +/** + * + * set of executables that inspects app source code and creates a plan to build and run your image + */ +export interface Buildpack { + /** + * identifier of the buildpack + * + * @example "heroku/ruby" + */ + id?: string; + /** + * version of the buildpack + * + * @example "2.0.0" + */ + version?: string; + /** + * homepage of the buildpack + * + * @example "https://github.com/heroku/buildpacks-ruby" + */ + homepage?: string; } /** * @@ -2347,6 +2516,12 @@ export interface Space { * @example "10.2.0.0/16" */ data_cidr: string; + /** + * generation for space + * + * @example "fir" + */ + generation: string; } /** * @@ -2578,6 +2753,10 @@ export interface EnterpriseAccount { * whether the enterprise account is a trial or not */ readonly trial: boolean; + /** + * whether the enterprise account is part of the Salesforce Partner Program + */ + readonly partner_benefits: boolean; /** * Identity Provider associated with the Enterprise Account */ @@ -2744,20 +2923,10 @@ export interface User { } export interface BuildCreatePayload { /** - * buildpacks executed for this build, in order + * buildpacks executed for this build, in order (only applicable to Cedar-generation apps) */ buildpacks?: Array<{ - /** - * the URL of the buildpack for the app - * - * @example "https://github.com/heroku/heroku-buildpack-ruby" - */ url?: string; - /** - * Buildpack Registry name of the buildpack for the app - * - * @example "heroku/ruby" - */ name?: string; }> | null; /** @@ -2808,13 +2977,13 @@ export interface BuildpackInstallation { /** * buildpack */ - buildpack: Buildpack; + buildpack: BuildpackInstallationBuildpack; } /** * * buildpack */ -export interface Buildpack { +export interface BuildpackInstallationBuildpack { /** * location of the buildpack for the app. Either a url (unofficial buildpacks) or an internal urn (heroku official buildpacks). * @@ -3186,12 +3355,24 @@ export interface DomainUpdatePayload { * Dyno sizes are the values and details of sizes that can be assigned to dynos. This information can also be found at : [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). */ export interface DynoSize { + /** + * CPU architecture of this dyno + * + * @example "arm64" + */ + readonly architecture: string; /** * minimum vCPUs, non-dedicated may get more depending on load * * @example 1 */ readonly compute: number; + /** + * whether this dyno size's product tier can use auto-scaling + * + * @example true + */ + readonly can_autoscale: boolean; /** * price information for this dyno size */ @@ -3200,10 +3381,6 @@ export interface DynoSize { * whether this dyno will be dedicated to one user */ readonly dedicated: boolean; - /** - * deprecated. See precise_dyno_units instead - */ - readonly dyno_units: number; /** * unit of consumption for Heroku Enterprise customers to 2 decimal places * @@ -3211,7 +3388,7 @@ export interface DynoSize { */ readonly precise_dyno_units: number; /** - * unique identifier of this dyno size + * unique identifier of the dyno size * * @example "01234567-89ab-cdef-0123-456789abcdef" */ @@ -3223,7 +3400,7 @@ export interface DynoSize { */ readonly memory: number; /** - * the name of this dyno-size + * name of the dyno size * * @example "eco" */ @@ -3232,6 +3409,41 @@ export interface DynoSize { * whether this dyno can only be provisioned in a private space */ readonly private_space_only: boolean; + /** + * Generation of the Heroku platform for this dyno size + */ + readonly generation: DynoSizeGeneration; + /** + * infrastructure tier for this dyno + * + * @example "production" + */ + readonly infrastructure_tier: string; + /** + * product tier for this dyno + * + * @example "standard" + */ + readonly product_dyno_tier: string; +} +/** + * + * [Heroku Platform API - generation](https://devcenter.heroku.com/articles/platform-api-reference#generation) + * Generation of the Heroku platform for this dyno size + */ +export interface DynoSizeGeneration { + /** + * unique identifier of the generation of the Heroku platform for this dyno size + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of the generation of the Heroku platform for this dyno size + * + * @example "cedar" + */ + readonly name?: string; } /** * @@ -3304,7 +3516,7 @@ export interface Dyno { } /** * - * [Heroku Platform API - release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * [Heroku Platform API - pipeline-deployment](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-deployment) * A release represents a combination of code, config vars and add-ons for an app on Heroku. */ export interface Release { @@ -3312,6 +3524,10 @@ export interface Release { * add-on plans installed on the app for this release */ addon_plan_names: string[]; + /** + * build artifacts for the release + */ + artifacts: Artifact[]; /** * app involved in the release */ @@ -3341,7 +3557,11 @@ export interface Release { */ readonly updated_at: string; /** - * slug running in this release + * OCI image running in this release + */ + oci_image: ReleaseOciImage | null; + /** + * slug running in this release. Not applicable to apps using Cloud Native Buildpacks. */ slug: Slug | null; /** @@ -3349,7 +3569,7 @@ export interface Release { * * @example "succeeded" */ - readonly status: 'failed' | 'pending' | 'succeeded'; + readonly status: 'expired' | 'failed' | 'pending' | 'succeeded'; /** * user that created the release */ @@ -3361,17 +3581,23 @@ export interface Release { */ readonly version: number; /** - * indicates this release as being the current one for the app + * indicates if this release is the current one for the app * * @example true */ readonly current: boolean; /** - * Release command output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). + * URL that the release command output streams to. The stream is available as either `text/plain` or `text/event-stream`. Prepare clients to handle disconnects and to resume the stream by sending a `Range` header for `text/plain` or a `Last-Event-Id` header for `text/event-stream`. * * @example "https://release-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef" */ readonly output_stream_url: string | null; + /** + * indicates if this release is eligible for rollback + * + * @example true + */ + readonly eligible_for_rollback: boolean; } /** * @@ -3450,51 +3676,13 @@ export interface EnterpriseAccountDailyUsage { * usage by team */ teams: Array<{ - /** - * total add-on credits used - * - * @example 250 - */ readonly addons?: number; - /** - * app usage in the team - */ apps?: AppUsageDaily[]; - /** - * total add-on credits used for first party add-ons - * - * @example 34.89 - */ readonly data?: number; - /** - * dynos used - * - * @example 1.548 - */ readonly dynos?: number; - /** - * team identifier - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ readonly id?: string; - /** - * name of the team - * - * @example "ops" - */ readonly name?: string; - /** - * total add-on credits used for third party add-ons - * - * @example 12.34 - */ readonly partner?: number; - /** - * space credits used - * - * @example 1.548 - */ readonly space?: number; }>; /** @@ -3607,16 +3795,7 @@ export interface EnterpriseAccountMember { * enterprise account permissions */ permissions: Array<{ - /** - * - * @example "View enterprise account members and teams." - */ description?: string; - /** - * permission in the enterprise account - * - * @example "view" - */ readonly name?: 'view' | 'create' | 'manage' | 'billing'; }>; /** @@ -3714,61 +3893,18 @@ export interface EnterpriseAccountMonthlyUsage { * usage by team */ teams: Array<{ - /** - * total add-on credits used - * - * @example 250 - */ readonly addons?: number; - /** - * app usage in the team - */ apps?: AppUsageMonthly[]; - /** - * average connect rows synced - * - * @example 15000 - */ readonly connect?: number; - /** - * total add-on credits used for first party add-ons - * - * @example 34.89 - */ readonly data?: number; - /** - * dynos used - * - * @example 1.548 - */ readonly dynos?: number; - /** - * team identifier - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ readonly id?: string; - /** - * name of the team - * - * @example "ops" - */ readonly name?: string; - /** - * total add-on credits used for third party add-ons - * - * @example 12.34 - */ readonly partner?: number; - /** - * space credits used - * - * @example 1.548 - */ readonly space?: number; }>; /** - * average connect rows synced + * max connect rows synced * * @example 15000 */ @@ -3914,6 +4050,16 @@ export interface TeamApp { * @example "2012-01-01T12:00:00Z" */ readonly archived_at?: null | string; + /** + * name of the image used for the base layers of the OCI image + * + * @example "heroku/heroku:22-cnb" + */ + readonly base_image_name?: null | string; + /** + * identity of the stack that will be used for new builds + */ + build_stack?: BuildStack; /** * description from buildpack of app * @@ -3921,15 +4067,27 @@ export interface TeamApp { */ readonly buildpack_provided_description?: null | string; /** - * identity of the stack that will be used for new builds + * buildpacks of the OCI image */ - build_stack?: BuildStack; + buildpacks?: null | Buildpack[]; + /** + * current build architecture for the app + * + * @example "[arm64]" + */ + current_build_architecture?: []; /** * when app was created * * @example "2012-01-01T12:00:00Z" */ readonly created_at?: string; + /** + * the generation of the app + * + * @example "fir" + */ + readonly generation?: string; /** * git repo URL of app * @@ -4089,6 +4247,10 @@ export interface Formation { * @example "2012-01-01T12:00:00Z" */ readonly created_at: string; + /** + * dyno size + */ + dyno_size: FormationDynoSize; /** * unique identifier of this process type * @@ -4102,7 +4264,7 @@ export interface Formation { */ quantity: number; /** - * dyno size + * deprecated, refer to 'dyno_size' instead * * @example "standard-1X" */ @@ -4139,9 +4301,27 @@ export interface FormationApp { */ readonly id?: string; } +/** + * + * dyno size + */ +export interface FormationDynoSize { + /** + * unique identifier of the dyno size + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of the dyno size + * + * @example "eco" + */ + readonly name?: string; +} export interface FormationBatchUpdatePayload { /** - * Array with formation updates. Each element must have "type", the id or name of the process type to be updated, and can optionally update its "quantity" or "size". + * Array with formation updates. Each element must have "type", the id or name of the process type to be updated, and can optionally update its "quantity" or "dyno_size". */ updates: FormationBatchUpdatePayloadUpdate[]; } @@ -4151,17 +4331,17 @@ export interface FormationBatchUpdatePayload { */ export interface FormationBatchUpdatePayloadUpdate { /** - * number of processes to maintain + * dyno size * - * @example 1 + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} */ - quantity?: number; + dyno_size?: FormationBatchUpdatePayloadUpdateDynoSize; /** - * dyno size + * number of processes to maintain * - * @example "standard-1X" + * @example 1 */ - size?: string; + quantity?: number; /** * type of process to maintain * @@ -4169,53 +4349,164 @@ export interface FormationBatchUpdatePayloadUpdate { */ readonly type: string; } -export interface FormationUpdatePayload { +/** + * + * dyno size + */ +export interface FormationBatchUpdatePayloadUpdateDynoSize { /** - * number of processes to maintain + * unique identifier of the dyno size * - * @example 1 + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - quantity?: number; + readonly id: string; /** - * dyno size + * name of the dyno size * - * @example "standard-1X" + * @example "Standard-1X" */ - size?: string; + readonly name?: string; } -export interface IdentityProviderCreateByTeamPayload { +export interface FormationUpdatePayload { /** - * raw contents of the public certificate (eg: .crt or .pem file) + * dyno size * - * @example "-----BEGIN CERTIFICATE----- ..." + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} */ - certificate: string; + dyno_size?: FormationUpdatePayloadDynoSize; /** - * URL identifier provided by the identity provider + * number of processes to maintain * - * @example "https://customer-domain.idp.com" + * @example 1 */ - entity_id: string; + quantity?: number; +} +/** + * + * dyno size + */ +export interface FormationUpdatePayloadDynoSize { /** - * single log out URL for this identity provider + * unique identifier of the dyno size * - * @example "https://example.com/idp/logout" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - slo_target_url?: string; + readonly id: string; /** - * single sign on URL for this identity provider + * name of the dyno size * - * @example "https://example.com/idp/login" + * @example "Standard-1X" */ - sso_target_url: string; + readonly name?: string; +} +/** + * + * [Heroku Platform API - generation](https://devcenter.heroku.com/articles/platform-api-reference#generation) + * A generation represents a version of the Heroku platform that includes the app execution environment, routing, telemetry, and build systems. + */ +export interface Generation { + /** + * when generation was created + * + * @example "2024-12-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of generation + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of generation + * + * @example "fir" + */ + readonly name: string; + /** + * when generation was updated + * + * @example "2024-12-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * features unsupported by this generation + */ + unsupported_features: string[]; + /** + * features unsupported by this generation along with their metadata + */ + expanded_supported_features: UnsupportedFeature[]; +} +/** + * + * unsupported feature information + */ +export interface UnsupportedFeature { + /** + * name of unsupported feature + * + * @example "app_maintenance" + */ + name?: string; + /** + * type of unsupported feature + * + * @example "temporary" + */ + incompatible_type?: string; + /** + * scope of unsupported feature + * + * @example "app" + */ + scope?: string; } -export interface IdentityProviderUpdateByTeamPayload { +export interface IdentityProviderCreatePayload { + /** + * Array of sso certificates belonging to this identity provider + */ + certificates?: Array<{ + readonly created_at?: string; + readonly id?: string; + readonly expires_at?: string; + body?: string; + name?: string | null; + }>; /** * raw contents of the public certificate (eg: .crt or .pem file) * * @example "-----BEGIN CERTIFICATE----- ..." */ - certificate?: string; + certificate?: string | null; + /** + * URL identifier provided by the identity provider + * + * @example "https://customer-domain.idp.com" + */ + entity_id?: string; + /** + * single log out URL for this identity provider + * + * @example "https://example.com/idp/logout" + */ + slo_target_url?: string; + /** + * single sign on URL for this identity provider + * + * @example "https://example.com/idp/login" + */ + sso_target_url?: string; + /** + * entity that owns this identity provider + */ + owner: Owner; + /** + * when the identity provider is allowed to be used + */ + readonly enabled?: boolean; +} +export interface IdentityProviderUpdatePayload { /** * URL identifier provided by the identity provider * @@ -4234,6 +4525,14 @@ export interface IdentityProviderUpdateByTeamPayload { * @example "https://example.com/idp/login" */ sso_target_url?: string; + /** + * when the identity provider is allowed to be used + */ + readonly enabled?: boolean; + /** + * List of certificates to update or create; any existing certificates not referenced here will be deleted + */ + certificates?: []; } /** * @@ -4647,13 +4946,19 @@ export interface LogSession { } export interface LogSessionCreatePayload { /** - * dyno to limit results to + * dyno name to limit results to * - * @example "web.1" + * @example "'web.1' (Cedar-generation) or 'web-1234abcde-123ab' (Fir-generation)" */ dyno?: string; /** - * number of log lines to stream at once + * process type to limit results to (for Fir-generation apps only) + * + * @example "web" + */ + type?: string; + /** + * number of log lines to stream at a time (for Cedar-generation apps only) * * @example 10 */ @@ -4691,6 +4996,12 @@ export interface OauthAuthorization { * @example "2012-01-01T12:00:00Z" */ readonly created_at: string; + /** + * human-friendly description of this OAuth authorization + * + * @example "sample authorization" + */ + readonly description: string; /** * this authorization's grant */ @@ -4711,6 +5022,10 @@ export interface OauthAuthorization { * @example ["global"] */ readonly scope: string[]; + /** + * this authorization's session + */ + readonly session: null | Session; /** * when OAuth authorization was updated * @@ -4742,9 +5057,15 @@ export interface AccessToken { /** * contents of the token to be used for authorization * - * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly token?: string; + /** + * the version of the token + * + * @example "1" + */ + readonly version?: number; } /** * @@ -4814,10 +5135,22 @@ export interface RefreshToken { /** * contents of the token to be used for authorization * - * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly token: string; } +/** + * + * this authorization's session + */ +export interface Session { + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} /** * * authenticated user associated with this authorization @@ -4866,6 +5199,36 @@ export interface OauthAuthorizationCreatePayload { */ readonly scope: string[]; } +export interface OauthAuthorizationUpdatePayload { + /** + * human-friendly description of this OAuth authorization + * + * @example "sample authorization" + */ + readonly description?: string; + /** + * identifier of the client that obtained this authorization + */ + client: OauthAuthorizationUpdatePayloadClient; +} +/** + * + * identifier of the client that obtained this authorization + */ +export interface OauthAuthorizationUpdatePayloadClient { + /** + * unique identifier of this OAuth client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * secret used to obtain OAuth authorizations under this client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly secret?: string; +} /** * * [Heroku Platform API - oauth-client](https://devcenter.heroku.com/articles/platform-api-reference#oauth-client) @@ -4957,7 +5320,7 @@ export interface OauthToken { /** * current access token */ - access_token: AccessToken; + access_token: OauthTokenAccessToken; /** * authorization for this set of tokens */ @@ -4985,7 +5348,7 @@ export interface OauthToken { /** * refresh token for this authorization */ - refresh_token: RefreshToken; + refresh_token: OauthTokenRefreshToken; /** * OAuth session using this token */ @@ -5001,6 +5364,30 @@ export interface OauthToken { */ user: OauthTokenUser; } +/** + * + * current access token + */ +export interface OauthTokenAccessToken { + /** + * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime + * + * @example 2592000 + */ + readonly expires_in: null | number; + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * contents of the token to be used for authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token: string; +} /** * * authorization for this set of tokens @@ -5045,15 +5432,33 @@ export interface OauthTokenGrant { } /** * - * OAuth session using this token + * refresh token for this authorization */ -export interface Session { +export interface OauthTokenRefreshToken { + /** + * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime + * + * @example 2592000 + */ + readonly expires_in: null | number; /** * unique identifier of OAuth token * * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly id: string; + /** + * contents of the token to be used for authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token: string; + /** + * the version of the token + * + * @example "1" + */ + readonly version: number; } /** * @@ -5098,119 +5503,283 @@ export interface OauthTokenCreatePayloadRefreshToken { /** * contents of the token to be used for authorization * - * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly token?: string; } /** * - * [Heroku Platform API - password-reset](https://devcenter.heroku.com/articles/platform-api-reference#password-reset) - * A password reset represents a in-process password reset attempt. + * [Heroku Platform API - oci-image](https://devcenter.heroku.com/articles/platform-api-reference#oci-image) + * An OCI (Open Container Initiative) image is a standardized format for packaging and distributing containerized applications, ready to run on the platform. */ -export interface PasswordReset { +export interface OciImage { /** - * when password reset was created + * unique identifier of the OCI image * - * @example "2012-01-01T12:00:00Z" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - readonly created_at: string; - user: User; -} -export interface PasswordResetResetPasswordPayload { + readonly id: string; /** - * unique email address of account + * name of the image used for the base layers of the OCI image * - * @example "username@example.com" + * @example "heroku/heroku:22-cnb" */ - email: string; -} -export interface PasswordResetCompleteResetPasswordPayload { + base_image_name: string; /** - * current password on the account + * the digest of the top most layer of the base image. * - * @example "currentpassword" + * @example "sha256:ea36ae5fbc1e7230e0a782bf216fb46500e210382703baa6bab8acf2c6a23f78" */ - readonly password: string; + base_top_layer: string; /** - * confirmation of the new password + * identification of the code in your version control system (eg: SHA of the git HEAD) * - * @example "newpassword" + * @example "60883d9e8947a57e04dc9124f25df004866a2051" */ - readonly password_confirmation: string; -} -/** - * - * [Heroku Platform API - peering-info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) - * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. - */ -export interface PeeringInfo { + commit: string; /** - * The AWS account ID of your Private Space. + * an optional description of the provided commit * - * @example "123456789012" + * @example "fixed a bug with API documentation" */ - readonly aws_account_id: string; + commit_description: string; /** - * region name used by provider + * name of the image registry repository used for storage * - * @example "us-east-1" + * @example "d7ba1ace-b396-4691-968c-37ae53153426/builds" */ - readonly aws_region: 'ap-south-1' | 'eu-west-1' | 'ap-southeast-1' | 'ap-southeast-2' | 'eu-central-1' | 'eu-west-2' | 'ap-northeast-2' | 'ap-northeast-1' | 'us-east-1' | 'sa-east-1' | 'us-west-1' | 'us-west-2' | 'ca-central-1'; + image_repo: string; /** - * The AWS VPC ID of the peer. + * unique identifier representing the content of the OCI image * - * @example "vpc-1234567890" + * @example "sha256:dc14ae5fbc1e7230e0a782bf216fb46500e210631703bcc6bab8acf2c6a23f42" */ - readonly vpc_id: string; + digest: string; /** - * An IP address and the number of significant bits that make up the routing or networking portion. + * stack associated to the OCI image + */ + stack: OciImageStack; + /** + * process types of the OCI image * - * @example "10.0.0.0/16" + * @example {"web":{"name":"web","display_cmd":"bundle exec puma -p $PORT","command":"/cnb/process/web","working_dir":"/workspace/webapp","default":true}} */ - vpc_cidr: string; + process_types: Record; /** - * The CIDR ranges that should be routed to the Private Space VPC. + * buildpacks of the OCI image */ - dyno_cidr_blocks: string[]; + buildpacks: Buildpack[]; /** - * The CIDR ranges that you must not conflict with. + * when the OCI image was created + * + * @example "2012-01-01T12:00:00Z" */ - unavailable_cidr_blocks: string[]; + readonly created_at: string; /** - * The CIDR ranges that should be routed to the Private Space VPC. + * when the OCI image was updated + * + * @example "2012-01-01T12:00:00Z" */ - space_cidr_blocks: string[]; + readonly updated_at: string; + /** + * build architecture for OCI image + * + * @example "arm64" + */ + architecture: string | null; } /** * - * [Heroku Platform API - peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) - * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + * [Heroku Platform API - stack](https://devcenter.heroku.com/articles/platform-api-reference#stack) + * stack associated to the OCI image */ -export interface Peering { +export interface OciImageStack { /** - * The type of peering connection. + * unique identifier of stack * - * @example "heroku-managed" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - type: 'heroku-managed' | 'customer-managed' | 'unknown'; + readonly id?: string; /** - * The AWS VPC Peering Connection ID of the peering. + * unique name of stack * - * @example "pcx-123456789012" + * @example "heroku-18" */ - readonly pcx_id: string; + readonly name?: string; +} +export interface OciImageCreatePayload { /** - * The CIDR blocks of the peer. + * build architecture for OCI image + * + * @example "arm64" */ - cidr_blocks: string[]; + architecture?: string | null; /** - * The status of the peering connection. + * name of the image used for the base layers of the OCI image * - * @example "pending-acceptance" + * @example "heroku/heroku:22-cnb" */ - readonly status: 'initiating-request' | 'pending-acceptance' | 'provisioning' | 'active' | 'failed' | 'expired' | 'rejected' | 'deleted'; + base_image_name?: string; /** - * The AWS VPC ID of the peer. + * the digest of the top most layer of the base image. + * + * @example "sha256:ea36ae5fbc1e7230e0a782bf216fb46500e210382703baa6bab8acf2c6a23f78" + */ + base_top_layer?: string; + /** + * identification of the code in your version control system (eg: SHA of the git HEAD) + * + * @example "60883d9e8947a57e04dc9124f25df004866a2051" + */ + commit?: string; + /** + * an optional description of the provided commit + * + * @example "fixed a bug with API documentation" + */ + commit_description?: string; + /** + * name of the image registry repository used for storage + * + * @example "d7ba1ace-b396-4691-968c-37ae53153426/builds" + */ + image_repo?: string; + /** + * unique identifier representing the content of the OCI image + * + * @example "sha256:dc14ae5fbc1e7230e0a782bf216fb46500e210631703bcc6bab8acf2c6a23f42" + */ + digest?: string; + /** + * unique name of stack or unique identifier of stack + */ + stack?: string; + /** + * process types of the OCI image + * + * @example {"web":{"name":"web","display_cmd":"bundle exec puma -p $PORT","command":"/cnb/process/web","working_dir":"/workspace/webapp","default":true}} + */ + process_types?: Record; + /** + * buildpacks of the OCI image + */ + buildpacks?: Buildpack[]; +} +/** + * + * [Heroku Platform API - password-reset](https://devcenter.heroku.com/articles/platform-api-reference#password-reset) + * A password reset represents a in-process password reset attempt. + */ +export interface PasswordReset { + /** + * when password reset was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + user: User; +} +export interface PasswordResetResetPasswordPayload { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; +} +export interface PasswordResetCompleteResetPasswordPayload { + /** + * current password on the account + * + * @example "currentpassword" + */ + readonly password: string; + /** + * confirmation of the new password + * + * @example "newpassword" + */ + readonly password_confirmation: string; +} +/** + * + * [Heroku Platform API - peering-info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) + * [Peering Info](https://devcenter.heroku.com/articles/private-space-vpc-peering?preview=1) gives you the information necessary to peer an AWS VPC to a Private Space. + */ +export interface PeeringInfo { + /** + * The AWS account ID of your Private Space. + * + * @example "123456789012" + */ + readonly aws_account_id: string; + /** + * The AWS region where your Private Space resides + * + * @example "us-west-1" + */ + readonly aws_region: 'ap-south-1' | 'eu-west-1' | 'ap-southeast-1' | 'ap-southeast-2' | 'eu-central-1' | 'ap-northeast-2' | 'ap-northeast-1' | 'us-east-1' | 'sa-east-1' | 'us-west-1' | 'us-west-2'; + /** + * The AWS VPC ID of the peer. + * + * @example "vpc-1234567890" + */ + readonly vpc_id: string; + /** + * An IP address and the number of significant bits that make up the routing or networking portion. + * + * @example "192.0.2.0/24" + */ + vpc_cidr: string; + /** + * The CIDR ranges that should be routed to the Private Space VPC. + */ + dyno_cidr_blocks: string[]; + /** + * The CIDR ranges that you must not conflict with. + */ + unavailable_cidr_blocks: string[]; + /** + * The CIDR ranges that should be routed to the Private Space VPC. + */ + space_cidr_blocks: string[]; +} +/** + * + * [Heroku Platform API - peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) + * [Peering](https://devcenter.heroku.com/articles/private-space-vpc-peering?preview=1) provides a way to peer your Private Space VPC to another AWS VPC. + */ +export interface Peering { + /** + * The type of peering connection. + * + * @example "heroku-managed" + */ + type: 'heroku-managed' | 'customer-managed' | 'unknown' | 'slowdb' | 'heroku-postgresql' | 'heroku-redis' | 'heroku-kafka' | 'heroku-cassandra'; + /** + * The AWS VPC Peering Connection ID of the peering. + * + * @example "pcx-123456789012" + */ + readonly pcx_id: string; + /** + * An IP address and the number of significant bits that make up the routing or networking portion. + * + * @example "192.0.2.0/24" + */ + cidr_block: string; + /** + * The CIDR blocks of the peer. + */ + cidr_blocks: string[]; + /** + * The status of the peering connection. + * + * @example "pending-acceptance" + */ + readonly status: 'initiating-request' | 'pending-acceptance' | 'provisioning' | 'active' | 'failed' | 'expired' | 'rejected' | 'deleted'; + /** + * The AWS VPC ID of the peer. * * @example "vpc-1234567890" */ @@ -5234,6 +5803,14 @@ export interface Peering { */ readonly expires: string; } +export interface PeeringAcceptPayload { + /** + * The AWS VPC Peering Connection ID of the peering. + * + * @example "pcx-123456789012" + */ + readonly pcx_id: string; +} /** * * [Heroku Platform API - permission-entity](https://devcenter.heroku.com/articles/platform-api-reference#permission-entity) @@ -5268,140 +5845,288 @@ export interface PermissionEntity { * Users that have access to the entity. */ users: Array<{ - /** - * unique email address of account - * - * @example "username@example.com" - */ email?: string; - /** - * unique identifier of an account - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ readonly id?: string; - /** - * enterprise account permissions - */ permissions?: string[]; }>; } /** * - * [Heroku Platform API - pipeline-coupling](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-coupling) - * Information about an app's coupling to a pipeline + * [Heroku Platform API - pipeline-build](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-build) + * Information about the latest builds of apps in a pipeline. A build represents the process of transforming code into build artifacts. */ -export interface PipelineCoupling { +export interface PipelineBuild { /** - * app involved in the pipeline coupling + * app that the build belongs to */ - app?: PipelineCouplingApp; + app: PipelineBuildApp; /** - * when pipeline coupling was created + * buildpacks executed for this build, in order (only applicable to Cedar-generation apps) + */ + buildpacks: Array<{ + url?: string; + name?: string; + }> | null; + /** + * when build was created * * @example "2012-01-01T12:00:00Z" */ - readonly created_at?: string; + readonly created_at: string; /** - * unique identifier of pipeline coupling + * unique identifier of build * * @example "01234567-89ab-cdef-0123-456789abcdef" */ - readonly id?: string; + readonly id: string; /** - * pipeline involved in the coupling + * Build process output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). + * + * @example "https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef" */ - pipeline?: Pipeline; + readonly output_stream_url: string; /** - * target pipeline stage + * location of gzipped tarball of source code used to create build + */ + source_blob: PipelineBuildSourceBlob; + /** + * release resulting from the build * - * @example "production" + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} */ - stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; + readonly release: null | BuildRelease; /** - * when pipeline coupling was updated + * slug created by this build + */ + slug: PipelineBuildSlug | null; + /** + * stack of build + * + * @example "heroku-22" + */ + readonly stack: string; + /** + * status of build + * + * @example "succeeded" + */ + readonly status: 'failed' | 'pending' | 'succeeded'; + /** + * when build was updated * * @example "2012-01-01T12:00:00Z" */ - readonly updated_at?: string; + readonly updated_at: string; + /** + * user that started the build + */ + user: User; } /** * * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) - * app involved in the pipeline coupling + * app that the build belongs to */ -export interface PipelineCouplingApp { +export interface PipelineBuildApp { /** * unique identifier of app * * @example "01234567-89ab-cdef-0123-456789abcdef" */ - readonly id?: string; + readonly id: string; } /** * - * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) - * A pipeline allows grouping of apps into different stages. + * location of gzipped tarball of source code used to create build */ -export interface Pipeline { +export interface PipelineBuildSourceBlob { /** - * when pipeline was created + * an optional checksum of the gzipped tarball for verifying its integrity * - * @example "2012-01-01T12:00:00Z" + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" */ - readonly created_at?: string; + readonly checksum: null | string; /** - * unique identifier of pipeline + * URL where gzipped tar archive of source code for build was downloaded. * - * @example "01234567-89ab-cdef-0123-456789abcdef" + * @example "https://example.com/source.tgz?token=xyz" */ - readonly id?: string; + readonly url: string; /** - * name of pipeline + * version of the gzipped tarball * - * @example "example" - */ - name?: string; - /** - * Owner of a pipeline. + * @example "v1.3.0" */ - owner?: PipelineOwner | null; + readonly version: string | null; /** - * when pipeline was updated + * version description of the gzipped tarball * - * @example "2012-01-01T12:00:00Z" + * @example "* Fake User: Change session key" */ - readonly updated_at?: string; + readonly version_description: string | null; } -export interface PipelineCouplingCreatePayload { - /** - * unique identifier of app or unique name of app - */ - app: string; +/** + * + * [Heroku Platform API - slug](https://devcenter.heroku.com/articles/platform-api-reference#slug) + * slug created by this build + */ +export interface PipelineBuildSlug { /** - * unique identifier of pipeline + * unique identifier of slug * * @example "01234567-89ab-cdef-0123-456789abcdef" */ - readonly pipeline: string; - /** - * target pipeline stage - * - * @example "production" - */ - stage: 'test' | 'review' | 'development' | 'staging' | 'production'; + readonly id: string; } -export interface PipelineCouplingUpdatePayload { +/** + * + * [Heroku Platform API - pipeline-config-var](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-config-var) + * Pipeline config vars in Heroku CI and review apps used to manage the configuration information for a pipeline. + */ +export interface PipelineConfigVar { /** - * target pipeline stage + * user-defined config var name and value * - * @example "production" + * @example {"FOO":"bar"} */ - stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; + '["NAME"]: ["value"]': Record; } /** * - * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * [Heroku Platform API - pipeline-coupling](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-coupling) + * Information about an app's coupling to a pipeline + */ +export interface PipelineCoupling { + /** + * app involved in the pipeline coupling + */ + app?: PipelineCouplingApp; + /** + * when pipeline coupling was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of pipeline coupling + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * pipeline involved in the coupling + */ + pipeline?: Pipeline; + /** + * target pipeline stage + * + * @example "production" + */ + stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; + /** + * when pipeline coupling was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app involved in the pipeline coupling + */ +export interface PipelineCouplingApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * A pipeline allows grouping of apps into different stages. + */ +export interface Pipeline { + /** + * when pipeline was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of pipeline + * + * @example "example" + */ + name?: string; + /** + * Owner of a pipeline. + */ + owner?: PipelineOwner | null; + /** + * when pipeline was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; + /** + * the generation of the Heroku platform for this pipeline + */ + generation?: PipelineGeneration; +} +export interface PipelineCouplingCreatePayload { + /** + * unique identifier of app or unique name of app + */ + app: string; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly pipeline: string; + /** + * target pipeline stage + * + * @example "production" + */ + stage: 'test' | 'review' | 'development' | 'staging' | 'production'; +} +export interface PipelineCouplingUpdatePayload { + /** + * target pipeline stage + * + * @example "production" + */ + stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; +} +/** + * + * a build artifact for the release + */ +export interface Artifact { + /** + * type of artifact + * + * @example "oci-image" + */ + type?: string; + /** + * unique identifier of slug or unique identifier of the OCI image + */ + id?: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) * app involved in the release */ export interface ReleaseApp { @@ -5418,6 +6143,18 @@ export interface ReleaseApp { */ readonly id?: string; } +/** + * + * OCI image running in this release + */ +export interface ReleaseOciImage { + /** + * unique identifier of the OCI image + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} /** * * [Heroku Platform API - pipeline-promotion-target](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion-target) @@ -5567,9 +6304,6 @@ export interface PipelinePromotionCreatePayload { */ source: PipelinePromotionCreatePayloadSource; targets: Array<{ - /** - * the app is being promoted to - */ app?: PipelinePromotionCreatePayloadApp; }>; } @@ -5610,6 +6344,119 @@ export interface PipelinePromotionCreatePayloadApp { */ readonly id: string; } +/** + * + * [Heroku Platform API - pipeline-release](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-release) + * Information about the latest release of each app in a pipeline. A release makes a deployment available to end-users. + */ +export interface PipelineRelease { + /** + * add-on plans installed on the app for this release + */ + addon_plan_names: string[]; + /** + * a build artifact for the release + */ + readonly artifacts: Artifact; + /** + * app involved in the release + */ + app: PipelineReleaseApp; + /** + * when release was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of changes in this release + * + * @example "Added new feature" + */ + readonly description: string; + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * when release was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * slug running in the release + */ + slug: PipelineReleaseSlug | null; + /** + * current status of the release + * + * @example "succeeded" + */ + readonly status: 'expired' | 'failed' | 'pending' | 'succeeded'; + /** + * user that created the release + */ + user: User; + /** + * unique version assigned to the release + * + * @example 11 + */ + readonly version: number; + /** + * indicates if this release is the current one for the app + * + * @example true + */ + readonly current: boolean; + /** + * URL that the release command output streams to. The stream is available as either `text/plain` or `text/event-stream`. Prepare clients to handle disconnects and to resume the stream by sending a `Range` header for `text/plain` or a `Last-Event-Id` header for `text/event-stream`. + * + * @example "https://release-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef" + */ + readonly output_stream_url: string | null; + /** + * indicates if this release is eligible for rollback + * + * @example true + */ + readonly eligible_for_rollback: boolean; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app involved in the release + */ +export interface PipelineReleaseApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - slug](https://devcenter.heroku.com/articles/platform-api-reference#slug) + * slug running in the release + */ +export interface PipelineReleaseSlug { + /** + * unique identifier of slug + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} /** * * [Heroku Platform API - pipeline-stack](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-stack) @@ -5686,6 +6533,25 @@ export interface PipelineOwner { */ type: string; } +/** + * + * [Heroku Platform API - generation](https://devcenter.heroku.com/articles/platform-api-reference#generation) + * the generation of the Heroku platform for this pipeline + */ +export interface PipelineGeneration { + /** + * unique identifier of the generation of the Heroku platform for this pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of the generation of the Heroku platform for this pipeline + * + * @example "cedar" + */ + readonly name?: string; +} export interface PipelineCreatePayload { /** * name of pipeline @@ -5744,10 +6610,14 @@ export interface ReleaseCreatePayload { * @example "Added new feature" */ readonly description?: string; + /** + * unique identifier of the OCI image or unique identifier representing the content of the OCI image + */ + oci_image?: string; /** * unique identifier of slug */ - slug: string; + slug?: string; } export interface ReleaseRollbackPayload { /** @@ -6163,7 +7033,7 @@ export interface SniEndpointApp { */ export interface SslCert { readonly 'ca_signed?'?: boolean; - readonly cert_domains?: unknown[]; + readonly cert_domains?: []; readonly expires_at?: string; readonly issuer?: string; readonly 'self_signed?'?: boolean; @@ -6331,20 +7201,8 @@ export interface SpaceTopology { * The apps within this space */ readonly apps: Array<{ - /** - * unique identifier of app - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ readonly id?: string; - /** - * - * @example ["example.com","example.net"] - */ - readonly domains?: unknown[]; - /** - * formations for application - */ + readonly domains?: []; readonly formation?: SpaceTopologyFormation[]; }>; } @@ -6495,15 +7353,39 @@ export interface SpaceCreatePayload { * @example "https://example.com/logs" */ log_drain_url?: string; -} -/** - * - * [Heroku Platform API - team-app-collaborator](https://devcenter.heroku.com/articles/platform-api-reference#team-app-collaborator) - * A team collaborator represents an account that has been given access to a team app on Heroku. - */ -export interface TeamAppCollaborator { /** - * app collaborator belongs to + * channel to create the space on + * + * @example "some-channel" + */ + channel_name?: string; + /** + * generation for space + * + * @example "fir" + */ + generation?: string; + /** + * runtime features for the space + * + * @example "[feature-name]" + */ + features?: []; + /** + * supported api features for the space + * + * @example "[api-feature-name]" + */ + supported_features?: []; +} +/** + * + * [Heroku Platform API - team-app-collaborator](https://devcenter.heroku.com/articles/platform-api-reference#team-app-collaborator) + * A team collaborator represents an account that has been given access to a team app on Heroku. + */ +export interface TeamAppCollaborator { + /** + * app collaborator belongs to */ app?: TeamAppCollaboratorApp; /** @@ -7201,7 +8083,7 @@ export interface TeamMonthlyUsage { */ apps: AppUsageMonthly[]; /** - * average connect rows synced + * max connect rows synced * * @example 15000 */ @@ -7446,6 +8328,133 @@ export interface TeamCreateInEnterpriseAccountPayload { */ readonly name: string; } +/** + * + * [Heroku Platform API - telemetry-drain](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-drain) + * A telemetry drain forwards OpenTelemetry traces, metrics, and logs to your own consumer. For Fir-generation apps only. + */ +export interface TelemetryDrain { + /** + * when the telemetry drain was created + * + * @example "2024-12-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of telemetry drain + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * entity that owns this telemetry drain + */ + owner: TelemetryDrainOwner; + /** + * OpenTelemetry signals to send to telemetry drain + * + * @example ["traces","metrics"] + */ + signals: 'traces' | 'metrics' | Array<'logs'>; + /** + * OpenTelemetry exporter configuration + */ + exporter: Exporter; + /** + * when telemetry drain was last updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * entity that owns this telemetry drain + */ +export interface TelemetryDrainOwner { + /** + * unique identifier of owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * type of owner + * + * @example "app" + */ + readonly type: 'app' | 'space'; +} +/** + * + * OpenTelemetry exporter configuration + */ +export interface Exporter { + /** + * the transport type to be used for your OpenTelemetry consumer + * + * @example "otlphttp" + */ + readonly type: 'otlphttp' | 'otlp'; + /** + * URI of your OpenTelemetry consumer + * + * @example "https://api.otelproduct.example/consumer" + */ + endpoint: string; + /** + * JSON headers to send to your OpenTelemetry consumer + * + * @example {"API-Key":"example_api_key_012345","Environment":"production"} + */ + headers?: Record; +} +export interface TelemetryDrainCreatePayload { + /** + * entity that owns this telemetry drain + */ + owner: TelemetryDrainCreatePayloadOwner; + /** + * OpenTelemetry signals to send to telemetry drain + * + * @example ["traces","metrics"] + */ + signals: 'traces' | 'metrics' | Array<'logs'>; + /** + * OpenTelemetry exporter configuration + */ + exporter: Exporter; +} +/** + * + * entity that owns this telemetry drain + */ +export interface TelemetryDrainCreatePayloadOwner { + /** + * unique identifier of owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * type of owner + * + * @example "app" + */ + readonly type: 'app' | 'space'; +} +export interface TelemetryDrainUpdatePayload { + /** + * OpenTelemetry signals to send to telemetry drain + * + * @example ["traces","metrics"] + */ + signals?: 'traces' | 'metrics' | Array<'logs'>; + /** + * OpenTelemetry exporter configuration + */ + exporter?: Exporter; +} /** * * [Heroku Platform API - test-case](https://devcenter.heroku.com/articles/platform-api-reference#test-case) @@ -7707,276 +8716,1280 @@ export interface TestRunCreatePayload { /** * whether the test run was started for interactive debugging */ - debug?: boolean; + debug?: boolean; + /** + * unique name of team or unique identifier of team + */ + organization?: string; + /** + * unique identifier of pipeline or name of pipeline + */ + pipeline: string; + /** + * The download location for the source code to be tested + */ + source_blob_url: string; +} +export interface TestRunUpdatePayload { + /** + * current state of the test run + */ + readonly status: 'pending' | 'cancelled' | 'creating' | 'building' | 'running' | 'succeeded' | 'failed' | 'errored' | 'debugging'; + /** + * human friendly message indicating reason for an error + */ + message: string | null; +} +/** + * + * [Heroku Platform API - user-preferences](https://devcenter.heroku.com/articles/platform-api-reference#user-preferences) + * Tracks a user's preferences and message dismissals + */ +export interface UserPreferences { + /** + * User's default timezone + * + * @example "UTC" + */ + timezone: string | null; + /** + * User's default team + * + * @example "sushi-inc" + */ + 'default-organization': string | null; + /** + * Whether the user has dismissed the GitHub link banner + * + * @example true + */ + 'dismissed-github-banner': boolean | null; + /** + * Whether the user has dismissed the getting started banner + * + * @example true + */ + 'dismissed-getting-started': boolean | null; + /** + * Whether the user has dismissed the Organization Access Controls banner + * + * @example true + */ + 'dismissed-org-access-controls': boolean | null; + /** + * Whether the user has dismissed the Organization Wizard + * + * @example true + */ + 'dismissed-org-wizard-notification': boolean | null; + /** + * Whether the user has dismissed the Pipelines banner + * + * @example true + */ + 'dismissed-pipelines-banner': boolean | null; + /** + * Whether the user has dismissed the GitHub banner on a pipeline overview + * + * @example true + */ + 'dismissed-pipelines-github-banner': boolean | null; + /** + * Which pipeline uuids the user has dismissed the GitHub banner for + * + * @example ["96c68759-f310-4910-9867-e0b062064098"] + */ + 'dismissed-pipelines-github-banners': null | string[]; + /** + * Whether the user has dismissed the 2FA SMS banner + * + * @example true + */ + 'dismissed-sms-banner': boolean | null; +} +export interface UserPreferencesUpdatePayload { + /** + * User's default timezone + * + * @example "UTC" + */ + timezone?: string | null; + /** + * User's default team + * + * @example "sushi-inc" + */ + 'default-organization'?: string | null; + /** + * Whether the user has dismissed the GitHub link banner + * + * @example true + */ + 'dismissed-github-banner'?: boolean | null; + /** + * Whether the user has dismissed the getting started banner + * + * @example true + */ + 'dismissed-getting-started'?: boolean | null; + /** + * Whether the user has dismissed the Organization Access Controls banner + * + * @example true + */ + 'dismissed-org-access-controls'?: boolean | null; + /** + * Whether the user has dismissed the Organization Wizard + * + * @example true + */ + 'dismissed-org-wizard-notification'?: boolean | null; + /** + * Whether the user has dismissed the Pipelines banner + * + * @example true + */ + 'dismissed-pipelines-banner'?: boolean | null; + /** + * Whether the user has dismissed the GitHub banner on a pipeline overview + * + * @example true + */ + 'dismissed-pipelines-github-banner'?: boolean | null; + /** + * Which pipeline uuids the user has dismissed the GitHub banner for + * + * @example ["96c68759-f310-4910-9867-e0b062064098"] + */ + 'dismissed-pipelines-github-banners'?: null | string[]; + /** + * Whether the user has dismissed the 2FA SMS banner + * + * @example true + */ + 'dismissed-sms-banner'?: boolean | null; +} +/** + * + * [Heroku Platform API - vpn-connection](https://devcenter.heroku.com/articles/platform-api-reference#vpn-connection) + * [VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN. + */ +export interface VpnConnection { + /** + * VPN ID + * + * @example "123456789012" + */ + readonly id: string; + /** + * VPN Name + * + * @example "office" + */ + name: string; + /** + * Public IP of VPN customer gateway + * + * @example "35.161.69.30" + */ + public_ip: string; + /** + * Routable CIDRs of VPN + */ + routable_cidrs: string[]; + /** + * CIDR Block of the Private Space + * + * @example "10.0.0.0/16" + */ + readonly space_cidr_block: string; + tunnels: Tunnel[]; + /** + * IKE Version + * + * @example 1 + */ + readonly ike_version: number; + /** + * Status of the VPN + * + * @example "active" + */ + readonly status: 'pending' | 'provisioning' | 'active' | 'deprovisioning' | 'failed'; + /** + * Details of the status + * + * @example "supplied CIDR block already in use" + */ + readonly status_message: string; +} +/** + * + * Tunnel info + */ +export interface Tunnel { + /** + * Timestamp of last status changed + * + * @example "2016-10-25T22:09:05Z" + */ + last_status_change?: string; + /** + * Public IP address for the tunnel + * + * @example "52.44.146.197" + */ + ip?: string; + /** + * Public IP address for the customer side of the tunnel + * + * @example "52.44.146.197" + */ + customer_ip?: string; + /** + * Pre-shared key + * + * @example "secret" + */ + pre_shared_key?: string; + /** + * Status of the tunnel + * + * @example "UP" + */ + status?: 'UP' | 'DOWN'; + /** + * Details of the status + * + * @example "status message" + */ + status_message?: string; +} +export interface VpnConnectionCreatePayload { + /** + * VPN Name + * + * @example "office" + */ + name: string; + /** + * Public IP of VPN customer gateway + * + * @example "35.161.69.30" + */ + public_ip: string; + /** + * Routable CIDRs of VPN + */ + routable_cidrs: string[]; +} +export interface VpnConnectionUpdatePayload { + /** + * Routable CIDRs of VPN + */ + routable_cidrs: string[]; +} +/** + * + * [Heroku Platform API - add-on-sso](https://devcenter.heroku.com/articles/platform-api-reference#add-on-sso) + * Add-on Single Sign-on generates URL that allows a customer to log in to an Add-on Service's web dashboard. + */ +export interface AddOnSso { + /** + * whether this SSO request is a GET or a POST + * + * @example "get" + */ + readonly method: 'get' | 'post'; + /** + * URL to follow to initiate single sign-on + * + * @example "https://slowdb.heroku.com/heroku/resources/" + */ + readonly action: string; + /** + * params for this request + */ + readonly params: Params; +} +/** + * + * params for this request + */ +export interface Params { + /** + * unique email address of current user + * + * @example "username@example.com" + */ + readonly email?: string; + /** + * unique identifier of current user + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly user_id?: string; + /** + * name of app where add-on was first attached + * + * @example "example" + */ + readonly owning_app?: string; + /** + * current app name when SSO was requested + * + * @example "example" + */ + readonly attached_app?: string; + /** + * timestamp used to build params as an unix epoch integer + * + * @example "1325419200" + */ + readonly timestamp?: number; + /** + * Base64-encoded nav data for Heroku header + * + * @example "example" + */ + readonly 'nav-data'?: string; + /** + * id of this add-on with its provider + * + * @example "abcd1234" + */ + readonly id?: string; + /** + * token generated for this request that authenticates user + * + * @example "0123456789abcdef0123456789abcdef01234578" + */ + readonly token?: string; + /** + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly resource_id?: string; + /** + * unique token for this SSO request + * + * @example "bb466eb1d6bc345d11072c3cd25c311f21be130d" + */ + readonly resource_token?: string; +} +/** + * + * [Heroku Platform API - build-metadata](https://devcenter.heroku.com/articles/platform-api-reference#build-metadata) + * Build metadata contains the reference data for building the associated App. + */ +export interface BuildMetadata { + /** + * App associated with this metadata + */ + app: BuildMetadataApp; + /** + * URL for deleting the build cache. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly cache_delete_url: string; + /** + * URL for retrieving the latest build cache. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly cache_get_url: string; + /** + * URL for updating the latest build cache. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly cache_put_url: string; + /** + * URL for deleting this app's repo. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly repo_delete_url: string; + /** + * URL for retrieving this app's repo. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly repo_get_url: string; + /** + * URL for updating the app's repo. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly repo_put_url: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * App associated with this metadata + */ +export interface BuildMetadataApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - capability](https://devcenter.heroku.com/articles/platform-api-reference#capability) + * A capability represents a requested capability on a resource along with whether the requesting user has that capability + */ +export interface Capability { + /** + * name of the capability + * + * @example "manage_dynos" + */ + readonly capability: string; + /** + * id or name of the resource + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly resource_id: null | string; + /** + * type of the resource + * + * @example "app" + */ + readonly resource_type: string; + /** + * whether the user has the capability on the resource_id of type resource_type + * + * @example true + */ + readonly capable: boolean; + /** + * whether the given application resource is flagged as a paranoid app and will require a second factor + * + * @example true + */ + readonly requires_second_factor?: boolean; + /** + * canonical id of the resource if it's present + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly resource_canonical_id?: string; +} +export interface CapabilityCapabilitiesPayload { + /** + * The list of capabilities that you want to check + */ + capabilities: CapabilityRequest[]; +} +/** + * + * an object representing the requested capability + */ +export interface CapabilityRequest { + /** + * name of the capability + * + * @example "manage_dynos" + */ + readonly capability: string; + /** + * id or name of the resource + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly resource_id: null | string; + /** + * type of the resource + * + * @example "app" + */ + readonly resource_type: string; +} +export interface CapabilityCapabilitiesResponse { + /** + * The list of capabilities for the requested resources + */ + capabilities?: Capability[]; +} +/** + * + * [Heroku Platform API - config-vars-settings](https://devcenter.heroku.com/articles/platform-api-reference#config-vars-settings) + * The Config Vars Settings endpoints enable you to view and manage the configuration provided to an app on Heroku. These endpoints are similar to /config-vars but also allow you to check which config vars you can mask, and which are currently masked. + */ +export interface ConfigVarsSettings { + /** + * attachment that created this config var, if any + */ + attachment: ConfigVarsSettingsAttachment | null; + /** + * name of the config var + * + * @example "FOO_TOKEN" + */ + key: string; + /** + * value of the config var + * + * @example "bar" + */ + value: string | null; + /** + * indicates if the value is masked + */ + masked: boolean; + /** + * indicates if you can mask the value + * + * @example true + */ + readonly masking_supported: boolean; + /** + * indicates when the value was updated + * + * @example "2024-01-01T12:00:00Z" + */ + readonly value_updated_at: string; +} +/** + * + * attachment that created this config var, if any + */ +export interface ConfigVarsSettingsAttachment { + /** + * unique identifier of this add-on attachment + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface ConfigVarsSettingsUpdatePayload { + /** + * An array of config vars to be updated. + */ + config?: []; +} +/** + * + * [Heroku Platform API - dyno-processes](https://devcenter.heroku.com/articles/platform-api-reference#dyno-processes) + * Run processes inside existing dynos. + */ +export interface DynoProcesses { + /** + * a URL to stream output from for attached processes or null for non-attached processes + * + * @example "rendezvous://rendezvous.runtime.heroku.com:5000/{rendezvous-id}" + */ + readonly attach_url: string | null; +} +export interface DynoProcessesCreatePayload { + /** + * command used to start this process + * + * @example "bash" + */ + command: string; + /** + * custom environment to add to the dyno config vars + * + * @example {"COLUMNS":"80","LINES":"24"} + */ + env?: Record; +} +/** + * + * [Heroku Platform API - gateway-token](https://devcenter.heroku.com/articles/platform-api-reference#gateway-token) + * Contains a set of information useful for identifying a user and the type of access this user is allowed to have. + */ +export interface GatewayToken { + /** + * Token issuer + * + * @example "2012-01-01T12:00:00Z" + */ + readonly iss: string; + /** + * Integer representation of the timestamp the token was issued at + * + * @example 1526341325 + */ + readonly iat: number; + /** + * Integer representation of the timestamp the token should expire at + * + * @example 1526341325 + */ + readonly exp: number; + /** + * Unique identifier of the subject + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly sub: string; + /** + * Unique identifier of the user + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly user_id: string; + /** + * Email address of the user + * + * @example "username@example.com" + */ + readonly user_email: string; + /** + * Unique identifier of the OAuth authirization used in the token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly authorization_id: string | null; + /** + * Indicates that a rate limit should be enforced + * + * @example true + */ + readonly rate_limit_enabled: boolean; + /** + * Rate limit multiplier that should be used + * + * @example 2 + */ + readonly rate_limit_multiplier: number; + /** + * Describes if the token contains second factor claim + * + * @example true + */ + readonly second_factor: boolean; + /** + * Describes if the token contains sudo claim + * + * @example true + */ + readonly sudo: boolean; + /** + * Unique identifier of the sudoer if sudo was used + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly sudo_user_id: string | null; + /** + * Reason for using sudo if present + * + * @example "Ticket #123" + */ + readonly sudo_reason: string | null; + /** + * Describes if the token contains sudo force claim + * + * @example true + */ + readonly sudo_force: boolean; +} +/** + * + * [Heroku Platform API - identity-provider-actions](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-actions) + * Actions taken on Identity Providers, the SSO configuration representation. + */ +export interface IdentityProviderActions { + /** + * Array of sso certificates belonging to this identity provider + */ + certificates: Array<{ + readonly created_at?: string; + readonly id?: string; + readonly expires_at?: string; + body?: string; + name?: string | null; + }>; + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate: string | null; + /** + * when provider record was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * URL identifier provided by the identity provider + * + * @example "https://customer-domain.idp.com" + */ + entity_id: string; + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * user-friendly unique identifier for this identity provider + * + * @example "acme-sso" + */ + name: string; + /** + * entity that owns this identity provider + */ + owner: Owner; + /** + * single log out URL for this identity provider + * + * @example "https://example.com/idp/logout" + */ + slo_target_url: string; + /** + * single sign on URL for this identity provider + * + * @example "https://example.com/idp/login" + */ + sso_target_url: string; + /** + * when the identity provider record was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - identity-provider-certificate](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-certificate) + * Certificates represent an sso cert attached to an Identity Provider + */ +export interface IdentityProviderCertificate { + /** + * label for certificate + * + * @example "Certificate 1" + */ + name: string | null; + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + body: string; + /** + * when provider record was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * time which the certificate expires + * + * @example "2012-01-01T12:00:00Z" + */ + readonly expires_at: string; + /** + * unique identifier of the identity provider the cert belongs to + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly identity_provider_id: string; +} +export interface IdentityProviderCertificateCreatePayload { + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + body: string; + /** + * label for certificate + * + * @example "Certificate 1" + */ + name?: string | null; +} +export interface IdentityProviderCertificateUpdatePayload { + /** + * label for certificate + * + * @example "Certificate 1" + */ + name?: string | null; +} +/** + * + * [Heroku Platform API - payment-method](https://devcenter.heroku.com/articles/platform-api-reference#payment-method) + * The on file payment method for an account + */ +export interface PaymentMethod { + /** + * street address line 1 + * + * @example "40 Hickory Lane" + */ + address_1?: string | null; + /** + * street address line 2 + * + * @example "Suite 103" + */ + address_2?: string; + /** + * last 4 digits of credit card number + * + * @example "1234" + */ + readonly card_last4?: string; + /** + * name of credit card issuer + * + * @example "VISA" + */ + readonly card_type?: string; + /** + * city + * + * @example "San Francisco" + */ + city?: string; + /** + * country + * + * @example "US" + */ + country?: string; + /** + * expiration month + * + * @example "11" + */ + expiration_month?: string | null; + /** + * expiration year + * + * @example "2014" + */ + expiration_year?: string | null; + /** + * the first name for payment method + * + * @example "Jason" + */ + first_name?: string; + /** + * the last name for payment method + * + * @example "Walker" + */ + last_name?: string; + /** + * metadata + * + * @example "Additional information for payment method" + */ + other?: string | null; + /** + * postal code + * + * @example "90210" + */ + postal_code?: string; + /** + * state + * + * @example "CA" + */ + state?: string; +} +export interface PaymentMethodUpdatePayload { + /** + * street address line 1 + * + * @example "40 Hickory Lane" + */ + address_1?: string | null; + /** + * street address line 2 + * + * @example "Suite 103" + */ + address_2?: string; + /** + * encrypted card number of payment method + * + * @example "encrypted-card-number" + */ + card_number?: string | null; + /** + * city + * + * @example "San Francisco" + */ + city?: string; + /** + * country + * + * @example "US" + */ + country?: string; + /** + * card verification value + * + * @example "123" + */ + cvv?: string | null; /** - * unique name of team or unique identifier of team + * expiration month + * + * @example "11" */ - organization?: string; + expiration_month?: string | null; /** - * unique identifier of pipeline or name of pipeline + * expiration year + * + * @example "2014" */ - pipeline: string; + expiration_year?: string | null; /** - * The download location for the source code to be tested + * the first name for payment method + * + * @example "Jason" */ - source_blob_url: string; -} -export interface TestRunUpdatePayload { + first_name?: string; /** - * current state of the test run + * the last name for payment method + * + * @example "Walker" */ - readonly status: 'pending' | 'cancelled' | 'creating' | 'building' | 'running' | 'succeeded' | 'failed' | 'errored' | 'debugging'; + last_name?: string; /** - * human friendly message indicating reason for an error + * metadata + * + * @example "Additional information for payment method" */ - message: string | null; -} -/** - * - * [Heroku Platform API - user-preferences](https://devcenter.heroku.com/articles/platform-api-reference#user-preferences) - * Tracks a user's preferences and message dismissals - */ -export interface UserPreferences { + other?: string | null; /** - * User's default timezone + * postal code * - * @example "UTC" + * @example "90210" */ - timezone: string | null; + postal_code?: string; /** - * User's default team + * state * - * @example "sushi-inc" + * @example "CA" */ - 'default-organization': string | null; + state?: string; /** - * Whether the user has dismissed the GitHub link banner + * Nonce generated by Braintree hosted fields form * - * @example true + * @example "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" */ - 'dismissed-github-banner': boolean | null; + nonce?: string | null; /** - * Whether the user has dismissed the getting started banner + * Device data string generated by the client * - * @example true + * @example "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" */ - 'dismissed-getting-started': boolean | null; + device_data?: string; +} +/** + * + * [Heroku Platform API - payment](https://devcenter.heroku.com/articles/platform-api-reference#payment) + * A payment represents money collected for an account + */ +export interface Payment { /** - * Whether the user has dismissed the Organization Access Controls banner + * amount of payment in cents * - * @example true + * @example 50000 */ - 'dismissed-org-access-controls': boolean | null; + amount?: number; /** - * Whether the user has dismissed the Organization Wizard + * when payment was created * - * @example true + * @example "2012-01-01T12:00:00Z" */ - 'dismissed-org-wizard-notification': boolean | null; + readonly created_at?: string; /** - * Whether the user has dismissed the Pipelines banner + * legacy unique identifier of payment * - * @example true + * @example 9403943 */ - 'dismissed-pipelines-banner': boolean | null; + readonly id?: number; /** - * Whether the user has dismissed the GitHub banner on a pipeline overview - * - * @example true + * identity of invoice */ - 'dismissed-pipelines-github-banner': boolean | null; + invoice?: null | PaymentInvoice; /** - * Which pipeline uuids the user has dismissed the GitHub banner for + * when credit was updated * - * @example ["96c68759-f310-4910-9867-e0b062064098"] + * @example "2012-01-01T12:00:00Z" */ - 'dismissed-pipelines-github-banners': null | string[]; + readonly updated_at?: string; /** - * Whether the user has dismissed the 2FA SMS banner + * identity of user issuing payment + */ + user?: User; + /** + * state of the payment * - * @example true + * @example "pending" */ - 'dismissed-sms-banner': boolean | null; + readonly state?: 'failure' | 'pending' | 'success'; } -export interface UserPreferencesUpdatePayload { +/** + * + * [Heroku Platform API - invoice](https://devcenter.heroku.com/articles/platform-api-reference#invoice) + * identity of invoice + */ +export interface PaymentInvoice { /** - * User's default timezone + * unique identifier of this invoice * - * @example "UTC" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - timezone?: string | null; + readonly id?: string; /** - * User's default team + * human readable invoice number * - * @example "sushi-inc" + * @example 9403943 */ - 'default-organization'?: string | null; + readonly number?: number; +} +export interface PaymentCreatePayload { /** - * Whether the user has dismissed the GitHub link banner + * amount of payment in cents * - * @example true + * @example 50000 */ - 'dismissed-github-banner'?: boolean | null; + amount: number; /** - * Whether the user has dismissed the getting started banner - * - * @example true + * human readable invoice number */ - 'dismissed-getting-started'?: boolean | null; + invoice_id: number; /** - * Whether the user has dismissed the Organization Access Controls banner + * unique identifier for a payment transaction * - * @example true + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - 'dismissed-org-access-controls'?: boolean | null; + uuid: string; +} +/** + * + * [Heroku Platform API - space-host](https://devcenter.heroku.com/articles/platform-api-reference#space-host) + * [Space Hosts](https://devcenter.heroku.com/articles/private-spaces-dedicated-hosts?preview=1) lists dedicated hosts allocated to a space + */ +export interface SpaceHost { /** - * Whether the user has dismissed the Organization Wizard + * unique identifier of this host * - * @example true + * @example "h-05abcdd96ee9ca123" */ - 'dismissed-org-wizard-notification'?: boolean | null; + readonly host_id: string; /** - * Whether the user has dismissed the Pipelines banner + * availability of this space * - * @example true + * @example "available" */ - 'dismissed-pipelines-banner'?: boolean | null; + readonly state: 'available' | 'under-assessment' | 'permanent-failure' | 'released' | 'released-permanent-failure'; /** - * Whether the user has dismissed the GitHub banner on a pipeline overview + * approximate available capacity on this host expresses a percentage * - * @example true + * @example 67 */ - 'dismissed-pipelines-github-banner'?: boolean | null; + readonly available_capacity_percentage: number; /** - * Which pipeline uuids the user has dismissed the GitHub banner for + * when the host was allocated * - * @example ["96c68759-f310-4910-9867-e0b062064098"] + * @example "2012-01-01T12:00:00Z" */ - 'dismissed-pipelines-github-banners'?: null | string[]; + readonly allocated_at: string; /** - * Whether the user has dismissed the 2FA SMS banner + * when the host was released * - * @example true + * @example "2012-01-01T12:00:00Z" */ - 'dismissed-sms-banner'?: boolean | null; + readonly released_at: string; +} +export interface SpaceLogDrainUpdatePayload { + url?: string; } /** * - * [Heroku Platform API - vpn-connection](https://devcenter.heroku.com/articles/platform-api-reference#vpn-connection) - * [VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN. + * [Heroku Platform API - team-license](https://devcenter.heroku.com/articles/platform-api-reference#team-license) + * A team license is credits provided and consumed by the team. */ -export interface VpnConnection { +export interface TeamLicense { /** - * VPN ID + * when license started * - * @example "123456789012" + * @example "2012-01-01" */ - readonly id: string; + readonly start_date: string; /** - * VPN Name + * when license ended * - * @example "office" + * @example "2012-01-01" */ - name: string; + readonly end_date: string; /** - * Public IP of VPN customer gateway + * quantity of the license * - * @example "35.161.69.30" + * @example 5 */ - public_ip: string; + readonly qty: number; /** - * Routable CIDRs of VPN + * consumed quantity + * + * @example 2 */ - routable_cidrs: string[]; + readonly consumed: number; /** - * CIDR Block of the Private Space + * code of this license change * - * @example "10.0.0.0/16" + * @example "add" */ - readonly space_cidr_block: string; - tunnels: Tunnel[]; + readonly code: string; /** - * IKE Version + * name of this license * - * @example 1 + * @example "HerokuAddOnCredits1" */ - readonly ike_version: number; + readonly name: string; +} +/** + * + * [Heroku Platform API - team-license-collection](https://devcenter.heroku.com/articles/platform-api-reference#team-license-collection) + * A team license collection is credits provided and consumed by the team per period. + */ +export interface TeamLicenseCollection { /** - * Status of the VPN + * year and month the licenses were in effect * - * @example "active" + * @example "2014-01" */ - readonly status: 'pending' | 'provisioning' | 'active' | 'deprovisioning' | 'failed'; + readonly period: string; /** - * Details of the status - * - * @example "supplied CIDR block already in use" + * Licenses for this period. */ - readonly status_message: string; + licenses: TeamLicense[]; } /** * - * Tunnel info + * [Heroku Platform API - telemetry-ingress-info](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-ingress-info) + * Telemetry Ingress Info allows add-on partners to view authorization information required to write to Fir app logs. */ -export interface Tunnel { +export interface TelemetryIngressInfo { /** - * Timestamp of last status changed + * JWT token to be used for authorization * - * @example "2016-10-25T22:09:05Z" + * @example "vJkbPNUFaK4kVIMGQlEmyA.-MAquq_5yQqtae62b8i7aw" */ - last_status_change?: string; + readonly id_token: string; /** - * Public IP address for the tunnel + * the authorization type * - * @example "52.44.146.197" + * @example "Bearer" */ - ip?: string; + readonly token_type: string; /** - * Public IP address for the customer side of the tunnel - * - * @example "52.44.146.197" + * URLs for add-on partners to write to an add-ons logs */ - customer_ip?: string; + readonly transports: string; /** - * Pre-shared key + * when the token will expire * - * @example "secret" + * @example "2025-01-01T12:00:00Z" */ - pre_shared_key?: string; + readonly expires_at: string; +} +/** + * + * [Heroku Platform API - usage](https://devcenter.heroku.com/articles/platform-api-reference#usage) + * Usage for apps. + */ +export interface Usage { /** - * Status of the tunnel + * add-on usage in the app + */ + addons: UsageAddon[]; +} +/** + * + * usage for an add-on + */ +export interface UsageAddon { + /** + * unique identifier of add-on * - * @example "UP" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - status?: 'UP' | 'DOWN'; + readonly id?: string; /** - * Details of the status + * the meters associated with the add-on * - * @example "status message" + * @example {"storage":{"quantity":1000}} */ - status_message?: string; + meters?: Record; } -export interface VpnConnectionCreatePayload { +/** + * + * usage for the apps belonging to the team + */ +export interface Apps { /** - * VPN Name - * - * @example "office" + * apps belonging to the team */ - name: string; + apps?: UsageApp[]; +} +/** + * + * usage for an app belonging to the team + */ +export interface UsageApp { /** - * Public IP of VPN customer gateway + * unique identifier of app * - * @example "35.161.69.30" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - public_ip: string; + readonly id?: string; /** - * Routable CIDRs of VPN + * add-on usage in the app */ - routable_cidrs: string[]; + addons?: UsageAppAddon[]; } -export interface VpnConnectionUpdatePayload { +/** + * + * usage for an add-on + */ +export interface UsageAppAddon { /** - * Routable CIDRs of VPN + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - routable_cidrs: string[]; + readonly id?: string; + /** + * the meters associated with the add-on + * + * @example {"storage":{"quantity":1000}} + */ + meters?: Record; } diff --git a/lib/cjs/services/account-delinquency-service.js b/lib/cjs/services/account-delinquency-service.js index 23aa98f..83bf81a 100644 --- a/lib/cjs/services/account-delinquency-service.js +++ b/lib/cjs/services/account-delinquency-service.js @@ -22,13 +22,20 @@ class AccountDelinquencyService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AccountDelinquencyService; diff --git a/lib/cjs/services/account-feature-service.js b/lib/cjs/services/account-feature-service.js index 3f49745..b58448d 100644 --- a/lib/cjs/services/account-feature-service.js +++ b/lib/cjs/services/account-feature-service.js @@ -23,13 +23,20 @@ class AccountFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing account features. @@ -42,13 +49,20 @@ class AccountFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing account feature. @@ -64,14 +78,21 @@ class AccountFeatureService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AccountFeatureService; diff --git a/lib/cjs/services/account-service.js b/lib/cjs/services/account-service.js index ab78c58..1d95bca 100644 --- a/lib/cjs/services/account-service.js +++ b/lib/cjs/services/account-service.js @@ -22,13 +22,20 @@ class AccountService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update account. @@ -43,14 +50,21 @@ class AccountService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. @@ -63,14 +77,21 @@ class AccountService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for account. @@ -84,13 +105,20 @@ class AccountService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update account. @@ -106,14 +134,21 @@ class AccountService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. @@ -127,14 +162,21 @@ class AccountService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AccountService; diff --git a/lib/cjs/services/add-on-action-service.d.ts b/lib/cjs/services/add-on-action-service.d.ts index d4323d4..ab36d55 100644 --- a/lib/cjs/services/add-on-action-service.d.ts +++ b/lib/cjs/services/add-on-action-service.d.ts @@ -21,4 +21,20 @@ export default class AddOnActionService { * @param requestInit The initializer for the request. */ deprovision(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * Add or update a peering connection to an add-on + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + peer(addOnIdentity: string, payload: Heroku.AddOnActionPeerPayload, requestInit?: Omit): Promise>; + /** + * Remove a peering connection from an add-on + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + unpeer(addOnIdentity: string, payload: Record, requestInit?: Omit): Promise>; } diff --git a/lib/cjs/services/add-on-action-service.js b/lib/cjs/services/add-on-action-service.js index 052bdec..bb88913 100644 --- a/lib/cjs/services/add-on-action-service.js +++ b/lib/cjs/services/add-on-action-service.js @@ -23,14 +23,21 @@ class AddOnActionService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Mark an add-on as deprovisioned. @@ -44,14 +51,81 @@ class AddOnActionService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Add or update a peering connection to an add-on + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async peer(addOnIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/actions/peer`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Remove a peering connection from an add-on + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async unpeer(addOnIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/actions/unpeer`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AddOnActionService; diff --git a/lib/cjs/services/add-on-attachment-service.js b/lib/cjs/services/add-on-attachment-service.js index e57245e..03bad48 100644 --- a/lib/cjs/services/add-on-attachment-service.js +++ b/lib/cjs/services/add-on-attachment-service.js @@ -24,14 +24,21 @@ class AddOnAttachmentService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing add-on attachment. @@ -45,14 +52,21 @@ class AddOnAttachmentService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing add-on attachment. @@ -66,13 +80,20 @@ class AddOnAttachmentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on attachments. @@ -85,13 +106,20 @@ class AddOnAttachmentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on attachments for an add-on. @@ -105,13 +133,20 @@ class AddOnAttachmentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on attachments for an app. @@ -125,13 +160,20 @@ class AddOnAttachmentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing add-on attachment for an app. @@ -146,13 +188,20 @@ class AddOnAttachmentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Resolve an add-on attachment from a name, optionally passing an app name. If there are matches it returns at least one add-on attachment (exact match) or many. @@ -167,14 +216,21 @@ class AddOnAttachmentService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AddOnAttachmentService; diff --git a/lib/cjs/services/add-on-config-service.js b/lib/cjs/services/add-on-config-service.js index 0d608f5..d789aac 100644 --- a/lib/cjs/services/add-on-config-service.js +++ b/lib/cjs/services/add-on-config-service.js @@ -23,13 +23,20 @@ class AddOnConfigService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an add-on's config. Can only be accessed by the add-on partner providing this add-on. @@ -45,14 +52,21 @@ class AddOnConfigService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AddOnConfigService; diff --git a/lib/cjs/services/add-on-region-capability-service.js b/lib/cjs/services/add-on-region-capability-service.js index 5c54ae6..5943906 100644 --- a/lib/cjs/services/add-on-region-capability-service.js +++ b/lib/cjs/services/add-on-region-capability-service.js @@ -22,13 +22,20 @@ class AddOnRegionCapabilityService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on region capabilities for an add-on-service @@ -42,13 +49,20 @@ class AddOnRegionCapabilityService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on region capabilities for a region. @@ -62,13 +76,20 @@ class AddOnRegionCapabilityService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AddOnRegionCapabilityService; diff --git a/lib/cjs/services/add-on-service-service.js b/lib/cjs/services/add-on-service-service.js index c68e8a8..c8f34e5 100644 --- a/lib/cjs/services/add-on-service-service.js +++ b/lib/cjs/services/add-on-service-service.js @@ -23,13 +23,20 @@ class AddOnServiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on-services. @@ -42,13 +49,20 @@ class AddOnServiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AddOnServiceService; diff --git a/lib/cjs/services/add-on-service.js b/lib/cjs/services/add-on-service.js index e996dc7..1c42198 100644 --- a/lib/cjs/services/add-on-service.js +++ b/lib/cjs/services/add-on-service.js @@ -22,13 +22,20 @@ class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an existing add-on. @@ -42,13 +49,20 @@ class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new add-on. @@ -64,14 +78,21 @@ class AddOnService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing add-on. @@ -86,14 +107,21 @@ class AddOnService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an existing add-on. @@ -108,13 +136,20 @@ class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-ons for an app. @@ -128,13 +163,20 @@ class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Change add-on plan. Some add-ons may not support changing plans. In that case, an error will be returned. @@ -151,14 +193,21 @@ class AddOnService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List all existing add-ons a user has access to @@ -172,13 +221,20 @@ class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List add-ons used across all Team apps @@ -192,13 +248,20 @@ class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Resolve an add-on from a name, optionally passing an app name. If there are matches it returns at least one add-on (exact match) or many. @@ -213,14 +276,21 @@ class AddOnService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AddOnService; diff --git a/lib/cjs/services/add-on-sso-service.d.ts b/lib/cjs/services/add-on-sso-service.d.ts new file mode 100644 index 0000000..ac1a5ac --- /dev/null +++ b/lib/cjs/services/add-on-sso-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on SSO](https://devcenter.heroku.com/articles/platform-api-reference#add-on-sso) + * Add-on Single Sign-on generates URL that allows a customer to log in to an Add-on Service's web dashboard. + */ +export default class AddOnSsoService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Generate a timestamp-based single sign-on URL. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + addOnSso(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * Generate a timestamp-based single sign-on URL. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + addOnSsoByApp(appIdentity: string, addOnIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/add-on-sso-service.js b/lib/cjs/services/add-on-sso-service.js new file mode 100644 index 0000000..68e15cf --- /dev/null +++ b/lib/cjs/services/add-on-sso-service.js @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Add-on SSO](https://devcenter.heroku.com/articles/platform-api-reference#add-on-sso) + * Add-on Single Sign-on generates URL that allows a customer to log in to an Add-on Service's web dashboard. + */ +class AddOnSsoService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Generate a timestamp-based single sign-on URL. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async addOnSso(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/sso`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Generate a timestamp-based single sign-on URL. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async addOnSsoByApp(appIdentity, addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons/${addOnIdentity}/sso`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = AddOnSsoService; diff --git a/lib/cjs/services/add-on-webhook-delivery-service.js b/lib/cjs/services/add-on-webhook-delivery-service.js index 3733c00..58c3621 100644 --- a/lib/cjs/services/add-on-webhook-delivery-service.js +++ b/lib/cjs/services/add-on-webhook-delivery-service.js @@ -24,13 +24,20 @@ class AddOnWebhookDeliveryService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Lists existing deliveries for an add-on. Can only be accessed by the add-on partner providing this add-on. @@ -44,13 +51,20 @@ class AddOnWebhookDeliveryService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AddOnWebhookDeliveryService; diff --git a/lib/cjs/services/add-on-webhook-event-service.js b/lib/cjs/services/add-on-webhook-event-service.js index d5cee3a..0aac517 100644 --- a/lib/cjs/services/add-on-webhook-event-service.js +++ b/lib/cjs/services/add-on-webhook-event-service.js @@ -24,13 +24,20 @@ class AddOnWebhookEventService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Lists existing webhook events for an add-on. Can only be accessed by the add-on partner providing this add-on. @@ -44,13 +51,20 @@ class AddOnWebhookEventService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AddOnWebhookEventService; diff --git a/lib/cjs/services/add-on-webhook-service.js b/lib/cjs/services/add-on-webhook-service.js index 0cb60a1..bf2e439 100644 --- a/lib/cjs/services/add-on-webhook-service.js +++ b/lib/cjs/services/add-on-webhook-service.js @@ -25,14 +25,21 @@ class AddOnWebhookService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Removes an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. @@ -47,14 +54,21 @@ class AddOnWebhookService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Returns the info for an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. @@ -69,13 +83,20 @@ class AddOnWebhookService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List all webhook subscriptions for a particular add-on. Can only be accessed by the add-on partner providing this add-on. @@ -89,13 +110,20 @@ class AddOnWebhookService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Updates the details of an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. @@ -112,14 +140,21 @@ class AddOnWebhookService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AddOnWebhookService; diff --git a/lib/cjs/services/allowed-add-on-service-service.js b/lib/cjs/services/allowed-add-on-service-service.js index f4d851c..d59cf3a 100644 --- a/lib/cjs/services/allowed-add-on-service-service.js +++ b/lib/cjs/services/allowed-add-on-service-service.js @@ -23,13 +23,20 @@ class AllowedAddOnServiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Allow an Add-on Service @@ -45,14 +52,21 @@ class AllowedAddOnServiceService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Remove an allowed add-on service @@ -67,14 +81,21 @@ class AllowedAddOnServiceService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AllowedAddOnServiceService; diff --git a/lib/cjs/services/app-feature-service.js b/lib/cjs/services/app-feature-service.js index 350c467..5c99009 100644 --- a/lib/cjs/services/app-feature-service.js +++ b/lib/cjs/services/app-feature-service.js @@ -24,13 +24,20 @@ class AppFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing app features. @@ -44,13 +51,20 @@ class AppFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing app feature. @@ -67,14 +81,21 @@ class AppFeatureService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AppFeatureService; diff --git a/lib/cjs/services/app-service.js b/lib/cjs/services/app-service.js index 6cbe682..f65f76f 100644 --- a/lib/cjs/services/app-service.js +++ b/lib/cjs/services/app-service.js @@ -24,14 +24,21 @@ class AppService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing app. @@ -45,14 +52,21 @@ class AppService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing app. @@ -66,13 +80,20 @@ class AppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing apps. @@ -85,13 +106,20 @@ class AppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List owned and collaborated apps (excludes team apps). @@ -105,13 +133,20 @@ class AppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing app. @@ -127,14 +162,21 @@ class AppService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Enable ACM flag for an app @@ -148,14 +190,21 @@ class AppService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Disable ACM flag for an app @@ -169,14 +218,21 @@ class AppService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Refresh ACM for an app @@ -190,14 +246,21 @@ class AppService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AppService; diff --git a/lib/cjs/services/app-setup-service.js b/lib/cjs/services/app-setup-service.js index 5d3443d..5fddba0 100644 --- a/lib/cjs/services/app-setup-service.js +++ b/lib/cjs/services/app-setup-service.js @@ -24,14 +24,21 @@ class AppSetupService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Get the status of an app setup. @@ -45,13 +52,20 @@ class AppSetupService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AppSetupService; diff --git a/lib/cjs/services/app-transfer-service.js b/lib/cjs/services/app-transfer-service.js index e81cd3d..1077c66 100644 --- a/lib/cjs/services/app-transfer-service.js +++ b/lib/cjs/services/app-transfer-service.js @@ -24,14 +24,21 @@ class AppTransferService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing app transfer @@ -45,14 +52,21 @@ class AppTransferService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing app transfer. @@ -66,13 +80,20 @@ class AppTransferService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing apps transfers. @@ -85,13 +106,20 @@ class AppTransferService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing app transfer. @@ -107,14 +135,21 @@ class AppTransferService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AppTransferService; diff --git a/lib/cjs/services/app-webhook-delivery-service.js b/lib/cjs/services/app-webhook-delivery-service.js index 46f9557..e406987 100644 --- a/lib/cjs/services/app-webhook-delivery-service.js +++ b/lib/cjs/services/app-webhook-delivery-service.js @@ -24,13 +24,20 @@ class AppWebhookDeliveryService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Lists existing deliveries for an app. @@ -44,13 +51,20 @@ class AppWebhookDeliveryService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AppWebhookDeliveryService; diff --git a/lib/cjs/services/app-webhook-event-service.js b/lib/cjs/services/app-webhook-event-service.js index 3f11bd2..5ebbf01 100644 --- a/lib/cjs/services/app-webhook-event-service.js +++ b/lib/cjs/services/app-webhook-event-service.js @@ -24,13 +24,20 @@ class AppWebhookEventService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Lists existing webhook events for an app. @@ -44,13 +51,20 @@ class AppWebhookEventService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AppWebhookEventService; diff --git a/lib/cjs/services/app-webhook-service.js b/lib/cjs/services/app-webhook-service.js index 3961d1c..28cd7ee 100644 --- a/lib/cjs/services/app-webhook-service.js +++ b/lib/cjs/services/app-webhook-service.js @@ -25,14 +25,21 @@ class AppWebhookService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Removes an app webhook subscription. @@ -47,14 +54,21 @@ class AppWebhookService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Returns the info for an app webhook subscription. @@ -69,13 +83,20 @@ class AppWebhookService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List all webhook subscriptions for a particular app. @@ -89,13 +110,20 @@ class AppWebhookService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Updates the details of an app webhook subscription. @@ -112,14 +140,21 @@ class AppWebhookService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = AppWebhookService; diff --git a/lib/cjs/services/archive-service.js b/lib/cjs/services/archive-service.js index 99d1fc4..7b8b322 100644 --- a/lib/cjs/services/archive-service.js +++ b/lib/cjs/services/archive-service.js @@ -27,7 +27,7 @@ class ArchiveService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } @@ -43,7 +43,7 @@ class ArchiveService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } diff --git a/lib/cjs/services/audit-trail-event-service.js b/lib/cjs/services/audit-trail-event-service.js index 9e0f0b0..efc4582 100644 --- a/lib/cjs/services/audit-trail-event-service.js +++ b/lib/cjs/services/audit-trail-event-service.js @@ -23,7 +23,7 @@ class AuditTrailEventService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } diff --git a/lib/cjs/services/build-metadata-service.d.ts b/lib/cjs/services/build-metadata-service.d.ts new file mode 100644 index 0000000..0d24d44 --- /dev/null +++ b/lib/cjs/services/build-metadata-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Build Metadata](https://devcenter.heroku.com/articles/platform-api-reference#build-metadata) + * Build metadata contains the reference data for building the associated App. + */ +export default class BuildMetadataService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Build metadata for app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/build-metadata-service.js b/lib/cjs/services/build-metadata-service.js new file mode 100644 index 0000000..7f767b6 --- /dev/null +++ b/lib/cjs/services/build-metadata-service.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Build Metadata](https://devcenter.heroku.com/articles/platform-api-reference#build-metadata) + * Build metadata contains the reference data for building the associated App. + */ +class BuildMetadataService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Build metadata for app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/build-metadata`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = BuildMetadataService; diff --git a/lib/cjs/services/build-service.d.ts b/lib/cjs/services/build-service.d.ts index cba4137..6f9628a 100644 --- a/lib/cjs/services/build-service.d.ts +++ b/lib/cjs/services/build-service.d.ts @@ -1,7 +1,7 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Build API - Build](https://devcenter.heroku.com/articles/platform-api-reference#build) - * A build represents the process of transforming a code tarball into a slug + * A build represents the process of transforming a code tarball into build artifacts */ export default class BuildService { protected readonly fetchImpl: typeof fetch; diff --git a/lib/cjs/services/build-service.js b/lib/cjs/services/build-service.js index d1a6c8a..ce98377 100644 --- a/lib/cjs/services/build-service.js +++ b/lib/cjs/services/build-service.js @@ -2,7 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); /** * [Heroku Build API - Build](https://devcenter.heroku.com/articles/platform-api-reference#build) - * A build represents the process of transforming a code tarball into a slug + * A build represents the process of transforming a code tarball into build artifacts */ class BuildService { fetchImpl; @@ -25,14 +25,21 @@ class BuildService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing build. @@ -47,13 +54,20 @@ class BuildService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing build. @@ -67,13 +81,20 @@ class BuildService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Destroy a build cache. @@ -87,7 +108,7 @@ class BuildService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); @@ -105,14 +126,21 @@ class BuildService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = BuildService; diff --git a/lib/cjs/services/buildpack-installation-service.js b/lib/cjs/services/buildpack-installation-service.js index c67ca67..506b5f0 100644 --- a/lib/cjs/services/buildpack-installation-service.js +++ b/lib/cjs/services/buildpack-installation-service.js @@ -25,14 +25,21 @@ class BuildpackInstallationService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List an app's existing buildpack installations. @@ -46,13 +53,20 @@ class BuildpackInstallationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = BuildpackInstallationService; diff --git a/lib/cjs/services/capability-service.d.ts b/lib/cjs/services/capability-service.d.ts new file mode 100644 index 0000000..616fb45 --- /dev/null +++ b/lib/cjs/services/capability-service.d.ts @@ -0,0 +1,20 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Capability](https://devcenter.heroku.com/articles/platform-api-reference#capability) + * A capability represents a requested capability on a resource along with whether the requesting user has that capability + */ +export default class CapabilityService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Request to check a list of capabilities the current user (yourself). An capability is a tuple of + * (capability, resource_id, resource_type). The endpoint will then respond with a `capable` boolean + * true or false for each requested capability. This boolean indicates whether the authenticated user + * has the requested capability on the resource. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + capabilities(payload: Heroku.CapabilityCapabilitiesPayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/capability-service.js b/lib/cjs/services/capability-service.js new file mode 100644 index 0000000..f7f91b6 --- /dev/null +++ b/lib/cjs/services/capability-service.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Capability](https://devcenter.heroku.com/articles/platform-api-reference#capability) + * A capability represents a requested capability on a resource along with whether the requesting user has that capability + */ +class CapabilityService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Request to check a list of capabilities the current user (yourself). An capability is a tuple of + * (capability, resource_id, resource_type). The endpoint will then respond with a `capable` boolean + * true or false for each requested capability. This boolean indicates whether the authenticated user + * has the requested capability on the resource. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async capabilities(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/~/capabilities`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = CapabilityService; diff --git a/lib/cjs/services/collaborator-service.js b/lib/cjs/services/collaborator-service.js index bc3e855..a397778 100644 --- a/lib/cjs/services/collaborator-service.js +++ b/lib/cjs/services/collaborator-service.js @@ -25,14 +25,21 @@ class CollaboratorService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing collaborator. @@ -47,14 +54,21 @@ class CollaboratorService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing collaborator. @@ -69,13 +83,20 @@ class CollaboratorService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing collaborators. @@ -89,13 +110,20 @@ class CollaboratorService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = CollaboratorService; diff --git a/lib/cjs/services/config-var-service.js b/lib/cjs/services/config-var-service.js index 19fe915..436ab8d 100644 --- a/lib/cjs/services/config-var-service.js +++ b/lib/cjs/services/config-var-service.js @@ -23,13 +23,20 @@ class ConfigVarService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Get config-vars for a release. @@ -44,13 +51,20 @@ class ConfigVarService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update config-vars for app. You can update existing config-vars by setting them again, and remove by setting it to `null`. @@ -66,14 +80,21 @@ class ConfigVarService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = ConfigVarService; diff --git a/lib/cjs/services/config-vars-settings-service.d.ts b/lib/cjs/services/config-vars-settings-service.d.ts new file mode 100644 index 0000000..8d8c445 --- /dev/null +++ b/lib/cjs/services/config-vars-settings-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Config Vars Settings](https://devcenter.heroku.com/articles/platform-api-reference#config-vars-settings) + * The Config Vars Settings endpoints enable you to view and manage the configuration provided to an app on Heroku. These endpoints are similar to /config-vars but also allow you to check which config vars you can mask, and which are currently masked. + */ +export default class ConfigVarsSettingsService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Get additional info for an app's config vars, including which config vars you can mask, and which are currently masked. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; + /** + * Update a config var. You can update an existing config var's value by setting it again, and you can remove it by setting it to `null`. You can't unmask a masked config var. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, payload: Heroku.ConfigVarsSettingsUpdatePayload, requestInit?: Omit): Promise>; +} diff --git a/lib/cjs/services/config-vars-settings-service.js b/lib/cjs/services/config-vars-settings-service.js new file mode 100644 index 0000000..6cae74b --- /dev/null +++ b/lib/cjs/services/config-vars-settings-service.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Config Vars Settings](https://devcenter.heroku.com/articles/platform-api-reference#config-vars-settings) + * The Config Vars Settings endpoints enable you to view and manage the configuration provided to an app on Heroku. These endpoints are similar to /config-vars but also allow you to check which config vars you can mask, and which are currently masked. + */ +class ConfigVarsSettingsService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Get additional info for an app's config vars, including which config vars you can mask, and which are currently masked. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/config-vars-settings`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Update a config var. You can update an existing config var's value by setting it again, and you can remove it by setting it to `null`. You can't unmask a masked config var. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/config-vars-settings`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = ConfigVarsSettingsService; diff --git a/lib/cjs/services/credit-service.js b/lib/cjs/services/credit-service.js index d2bc4a9..fd7305c 100644 --- a/lib/cjs/services/credit-service.js +++ b/lib/cjs/services/credit-service.js @@ -24,14 +24,21 @@ class CreditService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing credit. @@ -45,13 +52,20 @@ class CreditService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing credits. @@ -64,13 +78,20 @@ class CreditService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = CreditService; diff --git a/lib/cjs/services/domain-service.js b/lib/cjs/services/domain-service.js index 2f8a111..1d5db3e 100644 --- a/lib/cjs/services/domain-service.js +++ b/lib/cjs/services/domain-service.js @@ -25,14 +25,21 @@ class DomainService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Associate an SNI endpoint @@ -49,14 +56,21 @@ class DomainService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing domain @@ -71,14 +85,21 @@ class DomainService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing domain. @@ -93,13 +114,20 @@ class DomainService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing domains. @@ -113,13 +141,20 @@ class DomainService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = DomainService; diff --git a/lib/cjs/services/dyno-processes-service.d.ts b/lib/cjs/services/dyno-processes-service.d.ts new file mode 100644 index 0000000..ff054a5 --- /dev/null +++ b/lib/cjs/services/dyno-processes-service.d.ts @@ -0,0 +1,19 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Processes Inside Dynos](https://devcenter.heroku.com/articles/platform-api-reference#dyno-processes) + * Run processes inside existing dynos. + */ +export default class DynoProcessesService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new process in an existing dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, dynoIdentity: string, payload: Heroku.DynoProcessesCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/dyno-processes-service.js b/lib/cjs/services/dyno-processes-service.js new file mode 100644 index 0000000..771ef60 --- /dev/null +++ b/lib/cjs/services/dyno-processes-service.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Processes Inside Dynos](https://devcenter.heroku.com/articles/platform-api-reference#dyno-processes) + * Run processes inside existing dynos. + */ +class DynoProcessesService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new process in an existing dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, dynoIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos/${dynoIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = DynoProcessesService; diff --git a/lib/cjs/services/dyno-service.d.ts b/lib/cjs/services/dyno-service.d.ts index c19baa0..fcaec9d 100644 --- a/lib/cjs/services/dyno-service.d.ts +++ b/lib/cjs/services/dyno-service.d.ts @@ -23,6 +23,15 @@ export default class DynoService { * @param requestInit The initializer for the request. */ restart(appIdentity: string, dynoIdentity: string, requestInit?: Omit): Promise>; + /** + * Restart dynos of a given formation type. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoFormationType the formation type of this process on this dyno + * @example "run". + * @param requestInit The initializer for the request. + */ + restartFormation(appIdentity: string, dynoFormationType: string, requestInit?: Omit): Promise>; /** * Restart all dynos. * @@ -38,6 +47,15 @@ export default class DynoService { * @param requestInit The initializer for the request. */ stop(appIdentity: string, dynoIdentity: string, requestInit?: Omit): Promise>; + /** + * Stop dynos of a given formation type. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoFormationType the formation type of this process on this dyno + * @example "run". + * @param requestInit The initializer for the request. + */ + stopFormation(appIdentity: string, dynoFormationType: string, requestInit?: Omit): Promise>; /** * Info for existing dyno. * diff --git a/lib/cjs/services/dyno-service.js b/lib/cjs/services/dyno-service.js index 07a4680..501e3de 100644 --- a/lib/cjs/services/dyno-service.js +++ b/lib/cjs/services/dyno-service.js @@ -25,14 +25,21 @@ class DynoService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Restart dyno. @@ -47,14 +54,51 @@ class DynoService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Restart dynos of a given formation type. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoFormationType the formation type of this process on this dyno + * @example "run". + * @param requestInit The initializer for the request. + */ + async restartFormation(appIdentity, dynoFormationType, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formations/${dynoFormationType}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Restart all dynos. @@ -68,14 +112,21 @@ class DynoService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Stop dyno. @@ -90,14 +141,51 @@ class DynoService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Stop dynos of a given formation type. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoFormationType the formation type of this process on this dyno + * @example "run". + * @param requestInit The initializer for the request. + */ + async stopFormation(appIdentity, dynoFormationType, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formations/${dynoFormationType}/actions/stop`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing dyno. @@ -112,13 +200,20 @@ class DynoService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing dynos. @@ -132,13 +227,20 @@ class DynoService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = DynoService; diff --git a/lib/cjs/services/dyno-size-service.d.ts b/lib/cjs/services/dyno-size-service.d.ts index aa9490c..2d7a7ca 100644 --- a/lib/cjs/services/dyno-size-service.d.ts +++ b/lib/cjs/services/dyno-size-service.d.ts @@ -10,7 +10,7 @@ export default class DynoSizeService { /** * Info for existing dyno size. * - * @param dynoSizeIdentity unique identifier of this dyno size or the name of this dyno-size. + * @param dynoSizeIdentity unique identifier of the dyno size or name of the dyno size. * @param requestInit The initializer for the request. */ info(dynoSizeIdentity: string, requestInit?: Omit): Promise; @@ -20,4 +20,11 @@ export default class DynoSizeService { * @param requestInit The initializer for the request. */ list(requestInit?: Omit): Promise; + /** + * List available dyno sizes for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + listAppDynoSizes(appIdentity: string, requestInit?: Omit): Promise>; } diff --git a/lib/cjs/services/dyno-size-service.js b/lib/cjs/services/dyno-size-service.js index c2fa21d..7db2e33 100644 --- a/lib/cjs/services/dyno-size-service.js +++ b/lib/cjs/services/dyno-size-service.js @@ -14,7 +14,7 @@ class DynoSizeService { /** * Info for existing dyno size. * - * @param dynoSizeIdentity unique identifier of this dyno size or the name of this dyno-size. + * @param dynoSizeIdentity unique identifier of the dyno size or name of the dyno size. * @param requestInit The initializer for the request. */ async info(dynoSizeIdentity, requestInit = {}) { @@ -23,13 +23,20 @@ class DynoSizeService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing dyno sizes. @@ -42,13 +49,47 @@ class DynoSizeService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List available dyno sizes for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async listAppDynoSizes(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/available-dyno-sizes`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = DynoSizeService; diff --git a/lib/cjs/services/enterprise-account-daily-usage-service.js b/lib/cjs/services/enterprise-account-daily-usage-service.js index 079f0e8..d7f6833 100644 --- a/lib/cjs/services/enterprise-account-daily-usage-service.js +++ b/lib/cjs/services/enterprise-account-daily-usage-service.js @@ -26,13 +26,20 @@ class EnterpriseAccountDailyUsageService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = EnterpriseAccountDailyUsageService; diff --git a/lib/cjs/services/enterprise-account-member-service.js b/lib/cjs/services/enterprise-account-member-service.js index 33af5aa..8157108 100644 --- a/lib/cjs/services/enterprise-account-member-service.js +++ b/lib/cjs/services/enterprise-account-member-service.js @@ -23,13 +23,20 @@ class EnterpriseAccountMemberService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a member in an enterprise account. @@ -45,14 +52,21 @@ class EnterpriseAccountMemberService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update a member in an enterprise account. @@ -69,14 +83,21 @@ class EnterpriseAccountMemberService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * delete a member in an enterprise account. @@ -91,14 +112,21 @@ class EnterpriseAccountMemberService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = EnterpriseAccountMemberService; diff --git a/lib/cjs/services/enterprise-account-monthly-usage-service.js b/lib/cjs/services/enterprise-account-monthly-usage-service.js index 69ae43c..90930dd 100644 --- a/lib/cjs/services/enterprise-account-monthly-usage-service.js +++ b/lib/cjs/services/enterprise-account-monthly-usage-service.js @@ -26,13 +26,20 @@ class EnterpriseAccountMonthlyUsageService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = EnterpriseAccountMonthlyUsageService; diff --git a/lib/cjs/services/enterprise-account-service.js b/lib/cjs/services/enterprise-account-service.js index 4b514b5..7963f4d 100644 --- a/lib/cjs/services/enterprise-account-service.js +++ b/lib/cjs/services/enterprise-account-service.js @@ -22,13 +22,20 @@ class EnterpriseAccountService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Information about an enterprise account. @@ -42,13 +49,20 @@ class EnterpriseAccountService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update enterprise account properties @@ -64,14 +78,21 @@ class EnterpriseAccountService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = EnterpriseAccountService; diff --git a/lib/cjs/services/filter-apps-service.js b/lib/cjs/services/filter-apps-service.js index 58e7694..bf4623d 100644 --- a/lib/cjs/services/filter-apps-service.js +++ b/lib/cjs/services/filter-apps-service.js @@ -24,14 +24,21 @@ class FilterAppsService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = FilterAppsService; diff --git a/lib/cjs/services/formation-service.js b/lib/cjs/services/formation-service.js index 739f702..f36770c 100644 --- a/lib/cjs/services/formation-service.js +++ b/lib/cjs/services/formation-service.js @@ -24,13 +24,20 @@ class FormationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List process type formation @@ -44,13 +51,20 @@ class FormationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Batch update process types @@ -66,14 +80,21 @@ class FormationService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update process type @@ -90,14 +111,21 @@ class FormationService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = FormationService; diff --git a/lib/cjs/services/gateway-token-service.d.ts b/lib/cjs/services/gateway-token-service.d.ts new file mode 100644 index 0000000..ad58e2e --- /dev/null +++ b/lib/cjs/services/gateway-token-service.d.ts @@ -0,0 +1,26 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Gateway Token](https://devcenter.heroku.com/articles/platform-api-reference#gateway-token) + * Contains a set of information useful for identifying a user and the type of access this user is allowed to have. + */ +export default class GatewayTokenService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Generate a gateway token for a user. Note that a JWT version of the + * token will be available in `Heroku-Gateway-Token` header. + * + * @param requestInit The initializer for the request. + */ + create(requestInit?: Omit): Promise; + /** + * Generates a Proxy oauth acccess tokens for the passed in gateway token. + * This new proxy token is designed to have a shorter lifetime than the + * user supplied token so it is safe to pass to futher downstream services + * without increasing the breadth of the long lived tokens. + * + * @param requestInit The initializer for the request. + */ + oauthToken(requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/gateway-token-service.js b/lib/cjs/services/gateway-token-service.js new file mode 100644 index 0000000..e557a9d --- /dev/null +++ b/lib/cjs/services/gateway-token-service.js @@ -0,0 +1,73 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Gateway Token](https://devcenter.heroku.com/articles/platform-api-reference#gateway-token) + * Contains a set of information useful for identifying a user and the type of access this user is allowed to have. + */ +class GatewayTokenService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Generate a gateway token for a user. Note that a JWT version of the + * token will be available in `Heroku-Gateway-Token` header. + * + * @param requestInit The initializer for the request. + */ + async create(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/~/gateway-tokens`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Generates a Proxy oauth acccess tokens for the passed in gateway token. + * This new proxy token is designed to have a shorter lifetime than the + * user supplied token so it is safe to pass to futher downstream services + * without increasing the breadth of the long lived tokens. + * + * @param requestInit The initializer for the request. + */ + async oauthToken(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/~/gateway-tokens/oauth-authorization`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = GatewayTokenService; diff --git a/lib/cjs/services/generation-service.d.ts b/lib/cjs/services/generation-service.d.ts new file mode 100644 index 0000000..451c3a5 --- /dev/null +++ b/lib/cjs/services/generation-service.d.ts @@ -0,0 +1,30 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Generation](https://devcenter.heroku.com/articles/platform-api-reference#generation) + * A generation represents a version of the Heroku platform that includes the app execution environment, routing, telemetry, and build systems. + */ +export default class GenerationService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for generation. + * + * @param stackIdentity unique name of stack or unique identifier of stack. + * @param requestInit The initializer for the request. + */ + info(stackIdentity: string, requestInit?: Omit): Promise; + /** + * List available generations. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * List available generations for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + listGenerations(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/generation-service.js b/lib/cjs/services/generation-service.js new file mode 100644 index 0000000..f43ffcd --- /dev/null +++ b/lib/cjs/services/generation-service.js @@ -0,0 +1,95 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Generation](https://devcenter.heroku.com/articles/platform-api-reference#generation) + * A generation represents a version of the Heroku platform that includes the app execution environment, routing, telemetry, and build systems. + */ +class GenerationService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for generation. + * + * @param stackIdentity unique name of stack or unique identifier of stack. + * @param requestInit The initializer for the request. + */ + async info(stackIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/generations/${stackIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List available generations. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/generations`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List available generations for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async listGenerations(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/available-generations`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = GenerationService; diff --git a/lib/cjs/services/identity-provider-actions-service.d.ts b/lib/cjs/services/identity-provider-actions-service.d.ts new file mode 100644 index 0000000..9d06b9f --- /dev/null +++ b/lib/cjs/services/identity-provider-actions-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Identity Provider Actions](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-actions) + * Actions taken on Identity Providers, the SSO configuration representation. + */ +export default class IdentityProviderActionsService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Migrate an Identity Provider + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param requestInit The initializer for the request. + */ + update(identityProviderIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/identity-provider-actions-service.js b/lib/cjs/services/identity-provider-actions-service.js new file mode 100644 index 0000000..a2f8463 --- /dev/null +++ b/lib/cjs/services/identity-provider-actions-service.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Identity Provider Actions](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-actions) + * Actions taken on Identity Providers, the SSO configuration representation. + */ +class IdentityProviderActionsService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Migrate an Identity Provider + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param requestInit The initializer for the request. + */ + async update(identityProviderIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}/migrate`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = IdentityProviderActionsService; diff --git a/lib/cjs/services/identity-provider-certificate-service.d.ts b/lib/cjs/services/identity-provider-certificate-service.d.ts new file mode 100644 index 0000000..bfd9103 --- /dev/null +++ b/lib/cjs/services/identity-provider-certificate-service.d.ts @@ -0,0 +1,43 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Certificates](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-certificate) + * Certificates represent an sso cert attached to an Identity Provider + */ +export default class IdentityProviderCertificateService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Destroy a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param identityProviderIdentity1 unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param requestInit The initializer for the request. + */ + delete(identityProviderIdentity: string, identityProviderIdentity1: string, requestInit?: Omit): Promise; + /** + * Create a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(identityProviderIdentity: string, payload: Heroku.IdentityProviderCertificateCreatePayload, requestInit?: Omit): Promise; + /** + * Update a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param identityProviderIdentity1 unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(identityProviderIdentity: string, identityProviderIdentity1: string, payload: Heroku.IdentityProviderCertificateUpdatePayload, requestInit?: Omit): Promise; + /** + * Get a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param identityProviderIdentity1 unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param requestInit The initializer for the request. + */ + info(identityProviderIdentity: string, identityProviderIdentity1: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/identity-provider-certificate-service.js b/lib/cjs/services/identity-provider-certificate-service.js new file mode 100644 index 0000000..718ec34 --- /dev/null +++ b/lib/cjs/services/identity-provider-certificate-service.js @@ -0,0 +1,134 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Certificates](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-certificate) + * Certificates represent an sso cert attached to an Identity Provider + */ +class IdentityProviderCertificateService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Destroy a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param identityProviderIdentity1 unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param requestInit The initializer for the request. + */ + async delete(identityProviderIdentity, identityProviderIdentity1, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}/certificates/${identityProviderIdentity1}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Create a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(identityProviderIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}/certificates`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Update a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param identityProviderIdentity1 unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(identityProviderIdentity, identityProviderIdentity1, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}/certificates/${identityProviderIdentity1}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Get a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param identityProviderIdentity1 unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param requestInit The initializer for the request. + */ + async info(identityProviderIdentity, identityProviderIdentity1, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}/certificates/${identityProviderIdentity1}`, { + ...requestInit, + method: 'Get', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = IdentityProviderCertificateService; diff --git a/lib/cjs/services/identity-provider-service.d.ts b/lib/cjs/services/identity-provider-service.d.ts index 144c4d4..cd1d804 100644 --- a/lib/cjs/services/identity-provider-service.d.ts +++ b/lib/cjs/services/identity-provider-service.d.ts @@ -1,48 +1,32 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Platform API - Identity Provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) - * Identity Providers represent the SAML configuration of teams or an Enterprise account + * Identity Providers represent the SSO configuration of an Enterprise Account or Team. */ export default class IdentityProviderService { protected readonly fetchImpl: typeof fetch; protected readonly endpoint: string; constructor(fetchImpl: typeof fetch, endpoint: string); /** - * Get a list of a team's Identity Providers + * Info for an Identity Provider * - * @param teamName unique name of team - * @example "example". + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. * @param requestInit The initializer for the request. */ - listByTeam(teamName: string, requestInit?: Omit): Promise; + info(identityProviderIdentity: string, requestInit?: Omit): Promise; /** - * Create an Identity Provider for a team + * Create an Identity Provider * - * @param teamName unique name of team - * @example "example". * @param payload Object to send to the endpoint. * @param requestInit The initializer for the request. */ - createByTeam(teamName: string, payload: Heroku.IdentityProviderCreateByTeamPayload, requestInit?: Omit): Promise; + create(payload: Heroku.IdentityProviderCreatePayload, requestInit?: Omit): Promise; /** - * Update a team's Identity Provider + * Update an Identity Provider * - * @param teamName unique name of team - * @example "example". - * @param identityProviderId unique identifier of this identity provider - * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. * @param payload Object to send to the endpoint. * @param requestInit The initializer for the request. */ - updateByTeam(teamName: string, identityProviderId: string, payload: Heroku.IdentityProviderUpdateByTeamPayload, requestInit?: Omit): Promise; - /** - * Delete a team's Identity Provider - * - * @param teamName unique name of team - * @example "example". - * @param identityProviderId unique identifier of this identity provider - * @example "01234567-89ab-cdef-0123-456789abcdef". - * @param requestInit The initializer for the request. - */ - deleteByTeam(teamName: string, identityProviderId: string, requestInit?: Omit): Promise; + update(identityProviderIdentity: string, payload: Heroku.IdentityProviderUpdatePayload, requestInit?: Omit): Promise; } diff --git a/lib/cjs/services/identity-provider-service.js b/lib/cjs/services/identity-provider-service.js index 8a29f0d..8e11d10 100644 --- a/lib/cjs/services/identity-provider-service.js +++ b/lib/cjs/services/identity-provider-service.js @@ -2,7 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); /** * [Heroku Platform API - Identity Provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) - * Identity Providers represent the SAML configuration of teams or an Enterprise account + * Identity Providers represent the SSO configuration of an Enterprise Account or Team. */ class IdentityProviderService { fetchImpl; @@ -12,99 +12,90 @@ class IdentityProviderService { this.endpoint = endpoint; } /** - * Get a list of a team's Identity Providers + * Info for an Identity Provider * - * @param teamName unique name of team - * @example "example". + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. * @param requestInit The initializer for the request. */ - async listByTeam(teamName, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers`, { + async info(identityProviderIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}`, { ...requestInit, method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** - * Create an Identity Provider for a team + * Create an Identity Provider * - * @param teamName unique name of team - * @example "example". * @param payload Object to send to the endpoint. * @param requestInit The initializer for the request. */ - async createByTeam(teamName, payload, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers`, { + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers`, { ...requestInit, body: JSON.stringify(payload, null, 2), method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** - * Update a team's Identity Provider + * Update an Identity Provider * - * @param teamName unique name of team - * @example "example". - * @param identityProviderId unique identifier of this identity provider - * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. * @param payload Object to send to the endpoint. * @param requestInit The initializer for the request. */ - async updateByTeam(teamName, identityProviderId, payload, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers/${identityProviderId}`, { + async update(identityProviderIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}`, { ...requestInit, body: JSON.stringify(payload, null, 2), method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); - } - /** - * Delete a team's Identity Provider - * - * @param teamName unique name of team - * @example "example". - * @param identityProviderId unique identifier of this identity provider - * @example "01234567-89ab-cdef-0123-456789abcdef". - * @param requestInit The initializer for the request. - */ - async deleteByTeam(teamName, identityProviderId, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers/${identityProviderId}`, { - ...requestInit, - method: 'DELETE', - headers: { - ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', - 'Content-Type': 'application/json' - } - }); - if (response.ok) { - return (await response.json()); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op } - throw new Error(response.statusText); + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = IdentityProviderService; diff --git a/lib/cjs/services/inbound-ruleset-service.js b/lib/cjs/services/inbound-ruleset-service.js index 892e23f..f6b85c1 100644 --- a/lib/cjs/services/inbound-ruleset-service.js +++ b/lib/cjs/services/inbound-ruleset-service.js @@ -23,13 +23,20 @@ class InboundRulesetService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info on an existing Inbound Ruleset @@ -44,13 +51,20 @@ class InboundRulesetService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List all inbound rulesets for a space @@ -64,13 +78,20 @@ class InboundRulesetService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new inbound ruleset @@ -86,14 +107,21 @@ class InboundRulesetService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = InboundRulesetService; diff --git a/lib/cjs/services/index.d.ts b/lib/cjs/services/index.d.ts index 7fce78f..f1652de 100644 --- a/lib/cjs/services/index.d.ts +++ b/lib/cjs/services/index.d.ts @@ -34,6 +34,7 @@ export * from './enterprise-account-monthly-usage-service'; export * from './enterprise-account-service'; export * from './filter-apps-service'; export * from './formation-service'; +export * from './generation-service'; export * from './identity-provider-service'; export * from './inbound-ruleset-service'; export * from './invoice-address-service'; @@ -45,8 +46,8 @@ export * from './oauth-authorization-service'; export * from './oauth-client-service'; export * from './oauth-grant-service'; export * from './oauth-token-service'; +export * from './oci-image-service'; export * from './password-reset-service'; -export * from './peering-info-service'; export * from './peering-service'; export * from './permission-entity-service'; export * from './pipeline-build-service'; @@ -89,8 +90,25 @@ export * from './team-monthly-usage-service'; export * from './team-preferences-service'; export * from './team-space-service'; export * from './team-service'; +export * from './telemetry-drain-service'; export * from './test-case-service'; export * from './test-node-service'; export * from './test-run-service'; export * from './user-preferences-service'; export * from './vpn-connection-service'; +export * from './add-on-sso-service'; +export * from './build-metadata-service'; +export * from './capability-service'; +export * from './config-vars-settings-service'; +export * from './dyno-processes-service'; +export * from './gateway-token-service'; +export * from './identity-provider-actions-service'; +export * from './identity-provider-certificate-service'; +export * from './payment-method-service'; +export * from './payment-service'; +export * from './space-host-service'; +export * from './space-log-drain-service'; +export * from './team-license-service'; +export * from './team-license-collection-service'; +export * from './telemetry-ingress-info-service'; +export * from './usage-service'; diff --git a/lib/cjs/services/index.js b/lib/cjs/services/index.js index c94ec47..cc2d48c 100644 --- a/lib/cjs/services/index.js +++ b/lib/cjs/services/index.js @@ -37,6 +37,7 @@ tslib_1.__exportStar(require("./enterprise-account-monthly-usage-service"), expo tslib_1.__exportStar(require("./enterprise-account-service"), exports); tslib_1.__exportStar(require("./filter-apps-service"), exports); tslib_1.__exportStar(require("./formation-service"), exports); +tslib_1.__exportStar(require("./generation-service"), exports); tslib_1.__exportStar(require("./identity-provider-service"), exports); tslib_1.__exportStar(require("./inbound-ruleset-service"), exports); tslib_1.__exportStar(require("./invoice-address-service"), exports); @@ -48,8 +49,8 @@ tslib_1.__exportStar(require("./oauth-authorization-service"), exports); tslib_1.__exportStar(require("./oauth-client-service"), exports); tslib_1.__exportStar(require("./oauth-grant-service"), exports); tslib_1.__exportStar(require("./oauth-token-service"), exports); +tslib_1.__exportStar(require("./oci-image-service"), exports); tslib_1.__exportStar(require("./password-reset-service"), exports); -tslib_1.__exportStar(require("./peering-info-service"), exports); tslib_1.__exportStar(require("./peering-service"), exports); tslib_1.__exportStar(require("./permission-entity-service"), exports); tslib_1.__exportStar(require("./pipeline-build-service"), exports); @@ -92,8 +93,25 @@ tslib_1.__exportStar(require("./team-monthly-usage-service"), exports); tslib_1.__exportStar(require("./team-preferences-service"), exports); tslib_1.__exportStar(require("./team-space-service"), exports); tslib_1.__exportStar(require("./team-service"), exports); +tslib_1.__exportStar(require("./telemetry-drain-service"), exports); tslib_1.__exportStar(require("./test-case-service"), exports); tslib_1.__exportStar(require("./test-node-service"), exports); tslib_1.__exportStar(require("./test-run-service"), exports); tslib_1.__exportStar(require("./user-preferences-service"), exports); tslib_1.__exportStar(require("./vpn-connection-service"), exports); +tslib_1.__exportStar(require("./add-on-sso-service"), exports); +tslib_1.__exportStar(require("./build-metadata-service"), exports); +tslib_1.__exportStar(require("./capability-service"), exports); +tslib_1.__exportStar(require("./config-vars-settings-service"), exports); +tslib_1.__exportStar(require("./dyno-processes-service"), exports); +tslib_1.__exportStar(require("./gateway-token-service"), exports); +tslib_1.__exportStar(require("./identity-provider-actions-service"), exports); +tslib_1.__exportStar(require("./identity-provider-certificate-service"), exports); +tslib_1.__exportStar(require("./payment-method-service"), exports); +tslib_1.__exportStar(require("./payment-service"), exports); +tslib_1.__exportStar(require("./space-host-service"), exports); +tslib_1.__exportStar(require("./space-log-drain-service"), exports); +tslib_1.__exportStar(require("./team-license-service"), exports); +tslib_1.__exportStar(require("./team-license-collection-service"), exports); +tslib_1.__exportStar(require("./telemetry-ingress-info-service"), exports); +tslib_1.__exportStar(require("./usage-service"), exports); diff --git a/lib/cjs/services/invoice-address-service.js b/lib/cjs/services/invoice-address-service.js index 7d2b695..3382b89 100644 --- a/lib/cjs/services/invoice-address-service.js +++ b/lib/cjs/services/invoice-address-service.js @@ -22,13 +22,20 @@ class InvoiceAddressService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update invoice address for an account. @@ -43,14 +50,21 @@ class InvoiceAddressService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = InvoiceAddressService; diff --git a/lib/cjs/services/invoice-service.js b/lib/cjs/services/invoice-service.js index 420c658..5dc07fd 100644 --- a/lib/cjs/services/invoice-service.js +++ b/lib/cjs/services/invoice-service.js @@ -23,13 +23,20 @@ class InvoiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing invoices. @@ -42,13 +49,20 @@ class InvoiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = InvoiceService; diff --git a/lib/cjs/services/key-service.js b/lib/cjs/services/key-service.js index e6955a5..78a02ac 100644 --- a/lib/cjs/services/key-service.js +++ b/lib/cjs/services/key-service.js @@ -23,13 +23,20 @@ class KeyService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing keys. @@ -42,13 +49,20 @@ class KeyService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = KeyService; diff --git a/lib/cjs/services/log-drain-service.js b/lib/cjs/services/log-drain-service.js index 908879b..2fd16d1 100644 --- a/lib/cjs/services/log-drain-service.js +++ b/lib/cjs/services/log-drain-service.js @@ -25,14 +25,21 @@ class LogDrainService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an add-on owned log drain. @@ -49,14 +56,21 @@ class LogDrainService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing log drain. Log drains added by add-ons can only be removed by removing the add-on. @@ -71,14 +85,21 @@ class LogDrainService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing log drain. @@ -93,13 +114,20 @@ class LogDrainService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing log drains for an add-on. @@ -113,13 +141,20 @@ class LogDrainService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing log drains. @@ -133,13 +168,20 @@ class LogDrainService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = LogDrainService; diff --git a/lib/cjs/services/log-session-service.js b/lib/cjs/services/log-session-service.js index 913d44e..50da474 100644 --- a/lib/cjs/services/log-session-service.js +++ b/lib/cjs/services/log-session-service.js @@ -25,14 +25,21 @@ class LogSessionService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = LogSessionService; diff --git a/lib/cjs/services/oauth-authorization-service.d.ts b/lib/cjs/services/oauth-authorization-service.d.ts index be4183c..4668fd4 100644 --- a/lib/cjs/services/oauth-authorization-service.d.ts +++ b/lib/cjs/services/oauth-authorization-service.d.ts @@ -28,6 +28,14 @@ export default class OauthAuthorizationService { * @param requestInit The initializer for the request. */ info(oauthAuthorizationIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing OAuth authorization. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(oauthAuthorizationIdentity: string, payload: Heroku.OauthAuthorizationUpdatePayload, requestInit?: Omit): Promise; /** * List OAuth authorizations. * diff --git a/lib/cjs/services/oauth-authorization-service.js b/lib/cjs/services/oauth-authorization-service.js index dfdea1f..2049004 100644 --- a/lib/cjs/services/oauth-authorization-service.js +++ b/lib/cjs/services/oauth-authorization-service.js @@ -24,14 +24,21 @@ class OauthAuthorizationService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete OAuth authorization. @@ -45,14 +52,21 @@ class OauthAuthorizationService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an OAuth authorization. @@ -66,13 +80,50 @@ class OauthAuthorizationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Update an existing OAuth authorization. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(oauthAuthorizationIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations/${oauthAuthorizationIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List OAuth authorizations. @@ -85,13 +136,20 @@ class OauthAuthorizationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Regenerate OAuth tokens. This endpoint is only available to direct authorizations or privileged OAuth clients. @@ -105,14 +163,21 @@ class OauthAuthorizationService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = OauthAuthorizationService; diff --git a/lib/cjs/services/oauth-client-service.js b/lib/cjs/services/oauth-client-service.js index a529233..046e0da 100644 --- a/lib/cjs/services/oauth-client-service.js +++ b/lib/cjs/services/oauth-client-service.js @@ -24,14 +24,21 @@ class OauthClientService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete OAuth client. @@ -45,14 +52,21 @@ class OauthClientService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an OAuth client. The output for unauthenticated requests excludes the `secret` parameter. @@ -66,7 +80,7 @@ class OauthClientService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } @@ -81,13 +95,20 @@ class OauthClientService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update OAuth client @@ -103,14 +124,21 @@ class OauthClientService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Rotate credentials for an OAuth client @@ -124,14 +152,21 @@ class OauthClientService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = OauthClientService; diff --git a/lib/cjs/services/oauth-token-service.js b/lib/cjs/services/oauth-token-service.js index ea62010..d88c194 100644 --- a/lib/cjs/services/oauth-token-service.js +++ b/lib/cjs/services/oauth-token-service.js @@ -24,14 +24,21 @@ class OauthTokenService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Revoke OAuth access token. @@ -45,14 +52,21 @@ class OauthTokenService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = OauthTokenService; diff --git a/lib/cjs/services/oci-image-service.d.ts b/lib/cjs/services/oci-image-service.d.ts new file mode 100644 index 0000000..f001a5c --- /dev/null +++ b/lib/cjs/services/oci-image-service.d.ts @@ -0,0 +1,26 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - OCI Images](https://devcenter.heroku.com/articles/platform-api-reference#oci-image) + * An OCI (Open Container Initiative) image is a standardized format for packaging and distributing containerized applications, ready to run on the platform. + */ +export default class OciImageService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for the OCI images of an app, filtered by identifier. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param ociImageIdentity unique identifier of the OCI image or unique identifier representing the content of the OCI image. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, ociImageIdentity: string, requestInit?: Omit): Promise; + /** + * Create an new OCI image of an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.OciImageCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/oci-image-service.js b/lib/cjs/services/oci-image-service.js new file mode 100644 index 0000000..beb2ce0 --- /dev/null +++ b/lib/cjs/services/oci-image-service.js @@ -0,0 +1,73 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - OCI Images](https://devcenter.heroku.com/articles/platform-api-reference#oci-image) + * An OCI (Open Container Initiative) image is a standardized format for packaging and distributing containerized applications, ready to run on the platform. + */ +class OciImageService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for the OCI images of an app, filtered by identifier. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param ociImageIdentity unique identifier of the OCI image or unique identifier representing the content of the OCI image. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, ociImageIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/oci-images/${ociImageIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Create an new OCI image of an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/oci-images`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = OciImageService; diff --git a/lib/cjs/services/password-reset-service.js b/lib/cjs/services/password-reset-service.js index f5557cc..7cefdee 100644 --- a/lib/cjs/services/password-reset-service.js +++ b/lib/cjs/services/password-reset-service.js @@ -24,14 +24,21 @@ class PasswordResetService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Complete password reset. @@ -48,14 +55,21 @@ class PasswordResetService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = PasswordResetService; diff --git a/lib/cjs/services/payment-method-service.d.ts b/lib/cjs/services/payment-method-service.d.ts new file mode 100644 index 0000000..c96f8c3 --- /dev/null +++ b/lib/cjs/services/payment-method-service.d.ts @@ -0,0 +1,29 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Vault API - Payment Method](https://devcenter.heroku.com/articles/platform-api-reference#payment-method) + * The on file payment method for an account + */ +export default class PaymentMethodService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Update an existing payment method for an account. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(payload: Heroku.PaymentMethodUpdatePayload, requestInit?: Omit): Promise; + /** + * Get the current payment method for an account. + * + * @param requestInit The initializer for the request. + */ + get(requestInit?: Omit): Promise; + /** + * Get the verified apps on the payment-method + * + * @param requestInit The initializer for the request. + */ + getApps(requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/payment-method-service.js b/lib/cjs/services/payment-method-service.js new file mode 100644 index 0000000..e218901 --- /dev/null +++ b/lib/cjs/services/payment-method-service.js @@ -0,0 +1,96 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Vault API - Payment Method](https://devcenter.heroku.com/articles/platform-api-reference#payment-method) + * The on file payment method for an account + */ +class PaymentMethodService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Update an existing payment method for an account. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/payment-method`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Get the current payment method for an account. + * + * @param requestInit The initializer for the request. + */ + async get(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/payment-method`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Get the verified apps on the payment-method + * + * @param requestInit The initializer for the request. + */ + async getApps(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/payment-method/apps`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = PaymentMethodService; diff --git a/lib/cjs/services/payment-service.d.ts b/lib/cjs/services/payment-service.d.ts new file mode 100644 index 0000000..9d16b4d --- /dev/null +++ b/lib/cjs/services/payment-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Vault API - Payments](https://devcenter.heroku.com/articles/platform-api-reference#payment) + * A payment represents money collected for an account + */ +export default class PaymentService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a payment on an existing account + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.PaymentCreatePayload, requestInit?: Omit): Promise; + /** + * Create a payment on an existing team + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + createPayment(teamIdentity: string, payload: Heroku.PaymentCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/payment-service.js b/lib/cjs/services/payment-service.js new file mode 100644 index 0000000..a7ae9b0 --- /dev/null +++ b/lib/cjs/services/payment-service.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Vault API - Payments](https://devcenter.heroku.com/articles/platform-api-reference#payment) + * A payment represents money collected for an account + */ +class PaymentService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a payment on an existing account + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/payments`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Create a payment on an existing team + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async createPayment(teamIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/payments`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = PaymentService; diff --git a/lib/cjs/services/peering-info-service.d.ts b/lib/cjs/services/peering-info-service.d.ts deleted file mode 100644 index f0f5743..0000000 --- a/lib/cjs/services/peering-info-service.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import * as Heroku from '@heroku-cli/schema'; -/** - * [Heroku Platform API - Peering Info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) - * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. - */ -export default class PeeringInfoService { - protected readonly fetchImpl: typeof fetch; - protected readonly endpoint: string; - constructor(fetchImpl: typeof fetch, endpoint: string); - /** - * Provides the necessary information to establish an AWS VPC Peering with your private space. - * - * @param spaceIdentity unique identifier of space or unique name of space. - * @param requestInit The initializer for the request. - */ - info(spaceIdentity: string, requestInit?: Omit): Promise; -} diff --git a/lib/cjs/services/peering-info-service.js b/lib/cjs/services/peering-info-service.js deleted file mode 100644 index 13b1d95..0000000 --- a/lib/cjs/services/peering-info-service.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * [Heroku Platform API - Peering Info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) - * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. - */ -class PeeringInfoService { - fetchImpl; - endpoint; - constructor(fetchImpl, endpoint) { - this.fetchImpl = fetchImpl; - this.endpoint = endpoint; - } - /** - * Provides the necessary information to establish an AWS VPC Peering with your private space. - * - * @param spaceIdentity unique identifier of space or unique name of space. - * @param requestInit The initializer for the request. - */ - async info(spaceIdentity, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peering-info`, { - ...requestInit, - method: 'GET', - headers: { - ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' - } - }); - if (response.ok) { - return (await response.json()); - } - throw new Error(response.statusText); - } -} -exports.default = PeeringInfoService; diff --git a/lib/cjs/services/peering-service.d.ts b/lib/cjs/services/peering-service.d.ts index 8eba208..2dfdc89 100644 --- a/lib/cjs/services/peering-service.d.ts +++ b/lib/cjs/services/peering-service.d.ts @@ -1,44 +1,41 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Platform API - Peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) - * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + * [Peering](https://devcenter.heroku.com/articles/private-space-vpc-peering?preview=1) provides a way to peer your Private Space VPC to another AWS VPC. */ export default class PeeringService { protected readonly fetchImpl: typeof fetch; protected readonly endpoint: string; constructor(fetchImpl: typeof fetch, endpoint: string); /** - * List peering connections of a private space. + * Provides the necessary information to establish an AWS VPC Peering with your private space. * * @param spaceIdentity unique identifier of space or unique name of space. * @param requestInit The initializer for the request. */ - list(spaceIdentity: string, requestInit?: Omit): Promise; + info(spaceIdentity: string, requestInit?: Omit): Promise; /** - * Accept a pending peering connection with a private space. + * List peering connections of a private space. * * @param spaceIdentity unique identifier of space or unique name of space. - * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. - * @example "pcx-123456789012". * @param requestInit The initializer for the request. */ - accept(spaceIdentity: string, peeringPcxId: string, requestInit?: Omit): Promise; + list(spaceIdentity: string, requestInit?: Omit): Promise; /** - * Destroy an active peering connection with a private space. + * Accept a pending peering connection with a private space. * * @param spaceIdentity unique identifier of space or unique name of space. - * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. - * @example "pcx-123456789012". + * @param payload Object to send to the endpoint. * @param requestInit The initializer for the request. */ - destroy(spaceIdentity: string, peeringPcxId: string, requestInit?: Omit): Promise; + accept(spaceIdentity: string, payload: Heroku.PeeringAcceptPayload, requestInit?: Omit): Promise; /** - * Fetch information for existing peering connection + * Destroy an active peering connection with a private space. * * @param spaceIdentity unique identifier of space or unique name of space. * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. * @example "pcx-123456789012". * @param requestInit The initializer for the request. */ - info(spaceIdentity: string, peeringPcxId: string, requestInit?: Omit): Promise; + destroy(spaceIdentity: string, peeringPcxId: string, requestInit?: Omit): Promise; } diff --git a/lib/cjs/services/peering-service.js b/lib/cjs/services/peering-service.js index 9c9a7cb..2c432ed 100644 --- a/lib/cjs/services/peering-service.js +++ b/lib/cjs/services/peering-service.js @@ -2,7 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); /** * [Heroku Platform API - Peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) - * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + * [Peering](https://devcenter.heroku.com/articles/private-space-vpc-peering?preview=1) provides a way to peer your Private Space VPC to another AWS VPC. */ class PeeringService { fetchImpl; @@ -12,92 +12,118 @@ class PeeringService { this.endpoint = endpoint; } /** - * List peering connections of a private space. + * Provides the necessary information to establish an AWS VPC Peering with your private space. * * @param spaceIdentity unique identifier of space or unique name of space. * @param requestInit The initializer for the request. */ - async list(spaceIdentity, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings`, { + async info(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peering-info`, { ...requestInit, method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** - * Accept a pending peering connection with a private space. + * List peering connections of a private space. * * @param spaceIdentity unique identifier of space or unique name of space. - * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. - * @example "pcx-123456789012". * @param requestInit The initializer for the request. */ - async accept(spaceIdentity, peeringPcxId, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}/actions/accept`, { + async list(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings`, { ...requestInit, - method: 'POST', + method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', - 'Content-Type': 'application/json' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** - * Destroy an active peering connection with a private space. + * Accept a pending peering connection with a private space. * * @param spaceIdentity unique identifier of space or unique name of space. - * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. - * @example "pcx-123456789012". + * @param payload Object to send to the endpoint. * @param requestInit The initializer for the request. */ - async destroy(spaceIdentity, peeringPcxId, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}`, { + async accept(spaceIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings`, { ...requestInit, - method: 'DELETE', + body: JSON.stringify(payload, null, 2), + method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** - * Fetch information for existing peering connection + * Destroy an active peering connection with a private space. * * @param spaceIdentity unique identifier of space or unique name of space. * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. * @example "pcx-123456789012". * @param requestInit The initializer for the request. */ - async info(spaceIdentity, peeringPcxId, requestInit = {}) { + async destroy(spaceIdentity, peeringPcxId, requestInit = {}) { const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}`, { ...requestInit, - method: 'GET', + method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = PeeringService; diff --git a/lib/cjs/services/permission-entity-service.js b/lib/cjs/services/permission-entity-service.js index 208bb3e..804d1e2 100644 --- a/lib/cjs/services/permission-entity-service.js +++ b/lib/cjs/services/permission-entity-service.js @@ -23,13 +23,20 @@ class PermissionEntityService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = PermissionEntityService; diff --git a/lib/cjs/services/pipeline-build-service.d.ts b/lib/cjs/services/pipeline-build-service.d.ts index f26ee6d..1f3deea 100644 --- a/lib/cjs/services/pipeline-build-service.d.ts +++ b/lib/cjs/services/pipeline-build-service.d.ts @@ -1,7 +1,7 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Platform API - Pipeline Build](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-build) - * Information about latest builds of apps in a pipeline. + * Information about the latest builds of apps in a pipeline. A build represents the process of transforming code into build artifacts. */ export default class PipelineBuildService { protected readonly fetchImpl: typeof fetch; @@ -14,5 +14,5 @@ export default class PipelineBuildService { * @example "01234567-89ab-cdef-0123-456789abcdef". * @param requestInit The initializer for the request. */ - list(pipelineId: string, requestInit?: Omit): Promise; + list(pipelineId: string, requestInit?: Omit): Promise; } diff --git a/lib/cjs/services/pipeline-build-service.js b/lib/cjs/services/pipeline-build-service.js index 26629a5..aab5793 100644 --- a/lib/cjs/services/pipeline-build-service.js +++ b/lib/cjs/services/pipeline-build-service.js @@ -2,7 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); /** * [Heroku Platform API - Pipeline Build](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-build) - * Information about latest builds of apps in a pipeline. + * Information about the latest builds of apps in a pipeline. A build represents the process of transforming code into build artifacts. */ class PipelineBuildService { fetchImpl; @@ -24,13 +24,20 @@ class PipelineBuildService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = PipelineBuildService; diff --git a/lib/cjs/services/pipeline-config-var-service.d.ts b/lib/cjs/services/pipeline-config-var-service.d.ts index 3204e16..47f044b 100644 --- a/lib/cjs/services/pipeline-config-var-service.d.ts +++ b/lib/cjs/services/pipeline-config-var-service.d.ts @@ -1,6 +1,6 @@ /** * [Heroku Platform API - Pipeline Config Vars](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-config-var) - * Pipeline Config Vars allow you to manage the configuration information provided to a pipeline. + * Pipeline config vars in Heroku CI and review apps used to manage the configuration information for a pipeline. */ export default class PipelineConfigVarService { protected readonly fetchImpl: typeof fetch; diff --git a/lib/cjs/services/pipeline-config-var-service.js b/lib/cjs/services/pipeline-config-var-service.js index dac9dd1..e34747f 100644 --- a/lib/cjs/services/pipeline-config-var-service.js +++ b/lib/cjs/services/pipeline-config-var-service.js @@ -2,7 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); /** * [Heroku Platform API - Pipeline Config Vars](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-config-var) - * Pipeline Config Vars allow you to manage the configuration information provided to a pipeline. + * Pipeline config vars in Heroku CI and review apps used to manage the configuration information for a pipeline. */ class PipelineConfigVarService { fetchImpl; @@ -26,13 +26,20 @@ class PipelineConfigVarService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update config-vars for a pipeline stage. You can update existing config-vars by setting them again, and remove by setting it to `null`. @@ -51,14 +58,21 @@ class PipelineConfigVarService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = PipelineConfigVarService; diff --git a/lib/cjs/services/pipeline-coupling-service.js b/lib/cjs/services/pipeline-coupling-service.js index 2f5f0f8..9335010 100644 --- a/lib/cjs/services/pipeline-coupling-service.js +++ b/lib/cjs/services/pipeline-coupling-service.js @@ -24,13 +24,20 @@ class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List pipeline couplings for the current user. @@ -43,13 +50,20 @@ class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List pipeline couplings. @@ -62,13 +76,20 @@ class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List pipeline couplings for a team. @@ -82,13 +103,20 @@ class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new pipeline coupling. @@ -103,14 +131,21 @@ class PipelineCouplingService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an existing pipeline coupling. @@ -124,13 +159,20 @@ class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing pipeline coupling. @@ -144,14 +186,21 @@ class PipelineCouplingService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing pipeline coupling. @@ -167,14 +216,21 @@ class PipelineCouplingService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an existing pipeline coupling. @@ -188,13 +244,20 @@ class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = PipelineCouplingService; diff --git a/lib/cjs/services/pipeline-deployment-service.d.ts b/lib/cjs/services/pipeline-deployment-service.d.ts index 05f283e..53843a4 100644 --- a/lib/cjs/services/pipeline-deployment-service.d.ts +++ b/lib/cjs/services/pipeline-deployment-service.d.ts @@ -1,14 +1,14 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Platform API - Pipeline Deployment](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-deployment) - * Information about latest deployments of apps in a pipeline. + * Information about the latest deployment of each app in a pipeline. A deployment is the process of moving the build artifacts to a target environment. */ export default class PipelineDeploymentService { protected readonly fetchImpl: typeof fetch; protected readonly endpoint: string; constructor(fetchImpl: typeof fetch, endpoint: string); /** - * List latest slug releases for each app in a pipeline + * List latest deployments for each app in a pipeline. A deployment is a release that changed your source slug, container image, or Heroku processes. * * @param pipelineId unique identifier of pipeline * @example "01234567-89ab-cdef-0123-456789abcdef". diff --git a/lib/cjs/services/pipeline-deployment-service.js b/lib/cjs/services/pipeline-deployment-service.js index 0190fa7..508d65a 100644 --- a/lib/cjs/services/pipeline-deployment-service.js +++ b/lib/cjs/services/pipeline-deployment-service.js @@ -2,7 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); /** * [Heroku Platform API - Pipeline Deployment](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-deployment) - * Information about latest deployments of apps in a pipeline. + * Information about the latest deployment of each app in a pipeline. A deployment is the process of moving the build artifacts to a target environment. */ class PipelineDeploymentService { fetchImpl; @@ -12,7 +12,7 @@ class PipelineDeploymentService { this.endpoint = endpoint; } /** - * List latest slug releases for each app in a pipeline + * List latest deployments for each app in a pipeline. A deployment is a release that changed your source slug, container image, or Heroku processes. * * @param pipelineId unique identifier of pipeline * @example "01234567-89ab-cdef-0123-456789abcdef". @@ -24,13 +24,20 @@ class PipelineDeploymentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = PipelineDeploymentService; diff --git a/lib/cjs/services/pipeline-promotion-service.js b/lib/cjs/services/pipeline-promotion-service.js index 323cc84..7c82a3e 100644 --- a/lib/cjs/services/pipeline-promotion-service.js +++ b/lib/cjs/services/pipeline-promotion-service.js @@ -24,14 +24,21 @@ class PipelinePromotionService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing pipeline promotion. @@ -45,13 +52,20 @@ class PipelinePromotionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = PipelinePromotionService; diff --git a/lib/cjs/services/pipeline-promotion-target-service.js b/lib/cjs/services/pipeline-promotion-target-service.js index b42f4c8..ef974e5 100644 --- a/lib/cjs/services/pipeline-promotion-target-service.js +++ b/lib/cjs/services/pipeline-promotion-target-service.js @@ -24,13 +24,20 @@ class PipelinePromotionTargetService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = PipelinePromotionTargetService; diff --git a/lib/cjs/services/pipeline-release-service.d.ts b/lib/cjs/services/pipeline-release-service.d.ts index a253dec..209fcad 100644 --- a/lib/cjs/services/pipeline-release-service.d.ts +++ b/lib/cjs/services/pipeline-release-service.d.ts @@ -1,7 +1,7 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Platform API - Pipeline Release](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-release) - * Information about latest releases of apps in a pipeline. + * Information about the latest release of each app in a pipeline. A release makes a deployment available to end-users. */ export default class PipelineReleaseService { protected readonly fetchImpl: typeof fetch; diff --git a/lib/cjs/services/pipeline-release-service.js b/lib/cjs/services/pipeline-release-service.js index e2724f3..2e1d6b6 100644 --- a/lib/cjs/services/pipeline-release-service.js +++ b/lib/cjs/services/pipeline-release-service.js @@ -2,7 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); /** * [Heroku Platform API - Pipeline Release](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-release) - * Information about latest releases of apps in a pipeline. + * Information about the latest release of each app in a pipeline. A release makes a deployment available to end-users. */ class PipelineReleaseService { fetchImpl; @@ -24,13 +24,20 @@ class PipelineReleaseService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = PipelineReleaseService; diff --git a/lib/cjs/services/pipeline-service.js b/lib/cjs/services/pipeline-service.js index e9d2bc2..022ec02 100644 --- a/lib/cjs/services/pipeline-service.js +++ b/lib/cjs/services/pipeline-service.js @@ -24,14 +24,21 @@ class PipelineService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing pipeline. @@ -45,13 +52,20 @@ class PipelineService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing pipeline. @@ -66,14 +80,21 @@ class PipelineService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing pipeline. @@ -90,14 +111,21 @@ class PipelineService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing pipelines. @@ -110,13 +138,20 @@ class PipelineService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = PipelineService; diff --git a/lib/cjs/services/pipeline-stack-service.js b/lib/cjs/services/pipeline-stack-service.js index 25d866e..2887e99 100644 --- a/lib/cjs/services/pipeline-stack-service.js +++ b/lib/cjs/services/pipeline-stack-service.js @@ -24,13 +24,20 @@ class PipelineStackService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = PipelineStackService; diff --git a/lib/cjs/services/pipeline-transfer-service.js b/lib/cjs/services/pipeline-transfer-service.js index 47c1edc..a7f3a90 100644 --- a/lib/cjs/services/pipeline-transfer-service.js +++ b/lib/cjs/services/pipeline-transfer-service.js @@ -24,14 +24,21 @@ class PipelineTransferService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = PipelineTransferService; diff --git a/lib/cjs/services/plan-service.js b/lib/cjs/services/plan-service.js index 3ff9b61..c02b69f 100644 --- a/lib/cjs/services/plan-service.js +++ b/lib/cjs/services/plan-service.js @@ -23,13 +23,20 @@ class PlanService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing plan by Add-on. @@ -44,13 +51,20 @@ class PlanService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing plans by Add-on. @@ -64,13 +78,20 @@ class PlanService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = PlanService; diff --git a/lib/cjs/services/rate-limit-service.js b/lib/cjs/services/rate-limit-service.js index ba9ba3d..381352f 100644 --- a/lib/cjs/services/rate-limit-service.js +++ b/lib/cjs/services/rate-limit-service.js @@ -22,13 +22,20 @@ class RateLimitService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = RateLimitService; diff --git a/lib/cjs/services/region-service.js b/lib/cjs/services/region-service.js index 204cace..4724fd0 100644 --- a/lib/cjs/services/region-service.js +++ b/lib/cjs/services/region-service.js @@ -23,13 +23,20 @@ class RegionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing regions. @@ -42,13 +49,20 @@ class RegionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = RegionService; diff --git a/lib/cjs/services/release-service.js b/lib/cjs/services/release-service.js index 141c765..2b36919 100644 --- a/lib/cjs/services/release-service.js +++ b/lib/cjs/services/release-service.js @@ -24,13 +24,20 @@ class ReleaseService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing releases. @@ -44,13 +51,20 @@ class ReleaseService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create new release. @@ -66,14 +80,21 @@ class ReleaseService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Rollback to an existing release. @@ -89,14 +110,21 @@ class ReleaseService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = ReleaseService; diff --git a/lib/cjs/services/review-app-config-service.js b/lib/cjs/services/review-app-config-service.js index f851bf0..c1c4e63 100644 --- a/lib/cjs/services/review-app-config-service.js +++ b/lib/cjs/services/review-app-config-service.js @@ -26,14 +26,21 @@ class ReviewAppConfigService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Get review apps configuration for a pipeline @@ -48,13 +55,20 @@ class ReviewAppConfigService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update review app configuration for a pipeline @@ -71,14 +85,21 @@ class ReviewAppConfigService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Disable review apps for a pipeline @@ -93,14 +114,21 @@ class ReviewAppConfigService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = ReviewAppConfigService; diff --git a/lib/cjs/services/review-app-service.js b/lib/cjs/services/review-app-service.js index b60f58e..2cf7a4e 100644 --- a/lib/cjs/services/review-app-service.js +++ b/lib/cjs/services/review-app-service.js @@ -24,14 +24,21 @@ class ReviewAppService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Gets an existing review app @@ -45,13 +52,20 @@ class ReviewAppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing review app @@ -65,14 +79,21 @@ class ReviewAppService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Get a review app using the associated app_id @@ -86,13 +107,20 @@ class ReviewAppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List review apps for a pipeline @@ -107,13 +135,20 @@ class ReviewAppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = ReviewAppService; diff --git a/lib/cjs/services/slug-service.js b/lib/cjs/services/slug-service.js index 74401ca..53d92f9 100644 --- a/lib/cjs/services/slug-service.js +++ b/lib/cjs/services/slug-service.js @@ -24,13 +24,20 @@ class SlugService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new slug. For more information please refer to [Deploying Slugs using the Platform API](https://devcenter.heroku.com/articles/platform-api-deploying-slugs). @@ -46,14 +53,21 @@ class SlugService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = SlugService; diff --git a/lib/cjs/services/sms-number-service.js b/lib/cjs/services/sms-number-service.js index 4b440e3..d17f6aa 100644 --- a/lib/cjs/services/sms-number-service.js +++ b/lib/cjs/services/sms-number-service.js @@ -23,13 +23,20 @@ class SmsNumberService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Recover an account using an SMS recovery code @@ -43,14 +50,21 @@ class SmsNumberService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Confirm an SMS number change with a confirmation code @@ -64,14 +78,21 @@ class SmsNumberService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = SmsNumberService; diff --git a/lib/cjs/services/sni-endpoint-service.js b/lib/cjs/services/sni-endpoint-service.js index 121b39e..5bece8e 100644 --- a/lib/cjs/services/sni-endpoint-service.js +++ b/lib/cjs/services/sni-endpoint-service.js @@ -25,14 +25,21 @@ class SniEndpointService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete existing SNI endpoint. @@ -47,14 +54,21 @@ class SniEndpointService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing SNI endpoint. @@ -69,13 +83,20 @@ class SniEndpointService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing SNI endpoints. @@ -89,13 +110,20 @@ class SniEndpointService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing SNI endpoint. @@ -112,14 +140,21 @@ class SniEndpointService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = SniEndpointService; diff --git a/lib/cjs/services/source-service.js b/lib/cjs/services/source-service.js index da69671..1b570b9 100644 --- a/lib/cjs/services/source-service.js +++ b/lib/cjs/services/source-service.js @@ -22,14 +22,21 @@ class SourceService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create URLs for uploading and downloading source. Deprecated in favor of `POST /sources` @@ -43,14 +50,21 @@ class SourceService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = SourceService; diff --git a/lib/cjs/services/space-app-access-service.js b/lib/cjs/services/space-app-access-service.js index 7e3efda..7be3ca3 100644 --- a/lib/cjs/services/space-app-access-service.js +++ b/lib/cjs/services/space-app-access-service.js @@ -24,13 +24,20 @@ class SpaceAppAccessService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing user's set of permissions on a space. @@ -47,14 +54,21 @@ class SpaceAppAccessService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List all users and their permissions on a space. @@ -68,13 +82,20 @@ class SpaceAppAccessService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = SpaceAppAccessService; diff --git a/lib/cjs/services/space-host-service.d.ts b/lib/cjs/services/space-host-service.d.ts new file mode 100644 index 0000000..175bf75 --- /dev/null +++ b/lib/cjs/services/space-host-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Host](https://devcenter.heroku.com/articles/platform-api-reference#space-host) + * [Space Hosts](https://devcenter.heroku.com/articles/private-spaces-dedicated-hosts?preview=1) lists dedicated hosts allocated to a space + */ +export default class SpaceHostService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List hosts + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + list(spaceIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/space-host-service.js b/lib/cjs/services/space-host-service.js new file mode 100644 index 0000000..9149bc1 --- /dev/null +++ b/lib/cjs/services/space-host-service.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Space Host](https://devcenter.heroku.com/articles/platform-api-reference#space-host) + * [Space Hosts](https://devcenter.heroku.com/articles/private-spaces-dedicated-hosts?preview=1) lists dedicated hosts allocated to a space + */ +class SpaceHostService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List hosts + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async list(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/hosts`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = SpaceHostService; diff --git a/lib/cjs/services/space-log-drain-service.d.ts b/lib/cjs/services/space-log-drain-service.d.ts new file mode 100644 index 0000000..f7082a4 --- /dev/null +++ b/lib/cjs/services/space-log-drain-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Log Drain](https://devcenter.heroku.com/articles/platform-api-reference#space-log-drain) + * Single log drain for all apps in a Private Space + */ +export default class SpaceLogDrainService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Current log drain for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Update log drain for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(spaceIdentity: string, payload: Heroku.SpaceLogDrainUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/space-log-drain-service.js b/lib/cjs/services/space-log-drain-service.js new file mode 100644 index 0000000..cf19be9 --- /dev/null +++ b/lib/cjs/services/space-log-drain-service.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Space Log Drain](https://devcenter.heroku.com/articles/platform-api-reference#space-log-drain) + * Single log drain for all apps in a Private Space + */ +class SpaceLogDrainService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Current log drain for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/log-drain`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Update log drain for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(spaceIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/log-drain`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = SpaceLogDrainService; diff --git a/lib/cjs/services/space-nat-service.js b/lib/cjs/services/space-nat-service.js index e3b70d9..5a4056e 100644 --- a/lib/cjs/services/space-nat-service.js +++ b/lib/cjs/services/space-nat-service.js @@ -23,13 +23,20 @@ class SpaceNatService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = SpaceNatService; diff --git a/lib/cjs/services/space-service.js b/lib/cjs/services/space-service.js index 4c0927f..97a372e 100644 --- a/lib/cjs/services/space-service.js +++ b/lib/cjs/services/space-service.js @@ -22,13 +22,20 @@ class SpaceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing space. @@ -42,13 +49,20 @@ class SpaceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing space. @@ -64,14 +78,21 @@ class SpaceService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing space. @@ -85,14 +106,21 @@ class SpaceService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new space. @@ -107,14 +135,21 @@ class SpaceService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = SpaceService; diff --git a/lib/cjs/services/space-topology-service.js b/lib/cjs/services/space-topology-service.js index 28674a8..26ce7b7 100644 --- a/lib/cjs/services/space-topology-service.js +++ b/lib/cjs/services/space-topology-service.js @@ -23,13 +23,20 @@ class SpaceTopologyService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = SpaceTopologyService; diff --git a/lib/cjs/services/space-transfer-service.js b/lib/cjs/services/space-transfer-service.js index c83721b..93cbe11 100644 --- a/lib/cjs/services/space-transfer-service.js +++ b/lib/cjs/services/space-transfer-service.js @@ -25,14 +25,21 @@ class SpaceTransferService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = SpaceTransferService; diff --git a/lib/cjs/services/stack-service.d.ts b/lib/cjs/services/stack-service.d.ts index 471c0d8..18be7e7 100644 --- a/lib/cjs/services/stack-service.d.ts +++ b/lib/cjs/services/stack-service.d.ts @@ -20,4 +20,11 @@ export default class StackService { * @param requestInit The initializer for the request. */ list(requestInit?: Omit): Promise; + /** + * List available app stacks for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + listStacks(appIdentity: string, requestInit?: Omit): Promise; } diff --git a/lib/cjs/services/stack-service.js b/lib/cjs/services/stack-service.js index 86196de..8b1e3d3 100644 --- a/lib/cjs/services/stack-service.js +++ b/lib/cjs/services/stack-service.js @@ -23,13 +23,20 @@ class StackService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List available stacks. @@ -42,13 +49,47 @@ class StackService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List available app stacks for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async listStacks(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/available-stacks`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = StackService; diff --git a/lib/cjs/services/team-add-on-service.js b/lib/cjs/services/team-add-on-service.js index 7e4b9ad..7e4025b 100644 --- a/lib/cjs/services/team-add-on-service.js +++ b/lib/cjs/services/team-add-on-service.js @@ -23,13 +23,20 @@ class TeamAddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TeamAddOnService; diff --git a/lib/cjs/services/team-app-collaborator-service.js b/lib/cjs/services/team-app-collaborator-service.js index 9960274..a65bd38 100644 --- a/lib/cjs/services/team-app-collaborator-service.js +++ b/lib/cjs/services/team-app-collaborator-service.js @@ -25,14 +25,21 @@ class TeamAppCollaboratorService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing collaborator from a team app. @@ -48,14 +55,21 @@ class TeamAppCollaboratorService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for a collaborator on a team app. @@ -71,13 +85,20 @@ class TeamAppCollaboratorService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing collaborator from a team app. @@ -95,14 +116,21 @@ class TeamAppCollaboratorService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List collaborators on a team app. @@ -117,13 +145,20 @@ class TeamAppCollaboratorService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TeamAppCollaboratorService; diff --git a/lib/cjs/services/team-app-permission-service.js b/lib/cjs/services/team-app-permission-service.js index 4ffe8ca..04ce559 100644 --- a/lib/cjs/services/team-app-permission-service.js +++ b/lib/cjs/services/team-app-permission-service.js @@ -22,13 +22,20 @@ class TeamAppPermissionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TeamAppPermissionService; diff --git a/lib/cjs/services/team-app-service.js b/lib/cjs/services/team-app-service.js index a2fa1bd..d95c28c 100644 --- a/lib/cjs/services/team-app-service.js +++ b/lib/cjs/services/team-app-service.js @@ -24,14 +24,21 @@ class TeamAppService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for a team app. @@ -46,13 +53,20 @@ class TeamAppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Lock or unlock a team app. @@ -69,14 +83,21 @@ class TeamAppService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Transfer an existing team app to another Heroku account. @@ -93,7 +114,7 @@ class TeamAppService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); @@ -113,14 +134,21 @@ class TeamAppService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List team apps. @@ -134,13 +162,20 @@ class TeamAppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TeamAppService; diff --git a/lib/cjs/services/team-daily-usage-service.js b/lib/cjs/services/team-daily-usage-service.js index cb76607..85e55fb 100644 --- a/lib/cjs/services/team-daily-usage-service.js +++ b/lib/cjs/services/team-daily-usage-service.js @@ -26,13 +26,20 @@ class TeamDailyUsageService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TeamDailyUsageService; diff --git a/lib/cjs/services/team-delinquency-service.js b/lib/cjs/services/team-delinquency-service.js index aebfc22..e17088b 100644 --- a/lib/cjs/services/team-delinquency-service.js +++ b/lib/cjs/services/team-delinquency-service.js @@ -23,13 +23,20 @@ class TeamDelinquencyService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TeamDelinquencyService; diff --git a/lib/cjs/services/team-feature-service.js b/lib/cjs/services/team-feature-service.js index 91614f3..0653392 100644 --- a/lib/cjs/services/team-feature-service.js +++ b/lib/cjs/services/team-feature-service.js @@ -24,13 +24,20 @@ class TeamFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing team features. @@ -44,13 +51,20 @@ class TeamFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TeamFeatureService; diff --git a/lib/cjs/services/team-invitation-service.js b/lib/cjs/services/team-invitation-service.js index 95561a7..936f3ee 100644 --- a/lib/cjs/services/team-invitation-service.js +++ b/lib/cjs/services/team-invitation-service.js @@ -24,13 +24,20 @@ class TeamInvitationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create Team Invitation @@ -46,14 +53,21 @@ class TeamInvitationService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Revoke a team invitation. @@ -68,14 +82,21 @@ class TeamInvitationService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Get an invitation by its token @@ -90,13 +111,20 @@ class TeamInvitationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Accept Team Invitation @@ -111,14 +139,21 @@ class TeamInvitationService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TeamInvitationService; diff --git a/lib/cjs/services/team-invoice-service.js b/lib/cjs/services/team-invoice-service.js index e2ed861..b94bc50 100644 --- a/lib/cjs/services/team-invoice-service.js +++ b/lib/cjs/services/team-invoice-service.js @@ -24,13 +24,20 @@ class TeamInvoiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing invoices. @@ -44,13 +51,20 @@ class TeamInvoiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TeamInvoiceService; diff --git a/lib/cjs/services/team-license-collection-service.d.ts b/lib/cjs/services/team-license-collection-service.d.ts new file mode 100644 index 0000000..398fe93 --- /dev/null +++ b/lib/cjs/services/team-license-collection-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team License Collection](https://devcenter.heroku.com/articles/platform-api-reference#team-license-collection) + * A team license collection is credits provided and consumed by the team per period. + */ +export default class TeamLicenseCollectionService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List team licenses. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-license-collection-service.js b/lib/cjs/services/team-license-collection-service.js new file mode 100644 index 0000000..9241962 --- /dev/null +++ b/lib/cjs/services/team-license-collection-service.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team License Collection](https://devcenter.heroku.com/articles/platform-api-reference#team-license-collection) + * A team license collection is credits provided and consumed by the team per period. + */ +class TeamLicenseCollectionService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List team licenses. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/license-collections`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = TeamLicenseCollectionService; diff --git a/lib/cjs/services/team-license-service.d.ts b/lib/cjs/services/team-license-service.d.ts new file mode 100644 index 0000000..34cc4c3 --- /dev/null +++ b/lib/cjs/services/team-license-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team License](https://devcenter.heroku.com/articles/platform-api-reference#team-license) + * A team license is credits provided and consumed by the team. + */ +export default class TeamLicenseService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List teams licenses. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/team-license-service.js b/lib/cjs/services/team-license-service.js new file mode 100644 index 0000000..9b9343e --- /dev/null +++ b/lib/cjs/services/team-license-service.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Team License](https://devcenter.heroku.com/articles/platform-api-reference#team-license) + * A team license is credits provided and consumed by the team. + */ +class TeamLicenseService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List teams licenses. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/licenses`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = TeamLicenseService; diff --git a/lib/cjs/services/team-member-service.js b/lib/cjs/services/team-member-service.js index cb53445..da968fb 100644 --- a/lib/cjs/services/team-member-service.js +++ b/lib/cjs/services/team-member-service.js @@ -25,14 +25,21 @@ class TeamMemberService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new team member. @@ -48,14 +55,21 @@ class TeamMemberService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update a team member. @@ -71,14 +85,21 @@ class TeamMemberService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Remove a member from the team. @@ -93,14 +114,21 @@ class TeamMemberService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List members of the team. @@ -114,13 +142,20 @@ class TeamMemberService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List the apps of a team member. @@ -135,13 +170,20 @@ class TeamMemberService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TeamMemberService; diff --git a/lib/cjs/services/team-monthly-usage-service.js b/lib/cjs/services/team-monthly-usage-service.js index 82a214c..2d35c63 100644 --- a/lib/cjs/services/team-monthly-usage-service.js +++ b/lib/cjs/services/team-monthly-usage-service.js @@ -26,13 +26,20 @@ class TeamMonthlyUsageService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TeamMonthlyUsageService; diff --git a/lib/cjs/services/team-preferences-service.js b/lib/cjs/services/team-preferences-service.js index 3b645aa..05aeaab 100644 --- a/lib/cjs/services/team-preferences-service.js +++ b/lib/cjs/services/team-preferences-service.js @@ -23,13 +23,20 @@ class TeamPreferencesService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update Team Preferences @@ -45,14 +52,21 @@ class TeamPreferencesService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TeamPreferencesService; diff --git a/lib/cjs/services/team-service.js b/lib/cjs/services/team-service.js index 59013e4..d011888 100644 --- a/lib/cjs/services/team-service.js +++ b/lib/cjs/services/team-service.js @@ -22,13 +22,20 @@ class TeamService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for a team. @@ -42,13 +49,20 @@ class TeamService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update team properties. @@ -64,14 +78,21 @@ class TeamService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new team. @@ -86,14 +107,21 @@ class TeamService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing team. @@ -107,14 +135,21 @@ class TeamService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List teams for an enterprise account. @@ -128,13 +163,20 @@ class TeamService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a team in an enterprise account. @@ -150,14 +192,21 @@ class TeamService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TeamService; diff --git a/lib/cjs/services/team-space-service.js b/lib/cjs/services/team-space-service.js index 3ee4391..245763b 100644 --- a/lib/cjs/services/team-space-service.js +++ b/lib/cjs/services/team-space-service.js @@ -23,13 +23,20 @@ class TeamSpaceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TeamSpaceService; diff --git a/lib/cjs/services/telemetry-drain-service.d.ts b/lib/cjs/services/telemetry-drain-service.d.ts new file mode 100644 index 0000000..d24fc50 --- /dev/null +++ b/lib/cjs/services/telemetry-drain-service.d.ts @@ -0,0 +1,53 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Telemetry Drain](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-drain) + * A telemetry drain forwards OpenTelemetry traces, metrics, and logs to your own consumer. For Fir-generation apps only. + */ +export default class TelemetryDrainService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a telemetry drain. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.TelemetryDrainCreatePayload, requestInit?: Omit): Promise; + /** + * List telemetry drains for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + listByApp(appIdentity: string, requestInit?: Omit): Promise; + /** + * List telemetry drains for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + listBySpace(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Update a telemetry drain. + * + * @param telemetryDrainIdentity unique identifier of telemetry drain. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(telemetryDrainIdentity: string, payload: Heroku.TelemetryDrainUpdatePayload, requestInit?: Omit): Promise; + /** + * Delete a telemetry drain. + * + * @param telemetryDrainIdentity unique identifier of telemetry drain. + * @param requestInit The initializer for the request. + */ + delete(telemetryDrainIdentity: string, requestInit?: Omit): Promise; + /** + * Info for a telemetry drain. + * + * @param telemetryDrainIdentity unique identifier of telemetry drain. + * @param requestInit The initializer for the request. + */ + info(telemetryDrainIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/telemetry-drain-service.js b/lib/cjs/services/telemetry-drain-service.js new file mode 100644 index 0000000..e30149e --- /dev/null +++ b/lib/cjs/services/telemetry-drain-service.js @@ -0,0 +1,183 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Telemetry Drain](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-drain) + * A telemetry drain forwards OpenTelemetry traces, metrics, and logs to your own consumer. For Fir-generation apps only. + */ +class TelemetryDrainService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a telemetry drain. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/telemetry-drains`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List telemetry drains for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async listByApp(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/telemetry-drains`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List telemetry drains for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async listBySpace(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/telemetry-drains`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Update a telemetry drain. + * + * @param telemetryDrainIdentity unique identifier of telemetry drain. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(telemetryDrainIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/telemetry-drains/${telemetryDrainIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Delete a telemetry drain. + * + * @param telemetryDrainIdentity unique identifier of telemetry drain. + * @param requestInit The initializer for the request. + */ + async delete(telemetryDrainIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/telemetry-drains/${telemetryDrainIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Info for a telemetry drain. + * + * @param telemetryDrainIdentity unique identifier of telemetry drain. + * @param requestInit The initializer for the request. + */ + async info(telemetryDrainIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/telemetry-drains/${telemetryDrainIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = TelemetryDrainService; diff --git a/lib/cjs/services/telemetry-ingress-info-service.d.ts b/lib/cjs/services/telemetry-ingress-info-service.d.ts new file mode 100644 index 0000000..dd4971a --- /dev/null +++ b/lib/cjs/services/telemetry-ingress-info-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Telemetry Ingress Info](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-ingress-info) + * Telemetry Ingress Info allows add-on partners to view authorization information required to write to Fir app logs. + */ +export default class TelemetryIngressInfoService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Fetch telemetry ingress info. + * + * @param addOnAttachmentIdentity unique identifier of this add-on attachment. + * @param requestInit The initializer for the request. + */ + info(addOnAttachmentIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/telemetry-ingress-info-service.js b/lib/cjs/services/telemetry-ingress-info-service.js new file mode 100644 index 0000000..7618d50 --- /dev/null +++ b/lib/cjs/services/telemetry-ingress-info-service.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Telemetry Ingress Info](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-ingress-info) + * Telemetry Ingress Info allows add-on partners to view authorization information required to write to Fir app logs. + */ +class TelemetryIngressInfoService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Fetch telemetry ingress info. + * + * @param addOnAttachmentIdentity unique identifier of this add-on attachment. + * @param requestInit The initializer for the request. + */ + async info(addOnAttachmentIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-attachments/${addOnAttachmentIdentity}/telemetry-ingress-info`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = TelemetryIngressInfoService; diff --git a/lib/cjs/services/test-case-service.js b/lib/cjs/services/test-case-service.js index b764fd9..b8a005f 100644 --- a/lib/cjs/services/test-case-service.js +++ b/lib/cjs/services/test-case-service.js @@ -23,13 +23,20 @@ class TestCaseService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TestCaseService; diff --git a/lib/cjs/services/test-node-service.js b/lib/cjs/services/test-node-service.js index e608447..da34127 100644 --- a/lib/cjs/services/test-node-service.js +++ b/lib/cjs/services/test-node-service.js @@ -23,13 +23,20 @@ class TestNodeService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = TestNodeService; diff --git a/lib/cjs/services/test-run-service.js b/lib/cjs/services/test-run-service.js index 1ee1513..3d96d27 100644 --- a/lib/cjs/services/test-run-service.js +++ b/lib/cjs/services/test-run-service.js @@ -24,7 +24,7 @@ class TestRunService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); @@ -41,7 +41,7 @@ class TestRunService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } @@ -58,13 +58,20 @@ class TestRunService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing test-run by Pipeline @@ -80,7 +87,7 @@ class TestRunService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } @@ -98,7 +105,7 @@ class TestRunService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); diff --git a/lib/cjs/services/usage-service.d.ts b/lib/cjs/services/usage-service.d.ts new file mode 100644 index 0000000..d22ba4f --- /dev/null +++ b/lib/cjs/services/usage-service.d.ts @@ -0,0 +1,33 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Usage](https://devcenter.heroku.com/articles/platform-api-reference#usage) + * Usage for apps. + */ +export default class UsageService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieves usage for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, requestInit?: Omit): Promise; + /** + * Retrieves usage for an app belonging to a particular team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamAppIdentity unique name of app + * @example "example". + * @param requestInit The initializer for the request. + */ + infoUsage(teamIdentity: string, teamAppIdentity: string, requestInit?: Omit): Promise; + /** + * Retrieves usage for apps belonging to a particular team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + infoApps(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/cjs/services/usage-service.js b/lib/cjs/services/usage-service.js new file mode 100644 index 0000000..b639c90 --- /dev/null +++ b/lib/cjs/services/usage-service.js @@ -0,0 +1,98 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * [Heroku Platform API - Usage](https://devcenter.heroku.com/articles/platform-api-reference#usage) + * Usage for apps. + */ +class UsageService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieves usage for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/usage`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Retrieves usage for an app belonging to a particular team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamAppIdentity unique name of app + * @example "example". + * @param requestInit The initializer for the request. + */ + async infoUsage(teamIdentity, teamAppIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/apps/${teamAppIdentity}/usage`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Retrieves usage for apps belonging to a particular team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async infoApps(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/usage`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} +exports.default = UsageService; diff --git a/lib/cjs/services/user-preferences-service.js b/lib/cjs/services/user-preferences-service.js index db8e07a..0b94b25 100644 --- a/lib/cjs/services/user-preferences-service.js +++ b/lib/cjs/services/user-preferences-service.js @@ -23,13 +23,20 @@ class UserPreferencesService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update User Preferences @@ -45,14 +52,21 @@ class UserPreferencesService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = UserPreferencesService; diff --git a/lib/cjs/services/vpn-connection-service.js b/lib/cjs/services/vpn-connection-service.js index ac51902..0a8a411 100644 --- a/lib/cjs/services/vpn-connection-service.js +++ b/lib/cjs/services/vpn-connection-service.js @@ -25,14 +25,21 @@ class VpnConnectionService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Destroy existing VPN Connection @@ -47,14 +54,21 @@ class VpnConnectionService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List VPN connections for a space. @@ -68,13 +82,20 @@ class VpnConnectionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an existing vpn-connection. @@ -89,13 +110,20 @@ class VpnConnectionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update a VPN connection in a private space. @@ -112,14 +140,21 @@ class VpnConnectionService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } exports.default = VpnConnectionService; diff --git a/lib/esm/index.d.ts b/lib/esm/index.d.ts index 79ff118..5179299 100644 --- a/lib/esm/index.d.ts +++ b/lib/esm/index.d.ts @@ -184,6 +184,64 @@ export interface Account { * @example "United States" */ country_of_residence: string | null; + /** + * whether the user has enabled Eco dynos + */ + eco_dynos_enabled: boolean; + /** + * When the user's Eco dynos will be shutdown after disablement + * + * @example "2012-01-01T12:00:00Z" + */ + readonly eco_dynos_shutdown_at: string | null; + /** + * when pipeline cost consent was made + * + * @example "2012-01-01T12:00:00Z" + */ + readonly pipeline_cost_consent_at: string | null; + /** + * whether account has acknowledged the MSA terms of service + */ + readonly acknowledged_msa: boolean; + /** + * when account has acknowledged the MSA terms of service + * + * @example "2012-01-01T12:00:00Z" + */ + readonly acknowledged_msa_at: string | null; + /** + * whether account has acknowledged the Italian customer terms of service + * + * @example "affirmatively_accepted" + */ + readonly italian_customer_terms: string | null; + /** + * whether account has acknowledged the Italian provider terms of service + * + * @example "affirmatively_accepted" + */ + readonly italian_partner_terms: string | null; + /** + * whether account has legacy 2FA or VaaS MFA enabled + */ + readonly mfa_enabled: boolean; + /** + * whether the user is exempt from MFA requirements + */ + mfa_exemption: boolean; + /** + * the reason why a user may be exempt from MFA requirements + * + * @example "federated" + */ + mfa_exemption_reason: string | null; + /** + * which type of mfa the user should see + * + * @example "vaas" + */ + readonly mfa_experience: 'vaas' | 'legacy'; /** * team selected by default */ @@ -196,7 +254,7 @@ export interface Account { /** * * [Heroku Platform API - identity-provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) - * Identity Providers represent the SAML configuration of teams or an Enterprise account + * Identity Providers represent the SSO configuration of an Enterprise Account or Team. */ export interface IdentityProvider { /** @@ -204,7 +262,17 @@ export interface IdentityProvider { * * @example "-----BEGIN CERTIFICATE----- ..." */ - certificate: string; + certificate: string | null; + /** + * Array of sso certificates belonging to this identity provider + */ + certificates: Array<{ + readonly created_at?: string; + readonly id?: string; + readonly expires_at?: string; + body?: string; + name?: string | null; + }>; /** * when provider record was created * @@ -223,6 +291,16 @@ export interface IdentityProvider { * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly id: string; + /** + * user-friendly unique identifier for this identity provider + * + * @example "acme-sso" + */ + name: string; + /** + * entity that owns this identity provider + */ + owner: Owner; /** * single log out URL for this identity provider * @@ -235,10 +313,6 @@ export interface IdentityProvider { * @example "https://example.com/idp/login" */ sso_target_url: string; - /** - * team associated with this identity provider - */ - organization: null | Organization; /** * when the identity provider record was updated * @@ -246,9 +320,27 @@ export interface IdentityProvider { */ readonly updated_at: string; /** - * entity that owns this identity provider + * when the identity provider is allowed to be used */ - owner: Owner; + readonly enabled: boolean; + /** + * heroku start url + * + * @example "https://sso.heroku.com/saml/acme-sso/init" + */ + readonly heroku_start_url: string; + /** + * heroku entity id + * + * @example "https://sso.heroku.com/saml/acme-sso" + */ + readonly heroku_entity_id: string; + /** + * heroku acs url + * + * @example "https://sso.heroku.com/saml/acme-sso/finalize" + */ + readonly heroku_acs_url: string; } /** * @@ -291,6 +383,18 @@ export interface Team { * @example 25 */ readonly membership_limit: number | null; + /** + * Time when team was consented into new pipeline costs + * + * @example "01-01-2023" + */ + pipeline_cost_consent_at: string | null; + /** + * Email of team user that consented to new pipeline costs + * + * @example "heroku@salesforce.com" + */ + pipeline_cost_consent_user_email: string | null; /** * unique name of team * @@ -407,6 +511,16 @@ export interface AccountUpdatePayload { * @example "Tina Edmonds" */ name?: string | null; + /** + * whether the user has enabled Eco dynos + */ + eco_dynos_enabled?: boolean; + /** + * whether pipeline cost consent was made + * + * @example "true" + */ + readonly pipeline_cost_consent?: boolean; } export interface AccountUpdateByUserPayload { /** @@ -425,6 +539,16 @@ export interface AccountUpdateByUserPayload { * @example "Tina Edmonds" */ name?: string | null; + /** + * whether the user has enabled Eco dynos + */ + eco_dynos_enabled?: boolean; + /** + * whether pipeline cost consent was made + * + * @example "true" + */ + readonly pipeline_cost_consent?: boolean; } /** * @@ -446,17 +570,7 @@ export interface AddOn { * identity of add-on serviceAdd-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. */ addon_service: { - /** - * unique identifier of this add-on-service - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ readonly id: string; - /** - * unique name of this add-on-service - * - * @example "heroku-postgresql" - */ readonly name: string; } | AddOnService; /** @@ -499,17 +613,7 @@ export interface AddOn { * identity of add-on planPlans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication. */ plan: { - /** - * unique identifier of this plan - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ readonly id: string; - /** - * unique name of this plan - * - * @example "heroku-postgresql:dev" - */ readonly name: string; } | Plan; /** @@ -597,6 +701,13 @@ export interface AddOnService { * @example "2012-01-01T12:00:00Z" */ readonly updated_at: string; + /** + * generations supported by this add-on + */ + supported_generations: Array<{ + readonly name?: string; + readonly id?: string; + }>; } /** * @@ -638,6 +749,16 @@ export interface App { * @example "2012-01-01T12:00:00Z" */ readonly archived_at: null | string; + /** + * name of the image used for the base layers of the OCI image + * + * @example "heroku/heroku:22-cnb" + */ + readonly base_image_name: null | string; + /** + * identity of the stack that will be used for new builds + */ + build_stack: BuildStack; /** * description from buildpack of app * @@ -645,15 +766,27 @@ export interface App { */ readonly buildpack_provided_description: null | string; /** - * identity of the stack that will be used for new builds + * buildpacks of the OCI image */ - build_stack: BuildStack; + buildpacks: null | Buildpack[]; /** * when app was created * * @example "2012-01-01T12:00:00Z" */ readonly created_at: string; + /** + * current build architecture for the app + * + * @example "[arm64]" + */ + current_build_architecture: []; + /** + * the generation of the app + * + * @example "fir" + */ + readonly generation: string; /** * git repo URL of app * @@ -744,6 +877,10 @@ export interface BilledPrice { * price is negotiated in a contract outside of monthly add-on billing */ readonly contract: boolean; + /** + * whether this plan is billed per use + */ + readonly metered: boolean; /** * unit of price for plan * @@ -869,6 +1006,10 @@ export interface Price { * price is negotiated in a contract outside of monthly add-on billing */ readonly contract: boolean; + /** + * whether this plan is billed per use + */ + readonly metered: boolean; /** * unit of price for plan * @@ -876,6 +1017,14 @@ export interface Price { */ readonly unit: string; } +export interface AddOnActionPeerPayload { + /** + * The AWS VPC Peering Connection ID of the peering. + * + * @example "pcx-123456789012" + */ + readonly pcx_id: string; +} /** * * [Heroku Platform API - add-on-attachment](https://devcenter.heroku.com/articles/platform-api-reference#add-on-attachment) @@ -1785,7 +1934,7 @@ export interface AppSetup { /** * * [Heroku Platform API - build](https://devcenter.heroku.com/articles/platform-api-reference#build) - * A build represents the process of transforming a code tarball into a slug + * A build represents the process of transforming a code tarball into build artifacts */ export interface Build { /** @@ -1793,20 +1942,10 @@ export interface Build { */ app?: BuildApp; /** - * buildpacks executed for this build, in order + * buildpacks executed for this build, in order (only applicable to Cedar-generation apps) */ buildpacks?: Array<{ - /** - * the URL of the buildpack for the app - * - * @example "https://github.com/heroku/heroku-buildpack-ruby" - */ url?: string; - /** - * Buildpack Registry name of the buildpack for the app - * - * @example "heroku/ruby" - */ name?: string; }> | null; /** @@ -1821,6 +1960,12 @@ export interface Build { * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly id: string; + /** + * Labs set from project.toml file. Only applies to Fir generation apps. + * + * @example {"build_config_vars":true} + */ + readonly labs?: Record; /** * Build process output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). * @@ -1838,7 +1983,7 @@ export interface Build { */ readonly release?: null | BuildRelease; /** - * slug created by this build + * slug created by this build (only applicable for Cedar-generation apps) */ slug?: Slug | null; /** @@ -2200,13 +2345,37 @@ export interface BuildStack { * * @example "01234567-89ab-cdef-0123-456789abcdef" */ - readonly id: string; + readonly id?: string; /** * unique name of stack * * @example "heroku-18" */ - readonly name: string; + readonly name?: string; +} +/** + * + * set of executables that inspects app source code and creates a plan to build and run your image + */ +export interface Buildpack { + /** + * identifier of the buildpack + * + * @example "heroku/ruby" + */ + id?: string; + /** + * version of the buildpack + * + * @example "2.0.0" + */ + version?: string; + /** + * homepage of the buildpack + * + * @example "https://github.com/heroku/buildpacks-ruby" + */ + homepage?: string; } /** * @@ -2347,6 +2516,12 @@ export interface Space { * @example "10.2.0.0/16" */ data_cidr: string; + /** + * generation for space + * + * @example "fir" + */ + generation: string; } /** * @@ -2578,6 +2753,10 @@ export interface EnterpriseAccount { * whether the enterprise account is a trial or not */ readonly trial: boolean; + /** + * whether the enterprise account is part of the Salesforce Partner Program + */ + readonly partner_benefits: boolean; /** * Identity Provider associated with the Enterprise Account */ @@ -2744,20 +2923,10 @@ export interface User { } export interface BuildCreatePayload { /** - * buildpacks executed for this build, in order + * buildpacks executed for this build, in order (only applicable to Cedar-generation apps) */ buildpacks?: Array<{ - /** - * the URL of the buildpack for the app - * - * @example "https://github.com/heroku/heroku-buildpack-ruby" - */ url?: string; - /** - * Buildpack Registry name of the buildpack for the app - * - * @example "heroku/ruby" - */ name?: string; }> | null; /** @@ -2808,13 +2977,13 @@ export interface BuildpackInstallation { /** * buildpack */ - buildpack: Buildpack; + buildpack: BuildpackInstallationBuildpack; } /** * * buildpack */ -export interface Buildpack { +export interface BuildpackInstallationBuildpack { /** * location of the buildpack for the app. Either a url (unofficial buildpacks) or an internal urn (heroku official buildpacks). * @@ -3186,12 +3355,24 @@ export interface DomainUpdatePayload { * Dyno sizes are the values and details of sizes that can be assigned to dynos. This information can also be found at : [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). */ export interface DynoSize { + /** + * CPU architecture of this dyno + * + * @example "arm64" + */ + readonly architecture: string; /** * minimum vCPUs, non-dedicated may get more depending on load * * @example 1 */ readonly compute: number; + /** + * whether this dyno size's product tier can use auto-scaling + * + * @example true + */ + readonly can_autoscale: boolean; /** * price information for this dyno size */ @@ -3200,10 +3381,6 @@ export interface DynoSize { * whether this dyno will be dedicated to one user */ readonly dedicated: boolean; - /** - * deprecated. See precise_dyno_units instead - */ - readonly dyno_units: number; /** * unit of consumption for Heroku Enterprise customers to 2 decimal places * @@ -3211,7 +3388,7 @@ export interface DynoSize { */ readonly precise_dyno_units: number; /** - * unique identifier of this dyno size + * unique identifier of the dyno size * * @example "01234567-89ab-cdef-0123-456789abcdef" */ @@ -3223,7 +3400,7 @@ export interface DynoSize { */ readonly memory: number; /** - * the name of this dyno-size + * name of the dyno size * * @example "eco" */ @@ -3232,6 +3409,41 @@ export interface DynoSize { * whether this dyno can only be provisioned in a private space */ readonly private_space_only: boolean; + /** + * Generation of the Heroku platform for this dyno size + */ + readonly generation: DynoSizeGeneration; + /** + * infrastructure tier for this dyno + * + * @example "production" + */ + readonly infrastructure_tier: string; + /** + * product tier for this dyno + * + * @example "standard" + */ + readonly product_dyno_tier: string; +} +/** + * + * [Heroku Platform API - generation](https://devcenter.heroku.com/articles/platform-api-reference#generation) + * Generation of the Heroku platform for this dyno size + */ +export interface DynoSizeGeneration { + /** + * unique identifier of the generation of the Heroku platform for this dyno size + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of the generation of the Heroku platform for this dyno size + * + * @example "cedar" + */ + readonly name?: string; } /** * @@ -3304,7 +3516,7 @@ export interface Dyno { } /** * - * [Heroku Platform API - release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * [Heroku Platform API - pipeline-deployment](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-deployment) * A release represents a combination of code, config vars and add-ons for an app on Heroku. */ export interface Release { @@ -3312,6 +3524,10 @@ export interface Release { * add-on plans installed on the app for this release */ addon_plan_names: string[]; + /** + * build artifacts for the release + */ + artifacts: Artifact[]; /** * app involved in the release */ @@ -3341,7 +3557,11 @@ export interface Release { */ readonly updated_at: string; /** - * slug running in this release + * OCI image running in this release + */ + oci_image: ReleaseOciImage | null; + /** + * slug running in this release. Not applicable to apps using Cloud Native Buildpacks. */ slug: Slug | null; /** @@ -3349,7 +3569,7 @@ export interface Release { * * @example "succeeded" */ - readonly status: 'failed' | 'pending' | 'succeeded'; + readonly status: 'expired' | 'failed' | 'pending' | 'succeeded'; /** * user that created the release */ @@ -3361,17 +3581,23 @@ export interface Release { */ readonly version: number; /** - * indicates this release as being the current one for the app + * indicates if this release is the current one for the app * * @example true */ readonly current: boolean; /** - * Release command output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). + * URL that the release command output streams to. The stream is available as either `text/plain` or `text/event-stream`. Prepare clients to handle disconnects and to resume the stream by sending a `Range` header for `text/plain` or a `Last-Event-Id` header for `text/event-stream`. * * @example "https://release-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef" */ readonly output_stream_url: string | null; + /** + * indicates if this release is eligible for rollback + * + * @example true + */ + readonly eligible_for_rollback: boolean; } /** * @@ -3450,51 +3676,13 @@ export interface EnterpriseAccountDailyUsage { * usage by team */ teams: Array<{ - /** - * total add-on credits used - * - * @example 250 - */ readonly addons?: number; - /** - * app usage in the team - */ apps?: AppUsageDaily[]; - /** - * total add-on credits used for first party add-ons - * - * @example 34.89 - */ readonly data?: number; - /** - * dynos used - * - * @example 1.548 - */ readonly dynos?: number; - /** - * team identifier - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ readonly id?: string; - /** - * name of the team - * - * @example "ops" - */ readonly name?: string; - /** - * total add-on credits used for third party add-ons - * - * @example 12.34 - */ readonly partner?: number; - /** - * space credits used - * - * @example 1.548 - */ readonly space?: number; }>; /** @@ -3607,16 +3795,7 @@ export interface EnterpriseAccountMember { * enterprise account permissions */ permissions: Array<{ - /** - * - * @example "View enterprise account members and teams." - */ description?: string; - /** - * permission in the enterprise account - * - * @example "view" - */ readonly name?: 'view' | 'create' | 'manage' | 'billing'; }>; /** @@ -3714,61 +3893,18 @@ export interface EnterpriseAccountMonthlyUsage { * usage by team */ teams: Array<{ - /** - * total add-on credits used - * - * @example 250 - */ readonly addons?: number; - /** - * app usage in the team - */ apps?: AppUsageMonthly[]; - /** - * average connect rows synced - * - * @example 15000 - */ readonly connect?: number; - /** - * total add-on credits used for first party add-ons - * - * @example 34.89 - */ readonly data?: number; - /** - * dynos used - * - * @example 1.548 - */ readonly dynos?: number; - /** - * team identifier - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ readonly id?: string; - /** - * name of the team - * - * @example "ops" - */ readonly name?: string; - /** - * total add-on credits used for third party add-ons - * - * @example 12.34 - */ readonly partner?: number; - /** - * space credits used - * - * @example 1.548 - */ readonly space?: number; }>; /** - * average connect rows synced + * max connect rows synced * * @example 15000 */ @@ -3914,6 +4050,16 @@ export interface TeamApp { * @example "2012-01-01T12:00:00Z" */ readonly archived_at?: null | string; + /** + * name of the image used for the base layers of the OCI image + * + * @example "heroku/heroku:22-cnb" + */ + readonly base_image_name?: null | string; + /** + * identity of the stack that will be used for new builds + */ + build_stack?: BuildStack; /** * description from buildpack of app * @@ -3921,15 +4067,27 @@ export interface TeamApp { */ readonly buildpack_provided_description?: null | string; /** - * identity of the stack that will be used for new builds + * buildpacks of the OCI image */ - build_stack?: BuildStack; + buildpacks?: null | Buildpack[]; + /** + * current build architecture for the app + * + * @example "[arm64]" + */ + current_build_architecture?: []; /** * when app was created * * @example "2012-01-01T12:00:00Z" */ readonly created_at?: string; + /** + * the generation of the app + * + * @example "fir" + */ + readonly generation?: string; /** * git repo URL of app * @@ -4089,6 +4247,10 @@ export interface Formation { * @example "2012-01-01T12:00:00Z" */ readonly created_at: string; + /** + * dyno size + */ + dyno_size: FormationDynoSize; /** * unique identifier of this process type * @@ -4102,7 +4264,7 @@ export interface Formation { */ quantity: number; /** - * dyno size + * deprecated, refer to 'dyno_size' instead * * @example "standard-1X" */ @@ -4139,9 +4301,27 @@ export interface FormationApp { */ readonly id?: string; } +/** + * + * dyno size + */ +export interface FormationDynoSize { + /** + * unique identifier of the dyno size + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of the dyno size + * + * @example "eco" + */ + readonly name?: string; +} export interface FormationBatchUpdatePayload { /** - * Array with formation updates. Each element must have "type", the id or name of the process type to be updated, and can optionally update its "quantity" or "size". + * Array with formation updates. Each element must have "type", the id or name of the process type to be updated, and can optionally update its "quantity" or "dyno_size". */ updates: FormationBatchUpdatePayloadUpdate[]; } @@ -4151,17 +4331,17 @@ export interface FormationBatchUpdatePayload { */ export interface FormationBatchUpdatePayloadUpdate { /** - * number of processes to maintain + * dyno size * - * @example 1 + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} */ - quantity?: number; + dyno_size?: FormationBatchUpdatePayloadUpdateDynoSize; /** - * dyno size + * number of processes to maintain * - * @example "standard-1X" + * @example 1 */ - size?: string; + quantity?: number; /** * type of process to maintain * @@ -4169,53 +4349,164 @@ export interface FormationBatchUpdatePayloadUpdate { */ readonly type: string; } -export interface FormationUpdatePayload { +/** + * + * dyno size + */ +export interface FormationBatchUpdatePayloadUpdateDynoSize { /** - * number of processes to maintain + * unique identifier of the dyno size * - * @example 1 + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - quantity?: number; + readonly id: string; /** - * dyno size + * name of the dyno size * - * @example "standard-1X" + * @example "Standard-1X" */ - size?: string; + readonly name?: string; } -export interface IdentityProviderCreateByTeamPayload { +export interface FormationUpdatePayload { /** - * raw contents of the public certificate (eg: .crt or .pem file) + * dyno size * - * @example "-----BEGIN CERTIFICATE----- ..." + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} */ - certificate: string; + dyno_size?: FormationUpdatePayloadDynoSize; /** - * URL identifier provided by the identity provider + * number of processes to maintain * - * @example "https://customer-domain.idp.com" + * @example 1 */ - entity_id: string; + quantity?: number; +} +/** + * + * dyno size + */ +export interface FormationUpdatePayloadDynoSize { /** - * single log out URL for this identity provider + * unique identifier of the dyno size * - * @example "https://example.com/idp/logout" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - slo_target_url?: string; + readonly id: string; /** - * single sign on URL for this identity provider + * name of the dyno size * - * @example "https://example.com/idp/login" + * @example "Standard-1X" */ - sso_target_url: string; + readonly name?: string; +} +/** + * + * [Heroku Platform API - generation](https://devcenter.heroku.com/articles/platform-api-reference#generation) + * A generation represents a version of the Heroku platform that includes the app execution environment, routing, telemetry, and build systems. + */ +export interface Generation { + /** + * when generation was created + * + * @example "2024-12-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of generation + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of generation + * + * @example "fir" + */ + readonly name: string; + /** + * when generation was updated + * + * @example "2024-12-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * features unsupported by this generation + */ + unsupported_features: string[]; + /** + * features unsupported by this generation along with their metadata + */ + expanded_supported_features: UnsupportedFeature[]; +} +/** + * + * unsupported feature information + */ +export interface UnsupportedFeature { + /** + * name of unsupported feature + * + * @example "app_maintenance" + */ + name?: string; + /** + * type of unsupported feature + * + * @example "temporary" + */ + incompatible_type?: string; + /** + * scope of unsupported feature + * + * @example "app" + */ + scope?: string; } -export interface IdentityProviderUpdateByTeamPayload { +export interface IdentityProviderCreatePayload { + /** + * Array of sso certificates belonging to this identity provider + */ + certificates?: Array<{ + readonly created_at?: string; + readonly id?: string; + readonly expires_at?: string; + body?: string; + name?: string | null; + }>; /** * raw contents of the public certificate (eg: .crt or .pem file) * * @example "-----BEGIN CERTIFICATE----- ..." */ - certificate?: string; + certificate?: string | null; + /** + * URL identifier provided by the identity provider + * + * @example "https://customer-domain.idp.com" + */ + entity_id?: string; + /** + * single log out URL for this identity provider + * + * @example "https://example.com/idp/logout" + */ + slo_target_url?: string; + /** + * single sign on URL for this identity provider + * + * @example "https://example.com/idp/login" + */ + sso_target_url?: string; + /** + * entity that owns this identity provider + */ + owner: Owner; + /** + * when the identity provider is allowed to be used + */ + readonly enabled?: boolean; +} +export interface IdentityProviderUpdatePayload { /** * URL identifier provided by the identity provider * @@ -4234,6 +4525,14 @@ export interface IdentityProviderUpdateByTeamPayload { * @example "https://example.com/idp/login" */ sso_target_url?: string; + /** + * when the identity provider is allowed to be used + */ + readonly enabled?: boolean; + /** + * List of certificates to update or create; any existing certificates not referenced here will be deleted + */ + certificates?: []; } /** * @@ -4647,13 +4946,19 @@ export interface LogSession { } export interface LogSessionCreatePayload { /** - * dyno to limit results to + * dyno name to limit results to * - * @example "web.1" + * @example "'web.1' (Cedar-generation) or 'web-1234abcde-123ab' (Fir-generation)" */ dyno?: string; /** - * number of log lines to stream at once + * process type to limit results to (for Fir-generation apps only) + * + * @example "web" + */ + type?: string; + /** + * number of log lines to stream at a time (for Cedar-generation apps only) * * @example 10 */ @@ -4691,6 +4996,12 @@ export interface OauthAuthorization { * @example "2012-01-01T12:00:00Z" */ readonly created_at: string; + /** + * human-friendly description of this OAuth authorization + * + * @example "sample authorization" + */ + readonly description: string; /** * this authorization's grant */ @@ -4711,6 +5022,10 @@ export interface OauthAuthorization { * @example ["global"] */ readonly scope: string[]; + /** + * this authorization's session + */ + readonly session: null | Session; /** * when OAuth authorization was updated * @@ -4742,9 +5057,15 @@ export interface AccessToken { /** * contents of the token to be used for authorization * - * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly token?: string; + /** + * the version of the token + * + * @example "1" + */ + readonly version?: number; } /** * @@ -4814,10 +5135,22 @@ export interface RefreshToken { /** * contents of the token to be used for authorization * - * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly token: string; } +/** + * + * this authorization's session + */ +export interface Session { + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} /** * * authenticated user associated with this authorization @@ -4866,6 +5199,36 @@ export interface OauthAuthorizationCreatePayload { */ readonly scope: string[]; } +export interface OauthAuthorizationUpdatePayload { + /** + * human-friendly description of this OAuth authorization + * + * @example "sample authorization" + */ + readonly description?: string; + /** + * identifier of the client that obtained this authorization + */ + client: OauthAuthorizationUpdatePayloadClient; +} +/** + * + * identifier of the client that obtained this authorization + */ +export interface OauthAuthorizationUpdatePayloadClient { + /** + * unique identifier of this OAuth client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * secret used to obtain OAuth authorizations under this client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly secret?: string; +} /** * * [Heroku Platform API - oauth-client](https://devcenter.heroku.com/articles/platform-api-reference#oauth-client) @@ -4957,7 +5320,7 @@ export interface OauthToken { /** * current access token */ - access_token: AccessToken; + access_token: OauthTokenAccessToken; /** * authorization for this set of tokens */ @@ -4985,7 +5348,7 @@ export interface OauthToken { /** * refresh token for this authorization */ - refresh_token: RefreshToken; + refresh_token: OauthTokenRefreshToken; /** * OAuth session using this token */ @@ -5001,6 +5364,30 @@ export interface OauthToken { */ user: OauthTokenUser; } +/** + * + * current access token + */ +export interface OauthTokenAccessToken { + /** + * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime + * + * @example 2592000 + */ + readonly expires_in: null | number; + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * contents of the token to be used for authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token: string; +} /** * * authorization for this set of tokens @@ -5045,15 +5432,33 @@ export interface OauthTokenGrant { } /** * - * OAuth session using this token + * refresh token for this authorization */ -export interface Session { +export interface OauthTokenRefreshToken { + /** + * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime + * + * @example 2592000 + */ + readonly expires_in: null | number; /** * unique identifier of OAuth token * * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly id: string; + /** + * contents of the token to be used for authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token: string; + /** + * the version of the token + * + * @example "1" + */ + readonly version: number; } /** * @@ -5098,119 +5503,283 @@ export interface OauthTokenCreatePayloadRefreshToken { /** * contents of the token to be used for authorization * - * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly token?: string; } /** * - * [Heroku Platform API - password-reset](https://devcenter.heroku.com/articles/platform-api-reference#password-reset) - * A password reset represents a in-process password reset attempt. + * [Heroku Platform API - oci-image](https://devcenter.heroku.com/articles/platform-api-reference#oci-image) + * An OCI (Open Container Initiative) image is a standardized format for packaging and distributing containerized applications, ready to run on the platform. */ -export interface PasswordReset { +export interface OciImage { /** - * when password reset was created + * unique identifier of the OCI image * - * @example "2012-01-01T12:00:00Z" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - readonly created_at: string; - user: User; -} -export interface PasswordResetResetPasswordPayload { + readonly id: string; /** - * unique email address of account + * name of the image used for the base layers of the OCI image * - * @example "username@example.com" + * @example "heroku/heroku:22-cnb" */ - email: string; -} -export interface PasswordResetCompleteResetPasswordPayload { + base_image_name: string; /** - * current password on the account + * the digest of the top most layer of the base image. * - * @example "currentpassword" + * @example "sha256:ea36ae5fbc1e7230e0a782bf216fb46500e210382703baa6bab8acf2c6a23f78" */ - readonly password: string; + base_top_layer: string; /** - * confirmation of the new password + * identification of the code in your version control system (eg: SHA of the git HEAD) * - * @example "newpassword" + * @example "60883d9e8947a57e04dc9124f25df004866a2051" */ - readonly password_confirmation: string; -} -/** - * - * [Heroku Platform API - peering-info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) - * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. - */ -export interface PeeringInfo { + commit: string; /** - * The AWS account ID of your Private Space. + * an optional description of the provided commit * - * @example "123456789012" + * @example "fixed a bug with API documentation" */ - readonly aws_account_id: string; + commit_description: string; /** - * region name used by provider + * name of the image registry repository used for storage * - * @example "us-east-1" + * @example "d7ba1ace-b396-4691-968c-37ae53153426/builds" */ - readonly aws_region: 'ap-south-1' | 'eu-west-1' | 'ap-southeast-1' | 'ap-southeast-2' | 'eu-central-1' | 'eu-west-2' | 'ap-northeast-2' | 'ap-northeast-1' | 'us-east-1' | 'sa-east-1' | 'us-west-1' | 'us-west-2' | 'ca-central-1'; + image_repo: string; /** - * The AWS VPC ID of the peer. + * unique identifier representing the content of the OCI image * - * @example "vpc-1234567890" + * @example "sha256:dc14ae5fbc1e7230e0a782bf216fb46500e210631703bcc6bab8acf2c6a23f42" */ - readonly vpc_id: string; + digest: string; /** - * An IP address and the number of significant bits that make up the routing or networking portion. + * stack associated to the OCI image + */ + stack: OciImageStack; + /** + * process types of the OCI image * - * @example "10.0.0.0/16" + * @example {"web":{"name":"web","display_cmd":"bundle exec puma -p $PORT","command":"/cnb/process/web","working_dir":"/workspace/webapp","default":true}} */ - vpc_cidr: string; + process_types: Record; /** - * The CIDR ranges that should be routed to the Private Space VPC. + * buildpacks of the OCI image */ - dyno_cidr_blocks: string[]; + buildpacks: Buildpack[]; /** - * The CIDR ranges that you must not conflict with. + * when the OCI image was created + * + * @example "2012-01-01T12:00:00Z" */ - unavailable_cidr_blocks: string[]; + readonly created_at: string; /** - * The CIDR ranges that should be routed to the Private Space VPC. + * when the OCI image was updated + * + * @example "2012-01-01T12:00:00Z" */ - space_cidr_blocks: string[]; + readonly updated_at: string; + /** + * build architecture for OCI image + * + * @example "arm64" + */ + architecture: string | null; } /** * - * [Heroku Platform API - peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) - * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + * [Heroku Platform API - stack](https://devcenter.heroku.com/articles/platform-api-reference#stack) + * stack associated to the OCI image */ -export interface Peering { +export interface OciImageStack { /** - * The type of peering connection. + * unique identifier of stack * - * @example "heroku-managed" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - type: 'heroku-managed' | 'customer-managed' | 'unknown'; + readonly id?: string; /** - * The AWS VPC Peering Connection ID of the peering. + * unique name of stack * - * @example "pcx-123456789012" + * @example "heroku-18" */ - readonly pcx_id: string; + readonly name?: string; +} +export interface OciImageCreatePayload { /** - * The CIDR blocks of the peer. + * build architecture for OCI image + * + * @example "arm64" */ - cidr_blocks: string[]; + architecture?: string | null; /** - * The status of the peering connection. + * name of the image used for the base layers of the OCI image * - * @example "pending-acceptance" + * @example "heroku/heroku:22-cnb" */ - readonly status: 'initiating-request' | 'pending-acceptance' | 'provisioning' | 'active' | 'failed' | 'expired' | 'rejected' | 'deleted'; + base_image_name?: string; /** - * The AWS VPC ID of the peer. + * the digest of the top most layer of the base image. + * + * @example "sha256:ea36ae5fbc1e7230e0a782bf216fb46500e210382703baa6bab8acf2c6a23f78" + */ + base_top_layer?: string; + /** + * identification of the code in your version control system (eg: SHA of the git HEAD) + * + * @example "60883d9e8947a57e04dc9124f25df004866a2051" + */ + commit?: string; + /** + * an optional description of the provided commit + * + * @example "fixed a bug with API documentation" + */ + commit_description?: string; + /** + * name of the image registry repository used for storage + * + * @example "d7ba1ace-b396-4691-968c-37ae53153426/builds" + */ + image_repo?: string; + /** + * unique identifier representing the content of the OCI image + * + * @example "sha256:dc14ae5fbc1e7230e0a782bf216fb46500e210631703bcc6bab8acf2c6a23f42" + */ + digest?: string; + /** + * unique name of stack or unique identifier of stack + */ + stack?: string; + /** + * process types of the OCI image + * + * @example {"web":{"name":"web","display_cmd":"bundle exec puma -p $PORT","command":"/cnb/process/web","working_dir":"/workspace/webapp","default":true}} + */ + process_types?: Record; + /** + * buildpacks of the OCI image + */ + buildpacks?: Buildpack[]; +} +/** + * + * [Heroku Platform API - password-reset](https://devcenter.heroku.com/articles/platform-api-reference#password-reset) + * A password reset represents a in-process password reset attempt. + */ +export interface PasswordReset { + /** + * when password reset was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + user: User; +} +export interface PasswordResetResetPasswordPayload { + /** + * unique email address of account + * + * @example "username@example.com" + */ + email: string; +} +export interface PasswordResetCompleteResetPasswordPayload { + /** + * current password on the account + * + * @example "currentpassword" + */ + readonly password: string; + /** + * confirmation of the new password + * + * @example "newpassword" + */ + readonly password_confirmation: string; +} +/** + * + * [Heroku Platform API - peering-info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) + * [Peering Info](https://devcenter.heroku.com/articles/private-space-vpc-peering?preview=1) gives you the information necessary to peer an AWS VPC to a Private Space. + */ +export interface PeeringInfo { + /** + * The AWS account ID of your Private Space. + * + * @example "123456789012" + */ + readonly aws_account_id: string; + /** + * The AWS region where your Private Space resides + * + * @example "us-west-1" + */ + readonly aws_region: 'ap-south-1' | 'eu-west-1' | 'ap-southeast-1' | 'ap-southeast-2' | 'eu-central-1' | 'ap-northeast-2' | 'ap-northeast-1' | 'us-east-1' | 'sa-east-1' | 'us-west-1' | 'us-west-2'; + /** + * The AWS VPC ID of the peer. + * + * @example "vpc-1234567890" + */ + readonly vpc_id: string; + /** + * An IP address and the number of significant bits that make up the routing or networking portion. + * + * @example "192.0.2.0/24" + */ + vpc_cidr: string; + /** + * The CIDR ranges that should be routed to the Private Space VPC. + */ + dyno_cidr_blocks: string[]; + /** + * The CIDR ranges that you must not conflict with. + */ + unavailable_cidr_blocks: string[]; + /** + * The CIDR ranges that should be routed to the Private Space VPC. + */ + space_cidr_blocks: string[]; +} +/** + * + * [Heroku Platform API - peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) + * [Peering](https://devcenter.heroku.com/articles/private-space-vpc-peering?preview=1) provides a way to peer your Private Space VPC to another AWS VPC. + */ +export interface Peering { + /** + * The type of peering connection. + * + * @example "heroku-managed" + */ + type: 'heroku-managed' | 'customer-managed' | 'unknown' | 'slowdb' | 'heroku-postgresql' | 'heroku-redis' | 'heroku-kafka' | 'heroku-cassandra'; + /** + * The AWS VPC Peering Connection ID of the peering. + * + * @example "pcx-123456789012" + */ + readonly pcx_id: string; + /** + * An IP address and the number of significant bits that make up the routing or networking portion. + * + * @example "192.0.2.0/24" + */ + cidr_block: string; + /** + * The CIDR blocks of the peer. + */ + cidr_blocks: string[]; + /** + * The status of the peering connection. + * + * @example "pending-acceptance" + */ + readonly status: 'initiating-request' | 'pending-acceptance' | 'provisioning' | 'active' | 'failed' | 'expired' | 'rejected' | 'deleted'; + /** + * The AWS VPC ID of the peer. * * @example "vpc-1234567890" */ @@ -5234,6 +5803,14 @@ export interface Peering { */ readonly expires: string; } +export interface PeeringAcceptPayload { + /** + * The AWS VPC Peering Connection ID of the peering. + * + * @example "pcx-123456789012" + */ + readonly pcx_id: string; +} /** * * [Heroku Platform API - permission-entity](https://devcenter.heroku.com/articles/platform-api-reference#permission-entity) @@ -5268,140 +5845,288 @@ export interface PermissionEntity { * Users that have access to the entity. */ users: Array<{ - /** - * unique email address of account - * - * @example "username@example.com" - */ email?: string; - /** - * unique identifier of an account - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ readonly id?: string; - /** - * enterprise account permissions - */ permissions?: string[]; }>; } /** * - * [Heroku Platform API - pipeline-coupling](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-coupling) - * Information about an app's coupling to a pipeline + * [Heroku Platform API - pipeline-build](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-build) + * Information about the latest builds of apps in a pipeline. A build represents the process of transforming code into build artifacts. */ -export interface PipelineCoupling { +export interface PipelineBuild { /** - * app involved in the pipeline coupling + * app that the build belongs to */ - app?: PipelineCouplingApp; + app: PipelineBuildApp; /** - * when pipeline coupling was created + * buildpacks executed for this build, in order (only applicable to Cedar-generation apps) + */ + buildpacks: Array<{ + url?: string; + name?: string; + }> | null; + /** + * when build was created * * @example "2012-01-01T12:00:00Z" */ - readonly created_at?: string; + readonly created_at: string; /** - * unique identifier of pipeline coupling + * unique identifier of build * * @example "01234567-89ab-cdef-0123-456789abcdef" */ - readonly id?: string; + readonly id: string; /** - * pipeline involved in the coupling + * Build process output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). + * + * @example "https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef" */ - pipeline?: Pipeline; + readonly output_stream_url: string; /** - * target pipeline stage + * location of gzipped tarball of source code used to create build + */ + source_blob: PipelineBuildSourceBlob; + /** + * release resulting from the build * - * @example "production" + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} */ - stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; + readonly release: null | BuildRelease; /** - * when pipeline coupling was updated + * slug created by this build + */ + slug: PipelineBuildSlug | null; + /** + * stack of build + * + * @example "heroku-22" + */ + readonly stack: string; + /** + * status of build + * + * @example "succeeded" + */ + readonly status: 'failed' | 'pending' | 'succeeded'; + /** + * when build was updated * * @example "2012-01-01T12:00:00Z" */ - readonly updated_at?: string; + readonly updated_at: string; + /** + * user that started the build + */ + user: User; } /** * * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) - * app involved in the pipeline coupling + * app that the build belongs to */ -export interface PipelineCouplingApp { +export interface PipelineBuildApp { /** * unique identifier of app * * @example "01234567-89ab-cdef-0123-456789abcdef" */ - readonly id?: string; + readonly id: string; } /** * - * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) - * A pipeline allows grouping of apps into different stages. + * location of gzipped tarball of source code used to create build */ -export interface Pipeline { +export interface PipelineBuildSourceBlob { /** - * when pipeline was created + * an optional checksum of the gzipped tarball for verifying its integrity * - * @example "2012-01-01T12:00:00Z" + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" */ - readonly created_at?: string; + readonly checksum: null | string; /** - * unique identifier of pipeline + * URL where gzipped tar archive of source code for build was downloaded. * - * @example "01234567-89ab-cdef-0123-456789abcdef" + * @example "https://example.com/source.tgz?token=xyz" */ - readonly id?: string; + readonly url: string; /** - * name of pipeline + * version of the gzipped tarball * - * @example "example" - */ - name?: string; - /** - * Owner of a pipeline. + * @example "v1.3.0" */ - owner?: PipelineOwner | null; + readonly version: string | null; /** - * when pipeline was updated + * version description of the gzipped tarball * - * @example "2012-01-01T12:00:00Z" + * @example "* Fake User: Change session key" */ - readonly updated_at?: string; + readonly version_description: string | null; } -export interface PipelineCouplingCreatePayload { - /** - * unique identifier of app or unique name of app - */ - app: string; +/** + * + * [Heroku Platform API - slug](https://devcenter.heroku.com/articles/platform-api-reference#slug) + * slug created by this build + */ +export interface PipelineBuildSlug { /** - * unique identifier of pipeline + * unique identifier of slug * * @example "01234567-89ab-cdef-0123-456789abcdef" */ - readonly pipeline: string; - /** - * target pipeline stage - * - * @example "production" - */ - stage: 'test' | 'review' | 'development' | 'staging' | 'production'; + readonly id: string; } -export interface PipelineCouplingUpdatePayload { +/** + * + * [Heroku Platform API - pipeline-config-var](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-config-var) + * Pipeline config vars in Heroku CI and review apps used to manage the configuration information for a pipeline. + */ +export interface PipelineConfigVar { /** - * target pipeline stage + * user-defined config var name and value * - * @example "production" + * @example {"FOO":"bar"} */ - stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; + '["NAME"]: ["value"]': Record; } /** * - * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * [Heroku Platform API - pipeline-coupling](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-coupling) + * Information about an app's coupling to a pipeline + */ +export interface PipelineCoupling { + /** + * app involved in the pipeline coupling + */ + app?: PipelineCouplingApp; + /** + * when pipeline coupling was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of pipeline coupling + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * pipeline involved in the coupling + */ + pipeline?: Pipeline; + /** + * target pipeline stage + * + * @example "production" + */ + stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; + /** + * when pipeline coupling was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app involved in the pipeline coupling + */ +export interface PipelineCouplingApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - pipeline](https://devcenter.heroku.com/articles/platform-api-reference#pipeline) + * A pipeline allows grouping of apps into different stages. + */ +export interface Pipeline { + /** + * when pipeline was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of pipeline + * + * @example "example" + */ + name?: string; + /** + * Owner of a pipeline. + */ + owner?: PipelineOwner | null; + /** + * when pipeline was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; + /** + * the generation of the Heroku platform for this pipeline + */ + generation?: PipelineGeneration; +} +export interface PipelineCouplingCreatePayload { + /** + * unique identifier of app or unique name of app + */ + app: string; + /** + * unique identifier of pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly pipeline: string; + /** + * target pipeline stage + * + * @example "production" + */ + stage: 'test' | 'review' | 'development' | 'staging' | 'production'; +} +export interface PipelineCouplingUpdatePayload { + /** + * target pipeline stage + * + * @example "production" + */ + stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; +} +/** + * + * a build artifact for the release + */ +export interface Artifact { + /** + * type of artifact + * + * @example "oci-image" + */ + type?: string; + /** + * unique identifier of slug or unique identifier of the OCI image + */ + id?: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) * app involved in the release */ export interface ReleaseApp { @@ -5418,6 +6143,18 @@ export interface ReleaseApp { */ readonly id?: string; } +/** + * + * OCI image running in this release + */ +export interface ReleaseOciImage { + /** + * unique identifier of the OCI image + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} /** * * [Heroku Platform API - pipeline-promotion-target](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion-target) @@ -5567,9 +6304,6 @@ export interface PipelinePromotionCreatePayload { */ source: PipelinePromotionCreatePayloadSource; targets: Array<{ - /** - * the app is being promoted to - */ app?: PipelinePromotionCreatePayloadApp; }>; } @@ -5610,6 +6344,119 @@ export interface PipelinePromotionCreatePayloadApp { */ readonly id: string; } +/** + * + * [Heroku Platform API - pipeline-release](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-release) + * Information about the latest release of each app in a pipeline. A release makes a deployment available to end-users. + */ +export interface PipelineRelease { + /** + * add-on plans installed on the app for this release + */ + addon_plan_names: string[]; + /** + * a build artifact for the release + */ + readonly artifacts: Artifact; + /** + * app involved in the release + */ + app: PipelineReleaseApp; + /** + * when release was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of changes in this release + * + * @example "Added new feature" + */ + readonly description: string; + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * when release was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * slug running in the release + */ + slug: PipelineReleaseSlug | null; + /** + * current status of the release + * + * @example "succeeded" + */ + readonly status: 'expired' | 'failed' | 'pending' | 'succeeded'; + /** + * user that created the release + */ + user: User; + /** + * unique version assigned to the release + * + * @example 11 + */ + readonly version: number; + /** + * indicates if this release is the current one for the app + * + * @example true + */ + readonly current: boolean; + /** + * URL that the release command output streams to. The stream is available as either `text/plain` or `text/event-stream`. Prepare clients to handle disconnects and to resume the stream by sending a `Range` header for `text/plain` or a `Last-Event-Id` header for `text/event-stream`. + * + * @example "https://release-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef" + */ + readonly output_stream_url: string | null; + /** + * indicates if this release is eligible for rollback + * + * @example true + */ + readonly eligible_for_rollback: boolean; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app involved in the release + */ +export interface PipelineReleaseApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - slug](https://devcenter.heroku.com/articles/platform-api-reference#slug) + * slug running in the release + */ +export interface PipelineReleaseSlug { + /** + * unique identifier of slug + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} /** * * [Heroku Platform API - pipeline-stack](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-stack) @@ -5686,6 +6533,25 @@ export interface PipelineOwner { */ type: string; } +/** + * + * [Heroku Platform API - generation](https://devcenter.heroku.com/articles/platform-api-reference#generation) + * the generation of the Heroku platform for this pipeline + */ +export interface PipelineGeneration { + /** + * unique identifier of the generation of the Heroku platform for this pipeline + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of the generation of the Heroku platform for this pipeline + * + * @example "cedar" + */ + readonly name?: string; +} export interface PipelineCreatePayload { /** * name of pipeline @@ -5744,10 +6610,14 @@ export interface ReleaseCreatePayload { * @example "Added new feature" */ readonly description?: string; + /** + * unique identifier of the OCI image or unique identifier representing the content of the OCI image + */ + oci_image?: string; /** * unique identifier of slug */ - slug: string; + slug?: string; } export interface ReleaseRollbackPayload { /** @@ -6163,7 +7033,7 @@ export interface SniEndpointApp { */ export interface SslCert { readonly 'ca_signed?'?: boolean; - readonly cert_domains?: unknown[]; + readonly cert_domains?: []; readonly expires_at?: string; readonly issuer?: string; readonly 'self_signed?'?: boolean; @@ -6331,20 +7201,8 @@ export interface SpaceTopology { * The apps within this space */ readonly apps: Array<{ - /** - * unique identifier of app - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ readonly id?: string; - /** - * - * @example ["example.com","example.net"] - */ - readonly domains?: unknown[]; - /** - * formations for application - */ + readonly domains?: []; readonly formation?: SpaceTopologyFormation[]; }>; } @@ -6495,15 +7353,39 @@ export interface SpaceCreatePayload { * @example "https://example.com/logs" */ log_drain_url?: string; -} -/** - * - * [Heroku Platform API - team-app-collaborator](https://devcenter.heroku.com/articles/platform-api-reference#team-app-collaborator) - * A team collaborator represents an account that has been given access to a team app on Heroku. - */ -export interface TeamAppCollaborator { /** - * app collaborator belongs to + * channel to create the space on + * + * @example "some-channel" + */ + channel_name?: string; + /** + * generation for space + * + * @example "fir" + */ + generation?: string; + /** + * runtime features for the space + * + * @example "[feature-name]" + */ + features?: []; + /** + * supported api features for the space + * + * @example "[api-feature-name]" + */ + supported_features?: []; +} +/** + * + * [Heroku Platform API - team-app-collaborator](https://devcenter.heroku.com/articles/platform-api-reference#team-app-collaborator) + * A team collaborator represents an account that has been given access to a team app on Heroku. + */ +export interface TeamAppCollaborator { + /** + * app collaborator belongs to */ app?: TeamAppCollaboratorApp; /** @@ -7201,7 +8083,7 @@ export interface TeamMonthlyUsage { */ apps: AppUsageMonthly[]; /** - * average connect rows synced + * max connect rows synced * * @example 15000 */ @@ -7446,6 +8328,133 @@ export interface TeamCreateInEnterpriseAccountPayload { */ readonly name: string; } +/** + * + * [Heroku Platform API - telemetry-drain](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-drain) + * A telemetry drain forwards OpenTelemetry traces, metrics, and logs to your own consumer. For Fir-generation apps only. + */ +export interface TelemetryDrain { + /** + * when the telemetry drain was created + * + * @example "2024-12-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of telemetry drain + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * entity that owns this telemetry drain + */ + owner: TelemetryDrainOwner; + /** + * OpenTelemetry signals to send to telemetry drain + * + * @example ["traces","metrics"] + */ + signals: 'traces' | 'metrics' | Array<'logs'>; + /** + * OpenTelemetry exporter configuration + */ + exporter: Exporter; + /** + * when telemetry drain was last updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * entity that owns this telemetry drain + */ +export interface TelemetryDrainOwner { + /** + * unique identifier of owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * type of owner + * + * @example "app" + */ + readonly type: 'app' | 'space'; +} +/** + * + * OpenTelemetry exporter configuration + */ +export interface Exporter { + /** + * the transport type to be used for your OpenTelemetry consumer + * + * @example "otlphttp" + */ + readonly type: 'otlphttp' | 'otlp'; + /** + * URI of your OpenTelemetry consumer + * + * @example "https://api.otelproduct.example/consumer" + */ + endpoint: string; + /** + * JSON headers to send to your OpenTelemetry consumer + * + * @example {"API-Key":"example_api_key_012345","Environment":"production"} + */ + headers?: Record; +} +export interface TelemetryDrainCreatePayload { + /** + * entity that owns this telemetry drain + */ + owner: TelemetryDrainCreatePayloadOwner; + /** + * OpenTelemetry signals to send to telemetry drain + * + * @example ["traces","metrics"] + */ + signals: 'traces' | 'metrics' | Array<'logs'>; + /** + * OpenTelemetry exporter configuration + */ + exporter: Exporter; +} +/** + * + * entity that owns this telemetry drain + */ +export interface TelemetryDrainCreatePayloadOwner { + /** + * unique identifier of owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * type of owner + * + * @example "app" + */ + readonly type: 'app' | 'space'; +} +export interface TelemetryDrainUpdatePayload { + /** + * OpenTelemetry signals to send to telemetry drain + * + * @example ["traces","metrics"] + */ + signals?: 'traces' | 'metrics' | Array<'logs'>; + /** + * OpenTelemetry exporter configuration + */ + exporter?: Exporter; +} /** * * [Heroku Platform API - test-case](https://devcenter.heroku.com/articles/platform-api-reference#test-case) @@ -7707,276 +8716,1280 @@ export interface TestRunCreatePayload { /** * whether the test run was started for interactive debugging */ - debug?: boolean; + debug?: boolean; + /** + * unique name of team or unique identifier of team + */ + organization?: string; + /** + * unique identifier of pipeline or name of pipeline + */ + pipeline: string; + /** + * The download location for the source code to be tested + */ + source_blob_url: string; +} +export interface TestRunUpdatePayload { + /** + * current state of the test run + */ + readonly status: 'pending' | 'cancelled' | 'creating' | 'building' | 'running' | 'succeeded' | 'failed' | 'errored' | 'debugging'; + /** + * human friendly message indicating reason for an error + */ + message: string | null; +} +/** + * + * [Heroku Platform API - user-preferences](https://devcenter.heroku.com/articles/platform-api-reference#user-preferences) + * Tracks a user's preferences and message dismissals + */ +export interface UserPreferences { + /** + * User's default timezone + * + * @example "UTC" + */ + timezone: string | null; + /** + * User's default team + * + * @example "sushi-inc" + */ + 'default-organization': string | null; + /** + * Whether the user has dismissed the GitHub link banner + * + * @example true + */ + 'dismissed-github-banner': boolean | null; + /** + * Whether the user has dismissed the getting started banner + * + * @example true + */ + 'dismissed-getting-started': boolean | null; + /** + * Whether the user has dismissed the Organization Access Controls banner + * + * @example true + */ + 'dismissed-org-access-controls': boolean | null; + /** + * Whether the user has dismissed the Organization Wizard + * + * @example true + */ + 'dismissed-org-wizard-notification': boolean | null; + /** + * Whether the user has dismissed the Pipelines banner + * + * @example true + */ + 'dismissed-pipelines-banner': boolean | null; + /** + * Whether the user has dismissed the GitHub banner on a pipeline overview + * + * @example true + */ + 'dismissed-pipelines-github-banner': boolean | null; + /** + * Which pipeline uuids the user has dismissed the GitHub banner for + * + * @example ["96c68759-f310-4910-9867-e0b062064098"] + */ + 'dismissed-pipelines-github-banners': null | string[]; + /** + * Whether the user has dismissed the 2FA SMS banner + * + * @example true + */ + 'dismissed-sms-banner': boolean | null; +} +export interface UserPreferencesUpdatePayload { + /** + * User's default timezone + * + * @example "UTC" + */ + timezone?: string | null; + /** + * User's default team + * + * @example "sushi-inc" + */ + 'default-organization'?: string | null; + /** + * Whether the user has dismissed the GitHub link banner + * + * @example true + */ + 'dismissed-github-banner'?: boolean | null; + /** + * Whether the user has dismissed the getting started banner + * + * @example true + */ + 'dismissed-getting-started'?: boolean | null; + /** + * Whether the user has dismissed the Organization Access Controls banner + * + * @example true + */ + 'dismissed-org-access-controls'?: boolean | null; + /** + * Whether the user has dismissed the Organization Wizard + * + * @example true + */ + 'dismissed-org-wizard-notification'?: boolean | null; + /** + * Whether the user has dismissed the Pipelines banner + * + * @example true + */ + 'dismissed-pipelines-banner'?: boolean | null; + /** + * Whether the user has dismissed the GitHub banner on a pipeline overview + * + * @example true + */ + 'dismissed-pipelines-github-banner'?: boolean | null; + /** + * Which pipeline uuids the user has dismissed the GitHub banner for + * + * @example ["96c68759-f310-4910-9867-e0b062064098"] + */ + 'dismissed-pipelines-github-banners'?: null | string[]; + /** + * Whether the user has dismissed the 2FA SMS banner + * + * @example true + */ + 'dismissed-sms-banner'?: boolean | null; +} +/** + * + * [Heroku Platform API - vpn-connection](https://devcenter.heroku.com/articles/platform-api-reference#vpn-connection) + * [VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN. + */ +export interface VpnConnection { + /** + * VPN ID + * + * @example "123456789012" + */ + readonly id: string; + /** + * VPN Name + * + * @example "office" + */ + name: string; + /** + * Public IP of VPN customer gateway + * + * @example "35.161.69.30" + */ + public_ip: string; + /** + * Routable CIDRs of VPN + */ + routable_cidrs: string[]; + /** + * CIDR Block of the Private Space + * + * @example "10.0.0.0/16" + */ + readonly space_cidr_block: string; + tunnels: Tunnel[]; + /** + * IKE Version + * + * @example 1 + */ + readonly ike_version: number; + /** + * Status of the VPN + * + * @example "active" + */ + readonly status: 'pending' | 'provisioning' | 'active' | 'deprovisioning' | 'failed'; + /** + * Details of the status + * + * @example "supplied CIDR block already in use" + */ + readonly status_message: string; +} +/** + * + * Tunnel info + */ +export interface Tunnel { + /** + * Timestamp of last status changed + * + * @example "2016-10-25T22:09:05Z" + */ + last_status_change?: string; + /** + * Public IP address for the tunnel + * + * @example "52.44.146.197" + */ + ip?: string; + /** + * Public IP address for the customer side of the tunnel + * + * @example "52.44.146.197" + */ + customer_ip?: string; + /** + * Pre-shared key + * + * @example "secret" + */ + pre_shared_key?: string; + /** + * Status of the tunnel + * + * @example "UP" + */ + status?: 'UP' | 'DOWN'; + /** + * Details of the status + * + * @example "status message" + */ + status_message?: string; +} +export interface VpnConnectionCreatePayload { + /** + * VPN Name + * + * @example "office" + */ + name: string; + /** + * Public IP of VPN customer gateway + * + * @example "35.161.69.30" + */ + public_ip: string; + /** + * Routable CIDRs of VPN + */ + routable_cidrs: string[]; +} +export interface VpnConnectionUpdatePayload { + /** + * Routable CIDRs of VPN + */ + routable_cidrs: string[]; +} +/** + * + * [Heroku Platform API - add-on-sso](https://devcenter.heroku.com/articles/platform-api-reference#add-on-sso) + * Add-on Single Sign-on generates URL that allows a customer to log in to an Add-on Service's web dashboard. + */ +export interface AddOnSso { + /** + * whether this SSO request is a GET or a POST + * + * @example "get" + */ + readonly method: 'get' | 'post'; + /** + * URL to follow to initiate single sign-on + * + * @example "https://slowdb.heroku.com/heroku/resources/" + */ + readonly action: string; + /** + * params for this request + */ + readonly params: Params; +} +/** + * + * params for this request + */ +export interface Params { + /** + * unique email address of current user + * + * @example "username@example.com" + */ + readonly email?: string; + /** + * unique identifier of current user + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly user_id?: string; + /** + * name of app where add-on was first attached + * + * @example "example" + */ + readonly owning_app?: string; + /** + * current app name when SSO was requested + * + * @example "example" + */ + readonly attached_app?: string; + /** + * timestamp used to build params as an unix epoch integer + * + * @example "1325419200" + */ + readonly timestamp?: number; + /** + * Base64-encoded nav data for Heroku header + * + * @example "example" + */ + readonly 'nav-data'?: string; + /** + * id of this add-on with its provider + * + * @example "abcd1234" + */ + readonly id?: string; + /** + * token generated for this request that authenticates user + * + * @example "0123456789abcdef0123456789abcdef01234578" + */ + readonly token?: string; + /** + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly resource_id?: string; + /** + * unique token for this SSO request + * + * @example "bb466eb1d6bc345d11072c3cd25c311f21be130d" + */ + readonly resource_token?: string; +} +/** + * + * [Heroku Platform API - build-metadata](https://devcenter.heroku.com/articles/platform-api-reference#build-metadata) + * Build metadata contains the reference data for building the associated App. + */ +export interface BuildMetadata { + /** + * App associated with this metadata + */ + app: BuildMetadataApp; + /** + * URL for deleting the build cache. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly cache_delete_url: string; + /** + * URL for retrieving the latest build cache. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly cache_get_url: string; + /** + * URL for updating the latest build cache. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly cache_put_url: string; + /** + * URL for deleting this app's repo. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly repo_delete_url: string; + /** + * URL for retrieving this app's repo. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly repo_get_url: string; + /** + * URL for updating the app's repo. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly repo_put_url: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * App associated with this metadata + */ +export interface BuildMetadataApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - capability](https://devcenter.heroku.com/articles/platform-api-reference#capability) + * A capability represents a requested capability on a resource along with whether the requesting user has that capability + */ +export interface Capability { + /** + * name of the capability + * + * @example "manage_dynos" + */ + readonly capability: string; + /** + * id or name of the resource + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly resource_id: null | string; + /** + * type of the resource + * + * @example "app" + */ + readonly resource_type: string; + /** + * whether the user has the capability on the resource_id of type resource_type + * + * @example true + */ + readonly capable: boolean; + /** + * whether the given application resource is flagged as a paranoid app and will require a second factor + * + * @example true + */ + readonly requires_second_factor?: boolean; + /** + * canonical id of the resource if it's present + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly resource_canonical_id?: string; +} +export interface CapabilityCapabilitiesPayload { + /** + * The list of capabilities that you want to check + */ + capabilities: CapabilityRequest[]; +} +/** + * + * an object representing the requested capability + */ +export interface CapabilityRequest { + /** + * name of the capability + * + * @example "manage_dynos" + */ + readonly capability: string; + /** + * id or name of the resource + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly resource_id: null | string; + /** + * type of the resource + * + * @example "app" + */ + readonly resource_type: string; +} +export interface CapabilityCapabilitiesResponse { + /** + * The list of capabilities for the requested resources + */ + capabilities?: Capability[]; +} +/** + * + * [Heroku Platform API - config-vars-settings](https://devcenter.heroku.com/articles/platform-api-reference#config-vars-settings) + * The Config Vars Settings endpoints enable you to view and manage the configuration provided to an app on Heroku. These endpoints are similar to /config-vars but also allow you to check which config vars you can mask, and which are currently masked. + */ +export interface ConfigVarsSettings { + /** + * attachment that created this config var, if any + */ + attachment: ConfigVarsSettingsAttachment | null; + /** + * name of the config var + * + * @example "FOO_TOKEN" + */ + key: string; + /** + * value of the config var + * + * @example "bar" + */ + value: string | null; + /** + * indicates if the value is masked + */ + masked: boolean; + /** + * indicates if you can mask the value + * + * @example true + */ + readonly masking_supported: boolean; + /** + * indicates when the value was updated + * + * @example "2024-01-01T12:00:00Z" + */ + readonly value_updated_at: string; +} +/** + * + * attachment that created this config var, if any + */ +export interface ConfigVarsSettingsAttachment { + /** + * unique identifier of this add-on attachment + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface ConfigVarsSettingsUpdatePayload { + /** + * An array of config vars to be updated. + */ + config?: []; +} +/** + * + * [Heroku Platform API - dyno-processes](https://devcenter.heroku.com/articles/platform-api-reference#dyno-processes) + * Run processes inside existing dynos. + */ +export interface DynoProcesses { + /** + * a URL to stream output from for attached processes or null for non-attached processes + * + * @example "rendezvous://rendezvous.runtime.heroku.com:5000/{rendezvous-id}" + */ + readonly attach_url: string | null; +} +export interface DynoProcessesCreatePayload { + /** + * command used to start this process + * + * @example "bash" + */ + command: string; + /** + * custom environment to add to the dyno config vars + * + * @example {"COLUMNS":"80","LINES":"24"} + */ + env?: Record; +} +/** + * + * [Heroku Platform API - gateway-token](https://devcenter.heroku.com/articles/platform-api-reference#gateway-token) + * Contains a set of information useful for identifying a user and the type of access this user is allowed to have. + */ +export interface GatewayToken { + /** + * Token issuer + * + * @example "2012-01-01T12:00:00Z" + */ + readonly iss: string; + /** + * Integer representation of the timestamp the token was issued at + * + * @example 1526341325 + */ + readonly iat: number; + /** + * Integer representation of the timestamp the token should expire at + * + * @example 1526341325 + */ + readonly exp: number; + /** + * Unique identifier of the subject + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly sub: string; + /** + * Unique identifier of the user + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly user_id: string; + /** + * Email address of the user + * + * @example "username@example.com" + */ + readonly user_email: string; + /** + * Unique identifier of the OAuth authirization used in the token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly authorization_id: string | null; + /** + * Indicates that a rate limit should be enforced + * + * @example true + */ + readonly rate_limit_enabled: boolean; + /** + * Rate limit multiplier that should be used + * + * @example 2 + */ + readonly rate_limit_multiplier: number; + /** + * Describes if the token contains second factor claim + * + * @example true + */ + readonly second_factor: boolean; + /** + * Describes if the token contains sudo claim + * + * @example true + */ + readonly sudo: boolean; + /** + * Unique identifier of the sudoer if sudo was used + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly sudo_user_id: string | null; + /** + * Reason for using sudo if present + * + * @example "Ticket #123" + */ + readonly sudo_reason: string | null; + /** + * Describes if the token contains sudo force claim + * + * @example true + */ + readonly sudo_force: boolean; +} +/** + * + * [Heroku Platform API - identity-provider-actions](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-actions) + * Actions taken on Identity Providers, the SSO configuration representation. + */ +export interface IdentityProviderActions { + /** + * Array of sso certificates belonging to this identity provider + */ + certificates: Array<{ + readonly created_at?: string; + readonly id?: string; + readonly expires_at?: string; + body?: string; + name?: string | null; + }>; + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate: string | null; + /** + * when provider record was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * URL identifier provided by the identity provider + * + * @example "https://customer-domain.idp.com" + */ + entity_id: string; + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * user-friendly unique identifier for this identity provider + * + * @example "acme-sso" + */ + name: string; + /** + * entity that owns this identity provider + */ + owner: Owner; + /** + * single log out URL for this identity provider + * + * @example "https://example.com/idp/logout" + */ + slo_target_url: string; + /** + * single sign on URL for this identity provider + * + * @example "https://example.com/idp/login" + */ + sso_target_url: string; + /** + * when the identity provider record was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - identity-provider-certificate](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-certificate) + * Certificates represent an sso cert attached to an Identity Provider + */ +export interface IdentityProviderCertificate { + /** + * label for certificate + * + * @example "Certificate 1" + */ + name: string | null; + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + body: string; + /** + * when provider record was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * time which the certificate expires + * + * @example "2012-01-01T12:00:00Z" + */ + readonly expires_at: string; + /** + * unique identifier of the identity provider the cert belongs to + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly identity_provider_id: string; +} +export interface IdentityProviderCertificateCreatePayload { + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + body: string; + /** + * label for certificate + * + * @example "Certificate 1" + */ + name?: string | null; +} +export interface IdentityProviderCertificateUpdatePayload { + /** + * label for certificate + * + * @example "Certificate 1" + */ + name?: string | null; +} +/** + * + * [Heroku Platform API - payment-method](https://devcenter.heroku.com/articles/platform-api-reference#payment-method) + * The on file payment method for an account + */ +export interface PaymentMethod { + /** + * street address line 1 + * + * @example "40 Hickory Lane" + */ + address_1?: string | null; + /** + * street address line 2 + * + * @example "Suite 103" + */ + address_2?: string; + /** + * last 4 digits of credit card number + * + * @example "1234" + */ + readonly card_last4?: string; + /** + * name of credit card issuer + * + * @example "VISA" + */ + readonly card_type?: string; + /** + * city + * + * @example "San Francisco" + */ + city?: string; + /** + * country + * + * @example "US" + */ + country?: string; + /** + * expiration month + * + * @example "11" + */ + expiration_month?: string | null; + /** + * expiration year + * + * @example "2014" + */ + expiration_year?: string | null; + /** + * the first name for payment method + * + * @example "Jason" + */ + first_name?: string; + /** + * the last name for payment method + * + * @example "Walker" + */ + last_name?: string; + /** + * metadata + * + * @example "Additional information for payment method" + */ + other?: string | null; + /** + * postal code + * + * @example "90210" + */ + postal_code?: string; + /** + * state + * + * @example "CA" + */ + state?: string; +} +export interface PaymentMethodUpdatePayload { + /** + * street address line 1 + * + * @example "40 Hickory Lane" + */ + address_1?: string | null; + /** + * street address line 2 + * + * @example "Suite 103" + */ + address_2?: string; + /** + * encrypted card number of payment method + * + * @example "encrypted-card-number" + */ + card_number?: string | null; + /** + * city + * + * @example "San Francisco" + */ + city?: string; + /** + * country + * + * @example "US" + */ + country?: string; + /** + * card verification value + * + * @example "123" + */ + cvv?: string | null; /** - * unique name of team or unique identifier of team + * expiration month + * + * @example "11" */ - organization?: string; + expiration_month?: string | null; /** - * unique identifier of pipeline or name of pipeline + * expiration year + * + * @example "2014" */ - pipeline: string; + expiration_year?: string | null; /** - * The download location for the source code to be tested + * the first name for payment method + * + * @example "Jason" */ - source_blob_url: string; -} -export interface TestRunUpdatePayload { + first_name?: string; /** - * current state of the test run + * the last name for payment method + * + * @example "Walker" */ - readonly status: 'pending' | 'cancelled' | 'creating' | 'building' | 'running' | 'succeeded' | 'failed' | 'errored' | 'debugging'; + last_name?: string; /** - * human friendly message indicating reason for an error + * metadata + * + * @example "Additional information for payment method" */ - message: string | null; -} -/** - * - * [Heroku Platform API - user-preferences](https://devcenter.heroku.com/articles/platform-api-reference#user-preferences) - * Tracks a user's preferences and message dismissals - */ -export interface UserPreferences { + other?: string | null; /** - * User's default timezone + * postal code * - * @example "UTC" + * @example "90210" */ - timezone: string | null; + postal_code?: string; /** - * User's default team + * state * - * @example "sushi-inc" + * @example "CA" */ - 'default-organization': string | null; + state?: string; /** - * Whether the user has dismissed the GitHub link banner + * Nonce generated by Braintree hosted fields form * - * @example true + * @example "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" */ - 'dismissed-github-banner': boolean | null; + nonce?: string | null; /** - * Whether the user has dismissed the getting started banner + * Device data string generated by the client * - * @example true + * @example "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" */ - 'dismissed-getting-started': boolean | null; + device_data?: string; +} +/** + * + * [Heroku Platform API - payment](https://devcenter.heroku.com/articles/platform-api-reference#payment) + * A payment represents money collected for an account + */ +export interface Payment { /** - * Whether the user has dismissed the Organization Access Controls banner + * amount of payment in cents * - * @example true + * @example 50000 */ - 'dismissed-org-access-controls': boolean | null; + amount?: number; /** - * Whether the user has dismissed the Organization Wizard + * when payment was created * - * @example true + * @example "2012-01-01T12:00:00Z" */ - 'dismissed-org-wizard-notification': boolean | null; + readonly created_at?: string; /** - * Whether the user has dismissed the Pipelines banner + * legacy unique identifier of payment * - * @example true + * @example 9403943 */ - 'dismissed-pipelines-banner': boolean | null; + readonly id?: number; /** - * Whether the user has dismissed the GitHub banner on a pipeline overview - * - * @example true + * identity of invoice */ - 'dismissed-pipelines-github-banner': boolean | null; + invoice?: null | PaymentInvoice; /** - * Which pipeline uuids the user has dismissed the GitHub banner for + * when credit was updated * - * @example ["96c68759-f310-4910-9867-e0b062064098"] + * @example "2012-01-01T12:00:00Z" */ - 'dismissed-pipelines-github-banners': null | string[]; + readonly updated_at?: string; /** - * Whether the user has dismissed the 2FA SMS banner + * identity of user issuing payment + */ + user?: User; + /** + * state of the payment * - * @example true + * @example "pending" */ - 'dismissed-sms-banner': boolean | null; + readonly state?: 'failure' | 'pending' | 'success'; } -export interface UserPreferencesUpdatePayload { +/** + * + * [Heroku Platform API - invoice](https://devcenter.heroku.com/articles/platform-api-reference#invoice) + * identity of invoice + */ +export interface PaymentInvoice { /** - * User's default timezone + * unique identifier of this invoice * - * @example "UTC" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - timezone?: string | null; + readonly id?: string; /** - * User's default team + * human readable invoice number * - * @example "sushi-inc" + * @example 9403943 */ - 'default-organization'?: string | null; + readonly number?: number; +} +export interface PaymentCreatePayload { /** - * Whether the user has dismissed the GitHub link banner + * amount of payment in cents * - * @example true + * @example 50000 */ - 'dismissed-github-banner'?: boolean | null; + amount: number; /** - * Whether the user has dismissed the getting started banner - * - * @example true + * human readable invoice number */ - 'dismissed-getting-started'?: boolean | null; + invoice_id: number; /** - * Whether the user has dismissed the Organization Access Controls banner + * unique identifier for a payment transaction * - * @example true + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - 'dismissed-org-access-controls'?: boolean | null; + uuid: string; +} +/** + * + * [Heroku Platform API - space-host](https://devcenter.heroku.com/articles/platform-api-reference#space-host) + * [Space Hosts](https://devcenter.heroku.com/articles/private-spaces-dedicated-hosts?preview=1) lists dedicated hosts allocated to a space + */ +export interface SpaceHost { /** - * Whether the user has dismissed the Organization Wizard + * unique identifier of this host * - * @example true + * @example "h-05abcdd96ee9ca123" */ - 'dismissed-org-wizard-notification'?: boolean | null; + readonly host_id: string; /** - * Whether the user has dismissed the Pipelines banner + * availability of this space * - * @example true + * @example "available" */ - 'dismissed-pipelines-banner'?: boolean | null; + readonly state: 'available' | 'under-assessment' | 'permanent-failure' | 'released' | 'released-permanent-failure'; /** - * Whether the user has dismissed the GitHub banner on a pipeline overview + * approximate available capacity on this host expresses a percentage * - * @example true + * @example 67 */ - 'dismissed-pipelines-github-banner'?: boolean | null; + readonly available_capacity_percentage: number; /** - * Which pipeline uuids the user has dismissed the GitHub banner for + * when the host was allocated * - * @example ["96c68759-f310-4910-9867-e0b062064098"] + * @example "2012-01-01T12:00:00Z" */ - 'dismissed-pipelines-github-banners'?: null | string[]; + readonly allocated_at: string; /** - * Whether the user has dismissed the 2FA SMS banner + * when the host was released * - * @example true + * @example "2012-01-01T12:00:00Z" */ - 'dismissed-sms-banner'?: boolean | null; + readonly released_at: string; +} +export interface SpaceLogDrainUpdatePayload { + url?: string; } /** * - * [Heroku Platform API - vpn-connection](https://devcenter.heroku.com/articles/platform-api-reference#vpn-connection) - * [VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN. + * [Heroku Platform API - team-license](https://devcenter.heroku.com/articles/platform-api-reference#team-license) + * A team license is credits provided and consumed by the team. */ -export interface VpnConnection { +export interface TeamLicense { /** - * VPN ID + * when license started * - * @example "123456789012" + * @example "2012-01-01" */ - readonly id: string; + readonly start_date: string; /** - * VPN Name + * when license ended * - * @example "office" + * @example "2012-01-01" */ - name: string; + readonly end_date: string; /** - * Public IP of VPN customer gateway + * quantity of the license * - * @example "35.161.69.30" + * @example 5 */ - public_ip: string; + readonly qty: number; /** - * Routable CIDRs of VPN + * consumed quantity + * + * @example 2 */ - routable_cidrs: string[]; + readonly consumed: number; /** - * CIDR Block of the Private Space + * code of this license change * - * @example "10.0.0.0/16" + * @example "add" */ - readonly space_cidr_block: string; - tunnels: Tunnel[]; + readonly code: string; /** - * IKE Version + * name of this license * - * @example 1 + * @example "HerokuAddOnCredits1" */ - readonly ike_version: number; + readonly name: string; +} +/** + * + * [Heroku Platform API - team-license-collection](https://devcenter.heroku.com/articles/platform-api-reference#team-license-collection) + * A team license collection is credits provided and consumed by the team per period. + */ +export interface TeamLicenseCollection { /** - * Status of the VPN + * year and month the licenses were in effect * - * @example "active" + * @example "2014-01" */ - readonly status: 'pending' | 'provisioning' | 'active' | 'deprovisioning' | 'failed'; + readonly period: string; /** - * Details of the status - * - * @example "supplied CIDR block already in use" + * Licenses for this period. */ - readonly status_message: string; + licenses: TeamLicense[]; } /** * - * Tunnel info + * [Heroku Platform API - telemetry-ingress-info](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-ingress-info) + * Telemetry Ingress Info allows add-on partners to view authorization information required to write to Fir app logs. */ -export interface Tunnel { +export interface TelemetryIngressInfo { /** - * Timestamp of last status changed + * JWT token to be used for authorization * - * @example "2016-10-25T22:09:05Z" + * @example "vJkbPNUFaK4kVIMGQlEmyA.-MAquq_5yQqtae62b8i7aw" */ - last_status_change?: string; + readonly id_token: string; /** - * Public IP address for the tunnel + * the authorization type * - * @example "52.44.146.197" + * @example "Bearer" */ - ip?: string; + readonly token_type: string; /** - * Public IP address for the customer side of the tunnel - * - * @example "52.44.146.197" + * URLs for add-on partners to write to an add-ons logs */ - customer_ip?: string; + readonly transports: string; /** - * Pre-shared key + * when the token will expire * - * @example "secret" + * @example "2025-01-01T12:00:00Z" */ - pre_shared_key?: string; + readonly expires_at: string; +} +/** + * + * [Heroku Platform API - usage](https://devcenter.heroku.com/articles/platform-api-reference#usage) + * Usage for apps. + */ +export interface Usage { /** - * Status of the tunnel + * add-on usage in the app + */ + addons: UsageAddon[]; +} +/** + * + * usage for an add-on + */ +export interface UsageAddon { + /** + * unique identifier of add-on * - * @example "UP" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - status?: 'UP' | 'DOWN'; + readonly id?: string; /** - * Details of the status + * the meters associated with the add-on * - * @example "status message" + * @example {"storage":{"quantity":1000}} */ - status_message?: string; + meters?: Record; } -export interface VpnConnectionCreatePayload { +/** + * + * usage for the apps belonging to the team + */ +export interface Apps { /** - * VPN Name - * - * @example "office" + * apps belonging to the team */ - name: string; + apps?: UsageApp[]; +} +/** + * + * usage for an app belonging to the team + */ +export interface UsageApp { /** - * Public IP of VPN customer gateway + * unique identifier of app * - * @example "35.161.69.30" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - public_ip: string; + readonly id?: string; /** - * Routable CIDRs of VPN + * add-on usage in the app */ - routable_cidrs: string[]; + addons?: UsageAppAddon[]; } -export interface VpnConnectionUpdatePayload { +/** + * + * usage for an add-on + */ +export interface UsageAppAddon { /** - * Routable CIDRs of VPN + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - routable_cidrs: string[]; + readonly id?: string; + /** + * the meters associated with the add-on + * + * @example {"storage":{"quantity":1000}} + */ + meters?: Record; } diff --git a/lib/esm/services/account-delinquency-service.js b/lib/esm/services/account-delinquency-service.js index 5c0b8ab..2c62147 100644 --- a/lib/esm/services/account-delinquency-service.js +++ b/lib/esm/services/account-delinquency-service.js @@ -20,12 +20,19 @@ export default class AccountDelinquencyService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/account-feature-service.js b/lib/esm/services/account-feature-service.js index 0a551ca..d698ba0 100644 --- a/lib/esm/services/account-feature-service.js +++ b/lib/esm/services/account-feature-service.js @@ -21,13 +21,20 @@ export default class AccountFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing account features. @@ -40,13 +47,20 @@ export default class AccountFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing account feature. @@ -62,13 +76,20 @@ export default class AccountFeatureService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/account-service.js b/lib/esm/services/account-service.js index d023bc2..c236237 100644 --- a/lib/esm/services/account-service.js +++ b/lib/esm/services/account-service.js @@ -20,13 +20,20 @@ export default class AccountService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update account. @@ -41,14 +48,21 @@ export default class AccountService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. @@ -61,14 +75,21 @@ export default class AccountService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for account. @@ -82,13 +103,20 @@ export default class AccountService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update account. @@ -104,14 +132,21 @@ export default class AccountService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. @@ -125,13 +160,20 @@ export default class AccountService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/add-on-action-service.d.ts b/lib/esm/services/add-on-action-service.d.ts index d4323d4..ab36d55 100644 --- a/lib/esm/services/add-on-action-service.d.ts +++ b/lib/esm/services/add-on-action-service.d.ts @@ -21,4 +21,20 @@ export default class AddOnActionService { * @param requestInit The initializer for the request. */ deprovision(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * Add or update a peering connection to an add-on + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + peer(addOnIdentity: string, payload: Heroku.AddOnActionPeerPayload, requestInit?: Omit): Promise>; + /** + * Remove a peering connection from an add-on + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + unpeer(addOnIdentity: string, payload: Record, requestInit?: Omit): Promise>; } diff --git a/lib/esm/services/add-on-action-service.js b/lib/esm/services/add-on-action-service.js index a722638..b3ff97c 100644 --- a/lib/esm/services/add-on-action-service.js +++ b/lib/esm/services/add-on-action-service.js @@ -21,14 +21,21 @@ export default class AddOnActionService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Mark an add-on as deprovisioned. @@ -42,13 +49,80 @@ export default class AddOnActionService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Add or update a peering connection to an add-on + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async peer(addOnIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/actions/peer`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Remove a peering connection from an add-on + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async unpeer(addOnIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/actions/unpeer`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/add-on-attachment-service.js b/lib/esm/services/add-on-attachment-service.js index b32d21e..e4c534d 100644 --- a/lib/esm/services/add-on-attachment-service.js +++ b/lib/esm/services/add-on-attachment-service.js @@ -22,14 +22,21 @@ export default class AddOnAttachmentService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing add-on attachment. @@ -43,14 +50,21 @@ export default class AddOnAttachmentService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing add-on attachment. @@ -64,13 +78,20 @@ export default class AddOnAttachmentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on attachments. @@ -83,13 +104,20 @@ export default class AddOnAttachmentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on attachments for an add-on. @@ -103,13 +131,20 @@ export default class AddOnAttachmentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on attachments for an app. @@ -123,13 +158,20 @@ export default class AddOnAttachmentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing add-on attachment for an app. @@ -144,13 +186,20 @@ export default class AddOnAttachmentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Resolve an add-on attachment from a name, optionally passing an app name. If there are matches it returns at least one add-on attachment (exact match) or many. @@ -165,13 +214,20 @@ export default class AddOnAttachmentService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/add-on-config-service.js b/lib/esm/services/add-on-config-service.js index 6759db7..9a87727 100644 --- a/lib/esm/services/add-on-config-service.js +++ b/lib/esm/services/add-on-config-service.js @@ -21,13 +21,20 @@ export default class AddOnConfigService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an add-on's config. Can only be accessed by the add-on partner providing this add-on. @@ -43,13 +50,20 @@ export default class AddOnConfigService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/add-on-region-capability-service.js b/lib/esm/services/add-on-region-capability-service.js index 7f30d3c..f041a1e 100644 --- a/lib/esm/services/add-on-region-capability-service.js +++ b/lib/esm/services/add-on-region-capability-service.js @@ -20,13 +20,20 @@ export default class AddOnRegionCapabilityService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on region capabilities for an add-on-service @@ -40,13 +47,20 @@ export default class AddOnRegionCapabilityService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on region capabilities for a region. @@ -60,12 +74,19 @@ export default class AddOnRegionCapabilityService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/add-on-service-service.js b/lib/esm/services/add-on-service-service.js index f7cb2b3..fe33e85 100644 --- a/lib/esm/services/add-on-service-service.js +++ b/lib/esm/services/add-on-service-service.js @@ -21,13 +21,20 @@ export default class AddOnServiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on-services. @@ -40,12 +47,19 @@ export default class AddOnServiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/add-on-service.js b/lib/esm/services/add-on-service.js index d4d6f1b..290c703 100644 --- a/lib/esm/services/add-on-service.js +++ b/lib/esm/services/add-on-service.js @@ -20,13 +20,20 @@ export default class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an existing add-on. @@ -40,13 +47,20 @@ export default class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new add-on. @@ -62,14 +76,21 @@ export default class AddOnService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing add-on. @@ -84,14 +105,21 @@ export default class AddOnService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an existing add-on. @@ -106,13 +134,20 @@ export default class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-ons for an app. @@ -126,13 +161,20 @@ export default class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Change add-on plan. Some add-ons may not support changing plans. In that case, an error will be returned. @@ -149,14 +191,21 @@ export default class AddOnService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List all existing add-ons a user has access to @@ -170,13 +219,20 @@ export default class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List add-ons used across all Team apps @@ -190,13 +246,20 @@ export default class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Resolve an add-on from a name, optionally passing an app name. If there are matches it returns at least one add-on (exact match) or many. @@ -211,13 +274,20 @@ export default class AddOnService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/add-on-sso-service.d.ts b/lib/esm/services/add-on-sso-service.d.ts new file mode 100644 index 0000000..ac1a5ac --- /dev/null +++ b/lib/esm/services/add-on-sso-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on SSO](https://devcenter.heroku.com/articles/platform-api-reference#add-on-sso) + * Add-on Single Sign-on generates URL that allows a customer to log in to an Add-on Service's web dashboard. + */ +export default class AddOnSsoService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Generate a timestamp-based single sign-on URL. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + addOnSso(addOnIdentity: string, requestInit?: Omit): Promise; + /** + * Generate a timestamp-based single sign-on URL. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + addOnSsoByApp(appIdentity: string, addOnIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/add-on-sso-service.js b/lib/esm/services/add-on-sso-service.js new file mode 100644 index 0000000..0853d9d --- /dev/null +++ b/lib/esm/services/add-on-sso-service.js @@ -0,0 +1,67 @@ +/** + * [Heroku Platform API - Add-on SSO](https://devcenter.heroku.com/articles/platform-api-reference#add-on-sso) + * Add-on Single Sign-on generates URL that allows a customer to log in to an Add-on Service's web dashboard. + */ +export default class AddOnSsoService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Generate a timestamp-based single sign-on URL. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async addOnSso(addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/sso`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Generate a timestamp-based single sign-on URL. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + async addOnSsoByApp(appIdentity, addOnIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons/${addOnIdentity}/sso`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/add-on-webhook-delivery-service.js b/lib/esm/services/add-on-webhook-delivery-service.js index 44a7fb2..4a8f0e6 100644 --- a/lib/esm/services/add-on-webhook-delivery-service.js +++ b/lib/esm/services/add-on-webhook-delivery-service.js @@ -22,13 +22,20 @@ export default class AddOnWebhookDeliveryService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Lists existing deliveries for an add-on. Can only be accessed by the add-on partner providing this add-on. @@ -42,12 +49,19 @@ export default class AddOnWebhookDeliveryService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/add-on-webhook-event-service.js b/lib/esm/services/add-on-webhook-event-service.js index b44db01..8208762 100644 --- a/lib/esm/services/add-on-webhook-event-service.js +++ b/lib/esm/services/add-on-webhook-event-service.js @@ -22,13 +22,20 @@ export default class AddOnWebhookEventService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Lists existing webhook events for an add-on. Can only be accessed by the add-on partner providing this add-on. @@ -42,12 +49,19 @@ export default class AddOnWebhookEventService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/add-on-webhook-service.js b/lib/esm/services/add-on-webhook-service.js index a70e3ee..fd28e12 100644 --- a/lib/esm/services/add-on-webhook-service.js +++ b/lib/esm/services/add-on-webhook-service.js @@ -23,14 +23,21 @@ export default class AddOnWebhookService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Removes an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. @@ -45,14 +52,21 @@ export default class AddOnWebhookService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Returns the info for an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. @@ -67,13 +81,20 @@ export default class AddOnWebhookService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List all webhook subscriptions for a particular add-on. Can only be accessed by the add-on partner providing this add-on. @@ -87,13 +108,20 @@ export default class AddOnWebhookService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Updates the details of an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. @@ -110,13 +138,20 @@ export default class AddOnWebhookService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/allowed-add-on-service-service.js b/lib/esm/services/allowed-add-on-service-service.js index 0916ba6..66afa8b 100644 --- a/lib/esm/services/allowed-add-on-service-service.js +++ b/lib/esm/services/allowed-add-on-service-service.js @@ -21,13 +21,20 @@ export default class AllowedAddOnServiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Allow an Add-on Service @@ -43,14 +50,21 @@ export default class AllowedAddOnServiceService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Remove an allowed add-on service @@ -65,13 +79,20 @@ export default class AllowedAddOnServiceService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/app-feature-service.js b/lib/esm/services/app-feature-service.js index c9b1bfa..1d032d9 100644 --- a/lib/esm/services/app-feature-service.js +++ b/lib/esm/services/app-feature-service.js @@ -22,13 +22,20 @@ export default class AppFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing app features. @@ -42,13 +49,20 @@ export default class AppFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing app feature. @@ -65,13 +79,20 @@ export default class AppFeatureService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/app-service.js b/lib/esm/services/app-service.js index b39beea..b3c8f8e 100644 --- a/lib/esm/services/app-service.js +++ b/lib/esm/services/app-service.js @@ -22,14 +22,21 @@ export default class AppService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing app. @@ -43,14 +50,21 @@ export default class AppService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing app. @@ -64,13 +78,20 @@ export default class AppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing apps. @@ -83,13 +104,20 @@ export default class AppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List owned and collaborated apps (excludes team apps). @@ -103,13 +131,20 @@ export default class AppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing app. @@ -125,14 +160,21 @@ export default class AppService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Enable ACM flag for an app @@ -146,14 +188,21 @@ export default class AppService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Disable ACM flag for an app @@ -167,14 +216,21 @@ export default class AppService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Refresh ACM for an app @@ -188,13 +244,20 @@ export default class AppService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/app-setup-service.js b/lib/esm/services/app-setup-service.js index adcbb22..d6551fc 100644 --- a/lib/esm/services/app-setup-service.js +++ b/lib/esm/services/app-setup-service.js @@ -22,14 +22,21 @@ export default class AppSetupService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Get the status of an app setup. @@ -43,12 +50,19 @@ export default class AppSetupService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/app-transfer-service.js b/lib/esm/services/app-transfer-service.js index aef53f5..b4e3ee7 100644 --- a/lib/esm/services/app-transfer-service.js +++ b/lib/esm/services/app-transfer-service.js @@ -22,14 +22,21 @@ export default class AppTransferService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing app transfer @@ -43,14 +50,21 @@ export default class AppTransferService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing app transfer. @@ -64,13 +78,20 @@ export default class AppTransferService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing apps transfers. @@ -83,13 +104,20 @@ export default class AppTransferService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing app transfer. @@ -105,13 +133,20 @@ export default class AppTransferService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/app-webhook-delivery-service.js b/lib/esm/services/app-webhook-delivery-service.js index a0bcc73..67646ee 100644 --- a/lib/esm/services/app-webhook-delivery-service.js +++ b/lib/esm/services/app-webhook-delivery-service.js @@ -22,13 +22,20 @@ export default class AppWebhookDeliveryService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Lists existing deliveries for an app. @@ -42,12 +49,19 @@ export default class AppWebhookDeliveryService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/app-webhook-event-service.js b/lib/esm/services/app-webhook-event-service.js index 871b7aa..13bf58c 100644 --- a/lib/esm/services/app-webhook-event-service.js +++ b/lib/esm/services/app-webhook-event-service.js @@ -22,13 +22,20 @@ export default class AppWebhookEventService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Lists existing webhook events for an app. @@ -42,12 +49,19 @@ export default class AppWebhookEventService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/app-webhook-service.js b/lib/esm/services/app-webhook-service.js index 6a20b85..92da8ab 100644 --- a/lib/esm/services/app-webhook-service.js +++ b/lib/esm/services/app-webhook-service.js @@ -23,14 +23,21 @@ export default class AppWebhookService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Removes an app webhook subscription. @@ -45,14 +52,21 @@ export default class AppWebhookService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Returns the info for an app webhook subscription. @@ -67,13 +81,20 @@ export default class AppWebhookService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List all webhook subscriptions for a particular app. @@ -87,13 +108,20 @@ export default class AppWebhookService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Updates the details of an app webhook subscription. @@ -110,13 +138,20 @@ export default class AppWebhookService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/archive-service.js b/lib/esm/services/archive-service.js index ecab29c..29a0778 100644 --- a/lib/esm/services/archive-service.js +++ b/lib/esm/services/archive-service.js @@ -25,7 +25,7 @@ export default class ArchiveService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } @@ -41,7 +41,7 @@ export default class ArchiveService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } diff --git a/lib/esm/services/audit-trail-event-service.js b/lib/esm/services/audit-trail-event-service.js index 9c103f3..92e8560 100644 --- a/lib/esm/services/audit-trail-event-service.js +++ b/lib/esm/services/audit-trail-event-service.js @@ -21,7 +21,7 @@ export default class AuditTrailEventService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } diff --git a/lib/esm/services/build-metadata-service.d.ts b/lib/esm/services/build-metadata-service.d.ts new file mode 100644 index 0000000..0d24d44 --- /dev/null +++ b/lib/esm/services/build-metadata-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Build Metadata](https://devcenter.heroku.com/articles/platform-api-reference#build-metadata) + * Build metadata contains the reference data for building the associated App. + */ +export default class BuildMetadataService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Build metadata for app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/build-metadata-service.js b/lib/esm/services/build-metadata-service.js new file mode 100644 index 0000000..fa35df4 --- /dev/null +++ b/lib/esm/services/build-metadata-service.js @@ -0,0 +1,39 @@ +/** + * [Heroku Platform API - Build Metadata](https://devcenter.heroku.com/articles/platform-api-reference#build-metadata) + * Build metadata contains the reference data for building the associated App. + */ +export default class BuildMetadataService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Build metadata for app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/build-metadata`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/build-service.d.ts b/lib/esm/services/build-service.d.ts index cba4137..6f9628a 100644 --- a/lib/esm/services/build-service.d.ts +++ b/lib/esm/services/build-service.d.ts @@ -1,7 +1,7 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Build API - Build](https://devcenter.heroku.com/articles/platform-api-reference#build) - * A build represents the process of transforming a code tarball into a slug + * A build represents the process of transforming a code tarball into build artifacts */ export default class BuildService { protected readonly fetchImpl: typeof fetch; diff --git a/lib/esm/services/build-service.js b/lib/esm/services/build-service.js index 3555ce0..54d1d63 100644 --- a/lib/esm/services/build-service.js +++ b/lib/esm/services/build-service.js @@ -1,6 +1,6 @@ /** * [Heroku Build API - Build](https://devcenter.heroku.com/articles/platform-api-reference#build) - * A build represents the process of transforming a code tarball into a slug + * A build represents the process of transforming a code tarball into build artifacts */ export default class BuildService { fetchImpl; @@ -23,14 +23,21 @@ export default class BuildService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing build. @@ -45,13 +52,20 @@ export default class BuildService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing build. @@ -65,13 +79,20 @@ export default class BuildService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Destroy a build cache. @@ -85,7 +106,7 @@ export default class BuildService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); @@ -103,13 +124,20 @@ export default class BuildService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/buildpack-installation-service.js b/lib/esm/services/buildpack-installation-service.js index 7768889..b42bed1 100644 --- a/lib/esm/services/buildpack-installation-service.js +++ b/lib/esm/services/buildpack-installation-service.js @@ -23,14 +23,21 @@ export default class BuildpackInstallationService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List an app's existing buildpack installations. @@ -44,12 +51,19 @@ export default class BuildpackInstallationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/capability-service.d.ts b/lib/esm/services/capability-service.d.ts new file mode 100644 index 0000000..616fb45 --- /dev/null +++ b/lib/esm/services/capability-service.d.ts @@ -0,0 +1,20 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Capability](https://devcenter.heroku.com/articles/platform-api-reference#capability) + * A capability represents a requested capability on a resource along with whether the requesting user has that capability + */ +export default class CapabilityService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Request to check a list of capabilities the current user (yourself). An capability is a tuple of + * (capability, resource_id, resource_type). The endpoint will then respond with a `capable` boolean + * true or false for each requested capability. This boolean indicates whether the authenticated user + * has the requested capability on the resource. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + capabilities(payload: Heroku.CapabilityCapabilitiesPayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/capability-service.js b/lib/esm/services/capability-service.js new file mode 100644 index 0000000..2ac8e5c --- /dev/null +++ b/lib/esm/services/capability-service.js @@ -0,0 +1,44 @@ +/** + * [Heroku Platform API - Capability](https://devcenter.heroku.com/articles/platform-api-reference#capability) + * A capability represents a requested capability on a resource along with whether the requesting user has that capability + */ +export default class CapabilityService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Request to check a list of capabilities the current user (yourself). An capability is a tuple of + * (capability, resource_id, resource_type). The endpoint will then respond with a `capable` boolean + * true or false for each requested capability. This boolean indicates whether the authenticated user + * has the requested capability on the resource. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async capabilities(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/~/capabilities`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/collaborator-service.js b/lib/esm/services/collaborator-service.js index f05ddbd..327649d 100644 --- a/lib/esm/services/collaborator-service.js +++ b/lib/esm/services/collaborator-service.js @@ -23,14 +23,21 @@ export default class CollaboratorService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing collaborator. @@ -45,14 +52,21 @@ export default class CollaboratorService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing collaborator. @@ -67,13 +81,20 @@ export default class CollaboratorService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing collaborators. @@ -87,12 +108,19 @@ export default class CollaboratorService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/config-var-service.js b/lib/esm/services/config-var-service.js index e7d3b1b..75da7a0 100644 --- a/lib/esm/services/config-var-service.js +++ b/lib/esm/services/config-var-service.js @@ -21,13 +21,20 @@ export default class ConfigVarService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Get config-vars for a release. @@ -42,13 +49,20 @@ export default class ConfigVarService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update config-vars for app. You can update existing config-vars by setting them again, and remove by setting it to `null`. @@ -64,13 +78,20 @@ export default class ConfigVarService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/config-vars-settings-service.d.ts b/lib/esm/services/config-vars-settings-service.d.ts new file mode 100644 index 0000000..8d8c445 --- /dev/null +++ b/lib/esm/services/config-vars-settings-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Config Vars Settings](https://devcenter.heroku.com/articles/platform-api-reference#config-vars-settings) + * The Config Vars Settings endpoints enable you to view and manage the configuration provided to an app on Heroku. These endpoints are similar to /config-vars but also allow you to check which config vars you can mask, and which are currently masked. + */ +export default class ConfigVarsSettingsService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Get additional info for an app's config vars, including which config vars you can mask, and which are currently masked. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + list(appIdentity: string, requestInit?: Omit): Promise; + /** + * Update a config var. You can update an existing config var's value by setting it again, and you can remove it by setting it to `null`. You can't unmask a masked config var. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(appIdentity: string, payload: Heroku.ConfigVarsSettingsUpdatePayload, requestInit?: Omit): Promise>; +} diff --git a/lib/esm/services/config-vars-settings-service.js b/lib/esm/services/config-vars-settings-service.js new file mode 100644 index 0000000..386f8bd --- /dev/null +++ b/lib/esm/services/config-vars-settings-service.js @@ -0,0 +1,69 @@ +/** + * [Heroku Platform API - Config Vars Settings](https://devcenter.heroku.com/articles/platform-api-reference#config-vars-settings) + * The Config Vars Settings endpoints enable you to view and manage the configuration provided to an app on Heroku. These endpoints are similar to /config-vars but also allow you to check which config vars you can mask, and which are currently masked. + */ +export default class ConfigVarsSettingsService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Get additional info for an app's config vars, including which config vars you can mask, and which are currently masked. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async list(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/config-vars-settings`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Update a config var. You can update an existing config var's value by setting it again, and you can remove it by setting it to `null`. You can't unmask a masked config var. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/config-vars-settings`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/credit-service.js b/lib/esm/services/credit-service.js index 521d63c..d1ae59d 100644 --- a/lib/esm/services/credit-service.js +++ b/lib/esm/services/credit-service.js @@ -22,14 +22,21 @@ export default class CreditService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing credit. @@ -43,13 +50,20 @@ export default class CreditService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing credits. @@ -62,12 +76,19 @@ export default class CreditService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/domain-service.js b/lib/esm/services/domain-service.js index 4587116..fc62c35 100644 --- a/lib/esm/services/domain-service.js +++ b/lib/esm/services/domain-service.js @@ -23,14 +23,21 @@ export default class DomainService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Associate an SNI endpoint @@ -47,14 +54,21 @@ export default class DomainService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing domain @@ -69,14 +83,21 @@ export default class DomainService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing domain. @@ -91,13 +112,20 @@ export default class DomainService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing domains. @@ -111,12 +139,19 @@ export default class DomainService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/dyno-processes-service.d.ts b/lib/esm/services/dyno-processes-service.d.ts new file mode 100644 index 0000000..ff054a5 --- /dev/null +++ b/lib/esm/services/dyno-processes-service.d.ts @@ -0,0 +1,19 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Processes Inside Dynos](https://devcenter.heroku.com/articles/platform-api-reference#dyno-processes) + * Run processes inside existing dynos. + */ +export default class DynoProcessesService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a new process in an existing dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, dynoIdentity: string, payload: Heroku.DynoProcessesCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/dyno-processes-service.js b/lib/esm/services/dyno-processes-service.js new file mode 100644 index 0000000..125110d --- /dev/null +++ b/lib/esm/services/dyno-processes-service.js @@ -0,0 +1,43 @@ +/** + * [Heroku Platform API - Processes Inside Dynos](https://devcenter.heroku.com/articles/platform-api-reference#dyno-processes) + * Run processes inside existing dynos. + */ +export default class DynoProcessesService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a new process in an existing dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, dynoIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos/${dynoIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/dyno-service.d.ts b/lib/esm/services/dyno-service.d.ts index c19baa0..fcaec9d 100644 --- a/lib/esm/services/dyno-service.d.ts +++ b/lib/esm/services/dyno-service.d.ts @@ -23,6 +23,15 @@ export default class DynoService { * @param requestInit The initializer for the request. */ restart(appIdentity: string, dynoIdentity: string, requestInit?: Omit): Promise>; + /** + * Restart dynos of a given formation type. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoFormationType the formation type of this process on this dyno + * @example "run". + * @param requestInit The initializer for the request. + */ + restartFormation(appIdentity: string, dynoFormationType: string, requestInit?: Omit): Promise>; /** * Restart all dynos. * @@ -38,6 +47,15 @@ export default class DynoService { * @param requestInit The initializer for the request. */ stop(appIdentity: string, dynoIdentity: string, requestInit?: Omit): Promise>; + /** + * Stop dynos of a given formation type. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoFormationType the formation type of this process on this dyno + * @example "run". + * @param requestInit The initializer for the request. + */ + stopFormation(appIdentity: string, dynoFormationType: string, requestInit?: Omit): Promise>; /** * Info for existing dyno. * diff --git a/lib/esm/services/dyno-service.js b/lib/esm/services/dyno-service.js index 8e4aa5f..a428bea 100644 --- a/lib/esm/services/dyno-service.js +++ b/lib/esm/services/dyno-service.js @@ -23,14 +23,21 @@ export default class DynoService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Restart dyno. @@ -45,14 +52,51 @@ export default class DynoService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Restart dynos of a given formation type. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoFormationType the formation type of this process on this dyno + * @example "run". + * @param requestInit The initializer for the request. + */ + async restartFormation(appIdentity, dynoFormationType, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formations/${dynoFormationType}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Restart all dynos. @@ -66,14 +110,21 @@ export default class DynoService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Stop dyno. @@ -88,14 +139,51 @@ export default class DynoService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Stop dynos of a given formation type. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoFormationType the formation type of this process on this dyno + * @example "run". + * @param requestInit The initializer for the request. + */ + async stopFormation(appIdentity, dynoFormationType, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formations/${dynoFormationType}/actions/stop`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing dyno. @@ -110,13 +198,20 @@ export default class DynoService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing dynos. @@ -130,12 +225,19 @@ export default class DynoService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/dyno-size-service.d.ts b/lib/esm/services/dyno-size-service.d.ts index aa9490c..2d7a7ca 100644 --- a/lib/esm/services/dyno-size-service.d.ts +++ b/lib/esm/services/dyno-size-service.d.ts @@ -10,7 +10,7 @@ export default class DynoSizeService { /** * Info for existing dyno size. * - * @param dynoSizeIdentity unique identifier of this dyno size or the name of this dyno-size. + * @param dynoSizeIdentity unique identifier of the dyno size or name of the dyno size. * @param requestInit The initializer for the request. */ info(dynoSizeIdentity: string, requestInit?: Omit): Promise; @@ -20,4 +20,11 @@ export default class DynoSizeService { * @param requestInit The initializer for the request. */ list(requestInit?: Omit): Promise; + /** + * List available dyno sizes for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + listAppDynoSizes(appIdentity: string, requestInit?: Omit): Promise>; } diff --git a/lib/esm/services/dyno-size-service.js b/lib/esm/services/dyno-size-service.js index 7f5f022..8edd453 100644 --- a/lib/esm/services/dyno-size-service.js +++ b/lib/esm/services/dyno-size-service.js @@ -12,7 +12,7 @@ export default class DynoSizeService { /** * Info for existing dyno size. * - * @param dynoSizeIdentity unique identifier of this dyno size or the name of this dyno-size. + * @param dynoSizeIdentity unique identifier of the dyno size or name of the dyno size. * @param requestInit The initializer for the request. */ async info(dynoSizeIdentity, requestInit = {}) { @@ -21,13 +21,20 @@ export default class DynoSizeService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing dyno sizes. @@ -40,12 +47,46 @@ export default class DynoSizeService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List available dyno sizes for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async listAppDynoSizes(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/available-dyno-sizes`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/enterprise-account-daily-usage-service.js b/lib/esm/services/enterprise-account-daily-usage-service.js index fc2532c..eab8319 100644 --- a/lib/esm/services/enterprise-account-daily-usage-service.js +++ b/lib/esm/services/enterprise-account-daily-usage-service.js @@ -24,12 +24,19 @@ export default class EnterpriseAccountDailyUsageService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/enterprise-account-member-service.js b/lib/esm/services/enterprise-account-member-service.js index 8468013..d047576 100644 --- a/lib/esm/services/enterprise-account-member-service.js +++ b/lib/esm/services/enterprise-account-member-service.js @@ -21,13 +21,20 @@ export default class EnterpriseAccountMemberService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a member in an enterprise account. @@ -43,14 +50,21 @@ export default class EnterpriseAccountMemberService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update a member in an enterprise account. @@ -67,14 +81,21 @@ export default class EnterpriseAccountMemberService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * delete a member in an enterprise account. @@ -89,13 +110,20 @@ export default class EnterpriseAccountMemberService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/enterprise-account-monthly-usage-service.js b/lib/esm/services/enterprise-account-monthly-usage-service.js index 9c925c9..1abd917 100644 --- a/lib/esm/services/enterprise-account-monthly-usage-service.js +++ b/lib/esm/services/enterprise-account-monthly-usage-service.js @@ -24,12 +24,19 @@ export default class EnterpriseAccountMonthlyUsageService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/enterprise-account-service.js b/lib/esm/services/enterprise-account-service.js index bf3c0a3..47a8ad3 100644 --- a/lib/esm/services/enterprise-account-service.js +++ b/lib/esm/services/enterprise-account-service.js @@ -20,13 +20,20 @@ export default class EnterpriseAccountService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Information about an enterprise account. @@ -40,13 +47,20 @@ export default class EnterpriseAccountService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update enterprise account properties @@ -62,13 +76,20 @@ export default class EnterpriseAccountService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/filter-apps-service.js b/lib/esm/services/filter-apps-service.js index 4ad7a39..a8f201e 100644 --- a/lib/esm/services/filter-apps-service.js +++ b/lib/esm/services/filter-apps-service.js @@ -22,13 +22,20 @@ export default class FilterAppsService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/formation-service.js b/lib/esm/services/formation-service.js index e497819..86f49fc 100644 --- a/lib/esm/services/formation-service.js +++ b/lib/esm/services/formation-service.js @@ -22,13 +22,20 @@ export default class FormationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List process type formation @@ -42,13 +49,20 @@ export default class FormationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Batch update process types @@ -64,14 +78,21 @@ export default class FormationService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update process type @@ -88,13 +109,20 @@ export default class FormationService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/gateway-token-service.d.ts b/lib/esm/services/gateway-token-service.d.ts new file mode 100644 index 0000000..ad58e2e --- /dev/null +++ b/lib/esm/services/gateway-token-service.d.ts @@ -0,0 +1,26 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Gateway Token](https://devcenter.heroku.com/articles/platform-api-reference#gateway-token) + * Contains a set of information useful for identifying a user and the type of access this user is allowed to have. + */ +export default class GatewayTokenService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Generate a gateway token for a user. Note that a JWT version of the + * token will be available in `Heroku-Gateway-Token` header. + * + * @param requestInit The initializer for the request. + */ + create(requestInit?: Omit): Promise; + /** + * Generates a Proxy oauth acccess tokens for the passed in gateway token. + * This new proxy token is designed to have a shorter lifetime than the + * user supplied token so it is safe to pass to futher downstream services + * without increasing the breadth of the long lived tokens. + * + * @param requestInit The initializer for the request. + */ + oauthToken(requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/gateway-token-service.js b/lib/esm/services/gateway-token-service.js new file mode 100644 index 0000000..573d2bd --- /dev/null +++ b/lib/esm/services/gateway-token-service.js @@ -0,0 +1,70 @@ +/** + * [Heroku Platform API - Gateway Token](https://devcenter.heroku.com/articles/platform-api-reference#gateway-token) + * Contains a set of information useful for identifying a user and the type of access this user is allowed to have. + */ +export default class GatewayTokenService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Generate a gateway token for a user. Note that a JWT version of the + * token will be available in `Heroku-Gateway-Token` header. + * + * @param requestInit The initializer for the request. + */ + async create(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/~/gateway-tokens`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Generates a Proxy oauth acccess tokens for the passed in gateway token. + * This new proxy token is designed to have a shorter lifetime than the + * user supplied token so it is safe to pass to futher downstream services + * without increasing the breadth of the long lived tokens. + * + * @param requestInit The initializer for the request. + */ + async oauthToken(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/users/~/gateway-tokens/oauth-authorization`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/generation-service.d.ts b/lib/esm/services/generation-service.d.ts new file mode 100644 index 0000000..451c3a5 --- /dev/null +++ b/lib/esm/services/generation-service.d.ts @@ -0,0 +1,30 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Generation](https://devcenter.heroku.com/articles/platform-api-reference#generation) + * A generation represents a version of the Heroku platform that includes the app execution environment, routing, telemetry, and build systems. + */ +export default class GenerationService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for generation. + * + * @param stackIdentity unique name of stack or unique identifier of stack. + * @param requestInit The initializer for the request. + */ + info(stackIdentity: string, requestInit?: Omit): Promise; + /** + * List available generations. + * + * @param requestInit The initializer for the request. + */ + list(requestInit?: Omit): Promise; + /** + * List available generations for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + listGenerations(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/generation-service.js b/lib/esm/services/generation-service.js new file mode 100644 index 0000000..c40a768 --- /dev/null +++ b/lib/esm/services/generation-service.js @@ -0,0 +1,92 @@ +/** + * [Heroku Platform API - Generation](https://devcenter.heroku.com/articles/platform-api-reference#generation) + * A generation represents a version of the Heroku platform that includes the app execution environment, routing, telemetry, and build systems. + */ +export default class GenerationService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for generation. + * + * @param stackIdentity unique name of stack or unique identifier of stack. + * @param requestInit The initializer for the request. + */ + async info(stackIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/generations/${stackIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List available generations. + * + * @param requestInit The initializer for the request. + */ + async list(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/generations`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List available generations for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async listGenerations(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/available-generations`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/identity-provider-actions-service.d.ts b/lib/esm/services/identity-provider-actions-service.d.ts new file mode 100644 index 0000000..9d06b9f --- /dev/null +++ b/lib/esm/services/identity-provider-actions-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Identity Provider Actions](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-actions) + * Actions taken on Identity Providers, the SSO configuration representation. + */ +export default class IdentityProviderActionsService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Migrate an Identity Provider + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param requestInit The initializer for the request. + */ + update(identityProviderIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/identity-provider-actions-service.js b/lib/esm/services/identity-provider-actions-service.js new file mode 100644 index 0000000..57cfdc9 --- /dev/null +++ b/lib/esm/services/identity-provider-actions-service.js @@ -0,0 +1,40 @@ +/** + * [Heroku Platform API - Identity Provider Actions](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-actions) + * Actions taken on Identity Providers, the SSO configuration representation. + */ +export default class IdentityProviderActionsService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Migrate an Identity Provider + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param requestInit The initializer for the request. + */ + async update(identityProviderIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}/migrate`, { + ...requestInit, + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/identity-provider-certificate-service.d.ts b/lib/esm/services/identity-provider-certificate-service.d.ts new file mode 100644 index 0000000..bfd9103 --- /dev/null +++ b/lib/esm/services/identity-provider-certificate-service.d.ts @@ -0,0 +1,43 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Certificates](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-certificate) + * Certificates represent an sso cert attached to an Identity Provider + */ +export default class IdentityProviderCertificateService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Destroy a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param identityProviderIdentity1 unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param requestInit The initializer for the request. + */ + delete(identityProviderIdentity: string, identityProviderIdentity1: string, requestInit?: Omit): Promise; + /** + * Create a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(identityProviderIdentity: string, payload: Heroku.IdentityProviderCertificateCreatePayload, requestInit?: Omit): Promise; + /** + * Update a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param identityProviderIdentity1 unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(identityProviderIdentity: string, identityProviderIdentity1: string, payload: Heroku.IdentityProviderCertificateUpdatePayload, requestInit?: Omit): Promise; + /** + * Get a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param identityProviderIdentity1 unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param requestInit The initializer for the request. + */ + info(identityProviderIdentity: string, identityProviderIdentity1: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/identity-provider-certificate-service.js b/lib/esm/services/identity-provider-certificate-service.js new file mode 100644 index 0000000..e6f2edd --- /dev/null +++ b/lib/esm/services/identity-provider-certificate-service.js @@ -0,0 +1,131 @@ +/** + * [Heroku Platform API - Certificates](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-certificate) + * Certificates represent an sso cert attached to an Identity Provider + */ +export default class IdentityProviderCertificateService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Destroy a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param identityProviderIdentity1 unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param requestInit The initializer for the request. + */ + async delete(identityProviderIdentity, identityProviderIdentity1, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}/certificates/${identityProviderIdentity1}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Create a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(identityProviderIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}/certificates`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Update a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param identityProviderIdentity1 unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(identityProviderIdentity, identityProviderIdentity1, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}/certificates/${identityProviderIdentity1}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Get a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param identityProviderIdentity1 unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param requestInit The initializer for the request. + */ + async info(identityProviderIdentity, identityProviderIdentity1, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}/certificates/${identityProviderIdentity1}`, { + ...requestInit, + method: 'Get', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/identity-provider-service.d.ts b/lib/esm/services/identity-provider-service.d.ts index 144c4d4..cd1d804 100644 --- a/lib/esm/services/identity-provider-service.d.ts +++ b/lib/esm/services/identity-provider-service.d.ts @@ -1,48 +1,32 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Platform API - Identity Provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) - * Identity Providers represent the SAML configuration of teams or an Enterprise account + * Identity Providers represent the SSO configuration of an Enterprise Account or Team. */ export default class IdentityProviderService { protected readonly fetchImpl: typeof fetch; protected readonly endpoint: string; constructor(fetchImpl: typeof fetch, endpoint: string); /** - * Get a list of a team's Identity Providers + * Info for an Identity Provider * - * @param teamName unique name of team - * @example "example". + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. * @param requestInit The initializer for the request. */ - listByTeam(teamName: string, requestInit?: Omit): Promise; + info(identityProviderIdentity: string, requestInit?: Omit): Promise; /** - * Create an Identity Provider for a team + * Create an Identity Provider * - * @param teamName unique name of team - * @example "example". * @param payload Object to send to the endpoint. * @param requestInit The initializer for the request. */ - createByTeam(teamName: string, payload: Heroku.IdentityProviderCreateByTeamPayload, requestInit?: Omit): Promise; + create(payload: Heroku.IdentityProviderCreatePayload, requestInit?: Omit): Promise; /** - * Update a team's Identity Provider + * Update an Identity Provider * - * @param teamName unique name of team - * @example "example". - * @param identityProviderId unique identifier of this identity provider - * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. * @param payload Object to send to the endpoint. * @param requestInit The initializer for the request. */ - updateByTeam(teamName: string, identityProviderId: string, payload: Heroku.IdentityProviderUpdateByTeamPayload, requestInit?: Omit): Promise; - /** - * Delete a team's Identity Provider - * - * @param teamName unique name of team - * @example "example". - * @param identityProviderId unique identifier of this identity provider - * @example "01234567-89ab-cdef-0123-456789abcdef". - * @param requestInit The initializer for the request. - */ - deleteByTeam(teamName: string, identityProviderId: string, requestInit?: Omit): Promise; + update(identityProviderIdentity: string, payload: Heroku.IdentityProviderUpdatePayload, requestInit?: Omit): Promise; } diff --git a/lib/esm/services/identity-provider-service.js b/lib/esm/services/identity-provider-service.js index c5a4e61..8399d36 100644 --- a/lib/esm/services/identity-provider-service.js +++ b/lib/esm/services/identity-provider-service.js @@ -1,6 +1,6 @@ /** * [Heroku Platform API - Identity Provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) - * Identity Providers represent the SAML configuration of teams or an Enterprise account + * Identity Providers represent the SSO configuration of an Enterprise Account or Team. */ export default class IdentityProviderService { fetchImpl; @@ -10,98 +10,89 @@ export default class IdentityProviderService { this.endpoint = endpoint; } /** - * Get a list of a team's Identity Providers + * Info for an Identity Provider * - * @param teamName unique name of team - * @example "example". + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. * @param requestInit The initializer for the request. */ - async listByTeam(teamName, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers`, { + async info(identityProviderIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}`, { ...requestInit, method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** - * Create an Identity Provider for a team + * Create an Identity Provider * - * @param teamName unique name of team - * @example "example". * @param payload Object to send to the endpoint. * @param requestInit The initializer for the request. */ - async createByTeam(teamName, payload, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers`, { + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers`, { ...requestInit, body: JSON.stringify(payload, null, 2), method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** - * Update a team's Identity Provider + * Update an Identity Provider * - * @param teamName unique name of team - * @example "example". - * @param identityProviderId unique identifier of this identity provider - * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. * @param payload Object to send to the endpoint. * @param requestInit The initializer for the request. */ - async updateByTeam(teamName, identityProviderId, payload, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers/${identityProviderId}`, { + async update(identityProviderIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}`, { ...requestInit, body: JSON.stringify(payload, null, 2), method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); - } - /** - * Delete a team's Identity Provider - * - * @param teamName unique name of team - * @example "example". - * @param identityProviderId unique identifier of this identity provider - * @example "01234567-89ab-cdef-0123-456789abcdef". - * @param requestInit The initializer for the request. - */ - async deleteByTeam(teamName, identityProviderId, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers/${identityProviderId}`, { - ...requestInit, - method: 'DELETE', - headers: { - ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', - 'Content-Type': 'application/json' - } - }); - if (response.ok) { - return (await response.json()); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op } - throw new Error(response.statusText); + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/inbound-ruleset-service.js b/lib/esm/services/inbound-ruleset-service.js index b626489..aa57b97 100644 --- a/lib/esm/services/inbound-ruleset-service.js +++ b/lib/esm/services/inbound-ruleset-service.js @@ -21,13 +21,20 @@ export default class InboundRulesetService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info on an existing Inbound Ruleset @@ -42,13 +49,20 @@ export default class InboundRulesetService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List all inbound rulesets for a space @@ -62,13 +76,20 @@ export default class InboundRulesetService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new inbound ruleset @@ -84,13 +105,20 @@ export default class InboundRulesetService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/index.d.ts b/lib/esm/services/index.d.ts index 7fce78f..f1652de 100644 --- a/lib/esm/services/index.d.ts +++ b/lib/esm/services/index.d.ts @@ -34,6 +34,7 @@ export * from './enterprise-account-monthly-usage-service'; export * from './enterprise-account-service'; export * from './filter-apps-service'; export * from './formation-service'; +export * from './generation-service'; export * from './identity-provider-service'; export * from './inbound-ruleset-service'; export * from './invoice-address-service'; @@ -45,8 +46,8 @@ export * from './oauth-authorization-service'; export * from './oauth-client-service'; export * from './oauth-grant-service'; export * from './oauth-token-service'; +export * from './oci-image-service'; export * from './password-reset-service'; -export * from './peering-info-service'; export * from './peering-service'; export * from './permission-entity-service'; export * from './pipeline-build-service'; @@ -89,8 +90,25 @@ export * from './team-monthly-usage-service'; export * from './team-preferences-service'; export * from './team-space-service'; export * from './team-service'; +export * from './telemetry-drain-service'; export * from './test-case-service'; export * from './test-node-service'; export * from './test-run-service'; export * from './user-preferences-service'; export * from './vpn-connection-service'; +export * from './add-on-sso-service'; +export * from './build-metadata-service'; +export * from './capability-service'; +export * from './config-vars-settings-service'; +export * from './dyno-processes-service'; +export * from './gateway-token-service'; +export * from './identity-provider-actions-service'; +export * from './identity-provider-certificate-service'; +export * from './payment-method-service'; +export * from './payment-service'; +export * from './space-host-service'; +export * from './space-log-drain-service'; +export * from './team-license-service'; +export * from './team-license-collection-service'; +export * from './telemetry-ingress-info-service'; +export * from './usage-service'; diff --git a/lib/esm/services/index.js b/lib/esm/services/index.js index 7fce78f..f1652de 100644 --- a/lib/esm/services/index.js +++ b/lib/esm/services/index.js @@ -34,6 +34,7 @@ export * from './enterprise-account-monthly-usage-service'; export * from './enterprise-account-service'; export * from './filter-apps-service'; export * from './formation-service'; +export * from './generation-service'; export * from './identity-provider-service'; export * from './inbound-ruleset-service'; export * from './invoice-address-service'; @@ -45,8 +46,8 @@ export * from './oauth-authorization-service'; export * from './oauth-client-service'; export * from './oauth-grant-service'; export * from './oauth-token-service'; +export * from './oci-image-service'; export * from './password-reset-service'; -export * from './peering-info-service'; export * from './peering-service'; export * from './permission-entity-service'; export * from './pipeline-build-service'; @@ -89,8 +90,25 @@ export * from './team-monthly-usage-service'; export * from './team-preferences-service'; export * from './team-space-service'; export * from './team-service'; +export * from './telemetry-drain-service'; export * from './test-case-service'; export * from './test-node-service'; export * from './test-run-service'; export * from './user-preferences-service'; export * from './vpn-connection-service'; +export * from './add-on-sso-service'; +export * from './build-metadata-service'; +export * from './capability-service'; +export * from './config-vars-settings-service'; +export * from './dyno-processes-service'; +export * from './gateway-token-service'; +export * from './identity-provider-actions-service'; +export * from './identity-provider-certificate-service'; +export * from './payment-method-service'; +export * from './payment-service'; +export * from './space-host-service'; +export * from './space-log-drain-service'; +export * from './team-license-service'; +export * from './team-license-collection-service'; +export * from './telemetry-ingress-info-service'; +export * from './usage-service'; diff --git a/lib/esm/services/invoice-address-service.js b/lib/esm/services/invoice-address-service.js index aeae79e..c5ddde7 100644 --- a/lib/esm/services/invoice-address-service.js +++ b/lib/esm/services/invoice-address-service.js @@ -20,13 +20,20 @@ export default class InvoiceAddressService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update invoice address for an account. @@ -41,13 +48,20 @@ export default class InvoiceAddressService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/invoice-service.js b/lib/esm/services/invoice-service.js index 88b59a7..bec1df4 100644 --- a/lib/esm/services/invoice-service.js +++ b/lib/esm/services/invoice-service.js @@ -21,13 +21,20 @@ export default class InvoiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing invoices. @@ -40,12 +47,19 @@ export default class InvoiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/key-service.js b/lib/esm/services/key-service.js index 7d60c6a..495f9d9 100644 --- a/lib/esm/services/key-service.js +++ b/lib/esm/services/key-service.js @@ -21,13 +21,20 @@ export default class KeyService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing keys. @@ -40,12 +47,19 @@ export default class KeyService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/log-drain-service.js b/lib/esm/services/log-drain-service.js index 9043b94..21c2c30 100644 --- a/lib/esm/services/log-drain-service.js +++ b/lib/esm/services/log-drain-service.js @@ -23,14 +23,21 @@ export default class LogDrainService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an add-on owned log drain. @@ -47,14 +54,21 @@ export default class LogDrainService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing log drain. Log drains added by add-ons can only be removed by removing the add-on. @@ -69,14 +83,21 @@ export default class LogDrainService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing log drain. @@ -91,13 +112,20 @@ export default class LogDrainService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing log drains for an add-on. @@ -111,13 +139,20 @@ export default class LogDrainService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing log drains. @@ -131,12 +166,19 @@ export default class LogDrainService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/log-session-service.js b/lib/esm/services/log-session-service.js index 13129bb..c0460a2 100644 --- a/lib/esm/services/log-session-service.js +++ b/lib/esm/services/log-session-service.js @@ -23,13 +23,20 @@ export default class LogSessionService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/oauth-authorization-service.d.ts b/lib/esm/services/oauth-authorization-service.d.ts index be4183c..4668fd4 100644 --- a/lib/esm/services/oauth-authorization-service.d.ts +++ b/lib/esm/services/oauth-authorization-service.d.ts @@ -28,6 +28,14 @@ export default class OauthAuthorizationService { * @param requestInit The initializer for the request. */ info(oauthAuthorizationIdentity: string, requestInit?: Omit): Promise; + /** + * Update an existing OAuth authorization. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(oauthAuthorizationIdentity: string, payload: Heroku.OauthAuthorizationUpdatePayload, requestInit?: Omit): Promise; /** * List OAuth authorizations. * diff --git a/lib/esm/services/oauth-authorization-service.js b/lib/esm/services/oauth-authorization-service.js index 5a22530..e48699a 100644 --- a/lib/esm/services/oauth-authorization-service.js +++ b/lib/esm/services/oauth-authorization-service.js @@ -22,14 +22,21 @@ export default class OauthAuthorizationService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete OAuth authorization. @@ -43,14 +50,21 @@ export default class OauthAuthorizationService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an OAuth authorization. @@ -64,13 +78,50 @@ export default class OauthAuthorizationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Update an existing OAuth authorization. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(oauthAuthorizationIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations/${oauthAuthorizationIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List OAuth authorizations. @@ -83,13 +134,20 @@ export default class OauthAuthorizationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Regenerate OAuth tokens. This endpoint is only available to direct authorizations or privileged OAuth clients. @@ -103,13 +161,20 @@ export default class OauthAuthorizationService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/oauth-client-service.js b/lib/esm/services/oauth-client-service.js index d9e617e..f777fef 100644 --- a/lib/esm/services/oauth-client-service.js +++ b/lib/esm/services/oauth-client-service.js @@ -22,14 +22,21 @@ export default class OauthClientService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete OAuth client. @@ -43,14 +50,21 @@ export default class OauthClientService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an OAuth client. The output for unauthenticated requests excludes the `secret` parameter. @@ -64,7 +78,7 @@ export default class OauthClientService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } @@ -79,13 +93,20 @@ export default class OauthClientService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update OAuth client @@ -101,14 +122,21 @@ export default class OauthClientService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Rotate credentials for an OAuth client @@ -122,13 +150,20 @@ export default class OauthClientService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/oauth-token-service.js b/lib/esm/services/oauth-token-service.js index 0e046b4..5362eb0 100644 --- a/lib/esm/services/oauth-token-service.js +++ b/lib/esm/services/oauth-token-service.js @@ -22,14 +22,21 @@ export default class OauthTokenService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Revoke OAuth access token. @@ -43,13 +50,20 @@ export default class OauthTokenService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/oci-image-service.d.ts b/lib/esm/services/oci-image-service.d.ts new file mode 100644 index 0000000..f001a5c --- /dev/null +++ b/lib/esm/services/oci-image-service.d.ts @@ -0,0 +1,26 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - OCI Images](https://devcenter.heroku.com/articles/platform-api-reference#oci-image) + * An OCI (Open Container Initiative) image is a standardized format for packaging and distributing containerized applications, ready to run on the platform. + */ +export default class OciImageService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Info for the OCI images of an app, filtered by identifier. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param ociImageIdentity unique identifier of the OCI image or unique identifier representing the content of the OCI image. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, ociImageIdentity: string, requestInit?: Omit): Promise; + /** + * Create an new OCI image of an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(appIdentity: string, payload: Heroku.OciImageCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/oci-image-service.js b/lib/esm/services/oci-image-service.js new file mode 100644 index 0000000..efdf99b --- /dev/null +++ b/lib/esm/services/oci-image-service.js @@ -0,0 +1,70 @@ +/** + * [Heroku Platform API - OCI Images](https://devcenter.heroku.com/articles/platform-api-reference#oci-image) + * An OCI (Open Container Initiative) image is a standardized format for packaging and distributing containerized applications, ready to run on the platform. + */ +export default class OciImageService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for the OCI images of an app, filtered by identifier. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param ociImageIdentity unique identifier of the OCI image or unique identifier representing the content of the OCI image. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, ociImageIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/oci-images/${ociImageIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Create an new OCI image of an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(appIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/oci-images`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/password-reset-service.js b/lib/esm/services/password-reset-service.js index 5b3cec8..fbbe3f7 100644 --- a/lib/esm/services/password-reset-service.js +++ b/lib/esm/services/password-reset-service.js @@ -22,14 +22,21 @@ export default class PasswordResetService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Complete password reset. @@ -46,13 +53,20 @@ export default class PasswordResetService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/payment-method-service.d.ts b/lib/esm/services/payment-method-service.d.ts new file mode 100644 index 0000000..c96f8c3 --- /dev/null +++ b/lib/esm/services/payment-method-service.d.ts @@ -0,0 +1,29 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Vault API - Payment Method](https://devcenter.heroku.com/articles/platform-api-reference#payment-method) + * The on file payment method for an account + */ +export default class PaymentMethodService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Update an existing payment method for an account. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(payload: Heroku.PaymentMethodUpdatePayload, requestInit?: Omit): Promise; + /** + * Get the current payment method for an account. + * + * @param requestInit The initializer for the request. + */ + get(requestInit?: Omit): Promise; + /** + * Get the verified apps on the payment-method + * + * @param requestInit The initializer for the request. + */ + getApps(requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/payment-method-service.js b/lib/esm/services/payment-method-service.js new file mode 100644 index 0000000..5922ca6 --- /dev/null +++ b/lib/esm/services/payment-method-service.js @@ -0,0 +1,93 @@ +/** + * [Heroku Vault API - Payment Method](https://devcenter.heroku.com/articles/platform-api-reference#payment-method) + * The on file payment method for an account + */ +export default class PaymentMethodService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Update an existing payment method for an account. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/payment-method`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Get the current payment method for an account. + * + * @param requestInit The initializer for the request. + */ + async get(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/payment-method`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Get the verified apps on the payment-method + * + * @param requestInit The initializer for the request. + */ + async getApps(requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/payment-method/apps`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/payment-service.d.ts b/lib/esm/services/payment-service.d.ts new file mode 100644 index 0000000..9d16b4d --- /dev/null +++ b/lib/esm/services/payment-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Vault API - Payments](https://devcenter.heroku.com/articles/platform-api-reference#payment) + * A payment represents money collected for an account + */ +export default class PaymentService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a payment on an existing account + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.PaymentCreatePayload, requestInit?: Omit): Promise; + /** + * Create a payment on an existing team + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + createPayment(teamIdentity: string, payload: Heroku.PaymentCreatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/payment-service.js b/lib/esm/services/payment-service.js new file mode 100644 index 0000000..e66eb6d --- /dev/null +++ b/lib/esm/services/payment-service.js @@ -0,0 +1,71 @@ +/** + * [Heroku Vault API - Payments](https://devcenter.heroku.com/articles/platform-api-reference#payment) + * A payment represents money collected for an account + */ +export default class PaymentService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a payment on an existing account + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/account/payments`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Create a payment on an existing team + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async createPayment(teamIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/payments`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/peering-info-service.d.ts b/lib/esm/services/peering-info-service.d.ts deleted file mode 100644 index f0f5743..0000000 --- a/lib/esm/services/peering-info-service.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import * as Heroku from '@heroku-cli/schema'; -/** - * [Heroku Platform API - Peering Info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) - * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. - */ -export default class PeeringInfoService { - protected readonly fetchImpl: typeof fetch; - protected readonly endpoint: string; - constructor(fetchImpl: typeof fetch, endpoint: string); - /** - * Provides the necessary information to establish an AWS VPC Peering with your private space. - * - * @param spaceIdentity unique identifier of space or unique name of space. - * @param requestInit The initializer for the request. - */ - info(spaceIdentity: string, requestInit?: Omit): Promise; -} diff --git a/lib/esm/services/peering-info-service.js b/lib/esm/services/peering-info-service.js deleted file mode 100644 index 072b0a1..0000000 --- a/lib/esm/services/peering-info-service.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * [Heroku Platform API - Peering Info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) - * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. - */ -export default class PeeringInfoService { - fetchImpl; - endpoint; - constructor(fetchImpl, endpoint) { - this.fetchImpl = fetchImpl; - this.endpoint = endpoint; - } - /** - * Provides the necessary information to establish an AWS VPC Peering with your private space. - * - * @param spaceIdentity unique identifier of space or unique name of space. - * @param requestInit The initializer for the request. - */ - async info(spaceIdentity, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peering-info`, { - ...requestInit, - method: 'GET', - headers: { - ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' - } - }); - if (response.ok) { - return (await response.json()); - } - throw new Error(response.statusText); - } -} diff --git a/lib/esm/services/peering-service.d.ts b/lib/esm/services/peering-service.d.ts index 8eba208..2dfdc89 100644 --- a/lib/esm/services/peering-service.d.ts +++ b/lib/esm/services/peering-service.d.ts @@ -1,44 +1,41 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Platform API - Peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) - * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + * [Peering](https://devcenter.heroku.com/articles/private-space-vpc-peering?preview=1) provides a way to peer your Private Space VPC to another AWS VPC. */ export default class PeeringService { protected readonly fetchImpl: typeof fetch; protected readonly endpoint: string; constructor(fetchImpl: typeof fetch, endpoint: string); /** - * List peering connections of a private space. + * Provides the necessary information to establish an AWS VPC Peering with your private space. * * @param spaceIdentity unique identifier of space or unique name of space. * @param requestInit The initializer for the request. */ - list(spaceIdentity: string, requestInit?: Omit): Promise; + info(spaceIdentity: string, requestInit?: Omit): Promise; /** - * Accept a pending peering connection with a private space. + * List peering connections of a private space. * * @param spaceIdentity unique identifier of space or unique name of space. - * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. - * @example "pcx-123456789012". * @param requestInit The initializer for the request. */ - accept(spaceIdentity: string, peeringPcxId: string, requestInit?: Omit): Promise; + list(spaceIdentity: string, requestInit?: Omit): Promise; /** - * Destroy an active peering connection with a private space. + * Accept a pending peering connection with a private space. * * @param spaceIdentity unique identifier of space or unique name of space. - * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. - * @example "pcx-123456789012". + * @param payload Object to send to the endpoint. * @param requestInit The initializer for the request. */ - destroy(spaceIdentity: string, peeringPcxId: string, requestInit?: Omit): Promise; + accept(spaceIdentity: string, payload: Heroku.PeeringAcceptPayload, requestInit?: Omit): Promise; /** - * Fetch information for existing peering connection + * Destroy an active peering connection with a private space. * * @param spaceIdentity unique identifier of space or unique name of space. * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. * @example "pcx-123456789012". * @param requestInit The initializer for the request. */ - info(spaceIdentity: string, peeringPcxId: string, requestInit?: Omit): Promise; + destroy(spaceIdentity: string, peeringPcxId: string, requestInit?: Omit): Promise; } diff --git a/lib/esm/services/peering-service.js b/lib/esm/services/peering-service.js index edc2327..2b3c7fd 100644 --- a/lib/esm/services/peering-service.js +++ b/lib/esm/services/peering-service.js @@ -1,6 +1,6 @@ /** * [Heroku Platform API - Peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) - * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + * [Peering](https://devcenter.heroku.com/articles/private-space-vpc-peering?preview=1) provides a way to peer your Private Space VPC to another AWS VPC. */ export default class PeeringService { fetchImpl; @@ -10,91 +10,117 @@ export default class PeeringService { this.endpoint = endpoint; } /** - * List peering connections of a private space. + * Provides the necessary information to establish an AWS VPC Peering with your private space. * * @param spaceIdentity unique identifier of space or unique name of space. * @param requestInit The initializer for the request. */ - async list(spaceIdentity, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings`, { + async info(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peering-info`, { ...requestInit, method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** - * Accept a pending peering connection with a private space. + * List peering connections of a private space. * * @param spaceIdentity unique identifier of space or unique name of space. - * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. - * @example "pcx-123456789012". * @param requestInit The initializer for the request. */ - async accept(spaceIdentity, peeringPcxId, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}/actions/accept`, { + async list(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings`, { ...requestInit, - method: 'POST', + method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', - 'Content-Type': 'application/json' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** - * Destroy an active peering connection with a private space. + * Accept a pending peering connection with a private space. * * @param spaceIdentity unique identifier of space or unique name of space. - * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. - * @example "pcx-123456789012". + * @param payload Object to send to the endpoint. * @param requestInit The initializer for the request. */ - async destroy(spaceIdentity, peeringPcxId, requestInit = {}) { - const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}`, { + async accept(spaceIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings`, { ...requestInit, - method: 'DELETE', + body: JSON.stringify(payload, null, 2), + method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** - * Fetch information for existing peering connection + * Destroy an active peering connection with a private space. * * @param spaceIdentity unique identifier of space or unique name of space. * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. * @example "pcx-123456789012". * @param requestInit The initializer for the request. */ - async info(spaceIdentity, peeringPcxId, requestInit = {}) { + async destroy(spaceIdentity, peeringPcxId, requestInit = {}) { const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}`, { ...requestInit, - method: 'GET', + method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/permission-entity-service.js b/lib/esm/services/permission-entity-service.js index 8fbb476..395b60a 100644 --- a/lib/esm/services/permission-entity-service.js +++ b/lib/esm/services/permission-entity-service.js @@ -21,12 +21,19 @@ export default class PermissionEntityService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/pipeline-build-service.d.ts b/lib/esm/services/pipeline-build-service.d.ts index f26ee6d..1f3deea 100644 --- a/lib/esm/services/pipeline-build-service.d.ts +++ b/lib/esm/services/pipeline-build-service.d.ts @@ -1,7 +1,7 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Platform API - Pipeline Build](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-build) - * Information about latest builds of apps in a pipeline. + * Information about the latest builds of apps in a pipeline. A build represents the process of transforming code into build artifacts. */ export default class PipelineBuildService { protected readonly fetchImpl: typeof fetch; @@ -14,5 +14,5 @@ export default class PipelineBuildService { * @example "01234567-89ab-cdef-0123-456789abcdef". * @param requestInit The initializer for the request. */ - list(pipelineId: string, requestInit?: Omit): Promise; + list(pipelineId: string, requestInit?: Omit): Promise; } diff --git a/lib/esm/services/pipeline-build-service.js b/lib/esm/services/pipeline-build-service.js index 40c001c..0678f09 100644 --- a/lib/esm/services/pipeline-build-service.js +++ b/lib/esm/services/pipeline-build-service.js @@ -1,6 +1,6 @@ /** * [Heroku Platform API - Pipeline Build](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-build) - * Information about latest builds of apps in a pipeline. + * Information about the latest builds of apps in a pipeline. A build represents the process of transforming code into build artifacts. */ export default class PipelineBuildService { fetchImpl; @@ -22,12 +22,19 @@ export default class PipelineBuildService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/pipeline-config-var-service.d.ts b/lib/esm/services/pipeline-config-var-service.d.ts index 3204e16..47f044b 100644 --- a/lib/esm/services/pipeline-config-var-service.d.ts +++ b/lib/esm/services/pipeline-config-var-service.d.ts @@ -1,6 +1,6 @@ /** * [Heroku Platform API - Pipeline Config Vars](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-config-var) - * Pipeline Config Vars allow you to manage the configuration information provided to a pipeline. + * Pipeline config vars in Heroku CI and review apps used to manage the configuration information for a pipeline. */ export default class PipelineConfigVarService { protected readonly fetchImpl: typeof fetch; diff --git a/lib/esm/services/pipeline-config-var-service.js b/lib/esm/services/pipeline-config-var-service.js index 5e81087..34ed54d 100644 --- a/lib/esm/services/pipeline-config-var-service.js +++ b/lib/esm/services/pipeline-config-var-service.js @@ -1,6 +1,6 @@ /** * [Heroku Platform API - Pipeline Config Vars](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-config-var) - * Pipeline Config Vars allow you to manage the configuration information provided to a pipeline. + * Pipeline config vars in Heroku CI and review apps used to manage the configuration information for a pipeline. */ export default class PipelineConfigVarService { fetchImpl; @@ -24,13 +24,20 @@ export default class PipelineConfigVarService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update config-vars for a pipeline stage. You can update existing config-vars by setting them again, and remove by setting it to `null`. @@ -49,13 +56,20 @@ export default class PipelineConfigVarService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/pipeline-coupling-service.js b/lib/esm/services/pipeline-coupling-service.js index b69e0b4..ec0e0d2 100644 --- a/lib/esm/services/pipeline-coupling-service.js +++ b/lib/esm/services/pipeline-coupling-service.js @@ -22,13 +22,20 @@ export default class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List pipeline couplings for the current user. @@ -41,13 +48,20 @@ export default class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List pipeline couplings. @@ -60,13 +74,20 @@ export default class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List pipeline couplings for a team. @@ -80,13 +101,20 @@ export default class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new pipeline coupling. @@ -101,14 +129,21 @@ export default class PipelineCouplingService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an existing pipeline coupling. @@ -122,13 +157,20 @@ export default class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing pipeline coupling. @@ -142,14 +184,21 @@ export default class PipelineCouplingService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing pipeline coupling. @@ -165,14 +214,21 @@ export default class PipelineCouplingService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an existing pipeline coupling. @@ -186,12 +242,19 @@ export default class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/pipeline-deployment-service.d.ts b/lib/esm/services/pipeline-deployment-service.d.ts index 05f283e..53843a4 100644 --- a/lib/esm/services/pipeline-deployment-service.d.ts +++ b/lib/esm/services/pipeline-deployment-service.d.ts @@ -1,14 +1,14 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Platform API - Pipeline Deployment](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-deployment) - * Information about latest deployments of apps in a pipeline. + * Information about the latest deployment of each app in a pipeline. A deployment is the process of moving the build artifacts to a target environment. */ export default class PipelineDeploymentService { protected readonly fetchImpl: typeof fetch; protected readonly endpoint: string; constructor(fetchImpl: typeof fetch, endpoint: string); /** - * List latest slug releases for each app in a pipeline + * List latest deployments for each app in a pipeline. A deployment is a release that changed your source slug, container image, or Heroku processes. * * @param pipelineId unique identifier of pipeline * @example "01234567-89ab-cdef-0123-456789abcdef". diff --git a/lib/esm/services/pipeline-deployment-service.js b/lib/esm/services/pipeline-deployment-service.js index be4cee4..4be9b85 100644 --- a/lib/esm/services/pipeline-deployment-service.js +++ b/lib/esm/services/pipeline-deployment-service.js @@ -1,6 +1,6 @@ /** * [Heroku Platform API - Pipeline Deployment](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-deployment) - * Information about latest deployments of apps in a pipeline. + * Information about the latest deployment of each app in a pipeline. A deployment is the process of moving the build artifacts to a target environment. */ export default class PipelineDeploymentService { fetchImpl; @@ -10,7 +10,7 @@ export default class PipelineDeploymentService { this.endpoint = endpoint; } /** - * List latest slug releases for each app in a pipeline + * List latest deployments for each app in a pipeline. A deployment is a release that changed your source slug, container image, or Heroku processes. * * @param pipelineId unique identifier of pipeline * @example "01234567-89ab-cdef-0123-456789abcdef". @@ -22,12 +22,19 @@ export default class PipelineDeploymentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/pipeline-promotion-service.js b/lib/esm/services/pipeline-promotion-service.js index f1a12ee..eff4197 100644 --- a/lib/esm/services/pipeline-promotion-service.js +++ b/lib/esm/services/pipeline-promotion-service.js @@ -22,14 +22,21 @@ export default class PipelinePromotionService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing pipeline promotion. @@ -43,12 +50,19 @@ export default class PipelinePromotionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/pipeline-promotion-target-service.js b/lib/esm/services/pipeline-promotion-target-service.js index 0bed9c1..f86c839 100644 --- a/lib/esm/services/pipeline-promotion-target-service.js +++ b/lib/esm/services/pipeline-promotion-target-service.js @@ -22,12 +22,19 @@ export default class PipelinePromotionTargetService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/pipeline-release-service.d.ts b/lib/esm/services/pipeline-release-service.d.ts index a253dec..209fcad 100644 --- a/lib/esm/services/pipeline-release-service.d.ts +++ b/lib/esm/services/pipeline-release-service.d.ts @@ -1,7 +1,7 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Platform API - Pipeline Release](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-release) - * Information about latest releases of apps in a pipeline. + * Information about the latest release of each app in a pipeline. A release makes a deployment available to end-users. */ export default class PipelineReleaseService { protected readonly fetchImpl: typeof fetch; diff --git a/lib/esm/services/pipeline-release-service.js b/lib/esm/services/pipeline-release-service.js index 51c2585..af70427 100644 --- a/lib/esm/services/pipeline-release-service.js +++ b/lib/esm/services/pipeline-release-service.js @@ -1,6 +1,6 @@ /** * [Heroku Platform API - Pipeline Release](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-release) - * Information about latest releases of apps in a pipeline. + * Information about the latest release of each app in a pipeline. A release makes a deployment available to end-users. */ export default class PipelineReleaseService { fetchImpl; @@ -22,12 +22,19 @@ export default class PipelineReleaseService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/pipeline-service.js b/lib/esm/services/pipeline-service.js index 541fe37..8703cc7 100644 --- a/lib/esm/services/pipeline-service.js +++ b/lib/esm/services/pipeline-service.js @@ -22,14 +22,21 @@ export default class PipelineService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing pipeline. @@ -43,13 +50,20 @@ export default class PipelineService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing pipeline. @@ -64,14 +78,21 @@ export default class PipelineService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing pipeline. @@ -88,14 +109,21 @@ export default class PipelineService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing pipelines. @@ -108,12 +136,19 @@ export default class PipelineService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/pipeline-stack-service.js b/lib/esm/services/pipeline-stack-service.js index 511a36e..20899d0 100644 --- a/lib/esm/services/pipeline-stack-service.js +++ b/lib/esm/services/pipeline-stack-service.js @@ -22,12 +22,19 @@ export default class PipelineStackService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/pipeline-transfer-service.js b/lib/esm/services/pipeline-transfer-service.js index c0eb11e..f5031f3 100644 --- a/lib/esm/services/pipeline-transfer-service.js +++ b/lib/esm/services/pipeline-transfer-service.js @@ -22,13 +22,20 @@ export default class PipelineTransferService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/plan-service.js b/lib/esm/services/plan-service.js index fac0b20..f7df9c1 100644 --- a/lib/esm/services/plan-service.js +++ b/lib/esm/services/plan-service.js @@ -21,13 +21,20 @@ export default class PlanService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing plan by Add-on. @@ -42,13 +49,20 @@ export default class PlanService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing plans by Add-on. @@ -62,12 +76,19 @@ export default class PlanService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/rate-limit-service.js b/lib/esm/services/rate-limit-service.js index c6c5875..fd17abe 100644 --- a/lib/esm/services/rate-limit-service.js +++ b/lib/esm/services/rate-limit-service.js @@ -20,12 +20,19 @@ export default class RateLimitService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/region-service.js b/lib/esm/services/region-service.js index 31a7673..f321d3e 100644 --- a/lib/esm/services/region-service.js +++ b/lib/esm/services/region-service.js @@ -21,13 +21,20 @@ export default class RegionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing regions. @@ -40,12 +47,19 @@ export default class RegionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/release-service.js b/lib/esm/services/release-service.js index 9182a37..e68f673 100644 --- a/lib/esm/services/release-service.js +++ b/lib/esm/services/release-service.js @@ -22,13 +22,20 @@ export default class ReleaseService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing releases. @@ -42,13 +49,20 @@ export default class ReleaseService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create new release. @@ -64,14 +78,21 @@ export default class ReleaseService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Rollback to an existing release. @@ -87,13 +108,20 @@ export default class ReleaseService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/review-app-config-service.js b/lib/esm/services/review-app-config-service.js index 4761fc4..529ba3c 100644 --- a/lib/esm/services/review-app-config-service.js +++ b/lib/esm/services/review-app-config-service.js @@ -24,14 +24,21 @@ export default class ReviewAppConfigService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Get review apps configuration for a pipeline @@ -46,13 +53,20 @@ export default class ReviewAppConfigService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update review app configuration for a pipeline @@ -69,14 +83,21 @@ export default class ReviewAppConfigService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Disable review apps for a pipeline @@ -91,13 +112,20 @@ export default class ReviewAppConfigService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/review-app-service.js b/lib/esm/services/review-app-service.js index ffe1c8a..a66042f 100644 --- a/lib/esm/services/review-app-service.js +++ b/lib/esm/services/review-app-service.js @@ -22,14 +22,21 @@ export default class ReviewAppService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Gets an existing review app @@ -43,13 +50,20 @@ export default class ReviewAppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing review app @@ -63,14 +77,21 @@ export default class ReviewAppService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Get a review app using the associated app_id @@ -84,13 +105,20 @@ export default class ReviewAppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List review apps for a pipeline @@ -105,12 +133,19 @@ export default class ReviewAppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/slug-service.js b/lib/esm/services/slug-service.js index 2c02ce9..ed7ed16 100644 --- a/lib/esm/services/slug-service.js +++ b/lib/esm/services/slug-service.js @@ -22,13 +22,20 @@ export default class SlugService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new slug. For more information please refer to [Deploying Slugs using the Platform API](https://devcenter.heroku.com/articles/platform-api-deploying-slugs). @@ -44,13 +51,20 @@ export default class SlugService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/sms-number-service.js b/lib/esm/services/sms-number-service.js index 4400509..b4fd6d3 100644 --- a/lib/esm/services/sms-number-service.js +++ b/lib/esm/services/sms-number-service.js @@ -21,13 +21,20 @@ export default class SmsNumberService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Recover an account using an SMS recovery code @@ -41,14 +48,21 @@ export default class SmsNumberService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Confirm an SMS number change with a confirmation code @@ -62,13 +76,20 @@ export default class SmsNumberService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/sni-endpoint-service.js b/lib/esm/services/sni-endpoint-service.js index e8dc637..b063782 100644 --- a/lib/esm/services/sni-endpoint-service.js +++ b/lib/esm/services/sni-endpoint-service.js @@ -23,14 +23,21 @@ export default class SniEndpointService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete existing SNI endpoint. @@ -45,14 +52,21 @@ export default class SniEndpointService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing SNI endpoint. @@ -67,13 +81,20 @@ export default class SniEndpointService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing SNI endpoints. @@ -87,13 +108,20 @@ export default class SniEndpointService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing SNI endpoint. @@ -110,13 +138,20 @@ export default class SniEndpointService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/source-service.js b/lib/esm/services/source-service.js index 7b7d1af..26477c8 100644 --- a/lib/esm/services/source-service.js +++ b/lib/esm/services/source-service.js @@ -20,14 +20,21 @@ export default class SourceService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create URLs for uploading and downloading source. Deprecated in favor of `POST /sources` @@ -41,13 +48,20 @@ export default class SourceService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/space-app-access-service.js b/lib/esm/services/space-app-access-service.js index e152256..b59e749 100644 --- a/lib/esm/services/space-app-access-service.js +++ b/lib/esm/services/space-app-access-service.js @@ -22,13 +22,20 @@ export default class SpaceAppAccessService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing user's set of permissions on a space. @@ -45,14 +52,21 @@ export default class SpaceAppAccessService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List all users and their permissions on a space. @@ -66,12 +80,19 @@ export default class SpaceAppAccessService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/space-host-service.d.ts b/lib/esm/services/space-host-service.d.ts new file mode 100644 index 0000000..175bf75 --- /dev/null +++ b/lib/esm/services/space-host-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Host](https://devcenter.heroku.com/articles/platform-api-reference#space-host) + * [Space Hosts](https://devcenter.heroku.com/articles/private-spaces-dedicated-hosts?preview=1) lists dedicated hosts allocated to a space + */ +export default class SpaceHostService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List hosts + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + list(spaceIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/space-host-service.js b/lib/esm/services/space-host-service.js new file mode 100644 index 0000000..227bba6 --- /dev/null +++ b/lib/esm/services/space-host-service.js @@ -0,0 +1,39 @@ +/** + * [Heroku Platform API - Space Host](https://devcenter.heroku.com/articles/platform-api-reference#space-host) + * [Space Hosts](https://devcenter.heroku.com/articles/private-spaces-dedicated-hosts?preview=1) lists dedicated hosts allocated to a space + */ +export default class SpaceHostService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List hosts + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async list(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/hosts`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/space-log-drain-service.d.ts b/lib/esm/services/space-log-drain-service.d.ts new file mode 100644 index 0000000..f7082a4 --- /dev/null +++ b/lib/esm/services/space-log-drain-service.d.ts @@ -0,0 +1,25 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Log Drain](https://devcenter.heroku.com/articles/platform-api-reference#space-log-drain) + * Single log drain for all apps in a Private Space + */ +export default class SpaceLogDrainService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Current log drain for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + info(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Update log drain for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(spaceIdentity: string, payload: Heroku.SpaceLogDrainUpdatePayload, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/space-log-drain-service.js b/lib/esm/services/space-log-drain-service.js new file mode 100644 index 0000000..e13a6f6 --- /dev/null +++ b/lib/esm/services/space-log-drain-service.js @@ -0,0 +1,69 @@ +/** + * [Heroku Platform API - Space Log Drain](https://devcenter.heroku.com/articles/platform-api-reference#space-log-drain) + * Single log drain for all apps in a Private Space + */ +export default class SpaceLogDrainService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Current log drain for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async info(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/log-drain`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Update log drain for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(spaceIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/log-drain`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/space-nat-service.js b/lib/esm/services/space-nat-service.js index 19ae7fc..ad5a210 100644 --- a/lib/esm/services/space-nat-service.js +++ b/lib/esm/services/space-nat-service.js @@ -21,12 +21,19 @@ export default class SpaceNatService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/space-service.js b/lib/esm/services/space-service.js index d8bae1d..c19d70f 100644 --- a/lib/esm/services/space-service.js +++ b/lib/esm/services/space-service.js @@ -20,13 +20,20 @@ export default class SpaceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing space. @@ -40,13 +47,20 @@ export default class SpaceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing space. @@ -62,14 +76,21 @@ export default class SpaceService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing space. @@ -83,14 +104,21 @@ export default class SpaceService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new space. @@ -105,13 +133,20 @@ export default class SpaceService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/space-topology-service.js b/lib/esm/services/space-topology-service.js index ea51643..110c623 100644 --- a/lib/esm/services/space-topology-service.js +++ b/lib/esm/services/space-topology-service.js @@ -21,12 +21,19 @@ export default class SpaceTopologyService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/space-transfer-service.js b/lib/esm/services/space-transfer-service.js index 7d98f63..b7a4e7e 100644 --- a/lib/esm/services/space-transfer-service.js +++ b/lib/esm/services/space-transfer-service.js @@ -23,13 +23,20 @@ export default class SpaceTransferService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/stack-service.d.ts b/lib/esm/services/stack-service.d.ts index 471c0d8..18be7e7 100644 --- a/lib/esm/services/stack-service.d.ts +++ b/lib/esm/services/stack-service.d.ts @@ -20,4 +20,11 @@ export default class StackService { * @param requestInit The initializer for the request. */ list(requestInit?: Omit): Promise; + /** + * List available app stacks for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + listStacks(appIdentity: string, requestInit?: Omit): Promise; } diff --git a/lib/esm/services/stack-service.js b/lib/esm/services/stack-service.js index 3a4d107..e0c7c60 100644 --- a/lib/esm/services/stack-service.js +++ b/lib/esm/services/stack-service.js @@ -21,13 +21,20 @@ export default class StackService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List available stacks. @@ -40,12 +47,46 @@ export default class StackService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List available app stacks for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async listStacks(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/available-stacks`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/team-add-on-service.js b/lib/esm/services/team-add-on-service.js index 96ef71c..270ce1c 100644 --- a/lib/esm/services/team-add-on-service.js +++ b/lib/esm/services/team-add-on-service.js @@ -21,12 +21,19 @@ export default class TeamAddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/team-app-collaborator-service.js b/lib/esm/services/team-app-collaborator-service.js index 5946d64..ddfc5d3 100644 --- a/lib/esm/services/team-app-collaborator-service.js +++ b/lib/esm/services/team-app-collaborator-service.js @@ -23,14 +23,21 @@ export default class TeamAppCollaboratorService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing collaborator from a team app. @@ -46,14 +53,21 @@ export default class TeamAppCollaboratorService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for a collaborator on a team app. @@ -69,13 +83,20 @@ export default class TeamAppCollaboratorService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing collaborator from a team app. @@ -93,14 +114,21 @@ export default class TeamAppCollaboratorService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List collaborators on a team app. @@ -115,12 +143,19 @@ export default class TeamAppCollaboratorService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/team-app-permission-service.js b/lib/esm/services/team-app-permission-service.js index 1a67519..3176d17 100644 --- a/lib/esm/services/team-app-permission-service.js +++ b/lib/esm/services/team-app-permission-service.js @@ -20,12 +20,19 @@ export default class TeamAppPermissionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/team-app-service.js b/lib/esm/services/team-app-service.js index 076eeee..89ea051 100644 --- a/lib/esm/services/team-app-service.js +++ b/lib/esm/services/team-app-service.js @@ -22,14 +22,21 @@ export default class TeamAppService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for a team app. @@ -44,13 +51,20 @@ export default class TeamAppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Lock or unlock a team app. @@ -67,14 +81,21 @@ export default class TeamAppService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Transfer an existing team app to another Heroku account. @@ -91,7 +112,7 @@ export default class TeamAppService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); @@ -111,14 +132,21 @@ export default class TeamAppService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List team apps. @@ -132,12 +160,19 @@ export default class TeamAppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/team-daily-usage-service.js b/lib/esm/services/team-daily-usage-service.js index d55eb9a..34dcdc0 100644 --- a/lib/esm/services/team-daily-usage-service.js +++ b/lib/esm/services/team-daily-usage-service.js @@ -24,12 +24,19 @@ export default class TeamDailyUsageService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/team-delinquency-service.js b/lib/esm/services/team-delinquency-service.js index fd1f225..80e9190 100644 --- a/lib/esm/services/team-delinquency-service.js +++ b/lib/esm/services/team-delinquency-service.js @@ -21,12 +21,19 @@ export default class TeamDelinquencyService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/team-feature-service.js b/lib/esm/services/team-feature-service.js index 0b3b3ed..1fc193a 100644 --- a/lib/esm/services/team-feature-service.js +++ b/lib/esm/services/team-feature-service.js @@ -22,13 +22,20 @@ export default class TeamFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing team features. @@ -42,12 +49,19 @@ export default class TeamFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/team-invitation-service.js b/lib/esm/services/team-invitation-service.js index d03c6b6..a949815 100644 --- a/lib/esm/services/team-invitation-service.js +++ b/lib/esm/services/team-invitation-service.js @@ -22,13 +22,20 @@ export default class TeamInvitationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create Team Invitation @@ -44,14 +51,21 @@ export default class TeamInvitationService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Revoke a team invitation. @@ -66,14 +80,21 @@ export default class TeamInvitationService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Get an invitation by its token @@ -88,13 +109,20 @@ export default class TeamInvitationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Accept Team Invitation @@ -109,13 +137,20 @@ export default class TeamInvitationService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/team-invoice-service.js b/lib/esm/services/team-invoice-service.js index 7af4864..50040ef 100644 --- a/lib/esm/services/team-invoice-service.js +++ b/lib/esm/services/team-invoice-service.js @@ -22,13 +22,20 @@ export default class TeamInvoiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing invoices. @@ -42,12 +49,19 @@ export default class TeamInvoiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/team-license-collection-service.d.ts b/lib/esm/services/team-license-collection-service.d.ts new file mode 100644 index 0000000..398fe93 --- /dev/null +++ b/lib/esm/services/team-license-collection-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team License Collection](https://devcenter.heroku.com/articles/platform-api-reference#team-license-collection) + * A team license collection is credits provided and consumed by the team per period. + */ +export default class TeamLicenseCollectionService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List team licenses. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-license-collection-service.js b/lib/esm/services/team-license-collection-service.js new file mode 100644 index 0000000..5e33fe6 --- /dev/null +++ b/lib/esm/services/team-license-collection-service.js @@ -0,0 +1,39 @@ +/** + * [Heroku Platform API - Team License Collection](https://devcenter.heroku.com/articles/platform-api-reference#team-license-collection) + * A team license collection is credits provided and consumed by the team per period. + */ +export default class TeamLicenseCollectionService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List team licenses. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/license-collections`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/team-license-service.d.ts b/lib/esm/services/team-license-service.d.ts new file mode 100644 index 0000000..34cc4c3 --- /dev/null +++ b/lib/esm/services/team-license-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team License](https://devcenter.heroku.com/articles/platform-api-reference#team-license) + * A team license is credits provided and consumed by the team. + */ +export default class TeamLicenseService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * List teams licenses. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + list(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/team-license-service.js b/lib/esm/services/team-license-service.js new file mode 100644 index 0000000..9c88e92 --- /dev/null +++ b/lib/esm/services/team-license-service.js @@ -0,0 +1,39 @@ +/** + * [Heroku Platform API - Team License](https://devcenter.heroku.com/articles/platform-api-reference#team-license) + * A team license is credits provided and consumed by the team. + */ +export default class TeamLicenseService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * List teams licenses. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async list(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/licenses`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/team-member-service.js b/lib/esm/services/team-member-service.js index b11c6b9..88fd8bf 100644 --- a/lib/esm/services/team-member-service.js +++ b/lib/esm/services/team-member-service.js @@ -23,14 +23,21 @@ export default class TeamMemberService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new team member. @@ -46,14 +53,21 @@ export default class TeamMemberService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update a team member. @@ -69,14 +83,21 @@ export default class TeamMemberService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Remove a member from the team. @@ -91,14 +112,21 @@ export default class TeamMemberService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List members of the team. @@ -112,13 +140,20 @@ export default class TeamMemberService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List the apps of a team member. @@ -133,12 +168,19 @@ export default class TeamMemberService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/team-monthly-usage-service.js b/lib/esm/services/team-monthly-usage-service.js index 0522373..633f9bf 100644 --- a/lib/esm/services/team-monthly-usage-service.js +++ b/lib/esm/services/team-monthly-usage-service.js @@ -24,12 +24,19 @@ export default class TeamMonthlyUsageService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/team-preferences-service.js b/lib/esm/services/team-preferences-service.js index a5cbdd6..cefcec0 100644 --- a/lib/esm/services/team-preferences-service.js +++ b/lib/esm/services/team-preferences-service.js @@ -21,13 +21,20 @@ export default class TeamPreferencesService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update Team Preferences @@ -43,13 +50,20 @@ export default class TeamPreferencesService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/team-service.js b/lib/esm/services/team-service.js index b124686..d30c458 100644 --- a/lib/esm/services/team-service.js +++ b/lib/esm/services/team-service.js @@ -20,13 +20,20 @@ export default class TeamService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for a team. @@ -40,13 +47,20 @@ export default class TeamService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update team properties. @@ -62,14 +76,21 @@ export default class TeamService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new team. @@ -84,14 +105,21 @@ export default class TeamService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing team. @@ -105,14 +133,21 @@ export default class TeamService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List teams for an enterprise account. @@ -126,13 +161,20 @@ export default class TeamService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a team in an enterprise account. @@ -148,13 +190,20 @@ export default class TeamService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/team-space-service.js b/lib/esm/services/team-space-service.js index ae54768..98a8045 100644 --- a/lib/esm/services/team-space-service.js +++ b/lib/esm/services/team-space-service.js @@ -21,12 +21,19 @@ export default class TeamSpaceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/telemetry-drain-service.d.ts b/lib/esm/services/telemetry-drain-service.d.ts new file mode 100644 index 0000000..d24fc50 --- /dev/null +++ b/lib/esm/services/telemetry-drain-service.d.ts @@ -0,0 +1,53 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Telemetry Drain](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-drain) + * A telemetry drain forwards OpenTelemetry traces, metrics, and logs to your own consumer. For Fir-generation apps only. + */ +export default class TelemetryDrainService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Create a telemetry drain. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.TelemetryDrainCreatePayload, requestInit?: Omit): Promise; + /** + * List telemetry drains for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + listByApp(appIdentity: string, requestInit?: Omit): Promise; + /** + * List telemetry drains for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + listBySpace(spaceIdentity: string, requestInit?: Omit): Promise; + /** + * Update a telemetry drain. + * + * @param telemetryDrainIdentity unique identifier of telemetry drain. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + update(telemetryDrainIdentity: string, payload: Heroku.TelemetryDrainUpdatePayload, requestInit?: Omit): Promise; + /** + * Delete a telemetry drain. + * + * @param telemetryDrainIdentity unique identifier of telemetry drain. + * @param requestInit The initializer for the request. + */ + delete(telemetryDrainIdentity: string, requestInit?: Omit): Promise; + /** + * Info for a telemetry drain. + * + * @param telemetryDrainIdentity unique identifier of telemetry drain. + * @param requestInit The initializer for the request. + */ + info(telemetryDrainIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/telemetry-drain-service.js b/lib/esm/services/telemetry-drain-service.js new file mode 100644 index 0000000..23dcf4b --- /dev/null +++ b/lib/esm/services/telemetry-drain-service.js @@ -0,0 +1,180 @@ +/** + * [Heroku Platform API - Telemetry Drain](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-drain) + * A telemetry drain forwards OpenTelemetry traces, metrics, and logs to your own consumer. For Fir-generation apps only. + */ +export default class TelemetryDrainService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Create a telemetry drain. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async create(payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/telemetry-drains`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List telemetry drains for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async listByApp(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/telemetry-drains`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List telemetry drains for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + async listBySpace(spaceIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/telemetry-drains`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Update a telemetry drain. + * + * @param telemetryDrainIdentity unique identifier of telemetry drain. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + async update(telemetryDrainIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/telemetry-drains/${telemetryDrainIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Delete a telemetry drain. + * + * @param telemetryDrainIdentity unique identifier of telemetry drain. + * @param requestInit The initializer for the request. + */ + async delete(telemetryDrainIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/telemetry-drains/${telemetryDrainIdentity}`, { + ...requestInit, + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Info for a telemetry drain. + * + * @param telemetryDrainIdentity unique identifier of telemetry drain. + * @param requestInit The initializer for the request. + */ + async info(telemetryDrainIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/telemetry-drains/${telemetryDrainIdentity}`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/telemetry-ingress-info-service.d.ts b/lib/esm/services/telemetry-ingress-info-service.d.ts new file mode 100644 index 0000000..dd4971a --- /dev/null +++ b/lib/esm/services/telemetry-ingress-info-service.d.ts @@ -0,0 +1,17 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Telemetry Ingress Info](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-ingress-info) + * Telemetry Ingress Info allows add-on partners to view authorization information required to write to Fir app logs. + */ +export default class TelemetryIngressInfoService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Fetch telemetry ingress info. + * + * @param addOnAttachmentIdentity unique identifier of this add-on attachment. + * @param requestInit The initializer for the request. + */ + info(addOnAttachmentIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/telemetry-ingress-info-service.js b/lib/esm/services/telemetry-ingress-info-service.js new file mode 100644 index 0000000..0d1a712 --- /dev/null +++ b/lib/esm/services/telemetry-ingress-info-service.js @@ -0,0 +1,39 @@ +/** + * [Heroku Platform API - Telemetry Ingress Info](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-ingress-info) + * Telemetry Ingress Info allows add-on partners to view authorization information required to write to Fir app logs. + */ +export default class TelemetryIngressInfoService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Fetch telemetry ingress info. + * + * @param addOnAttachmentIdentity unique identifier of this add-on attachment. + * @param requestInit The initializer for the request. + */ + async info(addOnAttachmentIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/addon-attachments/${addOnAttachmentIdentity}/telemetry-ingress-info`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/test-case-service.js b/lib/esm/services/test-case-service.js index f5c939f..c7939c0 100644 --- a/lib/esm/services/test-case-service.js +++ b/lib/esm/services/test-case-service.js @@ -21,12 +21,19 @@ export default class TestCaseService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/test-node-service.js b/lib/esm/services/test-node-service.js index e98e620..ec404a4 100644 --- a/lib/esm/services/test-node-service.js +++ b/lib/esm/services/test-node-service.js @@ -21,12 +21,19 @@ export default class TestNodeService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/test-run-service.js b/lib/esm/services/test-run-service.js index 30fffc1..d7f1561 100644 --- a/lib/esm/services/test-run-service.js +++ b/lib/esm/services/test-run-service.js @@ -22,7 +22,7 @@ export default class TestRunService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); @@ -39,7 +39,7 @@ export default class TestRunService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } @@ -56,13 +56,20 @@ export default class TestRunService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing test-run by Pipeline @@ -78,7 +85,7 @@ export default class TestRunService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } @@ -96,7 +103,7 @@ export default class TestRunService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); diff --git a/lib/esm/services/usage-service.d.ts b/lib/esm/services/usage-service.d.ts new file mode 100644 index 0000000..d22ba4f --- /dev/null +++ b/lib/esm/services/usage-service.d.ts @@ -0,0 +1,33 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Usage](https://devcenter.heroku.com/articles/platform-api-reference#usage) + * Usage for apps. + */ +export default class UsageService { + protected readonly fetchImpl: typeof fetch; + protected readonly endpoint: string; + constructor(fetchImpl: typeof fetch, endpoint: string); + /** + * Retrieves usage for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + info(appIdentity: string, requestInit?: Omit): Promise; + /** + * Retrieves usage for an app belonging to a particular team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamAppIdentity unique name of app + * @example "example". + * @param requestInit The initializer for the request. + */ + infoUsage(teamIdentity: string, teamAppIdentity: string, requestInit?: Omit): Promise; + /** + * Retrieves usage for apps belonging to a particular team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + infoApps(teamIdentity: string, requestInit?: Omit): Promise; +} diff --git a/lib/esm/services/usage-service.js b/lib/esm/services/usage-service.js new file mode 100644 index 0000000..51c5fdf --- /dev/null +++ b/lib/esm/services/usage-service.js @@ -0,0 +1,95 @@ +/** + * [Heroku Platform API - Usage](https://devcenter.heroku.com/articles/platform-api-reference#usage) + * Usage for apps. + */ +export default class UsageService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Retrieves usage for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + async info(appIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/usage`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Retrieves usage for an app belonging to a particular team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamAppIdentity unique name of app + * @example "example". + * @param requestInit The initializer for the request. + */ + async infoUsage(teamIdentity, teamAppIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/apps/${teamAppIdentity}/usage`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Retrieves usage for apps belonging to a particular team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + async infoApps(teamIdentity, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/usage`, { + ...requestInit, + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/lib/esm/services/user-preferences-service.js b/lib/esm/services/user-preferences-service.js index 682f201..4b0ab15 100644 --- a/lib/esm/services/user-preferences-service.js +++ b/lib/esm/services/user-preferences-service.js @@ -21,13 +21,20 @@ export default class UserPreferencesService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update User Preferences @@ -43,13 +50,20 @@ export default class UserPreferencesService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/lib/esm/services/vpn-connection-service.js b/lib/esm/services/vpn-connection-service.js index 5277bd9..6dda369 100644 --- a/lib/esm/services/vpn-connection-service.js +++ b/lib/esm/services/vpn-connection-service.js @@ -23,14 +23,21 @@ export default class VpnConnectionService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Destroy existing VPN Connection @@ -45,14 +52,21 @@ export default class VpnConnectionService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List VPN connections for a space. @@ -66,13 +80,20 @@ export default class VpnConnectionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an existing vpn-connection. @@ -87,13 +108,20 @@ export default class VpnConnectionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update a VPN connection in a private space. @@ -110,13 +138,20 @@ export default class VpnConnectionService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()); } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/package.json b/package.json index 4d85948..b4e26e4 100644 --- a/package.json +++ b/package.json @@ -3,30 +3,19 @@ "version": "1.0.25", "author": "Heroku", "bugs": "https://github.com/heroku/typescript-api-schema/issues", - "devDependencies": { - "@typescript-eslint/parser": "^6.15.0", - "camelcase": "^8.0.0", - "eslint": "^8.56.0", - "eslint-config-salesforce-typescript": "3.2.3", - "eslint-plugin-unused-imports": "^3.1.0", - "pascal-case": "^4.0.0", - "dashify": "^2.0.0", - "prettier": "3.2.4", - "http-call": "^5.2.2", - "jsonwebtoken": "9.0.0", - "typescript": "^5.3.3" - }, - "peerDependencies": { - "tslib": "2.x" - }, + "main": "./lib/cjs/index.js", + "module": "./lib/esm/index.js", + "types": "./lib/esm/index.d.ts", "exports": { ".": { "import": "./lib/esm/index.js", - "require": "./lib/cjs/index.js" + "require": "./lib/cjs/index.js", + "types": "./lib/esm/index.d.ts" }, "./services/*.js": { "import": "./lib/esm/services/*.js", - "require": "./lib/cjs/services/*.js" + "require": "./lib/cjs/services/*.js", + "types": "./lib/esm/services/*.d.ts" } }, "engines": { @@ -41,10 +30,25 @@ ], "license": "MIT", "repository": "heroku/typescript-api-schema", - "types": "lib/index.d.ts", "scripts": { "build:cjs": "tsc --module commonjs --outDir lib/cjs --target esnext", "build:esm": "tsc --module esnext --outDir lib/esm --target esnext", "build": "node schema-builder.mjs && eslint . --config .eslintrc --fix && prettier -w --config ./.prettier.mjs ./src/**/*.ts && (npm run build:cjs & npm run build:esm)" + }, + "devDependencies": { + "@typescript-eslint/parser": "^6.15.0", + "camelcase": "^8.0.0", + "eslint": "^8.56.0", + "eslint-config-salesforce-typescript": "3.2.3", + "eslint-plugin-unused-imports": "^3.1.0", + "pascal-case": "^4.0.0", + "dashify": "^2.0.0", + "prettier": "3.2.4", + "http-call": "^5.2.2", + "jsonwebtoken": "9.0.0", + "typescript": "^5.3.3" + }, + "peerDependencies": { + "tslib": "2.x" } } diff --git a/schema-builder.mjs b/schema-builder.mjs index 4b4b19d..006c3a6 100644 --- a/schema-builder.mjs +++ b/schema-builder.mjs @@ -1,4 +1,4 @@ -import schema from './schema.json' assert {type: 'json'}; +import schema from './schema.json' with {type: 'json'}; import {pascalCase} from 'pascal-case'; import fs from 'node:fs/promises'; @@ -50,6 +50,9 @@ function isDeepEqual(a, b) { * @returns {(*|undefined)[]} */ function resolveTypes(items) { + if (!items) { + return []; + } if (!Array.isArray(items)) { items = [items]; } @@ -59,7 +62,8 @@ function resolveTypes(items) { if (schemaValue) { const {type: types} = schemaValue; const proposedInterfaceName = buildNameFromRef($ref); - return types.map(resolvedType => getTypeDefinition(resolvedType, proposedInterfaceName, item)).join(' | '); + const typesToMap = Array.isArray(types) ? types : [types]; + return typesToMap.map(resolvedType => getTypeDefinition(resolvedType, proposedInterfaceName, item)).join(' | '); } }))]; } @@ -114,15 +118,16 @@ function getTypeDefinition(typeName, proposedInterfaceName, schemaInfo) { * @param {string} propName The name of the interface member. * @param {Record} schemaInfo The schema info belonging to this member * @param {boolean} required Boolean indicating whether this property is required. + * @param {boolean} includeDescription Boolean indicating whether to include the description in the doc block. * @returns {string} */ -function createInterfaceMemberFromProp(propName, schemaInfo, required) { +function createInterfaceMemberFromProp(propName, schemaInfo, required, includeDescription = true) { if (/\W/g.test(propName)) { propName = `'${propName}'`; } const {description, typeScriptType, readOnly} = createInterfaceMemberDescriptor(propName, schemaInfo); - const docBlock = description ? `/**\n * ${description}\n */\n ` : ''; + const docBlock = includeDescription && description ? `/**\n * ${description}\n */\n ` : ''; return `${docBlock}${readOnly ? 'readonly ' : ''}${propName}${required ? '' : '?'}: ${typeScriptType};`; } @@ -140,7 +145,7 @@ function createInterfaceMemberDescriptor(propName, schemaInfo) { const {type, readOnly, anyOf} = schemaValue; let {description = '', example = ''} = schemaValue; - let resolvedTypes = anyOf ? resolveTypes(anyOf) : type; + let resolvedTypes = anyOf ? resolveTypes(anyOf) : Array.isArray(type) ? type : [type]; if (anyOf) { description += anyOf .filter(anyOfRef => anyOfRef.$ref) @@ -152,7 +157,7 @@ function createInterfaceMemberDescriptor(propName, schemaInfo) { const typeDefinitions = resolvedTypes.map((resolvedType) => getTypeDefinition(resolvedType, propName, schemaInfo)); return { description, - typeScriptType: typeDefinitions.join(` ${unionOrIntersection} `), + typeScriptType: typeDefinitions?.join(` ${unionOrIntersection} `), propName, readOnly, }; @@ -202,8 +207,8 @@ function buildNameFromRef(ref = '', useShallowCheck = true) { * @return string */ function createInterfaceFromSchemaInfo(propName, schemaInfo) { - let {properties, strictProperties, description = '', required, $ref} = schemaInfo; - let interfaceName = pascalCase(propName ?? ''); + let {properties, strictProperties, description = '', required, title:schemaTitle, $ref} = schemaInfo; + let interfaceName = pascalCase(propName || schemaTitle || ''); // $ref will always reference a single definition // and are safe to use as-is @@ -254,7 +259,7 @@ function createInterfaceFromSchemaInfo(propName, schemaInfo) { // Interface members are primitives, other interfaces, // intersection types or enums. const interfaceMembers = properties - ? Object.keys(properties).map((propName => createInterfaceMemberFromProp(propName, properties[propName], strictProperties || required?.includes(propName)))) + ? Object.keys(properties).map((propName => createInterfaceMemberFromProp(propName, properties[propName], strictProperties || required?.includes(propName), !!interfaceName))) : ['[k: string]: unknown']; // Build the entire interface @@ -285,14 +290,14 @@ function createInterfaceFromSchemaInfo(propName, schemaInfo) { * @param targetSchema * @returns {string} */ -function getTargetSchemaType(targetSchema) { +function getTargetSchemaType(targetSchema, alternateInterfaceName) { if (!targetSchema) { return 'void'; } const {type: types} = targetSchema; if (types) { return types - .map(type => getTypeDefinition(type, undefined, targetSchema)) + .map(type => getTypeDefinition(type, alternateInterfaceName, targetSchema)) .join(' | '); } return createInterfaceFromSchemaInfo(undefined, targetSchema); @@ -309,9 +314,14 @@ function createParamDescriptors(tokenizedUrl) { const tokenRegex = /{\((#[\w+/\-_]+)\)}/g; const hrefTokens = [...tokenizedUrl.matchAll(tokenRegex)]; let parameterizedUrl = tokenizedUrl; + const encounteredNames = new Set(); const paramDescriptors = hrefTokens.map(hrefToken => { const [token, ref] = hrefToken; - const proposedInterfaceName = camelcase(buildNameFromRef(ref, false)); + let proposedInterfaceName = camelcase(buildNameFromRef(ref, false)); + if (encounteredNames.has(proposedInterfaceName)) { + proposedInterfaceName = `${proposedInterfaceName}${encounteredNames.size}`; + } + encounteredNames.add(proposedInterfaceName); parameterizedUrl = parameterizedUrl.replace(token, '${' + proposedInterfaceName + '}'); return createInterfaceMemberDescriptor(proposedInterfaceName, getValueFromSchema(ref)); }); @@ -350,7 +360,9 @@ function createParamDescriptors(tokenizedUrl) { */ function buildClassMembersFromLinks(entityName, links) { const members = []; - for (const link of links) { + const encounteredTitles = new Set(); + for (let i = 0; i < links.length; i++) { + const link = links[i]; const {description, method, href, schema, title, targetSchema} = link; let payloadType = schema ? createInterfaceFromSchemaInfo(`${entityName}-${title}-payload`, schema) @@ -359,12 +371,20 @@ function buildClassMembersFromLinks(entityName, links) { payloadType = `Heroku.${payloadType}`; } - let targetSchemaType = getTargetSchemaType(targetSchema); + let targetSchemaType = getTargetSchemaType(targetSchema, `${entityName}-${title}-response`); if (targetSchemaType !== 'void' && !targetSchemaType.startsWith('Record')) { targetSchemaType = `Heroku.${targetSchemaType}`; } const {paramDescriptors, parameterizedUrl} = createParamDescriptors(decodeURIComponent(href)); + let methodName = title || method.toLowerCase(); + if (encounteredTitles.has(methodName)) { + const targetSchemaTypeName = targetSchemaType.split('.').pop(); + const [name, isArray] = targetSchemaTypeName.split('[]'); + const formattedTitle = `${title ? `-${title.replace(new RegExp(methodName, 'ig'), '-')}` : ''}`; + methodName = `${methodName}-${name}${isArray !== undefined ? 's' : ''}${title ? `${formattedTitle}` : ''}`; + } + encounteredTitles.add(methodName); // Doc blocks are composed of the schema // description for the method declaration // and the interface descriptor for each param. @@ -393,7 +413,7 @@ function buildClassMembersFromLinks(entityName, links) { method: '${method}', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' ${method !== 'GET' ? `,'Content-Type': 'application/json'` : ''} } }`; @@ -402,11 +422,17 @@ function buildClassMembersFromLinks(entityName, links) { if (response.ok) { return await response.json() as Promise<${targetSchemaType}>; } - throw new Error(response.statusText);` : `await this.fetchImpl(\`${parameterizedUrl}\`, ${requestInit});`; + let message = response.statusText; + try { + ({message} = await response.json() as {message:string}); + } catch (error) { + // no-op + } + throw new Error(\`\${response.status}: \${message}\`, {cause: response});` : `await this.fetchImpl(\`${parameterizedUrl}\`, ${requestInit});`; // Finally the class member is constructed let member = `${docBlock} - public async ${camelcase(title)}(${params}): Promise<${targetSchemaType}> { + public async ${camelcase(methodName)}(${params}): Promise<${targetSchemaType}> { ${returnVal} }`; members.push(member); diff --git a/schema.json b/schema.json index 42f0b2a..12826e2 100644 --- a/schema.json +++ b/schema.json @@ -420,6 +420,117 @@ "type": [ "boolean" ] + }, + "eco_dynos_enabled": { + "default": false, + "description": "whether the user has enabled Eco dynos", + "example": false, + "readOnly": false, + "type": [ + "boolean" + ] + }, + "eco_dynos_shutdown_at": { + "description": "When the user's Eco dynos will be shutdown after disablement", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "pipeline_cost_consent_at": { + "description": "when pipeline cost consent was made", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "pipeline_cost_consent": { + "description": "whether pipeline cost consent was made", + "example": "true", + "readOnly": true, + "type": [ + "boolean" + ] + }, + "acknowledged_msa": { + "description": "whether account has acknowledged the MSA terms of service", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "acknowledged_msa_at": { + "description": "when account has acknowledged the MSA terms of service", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "italian_customer_terms": { + "description": "whether account has acknowledged the Italian customer terms of service", + "example": "affirmatively_accepted", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "italian_partner_terms": { + "description": "whether account has acknowledged the Italian provider terms of service", + "example": "affirmatively_accepted", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "mfa_enabled": { + "default": false, + "description": "whether account has legacy 2FA or VaaS MFA enabled", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "mfa_exemption": { + "description": "whether the user is exempt from MFA requirements", + "example": false, + "readonly": true, + "type": [ + "boolean" + ] + }, + "mfa_exemption_reason": { + "description": "the reason why a user may be exempt from MFA requirements", + "example": "federated", + "readonly": true, + "type": [ + "string", + "null" + ] + }, + "mfa_experience": { + "description": "which type of mfa the user should see", + "example": "vaas", + "readOnly": true, + "enum": [ + "vaas", + "legacy" + ], + "type": [ + "string" + ] } }, "links": [ @@ -448,6 +559,12 @@ }, "name": { "$ref": "#/definitions/account/definitions/name" + }, + "eco_dynos_enabled": { + "$ref": "#/definitions/account/definitions/eco_dynos_enabled" + }, + "pipeline_cost_consent": { + "$ref": "#/definitions/account/definitions/pipeline_cost_consent" } }, "type": [ @@ -494,6 +611,12 @@ }, "name": { "$ref": "#/definitions/account/definitions/name" + }, + "eco_dynos_enabled": { + "$ref": "#/definitions/account/definitions/eco_dynos_enabled" + }, + "pipeline_cost_consent": { + "$ref": "#/definitions/account/definitions/pipeline_cost_consent" } }, "type": [ @@ -601,6 +724,39 @@ "country_of_residence": { "$ref": "#/definitions/account/definitions/country_of_residence" }, + "eco_dynos_enabled": { + "$ref": "#/definitions/account/definitions/eco_dynos_enabled" + }, + "eco_dynos_shutdown_at": { + "$ref": "#/definitions/account/definitions/eco_dynos_shutdown_at" + }, + "pipeline_cost_consent_at": { + "$ref": "#/definitions/account/definitions/pipeline_cost_consent_at" + }, + "acknowledged_msa": { + "$ref": "#/definitions/account/definitions/acknowledged_msa" + }, + "acknowledged_msa_at": { + "$ref": "#/definitions/account/definitions/acknowledged_msa_at" + }, + "italian_customer_terms": { + "$ref": "#/definitions/account/definitions/italian_customer_terms" + }, + "italian_partner_terms": { + "$ref": "#/definitions/account/definitions/italian_partner_terms" + }, + "mfa_enabled": { + "$ref": "#/definitions/account/definitions/mfa_enabled" + }, + "mfa_exemption": { + "$ref": "#/definitions/account/definitions/mfa_exemption" + }, + "mfa_exemption_reason": { + "$ref": "#/definitions/account/definitions/mfa_exemption_reason" + }, + "mfa_experience": { + "$ref": "#/definitions/account/definitions/mfa_experience" + }, "default_organization": { "description": "team selected by default", "properties": { @@ -644,8 +800,7 @@ "type": [ "object" ], - "definitions": { - }, + "definitions": {}, "links": [ { "description": "Mark an add-on as provisioned for use.", @@ -666,10 +821,58 @@ "$ref": "#/definitions/add-on" }, "title": "Deprovision" + }, + { + "description": "Add or update a peering connection to an add-on", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/actions/peer", + "method": "POST", + "rel": "empty", + "schema": { + "properties": { + "pcx_id": { + "description": "The AWS VPC Peering Connection ID of the peering.", + "example": "pcx-123456789012", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "required": [ + "pcx_id" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "additionalProperties": false, + "type": [ + "object" + ] + }, + "title": "Peer" + }, + { + "description": "Remove a peering connection from an add-on", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/actions/unpeer", + "method": "POST", + "rel": "empty", + "schema": { + "type": [ + "object" + ] + }, + "targetSchema": { + "additionalProperties": false, + "type": [ + "object" + ] + }, + "title": "Unpeer" } ], - "properties": { - } + "properties": {} }, "add-on-attachment": { "description": "An add-on attachment represents a connection between an app and an add-on that it has been given access to.", @@ -1347,6 +1550,27 @@ "type": [ "string" ] + }, + "supported_generations": { + "description": "generations supported by this add-on", + "readonly": true, + "type": [ + "array" + ], + "items": { + "type": [ + "object" + ], + "properties": { + "name": { + "$ref": "#/definitions/generation/definitions/name", + "example": "cedar" + }, + "id": { + "$ref": "#/definitions/generation/definitions/id" + } + } + } } }, "links": [ @@ -1403,6 +1627,9 @@ }, "updated_at": { "$ref": "#/definitions/add-on-service/definitions/updated_at" + }, + "supported_generations": { + "$ref": "#/definitions/add-on-service/definitions/supported_generations" } } }, @@ -2176,6 +2403,9 @@ "contract": { "$ref": "#/definitions/plan/definitions/contract" }, + "metered": { + "$ref": "#/definitions/plan/definitions/metered" + }, "unit": { "$ref": "#/definitions/plan/definitions/unit" } @@ -3765,6 +3995,15 @@ "object" ], "definitions": { + "acm": { + "description": "ACM status of this app", + "default": false, + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, "archived_at": { "description": "when app was archived", "example": "2012-01-01T12:00:00Z", @@ -3775,6 +4014,29 @@ "string" ] }, + "base_image_name": { + "description": "name of the image used for the base layers of the OCI image", + "example": "heroku/heroku:22-cnb", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "build_stack": { + "description": "identity of the stack that will be used for new builds", + "properties": { + "id": { + "$ref": "#/definitions/stack/definitions/id" + }, + "name": { + "$ref": "#/definitions/stack/definitions/name" + } + }, + "type": [ + "object" + ] + }, "buildpack_provided_description": { "description": "description from buildpack of app", "example": "Ruby/Rack", @@ -3784,6 +4046,16 @@ "string" ] }, + "buildpacks": { + "description": "buildpacks of the OCI image", + "items": { + "$ref": "#/definitions/oci-image/definitions/buildpack" + }, + "type": [ + "null", + "array" + ] + }, "created_at": { "description": "when app was created", "example": "2012-01-01T12:00:00Z", @@ -3793,6 +4065,22 @@ "string" ] }, + "current_build_architecture": { + "description": "current build architecture for the app", + "example": "[arm64]", + "readOnly": false, + "type": [ + "array" + ] + }, + "generation": { + "description": "the generation of the app", + "example": "fir", + "readOnly": true, + "type": [ + "string" + ] + }, "git_url": { "description": "git repo URL of app", "example": "https://git.heroku.com/example.git", @@ -3889,15 +4177,6 @@ "null", "string" ] - }, - "acm": { - "description": "ACM status of this app", - "default": false, - "example": false, - "readOnly": true, - "type": [ - "boolean" - ] } }, "links": [ @@ -4060,27 +4339,27 @@ "archived_at": { "$ref": "#/definitions/app/definitions/archived_at" }, + "base_image_name": { + "$ref": "#/definitions/app/definitions/base_image_name" + }, + "build_stack": { + "$ref": "#/definitions/app/definitions/build_stack" + }, "buildpack_provided_description": { "$ref": "#/definitions/app/definitions/buildpack_provided_description" }, - "build_stack": { - "description": "identity of the stack that will be used for new builds", - "properties": { - "id": { - "$ref": "#/definitions/stack/definitions/id" - }, - "name": { - "$ref": "#/definitions/stack/definitions/name" - } - }, - "strictProperties": true, - "type": [ - "object" - ] + "buildpacks": { + "$ref": "#/definitions/app/definitions/buildpacks" }, "created_at": { "$ref": "#/definitions/app/definitions/created_at" }, + "current_build_architecture": { + "$ref": "#/definitions/app/definitions/current_build_architecture" + }, + "generation": { + "$ref": "#/definitions/app/definitions/generation" + }, "git_url": { "$ref": "#/definitions/app/definitions/git_url" }, @@ -4536,7 +4815,7 @@ }, "build": { "$schema": "http://json-schema.org/draft-04/hyper-schema", - "description": "A build represents the process of transforming a code tarball into a slug", + "description": "A build represents the process of transforming a code tarball into build artifacts", "title": "Heroku Build API - Build", "stability": "production", "strictProperties": false, @@ -4553,7 +4832,7 @@ ], "definitions": { "buildpacks": { - "description": "buildpacks executed for this build, in order", + "description": "buildpacks executed for this build, in order (only applicable to Cedar-generation apps)", "type": [ "array", "null" @@ -4608,6 +4887,21 @@ } ] }, + "labs": { + "description": "Labs set from project.toml file. Only applies to Fir generation apps.", + "example": { + "build_config_vars": true + }, + "readOnly": true, + "type": [ + "object" + ], + "additionalProperties": { + "type": [ + "boolean" + ] + } + }, "output_stream_url": { "description": "Build process output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`).", "example": "https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef", @@ -4813,6 +5107,9 @@ "id": { "$ref": "#/definitions/build/definitions/id" }, + "labs": { + "$ref": "#/definitions/build/definitions/labs" + }, "output_stream_url": { "$ref": "#/definitions/build/definitions/output_stream_url" }, @@ -4823,7 +5120,7 @@ "$ref": "#/definitions/build/definitions/release" }, "slug": { - "description": "slug created by this build", + "description": "slug created by this build (only applicable for Cedar-generation apps)", "properties": { "id": { "$ref": "#/definitions/slug/definitions/id" @@ -5688,6 +5985,14 @@ "object" ], "definitions": { + "architecture": { + "description": "CPU architecture of this dyno", + "example": "arm64", + "readOnly": true, + "type": [ + "string" + ] + }, "compute": { "description": "minimum vCPUs, non-dedicated may get more depending on load", "example": 1, @@ -5705,7 +6010,7 @@ ] }, "id": { - "description": "unique identifier of this dyno size", + "description": "unique identifier of the dyno size", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -5723,24 +6028,48 @@ } ] }, - "memory": { - "description": "amount of RAM in GB", - "example": 0.5, + "infrastructure_tier": { + "description": "infrastructure tier for this dyno", + "example": "production", "readOnly": true, "type": [ - "number" + "string" ] }, - "name": { - "description": "the name of this dyno-size", - "example": "eco", + "product_dyno_tier": { + "description": "product tier for this dyno", + "example": "standard", "readOnly": true, "type": [ "string" ] }, - "cost": { - "description": "price information for this dyno size", + "memory": { + "description": "amount of RAM in GB", + "example": 0.5, + "readOnly": true, + "type": [ + "number" + ] + }, + "name": { + "description": "name of the dyno size", + "example": "eco", + "readOnly": true, + "type": [ + "string" + ] + }, + "can_autoscale": { + "description": "whether this dyno size's product tier can use auto-scaling", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "cost": { + "description": "price information for this dyno size", "readOnly": true, "type": [ "null", @@ -5765,15 +6094,6 @@ } } }, - "dyno_units": { - "deprecated": true, - "description": "deprecated. See precise_dyno_units instead", - "example": 0, - "readOnly": true, - "type": [ - "integer" - ] - }, "precise_dyno_units": { "description": "unit of consumption for Heroku Enterprise customers to 2 decimal places", "example": 0.28, @@ -5789,6 +6109,32 @@ "type": [ "boolean" ] + }, + "generation": { + "description": "Generation of the Heroku platform for this dyno size", + "readOnly": true, + "type": [ + "object" + ], + "properties": { + "id": { + "description": "unique identifier of the generation of the Heroku platform for this dyno size", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "name": { + "description": "unique name of the generation of the Heroku platform for this dyno size", + "example": "cedar", + "readOnly": true, + "type": [ + "string" + ] + } + } } }, "links": [ @@ -5816,21 +6162,36 @@ ] }, "title": "List" + }, + { + "description": "List available dyno sizes for an app", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/available-dyno-sizes", + "method": "GET", + "rel": "available-app-dynos", + "targetSchema": { + "items": { + "$ref": "#/definitions/dyno-size" + } + }, + "title": "List App Dyno Sizes" } ], "properties": { + "architecture": { + "$ref": "#/definitions/dyno-size/definitions/architecture" + }, "compute": { "$ref": "#/definitions/dyno-size/definitions/compute" }, + "can_autoscale": { + "$ref": "#/definitions/dyno-size/definitions/can_autoscale" + }, "cost": { "$ref": "#/definitions/dyno-size/definitions/cost" }, "dedicated": { "$ref": "#/definitions/dyno-size/definitions/dedicated" }, - "dyno_units": { - "$ref": "#/definitions/dyno-size/definitions/dyno_units" - }, "precise_dyno_units": { "$ref": "#/definitions/dyno-size/definitions/precise_dyno_units" }, @@ -5845,6 +6206,15 @@ }, "private_space_only": { "$ref": "#/definitions/dyno-size/definitions/private_space_only" + }, + "generation": { + "$ref": "#/definitions/dyno-size/definitions/generation" + }, + "infrastructure_tier": { + "$ref": "#/definitions/dyno-size/definitions/infrastructure_tier" + }, + "product_dyno_tier": { + "$ref": "#/definitions/dyno-size/definitions/product_dyno_tier" } } }, @@ -5939,6 +6309,14 @@ "string" ] }, + "formation_type": { + "description": "the formation type of this process on this dyno", + "example": "run", + "readOnly": true, + "type": [ + "string" + ] + }, "force_no_tty": { "description": "force an attached one-off dyno to not run in a tty", "example": null, @@ -6045,6 +6423,19 @@ }, "title": "Restart" }, + { + "description": "Restart dynos of a given formation type.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/formations/{(%23%2Fdefinitions%2Fdyno%2Fdefinitions%2Fformation_type)}", + "method": "DELETE", + "rel": "empty", + "targetSchema": { + "additionalProperties": false, + "type": [ + "object" + ] + }, + "title": "Restart formation" + }, { "description": "Restart all dynos.", "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/dynos", @@ -6071,6 +6462,19 @@ }, "title": "Stop" }, + { + "description": "Stop dynos of a given formation type.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/formations/{(%23%2Fdefinitions%2Fdyno%2Fdefinitions%2Fformation_type)}/actions/stop", + "method": "POST", + "rel": "empty", + "targetSchema": { + "additionalProperties": false, + "type": [ + "object" + ] + }, + "title": "Stop formation" + }, { "description": "Info for existing dyno.", "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/dynos/{(%23%2Fdefinitions%2Fdyno%2Fdefinitions%2Fidentity)}", @@ -6626,7 +7030,7 @@ ] }, "connect": { - "description": "average connect rows synced", + "description": "max connect rows synced", "example": 15000, "readOnly": true, "type": [ @@ -6913,6 +7317,14 @@ "type": [ "boolean" ] + }, + "partner_benefits": { + "description": "whether the enterprise account is part of the Salesforce Partner Program", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] } }, "links": [ @@ -6980,6 +7392,9 @@ "trial": { "$ref": "#/definitions/enterprise-account/definitions/trial" }, + "partner_benefits": { + "$ref": "#/definitions/enterprise-account/definitions/partner_benefits" + }, "identity_provider": { "$ref": "#/definitions/enterprise-account/definitions/identity_provider" } @@ -7076,6 +7491,50 @@ "string" ] }, + "dyno_size": { + "description": "dyno size", + "example": { + "id": "01234567-89ab-cdef-0123-456789abcdef" + }, + "oneOf": [ + { + "required": [ + "id" + ] + }, + { + "required": [ + "name" + ] + } + ], + "properties": { + "id": { + "description": "unique identifier of the dyno size", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "name": { + "description": "name of the dyno size", + "example": "Standard-1X", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "readOnly": false, + "required": [ + "id" + ], + "type": [ + "object" + ] + }, "id": { "description": "unique identifier of this process type", "example": "01234567-89ab-cdef-0123-456789abcdef", @@ -7104,7 +7563,8 @@ ] }, "size": { - "description": "dyno size", + "deprecated": true, + "description": "deprecated, refer to 'dyno_size' instead", "example": "standard-1X", "readOnly": false, "type": [ @@ -7133,12 +7593,12 @@ "additionalProperties": false, "description": "Properties to update a process type", "properties": { + "dyno_size": { + "$ref": "#/definitions/formation/definitions/dyno_size" + }, "quantity": { "$ref": "#/definitions/formation/definitions/quantity" }, - "size": { - "$ref": "#/definitions/formation/definitions/size" - }, "type": { "$ref": "#/definitions/formation/definitions/type" } @@ -7192,7 +7652,7 @@ "items": { "$ref": "#/definitions/formation/definitions/update" }, - "description": "Array with formation updates. Each element must have \"type\", the id or name of the process type to be updated, and can optionally update its \"quantity\" or \"size\"." + "description": "Array with formation updates. Each element must have \"type\", the id or name of the process type to be updated, and can optionally update its \"quantity\" or \"dyno_size\"." } }, "required": [ @@ -7219,11 +7679,11 @@ "rel": "update", "schema": { "properties": { + "dyno_size": { + "$ref": "#/definitions/formation/definitions/dyno_size" + }, "quantity": { "$ref": "#/definitions/formation/definitions/quantity" - }, - "size": { - "$ref": "#/definitions/formation/definitions/size" } }, "type": [ @@ -7260,6 +7720,20 @@ "created_at": { "$ref": "#/definitions/formation/definitions/created_at" }, + "dyno_size": { + "description": "dyno size", + "properties": { + "id": { + "$ref": "#/definitions/dyno-size/definitions/id" + }, + "name": { + "$ref": "#/definitions/dyno-size/definitions/name" + } + }, + "type": [ + "object" + ] + }, "id": { "$ref": "#/definitions/formation/definitions/id" }, @@ -7277,43 +7751,27 @@ } } }, - "identity-provider": { - "description": "Identity Providers represent the SAML configuration of teams or an Enterprise account", + "generation": { + "description": "A generation represents a version of the Heroku platform that includes the app execution environment, routing, telemetry, and build systems.", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", + "stability": "prototype", "strictProperties": true, - "title": "Heroku Platform API - Identity Provider", + "title": "Heroku Platform API - Generation", "type": [ "object" ], "definitions": { - "certificate": { - "description": "raw contents of the public certificate (eg: .crt or .pem file)", - "example": "-----BEGIN CERTIFICATE----- ...", - "readOnly": false, - "type": [ - "string" - ] - }, "created_at": { - "description": "when provider record was created", - "example": "2012-01-01T12:00:00Z", + "description": "when generation was created", + "example": "2024-12-01T12:00:00Z", "format": "date-time", "readOnly": true, "type": [ "string" ] }, - "entity_id": { - "description": "URL identifier provided by the identity provider", - "example": "https://customer-domain.idp.com", - "readOnly": false, - "type": [ - "string" - ] - }, "id": { - "description": "unique identifier of this identity provider", + "description": "unique identifier of generation", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -7321,243 +7779,234 @@ "string" ] }, - "name": { - "description": "user-friendly unique identifier for this identity provider", - "example": "acme-sso", - "type": [ - "string" - ] - }, - "slo_target_url": { - "description": "single log out URL for this identity provider", - "example": "https://example.com/idp/logout", - "readOnly": false, - "type": [ - "string" + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/generation/definitions/name" + }, + { + "$ref": "#/definitions/generation/definitions/id" + } ] }, - "sso_target_url": { - "description": "single sign on URL for this identity provider", - "example": "https://example.com/idp/login", - "readOnly": false, + "name": { + "description": "unique name of generation", + "example": "fir", + "readOnly": true, "type": [ "string" ] }, "updated_at": { - "description": "when the identity provider record was updated", - "example": "2012-01-01T12:00:00Z", + "description": "when generation was updated", + "example": "2024-12-01T12:00:00Z", "format": "date-time", "readOnly": true, "type": [ "string" ] }, - "owner": { - "description": "entity that owns this identity provider", + "unsupported_feature": { + "description": "unsupported feature information", "properties": { - "id": { - "description": "unique identifier of the owner", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", - "readOnly": true, + "name": { + "description": "name of unsupported feature", + "example": "app_maintenance", "type": [ "string" ] }, - "name": { - "description": "name of the owner", - "example": "acme", - "readOnly": true, + "incompatible_type": { + "description": "type of unsupported feature", + "example": "temporary", "type": [ "string" ] }, - "type": { - "description": "type of the owner", - "enum": [ - "team", - "enterprise-account" - ], - "example": "team", - "readOnly": true, + "scope": { + "description": "scope of unsupported feature", + "example": "app", "type": [ "string" ] } }, - "readOnly": false, - "required": [ - "id", - "type" - ], + "readOnly": true, "type": [ "object" ] + }, + "unsupported_features": { + "description": "features unsupported by this generation", + "type": [ + "array" + ], + "items": { + "type": [ + "string" + ], + "example": "ipv6_peering" + } } }, "links": [ { - "description": "Get a list of a team's Identity Providers", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fname)}/identity-providers", + "description": "Info for generation.", + "href": "/generations/{(%23%2Fdefinitions%2Fstack%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/generation" + }, + "title": "Info" + }, + { + "description": "List available generations.", + "href": "/generations", "method": "GET", "rel": "instances", "targetSchema": { "items": { - "$ref": "#/definitions/identity-provider" + "$ref": "#/definitions/generation" }, "type": [ "array" ] }, - "title": "List By Team" + "title": "List" }, { - "description": "Create an Identity Provider for a team", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fname)}/identity-providers", - "method": "POST", - "rel": "create", - "schema": { - "properties": { - "certificate": { - "$ref": "#/definitions/identity-provider/definitions/certificate" - }, - "entity_id": { - "$ref": "#/definitions/identity-provider/definitions/entity_id" - }, - "slo_target_url": { - "$ref": "#/definitions/identity-provider/definitions/slo_target_url" - }, - "sso_target_url": { - "$ref": "#/definitions/identity-provider/definitions/sso_target_url" - } - }, - "required": [ - "certificate", - "sso_target_url", - "entity_id" - ], - "type": [ - "object" - ] - }, + "description": "List available generations for a team.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/available-generations", + "method": "GET", + "rel": "instances", "targetSchema": { - "$ref": "#/definitions/identity-provider" - }, - "title": "Create By Team" - }, - { - "description": "Update a team's Identity Provider", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fname)}/identity-providers/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fid)}", - "method": "PATCH", - "rel": "update", - "schema": { - "properties": { - "certificate": { - "$ref": "#/definitions/identity-provider/definitions/certificate" - }, - "entity_id": { - "$ref": "#/definitions/identity-provider/definitions/entity_id" - }, - "slo_target_url": { - "$ref": "#/definitions/identity-provider/definitions/slo_target_url" - }, - "sso_target_url": { - "$ref": "#/definitions/identity-provider/definitions/sso_target_url" - } + "items": { + "$ref": "#/definitions/generation" }, "type": [ - "object" + "array" ] }, - "targetSchema": { - "$ref": "#/definitions/identity-provider" - }, - "title": "Update By Team" - }, - { - "description": "Delete a team's Identity Provider", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fname)}/identity-providers/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fid)}", - "method": "DELETE", - "rel": "destroy", - "targetSchema": { - "$ref": "#/definitions/identity-provider" - }, - "title": "Delete By Team" + "title": "List" } ], "properties": { - "certificate": { - "$ref": "#/definitions/identity-provider/definitions/certificate" - }, "created_at": { - "$ref": "#/definitions/identity-provider/definitions/created_at" - }, - "entity_id": { - "$ref": "#/definitions/identity-provider/definitions/entity_id" + "$ref": "#/definitions/generation/definitions/created_at" }, "id": { - "$ref": "#/definitions/identity-provider/definitions/id" + "$ref": "#/definitions/generation/definitions/id" }, - "slo_target_url": { - "$ref": "#/definitions/identity-provider/definitions/slo_target_url" - }, - "sso_target_url": { - "$ref": "#/definitions/identity-provider/definitions/sso_target_url" - }, - "organization": { - "description": "team associated with this identity provider", - "properties": { - "name": { - "$ref": "#/definitions/team/definitions/name" - } - }, - "type": [ - "null", - "object" - ] + "name": { + "$ref": "#/definitions/generation/definitions/name" }, "updated_at": { - "$ref": "#/definitions/identity-provider/definitions/updated_at" + "$ref": "#/definitions/generation/definitions/updated_at" }, - "owner": { - "$ref": "#/definitions/identity-provider/definitions/owner" + "unsupported_features": { + "$ref": "#/definitions/generation/definitions/unsupported_features" + }, + "expanded_supported_features": { + "description": "features unsupported by this generation along with their metadata", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/generation/definitions/unsupported_feature" + } } } }, - "inbound-ruleset": { - "description": "An inbound-ruleset is a collection of rules that specify what hosts can or cannot connect to an application.", + "identity-provider": { + "description": "Identity Providers represent the SSO configuration of an Enterprise Account or Team.", "$schema": "http://json-schema.org/draft-04/hyper-schema", "stability": "prototype", "strictProperties": true, - "title": "Heroku Platform API - Inbound Ruleset", + "title": "Heroku Platform API - Identity Provider", "type": [ "object" ], "definitions": { - "action": { - "description": "states whether the connection is allowed or denied", - "example": "allow", + "certificate": { + "description": "raw contents of the public certificate (eg: .crt or .pem file)", + "example": "-----BEGIN CERTIFICATE----- ...", "readOnly": false, "type": [ - "string" + "string", + "null" + ] + }, + "certificates": { + "description": "Array of sso certificates belonging to this identity provider", + "readOnly": false, + "type": [ + "array" ], - "enum": [ - "allow", - "deny" + "items": { + "type": [ + "object" + ], + "properties": { + "created_at": { + "$ref": "#/definitions/identity-provider-certificate/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/identity-provider-certificate/definitions/id" + }, + "expires_at": { + "$ref": "#/definitions/identity-provider-certificate/definitions/expires_at" + }, + "body": { + "$ref": "#/definitions/identity-provider-certificate/definitions/body" + }, + "name": { + "$ref": "#/definitions/identity-provider-certificate/definitions/name" + } + } + } + }, + "certificate_update": { + "description": "Nested payload for updating associated certificate", + "readOnly": false, + "additionalProperties": false, + "type": [ + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/identity-provider-certificate/definitions/id" + }, + "name": { + "$ref": "#/definitions/identity-provider-certificate/definitions/name" + } + }, + "required": [ + "id", + "name" ] }, - "source": { - "description": "is the request’s source in CIDR notation", - "example": "1.1.1.1/1", - "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/([0-9]|[1-2][0-9]|3[0-2]))$", + "certificate_create": { + "description": "Nested payload for creating associated certificate", "readOnly": false, + "additionalProperties": false, "type": [ - "string" + "object" + ], + "properties": { + "name": { + "$ref": "#/definitions/identity-provider-certificate/definitions/name" + }, + "body": { + "$ref": "#/definitions/identity-provider-certificate/definitions/body" + } + }, + "required": [ + "body" ] }, "created_at": { - "description": "when inbound-ruleset was created", + "description": "when provider record was created", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, @@ -7565,8 +8014,23 @@ "string" ] }, + "enabled": { + "description": "when the identity provider is allowed to be used", + "readOnly": true, + "type": [ + "boolean" + ] + }, + "entity_id": { + "description": "URL identifier provided by the identity provider", + "example": "https://customer-domain.idp.com", + "readOnly": false, + "type": [ + "string" + ] + }, "id": { - "description": "unique identifier of an inbound-ruleset", + "description": "unique identifier of this identity provider", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -7577,249 +8041,199 @@ "identity": { "anyOf": [ { - "$ref": "#/definitions/inbound-ruleset/definitions/id" + "$ref": "#/definitions/identity-provider/definitions/id" + }, + { + "$ref": "#/definitions/identity-provider/definitions/name" } ] }, - "rule": { - "description": "the combination of an IP address in CIDR notation and whether to allow or deny it's traffic.", + "name": { + "description": "user-friendly unique identifier for this identity provider", + "example": "acme-sso", + "readOnly": false, "type": [ - "object" - ], + "string" + ] + }, + "owner": { + "description": "entity that owns this identity provider", "properties": { - "action": { - "$ref": "#/definitions/inbound-ruleset/definitions/action" + "id": { + "description": "unique identifier of the owner", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] }, - "source": { - "$ref": "#/definitions/inbound-ruleset/definitions/source" + "name": { + "description": "name of the owner", + "example": "acme", + "readOnly": true, + "type": [ + "string" + ] + }, + "type": { + "description": "type of the owner", + "enum": [ + "team", + "enterprise-account" + ], + "example": "team", + "readOnly": true, + "type": [ + "string" + ] } }, + "readOnly": false, "required": [ - "source", - "action" + "id", + "type" + ], + "type": [ + "object" ] - } - }, - "links": [ - { - "description": "Current inbound ruleset for a space", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/inbound-ruleset", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/inbound-ruleset" - }, - "title": "Current" - }, - { - "description": "Info on an existing Inbound Ruleset", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/inbound-rulesets/{(%23%2Fdefinitions%2Finbound-ruleset%2Fdefinitions%2Fidentity)}", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/inbound-ruleset" - }, - "title": "Info" }, - { - "description": "List all inbound rulesets for a space", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/inbound-rulesets", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/inbound-ruleset" - }, - "type": [ - "array" - ] - }, - "title": "List" - }, - { - "description": "Create a new inbound ruleset", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/inbound-ruleset", - "method": "PUT", - "rel": "create", - "targetSchema": { - "$ref": "#/definitions/inbound-ruleset" - }, - "schema": { - "type": [ - "object" - ], - "properties": { - "rules": { - "type": [ - "array" - ], - "items": { - "$ref": "#/definitions/inbound-ruleset/definitions/rule" - } - } - } - }, - "title": "Create" - } - ], - "properties": { - "id": { - "$ref": "#/definitions/inbound-ruleset/definitions/id" - }, - "space": { - "description": "identity of space", - "properties": { - "id": { - "$ref": "#/definitions/space/definitions/id" - }, - "name": { - "$ref": "#/definitions/space/definitions/name" - } - }, - "type": [ - "object" - ] - }, - "created_at": { - "$ref": "#/definitions/inbound-ruleset/definitions/created_at" - }, - "rules": { - "type": [ - "array" - ], - "items": { - "$ref": "#/definitions/inbound-ruleset/definitions/rule" - } - }, - "created_by": { - "$ref": "#/definitions/account/definitions/email" - } - } - }, - "invoice-address": { - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "description": "An invoice address represents the address that should be listed on an invoice.", - "title": "Heroku Vault API - Invoice Address", - "stability": "development", - "type": [ - "object" - ], - "definitions": { - "address_1": { - "type": [ - "string" - ], - "description": "invoice street address line 1", - "example": "40 Hickory Blvd." - }, - "address_2": { - "type": [ - "string" - ], - "description": "invoice street address line 2", - "example": "Suite 300" - }, - "city": { + "slo_target_url": { + "description": "single log out URL for this identity provider", + "example": "https://example.com/idp/logout", + "readOnly": false, "type": [ "string" - ], - "description": "invoice city", - "example": "Seattle" + ] }, - "country": { + "sso_target_url": { + "description": "single sign on URL for this identity provider", + "example": "https://example.com/idp/login", + "readOnly": false, "type": [ "string" - ], - "description": "country", - "example": "US" + ] }, - "heroku_id": { + "updated_at": { + "description": "when the identity provider record was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, "type": [ "string" - ], - "description": "heroku_id identifier reference", - "example": "user930223902@heroku.com", - "readOnly": true - }, - "identity": { - "anyOf": [ - { - "$ref": "#/definitions/invoice-address/definitions/heroku_id" - } ] }, - "other": { + "heroku_start_url": { + "description": "heroku start url", + "example": "https://sso.heroku.com/saml/acme-sso/init", + "readOnly": true, "type": [ "string" - ], - "description": "metadata / additional information to go on invoice", - "example": "Company ABC Inc. VAT 903820" + ] }, - "postal_code": { + "heroku_entity_id": { + "description": "heroku entity id", + "example": "https://sso.heroku.com/saml/acme-sso", + "readOnly": true, "type": [ "string" - ], - "description": "invoice zip code", - "example": "98101" + ] }, - "state": { + "heroku_acs_url": { + "description": "heroku acs url", + "example": "https://sso.heroku.com/saml/acme-sso/finalize", + "readOnly": true, "type": [ "string" - ], - "description": "invoice state", - "example": "WA" - }, - "use_invoice_address": { - "type": [ - "boolean" - ], - "description": "flag to use the invoice address for an account or not", - "example": true, - "default": false + ] } }, "links": [ { - "description": "Retrieve existing invoice address.", - "href": "/account/invoice-address", + "description": "Info for an Identity Provider", + "href": "/identity-providers/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fidentity)}", "method": "GET", "rel": "self", "targetSchema": { - "$ref": "#/definitions/invoice-address" + "$ref": "#/definitions/identity-provider" }, - "title": "info" + "title": "Info" }, { - "description": "Update invoice address for an account.", - "href": "/account/invoice-address", - "method": "PUT", - "rel": "self", - "title": "update", + "description": "Create an Identity Provider", + "href": "/identity-providers", + "method": "POST", + "rel": "create", "schema": { "properties": { - "address_1": { - "$ref": "#/definitions/invoice-address/definitions/address_1" + "certificates": { + "$ref": "#/definitions/identity-provider/definitions/certificates" }, - "address_2": { - "$ref": "#/definitions/invoice-address/definitions/address_2" + "certificate": { + "$ref": "#/definitions/identity-provider/definitions/certificate" }, - "city": { - "$ref": "#/definitions/invoice-address/definitions/city" + "entity_id": { + "$ref": "#/definitions/identity-provider/definitions/entity_id" }, - "country": { - "$ref": "#/definitions/invoice-address/definitions/country" + "slo_target_url": { + "$ref": "#/definitions/identity-provider/definitions/slo_target_url" }, - "other": { - "$ref": "#/definitions/invoice-address/definitions/other" + "sso_target_url": { + "$ref": "#/definitions/identity-provider/definitions/sso_target_url" }, - "postal_code": { - "$ref": "#/definitions/invoice-address/definitions/postal_code" + "owner": { + "$ref": "#/definitions/identity-provider/definitions/owner" }, - "state": { - "$ref": "#/definitions/invoice-address/definitions/state" + "enabled": { + "$ref": "#/definitions/identity-provider/definitions/enabled" + } + }, + "required": [ + "owner" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/identity-provider" + }, + "title": "Create" + }, + { + "description": "Update an Identity Provider", + "href": "/identity-providers/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "entity_id": { + "$ref": "#/definitions/identity-provider/definitions/entity_id" }, - "use_invoice_address": { - "$ref": "#/definitions/invoice-address/definitions/use_invoice_address" + "slo_target_url": { + "$ref": "#/definitions/identity-provider/definitions/slo_target_url" + }, + "sso_target_url": { + "$ref": "#/definitions/identity-provider/definitions/sso_target_url" + }, + "enabled": { + "$ref": "#/definitions/identity-provider/definitions/enabled" + }, + "certificates": { + "description": "List of certificates to update or create; any existing certificates not referenced here will be deleted", + "type": [ + "array" + ], + "items": { + "oneOf": [ + { + "$ref": "#/definitions/identity-provider/definitions/certificate_update" + }, + { + "$ref": "#/definitions/identity-provider/definitions/certificate_create" + } + ] + } } }, "type": [ @@ -7827,77 +8241,98 @@ ] }, "targetSchema": { - "$ref": "#/definitions/invoice-address" - } + "$ref": "#/definitions/identity-provider" + }, + "title": "Update" } ], "properties": { - "address_1": { - "$ref": "#/definitions/invoice-address/definitions/address_1" + "certificate": { + "$ref": "#/definitions/identity-provider/definitions/certificate" }, - "address_2": { - "$ref": "#/definitions/invoice-address/definitions/address_2" + "certificates": { + "$ref": "#/definitions/identity-provider/definitions/certificates" }, - "city": { - "$ref": "#/definitions/invoice-address/definitions/city" + "created_at": { + "$ref": "#/definitions/identity-provider/definitions/created_at" }, - "country": { - "$ref": "#/definitions/invoice-address/definitions/country" + "entity_id": { + "$ref": "#/definitions/identity-provider/definitions/entity_id" }, - "heroku_id": { - "$ref": "#/definitions/invoice-address/definitions/identity" + "id": { + "$ref": "#/definitions/identity-provider/definitions/id" }, - "other": { - "$ref": "#/definitions/invoice-address/definitions/other" + "name": { + "$ref": "#/definitions/identity-provider/definitions/name" }, - "postal_code": { - "$ref": "#/definitions/invoice-address/definitions/postal_code" + "owner": { + "$ref": "#/definitions/identity-provider/definitions/owner" }, - "state": { - "$ref": "#/definitions/invoice-address/definitions/state" + "slo_target_url": { + "$ref": "#/definitions/identity-provider/definitions/slo_target_url" }, - "use_invoice_address": { - "$ref": "#/definitions/invoice-address/definitions/use_invoice_address" + "sso_target_url": { + "$ref": "#/definitions/identity-provider/definitions/sso_target_url" + }, + "updated_at": { + "$ref": "#/definitions/identity-provider/definitions/updated_at" + }, + "enabled": { + "$ref": "#/definitions/identity-provider/definitions/enabled" + }, + "heroku_start_url": { + "$ref": "#/definitions/identity-provider/definitions/heroku_start_url" + }, + "heroku_entity_id": { + "$ref": "#/definitions/identity-provider/definitions/heroku_entity_id" + }, + "heroku_acs_url": { + "$ref": "#/definitions/identity-provider/definitions/heroku_acs_url" } } }, - "invoice": { + "inbound-ruleset": { + "description": "An inbound-ruleset is a collection of rules that specify what hosts can or cannot connect to an application.", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "description": "An invoice is an itemized bill of goods for an account which includes pricing and charges.", - "stability": "development", + "stability": "prototype", "strictProperties": true, - "title": "Heroku Platform API - Invoice", + "title": "Heroku Platform API - Inbound Ruleset", "type": [ "object" ], "definitions": { - "charges_total": { - "description": "total charges on this invoice", - "example": 100.0, - "readOnly": true, + "action": { + "description": "states whether the connection is allowed or denied", + "example": "allow", + "readOnly": false, "type": [ - "number" + "string" + ], + "enum": [ + "allow", + "deny" ] }, - "created_at": { - "description": "when invoice was created", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", - "readOnly": true, + "source": { + "description": "is the request’s source in CIDR notation", + "example": "1.1.1.1/1", + "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/([0-9]|[1-2][0-9]|3[0-2]))$", + "readOnly": false, "type": [ "string" ] }, - "credits_total": { - "description": "total credits on this invoice", - "example": 100.0, + "created_at": { + "description": "when inbound-ruleset was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", "readOnly": true, "type": [ - "number" + "string" ] }, "id": { - "description": "unique identifier of this invoice", + "description": "unique identifier of an inbound-ruleset", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -7908,324 +8343,310 @@ "identity": { "anyOf": [ { - "$ref": "#/definitions/invoice/definitions/number" + "$ref": "#/definitions/inbound-ruleset/definitions/id" } ] }, - "number": { - "description": "human readable invoice number", - "example": 9403943, - "readOnly": true, - "type": [ - "integer" - ] - }, - "period_end": { - "description": "the ending date that the invoice covers", - "example": "01/31/2014", - "readOnly": true, - "type": [ - "string" - ] - }, - "period_start": { - "description": "the starting date that this invoice covers", - "example": "01/01/2014", - "readOnly": true, - "type": [ - "string" - ] - }, - "state": { - "description": "payment status for this invoice (pending, successful, failed)", - "example": 1, - "readOnly": true, - "type": [ - "integer" - ] - }, - "total": { - "description": "combined total of charges and credits on this invoice", - "example": 100.0, - "readOnly": true, - "type": [ - "number" - ] - }, - "updated_at": { - "description": "when invoice was updated", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", - "readOnly": true, + "rule": { + "description": "the combination of an IP address in CIDR notation and whether to allow or deny it's traffic.", "type": [ - "string" + "object" + ], + "properties": { + "action": { + "$ref": "#/definitions/inbound-ruleset/definitions/action" + }, + "source": { + "$ref": "#/definitions/inbound-ruleset/definitions/source" + } + }, + "required": [ + "source", + "action" ] } }, "links": [ { - "description": "Info for existing invoice.", - "href": "/account/invoices/{(%23%2Fdefinitions%2Finvoice%2Fdefinitions%2Fidentity)}", + "description": "Current inbound ruleset for a space", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/inbound-ruleset", "method": "GET", "rel": "self", "targetSchema": { - "$ref": "#/definitions/invoice" + "$ref": "#/definitions/inbound-ruleset" + }, + "title": "Current" + }, + { + "description": "Info on an existing Inbound Ruleset", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/inbound-rulesets/{(%23%2Fdefinitions%2Finbound-ruleset%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/inbound-ruleset" }, "title": "Info" }, { - "description": "List existing invoices.", - "href": "/account/invoices", + "description": "List all inbound rulesets for a space", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/inbound-rulesets", "method": "GET", "rel": "instances", "targetSchema": { "items": { - "$ref": "#/definitions/invoice" + "$ref": "#/definitions/inbound-ruleset" }, "type": [ "array" ] }, "title": "List" + }, + { + "description": "Create a new inbound ruleset", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/inbound-ruleset", + "method": "PUT", + "rel": "create", + "targetSchema": { + "$ref": "#/definitions/inbound-ruleset" + }, + "schema": { + "type": [ + "object" + ], + "properties": { + "rules": { + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/inbound-ruleset/definitions/rule" + } + } + } + }, + "title": "Create" } ], "properties": { - "charges_total": { - "$ref": "#/definitions/invoice/definitions/charges_total" - }, - "created_at": { - "$ref": "#/definitions/invoice/definitions/created_at" - }, - "credits_total": { - "$ref": "#/definitions/invoice/definitions/credits_total" - }, "id": { - "$ref": "#/definitions/invoice/definitions/id" - }, - "number": { - "$ref": "#/definitions/invoice/definitions/number" - }, - "period_end": { - "$ref": "#/definitions/invoice/definitions/period_end" + "$ref": "#/definitions/inbound-ruleset/definitions/id" }, - "period_start": { - "$ref": "#/definitions/invoice/definitions/period_start" + "space": { + "description": "identity of space", + "properties": { + "id": { + "$ref": "#/definitions/space/definitions/id" + }, + "name": { + "$ref": "#/definitions/space/definitions/name" + } + }, + "type": [ + "object" + ] }, - "state": { - "$ref": "#/definitions/invoice/definitions/state" + "created_at": { + "$ref": "#/definitions/inbound-ruleset/definitions/created_at" }, - "total": { - "$ref": "#/definitions/invoice/definitions/total" + "rules": { + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/inbound-ruleset/definitions/rule" + } }, - "updated_at": { - "$ref": "#/definitions/invoice/definitions/updated_at" + "created_by": { + "$ref": "#/definitions/account/definitions/email" } } }, - "key": { - "description": "Keys represent public SSH keys associated with an account and are used to authorize accounts as they are performing git operations.", + "invoice-address": { "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", - "strictProperties": true, - "title": "Heroku Platform API - Key", + "description": "An invoice address represents the address that should be listed on an invoice.", + "title": "Heroku Vault API - Invoice Address", + "stability": "development", "type": [ "object" ], "definitions": { - "comment": { - "description": "comment on the key", - "example": "username@host", - "readOnly": true, + "address_1": { "type": [ "string" - ] + ], + "description": "invoice street address line 1", + "example": "40 Hickory Blvd." }, - "created_at": { - "description": "when key was created", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", - "readOnly": true, + "address_2": { "type": [ "string" - ] + ], + "description": "invoice street address line 2", + "example": "Suite 300" }, - "email": { - "deprecated": true, - "description": "deprecated. Please refer to 'comment' instead", - "example": "username@host", - "readOnly": true, + "city": { "type": [ "string" - ] + ], + "description": "invoice city", + "example": "Seattle" }, - "fingerprint": { - "description": "a unique identifying string based on contents", - "example": "17:63:a4:ba:24:d3:7f:af:17:c8:94:82:7e:80:56:bf", - "readOnly": true, + "country": { "type": [ "string" - ] + ], + "description": "country", + "example": "US" }, - "id": { - "description": "unique identifier of this key", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", - "readOnly": true, + "heroku_id": { "type": [ "string" - ] + ], + "description": "heroku_id identifier reference", + "example": "user930223902@heroku.com", + "readOnly": true }, "identity": { "anyOf": [ { - "$ref": "#/definitions/key/definitions/id" - }, - { - "$ref": "#/definitions/key/definitions/fingerprint" + "$ref": "#/definitions/invoice-address/definitions/heroku_id" } ] }, - "public_key": { - "description": "full public_key as uploaded", - "example": "ssh-rsa AAAAB3NzaC1ycVc/../839Uv username@example.com", - "readOnly": true, + "other": { "type": [ "string" - ] + ], + "description": "metadata / additional information to go on invoice", + "example": "Company ABC Inc. VAT 903820" }, - "updated_at": { - "description": "when key was updated", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", - "readOnly": true, + "postal_code": { "type": [ "string" - ] + ], + "description": "invoice zip code", + "example": "98101" + }, + "state": { + "type": [ + "string" + ], + "description": "invoice state", + "example": "WA" + }, + "use_invoice_address": { + "type": [ + "boolean" + ], + "description": "flag to use the invoice address for an account or not", + "example": true, + "default": false } }, "links": [ { - "description": "Info for existing key.", - "href": "/account/keys/{(%23%2Fdefinitions%2Fkey%2Fdefinitions%2Fidentity)}", + "description": "Retrieve existing invoice address.", + "href": "/account/invoice-address", "method": "GET", "rel": "self", "targetSchema": { - "$ref": "#/definitions/key" + "$ref": "#/definitions/invoice-address" }, - "title": "Info" + "title": "info" }, { - "description": "List existing keys.", - "href": "/account/keys", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/key" + "description": "Update invoice address for an account.", + "href": "/account/invoice-address", + "method": "PUT", + "rel": "self", + "title": "update", + "schema": { + "properties": { + "address_1": { + "$ref": "#/definitions/invoice-address/definitions/address_1" + }, + "address_2": { + "$ref": "#/definitions/invoice-address/definitions/address_2" + }, + "city": { + "$ref": "#/definitions/invoice-address/definitions/city" + }, + "country": { + "$ref": "#/definitions/invoice-address/definitions/country" + }, + "other": { + "$ref": "#/definitions/invoice-address/definitions/other" + }, + "postal_code": { + "$ref": "#/definitions/invoice-address/definitions/postal_code" + }, + "state": { + "$ref": "#/definitions/invoice-address/definitions/state" + }, + "use_invoice_address": { + "$ref": "#/definitions/invoice-address/definitions/use_invoice_address" + } }, "type": [ - "array" + "object" ] }, - "title": "List" + "targetSchema": { + "$ref": "#/definitions/invoice-address" + } } ], "properties": { - "comment": { - "$ref": "#/definitions/key/definitions/comment" + "address_1": { + "$ref": "#/definitions/invoice-address/definitions/address_1" }, - "created_at": { - "$ref": "#/definitions/key/definitions/created_at" + "address_2": { + "$ref": "#/definitions/invoice-address/definitions/address_2" }, - "email": { - "$ref": "#/definitions/key/definitions/email" + "city": { + "$ref": "#/definitions/invoice-address/definitions/city" }, - "fingerprint": { - "$ref": "#/definitions/key/definitions/fingerprint" + "country": { + "$ref": "#/definitions/invoice-address/definitions/country" }, - "id": { - "$ref": "#/definitions/key/definitions/id" + "heroku_id": { + "$ref": "#/definitions/invoice-address/definitions/identity" }, - "public_key": { - "$ref": "#/definitions/key/definitions/public_key" + "other": { + "$ref": "#/definitions/invoice-address/definitions/other" }, - "updated_at": { - "$ref": "#/definitions/key/definitions/updated_at" + "postal_code": { + "$ref": "#/definitions/invoice-address/definitions/postal_code" + }, + "state": { + "$ref": "#/definitions/invoice-address/definitions/state" + }, + "use_invoice_address": { + "$ref": "#/definitions/invoice-address/definitions/use_invoice_address" } } }, - "log-drain": { - "description": "[Log drains](https://devcenter.heroku.com/articles/log-drains) provide a way to forward your Heroku logs to an external syslog server for long-term archiving. This external service must be configured to receive syslog packets from Heroku, whereupon its URL can be added to an app using this API. Some add-ons will add a log drain when they are provisioned to an app. These drains can only be removed by removing the add-on.", + "invoice": { "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", + "description": "An invoice is an itemized bill of goods for an account which includes pricing and charges.", + "stability": "development", "strictProperties": true, - "title": "Heroku Platform API - Log Drain", + "title": "Heroku Platform API - Invoice", "type": [ "object" ], "definitions": { - "addon": { - "description": "add-on that created the drain", - "example": { - "id": "01234567-89ab-cdef-0123-456789abcdef", - "name": "singing-swiftly-1242", - "app": { - "id": "01234567-89ab-cdef-0123-456789abcdef", - "name": "example" - } - }, - "properties": { - "id": { - "$ref": "#/definitions/add-on/definitions/id" - }, - "name": { - "$ref": "#/definitions/add-on/definitions/name" - }, - "app": { - "description": "billing application associated with this add-on", - "type": [ - "object" - ], - "properties": { - "id": { - "$ref": "#/definitions/app/definitions/id" - }, - "name": { - "$ref": "#/definitions/app/definitions/name" - } - }, - "strictProperties": true - } - }, - "readOnly": true, - "type": [ - "object", - "null" - ] - }, - "app": { - "description": "application that is attached to this drain", - "example": { - "id": "01234567-89ab-cdef-0123-456789abcdef", - "name": "example" - }, - "properties": { - "id": { - "$ref": "#/definitions/app/definitions/id" - }, - "name": { - "$ref": "#/definitions/app/definitions/name" - } - }, - "strictProperties": true, + "charges_total": { + "description": "total charges on this invoice", + "example": 100.0, "readOnly": true, "type": [ - "object", - "null" + "number" ] }, "created_at": { - "description": "when log drain was created", + "description": "when invoice was created", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, @@ -8233,8 +8654,16 @@ "string" ] }, + "credits_total": { + "description": "total credits on this invoice", + "example": 100.0, + "readOnly": true, + "type": [ + "number" + ] + }, "id": { - "description": "unique identifier of this log drain", + "description": "unique identifier of this invoice", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -8242,46 +8671,57 @@ "string" ] }, - "query_identity": { + "identity": { "anyOf": [ { - "$ref": "#/definitions/log-drain/definitions/id" - }, - { - "$ref": "#/definitions/log-drain/definitions/url" - }, - { - "$ref": "#/definitions/log-drain/definitions/token" + "$ref": "#/definitions/invoice/definitions/number" } ] }, - "identity": { - "anyOf": [ - { - "$ref": "#/definitions/log-drain/definitions/url" - } + "number": { + "description": "human readable invoice number", + "example": 9403943, + "readOnly": true, + "type": [ + "integer" ] }, - "token": { - "description": "token associated with the log drain", - "example": "d.01234567-89ab-cdef-0123-456789abcdef", + "period_end": { + "description": "the ending date that the invoice covers", + "example": "01/31/2014", "readOnly": true, "type": [ "string" ] }, - "updated_at": { - "description": "when log drain was updated", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "period_start": { + "description": "the starting date that this invoice covers", + "example": "01/01/2014", "readOnly": true, "type": [ "string" ] }, - "url": { - "description": "url associated with the log drain", - "example": "https://example.com/drain", + "state": { + "description": "payment status for this invoice (pending, successful, failed)", + "example": 1, + "readOnly": true, + "type": [ + "integer" + ] + }, + "total": { + "description": "combined total of charges and credits on this invoice", + "example": 100.0, + "readOnly": true, + "type": [ + "number" + ] + }, + "updated_at": { + "description": "when invoice was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", "readOnly": true, "type": [ "string" @@ -8290,94 +8730,23 @@ }, "links": [ { - "description": "Create a new log drain.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/log-drains", - "method": "POST", - "rel": "create", - "schema": { - "properties": { - "url": { - "$ref": "#/definitions/log-drain/definitions/url" - } - }, - "required": [ - "url" - ], - "type": [ - "object" - ] - }, - "targetSchema": { - "$ref": "#/definitions/log-drain" - }, - "title": "Create" - }, - { - "description": "Update an add-on owned log drain.", - "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/log-drains/{(%23%2Fdefinitions%2Flog-drain%2Fdefinitions%2Fquery_identity)}", - "method": "PUT", - "rel": "update", - "schema": { - "properties": { - "url": { - "$ref": "#/definitions/log-drain/definitions/url" - } - }, - "required": [ - "url" - ], - "type": [ - "object" - ] - }, - "targetSchema": { - "$ref": "#/definitions/log-drain" - }, - "title": "Update" - }, - { - "description": "Delete an existing log drain. Log drains added by add-ons can only be removed by removing the add-on.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/log-drains/{(%23%2Fdefinitions%2Flog-drain%2Fdefinitions%2Fquery_identity)}", - "method": "DELETE", - "rel": "destroy", - "targetSchema": { - "$ref": "#/definitions/log-drain" - }, - "title": "Delete" - }, - { - "description": "Info for existing log drain.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/log-drains/{(%23%2Fdefinitions%2Flog-drain%2Fdefinitions%2Fquery_identity)}", + "description": "Info for existing invoice.", + "href": "/account/invoices/{(%23%2Fdefinitions%2Finvoice%2Fdefinitions%2Fidentity)}", "method": "GET", "rel": "self", "targetSchema": { - "$ref": "#/definitions/log-drain" + "$ref": "#/definitions/invoice" }, "title": "Info" }, { - "description": "List existing log drains for an add-on.", - "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/log-drains", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/log-drain" - }, - "type": [ - "array" - ] - }, - "title": "List By Add-on" - }, - { - "description": "List existing log drains.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/log-drains", + "description": "List existing invoices.", + "href": "/account/invoices", "method": "GET", "rel": "instances", "targetSchema": { "items": { - "$ref": "#/definitions/log-drain" + "$ref": "#/definitions/invoice" }, "type": [ "array" @@ -8387,41 +8756,58 @@ } ], "properties": { - "addon": { - "$ref": "#/definitions/log-drain/definitions/addon" - }, - "app": { - "$ref": "#/definitions/log-drain/definitions/app" + "charges_total": { + "$ref": "#/definitions/invoice/definitions/charges_total" }, "created_at": { - "$ref": "#/definitions/log-drain/definitions/created_at" + "$ref": "#/definitions/invoice/definitions/created_at" + }, + "credits_total": { + "$ref": "#/definitions/invoice/definitions/credits_total" }, "id": { - "$ref": "#/definitions/log-drain/definitions/id" + "$ref": "#/definitions/invoice/definitions/id" }, - "token": { - "$ref": "#/definitions/log-drain/definitions/token" + "number": { + "$ref": "#/definitions/invoice/definitions/number" }, - "updated_at": { - "$ref": "#/definitions/log-drain/definitions/updated_at" + "period_end": { + "$ref": "#/definitions/invoice/definitions/period_end" }, - "url": { - "$ref": "#/definitions/log-drain/definitions/url" + "period_start": { + "$ref": "#/definitions/invoice/definitions/period_start" + }, + "state": { + "$ref": "#/definitions/invoice/definitions/state" + }, + "total": { + "$ref": "#/definitions/invoice/definitions/total" + }, + "updated_at": { + "$ref": "#/definitions/invoice/definitions/updated_at" } } }, - "log-session": { - "description": "A log session is a reference to the http based log stream for an app.", + "key": { + "description": "Keys represent public SSH keys associated with an account and are used to authorize accounts as they are performing git operations.", "$schema": "http://json-schema.org/draft-04/hyper-schema", "stability": "production", "strictProperties": true, - "title": "Heroku Platform API - Log Session", + "title": "Heroku Platform API - Key", "type": [ "object" ], "definitions": { + "comment": { + "description": "comment on the key", + "example": "username@host", + "readOnly": true, + "type": [ + "string" + ] + }, "created_at": { - "description": "when log connection was created", + "description": "when key was created", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, @@ -8429,16 +8815,25 @@ "string" ] }, - "dyno": { - "description": "dyno to limit results to", - "example": "web.1", - "readOnly": false, + "email": { + "deprecated": true, + "description": "deprecated. Please refer to 'comment' instead", + "example": "username@host", + "readOnly": true, + "type": [ + "string" + ] + }, + "fingerprint": { + "description": "a unique identifying string based on contents", + "example": "17:63:a4:ba:24:d3:7f:af:17:c8:94:82:7e:80:56:bf", + "readOnly": true, "type": [ "string" ] }, "id": { - "description": "unique identifier of this log session", + "description": "unique identifier of this key", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -8449,44 +8844,23 @@ "identity": { "anyOf": [ { - "$ref": "#/definitions/log-session/definitions/id" + "$ref": "#/definitions/key/definitions/id" + }, + { + "$ref": "#/definitions/key/definitions/fingerprint" } ] }, - "lines": { - "description": "number of log lines to stream at once", - "example": 10, - "readOnly": false, - "type": [ - "integer" - ] - }, - "logplex_url": { - "description": "URL for log streaming session", - "example": "https://logplex.heroku.com/sessions/01234567-89ab-cdef-0123-456789abcdef?srv=1325419200", + "public_key": { + "description": "full public_key as uploaded", + "example": "ssh-rsa AAAAB3NzaC1ycVc/../839Uv username@example.com", "readOnly": true, "type": [ "string" ] }, - "source": { - "description": "log source to limit results to", - "example": "app", - "readOnly": false, - "type": [ - "string" - ] - }, - "tail": { - "description": "whether to stream ongoing logs", - "example": true, - "readOnly": false, - "type": [ - "boolean" - ] - }, "updated_at": { - "description": "when log session was updated", + "description": "when key was updated", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, @@ -8497,79 +8871,136 @@ }, "links": [ { - "description": "Create a new log session.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/log-sessions", - "method": "POST", - "rel": "create", - "schema": { - "properties": { - "dyno": { - "$ref": "#/definitions/log-session/definitions/dyno" - }, - "lines": { - "$ref": "#/definitions/log-session/definitions/lines" - }, - "source": { - "$ref": "#/definitions/log-session/definitions/source" - }, - "tail": { - "$ref": "#/definitions/log-session/definitions/tail" - } + "description": "Info for existing key.", + "href": "/account/keys/{(%23%2Fdefinitions%2Fkey%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/key" + }, + "title": "Info" + }, + { + "description": "List existing keys.", + "href": "/account/keys", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/key" }, "type": [ - "object" + "array" ] }, - "targetSchema": { - "$ref": "#/definitions/log-session" - }, - "title": "Create" + "title": "List" } ], "properties": { + "comment": { + "$ref": "#/definitions/key/definitions/comment" + }, "created_at": { - "$ref": "#/definitions/log-session/definitions/created_at" + "$ref": "#/definitions/key/definitions/created_at" + }, + "email": { + "$ref": "#/definitions/key/definitions/email" + }, + "fingerprint": { + "$ref": "#/definitions/key/definitions/fingerprint" }, "id": { - "$ref": "#/definitions/log-session/definitions/id" + "$ref": "#/definitions/key/definitions/id" }, - "logplex_url": { - "$ref": "#/definitions/log-session/definitions/logplex_url" + "public_key": { + "$ref": "#/definitions/key/definitions/public_key" }, "updated_at": { - "$ref": "#/definitions/log-session/definitions/updated_at" + "$ref": "#/definitions/key/definitions/updated_at" } } }, - "oauth-authorization": { - "description": "OAuth authorizations represent clients that a Heroku user has authorized to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth)", + "log-drain": { + "description": "[Log drains](https://devcenter.heroku.com/articles/log-drains) provide a way to forward your Heroku logs to an external syslog server for long-term archiving. This external service must be configured to receive syslog packets from Heroku, whereupon its URL can be added to an app using this API. Some add-ons will add a log drain when they are provisioned to an app. These drains can only be removed by removing the add-on.", "$schema": "http://json-schema.org/draft-04/hyper-schema", "stability": "production", "strictProperties": true, - "title": "Heroku Platform API - OAuth Authorization", + "title": "Heroku Platform API - Log Drain", "type": [ "object" ], "definitions": { - "created_at": { - "description": "when OAuth authorization was created", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "addon": { + "description": "add-on that created the drain", + "example": { + "id": "01234567-89ab-cdef-0123-456789abcdef", + "name": "singing-swiftly-1242", + "app": { + "id": "01234567-89ab-cdef-0123-456789abcdef", + "name": "example" + } + }, + "properties": { + "id": { + "$ref": "#/definitions/add-on/definitions/id" + }, + "name": { + "$ref": "#/definitions/add-on/definitions/name" + }, + "app": { + "description": "billing application associated with this add-on", + "type": [ + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + } + }, + "strictProperties": true + } + }, "readOnly": true, "type": [ - "string" + "object", + "null" ] }, - "description": { - "description": "human-friendly description of this OAuth authorization", - "example": "sample authorization", + "app": { + "description": "application that is attached to this drain", + "example": { + "id": "01234567-89ab-cdef-0123-456789abcdef", + "name": "example" + }, + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + } + }, + "strictProperties": true, + "readOnly": true, + "type": [ + "object", + "null" + ] + }, + "created_at": { + "description": "when log drain was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", "readOnly": true, "type": [ "string" ] }, "id": { - "description": "unique identifier of OAuth authorization", + "description": "unique identifier of this log drain", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -8577,236 +9008,186 @@ "string" ] }, + "query_identity": { + "anyOf": [ + { + "$ref": "#/definitions/log-drain/definitions/id" + }, + { + "$ref": "#/definitions/log-drain/definitions/url" + }, + { + "$ref": "#/definitions/log-drain/definitions/token" + } + ] + }, "identity": { "anyOf": [ { - "$ref": "#/definitions/oauth-authorization/definitions/id" + "$ref": "#/definitions/log-drain/definitions/url" } ] }, - "scope": { - "description": "The scope of access OAuth authorization allows", - "example": [ - "global" - ], + "token": { + "description": "token associated with the log drain", + "example": "d.01234567-89ab-cdef-0123-456789abcdef", "readOnly": true, "type": [ - "array" - ], - "items": { - "type": [ - "string" - ] - } + "string" + ] }, "updated_at": { - "description": "when OAuth authorization was updated", + "description": "when log drain was updated", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, "type": [ "string" ] + }, + "url": { + "description": "url associated with the log drain", + "example": "https://example.com/drain", + "readOnly": true, + "type": [ + "string" + ] } }, "links": [ { - "description": "Create a new OAuth authorization.", - "href": "/oauth/authorizations", + "description": "Create a new log drain.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/log-drains", "method": "POST", "rel": "create", "schema": { "properties": { - "client": { - "$ref": "#/definitions/oauth-client/definitions/identity" - }, - "description": { - "$ref": "#/definitions/oauth-authorization/definitions/description" - }, - "expires_in": { - "$ref": "#/definitions/oauth-token/definitions/expires_in" - }, - "scope": { - "$ref": "#/definitions/oauth-authorization/definitions/scope" + "url": { + "$ref": "#/definitions/log-drain/definitions/url" } }, "required": [ - "scope" + "url" ], "type": [ "object" ] }, "targetSchema": { - "$ref": "#/definitions/oauth-authorization" + "$ref": "#/definitions/log-drain" }, "title": "Create" }, { - "description": "Delete OAuth authorization.", - "href": "/oauth/authorizations/{(%23%2Fdefinitions%2Foauth-authorization%2Fdefinitions%2Fidentity)}", + "description": "Update an add-on owned log drain.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/log-drains/{(%23%2Fdefinitions%2Flog-drain%2Fdefinitions%2Fquery_identity)}", + "method": "PUT", + "rel": "update", + "schema": { + "properties": { + "url": { + "$ref": "#/definitions/log-drain/definitions/url" + } + }, + "required": [ + "url" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/log-drain" + }, + "title": "Update" + }, + { + "description": "Delete an existing log drain. Log drains added by add-ons can only be removed by removing the add-on.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/log-drains/{(%23%2Fdefinitions%2Flog-drain%2Fdefinitions%2Fquery_identity)}", "method": "DELETE", "rel": "destroy", "targetSchema": { - "$ref": "#/definitions/oauth-authorization" + "$ref": "#/definitions/log-drain" }, "title": "Delete" }, { - "description": "Info for an OAuth authorization.", - "href": "/oauth/authorizations/{(%23%2Fdefinitions%2Foauth-authorization%2Fdefinitions%2Fidentity)}", + "description": "Info for existing log drain.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/log-drains/{(%23%2Fdefinitions%2Flog-drain%2Fdefinitions%2Fquery_identity)}", "method": "GET", "rel": "self", "targetSchema": { - "$ref": "#/definitions/oauth-authorization" + "$ref": "#/definitions/log-drain" }, "title": "Info" }, { - "description": "List OAuth authorizations.", - "href": "/oauth/authorizations", + "description": "List existing log drains for an add-on.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/log-drains", "method": "GET", "rel": "instances", "targetSchema": { "items": { - "$ref": "#/definitions/oauth-authorization" + "$ref": "#/definitions/log-drain" }, "type": [ "array" ] }, - "title": "List" + "title": "List By Add-on" }, { - "description": "Regenerate OAuth tokens. This endpoint is only available to direct authorizations or privileged OAuth clients.", - "href": "/oauth/authorizations/{(%23%2Fdefinitions%2Foauth-authorization%2Fdefinitions%2Fidentity)}/actions/regenerate-tokens", - "method": "POST", - "rel": "update", + "description": "List existing log drains.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/log-drains", + "method": "GET", + "rel": "instances", "targetSchema": { - "$ref": "#/definitions/oauth-authorization" + "items": { + "$ref": "#/definitions/log-drain" + }, + "type": [ + "array" + ] }, - "title": "Regenerate" + "title": "List" } ], "properties": { - "access_token": { - "description": "access token for this authorization", - "properties": { - "expires_in": { - "$ref": "#/definitions/oauth-token/definitions/expires_in" - }, - "id": { - "$ref": "#/definitions/oauth-token/definitions/id" - }, - "token": { - "$ref": "#/definitions/oauth-token/definitions/token" - } - }, - "type": [ - "null", - "object" - ] + "addon": { + "$ref": "#/definitions/log-drain/definitions/addon" }, - "client": { - "description": "identifier of the client that obtained this authorization, if any", - "properties": { - "id": { - "$ref": "#/definitions/oauth-client/definitions/id" - }, - "name": { - "$ref": "#/definitions/oauth-client/definitions/name" - }, - "redirect_uri": { - "$ref": "#/definitions/oauth-client/definitions/redirect_uri" - } - }, - "type": [ - "null", - "object" - ] + "app": { + "$ref": "#/definitions/log-drain/definitions/app" }, "created_at": { - "$ref": "#/definitions/oauth-authorization/definitions/created_at" - }, - "grant": { - "description": "this authorization's grant", - "properties": { - "code": { - "$ref": "#/definitions/oauth-grant/definitions/code" - }, - "expires_in": { - "$ref": "#/definitions/oauth-grant/definitions/expires_in" - }, - "id": { - "$ref": "#/definitions/oauth-grant/definitions/id" - } - }, - "strictProperties": true, - "type": [ - "null", - "object" - ] + "$ref": "#/definitions/log-drain/definitions/created_at" }, "id": { - "$ref": "#/definitions/oauth-authorization/definitions/id" - }, - "refresh_token": { - "description": "refresh token for this authorization", - "properties": { - "expires_in": { - "$ref": "#/definitions/oauth-token/definitions/expires_in" - }, - "id": { - "$ref": "#/definitions/oauth-token/definitions/id" - }, - "token": { - "$ref": "#/definitions/oauth-token/definitions/token" - } - }, - "strictProperties": true, - "type": [ - "null", - "object" - ] + "$ref": "#/definitions/log-drain/definitions/id" }, - "scope": { - "$ref": "#/definitions/oauth-authorization/definitions/scope" + "token": { + "$ref": "#/definitions/log-drain/definitions/token" }, "updated_at": { - "$ref": "#/definitions/oauth-authorization/definitions/updated_at" + "$ref": "#/definitions/log-drain/definitions/updated_at" }, - "user": { - "description": "authenticated user associated with this authorization", - "properties": { - "id": { - "$ref": "#/definitions/account/definitions/id" - }, - "email": { - "$ref": "#/definitions/account/definitions/email" - }, - "full_name": { - "$ref": "#/definitions/account/definitions/name" - } - }, - "strictProperties": true, - "type": [ - "object" - ] + "url": { + "$ref": "#/definitions/log-drain/definitions/url" } } }, - "oauth-client": { - "description": "OAuth clients are applications that Heroku users can authorize to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth).", + "log-session": { + "description": "A log session is a reference to the http based log stream for an app.", "$schema": "http://json-schema.org/draft-04/hyper-schema", "stability": "production", "strictProperties": true, - "title": "Heroku Platform API - OAuth Client", + "title": "Heroku Platform API - Log Session", "type": [ "object" ], "definitions": { "created_at": { - "description": "when OAuth client was created", + "description": "when log connection was created", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, @@ -8814,8 +9195,24 @@ "string" ] }, + "dyno": { + "description": "dyno name to limit results to", + "example": "'web.1' (Cedar-generation) or 'web-1234abcde-123ab' (Fir-generation)", + "readOnly": false, + "type": [ + "string" + ] + }, + "type": { + "description": "process type to limit results to (for Fir-generation apps only)", + "example": "web", + "readOnly": false, + "type": [ + "string" + ] + }, "id": { - "description": "unique identifier of this OAuth client", + "description": "unique identifier of this log session", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -8826,45 +9223,44 @@ "identity": { "anyOf": [ { - "$ref": "#/definitions/oauth-client/definitions/id" + "$ref": "#/definitions/log-session/definitions/id" } ] }, - "ignores_delinquent": { - "description": "whether the client is still operable given a delinquent account", - "example": false, - "readOnly": true, + "lines": { + "description": "number of log lines to stream at a time (for Cedar-generation apps only)", + "example": 10, + "readOnly": false, "type": [ - "boolean", - "null" + "integer" ] }, - "name": { - "description": "OAuth client name", - "example": "example", + "logplex_url": { + "description": "URL for log streaming session", + "example": "https://logplex.heroku.com/sessions/01234567-89ab-cdef-0123-456789abcdef?srv=1325419200", "readOnly": true, "type": [ "string" ] }, - "redirect_uri": { - "description": "endpoint for redirection after authorization with OAuth client", - "example": "https://example.com/auth/heroku/callback", - "readOnly": true, + "source": { + "description": "log source to limit results to", + "example": "app", + "readOnly": false, "type": [ "string" ] }, - "secret": { - "description": "secret used to obtain OAuth authorizations under this client", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "readOnly": true, + "tail": { + "description": "whether to stream ongoing logs", + "example": true, + "readOnly": false, "type": [ - "string" + "boolean" ] }, "updated_at": { - "description": "when OAuth client was updated", + "description": "when log session was updated", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, @@ -8875,76 +9271,26 @@ }, "links": [ { - "description": "Create a new OAuth client.", - "href": "/oauth/clients", + "description": "Create a new log session.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/log-sessions", "method": "POST", "rel": "create", "schema": { "properties": { - "name": { - "$ref": "#/definitions/oauth-client/definitions/name" + "dyno": { + "$ref": "#/definitions/log-session/definitions/dyno" }, - "redirect_uri": { - "$ref": "#/definitions/oauth-client/definitions/redirect_uri" - } - }, - "required": [ - "name", - "redirect_uri" - ], - "type": [ - "object" - ] - }, - "targetSchema": { - "$ref": "#/definitions/oauth-client" - }, - "title": "Create" - }, - { - "description": "Delete OAuth client.", - "href": "/oauth/clients/{(%23%2Fdefinitions%2Foauth-client%2Fdefinitions%2Fidentity)}", - "method": "DELETE", - "rel": "destroy", - "targetSchema": { - "$ref": "#/definitions/oauth-client" - }, - "title": "Delete" - }, - { - "description": "Info for an OAuth client. The output for unauthenticated requests excludes the `secret` parameter.", - "href": "/oauth/clients/{(%23%2Fdefinitions%2Foauth-client%2Fdefinitions%2Fidentity)}", - "method": "GET", - "rel": "self", - "title": "Info" - }, - { - "description": "List OAuth clients", - "href": "/oauth/clients", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/oauth-client" - }, - "type": [ - "array" - ] - }, - "title": "List" - }, - { - "description": "Update OAuth client", - "href": "/oauth/clients/{(%23%2Fdefinitions%2Foauth-client%2Fdefinitions%2Fidentity)}", - "method": "PATCH", - "rel": "update", - "schema": { - "properties": { - "name": { - "$ref": "#/definitions/oauth-client/definitions/name" + "type": { + "$ref": "#/definitions/log-session/definitions/type" }, - "redirect_uri": { - "$ref": "#/definitions/oauth-client/definitions/redirect_uri" + "lines": { + "$ref": "#/definitions/log-session/definitions/lines" + }, + "source": { + "$ref": "#/definitions/log-session/definitions/source" + }, + "tail": { + "$ref": "#/definitions/log-session/definitions/tail" } }, "type": [ @@ -8952,131 +9298,55 @@ ] }, "targetSchema": { - "$ref": "#/definitions/oauth-client" - }, - "title": "Update" - }, - { - "description": "Rotate credentials for an OAuth client", - "href": "/oauth/clients/{(%23%2Fdefinitions%2Foauth-client%2Fdefinitions%2Fidentity)}/actions/rotate-credentials", - "method": "POST", - "rel": "update", - "targetSchema": { - "$ref": "#/definitions/oauth-client" + "$ref": "#/definitions/log-session" }, - "title": "Rotate Credentials" + "title": "Create" } ], "properties": { "created_at": { - "$ref": "#/definitions/oauth-client/definitions/created_at" + "$ref": "#/definitions/log-session/definitions/created_at" }, "id": { - "$ref": "#/definitions/oauth-client/definitions/id" - }, - "ignores_delinquent": { - "$ref": "#/definitions/oauth-client/definitions/ignores_delinquent" - }, - "name": { - "$ref": "#/definitions/oauth-client/definitions/name" - }, - "redirect_uri": { - "$ref": "#/definitions/oauth-client/definitions/redirect_uri" + "$ref": "#/definitions/log-session/definitions/id" }, - "secret": { - "$ref": "#/definitions/oauth-client/definitions/secret" + "logplex_url": { + "$ref": "#/definitions/log-session/definitions/logplex_url" }, "updated_at": { - "$ref": "#/definitions/oauth-client/definitions/updated_at" + "$ref": "#/definitions/log-session/definitions/updated_at" } } }, - "oauth-grant": { - "description": "OAuth grants are used to obtain authorizations on behalf of a user. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth)", + "oauth-authorization": { + "description": "OAuth authorizations represent clients that a Heroku user has authorized to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth)", "$schema": "http://json-schema.org/draft-04/hyper-schema", "stability": "production", "strictProperties": true, - "title": "Heroku Platform API - OAuth Grant", + "title": "Heroku Platform API - OAuth Authorization", "type": [ "object" ], "definitions": { - "code": { - "description": "grant code received from OAuth web application authorization", - "example": "01234567-89ab-cdef-0123-456789abcdef", + "created_at": { + "description": "when OAuth authorization was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", "readOnly": true, "type": [ "string" ] }, - "expires_in": { - "description": "seconds until OAuth grant expires", - "example": 2592000, - "readOnly": true, - "type": [ - "integer" - ] - }, - "id": { - "description": "unique identifier of OAuth grant", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", - "readOnly": true, - "type": [ - "string" - ] - }, - "identity": { - "anyOf": [ - { - "$ref": "#/definitions/oauth-grant/definitions/id" - } - ] - }, - "type": { - "description": "type of grant requested, one of `authorization_code` or `refresh_token`", - "example": "authorization_code", - "readOnly": false, - "type": [ - "string" - ] - } - }, - "links": [ - ], - "properties": { - } - }, - "oauth-token": { - "description": "OAuth tokens provide access for authorized clients to act on behalf of a Heroku user to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth)", - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", - "strictProperties": true, - "title": "Heroku Platform API - OAuth Token", - "type": [ - "object" - ], - "definitions": { - "created_at": { - "description": "when OAuth token was created", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "description": { + "description": "human-friendly description of this OAuth authorization", + "example": "sample authorization", "readOnly": true, "type": [ "string" ] }, - "expires_in": { - "description": "seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime", - "example": 2592000, - "readOnly": true, - "type": [ - "null", - "integer" - ] - }, "id": { - "description": "unique identifier of OAuth token", + "description": "unique identifier of OAuth authorization", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -9087,20 +9357,27 @@ "identity": { "anyOf": [ { - "$ref": "#/definitions/oauth-token/definitions/id" + "$ref": "#/definitions/oauth-authorization/definitions/id" } ] }, - "token": { - "description": "contents of the token to be used for authorization", - "example": "HRKU-01234567-89ab-cdef-0123-456789abcdef", + "scope": { + "description": "The scope of access OAuth authorization allows", + "example": [ + "global" + ], "readOnly": true, "type": [ - "string" - ] + "array" + ], + "items": { + "type": [ + "string" + ] + } }, "updated_at": { - "description": "when OAuth token was updated", + "description": "when OAuth authorization was updated", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, @@ -9111,74 +9388,123 @@ }, "links": [ { - "description": "Create a new OAuth token.", - "href": "/oauth/tokens", + "description": "Create a new OAuth authorization.", + "href": "/oauth/authorizations", "method": "POST", "rel": "create", "schema": { "properties": { "client": { - "type": [ - "object" - ], - "properties": { - "secret": { - "$ref": "#/definitions/oauth-client/definitions/secret" - } - } + "$ref": "#/definitions/oauth-client/definitions/identity" }, - "grant": { - "type": [ - "object" - ], - "properties": { - "code": { - "$ref": "#/definitions/oauth-grant/definitions/code" - }, - "type": { - "$ref": "#/definitions/oauth-grant/definitions/type" - } - } + "description": { + "$ref": "#/definitions/oauth-authorization/definitions/description" }, - "refresh_token": { + "expires_in": { + "$ref": "#/definitions/oauth-token/definitions/expires_in" + }, + "scope": { + "$ref": "#/definitions/oauth-authorization/definitions/scope" + } + }, + "required": [ + "scope" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/oauth-authorization" + }, + "title": "Create" + }, + { + "description": "Delete OAuth authorization.", + "href": "/oauth/authorizations/{(%23%2Fdefinitions%2Foauth-authorization%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/oauth-authorization" + }, + "title": "Delete" + }, + { + "description": "Info for an OAuth authorization.", + "href": "/oauth/authorizations/{(%23%2Fdefinitions%2Foauth-authorization%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/oauth-authorization" + }, + "title": "Info" + }, + { + "description": "Update an existing OAuth authorization.", + "href": "/oauth/authorizations/{(%23%2Fdefinitions%2Foauth-authorization%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "targetSchema": { + "$ref": "#/definitions/oauth-authorization" + }, + "schema": { + "properties": { + "description": { + "$ref": "#/definitions/oauth-authorization/definitions/description" + }, + "client": { "type": [ "object" ], + "description": "identifier of the client that obtained this authorization", "properties": { - "token": { - "$ref": "#/definitions/oauth-token/definitions/token" + "id": { + "$ref": "#/definitions/oauth-client/definitions/id" + }, + "secret": { + "$ref": "#/definitions/oauth-client/definitions/secret" } } } }, "required": [ - "grant", - "client", - "refresh_token" + "client" ], "type": [ "object" ] }, + "title": "Update" + }, + { + "description": "List OAuth authorizations.", + "href": "/oauth/authorizations", + "method": "GET", + "rel": "instances", "targetSchema": { - "$ref": "#/definitions/oauth-token" + "items": { + "$ref": "#/definitions/oauth-authorization" + }, + "type": [ + "array" + ] }, - "title": "Create" + "title": "List" }, { - "description": "Revoke OAuth access token.", - "href": "/oauth/tokens/{(%23%2Fdefinitions%2Foauth-token%2Fdefinitions%2Fidentity)}", - "method": "DELETE", - "rel": "destroy", + "description": "Regenerate OAuth tokens. This endpoint is only available to direct authorizations or privileged OAuth clients.", + "href": "/oauth/authorizations/{(%23%2Fdefinitions%2Foauth-authorization%2Fdefinitions%2Fidentity)}/actions/regenerate-tokens", + "method": "POST", + "rel": "update", "targetSchema": { - "$ref": "#/definitions/oauth-token" + "$ref": "#/definitions/oauth-authorization" }, - "title": "Delete" + "title": "Regenerate" } ], "properties": { "access_token": { - "description": "current access token", + "description": "access token for this authorization", "properties": { "expires_in": { "$ref": "#/definitions/oauth-token/definitions/expires_in" @@ -9188,58 +9514,61 @@ }, "token": { "$ref": "#/definitions/oauth-token/definitions/token" + }, + "version": { + "$ref": "#/definitions/oauth-token/definitions/version" } }, - "strictProperties": true, - "type": [ - "object" - ] - }, - "authorization": { - "description": "authorization for this set of tokens", - "properties": { - "id": { - "$ref": "#/definitions/oauth-authorization/definitions/id" - } - }, - "strictProperties": true, "type": [ + "null", "object" ] }, "client": { - "description": "OAuth client secret used to obtain token", + "description": "identifier of the client that obtained this authorization, if any", "properties": { - "secret": { - "$ref": "#/definitions/oauth-client/definitions/secret" + "id": { + "$ref": "#/definitions/oauth-client/definitions/id" + }, + "name": { + "$ref": "#/definitions/oauth-client/definitions/name" + }, + "redirect_uri": { + "$ref": "#/definitions/oauth-client/definitions/redirect_uri" } }, - "strictProperties": true, "type": [ "null", "object" ] }, "created_at": { - "$ref": "#/definitions/oauth-token/definitions/created_at" + "$ref": "#/definitions/oauth-authorization/definitions/created_at" + }, + "description": { + "$ref": "#/definitions/oauth-authorization/definitions/description" }, "grant": { - "description": "grant used on the underlying authorization", + "description": "this authorization's grant", "properties": { "code": { "$ref": "#/definitions/oauth-grant/definitions/code" }, - "type": { - "$ref": "#/definitions/oauth-grant/definitions/type" + "expires_in": { + "$ref": "#/definitions/oauth-grant/definitions/expires_in" + }, + "id": { + "$ref": "#/definitions/oauth-grant/definitions/id" } }, "strictProperties": true, "type": [ + "null", "object" ] }, "id": { - "$ref": "#/definitions/oauth-token/definitions/id" + "$ref": "#/definitions/oauth-authorization/definitions/id" }, "refresh_token": { "description": "refresh token for this authorization", @@ -9256,29 +9585,41 @@ }, "strictProperties": true, "type": [ + "null", "object" ] }, + "scope": { + "$ref": "#/definitions/oauth-authorization/definitions/scope" + }, "session": { - "description": "OAuth session using this token", + "description": "this authorization's session", "properties": { "id": { "$ref": "#/definitions/oauth-token/definitions/id" } }, "strictProperties": true, + "readOnly": true, "type": [ + "null", "object" ] }, "updated_at": { - "$ref": "#/definitions/oauth-token/definitions/updated_at" + "$ref": "#/definitions/oauth-authorization/definitions/updated_at" }, "user": { - "description": "Reference to the user associated with this token", + "description": "authenticated user associated with this authorization", "properties": { "id": { "$ref": "#/definitions/account/definitions/id" + }, + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "full_name": { + "$ref": "#/definitions/account/definitions/name" } }, "strictProperties": true, @@ -9288,18 +9629,18 @@ } } }, - "password-reset": { - "description": "A password reset represents a in-process password reset attempt.", + "oauth-client": { + "description": "OAuth clients are applications that Heroku users can authorize to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth).", "$schema": "http://json-schema.org/draft-04/hyper-schema", "stability": "production", "strictProperties": true, - "title": "Heroku Platform API - PasswordReset", + "title": "Heroku Platform API - OAuth Client", "type": [ "object" ], "definitions": { "created_at": { - "description": "when password reset was created", + "description": "when OAuth client was created", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, @@ -9307,25 +9648,59 @@ "string" ] }, + "id": { + "description": "unique identifier of this OAuth client", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, "identity": { "anyOf": [ { - "$ref": "#/definitions/account/definitions/email" + "$ref": "#/definitions/oauth-client/definitions/id" } ] }, - "password_confirmation": { - "description": "confirmation of the new password", - "example": "newpassword", + "ignores_delinquent": { + "description": "whether the client is still operable given a delinquent account", + "example": false, + "readOnly": true, + "type": [ + "boolean", + "null" + ] + }, + "name": { + "description": "OAuth client name", + "example": "example", "readOnly": true, "type": [ "string" ] }, - "reset_password_token": { - "description": "unique identifier of a password reset attempt", + "redirect_uri": { + "description": "endpoint for redirection after authorization with OAuth client", + "example": "https://example.com/auth/heroku/callback", + "readOnly": true, + "type": [ + "string" + ] + }, + "secret": { + "description": "secret used to obtain OAuth authorizations under this client", "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when OAuth client was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", "readOnly": true, "type": [ "string" @@ -9334,321 +9709,206 @@ }, "links": [ { - "description": "Reset account's password. This will send a reset password link to the user's email address.", - "href": "/password-resets", + "description": "Create a new OAuth client.", + "href": "/oauth/clients", "method": "POST", - "rel": "self", + "rel": "create", "schema": { "properties": { - "email": { - "$ref": "#/definitions/account/definitions/email" + "name": { + "$ref": "#/definitions/oauth-client/definitions/name" + }, + "redirect_uri": { + "$ref": "#/definitions/oauth-client/definitions/redirect_uri" } }, "required": [ - "email" + "name", + "redirect_uri" ], "type": [ "object" ] }, "targetSchema": { - "$ref": "#/definitions/password-reset" + "$ref": "#/definitions/oauth-client" }, - "title": "Reset Password" + "title": "Create" }, { - "description": "Complete password reset.", - "href": "/password-resets/{(%23%2Fdefinitions%2Fpassword-reset%2Fdefinitions%2Freset_password_token)}/actions/finalize", - "method": "POST", + "description": "Delete OAuth client.", + "href": "/oauth/clients/{(%23%2Fdefinitions%2Foauth-client%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/oauth-client" + }, + "title": "Delete" + }, + { + "description": "Info for an OAuth client. The output for unauthenticated requests excludes the `secret` parameter.", + "href": "/oauth/clients/{(%23%2Fdefinitions%2Foauth-client%2Fdefinitions%2Fidentity)}", + "method": "GET", "rel": "self", + "title": "Info" + }, + { + "description": "List OAuth clients", + "href": "/oauth/clients", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/oauth-client" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Update OAuth client", + "href": "/oauth/clients/{(%23%2Fdefinitions%2Foauth-client%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", "schema": { "properties": { - "password": { - "$ref": "#/definitions/account/definitions/password" + "name": { + "$ref": "#/definitions/oauth-client/definitions/name" }, - "password_confirmation": { - "$ref": "#/definitions/password-reset/definitions/password_confirmation" + "redirect_uri": { + "$ref": "#/definitions/oauth-client/definitions/redirect_uri" } }, - "required": [ - "password", - "password_confirmation" - ], "type": [ "object" ] }, "targetSchema": { - "$ref": "#/definitions/password-reset" + "$ref": "#/definitions/oauth-client" }, - "title": "Complete Reset Password" - } - ], - "properties": { - "created_at": { - "$ref": "#/definitions/password-reset/definitions/created_at" + "title": "Update" }, - "user": { - "properties": { - "email": { - "$ref": "#/definitions/account/definitions/email" - }, - "id": { - "$ref": "#/definitions/account/definitions/id" - } + { + "description": "Rotate credentials for an OAuth client", + "href": "/oauth/clients/{(%23%2Fdefinitions%2Foauth-client%2Fdefinitions%2Fidentity)}/actions/rotate-credentials", + "method": "POST", + "rel": "update", + "targetSchema": { + "$ref": "#/definitions/oauth-client" }, - "strictProperties": true, - "type": [ - "object" - ] + "title": "Rotate Credentials" } - } - }, - "peering-info": { - "description": "[Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space.", - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "prototype", - "strictProperties": true, - "title": "Heroku Platform API - Peering Info", - "type": [ - "object" ], "properties": { - "aws_account_id": { - "$ref": "#/definitions/peering/definitions/aws_account_id" + "created_at": { + "$ref": "#/definitions/oauth-client/definitions/created_at" }, - "aws_region": { - "$ref": "#/definitions/region/definitions/provider/properties/region" + "id": { + "$ref": "#/definitions/oauth-client/definitions/id" }, - "vpc_id": { - "$ref": "#/definitions/peering/definitions/vpc_id" + "ignores_delinquent": { + "$ref": "#/definitions/oauth-client/definitions/ignores_delinquent" }, - "vpc_cidr": { - "description": "The CIDR range of the Private Space VPC", - "$ref": "#/definitions/peering/definitions/cidr" + "name": { + "$ref": "#/definitions/oauth-client/definitions/name" }, - "dyno_cidr_blocks": { - "description": "The CIDR ranges that should be routed to the Private Space VPC.", - "type": [ - "array" - ], - "items": { - "$ref": "#/definitions/peering/definitions/cidr" - } + "redirect_uri": { + "$ref": "#/definitions/oauth-client/definitions/redirect_uri" }, - "unavailable_cidr_blocks": { - "description": "The CIDR ranges that you must not conflict with.", - "type": [ - "array" - ], - "items": { - "$ref": "#/definitions/peering/definitions/cidr" - } + "secret": { + "$ref": "#/definitions/oauth-client/definitions/secret" }, - "space_cidr_blocks": { - "description": "The CIDR ranges that should be routed to the Private Space VPC.", - "type": [ - "array" - ], - "items": { - "$ref": "#/definitions/peering/definitions/cidr" - } - } - }, - "links": [ - { - "description": "Provides the necessary information to establish an AWS VPC Peering with your private space.", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/peering-info", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/peering-info" - }, - "title": "Info" + "updated_at": { + "$ref": "#/definitions/oauth-client/definitions/updated_at" } - ] + } }, - "peering": { - "description": "[Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC.", + "oauth-grant": { + "description": "OAuth grants are used to obtain authorizations on behalf of a user. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth)", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "prototype", + "stability": "production", "strictProperties": true, - "title": "Heroku Platform API - Peering", + "title": "Heroku Platform API - OAuth Grant", "type": [ "object" ], "definitions": { - "aws_account_id": { - "description": "The AWS account ID of your Private Space.", - "example": "123456789012", + "code": { + "description": "grant code received from OAuth web application authorization", + "example": "01234567-89ab-cdef-0123-456789abcdef", "readOnly": true, "type": [ "string" ] }, - "aws_region": { - "description": "The AWS region of the peer connection.", - "example": "us-east-1", + "expires_in": { + "description": "seconds until OAuth grant expires", + "example": 2592000, "readOnly": true, "type": [ - "string" + "integer" ] }, - "vpc_id": { - "description": "The AWS VPC ID of the peer.", - "example": "vpc-1234567890", - "readOnly": true, - "type": [ - "string" - ] - }, - "type": { - "description": "The type of peering connection.", - "example": "heroku-managed", - "type": [ - "string" - ], - "enum": [ - "heroku-managed", - "customer-managed", - "unknown" - ] - }, - "status": { - "description": "The status of the peering connection.", - "example": "pending-acceptance", - "enum": [ - "initiating-request", - "pending-acceptance", - "provisioning", - "active", - "failed", - "expired", - "rejected", - "deleted" - ], - "type": [ - "string" - ], - "readOnly": true - }, - "pcx_id": { - "description": "The AWS VPC Peering Connection ID of the peering.", - "example": "pcx-123456789012", + "id": { + "description": "unique identifier of OAuth grant", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", "readOnly": true, "type": [ "string" ] }, - "cidr": { - "description": "An IP address and the number of significant bits that make up the routing or networking portion.", - "example": "10.0.0.0/16", - "type": [ - "string" + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/oauth-grant/definitions/id" + } ] }, - "expires": { - "description": "When a peering connection will expire.", - "example": "2020-01-01T12:00:00Z", - "format": "date-time", - "readOnly": true, + "type": { + "description": "type of grant requested, one of `authorization_code` or `refresh_token`", + "example": "authorization_code", + "readOnly": false, "type": [ "string" ] } }, - "properties": { - "type": { - "$ref": "#/definitions/peering/definitions/type" - }, - "pcx_id": { - "$ref": "#/definitions/peering/definitions/pcx_id" - }, - "cidr_blocks": { - "description": "The CIDR blocks of the peer.", - "type": [ - "array" - ], - "items": { - "$ref": "#/definitions/peering/definitions/cidr" - } - }, - "status": { - "$ref": "#/definitions/peering/definitions/status" - }, - "aws_vpc_id": { - "$ref": "#/definitions/peering/definitions/vpc_id" - }, - "aws_region": { - "$ref": "#/definitions/peering/definitions/aws_region" - }, - "aws_account_id": { - "$ref": "#/definitions/peering/definitions/aws_account_id" - }, - "expires": { - "$ref": "#/definitions/peering/definitions/expires" - } - }, - "links": [ - { - "description": "List peering connections of a private space.", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/peerings", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/peering" - }, - "type": [ - "array" - ] - }, - "title": "List" - }, - { - "description": "Accept a pending peering connection with a private space.", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/peerings/{(%23%2Fdefinitions%2Fpeering%2Fdefinitions%2Fpcx_id)}/actions/accept", - "method": "POST", - "rel": "empty", - "title": "Accept", - "targetSchema": { - "$ref": "#/definitions/peering" - } - }, - { - "description": "Destroy an active peering connection with a private space.", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/peerings/{(%23%2Fdefinitions%2Fpeering%2Fdefinitions%2Fpcx_id)}", - "rel": "empty", - "method": "DELETE", - "title": "Destroy", - "targetSchema": { - "$ref": "#/definitions/peering" - } - }, - { - "description": "Fetch information for existing peering connection", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/peerings/{(%23%2Fdefinitions%2Fpeering%2Fdefinitions%2Fpcx_id)}", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/peering" - }, - "title": "Info" - } - ] + "links": [], + "properties": {} }, - "permission-entity": { + "oauth-token": { + "description": "OAuth tokens provide access for authorized clients to act on behalf of a Heroku user to automate, customize or extend their usage of the platform. For more information please refer to the [Heroku OAuth documentation](https://devcenter.heroku.com/articles/oauth)", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "description": "An owned entity including users' permissions.", - "stability": "development", + "stability": "production", "strictProperties": true, - "title": "Heroku Platform API - Permission Entity", + "title": "Heroku Platform API - OAuth Token", "type": [ "object" ], "definitions": { + "created_at": { + "description": "when OAuth token was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "expires_in": { + "description": "seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime", + "example": 2592000, + "readOnly": true, + "type": [ + "null", + "integer" + ] + }, "id": { - "description": "ID of the entity.", + "description": "unique identifier of OAuth token", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -9656,499 +9916,580 @@ "string" ] }, - "type": { - "description": "The type of object the entity is referring to.", - "example": "app", + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/oauth-token/definitions/id" + } + ] + }, + "token": { + "description": "contents of the token to be used for authorization", + "example": "01234567-89ab-cdef-0123-456789abcdef", "readOnly": true, "type": [ "string" - ], - "enum": [ - "app", - "space" ] }, - "name": { - "description": "Name of the entity.", - "example": "polar-lake-12345", + "updated_at": { + "description": "when OAuth token was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", "readOnly": true, "type": [ "string" ] }, - "permissions": { - "description": "A list of permissions the user has on the entity.", - "example": "app", + "version": { + "description": "the version of the token", + "example": "1", "readOnly": true, "type": [ - "array" + "integer" ] } }, "links": [ { - "description": "List permission entities for a team.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/permissions", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/permission-entity" - }, - "type": [ - "array" - ] - }, - "title": "List" - } - ], - "properties": { - "id": { - "$ref": "#/definitions/permission-entity/definitions/id" - }, - "name": { - "$ref": "#/definitions/permission-entity/definitions/name" - }, - "team_id": { - "$ref": "#/definitions/team/definitions/id" - }, - "type": { - "$ref": "#/definitions/permission-entity/definitions/type" - }, - "users": { - "description": "Users that have access to the entity.", - "items": { - "type": [ - "object" - ], + "description": "Create a new OAuth token.", + "href": "/oauth/tokens", + "method": "POST", + "rel": "create", + "schema": { "properties": { - "email": { - "$ref": "#/definitions/account/definitions/email" - }, - "id": { - "$ref": "#/definitions/account/definitions/id" - }, - "permissions": { - "description": "enterprise account permissions", + "client": { "type": [ - "array" + "object" ], - "items": { - "type": [ - "string" - ] + "properties": { + "secret": { + "$ref": "#/definitions/oauth-client/definitions/secret" + } } - } - } - }, - "type": [ - "array" - ] - } - } - }, - "pipeline-build": { - "description": "Information about latest builds of apps in a pipeline.", - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", - "strictProperties": true, - "title": "Heroku Platform API - Pipeline Build", - "type": [ - "object" - ], - "definitions": { - }, - "links": [ - { - "description": "List latest builds for each app in a pipeline", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/latest-builds", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/build" + }, + "grant": { + "type": [ + "object" + ], + "properties": { + "code": { + "$ref": "#/definitions/oauth-grant/definitions/code" + }, + "type": { + "$ref": "#/definitions/oauth-grant/definitions/type" + } + } + }, + "refresh_token": { + "type": [ + "object" + ], + "properties": { + "token": { + "$ref": "#/definitions/oauth-token/definitions/token" + } + } + } }, + "required": [ + "grant", + "client", + "refresh_token" + ], "type": [ - "array" + "object" ] }, - "title": "List" + "targetSchema": { + "$ref": "#/definitions/oauth-token" + }, + "title": "Create" + }, + { + "description": "Revoke OAuth access token.", + "href": "/oauth/tokens/{(%23%2Fdefinitions%2Foauth-token%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/oauth-token" + }, + "title": "Delete" } - ] - }, - "pipeline-config-var": { - "description": "Pipeline Config Vars allow you to manage the configuration information provided to a pipeline.", - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", - "strictProperties": true, - "title": "Heroku Platform API - Pipeline Config Vars", - "type": [ - "object" ], - "definitions": { - "config_vars": { - "additionalProperties": false, - "description": "hash of config vars", - "example": { - "FOO": "bar", - "BAZ": "qux" + "properties": { + "access_token": { + "description": "current access token", + "properties": { + "expires_in": { + "$ref": "#/definitions/oauth-token/definitions/expires_in" + }, + "id": { + "$ref": "#/definitions/oauth-token/definitions/id" + }, + "token": { + "$ref": "#/definitions/oauth-token/definitions/token" + } }, - "patternProperties": { - "^[\\w\\.\\:\\[\\]]+$": { - "type": [ - "string", - "null" - ] + "strictProperties": true, + "type": [ + "object" + ] + }, + "authorization": { + "description": "authorization for this set of tokens", + "properties": { + "id": { + "$ref": "#/definitions/oauth-authorization/definitions/id" } }, + "strictProperties": true, "type": [ "object" ] - } - }, - "links": [ - { - "description": "Get config-vars for a pipeline stage.", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/stage/{(%23%2Fdefinitions%2Fpipeline-coupling%2Fdefinitions%2Fstage)}/config-vars", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/pipeline-config-var/definitions/config_vars" + }, + "client": { + "description": "OAuth client secret used to obtain token", + "properties": { + "secret": { + "$ref": "#/definitions/oauth-client/definitions/secret" + } }, - "title": "Info for App" + "strictProperties": true, + "type": [ + "null", + "object" + ] }, - { - "description": "Update config-vars for a pipeline stage. You can update existing config-vars by setting them again, and remove by setting it to `null`.", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/stage/{(%23%2Fdefinitions%2Fpipeline-coupling%2Fdefinitions%2Fstage)}/config-vars", - "method": "PATCH", - "rel": "update", - "schema": { - "additionalProperties": false, - "description": "hash of config changes – update values or delete by seting it to `null`", - "example": { - "FOO": "bar", - "BAZ": "qux" + "created_at": { + "$ref": "#/definitions/oauth-token/definitions/created_at" + }, + "grant": { + "description": "grant used on the underlying authorization", + "properties": { + "code": { + "$ref": "#/definitions/oauth-grant/definitions/code" }, - "patternProperties": { - "^[\\w\\.\\:\\[\\]]+$": { - "type": [ - "string", - "null" - ] - } + "type": { + "$ref": "#/definitions/oauth-grant/definitions/type" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "id": { + "$ref": "#/definitions/oauth-token/definitions/id" + }, + "refresh_token": { + "description": "refresh token for this authorization", + "properties": { + "expires_in": { + "$ref": "#/definitions/oauth-token/definitions/expires_in" }, - "type": [ - "object" - ] + "id": { + "$ref": "#/definitions/oauth-token/definitions/id" + }, + "token": { + "$ref": "#/definitions/oauth-token/definitions/token" + }, + "version": { + "$ref": "#/definitions/oauth-token/definitions/version" + } }, - "targetSchema": { - "$ref": "#/definitions/pipeline-config-var/definitions/config_vars" + "strictProperties": true, + "type": [ + "object" + ] + }, + "session": { + "description": "OAuth session using this token", + "properties": { + "id": { + "$ref": "#/definitions/oauth-token/definitions/id" + } }, - "title": "Update" - } - ], - "example": { - "FOO": "bar", - "BAZ": "qux" - }, - "patternProperties": { - "^\\w+$": { + "strictProperties": true, "type": [ - "string" + "object" + ] + }, + "updated_at": { + "$ref": "#/definitions/oauth-token/definitions/updated_at" + }, + "user": { + "description": "Reference to the user associated with this token", + "properties": { + "id": { + "$ref": "#/definitions/account/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" ] } } }, - "pipeline-coupling": { - "description": "Information about an app's coupling to a pipeline", + "oci-image": { + "description": "An OCI (Open Container Initiative) image is a standardized format for packaging and distributing containerized applications, ready to run on the platform.", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", - "title": "Heroku Platform API - Pipeline Coupling", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - OCI Images", "type": [ "object" ], "definitions": { - "created_at": { - "description": "when pipeline coupling was created", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "id": { + "description": "unique identifier of the OCI image", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", "readOnly": true, "type": [ "string" ] }, - "id": { - "description": "unique identifier of pipeline coupling", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", - "readOnly": true, + "digest": { + "description": "unique identifier representing the content of the OCI image", + "example": "sha256:dc14ae5fbc1e7230e0a782bf216fb46500e210631703bcc6bab8acf2c6a23f42", + "readOnly": false, "type": [ "string" ] }, - "identity": { - "anyOf": [ - { - "$ref": "#/definitions/pipeline-coupling/definitions/id" + "architecture": { + "description": "build architecture for OCI image", + "example": "arm64", + "readOnly": false, + "type": [ + "string", + "null" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/oci-image/definitions/id" + }, + { + "$ref": "#/definitions/oci-image/definitions/digest" } ] }, - "stage": { - "description": "target pipeline stage", - "example": "production", - "enum": [ - "test", - "review", - "development", - "staging", - "production" - ], + "base_image_name": { + "description": "name of the image used for the base layers of the OCI image", + "example": "heroku/heroku:22-cnb", + "readOnly": false, "type": [ "string" ] }, - "updated_at": { - "description": "when pipeline coupling was updated", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", - "readOnly": true, + "base_top_layer": { + "description": "the digest of the top most layer of the base image.", + "example": "sha256:ea36ae5fbc1e7230e0a782bf216fb46500e210382703baa6bab8acf2c6a23f78", + "readOnly": false, "type": [ "string" ] - } - }, - "links": [ - { - "description": "List couplings for a pipeline", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/pipeline-couplings", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/pipeline-coupling" + }, + "commit": { + "description": "identification of the code in your version control system (eg: SHA of the git HEAD)", + "example": "60883d9e8947a57e04dc9124f25df004866a2051", + "readOnly": false, + "type": [ + "string" + ] + }, + "commit_description": { + "description": "an optional description of the provided commit", + "example": "fixed a bug with API documentation", + "readOnly": false, + "type": [ + "string" + ] + }, + "image_repo": { + "description": "name of the image registry repository used for storage", + "example": "d7ba1ace-b396-4691-968c-37ae53153426/builds", + "readOnly": false, + "type": [ + "string" + ] + }, + "process_type": { + "description": "process type information such as names and commands", + "readOnly": false, + "properties": { + "name": { + "description": "name of the process type", + "example": "web", + "type": [ + "string" + ] }, - "type": [ - "array" - ] + "display_cmd": { + "description": "the detailed command used for display purposes", + "example": "bundle exec puma -p $PORT", + "type": [ + "string" + ] + }, + "command": { + "description": "the command that will be executed", + "example": "/cnb/process/web", + "type": [ + "string" + ] + }, + "working_dir": { + "description": "working directory", + "example": "/worspace/webapp", + "type": [ + "string" + ] + }, + "default": { + "description": "true if it is the default process type", + "example": true, + "type": [ + "boolean", + "null" + ] + } }, - "title": "List By Pipeline" + "example": { + "name": "web", + "display_cmd": "bundle exec puma -p $PORT", + "command": "/cnb/process/web", + "working_dir": "/workspace/webapp", + "default": true + }, + "type": [ + "object" + ] }, - { - "description": "List pipeline couplings for the current user.", - "href": "/users/~/pipeline-couplings", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/pipeline-coupling" + "process_types": { + "description": "process types of the OCI image", + "patternProperties": { + "^[-\\w]{1,128}$": { + "$ref": "#/definitions/oci-image/definitions/process_type" + } + }, + "example": { + "web": { + "name": "web", + "display_cmd": "bundle exec puma -p $PORT", + "command": "/cnb/process/web", + "working_dir": "/workspace/webapp", + "default": true + } + }, + "type": [ + "object" + ] + }, + "buildpack": { + "description": "set of executables that inspects app source code and creates a plan to build and run your image", + "readOnly": false, + "properties": { + "id": { + "description": "identifier of the buildpack", + "example": "heroku/ruby", + "type": [ + "string" + ] }, - "type": [ - "array" - ] + "version": { + "description": "version of the buildpack", + "example": "2.0.0", + "type": [ + "string" + ] + }, + "homepage": { + "description": "homepage of the buildpack", + "example": "https://github.com/heroku/buildpacks-ruby", + "type": [ + "string" + ] + } }, - "title": "List By Current User" + "example": { + "id": "heroku/ruby", + "version": "2.0.0", + "homepage": "https://github.com/heroku/buildpacks-ruby" + }, + "type": [ + "object" + ] }, - { - "description": "List pipeline couplings.", - "href": "/pipeline-couplings", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/pipeline-coupling" + "buildpacks": { + "description": "buildpacks of the OCI image", + "items": { + "$ref": "#/definitions/oci-image/definitions/buildpack" + }, + "type": [ + "array" + ] + }, + "stack": { + "description": "stack associated to the OCI image", + "readOnly": false, + "properties": { + "id": { + "$ref": "#/definitions/stack/definitions/id", + "example": "ba46bf09-7bd1-42fd-90df-a1a9a93eb4a2" }, - "type": [ - "array" - ] + "name": { + "$ref": "#/definitions/stack/definitions/name", + "example": "cnb" + } }, - "title": "List" + "type": [ + "object" + ] + }, + "created_at": { + "description": "when the OCI image was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] }, + "updated_at": { + "description": "when the OCI image was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ { - "description": "List pipeline couplings for a team.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/pipeline-couplings", + "description": "Info for the OCI images of an app, filtered by identifier.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/oci-images/{(%23%2Fdefinitions%2Foci-image%2Fdefinitions%2Fidentity)}", "method": "GET", - "rel": "instances", + "rel": "self", "targetSchema": { "items": { - "$ref": "#/definitions/pipeline-coupling" + "$ref": "#/definitions/oci-image" }, "type": [ "array" ] }, - "title": "List By Team" + "title": "Info" }, { - "description": "Create a new pipeline coupling.", - "href": "/pipeline-couplings", + "description": "Create an new OCI image of an app", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/oci-images", "method": "POST", "rel": "create", "schema": { "properties": { - "app": { - "$ref": "#/definitions/app/definitions/identity" + "architecture": { + "$ref": "#/definitions/oci-image/definitions/architecture" }, - "pipeline": { - "$ref": "#/definitions/pipeline/definitions/id" + "base_image_name": { + "$ref": "#/definitions/oci-image/definitions/base_image_name" }, - "stage": { - "$ref": "#/definitions/pipeline-coupling/definitions/stage" + "base_top_layer": { + "$ref": "#/definitions/oci-image/definitions/base_top_layer" + }, + "commit": { + "$ref": "#/definitions/oci-image/definitions/commit" + }, + "commit_description": { + "$ref": "#/definitions/oci-image/definitions/commit_description" + }, + "image_repo": { + "$ref": "#/definitions/oci-image/definitions/image_repo" + }, + "digest": { + "$ref": "#/definitions/oci-image/definitions/digest" + }, + "stack": { + "$ref": "#/definitions/stack/definitions/identity" + }, + "process_types": { + "$ref": "#/definitions/oci-image/definitions/process_types" + }, + "buildpacks": { + "$ref": "#/definitions/oci-image/definitions/buildpacks" } }, - "required": [ - "app", - "pipeline", - "stage" - ], "type": [ "object" ] }, "targetSchema": { - "$ref": "#/definitions/pipeline-coupling" + "$ref": "#/definitions/oci-image" }, "title": "Create" + } + ], + "properties": { + "id": { + "$ref": "#/definitions/oci-image/definitions/id" }, - { - "description": "Info for an existing pipeline coupling.", - "href": "/pipeline-couplings/{(%23%2Fdefinitions%2Fpipeline-coupling%2Fdefinitions%2Fidentity)}", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/pipeline-coupling" - }, - "title": "Info" + "base_image_name": { + "$ref": "#/definitions/oci-image/definitions/base_image_name" }, - { - "description": "Delete an existing pipeline coupling.", - "href": "/pipeline-couplings/{(%23%2Fdefinitions%2Fpipeline-coupling%2Fdefinitions%2Fidentity)}", - "method": "DELETE", - "rel": "delete", - "targetSchema": { - "$ref": "#/definitions/pipeline-coupling" - }, - "title": "Delete" + "base_top_layer": { + "$ref": "#/definitions/oci-image/definitions/base_top_layer" }, - { - "description": "Update an existing pipeline coupling.", - "href": "/pipeline-couplings/{(%23%2Fdefinitions%2Fpipeline-coupling%2Fdefinitions%2Fidentity)}", - "method": "PATCH", - "rel": "update", - "schema": { - "properties": { - "stage": { - "$ref": "#/definitions/pipeline-coupling/definitions/stage" - } - }, - "type": [ - "object" - ] - }, - "targetSchema": { - "$ref": "#/definitions/pipeline-coupling" - }, - "title": "Update" + "commit": { + "$ref": "#/definitions/oci-image/definitions/commit" }, - { - "description": "Info for an existing pipeline coupling.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/pipeline-couplings", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/pipeline-coupling" - }, - "title": "Info By App" - } - ], - "properties": { - "app": { - "description": "app involved in the pipeline coupling", - "properties": { - "id": { - "$ref": "#/definitions/app/definitions/id" - } - }, - "type": [ - "object" - ] + "commit_description": { + "$ref": "#/definitions/oci-image/definitions/commit_description" }, - "created_at": { - "$ref": "#/definitions/pipeline-coupling/definitions/created_at" + "image_repo": { + "$ref": "#/definitions/oci-image/definitions/image_repo" }, - "id": { - "$ref": "#/definitions/pipeline-coupling/definitions/id" + "digest": { + "$ref": "#/definitions/oci-image/definitions/digest" }, - "pipeline": { - "description": "pipeline involved in the coupling", - "properties": { - "id": { - "$ref": "#/definitions/pipeline/definitions/id" - } - }, - "type": [ - "object" - ] + "stack": { + "$ref": "#/definitions/oci-image/definitions/stack" }, - "stage": { - "$ref": "#/definitions/pipeline-coupling/definitions/stage" + "process_types": { + "$ref": "#/definitions/oci-image/definitions/process_types" + }, + "buildpacks": { + "$ref": "#/definitions/oci-image/definitions/buildpacks" + }, + "created_at": { + "$ref": "#/definitions/oci-image/definitions/created_at" }, "updated_at": { - "$ref": "#/definitions/pipeline-coupling/definitions/updated_at" + "$ref": "#/definitions/oci-image/definitions/updated_at" + }, + "architecture": { + "$ref": "#/definitions/oci-image/definitions/architecture" } } }, - "pipeline-deployment": { - "description": "Information about latest deployments of apps in a pipeline.", - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", - "strictProperties": true, - "title": "Heroku Platform API - Pipeline Deployment", - "type": [ - "object" - ], - "definitions": { - }, - "links": [ - { - "description": "List latest slug releases for each app in a pipeline", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/latest-deployments", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/release" - }, - "type": [ - "array" - ] - }, - "title": "List" - } - ] - }, - "pipeline-promotion-target": { - "description": "Promotion targets represent an individual app being promoted to", + "password-reset": { + "description": "A password reset represents a in-process password reset attempt.", "$schema": "http://json-schema.org/draft-04/hyper-schema", "stability": "production", "strictProperties": true, - "title": "Heroku Platform API - Pipeline Promotion Target", + "title": "Heroku Platform API - PasswordReset", "type": [ "object" ], "definitions": { - "error_message": { - "description": "an error message for why the promotion failed", - "example": "User does not have access to that app", - "type": [ - "null", - "string" - ] - }, - "id": { - "description": "unique identifier of promotion target", - "example": "01234567-89ab-cdef-0123-456789abcdef", + "created_at": { + "description": "when password reset was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", "readOnly": true, - "format": "uuid", "type": [ "string" ] @@ -10156,19 +10497,23 @@ "identity": { "anyOf": [ { - "$ref": "#/definitions/pipeline-promotion-target/definitions/id" + "$ref": "#/definitions/account/definitions/email" } ] }, - "status": { - "description": "status of promotion", - "example": "pending", + "password_confirmation": { + "description": "confirmation of the new password", + "example": "newpassword", + "readOnly": true, + "type": [ + "string" + ] + }, + "reset_password_token": { + "description": "unique identifier of a password reset attempt", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", "readOnly": true, - "enum": [ - "pending", - "succeeded", - "failed" - ], "type": [ "string" ] @@ -10176,469 +10521,4013 @@ }, "links": [ { - "description": "List promotion targets belonging to an existing promotion.", - "href": "/pipeline-promotions/{(%23%2Fdefinitions%2Fpipeline-promotion%2Fdefinitions%2Fid)}/promotion-targets", - "method": "GET", - "rel": "instances", + "description": "Reset account's password. This will send a reset password link to the user's email address.", + "href": "/password-resets", + "method": "POST", + "rel": "self", + "schema": { + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + } + }, + "required": [ + "email" + ], + "type": [ + "object" + ] + }, "targetSchema": { - "items": { - "$ref": "#/definitions/pipeline-promotion-target" + "$ref": "#/definitions/password-reset" + }, + "title": "Reset Password" + }, + { + "description": "Complete password reset.", + "href": "/password-resets/{(%23%2Fdefinitions%2Fpassword-reset%2Fdefinitions%2Freset_password_token)}/actions/finalize", + "method": "POST", + "rel": "self", + "schema": { + "properties": { + "password": { + "$ref": "#/definitions/account/definitions/password" + }, + "password_confirmation": { + "$ref": "#/definitions/password-reset/definitions/password_confirmation" + } }, + "required": [ + "password", + "password_confirmation" + ], "type": [ - "array" + "object" ] }, - "title": "List" + "targetSchema": { + "$ref": "#/definitions/password-reset" + }, + "title": "Complete Reset Password" } ], "properties": { - "app": { - "description": "the app which was promoted to", - "properties": { - "id": { - "$ref": "#/definitions/app/definitions/id" - } - }, - "strictProperties": true, - "type": [ - "object" - ] - }, - "error_message": { - "$ref": "#/definitions/pipeline-promotion-target/definitions/error_message" - }, - "id": { - "$ref": "#/definitions/pipeline-promotion-target/definitions/id" + "created_at": { + "$ref": "#/definitions/password-reset/definitions/created_at" }, - "pipeline_promotion": { - "description": "the promotion which the target belongs to", + "user": { "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, "id": { - "$ref": "#/definitions/pipeline-promotion/definitions/id" + "$ref": "#/definitions/account/definitions/id" } }, "strictProperties": true, "type": [ "object" ] - }, - "release": { - "description": "the release which was created on the target app", - "properties": { - "id": { - "$ref": "#/definitions/release/definitions/id" - } - }, - "type": [ - "object", - "null" - ] - }, - "status": { - "$ref": "#/definitions/pipeline-promotion-target/definitions/status" } } }, - "pipeline-promotion": { - "description": "Promotions allow you to move code from an app in a pipeline to all targets", + "peering-info": { + "description": "[Peering Info](https://devcenter.heroku.com/articles/private-space-vpc-peering?preview=1) gives you the information necessary to peer an AWS VPC to a Private Space.", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", + "stability": "prototype", "strictProperties": true, - "title": "Heroku Platform API - Pipeline Promotion", + "title": "Heroku Platform API - Peering Info", "type": [ "object" ], "definitions": { - "created_at": { - "description": "when promotion was created", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", - "type": [ - "string" - ] - }, - "id": { - "description": "unique identifier of promotion", - "example": "01234567-89ab-cdef-0123-456789abcdef", + "aws_region": { + "description": "The AWS region where your Private Space resides", + "example": "us-west-1", + "enum": [ + "ap-south-1", + "eu-west-1", + "ap-southeast-1", + "ap-southeast-2", + "eu-central-1", + "ap-northeast-2", + "ap-northeast-1", + "us-east-1", + "sa-east-1", + "us-west-1", + "us-west-2" + ], "readOnly": true, - "format": "uuid", "type": [ "string" ] + } + }, + "properties": { + "aws_account_id": { + "$ref": "#/definitions/peering/definitions/aws_account_id" }, - "identity": { - "anyOf": [ - { - "$ref": "#/definitions/pipeline-promotion/definitions/id" - } - ] + "aws_region": { + "$ref": "#/definitions/peering-info/definitions/aws_region" }, - "status": { - "description": "status of promotion", - "example": "pending", - "readOnly": true, - "enum": [ - "pending", - "completed" + "vpc_id": { + "$ref": "#/definitions/peering/definitions/vpc_id" + }, + "vpc_cidr": { + "description": "The CIDR range of the Private Space VPC", + "$ref": "#/definitions/peering/definitions/cidr" + }, + "dyno_cidr_blocks": { + "description": "The CIDR ranges that should be routed to the Private Space VPC.", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/peering/definitions/cidr" + } + }, + "unavailable_cidr_blocks": { + "description": "The CIDR ranges that you must not conflict with.", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/peering/definitions/cidr" + } + }, + "space_cidr_blocks": { + "description": "The CIDR ranges that should be routed to the Private Space VPC.", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/peering/definitions/cidr" + } + } + } + }, + "peering": { + "description": "[Peering](https://devcenter.heroku.com/articles/private-space-vpc-peering?preview=1) provides a way to peer your Private Space VPC to another AWS VPC.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Peering", + "type": [ + "object" + ], + "definitions": { + "aws_account_id": { + "description": "The AWS account ID of your Private Space.", + "example": "123456789012", + "readOnly": true, + "type": [ + "string" + ] + }, + "aws_region": { + "description": "The AWS region of the peer connection.", + "example": "us-east-1", + "readOnly": true, + "type": [ + "string" + ] + }, + "vpc_id": { + "description": "The AWS VPC ID of the peer.", + "example": "vpc-1234567890", + "readOnly": true, + "type": [ + "string" + ] + }, + "type": { + "description": "The type of peering connection.", + "example": "heroku-managed", + "type": [ + "string" + ], + "enum": [ + "heroku-managed", + "customer-managed", + "unknown", + "slowdb", + "heroku-postgresql", + "heroku-redis", + "heroku-kafka", + "heroku-cassandra" + ] + }, + "status": { + "description": "The status of the peering connection.", + "example": "pending-acceptance", + "enum": [ + "initiating-request", + "pending-acceptance", + "provisioning", + "active", + "failed", + "expired", + "rejected", + "deleted" + ], + "type": [ + "string" + ], + "readOnly": true + }, + "pcx_id": { + "description": "The AWS VPC Peering Connection ID of the peering.", + "example": "pcx-123456789012", + "readOnly": true, + "type": [ + "string" + ] + }, + "cidr": { + "description": "An IP address and the number of significant bits that make up the routing or networking portion.", + "example": "192.0.2.0/24", + "type": [ + "string" + ] + }, + "expires": { + "description": "When a peering connection will expire.", + "example": "2020-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "properties": { + "type": { + "$ref": "#/definitions/peering/definitions/type" + }, + "pcx_id": { + "$ref": "#/definitions/peering/definitions/pcx_id" + }, + "cidr_block": { + "description": "The CIDR block of the peer.", + "$ref": "#/definitions/peering/definitions/cidr" + }, + "cidr_blocks": { + "description": "The CIDR blocks of the peer.", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/peering/definitions/cidr" + } + }, + "status": { + "$ref": "#/definitions/peering/definitions/status" + }, + "aws_vpc_id": { + "$ref": "#/definitions/peering/definitions/vpc_id" + }, + "aws_region": { + "$ref": "#/definitions/peering/definitions/aws_region" + }, + "aws_account_id": { + "$ref": "#/definitions/peering/definitions/aws_account_id" + }, + "expires": { + "$ref": "#/definitions/peering/definitions/expires" + } + }, + "links": [ + { + "description": "Provides the necessary information to establish an AWS VPC Peering with your private space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/peering-info", + "method": "GET", + "rel": { + "$ref": "#/definitions/peering-info" + }, + "targetSchema": { + "$ref": "#/definitions/peering-info" + }, + "title": "Info" + }, + { + "description": "List peering connections of a private space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/peerings", + "method": "GET", + "rel": "self", + "targetSchema": { + "items": { + "$ref": "#/definitions/peering" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Accept a pending peering connection with a private space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/peerings", + "method": "POST", + "rel": "empty", + "schema": { + "properties": { + "pcx_id": { + "$ref": "#/definitions/peering/definitions/pcx_id" + } + }, + "required": [ + "pcx_id" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/peering" + }, + "title": "Accept" + }, + { + "description": "Destroy an active peering connection with a private space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/peerings/{(%23%2Fdefinitions%2Fpeering%2Fdefinitions%2Fpcx_id)}", + "rel": "empty", + "method": "DELETE", + "targetSchema": { + "$ref": "#/definitions/peering" + }, + "title": "Destroy" + } + ] + }, + "permission-entity": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "An owned entity including users' permissions.", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Permission Entity", + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "ID of the entity.", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "type": { + "description": "The type of object the entity is referring to.", + "example": "app", + "readOnly": true, + "type": [ + "string" + ], + "enum": [ + "app", + "space" + ] + }, + "name": { + "description": "Name of the entity.", + "example": "polar-lake-12345", + "readOnly": true, + "type": [ + "string" + ] + }, + "permissions": { + "description": "A list of permissions the user has on the entity.", + "example": "app", + "readOnly": true, + "type": [ + "array" + ] + } + }, + "links": [ + { + "description": "List permission entities for a team.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/permissions", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/permission-entity" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "id": { + "$ref": "#/definitions/permission-entity/definitions/id" + }, + "name": { + "$ref": "#/definitions/permission-entity/definitions/name" + }, + "team_id": { + "$ref": "#/definitions/team/definitions/id" + }, + "type": { + "$ref": "#/definitions/permission-entity/definitions/type" + }, + "users": { + "description": "Users that have access to the entity.", + "items": { + "type": [ + "object" + ], + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + }, + "permissions": { + "description": "enterprise account permissions", + "type": [ + "array" + ], + "items": { + "type": [ + "string" + ] + } + } + } + }, + "type": [ + "array" + ] + } + } + }, + "pipeline-build": { + "description": "Information about the latest builds of apps in a pipeline. A build represents the process of transforming code into build artifacts.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Pipeline Build", + "type": [ + "object" + ], + "definitions": {}, + "properties": { + "app": { + "description": "app that the build belongs to", + "properties": { + "id": { + "description": "unique identifier of the app", + "$ref": "#/definitions/app/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "buildpacks": { + "$ref": "#/definitions/build/definitions/buildpacks" + }, + "created_at": { + "description": "when the build was created", + "$ref": "#/definitions/build/definitions/created_at" + }, + "id": { + "description": "unique identifier of the build", + "$ref": "#/definitions/build/definitions/id" + }, + "output_stream_url": { + "description": "streaming URL of the build process output", + "$ref": "#/definitions/build/definitions/output_stream_url" + }, + "source_blob": { + "description": "location of gzipped tarball of source code used to create build", + "properties": { + "checksum": { + "description": "an optional checksum of the gzipped tarball for verifying its integrity", + "example": "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "url": { + "description": "URL where gzipped tar archive of source code for build was downloaded.", + "example": "https://example.com/source.tgz?token=xyz", + "readOnly": true, + "type": [ + "string" + ] + }, + "version": { + "description": "version of the gzipped tarball", + "example": "v1.3.0", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "version_description": { + "description": "version description of the gzipped tarball", + "example": "* Fake User: Change session key", + "readOnly": true, + "type": [ + "string", + "null" + ] + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "release": { + "properties": { + "id": { + "description": "unique identifier of the release", + "$ref": "#/definitions/release/definitions/id" + } + }, + "$ref": "#/definitions/build/definitions/release" + }, + "slug": { + "description": "slug created by this build", + "properties": { + "id": { + "description": "unique identifier of the slug", + "$ref": "#/definitions/slug/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object", + "null" + ] + }, + "stack": { + "description": "stack of the build", + "example": "heroku-24", + "$ref": "#/definitions/build/definitions/stack" + }, + "status": { + "description": "status of the build", + "$ref": "#/definitions/build/definitions/status" + }, + "updated_at": { + "description": "when the build was updated", + "$ref": "#/definitions/build/definitions/updated_at" + }, + "user": { + "description": "user that started the build", + "properties": { + "id": { + "$ref": "#/definitions/account/definitions/id" + }, + "email": { + "$ref": "#/definitions/account/definitions/email" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + }, + "links": [ + { + "description": "List latest builds for each app in a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/latest-builds", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/pipeline-build" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ] + }, + "pipeline-config-var": { + "description": "Pipeline config vars in Heroku CI and review apps used to manage the configuration information for a pipeline.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Pipeline Config Vars", + "type": [ + "object" + ], + "definitions": { + "config_vars": { + "additionalProperties": false, + "description": "hash of config vars", + "example": { + "FOO": "bar", + "BAZ": "qux" + }, + "patternProperties": { + "^[\\w\\.\\:\\[\\]]+$": { + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object" + ] + } + }, + "properties": { + "[\"NAME\"]: [\"value\"]": { + "type": [ + "object" + ], + "description": "user-defined config var name and value", + "example": { + "FOO": "bar" + } + } + }, + "links": [ + { + "description": "Get config-vars for a pipeline stage.", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/stage/{(%23%2Fdefinitions%2Fpipeline-coupling%2Fdefinitions%2Fstage)}/config-vars", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/pipeline-config-var/definitions/config_vars" + }, + "title": "Info for App" + }, + { + "description": "Update config-vars for a pipeline stage. You can update existing config-vars by setting them again, and remove by setting it to `null`.", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/stage/{(%23%2Fdefinitions%2Fpipeline-coupling%2Fdefinitions%2Fstage)}/config-vars", + "method": "PATCH", + "rel": "update", + "schema": { + "additionalProperties": false, + "description": "hash of config changes – update values or delete by seting it to `null`", + "example": { + "FOO": "bar", + "BAZ": "qux" + }, + "patternProperties": { + "^[\\w\\.\\:\\[\\]]+$": { + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/pipeline-config-var/definitions/config_vars" + }, + "title": "Update" + } + ], + "example": { + "FOO": "bar", + "BAZ": "qux" + }, + "patternProperties": { + "^\\w+$": { + "type": [ + "string" + ] + } + } + }, + "pipeline-coupling": { + "description": "Information about an app's coupling to a pipeline", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "title": "Heroku Platform API - Pipeline Coupling", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when pipeline coupling was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of pipeline coupling", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/pipeline-coupling/definitions/id" + } + ] + }, + "stage": { + "description": "target pipeline stage", + "example": "production", + "enum": [ + "test", + "review", + "development", + "staging", + "production" + ], + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when pipeline coupling was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "List couplings for a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/pipeline-couplings", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/pipeline-coupling" + }, + "type": [ + "array" + ] + }, + "title": "List By Pipeline" + }, + { + "description": "List pipeline couplings for the current user.", + "href": "/users/~/pipeline-couplings", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/pipeline-coupling" + }, + "type": [ + "array" + ] + }, + "title": "List By Current User" + }, + { + "description": "List pipeline couplings.", + "href": "/pipeline-couplings", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/pipeline-coupling" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "List pipeline couplings for a team.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/pipeline-couplings", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/pipeline-coupling" + }, + "type": [ + "array" + ] + }, + "title": "List By Team" + }, + { + "description": "Create a new pipeline coupling.", + "href": "/pipeline-couplings", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "app": { + "$ref": "#/definitions/app/definitions/identity" + }, + "pipeline": { + "$ref": "#/definitions/pipeline/definitions/id" + }, + "stage": { + "$ref": "#/definitions/pipeline-coupling/definitions/stage" + } + }, + "required": [ + "app", + "pipeline", + "stage" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/pipeline-coupling" + }, + "title": "Create" + }, + { + "description": "Info for an existing pipeline coupling.", + "href": "/pipeline-couplings/{(%23%2Fdefinitions%2Fpipeline-coupling%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/pipeline-coupling" + }, + "title": "Info" + }, + { + "description": "Delete an existing pipeline coupling.", + "href": "/pipeline-couplings/{(%23%2Fdefinitions%2Fpipeline-coupling%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "delete", + "targetSchema": { + "$ref": "#/definitions/pipeline-coupling" + }, + "title": "Delete" + }, + { + "description": "Update an existing pipeline coupling.", + "href": "/pipeline-couplings/{(%23%2Fdefinitions%2Fpipeline-coupling%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "stage": { + "$ref": "#/definitions/pipeline-coupling/definitions/stage" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/pipeline-coupling" + }, + "title": "Update" + }, + { + "description": "Info for an existing pipeline coupling.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/pipeline-couplings", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/pipeline-coupling" + }, + "title": "Info By App" + } + ], + "properties": { + "app": { + "description": "app involved in the pipeline coupling", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/pipeline-coupling/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/pipeline-coupling/definitions/id" + }, + "pipeline": { + "description": "pipeline involved in the coupling", + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "stage": { + "$ref": "#/definitions/pipeline-coupling/definitions/stage" + }, + "updated_at": { + "$ref": "#/definitions/pipeline-coupling/definitions/updated_at" + } + } + }, + "pipeline-deployment": { + "description": "Information about the latest deployment of each app in a pipeline. A deployment is the process of moving the build artifacts to a target environment.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Pipeline Deployment", + "type": [ + "object" + ], + "$ref": "#/definitions/release", + "properties": { + "addon_plan_names": { + "description": "add-on plans installed on the app for this deployment", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/plan/definitions/name" + } + }, + "artifacts": { + "$ref": "#/definitions/release/definitions/artifact" + }, + "app": { + "description": "app involved in the deployment", + "properties": { + "name": { + "description": "unique name of the app", + "$ref": "#/definitions/app/definitions/name" + }, + "id": { + "description": "unique identifier of the app", + "$ref": "#/definitions/app/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "created_at": { + "description": "when the deployment was created", + "$ref": "#/definitions/release/definitions/created_at" + }, + "description": { + "description": "description of changes in this deployment", + "$ref": "#/definitions/release/definitions/description" + }, + "id": { + "description": "unique identifier of the deployment", + "$ref": "#/definitions/release/definitions/id" + }, + "updated_at": { + "description": "when the deployment was updated", + "$ref": "#/definitions/release/definitions/updated_at" + }, + "slug": { + "description": "slug running in this deployment", + "properties": { + "id": { + "description": "unique identifier of the slug", + "$ref": "#/definitions/slug/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object", + "null" + ] + }, + "status": { + "description": "current status of the deployment", + "$ref": "#/definitions/release/definitions/status" + }, + "user": { + "description": "user that created the deployment", + "properties": { + "id": { + "$ref": "#/definitions/account/definitions/id" + }, + "email": { + "$ref": "#/definitions/account/definitions/email" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "version": { + "description": "unique version assigned to the deployment", + "$ref": "#/definitions/release/definitions/version" + }, + "current": { + "description": "indicates if this deployment is the current one for the app", + "$ref": "#/definitions/release/definitions/current" + }, + "output_stream_url": { + "description": "streaming URL for the release command output", + "$ref": "#/definitions/release/definitions/output_stream_url" + }, + "eligible_for_rollback": { + "description": "indicates if this deployment is eligible for rollback", + "$ref": "#/definitions/release/definitions/eligible_for_rollback" + } + }, + "links": [ + { + "description": "List latest deployments for each app in a pipeline. A deployment is a release that changed your source slug, container image, or Heroku processes.", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/latest-deployments", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/release" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ] + }, + "pipeline-promotion-target": { + "description": "Promotion targets represent an individual app being promoted to", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Pipeline Promotion Target", + "type": [ + "object" + ], + "definitions": { + "error_message": { + "description": "an error message for why the promotion failed", + "example": "User does not have access to that app", + "type": [ + "null", + "string" + ] + }, + "id": { + "description": "unique identifier of promotion target", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "readOnly": true, + "format": "uuid", + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/pipeline-promotion-target/definitions/id" + } + ] + }, + "status": { + "description": "status of promotion", + "example": "pending", + "readOnly": true, + "enum": [ + "pending", + "succeeded", + "failed" + ], + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "List promotion targets belonging to an existing promotion.", + "href": "/pipeline-promotions/{(%23%2Fdefinitions%2Fpipeline-promotion%2Fdefinitions%2Fid)}/promotion-targets", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/pipeline-promotion-target" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "app": { + "description": "the app which was promoted to", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "error_message": { + "$ref": "#/definitions/pipeline-promotion-target/definitions/error_message" + }, + "id": { + "$ref": "#/definitions/pipeline-promotion-target/definitions/id" + }, + "pipeline_promotion": { + "description": "the promotion which the target belongs to", + "properties": { + "id": { + "$ref": "#/definitions/pipeline-promotion/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "release": { + "description": "the release which was created on the target app", + "properties": { + "id": { + "$ref": "#/definitions/release/definitions/id" + } + }, + "type": [ + "object", + "null" + ] + }, + "status": { + "$ref": "#/definitions/pipeline-promotion-target/definitions/status" + } + } + }, + "pipeline-promotion": { + "description": "Promotions allow you to move code from an app in a pipeline to all targets", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Pipeline Promotion", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when promotion was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of promotion", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "readOnly": true, + "format": "uuid", + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/pipeline-promotion/definitions/id" + } + ] + }, + "status": { + "description": "status of promotion", + "example": "pending", + "readOnly": true, + "enum": [ + "pending", + "completed" + ], + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when promotion was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "type": [ + "string", + "null" + ] + } + }, + "links": [ + { + "description": "Create a new promotion.", + "href": "/pipeline-promotions", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "pipeline": { + "description": "pipeline involved in the promotion", + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/id" + } + }, + "required": [ + "id" + ], + "type": [ + "object" + ] + }, + "source": { + "description": "the app being promoted from", + "properties": { + "app": { + "description": "the app which was promoted from", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + }, + "type": [ + "object" + ] + }, + "targets": { + "items": { + "properties": { + "app": { + "description": "the app is being promoted to", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + } + }, + "type": [ + "object" + ] + }, + "type": [ + "array" + ] + } + }, + "required": [ + "pipeline", + "source", + "targets" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/pipeline-promotion" + }, + "title": "Create" + }, + { + "description": "Info for existing pipeline promotion.", + "href": "/pipeline-promotions/{(%23%2Fdefinitions%2Fpipeline-promotion%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/pipeline-promotion" + }, + "title": "Info" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/pipeline-promotion/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/pipeline-promotion/definitions/id" + }, + "pipeline": { + "description": "the pipeline which the promotion belongs to", + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "source": { + "description": "the app being promoted from", + "properties": { + "app": { + "description": "the app which was promoted from", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "release": { + "description": "the release used to promoted from", + "properties": { + "id": { + "$ref": "#/definitions/release/definitions/id" + } + }, + "type": [ + "object" + ] + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "status": { + "$ref": "#/definitions/pipeline-promotion/definitions/status" + }, + "updated_at": { + "$ref": "#/definitions/pipeline-promotion/definitions/updated_at" + } + } + }, + "pipeline-release": { + "description": "Information about the latest release of each app in a pipeline. A release makes a deployment available to end-users.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Pipeline Release", + "type": [ + "object" + ], + "properties": { + "addon_plan_names": { + "description": "add-on plans installed on the app for this release", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/plan/definitions/name" + } + }, + "artifacts": { + "$ref": "#/definitions/release/definitions/artifact" + }, + "app": { + "description": "app involved in the release", + "properties": { + "name": { + "description": "unique name of the app", + "$ref": "#/definitions/app/definitions/name" + }, + "id": { + "description": "unique identifier of the app", + "$ref": "#/definitions/app/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "created_at": { + "description": "when the release was created", + "$ref": "#/definitions/release/definitions/created_at" + }, + "description": { + "$ref": "#/definitions/release/definitions/description" + }, + "id": { + "description": "unique identifier of the release", + "$ref": "#/definitions/release/definitions/id" + }, + "updated_at": { + "description": "when the release was updated", + "$ref": "#/definitions/release/definitions/updated_at" + }, + "slug": { + "description": "slug running in the release", + "properties": { + "id": { + "description": "unique identifier of the slug", + "$ref": "#/definitions/slug/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object", + "null" + ] + }, + "status": { + "$ref": "#/definitions/release/definitions/status" + }, + "user": { + "description": "user that created the release", + "properties": { + "id": { + "$ref": "#/definitions/account/definitions/id" + }, + "email": { + "$ref": "#/definitions/account/definitions/email" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "version": { + "$ref": "#/definitions/release/definitions/version" + }, + "current": { + "description": "indicates if this release is the current one for the app", + "$ref": "#/definitions/release/definitions/current" + }, + "output_stream_url": { + "description": "streaming URL of the build process output", + "$ref": "#/definitions/release/definitions/output_stream_url" + }, + "eligible_for_rollback": { + "$ref": "#/definitions/release/definitions/eligible_for_rollback" + } + }, + "links": [ + { + "description": "List latest releases for each app in a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/latest-releases", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/release" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ] + }, + "pipeline-stack": { + "description": "A pipeline's stack is determined by the apps in the pipeline. This is used during creation of CI and Review Apps that have no stack defined in app.json", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": false, + "title": "Heroku Platform API - Pipeline Stack", + "type": [ + "object" + ], + "links": [ + { + "description": "The stack for a given pipeline, used for CI and Review Apps that have no stack defined in app.json.", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/pipeline-stack", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/pipeline-stack" + }, + "title": "Default Stack" + } + ], + "properties": { + "stack": { + "description": "identity of the stack that will be used for new builds without a stack defined in CI and Review Apps", + "properties": { + "id": { + "$ref": "#/definitions/stack/definitions/id" + }, + "name": { + "$ref": "#/definitions/stack/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object", + "null" + ] + } + } + }, + "pipeline-transfer": { + "description": "A pipeline transfer is the process of changing pipeline ownership along with the contained apps.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": false, + "title": "Heroku Platform API - Pipeline Transfer", + "type": [ + "object" + ], + "definitions": { + "new_owner": { + "description": "New owner of the pipeline.", + "$ref": "#/definitions/pipeline/definitions/owner", + "type": [ + "object" + ] + }, + "previous_owner": { + "description": "Previous owner of the pipeline.", + "$ref": "#/definitions/pipeline/definitions/owner", + "type": [ + "object" + ] + } + }, + "links": [ + { + "description": "Create a new pipeline transfer.", + "href": "/pipeline-transfers", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "pipeline": { + "description": "The pipeline to transfer", + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "new_owner": { + "description": "New pipeline owner", + "properties": { + "id": { + "description": "unique identifier of a pipeline owner", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "type": [ + "string" + ] + }, + "type": { + "description": "type of pipeline owner", + "example": "team", + "pattern": "(^team$|^user$)", + "type": [ + "string" + ] + } + }, + "type": [ + "object" + ] + } + }, + "required": [ + "pipeline", + "new_owner" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/pipeline-transfer" + }, + "title": "Create" + } + ], + "properties": { + "pipeline": { + "description": "pipeline being transferred", + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "previous_owner": { + "$ref": "#/definitions/pipeline-transfer/definitions/previous_owner" + }, + "new_owner": { + "$ref": "#/definitions/pipeline-transfer/definitions/new_owner" + } + } + }, + "pipeline": { + "description": "A pipeline allows grouping of apps into different stages.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": false, + "title": "Heroku Platform API - Pipeline", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when pipeline was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of pipeline", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/pipeline/definitions/id" + }, + { + "$ref": "#/definitions/pipeline/definitions/name" + } + ] + }, + "name": { + "description": "name of pipeline", + "example": "example", + "pattern": "^[a-z][a-z0-9-]{2,29}$", + "readOnly": false, + "type": [ + "string" + ] + }, + "owner": { + "description": "Owner of a pipeline.", + "definitions": { + "id": { + "description": "unique identifier of a pipeline owner", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": false, + "type": [ + "string" + ] + }, + "type": { + "description": "type of pipeline owner", + "example": "team", + "pattern": "(^team$|^user$)", + "readOnly": false, + "type": [ + "string" + ] + } + }, + "links": [], + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/owner/definitions/id" + }, + "type": { + "$ref": "#/definitions/pipeline/definitions/owner/definitions/type" + } + }, + "required": [ + "id", + "type" + ], + "type": [ + "object", + "null" + ] + }, + "updated_at": { + "description": "when pipeline was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "generation": { + "description": "the generation of the Heroku platform for this pipeline", + "definitions": { + "id": { + "description": "unique identifier of the generation of the Heroku platform for this pipeline", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/pipeline/definitions/generation/definitions/id" + }, + { + "$ref": "#/definitions/pipeline/definitions/generation/definitions/name" + } + ] + }, + "name": { + "description": "unique name of the generation of the Heroku platform for this pipeline", + "example": "cedar", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/generation/definitions/id" + }, + "name": { + "$ref": "#/definitions/pipeline/definitions/generation/definitions/name" + } + }, + "type": [ + "object" + ] + } + }, + "links": [ + { + "description": "Create a new pipeline.", + "href": "/pipelines", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/pipeline/definitions/name" + }, + "owner": { + "description": "Pipeline owner", + "$ref": "#/definitions/pipeline/definitions/owner", + "type": [ + "object", + "null" + ] + } + }, + "required": [ + "name" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/pipeline" + }, + "title": "Create" + }, + { + "description": "Info for existing pipeline.", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/pipeline" + }, + "title": "Info" + }, + { + "description": "Delete an existing pipeline.", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}", + "method": "DELETE", + "rel": "delete", + "targetSchema": { + "$ref": "#/definitions/pipeline" + }, + "title": "Delete" + }, + { + "description": "Update an existing pipeline.", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/pipeline/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/pipeline" + }, + "title": "Update" + }, + { + "description": "List existing pipelines.", + "href": "/pipelines", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/pipeline" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/pipeline/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/pipeline/definitions/id" + }, + "name": { + "$ref": "#/definitions/pipeline/definitions/name" + }, + "owner": { + "$ref": "#/definitions/pipeline/definitions/owner" + }, + "updated_at": { + "$ref": "#/definitions/pipeline/definitions/updated_at" + }, + "generation": { + "$ref": "#/definitions/pipeline/definitions/generation" + } + } + }, + "plan": { + "description": "Plans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Plan", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when plan was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "compliance": { + "description": "the compliance regimes applied to an add-on plan", + "example": [ + "HIPAA" + ], + "readOnly": false, + "type": [ + "null", + "array" + ], + "items": { + "$ref": "#/definitions/plan/definitions/regime" + } + }, + "default": { + "description": "whether this plan is the default for its add-on service", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "description": { + "description": "description of plan", + "example": "Heroku Postgres Dev", + "readOnly": true, + "type": [ + "string" + ] + }, + "human_name": { + "description": "human readable name of the add-on plan", + "example": "Dev", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of this plan", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "installable_inside_private_network": { + "description": "whether this plan is installable to a Private Spaces app", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "installable_outside_private_network": { + "description": "whether this plan is installable to a Common Runtime app", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/plan/definitions/id" + }, + { + "$ref": "#/definitions/plan/definitions/name" + } + ] + }, + "name": { + "description": "unique name of this plan", + "example": "heroku-postgresql:dev", + "readOnly": true, + "type": [ + "string" + ] + }, + "regime": { + "description": "compliance requirements an add-on plan must adhere to", + "readOnly": true, + "example": "HIPAA", + "type": [ + "string" + ], + "enum": [ + "HIPAA", + "PCI" + ] + }, + "cents": { + "description": "price in cents per unit of plan", + "example": 0, + "readOnly": true, + "type": [ + "integer" + ] + }, + "contract": { + "description": "price is negotiated in a contract outside of monthly add-on billing", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "metered": { + "description": "whether this plan is billed per use", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "unit": { + "description": "unit of price for plan", + "example": "month", + "readOnly": true, + "type": [ + "string" + ] + }, + "space_default": { + "description": "whether this plan is the default for apps in Private Spaces", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "state": { + "description": "release status for plan", + "example": "public", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when plan was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "visible": { + "description": "whether this plan is publicly visible", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + } + }, + "links": [ + { + "description": "Info for existing plan.", + "href": "/plans/{(%23%2Fdefinitions%2Fplan%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/plan" + }, + "title": "Info" + }, + { + "description": "Info for existing plan by Add-on.", + "href": "/addon-services/{(%23%2Fdefinitions%2Fadd-on-service%2Fdefinitions%2Fidentity)}/plans/{(%23%2Fdefinitions%2Fplan%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/plan" + }, + "title": "Info By Add-on" + }, + { + "description": "List existing plans by Add-on.", + "href": "/addon-services/{(%23%2Fdefinitions%2Fadd-on-service%2Fdefinitions%2Fidentity)}/plans", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/plan" + }, + "type": [ + "array" + ] + }, + "title": "List By Add-on" + } + ], + "properties": { + "addon_service": { + "description": "identity of add-on service", + "properties": { + "id": { + "$ref": "#/definitions/add-on-service/definitions/id" + }, + "name": { + "$ref": "#/definitions/add-on-service/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/plan/definitions/created_at" + }, + "compliance": { + "$ref": "#/definitions/plan/definitions/compliance" + }, + "default": { + "$ref": "#/definitions/plan/definitions/default" + }, + "description": { + "$ref": "#/definitions/plan/definitions/description" + }, + "human_name": { + "$ref": "#/definitions/plan/definitions/human_name" + }, + "id": { + "$ref": "#/definitions/plan/definitions/id" + }, + "installable_inside_private_network": { + "$ref": "#/definitions/plan/definitions/installable_inside_private_network" + }, + "installable_outside_private_network": { + "$ref": "#/definitions/plan/definitions/installable_outside_private_network" + }, + "name": { + "$ref": "#/definitions/plan/definitions/name" + }, + "price": { + "description": "price", + "properties": { + "cents": { + "$ref": "#/definitions/plan/definitions/cents" + }, + "contract": { + "$ref": "#/definitions/plan/definitions/contract" + }, + "metered": { + "$ref": "#/definitions/plan/definitions/metered" + }, + "unit": { + "$ref": "#/definitions/plan/definitions/unit" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "space_default": { + "$ref": "#/definitions/plan/definitions/space_default" + }, + "state": { + "$ref": "#/definitions/plan/definitions/state" + }, + "updated_at": { + "$ref": "#/definitions/plan/definitions/updated_at" + }, + "visible": { + "$ref": "#/definitions/plan/definitions/visible" + } + } + }, + "rate-limit": { + "description": "Rate Limit represents the number of request tokens each account holds. Requests to this endpoint do not count towards the rate limit.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Rate Limit", + "type": [ + "object" + ], + "definitions": { + "identity": {}, + "remaining": { + "description": "allowed requests remaining in current interval", + "example": 2399, + "readOnly": true, + "type": [ + "integer" + ] + } + }, + "links": [ + { + "description": "Info for rate limits.", + "href": "/account/rate-limits", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/rate-limit" + }, + "title": "Info" + } + ], + "properties": { + "remaining": { + "$ref": "#/definitions/rate-limit/definitions/remaining" + } + } + }, + "region": { + "description": "A region represents a geographic location in which your application may run.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Region", + "type": [ + "object" + ], + "definitions": { + "country": { + "description": "country where the region exists", + "example": "United States", + "readOnly": true, + "type": [ + "string" + ] + }, + "created_at": { + "description": "when region was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "description": { + "description": "description of region", + "example": "United States", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of region", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/region/definitions/id" + }, + { + "$ref": "#/definitions/region/definitions/name" + } + ] + }, + "locale": { + "description": "area in the country where the region exists", + "example": "Virginia", + "readOnly": true, + "type": [ + "string" + ] + }, + "name": { + "description": "unique name of region", + "example": "us", + "readOnly": true, + "type": [ + "string" + ] + }, + "private_capable": { + "description": "whether or not region is available for creating a Private Space", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "provider": { + "description": "provider of underlying substrate", + "type": [ + "object" + ], + "properties": { + "name": { + "description": "name of provider", + "example": "amazon-web-services", + "readOnly": true, + "type": [ + "string" + ] + }, + "region": { + "description": "region name used by provider", + "example": "us-east-1", + "readOnly": true, + "type": [ + "string" + ], + "enum": [ + "ap-south-1", + "eu-west-1", + "ap-southeast-1", + "ap-southeast-2", + "eu-central-1", + "eu-west-2", + "ap-northeast-2", + "ap-northeast-1", + "us-east-1", + "sa-east-1", + "us-west-1", + "us-west-2", + "ca-central-1" + ] + } + }, + "readOnly": true + }, + "updated_at": { + "description": "when region was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Info for existing region.", + "href": "/regions/{(%23%2Fdefinitions%2Fregion%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/region" + }, + "title": "Info" + }, + { + "description": "List existing regions.", + "href": "/regions", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/region" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "country": { + "$ref": "#/definitions/region/definitions/country" + }, + "created_at": { + "$ref": "#/definitions/region/definitions/created_at" + }, + "description": { + "$ref": "#/definitions/region/definitions/description" + }, + "id": { + "$ref": "#/definitions/region/definitions/id" + }, + "locale": { + "$ref": "#/definitions/region/definitions/locale" + }, + "name": { + "$ref": "#/definitions/region/definitions/name" + }, + "private_capable": { + "$ref": "#/definitions/region/definitions/private_capable" + }, + "provider": { + "$ref": "#/definitions/region/definitions/provider" + }, + "updated_at": { + "$ref": "#/definitions/region/definitions/updated_at" + } + } + }, + "release": { + "description": "A release represents a combination of code, config vars and add-ons for an app on Heroku.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Release", + "type": [ + "object" + ], + "definitions": { + "artifact": { + "description": "a build artifact for the release", + "properties": { + "type": { + "description": "type of artifact", + "example": "oci-image", + "type": [ + "string" + ] + }, + "id": { + "anyOf": [ + { + "$ref": "#/definitions/slug/definitions/id" + }, + { + "$ref": "#/definitions/oci-image/definitions/id" + } + ] + } + }, + "readOnly": true, + "type": [ + "object" + ] + }, + "created_at": { + "description": "when release was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "current": { + "description": "indicates if this release is the current one for the app", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "description": { + "description": "description of changes in this release", + "example": "Added new feature", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of release", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/release/definitions/id" + }, + { + "$ref": "#/definitions/release/definitions/version" + } + ] + }, + "output_stream_url": { + "description": "URL that the release command output streams to. The stream is available as either `text/plain` or `text/event-stream`. Prepare clients to handle disconnects and to resume the stream by sending a `Range` header for `text/plain` or a `Last-Event-Id` header for `text/event-stream`.", + "example": "https://release-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "description": "current status of the release", + "enum": [ + "expired", + "failed", + "pending", + "succeeded" + ], + "example": "succeeded", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when release was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "version": { + "description": "unique version assigned to the release", + "example": 11, + "readOnly": true, + "type": [ + "integer" + ] + }, + "eligible_for_rollback": { + "description": "indicates if this release is eligible for rollback", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + } + }, + "links": [ + { + "description": "Info for existing release.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/releases/{(%23%2Fdefinitions%2Frelease%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/release" + }, + "title": "Info" + }, + { + "description": "List existing releases.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/releases", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/release" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "Create new release.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/releases", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "description": { + "$ref": "#/definitions/release/definitions/description" + }, + "oci_image": { + "$ref": "#/definitions/oci-image/definitions/identity" + }, + "slug": { + "$ref": "#/definitions/slug/definitions/identity" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/release" + }, + "title": "Create" + }, + { + "description": "Rollback to an existing release.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/releases", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "release": { + "$ref": "#/definitions/release/definitions/id" + } + }, + "required": [ + "release" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/release" + }, + "title": "Rollback" + } + ], + "properties": { + "addon_plan_names": { + "description": "add-on plans installed on the app for this release", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/plan/definitions/name" + } + }, + "artifacts": { + "description": "build artifacts for the release", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/release/definitions/artifact" + } + }, + "app": { + "description": "app involved in the release", + "properties": { + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "created_at": { + "$ref": "#/definitions/release/definitions/created_at" + }, + "description": { + "$ref": "#/definitions/release/definitions/description" + }, + "id": { + "$ref": "#/definitions/release/definitions/id" + }, + "updated_at": { + "$ref": "#/definitions/release/definitions/updated_at" + }, + "oci_image": { + "description": "OCI image running in this release", + "properties": { + "id": { + "$ref": "#/definitions/oci-image/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object", + "null" + ] + }, + "slug": { + "description": "slug running in this release. Not applicable to apps using Cloud Native Buildpacks.", + "properties": { + "id": { + "$ref": "#/definitions/slug/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object", + "null" + ] + }, + "status": { + "$ref": "#/definitions/release/definitions/status" + }, + "user": { + "description": "user that created the release", + "properties": { + "id": { + "$ref": "#/definitions/account/definitions/id" + }, + "email": { + "$ref": "#/definitions/account/definitions/email" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "version": { + "$ref": "#/definitions/release/definitions/version" + }, + "current": { + "$ref": "#/definitions/release/definitions/current" + }, + "output_stream_url": { + "$ref": "#/definitions/release/definitions/output_stream_url" + }, + "eligible_for_rollback": { + "$ref": "#/definitions/release/definitions/eligible_for_rollback" + } + } + }, + "review-app": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Review App", + "description": "An ephemeral app to review a set of changes", + "stability": "production", + "strictProperties": true, + "type": [ + "object" + ], + "definitions": { + "app_setup": { + "readOnly": true, + "type": [ + "null", + "object" + ] + }, + "branch": { + "description": "the branch of the repository which the review app is based on", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of the review app", + "readOnly": true, + "format": "uuid", + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/review-app/definitions/id" + } + ] + }, + "creator": { + "description": "The user who created the review app", + "readOnly": true, + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "unique identifier of a review app owner", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": false, + "type": [ + "string" + ] + } + } + }, + "created_at": { + "description": "when test run was created", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "source_blob": { + "description": "The download location for the review app's source code", + "properties": { + "url": { + "description": "URL where gzipped tar archive of source code for build was downloaded.", + "example": "https://example.com/source.tgz?token=xyz", + "readOnly": true, + "type": [ + "string" + ] + }, + "version": { + "description": "The version number (or SHA) of the code to build.", + "example": "v1.2.0", + "type": [ + "string", + "null" + ] + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "status": { + "description": "current state of the review app", + "enum": [ + "pending", + "creating", + "created", + "deleting", + "deleted", + "errored" + ], + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when review app was updated", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "wait_for_ci": { + "description": "wait for ci before building the app", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "error_status": { + "description": "error message from creating the review app if any", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "message": { + "description": "message from creating the review app if any", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "config_vars": { + "additionalProperties": false, + "description": "hash of config vars", + "example": { + "FOO": "bar", + "BAZ": "qux" + }, + "patternProperties": { + "^[\\w\\.\\:\\[\\]]+$": { + "type": [ + "string", + "null" + ] + } + }, + "type": [ + "object", + "null" + ] + }, + "fork_repo_id": { + "description": "repository id of the fork the branch resides in", + "example": "123456", + "readOnly": true, + "type": [ + "integer", + "null" + ] + }, + "pr_number": { + "description": "pull request number the review app is built for", + "example": 24, + "readOnly": true, + "type": [ + "integer", + "null" + ] + } + }, + "links": [ + { + "description": "Create a new review app", + "href": "/review-apps", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "branch": { + "$ref": "#/definitions/review-app/definitions/branch" + }, + "pr_number": { + "$ref": "#/definitions/review-app/definitions/pr_number" + }, + "pipeline": { + "$ref": "#/definitions/pipeline/definitions/id" + }, + "source_blob": { + "$ref": "#/definitions/review-app/definitions/source_blob" + }, + "environment": { + "$ref": "#/definitions/review-app/definitions/config_vars", + "description": "A set of key value pairs which will be put into the environment of the spawned review app process." + }, + "fork_repo_id": { + "$ref": "#/definitions/review-app/definitions/fork_repo_id" + } + }, + "required": [ + "branch", + "pipeline", + "source_blob" + ], + "type": [ + "object" + ] + }, + "title": "Create", + "targetSchema": { + "$ref": "#/definitions/review-app" + } + }, + { + "description": "Gets an existing review app", + "href": "/review-apps/{(%23%2Fdefinitions%2Freview-app%2Fdefinitions%2Fid)}", + "method": "GET", + "targetSchema": { + "$ref": "#/definitions/review-app" + }, + "title": "Get review app" + }, + { + "description": "Delete an existing review app", + "href": "/review-apps/{(%23%2Fdefinitions%2Freview-app%2Fdefinitions%2Fid)}", + "method": "DELETE", + "rel": "delete", + "targetSchema": { + "$ref": "#/definitions/review-app" + }, + "title": "Delete" + }, + { + "description": "Get a review app using the associated app_id", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/review-app", + "method": "GET", + "title": "Get review app by app_id", + "targetSchema": { + "$ref": "#/definitions/review-app" + } + }, + { + "description": "List review apps for a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/review-apps", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/review-app" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "app": { + "description": "the Heroku app associated to this review app", + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "type": [ + "null", + "object" + ] + }, + "app_setup": { + "description": "the app setup for this review app", + "properties": { + "id": { + "$ref": "#/definitions/app-setup/definitions/id" + } + }, + "type": [ + "null", + "object" + ] + }, + "branch": { + "$ref": "#/definitions/review-app/definitions/branch" + }, + "created_at": { + "$ref": "#/definitions/review-app/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/review-app/definitions/id" + }, + "pipeline": { + "description": "the pipeline which this review app belongs to", + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/id" + } + }, + "type": [ + "object" + ] + }, + "status": { + "$ref": "#/definitions/review-app/definitions/status" + }, + "updated_at": { + "$ref": "#/definitions/review-app/definitions/updated_at" + }, + "creator": { + "$ref": "#/definitions/review-app/definitions/creator" + }, + "wait_for_ci": { + "$ref": "#/definitions/review-app/definitions/wait_for_ci" + }, + "error_status": { + "$ref": "#/definitions/review-app/definitions/error_status" + }, + "message": { + "$ref": "#/definitions/review-app/definitions/message" + }, + "fork_repo": { + "properties": { + "id": { + "$ref": "#/definitions/review-app/definitions/fork_repo_id" + } + }, + "strictProperties": true, + "type": [ + "object", + "null" + ] + }, + "pr_number": { + "$ref": "#/definitions/review-app/definitions/pr_number" + } + } + }, + "review-app-config": { + "description": "Review apps can be configured for pipelines.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": false, + "title": "Heroku Platform API - Review App Configuration", + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "unique identifier of pipeline", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "repo": { + "description": "repository name", + "example": "heroku/homebrew-brew", + "readOnly": true, + "type": [ + "string" + ] + }, + "automatic_review_apps": { + "description": "enable automatic review apps for pull requests", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "repo_id": { + "description": "repository id", + "example": "123456", + "readOnly": true, + "type": [ + "integer" + ] + }, + "destroy_stale_apps": { + "description": "automatically destroy review apps when they haven't been deployed for a number of days", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "stale_days": { + "description": "number of days without a deployment after which to consider a review app stale", + "example": "5", + "readOnly": true, + "type": [ + "integer" + ] + }, + "wait_for_ci": { + "description": "If true, review apps are created only when CI passes", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "base_name": { + "description": "A unique prefix that will be used to create review app names", + "example": "singular-app", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "deploy_target": { + "description": "the deploy target for the review apps of a pipeline", + "definitions": { + "id": { + "description": "unique identifier of deploy target", + "example": "us", + "pattern": "(^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$|^[a-z]{2}$)", + "readOnly": true, + "type": [ + "string" + ] + }, + "type": { + "description": "type of deploy target", + "example": "region", + "pattern": "(^space$|^region$)", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [], + "properties": { + "id": { + "$ref": "#/definitions/review-app-config/definitions/deploy_target/definitions/id" + }, + "type": { + "$ref": "#/definitions/review-app-config/definitions/deploy_target/definitions/type" + } + }, + "required": [ + "id", + "type" + ], + "type": [ + "object", + "null" + ] + } + }, + "links": [ + { + "description": "Enable review apps for a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/review-app-config", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "repo": { + "$ref": "#/definitions/review-app-config/definitions/repo", + "description": "The full_name of the repository that you want enable review-apps from." + }, + "automatic_review_apps": { + "$ref": "#/definitions/review-app-config/definitions/automatic_review_apps", + "description": "If true, this will trigger the creation of review apps when pull-requests are opened in the repo." + }, + "destroy_stale_apps": { + "$ref": "#/definitions/review-app-config/definitions/destroy_stale_apps", + "description": "If true, this will trigger automatic deletion of review apps when they're stale" + }, + "stale_days": { + "$ref": "#/definitions/review-app-config/definitions/stale_days", + "description": "If destroy_stale_apps is true, then apps will be destroyed after this many days" + }, + "deploy_target": { + "$ref": "#/definitions/review-app-config/definitions/deploy_target", + "description": "Provides a key/value pair to specify whether to use a common runtime or a private space" + }, + "wait_for_ci": { + "$ref": "#/definitions/review-app-config/definitions/wait_for_ci", + "description": "If true, review apps will only be created when CI passes" + }, + "base_name": { + "$ref": "#/definitions/review-app-config/definitions/base_name", + "description": "A unique prefix that will be used to create review app names" + } + }, + "required": [ + "repo" + ], + "type": [ + "object" + ] + }, + "title": "Enable", + "targetSchema": { + "$ref": "#/definitions/review-app-config" + } + }, + { + "description": "Get review apps configuration for a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/review-app-config", + "method": "GET", + "rel": "self", + "title": "Info", + "targetSchema": { + "$ref": "#/definitions/review-app-config" + } + }, + { + "description": "Update review app configuration for a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/review-app-config", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "automatic_review_apps": { + "$ref": "#/definitions/review-app-config/definitions/automatic_review_apps", + "description": "If true, this will trigger the creation of review apps when pull-requests are opened in the repo" + }, + "destroy_stale_apps": { + "$ref": "#/definitions/review-app-config/definitions/destroy_stale_apps", + "description": "If true, this will trigger automatic deletion of review apps when they're stale" + }, + "stale_days": { + "$ref": "#/definitions/review-app-config/definitions/stale_days", + "description": "If destroy_stale_apps is true, then apps will be destroyed after this many days" + }, + "deploy_target": { + "$ref": "#/definitions/review-app-config/definitions/deploy_target", + "description": "Provides a key/value pair to specify whether to use a common runtime or a private space" + }, + "wait_for_ci": { + "$ref": "#/definitions/review-app-config/definitions/wait_for_ci", + "description": "If true, review apps will only be created when CI passes" + }, + "base_name": { + "$ref": "#/definitions/review-app-config/definitions/base_name", + "description": "A unique prefix that will be used to create review app names" + } + }, + "type": [ + "object" + ] + }, + "title": "Update", + "targetSchema": { + "$ref": "#/definitions/review-app-config" + } + }, + { + "description": "Disable review apps for a pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/review-app-config", + "method": "DELETE", + "rel": "destroy", + "title": "Delete", + "targetSchema": { + "$ref": "#/definitions/review-app-config" + } + } + ], + "properties": { + "repo": { + "properties": { + "id": { + "$ref": "#/definitions/review-app-config/definitions/repo_id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "automatic_review_apps": { + "$ref": "#/definitions/review-app-config/definitions/automatic_review_apps" + }, + "deploy_target": { + "$ref": "#/definitions/review-app-config/definitions/deploy_target" + }, + "destroy_stale_apps": { + "$ref": "#/definitions/review-app-config/definitions/destroy_stale_apps" + }, + "stale_days": { + "$ref": "#/definitions/review-app-config/definitions/stale_days" + }, + "pipeline_id": { + "$ref": "#/definitions/review-app-config/definitions/id" + }, + "wait_for_ci": { + "$ref": "#/definitions/review-app-config/definitions/wait_for_ci" + }, + "base_name": { + "$ref": "#/definitions/review-app-config/definitions/base_name" + } + } + }, + "slug": { + "description": "A slug is a snapshot of your application code that is ready to run on the platform.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Slug", + "type": [ + "object" + ], + "definitions": { + "buildpack_provided_description": { + "description": "description from buildpack of slug", + "example": "Ruby/Rack", + "readOnly": false, + "type": [ + "null", + "string" + ] + }, + "checksum": { + "description": "an optional checksum of the slug for verifying its integrity", + "example": "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "commit": { + "description": "identification of the code with your version control system (eg: SHA of the git HEAD)", + "example": "60883d9e8947a57e04dc9124f25df004866a2051", + "readOnly": false, + "type": [ + "null", + "string" + ] + }, + "commit_description": { + "description": "an optional description of the provided commit", + "example": "fixed a bug with API documentation", + "readOnly": false, + "type": [ + "null", + "string" + ] + }, + "created_at": { + "description": "when slug was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of slug", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/slug/definitions/id" + } + ] + }, + "method": { + "description": "method to be used to interact with the slug blob", + "example": "GET", + "readOnly": true, + "type": [ + "string" + ] + }, + "process_types": { + "additionalProperties": false, + "description": "hash mapping process type names to their respective command", + "example": { + "web": "./bin/web -p $PORT" + }, + "patternProperties": { + "^[-\\w]{1,128}$": { + "type": [ + "string" + ] + } + }, + "readOnly": false, + "type": [ + "object" + ] + }, + "size": { + "default": null, + "description": "size of slug, in bytes", + "example": 2048, + "readOnly": true, + "type": [ + "integer", + "null" + ] + }, + "updated_at": { + "description": "when slug was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "url": { + "description": "URL to interact with the slug blob", + "example": "https://api.heroku.com/slugs/1234.tgz", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Info for existing slug.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/slugs/{(%23%2Fdefinitions%2Fslug%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/slug" + }, + "title": "Info" + }, + { + "description": "Create a new slug. For more information please refer to [Deploying Slugs using the Platform API](https://devcenter.heroku.com/articles/platform-api-deploying-slugs).", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/slugs", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "buildpack_provided_description": { + "$ref": "#/definitions/slug/definitions/buildpack_provided_description" + }, + "checksum": { + "$ref": "#/definitions/slug/definitions/checksum" + }, + "commit": { + "$ref": "#/definitions/slug/definitions/commit" + }, + "commit_description": { + "$ref": "#/definitions/slug/definitions/commit_description" + }, + "process_types": { + "$ref": "#/definitions/slug/definitions/process_types" + }, + "stack": { + "$ref": "#/definitions/stack/definitions/identity" + } + }, + "required": [ + "process_types" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/slug", + "example": { + "blob": { + "method": "PUT", + "url": "https://api.heroku.com/slugs/1234.tgz" + }, + "buildpack_provided_description": "Ruby/Rack", + "checksum": "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "commit": "60883d9e8947a57e04dc9124f25df004866a2051", + "commit_description": "fixed a bug with API documentation", + "created_at": "2012-01-01T12:00:00Z", + "id": "01234567-89ab-cdef-0123-456789abcdef", + "process_types": { + "web": "./bin/web -p $PORT" + }, + "size": 2048, + "stack": { + "id": "01234567-89ab-cdef-0123-456789abcdef", + "name": "heroku-18" + }, + "updated_at": "2012-01-01T12:00:00Z" + } + }, + "title": "Create" + } + ], + "properties": { + "blob": { + "description": "pointer to the url where clients can fetch or store the actual release binary", + "properties": { + "method": { + "$ref": "#/definitions/slug/definitions/method" + }, + "url": { + "$ref": "#/definitions/slug/definitions/url" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "buildpack_provided_description": { + "$ref": "#/definitions/slug/definitions/buildpack_provided_description" + }, + "checksum": { + "$ref": "#/definitions/slug/definitions/checksum" + }, + "commit": { + "$ref": "#/definitions/slug/definitions/commit" + }, + "commit_description": { + "$ref": "#/definitions/slug/definitions/commit_description" + }, + "created_at": { + "$ref": "#/definitions/slug/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/slug/definitions/id" + }, + "process_types": { + "$ref": "#/definitions/slug/definitions/process_types" + }, + "size": { + "$ref": "#/definitions/slug/definitions/size" + }, + "stack": { + "description": "identity of slug stack", + "properties": { + "id": { + "$ref": "#/definitions/stack/definitions/id" + }, + "name": { + "$ref": "#/definitions/stack/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "updated_at": { + "$ref": "#/definitions/slug/definitions/updated_at" + } + } + }, + "sms-number": { + "description": "SMS numbers are used for recovery on accounts with two-factor authentication enabled.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - SMS Number", + "type": [ + "object" + ], + "definitions": { + "sms_number": { + "$ref": "#/definitions/account/definitions/sms_number" + } + }, + "links": [ + { + "description": "Recover an account using an SMS recovery code", + "href": "/users/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}/sms-number", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/sms-number" + }, + "title": "SMS Number" + }, + { + "description": "Recover an account using an SMS recovery code", + "href": "/users/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}/sms-number/actions/recover", + "method": "POST", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/sms-number" + }, + "title": "Recover" + }, + { + "description": "Confirm an SMS number change with a confirmation code", + "href": "/users/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}/sms-number/actions/confirm", + "method": "POST", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/sms-number" + }, + "title": "Confirm" + } + ], + "properties": { + "sms_number": { + "$ref": "#/definitions/account/definitions/sms_number" + } + } + }, + "sni-endpoint": { + "description": "SNI Endpoint is a public address serving a custom SSL cert for HTTPS traffic, using the SNI TLS extension, to a Heroku app.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Heroku Platform API - SNI Endpoint", + "stability": "development", + "strictProperties": true, + "type": [ + "object" + ], + "definitions": { + "ca_signed?": { + "readOnly": true, + "type": [ + "boolean" + ] + }, + "cert_domains": { + "readOnly": true, + "type": [ + "array" + ] + }, + "certificate_chain": { + "description": "raw contents of the public certificate chain (eg: .crt or .pem file)", + "example": "-----BEGIN CERTIFICATE----- ...", + "readOnly": false, + "type": [ + "string" + ] + }, + "created_at": { + "description": "when endpoint was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "domains": { + "description": "domains associated with this SSL certificate", + "type": [ + "array" ], + "readOnly": true, + "items": { + "$ref": "#/definitions/domain/definitions/id" + } + }, + "display_name": { + "description": "unique name for SSL certificate", + "example": "example", + "pattern": "^[a-z][a-z0-9-]{2,29}$", + "readOnly": false, + "type": [ + "string", + "null" + ] + }, + "expires_at": { + "readOnly": true, + "format": "date-time", + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of this SNI endpoint", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/sni-endpoint/definitions/id" + }, + { + "$ref": "#/definitions/sni-endpoint/definitions/name" + } + ] + }, + "issuer": { + "readOnly": true, + "type": [ + "string" + ] + }, + "name": { + "description": "unique name for SNI endpoint", + "example": "example", + "pattern": "^[a-z][a-z0-9-]{2,29}$", + "readOnly": true, + "type": [ + "string" + ] + }, + "private_key": { + "description": "contents of the private key (eg .key file)", + "example": "-----BEGIN RSA PRIVATE KEY----- ...", + "readOnly": false, + "type": [ + "string" + ] + }, + "self_signed?": { + "readOnly": true, + "type": [ + "boolean" + ] + }, + "starts_at": { + "readOnly": true, + "format": "date-time", + "type": [ + "string" + ] + }, + "subject": { + "readOnly": true, "type": [ "string" ] }, "updated_at": { - "description": "when promotion was updated", + "description": "when SNI endpoint was updated", "example": "2012-01-01T12:00:00Z", "format": "date-time", + "readOnly": true, "type": [ - "string", - "null" + "string" ] } }, "links": [ { - "description": "Create a new promotion.", - "href": "/pipeline-promotions", + "description": "Create a new SNI endpoint.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sni-endpoints", "method": "POST", "rel": "create", "schema": { "properties": { - "pipeline": { - "description": "pipeline involved in the promotion", - "properties": { - "id": { - "$ref": "#/definitions/pipeline/definitions/id" - } - }, - "required": [ - "id" - ], - "type": [ - "object" - ] - }, - "source": { - "description": "the app being promoted from", - "properties": { - "app": { - "description": "the app which was promoted from", - "properties": { - "id": { - "$ref": "#/definitions/app/definitions/id" - } - }, - "strictProperties": true, - "type": [ - "object" - ] - } - }, - "type": [ - "object" - ] + "certificate_chain": { + "$ref": "#/definitions/sni-endpoint/definitions/certificate_chain" }, - "targets": { - "items": { - "properties": { - "app": { - "description": "the app is being promoted to", - "properties": { - "id": { - "$ref": "#/definitions/app/definitions/id" - } - }, - "strictProperties": true, - "type": [ - "object" - ] - } - }, - "type": [ - "object" - ] - }, - "type": [ - "array" - ] + "private_key": { + "$ref": "#/definitions/sni-endpoint/definitions/private_key" } }, "required": [ - "pipeline", - "source", - "targets" + "certificate_chain", + "private_key" ], "type": [ "object" ] }, "targetSchema": { - "$ref": "#/definitions/pipeline-promotion" + "$ref": "#/definitions/sni-endpoint" }, "title": "Create" }, { - "description": "Info for existing pipeline promotion.", - "href": "/pipeline-promotions/{(%23%2Fdefinitions%2Fpipeline-promotion%2Fdefinitions%2Fidentity)}", + "description": "Delete existing SNI endpoint.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sni-endpoints/{(%23%2Fdefinitions%2Fsni-endpoint%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/sni-endpoint" + }, + "title": "Delete" + }, + { + "description": "Info for existing SNI endpoint.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sni-endpoints/{(%23%2Fdefinitions%2Fsni-endpoint%2Fdefinitions%2Fidentity)}", "method": "GET", "rel": "self", "targetSchema": { - "$ref": "#/definitions/pipeline-promotion" + "$ref": "#/definitions/sni-endpoint" }, "title": "Info" - } - ], - "properties": { - "created_at": { - "$ref": "#/definitions/pipeline-promotion/definitions/created_at" - }, - "id": { - "$ref": "#/definitions/pipeline-promotion/definitions/id" - }, - "pipeline": { - "description": "the pipeline which the promotion belongs to", - "properties": { - "id": { - "$ref": "#/definitions/pipeline/definitions/id" - } - }, - "strictProperties": true, - "type": [ - "object" - ] - }, - "source": { - "description": "the app being promoted from", - "properties": { - "app": { - "description": "the app which was promoted from", - "properties": { - "id": { - "$ref": "#/definitions/app/definitions/id" - } - }, - "strictProperties": true, - "type": [ - "object" - ] - }, - "release": { - "description": "the release used to promoted from", - "properties": { - "id": { - "$ref": "#/definitions/release/definitions/id" - } - }, - "type": [ - "object" - ] - } - }, - "strictProperties": true, - "type": [ - "object" - ] - }, - "status": { - "$ref": "#/definitions/pipeline-promotion/definitions/status" }, - "updated_at": { - "$ref": "#/definitions/pipeline-promotion/definitions/updated_at" - } - } - }, - "pipeline-release": { - "description": "Information about latest releases of apps in a pipeline.", - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", - "strictProperties": true, - "title": "Heroku Platform API - Pipeline Release", - "type": [ - "object" - ], - "definitions": { - }, - "links": [ { - "description": "List latest releases for each app in a pipeline", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/latest-releases", + "description": "List existing SNI endpoints.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sni-endpoints", "method": "GET", "rel": "instances", "targetSchema": { "items": { - "$ref": "#/definitions/release" + "$ref": "#/definitions/sni-endpoint" }, "type": [ "array" ] }, "title": "List" - } - ] - }, - "pipeline-stack": { - "description": "A pipeline's stack is determined by the apps in the pipeline. This is used during creation of CI and Review Apps that have no stack defined in app.json", - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", - "strictProperties": false, - "title": "Heroku Platform API - Pipeline Stack", - "type": [ - "object" - ], - "links": [ + }, { - "description": "The stack for a given pipeline, used for CI and Review Apps that have no stack defined in app.json.", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/pipeline-stack", - "method": "GET", - "rel": "self", + "description": "Update an existing SNI endpoint.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sni-endpoints/{(%23%2Fdefinitions%2Fsni-endpoint%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "certificate_chain": { + "$ref": "#/definitions/sni-endpoint/definitions/certificate_chain" + }, + "private_key": { + "$ref": "#/definitions/sni-endpoint/definitions/private_key" + } + }, + "required": [ + "certificate_chain", + "private_key" + ], + "type": [ + "object" + ] + }, "targetSchema": { - "$ref": "#/definitions/pipeline-stack" + "$ref": "#/definitions/sni-endpoint" }, - "title": "Default Stack" + "title": "Update" } ], "properties": { - "stack": { - "description": "identity of the stack that will be used for new builds without a stack defined in CI and Review Apps", + "certificate_chain": { + "$ref": "#/definitions/sni-endpoint/definitions/certificate_chain" + }, + "created_at": { + "$ref": "#/definitions/sni-endpoint/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/sni-endpoint/definitions/id" + }, + "name": { + "$ref": "#/definitions/sni-endpoint/definitions/name" + }, + "updated_at": { + "$ref": "#/definitions/sni-endpoint/definitions/updated_at" + }, + "display_name": { + "$ref": "#/definitions/sni-endpoint/definitions/display_name" + }, + "domains": { + "$ref": "#/definitions/sni-endpoint/definitions/domains" + }, + "app": { + "description": "application that this SSL certificate is on", "properties": { "id": { - "$ref": "#/definitions/stack/definitions/id" + "$ref": "#/definitions/app/definitions/id" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "ssl_cert": { + "description": "certificate provided by this endpoint", + "type": [ + "object" + ], + "properties": { + "ca_signed?": { + "$ref": "#/definitions/sni-endpoint/definitions/ca_signed?" }, - "name": { - "$ref": "#/definitions/stack/definitions/name" + "cert_domains": { + "$ref": "#/definitions/sni-endpoint/definitions/cert_domains" + }, + "expires_at": { + "$ref": "#/definitions/sni-endpoint/definitions/expires_at" + }, + "issuer": { + "$ref": "#/definitions/sni-endpoint/definitions/issuer" + }, + "self_signed?": { + "$ref": "#/definitions/sni-endpoint/definitions/self_signed?" + }, + "starts_at": { + "$ref": "#/definitions/sni-endpoint/definitions/starts_at" + }, + "subject": { + "$ref": "#/definitions/sni-endpoint/definitions/subject" + }, + "id": { + "description": "unique identifier of this SSL certificate", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] } - }, - "strictProperties": true, - "type": [ - "object", - "null" - ] + } } } }, - "pipeline-transfer": { - "description": "A pipeline transfer is the process of changing pipeline ownership along with the contained apps.", + "source": { + "description": "A source is a location for uploading and downloading an application's source code.", "$schema": "http://json-schema.org/draft-04/hyper-schema", "stability": "production", - "strictProperties": false, - "title": "Heroku Platform API - Pipeline Transfer", + "strictProperties": true, + "title": "Heroku Platform API - Source", "type": [ "object" ], "definitions": { - "new_owner": { - "description": "New owner of the pipeline.", - "$ref": "#/definitions/pipeline/definitions/owner", + "get_url": { + "description": "URL to download the source", + "example": "https://api.heroku.com/sources/1234.tgz", + "readOnly": true, "type": [ - "object" + "string" ] }, - "previous_owner": { - "description": "Previous owner of the pipeline.", - "$ref": "#/definitions/pipeline/definitions/owner", + "put_url": { + "description": "URL to upload the source", + "example": "https://api.heroku.com/sources/1234.tgz", + "readOnly": true, "type": [ - "object" + "string" ] } }, "links": [ { - "description": "Create a new pipeline transfer.", - "href": "/pipeline-transfers", + "description": "Create URLs for uploading and downloading source.", + "href": "/sources", "method": "POST", "rel": "create", - "schema": { - "properties": { - "pipeline": { - "description": "The pipeline to transfer", - "properties": { - "id": { - "$ref": "#/definitions/pipeline/definitions/id" - } - }, - "type": [ - "object" - ] - }, - "new_owner": { - "description": "New pipeline owner", - "properties": { - "id": { - "description": "unique identifier of a pipeline owner", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", - "type": [ - "string" - ] - }, - "type": { - "description": "type of pipeline owner", - "example": "team", - "pattern": "(^team$|^user$)", - "type": [ - "string" - ] - } - }, - "type": [ - "object" - ] - } - }, - "required": [ - "pipeline", - "new_owner" - ], - "type": [ - "object" - ] - }, "targetSchema": { - "$ref": "#/definitions/pipeline-transfer" + "$ref": "#/definitions/source" }, "title": "Create" + }, + { + "deactivate_on": "2017-08-01", + "description": "Create URLs for uploading and downloading source. Deprecated in favor of `POST /sources`", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sources", + "method": "POST", + "rel": "create", + "targetSchema": { + "$ref": "#/definitions/source" + }, + "title": "Create - Deprecated" } ], "properties": { - "pipeline": { - "description": "pipeline being transferred", + "source_blob": { + "description": "pointer to the URL where clients can fetch or store the source", "properties": { - "id": { - "$ref": "#/definitions/pipeline/definitions/id" + "get_url": { + "$ref": "#/definitions/source/definitions/get_url" + }, + "put_url": { + "$ref": "#/definitions/source/definitions/put_url" } }, + "strictProperties": true, "type": [ "object" ] - }, - "previous_owner": { - "$ref": "#/definitions/pipeline-transfer/definitions/previous_owner" - }, - "new_owner": { - "$ref": "#/definitions/pipeline-transfer/definitions/new_owner" } } }, - "pipeline": { - "description": "A pipeline allows grouping of apps into different stages.", + "space-app-access": { + "description": "Space access represents the permissions a particular user has on a particular space.", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", - "strictProperties": false, - "title": "Heroku Platform API - Pipeline", + "stability": "prototype", + "title": "Heroku Platform API - Space Access", "type": [ "object" ], "definitions": { - "created_at": { - "description": "when pipeline was created", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", - "readOnly": true, - "type": [ - "string" - ] - }, "id": { - "description": "unique identifier of pipeline", + "description": "unique identifier of the space a user has permissions on", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -10649,153 +14538,67 @@ "identity": { "anyOf": [ { - "$ref": "#/definitions/pipeline/definitions/id" - }, - { - "$ref": "#/definitions/pipeline/definitions/name" - } - ] - }, - "name": { - "description": "name of pipeline", - "example": "example", - "pattern": "^[a-z][a-z0-9-]{2,29}$", - "readOnly": false, - "type": [ - "string" - ] - }, - "owner": { - "description": "Owner of a pipeline.", - "definitions": { - "id": { - "description": "unique identifier of a pipeline owner", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", - "readOnly": false, - "type": [ - "string" - ] - }, - "type": { - "description": "type of pipeline owner", - "example": "team", - "pattern": "(^team$|^user$)", - "readOnly": false, - "type": [ - "string" - ] - } - }, - "links": [ - ], - "properties": { - "id": { - "$ref": "#/definitions/pipeline/definitions/owner/definitions/id" - }, - "type": { - "$ref": "#/definitions/pipeline/definitions/owner/definitions/type" + "$ref": "#/definitions/space-app-access/definitions/id" } - }, - "required": [ - "id", - "type" - ], - "type": [ - "object", - "null" - ] - }, - "updated_at": { - "description": "when pipeline was updated", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", - "readOnly": true, - "type": [ - "string" ] } }, "links": [ { - "description": "Create a new pipeline.", - "href": "/pipelines", - "method": "POST", - "rel": "create", - "schema": { - "properties": { - "name": { - "$ref": "#/definitions/pipeline/definitions/name" - }, - "owner": { - "description": "Pipeline owner", - "$ref": "#/definitions/pipeline/definitions/owner", - "type": [ - "object", - "null" - ] - } - }, - "required": [ - "name" - ], - "type": [ - "object" - ] - }, - "targetSchema": { - "$ref": "#/definitions/pipeline" - }, - "title": "Create" - }, - { - "description": "Info for existing pipeline.", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fidentity)}", + "description": "List permissions for a given user on a given space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/members/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}", "method": "GET", "rel": "self", "targetSchema": { - "$ref": "#/definitions/pipeline" + "$ref": "#/definitions/space-app-access" }, "title": "Info" }, { - "description": "Delete an existing pipeline.", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}", - "method": "DELETE", - "rel": "delete", - "targetSchema": { - "$ref": "#/definitions/pipeline" - }, - "title": "Delete" - }, - { - "description": "Update an existing pipeline.", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}", + "description": "Update an existing user's set of permissions on a space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/members/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}", "method": "PATCH", "rel": "update", "schema": { - "properties": { - "name": { - "$ref": "#/definitions/pipeline/definitions/name" - } - }, "type": [ "object" - ] + ], + "required": [ + "permissions" + ], + "properties": { + "permissions": { + "type": [ + "array" + ], + "items": { + "type": [ + "object" + ], + "properties": { + "name": { + "type": [ + "string" + ] + } + } + } + } + } }, "targetSchema": { - "$ref": "#/definitions/pipeline" + "$ref": "#/definitions/space-app-access" }, "title": "Update" }, { - "description": "List existing pipelines.", - "href": "/pipelines", + "description": "List all users and their permissions on a space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/members", "method": "GET", "rel": "instances", "targetSchema": { "items": { - "$ref": "#/definitions/pipeline" + "$ref": "#/definitions/space-app-access" }, "type": [ "array" @@ -10805,35 +14608,82 @@ } ], "properties": { + "space": { + "description": "space user belongs to", + "properties": { + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, "created_at": { - "$ref": "#/definitions/pipeline/definitions/created_at" + "$ref": "#/definitions/space/definitions/created_at" }, "id": { - "$ref": "#/definitions/pipeline/definitions/id" - }, - "name": { - "$ref": "#/definitions/pipeline/definitions/name" + "$ref": "#/definitions/space/definitions/id" }, - "owner": { - "$ref": "#/definitions/pipeline/definitions/owner" + "permissions": { + "description": "user space permissions", + "type": [ + "array" + ], + "items": { + "type": [ + "object" + ], + "properties": { + "description": { + "type": [ + "string" + ] + }, + "name": { + "type": [ + "string" + ] + } + } + } }, "updated_at": { - "$ref": "#/definitions/pipeline/definitions/updated_at" + "$ref": "#/definitions/space/definitions/updated_at" + }, + "user": { + "description": "identity of user account", + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] } } }, - "plan": { - "description": "Plans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication.", + "space-nat": { + "description": "Network address translation (NAT) for stable outbound IP addresses from a space", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", + "stability": "prototype", "strictProperties": true, - "title": "Heroku Platform API - Plan", + "title": "Heroku Platform API - Space Network Address Translation", "type": [ "object" ], "definitions": { "created_at": { - "description": "when plan was created", + "description": "when network address translation for a space was created", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, @@ -10841,328 +14691,255 @@ "string" ] }, - "compliance": { - "description": "the compliance regimes applied to an add-on plan", - "example": [ - "HIPAA" - ], - "readOnly": false, - "type": [ - "null", - "array" - ], - "items": { - "$ref": "#/definitions/plan/definitions/regime" - } - }, - "default": { - "description": "whether this plan is the default for its add-on service", - "example": false, - "readOnly": true, - "type": [ - "boolean" - ] - }, - "description": { - "description": "description of plan", - "example": "Heroku Postgres Dev", - "readOnly": true, - "type": [ - "string" - ] - }, - "human_name": { - "description": "human readable name of the add-on plan", - "example": "Dev", - "readOnly": true, - "type": [ - "string" - ] - }, - "id": { - "description": "unique identifier of this plan", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", - "readOnly": true, - "type": [ - "string" - ] - }, - "installable_inside_private_network": { - "description": "whether this plan is installable to a Private Spaces app", - "example": false, - "readOnly": true, - "type": [ - "boolean" - ] - }, - "installable_outside_private_network": { - "description": "whether this plan is installable to a Common Runtime app", - "example": true, - "readOnly": true, - "type": [ - "boolean" - ] - }, - "identity": { - "anyOf": [ - { - "$ref": "#/definitions/plan/definitions/id" - }, - { - "$ref": "#/definitions/plan/definitions/name" - } - ] - }, - "name": { - "description": "unique name of this plan", - "example": "heroku-postgresql:dev", - "readOnly": true, + "ip_v4_address": { + "example": "123.123.123.123", + "format": "ipv4", + "pattern": "^(([01]?\\d?\\d|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d?\\d|2[0-4]\\d|25[0-5])$", "type": [ "string" ] }, - "regime": { - "description": "compliance requirements an add-on plan must adhere to", + "sources": { + "description": "potential IPs from which outbound network traffic will originate", "readOnly": true, - "example": "HIPAA", "type": [ - "string" + "array" ], - "enum": [ - "HIPAA", - "PCI" - ] - }, - "cents": { - "description": "price in cents per unit of plan", - "example": 0, - "readOnly": true, - "type": [ - "integer" - ] - }, - "contract": { - "description": "price is negotiated in a contract outside of monthly add-on billing", - "example": false, - "readOnly": true, - "type": [ - "boolean" - ] - }, - "unit": { - "description": "unit of price for plan", - "example": "month", - "readOnly": true, - "type": [ - "string" - ] - }, - "space_default": { - "description": "whether this plan is the default for apps in Private Spaces", - "example": false, - "readOnly": true, - "type": [ - "boolean" - ] + "items": { + "$ref": "#/definitions/space-nat/definitions/ip_v4_address" + } }, "state": { - "description": "release status for plan", - "example": "public", + "description": "availability of network address translation for a space", + "enum": [ + "disabled", + "updating", + "enabled" + ], + "example": "enabled", "readOnly": true, "type": [ "string" ] }, "updated_at": { - "description": "when plan was updated", + "description": "when network address translation for a space was updated", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, "type": [ "string" ] - }, - "visible": { - "description": "whether this plan is publicly visible", - "example": true, - "readOnly": true, - "type": [ - "boolean" - ] } }, "links": [ { - "description": "Info for existing plan.", - "href": "/plans/{(%23%2Fdefinitions%2Fplan%2Fdefinitions%2Fidentity)}", + "description": "Current state of network address translation for a space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/nat", "method": "GET", "rel": "self", "targetSchema": { - "$ref": "#/definitions/plan" + "$ref": "#/definitions/space-nat" }, "title": "Info" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/space-nat/definitions/created_at" }, - { - "description": "Info for existing plan by Add-on.", - "href": "/addon-services/{(%23%2Fdefinitions%2Fadd-on-service%2Fdefinitions%2Fidentity)}/plans/{(%23%2Fdefinitions%2Fplan%2Fdefinitions%2Fidentity)}", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/plan" - }, - "title": "Info By Add-on" + "sources": { + "$ref": "#/definitions/space-nat/definitions/sources" }, - { - "description": "List existing plans by Add-on.", - "href": "/addon-services/{(%23%2Fdefinitions%2Fadd-on-service%2Fdefinitions%2Fidentity)}/plans", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/plan" - }, - "type": [ - "array" - ] - }, - "title": "List By Add-on" + "state": { + "$ref": "#/definitions/space-nat/definitions/state" + }, + "updated_at": { + "$ref": "#/definitions/space-nat/definitions/updated_at" } + } + }, + "space-topology": { + "description": "Space Topology provides you with a mechanism for viewing all the running dynos, formations and applications for a space. This is the same data thats used to power our DNS Service Discovery.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Space Topology", + "type": [ + "object" ], - "properties": { - "addon_service": { - "description": "identity of add-on service", + "definitions": { + "version": { + "description": "version of the space topology payload", + "example": 1, + "readOnly": true, + "type": [ + "integer" + ] + }, + "dyno": { + "description": "A dyno", "properties": { "id": { - "$ref": "#/definitions/add-on-service/definitions/id" + "$ref": "#/definitions/dyno/definitions/id" }, - "name": { - "$ref": "#/definitions/add-on-service/definitions/name" + "number": { + "description": "process number, e.g. 1 in web.1", + "example": 1, + "type": [ + "integer" + ] + }, + "private_ip": { + "description": "RFC1918 Address of Dyno", + "example": "10.0.134.42", + "type": [ + "string" + ] + }, + "hostname": { + "description": "localspace hostname of resource", + "example": "1.example-app-90210.app.localspace", + "type": [ + "string" + ] } }, - "strictProperties": true, "type": [ "object" ] }, - "created_at": { - "$ref": "#/definitions/plan/definitions/created_at" - }, - "compliance": { - "$ref": "#/definitions/plan/definitions/compliance" - }, - "default": { - "$ref": "#/definitions/plan/definitions/default" - }, - "description": { - "$ref": "#/definitions/plan/definitions/description" - }, - "human_name": { - "$ref": "#/definitions/plan/definitions/human_name" - }, - "id": { - "$ref": "#/definitions/plan/definitions/id" - }, - "installable_inside_private_network": { - "$ref": "#/definitions/plan/definitions/installable_inside_private_network" - }, - "installable_outside_private_network": { - "$ref": "#/definitions/plan/definitions/installable_outside_private_network" - }, - "name": { - "$ref": "#/definitions/plan/definitions/name" - }, - "price": { - "description": "price", + "formation": { + "description": "formations for application", "properties": { - "cents": { - "$ref": "#/definitions/plan/definitions/cents" + "id": { + "$ref": "#/definitions/formation/definitions/id" }, - "contract": { - "$ref": "#/definitions/plan/definitions/contract" + "process_type": { + "description": "Name of process type", + "example": "web", + "type": [ + "string" + ] }, - "unit": { - "$ref": "#/definitions/plan/definitions/unit" + "dynos": { + "description": "Current dynos for application", + "items": { + "$ref": "#/definitions/space-topology/definitions/dyno" + }, + "type": [ + "array" + ] } }, - "strictProperties": true, "type": [ "object" ] + } + }, + "links": [ + { + "description": "Current space topology", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/topology", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/space-topology" + }, + "title": "Topology" + } + ], + "properties": { + "version": { + "$ref": "#/definitions/space-topology/definitions/version" }, - "space_default": { - "$ref": "#/definitions/plan/definitions/space_default" - }, - "state": { - "$ref": "#/definitions/plan/definitions/state" - }, - "updated_at": { - "$ref": "#/definitions/plan/definitions/updated_at" - }, - "visible": { - "$ref": "#/definitions/plan/definitions/visible" + "apps": { + "description": "The apps within this space", + "type": [ + "array" + ], + "readOnly": true, + "items": { + "type": [ + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id", + "readOnly": true + }, + "domains": { + "example": [ + "example.com", + "example.net" + ], + "readOnly": true, + "type": [ + "array" + ] + }, + "formation": { + "description": "formations for application", + "items": { + "$ref": "#/definitions/space-topology/definitions/formation" + }, + "type": [ + "array" + ], + "readOnly": true + } + } + } } } }, - "rate-limit": { - "description": "Rate Limit represents the number of request tokens each account holds. Requests to this endpoint do not count towards the rate limit.", + "space-transfer": { + "description": "Transfer spaces between enterprise teams with the same Enterprise Account.", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", + "stability": "development", "strictProperties": true, - "title": "Heroku Platform API - Rate Limit", + "title": "Heroku Platform API - Space Transfer", "type": [ "object" ], - "definitions": { - "identity": { - }, - "remaining": { - "description": "allowed requests remaining in current interval", - "example": 2399, - "readOnly": true, - "type": [ - "integer" - ] - } - }, "links": [ { - "description": "Info for rate limits.", - "href": "/account/rate-limits", - "method": "GET", - "rel": "self", + "description": "Transfer space between enterprise teams", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/transfer", + "method": "POST", + "rel": "transfer", + "schema": { + "properties": { + "new_owner": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "required": [ + "new_owner" + ], + "type": [ + "object" + ] + }, "targetSchema": { - "$ref": "#/definitions/rate-limit" + "$ref": "#/definitions/space" }, - "title": "Info" - } - ], - "properties": { - "remaining": { - "$ref": "#/definitions/rate-limit/definitions/remaining" + "title": "transfer" } - } + ] }, - "region": { - "description": "A region represents a geographic location in which your application may run.", + "space": { + "description": "A space is an isolated, highly available, secure app execution environment.", "$schema": "http://json-schema.org/draft-04/hyper-schema", "stability": "production", "strictProperties": true, - "title": "Heroku Platform API - Region", + "title": "Heroku Platform API - Space", "type": [ "object" ], "definitions": { - "country": { - "description": "country where the region exists", - "example": "United States", - "readOnly": true, - "type": [ - "string" - ] - }, "created_at": { - "description": "when region was created", + "description": "when space was created", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, @@ -11170,16 +14947,8 @@ "string" ] }, - "description": { - "description": "description of region", - "example": "United States", - "readOnly": true, - "type": [ - "string" - ] - }, "id": { - "description": "unique identifier of region", + "description": "unique identifier of space", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -11190,156 +14959,45 @@ "identity": { "anyOf": [ { - "$ref": "#/definitions/region/definitions/id" + "$ref": "#/definitions/space/definitions/id" }, { - "$ref": "#/definitions/region/definitions/name" + "$ref": "#/definitions/space/definitions/name" } ] }, - "locale": { - "description": "area in the country where the region exists", - "example": "Virginia", - "readOnly": true, - "type": [ - "string" - ] - }, "name": { - "description": "unique name of region", - "example": "us", - "readOnly": true, + "description": "unique name of space", + "example": "nasa", + "readOnly": false, + "pattern": "^[a-z0-9](?:[a-z0-9]|-(?!-))+[a-z0-9]$", "type": [ "string" ] }, - "private_capable": { - "description": "whether or not region is available for creating a Private Space", - "example": false, + "shield": { + "description": "true if this space has shield enabled", "readOnly": true, + "example": true, "type": [ "boolean" ] }, - "provider": { - "description": "provider of underlying substrate", - "type": [ - "object" + "state": { + "description": "availability of this space", + "enum": [ + "allocating", + "allocated", + "deleting" ], - "properties": { - "name": { - "description": "name of provider", - "example": "amazon-web-services", - "readOnly": true, - "type": [ - "string" - ] - }, - "region": { - "description": "region name used by provider", - "example": "us-east-1", - "readOnly": true, - "type": [ - "string" - ], - "enum": [ - "ap-south-1", - "eu-west-1", - "ap-southeast-1", - "ap-southeast-2", - "eu-central-1", - "eu-west-2", - "ap-northeast-2", - "ap-northeast-1", - "us-east-1", - "sa-east-1", - "us-west-1", - "us-west-2", - "ca-central-1" - ] - } - }, - "readOnly": true - }, - "updated_at": { - "description": "when region was updated", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "example": "allocated", "readOnly": true, "type": [ "string" ] - } - }, - "links": [ - { - "description": "Info for existing region.", - "href": "/regions/{(%23%2Fdefinitions%2Fregion%2Fdefinitions%2Fidentity)}", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/region" - }, - "title": "Info" - }, - { - "description": "List existing regions.", - "href": "/regions", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/region" - }, - "type": [ - "array" - ] - }, - "title": "List" - } - ], - "properties": { - "country": { - "$ref": "#/definitions/region/definitions/country" - }, - "created_at": { - "$ref": "#/definitions/region/definitions/created_at" - }, - "description": { - "$ref": "#/definitions/region/definitions/description" - }, - "id": { - "$ref": "#/definitions/region/definitions/id" - }, - "locale": { - "$ref": "#/definitions/region/definitions/locale" - }, - "name": { - "$ref": "#/definitions/region/definitions/name" - }, - "private_capable": { - "$ref": "#/definitions/region/definitions/private_capable" - }, - "provider": { - "$ref": "#/definitions/region/definitions/provider" }, "updated_at": { - "$ref": "#/definitions/region/definitions/updated_at" - } - } - }, - "release": { - "description": "A release represents a combination of code, config vars and add-ons for an app on Heroku.", - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", - "strictProperties": true, - "title": "Heroku Platform API - Release", - "type": [ - "object" - ], - "definitions": { - "created_at": { - "description": "when release was created", + "description": "when space was updated", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, @@ -11347,100 +15005,73 @@ "string" ] }, - "description": { - "description": "description of changes in this release", - "example": "Added new feature", - "readOnly": true, + "log_drain_url": { + "description": "URL to which all apps will drain logs. Only settable during space creation and enables direct logging. Must use HTTPS.", + "example": "https://example.com/logs", "type": [ "string" ] }, - "status": { - "description": "current status of the release", - "enum": [ - "failed", - "pending", - "succeeded" - ], - "example": "succeeded", - "readOnly": true, + "cidr": { + "description": "The RFC-1918 CIDR the Private Space will use. It must be a /16 in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16", + "example": "172.20.20.30/16", + "default": "10.0.0.0/16", + "pattern": "^((?:10|172\\.(?:1[6-9]|2[0-9]|3[01])|192\\.168)\\..*.+\\/16)$", + "readOnly": false, "type": [ "string" ] }, - "id": { - "description": "unique identifier of release", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", - "readOnly": true, + "data_cidr": { + "description": "The RFC-1918 CIDR that the Private Space will use for the Heroku-managed peering connection that's automatically created when using Heroku Data add-ons. It must be between a /16 and a /20", + "example": "10.2.0.0/16", + "readOnly": false, "type": [ "string" ] }, - "identity": { - "anyOf": [ - { - "$ref": "#/definitions/release/definitions/id" - }, - { - "$ref": "#/definitions/release/definitions/version" - } - ] - }, - "updated_at": { - "description": "when release was updated", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", - "readOnly": true, + "channel_name": { + "description": "channel to create the space on", + "example": "some-channel", + "readOnly": false, "type": [ "string" ] }, - "version": { - "description": "unique version assigned to the release", - "example": 11, - "readOnly": true, + "generation": { + "description": "generation for space", + "example": "fir", + "readOnly": false, "type": [ - "integer" + "string" ] }, - "current": { - "description": "indicates this release as being the current one for the app", - "example": true, - "readOnly": true, + "features": { + "description": "runtime features for the space", + "example": "[feature-name]", + "readOnly": false, "type": [ - "boolean" + "array" ] }, - "output_stream_url": { - "description": "Release command output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`).", - "example": "https://release-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef", - "readOnly": true, + "supported_features": { + "description": "supported api features for the space", + "example": "[api-feature-name]", + "readOnly": false, "type": [ - "string", - "null" + "array" ] } }, "links": [ { - "description": "Info for existing release.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/releases/{(%23%2Fdefinitions%2Frelease%2Fdefinitions%2Fidentity)}", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/release" - }, - "title": "Info" - }, - { - "description": "List existing releases.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/releases", + "description": "List existing spaces.", + "href": "/spaces", "method": "GET", "rel": "instances", "targetSchema": { "items": { - "$ref": "#/definitions/release" + "$ref": "#/definitions/space" }, "type": [ "array" @@ -11449,216 +15080,143 @@ "title": "List" }, { - "description": "Create new release.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/releases", - "method": "POST", - "rel": "create", + "description": "Info for existing space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/space" + }, + "title": "Info" + }, + { + "description": "Update an existing space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", "schema": { "properties": { - "description": { - "$ref": "#/definitions/release/definitions/description" - }, - "slug": { - "$ref": "#/definitions/slug/definitions/identity" + "name": { + "$ref": "#/definitions/space/definitions/name" } }, - "required": [ - "slug" - ], "type": [ "object" ] }, "targetSchema": { - "$ref": "#/definitions/release" + "$ref": "#/definitions/space" }, - "title": "Create" + "title": "Update" }, { - "description": "Rollback to an existing release.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/releases", + "description": "Delete an existing space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/space" + }, + "title": "Delete" + }, + { + "description": "Create a new space.", + "href": "/spaces", "method": "POST", "rel": "create", "schema": { "properties": { - "release": { - "$ref": "#/definitions/release/definitions/id" + "name": { + "$ref": "#/definitions/space/definitions/name" + }, + "team": { + "$ref": "#/definitions/team/definitions/name" + }, + "region": { + "$ref": "#/definitions/region/definitions/identity" + }, + "shield": { + "$ref": "#/definitions/space/definitions/shield" + }, + "cidr": { + "$ref": "#/definitions/space/definitions/cidr" + }, + "data_cidr": { + "$ref": "#/definitions/space/definitions/data_cidr" + }, + "log_drain_url": { + "$ref": "#/definitions/space/definitions/log_drain_url" + }, + "channel_name": { + "$ref": "#/definitions/space/definitions/channel_name" + }, + "generation": { + "$ref": "#/definitions/space/definitions/generation" + }, + "features": { + "$ref": "#/definitions/space/definitions/features" + }, + "supported_features": { + "$ref": "#/definitions/space/definitions/supported_features" } }, "required": [ - "release" + "name", + "team" ], "type": [ "object" ] }, "targetSchema": { - "$ref": "#/definitions/release" + "$ref": "#/definitions/space" }, - "title": "Rollback" + "title": "Create" } ], "properties": { - "addon_plan_names": { - "description": "add-on plans installed on the app for this release", - "type": [ - "array" - ], - "items": { - "$ref": "#/definitions/plan/definitions/name" - } - }, - "app": { - "description": "app involved in the release", - "properties": { - "name": { - "$ref": "#/definitions/app/definitions/name" - }, - "id": { - "$ref": "#/definitions/app/definitions/id" - } - }, - "type": [ - "object" - ] - }, "created_at": { - "$ref": "#/definitions/release/definitions/created_at" - }, - "description": { - "$ref": "#/definitions/release/definitions/description" + "$ref": "#/definitions/space/definitions/created_at" }, "id": { - "$ref": "#/definitions/release/definitions/id" + "$ref": "#/definitions/space/definitions/id" }, - "updated_at": { - "$ref": "#/definitions/release/definitions/updated_at" + "name": { + "$ref": "#/definitions/space/definitions/name" }, - "slug": { - "description": "slug running in this release", + "organization": { + "description": "organization that owns this space", "properties": { - "id": { - "$ref": "#/definitions/slug/definitions/id" + "name": { + "$ref": "#/definitions/team/definitions/name" } }, - "strictProperties": true, "type": [ - "object", - "null" + "object" ] }, - "status": { - "$ref": "#/definitions/release/definitions/status" - }, - "user": { - "description": "user that created the release", + "team": { + "description": "team that owns this space", "properties": { "id": { - "$ref": "#/definitions/account/definitions/id" + "$ref": "#/definitions/team/definitions/id" }, - "email": { - "$ref": "#/definitions/account/definitions/email" + "name": { + "$ref": "#/definitions/team/definitions/name" } }, - "strictProperties": true, - "type": [ - "object" - ] - }, - "version": { - "$ref": "#/definitions/release/definitions/version" - }, - "current": { - "$ref": "#/definitions/release/definitions/current" - }, - "output_stream_url": { - "$ref": "#/definitions/release/definitions/output_stream_url" - } - } - }, - "review-app": { - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "title": "Review App", - "description": "An ephemeral app to review a set of changes", - "stability": "production", - "strictProperties": true, - "type": [ - "object" - ], - "definitions": { - "app_setup": { - "readOnly": true, - "type": [ - "null", - "object" - ] - }, - "branch": { - "description": "the branch of the repository which the review app is based on", - "readOnly": true, - "type": [ - "string" - ] - }, - "id": { - "description": "unique identifier of the review app", - "readOnly": true, - "format": "uuid", - "type": [ - "string" - ] - }, - "identity": { - "anyOf": [ - { - "$ref": "#/definitions/review-app/definitions/id" - } - ] - }, - "creator": { - "description": "The user who created the review app", - "readOnly": true, "type": [ "object" - ], - "definitions": { - "id": { - "description": "unique identifier of a review app owner", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", - "readOnly": false, - "type": [ - "string" - ] - } - } - }, - "created_at": { - "description": "when test run was created", - "format": "date-time", - "readOnly": true, - "type": [ - "string" ] }, - "source_blob": { - "description": "The download location for the review app's source code", - "properties": { - "url": { - "description": "URL where gzipped tar archive of source code for build was downloaded.", - "example": "https://example.com/source.tgz?token=xyz", - "readOnly": true, - "type": [ - "string" - ] - }, - "version": { - "description": "The version number (or SHA) of the code to build.", - "example": "v1.2.0", - "type": [ - "string", - "null" - ] + "region": { + "description": "identity of space region", + "properties": { + "id": { + "$ref": "#/definitions/region/definitions/id" + }, + "name": { + "$ref": "#/definitions/region/definitions/name" } }, "strictProperties": true, @@ -11666,170 +15224,302 @@ "object" ] }, - "status": { - "description": "current state of the review app", - "enum": [ - "pending", - "creating", - "created", - "deleting", - "deleted", - "errored" - ], - "readOnly": true, - "type": [ - "string" - ] + "shield": { + "$ref": "#/definitions/space/definitions/shield" + }, + "state": { + "$ref": "#/definitions/space/definitions/state" }, "updated_at": { - "description": "when review app was updated", + "$ref": "#/definitions/space/definitions/updated_at" + }, + "cidr": { + "$ref": "#/definitions/space/definitions/cidr" + }, + "data_cidr": { + "$ref": "#/definitions/space/definitions/data_cidr" + }, + "generation": { + "$ref": "#/definitions/space/definitions/generation" + } + } + }, + "stack": { + "description": "Stacks are the different application execution environments available in the Heroku platform.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Stack", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when stack was introduced", + "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, "type": [ "string" ] }, - "wait_for_ci": { - "description": "wait for ci before building the app", + "default": { + "description": "indicates this stack is the default for new apps", "example": true, "readOnly": true, "type": [ "boolean" ] }, - "error_status": { - "description": "error message from creating the review app if any", + "id": { + "description": "unique identifier of stack", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", "readOnly": true, "type": [ - "string", - "null" + "string" ] }, - "message": { - "description": "message from creating the review app if any", - "readOnly": true, - "type": [ - "string", - "null" + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/stack/definitions/name" + }, + { + "$ref": "#/definitions/stack/definitions/id" + } ] }, - "config_vars": { - "additionalProperties": false, - "description": "hash of config vars", - "example": { - "FOO": "bar", - "BAZ": "qux" - }, - "patternProperties": { - "^[\\w\\.\\:\\[\\]]+$": { - "type": [ - "string", - "null" - ] - } - }, + "name": { + "description": "unique name of stack", + "example": "heroku-18", + "readOnly": true, "type": [ - "object", - "null" + "string" ] }, - "fork_repo_id": { - "description": "repository id of the fork the branch resides in", - "example": "123456", + "state": { + "description": "availability of this stack: beta, deprecated or public", + "example": "public", "readOnly": true, "type": [ - "integer", - "null" + "string" ] }, - "pr_number": { - "description": "pull request number the review app is built for", - "example": 24, + "updated_at": { + "description": "when stack was last modified", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", "readOnly": true, "type": [ - "integer", - "null" + "string" + ], + "items": { + "type": [ + "string" + ], + "example": "ipv6_peering" + } + } + }, + "links": [ + { + "description": "Stack info.", + "href": "/stacks/{(%23%2Fdefinitions%2Fstack%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/stack" + }, + "title": "Info" + }, + { + "description": "List available stacks.", + "href": "/stacks", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/stack" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "List available app stacks for an app.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/available-stacks", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/stack" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "default": { + "$ref": "#/definitions/stack/definitions/default" + }, + "created_at": { + "$ref": "#/definitions/stack/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/stack/definitions/id" + }, + "name": { + "$ref": "#/definitions/stack/definitions/name" + }, + "state": { + "$ref": "#/definitions/stack/definitions/state" + }, + "updated_at": { + "$ref": "#/definitions/stack/definitions/updated_at" + } + } + }, + "team-add-on": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "title": "Heroku Platform API - Team Add-on", + "type": [ + "object" + ], + "links": [ + { + "description": "List add-ons used across all Team apps", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/addons", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/add-on" + }, + "type": [ + "array" + ] + }, + "title": "List For Team" + } + ] + }, + "team-app-collaborator": { + "description": "A team collaborator represents an account that has been given access to a team app on Heroku.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "title": "Heroku Platform API - Team App Collaborator", + "type": [ + "object" + ], + "definitions": { + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/collaborator/definitions/email" + } ] } }, "links": [ { - "description": "Create a new review app", - "href": "/review-apps", + "description": "Create a new collaborator on a team app. Use this endpoint instead of the `/apps/{app_id_or_name}/collaborator` endpoint when you want the collaborator to be granted [permissions] (https://devcenter.heroku.com/articles/org-users-access#roles-and-permissions) according to their role in the team.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/collaborators", "method": "POST", "rel": "create", "schema": { "properties": { - "branch": { - "$ref": "#/definitions/review-app/definitions/branch" - }, - "pr_number": { - "$ref": "#/definitions/review-app/definitions/pr_number" - }, - "pipeline": { - "$ref": "#/definitions/pipeline/definitions/id" - }, - "source_blob": { - "$ref": "#/definitions/review-app/definitions/source_blob" + "permissions": { + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/team-app-permission/definitions/name" + }, + "description": "An array of permissions to give to the collaborator." }, - "environment": { - "$ref": "#/definitions/review-app/definitions/config_vars", - "description": "A set of key value pairs which will be put into the environment of the spawned review app process." + "silent": { + "$ref": "#/definitions/collaborator/definitions/silent" }, - "fork_repo_id": { - "$ref": "#/definitions/review-app/definitions/fork_repo_id" + "user": { + "$ref": "#/definitions/account/definitions/identity" } }, "required": [ - "branch", - "pipeline", - "source_blob" + "user" ], "type": [ "object" ] }, - "title": "Create", - "targetSchema": { - "$ref": "#/definitions/review-app" - } - }, - { - "description": "Gets an existing review app", - "href": "/review-apps/{(%23%2Fdefinitions%2Freview-app%2Fdefinitions%2Fid)}", - "method": "GET", "targetSchema": { - "$ref": "#/definitions/review-app" + "$ref": "#/definitions/team-app-collaborator" }, - "title": "Get review app" + "title": "Create" }, { - "description": "Delete an existing review app", - "href": "/review-apps/{(%23%2Fdefinitions%2Freview-app%2Fdefinitions%2Fid)}", + "description": "Delete an existing collaborator from a team app.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}/collaborators/{(%23%2Fdefinitions%2Fteam-app-collaborator%2Fdefinitions%2Fidentity)}", "method": "DELETE", - "rel": "delete", + "rel": "destroy", "targetSchema": { - "$ref": "#/definitions/review-app" + "$ref": "#/definitions/team-app-collaborator" }, "title": "Delete" }, { - "description": "Get a review app using the associated app_id", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/review-app", + "description": "Info for a collaborator on a team app.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}/collaborators/{(%23%2Fdefinitions%2Fteam-app-collaborator%2Fdefinitions%2Fidentity)}", "method": "GET", - "title": "Get review app by app_id", + "rel": "self", "targetSchema": { - "$ref": "#/definitions/review-app" - } + "$ref": "#/definitions/team-app-collaborator" + }, + "title": "Info" }, { - "description": "List review apps for a pipeline", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/review-apps", + "description": "Update an existing collaborator from a team app.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}/collaborators/{(%23%2Fdefinitions%2Fteam-app-collaborator%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "permissions": { + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/team-app-permission/definitions/name" + }, + "description": "An array of permissions to give to the collaborator." + } + }, + "required": [ + "permissions" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team-app-collaborator" + }, + "title": "Update" + }, + { + "description": "List collaborators on a team app.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}/collaborators", "method": "GET", "rel": "instances", "targetSchema": { "items": { - "$ref": "#/definitions/review-app" + "$ref": "#/definitions/team-app-collaborator" }, "type": [ "array" @@ -11840,405 +15530,502 @@ ], "properties": { "app": { - "description": "the Heroku app associated to this review app", + "description": "app collaborator belongs to", "properties": { + "name": { + "$ref": "#/definitions/app/definitions/name" + }, "id": { "$ref": "#/definitions/app/definitions/id" } }, + "strictProperties": true, "type": [ - "null", - "object" - ] - }, - "app_setup": { - "description": "the app setup for this review app", - "properties": { - "id": { - "$ref": "#/definitions/app-setup/definitions/id" - } - }, - "type": [ - "null", "object" ] }, - "branch": { - "$ref": "#/definitions/review-app/definitions/branch" - }, "created_at": { - "$ref": "#/definitions/review-app/definitions/created_at" + "$ref": "#/definitions/collaborator/definitions/created_at" }, "id": { - "$ref": "#/definitions/review-app/definitions/id" + "$ref": "#/definitions/collaborator/definitions/id" }, - "pipeline": { - "description": "the pipeline which this review app belongs to", - "properties": { - "id": { - "$ref": "#/definitions/pipeline/definitions/id" - } - }, + "permissions": { "type": [ - "object" - ] + "array" + ], + "items": { + "$ref": "#/definitions/team-app-permission" + }, + "description": "array of permissions for the collaborator (only applicable if the app is on a team)" }, - "status": { - "$ref": "#/definitions/review-app/definitions/status" + "role": { + "$ref": "#/definitions/team/definitions/role" }, "updated_at": { - "$ref": "#/definitions/review-app/definitions/updated_at" - }, - "creator": { - "$ref": "#/definitions/review-app/definitions/creator" - }, - "wait_for_ci": { - "$ref": "#/definitions/review-app/definitions/wait_for_ci" - }, - "error_status": { - "$ref": "#/definitions/review-app/definitions/error_status" - }, - "message": { - "$ref": "#/definitions/review-app/definitions/message" + "$ref": "#/definitions/collaborator/definitions/updated_at" }, - "fork_repo": { + "user": { + "description": "identity of collaborated account", "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "federated": { + "$ref": "#/definitions/account/definitions/federated" + }, "id": { - "$ref": "#/definitions/review-app/definitions/fork_repo_id" + "$ref": "#/definitions/account/definitions/id" } }, "strictProperties": true, "type": [ - "object", - "null" + "object" ] - }, - "pr_number": { - "$ref": "#/definitions/review-app/definitions/pr_number" } } }, - "review-app-config": { - "description": "Review apps can be configured for pipelines.", + "team-app-permission": { "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", - "strictProperties": false, - "title": "Heroku Platform API - Review App Configuration", + "description": "A team app permission is a behavior that is assigned to a user in a team app.", + "stability": "prototype", + "title": "Heroku Platform API - Team App Permission", "type": [ "object" ], "definitions": { - "id": { - "description": "unique identifier of pipeline", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", - "readOnly": true, - "type": [ - "string" + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/team-app-permission/definitions/name" + } ] }, - "repo": { - "description": "repository name", - "example": "heroku/homebrew-brew", + "name": { + "description": "The name of the app permission.", + "example": "view", "readOnly": true, "type": [ "string" ] }, - "automatic_review_apps": { - "description": "enable automatic review apps for pull requests", - "example": true, - "readOnly": true, - "type": [ - "boolean" - ] - }, - "repo_id": { - "description": "repository id", - "example": "123456", + "description": { + "description": "A description of what the app permission allows.", + "example": "Can manage config, deploy, run commands and restart the app.", "readOnly": true, "type": [ - "integer" + "string" ] + } + }, + "links": [ + { + "description": "Lists permissions available to teams.", + "href": "/teams/permissions", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-app-permission" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "name": { + "$ref": "#/definitions/team-app-permission/definitions/name" }, - "destroy_stale_apps": { - "description": "automatically destroy review apps when they haven't been deployed for a number of days", - "example": true, - "readOnly": true, + "description": { + "$ref": "#/definitions/team-app-permission/definitions/description" + } + } + }, + "team-app": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "A team app encapsulates the team specific functionality of Heroku apps.", + "stability": "development", + "title": "Heroku Platform API - Team App", + "type": [ + "object" + ], + "definitions": { + "locked": { + "default": false, + "description": "are other team members forbidden from joining this app.", + "example": false, "type": [ "boolean" ] }, - "stale_days": { - "description": "number of days without a deployment after which to consider a review app stale", - "example": "5", - "readOnly": true, - "type": [ - "integer" - ] + "identity": { + "$ref": "#/definitions/app/definitions/name" }, - "wait_for_ci": { - "description": "If true, review apps are created only when CI passes", - "example": true, - "readOnly": true, + "internal_routing": { + "default": false, + "description": "describes whether a Private Spaces app is externally routable or not", + "example": false, + "readOnly": false, "type": [ - "boolean" + "boolean", + "null" ] }, - "base_name": { - "description": "A unique prefix that will be used to create review app names", - "example": "singular-app", - "readOnly": true, + "joined": { + "default": false, + "description": "is the current member a collaborator on this app.", + "example": false, "type": [ - "null", - "string" + "boolean" ] }, - "deploy_target": { - "description": "the deploy target for the review apps of a pipeline", - "definitions": { - "id": { - "description": "unique identifier of deploy target", - "example": "us", - "pattern": "(^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$|^[a-z]{2}$)", - "readOnly": true, - "type": [ - "string" - ] - }, - "type": { - "description": "type of deploy target", - "example": "region", - "pattern": "(^space$|^region$)", - "readOnly": true, - "type": [ - "string" - ] - } - }, - "links": [ - ], - "properties": { - "id": { - "$ref": "#/definitions/review-app-config/definitions/deploy_target/definitions/id" - }, - "type": { - "$ref": "#/definitions/review-app-config/definitions/deploy_target/definitions/type" - } - }, - "required": [ - "id", - "type" - ], + "personal": { + "default": false, + "description": "force creation of the app in the user account even if a default team is set.", + "example": false, "type": [ - "object", - "null" + "boolean" ] } }, "links": [ { - "description": "Enable review apps for a pipeline", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/review-app-config", + "description": "Create a new app in the specified team, in the default team if unspecified, or in personal account, if default team is not set.", + "href": "/teams/apps", "method": "POST", "rel": "create", "schema": { "properties": { - "repo": { - "$ref": "#/definitions/review-app-config/definitions/repo", - "description": "The full_name of the repository that you want enable review-apps from." + "locked": { + "$ref": "#/definitions/team-app/definitions/locked" }, - "automatic_review_apps": { - "$ref": "#/definitions/review-app-config/definitions/automatic_review_apps", - "description": "If true, this will trigger the creation of review apps when pull-requests are opened in the repo." + "name": { + "$ref": "#/definitions/app/definitions/name" }, - "destroy_stale_apps": { - "$ref": "#/definitions/review-app-config/definitions/destroy_stale_apps", - "description": "If true, this will trigger automatic deletion of review apps when they're stale" + "team": { + "$ref": "#/definitions/team/definitions/name" }, - "stale_days": { - "$ref": "#/definitions/review-app-config/definitions/stale_days", - "description": "If destroy_stale_apps is true, then apps will be destroyed after this many days" + "personal": { + "$ref": "#/definitions/team-app/definitions/personal" }, - "deploy_target": { - "$ref": "#/definitions/review-app-config/definitions/deploy_target", - "description": "Provides a key/value pair to specify whether to use a common runtime or a private space" + "region": { + "$ref": "#/definitions/region/definitions/name" }, - "wait_for_ci": { - "$ref": "#/definitions/review-app-config/definitions/wait_for_ci", - "description": "If true, review apps will only be created when CI passes" + "space": { + "$ref": "#/definitions/space/definitions/name" }, - "base_name": { - "$ref": "#/definitions/review-app-config/definitions/base_name", - "description": "A unique prefix that will be used to create review app names" + "stack": { + "$ref": "#/definitions/stack/definitions/name" + }, + "internal_routing": { + "$ref": "#/definitions/team-app/definitions/internal_routing" } }, - "required": [ - "repo" - ], "type": [ "object" ] }, - "title": "Enable", "targetSchema": { - "$ref": "#/definitions/review-app-config" - } + "$ref": "#/definitions/team-app" + }, + "title": "Create" }, { - "description": "Get review apps configuration for a pipeline", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/review-app-config", + "description": "Info for a team app.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}", "method": "GET", "rel": "self", - "title": "Info", "targetSchema": { - "$ref": "#/definitions/review-app-config" - } + "$ref": "#/definitions/team-app" + }, + "title": "Info" }, { - "description": "Update review app configuration for a pipeline", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/review-app-config", + "description": "Lock or unlock a team app.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}", "method": "PATCH", "rel": "update", "schema": { "properties": { - "automatic_review_apps": { - "$ref": "#/definitions/review-app-config/definitions/automatic_review_apps", - "description": "If true, this will trigger the creation of review apps when pull-requests are opened in the repo" - }, - "destroy_stale_apps": { - "$ref": "#/definitions/review-app-config/definitions/destroy_stale_apps", - "description": "If true, this will trigger automatic deletion of review apps when they're stale" - }, - "stale_days": { - "$ref": "#/definitions/review-app-config/definitions/stale_days", - "description": "If destroy_stale_apps is true, then apps will be destroyed after this many days" - }, - "deploy_target": { - "$ref": "#/definitions/review-app-config/definitions/deploy_target", - "description": "Provides a key/value pair to specify whether to use a common runtime or a private space" - }, - "wait_for_ci": { - "$ref": "#/definitions/review-app-config/definitions/wait_for_ci", - "description": "If true, review apps will only be created when CI passes" - }, - "base_name": { - "$ref": "#/definitions/review-app-config/definitions/base_name", - "description": "A unique prefix that will be used to create review app names" + "locked": { + "$ref": "#/definitions/team-app/definitions/locked" + } + }, + "required": [ + "locked" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team-app" + }, + "title": "Update Locked" + }, + { + "description": "Transfer an existing team app to another Heroku account.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "owner": { + "$ref": "#/definitions/account/definitions/identity" + } + }, + "required": [ + "owner" + ], + "type": [ + "object" + ] + }, + "title": "Transfer to Account" + }, + { + "description": "Transfer an existing team app to another team.", + "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "owner": { + "$ref": "#/definitions/team/definitions/name" } }, - "type": [ - "object" - ] + "required": [ + "owner" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team-app" + }, + "title": "Transfer to Team" + }, + { + "description": "List team apps.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/apps", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-app" + }, + "type": [ + "array" + ] + }, + "title": "List By Team" + } + ], + "properties": { + "archived_at": { + "$ref": "#/definitions/app/definitions/archived_at" + }, + "base_image_name": { + "$ref": "#/definitions/app/definitions/base_image_name" + }, + "build_stack": { + "$ref": "#/definitions/app/definitions/build_stack" + }, + "buildpack_provided_description": { + "$ref": "#/definitions/app/definitions/buildpack_provided_description" + }, + "buildpacks": { + "$ref": "#/definitions/app/definitions/buildpacks" + }, + "current_build_architecture": { + "$ref": "#/definitions/app/definitions/current_build_architecture" + }, + "created_at": { + "$ref": "#/definitions/app/definitions/created_at" + }, + "generation": { + "$ref": "#/definitions/app/definitions/generation" + }, + "git_url": { + "$ref": "#/definitions/app/definitions/git_url" + }, + "id": { + "$ref": "#/definitions/app/definitions/id" + }, + "internal_routing": { + "$ref": "#/definitions/team-app/definitions/internal_routing" + }, + "joined": { + "$ref": "#/definitions/team-app/definitions/joined" + }, + "locked": { + "$ref": "#/definitions/team-app/definitions/locked" + }, + "maintenance": { + "$ref": "#/definitions/app/definitions/maintenance" + }, + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "team": { + "description": "team that owns this app", + "properties": { + "name": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "type": [ + "null", + "object" + ] + }, + "owner": { + "description": "identity of app owner", + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + } }, - "title": "Update", - "targetSchema": { - "$ref": "#/definitions/review-app-config" - } + "type": [ + "null", + "object" + ] }, - { - "description": "Disable review apps for a pipeline", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/review-app-config", - "method": "DELETE", - "rel": "destroy", - "title": "Delete", - "targetSchema": { - "$ref": "#/definitions/review-app-config" - } - } - ], - "properties": { - "repo": { + "region": { + "description": "identity of app region", "properties": { "id": { - "$ref": "#/definitions/review-app-config/definitions/repo_id" + "$ref": "#/definitions/region/definitions/id" + }, + "name": { + "$ref": "#/definitions/region/definitions/name" } }, - "strictProperties": true, "type": [ "object" ] }, - "automatic_review_apps": { - "$ref": "#/definitions/review-app-config/definitions/automatic_review_apps" + "released_at": { + "$ref": "#/definitions/app/definitions/released_at" }, - "deploy_target": { - "$ref": "#/definitions/review-app-config/definitions/deploy_target" + "repo_size": { + "$ref": "#/definitions/app/definitions/repo_size" }, - "destroy_stale_apps": { - "$ref": "#/definitions/review-app-config/definitions/destroy_stale_apps" + "slug_size": { + "$ref": "#/definitions/app/definitions/slug_size" }, - "stale_days": { - "$ref": "#/definitions/review-app-config/definitions/stale_days" + "space": { + "description": "identity of space", + "properties": { + "id": { + "$ref": "#/definitions/space/definitions/id" + }, + "name": { + "$ref": "#/definitions/space/definitions/name" + } + }, + "type": [ + "null", + "object" + ] }, - "pipeline_id": { - "$ref": "#/definitions/review-app-config/definitions/id" + "stack": { + "description": "identity of app stack", + "properties": { + "id": { + "$ref": "#/definitions/stack/definitions/id" + }, + "name": { + "$ref": "#/definitions/stack/definitions/name" + } + }, + "type": [ + "object" + ] }, - "wait_for_ci": { - "$ref": "#/definitions/review-app-config/definitions/wait_for_ci" + "updated_at": { + "$ref": "#/definitions/app/definitions/updated_at" }, - "base_name": { - "$ref": "#/definitions/review-app-config/definitions/base_name" + "web_url": { + "$ref": "#/definitions/app/definitions/web_url" } } }, - "slug": { - "description": "A slug is a snapshot of your application code that is ready to run on the platform.", + "team-daily-usage": { "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", + "description": "Usage for an enterprise team at a daily resolution.", + "stability": "development", "strictProperties": true, - "title": "Heroku Platform API - Slug", + "title": "Heroku Platform API - Team Daily Usage", "type": [ "object" ], "definitions": { - "buildpack_provided_description": { - "description": "description from buildpack of slug", - "example": "Ruby/Rack", - "readOnly": false, + "addons": { + "description": "total add-on credits used", + "example": 250.0, + "readOnly": true, "type": [ - "null", - "string" + "number" ] }, - "checksum": { - "description": "an optional checksum of the slug for verifying its integrity", - "example": "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "readOnly": true, + "app_usage_daily": { + "description": "Usage for an app at a daily resolution.", "type": [ - "null", - "string" - ] + "object" + ], + "properties": { + "addons": { + "$ref": "#/definitions/team-daily-usage/definitions/addons" + }, + "app_name": { + "$ref": "#/definitions/app/definitions/name" + }, + "data": { + "$ref": "#/definitions/team-daily-usage/definitions/data" + }, + "dynos": { + "$ref": "#/definitions/team-daily-usage/definitions/dynos" + }, + "partner": { + "$ref": "#/definitions/team-daily-usage/definitions/partner" + } + } }, - "commit": { - "description": "identification of the code with your version control system (eg: SHA of the git HEAD)", - "example": "60883d9e8947a57e04dc9124f25df004866a2051", - "readOnly": false, + "data": { + "description": "total add-on credits used for first party add-ons", + "example": 34.89, + "readOnly": true, "type": [ - "null", - "string" + "number" ] }, - "commit_description": { - "description": "an optional description of the provided commit", - "example": "fixed a bug with API documentation", - "readOnly": false, + "date": { + "description": "date of the usage", + "example": "2019-01-01", + "format": "date", + "readOnly": true, "type": [ - "null", "string" ] }, - "created_at": { - "description": "when slug was created", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "dynos": { + "description": "dynos used", + "example": 1.548, "readOnly": true, "type": [ - "string" + "number" ] }, "id": { - "description": "unique identifier of slug", + "description": "team identifier", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -12246,318 +16033,215 @@ "string" ] }, - "identity": { - "anyOf": [ - { - "$ref": "#/definitions/slug/definitions/id" - } - ] - }, - "method": { - "description": "method to be used to interact with the slug blob", - "example": "GET", + "name": { + "description": "name of the team", + "example": "ops", "readOnly": true, "type": [ "string" ] }, - "process_types": { - "additionalProperties": false, - "description": "hash mapping process type names to their respective command", - "example": { - "web": "./bin/web -p $PORT" - }, - "patternProperties": { - "^[-\\w]{1,128}$": { - "type": [ - "string" - ] - } - }, - "readOnly": false, + "partner": { + "description": "total add-on credits used for third party add-ons", + "example": 12.34, + "readOnly": true, "type": [ - "object" + "number" ] }, - "size": { - "default": null, - "description": "size of slug, in bytes", - "example": 2048, + "space": { + "description": "space credits used", + "example": 1.548, "readOnly": true, "type": [ - "integer", - "null" + "number" ] }, - "updated_at": { - "description": "when slug was updated", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "start_date": { + "description": "range start date", + "example": "2019-01-25", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$", "readOnly": true, "type": [ "string" ] }, - "url": { - "description": "URL to interact with the slug blob", - "example": "https://api.heroku.com/slugs/1234.tgz", + "end_date": { + "description": "range end date", + "example": "2019-02-25", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$", "readOnly": true, "type": [ "string" ] } - }, - "links": [ - { - "description": "Info for existing slug.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/slugs/{(%23%2Fdefinitions%2Fslug%2Fdefinitions%2Fidentity)}", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/slug" - }, - "title": "Info" - }, - { - "description": "Create a new slug. For more information please refer to [Deploying Slugs using the Platform API](https://devcenter.heroku.com/articles/platform-api-deploying-slugs).", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/slugs", - "method": "POST", - "rel": "create", + }, + "links": [ + { + "description": "Retrieves usage for an enterprise team for a range of days. Start and end dates can be specified as query parameters using the date format YYYY-MM-DD. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list).\n", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fid)}/usage/daily", + "method": "GET", + "title": "Info", "schema": { "properties": { - "buildpack_provided_description": { - "$ref": "#/definitions/slug/definitions/buildpack_provided_description" - }, - "checksum": { - "$ref": "#/definitions/slug/definitions/checksum" - }, - "commit": { - "$ref": "#/definitions/slug/definitions/commit" - }, - "commit_description": { - "$ref": "#/definitions/slug/definitions/commit_description" - }, - "process_types": { - "$ref": "#/definitions/slug/definitions/process_types" + "start": { + "$ref": "#/definitions/team-daily-usage/definitions/start_date" }, - "stack": { - "$ref": "#/definitions/stack/definitions/identity" + "end": { + "$ref": "#/definitions/team-daily-usage/definitions/end_date" } }, "required": [ - "process_types" + "start" ], "type": [ "object" ] }, + "rel": "instances", "targetSchema": { - "$ref": "#/definitions/slug", - "example": { - "blob": { - "method": "PUT", - "url": "https://api.heroku.com/slugs/1234.tgz" - }, - "buildpack_provided_description": "Ruby/Rack", - "checksum": "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "commit": "60883d9e8947a57e04dc9124f25df004866a2051", - "commit_description": "fixed a bug with API documentation", - "created_at": "2012-01-01T12:00:00Z", - "id": "01234567-89ab-cdef-0123-456789abcdef", - "process_types": { - "web": "./bin/web -p $PORT" - }, - "size": 2048, - "stack": { - "id": "01234567-89ab-cdef-0123-456789abcdef", - "name": "heroku-18" - }, - "updated_at": "2012-01-01T12:00:00Z" - } - }, - "title": "Create" + "items": { + "$ref": "#/definitions/team-daily-usage" + }, + "type": [ + "array" + ] + } } ], "properties": { - "blob": { - "description": "pointer to the url where clients can fetch or store the actual release binary", - "properties": { - "method": { - "$ref": "#/definitions/slug/definitions/method" - }, - "url": { - "$ref": "#/definitions/slug/definitions/url" - } - }, - "strictProperties": true, - "type": [ - "object" - ] - }, - "buildpack_provided_description": { - "$ref": "#/definitions/slug/definitions/buildpack_provided_description" + "addons": { + "$ref": "#/definitions/team-daily-usage/definitions/addons" }, - "checksum": { - "$ref": "#/definitions/slug/definitions/checksum" + "apps": { + "description": "app usage in the team", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/team-daily-usage/definitions/app_usage_daily" + } }, - "commit": { - "$ref": "#/definitions/slug/definitions/commit" + "data": { + "$ref": "#/definitions/team-daily-usage/definitions/data" }, - "commit_description": { - "$ref": "#/definitions/slug/definitions/commit_description" + "date": { + "$ref": "#/definitions/team-daily-usage/definitions/date" }, - "created_at": { - "$ref": "#/definitions/slug/definitions/created_at" + "dynos": { + "$ref": "#/definitions/team-daily-usage/definitions/dynos" }, "id": { - "$ref": "#/definitions/slug/definitions/id" - }, - "process_types": { - "$ref": "#/definitions/slug/definitions/process_types" + "$ref": "#/definitions/team-daily-usage/definitions/id" }, - "size": { - "$ref": "#/definitions/slug/definitions/size" + "name": { + "$ref": "#/definitions/team-daily-usage/definitions/name" }, - "stack": { - "description": "identity of slug stack", - "properties": { - "id": { - "$ref": "#/definitions/stack/definitions/id" - }, - "name": { - "$ref": "#/definitions/stack/definitions/name" - } - }, - "strictProperties": true, - "type": [ - "object" - ] + "partner": { + "$ref": "#/definitions/team-daily-usage/definitions/partner" }, - "updated_at": { - "$ref": "#/definitions/slug/definitions/updated_at" + "space": { + "$ref": "#/definitions/team-daily-usage/definitions/space" } } }, - "sms-number": { - "description": "SMS numbers are used for recovery on accounts with two-factor authentication enabled.", + "team-delinquency": { + "description": "A Heroku team becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent teams if their invoices remain unpaid.", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", + "stability": "development", "strictProperties": true, - "title": "Heroku Platform API - SMS Number", + "title": "Heroku Platform API - Team Delinquency", "type": [ "object" ], "definitions": { - "sms_number": { - "$ref": "#/definitions/account/definitions/sms_number" + "scheduled_suspension_time": { + "description": "scheduled time of when we will suspend your team due to delinquency", + "example": "2024-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "scheduled_deletion_time": { + "description": "scheduled time of when we will delete your team due to delinquency", + "example": "2024-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] } }, "links": [ { - "description": "Recover an account using an SMS recovery code", - "href": "/users/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}/sms-number", + "description": "Team delinquency information.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/delinquency", "method": "GET", "rel": "self", "targetSchema": { - "$ref": "#/definitions/sms-number" - }, - "title": "SMS Number" - }, - { - "description": "Recover an account using an SMS recovery code", - "href": "/users/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}/sms-number/actions/recover", - "method": "POST", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/sms-number" - }, - "title": "Recover" - }, - { - "description": "Confirm an SMS number change with a confirmation code", - "href": "/users/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}/sms-number/actions/confirm", - "method": "POST", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/sms-number" + "$ref": "#/definitions/team-delinquency" }, - "title": "Confirm" + "title": "Info" } ], "properties": { - "sms_number": { - "$ref": "#/definitions/account/definitions/sms_number" + "scheduled_suspension_time": { + "$ref": "#/definitions/team-delinquency/definitions/scheduled_suspension_time" + }, + "scheduled_deletion_time": { + "$ref": "#/definitions/team-delinquency/definitions/scheduled_deletion_time" } } }, - "sni-endpoint": { - "description": "SNI Endpoint is a public address serving a custom SSL cert for HTTPS traffic, using the SNI TLS extension, to a Heroku app.", + "team-feature": { + "description": "A team feature represents a feature enabled on a team account.", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "title": "Heroku Platform API - SNI Endpoint", "stability": "development", "strictProperties": true, + "title": "Heroku Platform API - Team Feature", "type": [ "object" ], "definitions": { - "ca_signed?": { + "created_at": { + "description": "when team feature was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", "readOnly": true, "type": [ - "boolean" + "string" ] }, - "cert_domains": { + "description": { + "description": "description of team feature", + "example": "Causes account to example.", "readOnly": true, - "type": [ - "array" - ] - }, - "certificate_chain": { - "description": "raw contents of the public certificate chain (eg: .crt or .pem file)", - "example": "-----BEGIN CERTIFICATE----- ...", - "readOnly": false, "type": [ "string" ] }, - "created_at": { - "description": "when endpoint was created", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "doc_url": { + "description": "documentation URL of team feature", + "example": "http://devcenter.heroku.com/articles/example", "readOnly": true, "type": [ "string" ] }, - "domains": { - "description": "domains associated with this SSL certificate", - "type": [ - "array" - ], - "readOnly": true, - "items": { - "$ref": "#/definitions/domain/definitions/id" - } - }, - "display_name": { - "description": "unique name for SSL certificate", - "example": "example", - "pattern": "^[a-z][a-z0-9-]{2,29}$", + "enabled": { + "description": "whether or not team feature has been enabled", + "example": true, "readOnly": false, "type": [ - "string", - "null" - ] - }, - "expires_at": { - "readOnly": true, - "format": "date-time", - "type": [ - "string" + "boolean" ] }, "id": { - "description": "unique identifier of this SNI endpoint", + "description": "unique identifier of team feature", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -12568,57 +16252,160 @@ "identity": { "anyOf": [ { - "$ref": "#/definitions/sni-endpoint/definitions/id" + "$ref": "#/definitions/team-feature/definitions/id" }, { - "$ref": "#/definitions/sni-endpoint/definitions/name" + "$ref": "#/definitions/team-feature/definitions/name" } ] }, - "issuer": { + "name": { + "description": "unique name of team feature", + "example": "name", "readOnly": true, "type": [ "string" ] }, - "name": { - "description": "unique name for SNI endpoint", - "example": "example", - "pattern": "^[a-z][a-z0-9-]{2,29}$", + "state": { + "description": "state of team feature", + "example": "public", "readOnly": true, "type": [ "string" ] }, - "private_key": { - "description": "contents of the private key (eg .key file)", - "example": "-----BEGIN RSA PRIVATE KEY----- ...", - "readOnly": false, + "updated_at": { + "description": "when team feature was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, "type": [ "string" ] }, - "self_signed?": { + "display_name": { + "description": "user readable feature name", + "example": "My Feature", "readOnly": true, "type": [ - "boolean" + "string" ] }, - "starts_at": { + "feedback_email": { + "description": "e-mail to send feedback about the feature", + "example": "feedback@heroku.com", "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Info for an existing team feature.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/features/{(%23%2Fdefinitions%2Fteam-feature%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/team-feature" + }, + "title": "Info" + }, + { + "description": "List existing team features.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/features", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-feature" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/team-feature/definitions/created_at" + }, + "description": { + "$ref": "#/definitions/team-feature/definitions/description" + }, + "doc_url": { + "$ref": "#/definitions/team-feature/definitions/doc_url" + }, + "enabled": { + "$ref": "#/definitions/team-feature/definitions/enabled" + }, + "id": { + "$ref": "#/definitions/team-feature/definitions/id" + }, + "name": { + "$ref": "#/definitions/team-feature/definitions/name" + }, + "state": { + "$ref": "#/definitions/team-feature/definitions/state" + }, + "updated_at": { + "$ref": "#/definitions/team-feature/definitions/updated_at" + }, + "display_name": { + "$ref": "#/definitions/team-feature/definitions/display_name" + }, + "feedback_email": { + "$ref": "#/definitions/team-feature/definitions/feedback_email" + } + } + }, + "team-invitation": { + "description": "A team invitation represents an invite to a team.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Team Invitation", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when invitation was created", + "example": "2012-01-01T12:00:00Z", "format": "date-time", + "readOnly": true, "type": [ "string" ] }, - "subject": { + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/team-invitation/definitions/id" + } + ] + }, + "id": { + "description": "unique identifier of an invitation", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "token": { + "description": "special token for invitation", + "example": "614ae25aa2d4802096cd7c18625b526c", "readOnly": true, "type": [ "string" ] }, "updated_at": { - "description": "when SNI endpoint was updated", + "description": "when invitation was updated", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, @@ -12629,125 +16416,95 @@ }, "links": [ { - "description": "Create a new SNI endpoint.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sni-endpoints", - "method": "POST", - "rel": "create", - "schema": { - "properties": { - "certificate_chain": { - "$ref": "#/definitions/sni-endpoint/definitions/certificate_chain" - }, - "private_key": { - "$ref": "#/definitions/sni-endpoint/definitions/private_key" - } - }, - "required": [ - "certificate_chain", - "private_key" - ], - "type": [ - "object" - ] - }, - "targetSchema": { - "$ref": "#/definitions/sni-endpoint" - }, - "title": "Create" - }, - { - "description": "Delete existing SNI endpoint.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sni-endpoints/{(%23%2Fdefinitions%2Fsni-endpoint%2Fdefinitions%2Fidentity)}", - "method": "DELETE", - "rel": "destroy", - "targetSchema": { - "$ref": "#/definitions/sni-endpoint" - }, - "title": "Delete" - }, - { - "description": "Info for existing SNI endpoint.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sni-endpoints/{(%23%2Fdefinitions%2Fsni-endpoint%2Fdefinitions%2Fidentity)}", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/sni-endpoint" - }, - "title": "Info" - }, - { - "description": "List existing SNI endpoints.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sni-endpoints", + "description": "Get a list of a team's Identity Providers", + "title": "List", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fname)}/invitations", "method": "GET", "rel": "instances", "targetSchema": { "items": { - "$ref": "#/definitions/sni-endpoint" + "$ref": "#/definitions/team-invitation" }, "type": [ "array" ] - }, - "title": "List" + } }, { - "description": "Update an existing SNI endpoint.", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sni-endpoints/{(%23%2Fdefinitions%2Fsni-endpoint%2Fdefinitions%2Fidentity)}", - "method": "PATCH", + "description": "Create Team Invitation", + "title": "Create", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/invitations", + "method": "PUT", "rel": "update", "schema": { "properties": { - "certificate_chain": { - "$ref": "#/definitions/sni-endpoint/definitions/certificate_chain" + "email": { + "$ref": "#/definitions/account/definitions/email" }, - "private_key": { - "$ref": "#/definitions/sni-endpoint/definitions/private_key" + "role": { + "$ref": "#/definitions/team/definitions/role" } }, "required": [ - "certificate_chain", - "private_key" + "email", + "role" ], "type": [ "object" ] }, "targetSchema": { - "$ref": "#/definitions/sni-endpoint" - }, - "title": "Update" - } - ], - "properties": { - "certificate_chain": { - "$ref": "#/definitions/sni-endpoint/definitions/certificate_chain" - }, - "created_at": { - "$ref": "#/definitions/sni-endpoint/definitions/created_at" - }, - "id": { - "$ref": "#/definitions/sni-endpoint/definitions/id" + "$ref": "#/definitions/team-invitation" + } }, - "name": { - "$ref": "#/definitions/sni-endpoint/definitions/name" + { + "description": "Revoke a team invitation.", + "title": "Revoke", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/invitations/{(%23%2Fdefinitions%2Fteam-invitation%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/team-invitation" + } }, - "updated_at": { - "$ref": "#/definitions/sni-endpoint/definitions/updated_at" + { + "description": "Get an invitation by its token", + "title": "Get", + "href": "/teams/invitations/{(%23%2Fdefinitions%2Fteam-invitation%2Fdefinitions%2Ftoken)}", + "method": "GET", + "rel": "instances", + "targetSchema": { + "$ref": "#/definitions/team-invitation" + } }, - "display_name": { - "$ref": "#/definitions/sni-endpoint/definitions/display_name" + { + "description": "Accept Team Invitation", + "title": "Accept", + "href": "/teams/invitations/{(%23%2Fdefinitions%2Fteam-invitation%2Fdefinitions%2Ftoken)}/accept", + "method": "POST", + "rel": "create", + "targetSchema": { + "$ref": "#/definitions/team-member" + } + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/team-invitation/definitions/created_at" }, - "domains": { - "$ref": "#/definitions/sni-endpoint/definitions/domains" + "id": { + "$ref": "#/definitions/team-invitation/definitions/id" }, - "app": { - "description": "application that this SSL certificate is on", + "invited_by": { "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, "id": { - "$ref": "#/definitions/app/definitions/id" + "$ref": "#/definitions/account/definitions/id" }, "name": { - "$ref": "#/definitions/app/definitions/name" + "$ref": "#/definitions/account/definitions/name" } }, "strictProperties": true, @@ -12755,125 +16512,106 @@ "object" ] }, - "ssl_cert": { - "description": "certificate provided by this endpoint", + "team": { + "properties": { + "id": { + "$ref": "#/definitions/team/definitions/id" + }, + "name": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "strictProperties": true, "type": [ "object" - ], + ] + }, + "role": { + "$ref": "#/definitions/team/definitions/role" + }, + "updated_at": { + "$ref": "#/definitions/team-invitation/definitions/updated_at" + }, + "user": { "properties": { - "ca_signed?": { - "$ref": "#/definitions/sni-endpoint/definitions/ca_signed?" - }, - "cert_domains": { - "$ref": "#/definitions/sni-endpoint/definitions/cert_domains" - }, - "expires_at": { - "$ref": "#/definitions/sni-endpoint/definitions/expires_at" - }, - "issuer": { - "$ref": "#/definitions/sni-endpoint/definitions/issuer" - }, - "self_signed?": { - "$ref": "#/definitions/sni-endpoint/definitions/self_signed?" - }, - "starts_at": { - "$ref": "#/definitions/sni-endpoint/definitions/starts_at" - }, - "subject": { - "$ref": "#/definitions/sni-endpoint/definitions/subject" + "email": { + "$ref": "#/definitions/account/definitions/email" }, "id": { - "description": "unique identifier of this SSL certificate", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", - "readOnly": true, - "type": [ - "string" - ] + "$ref": "#/definitions/account/definitions/id" + }, + "name": { + "$ref": "#/definitions/account/definitions/name" } - } + }, + "strictProperties": true, + "type": [ + "object" + ] } } }, - "source": { - "description": "A source is a location for uploading and downloading an application's source code.", + "team-invoice": { "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", + "description": "A Team Invoice is an itemized bill of goods for a team which includes pricing and charges.", + "stability": "development", "strictProperties": true, - "title": "Heroku Platform API - Source", + "title": "Heroku Platform API - Team Invoice", "type": [ "object" ], "definitions": { - "get_url": { - "description": "URL to download the source", - "example": "https://api.heroku.com/sources/1234.tgz", + "addons_total": { + "description": "total add-ons charges in on this invoice", + "example": 25000, "readOnly": true, "type": [ - "string" + "integer" ] }, - "put_url": { - "description": "URL to upload the source", - "example": "https://api.heroku.com/sources/1234.tgz", + "database_total": { + "description": "total database charges on this invoice", + "example": 25000, + "readOnly": true, + "type": [ + "integer" + ] + }, + "charges_total": { + "description": "total charges on this invoice", + "example": 0, + "readOnly": true, + "type": [ + "integer" + ] + }, + "created_at": { + "description": "when invoice was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", "readOnly": true, "type": [ "string" ] - } - }, - "links": [ - { - "description": "Create URLs for uploading and downloading source.", - "href": "/sources", - "method": "POST", - "rel": "create", - "targetSchema": { - "$ref": "#/definitions/source" - }, - "title": "Create" }, - { - "deactivate_on": "2017-08-01", - "description": "Create URLs for uploading and downloading source. Deprecated in favor of `POST /sources`", - "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/sources", - "method": "POST", - "rel": "create", - "targetSchema": { - "$ref": "#/definitions/source" - }, - "title": "Create - Deprecated" - } - ], - "properties": { - "source_blob": { - "description": "pointer to the URL where clients can fetch or store the source", - "properties": { - "get_url": { - "$ref": "#/definitions/source/definitions/get_url" - }, - "put_url": { - "$ref": "#/definitions/source/definitions/put_url" - } - }, - "strictProperties": true, + "credits_total": { + "description": "total credits on this invoice", + "example": 100000, + "readOnly": true, "type": [ - "object" + "integer" ] - } - } - }, - "space-app-access": { - "description": "Space access represents the permissions a particular user has on a particular space.", - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "prototype", - "title": "Heroku Platform API - Space Access", - "type": [ - "object" - ], - "definitions": { + }, + "dyno_units": { + "description": "total amount of dyno units consumed across dyno types.", + "example": 1.92, + "readOnly": true, + "type": [ + "number" + ] + }, "id": { - "description": "unique identifier of the space a user has permissions on", + "description": "unique identifier of this invoice", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -12884,67 +16622,103 @@ "identity": { "anyOf": [ { - "$ref": "#/definitions/space-app-access/definitions/id" + "$ref": "#/definitions/team-invoice/definitions/number" } ] + }, + "number": { + "description": "human readable invoice number", + "example": 9403943, + "readOnly": true, + "type": [ + "integer" + ] + }, + "payment_status": { + "description": "status of the invoice payment", + "example": "Paid", + "readOnly": true, + "type": [ + "string" + ] + }, + "platform_total": { + "description": "total platform charges on this invoice", + "example": 50000, + "readOnly": true, + "type": [ + "integer" + ] + }, + "period_end": { + "description": "the ending date that the invoice covers", + "example": "01/31/2014", + "readOnly": true, + "type": [ + "string" + ] + }, + "period_start": { + "description": "the starting date that this invoice covers", + "example": "01/01/2014", + "readOnly": true, + "type": [ + "string" + ] + }, + "state": { + "description": "payment status for this invoice (pending, successful, failed)", + "example": 1, + "readOnly": true, + "type": [ + "integer" + ] + }, + "total": { + "description": "combined total of charges and credits on this invoice", + "example": 100000, + "readOnly": true, + "type": [ + "integer" + ] + }, + "updated_at": { + "description": "when invoice was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "weighted_dyno_hours": { + "description": "The total amount of hours consumed across dyno types.", + "example": 1488, + "readOnly": true, + "type": [ + "number" + ] } }, "links": [ { - "description": "List permissions for a given user on a given space.", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/members/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}", + "description": "Info for existing invoice.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/invoices/{(%23%2Fdefinitions%2Fteam-invoice%2Fdefinitions%2Fidentity)}", "method": "GET", "rel": "self", "targetSchema": { - "$ref": "#/definitions/space-app-access" + "$ref": "#/definitions/team-invoice" }, "title": "Info" }, { - "description": "Update an existing user's set of permissions on a space.", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/members/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}", - "method": "PATCH", - "rel": "update", - "schema": { - "type": [ - "object" - ], - "required": [ - "permissions" - ], - "properties": { - "permissions": { - "type": [ - "array" - ], - "items": { - "type": [ - "object" - ], - "properties": { - "name": { - "type": [ - "string" - ] - } - } - } - } - } - }, - "targetSchema": { - "$ref": "#/definitions/space-app-access" - }, - "title": "Update" - }, - { - "description": "List all users and their permissions on a space.", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/members", + "description": "List existing invoices.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/invoices", "method": "GET", "rel": "instances", "targetSchema": { "items": { - "$ref": "#/definitions/space-app-access" + "$ref": "#/definitions/team-invoice" }, "type": [ "array" @@ -12954,82 +16728,74 @@ } ], "properties": { - "space": { - "description": "space user belongs to", - "properties": { - "name": { - "$ref": "#/definitions/app/definitions/name" - }, - "id": { - "$ref": "#/definitions/app/definitions/id" - } - }, - "strictProperties": true, - "type": [ - "object" - ] + "addons_total": { + "$ref": "#/definitions/team-invoice/definitions/addons_total" + }, + "database_total": { + "$ref": "#/definitions/team-invoice/definitions/database_total" + }, + "charges_total": { + "$ref": "#/definitions/team-invoice/definitions/charges_total" }, "created_at": { - "$ref": "#/definitions/space/definitions/created_at" + "$ref": "#/definitions/team-invoice/definitions/created_at" + }, + "credits_total": { + "$ref": "#/definitions/team-invoice/definitions/credits_total" + }, + "dyno_units": { + "$ref": "#/definitions/team-invoice/definitions/dyno_units" }, "id": { - "$ref": "#/definitions/space/definitions/id" + "$ref": "#/definitions/team-invoice/definitions/id" }, - "permissions": { - "description": "user space permissions", - "type": [ - "array" - ], - "items": { - "type": [ - "object" - ], - "properties": { - "description": { - "type": [ - "string" - ] - }, - "name": { - "type": [ - "string" - ] - } - } - } + "number": { + "$ref": "#/definitions/team-invoice/definitions/number" + }, + "payment_status": { + "$ref": "#/definitions/team-invoice/definitions/payment_status" + }, + "period_end": { + "$ref": "#/definitions/team-invoice/definitions/period_end" + }, + "period_start": { + "$ref": "#/definitions/team-invoice/definitions/period_start" + }, + "platform_total": { + "$ref": "#/definitions/team-invoice/definitions/platform_total" + }, + "state": { + "$ref": "#/definitions/team-invoice/definitions/state" + }, + "total": { + "$ref": "#/definitions/team-invoice/definitions/total" }, "updated_at": { - "$ref": "#/definitions/space/definitions/updated_at" + "$ref": "#/definitions/team-invoice/definitions/updated_at" }, - "user": { - "description": "identity of user account", - "properties": { - "email": { - "$ref": "#/definitions/account/definitions/email" - }, - "id": { - "$ref": "#/definitions/account/definitions/id" - } - }, - "strictProperties": true, - "type": [ - "object" - ] + "weighted_dyno_hours": { + "$ref": "#/definitions/team-invoice/definitions/weighted_dyno_hours" } } }, - "space-nat": { - "description": "Network address translation (NAT) for stable outbound IP addresses from a space", + "team-member": { "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "prototype", - "strictProperties": true, - "title": "Heroku Platform API - Space Network Address Translation", + "description": "A team member is an individual with access to a team.", + "stability": "development", + "additionalProperties": false, + "required": [ + "created_at", + "email", + "federated", + "updated_at" + ], + "title": "Heroku Platform API - Team Member", "type": [ "object" ], "definitions": { "created_at": { - "description": "when network address translation for a space was created", + "description": "when the membership record was created", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, @@ -13037,264 +16803,355 @@ "string" ] }, - "ip_v4_address": { - "example": "123.123.123.123", - "format": "ipv4", - "pattern": "^(([01]?\\d?\\d|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d?\\d|2[0-4]\\d|25[0-5])$", + "email": { + "description": "email address of the team member", + "example": "someone@example.org", + "readOnly": true, "type": [ "string" ] }, - "sources": { - "description": "potential IPs from which outbound network traffic will originate", - "readOnly": true, - "type": [ - "array" - ], - "items": { - "$ref": "#/definitions/space-nat/definitions/ip_v4_address" - } - }, - "state": { - "description": "availability of network address translation for a space", - "enum": [ - "disabled", - "updating", - "enabled" - ], - "example": "enabled", + "federated": { + "description": "whether the user is federated and belongs to an Identity Provider", + "example": false, "readOnly": true, "type": [ - "string" + "boolean" ] }, - "updated_at": { - "description": "when network address translation for a space was updated", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "id": { + "description": "unique identifier of the team member", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", "readOnly": true, "type": [ "string" ] - } - }, - "links": [ - { - "description": "Current state of network address translation for a space.", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/nat", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/space-nat" - }, - "title": "Info" - } - ], - "properties": { - "created_at": { - "$ref": "#/definitions/space-nat/definitions/created_at" - }, - "sources": { - "$ref": "#/definitions/space-nat/definitions/sources" }, - "state": { - "$ref": "#/definitions/space-nat/definitions/state" + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/team-member/definitions/email" + }, + { + "$ref": "#/definitions/team-member/definitions/id" + } + ] }, - "updated_at": { - "$ref": "#/definitions/space-nat/definitions/updated_at" - } - } - }, - "space-topology": { - "description": "Space Topology provides you with a mechanism for viewing all the running dynos, formations and applications for a space. This is the same data thats used to power our DNS Service Discovery.", - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "prototype", - "strictProperties": true, - "title": "Heroku Platform API - Space Topology", - "type": [ - "object" - ], - "definitions": { - "version": { - "description": "version of the space topology payload", - "example": 1, + "name": { + "description": "full name of the team member", + "example": "Tina Edmonds", "readOnly": true, "type": [ - "integer" + "string", + "null" ] }, - "dyno": { - "description": "A dyno", - "properties": { - "id": { - "$ref": "#/definitions/dyno/definitions/id" - }, - "number": { - "description": "process number, e.g. 1 in web.1", - "example": 1, - "type": [ - "integer" - ] - }, - "private_ip": { - "description": "RFC1918 Address of Dyno", - "example": "10.0.134.42", - "type": [ - "string" - ] - }, - "hostname": { - "description": "localspace hostname of resource", - "example": "1.example-app-90210.app.localspace", - "type": [ - "string" - ] - } - }, + "team_role": { + "description": "role in the team", + "enum": [ + "admin", + "viewer", + "member" + ], + "example": "admin", "type": [ - "object" + "string" ] }, - "formation": { - "description": "formations for application", - "properties": { - "id": { - "$ref": "#/definitions/formation/definitions/id" - }, - "process_type": { - "description": "Name of process type", - "example": "web", - "type": [ - "string" - ] - }, - "dynos": { - "description": "Current dynos for application", - "items": { - "$ref": "#/definitions/space-topology/definitions/dyno" - }, - "type": [ - "array" - ] - } - }, + "two_factor_authentication": { + "description": "whether the team member has two factor authentication enabled", + "example": true, + "readOnly": true, "type": [ - "object" + "boolean" + ] + }, + "updated_at": { + "description": "when the membership record was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" ] } }, "links": [ { - "description": "Current space topology", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/topology", - "method": "GET", - "rel": "self", + "description": "Create a new team member, or update their role.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members", + "method": "PUT", + "rel": "create", + "schema": { + "properties": { + "email": { + "$ref": "#/definitions/team-member/definitions/email" + }, + "federated": { + "$ref": "#/definitions/team-member/definitions/federated" + }, + "role": { + "$ref": "#/definitions/team-member/definitions/team_role" + } + }, + "required": [ + "email", + "role" + ], + "type": [ + "object" + ] + }, "targetSchema": { - "$ref": "#/definitions/space-topology" + "$ref": "#/definitions/team-member" }, - "title": "Topology" - } - ], - "properties": { - "version": { - "$ref": "#/definitions/space-topology/definitions/version" + "title": "Create or Update" }, - "apps": { - "description": "The apps within this space", - "type": [ - "array" - ], - "readOnly": true, - "items": { - "type": [ - "object" - ], + { + "description": "Create a new team member.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members", + "method": "POST", + "rel": "create", + "schema": { "properties": { - "id": { - "$ref": "#/definitions/app/definitions/id", - "readOnly": true + "email": { + "$ref": "#/definitions/team-member/definitions/email" }, - "domains": { - "example": [ - "example.com", - "example.net" - ], - "readOnly": true, - "type": [ - "array" - ] + "federated": { + "$ref": "#/definitions/team-member/definitions/federated" }, - "formation": { - "description": "formations for application", - "items": { - "$ref": "#/definitions/space-topology/definitions/formation" - }, - "type": [ - "array" - ], - "readOnly": true + "role": { + "$ref": "#/definitions/team-member/definitions/team_role" } - } - } - } - } - }, - "space-transfer": { - "description": "Transfer spaces between enterprise teams with the same Enterprise Account.", - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "development", - "strictProperties": true, - "title": "Heroku Platform API - Space Transfer", - "type": [ - "object" - ], - "links": [ + }, + "required": [ + "email", + "role" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team-member" + }, + "title": "Create" + }, { - "description": "Transfer space between enterprise teams", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/transfer", - "method": "POST", - "rel": "transfer", + "description": "Update a team member.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members", + "method": "PATCH", + "rel": "update", "schema": { "properties": { - "new_owner": { - "$ref": "#/definitions/team/definitions/name" + "email": { + "$ref": "#/definitions/team-member/definitions/email" + }, + "federated": { + "$ref": "#/definitions/team-member/definitions/federated" + }, + "role": { + "$ref": "#/definitions/team-member/definitions/team_role" } }, "required": [ - "new_owner" + "email", + "role" ], "type": [ "object" ] }, - "targetSchema": { - "$ref": "#/definitions/space" + "targetSchema": { + "$ref": "#/definitions/team-member" + }, + "title": "Update" + }, + { + "description": "Remove a member from the team.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members/{(%23%2Fdefinitions%2Fteam-member%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/team-member" + }, + "title": "Delete" + }, + { + "description": "List members of the team.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members", + "method": "GET", + "ranges": [ + "email" + ], + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-member" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "List the apps of a team member.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members/{(%23%2Fdefinitions%2Fteam-member%2Fdefinitions%2Fidentity)}/apps", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-app" + }, + "type": [ + "array" + ] + }, + "title": "List By Member" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/team-member/definitions/created_at" + }, + "email": { + "$ref": "#/definitions/team-member/definitions/email" + }, + "federated": { + "$ref": "#/definitions/team-member/definitions/federated" + }, + "id": { + "$ref": "#/definitions/team-member/definitions/id" + }, + "identity_provider": { + "description": "Identity Provider information the member is federated with", + "properties": { + "id": { + "$ref": "#/definitions/identity-provider/definitions/id" + }, + "name": { + "description": "name of the identity provider", + "example": "acme", + "readOnly": true, + "type": [ + "string" + ] + }, + "redacted": { + "description": "whether the identity_provider information is redacted or not", + "example": false, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "owner": { + "$ref": "#/definitions/identity-provider/definitions/owner" + } }, - "title": "transfer" + "type": [ + "null", + "object" + ] + }, + "role": { + "$ref": "#/definitions/team/definitions/role" + }, + "two_factor_authentication": { + "$ref": "#/definitions/team-member/definitions/two_factor_authentication" + }, + "updated_at": { + "$ref": "#/definitions/team-member/definitions/updated_at" + }, + "user": { + "description": "user information for the membership", + "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, + "id": { + "$ref": "#/definitions/account/definitions/id" + }, + "name": { + "$ref": "#/definitions/account/definitions/name" + } + }, + "strictProperties": true, + "type": [ + "object" + ] } - ] + } }, - "space": { - "description": "A space is an isolated, highly available, secure app execution environment.", + "team-monthly-usage": { "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", + "description": "Usage for an enterprise team at a monthly resolution.", + "stability": "development", "strictProperties": true, - "title": "Heroku Platform API - Space", + "title": "Heroku Platform API - Team Monthly Usage", "type": [ "object" ], "definitions": { - "created_at": { - "description": "when space was created", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "addons": { + "description": "total add-on credits used", + "example": 250.0, "readOnly": true, "type": [ - "string" + "number" + ] + }, + "app_usage_monthly": { + "description": "Usage for an app at a monthly resolution.", + "type": [ + "object" + ], + "properties": { + "addons": { + "$ref": "#/definitions/team-monthly-usage/definitions/addons" + }, + "app_name": { + "$ref": "#/definitions/app/definitions/name" + }, + "data": { + "$ref": "#/definitions/team-monthly-usage/definitions/data" + }, + "dynos": { + "$ref": "#/definitions/team-monthly-usage/definitions/dynos" + }, + "partner": { + "$ref": "#/definitions/team-monthly-usage/definitions/partner" + } + } + }, + "connect": { + "description": "max connect rows synced", + "example": 15000, + "readOnly": true, + "type": [ + "number" + ] + }, + "data": { + "description": "total add-on credits used for first party add-ons", + "example": 34.89, + "readOnly": true, + "type": [ + "number" + ] + }, + "dynos": { + "description": "dynos used", + "example": 1.548, + "readOnly": true, + "type": [ + "number" ] }, "id": { - "description": "unique identifier of space", + "description": "team identifier", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -13302,276 +17159,287 @@ "string" ] }, - "identity": { - "anyOf": [ - { - "$ref": "#/definitions/space/definitions/id" - }, - { - "$ref": "#/definitions/space/definitions/name" - } + "month": { + "description": "year and month of the usage", + "example": "2019-01", + "pattern": "^[0-9]{4}-[0-9]{2}$", + "readOnly": true, + "type": [ + "string" ] }, "name": { - "description": "unique name of space", - "example": "nasa", - "readOnly": false, - "pattern": "^[a-z0-9](?:[a-z0-9]|-(?!-))+[a-z0-9]$", + "description": "name of the team", + "example": "ops", + "readOnly": true, "type": [ "string" ] }, - "shield": { - "description": "true if this space has shield enabled", + "partner": { + "description": "total add-on credits used for third party add-ons", + "example": 12.34, "readOnly": true, - "example": true, "type": [ - "boolean" + "number" ] }, - "state": { - "description": "availability of this space", - "enum": [ - "allocating", - "allocated", - "deleting" - ], - "example": "allocated", + "space": { + "description": "space credits used", + "example": 1.548, + "readOnly": true, + "type": [ + "number" + ] + }, + "start_date": { + "description": "range start date", + "example": "2019-01", + "pattern": "^[0-9]{4}-[0-9]{2}$", "readOnly": true, "type": [ "string" ] }, - "updated_at": { - "description": "when space was updated", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "end_date": { + "description": "range end date", + "example": "2019-02", + "pattern": "^[0-9]{4}-[0-9]{2}$", "readOnly": true, "type": [ "string" ] + } + }, + "links": [ + { + "description": "Retrieves usage for an enterprise team for a range of months. Start and end dates can be specified as query parameters using the date, YYYY-MM. If no end date is specified, one month of usage is returned. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list).\n", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fid)}/usage/monthly", + "method": "GET", + "title": "Info", + "schema": { + "properties": { + "start": { + "$ref": "#/definitions/team-monthly-usage/definitions/start_date" + }, + "end": { + "$ref": "#/definitions/team-monthly-usage/definitions/end_date" + } + }, + "required": [ + "start" + ], + "type": [ + "object" + ] + }, + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-monthly-usage" + }, + "type": [ + "array" + ] + } + } + ], + "properties": { + "addons": { + "$ref": "#/definitions/team-monthly-usage/definitions/addons" + }, + "apps": { + "description": "app usage in the team", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/team-monthly-usage/definitions/app_usage_monthly" + } + }, + "connect": { + "$ref": "#/definitions/team-monthly-usage/definitions/connect" + }, + "data": { + "$ref": "#/definitions/team-monthly-usage/definitions/data" + }, + "dynos": { + "$ref": "#/definitions/team-monthly-usage/definitions/dynos" }, - "log_drain_url": { - "description": "URL to which all apps will drain logs. Only settable during space creation and enables direct logging. Must use HTTPS.", - "example": "https://example.com/logs", - "type": [ - "string" - ] + "id": { + "$ref": "#/definitions/team-monthly-usage/definitions/id" }, - "cidr": { - "description": "The RFC-1918 CIDR the Private Space will use. It must be a /16 in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16", - "example": "172.20.20.30/16", - "default": "10.0.0.0/16", - "pattern": "^((?:10|172\\.(?:1[6-9]|2[0-9]|3[01])|192\\.168)\\..*.+\\/16)$", + "month": { + "$ref": "#/definitions/team-monthly-usage/definitions/month" + }, + "name": { + "$ref": "#/definitions/team-monthly-usage/definitions/name" + }, + "partner": { + "$ref": "#/definitions/team-monthly-usage/definitions/partner" + }, + "space": { + "$ref": "#/definitions/team-monthly-usage/definitions/space" + } + } + }, + "team-preferences": { + "description": "Tracks a Team's Preferences", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Team Preferences", + "type": [ + "object" + ], + "definitions": { + "default-permission": { + "description": "The default permission used when adding new members to the team", + "example": "member", "readOnly": false, + "enum": [ + "admin", + "member", + "viewer", + null + ], "type": [ + "null", "string" ] }, - "data_cidr": { - "description": "The RFC-1918 CIDR that the Private Space will use for the Heroku-managed peering connection that's automatically created when using Heroku Data add-ons. It must be between a /16 and a /20", - "example": "10.2.0.0/16", + "identity": { + "$ref": "#/definitions/team/definitions/identity" + }, + "addons-controls": { + "description": "Whether add-on service rules should be applied to add-on installations", + "example": true, "readOnly": false, "type": [ - "string" + "boolean", + "null" ] } }, "links": [ { - "description": "List existing spaces.", - "href": "/spaces", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/space" - }, - "type": [ - "array" - ] - }, - "title": "List" - }, - { - "description": "Info for existing space.", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}", + "description": "Retrieve Team Preferences", + "href": "/teams/{(%23%2Fdefinitions%2Fteam-preferences%2Fdefinitions%2Fidentity)}/preferences", "method": "GET", "rel": "self", "targetSchema": { - "$ref": "#/definitions/space" + "$ref": "#/definitions/team-preferences" }, - "title": "Info" + "title": "List" }, { - "description": "Update an existing space.", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}", + "description": "Update Team Preferences", + "href": "/teams/{(%23%2Fdefinitions%2Fteam-preferences%2Fdefinitions%2Fidentity)}/preferences", "method": "PATCH", "rel": "update", "schema": { - "properties": { - "name": { - "$ref": "#/definitions/space/definitions/name" - } - }, "type": [ "object" - ] - }, - "targetSchema": { - "$ref": "#/definitions/space" - }, - "title": "Update" - }, - { - "description": "Delete an existing space.", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}", - "method": "DELETE", - "rel": "destroy", - "targetSchema": { - "$ref": "#/definitions/space" - }, - "title": "Delete" - }, - { - "description": "Create a new space.", - "href": "/spaces", - "method": "POST", - "rel": "create", - "schema": { + ], "properties": { - "name": { - "$ref": "#/definitions/space/definitions/name" - }, - "team": { - "$ref": "#/definitions/team/definitions/name" - }, - "region": { - "$ref": "#/definitions/region/definitions/identity" - }, - "shield": { - "$ref": "#/definitions/space/definitions/shield" - }, - "cidr": { - "$ref": "#/definitions/space/definitions/cidr" - }, - "data_cidr": { - "$ref": "#/definitions/space/definitions/data_cidr" - }, - "log_drain_url": { - "$ref": "#/definitions/space/definitions/log_drain_url" + "addons-controls": { + "$ref": "#/definitions/team-preferences/definitions/addons-controls" } - }, - "required": [ - "name", - "team" - ], - "type": [ - "object" - ] + } }, "targetSchema": { - "$ref": "#/definitions/space" + "$ref": "#/definitions/team-preferences" }, - "title": "Create" + "title": "Update" } ], "properties": { - "created_at": { - "$ref": "#/definitions/space/definitions/created_at" - }, - "id": { - "$ref": "#/definitions/space/definitions/id" - }, - "name": { - "$ref": "#/definitions/space/definitions/name" - }, - "organization": { - "description": "organization that owns this space", - "properties": { - "name": { - "$ref": "#/definitions/team/definitions/name" - } - }, - "type": [ - "object" - ] - }, - "team": { - "description": "team that owns this space", - "properties": { - "id": { - "$ref": "#/definitions/team/definitions/id" - }, - "name": { - "$ref": "#/definitions/team/definitions/name" - } - }, - "type": [ - "object" - ] + "default-permission": { + "$ref": "#/definitions/team-preferences/definitions/default-permission" }, - "region": { - "description": "identity of space region", - "properties": { - "id": { - "$ref": "#/definitions/region/definitions/id" + "addons-controls": { + "$ref": "#/definitions/team-preferences/definitions/addons-controls" + } + } + }, + "team-space": { + "description": "A space is an isolated, highly available, secure app execution environment.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Team Space", + "type": [ + "object" + ], + "links": [ + { + "description": "List spaces owned by the team", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/spaces", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/space" }, - "name": { - "$ref": "#/definitions/region/definitions/name" - } + "type": [ + "array" + ] }, - "strictProperties": true, - "type": [ - "object" - ] - }, - "shield": { - "$ref": "#/definitions/space/definitions/shield" - }, - "state": { - "$ref": "#/definitions/space/definitions/state" - }, - "updated_at": { - "$ref": "#/definitions/space/definitions/updated_at" - }, - "cidr": { - "$ref": "#/definitions/space/definitions/cidr" - }, - "data_cidr": { - "$ref": "#/definitions/space/definitions/data_cidr" + "title": "List" } - } + ] }, - "stack": { - "description": "Stacks are the different application execution environments available in the Heroku platform.", + "team": { "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", + "description": "Teams allow you to manage access to a shared group of applications and other resources.", + "stability": "development", "strictProperties": true, - "title": "Heroku Platform API - Stack", + "title": "Heroku Platform API - Team", "type": [ "object" ], "definitions": { "created_at": { - "description": "when stack was introduced", + "description": "when the team was created", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, "type": [ - "string" + "string" + ] + }, + "credit_card_collections": { + "description": "whether charges incurred by the team are paid by credit card.", + "example": true, + "readOnly": true, + "type": [ + "boolean" ] }, "default": { - "description": "indicates this stack is the default for new apps", + "description": "whether to use this team when none is specified", "example": true, - "readOnly": true, + "readOnly": false, "type": [ "boolean" ] }, + "enterprise_account": { + "type": [ + "null", + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/enterprise-account/definitions/id" + }, + "name": { + "$ref": "#/definitions/enterprise-account/definitions/name" + } + } + }, "id": { - "description": "unique identifier of stack", + "description": "unique identifier of team", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -13582,771 +17450,807 @@ "identity": { "anyOf": [ { - "$ref": "#/definitions/stack/definitions/name" + "$ref": "#/definitions/team/definitions/name" }, { - "$ref": "#/definitions/stack/definitions/id" + "$ref": "#/definitions/team/definitions/id" + } + ] + }, + "identity_provider": { + "description": "Identity Provider associated with the Team", + "strictProperties": true, + "type": [ + "null", + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/identity-provider/definitions/id" + }, + "name": { + "$ref": "#/definitions/identity-provider/definitions/name" + }, + "owner": { + "$ref": "#/definitions/identity-provider/definitions/owner" } + } + }, + "device_data": { + "type": [ + "string", + "null" + ], + "description": "Device data string generated by the client", + "example": "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" + }, + "nonce": { + "type": [ + "string", + "null" + ], + "description": "Nonce generated by Braintree hosted fields form", + "example": "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" + }, + "address_1": { + "type": [ + "string" + ], + "description": "street address line 1", + "example": "40 Hickory Lane" + }, + "address_2": { + "type": [ + "string", + "null" + ], + "description": "street address line 2", + "example": "Suite 103" + }, + "card_number": { + "type": [ + "string", + "null" + ], + "description": "encrypted card number of payment method", + "example": "encrypted-card-number" + }, + "city": { + "type": [ + "string" + ], + "description": "city", + "example": "San Francisco" + }, + "country": { + "type": [ + "string" + ], + "description": "country", + "example": "US" + }, + "cvv": { + "type": [ + "string", + "null" + ], + "description": "card verification value", + "example": "123" + }, + "expiration_month": { + "type": [ + "string", + "null" + ], + "description": "expiration month", + "example": "11" + }, + "expiration_year": { + "type": [ + "string", + "null" + ], + "description": "expiration year", + "example": "2014" + }, + "first_name": { + "type": [ + "string" + ], + "description": "the first name for payment method", + "example": "Jason" + }, + "last_name": { + "type": [ + "string" + ], + "description": "the last name for payment method", + "example": "Walker" + }, + "other": { + "type": [ + "string", + "null" + ], + "description": "metadata", + "example": "Additional information for payment method" + }, + "postal_code": { + "type": [ + "string" + ], + "description": "postal code", + "example": "90210" + }, + "state": { + "type": [ + "string" + ], + "description": "state", + "example": "CA" + }, + "membership_limit": { + "description": "upper limit of members allowed in a team.", + "example": 25, + "readOnly": true, + "type": [ + "number", + "null" ] }, "name": { - "description": "unique name of stack", - "example": "heroku-18", + "description": "unique name of team", + "example": "example", "readOnly": true, "type": [ "string" ] }, - "state": { - "description": "availability of this stack: beta, deprecated or public", - "example": "public", + "provisioned_licenses": { + "description": "whether the team is provisioned licenses by salesforce.", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "role": { + "description": "role in the team", + "enum": [ + "admin", + "collaborator", + "member", + "owner", + null + ], + "example": "admin", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "type": { + "description": "type of team.", + "example": "team", + "enum": [ + "enterprise", + "team" + ], "readOnly": true, "type": [ "string" ] }, "updated_at": { - "description": "when stack was last modified", + "description": "when the team was updated", "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, "type": [ "string" ] - } - }, - "links": [ - { - "description": "Stack info.", - "href": "/stacks/{(%23%2Fdefinitions%2Fstack%2Fdefinitions%2Fidentity)}", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/stack" - }, - "title": "Info" - }, - { - "description": "List available stacks.", - "href": "/stacks", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/stack" - }, - "type": [ - "array" - ] - }, - "title": "List" - } - ], - "properties": { - "default": { - "$ref": "#/definitions/stack/definitions/default" - }, - "created_at": { - "$ref": "#/definitions/stack/definitions/created_at" - }, - "id": { - "$ref": "#/definitions/stack/definitions/id" }, - "name": { - "$ref": "#/definitions/stack/definitions/name" - }, - "state": { - "$ref": "#/definitions/stack/definitions/state" + "pipeline_cost_consent_at": { + "description": "Time when team was consented into new pipeline costs", + "example": "01-01-2023", + "readOnly": false, + "format": "date-time", + "type": [ + "string", + "null" + ] }, - "updated_at": { - "$ref": "#/definitions/stack/definitions/updated_at" + "pipeline_cost_consent_user_email": { + "description": "Email of team user that consented to new pipeline costs", + "example": "heroku@salesforce.com", + "readOnly": false, + "type": [ + "string", + "null" + ] } - } - }, - "team-add-on": { - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", - "title": "Heroku Platform API - Team Add-on", - "type": [ - "object" - ], + }, "links": [ { - "description": "List add-ons used across all Team apps", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/addons", + "description": "List teams in which you are a member.", + "href": "/teams", "method": "GET", "rel": "instances", "targetSchema": { "items": { - "$ref": "#/definitions/add-on" + "$ref": "#/definitions/team" }, "type": [ "array" ] }, - "title": "List For Team" - } - ] - }, - "team-app-collaborator": { - "description": "A team collaborator represents an account that has been given access to a team app on Heroku.", - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "development", - "title": "Heroku Platform API - Team App Collaborator", - "type": [ - "object" - ], - "definitions": { - "identity": { - "anyOf": [ - { - "$ref": "#/definitions/collaborator/definitions/email" - } - ] - } - }, - "links": [ + "title": "List" + }, { - "description": "Create a new collaborator on a team app. Use this endpoint instead of the `/apps/{app_id_or_name}/collaborator` endpoint when you want the collaborator to be granted [permissions] (https://devcenter.heroku.com/articles/org-users-access#roles-and-permissions) according to their role in the team.", - "href": "/teams/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/collaborators", + "description": "Info for a team.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/team" + }, + "title": "Info" + }, + { + "description": "Update team properties.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "default": { + "$ref": "#/definitions/team/definitions/default" + }, + "name": { + "$ref": "#/definitions/team/definitions/name" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/team" + }, + "title": "Update" + }, + { + "description": "Create a new team.", + "href": "/teams", "method": "POST", "rel": "create", "schema": { "properties": { - "permissions": { - "type": [ - "array" - ], - "items": { - "$ref": "#/definitions/team-app-permission/definitions/name" - }, - "description": "An array of permissions to give to the collaborator." + "name": { + "$ref": "#/definitions/team/definitions/name" }, - "silent": { - "$ref": "#/definitions/collaborator/definitions/silent" + "address_1": { + "$ref": "#/definitions/team/definitions/address_1" }, - "user": { - "$ref": "#/definitions/account/definitions/identity" + "address_2": { + "$ref": "#/definitions/team/definitions/address_2" + }, + "card_number": { + "$ref": "#/definitions/team/definitions/card_number" + }, + "city": { + "$ref": "#/definitions/team/definitions/city" + }, + "country": { + "$ref": "#/definitions/team/definitions/country" + }, + "cvv": { + "$ref": "#/definitions/team/definitions/cvv" + }, + "expiration_month": { + "$ref": "#/definitions/team/definitions/expiration_month" + }, + "expiration_year": { + "$ref": "#/definitions/team/definitions/expiration_year" + }, + "first_name": { + "$ref": "#/definitions/team/definitions/first_name" + }, + "last_name": { + "$ref": "#/definitions/team/definitions/last_name" + }, + "other": { + "$ref": "#/definitions/team/definitions/other" + }, + "postal_code": { + "$ref": "#/definitions/team/definitions/postal_code" + }, + "state": { + "$ref": "#/definitions/team/definitions/state" + }, + "nonce": { + "$ref": "#/definitions/team/definitions/nonce" + }, + "device_data": { + "$ref": "#/definitions/team/definitions/device_data" } }, "required": [ - "user" + "name" ], "type": [ "object" ] }, "targetSchema": { - "$ref": "#/definitions/team-app-collaborator" + "$ref": "#/definitions/team" }, "title": "Create" }, { - "description": "Delete an existing collaborator from a team app.", - "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}/collaborators/{(%23%2Fdefinitions%2Fteam-app-collaborator%2Fdefinitions%2Fidentity)}", + "description": "Delete an existing team.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}", "method": "DELETE", "rel": "destroy", "targetSchema": { - "$ref": "#/definitions/team-app-collaborator" + "$ref": "#/definitions/team" }, "title": "Delete" }, { - "description": "Info for a collaborator on a team app.", - "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}/collaborators/{(%23%2Fdefinitions%2Fteam-app-collaborator%2Fdefinitions%2Fidentity)}", + "description": "List teams for an enterprise account.", + "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fidentity)}/teams", "method": "GET", - "rel": "self", + "rel": "instances", "targetSchema": { - "$ref": "#/definitions/team-app-collaborator" + "items": { + "$ref": "#/definitions/team" + }, + "type": [ + "array" + ] }, - "title": "Info" + "title": "List by Enterprise Account" }, { - "description": "Update an existing collaborator from a team app.", - "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}/collaborators/{(%23%2Fdefinitions%2Fteam-app-collaborator%2Fdefinitions%2Fidentity)}", - "method": "PATCH", - "rel": "update", + "description": "Create a team in an enterprise account.", + "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fidentity)}/teams", + "method": "POST", + "rel": "create", "schema": { "properties": { - "permissions": { - "type": [ - "array" - ], - "items": { - "$ref": "#/definitions/team-app-permission/definitions/name" - }, - "description": "An array of permissions to give to the collaborator." + "name": { + "$ref": "#/definitions/team/definitions/name" } }, "required": [ - "permissions" + "name" ], "type": [ "object" ] }, "targetSchema": { - "$ref": "#/definitions/team-app-collaborator" - }, - "title": "Update" - }, - { - "description": "List collaborators on a team app.", - "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}/collaborators", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/team-app-collaborator" - }, - "type": [ - "array" - ] + "$ref": "#/definitions/team" }, - "title": "List" + "title": "Create in Enterprise Account" } ], "properties": { - "app": { - "description": "app collaborator belongs to", - "properties": { - "name": { - "$ref": "#/definitions/app/definitions/name" - }, - "id": { - "$ref": "#/definitions/app/definitions/id" - } - }, - "strictProperties": true, - "type": [ - "object" - ] + "id": { + "$ref": "#/definitions/team/definitions/id" }, "created_at": { - "$ref": "#/definitions/collaborator/definitions/created_at" + "$ref": "#/definitions/team/definitions/created_at" }, - "id": { - "$ref": "#/definitions/collaborator/definitions/id" + "credit_card_collections": { + "$ref": "#/definitions/team/definitions/credit_card_collections" }, - "permissions": { - "type": [ - "array" - ], - "items": { - "$ref": "#/definitions/team-app-permission" - }, - "description": "array of permissions for the collaborator (only applicable if the app is on a team)" + "default": { + "$ref": "#/definitions/team/definitions/default" + }, + "enterprise_account": { + "$ref": "#/definitions/team/definitions/enterprise_account" + }, + "identity_provider": { + "$ref": "#/definitions/team/definitions/identity_provider" + }, + "membership_limit": { + "$ref": "#/definitions/team/definitions/membership_limit" + }, + "pipeline_cost_consent_at": { + "$ref": "#/definitions/team/definitions/pipeline_cost_consent_at" + }, + "pipeline_cost_consent_user_email": { + "$ref": "#/definitions/team/definitions/pipeline_cost_consent_user_email" + }, + "name": { + "$ref": "#/definitions/team/definitions/name" + }, + "provisioned_licenses": { + "$ref": "#/definitions/team/definitions/provisioned_licenses" }, "role": { "$ref": "#/definitions/team/definitions/role" }, - "updated_at": { - "$ref": "#/definitions/collaborator/definitions/updated_at" + "type": { + "$ref": "#/definitions/team/definitions/type" }, - "user": { - "description": "identity of collaborated account", - "properties": { - "email": { - "$ref": "#/definitions/account/definitions/email" - }, - "federated": { - "$ref": "#/definitions/account/definitions/federated" - }, - "id": { - "$ref": "#/definitions/account/definitions/id" - } - }, - "strictProperties": true, - "type": [ - "object" - ] + "updated_at": { + "$ref": "#/definitions/team/definitions/updated_at" } } }, - "team-app-permission": { + "telemetry-drain": { + "description": "A telemetry drain forwards OpenTelemetry traces, metrics, and logs to your own consumer. For Fir-generation apps only.", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "description": "A team app permission is a behavior that is assigned to a user in a team app.", "stability": "prototype", - "title": "Heroku Platform API - Team App Permission", + "strictProperties": true, + "title": "Heroku Platform API - Telemetry Drain", "type": [ "object" ], "definitions": { + "id": { + "description": "unique identifier of telemetry drain", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, "identity": { "anyOf": [ { - "$ref": "#/definitions/team-app-permission/definitions/name" + "$ref": "#/definitions/telemetry-drain/definitions/id" } ] }, - "name": { - "description": "The name of the app permission.", - "example": "view", + "created_at": { + "description": "when the telemetry drain was created", + "example": "2024-12-01T12:00:00Z", + "format": "date-time", "readOnly": true, "type": [ "string" ] }, - "description": { - "description": "A description of what the app permission allows.", - "example": "Can manage config, deploy, run commands and restart the app.", + "updated_at": { + "description": "when telemetry drain was last updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", "readOnly": true, "type": [ "string" ] - } - }, - "links": [ - { - "description": "Lists permissions available to teams.", - "href": "/teams/permissions", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/team-app-permission" - }, - "type": [ - "array" - ] - }, - "title": "List" - } - ], - "properties": { - "name": { - "$ref": "#/definitions/team-app-permission/definitions/name" }, - "description": { - "$ref": "#/definitions/team-app-permission/definitions/description" - } - } - }, - "team-app": { - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "description": "A team app encapsulates the team specific functionality of Heroku apps.", - "stability": "development", - "title": "Heroku Platform API - Team App", - "type": [ - "object" - ], - "definitions": { - "locked": { - "default": false, - "description": "are other team members forbidden from joining this app.", - "example": false, + "signal": { + "description": "OpenTelemetry signal to be sent to the telemetry drain", + "readOnly": true, + "example": "traces", "type": [ - "boolean" + "string" + ], + "enum": [ + "traces", + "metrics", + "logs" ] }, - "identity": { - "$ref": "#/definitions/app/definitions/name" - }, - "internal_routing": { - "default": false, - "description": "describes whether a Private Spaces app is externally routable or not", - "example": false, + "signals": { + "description": "OpenTelemetry signals to send to telemetry drain", + "example": [ + "traces", + "metrics" + ], "readOnly": false, + "minItems": 1, + "uniqueItems": true, "type": [ - "boolean", - "null" - ] + "array" + ], + "items": { + "$ref": "#/definitions/telemetry-drain/definitions/signal" + } }, - "joined": { - "default": false, - "description": "is the current member a collaborator on this app.", - "example": false, + "exporter_type": { + "description": "the transport type to be used for your OpenTelemetry consumer", + "readOnly": true, + "example": "otlphttp", "type": [ - "boolean" + "string" + ], + "enum": [ + "otlphttp", + "otlp" ] }, - "personal": { - "default": false, - "description": "force creation of the app in the user account even if a default team is set.", - "example": false, + "exporter_endpoint": { + "description": "URI of your OpenTelemetry consumer", + "readOnly": false, + "example": "https://api.otelproduct.example/consumer", + "maxLength": 1000, "type": [ - "boolean" + "string" ] - } - }, - "links": [ - { - "description": "Create a new app in the specified team, in the default team if unspecified, or in personal account, if default team is not set.", - "href": "/teams/apps", - "method": "POST", - "rel": "create", - "schema": { - "properties": { - "locked": { - "$ref": "#/definitions/team-app/definitions/locked" - }, - "name": { - "$ref": "#/definitions/app/definitions/name" - }, - "team": { - "$ref": "#/definitions/team/definitions/name" - }, - "personal": { - "$ref": "#/definitions/team-app/definitions/personal" - }, - "region": { - "$ref": "#/definitions/region/definitions/name" - }, - "space": { - "$ref": "#/definitions/space/definitions/name" - }, - "stack": { - "$ref": "#/definitions/stack/definitions/name" - }, - "internal_routing": { - "$ref": "#/definitions/team-app/definitions/internal_routing" - } - }, - "type": [ - "object" - ] + }, + "exporter_headers": { + "description": "JSON headers to send to your OpenTelemetry consumer", + "readOnly": false, + "example": { + "API-Key": "example_api_key_012345", + "Environment": "production" }, - "targetSchema": { - "$ref": "#/definitions/team-app" + "default": {}, + "additionalProperties": false, + "maxItems": 20, + "patternProperties": { + "^[A-Za-z0-9\\-_]{1,100}$": { + "maxLength": 1000, + "type": [ + "string" + ] + } }, - "title": "Create" + "type": [ + "object" + ] }, - { - "description": "Info for a team app.", - "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/team-app" + "exporter": { + "description": "OpenTelemetry exporter configuration", + "readOnly": false, + "additionalProperties": false, + "properties": { + "type": { + "$ref": "#/definitions/telemetry-drain/definitions/exporter_type" + }, + "endpoint": { + "$ref": "#/definitions/telemetry-drain/definitions/exporter_endpoint" + }, + "headers": { + "$ref": "#/definitions/telemetry-drain/definitions/exporter_headers" + } }, - "title": "Info" + "required": [ + "type", + "endpoint" + ], + "type": [ + "object" + ] }, - { - "description": "Lock or unlock a team app.", - "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}", - "method": "PATCH", - "rel": "update", - "schema": { - "properties": { - "locked": { - "$ref": "#/definitions/team-app/definitions/locked" - } + "owner": { + "description": "entity that owns this telemetry drain", + "properties": { + "id": { + "description": "unique identifier of owner", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] }, - "required": [ - "locked" - ], - "type": [ - "object" - ] - }, - "targetSchema": { - "$ref": "#/definitions/team-app" + "type": { + "description": "type of owner", + "enum": [ + "app", + "space" + ], + "example": "app", + "readOnly": true, + "type": [ + "string" + ] + } }, - "title": "Update Locked" - }, + "readOnly": false, + "required": [ + "id", + "type" + ], + "type": [ + "object" + ] + } + }, + "links": [ { - "description": "Transfer an existing team app to another Heroku account.", - "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}", - "method": "PATCH", - "rel": "update", + "description": "Create a telemetry drain.", + "href": "/telemetry-drains", + "method": "POST", + "rel": "create", "schema": { + "additionalProperties": false, "properties": { "owner": { - "$ref": "#/definitions/account/definitions/identity" + "$ref": "#/definitions/telemetry-drain/definitions/owner" + }, + "signals": { + "$ref": "#/definitions/telemetry-drain/definitions/signals" + }, + "exporter": { + "$ref": "#/definitions/telemetry-drain/definitions/exporter" } }, "required": [ - "owner" + "owner", + "signals", + "exporter" ], "type": [ "object" ] }, - "title": "Transfer to Account" + "targetSchema": { + "$ref": "#/definitions/telemetry-drain" + }, + "title": "Create" }, { - "description": "Transfer an existing team app to another team.", - "href": "/teams/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}", - "method": "PATCH", - "rel": "update", - "schema": { - "properties": { - "owner": { - "$ref": "#/definitions/team/definitions/name" - } + "description": "List telemetry drains for an app.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/telemetry-drains", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/telemetry-drain" }, - "required": [ - "owner" - ], "type": [ - "object" + "array" ] }, - "targetSchema": { - "$ref": "#/definitions/team-app" - }, - "title": "Transfer to Team" + "title": "List by App" }, { - "description": "List team apps.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/apps", + "description": "List telemetry drains for a space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/telemetry-drains", "method": "GET", "rel": "instances", "targetSchema": { "items": { - "$ref": "#/definitions/team-app" + "$ref": "#/definitions/telemetry-drain" }, "type": [ "array" ] }, - "title": "List By Team" - } - ], - "properties": { - "archived_at": { - "$ref": "#/definitions/app/definitions/archived_at" + "title": "List by Space" }, - "buildpack_provided_description": { - "$ref": "#/definitions/app/definitions/buildpack_provided_description" - }, - "build_stack": { - "description": "identity of the stack that will be used for new builds", - "properties": { - "id": { - "$ref": "#/definitions/stack/definitions/id" + { + "description": "Update a telemetry drain.", + "href": "/telemetry-drains/{(%23%2Fdefinitions%2Ftelemetry-drain%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", + "schema": { + "additionalProperties": false, + "properties": { + "signals": { + "$ref": "#/definitions/telemetry-drain/definitions/signals" + }, + "exporter": { + "$ref": "#/definitions/telemetry-drain/definitions/exporter" + } }, - "name": { - "$ref": "#/definitions/stack/definitions/name" - } + "type": [ + "object" + ] }, - "type": [ - "object" - ] - }, - "created_at": { - "$ref": "#/definitions/app/definitions/created_at" - }, - "git_url": { - "$ref": "#/definitions/app/definitions/git_url" - }, - "id": { - "$ref": "#/definitions/app/definitions/id" - }, - "internal_routing": { - "$ref": "#/definitions/team-app/definitions/internal_routing" - }, - "joined": { - "$ref": "#/definitions/team-app/definitions/joined" - }, - "locked": { - "$ref": "#/definitions/team-app/definitions/locked" - }, - "maintenance": { - "$ref": "#/definitions/app/definitions/maintenance" - }, - "name": { - "$ref": "#/definitions/app/definitions/name" - }, - "team": { - "description": "team that owns this app", - "properties": { - "name": { - "$ref": "#/definitions/team/definitions/name" - } + "targetSchema": { + "$ref": "#/definitions/telemetry-drain" }, - "type": [ - "null", - "object" - ] + "title": "Update" }, - "owner": { - "description": "identity of app owner", - "properties": { - "email": { - "$ref": "#/definitions/account/definitions/email" - }, - "id": { - "$ref": "#/definitions/account/definitions/id" - } + { + "description": "Delete a telemetry drain.", + "href": "/telemetry-drains/{(%23%2Fdefinitions%2Ftelemetry-drain%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/telemetry-drain" }, - "type": [ - "null", - "object" - ] + "title": "Delete" }, - "region": { - "description": "identity of app region", - "properties": { - "id": { - "$ref": "#/definitions/region/definitions/id" - }, - "name": { - "$ref": "#/definitions/region/definitions/name" - } + { + "description": "Info for a telemetry drain.", + "href": "/telemetry-drains/{(%23%2Fdefinitions%2Ftelemetry-drain%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/telemetry-drain" }, - "type": [ - "object" - ] - }, - "released_at": { - "$ref": "#/definitions/app/definitions/released_at" + "title": "Info" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/telemetry-drain/definitions/created_at" }, - "repo_size": { - "$ref": "#/definitions/app/definitions/repo_size" + "id": { + "$ref": "#/definitions/telemetry-drain/definitions/id" }, - "slug_size": { - "$ref": "#/definitions/app/definitions/slug_size" + "owner": { + "$ref": "#/definitions/telemetry-drain/definitions/owner" }, - "space": { - "description": "identity of space", - "properties": { - "id": { - "$ref": "#/definitions/space/definitions/id" - }, - "name": { - "$ref": "#/definitions/space/definitions/name" - } - }, - "type": [ - "null", - "object" - ] + "signals": { + "$ref": "#/definitions/telemetry-drain/definitions/signals" }, - "stack": { - "description": "identity of app stack", - "properties": { - "id": { - "$ref": "#/definitions/stack/definitions/id" - }, - "name": { - "$ref": "#/definitions/stack/definitions/name" - } - }, - "type": [ - "object" - ] + "exporter": { + "$ref": "#/definitions/telemetry-drain/definitions/exporter" }, "updated_at": { - "$ref": "#/definitions/app/definitions/updated_at" - }, - "web_url": { - "$ref": "#/definitions/app/definitions/web_url" + "$ref": "#/definitions/telemetry-drain/definitions/updated_at" } } }, - "team-daily-usage": { + "test-case": { "$schema": "http://json-schema.org/draft-04/hyper-schema", - "description": "Usage for an enterprise team at a daily resolution.", - "stability": "development", + "title": "Test Case", + "description": "A single test case belonging to a test run", + "stability": "prototype", "strictProperties": true, - "title": "Heroku Platform API - Team Daily Usage", "type": [ "object" ], "definitions": { - "addons": { - "description": "total add-on credits used", - "example": 250.0, - "readOnly": true, - "type": [ - "number" - ] - }, - "app_usage_daily": { - "description": "Usage for an app at a daily resolution.", - "type": [ - "object" - ], - "properties": { - "addons": { - "$ref": "#/definitions/team-daily-usage/definitions/addons" - }, - "app_name": { - "$ref": "#/definitions/app/definitions/name" - }, - "data": { - "$ref": "#/definitions/team-daily-usage/definitions/data" - }, - "dynos": { - "$ref": "#/definitions/team-daily-usage/definitions/dynos" - }, - "partner": { - "$ref": "#/definitions/team-daily-usage/definitions/partner" - } - } - }, - "data": { - "description": "total add-on credits used for first party add-ons", - "example": 34.89, - "readOnly": true, - "type": [ - "number" - ] - }, - "date": { - "description": "date of the usage", - "example": "2019-01-01", - "format": "date", + "id": { + "description": "unique identifier of a test case", "readOnly": true, + "format": "uuid", "type": [ "string" ] }, - "dynos": { - "description": "dynos used", - "example": 1.548, - "readOnly": true, + "description": { + "description": "description of the test case", "type": [ - "number" + "string" ] }, - "id": { - "description": "team identifier", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", - "readOnly": true, + "diagnostic": { + "description": "meta information about the test case", "type": [ "string" ] }, - "name": { - "description": "name of the team", - "example": "ops", - "readOnly": true, + "directive": { + "description": "special note about the test case e.g. skipped, todo", "type": [ "string" ] }, - "partner": { - "description": "total add-on credits used for third party add-ons", - "example": 12.34, - "readOnly": true, + "passed": { + "description": "whether the test case was successful", "type": [ - "number" + "boolean" ] }, - "space": { - "description": "space credits used", - "example": 1.548, - "readOnly": true, + "number": { + "description": "the test number", "type": [ - "number" + "integer" ] }, - "start_date": { - "description": "range start date", - "example": "2019-01-25", - "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$", + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/test-case/definitions/id" + } + ] + }, + "created_at": { + "description": "when test case was created", + "format": "date-time", "readOnly": true, "type": [ "string" ] }, - "end_date": { - "description": "range end date", - "example": "2019-02-25", - "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$", + "updated_at": { + "description": "when test case was updated", + "format": "date-time", "readOnly": true, "type": [ "string" @@ -14355,223 +18259,175 @@ }, "links": [ { - "description": "Retrieves usage for an enterprise team for a range of days. Start and end dates can be specified as query parameters using the date format YYYY-MM-DD. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list).\n", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fid)}/usage/daily", + "description": "List test cases", + "href": "/test-runs/{(%23%2Fdefinitions%2Ftest-run%2Fdefinitions%2Fid)}/test-cases", "method": "GET", - "title": "Info", - "schema": { - "properties": { - "start": { - "$ref": "#/definitions/team-daily-usage/definitions/start_date" - }, - "end": { - "$ref": "#/definitions/team-daily-usage/definitions/end_date" - } - }, - "required": [ - "start" - ], - "type": [ - "object" - ] - }, "rel": "instances", "targetSchema": { "items": { - "$ref": "#/definitions/team-daily-usage" - }, - "type": [ - "array" - ] - } + "$ref": "#/definitions/test-case" + } + }, + "type": [ + "array" + ], + "title": "List" } ], "properties": { - "addons": { - "$ref": "#/definitions/team-daily-usage/definitions/addons" + "id": { + "$ref": "#/definitions/test-case/definitions/id" }, - "apps": { - "description": "app usage in the team", - "type": [ - "array" - ], - "items": { - "$ref": "#/definitions/team-daily-usage/definitions/app_usage_daily" - } + "created_at": { + "$ref": "#/definitions/test-case/definitions/created_at" }, - "data": { - "$ref": "#/definitions/team-daily-usage/definitions/data" + "updated_at": { + "$ref": "#/definitions/test-case/definitions/updated_at" }, - "date": { - "$ref": "#/definitions/team-daily-usage/definitions/date" + "description": { + "$ref": "#/definitions/test-case/definitions/description" }, - "dynos": { - "$ref": "#/definitions/team-daily-usage/definitions/dynos" + "diagnostic": { + "$ref": "#/definitions/test-case/definitions/diagnostic" }, - "id": { - "$ref": "#/definitions/team-daily-usage/definitions/id" + "directive": { + "$ref": "#/definitions/test-case/definitions/directive" }, - "name": { - "$ref": "#/definitions/team-daily-usage/definitions/name" + "passed": { + "$ref": "#/definitions/test-case/definitions/passed" }, - "partner": { - "$ref": "#/definitions/team-daily-usage/definitions/partner" + "number": { + "$ref": "#/definitions/test-case/definitions/number" }, - "space": { - "$ref": "#/definitions/team-daily-usage/definitions/space" - } - } - }, - "team-delinquency": { - "description": "A Heroku team becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent teams if their invoices remain unpaid.", - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "development", - "strictProperties": true, - "title": "Heroku Platform API - Team Delinquency", - "type": [ - "object" - ], - "definitions": { - "scheduled_suspension_time": { - "description": "scheduled time of when we will suspend your team due to delinquency", - "example": "2024-01-01T12:00:00Z", - "format": "date-time", - "readOnly": true, + "test_node": { + "description": "the test node which executed this test case", + "properties": { + "id": { + "$ref": "#/definitions/test-node/definitions/identity" + } + }, "type": [ - "string", - "null" + "object" ] }, - "scheduled_deletion_time": { - "description": "scheduled time of when we will delete your team due to delinquency", - "example": "2024-01-01T12:00:00Z", - "format": "date-time", - "readOnly": true, + "test_run": { + "description": "the test run which owns this test case", + "properties": { + "id": { + "$ref": "#/definitions/test-run/definitions/identity" + } + }, "type": [ - "string", - "null" + "object" ] } - }, - "links": [ - { - "description": "Team delinquency information.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/delinquency", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/team-delinquency" - }, - "title": "Info" - } - ], - "properties": { - "scheduled_suspension_time": { - "$ref": "#/definitions/team-delinquency/definitions/scheduled_suspension_time" - }, - "scheduled_deletion_time": { - "$ref": "#/definitions/team-delinquency/definitions/scheduled_deletion_time" - } } }, - "team-feature": { - "description": "A team feature represents a feature enabled on a team account.", + "test-node": { "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "development", + "title": "Test Node", + "description": "A single test node belonging to a test run", + "stability": "prototype", "strictProperties": true, - "title": "Heroku Platform API - Team Feature", "type": [ "object" ], "definitions": { - "created_at": { - "description": "when team feature was created", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "id": { + "description": "unique identifier of a test node", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", "readOnly": true, "type": [ "string" ] }, - "description": { - "description": "description of team feature", - "example": "Causes account to example.", + "attach_url": { + "description": "a URL to stream output from for debug runs or null for non-debug runs", + "example": "rendezvous://rendezvous.runtime.heroku.com:5000/{rendezvous-id}", "readOnly": true, "type": [ - "string" + "string", + "null" ] }, - "doc_url": { - "description": "documentation URL of team feature", - "example": "http://devcenter.heroku.com/articles/example", + "created_at": { + "description": "when test node was created", + "format": "date-time", "readOnly": true, "type": [ "string" ] }, - "enabled": { - "description": "whether or not team feature has been enabled", - "example": true, - "readOnly": false, + "error_status": { + "description": "the status of the test run when the error occured", "type": [ - "boolean" + "string", + "null" ] }, - "id": { - "description": "unique identifier of team feature", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", - "readOnly": true, + "exit_code": { + "description": "the exit code of the test script", "type": [ - "string" + "integer", + "null" ] }, "identity": { "anyOf": [ { - "$ref": "#/definitions/team-feature/definitions/id" - }, - { - "$ref": "#/definitions/team-feature/definitions/name" + "$ref": "#/definitions/test-node/definitions/id" } ] }, - "name": { - "description": "unique name of team feature", - "example": "name", - "readOnly": true, + "index": { + "description": "The index of the test node", "type": [ - "string" + "integer" ] }, - "state": { - "description": "state of team feature", - "example": "public", - "readOnly": true, + "message": { + "description": "human friendly message indicating reason for an error", + "type": [ + "string", + "null" + ] + }, + "output_stream_url": { + "description": "the streaming output for the test node", + "example": "https://example.com/output.log", "type": [ "string" ] }, - "updated_at": { - "description": "when team feature was updated", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", - "readOnly": true, + "setup_stream_url": { + "description": "the streaming test setup output for the test node", + "example": "https://example.com/test-setup.log", "type": [ "string" ] }, - "display_name": { - "description": "user readable feature name", - "example": "My Feature", + "status": { + "description": "current state of the test run", + "enum": [ + "pending", + "cancelled", + "creating", + "building", + "running", + "succeeded", + "failed", + "errored", + "debugging" + ], "readOnly": true, "type": [ "string" ] }, - "feedback_email": { - "description": "e-mail to send feedback about the feature", - "example": "feedback@heroku.com", + "updated_at": { + "description": "when test node was updated", + "format": "date-time", "readOnly": true, "type": [ "string" @@ -14580,79 +18436,150 @@ }, "links": [ { - "description": "Info for an existing team feature.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/features/{(%23%2Fdefinitions%2Fteam-feature%2Fdefinitions%2Fidentity)}", - "method": "GET", - "rel": "self", - "targetSchema": { - "$ref": "#/definitions/team-feature" - }, - "title": "Info" - }, - { - "description": "List existing team features.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/features", + "description": "List test nodes", + "href": "/test-runs/{(%23%2Fdefinitions%2Ftest-run%2Fdefinitions%2Fidentity)}/test-nodes", "method": "GET", "rel": "instances", "targetSchema": { "items": { - "$ref": "#/definitions/team-feature" - }, - "type": [ - "array" - ] + "$ref": "#/definitions/test-node" + } }, + "type": [ + "array" + ], "title": "List" } ], "properties": { "created_at": { - "$ref": "#/definitions/team-feature/definitions/created_at" + "$ref": "#/definitions/test-node/definitions/created_at" }, - "description": { - "$ref": "#/definitions/team-feature/definitions/description" + "dyno": { + "description": "the dyno which belongs to this test node", + "properties": { + "id": { + "$ref": "#/definitions/dyno/definitions/identity" + }, + "attach_url": { + "$ref": "#/definitions/test-node/definitions/attach_url" + } + }, + "type": [ + "object", + "null" + ] }, - "doc_url": { - "$ref": "#/definitions/team-feature/definitions/doc_url" + "error_status": { + "$ref": "#/definitions/test-node/definitions/error_status" }, - "enabled": { - "$ref": "#/definitions/team-feature/definitions/enabled" + "exit_code": { + "$ref": "#/definitions/test-node/definitions/exit_code" }, "id": { - "$ref": "#/definitions/team-feature/definitions/id" + "$ref": "#/definitions/test-node/definitions/identity" }, - "name": { - "$ref": "#/definitions/team-feature/definitions/name" + "index": { + "$ref": "#/definitions/test-node/definitions/index" }, - "state": { - "$ref": "#/definitions/team-feature/definitions/state" + "message": { + "$ref": "#/definitions/test-node/definitions/message" }, - "updated_at": { - "$ref": "#/definitions/team-feature/definitions/updated_at" + "output_stream_url": { + "$ref": "#/definitions/test-node/definitions/output_stream_url" }, - "display_name": { - "$ref": "#/definitions/team-feature/definitions/display_name" + "pipeline": { + "description": "the pipeline which owns this test node", + "properties": { + "id": { + "$ref": "#/definitions/pipeline/definitions/identity" + } + }, + "type": [ + "object" + ] }, - "feedback_email": { - "$ref": "#/definitions/team-feature/definitions/feedback_email" + "setup_stream_url": { + "$ref": "#/definitions/test-node/definitions/setup_stream_url" + }, + "status": { + "$ref": "#/definitions/test-node/definitions/status" + }, + "updated_at": { + "$ref": "#/definitions/test-node/definitions/updated_at" + }, + "test_run": { + "description": "the test run which owns this test node", + "properties": { + "id": { + "$ref": "#/definitions/test-run/definitions/identity" + } + }, + "type": [ + "object" + ] } } }, - "team-invitation": { - "description": "A team invitation represents an invite to a team.", + "test-run": { "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "development", + "title": "Test Run", + "description": "An execution or trial of one or more tests", + "stability": "prototype", "strictProperties": true, - "title": "Heroku Platform API - Team Invitation", "type": [ "object" ], "definitions": { - "created_at": { - "description": "when invitation was created", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "actor_email": { + "description": "the email of the actor triggering the test run", + "type": [ + "string" + ], + "format": "email" + }, + "clear_cache": { + "description": "whether the test was run with an empty cache", + "type": [ + "boolean", + "null" + ] + }, + "commit_branch": { + "description": "the branch of the repository that the test run concerns", + "type": [ + "string" + ] + }, + "commit_message": { + "description": "the message for the commit under test", + "type": [ + "string" + ] + }, + "commit_sha": { + "description": "the SHA hash of the commit under test", + "type": [ + "string" + ] + }, + "debug": { + "description": "whether the test run was started for interactive debugging", + "type": [ + "boolean" + ] + }, + "app_setup": { + "description": "the app setup for the test run", + "type": [ + "null", + "object" + ] + }, + "id": { + "description": "unique identifier of a test run", "readOnly": true, + "format": "uuid", "type": [ "string" ] @@ -14660,446 +18587,509 @@ "identity": { "anyOf": [ { - "$ref": "#/definitions/team-invitation/definitions/id" + "$ref": "#/definitions/test-run/definitions/id" } ] }, - "id": { - "description": "unique identifier of an invitation", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", + "created_at": { + "description": "when test run was created", + "format": "date-time", "readOnly": true, "type": [ "string" ] }, - "token": { - "description": "special token for invitation", - "example": "614ae25aa2d4802096cd7c18625b526c", + "message": { + "description": "human friendly message indicating reason for an error", + "type": [ + "string", + "null" + ] + }, + "number": { + "description": "the auto incrementing test run number", + "type": [ + "integer" + ] + }, + "source_blob_url": { + "description": "The download location for the source code to be tested", + "type": [ + "string" + ] + }, + "status": { + "description": "current state of the test run", + "enum": [ + "pending", + "cancelled", + "creating", + "building", + "running", + "succeeded", + "failed", + "errored", + "debugging" + ], "readOnly": true, "type": [ "string" ] }, "updated_at": { - "description": "when invitation was updated", - "example": "2012-01-01T12:00:00Z", + "description": "when test-run was updated", "format": "date-time", "readOnly": true, "type": [ "string" ] + }, + "warning_message": { + "description": "human friently warning emitted during the test run", + "type": [ + "string", + "null" + ] } }, "links": [ { - "description": "Get a list of a team's Identity Providers", - "title": "List", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fname)}/invitations", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/team-invitation" - }, - "type": [ - "array" - ] - } - }, - { - "description": "Create Team Invitation", - "title": "Create", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/invitations", - "method": "PUT", - "rel": "update", + "description": "Create a new test-run.", + "href": "/test-runs", + "method": "POST", + "rel": "create", "schema": { "properties": { - "email": { - "$ref": "#/definitions/account/definitions/email" + "commit_branch": { + "$ref": "#/definitions/test-run/definitions/commit_branch" }, - "role": { - "$ref": "#/definitions/team/definitions/role" + "commit_message": { + "$ref": "#/definitions/test-run/definitions/commit_message" + }, + "commit_sha": { + "$ref": "#/definitions/test-run/definitions/commit_sha" + }, + "debug": { + "$ref": "#/definitions/test-run/definitions/debug" + }, + "organization": { + "$ref": "#/definitions/team/definitions/identity" + }, + "pipeline": { + "$ref": "#/definitions/pipeline/definitions/identity" + }, + "source_blob_url": { + "$ref": "#/definitions/test-run/definitions/source_blob_url" } }, "required": [ - "email", - "role" + "commit_branch", + "commit_message", + "commit_sha", + "pipeline", + "source_blob_url" ], "type": [ "object" ] }, - "targetSchema": { - "$ref": "#/definitions/team-invitation" - } + "title": "Create" }, { - "description": "Revoke a team invitation.", - "title": "Revoke", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/invitations/{(%23%2Fdefinitions%2Fteam-invitation%2Fdefinitions%2Fidentity)}", - "method": "DELETE", + "description": "Info for existing test-run.", + "href": "/test-runs/{(%23%2Fdefinitions%2Ftest-run%2Fdefinitions%2Fid)}", + "method": "GET", "rel": "self", - "targetSchema": { - "$ref": "#/definitions/team-invitation" - } + "title": "Info" }, { - "description": "Get an invitation by its token", - "title": "Get", - "href": "/teams/invitations/{(%23%2Fdefinitions%2Fteam-invitation%2Fdefinitions%2Ftoken)}", + "description": "List existing test-runs for a pipeline.", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/test-runs", "method": "GET", "rel": "instances", "targetSchema": { - "$ref": "#/definitions/team-invitation" - } + "items": { + "$ref": "#/definitions/test-run" + } + }, + "type": [ + "array" + ], + "title": "List" }, { - "description": "Accept Team Invitation", - "title": "Accept", - "href": "/teams/invitations/{(%23%2Fdefinitions%2Fteam-invitation%2Fdefinitions%2Ftoken)}/accept", - "method": "POST", - "rel": "create", - "targetSchema": { - "$ref": "#/definitions/team-member" + "description": "Info for existing test-run by Pipeline", + "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/test-runs/{(%23%2Fdefinitions%2Ftest-run%2Fdefinitions%2Fnumber)}", + "method": "GET", + "rel": "self", + "title": "Info By Pipeline" + }, + { + "description": "Update a test-run's status.", + "href": "/test-runs/{(%23%2Fdefinitions%2Ftest-run%2Fdefinitions%2Fnumber)}", + "method": "PATCH", + "rel": "self", + "title": "Update", + "schema": { + "properties": { + "status": { + "$ref": "#/definitions/test-run/definitions/status" + }, + "message": { + "$ref": "#/definitions/test-run/definitions/message" + } + }, + "required": [ + "status", + "message" + ], + "type": [ + "object" + ] } } ], "properties": { - "created_at": { - "$ref": "#/definitions/team-invitation/definitions/created_at" + "actor_email": { + "$ref": "#/definitions/test-run/definitions/actor_email" }, - "id": { - "$ref": "#/definitions/team-invitation/definitions/id" + "clear_cache": { + "$ref": "#/definitions/test-run/definitions/clear_cache" }, - "invited_by": { + "commit_branch": { + "$ref": "#/definitions/test-run/definitions/commit_branch" + }, + "commit_message": { + "$ref": "#/definitions/test-run/definitions/commit_message" + }, + "commit_sha": { + "$ref": "#/definitions/test-run/definitions/commit_sha" + }, + "debug": { + "$ref": "#/definitions/test-run/definitions/debug" + }, + "app_setup": { + "$ref": "#/definitions/test-run/definitions/app_setup" + }, + "created_at": { + "$ref": "#/definitions/test-run/definitions/created_at" + }, + "dyno": { + "description": "the type of dynos used for this test-run", "properties": { - "email": { - "$ref": "#/definitions/account/definitions/email" - }, - "id": { - "$ref": "#/definitions/account/definitions/id" - }, - "name": { - "$ref": "#/definitions/account/definitions/name" + "size": { + "$ref": "#/definitions/dyno/definitions/size" } }, - "strictProperties": true, "type": [ + "null", "object" ] }, - "team": { + "id": { + "$ref": "#/definitions/test-run/definitions/id" + }, + "message": { + "$ref": "#/definitions/test-run/definitions/message" + }, + "number": { + "$ref": "#/definitions/test-run/definitions/number" + }, + "organization": { + "description": "the team that owns this test-run", "properties": { - "id": { - "$ref": "#/definitions/team/definitions/id" - }, "name": { "$ref": "#/definitions/team/definitions/name" } }, - "strictProperties": true, "type": [ + "null", "object" ] }, - "role": { - "$ref": "#/definitions/team/definitions/role" - }, - "updated_at": { - "$ref": "#/definitions/team-invitation/definitions/updated_at" - }, - "user": { + "pipeline": { + "description": "the pipeline which owns this test-run", "properties": { - "email": { - "$ref": "#/definitions/account/definitions/email" - }, "id": { - "$ref": "#/definitions/account/definitions/id" - }, - "name": { - "$ref": "#/definitions/account/definitions/name" + "$ref": "#/definitions/pipeline/definitions/identity" } }, - "strictProperties": true, "type": [ "object" ] + }, + "status": { + "$ref": "#/definitions/test-run/definitions/status" + }, + "source_blob_url": { + "$ref": "#/definitions/test-run/definitions/source_blob_url" + }, + "updated_at": { + "$ref": "#/definitions/test-run/definitions/updated_at" + }, + "user": { + "$ref": "#/definitions/account" + }, + "warning_message": { + "$ref": "#/definitions/test-run/definitions/warning_message" } } }, - "team-invoice": { + "user-preferences": { + "description": "Tracks a user's preferences and message dismissals", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "description": "A Team Invoice is an itemized bill of goods for a team which includes pricing and charges.", - "stability": "development", + "stability": "production", "strictProperties": true, - "title": "Heroku Platform API - Team Invoice", + "title": "Heroku Platform API - User Preferences", "type": [ "object" ], "definitions": { - "addons_total": { - "description": "total add-ons charges in on this invoice", - "example": 25000, - "readOnly": true, - "type": [ - "integer" - ] - }, - "database_total": { - "description": "total database charges on this invoice", - "example": 25000, - "readOnly": true, - "type": [ - "integer" - ] - }, - "charges_total": { - "description": "total charges on this invoice", - "example": 0, - "readOnly": true, - "type": [ - "integer" - ] - }, - "created_at": { - "description": "when invoice was created", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", - "readOnly": true, - "type": [ - "string" - ] - }, - "credits_total": { - "description": "total credits on this invoice", - "example": 100000, - "readOnly": true, - "type": [ - "integer" - ] - }, - "dyno_units": { - "description": "total amount of dyno units consumed across dyno types.", - "example": 1.92, - "readOnly": true, - "type": [ - "number" + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/user-preferences/definitions/self" + } ] }, - "id": { - "description": "unique identifier of this invoice", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", + "self": { + "description": "Implicit reference to currently authorized user", + "enum": [ + "~" + ], + "example": "~", "readOnly": true, "type": [ "string" ] }, - "identity": { - "anyOf": [ - { - "$ref": "#/definitions/team-invoice/definitions/number" - } + "timezone": { + "description": "User's default timezone", + "example": "UTC", + "readOnly": false, + "type": [ + "string", + "null" ] }, - "number": { - "description": "human readable invoice number", - "example": 9403943, - "readOnly": true, + "default-organization": { + "description": "User's default team", + "example": "sushi-inc", + "readOnly": false, "type": [ - "integer" + "string", + "null" ] }, - "payment_status": { - "description": "status of the invoice payment", - "example": "Paid", - "readOnly": true, + "dismissed-github-banner": { + "description": "Whether the user has dismissed the GitHub link banner", + "example": true, + "readOnly": false, "type": [ - "string" + "boolean", + "null" ] }, - "platform_total": { - "description": "total platform charges on this invoice", - "example": 50000, - "readOnly": true, + "dismissed-getting-started": { + "description": "Whether the user has dismissed the getting started banner", + "example": true, + "readOnly": false, "type": [ - "integer" + "boolean", + "null" ] }, - "period_end": { - "description": "the ending date that the invoice covers", - "example": "01/31/2014", - "readOnly": true, + "dismissed-org-access-controls": { + "description": "Whether the user has dismissed the Organization Access Controls banner", + "example": true, + "readOnly": false, "type": [ - "string" + "boolean", + "null" ] }, - "period_start": { - "description": "the starting date that this invoice covers", - "example": "01/01/2014", - "readOnly": true, + "dismissed-org-wizard-notification": { + "description": "Whether the user has dismissed the Organization Wizard", + "example": true, + "readOnly": false, "type": [ - "string" + "boolean", + "null" ] }, - "state": { - "description": "payment status for this invoice (pending, successful, failed)", - "example": 1, - "readOnly": true, + "dismissed-pipelines-banner": { + "description": "Whether the user has dismissed the Pipelines banner", + "example": true, + "readOnly": false, "type": [ - "integer" + "boolean", + "null" ] }, - "total": { - "description": "combined total of charges and credits on this invoice", - "example": 100000, - "readOnly": true, + "dismissed-pipelines-github-banner": { + "description": "Whether the user has dismissed the GitHub banner on a pipeline overview", + "example": true, + "readOnly": false, "type": [ - "integer" + "boolean", + "null" ] }, - "updated_at": { - "description": "when invoice was updated", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", - "readOnly": true, + "dismissed-pipelines-github-banners": { + "description": "Which pipeline uuids the user has dismissed the GitHub banner for", + "example": [ + "96c68759-f310-4910-9867-e0b062064098" + ], + "readOnly": false, "type": [ - "string" - ] + "null", + "array" + ], + "items": { + "$ref": "#/definitions/pipeline/definitions/id" + } }, - "weighted_dyno_hours": { - "description": "The total amount of hours consumed across dyno types.", - "example": 1488, - "readOnly": true, + "dismissed-sms-banner": { + "description": "Whether the user has dismissed the 2FA SMS banner", + "example": true, + "readOnly": false, "type": [ - "number" + "boolean", + "null" ] } }, "links": [ { - "description": "Info for existing invoice.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/invoices/{(%23%2Fdefinitions%2Fteam-invoice%2Fdefinitions%2Fidentity)}", + "description": "Retrieve User Preferences", + "href": "/users/{(%23%2Fdefinitions%2Fuser-preferences%2Fdefinitions%2Fidentity)}/preferences", "method": "GET", "rel": "self", "targetSchema": { - "$ref": "#/definitions/team-invoice" + "$ref": "#/definitions/user-preferences" }, - "title": "Info" + "title": "List" }, { - "description": "List existing invoices.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/invoices", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/team-invoice" - }, + "description": "Update User Preferences", + "href": "/users/{(%23%2Fdefinitions%2Fuser-preferences%2Fdefinitions%2Fidentity)}/preferences", + "method": "PATCH", + "rel": "update", + "schema": { "type": [ - "array" - ] + "object" + ], + "properties": { + "timezone": { + "$ref": "#/definitions/user-preferences/definitions/timezone" + }, + "default-organization": { + "$ref": "#/definitions/user-preferences/definitions/default-organization" + }, + "dismissed-github-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-github-banner" + }, + "dismissed-getting-started": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-getting-started" + }, + "dismissed-org-access-controls": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-org-access-controls" + }, + "dismissed-org-wizard-notification": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-org-wizard-notification" + }, + "dismissed-pipelines-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-banner" + }, + "dismissed-pipelines-github-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-github-banner" + }, + "dismissed-pipelines-github-banners": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-github-banners" + }, + "dismissed-sms-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-sms-banner" + } + } }, - "title": "List" + "targetSchema": { + "$ref": "#/definitions/user-preferences" + }, + "title": "Update" } ], "properties": { - "addons_total": { - "$ref": "#/definitions/team-invoice/definitions/addons_total" - }, - "database_total": { - "$ref": "#/definitions/team-invoice/definitions/database_total" - }, - "charges_total": { - "$ref": "#/definitions/team-invoice/definitions/charges_total" - }, - "created_at": { - "$ref": "#/definitions/team-invoice/definitions/created_at" - }, - "credits_total": { - "$ref": "#/definitions/team-invoice/definitions/credits_total" - }, - "dyno_units": { - "$ref": "#/definitions/team-invoice/definitions/dyno_units" - }, - "id": { - "$ref": "#/definitions/team-invoice/definitions/id" + "timezone": { + "$ref": "#/definitions/user-preferences/definitions/timezone" }, - "number": { - "$ref": "#/definitions/team-invoice/definitions/number" + "default-organization": { + "$ref": "#/definitions/user-preferences/definitions/default-organization" }, - "payment_status": { - "$ref": "#/definitions/team-invoice/definitions/payment_status" + "dismissed-github-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-github-banner" }, - "period_end": { - "$ref": "#/definitions/team-invoice/definitions/period_end" + "dismissed-getting-started": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-getting-started" }, - "period_start": { - "$ref": "#/definitions/team-invoice/definitions/period_start" + "dismissed-org-access-controls": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-org-access-controls" }, - "platform_total": { - "$ref": "#/definitions/team-invoice/definitions/platform_total" + "dismissed-org-wizard-notification": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-org-wizard-notification" }, - "state": { - "$ref": "#/definitions/team-invoice/definitions/state" + "dismissed-pipelines-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-banner" }, - "total": { - "$ref": "#/definitions/team-invoice/definitions/total" + "dismissed-pipelines-github-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-github-banner" }, - "updated_at": { - "$ref": "#/definitions/team-invoice/definitions/updated_at" + "dismissed-pipelines-github-banners": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-github-banners" }, - "weighted_dyno_hours": { - "$ref": "#/definitions/team-invoice/definitions/weighted_dyno_hours" + "dismissed-sms-banner": { + "$ref": "#/definitions/user-preferences/definitions/dismissed-sms-banner" } } - }, - "team-member": { - "$schema": "http://json-schema.org/draft-04/hyper-schema", - "description": "A team member is an individual with access to a team.", - "stability": "development", - "additionalProperties": false, - "required": [ - "created_at", - "email", - "federated", - "updated_at" - ], - "title": "Heroku Platform API - Team Member", + }, + "vpn-connection": { + "description": "[VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "production", + "strictProperties": true, + "title": "Heroku Platform API - Private Spaces VPN", "type": [ "object" ], "definitions": { - "created_at": { - "description": "when the membership record was created", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", - "readOnly": true, + "name": { + "description": "VPN Name", + "example": "office", "type": [ "string" ] }, - "email": { - "description": "email address of the team member", - "example": "someone@example.org", - "readOnly": true, + "public_ip": { + "description": "Public IP of VPN customer gateway", + "example": "35.161.69.30", "type": [ "string" ] }, - "federated": { - "description": "whether the user is federated and belongs to an Identity Provider", - "example": false, - "readOnly": true, + "routable_cidrs": { + "description": "Routable CIDRs of VPN", "type": [ - "boolean" - ] + "array" + ], + "items": { + "example": "172.16.0.0/16", + "type": [ + "string" + ] + } }, "id": { - "description": "unique identifier of the team member", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", + "description": "VPN ID", + "example": "123456789012", "readOnly": true, "type": [ "string" @@ -15108,164 +19098,192 @@ "identity": { "anyOf": [ { - "$ref": "#/definitions/team-member/definitions/email" + "$ref": "#/definitions/vpn-connection/definitions/id" }, { - "$ref": "#/definitions/team-member/definitions/id" + "$ref": "#/definitions/vpn-connection/definitions/name" } ] }, - "name": { - "description": "full name of the team member", - "example": "Tina Edmonds", + "space_cidr_block": { + "description": "CIDR Block of the Private Space", + "example": "10.0.0.0/16", "readOnly": true, "type": [ - "string", - "null" + "string" ] }, - "team_role": { - "description": "role in the team", - "enum": [ - "admin", - "viewer", - "member" - ], - "example": "admin", + "ike_version": { + "description": "IKE Version", + "example": 1, + "readOnly": true, "type": [ - "string" + "integer" ] }, - "two_factor_authentication": { - "description": "whether the team member has two factor authentication enabled", - "example": true, + "tunnel": { + "description": "Tunnel info", "readOnly": true, "type": [ - "boolean" + "object" + ], + "properties": { + "last_status_change": { + "description": "Timestamp of last status changed", + "example": "2016-10-25T22:09:05Z", + "type": [ + "string" + ] + }, + "ip": { + "description": "Public IP address for the tunnel", + "example": "52.44.146.197", + "type": [ + "string" + ] + }, + "customer_ip": { + "description": "Public IP address for the customer side of the tunnel", + "example": "52.44.146.197", + "type": [ + "string" + ] + }, + "pre_shared_key": { + "description": "Pre-shared key", + "example": "secret", + "type": [ + "string" + ] + }, + "status": { + "description": "Status of the tunnel", + "enum": [ + "UP", + "DOWN" + ], + "example": "UP", + "type": [ + "string" + ] + }, + "status_message": { + "description": "Details of the status", + "example": "status message", + "type": [ + "string" + ] + } + } + }, + "status": { + "description": "Status of the VPN", + "enum": [ + "pending", + "provisioning", + "active", + "deprovisioning", + "failed" + ], + "example": "active", + "readOnly": true, + "type": [ + "string" ] }, - "updated_at": { - "description": "when the membership record was updated", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "status_message": { + "description": "Details of the status", + "example": "supplied CIDR block already in use", "readOnly": true, "type": [ "string" ] } }, - "links": [ - { - "description": "Create a new team member, or update their role.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members", - "method": "PUT", - "rel": "create", - "schema": { - "properties": { - "email": { - "$ref": "#/definitions/team-member/definitions/email" - }, - "federated": { - "$ref": "#/definitions/team-member/definitions/federated" - }, - "role": { - "$ref": "#/definitions/team-member/definitions/team_role" - } - }, - "required": [ - "email", - "role" - ], - "type": [ - "object" - ] - }, - "targetSchema": { - "$ref": "#/definitions/team-member" - }, - "title": "Create or Update" + "properties": { + "id": { + "$ref": "#/definitions/vpn-connection/definitions/id" }, - { - "description": "Create a new team member.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members", - "method": "POST", - "rel": "create", - "schema": { - "properties": { - "email": { - "$ref": "#/definitions/team-member/definitions/email" - }, - "federated": { - "$ref": "#/definitions/team-member/definitions/federated" - }, - "role": { - "$ref": "#/definitions/team-member/definitions/team_role" - } - }, - "required": [ - "email", - "role" - ], - "type": [ - "object" - ] - }, - "targetSchema": { - "$ref": "#/definitions/team-member" + "name": { + "$ref": "#/definitions/vpn-connection/definitions/name" + }, + "public_ip": { + "$ref": "#/definitions/vpn-connection/definitions/public_ip" + }, + "routable_cidrs": { + "$ref": "#/definitions/vpn-connection/definitions/routable_cidrs" + }, + "space_cidr_block": { + "$ref": "#/definitions/vpn-connection/definitions/space_cidr_block" + }, + "tunnels": { + "items": { + "$ref": "#/definitions/vpn-connection/definitions/tunnel" }, - "title": "Create" + "type": [ + "array" + ] + }, + "ike_version": { + "$ref": "#/definitions/vpn-connection/definitions/ike_version" + }, + "status": { + "$ref": "#/definitions/vpn-connection/definitions/status" }, + "status_message": { + "$ref": "#/definitions/vpn-connection/definitions/status_message" + } + }, + "links": [ { - "description": "Update a team member.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members", - "method": "PATCH", - "rel": "update", + "description": "Create a new VPN connection in a private space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/vpn-connections", + "rel": "create", "schema": { "properties": { - "email": { - "$ref": "#/definitions/team-member/definitions/email" + "name": { + "$ref": "#/definitions/vpn-connection/definitions/name" }, - "federated": { - "$ref": "#/definitions/team-member/definitions/federated" + "public_ip": { + "$ref": "#/definitions/vpn-connection/definitions/public_ip" }, - "role": { - "$ref": "#/definitions/team-member/definitions/team_role" + "routable_cidrs": { + "$ref": "#/definitions/vpn-connection/definitions/routable_cidrs" } }, "required": [ - "email", - "role" + "name", + "public_ip", + "routable_cidrs" ], "type": [ "object" ] }, "targetSchema": { - "$ref": "#/definitions/team-member" + "$ref": "#/definitions/vpn-connection" }, - "title": "Update" + "method": "POST", + "title": "Create" }, { - "description": "Remove a member from the team.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members/{(%23%2Fdefinitions%2Fteam-member%2Fdefinitions%2Fidentity)}", + "description": "Destroy existing VPN Connection", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/vpn-connections/{(%23%2Fdefinitions%2Fvpn-connection%2Fdefinitions%2Fidentity)}", + "rel": "empty", "method": "DELETE", - "rel": "destroy", "targetSchema": { - "$ref": "#/definitions/team-member" + "$ref": "#/definitions/vpn-connection" }, - "title": "Delete" + "title": "Destroy" }, { - "description": "List members of the team.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members", + "description": "List VPN connections for a space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/vpn-connections", "method": "GET", - "ranges": [ - "email" - ], "rel": "instances", "targetSchema": { "items": { - "$ref": "#/definitions/team-member" + "$ref": "#/definitions/vpn-connection" }, "type": [ "array" @@ -15274,449 +19292,705 @@ "title": "List" }, { - "description": "List the apps of a team member.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/members/{(%23%2Fdefinitions%2Fteam-member%2Fdefinitions%2Fidentity)}/apps", + "description": "Info for an existing vpn-connection.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/vpn-connections/{(%23%2Fdefinitions%2Fvpn-connection%2Fdefinitions%2Fidentity)}", "method": "GET", - "rel": "instances", + "rel": "self", "targetSchema": { - "items": { - "$ref": "#/definitions/team-app" + "$ref": "#/definitions/vpn-connection" + }, + "title": "Info" + }, + { + "description": "Update a VPN connection in a private space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/vpn-connections/{(%23%2Fdefinitions%2Fvpn-connection%2Fdefinitions%2Fidentity)}", + "rel": "update", + "schema": { + "properties": { + "routable_cidrs": { + "$ref": "#/definitions/vpn-connection/definitions/routable_cidrs" + } }, + "required": [ + "routable_cidrs" + ], "type": [ - "array" + "object" ] }, - "title": "List By Member" + "targetSchema": { + "$ref": "#/definitions/vpn-connection" + }, + "method": "PATCH", + "title": "Update" } + ] + }, + "add-on-sso": { + "description": "Add-on Single Sign-on generates URL that allows a customer to log in to an Add-on Service's web dashboard.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Add-on SSO", + "type": [ + "object" ], - "properties": { - "created_at": { - "$ref": "#/definitions/team-member/definitions/created_at" - }, - "email": { - "$ref": "#/definitions/team-member/definitions/email" - }, - "federated": { - "$ref": "#/definitions/team-member/definitions/federated" + "definitions": { + "method": { + "description": "whether this SSO request is a GET or a POST", + "enum": [ + "get", + "post" + ], + "example": "get", + "readOnly": true, + "type": [ + "string" + ] }, - "id": { - "$ref": "#/definitions/team-member/definitions/id" + "action": { + "description": "URL to follow to initiate single sign-on", + "example": "https://slowdb.heroku.com/heroku/resources/", + "format": "uri", + "readOnly": true, + "type": [ + "string" + ] }, - "identity_provider": { - "description": "Identity Provider information the member is federated with", + "params": { + "description": "params for this request", + "readOnly": true, + "optional": true, + "type": [ + "object" + ], "properties": { + "email": { + "description": "unique email address of current user", + "example": "username@example.com", + "format": "email", + "readOnly": true, + "type": [ + "string" + ] + }, + "user_id": { + "description": "unique identifier of current user", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "owning_app": { + "description": "name of app where add-on was first attached", + "example": "example", + "readOnly": true, + "type": [ + "string" + ] + }, + "attached_app": { + "description": "current app name when SSO was requested", + "example": "example", + "readOnly": true, + "type": [ + "string" + ] + }, + "timestamp": { + "description": "timestamp used to build params as an unix epoch integer", + "example": "1325419200", + "readOnly": true, + "type": [ + "integer" + ] + }, + "nav-data": { + "description": "Base64-encoded nav data for Heroku header", + "example": "example", + "readOnly": true, + "type": [ + "string" + ] + }, "id": { - "$ref": "#/definitions/identity-provider/definitions/id" + "description": "id of this add-on with its provider", + "example": "abcd1234", + "readOnly": true, + "type": [ + "string" + ] }, - "name": { - "description": "name of the identity provider", - "example": "acme", + "token": { + "description": "token generated for this request that authenticates user", + "example": "0123456789abcdef0123456789abcdef01234578", "readOnly": true, "type": [ "string" ] }, - "redacted": { - "description": "whether the identity_provider information is redacted or not", - "example": false, + "resource_id": { + "description": "unique identifier of add-on", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", "readOnly": true, "type": [ - "boolean" + "string" ] }, - "owner": { - "$ref": "#/definitions/identity-provider/definitions/owner" + "resource_token": { + "description": "unique token for this SSO request", + "example": "bb466eb1d6bc345d11072c3cd25c311f21be130d", + "readOnly": true, + "type": [ + "string" + ] + } + } + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/add-on/definitions/id" + }, + { + "$ref": "#/definitions/add-on/definitions/name" } + ] + } + }, + "links": [ + { + "description": "Generate a timestamp-based single sign-on URL.", + "href": "/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/sso", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/add-on-sso" }, + "title": "Add-on SSO" + }, + { + "description": "Generate a timestamp-based single sign-on URL.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/addons/{(%23%2Fdefinitions%2Fadd-on%2Fdefinitions%2Fidentity)}/sso", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/add-on-sso" + }, + "title": "Add-on SSO by App" + } + ], + "properties": { + "method": { + "$ref": "#/definitions/add-on-sso/definitions/method" + }, + "action": { + "$ref": "#/definitions/add-on-sso/definitions/action" + }, + "params": { + "$ref": "#/definitions/add-on-sso/definitions/params", + "strictProperties": true, "type": [ - "null", "object" ] + } + } + }, + "build-metadata": { + "description": "Build metadata contains the reference data for building the associated App.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Build Metadata", + "type": [ + "object" + ], + "definitions": { + "cache_delete_url": { + "description": "URL for deleting the build cache.", + "example": "https://example.com/source.tgz?token=xyz", + "readOnly": true, + "format": "uri", + "type": [ + "string" + ] }, - "role": { - "$ref": "#/definitions/team/definitions/role" + "cache_get_url": { + "description": "URL for retrieving the latest build cache.", + "example": "https://example.com/source.tgz?token=xyz", + "readOnly": true, + "format": "uri", + "type": [ + "string" + ] }, - "two_factor_authentication": { - "$ref": "#/definitions/team-member/definitions/two_factor_authentication" + "cache_put_url": { + "description": "URL for updating the latest build cache.", + "example": "https://example.com/source.tgz?token=xyz", + "readOnly": true, + "format": "uri", + "type": [ + "string" + ] }, - "updated_at": { - "$ref": "#/definitions/team-member/definitions/updated_at" + "repo_delete_url": { + "description": "URL for deleting this app's repo.", + "example": "https://example.com/source.tgz?token=xyz", + "readOnly": true, + "format": "uri", + "type": [ + "string" + ] }, - "user": { - "description": "user information for the membership", + "repo_get_url": { + "description": "URL for retrieving this app's repo.", + "example": "https://example.com/source.tgz?token=xyz", + "readOnly": true, + "format": "uri", + "type": [ + "string" + ] + }, + "repo_put_url": { + "description": "URL for updating the app's repo.", + "example": "https://example.com/source.tgz?token=xyz", + "readOnly": true, + "format": "uri", + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Build metadata for app.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/build-metadata", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/build-metadata" + }, + "title": "Info" + } + ], + "properties": { + "app": { + "description": "App associated with this metadata", "properties": { - "email": { - "$ref": "#/definitions/account/definitions/email" + "name": { + "$ref": "#/definitions/app/definitions/name" }, "id": { - "$ref": "#/definitions/account/definitions/id" - }, - "name": { - "$ref": "#/definitions/account/definitions/name" + "$ref": "#/definitions/app/definitions/id" } }, - "strictProperties": true, "type": [ "object" ] + }, + "cache_delete_url": { + "$ref": "#/definitions/build-metadata/definitions/cache_delete_url" + }, + "cache_get_url": { + "$ref": "#/definitions/build-metadata/definitions/cache_get_url" + }, + "cache_put_url": { + "$ref": "#/definitions/build-metadata/definitions/cache_put_url" + }, + "repo_delete_url": { + "$ref": "#/definitions/build-metadata/definitions/repo_delete_url" + }, + "repo_get_url": { + "$ref": "#/definitions/build-metadata/definitions/repo_get_url" + }, + "repo_put_url": { + "$ref": "#/definitions/build-metadata/definitions/repo_put_url" } } }, - "team-monthly-usage": { + "capability": { + "description": "A capability represents a requested capability on a resource along with whether the requesting user has that capability", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "description": "Usage for an enterprise team at a monthly resolution.", - "stability": "development", - "strictProperties": true, - "title": "Heroku Platform API - Team Monthly Usage", + "stability": "prototype", + "title": "Heroku Platform API - Capability", "type": [ "object" ], "definitions": { - "addons": { - "description": "total add-on credits used", - "example": 250.0, - "readOnly": true, - "type": [ - "number" - ] - }, - "app_usage_monthly": { - "description": "Usage for an app at a monthly resolution.", - "type": [ - "object" - ], - "properties": { - "addons": { - "$ref": "#/definitions/team-monthly-usage/definitions/addons" - }, - "app_name": { - "$ref": "#/definitions/app/definitions/name" - }, - "data": { - "$ref": "#/definitions/team-monthly-usage/definitions/data" - }, - "dynos": { - "$ref": "#/definitions/team-monthly-usage/definitions/dynos" - }, - "partner": { - "$ref": "#/definitions/team-monthly-usage/definitions/partner" - } - } - }, - "connect": { - "description": "average connect rows synced", - "example": 15000, - "readOnly": true, - "type": [ - "number" - ] - }, - "data": { - "description": "total add-on credits used for first party add-ons", - "example": 34.89, - "readOnly": true, - "type": [ - "number" - ] - }, - "dynos": { - "description": "dynos used", - "example": 1.548, - "readOnly": true, - "type": [ - "number" - ] - }, - "id": { - "description": "team identifier", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", + "capability": { + "description": "name of the capability", + "example": "manage_dynos", "readOnly": true, "type": [ "string" ] }, - "month": { - "description": "year and month of the usage", - "example": "2019-01", - "pattern": "^[0-9]{4}-[0-9]{2}$", + "resource_id": { + "description": "id or name of the resource", + "example": "01234567-89ab-cdef-0123-456789abcdef", "readOnly": true, "type": [ + "null", "string" ] }, - "name": { - "description": "name of the team", - "example": "ops", + "resource_type": { + "description": "type of the resource", + "example": "app", "readOnly": true, "type": [ "string" ] }, - "partner": { - "description": "total add-on credits used for third party add-ons", - "example": 12.34, + "capable": { + "description": "whether the user has the capability on the resource_id of type resource_type", + "example": true, "readOnly": true, "type": [ - "number" + "boolean" ] }, - "space": { - "description": "space credits used", - "example": 1.548, + "requires_second_factor": { + "description": "whether the given application resource is flagged as a paranoid app and will require a second factor", + "example": true, "readOnly": true, "type": [ - "number" + "boolean" ] }, - "start_date": { - "description": "range start date", - "example": "2019-01", - "pattern": "^[0-9]{4}-[0-9]{2}$", + "resource_canonical_id": { + "description": "canonical id of the resource if it's present", + "example": "01234567-89ab-cdef-0123-456789abcdef", "readOnly": true, "type": [ "string" ] }, - "end_date": { - "description": "range end date", - "example": "2019-02", - "pattern": "^[0-9]{4}-[0-9]{2}$", - "readOnly": true, + "capability-request": { + "description": "an object representing the requested capability", + "properties": { + "capability": { + "$ref": "#/definitions/capability/definitions/capability" + }, + "resource_id": { + "$ref": "#/definitions/capability/definitions/resource_id" + }, + "resource_type": { + "$ref": "#/definitions/capability/definitions/resource_type" + } + }, + "strictProperties": true, "type": [ - "string" + "object" ] } }, "links": [ { - "description": "Retrieves usage for an enterprise team for a range of months. Start and end dates can be specified as query parameters using the date, YYYY-MM. If no end date is specified, one month of usage is returned. The team identifier can be found from the [team list endpoint](https://devcenter.heroku.com/articles/platform-api-reference#team-list).\n", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fid)}/usage/monthly", - "method": "GET", - "title": "Info", + "description": "Request to check a list of capabilities the current user (yourself). An capability is a tuple of\n(capability, resource_id, resource_type). The endpoint will then respond with a `capable` boolean\ntrue or false for each requested capability. This boolean indicates whether the authenticated user\nhas the requested capability on the resource.\n", + "href": "/users/~/capabilities", + "title": "Capabilities", + "method": "PUT", + "rel": "self", "schema": { + "type": [ + "object" + ], "properties": { - "start": { - "$ref": "#/definitions/team-monthly-usage/definitions/start_date" - }, - "end": { - "$ref": "#/definitions/team-monthly-usage/definitions/end_date" + "capabilities": { + "description": "The list of capabilities that you want to check", + "items": { + "$ref": "#/definitions/capability/definitions/capability-request" + }, + "type": [ + "array" + ] } }, "required": [ - "start" - ], - "type": [ - "object" + "capabilities" ] }, - "rel": "instances", "targetSchema": { - "items": { - "$ref": "#/definitions/team-monthly-usage" - }, "type": [ - "array" - ] + "object" + ], + "properties": { + "capabilities": { + "description": "The list of capabilities for the requested resources", + "items": { + "$ref": "#/definitions/capability" + }, + "type": [ + "array" + ] + } + } } } ], + "required": [ + "capability", + "resource_id", + "resource_type", + "capable" + ], "properties": { - "addons": { - "$ref": "#/definitions/team-monthly-usage/definitions/addons" + "capability": { + "$ref": "#/definitions/capability/definitions/capability" }, - "apps": { - "description": "app usage in the team", - "type": [ - "array" - ], - "items": { - "$ref": "#/definitions/team-monthly-usage/definitions/app_usage_monthly" - } - }, - "connect": { - "$ref": "#/definitions/team-monthly-usage/definitions/connect" - }, - "data": { - "$ref": "#/definitions/team-monthly-usage/definitions/data" - }, - "dynos": { - "$ref": "#/definitions/team-monthly-usage/definitions/dynos" - }, - "id": { - "$ref": "#/definitions/team-monthly-usage/definitions/id" + "resource_id": { + "$ref": "#/definitions/capability/definitions/resource_id" }, - "month": { - "$ref": "#/definitions/team-monthly-usage/definitions/month" + "resource_type": { + "$ref": "#/definitions/capability/definitions/resource_type" }, - "name": { - "$ref": "#/definitions/team-monthly-usage/definitions/name" + "capable": { + "$ref": "#/definitions/capability/definitions/capable" }, - "partner": { - "$ref": "#/definitions/team-monthly-usage/definitions/partner" + "requires_second_factor": { + "$ref": "#/definitions/capability/definitions/requires_second_factor" }, - "space": { - "$ref": "#/definitions/team-monthly-usage/definitions/space" + "resource_canonical_id": { + "$ref": "#/definitions/capability/definitions/resource_canonical_id" } } }, - "team-preferences": { - "description": "Tracks a Team's Preferences", + "config-vars-settings": { + "description": "The Config Vars Settings endpoints enable you to view and manage the configuration provided to an app on Heroku. These endpoints are similar to /config-vars but also allow you to check which config vars you can mask, and which are currently masked.", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "development", + "stability": "prototype", "strictProperties": true, - "title": "Heroku Platform API - Team Preferences", + "title": "Heroku Platform API - Config Vars Settings", "type": [ "object" ], "definitions": { - "default-permission": { - "description": "The default permission used when adding new members to the team", - "example": "member", + "key": { + "description": "name of the config var", + "example": "FOO_TOKEN", "readOnly": false, - "enum": [ - "admin", - "member", - "viewer", - null - ], "type": [ - "null", "string" ] }, - "identity": { - "$ref": "#/definitions/team/definitions/identity" + "value": { + "description": "value of the config var", + "example": "bar", + "readOnly": false, + "type": [ + "string", + "null" + ] }, - "addons-controls": { - "description": "Whether add-on service rules should be applied to add-on installations", - "example": true, + "masked": { + "description": "indicates if the value is masked", + "example": false, "readOnly": false, "type": [ - "boolean", + "boolean" + ] + }, + "masking_supported": { + "description": "indicates if you can mask the value", + "example": true, + "readOnly": true, + "optional": true, + "type": [ + "boolean" + ] + }, + "attachment": { + "properties": { + "id": { + "$ref": "#/definitions/add-on-attachment/definitions/id" + } + }, + "type": [ + "object", "null" + ], + "readOnly": true, + "optional": true + }, + "value_updated_at": { + "description": "indicates when the value was updated", + "example": "2024-01-01T12:00:00Z", + "readOnly": true, + "type": [ + "string" ] } }, "links": [ { - "description": "Retrieve Team Preferences", - "href": "/teams/{(%23%2Fdefinitions%2Fteam-preferences%2Fdefinitions%2Fidentity)}/preferences", + "description": "Get additional info for an app's config vars, including which config vars you can mask, and which are currently masked.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/config-vars-settings", "method": "GET", - "rel": "self", + "rel": "instances", "targetSchema": { - "$ref": "#/definitions/team-preferences" + "items": { + "$ref": "#/definitions/config-vars-settings" + }, + "type": [ + "array" + ] }, "title": "List" }, { - "description": "Update Team Preferences", - "href": "/teams/{(%23%2Fdefinitions%2Fteam-preferences%2Fdefinitions%2Fidentity)}/preferences", + "description": "Update a config var. You can update an existing config var's value by setting it again, and you can remove it by setting it to `null`. You can't unmask a masked config var.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/config-vars-settings", "method": "PATCH", "rel": "update", "schema": { - "type": [ - "object" - ], + "strictProperties": false, "properties": { - "addons-controls": { - "$ref": "#/definitions/team-preferences/definitions/addons-controls" + "config": { + "items": { + "properties": { + "key": { + "$ref": "#/definitions/config-vars-settings/definitions/key" + }, + "value": { + "$ref": "#/definitions/config-vars-settings/definitions/value" + }, + "masked": { + "$ref": "#/definitions/config-vars-settings/definitions/masked" + } + } + }, + "type": [ + "array" + ], + "description": "An array of config vars to be updated." } - } + }, + "type": [ + "object" + ] }, + "title": "update", "targetSchema": { - "$ref": "#/definitions/team-preferences" - }, - "title": "Update" + "items": { + "$ref": "#/definitions/config-vars-settings" + } + } } ], "properties": { - "default-permission": { - "$ref": "#/definitions/team-preferences/definitions/default-permission" + "attachment": { + "description": "attachment that created this config var, if any", + "properties": { + "id": { + "$ref": "#/definitions/add-on-attachment/definitions/id" + } + }, + "type": [ + "object", + "null" + ] }, - "addons-controls": { - "$ref": "#/definitions/team-preferences/definitions/addons-controls" + "key": { + "$ref": "#/definitions/config-vars-settings/definitions/key" + }, + "value": { + "$ref": "#/definitions/config-vars-settings/definitions/value" + }, + "masked": { + "$ref": "#/definitions/config-vars-settings/definitions/masked" + }, + "masking_supported": { + "$ref": "#/definitions/config-vars-settings/definitions/masking_supported" + }, + "value_updated_at": { + "$ref": "#/definitions/config-vars-settings/definitions/value_updated_at" } } }, - "team-space": { - "description": "A space is an isolated, highly available, secure app execution environment.", + "dyno-processes": { + "description": "Run processes inside existing dynos.", "$schema": "http://json-schema.org/draft-04/hyper-schema", + "title": "Heroku Platform API - Processes Inside Dynos", "stability": "prototype", "strictProperties": true, - "title": "Heroku Platform API - Team Space", "type": [ "object" ], "links": [ { - "description": "List spaces owned by the team", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/spaces", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/space" + "description": "Create a new process in an existing dyno.", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/dynos/{(%23%2Fdefinitions%2Fdyno%2Fdefinitions%2Fidentity)}", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "command": { + "$ref": "#/definitions/dyno/definitions/command" + }, + "env": { + "$ref": "#/definitions/dyno/definitions/env" + } }, + "required": [ + "command" + ], "type": [ - "array" + "object" ] }, - "title": "List" + "targetSchema": { + "$ref": "#/definitions/dyno-processes" + }, + "title": "Create" } - ] + ], + "properties": { + "attach_url": { + "$ref": "#/definitions/dyno/definitions/attach_url" + } + } }, - "team": { + "gateway-token": { + "description": "Contains a set of information useful for identifying a user and the type of access this user is allowed to have.", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "description": "Teams allow you to manage access to a shared group of applications and other resources.", - "stability": "development", + "stability": "prototype", "strictProperties": true, - "title": "Heroku Platform API - Team", + "title": "Heroku Platform API - Gateway Token", "type": [ "object" ], "definitions": { - "created_at": { - "description": "when the team was created", + "iss": { + "description": "Token issuer", "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "format": "uri", "readOnly": true, "type": [ "string" ] }, - "credit_card_collections": { - "description": "whether charges incurred by the team are paid by credit card.", - "example": true, + "iat": { + "description": "Integer representation of the timestamp the token was issued at", + "example": 1526341325, "readOnly": true, "type": [ - "boolean" + "integer" ] }, - "default": { - "description": "whether to use this team when none is specified", - "example": true, - "readOnly": false, + "exp": { + "description": "Integer representation of the timestamp the token should expire at", + "example": 1526341325, + "readOnly": true, "type": [ - "boolean" + "integer" ] }, - "enterprise_account": { - "type": [ - "null", - "object" - ], - "properties": { - "id": { - "$ref": "#/definitions/enterprise-account/definitions/id" - }, - "name": { - "$ref": "#/definitions/enterprise-account/definitions/name" - } - } - }, - "id": { - "description": "unique identifier of team", + "sub": { + "description": "Unique identifier of the subject", "example": "01234567-89ab-cdef-0123-456789abcdef", "format": "uuid", "readOnly": true, @@ -15724,1031 +19998,983 @@ "string" ] }, - "identity": { - "anyOf": [ - { - "$ref": "#/definitions/team/definitions/name" - }, - { - "$ref": "#/definitions/team/definitions/id" - } - ] - }, - "identity_provider": { - "description": "Identity Provider associated with the Team", - "strictProperties": true, - "type": [ - "null", - "object" - ], - "properties": { - "id": { - "$ref": "#/definitions/identity-provider/definitions/id" - }, - "name": { - "$ref": "#/definitions/identity-provider/definitions/name" - }, - "owner": { - "$ref": "#/definitions/identity-provider/definitions/owner" - } - } - }, - "device_data": { - "type": [ - "string", - "null" - ], - "description": "Device data string generated by the client", - "example": "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" - }, - "nonce": { - "type": [ - "string", - "null" - ], - "description": "Nonce generated by Braintree hosted fields form", - "example": "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" - }, - "address_1": { - "type": [ - "string" - ], - "description": "street address line 1", - "example": "40 Hickory Lane" - }, - "address_2": { - "type": [ - "string", - "null" - ], - "description": "street address line 2", - "example": "Suite 103" - }, - "card_number": { - "type": [ - "string", - "null" - ], - "description": "encrypted card number of payment method", - "example": "encrypted-card-number" - }, - "city": { - "type": [ - "string" - ], - "description": "city", - "example": "San Francisco" - }, - "country": { - "type": [ - "string" - ], - "description": "country", - "example": "US" - }, - "cvv": { - "type": [ - "string", - "null" - ], - "description": "card verification value", - "example": "123" - }, - "expiration_month": { - "type": [ - "string", - "null" - ], - "description": "expiration month", - "example": "11" - }, - "expiration_year": { - "type": [ - "string", - "null" - ], - "description": "expiration year", - "example": "2014" - }, - "first_name": { - "type": [ - "string" - ], - "description": "the first name for payment method", - "example": "Jason" - }, - "last_name": { - "type": [ - "string" - ], - "description": "the last name for payment method", - "example": "Walker" - }, - "other": { - "type": [ - "string", - "null" - ], - "description": "metadata", - "example": "Additional information for payment method" - }, - "postal_code": { + "user_id": { + "description": "Unique identifier of the user", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, "type": [ "string" - ], - "description": "postal code", - "example": "90210" + ] }, - "state": { + "user_email": { + "description": "Email address of the user", + "example": "username@example.com", + "format": "email", + "readOnly": true, "type": [ "string" - ], - "description": "state", - "example": "CA" + ] }, - "membership_limit": { - "description": "upper limit of members allowed in a team.", - "example": 25, + "authorization_id": { + "description": "Unique identifier of the OAuth authirization used in the token", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", "readOnly": true, "type": [ - "number", + "string", "null" ] }, - "name": { - "description": "unique name of team", - "example": "example", + "rate_limit_enabled": { + "description": "Indicates that a rate limit should be enforced", + "example": true, "readOnly": true, "type": [ - "string" + "boolean" ] }, - "provisioned_licenses": { - "description": "whether the team is provisioned licenses by salesforce.", + "rate_limit_multiplier": { + "description": "Rate limit multiplier that should be used", + "example": 2, + "readOnly": true, + "type": [ + "integer" + ] + }, + "second_factor": { + "description": "Describes if the token contains second factor claim", "example": true, "readOnly": true, "type": [ "boolean" ] }, - "role": { - "description": "role in the team", - "enum": [ - "admin", - "collaborator", - "member", - "owner", - null - ], - "example": "admin", + "sudo": { + "description": "Describes if the token contains sudo claim", + "example": true, "readOnly": true, "type": [ - "null", - "string" + "boolean" ] }, - "type": { - "description": "type of team.", - "example": "team", - "enum": [ - "enterprise", - "team" - ], + "sudo_user_id": { + "description": "Unique identifier of the sudoer if sudo was used", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", "readOnly": true, "type": [ - "string" + "string", + "null" ] }, - "updated_at": { - "description": "when the team was updated", - "example": "2012-01-01T12:00:00Z", - "format": "date-time", + "sudo_reason": { + "description": "Reason for using sudo if present", + "example": "Ticket #123", "readOnly": true, "type": [ - "string" + "string", + "null" + ] + }, + "sudo_force": { + "description": "Describes if the token contains sudo force claim", + "example": true, + "readOnly": true, + "type": [ + "boolean" ] } }, + "properties": { + "iss": { + "$ref": "#/definitions/gateway-token/definitions/iss" + }, + "iat": { + "$ref": "#/definitions/gateway-token/definitions/iat" + }, + "exp": { + "$ref": "#/definitions/gateway-token/definitions/exp" + }, + "sub": { + "$ref": "#/definitions/gateway-token/definitions/sub" + }, + "user_id": { + "$ref": "#/definitions/gateway-token/definitions/user_id" + }, + "user_email": { + "$ref": "#/definitions/gateway-token/definitions/user_email" + }, + "authorization_id": { + "$ref": "#/definitions/gateway-token/definitions/authorization_id" + }, + "rate_limit_enabled": { + "$ref": "#/definitions/gateway-token/definitions/rate_limit_enabled" + }, + "rate_limit_multiplier": { + "$ref": "#/definitions/gateway-token/definitions/rate_limit_multiplier" + }, + "second_factor": { + "$ref": "#/definitions/gateway-token/definitions/second_factor" + }, + "sudo": { + "$ref": "#/definitions/gateway-token/definitions/sudo" + }, + "sudo_user_id": { + "$ref": "#/definitions/gateway-token/definitions/sudo_user_id" + }, + "sudo_reason": { + "$ref": "#/definitions/gateway-token/definitions/sudo_reason" + }, + "sudo_force": { + "$ref": "#/definitions/gateway-token/definitions/sudo_force" + } + }, "links": [ { - "description": "List teams in which you are a member.", - "href": "/teams", - "method": "GET", - "rel": "instances", + "description": "Generate a gateway token for a user. Note that a JWT version of the\ntoken will be available in `Heroku-Gateway-Token` header.\n", + "href": "/users/~/gateway-tokens", + "method": "POST", + "rel": "self", "targetSchema": { - "items": { - "$ref": "#/definitions/team" - }, - "type": [ - "array" - ] + "$ref": "#/definitions/gateway-token" }, - "title": "List" + "title": "Create" }, { - "description": "Info for a team.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}", - "method": "GET", + "description": "Generates a Proxy oauth acccess tokens for the passed in gateway token.\nThis new proxy token is designed to have a shorter lifetime than the\nuser supplied token so it is safe to pass to futher downstream services\nwithout increasing the breadth of the long lived tokens.\n", + "href": "/users/~/gateway-tokens/oauth-authorization", + "method": "POST", "rel": "self", "targetSchema": { - "$ref": "#/definitions/team" + "$ref": "#/definitions/oauth-token" }, - "title": "Info" - }, - { - "description": "Update team properties.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}", - "method": "PATCH", - "rel": "update", - "schema": { - "properties": { - "default": { - "$ref": "#/definitions/team/definitions/default" - }, - "name": { - "$ref": "#/definitions/team/definitions/name" - } + "title": "OAuth Token" + } + ] + }, + "identity-provider-actions": { + "description": "Actions taken on Identity Providers, the SSO configuration representation.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Identity Provider Actions", + "type": [ + "object" + ], + "definitions": { + "certificates": { + "description": "Array of sso certificates belonging to this identity provider", + "properties": { + "created_at": { + "description": "when provider record was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] }, - "type": [ - "object" - ] - }, - "targetSchema": { - "$ref": "#/definitions/team" + "id": { + "description": "unique identifier of this identity provider", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "expires_at": { + "description": "time which the certificate expires", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "body": { + "description": "raw contents of the public certificate (eg: .crt or .pem file)", + "example": "-----BEGIN CERTIFICATE----- ...", + "readOnly": false, + "type": [ + "string" + ] + } }, - "title": "Update" + "readOnly": false, + "required": [ + "id" + ], + "type": [ + "array" + ] }, - { - "description": "Create a new team.", - "href": "/teams", - "method": "POST", - "rel": "create", - "schema": { - "properties": { - "name": { - "$ref": "#/definitions/team/definitions/name" - }, - "address_1": { - "$ref": "#/definitions/team/definitions/address_1" - }, - "address_2": { - "$ref": "#/definitions/team/definitions/address_2" - }, - "card_number": { - "$ref": "#/definitions/team/definitions/card_number" - }, - "city": { - "$ref": "#/definitions/team/definitions/city" - }, - "country": { - "$ref": "#/definitions/team/definitions/country" - }, - "cvv": { - "$ref": "#/definitions/team/definitions/cvv" - }, - "expiration_month": { - "$ref": "#/definitions/team/definitions/expiration_month" - }, - "expiration_year": { - "$ref": "#/definitions/team/definitions/expiration_year" - }, - "first_name": { - "$ref": "#/definitions/team/definitions/first_name" - }, - "last_name": { - "$ref": "#/definitions/team/definitions/last_name" - }, - "other": { - "$ref": "#/definitions/team/definitions/other" - }, - "postal_code": { - "$ref": "#/definitions/team/definitions/postal_code" - }, - "state": { - "$ref": "#/definitions/team/definitions/state" - }, - "nonce": { - "$ref": "#/definitions/team/definitions/nonce" - }, - "device_data": { - "$ref": "#/definitions/team/definitions/device_data" - } + "certificate": { + "description": "raw contents of the public certificate (eg: .crt or .pem file)", + "example": "-----BEGIN CERTIFICATE----- ...", + "readOnly": false, + "type": [ + "string" + ] + }, + "created_at": { + "description": "when provider record was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "entity_id": { + "description": "URL identifier provided by the identity provider", + "example": "https://customer-domain.idp.com", + "readOnly": false, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of this identity provider", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/identity-provider/definitions/id" }, - "required": [ - "name" - ], - "type": [ - "object" - ] - }, - "targetSchema": { - "$ref": "#/definitions/team" - }, - "title": "Create" + { + "$ref": "#/definitions/identity-provider/definitions/name" + } + ] }, - { - "description": "Delete an existing team.", - "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}", - "method": "DELETE", - "rel": "destroy", - "targetSchema": { - "$ref": "#/definitions/team" - }, - "title": "Delete" + "name": { + "description": "user-friendly unique identifier for this identity provider", + "example": "acme-sso", + "readOnly": false, + "type": [ + "string" + ] }, - { - "description": "List teams for an enterprise account.", - "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fidentity)}/teams", - "method": "GET", - "rel": "instances", - "targetSchema": { - "items": { - "$ref": "#/definitions/team" + "owner": { + "description": "entity that owns this identity provider", + "properties": { + "id": { + "description": "unique identifier of the owner", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] }, - "type": [ - "array" - ] + "name": { + "description": "name of the owner", + "example": "acme", + "readOnly": true, + "type": [ + "string" + ] + }, + "type": { + "description": "type of the owner", + "enum": [ + "team", + "enterprise-account" + ], + "example": "team", + "readOnly": true, + "type": [ + "string" + ] + } }, - "title": "List by Enterprise Account" + "readOnly": false, + "required": [ + "id", + "type" + ], + "type": [ + "object" + ] + }, + "slo_target_url": { + "description": "single log out URL for this identity provider", + "example": "https://example.com/idp/logout", + "readOnly": false, + "type": [ + "string" + ] + }, + "sso_target_url": { + "description": "single sign on URL for this identity provider", + "example": "https://example.com/idp/login", + "readOnly": false, + "type": [ + "string" + ] }, + "updated_at": { + "description": "when the identity provider record was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ { - "description": "Create a team in an enterprise account.", - "href": "/enterprise-accounts/{(%23%2Fdefinitions%2Fenterprise-account%2Fdefinitions%2Fidentity)}/teams", + "description": "Migrate an Identity Provider", + "href": "/identity-providers/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fidentity)}/migrate", "method": "POST", - "rel": "create", - "schema": { - "properties": { - "name": { - "$ref": "#/definitions/team/definitions/name" - } - }, - "required": [ - "name" - ], - "type": [ - "object" - ] - }, + "rel": "update", "targetSchema": { - "$ref": "#/definitions/team" + "$ref": "#/definitions/identity-provider" }, - "title": "Create in Enterprise Account" + "title": "Update" } ], "properties": { - "id": { - "$ref": "#/definitions/team/definitions/id" - }, - "created_at": { - "$ref": "#/definitions/team/definitions/created_at" - }, - "credit_card_collections": { - "$ref": "#/definitions/team/definitions/credit_card_collections" + "certificates": { + "$ref": "#/definitions/identity-provider/definitions/certificates" }, - "default": { - "$ref": "#/definitions/team/definitions/default" + "certificate": { + "$ref": "#/definitions/identity-provider/definitions/certificate" }, - "enterprise_account": { - "$ref": "#/definitions/team/definitions/enterprise_account" + "created_at": { + "$ref": "#/definitions/identity-provider/definitions/created_at" }, - "identity_provider": { - "$ref": "#/definitions/team/definitions/identity_provider" + "entity_id": { + "$ref": "#/definitions/identity-provider/definitions/entity_id" }, - "membership_limit": { - "$ref": "#/definitions/team/definitions/membership_limit" + "id": { + "$ref": "#/definitions/identity-provider/definitions/id" }, "name": { - "$ref": "#/definitions/team/definitions/name" + "$ref": "#/definitions/identity-provider/definitions/name" }, - "provisioned_licenses": { - "$ref": "#/definitions/team/definitions/provisioned_licenses" + "owner": { + "$ref": "#/definitions/identity-provider/definitions/owner" }, - "role": { - "$ref": "#/definitions/team/definitions/role" + "slo_target_url": { + "$ref": "#/definitions/identity-provider/definitions/slo_target_url" }, - "type": { - "$ref": "#/definitions/team/definitions/type" + "sso_target_url": { + "$ref": "#/definitions/identity-provider/definitions/sso_target_url" }, "updated_at": { - "$ref": "#/definitions/team/definitions/updated_at" + "$ref": "#/definitions/identity-provider/definitions/updated_at" } } }, - "test-case": { + "identity-provider-certificate": { + "description": "Certificates represent an sso cert attached to an Identity Provider", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "title": "Test Case", - "description": "A single test case belonging to a test run", "stability": "prototype", "strictProperties": true, + "title": "Heroku Platform API - Certificates", "type": [ "object" ], "definitions": { - "id": { - "description": "unique identifier of a test case", + "created_at": { + "description": "when provider record was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", "readOnly": true, - "format": "uuid", "type": [ "string" ] }, - "description": { - "description": "description of the test case", + "id": { + "description": "unique identifier of this identity provider", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, "type": [ "string" ] }, - "diagnostic": { - "description": "meta information about the test case", + "name": { + "description": "label for certificate", + "example": "Certificate 1", + "readOnly": false, "type": [ - "string" + "string", + "null" ] }, - "directive": { - "description": "special note about the test case e.g. skipped, todo", + "body": { + "description": "raw contents of the public certificate (eg: .crt or .pem file)", + "example": "-----BEGIN CERTIFICATE----- ...", + "readOnly": false, "type": [ "string" ] }, - "passed": { - "description": "whether the test case was successful", + "expires_at": { + "description": "time which the certificate expires", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, "type": [ - "boolean" + "string" ] }, - "number": { - "description": "the test number", + "identity_provider_id": { + "description": "unique identifier of the identity provider the cert belongs to", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, "type": [ - "integer" + "string" ] }, "identity": { "anyOf": [ { - "$ref": "#/definitions/test-case/definitions/id" + "$ref": "#/definitions/identity-provider-certificate/definitions/id" } ] - }, - "created_at": { - "description": "when test case was created", - "format": "date-time", - "readOnly": true, - "type": [ - "string" - ] - }, - "updated_at": { - "description": "when test case was updated", - "format": "date-time", - "readOnly": true, - "type": [ - "string" - ] } }, "links": [ { - "description": "List test cases", - "href": "/test-runs/{(%23%2Fdefinitions%2Ftest-run%2Fdefinitions%2Fid)}/test-cases", - "method": "GET", - "rel": "instances", + "description": "Destroy a Certificate", + "href": "/identity-providers/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fidentity)}/certificates/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/identity-provider-certificate" + }, + "title": "Delete" + }, + { + "description": "Create a Certificate", + "href": "/identity-providers/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fidentity)}/certificates", + "method": "POST", + "rel": "create", + "targetSchema": { + "$ref": "#/definitions/identity-provider-certificate" + }, + "schema": { + "properties": { + "body": { + "$ref": "#/definitions/identity-provider-certificate/definitions/body" + }, + "name": { + "$ref": "#/definitions/identity-provider-certificate/definitions/name" + } + }, + "required": [ + "body" + ] + }, + "title": "Create" + }, + { + "description": "Update a Certificate", + "href": "/identity-providers/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fidentity)}/certificates/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fidentity)}", + "method": "PATCH", + "rel": "update", "targetSchema": { - "items": { - "$ref": "#/definitions/test-case" + "$ref": "#/definitions/identity-provider-certificate" + }, + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/identity-provider-certificate/definitions/name" + } } }, - "type": [ - "array" - ], - "title": "List" + "title": "Update" + }, + { + "description": "Get a Certificate", + "href": "/identity-providers/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fidentity)}/certificates/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fidentity)}", + "method": "Get", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/identity-provider-certificate" + }, + "title": "Info" } ], "properties": { - "id": { - "$ref": "#/definitions/test-case/definitions/id" - }, - "created_at": { - "$ref": "#/definitions/test-case/definitions/created_at" - }, - "updated_at": { - "$ref": "#/definitions/test-case/definitions/updated_at" - }, - "description": { - "$ref": "#/definitions/test-case/definitions/description" - }, - "diagnostic": { - "$ref": "#/definitions/test-case/definitions/diagnostic" + "name": { + "$ref": "#/definitions/identity-provider-certificate/definitions/name" }, - "directive": { - "$ref": "#/definitions/test-case/definitions/directive" + "body": { + "$ref": "#/definitions/identity-provider-certificate/definitions/body" }, - "passed": { - "$ref": "#/definitions/test-case/definitions/passed" + "created_at": { + "$ref": "#/definitions/identity-provider-certificate/definitions/created_at" }, - "number": { - "$ref": "#/definitions/test-case/definitions/number" + "id": { + "$ref": "#/definitions/identity-provider-certificate/definitions/id" }, - "test_node": { - "description": "the test node which executed this test case", - "properties": { - "id": { - "$ref": "#/definitions/test-node/definitions/identity" - } - }, - "type": [ - "object" - ] + "expires_at": { + "$ref": "#/definitions/identity-provider-certificate/definitions/expires_at" }, - "test_run": { - "description": "the test run which owns this test case", - "properties": { - "id": { - "$ref": "#/definitions/test-run/definitions/identity" - } - }, - "type": [ - "object" - ] + "identity_provider_id": { + "$ref": "#/definitions/identity-provider-certificate/definitions/identity_provider_id" } } }, - "test-node": { + "payment-method": { "$schema": "http://json-schema.org/draft-04/hyper-schema", - "title": "Test Node", - "description": "A single test node belonging to a test run", + "description": "The on file payment method for an account", "stability": "prototype", - "strictProperties": true, + "title": "Heroku Vault API - Payment Method", "type": [ "object" ], "definitions": { - "id": { - "description": "unique identifier of a test node", - "example": "01234567-89ab-cdef-0123-456789abcdef", - "format": "uuid", - "readOnly": true, + "device_data": { "type": [ "string" - ] + ], + "description": "Device data string generated by the client", + "example": "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" }, - "attach_url": { - "description": "a URL to stream output from for debug runs or null for non-debug runs", - "example": "rendezvous://rendezvous.runtime.heroku.com:5000/{rendezvous-id}", - "readOnly": true, + "nonce": { "type": [ "string", "null" - ] + ], + "description": "Nonce generated by Braintree hosted fields form", + "example": "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" }, - "created_at": { - "description": "when test node was created", - "format": "date-time", - "readOnly": true, + "address_1": { + "type": [ + "string", + "null" + ], + "description": "street address line 1", + "example": "40 Hickory Lane" + }, + "address_2": { "type": [ "string" - ] + ], + "description": "street address line 2", + "example": "Suite 103" }, - "error_status": { - "description": "the status of the test run when the error occured", + "card_number": { "type": [ "string", "null" - ] + ], + "description": "encrypted card number of payment method", + "example": "encrypted-card-number" }, - "exit_code": { - "description": "the exit code of the test script", + "city": { "type": [ - "integer", + "string" + ], + "description": "city", + "example": "San Francisco" + }, + "country": { + "type": [ + "string" + ], + "description": "country", + "example": "US" + }, + "cvv": { + "type": [ + "string", "null" - ] + ], + "description": "card verification value", + "example": "123" }, - "identity": { - "anyOf": [ - { - "$ref": "#/definitions/test-node/definitions/id" - } - ] + "expiration_month": { + "type": [ + "string", + "null" + ], + "description": "expiration month", + "example": "11" }, - "index": { - "description": "The index of the test node", + "expiration_year": { "type": [ - "integer" - ] + "string", + "null" + ], + "description": "expiration year", + "example": "2014" }, - "message": { - "description": "human friendly message indicating reason for an error", + "first_name": { + "type": [ + "string" + ], + "description": "the first name for payment method", + "example": "Jason" + }, + "last_name": { + "type": [ + "string" + ], + "description": "the last name for payment method", + "example": "Walker" + }, + "other": { "type": [ "string", "null" - ] + ], + "description": "metadata", + "example": "Additional information for payment method" }, - "output_stream_url": { - "description": "the streaming output for the test node", - "example": "https://example.com/output.log", + "postal_code": { "type": [ "string" - ] + ], + "description": "postal code", + "example": "90210" }, - "setup_stream_url": { - "description": "the streaming test setup output for the test node", - "example": "https://example.com/test-setup.log", + "state": { + "type": [ + "string" + ], + "description": "state", + "example": "CA" + }, + "card_last4": { + "type": [ + "string" + ], + "description": "last 4 digits of credit card number", + "example": "1234", + "readOnly": true + }, + "card_type": { + "type": [ + "string" + ], + "description": "name of credit card issuer", + "example": "VISA", + "readOnly": true + }, + "heroku_id": { "type": [ "string" + ], + "description": "heroku_id identifier reference", + "example": "user930223902@heroku.com", + "readOnly": true + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/invoice-address/definitions/heroku_id" + } ] + } + }, + "links": [ + { + "description": "Update an existing payment method for an account.", + "href": "/account/payment-method", + "method": "PATCH", + "rel": "update", + "schema": { + "properties": { + "address_1": { + "$ref": "#/definitions/payment-method/definitions/address_1" + }, + "address_2": { + "$ref": "#/definitions/payment-method/definitions/address_2" + }, + "card_number": { + "$ref": "#/definitions/payment-method/definitions/card_number" + }, + "city": { + "$ref": "#/definitions/payment-method/definitions/city" + }, + "country": { + "$ref": "#/definitions/payment-method/definitions/country" + }, + "cvv": { + "$ref": "#/definitions/payment-method/definitions/cvv" + }, + "expiration_month": { + "$ref": "#/definitions/payment-method/definitions/expiration_month" + }, + "expiration_year": { + "$ref": "#/definitions/payment-method/definitions/expiration_year" + }, + "first_name": { + "$ref": "#/definitions/payment-method/definitions/first_name" + }, + "last_name": { + "$ref": "#/definitions/payment-method/definitions/last_name" + }, + "other": { + "$ref": "#/definitions/payment-method/definitions/other" + }, + "postal_code": { + "$ref": "#/definitions/payment-method/definitions/postal_code" + }, + "state": { + "$ref": "#/definitions/payment-method/definitions/state" + }, + "nonce": { + "$ref": "#/definitions/payment-method/definitions/nonce" + }, + "device_data": { + "$ref": "#/definitions/payment-method/definitions/device_data" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/payment-method" + }, + "title": "update" }, - "status": { - "description": "current state of the test run", - "enum": [ - "pending", - "cancelled", - "creating", - "building", - "running", - "succeeded", - "failed", - "errored", - "debugging" - ], - "readOnly": true, - "type": [ - "string" - ] + { + "description": "Get the current payment method for an account.", + "href": "/account/payment-method", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/payment-method" + }, + "title": "get" }, - "updated_at": { - "description": "when test node was updated", - "format": "date-time", - "readOnly": true, - "type": [ - "string" - ] - } - }, - "links": [ { - "description": "List test nodes", - "href": "/test-runs/{(%23%2Fdefinitions%2Ftest-run%2Fdefinitions%2Fidentity)}/test-nodes", + "description": "Get the verified apps on the payment-method", + "href": "/account/payment-method/apps", "method": "GET", - "rel": "instances", + "rel": "self", "targetSchema": { "items": { - "$ref": "#/definitions/test-node" - } - }, - "type": [ - "array" - ], - "title": "List" + "$ref": "#/definitions/app" + }, + "type": [ + "array" + ] + } } ], "properties": { - "created_at": { - "$ref": "#/definitions/test-node/definitions/created_at" + "address_1": { + "$ref": "#/definitions/payment-method/definitions/address_1" }, - "dyno": { - "description": "the dyno which belongs to this test node", - "properties": { - "id": { - "$ref": "#/definitions/dyno/definitions/identity" - }, - "attach_url": { - "$ref": "#/definitions/test-node/definitions/attach_url" - } - }, - "type": [ - "object", - "null" - ] + "address_2": { + "$ref": "#/definitions/payment-method/definitions/address_2" }, - "error_status": { - "$ref": "#/definitions/test-node/definitions/error_status" + "card_last4": { + "$ref": "#/definitions/payment-method/definitions/card_last4" }, - "exit_code": { - "$ref": "#/definitions/test-node/definitions/exit_code" + "card_type": { + "$ref": "#/definitions/payment-method/definitions/card_type" }, - "id": { - "$ref": "#/definitions/test-node/definitions/identity" + "city": { + "$ref": "#/definitions/payment-method/definitions/city" }, - "index": { - "$ref": "#/definitions/test-node/definitions/index" + "country": { + "$ref": "#/definitions/payment-method/definitions/country" }, - "message": { - "$ref": "#/definitions/test-node/definitions/message" + "expiration_month": { + "$ref": "#/definitions/payment-method/definitions/expiration_month" }, - "output_stream_url": { - "$ref": "#/definitions/test-node/definitions/output_stream_url" + "expiration_year": { + "$ref": "#/definitions/payment-method/definitions/expiration_year" }, - "pipeline": { - "description": "the pipeline which owns this test node", - "properties": { - "id": { - "$ref": "#/definitions/pipeline/definitions/identity" - } - }, - "type": [ - "object" - ] + "first_name": { + "$ref": "#/definitions/payment-method/definitions/first_name" }, - "setup_stream_url": { - "$ref": "#/definitions/test-node/definitions/setup_stream_url" + "last_name": { + "$ref": "#/definitions/payment-method/definitions/last_name" }, - "status": { - "$ref": "#/definitions/test-node/definitions/status" + "other": { + "$ref": "#/definitions/payment-method/definitions/other" }, - "updated_at": { - "$ref": "#/definitions/test-node/definitions/updated_at" + "postal_code": { + "$ref": "#/definitions/payment-method/definitions/postal_code" }, - "test_run": { - "description": "the test run which owns this test node", - "properties": { - "id": { - "$ref": "#/definitions/test-run/definitions/identity" - } - }, - "type": [ - "object" - ] + "state": { + "$ref": "#/definitions/payment-method/definitions/state" } } }, - "test-run": { + "payment": { "$schema": "http://json-schema.org/draft-04/hyper-schema", - "title": "Test Run", - "description": "An execution or trial of one or more tests", + "description": "A payment represents money collected for an account", + "title": "Heroku Vault API - Payments", "stability": "prototype", - "strictProperties": true, "type": [ "object" ], "definitions": { - "actor_email": { - "description": "the email of the actor triggering the test run", + "account_id": { "type": [ - "string" + "integer" ], - "format": "email" - }, - "clear_cache": { - "description": "whether the test was run with an empty cache", - "type": [ - "boolean", - "null" - ] - }, - "commit_branch": { - "description": "the branch of the repository that the test run concerns", - "type": [ - "string" - ] + "description": "account that payment belongs to", + "example": 8403923, + "readOnly": true }, - "commit_message": { - "description": "the message for the commit under test", + "amount": { "type": [ - "string" - ] + "number" + ], + "description": "amount of payment in cents", + "example": 50000, + "readOnly": false }, - "commit_sha": { - "description": "the SHA hash of the commit under test", + "created_at": { + "description": "when payment was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, "type": [ "string" ] }, - "debug": { - "description": "whether the test run was started for interactive debugging", - "type": [ - "boolean" - ] - }, - "app_setup": { - "description": "the app setup for the test run", - "type": [ - "null", - "object" - ] - }, "id": { - "description": "unique identifier of a test run", - "readOnly": true, - "format": "uuid", "type": [ - "string" - ] + "integer" + ], + "description": "legacy unique identifier of payment", + "example": 9403943, + "readOnly": true }, "identity": { "anyOf": [ { - "$ref": "#/definitions/test-run/definitions/id" + "$ref": "#/definitions/payment/definitions/id" } ] }, - "created_at": { - "description": "when test run was created", - "format": "date-time", - "readOnly": true, - "type": [ - "string" - ] - }, - "message": { - "description": "human friendly message indicating reason for an error", - "type": [ - "string", - "null" - ] - }, - "number": { - "description": "the auto incrementing test run number", - "type": [ - "integer" - ] - }, - "source_blob_url": { - "description": "The download location for the source code to be tested", - "type": [ - "string" - ] - }, - "status": { - "description": "current state of the test run", + "state": { "enum": [ + "failure", "pending", - "cancelled", - "creating", - "building", - "running", - "succeeded", - "failed", - "errored", - "debugging" + "success" ], - "readOnly": true, "type": [ "string" - ] + ], + "description": "state of the payment", + "example": "pending", + "readOnly": true }, "updated_at": { - "description": "when test-run was updated", + "description": "when credit was updated", + "example": "2012-01-01T12:00:00Z", "format": "date-time", "readOnly": true, "type": [ "string" ] }, - "warning_message": { - "description": "human friently warning emitted during the test run", + "uuid": { + "description": "unique identifier for a payment transaction", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": false, "type": [ - "string", - "null" + "string" ] } }, "links": [ { - "description": "Create a new test-run.", - "href": "/test-runs", + "description": "Create a payment on an existing account", + "href": "/account/payments", "method": "POST", - "rel": "create", + "rel": "self", "schema": { "properties": { - "commit_branch": { - "$ref": "#/definitions/test-run/definitions/commit_branch" - }, - "commit_message": { - "$ref": "#/definitions/test-run/definitions/commit_message" - }, - "commit_sha": { - "$ref": "#/definitions/test-run/definitions/commit_sha" - }, - "debug": { - "$ref": "#/definitions/test-run/definitions/debug" - }, - "organization": { - "$ref": "#/definitions/team/definitions/identity" - }, - "pipeline": { - "$ref": "#/definitions/pipeline/definitions/identity" + "amount": { + "$ref": "#/definitions/payment/definitions/amount" }, - "source_blob_url": { - "$ref": "#/definitions/test-run/definitions/source_blob_url" + "invoice_id": { + "$ref": "#/definitions/invoice/definitions/identity" + }, + "uuid": { + "$ref": "#/definitions/payment/definitions/uuid" } }, "required": [ - "commit_branch", - "commit_message", - "commit_sha", - "pipeline", - "source_blob_url" + "amount", + "invoice_id", + "uuid" ], "type": [ "object" ] }, - "title": "Create" - }, - { - "description": "Info for existing test-run.", - "href": "/test-runs/{(%23%2Fdefinitions%2Ftest-run%2Fdefinitions%2Fid)}", - "method": "GET", - "rel": "self", - "title": "Info" - }, - { - "description": "List existing test-runs for a pipeline.", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/test-runs", - "method": "GET", - "rel": "instances", "targetSchema": { - "items": { - "$ref": "#/definitions/test-run" - } + "$ref": "#/definitions/payment" }, - "type": [ - "array" - ], - "title": "List" - }, - { - "description": "Info for existing test-run by Pipeline", - "href": "/pipelines/{(%23%2Fdefinitions%2Fpipeline%2Fdefinitions%2Fid)}/test-runs/{(%23%2Fdefinitions%2Ftest-run%2Fdefinitions%2Fnumber)}", - "method": "GET", - "rel": "self", - "title": "Info By Pipeline" + "title": "create" }, { - "description": "Update a test-run's status.", - "href": "/test-runs/{(%23%2Fdefinitions%2Ftest-run%2Fdefinitions%2Fnumber)}", - "method": "PATCH", + "description": "Create a payment on an existing team", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/payments", + "method": "POST", "rel": "self", - "title": "Update", "schema": { "properties": { - "status": { - "$ref": "#/definitions/test-run/definitions/status" + "amount": { + "$ref": "#/definitions/payment/definitions/amount" }, - "message": { - "$ref": "#/definitions/test-run/definitions/message" + "invoice_id": { + "$ref": "#/definitions/invoice/definitions/identity" + }, + "uuid": { + "$ref": "#/definitions/payment/definitions/uuid" } }, "required": [ - "status", - "message" + "amount", + "invoice_id", + "uuid" ], "type": [ "object" ] - } + }, + "targetSchema": { + "$ref": "#/definitions/payment" + }, + "title": "create" } ], "properties": { - "actor_email": { - "$ref": "#/definitions/test-run/definitions/actor_email" - }, - "clear_cache": { - "$ref": "#/definitions/test-run/definitions/clear_cache" - }, - "commit_branch": { - "$ref": "#/definitions/test-run/definitions/commit_branch" - }, - "commit_message": { - "$ref": "#/definitions/test-run/definitions/commit_message" - }, - "commit_sha": { - "$ref": "#/definitions/test-run/definitions/commit_sha" - }, - "debug": { - "$ref": "#/definitions/test-run/definitions/debug" - }, - "app_setup": { - "$ref": "#/definitions/test-run/definitions/app_setup" + "amount": { + "$ref": "#/definitions/payment/definitions/amount" }, "created_at": { - "$ref": "#/definitions/test-run/definitions/created_at" - }, - "dyno": { - "description": "the type of dynos used for this test-run", - "properties": { - "size": { - "$ref": "#/definitions/dyno/definitions/size" - } - }, - "type": [ - "null", - "object" - ] + "$ref": "#/definitions/payment/definitions/created_at" }, "id": { - "$ref": "#/definitions/test-run/definitions/id" - }, - "message": { - "$ref": "#/definitions/test-run/definitions/message" - }, - "number": { - "$ref": "#/definitions/test-run/definitions/number" + "$ref": "#/definitions/payment/definitions/id" }, - "organization": { - "description": "the team that owns this test-run", + "invoice": { + "description": "identity of invoice", "properties": { - "name": { - "$ref": "#/definitions/team/definitions/name" + "id": { + "$ref": "#/definitions/invoice/definitions/id" + }, + "number": { + "$ref": "#/definitions/invoice/definitions/number" } }, "type": [ @@ -16756,40 +20982,35 @@ "object" ] }, - "pipeline": { - "description": "the pipeline which owns this test-run", + "updated_at": { + "$ref": "#/definitions/payment/definitions/updated_at" + }, + "user": { + "description": "identity of user issuing payment", "properties": { + "email": { + "$ref": "#/definitions/account/definitions/email" + }, "id": { - "$ref": "#/definitions/pipeline/definitions/identity" + "$ref": "#/definitions/account/definitions/id" } }, + "strictProperties": true, "type": [ "object" ] }, - "status": { - "$ref": "#/definitions/test-run/definitions/status" - }, - "source_blob_url": { - "$ref": "#/definitions/test-run/definitions/source_blob_url" - }, - "updated_at": { - "$ref": "#/definitions/test-run/definitions/updated_at" - }, - "user": { - "$ref": "#/definitions/account" - }, - "warning_message": { - "$ref": "#/definitions/test-run/definitions/warning_message" + "state": { + "$ref": "#/definitions/payment/definitions/state" } } }, - "user-preferences": { - "description": "Tracks a user's preferences and message dismissals", + "space-host": { + "description": "[Space Hosts](https://devcenter.heroku.com/articles/private-spaces-dedicated-hosts?preview=1) lists dedicated hosts allocated to a space", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", + "stability": "prototype", "strictProperties": true, - "title": "Heroku Platform API - User Preferences", + "title": "Heroku Platform API - Space Host", "type": [ "object" ], @@ -16797,483 +21018,515 @@ "identity": { "anyOf": [ { - "$ref": "#/definitions/user-preferences/definitions/self" + "$ref": "#/definitions/space-host/definitions/host_id" } ] }, - "self": { - "description": "Implicit reference to currently authorized user", - "enum": [ - "~" - ], - "example": "~", + "host_id": { + "description": "unique identifier of this host", + "example": "h-05abcdd96ee9ca123", "readOnly": true, "type": [ "string" ] }, - "timezone": { - "description": "User's default timezone", - "example": "UTC", - "readOnly": false, - "type": [ - "string", - "null" - ] - }, - "default-organization": { - "description": "User's default team", - "example": "sushi-inc", - "readOnly": false, - "type": [ - "string", - "null" - ] - }, - "dismissed-github-banner": { - "description": "Whether the user has dismissed the GitHub link banner", - "example": true, - "readOnly": false, - "type": [ - "boolean", - "null" - ] - }, - "dismissed-getting-started": { - "description": "Whether the user has dismissed the getting started banner", - "example": true, - "readOnly": false, - "type": [ - "boolean", - "null" - ] - }, - "dismissed-org-access-controls": { - "description": "Whether the user has dismissed the Organization Access Controls banner", - "example": true, - "readOnly": false, - "type": [ - "boolean", - "null" - ] - }, - "dismissed-org-wizard-notification": { - "description": "Whether the user has dismissed the Organization Wizard", - "example": true, - "readOnly": false, + "state": { + "description": "availability of this space", + "enum": [ + "available", + "under-assessment", + "permanent-failure", + "released", + "released-permanent-failure" + ], + "example": "available", + "readOnly": true, "type": [ - "boolean", - "null" + "string" ] }, - "dismissed-pipelines-banner": { - "description": "Whether the user has dismissed the Pipelines banner", - "example": true, - "readOnly": false, + "available_capacity_percentage": { + "description": "approximate available capacity on this host expresses a percentage", + "example": 67, + "readOnly": true, "type": [ - "boolean", - "null" + "number" ] }, - "dismissed-pipelines-github-banner": { - "description": "Whether the user has dismissed the GitHub banner on a pipeline overview", - "example": true, - "readOnly": false, + "allocated_at": { + "description": "when the host was allocated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, "type": [ - "boolean", - "null" + "string" ] }, - "dismissed-pipelines-github-banners": { - "description": "Which pipeline uuids the user has dismissed the GitHub banner for", - "example": [ - "96c68759-f310-4910-9867-e0b062064098" - ], - "readOnly": false, - "type": [ - "null", - "array" - ], - "items": { - "$ref": "#/definitions/pipeline/definitions/id" - } - }, - "dismissed-sms-banner": { - "description": "Whether the user has dismissed the 2FA SMS banner", - "example": true, - "readOnly": false, + "released_at": { + "description": "when the host was released", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, "type": [ - "boolean", - "null" + "string" ] } - }, + }, + "links": [ + { + "description": "List hosts", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/hosts", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/space-host" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "host_id": { + "$ref": "#/definitions/space-host/definitions/host_id" + }, + "state": { + "$ref": "#/definitions/space-host/definitions/state" + }, + "available_capacity_percentage": { + "$ref": "#/definitions/space-host/definitions/available_capacity_percentage" + }, + "allocated_at": { + "$ref": "#/definitions/space-host/definitions/allocated_at" + }, + "released_at": { + "$ref": "#/definitions/space-host/definitions/released_at" + } + } + }, + "space-log-drain": { + "description": "Single log drain for all apps in a Private Space", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Space Log Drain", + "type": [ + "object" + ], "links": [ { - "description": "Retrieve User Preferences", - "href": "/users/{(%23%2Fdefinitions%2Fuser-preferences%2Fdefinitions%2Fidentity)}/preferences", + "description": "Current log drain for a space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/log-drain", "method": "GET", "rel": "self", "targetSchema": { - "$ref": "#/definitions/user-preferences" + "$ref": "#/definitions/log-drain" }, - "title": "List" + "title": "Info" }, { - "description": "Update User Preferences", - "href": "/users/{(%23%2Fdefinitions%2Fuser-preferences%2Fdefinitions%2Fidentity)}/preferences", - "method": "PATCH", + "description": "Update log drain for a space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/log-drain", + "method": "PUT", "rel": "update", + "targetSchema": { + "$ref": "#/definitions/log-drain" + }, "schema": { "type": [ "object" ], "properties": { - "timezone": { - "$ref": "#/definitions/user-preferences/definitions/timezone" - }, - "default-organization": { - "$ref": "#/definitions/user-preferences/definitions/default-organization" - }, - "dismissed-github-banner": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-github-banner" - }, - "dismissed-getting-started": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-getting-started" - }, - "dismissed-org-access-controls": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-org-access-controls" - }, - "dismissed-org-wizard-notification": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-org-wizard-notification" - }, - "dismissed-pipelines-banner": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-banner" - }, - "dismissed-pipelines-github-banner": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-github-banner" - }, - "dismissed-pipelines-github-banners": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-github-banners" - }, - "dismissed-sms-banner": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-sms-banner" + "url": { + "type": [ + "string" + ] } } }, - "targetSchema": { - "$ref": "#/definitions/user-preferences" - }, "title": "Update" } - ], - "properties": { - "timezone": { - "$ref": "#/definitions/user-preferences/definitions/timezone" - }, - "default-organization": { - "$ref": "#/definitions/user-preferences/definitions/default-organization" - }, - "dismissed-github-banner": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-github-banner" - }, - "dismissed-getting-started": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-getting-started" - }, - "dismissed-org-access-controls": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-org-access-controls" - }, - "dismissed-org-wizard-notification": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-org-wizard-notification" - }, - "dismissed-pipelines-banner": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-banner" - }, - "dismissed-pipelines-github-banner": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-github-banner" - }, - "dismissed-pipelines-github-banners": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-pipelines-github-banners" - }, - "dismissed-sms-banner": { - "$ref": "#/definitions/user-preferences/definitions/dismissed-sms-banner" - } - } + ] }, - "vpn-connection": { - "description": "[VPN](https://devcenter.heroku.com/articles/private-space-vpn-connection) provides a way to connect your Private Spaces to your network via VPN.", + "team-license": { "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "production", + "description": "A team license is credits provided and consumed by the team.", + "stability": "prototype", "strictProperties": true, - "title": "Heroku Platform API - Private Spaces VPN", + "title": "Heroku Platform API - Team License", "type": [ "object" ], "definitions": { - "name": { - "description": "VPN Name", - "example": "office", + "start_date": { + "description": "when license started", + "example": "2012-01-01", + "readOnly": true, "type": [ "string" ] }, - "public_ip": { - "description": "Public IP of VPN customer gateway", - "example": "35.161.69.30", + "end_date": { + "description": "when license ended", + "example": "2012-01-01", + "readOnly": true, "type": [ "string" ] }, - "routable_cidrs": { - "description": "Routable CIDRs of VPN", + "qty": { + "description": "quantity of the license", + "example": 5, + "readOnly": true, "type": [ - "array" - ], - "items": { - "example": "172.16.0.0/16", - "type": [ - "string" - ] - } + "integer" + ] }, - "id": { - "description": "VPN ID", - "example": "123456789012", + "consumed": { + "description": "consumed quantity", + "example": 2, "readOnly": true, "type": [ - "string" + "integer" ] }, - "identity": { - "anyOf": [ - { - "$ref": "#/definitions/vpn-connection/definitions/id" - }, - { - "$ref": "#/definitions/vpn-connection/definitions/name" - } + "code": { + "description": "code of this license change", + "example": "add", + "readOnly": true, + "type": [ + "string" ] }, - "space_cidr_block": { - "description": "CIDR Block of the Private Space", - "example": "10.0.0.0/16", + "name": { + "description": "name of this license", + "example": "HerokuAddOnCredits1", "readOnly": true, "type": [ "string" ] + } + }, + "links": [ + { + "description": "List teams licenses.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/licenses", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-license" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "start_date": { + "$ref": "#/definitions/team-license/definitions/start_date" }, - "ike_version": { - "description": "IKE Version", - "example": 1, + "end_date": { + "$ref": "#/definitions/team-license/definitions/end_date" + }, + "qty": { + "$ref": "#/definitions/team-license/definitions/qty" + }, + "consumed": { + "$ref": "#/definitions/team-license/definitions/consumed" + }, + "code": { + "$ref": "#/definitions/team-license/definitions/code" + }, + "name": { + "$ref": "#/definitions/team-license/definitions/name" + } + } + }, + "team-license-collection": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "A team license collection is credits provided and consumed by the team per period.", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Team License Collection", + "type": [ + "object" + ], + "definitions": { + "period": { + "description": "year and month the licenses were in effect", + "example": "2014-01", "readOnly": true, "type": [ - "integer" + "string" ] + } + }, + "links": [ + { + "description": "List team licenses.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/license-collections", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/team-license-collection" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "period": { + "$ref": "#/definitions/team-license-collection/definitions/period" }, - "tunnel": { - "description": "Tunnel info", - "readOnly": true, + "licenses": { + "description": "Licenses for this period.", "type": [ - "object" + "array" ], - "properties": { - "last_status_change": { - "description": "Timestamp of last status changed", - "example": "2016-10-25T22:09:05Z", - "type": [ - "string" - ] - }, - "ip": { - "description": "Public IP address for the tunnel", - "example": "52.44.146.197", - "type": [ - "string" - ] - }, - "customer_ip": { - "description": "Public IP address for the customer side of the tunnel", - "example": "52.44.146.197", - "type": [ - "string" - ] - }, - "pre_shared_key": { - "description": "Pre-shared key", - "example": "secret", - "type": [ - "string" - ] - }, - "status": { - "description": "Status of the tunnel", - "enum": [ - "UP", - "DOWN" - ], - "example": "UP", + "items": { + "$ref": "#/definitions/team-license" + } + } + } + }, + "telemetry-ingress-info": { + "description": "Telemetry Ingress Info allows add-on partners to view authorization information required to write to Fir app logs.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Telemetry Ingress Info", + "type": [ + "object" + ], + "definitions": { + "id_token": { + "description": "JWT token to be used for authorization", + "readOnly": true, + "example": "vJkbPNUFaK4kVIMGQlEmyA.-MAquq_5yQqtae62b8i7aw", + "type": [ + "string" + ] + }, + "token_type": { + "description": "the authorization type", + "readOnly": true, + "example": "Bearer", + "type": [ + "string" + ] + }, + "transports": { + "description": "URLs for add-on partners to write to an add-ons logs", + "readOnly": true, + "type":"string", + "properties": { + "http": { + "description": "OLTP HTTP ingestion endpoint", + "readOnly": true, + "example": "https://telemetry-ingress.guarded-mountain-6621.herokuspace.com/v1/logs", "type": [ "string" ] }, - "status_message": { - "description": "Details of the status", - "example": "status message", + "logpex": { + "description": "Logpex URL for add-on partners to write to an add-ons logs", + "readOnly": true, + "example": "https://telemetry-ingress.guarded-mountain-6621.herokuspace.com/logplex/logs", "type": [ "string" ] } } }, - "status": { - "description": "Status of the VPN", - "enum": [ - "pending", - "provisioning", - "active", - "deprovisioning", - "failed" - ], - "example": "active", - "readOnly": true, - "type": [ - "string" - ] - }, - "status_message": { - "description": "Details of the status", - "example": "supplied CIDR block already in use", + "expires_at": { + "description": "when the token will expire", "readOnly": true, + "example": "2025-01-01T12:00:00Z", + "format": "date-time", "type": [ "string" ] } }, + "links": [ + { + "description": "Fetch telemetry ingress info.", + "href": "/addon-attachments/{(%23%2Fdefinitions%2Fadd-on-attachment%2Fdefinitions%2Fidentity)}/telemetry-ingress-info", + "method": "GET", + "rel": "instances", + "type": [ + "object" + ], + "targetSchema": { + "$ref": "#/definitions/telemetry-ingress-info" + }, + "title": "Info" + } + ], "properties": { - "id": { - "$ref": "#/definitions/vpn-connection/definitions/id" + "id_token": { + "$ref": "#/definitions/telemetry-ingress-info/definitions/id_token" }, - "name": { - "$ref": "#/definitions/vpn-connection/definitions/name" - }, - "public_ip": { - "$ref": "#/definitions/vpn-connection/definitions/public_ip" + "token_type": { + "$ref": "#/definitions/telemetry-ingress-info/definitions/token_type" }, - "routable_cidrs": { - "$ref": "#/definitions/vpn-connection/definitions/routable_cidrs" + "transports": { + "$ref": "#/definitions/telemetry-ingress-info/definitions/transports" }, - "space_cidr_block": { - "$ref": "#/definitions/vpn-connection/definitions/space_cidr_block" + "expires_at": { + "$ref": "#/definitions/telemetry-ingress-info/definitions/expires_at" + } + } + }, + "usage": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "Usage for apps.", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Usage", + "type": [ + "object" + ], + "definitions": { + "addon": { + "description": "usage for an add-on", + "type": [ + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/add-on/definitions/id" + }, + "meters": { + "$ref": "#/definitions/usage/definitions/addon_meters" + } + } }, - "tunnels": { - "items": { - "$ref": "#/definitions/vpn-connection/definitions/tunnel" + "addon_meters": { + "description": "the meters associated with the add-on", + "type": [ + "object" + ], + "example": { + "storage": { + "quantity": 1000 + } }, + "patternProperties": { + "^\\w+$": { + "$ref": "#/definitions/usage/definitions/addon_meter" + } + } + }, + "addon_meter": { + "description": "a meter for an add-on", "type": [ - "array" - ] + "object" + ], + "properties": { + "quantity": { + "$ref": "#/definitions/usage/definitions/addon_meter_quantity" + } + } }, - "ike_version": { - "$ref": "#/definitions/vpn-connection/definitions/ike_version" + "addon_meter_quantity": { + "description": "total meter units used", + "type": [ + "number" + ], + "example": 1000 }, - "status": { - "$ref": "#/definitions/vpn-connection/definitions/status" + "app": { + "description": "usage for an app belonging to the team", + "type": [ + "object" + ], + "properties": { + "id": { + "$ref": "#/definitions/app/definitions/id" + }, + "addons": { + "description": "add-on usage in the app", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/usage/definitions/addon" + } + } + } }, - "status_message": { - "$ref": "#/definitions/vpn-connection/definitions/status_message" + "apps": { + "description": "usage for the apps belonging to the team", + "type": [ + "object" + ], + "properties": { + "apps": { + "description": "apps belonging to the team", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/usage/definitions/app" + } + } + } } }, "links": [ { - "description": "Create a new VPN connection in a private space.", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/vpn-connections", - "rel": "create", - "schema": { - "properties": { - "name": { - "$ref": "#/definitions/vpn-connection/definitions/name" - }, - "public_ip": { - "$ref": "#/definitions/vpn-connection/definitions/public_ip" - }, - "routable_cidrs": { - "$ref": "#/definitions/vpn-connection/definitions/routable_cidrs" - } - }, - "required": [ - "name", - "public_ip", - "routable_cidrs" - ], - "type": [ - "object" - ] - }, - "targetSchema": { - "$ref": "#/definitions/vpn-connection" - }, - "method": "POST", - "title": "Create" - }, - { - "description": "Destroy existing VPN Connection", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/vpn-connections/{(%23%2Fdefinitions%2Fvpn-connection%2Fdefinitions%2Fidentity)}", - "rel": "empty", - "method": "DELETE", - "targetSchema": { - "$ref": "#/definitions/vpn-connection" - }, - "title": "Destroy" - }, - { - "description": "List VPN connections for a space.", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/vpn-connections", + "description": "Retrieves usage for an app.\n", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/usage", "method": "GET", "rel": "instances", + "title": "Info", "targetSchema": { - "items": { - "$ref": "#/definitions/vpn-connection" - }, - "type": [ - "array" - ] - }, - "title": "List" + "$ref": "#/definitions/usage" + } }, { - "description": "Info for an existing vpn-connection.", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/vpn-connections/{(%23%2Fdefinitions%2Fvpn-connection%2Fdefinitions%2Fidentity)}", + "description": "Retrieves usage for an app belonging to a particular team.\n", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/apps/{(%23%2Fdefinitions%2Fteam-app%2Fdefinitions%2Fidentity)}/usage", "method": "GET", - "rel": "self", + "rel": "instances", + "title": "Info", "targetSchema": { - "$ref": "#/definitions/vpn-connection" - }, - "title": "Info" + "$ref": "#/definitions/usage" + } }, { - "description": "Update a VPN connection in a private space.", - "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/vpn-connections/{(%23%2Fdefinitions%2Fvpn-connection%2Fdefinitions%2Fidentity)}", - "rel": "update", - "schema": { - "properties": { - "routable_cidrs": { - "$ref": "#/definitions/vpn-connection/definitions/routable_cidrs" - } - }, - "required": [ - "routable_cidrs" - ], - "type": [ - "object" - ] - }, + "description": "Retrieves usage for apps belonging to a particular team.\n", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/usage", + "method": "GET", + "rel": "instances", + "title": "Info", "targetSchema": { - "$ref": "#/definitions/vpn-connection" - }, - "method": "PATCH", - "title": "Update" + "$ref": "#/definitions/usage/definitions/apps" + } } - ] + ], + "properties": { + "addons": { + "description": "add-on usage in the app", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/usage/definitions/addon" + } + } + } } }, "properties": { @@ -17388,6 +21641,9 @@ "formation": { "$ref": "#/definitions/formation" }, + "generation": { + "$ref": "#/definitions/generation" + }, "identity-provider": { "$ref": "#/definitions/identity-provider" }, @@ -17421,6 +21677,9 @@ "oauth-token": { "$ref": "#/definitions/oauth-token" }, + "oci-image": { + "$ref": "#/definitions/oci-image" + }, "password-reset": { "$ref": "#/definitions/password-reset" }, @@ -17553,6 +21812,9 @@ "team": { "$ref": "#/definitions/team" }, + "telemetry-drain": { + "$ref": "#/definitions/telemetry-drain" + }, "test-case": { "$ref": "#/definitions/test-case" }, @@ -17567,6 +21829,54 @@ }, "vpn-connection": { "$ref": "#/definitions/vpn-connection" + }, + "add-on-sso": { + "$ref": "#/definitions/add-on-sso" + }, + "build-metadata": { + "$ref": "#/definitions/build-metadata" + }, + "capability": { + "$ref": "#/definitions/capability" + }, + "config-vars-settings": { + "$ref": "#/definitions/config-vars-settings" + }, + "dyno-processes": { + "$ref": "#/definitions/dyno-processes" + }, + "gateway-token": { + "$ref": "#/definitions/gateway-token" + }, + "identity-provider-actions": { + "$ref": "#/definitions/identity-provider-actions" + }, + "identity-provider-certificate": { + "$ref": "#/definitions/identity-provider-certificate" + }, + "payment-method": { + "$ref": "#/definitions/payment-method" + }, + "payment": { + "$ref": "#/definitions/payment" + }, + "space-host": { + "$ref": "#/definitions/space-host" + }, + "space-log-drain": { + "$ref": "#/definitions/space-log-drain" + }, + "team-license": { + "$ref": "#/definitions/team-license" + }, + "team-license-collection": { + "$ref": "#/definitions/team-license-collection" + }, + "telemetry-ingress-info": { + "$ref": "#/definitions/telemetry-ingress-info" + }, + "usage": { + "$ref": "#/definitions/usage" } }, "description": "The platform API empowers developers to automate, extend and combine Heroku with other services.", @@ -17588,4 +21898,4 @@ } ], "title": "Heroku Platform API" -} +} \ No newline at end of file diff --git a/scripts/package.json b/scripts/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/scripts/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/src/index.ts b/src/index.ts index c591755..853ef0a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -184,6 +184,64 @@ export interface Account { * @example "United States" */ country_of_residence: string | null; + /** + * whether the user has enabled Eco dynos + */ + eco_dynos_enabled: boolean; + /** + * When the user's Eco dynos will be shutdown after disablement + * + * @example "2012-01-01T12:00:00Z" + */ + readonly eco_dynos_shutdown_at: string | null; + /** + * when pipeline cost consent was made + * + * @example "2012-01-01T12:00:00Z" + */ + readonly pipeline_cost_consent_at: string | null; + /** + * whether account has acknowledged the MSA terms of service + */ + readonly acknowledged_msa: boolean; + /** + * when account has acknowledged the MSA terms of service + * + * @example "2012-01-01T12:00:00Z" + */ + readonly acknowledged_msa_at: string | null; + /** + * whether account has acknowledged the Italian customer terms of service + * + * @example "affirmatively_accepted" + */ + readonly italian_customer_terms: string | null; + /** + * whether account has acknowledged the Italian provider terms of service + * + * @example "affirmatively_accepted" + */ + readonly italian_partner_terms: string | null; + /** + * whether account has legacy 2FA or VaaS MFA enabled + */ + readonly mfa_enabled: boolean; + /** + * whether the user is exempt from MFA requirements + */ + mfa_exemption: boolean; + /** + * the reason why a user may be exempt from MFA requirements + * + * @example "federated" + */ + mfa_exemption_reason: string | null; + /** + * which type of mfa the user should see + * + * @example "vaas" + */ + readonly mfa_experience: 'vaas' | 'legacy'; /** * team selected by default */ @@ -196,7 +254,7 @@ export interface Account { /** * * [Heroku Platform API - identity-provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) - * Identity Providers represent the SAML configuration of teams or an Enterprise account + * Identity Providers represent the SSO configuration of an Enterprise Account or Team. */ export interface IdentityProvider { /** @@ -204,7 +262,17 @@ export interface IdentityProvider { * * @example "-----BEGIN CERTIFICATE----- ..." */ - certificate: string; + certificate: string | null; + /** + * Array of sso certificates belonging to this identity provider + */ + certificates: Array<{ + readonly created_at?: string; + readonly id?: string; + readonly expires_at?: string; + body?: string; + name?: string | null; +}>; /** * when provider record was created * @@ -223,6 +291,16 @@ export interface IdentityProvider { * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly id: string; + /** + * user-friendly unique identifier for this identity provider + * + * @example "acme-sso" + */ + name: string; + /** + * entity that owns this identity provider + */ + owner: Owner; /** * single log out URL for this identity provider * @@ -235,10 +313,6 @@ export interface IdentityProvider { * @example "https://example.com/idp/login" */ sso_target_url: string; - /** - * team associated with this identity provider - */ - organization: null | Organization; /** * when the identity provider record was updated * @@ -246,9 +320,27 @@ export interface IdentityProvider { */ readonly updated_at: string; /** - * entity that owns this identity provider + * when the identity provider is allowed to be used */ - owner: Owner; + readonly enabled: boolean; + /** + * heroku start url + * + * @example "https://sso.heroku.com/saml/acme-sso/init" + */ + readonly heroku_start_url: string; + /** + * heroku entity id + * + * @example "https://sso.heroku.com/saml/acme-sso" + */ + readonly heroku_entity_id: string; + /** + * heroku acs url + * + * @example "https://sso.heroku.com/saml/acme-sso/finalize" + */ + readonly heroku_acs_url: string; } /** * @@ -291,6 +383,18 @@ export interface Team { * @example 25 */ readonly membership_limit: number | null; + /** + * Time when team was consented into new pipeline costs + * + * @example "01-01-2023" + */ + pipeline_cost_consent_at: string | null; + /** + * Email of team user that consented to new pipeline costs + * + * @example "heroku@salesforce.com" + */ + pipeline_cost_consent_user_email: string | null; /** * unique name of team * @@ -407,6 +511,16 @@ export interface AccountUpdatePayload { * @example "Tina Edmonds" */ name?: string | null; + /** + * whether the user has enabled Eco dynos + */ + eco_dynos_enabled?: boolean; + /** + * whether pipeline cost consent was made + * + * @example "true" + */ + readonly pipeline_cost_consent?: boolean; } export interface AccountUpdateByUserPayload { /** @@ -425,6 +539,16 @@ export interface AccountUpdateByUserPayload { * @example "Tina Edmonds" */ name?: string | null; + /** + * whether the user has enabled Eco dynos + */ + eco_dynos_enabled?: boolean; + /** + * whether pipeline cost consent was made + * + * @example "true" + */ + readonly pipeline_cost_consent?: boolean; } /** * @@ -447,18 +571,8 @@ export interface AddOn { * identity of add-on serviceAdd-on services represent add-ons that may be provisioned for apps. Endpoints under add-on services can be accessed without authentication. */ addon_service: { - /** - * unique identifier of this add-on-service - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ - readonly id: string; - /** - * unique name of this add-on-service - * - * @example "heroku-postgresql" - */ - readonly name: string; + readonly id: string; + readonly name: string; } | AddOnService; /** * billing entity associated with this add-on @@ -500,18 +614,8 @@ export interface AddOn { * identity of add-on planPlans represent different configurations of add-ons that may be added to apps. Endpoints under add-on services can be accessed without authentication. */ plan: { - /** - * unique identifier of this plan - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ - readonly id: string; - /** - * unique name of this plan - * - * @example "heroku-postgresql:dev" - */ - readonly name: string; + readonly id: string; + readonly name: string; } | Plan; /** * id of this add-on with its provider @@ -598,6 +702,13 @@ export interface AddOnService { * @example "2012-01-01T12:00:00Z" */ readonly updated_at: string; + /** + * generations supported by this add-on + */ + supported_generations: Array<{ + readonly name?: string; + readonly id?: string; +}>; } /** * @@ -639,6 +750,16 @@ export interface App { * @example "2012-01-01T12:00:00Z" */ readonly archived_at: null | string; + /** + * name of the image used for the base layers of the OCI image + * + * @example "heroku/heroku:22-cnb" + */ + readonly base_image_name: null | string; + /** + * identity of the stack that will be used for new builds + */ + build_stack: BuildStack; /** * description from buildpack of app * @@ -646,15 +767,27 @@ export interface App { */ readonly buildpack_provided_description: null | string; /** - * identity of the stack that will be used for new builds + * buildpacks of the OCI image */ - build_stack: BuildStack; + buildpacks: null | Buildpack[]; /** * when app was created * * @example "2012-01-01T12:00:00Z" */ readonly created_at: string; + /** + * current build architecture for the app + * + * @example "[arm64]" + */ + current_build_architecture: []; + /** + * the generation of the app + * + * @example "fir" + */ + readonly generation: string; /** * git repo URL of app * @@ -745,6 +878,10 @@ export interface BilledPrice { * price is negotiated in a contract outside of monthly add-on billing */ readonly contract: boolean; + /** + * whether this plan is billed per use + */ + readonly metered: boolean; /** * unit of price for plan * @@ -870,6 +1007,10 @@ export interface Price { * price is negotiated in a contract outside of monthly add-on billing */ readonly contract: boolean; + /** + * whether this plan is billed per use + */ + readonly metered: boolean; /** * unit of price for plan * @@ -877,6 +1018,14 @@ export interface Price { */ readonly unit: string; } +export interface AddOnActionPeerPayload { + /** + * The AWS VPC Peering Connection ID of the peering. + * + * @example "pcx-123456789012" + */ + readonly pcx_id: string; +} /** * * [Heroku Platform API - add-on-attachment](https://devcenter.heroku.com/articles/platform-api-reference#add-on-attachment) @@ -1786,7 +1935,7 @@ export interface AppSetup { /** * * [Heroku Platform API - build](https://devcenter.heroku.com/articles/platform-api-reference#build) - * A build represents the process of transforming a code tarball into a slug + * A build represents the process of transforming a code tarball into build artifacts */ export interface Build { /** @@ -1794,21 +1943,11 @@ export interface Build { */ app?: BuildApp; /** - * buildpacks executed for this build, in order + * buildpacks executed for this build, in order (only applicable to Cedar-generation apps) */ buildpacks?: Array<{ - /** - * the URL of the buildpack for the app - * - * @example "https://github.com/heroku/heroku-buildpack-ruby" - */ - url?: string; - /** - * Buildpack Registry name of the buildpack for the app - * - * @example "heroku/ruby" - */ - name?: string; + url?: string; + name?: string; }> | null; /** * when build was created @@ -1822,6 +1961,12 @@ export interface Build { * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly id: string; + /** + * Labs set from project.toml file. Only applies to Fir generation apps. + * + * @example {"build_config_vars":true} + */ + readonly labs?: Record; /** * Build process output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). * @@ -1839,7 +1984,7 @@ export interface Build { */ readonly release?: null | BuildRelease; /** - * slug created by this build + * slug created by this build (only applicable for Cedar-generation apps) */ slug?: Slug | null; /** @@ -2201,13 +2346,37 @@ export interface BuildStack { * * @example "01234567-89ab-cdef-0123-456789abcdef" */ - readonly id: string; + readonly id?: string; /** * unique name of stack * * @example "heroku-18" */ - readonly name: string; + readonly name?: string; +} +/** + * + * set of executables that inspects app source code and creates a plan to build and run your image + */ +export interface Buildpack { + /** + * identifier of the buildpack + * + * @example "heroku/ruby" + */ + id?: string; + /** + * version of the buildpack + * + * @example "2.0.0" + */ + version?: string; + /** + * homepage of the buildpack + * + * @example "https://github.com/heroku/buildpacks-ruby" + */ + homepage?: string; } /** * @@ -2348,6 +2517,12 @@ export interface Space { * @example "10.2.0.0/16" */ data_cidr: string; + /** + * generation for space + * + * @example "fir" + */ + generation: string; } /** * @@ -2579,6 +2754,10 @@ export interface EnterpriseAccount { * whether the enterprise account is a trial or not */ readonly trial: boolean; + /** + * whether the enterprise account is part of the Salesforce Partner Program + */ + readonly partner_benefits: boolean; /** * Identity Provider associated with the Enterprise Account */ @@ -2745,21 +2924,11 @@ export interface User { } export interface BuildCreatePayload { /** - * buildpacks executed for this build, in order + * buildpacks executed for this build, in order (only applicable to Cedar-generation apps) */ buildpacks?: Array<{ - /** - * the URL of the buildpack for the app - * - * @example "https://github.com/heroku/heroku-buildpack-ruby" - */ - url?: string; - /** - * Buildpack Registry name of the buildpack for the app - * - * @example "heroku/ruby" - */ - name?: string; + url?: string; + name?: string; }> | null; /** * location of gzipped tarball of source code used to create build @@ -2809,13 +2978,13 @@ export interface BuildpackInstallation { /** * buildpack */ - buildpack: Buildpack; + buildpack: BuildpackInstallationBuildpack; } /** * * buildpack */ -export interface Buildpack { +export interface BuildpackInstallationBuildpack { /** * location of the buildpack for the app. Either a url (unofficial buildpacks) or an internal urn (heroku official buildpacks). * @@ -3187,12 +3356,24 @@ export interface DomainUpdatePayload { * Dyno sizes are the values and details of sizes that can be assigned to dynos. This information can also be found at : [https://devcenter.heroku.com/articles/dyno-types](https://devcenter.heroku.com/articles/dyno-types). */ export interface DynoSize { + /** + * CPU architecture of this dyno + * + * @example "arm64" + */ + readonly architecture: string; /** * minimum vCPUs, non-dedicated may get more depending on load * * @example 1 */ readonly compute: number; + /** + * whether this dyno size's product tier can use auto-scaling + * + * @example true + */ + readonly can_autoscale: boolean; /** * price information for this dyno size */ @@ -3201,10 +3382,6 @@ export interface DynoSize { * whether this dyno will be dedicated to one user */ readonly dedicated: boolean; - /** - * deprecated. See precise_dyno_units instead - */ - readonly dyno_units: number; /** * unit of consumption for Heroku Enterprise customers to 2 decimal places * @@ -3212,7 +3389,7 @@ export interface DynoSize { */ readonly precise_dyno_units: number; /** - * unique identifier of this dyno size + * unique identifier of the dyno size * * @example "01234567-89ab-cdef-0123-456789abcdef" */ @@ -3224,7 +3401,7 @@ export interface DynoSize { */ readonly memory: number; /** - * the name of this dyno-size + * name of the dyno size * * @example "eco" */ @@ -3233,6 +3410,41 @@ export interface DynoSize { * whether this dyno can only be provisioned in a private space */ readonly private_space_only: boolean; + /** + * Generation of the Heroku platform for this dyno size + */ + readonly generation: DynoSizeGeneration; + /** + * infrastructure tier for this dyno + * + * @example "production" + */ + readonly infrastructure_tier: string; + /** + * product tier for this dyno + * + * @example "standard" + */ + readonly product_dyno_tier: string; +} +/** + * + * [Heroku Platform API - generation](https://devcenter.heroku.com/articles/platform-api-reference#generation) + * Generation of the Heroku platform for this dyno size + */ +export interface DynoSizeGeneration { + /** + * unique identifier of the generation of the Heroku platform for this dyno size + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of the generation of the Heroku platform for this dyno size + * + * @example "cedar" + */ + readonly name?: string; } /** * @@ -3305,7 +3517,7 @@ export interface Dyno { } /** * - * [Heroku Platform API - release](https://devcenter.heroku.com/articles/platform-api-reference#release) + * [Heroku Platform API - pipeline-deployment](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-deployment) * A release represents a combination of code, config vars and add-ons for an app on Heroku. */ export interface Release { @@ -3313,6 +3525,10 @@ export interface Release { * add-on plans installed on the app for this release */ addon_plan_names: string[]; + /** + * build artifacts for the release + */ + artifacts: Artifact[]; /** * app involved in the release */ @@ -3342,7 +3558,11 @@ export interface Release { */ readonly updated_at: string; /** - * slug running in this release + * OCI image running in this release + */ + oci_image: ReleaseOciImage | null; + /** + * slug running in this release. Not applicable to apps using Cloud Native Buildpacks. */ slug: Slug | null; /** @@ -3350,7 +3570,7 @@ export interface Release { * * @example "succeeded" */ - readonly status: 'failed' | 'pending' | 'succeeded'; + readonly status: 'expired' | 'failed' | 'pending' | 'succeeded'; /** * user that created the release */ @@ -3362,17 +3582,23 @@ export interface Release { */ readonly version: number; /** - * indicates this release as being the current one for the app + * indicates if this release is the current one for the app * * @example true */ readonly current: boolean; /** - * Release command output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). + * URL that the release command output streams to. The stream is available as either `text/plain` or `text/event-stream`. Prepare clients to handle disconnects and to resume the stream by sending a `Range` header for `text/plain` or a `Last-Event-Id` header for `text/event-stream`. * * @example "https://release-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef" */ readonly output_stream_url: string | null; + /** + * indicates if this release is eligible for rollback + * + * @example true + */ + readonly eligible_for_rollback: boolean; } /** * @@ -3451,89 +3677,51 @@ export interface EnterpriseAccountDailyUsage { * usage by team */ teams: Array<{ + readonly addons?: number; + apps?: AppUsageDaily[]; + readonly data?: number; + readonly dynos?: number; + readonly id?: string; + readonly name?: string; + readonly partner?: number; + readonly space?: number; +}>; /** - * total add-on credits used + * total add-on credits used for first party add-ons * - * @example 250 - */ - readonly addons?: number; - /** - * app usage in the team + * @example 34.89 */ - apps?: AppUsageDaily[]; + readonly data: number; /** - * total add-on credits used for first party add-ons + * date of the usage * - * @example 34.89 + * @example "2019-01-01" */ - readonly data?: number; + readonly date: string; /** * dynos used * * @example 1.548 */ - readonly dynos?: number; + readonly dynos: number; /** - * team identifier + * enterprise account identifier * * @example "01234567-89ab-cdef-0123-456789abcdef" */ - readonly id?: string; + readonly id: string; /** - * name of the team + * name of the enterprise account * - * @example "ops" + * @example "example-co" */ - readonly name?: string; + readonly name: string; /** * total add-on credits used for third party add-ons * * @example 12.34 */ - readonly partner?: number; - /** - * space credits used - * - * @example 1.548 - */ - readonly space?: number; -}>; - /** - * total add-on credits used for first party add-ons - * - * @example 34.89 - */ - readonly data: number; - /** - * date of the usage - * - * @example "2019-01-01" - */ - readonly date: string; - /** - * dynos used - * - * @example 1.548 - */ - readonly dynos: number; - /** - * enterprise account identifier - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ - readonly id: string; - /** - * name of the enterprise account - * - * @example "example-co" - */ - readonly name: string; - /** - * total add-on credits used for third party add-ons - * - * @example 12.34 - */ - readonly partner: number; + readonly partner: number; /** * space credits used * @@ -3608,17 +3796,8 @@ export interface EnterpriseAccountMember { * enterprise account permissions */ permissions: Array<{ - /** - * - * @example "View enterprise account members and teams." - */ - description?: string; - /** - * permission in the enterprise account - * - * @example "view" - */ - readonly name?: 'view' | 'create' | 'manage' | 'billing'; + description?: string; + readonly name?: 'view' | 'create' | 'manage' | 'billing'; }>; /** * user information for the membership @@ -3715,61 +3894,18 @@ export interface EnterpriseAccountMonthlyUsage { * usage by team */ teams: Array<{ - /** - * total add-on credits used - * - * @example 250 - */ - readonly addons?: number; - /** - * app usage in the team - */ - apps?: AppUsageMonthly[]; - /** - * average connect rows synced - * - * @example 15000 - */ - readonly connect?: number; - /** - * total add-on credits used for first party add-ons - * - * @example 34.89 - */ - readonly data?: number; - /** - * dynos used - * - * @example 1.548 - */ - readonly dynos?: number; - /** - * team identifier - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ - readonly id?: string; - /** - * name of the team - * - * @example "ops" - */ - readonly name?: string; - /** - * total add-on credits used for third party add-ons - * - * @example 12.34 - */ - readonly partner?: number; - /** - * space credits used - * - * @example 1.548 - */ - readonly space?: number; + readonly addons?: number; + apps?: AppUsageMonthly[]; + readonly connect?: number; + readonly data?: number; + readonly dynos?: number; + readonly id?: string; + readonly name?: string; + readonly partner?: number; + readonly space?: number; }>; /** - * average connect rows synced + * max connect rows synced * * @example 15000 */ @@ -3915,6 +4051,16 @@ export interface TeamApp { * @example "2012-01-01T12:00:00Z" */ readonly archived_at?: null | string; + /** + * name of the image used for the base layers of the OCI image + * + * @example "heroku/heroku:22-cnb" + */ + readonly base_image_name?: null | string; + /** + * identity of the stack that will be used for new builds + */ + build_stack?: BuildStack; /** * description from buildpack of app * @@ -3922,15 +4068,27 @@ export interface TeamApp { */ readonly buildpack_provided_description?: null | string; /** - * identity of the stack that will be used for new builds + * buildpacks of the OCI image */ - build_stack?: BuildStack; + buildpacks?: null | Buildpack[]; + /** + * current build architecture for the app + * + * @example "[arm64]" + */ + current_build_architecture?: []; /** * when app was created * * @example "2012-01-01T12:00:00Z" */ readonly created_at?: string; + /** + * the generation of the app + * + * @example "fir" + */ + readonly generation?: string; /** * git repo URL of app * @@ -4090,6 +4248,10 @@ export interface Formation { * @example "2012-01-01T12:00:00Z" */ readonly created_at: string; + /** + * dyno size + */ + dyno_size: FormationDynoSize; /** * unique identifier of this process type * @@ -4103,7 +4265,7 @@ export interface Formation { */ quantity: number; /** - * dyno size + * deprecated, refer to 'dyno_size' instead * * @example "standard-1X" */ @@ -4140,9 +4302,27 @@ export interface FormationApp { */ readonly id?: string; } +/** + * + * dyno size + */ +export interface FormationDynoSize { + /** + * unique identifier of the dyno size + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * name of the dyno size + * + * @example "eco" + */ + readonly name?: string; +} export interface FormationBatchUpdatePayload { /** - * Array with formation updates. Each element must have "type", the id or name of the process type to be updated, and can optionally update its "quantity" or "size". + * Array with formation updates. Each element must have "type", the id or name of the process type to be updated, and can optionally update its "quantity" or "dyno_size". */ updates: FormationBatchUpdatePayloadUpdate[]; } @@ -4152,17 +4332,17 @@ export interface FormationBatchUpdatePayload { */ export interface FormationBatchUpdatePayloadUpdate { /** - * number of processes to maintain + * dyno size * - * @example 1 + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} */ - quantity?: number; + dyno_size?: FormationBatchUpdatePayloadUpdateDynoSize; /** - * dyno size + * number of processes to maintain * - * @example "standard-1X" + * @example 1 */ - size?: string; + quantity?: number; /** * type of process to maintain * @@ -4170,33 +4350,142 @@ export interface FormationBatchUpdatePayloadUpdate { */ readonly type: string; } +/** + * + * dyno size + */ +export interface FormationBatchUpdatePayloadUpdateDynoSize { + /** + * unique identifier of the dyno size + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * name of the dyno size + * + * @example "Standard-1X" + */ + readonly name?: string; +} export interface FormationUpdatePayload { + /** + * dyno size + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} + */ + dyno_size?: FormationUpdatePayloadDynoSize; /** * number of processes to maintain * * @example 1 */ quantity?: number; +} +/** + * + * dyno size + */ +export interface FormationUpdatePayloadDynoSize { /** - * dyno size + * unique identifier of the dyno size * - * @example "standard-1X" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ - size?: string; + readonly id: string; + /** + * name of the dyno size + * + * @example "Standard-1X" + */ + readonly name?: string; +} +/** + * + * [Heroku Platform API - generation](https://devcenter.heroku.com/articles/platform-api-reference#generation) + * A generation represents a version of the Heroku platform that includes the app execution environment, routing, telemetry, and build systems. + */ +export interface Generation { + /** + * when generation was created + * + * @example "2024-12-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of generation + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique name of generation + * + * @example "fir" + */ + readonly name: string; + /** + * when generation was updated + * + * @example "2024-12-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * features unsupported by this generation + */ + unsupported_features: string[]; + /** + * features unsupported by this generation along with their metadata + */ + expanded_supported_features: UnsupportedFeature[]; +} +/** + * + * unsupported feature information + */ +export interface UnsupportedFeature { + /** + * name of unsupported feature + * + * @example "app_maintenance" + */ + name?: string; + /** + * type of unsupported feature + * + * @example "temporary" + */ + incompatible_type?: string; + /** + * scope of unsupported feature + * + * @example "app" + */ + scope?: string; } -export interface IdentityProviderCreateByTeamPayload { +export interface IdentityProviderCreatePayload { + /** + * Array of sso certificates belonging to this identity provider + */ + certificates?: Array<{ + readonly created_at?: string; + readonly id?: string; + readonly expires_at?: string; + body?: string; + name?: string | null; +}>; /** * raw contents of the public certificate (eg: .crt or .pem file) * * @example "-----BEGIN CERTIFICATE----- ..." */ - certificate: string; + certificate?: string | null; /** * URL identifier provided by the identity provider * * @example "https://customer-domain.idp.com" */ - entity_id: string; + entity_id?: string; /** * single log out URL for this identity provider * @@ -4208,15 +4497,17 @@ export interface IdentityProviderCreateByTeamPayload { * * @example "https://example.com/idp/login" */ - sso_target_url: string; -} -export interface IdentityProviderUpdateByTeamPayload { + sso_target_url?: string; /** - * raw contents of the public certificate (eg: .crt or .pem file) - * - * @example "-----BEGIN CERTIFICATE----- ..." + * entity that owns this identity provider + */ + owner: Owner; + /** + * when the identity provider is allowed to be used */ - certificate?: string; + readonly enabled?: boolean; +} +export interface IdentityProviderUpdatePayload { /** * URL identifier provided by the identity provider * @@ -4235,6 +4526,14 @@ export interface IdentityProviderUpdateByTeamPayload { * @example "https://example.com/idp/login" */ sso_target_url?: string; + /** + * when the identity provider is allowed to be used + */ + readonly enabled?: boolean; + /** + * List of certificates to update or create; any existing certificates not referenced here will be deleted + */ + certificates?: []; } /** * @@ -4648,13 +4947,19 @@ export interface LogSession { } export interface LogSessionCreatePayload { /** - * dyno to limit results to + * dyno name to limit results to * - * @example "web.1" + * @example "'web.1' (Cedar-generation) or 'web-1234abcde-123ab' (Fir-generation)" */ dyno?: string; /** - * number of log lines to stream at once + * process type to limit results to (for Fir-generation apps only) + * + * @example "web" + */ + type?: string; + /** + * number of log lines to stream at a time (for Cedar-generation apps only) * * @example 10 */ @@ -4692,6 +4997,12 @@ export interface OauthAuthorization { * @example "2012-01-01T12:00:00Z" */ readonly created_at: string; + /** + * human-friendly description of this OAuth authorization + * + * @example "sample authorization" + */ + readonly description: string; /** * this authorization's grant */ @@ -4712,6 +5023,10 @@ export interface OauthAuthorization { * @example ["global"] */ readonly scope: string[]; + /** + * this authorization's session + */ + readonly session: null | Session; /** * when OAuth authorization was updated * @@ -4743,9 +5058,15 @@ export interface AccessToken { /** * contents of the token to be used for authorization * - * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly token?: string; + /** + * the version of the token + * + * @example "1" + */ + readonly version?: number; } /** * @@ -4815,23 +5136,35 @@ export interface RefreshToken { /** * contents of the token to be used for authorization * - * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly token: string; } /** * - * authenticated user associated with this authorization + * this authorization's session */ -export interface OauthAuthorizationUser { +export interface Session { /** - * unique identifier of an account + * unique identifier of OAuth token * * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly id: string; - /** - * unique email address of account +} +/** + * + * authenticated user associated with this authorization + */ +export interface OauthAuthorizationUser { + /** + * unique identifier of an account + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * unique email address of account * * @example "username@example.com" */ @@ -4867,6 +5200,36 @@ export interface OauthAuthorizationCreatePayload { */ readonly scope: string[]; } +export interface OauthAuthorizationUpdatePayload { + /** + * human-friendly description of this OAuth authorization + * + * @example "sample authorization" + */ + readonly description?: string; + /** + * identifier of the client that obtained this authorization + */ + client: OauthAuthorizationUpdatePayloadClient; +} +/** + * + * identifier of the client that obtained this authorization + */ +export interface OauthAuthorizationUpdatePayloadClient { + /** + * unique identifier of this OAuth client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * secret used to obtain OAuth authorizations under this client + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly secret?: string; +} /** * * [Heroku Platform API - oauth-client](https://devcenter.heroku.com/articles/platform-api-reference#oauth-client) @@ -4959,7 +5322,7 @@ export interface OauthToken { /** * current access token */ - access_token: AccessToken; + access_token: OauthTokenAccessToken; /** * authorization for this set of tokens */ @@ -4987,7 +5350,7 @@ export interface OauthToken { /** * refresh token for this authorization */ - refresh_token: RefreshToken; + refresh_token: OauthTokenRefreshToken; /** * OAuth session using this token */ @@ -5003,6 +5366,30 @@ export interface OauthToken { */ user: OauthTokenUser; } +/** + * + * current access token + */ +export interface OauthTokenAccessToken { + /** + * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime + * + * @example 2592000 + */ + readonly expires_in: null | number; + /** + * unique identifier of OAuth token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * contents of the token to be used for authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token: string; +} /** * * authorization for this set of tokens @@ -5047,15 +5434,33 @@ export interface OauthTokenGrant { } /** * - * OAuth session using this token + * refresh token for this authorization */ -export interface Session { +export interface OauthTokenRefreshToken { + /** + * seconds until OAuth token expires; may be `null` for tokens with indefinite lifetime + * + * @example 2592000 + */ + readonly expires_in: null | number; /** * unique identifier of OAuth token * * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly id: string; + /** + * contents of the token to be used for authorization + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token: string; + /** + * the version of the token + * + * @example "1" + */ + readonly version: number; } /** * @@ -5100,10 +5505,168 @@ export interface OauthTokenCreatePayloadRefreshToken { /** * contents of the token to be used for authorization * - * @example "HRKU-01234567-89ab-cdef-0123-456789abcdef" + * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly token?: string; } +/** + * + * [Heroku Platform API - oci-image](https://devcenter.heroku.com/articles/platform-api-reference#oci-image) + * An OCI (Open Container Initiative) image is a standardized format for packaging and distributing containerized applications, ready to run on the platform. + */ +export interface OciImage { + /** + * unique identifier of the OCI image + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * name of the image used for the base layers of the OCI image + * + * @example "heroku/heroku:22-cnb" + */ + base_image_name: string; + /** + * the digest of the top most layer of the base image. + * + * @example "sha256:ea36ae5fbc1e7230e0a782bf216fb46500e210382703baa6bab8acf2c6a23f78" + */ + base_top_layer: string; + /** + * identification of the code in your version control system (eg: SHA of the git HEAD) + * + * @example "60883d9e8947a57e04dc9124f25df004866a2051" + */ + commit: string; + /** + * an optional description of the provided commit + * + * @example "fixed a bug with API documentation" + */ + commit_description: string; + /** + * name of the image registry repository used for storage + * + * @example "d7ba1ace-b396-4691-968c-37ae53153426/builds" + */ + image_repo: string; + /** + * unique identifier representing the content of the OCI image + * + * @example "sha256:dc14ae5fbc1e7230e0a782bf216fb46500e210631703bcc6bab8acf2c6a23f42" + */ + digest: string; + /** + * stack associated to the OCI image + */ + stack: OciImageStack; + /** + * process types of the OCI image + * + * @example {"web":{"name":"web","display_cmd":"bundle exec puma -p $PORT","command":"/cnb/process/web","working_dir":"/workspace/webapp","default":true}} + */ + process_types: Record; + /** + * buildpacks of the OCI image + */ + buildpacks: Buildpack[]; + /** + * when the OCI image was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * when the OCI image was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * build architecture for OCI image + * + * @example "arm64" + */ + architecture: string | null; +} +/** + * + * [Heroku Platform API - stack](https://devcenter.heroku.com/articles/platform-api-reference#stack) + * stack associated to the OCI image + */ +export interface OciImageStack { + /** + * unique identifier of stack + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of stack + * + * @example "heroku-18" + */ + readonly name?: string; +} +export interface OciImageCreatePayload { + /** + * build architecture for OCI image + * + * @example "arm64" + */ + architecture?: string | null; + /** + * name of the image used for the base layers of the OCI image + * + * @example "heroku/heroku:22-cnb" + */ + base_image_name?: string; + /** + * the digest of the top most layer of the base image. + * + * @example "sha256:ea36ae5fbc1e7230e0a782bf216fb46500e210382703baa6bab8acf2c6a23f78" + */ + base_top_layer?: string; + /** + * identification of the code in your version control system (eg: SHA of the git HEAD) + * + * @example "60883d9e8947a57e04dc9124f25df004866a2051" + */ + commit?: string; + /** + * an optional description of the provided commit + * + * @example "fixed a bug with API documentation" + */ + commit_description?: string; + /** + * name of the image registry repository used for storage + * + * @example "d7ba1ace-b396-4691-968c-37ae53153426/builds" + */ + image_repo?: string; + /** + * unique identifier representing the content of the OCI image + * + * @example "sha256:dc14ae5fbc1e7230e0a782bf216fb46500e210631703bcc6bab8acf2c6a23f42" + */ + digest?: string; + /** + * unique name of stack or unique identifier of stack + */ + stack?: string; + /** + * process types of the OCI image + * + * @example {"web":{"name":"web","display_cmd":"bundle exec puma -p $PORT","command":"/cnb/process/web","working_dir":"/workspace/webapp","default":true}} + */ + process_types?: Record; + /** + * buildpacks of the OCI image + */ + buildpacks?: Buildpack[]; +} /** * * [Heroku Platform API - password-reset](https://devcenter.heroku.com/articles/platform-api-reference#password-reset) @@ -5143,7 +5706,7 @@ export interface PasswordResetCompleteResetPasswordPayload { /** * * [Heroku Platform API - peering-info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) - * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. + * [Peering Info](https://devcenter.heroku.com/articles/private-space-vpc-peering?preview=1) gives you the information necessary to peer an AWS VPC to a Private Space. */ export interface PeeringInfo { /** @@ -5153,11 +5716,11 @@ export interface PeeringInfo { */ readonly aws_account_id: string; /** - * region name used by provider + * The AWS region where your Private Space resides * - * @example "us-east-1" + * @example "us-west-1" */ - readonly aws_region: 'ap-south-1' | 'eu-west-1' | 'ap-southeast-1' | 'ap-southeast-2' | 'eu-central-1' | 'eu-west-2' | 'ap-northeast-2' | 'ap-northeast-1' | 'us-east-1' | 'sa-east-1' | 'us-west-1' | 'us-west-2' | 'ca-central-1'; + readonly aws_region: 'ap-south-1' | 'eu-west-1' | 'ap-southeast-1' | 'ap-southeast-2' | 'eu-central-1' | 'ap-northeast-2' | 'ap-northeast-1' | 'us-east-1' | 'sa-east-1' | 'us-west-1' | 'us-west-2'; /** * The AWS VPC ID of the peer. * @@ -5167,7 +5730,7 @@ export interface PeeringInfo { /** * An IP address and the number of significant bits that make up the routing or networking portion. * - * @example "10.0.0.0/16" + * @example "192.0.2.0/24" */ vpc_cidr: string; /** @@ -5186,7 +5749,7 @@ export interface PeeringInfo { /** * * [Heroku Platform API - peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) - * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + * [Peering](https://devcenter.heroku.com/articles/private-space-vpc-peering?preview=1) provides a way to peer your Private Space VPC to another AWS VPC. */ export interface Peering { /** @@ -5194,13 +5757,19 @@ export interface Peering { * * @example "heroku-managed" */ - type: 'heroku-managed' | 'customer-managed' | 'unknown'; + type: 'heroku-managed' | 'customer-managed' | 'unknown' | 'slowdb' | 'heroku-postgresql' | 'heroku-redis' | 'heroku-kafka' | 'heroku-cassandra'; /** * The AWS VPC Peering Connection ID of the peering. * * @example "pcx-123456789012" */ readonly pcx_id: string; + /** + * An IP address and the number of significant bits that make up the routing or networking portion. + * + * @example "192.0.2.0/24" + */ + cidr_block: string; /** * The CIDR blocks of the peer. */ @@ -5236,6 +5805,14 @@ export interface Peering { */ readonly expires: string; } +export interface PeeringAcceptPayload { + /** + * The AWS VPC Peering Connection ID of the peering. + * + * @example "pcx-123456789012" + */ + readonly pcx_id: string; +} /** * * [Heroku Platform API - permission-entity](https://devcenter.heroku.com/articles/platform-api-reference#permission-entity) @@ -5270,72 +5847,200 @@ export interface PermissionEntity { * Users that have access to the entity. */ users: Array<{ - /** - * unique email address of account - * - * @example "username@example.com" - */ - email?: string; - /** - * unique identifier of an account - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ - readonly id?: string; - /** - * enterprise account permissions - */ - permissions?: string[]; + email?: string; + readonly id?: string; + permissions?: string[]; }>; } /** * - * [Heroku Platform API - pipeline-coupling](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-coupling) - * Information about an app's coupling to a pipeline + * [Heroku Platform API - pipeline-build](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-build) + * Information about the latest builds of apps in a pipeline. A build represents the process of transforming code into build artifacts. */ -export interface PipelineCoupling { +export interface PipelineBuild { /** - * app involved in the pipeline coupling + * app that the build belongs to */ - app?: PipelineCouplingApp; + app: PipelineBuildApp; /** - * when pipeline coupling was created + * buildpacks executed for this build, in order (only applicable to Cedar-generation apps) + */ + buildpacks: Array<{ + url?: string; + name?: string; +}> | null; + /** + * when build was created * * @example "2012-01-01T12:00:00Z" */ - readonly created_at?: string; + readonly created_at: string; /** - * unique identifier of pipeline coupling + * unique identifier of build * * @example "01234567-89ab-cdef-0123-456789abcdef" */ - readonly id?: string; + readonly id: string; /** - * pipeline involved in the coupling + * Build process output will be available from this URL as a stream. The stream is available as either `text/plain` or `text/event-stream`. Clients should be prepared to handle disconnects and can resume the stream by sending a `Range` header (for `text/plain`) or a `Last-Event-Id` header (for `text/event-stream`). + * + * @example "https://build-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef" */ - pipeline?: Pipeline; + readonly output_stream_url: string; /** - * target pipeline stage - * - * @example "production" + * location of gzipped tarball of source code used to create build */ - stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; + source_blob: PipelineBuildSourceBlob; /** - * when pipeline coupling was updated + * release resulting from the build * - * @example "2012-01-01T12:00:00Z" + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} */ - readonly updated_at?: string; -} -/** - * - * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) - * app involved in the pipeline coupling - */ -export interface PipelineCouplingApp { + readonly release: null | BuildRelease; /** - * unique identifier of app - * + * slug created by this build + */ + slug: PipelineBuildSlug | null; + /** + * stack of build + * + * @example "heroku-22" + */ + readonly stack: string; + /** + * status of build + * + * @example "succeeded" + */ + readonly status: 'failed' | 'pending' | 'succeeded'; + /** + * when build was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * user that started the build + */ + user: User; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app that the build belongs to + */ +export interface PipelineBuildApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * location of gzipped tarball of source code used to create build + */ +export interface PipelineBuildSourceBlob { + /** + * an optional checksum of the gzipped tarball for verifying its integrity + * + * @example "SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + */ + readonly checksum: null | string; + /** + * URL where gzipped tar archive of source code for build was downloaded. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly url: string; + /** + * version of the gzipped tarball + * + * @example "v1.3.0" + */ + readonly version: string | null; + /** + * version description of the gzipped tarball + * + * @example "* Fake User: Change session key" + */ + readonly version_description: string | null; +} +/** + * + * [Heroku Platform API - slug](https://devcenter.heroku.com/articles/platform-api-reference#slug) + * slug created by this build + */ +export interface PipelineBuildSlug { + /** + * unique identifier of slug + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} +/** + * + * [Heroku Platform API - pipeline-config-var](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-config-var) + * Pipeline config vars in Heroku CI and review apps used to manage the configuration information for a pipeline. + */ +export interface PipelineConfigVar { + /** + * user-defined config var name and value + * + * @example {"FOO":"bar"} + */ + '["NAME"]: ["value"]': Record; +} +/** + * + * [Heroku Platform API - pipeline-coupling](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-coupling) + * Information about an app's coupling to a pipeline + */ +export interface PipelineCoupling { + /** + * app involved in the pipeline coupling + */ + app?: PipelineCouplingApp; + /** + * when pipeline coupling was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * unique identifier of pipeline coupling + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * pipeline involved in the coupling + */ + pipeline?: Pipeline; + /** + * target pipeline stage + * + * @example "production" + */ + stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; + /** + * when pipeline coupling was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app involved in the pipeline coupling + */ +export interface PipelineCouplingApp { + /** + * unique identifier of app + * * @example "01234567-89ab-cdef-0123-456789abcdef" */ readonly id?: string; @@ -5374,6 +6079,10 @@ export interface Pipeline { * @example "2012-01-01T12:00:00Z" */ readonly updated_at?: string; + /** + * the generation of the Heroku platform for this pipeline + */ + generation?: PipelineGeneration; } export interface PipelineCouplingCreatePayload { /** @@ -5401,6 +6110,22 @@ export interface PipelineCouplingUpdatePayload { */ stage?: 'test' | 'review' | 'development' | 'staging' | 'production'; } +/** + * + * a build artifact for the release + */ +export interface Artifact { + /** + * type of artifact + * + * @example "oci-image" + */ + type?: string; + /** + * unique identifier of slug or unique identifier of the OCI image + */ + id?: string; +} /** * * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) @@ -5420,6 +6145,18 @@ export interface ReleaseApp { */ readonly id?: string; } +/** + * + * OCI image running in this release + */ +export interface ReleaseOciImage { + /** + * unique identifier of the OCI image + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} /** * * [Heroku Platform API - pipeline-promotion-target](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion-target) @@ -5569,10 +6306,7 @@ export interface PipelinePromotionCreatePayload { */ source: PipelinePromotionCreatePayloadSource; targets: Array<{ - /** - * the app is being promoted to - */ - app?: PipelinePromotionCreatePayloadApp; + app?: PipelinePromotionCreatePayloadApp; }>; } /** @@ -5612,6 +6346,119 @@ export interface PipelinePromotionCreatePayloadApp { */ readonly id: string; } +/** + * + * [Heroku Platform API - pipeline-release](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-release) + * Information about the latest release of each app in a pipeline. A release makes a deployment available to end-users. + */ +export interface PipelineRelease { + /** + * add-on plans installed on the app for this release + */ + addon_plan_names: string[]; + /** + * a build artifact for the release + */ + readonly artifacts: Artifact; + /** + * app involved in the release + */ + app: PipelineReleaseApp; + /** + * when release was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * description of changes in this release + * + * @example "Added new feature" + */ + readonly description: string; + /** + * unique identifier of release + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * when release was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; + /** + * slug running in the release + */ + slug: PipelineReleaseSlug | null; + /** + * current status of the release + * + * @example "succeeded" + */ + readonly status: 'expired' | 'failed' | 'pending' | 'succeeded'; + /** + * user that created the release + */ + user: User; + /** + * unique version assigned to the release + * + * @example 11 + */ + readonly version: number; + /** + * indicates if this release is the current one for the app + * + * @example true + */ + readonly current: boolean; + /** + * URL that the release command output streams to. The stream is available as either `text/plain` or `text/event-stream`. Prepare clients to handle disconnects and to resume the stream by sending a `Range` header for `text/plain` or a `Last-Event-Id` header for `text/event-stream`. + * + * @example "https://release-output.heroku.com/streams/01234567-89ab-cdef-0123-456789abcdef" + */ + readonly output_stream_url: string | null; + /** + * indicates if this release is eligible for rollback + * + * @example true + */ + readonly eligible_for_rollback: boolean; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * app involved in the release + */ +export interface PipelineReleaseApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - slug](https://devcenter.heroku.com/articles/platform-api-reference#slug) + * slug running in the release + */ +export interface PipelineReleaseSlug { + /** + * unique identifier of slug + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; +} /** * * [Heroku Platform API - pipeline-stack](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-stack) @@ -5688,11 +6535,30 @@ export interface PipelineOwner { */ type: string; } -export interface PipelineCreatePayload { +/** + * + * [Heroku Platform API - generation](https://devcenter.heroku.com/articles/platform-api-reference#generation) + * the generation of the Heroku platform for this pipeline + */ +export interface PipelineGeneration { /** - * name of pipeline + * unique identifier of the generation of the Heroku platform for this pipeline * - * @example "example" + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * unique name of the generation of the Heroku platform for this pipeline + * + * @example "cedar" + */ + readonly name?: string; +} +export interface PipelineCreatePayload { + /** + * name of pipeline + * + * @example "example" */ name: string; /** @@ -5746,10 +6612,14 @@ export interface ReleaseCreatePayload { * @example "Added new feature" */ readonly description?: string; + /** + * unique identifier of the OCI image or unique identifier representing the content of the OCI image + */ + oci_image?: string; /** * unique identifier of slug */ - slug: string; + slug?: string; } export interface ReleaseRollbackPayload { /** @@ -6165,7 +7035,7 @@ export interface SniEndpointApp { */ export interface SslCert { readonly 'ca_signed?'?: boolean; - readonly cert_domains?: unknown[]; + readonly cert_domains?: []; readonly expires_at?: string; readonly issuer?: string; readonly 'self_signed?'?: boolean; @@ -6333,21 +7203,9 @@ export interface SpaceTopology { * The apps within this space */ readonly apps: Array<{ - /** - * unique identifier of app - * - * @example "01234567-89ab-cdef-0123-456789abcdef" - */ - readonly id?: string; - /** - * - * @example ["example.com","example.net"] - */ - readonly domains?: unknown[]; - /** - * formations for application - */ - readonly formation?: SpaceTopologyFormation[]; + readonly id?: string; + readonly domains?: []; + readonly formation?: SpaceTopologyFormation[]; }>; } /** @@ -6497,6 +7355,30 @@ export interface SpaceCreatePayload { * @example "https://example.com/logs" */ log_drain_url?: string; + /** + * channel to create the space on + * + * @example "some-channel" + */ + channel_name?: string; + /** + * generation for space + * + * @example "fir" + */ + generation?: string; + /** + * runtime features for the space + * + * @example "[feature-name]" + */ + features?: []; + /** + * supported api features for the space + * + * @example "[api-feature-name]" + */ + supported_features?: []; } /** * @@ -7203,7 +8085,7 @@ export interface TeamMonthlyUsage { */ apps: AppUsageMonthly[]; /** - * average connect rows synced + * max connect rows synced * * @example 15000 */ @@ -7448,6 +8330,133 @@ export interface TeamCreateInEnterpriseAccountPayload { */ readonly name: string; } +/** + * + * [Heroku Platform API - telemetry-drain](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-drain) + * A telemetry drain forwards OpenTelemetry traces, metrics, and logs to your own consumer. For Fir-generation apps only. + */ +export interface TelemetryDrain { + /** + * when the telemetry drain was created + * + * @example "2024-12-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of telemetry drain + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * entity that owns this telemetry drain + */ + owner: TelemetryDrainOwner; + /** + * OpenTelemetry signals to send to telemetry drain + * + * @example ["traces","metrics"] + */ + signals: 'traces' | 'metrics' | Array<'logs'>; + /** + * OpenTelemetry exporter configuration + */ + exporter: Exporter; + /** + * when telemetry drain was last updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * entity that owns this telemetry drain + */ +export interface TelemetryDrainOwner { + /** + * unique identifier of owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * type of owner + * + * @example "app" + */ + readonly type: 'app' | 'space'; +} +/** + * + * OpenTelemetry exporter configuration + */ +export interface Exporter { + /** + * the transport type to be used for your OpenTelemetry consumer + * + * @example "otlphttp" + */ + readonly type: 'otlphttp' | 'otlp'; + /** + * URI of your OpenTelemetry consumer + * + * @example "https://api.otelproduct.example/consumer" + */ + endpoint: string; + /** + * JSON headers to send to your OpenTelemetry consumer + * + * @example {"API-Key":"example_api_key_012345","Environment":"production"} + */ + headers?: Record; +} +export interface TelemetryDrainCreatePayload { + /** + * entity that owns this telemetry drain + */ + owner: TelemetryDrainCreatePayloadOwner; + /** + * OpenTelemetry signals to send to telemetry drain + * + * @example ["traces","metrics"] + */ + signals: 'traces' | 'metrics' | Array<'logs'>; + /** + * OpenTelemetry exporter configuration + */ + exporter: Exporter; +} +/** + * + * entity that owns this telemetry drain + */ +export interface TelemetryDrainCreatePayloadOwner { + /** + * unique identifier of owner + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * type of owner + * + * @example "app" + */ + readonly type: 'app' | 'space'; +} +export interface TelemetryDrainUpdatePayload { + /** + * OpenTelemetry signals to send to telemetry drain + * + * @example ["traces","metrics"] + */ + signals?: 'traces' | 'metrics' | Array<'logs'>; + /** + * OpenTelemetry exporter configuration + */ + exporter?: Exporter; +} /** * * [Heroku Platform API - test-case](https://devcenter.heroku.com/articles/platform-api-reference#test-case) @@ -7982,3 +8991,1007 @@ export interface VpnConnectionUpdatePayload { */ routable_cidrs: string[]; } +/** + * + * [Heroku Platform API - add-on-sso](https://devcenter.heroku.com/articles/platform-api-reference#add-on-sso) + * Add-on Single Sign-on generates URL that allows a customer to log in to an Add-on Service's web dashboard. + */ +export interface AddOnSso { + /** + * whether this SSO request is a GET or a POST + * + * @example "get" + */ + readonly method: 'get' | 'post'; + /** + * URL to follow to initiate single sign-on + * + * @example "https://slowdb.heroku.com/heroku/resources/" + */ + readonly action: string; + /** + * params for this request + */ + readonly params: Params; +} +/** + * + * params for this request + */ +export interface Params { + /** + * unique email address of current user + * + * @example "username@example.com" + */ + readonly email?: string; + /** + * unique identifier of current user + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly user_id?: string; + /** + * name of app where add-on was first attached + * + * @example "example" + */ + readonly owning_app?: string; + /** + * current app name when SSO was requested + * + * @example "example" + */ + readonly attached_app?: string; + /** + * timestamp used to build params as an unix epoch integer + * + * @example "1325419200" + */ + readonly timestamp?: number; + /** + * Base64-encoded nav data for Heroku header + * + * @example "example" + */ + readonly 'nav-data'?: string; + /** + * id of this add-on with its provider + * + * @example "abcd1234" + */ + readonly id?: string; + /** + * token generated for this request that authenticates user + * + * @example "0123456789abcdef0123456789abcdef01234578" + */ + readonly token?: string; + /** + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly resource_id?: string; + /** + * unique token for this SSO request + * + * @example "bb466eb1d6bc345d11072c3cd25c311f21be130d" + */ + readonly resource_token?: string; +} +/** + * + * [Heroku Platform API - build-metadata](https://devcenter.heroku.com/articles/platform-api-reference#build-metadata) + * Build metadata contains the reference data for building the associated App. + */ +export interface BuildMetadata { + /** + * App associated with this metadata + */ + app: BuildMetadataApp; + /** + * URL for deleting the build cache. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly cache_delete_url: string; + /** + * URL for retrieving the latest build cache. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly cache_get_url: string; + /** + * URL for updating the latest build cache. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly cache_put_url: string; + /** + * URL for deleting this app's repo. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly repo_delete_url: string; + /** + * URL for retrieving this app's repo. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly repo_get_url: string; + /** + * URL for updating the app's repo. + * + * @example "https://example.com/source.tgz?token=xyz" + */ + readonly repo_put_url: string; +} +/** + * + * [Heroku Platform API - app](https://devcenter.heroku.com/articles/platform-api-reference#app) + * App associated with this metadata + */ +export interface BuildMetadataApp { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +/** + * + * [Heroku Platform API - capability](https://devcenter.heroku.com/articles/platform-api-reference#capability) + * A capability represents a requested capability on a resource along with whether the requesting user has that capability + */ +export interface Capability { + /** + * name of the capability + * + * @example "manage_dynos" + */ + readonly capability: string; + /** + * id or name of the resource + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly resource_id: null | string; + /** + * type of the resource + * + * @example "app" + */ + readonly resource_type: string; + /** + * whether the user has the capability on the resource_id of type resource_type + * + * @example true + */ + readonly capable: boolean; + /** + * whether the given application resource is flagged as a paranoid app and will require a second factor + * + * @example true + */ + readonly requires_second_factor?: boolean; + /** + * canonical id of the resource if it's present + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly resource_canonical_id?: string; +} +export interface CapabilityCapabilitiesPayload { + /** + * The list of capabilities that you want to check + */ + capabilities: CapabilityRequest[]; +} +/** + * + * an object representing the requested capability + */ +export interface CapabilityRequest { + /** + * name of the capability + * + * @example "manage_dynos" + */ + readonly capability: string; + /** + * id or name of the resource + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly resource_id: null | string; + /** + * type of the resource + * + * @example "app" + */ + readonly resource_type: string; +} +export interface CapabilityCapabilitiesResponse { + /** + * The list of capabilities for the requested resources + */ + capabilities?: Capability[]; +} +/** + * + * [Heroku Platform API - config-vars-settings](https://devcenter.heroku.com/articles/platform-api-reference#config-vars-settings) + * The Config Vars Settings endpoints enable you to view and manage the configuration provided to an app on Heroku. These endpoints are similar to /config-vars but also allow you to check which config vars you can mask, and which are currently masked. + */ +export interface ConfigVarsSettings { + /** + * attachment that created this config var, if any + */ + attachment: ConfigVarsSettingsAttachment | null; + /** + * name of the config var + * + * @example "FOO_TOKEN" + */ + key: string; + /** + * value of the config var + * + * @example "bar" + */ + value: string | null; + /** + * indicates if the value is masked + */ + masked: boolean; + /** + * indicates if you can mask the value + * + * @example true + */ + readonly masking_supported: boolean; + /** + * indicates when the value was updated + * + * @example "2024-01-01T12:00:00Z" + */ + readonly value_updated_at: string; +} +/** + * + * attachment that created this config var, if any + */ +export interface ConfigVarsSettingsAttachment { + /** + * unique identifier of this add-on attachment + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; +} +export interface ConfigVarsSettingsUpdatePayload { + /** + * An array of config vars to be updated. + */ + config?: []; +} +/** + * + * [Heroku Platform API - dyno-processes](https://devcenter.heroku.com/articles/platform-api-reference#dyno-processes) + * Run processes inside existing dynos. + */ +export interface DynoProcesses { + /** + * a URL to stream output from for attached processes or null for non-attached processes + * + * @example "rendezvous://rendezvous.runtime.heroku.com:5000/{rendezvous-id}" + */ + readonly attach_url: string | null; +} +export interface DynoProcessesCreatePayload { + /** + * command used to start this process + * + * @example "bash" + */ + command: string; + /** + * custom environment to add to the dyno config vars + * + * @example {"COLUMNS":"80","LINES":"24"} + */ + env?: Record; +} +/** + * + * [Heroku Platform API - gateway-token](https://devcenter.heroku.com/articles/platform-api-reference#gateway-token) + * Contains a set of information useful for identifying a user and the type of access this user is allowed to have. + */ +export interface GatewayToken { + /** + * Token issuer + * + * @example "2012-01-01T12:00:00Z" + */ + readonly iss: string; + /** + * Integer representation of the timestamp the token was issued at + * + * @example 1526341325 + */ + readonly iat: number; + /** + * Integer representation of the timestamp the token should expire at + * + * @example 1526341325 + */ + readonly exp: number; + /** + * Unique identifier of the subject + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly sub: string; + /** + * Unique identifier of the user + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly user_id: string; + /** + * Email address of the user + * + * @example "username@example.com" + */ + readonly user_email: string; + /** + * Unique identifier of the OAuth authirization used in the token + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly authorization_id: string | null; + /** + * Indicates that a rate limit should be enforced + * + * @example true + */ + readonly rate_limit_enabled: boolean; + /** + * Rate limit multiplier that should be used + * + * @example 2 + */ + readonly rate_limit_multiplier: number; + /** + * Describes if the token contains second factor claim + * + * @example true + */ + readonly second_factor: boolean; + /** + * Describes if the token contains sudo claim + * + * @example true + */ + readonly sudo: boolean; + /** + * Unique identifier of the sudoer if sudo was used + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly sudo_user_id: string | null; + /** + * Reason for using sudo if present + * + * @example "Ticket #123" + */ + readonly sudo_reason: string | null; + /** + * Describes if the token contains sudo force claim + * + * @example true + */ + readonly sudo_force: boolean; +} +/** + * + * [Heroku Platform API - identity-provider-actions](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-actions) + * Actions taken on Identity Providers, the SSO configuration representation. + */ +export interface IdentityProviderActions { + /** + * Array of sso certificates belonging to this identity provider + */ + certificates: Array<{ + readonly created_at?: string; + readonly id?: string; + readonly expires_at?: string; + body?: string; + name?: string | null; +}>; + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + certificate: string | null; + /** + * when provider record was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * URL identifier provided by the identity provider + * + * @example "https://customer-domain.idp.com" + */ + entity_id: string; + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * user-friendly unique identifier for this identity provider + * + * @example "acme-sso" + */ + name: string; + /** + * entity that owns this identity provider + */ + owner: Owner; + /** + * single log out URL for this identity provider + * + * @example "https://example.com/idp/logout" + */ + slo_target_url: string; + /** + * single sign on URL for this identity provider + * + * @example "https://example.com/idp/login" + */ + sso_target_url: string; + /** + * when the identity provider record was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at: string; +} +/** + * + * [Heroku Platform API - identity-provider-certificate](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-certificate) + * Certificates represent an sso cert attached to an Identity Provider + */ +export interface IdentityProviderCertificate { + /** + * label for certificate + * + * @example "Certificate 1" + */ + name: string | null; + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + body: string; + /** + * when provider record was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at: string; + /** + * unique identifier of this identity provider + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * time which the certificate expires + * + * @example "2012-01-01T12:00:00Z" + */ + readonly expires_at: string; + /** + * unique identifier of the identity provider the cert belongs to + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly identity_provider_id: string; +} +export interface IdentityProviderCertificateCreatePayload { + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + body: string; + /** + * label for certificate + * + * @example "Certificate 1" + */ + name?: string | null; +} +export interface IdentityProviderCertificateUpdatePayload { + /** + * label for certificate + * + * @example "Certificate 1" + */ + name?: string | null; +} +/** + * + * [Heroku Platform API - payment-method](https://devcenter.heroku.com/articles/platform-api-reference#payment-method) + * The on file payment method for an account + */ +export interface PaymentMethod { + /** + * street address line 1 + * + * @example "40 Hickory Lane" + */ + address_1?: string | null; + /** + * street address line 2 + * + * @example "Suite 103" + */ + address_2?: string; + /** + * last 4 digits of credit card number + * + * @example "1234" + */ + readonly card_last4?: string; + /** + * name of credit card issuer + * + * @example "VISA" + */ + readonly card_type?: string; + /** + * city + * + * @example "San Francisco" + */ + city?: string; + /** + * country + * + * @example "US" + */ + country?: string; + /** + * expiration month + * + * @example "11" + */ + expiration_month?: string | null; + /** + * expiration year + * + * @example "2014" + */ + expiration_year?: string | null; + /** + * the first name for payment method + * + * @example "Jason" + */ + first_name?: string; + /** + * the last name for payment method + * + * @example "Walker" + */ + last_name?: string; + /** + * metadata + * + * @example "Additional information for payment method" + */ + other?: string | null; + /** + * postal code + * + * @example "90210" + */ + postal_code?: string; + /** + * state + * + * @example "CA" + */ + state?: string; +} +export interface PaymentMethodUpdatePayload { + /** + * street address line 1 + * + * @example "40 Hickory Lane" + */ + address_1?: string | null; + /** + * street address line 2 + * + * @example "Suite 103" + */ + address_2?: string; + /** + * encrypted card number of payment method + * + * @example "encrypted-card-number" + */ + card_number?: string | null; + /** + * city + * + * @example "San Francisco" + */ + city?: string; + /** + * country + * + * @example "US" + */ + country?: string; + /** + * card verification value + * + * @example "123" + */ + cvv?: string | null; + /** + * expiration month + * + * @example "11" + */ + expiration_month?: string | null; + /** + * expiration year + * + * @example "2014" + */ + expiration_year?: string | null; + /** + * the first name for payment method + * + * @example "Jason" + */ + first_name?: string; + /** + * the last name for payment method + * + * @example "Walker" + */ + last_name?: string; + /** + * metadata + * + * @example "Additional information for payment method" + */ + other?: string | null; + /** + * postal code + * + * @example "90210" + */ + postal_code?: string; + /** + * state + * + * @example "CA" + */ + state?: string; + /** + * Nonce generated by Braintree hosted fields form + * + * @example "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" + */ + nonce?: string | null; + /** + * Device data string generated by the client + * + * @example "VGhpcyBpcyBhIGdvb2QgZGF5IHRvIGRpZQ==" + */ + device_data?: string; +} +/** + * + * [Heroku Platform API - payment](https://devcenter.heroku.com/articles/platform-api-reference#payment) + * A payment represents money collected for an account + */ +export interface Payment { + /** + * amount of payment in cents + * + * @example 50000 + */ + amount?: number; + /** + * when payment was created + * + * @example "2012-01-01T12:00:00Z" + */ + readonly created_at?: string; + /** + * legacy unique identifier of payment + * + * @example 9403943 + */ + readonly id?: number; + /** + * identity of invoice + */ + invoice?: null | PaymentInvoice; + /** + * when credit was updated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly updated_at?: string; + /** + * identity of user issuing payment + */ + user?: User; + /** + * state of the payment + * + * @example "pending" + */ + readonly state?: 'failure' | 'pending' | 'success'; +} +/** + * + * [Heroku Platform API - invoice](https://devcenter.heroku.com/articles/platform-api-reference#invoice) + * identity of invoice + */ +export interface PaymentInvoice { + /** + * unique identifier of this invoice + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * human readable invoice number + * + * @example 9403943 + */ + readonly number?: number; +} +export interface PaymentCreatePayload { + /** + * amount of payment in cents + * + * @example 50000 + */ + amount: number; + /** + * human readable invoice number + */ + invoice_id: number; + /** + * unique identifier for a payment transaction + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + uuid: string; +} +/** + * + * [Heroku Platform API - space-host](https://devcenter.heroku.com/articles/platform-api-reference#space-host) + * [Space Hosts](https://devcenter.heroku.com/articles/private-spaces-dedicated-hosts?preview=1) lists dedicated hosts allocated to a space + */ +export interface SpaceHost { + /** + * unique identifier of this host + * + * @example "h-05abcdd96ee9ca123" + */ + readonly host_id: string; + /** + * availability of this space + * + * @example "available" + */ + readonly state: 'available' | 'under-assessment' | 'permanent-failure' | 'released' | 'released-permanent-failure'; + /** + * approximate available capacity on this host expresses a percentage + * + * @example 67 + */ + readonly available_capacity_percentage: number; + /** + * when the host was allocated + * + * @example "2012-01-01T12:00:00Z" + */ + readonly allocated_at: string; + /** + * when the host was released + * + * @example "2012-01-01T12:00:00Z" + */ + readonly released_at: string; +} +export interface SpaceLogDrainUpdatePayload { + url?: string; +} +/** + * + * [Heroku Platform API - team-license](https://devcenter.heroku.com/articles/platform-api-reference#team-license) + * A team license is credits provided and consumed by the team. + */ +export interface TeamLicense { + /** + * when license started + * + * @example "2012-01-01" + */ + readonly start_date: string; + /** + * when license ended + * + * @example "2012-01-01" + */ + readonly end_date: string; + /** + * quantity of the license + * + * @example 5 + */ + readonly qty: number; + /** + * consumed quantity + * + * @example 2 + */ + readonly consumed: number; + /** + * code of this license change + * + * @example "add" + */ + readonly code: string; + /** + * name of this license + * + * @example "HerokuAddOnCredits1" + */ + readonly name: string; +} +/** + * + * [Heroku Platform API - team-license-collection](https://devcenter.heroku.com/articles/platform-api-reference#team-license-collection) + * A team license collection is credits provided and consumed by the team per period. + */ +export interface TeamLicenseCollection { + /** + * year and month the licenses were in effect + * + * @example "2014-01" + */ + readonly period: string; + /** + * Licenses for this period. + */ + licenses: TeamLicense[]; +} +/** + * + * [Heroku Platform API - telemetry-ingress-info](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-ingress-info) + * Telemetry Ingress Info allows add-on partners to view authorization information required to write to Fir app logs. + */ +export interface TelemetryIngressInfo { + /** + * JWT token to be used for authorization + * + * @example "vJkbPNUFaK4kVIMGQlEmyA.-MAquq_5yQqtae62b8i7aw" + */ + readonly id_token: string; + /** + * the authorization type + * + * @example "Bearer" + */ + readonly token_type: string; + /** + * URLs for add-on partners to write to an add-ons logs + */ + readonly transports: string; + /** + * when the token will expire + * + * @example "2025-01-01T12:00:00Z" + */ + readonly expires_at: string; +} +/** + * + * [Heroku Platform API - usage](https://devcenter.heroku.com/articles/platform-api-reference#usage) + * Usage for apps. + */ +export interface Usage { + /** + * add-on usage in the app + */ + addons: UsageAddon[]; +} +/** + * + * usage for an add-on + */ +export interface UsageAddon { + /** + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * the meters associated with the add-on + * + * @example {"storage":{"quantity":1000}} + */ + meters?: Record; +} +/** + * + * usage for the apps belonging to the team + */ +export interface Apps { + /** + * apps belonging to the team + */ + apps?: UsageApp[]; +} +/** + * + * usage for an app belonging to the team + */ +export interface UsageApp { + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * add-on usage in the app + */ + addons?: UsageAppAddon[]; +} +/** + * + * usage for an add-on + */ +export interface UsageAppAddon { + /** + * unique identifier of add-on + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id?: string; + /** + * the meters associated with the add-on + * + * @example {"storage":{"quantity":1000}} + */ + meters?: Record; +} diff --git a/src/services/account-delinquency-service.ts b/src/services/account-delinquency-service.ts index 394e471..2e1b564 100644 --- a/src/services/account-delinquency-service.ts +++ b/src/services/account-delinquency-service.ts @@ -21,12 +21,18 @@ export default class AccountDelinquencyService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/account-feature-service.ts b/src/services/account-feature-service.ts index 622304f..9271f26 100644 --- a/src/services/account-feature-service.ts +++ b/src/services/account-feature-service.ts @@ -25,13 +25,19 @@ export default class AccountFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing account features. @@ -45,13 +51,19 @@ export default class AccountFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing account feature. @@ -71,13 +83,19 @@ export default class AccountFeatureService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/account-service.ts b/src/services/account-service.ts index f444001..06eeb9c 100644 --- a/src/services/account-service.ts +++ b/src/services/account-service.ts @@ -21,13 +21,19 @@ export default class AccountService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update account. @@ -45,14 +51,20 @@ export default class AccountService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. @@ -66,14 +78,20 @@ export default class AccountService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for account. @@ -91,13 +109,19 @@ export default class AccountService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update account. @@ -117,14 +141,20 @@ export default class AccountService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete account. Note that this action cannot be undone. Note: This endpoint requires the HTTP_HEROKU_PASSWORD or HTTP_HEROKU_PASSWORD_BASE64 header be set correctly for the user account. @@ -142,13 +172,19 @@ export default class AccountService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/add-on-action-service.ts b/src/services/add-on-action-service.ts index 91a2973..9751e38 100644 --- a/src/services/add-on-action-service.ts +++ b/src/services/add-on-action-service.ts @@ -25,14 +25,20 @@ export default class AddOnActionService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Mark an add-on as deprovisioned. @@ -50,13 +56,85 @@ export default class AddOnActionService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Add or update a peering connection to an add-on + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async peer( + addOnIdentity: string, + payload: Heroku.AddOnActionPeerPayload, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/actions/peer`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise>; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Remove a peering connection from an add-on + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async unpeer( + addOnIdentity: string, + payload: Record, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/actions/unpeer`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise>; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/add-on-attachment-service.ts b/src/services/add-on-attachment-service.ts index 4750fb6..f85d98e 100644 --- a/src/services/add-on-attachment-service.ts +++ b/src/services/add-on-attachment-service.ts @@ -25,14 +25,20 @@ export default class AddOnAttachmentService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing add-on attachment. @@ -50,14 +56,20 @@ export default class AddOnAttachmentService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing add-on attachment. @@ -75,13 +87,19 @@ export default class AddOnAttachmentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on attachments. @@ -95,13 +113,19 @@ export default class AddOnAttachmentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on attachments for an add-on. @@ -119,13 +143,19 @@ export default class AddOnAttachmentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on attachments for an app. @@ -143,13 +173,19 @@ export default class AddOnAttachmentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing add-on attachment for an app. @@ -171,14 +207,20 @@ export default class AddOnAttachmentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } } ); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Resolve an add-on attachment from a name, optionally passing an app name. If there are matches it returns at least one add-on attachment (exact match) or many. @@ -196,13 +238,19 @@ export default class AddOnAttachmentService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/add-on-config-service.ts b/src/services/add-on-config-service.ts index 8b8f76c..8a32320 100644 --- a/src/services/add-on-config-service.ts +++ b/src/services/add-on-config-service.ts @@ -25,13 +25,19 @@ export default class AddOnConfigService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an add-on's config. Can only be accessed by the add-on partner providing this add-on. @@ -51,13 +57,19 @@ export default class AddOnConfigService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/add-on-region-capability-service.ts b/src/services/add-on-region-capability-service.ts index 0bc10d3..4b16665 100644 --- a/src/services/add-on-region-capability-service.ts +++ b/src/services/add-on-region-capability-service.ts @@ -21,13 +21,19 @@ export default class AddOnRegionCapabilityService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on region capabilities for an add-on-service @@ -47,14 +53,20 @@ export default class AddOnRegionCapabilityService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } } ); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on region capabilities for a region. @@ -72,12 +84,18 @@ export default class AddOnRegionCapabilityService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/add-on-service-service.ts b/src/services/add-on-service-service.ts index 5e7d288..71de6a4 100644 --- a/src/services/add-on-service-service.ts +++ b/src/services/add-on-service-service.ts @@ -25,13 +25,19 @@ export default class AddOnServiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-on-services. @@ -45,12 +51,18 @@ export default class AddOnServiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/add-on-service.ts b/src/services/add-on-service.ts index 915934a..a364db6 100644 --- a/src/services/add-on-service.ts +++ b/src/services/add-on-service.ts @@ -21,13 +21,19 @@ export default class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an existing add-on. @@ -45,13 +51,19 @@ export default class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new add-on. @@ -71,14 +83,20 @@ export default class AddOnService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing add-on. @@ -98,14 +116,20 @@ export default class AddOnService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an existing add-on. @@ -125,13 +149,19 @@ export default class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing add-ons for an app. @@ -149,13 +179,19 @@ export default class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Change add-on plan. Some add-ons may not support changing plans. In that case, an error will be returned. @@ -177,14 +213,20 @@ export default class AddOnService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List all existing add-ons a user has access to @@ -202,13 +244,19 @@ export default class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List add-ons used across all Team apps @@ -226,13 +274,19 @@ export default class AddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Resolve an add-on from a name, optionally passing an app name. If there are matches it returns at least one add-on (exact match) or many. @@ -250,13 +304,19 @@ export default class AddOnService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/add-on-sso-service.ts b/src/services/add-on-sso-service.ts new file mode 100644 index 0000000..9b41c86 --- /dev/null +++ b/src/services/add-on-sso-service.ts @@ -0,0 +1,74 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Add-on SSO](https://devcenter.heroku.com/articles/platform-api-reference#add-on-sso) + * Add-on Single Sign-on generates URL that allows a customer to log in to an Add-on Service's web dashboard. + */ +export default class AddOnSsoService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Generate a timestamp-based single sign-on URL. + * + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + public async addOnSso( + addOnIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/addons/${addOnIdentity}/sso`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Generate a timestamp-based single sign-on URL. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param addOnIdentity unique identifier of add-on or globally unique name of the add-on. + * @param requestInit The initializer for the request. + */ + public async addOnSsoByApp( + appIdentity: string, + addOnIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/addons/${addOnIdentity}/sso`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/add-on-webhook-delivery-service.ts b/src/services/add-on-webhook-delivery-service.ts index 3c26a3f..8b77575 100644 --- a/src/services/add-on-webhook-delivery-service.ts +++ b/src/services/add-on-webhook-delivery-service.ts @@ -29,14 +29,20 @@ export default class AddOnWebhookDeliveryService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } } ); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Lists existing deliveries for an add-on. Can only be accessed by the add-on partner providing this add-on. @@ -54,12 +60,18 @@ export default class AddOnWebhookDeliveryService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/add-on-webhook-event-service.ts b/src/services/add-on-webhook-event-service.ts index a4df8fa..7b785ef 100644 --- a/src/services/add-on-webhook-event-service.ts +++ b/src/services/add-on-webhook-event-service.ts @@ -29,14 +29,20 @@ export default class AddOnWebhookEventService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } } ); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Lists existing webhook events for an add-on. Can only be accessed by the add-on partner providing this add-on. @@ -54,12 +60,18 @@ export default class AddOnWebhookEventService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/add-on-webhook-service.ts b/src/services/add-on-webhook-service.ts index ab05142..99af89b 100644 --- a/src/services/add-on-webhook-service.ts +++ b/src/services/add-on-webhook-service.ts @@ -27,14 +27,20 @@ export default class AddOnWebhookService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Removes an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. @@ -54,14 +60,20 @@ export default class AddOnWebhookService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Returns the info for an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. @@ -81,13 +93,19 @@ export default class AddOnWebhookService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List all webhook subscriptions for a particular add-on. Can only be accessed by the add-on partner providing this add-on. @@ -105,13 +123,19 @@ export default class AddOnWebhookService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Updates the details of an add-on webhook subscription. Can only be accessed by the add-on partner providing this add-on. @@ -133,13 +157,19 @@ export default class AddOnWebhookService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/allowed-add-on-service-service.ts b/src/services/allowed-add-on-service-service.ts index 2096c13..511f4ce 100644 --- a/src/services/allowed-add-on-service-service.ts +++ b/src/services/allowed-add-on-service-service.ts @@ -25,13 +25,19 @@ export default class AllowedAddOnServiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Allow an Add-on Service @@ -51,14 +57,20 @@ export default class AllowedAddOnServiceService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Remove an allowed add-on service @@ -80,7 +92,7 @@ export default class AllowedAddOnServiceService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } } @@ -88,6 +100,12 @@ export default class AllowedAddOnServiceService { if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/app-feature-service.ts b/src/services/app-feature-service.ts index 5652588..8156e61 100644 --- a/src/services/app-feature-service.ts +++ b/src/services/app-feature-service.ts @@ -27,13 +27,19 @@ export default class AppFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing app features. @@ -51,13 +57,19 @@ export default class AppFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing app feature. @@ -79,13 +91,19 @@ export default class AppFeatureService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/app-service.ts b/src/services/app-service.ts index c591809..d3cf4ac 100644 --- a/src/services/app-service.ts +++ b/src/services/app-service.ts @@ -25,14 +25,20 @@ export default class AppService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing app. @@ -50,14 +56,20 @@ export default class AppService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing app. @@ -72,13 +84,19 @@ export default class AppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing apps. @@ -92,13 +110,19 @@ export default class AppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List owned and collaborated apps (excludes team apps). @@ -116,13 +140,19 @@ export default class AppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing app. @@ -142,14 +172,20 @@ export default class AppService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Enable ACM flag for an app @@ -167,14 +203,20 @@ export default class AppService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Disable ACM flag for an app @@ -192,14 +234,20 @@ export default class AppService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Refresh ACM for an app @@ -217,13 +265,19 @@ export default class AppService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/app-setup-service.ts b/src/services/app-setup-service.ts index e555c33..f2e7519 100644 --- a/src/services/app-setup-service.ts +++ b/src/services/app-setup-service.ts @@ -25,14 +25,20 @@ export default class AppSetupService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Get the status of an app setup. @@ -50,12 +56,18 @@ export default class AppSetupService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/app-transfer-service.ts b/src/services/app-transfer-service.ts index d131854..2def661 100644 --- a/src/services/app-transfer-service.ts +++ b/src/services/app-transfer-service.ts @@ -25,14 +25,20 @@ export default class AppTransferService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing app transfer @@ -50,14 +56,20 @@ export default class AppTransferService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing app transfer. @@ -75,13 +87,19 @@ export default class AppTransferService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing apps transfers. @@ -95,13 +113,19 @@ export default class AppTransferService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing app transfer. @@ -121,13 +145,19 @@ export default class AppTransferService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/app-webhook-delivery-service.ts b/src/services/app-webhook-delivery-service.ts index 404abab..d6bf765 100644 --- a/src/services/app-webhook-delivery-service.ts +++ b/src/services/app-webhook-delivery-service.ts @@ -29,14 +29,20 @@ export default class AppWebhookDeliveryService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } } ); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Lists existing deliveries for an app. @@ -54,12 +60,18 @@ export default class AppWebhookDeliveryService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/app-webhook-event-service.ts b/src/services/app-webhook-event-service.ts index 0234ecb..6c0763b 100644 --- a/src/services/app-webhook-event-service.ts +++ b/src/services/app-webhook-event-service.ts @@ -29,14 +29,20 @@ export default class AppWebhookEventService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } } ); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Lists existing webhook events for an app. @@ -54,12 +60,18 @@ export default class AppWebhookEventService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/app-webhook-service.ts b/src/services/app-webhook-service.ts index 0bb68fb..5e0a1f0 100644 --- a/src/services/app-webhook-service.ts +++ b/src/services/app-webhook-service.ts @@ -27,14 +27,20 @@ export default class AppWebhookService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Removes an app webhook subscription. @@ -54,14 +60,20 @@ export default class AppWebhookService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Returns the info for an app webhook subscription. @@ -81,13 +93,19 @@ export default class AppWebhookService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List all webhook subscriptions for a particular app. @@ -105,13 +123,19 @@ export default class AppWebhookService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Updates the details of an app webhook subscription. @@ -133,13 +157,19 @@ export default class AppWebhookService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/archive-service.ts b/src/services/archive-service.ts index 50f2141..aaa9b99 100644 --- a/src/services/archive-service.ts +++ b/src/services/archive-service.ts @@ -30,7 +30,7 @@ export default class ArchiveService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } @@ -50,7 +50,7 @@ export default class ArchiveService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } diff --git a/src/services/audit-trail-event-service.ts b/src/services/audit-trail-event-service.ts index c00a61a..bf85a1d 100644 --- a/src/services/audit-trail-event-service.ts +++ b/src/services/audit-trail-event-service.ts @@ -24,7 +24,7 @@ export default class AuditTrailEventService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } diff --git a/src/services/build-metadata-service.ts b/src/services/build-metadata-service.ts new file mode 100644 index 0000000..7b3c2bd --- /dev/null +++ b/src/services/build-metadata-service.ts @@ -0,0 +1,42 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Build Metadata](https://devcenter.heroku.com/articles/platform-api-reference#build-metadata) + * Build metadata contains the reference data for building the associated App. + */ +export default class BuildMetadataService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Build metadata for app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/build-metadata`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/build-service.ts b/src/services/build-service.ts index 7582212..087f1e3 100644 --- a/src/services/build-service.ts +++ b/src/services/build-service.ts @@ -1,7 +1,7 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Build API - Build](https://devcenter.heroku.com/articles/platform-api-reference#build) - * A build represents the process of transforming a code tarball into a slug + * A build represents the process of transforming a code tarball into build artifacts */ export default class BuildService { public constructor( @@ -27,14 +27,20 @@ export default class BuildService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing build. @@ -54,13 +60,19 @@ export default class BuildService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing build. @@ -78,13 +90,19 @@ export default class BuildService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Destroy a build cache. @@ -99,7 +117,7 @@ export default class BuildService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); @@ -122,13 +140,19 @@ export default class BuildService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/buildpack-installation-service.ts b/src/services/buildpack-installation-service.ts index 6149ff1..3bf861b 100644 --- a/src/services/buildpack-installation-service.ts +++ b/src/services/buildpack-installation-service.ts @@ -27,14 +27,20 @@ export default class BuildpackInstallationService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List an app's existing buildpack installations. @@ -52,12 +58,18 @@ export default class BuildpackInstallationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/capability-service.ts b/src/services/capability-service.ts new file mode 100644 index 0000000..71f60fc --- /dev/null +++ b/src/services/capability-service.ts @@ -0,0 +1,46 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Capability](https://devcenter.heroku.com/articles/platform-api-reference#capability) + * A capability represents a requested capability on a resource along with whether the requesting user has that capability + */ +export default class CapabilityService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Request to check a list of capabilities the current user (yourself). An capability is a tuple of + * (capability, resource_id, resource_type). The endpoint will then respond with a `capable` boolean + * true or false for each requested capability. This boolean indicates whether the authenticated user + * has the requested capability on the resource. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async capabilities( + payload: Heroku.CapabilityCapabilitiesPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/users/~/capabilities`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/collaborator-service.ts b/src/services/collaborator-service.ts index 11e0e36..9b55bfa 100644 --- a/src/services/collaborator-service.ts +++ b/src/services/collaborator-service.ts @@ -27,14 +27,20 @@ export default class CollaboratorService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing collaborator. @@ -56,7 +62,7 @@ export default class CollaboratorService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } } @@ -64,7 +70,13 @@ export default class CollaboratorService { if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing collaborator. @@ -86,14 +98,20 @@ export default class CollaboratorService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } } ); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing collaborators. @@ -111,12 +129,18 @@ export default class CollaboratorService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/config-var-service.ts b/src/services/config-var-service.ts index fad1dc1..6a6cdeb 100644 --- a/src/services/config-var-service.ts +++ b/src/services/config-var-service.ts @@ -24,13 +24,19 @@ export default class ConfigVarService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise>; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Get config-vars for a release. @@ -52,14 +58,20 @@ export default class ConfigVarService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } } ); if (response.ok) { return (await response.json()) as Promise>; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update config-vars for app. You can update existing config-vars by setting them again, and remove by setting it to `null`. @@ -79,13 +91,19 @@ export default class ConfigVarService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise>; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/config-vars-settings-service.ts b/src/services/config-vars-settings-service.ts new file mode 100644 index 0000000..897dea4 --- /dev/null +++ b/src/services/config-vars-settings-service.ts @@ -0,0 +1,75 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Config Vars Settings](https://devcenter.heroku.com/articles/platform-api-reference#config-vars-settings) + * The Config Vars Settings endpoints enable you to view and manage the configuration provided to an app on Heroku. These endpoints are similar to /config-vars but also allow you to check which config vars you can mask, and which are currently masked. + */ +export default class ConfigVarsSettingsService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Get additional info for an app's config vars, including which config vars you can mask, and which are currently masked. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async list( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/config-vars-settings`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Update a config var. You can update an existing config var's value by setting it again, and you can remove it by setting it to `null`. You can't unmask a masked config var. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + appIdentity: string, + payload: Heroku.ConfigVarsSettingsUpdatePayload, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/config-vars-settings`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise>; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/credit-service.ts b/src/services/credit-service.ts index 2433183..4474388 100644 --- a/src/services/credit-service.ts +++ b/src/services/credit-service.ts @@ -25,14 +25,20 @@ export default class CreditService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing credit. @@ -50,13 +56,19 @@ export default class CreditService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing credits. @@ -70,12 +82,18 @@ export default class CreditService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/domain-service.ts b/src/services/domain-service.ts index c5f0021..e63d2c7 100644 --- a/src/services/domain-service.ts +++ b/src/services/domain-service.ts @@ -27,14 +27,20 @@ export default class DomainService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Associate an SNI endpoint @@ -56,14 +62,20 @@ export default class DomainService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing domain @@ -83,14 +95,20 @@ export default class DomainService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing domain. @@ -110,13 +128,19 @@ export default class DomainService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing domains. @@ -134,12 +158,18 @@ export default class DomainService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/dyno-processes-service.ts b/src/services/dyno-processes-service.ts new file mode 100644 index 0000000..4947ec4 --- /dev/null +++ b/src/services/dyno-processes-service.ts @@ -0,0 +1,47 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Processes Inside Dynos](https://devcenter.heroku.com/articles/platform-api-reference#dyno-processes) + * Run processes inside existing dynos. + */ +export default class DynoProcessesService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a new process in an existing dyno. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoIdentity unique identifier of this dyno or the name of this process on this dyno. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + appIdentity: string, + dynoIdentity: string, + payload: Heroku.DynoProcessesCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/dynos/${dynoIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/dyno-service.ts b/src/services/dyno-service.ts index bbeaafd..c196460 100644 --- a/src/services/dyno-service.ts +++ b/src/services/dyno-service.ts @@ -27,14 +27,20 @@ export default class DynoService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Restart dyno. @@ -54,14 +60,54 @@ export default class DynoService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise>; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Restart dynos of a given formation type. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoFormationType the formation type of this process on this dyno + * @example "run". + * @param requestInit The initializer for the request. + */ + public async restartFormation( + appIdentity: string, + dynoFormationType: string, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/formations/${dynoFormationType}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise>; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Restart all dynos. @@ -79,14 +125,20 @@ export default class DynoService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise>; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Stop dyno. @@ -106,14 +158,57 @@ export default class DynoService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise>; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Stop dynos of a given formation type. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param dynoFormationType the formation type of this process on this dyno + * @example "run". + * @param requestInit The initializer for the request. + */ + public async stopFormation( + appIdentity: string, + dynoFormationType: string, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl( + `${this.endpoint}/apps/${appIdentity}/formations/${dynoFormationType}/actions/stop`, + { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise>; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing dyno. @@ -133,13 +228,19 @@ export default class DynoService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing dynos. @@ -157,12 +258,18 @@ export default class DynoService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/dyno-size-service.ts b/src/services/dyno-size-service.ts index c85c29b..6cfc57e 100644 --- a/src/services/dyno-size-service.ts +++ b/src/services/dyno-size-service.ts @@ -12,7 +12,7 @@ export default class DynoSizeService { /** * Info for existing dyno size. * - * @param dynoSizeIdentity unique identifier of this dyno size or the name of this dyno-size. + * @param dynoSizeIdentity unique identifier of the dyno size or name of the dyno size. * @param requestInit The initializer for the request. */ public async info( @@ -25,13 +25,19 @@ export default class DynoSizeService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing dyno sizes. @@ -45,12 +51,48 @@ export default class DynoSizeService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List available dyno sizes for an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async listAppDynoSizes( + appIdentity: string, + requestInit: Omit = {} + ): Promise> { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/available-dyno-sizes`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise>; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/enterprise-account-daily-usage-service.ts b/src/services/enterprise-account-daily-usage-service.ts index 23f6447..13eae68 100644 --- a/src/services/enterprise-account-daily-usage-service.ts +++ b/src/services/enterprise-account-daily-usage-service.ts @@ -28,12 +28,18 @@ export default class EnterpriseAccountDailyUsageService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/enterprise-account-member-service.ts b/src/services/enterprise-account-member-service.ts index fe50098..255dcc7 100644 --- a/src/services/enterprise-account-member-service.ts +++ b/src/services/enterprise-account-member-service.ts @@ -25,13 +25,19 @@ export default class EnterpriseAccountMemberService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a member in an enterprise account. @@ -51,14 +57,20 @@ export default class EnterpriseAccountMemberService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update a member in an enterprise account. @@ -82,7 +94,7 @@ export default class EnterpriseAccountMemberService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } } @@ -90,7 +102,13 @@ export default class EnterpriseAccountMemberService { if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * delete a member in an enterprise account. @@ -112,7 +130,7 @@ export default class EnterpriseAccountMemberService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } } @@ -120,6 +138,12 @@ export default class EnterpriseAccountMemberService { if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/enterprise-account-monthly-usage-service.ts b/src/services/enterprise-account-monthly-usage-service.ts index d77af9e..0a21a80 100644 --- a/src/services/enterprise-account-monthly-usage-service.ts +++ b/src/services/enterprise-account-monthly-usage-service.ts @@ -28,12 +28,18 @@ export default class EnterpriseAccountMonthlyUsageService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/enterprise-account-service.ts b/src/services/enterprise-account-service.ts index 91cad6a..efdb12b 100644 --- a/src/services/enterprise-account-service.ts +++ b/src/services/enterprise-account-service.ts @@ -21,13 +21,19 @@ export default class EnterpriseAccountService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Information about an enterprise account. @@ -45,13 +51,19 @@ export default class EnterpriseAccountService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update enterprise account properties @@ -71,13 +83,19 @@ export default class EnterpriseAccountService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/filter-apps-service.ts b/src/services/filter-apps-service.ts index 9fa6b68..982e6f9 100644 --- a/src/services/filter-apps-service.ts +++ b/src/services/filter-apps-service.ts @@ -25,13 +25,19 @@ export default class FilterAppsService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/formation-service.ts b/src/services/formation-service.ts index dfb6eb5..013d772 100644 --- a/src/services/formation-service.ts +++ b/src/services/formation-service.ts @@ -27,13 +27,19 @@ export default class FormationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List process type formation @@ -51,13 +57,19 @@ export default class FormationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Batch update process types @@ -77,14 +89,20 @@ export default class FormationService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update process type @@ -106,13 +124,19 @@ export default class FormationService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/gateway-token-service.ts b/src/services/gateway-token-service.ts new file mode 100644 index 0000000..7ed3c1a --- /dev/null +++ b/src/services/gateway-token-service.ts @@ -0,0 +1,70 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Gateway Token](https://devcenter.heroku.com/articles/platform-api-reference#gateway-token) + * Contains a set of information useful for identifying a user and the type of access this user is allowed to have. + */ +export default class GatewayTokenService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Generate a gateway token for a user. Note that a JWT version of the + * token will be available in `Heroku-Gateway-Token` header. + * + * @param requestInit The initializer for the request. + */ + public async create(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/users/~/gateway-tokens`, { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Generates a Proxy oauth acccess tokens for the passed in gateway token. + * This new proxy token is designed to have a shorter lifetime than the + * user supplied token so it is safe to pass to futher downstream services + * without increasing the breadth of the long lived tokens. + * + * @param requestInit The initializer for the request. + */ + public async oauthToken(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/users/~/gateway-tokens/oauth-authorization`, { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/generation-service.ts b/src/services/generation-service.ts new file mode 100644 index 0000000..9c29f90 --- /dev/null +++ b/src/services/generation-service.ts @@ -0,0 +1,98 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Generation](https://devcenter.heroku.com/articles/platform-api-reference#generation) + * A generation represents a version of the Heroku platform that includes the app execution environment, routing, telemetry, and build systems. + */ +export default class GenerationService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for generation. + * + * @param stackIdentity unique name of stack or unique identifier of stack. + * @param requestInit The initializer for the request. + */ + public async info( + stackIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/generations/${stackIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List available generations. + * + * @param requestInit The initializer for the request. + */ + public async list(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/generations`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List available generations for a team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async listGenerations( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/available-generations`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/identity-provider-actions-service.ts b/src/services/identity-provider-actions-service.ts new file mode 100644 index 0000000..5cce1e8 --- /dev/null +++ b/src/services/identity-provider-actions-service.ts @@ -0,0 +1,43 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Identity Provider Actions](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-actions) + * Actions taken on Identity Providers, the SSO configuration representation. + */ +export default class IdentityProviderActionsService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Migrate an Identity Provider + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param requestInit The initializer for the request. + */ + public async update( + identityProviderIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}/migrate`, { + ...requestInit, + + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/identity-provider-certificate-service.ts b/src/services/identity-provider-certificate-service.ts new file mode 100644 index 0000000..4cfcc2f --- /dev/null +++ b/src/services/identity-provider-certificate-service.ts @@ -0,0 +1,158 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Certificates](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider-certificate) + * Certificates represent an sso cert attached to an Identity Provider + */ +export default class IdentityProviderCertificateService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Destroy a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param identityProviderIdentity1 unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param requestInit The initializer for the request. + */ + public async delete( + identityProviderIdentity: string, + identityProviderIdentity1: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/identity-providers/${identityProviderIdentity}/certificates/${identityProviderIdentity1}`, + { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Create a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + identityProviderIdentity: string, + payload: Heroku.IdentityProviderCertificateCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/identity-providers/${identityProviderIdentity}/certificates`, + { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Update a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param identityProviderIdentity1 unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + identityProviderIdentity: string, + identityProviderIdentity1: string, + payload: Heroku.IdentityProviderCertificateUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/identity-providers/${identityProviderIdentity}/certificates/${identityProviderIdentity1}`, + { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Get a Certificate + * + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param identityProviderIdentity1 unique identifier of this identity provider or user-friendly unique identifier for this identity provider. + * @param requestInit The initializer for the request. + */ + public async info( + identityProviderIdentity: string, + identityProviderIdentity1: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/identity-providers/${identityProviderIdentity}/certificates/${identityProviderIdentity1}`, + { + ...requestInit, + + method: 'Get', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/identity-provider-service.ts b/src/services/identity-provider-service.ts index df58138..11e0165 100644 --- a/src/services/identity-provider-service.ts +++ b/src/services/identity-provider-service.ts @@ -1,7 +1,7 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Platform API - Identity Provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) - * Identity Providers represent the SAML configuration of teams or an Enterprise account + * Identity Providers represent the SSO configuration of an Enterprise Account or Team. */ export default class IdentityProviderService { public constructor( @@ -10,122 +10,97 @@ export default class IdentityProviderService { ) {} /** - * Get a list of a team's Identity Providers + * Info for an Identity Provider * - * @param teamName unique name of team - * @example "example". + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. * @param requestInit The initializer for the request. */ - public async listByTeam( - teamName: string, + public async info( + identityProviderIdentity: string, requestInit: Omit = {} - ): Promise { - const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers`, { + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}`, { ...requestInit, method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { - return (await response.json()) as Promise; + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op } - throw new Error(response.statusText); + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** - * Create an Identity Provider for a team + * Create an Identity Provider * - * @param teamName unique name of team - * @example "example". * @param payload Object to send to the endpoint. * @param requestInit The initializer for the request. */ - public async createByTeam( - teamName: string, - payload: Heroku.IdentityProviderCreateByTeamPayload, + public async create( + payload: Heroku.IdentityProviderCreatePayload, requestInit: Omit = {} ): Promise { - const response = await this.fetchImpl(`${this.endpoint}/teams/${teamName}/identity-providers`, { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers`, { ...requestInit, body: JSON.stringify(payload, null, 2), method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** - * Update a team's Identity Provider + * Update an Identity Provider * - * @param teamName unique name of team - * @example "example". - * @param identityProviderId unique identifier of this identity provider - * @example "01234567-89ab-cdef-0123-456789abcdef". + * @param identityProviderIdentity unique identifier of this identity provider or user-friendly unique identifier for this identity provider. * @param payload Object to send to the endpoint. * @param requestInit The initializer for the request. */ - public async updateByTeam( - teamName: string, - identityProviderId: string, - payload: Heroku.IdentityProviderUpdateByTeamPayload, + public async update( + identityProviderIdentity: string, + payload: Heroku.IdentityProviderUpdatePayload, requestInit: Omit = {} ): Promise { - const response = await this.fetchImpl( - `${this.endpoint}/teams/${teamName}/identity-providers/${identityProviderId}`, - { - ...requestInit, - body: JSON.stringify(payload, null, 2), - method: 'PATCH', - headers: { - ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', - 'Content-Type': 'application/json' - } + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' } - ); + }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); - } - /** - * Delete a team's Identity Provider - * - * @param teamName unique name of team - * @example "example". - * @param identityProviderId unique identifier of this identity provider - * @example "01234567-89ab-cdef-0123-456789abcdef". - * @param requestInit The initializer for the request. - */ - public async deleteByTeam( - teamName: string, - identityProviderId: string, - requestInit: Omit = {} - ): Promise { - const response = await this.fetchImpl( - `${this.endpoint}/teams/${teamName}/identity-providers/${identityProviderId}`, - { - ...requestInit, - - method: 'DELETE', - headers: { - ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', - 'Content-Type': 'application/json' - } - } - ); - if (response.ok) { - return (await response.json()) as Promise; + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op } - throw new Error(response.statusText); + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/inbound-ruleset-service.ts b/src/services/inbound-ruleset-service.ts index d3a6f7f..46b131b 100644 --- a/src/services/inbound-ruleset-service.ts +++ b/src/services/inbound-ruleset-service.ts @@ -25,13 +25,19 @@ export default class InboundRulesetService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info on an existing Inbound Ruleset @@ -53,14 +59,20 @@ export default class InboundRulesetService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } } ); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List all inbound rulesets for a space @@ -78,13 +90,19 @@ export default class InboundRulesetService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new inbound ruleset @@ -104,13 +122,19 @@ export default class InboundRulesetService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/index.ts b/src/services/index.ts index 7fce78f..f1652de 100644 --- a/src/services/index.ts +++ b/src/services/index.ts @@ -34,6 +34,7 @@ export * from './enterprise-account-monthly-usage-service'; export * from './enterprise-account-service'; export * from './filter-apps-service'; export * from './formation-service'; +export * from './generation-service'; export * from './identity-provider-service'; export * from './inbound-ruleset-service'; export * from './invoice-address-service'; @@ -45,8 +46,8 @@ export * from './oauth-authorization-service'; export * from './oauth-client-service'; export * from './oauth-grant-service'; export * from './oauth-token-service'; +export * from './oci-image-service'; export * from './password-reset-service'; -export * from './peering-info-service'; export * from './peering-service'; export * from './permission-entity-service'; export * from './pipeline-build-service'; @@ -89,8 +90,25 @@ export * from './team-monthly-usage-service'; export * from './team-preferences-service'; export * from './team-space-service'; export * from './team-service'; +export * from './telemetry-drain-service'; export * from './test-case-service'; export * from './test-node-service'; export * from './test-run-service'; export * from './user-preferences-service'; export * from './vpn-connection-service'; +export * from './add-on-sso-service'; +export * from './build-metadata-service'; +export * from './capability-service'; +export * from './config-vars-settings-service'; +export * from './dyno-processes-service'; +export * from './gateway-token-service'; +export * from './identity-provider-actions-service'; +export * from './identity-provider-certificate-service'; +export * from './payment-method-service'; +export * from './payment-service'; +export * from './space-host-service'; +export * from './space-log-drain-service'; +export * from './team-license-service'; +export * from './team-license-collection-service'; +export * from './telemetry-ingress-info-service'; +export * from './usage-service'; diff --git a/src/services/invoice-address-service.ts b/src/services/invoice-address-service.ts index 5f673f2..89726b9 100644 --- a/src/services/invoice-address-service.ts +++ b/src/services/invoice-address-service.ts @@ -21,13 +21,19 @@ export default class InvoiceAddressService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update invoice address for an account. @@ -45,13 +51,19 @@ export default class InvoiceAddressService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/invoice-service.ts b/src/services/invoice-service.ts index 92e50e5..501ea0f 100644 --- a/src/services/invoice-service.ts +++ b/src/services/invoice-service.ts @@ -25,13 +25,19 @@ export default class InvoiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing invoices. @@ -45,12 +51,18 @@ export default class InvoiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/key-service.ts b/src/services/key-service.ts index 0cd30c3..8979d19 100644 --- a/src/services/key-service.ts +++ b/src/services/key-service.ts @@ -22,13 +22,19 @@ export default class KeyService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing keys. @@ -42,12 +48,18 @@ export default class KeyService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/log-drain-service.ts b/src/services/log-drain-service.ts index c004558..57ed0d6 100644 --- a/src/services/log-drain-service.ts +++ b/src/services/log-drain-service.ts @@ -27,14 +27,20 @@ export default class LogDrainService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an add-on owned log drain. @@ -58,7 +64,7 @@ export default class LogDrainService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } } @@ -66,7 +72,13 @@ export default class LogDrainService { if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing log drain. Log drains added by add-ons can only be removed by removing the add-on. @@ -86,14 +98,20 @@ export default class LogDrainService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing log drain. @@ -113,13 +131,19 @@ export default class LogDrainService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing log drains for an add-on. @@ -137,13 +161,19 @@ export default class LogDrainService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing log drains. @@ -161,12 +191,18 @@ export default class LogDrainService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/log-session-service.ts b/src/services/log-session-service.ts index 0bd1946..0fba203 100644 --- a/src/services/log-session-service.ts +++ b/src/services/log-session-service.ts @@ -27,13 +27,19 @@ export default class LogSessionService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/oauth-authorization-service.ts b/src/services/oauth-authorization-service.ts index b6d02e6..ebcd4cd 100644 --- a/src/services/oauth-authorization-service.ts +++ b/src/services/oauth-authorization-service.ts @@ -25,14 +25,20 @@ export default class OauthAuthorizationService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete OAuth authorization. @@ -50,14 +56,20 @@ export default class OauthAuthorizationService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an OAuth authorization. @@ -75,13 +87,52 @@ export default class OauthAuthorizationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Update an existing OAuth authorization. + * + * @param oauthAuthorizationIdentity unique identifier of OAuth authorization. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + oauthAuthorizationIdentity: string, + payload: Heroku.OauthAuthorizationUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/oauth/authorizations/${oauthAuthorizationIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List OAuth authorizations. @@ -95,13 +146,19 @@ export default class OauthAuthorizationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Regenerate OAuth tokens. This endpoint is only available to direct authorizations or privileged OAuth clients. @@ -121,7 +178,7 @@ export default class OauthAuthorizationService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } } @@ -129,6 +186,12 @@ export default class OauthAuthorizationService { if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/oauth-client-service.ts b/src/services/oauth-client-service.ts index 99887b1..5420f78 100644 --- a/src/services/oauth-client-service.ts +++ b/src/services/oauth-client-service.ts @@ -25,14 +25,20 @@ export default class OauthClientService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete OAuth client. @@ -50,14 +56,20 @@ export default class OauthClientService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an OAuth client. The output for unauthenticated requests excludes the `secret` parameter. @@ -75,7 +87,7 @@ export default class OauthClientService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } @@ -91,13 +103,19 @@ export default class OauthClientService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update OAuth client @@ -117,14 +135,20 @@ export default class OauthClientService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Rotate credentials for an OAuth client @@ -144,7 +168,7 @@ export default class OauthClientService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } } @@ -152,6 +176,12 @@ export default class OauthClientService { if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/oauth-token-service.ts b/src/services/oauth-token-service.ts index 23b9845..776379a 100644 --- a/src/services/oauth-token-service.ts +++ b/src/services/oauth-token-service.ts @@ -25,14 +25,20 @@ export default class OauthTokenService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Revoke OAuth access token. @@ -50,13 +56,19 @@ export default class OauthTokenService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/oci-image-service.ts b/src/services/oci-image-service.ts new file mode 100644 index 0000000..659d943 --- /dev/null +++ b/src/services/oci-image-service.ts @@ -0,0 +1,77 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - OCI Images](https://devcenter.heroku.com/articles/platform-api-reference#oci-image) + * An OCI (Open Container Initiative) image is a standardized format for packaging and distributing containerized applications, ready to run on the platform. + */ +export default class OciImageService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for the OCI images of an app, filtered by identifier. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param ociImageIdentity unique identifier of the OCI image or unique identifier representing the content of the OCI image. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + ociImageIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/oci-images/${ociImageIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Create an new OCI image of an app + * + * @param appIdentity unique identifier of app or unique name of app. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + appIdentity: string, + payload: Heroku.OciImageCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/oci-images`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/password-reset-service.ts b/src/services/password-reset-service.ts index 95abbe0..3075635 100644 --- a/src/services/password-reset-service.ts +++ b/src/services/password-reset-service.ts @@ -25,14 +25,20 @@ export default class PasswordResetService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Complete password reset. @@ -55,7 +61,7 @@ export default class PasswordResetService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } } @@ -63,6 +69,12 @@ export default class PasswordResetService { if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/payment-method-service.ts b/src/services/payment-method-service.ts new file mode 100644 index 0000000..dbde4d9 --- /dev/null +++ b/src/services/payment-method-service.ts @@ -0,0 +1,95 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Vault API - Payment Method](https://devcenter.heroku.com/articles/platform-api-reference#payment-method) + * The on file payment method for an account + */ +export default class PaymentMethodService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Update an existing payment method for an account. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + payload: Heroku.PaymentMethodUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/payment-method`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Get the current payment method for an account. + * + * @param requestInit The initializer for the request. + */ + public async get(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/payment-method`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Get the verified apps on the payment-method + * + * @param requestInit The initializer for the request. + */ + public async getApps(requestInit: Omit = {}): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/payment-method/apps`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/payment-service.ts b/src/services/payment-service.ts new file mode 100644 index 0000000..0fd572d --- /dev/null +++ b/src/services/payment-service.ts @@ -0,0 +1,76 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Vault API - Payments](https://devcenter.heroku.com/articles/platform-api-reference#payment) + * A payment represents money collected for an account + */ +export default class PaymentService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a payment on an existing account + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.PaymentCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/account/payments`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Create a payment on an existing team + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async createPayment( + teamIdentity: string, + payload: Heroku.PaymentCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/payments`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/peering-info-service.ts b/src/services/peering-info-service.ts deleted file mode 100644 index 7106973..0000000 --- a/src/services/peering-info-service.ts +++ /dev/null @@ -1,36 +0,0 @@ -import * as Heroku from '@heroku-cli/schema'; -/** - * [Heroku Platform API - Peering Info](https://devcenter.heroku.com/articles/platform-api-reference#peering-info) - * [Peering Info](https://devcenter.heroku.com/articles/private-space-peering) gives you the information necessary to peer an AWS VPC to a Private Space. - */ -export default class PeeringInfoService { - public constructor( - protected readonly fetchImpl: typeof fetch, - protected readonly endpoint: string - ) {} - - /** - * Provides the necessary information to establish an AWS VPC Peering with your private space. - * - * @param spaceIdentity unique identifier of space or unique name of space. - * @param requestInit The initializer for the request. - */ - public async info( - spaceIdentity: string, - requestInit: Omit = {} - ): Promise { - const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peering-info`, { - ...requestInit, - - method: 'GET', - headers: { - ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' - } - }); - if (response.ok) { - return (await response.json()) as Promise; - } - throw new Error(response.statusText); - } -} diff --git a/src/services/peering-service.ts b/src/services/peering-service.ts index b8dfd7f..340981d 100644 --- a/src/services/peering-service.ts +++ b/src/services/peering-service.ts @@ -1,7 +1,7 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Platform API - Peering](https://devcenter.heroku.com/articles/platform-api-reference#peering) - * [Peering](https://devcenter.heroku.com/articles/private-space-peering) provides a way to peer your Private Space VPC to another AWS VPC. + * [Peering](https://devcenter.heroku.com/articles/private-space-vpc-peering?preview=1) provides a way to peer your Private Space VPC to another AWS VPC. */ export default class PeeringService { public constructor( @@ -10,97 +10,107 @@ export default class PeeringService { ) {} /** - * List peering connections of a private space. + * Provides the necessary information to establish an AWS VPC Peering with your private space. * * @param spaceIdentity unique identifier of space or unique name of space. * @param requestInit The initializer for the request. */ - public async list( + public async info( spaceIdentity: string, requestInit: Omit = {} - ): Promise { - const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings`, { + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peering-info`, { ...requestInit, method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { - return (await response.json()) as Promise; + return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** - * Accept a pending peering connection with a private space. + * List peering connections of a private space. * * @param spaceIdentity unique identifier of space or unique name of space. - * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. - * @example "pcx-123456789012". * @param requestInit The initializer for the request. */ - public async accept( + public async list( spaceIdentity: string, - peeringPcxId: string, requestInit: Omit = {} - ): Promise { - const response = await this.fetchImpl( - `${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}/actions/accept`, - { - ...requestInit, + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings`, { + ...requestInit, - method: 'POST', - headers: { - ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', - 'Content-Type': 'application/json' - } + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' } - ); + }); if (response.ok) { - return (await response.json()) as Promise; + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op } - throw new Error(response.statusText); + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** - * Destroy an active peering connection with a private space. + * Accept a pending peering connection with a private space. * * @param spaceIdentity unique identifier of space or unique name of space. - * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. - * @example "pcx-123456789012". + * @param payload Object to send to the endpoint. * @param requestInit The initializer for the request. */ - public async destroy( + public async accept( spaceIdentity: string, - peeringPcxId: string, + payload: Heroku.PeeringAcceptPayload, requestInit: Omit = {} ): Promise { - const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}`, { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings`, { ...requestInit, - - method: 'DELETE', + body: JSON.stringify(payload, null, 2), + method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** - * Fetch information for existing peering connection + * Destroy an active peering connection with a private space. * * @param spaceIdentity unique identifier of space or unique name of space. * @param peeringPcxId The AWS VPC Peering Connection ID of the peering. * @example "pcx-123456789012". * @param requestInit The initializer for the request. */ - public async info( + public async destroy( spaceIdentity: string, peeringPcxId: string, requestInit: Omit = {} @@ -108,15 +118,22 @@ export default class PeeringService { const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings/${peeringPcxId}`, { ...requestInit, - method: 'GET', + method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/permission-entity-service.ts b/src/services/permission-entity-service.ts index 437115d..b39bbcf 100644 --- a/src/services/permission-entity-service.ts +++ b/src/services/permission-entity-service.ts @@ -25,12 +25,18 @@ export default class PermissionEntityService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/pipeline-build-service.ts b/src/services/pipeline-build-service.ts index 7f7ab8f..5ecc80d 100644 --- a/src/services/pipeline-build-service.ts +++ b/src/services/pipeline-build-service.ts @@ -1,7 +1,7 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Platform API - Pipeline Build](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-build) - * Information about latest builds of apps in a pipeline. + * Information about the latest builds of apps in a pipeline. A build represents the process of transforming code into build artifacts. */ export default class PipelineBuildService { public constructor( @@ -19,19 +19,25 @@ export default class PipelineBuildService { public async list( pipelineId: string, requestInit: Omit = {} - ): Promise { + ): Promise { const response = await this.fetchImpl(`${this.endpoint}/pipelines/${pipelineId}/latest-builds`, { ...requestInit, method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { - return (await response.json()) as Promise; + return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/pipeline-config-var-service.ts b/src/services/pipeline-config-var-service.ts index 59521ae..9d240fd 100644 --- a/src/services/pipeline-config-var-service.ts +++ b/src/services/pipeline-config-var-service.ts @@ -1,6 +1,6 @@ /** * [Heroku Platform API - Pipeline Config Vars](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-config-var) - * Pipeline Config Vars allow you to manage the configuration information provided to a pipeline. + * Pipeline config vars in Heroku CI and review apps used to manage the configuration information for a pipeline. */ export default class PipelineConfigVarService { public constructor( @@ -30,14 +30,20 @@ export default class PipelineConfigVarService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } } ); if (response.ok) { return (await response.json()) as Promise>; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update config-vars for a pipeline stage. You can update existing config-vars by setting them again, and remove by setting it to `null`. @@ -63,7 +69,7 @@ export default class PipelineConfigVarService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } } @@ -71,6 +77,12 @@ export default class PipelineConfigVarService { if (response.ok) { return (await response.json()) as Promise>; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/pipeline-coupling-service.ts b/src/services/pipeline-coupling-service.ts index a122bb5..2122cd9 100644 --- a/src/services/pipeline-coupling-service.ts +++ b/src/services/pipeline-coupling-service.ts @@ -26,13 +26,19 @@ export default class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List pipeline couplings for the current user. @@ -48,13 +54,19 @@ export default class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List pipeline couplings. @@ -68,13 +80,19 @@ export default class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List pipeline couplings for a team. @@ -92,13 +110,19 @@ export default class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new pipeline coupling. @@ -116,14 +140,20 @@ export default class PipelineCouplingService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an existing pipeline coupling. @@ -141,13 +171,19 @@ export default class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing pipeline coupling. @@ -165,14 +201,20 @@ export default class PipelineCouplingService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing pipeline coupling. @@ -192,14 +234,20 @@ export default class PipelineCouplingService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an existing pipeline coupling. @@ -217,12 +265,18 @@ export default class PipelineCouplingService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/pipeline-deployment-service.ts b/src/services/pipeline-deployment-service.ts index 96a0ee9..2598775 100644 --- a/src/services/pipeline-deployment-service.ts +++ b/src/services/pipeline-deployment-service.ts @@ -1,7 +1,7 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Platform API - Pipeline Deployment](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-deployment) - * Information about latest deployments of apps in a pipeline. + * Information about the latest deployment of each app in a pipeline. A deployment is the process of moving the build artifacts to a target environment. */ export default class PipelineDeploymentService { public constructor( @@ -10,7 +10,7 @@ export default class PipelineDeploymentService { ) {} /** - * List latest slug releases for each app in a pipeline + * List latest deployments for each app in a pipeline. A deployment is a release that changed your source slug, container image, or Heroku processes. * * @param pipelineId unique identifier of pipeline * @example "01234567-89ab-cdef-0123-456789abcdef". @@ -26,12 +26,18 @@ export default class PipelineDeploymentService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/pipeline-promotion-service.ts b/src/services/pipeline-promotion-service.ts index 5fc7d43..93bebbd 100644 --- a/src/services/pipeline-promotion-service.ts +++ b/src/services/pipeline-promotion-service.ts @@ -25,14 +25,20 @@ export default class PipelinePromotionService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing pipeline promotion. @@ -50,12 +56,18 @@ export default class PipelinePromotionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/pipeline-promotion-target-service.ts b/src/services/pipeline-promotion-target-service.ts index 962f463..e7071ad 100644 --- a/src/services/pipeline-promotion-target-service.ts +++ b/src/services/pipeline-promotion-target-service.ts @@ -28,13 +28,19 @@ export default class PipelinePromotionTargetService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } } ); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/pipeline-release-service.ts b/src/services/pipeline-release-service.ts index ce1081c..182a6b5 100644 --- a/src/services/pipeline-release-service.ts +++ b/src/services/pipeline-release-service.ts @@ -1,7 +1,7 @@ import * as Heroku from '@heroku-cli/schema'; /** * [Heroku Platform API - Pipeline Release](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-release) - * Information about latest releases of apps in a pipeline. + * Information about the latest release of each app in a pipeline. A release makes a deployment available to end-users. */ export default class PipelineReleaseService { public constructor( @@ -26,12 +26,18 @@ export default class PipelineReleaseService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/pipeline-service.ts b/src/services/pipeline-service.ts index 209f1e9..ab347fb 100644 --- a/src/services/pipeline-service.ts +++ b/src/services/pipeline-service.ts @@ -25,14 +25,20 @@ export default class PipelineService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing pipeline. @@ -50,13 +56,19 @@ export default class PipelineService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing pipeline. @@ -75,14 +87,20 @@ export default class PipelineService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing pipeline. @@ -103,14 +121,20 @@ export default class PipelineService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing pipelines. @@ -124,12 +148,18 @@ export default class PipelineService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/pipeline-stack-service.ts b/src/services/pipeline-stack-service.ts index 2a36da4..a11fea2 100644 --- a/src/services/pipeline-stack-service.ts +++ b/src/services/pipeline-stack-service.ts @@ -26,12 +26,18 @@ export default class PipelineStackService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/pipeline-transfer-service.ts b/src/services/pipeline-transfer-service.ts index b11f303..befbe84 100644 --- a/src/services/pipeline-transfer-service.ts +++ b/src/services/pipeline-transfer-service.ts @@ -25,13 +25,19 @@ export default class PipelineTransferService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/plan-service.ts b/src/services/plan-service.ts index c50549e..24860b9 100644 --- a/src/services/plan-service.ts +++ b/src/services/plan-service.ts @@ -25,13 +25,19 @@ export default class PlanService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing plan by Add-on. @@ -53,14 +59,20 @@ export default class PlanService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } } ); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing plans by Add-on. @@ -78,12 +90,18 @@ export default class PlanService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/rate-limit-service.ts b/src/services/rate-limit-service.ts index 7a703db..a64a209 100644 --- a/src/services/rate-limit-service.ts +++ b/src/services/rate-limit-service.ts @@ -21,12 +21,18 @@ export default class RateLimitService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/region-service.ts b/src/services/region-service.ts index 4965c7a..1f2e791 100644 --- a/src/services/region-service.ts +++ b/src/services/region-service.ts @@ -25,13 +25,19 @@ export default class RegionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing regions. @@ -45,12 +51,18 @@ export default class RegionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/release-service.ts b/src/services/release-service.ts index 9949d52..f3b8ce0 100644 --- a/src/services/release-service.ts +++ b/src/services/release-service.ts @@ -27,13 +27,19 @@ export default class ReleaseService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing releases. @@ -51,13 +57,19 @@ export default class ReleaseService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create new release. @@ -77,14 +89,20 @@ export default class ReleaseService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Rollback to an existing release. @@ -104,13 +122,19 @@ export default class ReleaseService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/review-app-config-service.ts b/src/services/review-app-config-service.ts index 51ca3d8..67b3b23 100644 --- a/src/services/review-app-config-service.ts +++ b/src/services/review-app-config-service.ts @@ -28,14 +28,20 @@ export default class ReviewAppConfigService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Get review apps configuration for a pipeline @@ -54,13 +60,19 @@ export default class ReviewAppConfigService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update review app configuration for a pipeline @@ -81,14 +93,20 @@ export default class ReviewAppConfigService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Disable review apps for a pipeline @@ -107,13 +125,19 @@ export default class ReviewAppConfigService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/review-app-service.ts b/src/services/review-app-service.ts index d96d8a9..098c1cb 100644 --- a/src/services/review-app-service.ts +++ b/src/services/review-app-service.ts @@ -25,14 +25,20 @@ export default class ReviewAppService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Gets an existing review app @@ -50,13 +56,19 @@ export default class ReviewAppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing review app @@ -74,14 +86,20 @@ export default class ReviewAppService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Get a review app using the associated app_id @@ -99,13 +117,19 @@ export default class ReviewAppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List review apps for a pipeline @@ -124,12 +148,18 @@ export default class ReviewAppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/slug-service.ts b/src/services/slug-service.ts index 31d4050..dfb467d 100644 --- a/src/services/slug-service.ts +++ b/src/services/slug-service.ts @@ -27,13 +27,19 @@ export default class SlugService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new slug. For more information please refer to [Deploying Slugs using the Platform API](https://devcenter.heroku.com/articles/platform-api-deploying-slugs). @@ -53,13 +59,19 @@ export default class SlugService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/sms-number-service.ts b/src/services/sms-number-service.ts index ff5dc2e..3f4b514 100644 --- a/src/services/sms-number-service.ts +++ b/src/services/sms-number-service.ts @@ -25,13 +25,19 @@ export default class SmsNumberService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Recover an account using an SMS recovery code @@ -49,14 +55,20 @@ export default class SmsNumberService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Confirm an SMS number change with a confirmation code @@ -74,13 +86,19 @@ export default class SmsNumberService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/sni-endpoint-service.ts b/src/services/sni-endpoint-service.ts index bbc571b..ed6a188 100644 --- a/src/services/sni-endpoint-service.ts +++ b/src/services/sni-endpoint-service.ts @@ -27,14 +27,20 @@ export default class SniEndpointService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete existing SNI endpoint. @@ -54,14 +60,20 @@ export default class SniEndpointService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing SNI endpoint. @@ -81,13 +93,19 @@ export default class SniEndpointService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing SNI endpoints. @@ -105,13 +123,19 @@ export default class SniEndpointService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing SNI endpoint. @@ -133,13 +157,19 @@ export default class SniEndpointService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/source-service.ts b/src/services/source-service.ts index 409d7a7..8afdebc 100644 --- a/src/services/source-service.ts +++ b/src/services/source-service.ts @@ -21,14 +21,20 @@ export default class SourceService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create URLs for uploading and downloading source. Deprecated in favor of `POST /sources` @@ -46,13 +52,19 @@ export default class SourceService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/space-app-access-service.ts b/src/services/space-app-access-service.ts index 519bd7d..3919f2d 100644 --- a/src/services/space-app-access-service.ts +++ b/src/services/space-app-access-service.ts @@ -27,13 +27,19 @@ export default class SpaceAppAccessService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing user's set of permissions on a space. @@ -55,14 +61,20 @@ export default class SpaceAppAccessService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List all users and their permissions on a space. @@ -80,12 +92,18 @@ export default class SpaceAppAccessService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/space-host-service.ts b/src/services/space-host-service.ts new file mode 100644 index 0000000..600f8c1 --- /dev/null +++ b/src/services/space-host-service.ts @@ -0,0 +1,42 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Host](https://devcenter.heroku.com/articles/platform-api-reference#space-host) + * [Space Hosts](https://devcenter.heroku.com/articles/private-spaces-dedicated-hosts?preview=1) lists dedicated hosts allocated to a space + */ +export default class SpaceHostService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List hosts + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + public async list( + spaceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/hosts`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/space-log-drain-service.ts b/src/services/space-log-drain-service.ts new file mode 100644 index 0000000..cff7002 --- /dev/null +++ b/src/services/space-log-drain-service.ts @@ -0,0 +1,75 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Space Log Drain](https://devcenter.heroku.com/articles/platform-api-reference#space-log-drain) + * Single log drain for all apps in a Private Space + */ +export default class SpaceLogDrainService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Current log drain for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + public async info( + spaceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/log-drain`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Update log drain for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + spaceIdentity: string, + payload: Heroku.SpaceLogDrainUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/log-drain`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PUT', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/space-nat-service.ts b/src/services/space-nat-service.ts index e63d52f..674bcda 100644 --- a/src/services/space-nat-service.ts +++ b/src/services/space-nat-service.ts @@ -25,12 +25,18 @@ export default class SpaceNatService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/space-service.ts b/src/services/space-service.ts index 6cfb66c..60bb931 100644 --- a/src/services/space-service.ts +++ b/src/services/space-service.ts @@ -21,13 +21,19 @@ export default class SpaceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing space. @@ -45,13 +51,19 @@ export default class SpaceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing space. @@ -71,14 +83,20 @@ export default class SpaceService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing space. @@ -96,14 +114,20 @@ export default class SpaceService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new space. @@ -121,13 +145,19 @@ export default class SpaceService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/space-topology-service.ts b/src/services/space-topology-service.ts index 1e2581c..50ad90f 100644 --- a/src/services/space-topology-service.ts +++ b/src/services/space-topology-service.ts @@ -25,12 +25,18 @@ export default class SpaceTopologyService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/space-transfer-service.ts b/src/services/space-transfer-service.ts index 1fbab8f..0eadb30 100644 --- a/src/services/space-transfer-service.ts +++ b/src/services/space-transfer-service.ts @@ -27,13 +27,19 @@ export default class SpaceTransferService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/stack-service.ts b/src/services/stack-service.ts index 4211e3b..b452dda 100644 --- a/src/services/stack-service.ts +++ b/src/services/stack-service.ts @@ -25,13 +25,19 @@ export default class StackService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List available stacks. @@ -45,12 +51,48 @@ export default class StackService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List available app stacks for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async listStacks( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/available-stacks`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/team-add-on-service.ts b/src/services/team-add-on-service.ts index eba5bd4..736d0db 100644 --- a/src/services/team-add-on-service.ts +++ b/src/services/team-add-on-service.ts @@ -25,12 +25,18 @@ export default class TeamAddOnService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/team-app-collaborator-service.ts b/src/services/team-app-collaborator-service.ts index e86ab86..21a01e0 100644 --- a/src/services/team-app-collaborator-service.ts +++ b/src/services/team-app-collaborator-service.ts @@ -27,14 +27,20 @@ export default class TeamAppCollaboratorService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing collaborator from a team app. @@ -57,7 +63,7 @@ export default class TeamAppCollaboratorService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } } @@ -65,7 +71,13 @@ export default class TeamAppCollaboratorService { if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for a collaborator on a team app. @@ -88,14 +100,20 @@ export default class TeamAppCollaboratorService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } } ); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update an existing collaborator from a team app. @@ -120,7 +138,7 @@ export default class TeamAppCollaboratorService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } } @@ -128,7 +146,13 @@ export default class TeamAppCollaboratorService { if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List collaborators on a team app. @@ -147,12 +171,18 @@ export default class TeamAppCollaboratorService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/team-app-permission-service.ts b/src/services/team-app-permission-service.ts index d29e5da..42e8fcd 100644 --- a/src/services/team-app-permission-service.ts +++ b/src/services/team-app-permission-service.ts @@ -21,12 +21,18 @@ export default class TeamAppPermissionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/team-app-service.ts b/src/services/team-app-service.ts index 0436919..5fca449 100644 --- a/src/services/team-app-service.ts +++ b/src/services/team-app-service.ts @@ -25,14 +25,20 @@ export default class TeamAppService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for a team app. @@ -51,13 +57,19 @@ export default class TeamAppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Lock or unlock a team app. @@ -78,14 +90,20 @@ export default class TeamAppService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Transfer an existing team app to another Heroku account. @@ -106,7 +124,7 @@ export default class TeamAppService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); @@ -130,14 +148,20 @@ export default class TeamAppService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List team apps. @@ -155,12 +179,18 @@ export default class TeamAppService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/team-daily-usage-service.ts b/src/services/team-daily-usage-service.ts index 72c5e41..4121112 100644 --- a/src/services/team-daily-usage-service.ts +++ b/src/services/team-daily-usage-service.ts @@ -28,12 +28,18 @@ export default class TeamDailyUsageService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/team-delinquency-service.ts b/src/services/team-delinquency-service.ts index 9a363e2..75efea4 100644 --- a/src/services/team-delinquency-service.ts +++ b/src/services/team-delinquency-service.ts @@ -25,12 +25,18 @@ export default class TeamDelinquencyService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/team-feature-service.ts b/src/services/team-feature-service.ts index d37012d..d72477b 100644 --- a/src/services/team-feature-service.ts +++ b/src/services/team-feature-service.ts @@ -27,13 +27,19 @@ export default class TeamFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing team features. @@ -51,12 +57,18 @@ export default class TeamFeatureService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/team-invitation-service.ts b/src/services/team-invitation-service.ts index b566325..c0985cf 100644 --- a/src/services/team-invitation-service.ts +++ b/src/services/team-invitation-service.ts @@ -26,13 +26,19 @@ export default class TeamInvitationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create Team Invitation @@ -52,14 +58,20 @@ export default class TeamInvitationService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Revoke a team invitation. @@ -81,7 +93,7 @@ export default class TeamInvitationService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } } @@ -89,7 +101,13 @@ export default class TeamInvitationService { if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Get an invitation by its token @@ -108,13 +126,19 @@ export default class TeamInvitationService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Accept Team Invitation @@ -133,13 +157,19 @@ export default class TeamInvitationService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/team-invoice-service.ts b/src/services/team-invoice-service.ts index 145fc03..a9b5e59 100644 --- a/src/services/team-invoice-service.ts +++ b/src/services/team-invoice-service.ts @@ -27,13 +27,19 @@ export default class TeamInvoiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List existing invoices. @@ -51,12 +57,18 @@ export default class TeamInvoiceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/team-license-collection-service.ts b/src/services/team-license-collection-service.ts new file mode 100644 index 0000000..e7001ce --- /dev/null +++ b/src/services/team-license-collection-service.ts @@ -0,0 +1,42 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team License Collection](https://devcenter.heroku.com/articles/platform-api-reference#team-license-collection) + * A team license collection is credits provided and consumed by the team per period. + */ +export default class TeamLicenseCollectionService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List team licenses. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async list( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/license-collections`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/team-license-service.ts b/src/services/team-license-service.ts new file mode 100644 index 0000000..c3631d0 --- /dev/null +++ b/src/services/team-license-service.ts @@ -0,0 +1,42 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Team License](https://devcenter.heroku.com/articles/platform-api-reference#team-license) + * A team license is credits provided and consumed by the team. + */ +export default class TeamLicenseService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * List teams licenses. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async list( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/licenses`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/team-member-service.ts b/src/services/team-member-service.ts index 6297a08..311cebd 100644 --- a/src/services/team-member-service.ts +++ b/src/services/team-member-service.ts @@ -27,14 +27,20 @@ export default class TeamMemberService { method: 'PUT', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new team member. @@ -54,14 +60,20 @@ export default class TeamMemberService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update a team member. @@ -81,14 +93,20 @@ export default class TeamMemberService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Remove a member from the team. @@ -108,14 +126,20 @@ export default class TeamMemberService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List members of the team. @@ -133,13 +157,19 @@ export default class TeamMemberService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List the apps of a team member. @@ -159,12 +189,18 @@ export default class TeamMemberService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/team-monthly-usage-service.ts b/src/services/team-monthly-usage-service.ts index c9b9b22..f5adf24 100644 --- a/src/services/team-monthly-usage-service.ts +++ b/src/services/team-monthly-usage-service.ts @@ -28,12 +28,18 @@ export default class TeamMonthlyUsageService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/team-preferences-service.ts b/src/services/team-preferences-service.ts index 13731dd..792fd76 100644 --- a/src/services/team-preferences-service.ts +++ b/src/services/team-preferences-service.ts @@ -25,13 +25,19 @@ export default class TeamPreferencesService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update Team Preferences @@ -51,13 +57,19 @@ export default class TeamPreferencesService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/team-service.ts b/src/services/team-service.ts index a2d4900..dc28733 100644 --- a/src/services/team-service.ts +++ b/src/services/team-service.ts @@ -21,13 +21,19 @@ export default class TeamService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for a team. @@ -45,13 +51,19 @@ export default class TeamService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update team properties. @@ -71,14 +83,20 @@ export default class TeamService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a new team. @@ -96,14 +114,20 @@ export default class TeamService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Delete an existing team. @@ -121,14 +145,20 @@ export default class TeamService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List teams for an enterprise account. @@ -146,13 +176,19 @@ export default class TeamService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Create a team in an enterprise account. @@ -172,13 +208,19 @@ export default class TeamService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/team-space-service.ts b/src/services/team-space-service.ts index a46e9d8..d3a3e95 100644 --- a/src/services/team-space-service.ts +++ b/src/services/team-space-service.ts @@ -25,12 +25,18 @@ export default class TeamSpaceService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/telemetry-drain-service.ts b/src/services/telemetry-drain-service.ts new file mode 100644 index 0000000..5806ddb --- /dev/null +++ b/src/services/telemetry-drain-service.ts @@ -0,0 +1,197 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Telemetry Drain](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-drain) + * A telemetry drain forwards OpenTelemetry traces, metrics, and logs to your own consumer. For Fir-generation apps only. + */ +export default class TelemetryDrainService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Create a telemetry drain. + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.TelemetryDrainCreatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/telemetry-drains`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'POST', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List telemetry drains for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async listByApp( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/telemetry-drains`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * List telemetry drains for a space. + * + * @param spaceIdentity unique identifier of space or unique name of space. + * @param requestInit The initializer for the request. + */ + public async listBySpace( + spaceIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/telemetry-drains`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Update a telemetry drain. + * + * @param telemetryDrainIdentity unique identifier of telemetry drain. + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async update( + telemetryDrainIdentity: string, + payload: Heroku.TelemetryDrainUpdatePayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/telemetry-drains/${telemetryDrainIdentity}`, { + ...requestInit, + body: JSON.stringify(payload, null, 2), + method: 'PATCH', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Delete a telemetry drain. + * + * @param telemetryDrainIdentity unique identifier of telemetry drain. + * @param requestInit The initializer for the request. + */ + public async delete( + telemetryDrainIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/telemetry-drains/${telemetryDrainIdentity}`, { + ...requestInit, + + method: 'DELETE', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk', + 'Content-Type': 'application/json' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Info for a telemetry drain. + * + * @param telemetryDrainIdentity unique identifier of telemetry drain. + * @param requestInit The initializer for the request. + */ + public async info( + telemetryDrainIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/telemetry-drains/${telemetryDrainIdentity}`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/telemetry-ingress-info-service.ts b/src/services/telemetry-ingress-info-service.ts new file mode 100644 index 0000000..1cbccaf --- /dev/null +++ b/src/services/telemetry-ingress-info-service.ts @@ -0,0 +1,45 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Telemetry Ingress Info](https://devcenter.heroku.com/articles/platform-api-reference#telemetry-ingress-info) + * Telemetry Ingress Info allows add-on partners to view authorization information required to write to Fir app logs. + */ +export default class TelemetryIngressInfoService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Fetch telemetry ingress info. + * + * @param addOnAttachmentIdentity unique identifier of this add-on attachment. + * @param requestInit The initializer for the request. + */ + public async info( + addOnAttachmentIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl( + `${this.endpoint}/addon-attachments/${addOnAttachmentIdentity}/telemetry-ingress-info`, + { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + } + ); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/test-case-service.ts b/src/services/test-case-service.ts index 0f7609d..347dc83 100644 --- a/src/services/test-case-service.ts +++ b/src/services/test-case-service.ts @@ -24,12 +24,18 @@ export default class TestCaseService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise>; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/test-node-service.ts b/src/services/test-node-service.ts index 7545895..908de72 100644 --- a/src/services/test-node-service.ts +++ b/src/services/test-node-service.ts @@ -24,12 +24,18 @@ export default class TestNodeService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise>; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/test-run-service.ts b/src/services/test-run-service.ts index 21a8190..49aede8 100644 --- a/src/services/test-run-service.ts +++ b/src/services/test-run-service.ts @@ -25,7 +25,7 @@ export default class TestRunService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); @@ -43,7 +43,7 @@ export default class TestRunService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } @@ -64,13 +64,19 @@ export default class TestRunService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise>; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for existing test-run by Pipeline @@ -91,7 +97,7 @@ export default class TestRunService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); } @@ -113,7 +119,7 @@ export default class TestRunService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); diff --git a/src/services/usage-service.ts b/src/services/usage-service.ts new file mode 100644 index 0000000..5973049 --- /dev/null +++ b/src/services/usage-service.ts @@ -0,0 +1,105 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Usage](https://devcenter.heroku.com/articles/platform-api-reference#usage) + * Usage for apps. + */ +export default class UsageService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Retrieves usage for an app. + * + * @param appIdentity unique identifier of app or unique name of app. + * @param requestInit The initializer for the request. + */ + public async info( + appIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/apps/${appIdentity}/usage`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Retrieves usage for an app belonging to a particular team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param teamAppIdentity unique name of app + * @example "example". + * @param requestInit The initializer for the request. + */ + public async infoUsage( + teamIdentity: string, + teamAppIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/apps/${teamAppIdentity}/usage`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * Retrieves usage for apps belonging to a particular team. + * + * @param teamIdentity unique name of team or unique identifier of team. + * @param requestInit The initializer for the request. + */ + public async infoApps( + teamIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/teams/${teamIdentity}/usage`, { + ...requestInit, + + method: 'GET', + headers: { + ...requestInit?.headers, + Accept: 'application/vnd.heroku+json; version=3.sdk' + } + }); + if (response.ok) { + return (await response.json()) as Promise; + } + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } +} diff --git a/src/services/user-preferences-service.ts b/src/services/user-preferences-service.ts index 0f781eb..e1e6f7f 100644 --- a/src/services/user-preferences-service.ts +++ b/src/services/user-preferences-service.ts @@ -25,13 +25,19 @@ export default class UserPreferencesService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update User Preferences @@ -51,13 +57,19 @@ export default class UserPreferencesService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } } diff --git a/src/services/vpn-connection-service.ts b/src/services/vpn-connection-service.ts index e6e1960..d98fb22 100644 --- a/src/services/vpn-connection-service.ts +++ b/src/services/vpn-connection-service.ts @@ -27,14 +27,20 @@ export default class VpnConnectionService { method: 'POST', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Destroy existing VPN Connection @@ -56,7 +62,7 @@ export default class VpnConnectionService { method: 'DELETE', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } } @@ -64,7 +70,13 @@ export default class VpnConnectionService { if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * List VPN connections for a space. @@ -82,13 +94,19 @@ export default class VpnConnectionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } }); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Info for an existing vpn-connection. @@ -110,14 +128,20 @@ export default class VpnConnectionService { method: 'GET', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3' + Accept: 'application/vnd.heroku+json; version=3.sdk' } } ); if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } /** * Update a VPN connection in a private space. @@ -141,7 +165,7 @@ export default class VpnConnectionService { method: 'PATCH', headers: { ...requestInit?.headers, - Accept: 'application/vnd.heroku+json; version=3', + Accept: 'application/vnd.heroku+json; version=3.sdk', 'Content-Type': 'application/json' } } @@ -149,6 +173,12 @@ export default class VpnConnectionService { if (response.ok) { return (await response.json()) as Promise; } - throw new Error(response.statusText); + let message = response.statusText; + try { + ({ message } = (await response.json()) as { message: string }); + } catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); } }