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/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 0000000..9428303 Binary files /dev/null and b/heroku-cli-schema-1.0.25.tgz differ diff --git a/lib/cjs/index.d.ts b/lib/cjs/index.d.ts new file mode 100644 index 0000000..5179299 --- /dev/null +++ b/lib/cjs/index.d.ts @@ -0,0 +1,9995 @@ +/** + * + * [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; + /** + * 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 + */ + 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 SSO configuration of an Enterprise Account or Team. + */ +export interface IdentityProvider { + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + 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 + * + * @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; + /** + * when the identity provider is allowed to be used + */ + 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; +} +/** + * + * [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; + /** + * 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 + * + * @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; + /** + * 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 { + /** + * 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; + /** + * whether the user has enabled Eco dynos + */ + eco_dynos_enabled?: boolean; + /** + * whether pipeline cost consent was made + * + * @example "true" + */ + readonly pipeline_cost_consent?: boolean; +} +/** + * + * [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: { + readonly id: string; + 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: { + readonly id: string; + 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; + /** + * generations supported by this add-on + */ + supported_generations: Array<{ + readonly name?: string; + readonly id?: 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; + /** + * 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 + * + * @example "Ruby/Rack" + */ + readonly buildpack_provided_description: null | string; + /** + * buildpacks of the OCI image + */ + 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 + * + * @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; + /** + * whether this plan is billed per use + */ + readonly metered: 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; + /** + * whether this plan is billed per use + */ + readonly metered: boolean; + /** + * unit of price for plan + * + * @example "month" + */ + 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) + * 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 build artifacts + */ +export interface Build { + /** + * app that the build belongs to + */ + app?: BuildApp; + /** + * 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; + /** + * unique identifier of 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`). + * + * @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 (only applicable for Cedar-generation apps) + */ + 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; +} +/** + * + * 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; +} +/** + * + * 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; + /** + * generation for space + * + * @example "fir" + */ + generation: 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; + /** + * whether the enterprise account is part of the Salesforce Partner Program + */ + readonly partner_benefits: 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 (only applicable to Cedar-generation apps) + */ + buildpacks?: Array<{ + url?: string; + 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: BuildpackInstallationBuildpack; +} +/** + * + * buildpack + */ +export interface BuildpackInstallationBuildpack { + /** + * 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 { + /** + * 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 + */ + readonly cost: null | Record; + /** + * whether this dyno will be dedicated to one user + */ + readonly dedicated: boolean; + /** + * unit of consumption for Heroku Enterprise customers to 2 decimal places + * + * @example 0.28 + */ + readonly precise_dyno_units: number; + /** + * unique identifier of the dyno size + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * amount of RAM in GB + * + * @example 0.5 + */ + readonly memory: number; + /** + * name of the dyno size + * + * @example "eco" + */ + readonly name: string; + /** + * 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; +} +/** + * + * [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 - 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 { + /** + * 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 + */ + 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; + /** + * 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; + /** + * 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 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<{ + 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 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<{ + description?: string; + 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<{ + 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; + }>; + /** + * max 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; + /** + * 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 + * + * @example "Ruby/Rack" + */ + readonly buildpack_provided_description?: null | string; + /** + * buildpacks of the OCI image + */ + 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 + * + * @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; + /** + * dyno size + */ + dyno_size: FormationDynoSize; + /** + * unique identifier of this process type + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * number of processes to maintain + * + * @example 1 + */ + quantity: number; + /** + * deprecated, refer to 'dyno_size' instead + * + * @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; +} +/** + * + * 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 "dyno_size". + */ + updates: FormationBatchUpdatePayloadUpdate[]; +} +/** + * + * Properties to update a process type + */ +export interface FormationBatchUpdatePayloadUpdate { + /** + * dyno size + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} + */ + dyno_size?: FormationBatchUpdatePayloadUpdateDynoSize; + /** + * number of processes to maintain + * + * @example 1 + */ + quantity?: number; + /** + * type of process to maintain + * + * @example "web" + */ + 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 { + /** + * 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; +} +/** + * + * [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 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 | 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 + * + * @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; + /** + * 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?: []; +} +/** + * + * [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 name to limit results to + * + * @example "'web.1' (Cedar-generation) or 'web-1234abcde-123ab' (Fir-generation)" + */ + dyno?: string; + /** + * 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 + */ + 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; + /** + * human-friendly description of this OAuth authorization + * + * @example "sample authorization" + */ + readonly description: 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[]; + /** + * this authorization's session + */ + readonly session: null | Session; + /** + * 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 "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token?: string; + /** + * the version of the token + * + * @example "1" + */ + readonly version?: number; +} +/** + * + * 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 "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 + */ +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[]; +} +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) + * 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: OauthTokenAccessToken; + /** + * 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: OauthTokenRefreshToken; + /** + * 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; +} +/** + * + * 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 + */ +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; +} +/** + * + * refresh token for this authorization + */ +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; +} +/** + * + * 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 "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) + * 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" + */ + 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; +} +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) + * 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<{ + email?: string; + readonly id?: string; + permissions?: string[]; + }>; +} +/** + * + * [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 PipelineBuild { + /** + * app that the build belongs to + */ + app: PipelineBuildApp; + /** + * 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; + /** + * 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: PipelineBuildSourceBlob; + /** + * release resulting from the build + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} + */ + readonly release: null | BuildRelease; + /** + * 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; +} +/** + * + * [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 { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + 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) + * 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<{ + 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-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) + * 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; +} +/** + * + * [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 + * + * @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 the OCI image or unique identifier representing the content of the OCI image + */ + oci_image?: 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?: []; + 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<{ + readonly id?: string; + readonly domains?: []; + 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; + /** + * 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; + /** + * 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[]; + /** + * max 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 - 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) + * 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[]; +} +/** + * + * [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/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..83bf81a --- /dev/null +++ b/lib/cjs/services/account-delinquency-service.js @@ -0,0 +1,41 @@ +"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.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 = 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..b58448d --- /dev/null +++ b/lib/cjs/services/account-feature-service.js @@ -0,0 +1,98 @@ +"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.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 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.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 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.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 = 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..1d95bca --- /dev/null +++ b/lib/cjs/services/account-service.js @@ -0,0 +1,182 @@ +"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.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 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.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 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.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 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.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 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.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 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.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 = 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..ab36d55 --- /dev/null +++ b/lib/cjs/services/add-on-action-service.d.ts @@ -0,0 +1,40 @@ +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; + /** + * 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 new file mode 100644 index 0000000..bb88913 --- /dev/null +++ b/lib/cjs/services/add-on-action-service.js @@ -0,0 +1,131 @@ +"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.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 }); + } + /** + * 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.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()); + } + 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.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..03bad48 --- /dev/null +++ b/lib/cjs/services/add-on-attachment-service.js @@ -0,0 +1,236 @@ +"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.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 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.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 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.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 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.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 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.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 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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 = 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..d789aac --- /dev/null +++ b/lib/cjs/services/add-on-config-service.js @@ -0,0 +1,72 @@ +"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.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 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.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 = 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..5943906 --- /dev/null +++ b/lib/cjs/services/add-on-region-capability-service.js @@ -0,0 +1,95 @@ +"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.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 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.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 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.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 = 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..c8f34e5 --- /dev/null +++ b/lib/cjs/services/add-on-service-service.js @@ -0,0 +1,68 @@ +"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.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 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.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 = 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..1c42198 --- /dev/null +++ b/lib/cjs/services/add-on-service.js @@ -0,0 +1,296 @@ +"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.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 }); + } + /** + * 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.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 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.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 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.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 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.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 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.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 }); + } + /** + * 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.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 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.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 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.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 }); + } + /** + * 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.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 = 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.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..58c3621 --- /dev/null +++ b/lib/cjs/services/add-on-webhook-delivery-service.js @@ -0,0 +1,70 @@ +"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.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 }); + } + /** + * 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.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 = 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..0aac517 --- /dev/null +++ b/lib/cjs/services/add-on-webhook-event-service.js @@ -0,0 +1,70 @@ +"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.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 }); + } + /** + * 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.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 = 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..bf2e439 --- /dev/null +++ b/lib/cjs/services/add-on-webhook-service.js @@ -0,0 +1,160 @@ +"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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 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.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 }); + } + /** + * 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.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 = 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..d59cf3a --- /dev/null +++ b/lib/cjs/services/allowed-add-on-service-service.js @@ -0,0 +1,101 @@ +"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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 = 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..5c99009 --- /dev/null +++ b/lib/cjs/services/app-feature-service.js @@ -0,0 +1,101 @@ +"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.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 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.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 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.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 = 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..f65f76f --- /dev/null +++ b/lib/cjs/services/app-service.js @@ -0,0 +1,266 @@ +"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.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 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.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 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.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 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.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 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.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 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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 = 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..5fddba0 --- /dev/null +++ b/lib/cjs/services/app-setup-service.js @@ -0,0 +1,71 @@ +"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.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 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.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 = 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..1077c66 --- /dev/null +++ b/lib/cjs/services/app-transfer-service.js @@ -0,0 +1,155 @@ +"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.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 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.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 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.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 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.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 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.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 = 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..e406987 --- /dev/null +++ b/lib/cjs/services/app-webhook-delivery-service.js @@ -0,0 +1,70 @@ +"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.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 }); + } + /** + * 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.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 = 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..5ebbf01 --- /dev/null +++ b/lib/cjs/services/app-webhook-event-service.js @@ -0,0 +1,70 @@ +"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.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 }); + } + /** + * 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.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 = 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..28cd7ee --- /dev/null +++ b/lib/cjs/services/app-webhook-service.js @@ -0,0 +1,160 @@ +"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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 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.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 }); + } + /** + * 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.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 = 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..7b8b322 --- /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.sdk' + } + }); + } + /** + * 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.sdk' + } + }); + } +} +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..efc4582 --- /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.sdk' + } + }); + } +} +exports.default = AuditTrailEventService; 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 new file mode 100644 index 0000000..6f9628a --- /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 build artifacts + */ +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..ce98377 --- /dev/null +++ b/lib/cjs/services/build-service.js @@ -0,0 +1,146 @@ +"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 build artifacts + */ +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.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 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.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 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.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 }); + } + /** + * 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.sdk', + '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.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 = 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..506b5f0 --- /dev/null +++ b/lib/cjs/services/buildpack-installation-service.js @@ -0,0 +1,72 @@ +"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.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 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.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 = 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.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..a397778 --- /dev/null +++ b/lib/cjs/services/collaborator-service.js @@ -0,0 +1,129 @@ +"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.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 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.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 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.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 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.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 = 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..436ab8d --- /dev/null +++ b/lib/cjs/services/config-var-service.js @@ -0,0 +1,100 @@ +"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.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 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.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 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.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 = 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.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..fd7305c --- /dev/null +++ b/lib/cjs/services/credit-service.js @@ -0,0 +1,97 @@ +"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.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 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.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 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.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 = 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..1d5db3e --- /dev/null +++ b/lib/cjs/services/domain-service.js @@ -0,0 +1,160 @@ +"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.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 }); + } + /** + * 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.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 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.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 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.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 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.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 = 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 new file mode 100644 index 0000000..fcaec9d --- /dev/null +++ b/lib/cjs/services/dyno-service.d.ts @@ -0,0 +1,74 @@ +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 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. + * + * @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>; + /** + * 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. + * + * @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..501e3de --- /dev/null +++ b/lib/cjs/services/dyno-service.js @@ -0,0 +1,246 @@ +"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.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 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.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()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * 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.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 }); + } + /** + * 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.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 }); + } + /** + * 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. + * + * @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.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 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.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 = 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..2d7a7ca --- /dev/null +++ b/lib/cjs/services/dyno-size-service.d.ts @@ -0,0 +1,30 @@ +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 the dyno size or name of the 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; + /** + * 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 new file mode 100644 index 0000000..7db2e33 --- /dev/null +++ b/lib/cjs/services/dyno-size-service.js @@ -0,0 +1,95 @@ +"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 the dyno size or name of the 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.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 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.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()); + } + 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.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..d7f6833 --- /dev/null +++ b/lib/cjs/services/enterprise-account-daily-usage-service.js @@ -0,0 +1,45 @@ +"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.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 = 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..8157108 --- /dev/null +++ b/lib/cjs/services/enterprise-account-member-service.js @@ -0,0 +1,132 @@ +"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.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 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.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 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.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 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.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 = 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..90930dd --- /dev/null +++ b/lib/cjs/services/enterprise-account-monthly-usage-service.js @@ -0,0 +1,45 @@ +"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.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 = 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..7963f4d --- /dev/null +++ b/lib/cjs/services/enterprise-account-service.js @@ -0,0 +1,98 @@ +"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.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 }); + } + /** + * 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.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 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.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 = 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..bf4623d --- /dev/null +++ b/lib/cjs/services/filter-apps-service.js @@ -0,0 +1,44 @@ +"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.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 = 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..f36770c --- /dev/null +++ b/lib/cjs/services/formation-service.js @@ -0,0 +1,131 @@ +"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.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 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.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 }); + } + /** + * 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.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 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.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 = 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 new file mode 100644 index 0000000..cd1d804 --- /dev/null +++ b/lib/cjs/services/identity-provider-service.d.ts @@ -0,0 +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 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); + /** + * Info for 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. + */ + info(identityProviderIdentity: string, requestInit?: Omit): Promise; + /** + * Create an Identity Provider + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.IdentityProviderCreatePayload, requestInit?: Omit): Promise; + /** + * Update an Identity Provider + * + * @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. + */ + 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 new file mode 100644 index 0000000..8e11d10 --- /dev/null +++ b/lib/cjs/services/identity-provider-service.js @@ -0,0 +1,101 @@ +"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 SSO configuration of an Enterprise Account or Team. + */ +class IdentityProviderService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for 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 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.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 Identity Provider + * + * @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}/identity-providers`, { + ...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 an Identity Provider + * + * @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 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.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 = 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..f6b85c1 --- /dev/null +++ b/lib/cjs/services/inbound-ruleset-service.js @@ -0,0 +1,127 @@ +"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.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 }); + } + /** + * 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.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 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.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 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.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 = InboundRulesetService; diff --git a/lib/cjs/services/index.d.ts b/lib/cjs/services/index.d.ts new file mode 100644 index 0000000..f1652de --- /dev/null +++ b/lib/cjs/services/index.d.ts @@ -0,0 +1,114 @@ +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 './generation-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 './oci-image-service'; +export * from './password-reset-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 './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 new file mode 100644 index 0000000..cc2d48c --- /dev/null +++ b/lib/cjs/services/index.js @@ -0,0 +1,117 @@ +"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("./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); +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("./oci-image-service"), exports); +tslib_1.__exportStar(require("./password-reset-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("./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.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..3382b89 --- /dev/null +++ b/lib/cjs/services/invoice-address-service.js @@ -0,0 +1,70 @@ +"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.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 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.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 = 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..5dc07fd --- /dev/null +++ b/lib/cjs/services/invoice-service.js @@ -0,0 +1,68 @@ +"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.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 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.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 = 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..78a02ac --- /dev/null +++ b/lib/cjs/services/key-service.js @@ -0,0 +1,68 @@ +"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.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 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.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 = 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..2fd16d1 --- /dev/null +++ b/lib/cjs/services/log-drain-service.js @@ -0,0 +1,187 @@ +"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.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 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.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 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.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 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.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 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.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 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.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 = 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..50da474 --- /dev/null +++ b/lib/cjs/services/log-session-service.js @@ -0,0 +1,45 @@ +"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.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 = 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..4668fd4 --- /dev/null +++ b/lib/cjs/services/oauth-authorization-service.d.ts @@ -0,0 +1,52 @@ +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; + /** + * 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. + * + * @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..2049004 --- /dev/null +++ b/lib/cjs/services/oauth-authorization-service.js @@ -0,0 +1,183 @@ +"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.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 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.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 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.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()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * 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.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 }); + } + /** + * 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.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 = 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..046e0da --- /dev/null +++ b/lib/cjs/services/oauth-client-service.js @@ -0,0 +1,172 @@ +"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.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 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.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 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.sdk' + } + }); + } + /** + * 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.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 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.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 }); + } + /** + * 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.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 = 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..d88c194 --- /dev/null +++ b/lib/cjs/services/oauth-token-service.js @@ -0,0 +1,72 @@ +"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.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 }); + } + /** + * 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.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 = 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.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..7cefdee --- /dev/null +++ b/lib/cjs/services/password-reset-service.js @@ -0,0 +1,75 @@ +"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.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 }); + } + /** + * 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.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 = 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-service.d.ts b/lib/cjs/services/peering-service.d.ts new file mode 100644 index 0000000..2dfdc89 --- /dev/null +++ b/lib/cjs/services/peering-service.d.ts @@ -0,0 +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-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); + /** + * 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; + /** + * 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 payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + accept(spaceIdentity: string, payload: Heroku.PeeringAcceptPayload, 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; +} diff --git a/lib/cjs/services/peering-service.js b/lib/cjs/services/peering-service.js new file mode 100644 index 0000000..2c432ed --- /dev/null +++ b/lib/cjs/services/peering-service.js @@ -0,0 +1,129 @@ +"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-vpc-peering?preview=1) 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; + } + /** + * 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.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 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.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 }); + } + /** + * Accept a pending peering connection with 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 accept(spaceIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings`, { + ...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 }); + } + /** + * 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.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 = 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..804d1e2 --- /dev/null +++ b/lib/cjs/services/permission-entity-service.js @@ -0,0 +1,42 @@ +"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.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 = 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..1f3deea --- /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 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; + 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..aab5793 --- /dev/null +++ b/lib/cjs/services/pipeline-build-service.js @@ -0,0 +1,43 @@ +"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 the latest builds of apps in a pipeline. A build represents the process of transforming code into build artifacts. + */ +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.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 = 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..47f044b --- /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 in Heroku CI and review apps used to manage the configuration information for 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..e34747f --- /dev/null +++ b/lib/cjs/services/pipeline-config-var-service.js @@ -0,0 +1,78 @@ +"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 in Heroku CI and review apps used to manage the configuration information for 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.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 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.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 = 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..9335010 --- /dev/null +++ b/lib/cjs/services/pipeline-coupling-service.js @@ -0,0 +1,263 @@ +"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.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 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.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 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.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 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.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 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.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 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.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 }); + } + /** + * 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.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 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.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 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.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 = 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..53843a4 --- /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 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 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". + * @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..508d65a --- /dev/null +++ b/lib/cjs/services/pipeline-deployment-service.js @@ -0,0 +1,43 @@ +"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 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; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * 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". + * @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.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 = 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..7c82a3e --- /dev/null +++ b/lib/cjs/services/pipeline-promotion-service.js @@ -0,0 +1,71 @@ +"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.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 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.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 = 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..ef974e5 --- /dev/null +++ b/lib/cjs/services/pipeline-promotion-target-service.js @@ -0,0 +1,43 @@ +"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.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 = 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..209fcad --- /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 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; + 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..2e1d6b6 --- /dev/null +++ b/lib/cjs/services/pipeline-release-service.js @@ -0,0 +1,43 @@ +"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 the latest release of each app in a pipeline. A release makes a deployment available to end-users. + */ +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.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 = 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..022ec02 --- /dev/null +++ b/lib/cjs/services/pipeline-service.js @@ -0,0 +1,157 @@ +"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.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 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.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 }); + } + /** + * 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.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 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.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 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.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 = 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..2887e99 --- /dev/null +++ b/lib/cjs/services/pipeline-stack-service.js @@ -0,0 +1,43 @@ +"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.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 = 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..a7f3a90 --- /dev/null +++ b/lib/cjs/services/pipeline-transfer-service.js @@ -0,0 +1,44 @@ +"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.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 = 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..c02b69f --- /dev/null +++ b/lib/cjs/services/plan-service.js @@ -0,0 +1,97 @@ +"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.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 }); + } + /** + * 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.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 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.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 = 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..381352f --- /dev/null +++ b/lib/cjs/services/rate-limit-service.js @@ -0,0 +1,41 @@ +"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.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 = 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..4724fd0 --- /dev/null +++ b/lib/cjs/services/region-service.js @@ -0,0 +1,68 @@ +"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.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 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.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 = 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..2b36919 --- /dev/null +++ b/lib/cjs/services/release-service.js @@ -0,0 +1,130 @@ +"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.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 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.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 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.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 }); + } + /** + * 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.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 = 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..c1c4e63 --- /dev/null +++ b/lib/cjs/services/review-app-config-service.js @@ -0,0 +1,134 @@ +"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.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 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.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 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.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 }); + } + /** + * 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.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 = 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..2cf7a4e --- /dev/null +++ b/lib/cjs/services/review-app-service.js @@ -0,0 +1,154 @@ +"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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 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.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 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.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 = 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..53d92f9 --- /dev/null +++ b/lib/cjs/services/slug-service.js @@ -0,0 +1,73 @@ +"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.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 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.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 = 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..d17f6aa --- /dev/null +++ b/lib/cjs/services/sms-number-service.js @@ -0,0 +1,98 @@ +"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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 = 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..5bece8e --- /dev/null +++ b/lib/cjs/services/sni-endpoint-service.js @@ -0,0 +1,160 @@ +"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.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 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.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 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.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 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.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 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.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 = 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..1b570b9 --- /dev/null +++ b/lib/cjs/services/source-service.js @@ -0,0 +1,70 @@ +"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.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 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.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 = 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..7be3ca3 --- /dev/null +++ b/lib/cjs/services/space-app-access-service.js @@ -0,0 +1,101 @@ +"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.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 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.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 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.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 = 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.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..5a4056e --- /dev/null +++ b/lib/cjs/services/space-nat-service.js @@ -0,0 +1,42 @@ +"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.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 = 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..97a372e --- /dev/null +++ b/lib/cjs/services/space-service.js @@ -0,0 +1,155 @@ +"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.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 }); + } + /** + * 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.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 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.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 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.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 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.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 = 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..26ce7b7 --- /dev/null +++ b/lib/cjs/services/space-topology-service.js @@ -0,0 +1,42 @@ +"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.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 = 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..93cbe11 --- /dev/null +++ b/lib/cjs/services/space-transfer-service.js @@ -0,0 +1,45 @@ +"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.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 = 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..18be7e7 --- /dev/null +++ b/lib/cjs/services/stack-service.d.ts @@ -0,0 +1,30 @@ +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; + /** + * 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 new file mode 100644 index 0000000..8b1e3d3 --- /dev/null +++ b/lib/cjs/services/stack-service.js @@ -0,0 +1,95 @@ +"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.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 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.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()); + } + 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.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..7e4025b --- /dev/null +++ b/lib/cjs/services/team-add-on-service.js @@ -0,0 +1,42 @@ +"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.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 = 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..a65bd38 --- /dev/null +++ b/lib/cjs/services/team-app-collaborator-service.js @@ -0,0 +1,164 @@ +"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.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 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.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 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.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 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.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 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.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 = 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..04ce559 --- /dev/null +++ b/lib/cjs/services/team-app-permission-service.js @@ -0,0 +1,41 @@ +"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.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 = 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..d95c28c --- /dev/null +++ b/lib/cjs/services/team-app-service.js @@ -0,0 +1,181 @@ +"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.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 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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.sdk', + '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.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 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.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 = 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..85e55fb --- /dev/null +++ b/lib/cjs/services/team-daily-usage-service.js @@ -0,0 +1,45 @@ +"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.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 = 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..e17088b --- /dev/null +++ b/lib/cjs/services/team-delinquency-service.js @@ -0,0 +1,42 @@ +"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.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 = 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..0653392 --- /dev/null +++ b/lib/cjs/services/team-feature-service.js @@ -0,0 +1,70 @@ +"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.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 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.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 = 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..936f3ee --- /dev/null +++ b/lib/cjs/services/team-invitation-service.js @@ -0,0 +1,159 @@ +"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.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 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.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 }); + } + /** + * 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.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 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.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 }); + } + /** + * 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.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 = 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..b94bc50 --- /dev/null +++ b/lib/cjs/services/team-invoice-service.js @@ -0,0 +1,70 @@ +"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.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 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.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 = 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.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..da968fb --- /dev/null +++ b/lib/cjs/services/team-member-service.js @@ -0,0 +1,189 @@ +"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.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 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.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 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.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 }); + } + /** + * 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.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 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.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 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.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 = 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..2d35c63 --- /dev/null +++ b/lib/cjs/services/team-monthly-usage-service.js @@ -0,0 +1,45 @@ +"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.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 = 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..05aeaab --- /dev/null +++ b/lib/cjs/services/team-preferences-service.js @@ -0,0 +1,72 @@ +"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.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 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.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 = 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..d011888 --- /dev/null +++ b/lib/cjs/services/team-service.js @@ -0,0 +1,212 @@ +"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.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 }); + } + /** + * 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.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 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.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 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.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 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.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 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.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 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.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 = 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..245763b --- /dev/null +++ b/lib/cjs/services/team-space-service.js @@ -0,0 +1,42 @@ +"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.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 = 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.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..b8a005f --- /dev/null +++ b/lib/cjs/services/test-case-service.js @@ -0,0 +1,42 @@ +"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.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 = 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..da34127 --- /dev/null +++ b/lib/cjs/services/test-node-service.js @@ -0,0 +1,42 @@ +"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.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 = 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..3d96d27 --- /dev/null +++ b/lib/cjs/services/test-run-service.js @@ -0,0 +1,114 @@ +"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.sdk', + '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.sdk' + } + }); + } + /** + * 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.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 }); + } + /** + * 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.sdk' + } + }); + } + /** + * 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.sdk', + 'Content-Type': 'application/json' + } + }); + } +} +exports.default = TestRunService; 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.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..0b94b25 --- /dev/null +++ b/lib/cjs/services/user-preferences-service.js @@ -0,0 +1,72 @@ +"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.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 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.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 = 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..0a8a411 --- /dev/null +++ b/lib/cjs/services/vpn-connection-service.js @@ -0,0 +1,160 @@ +"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.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 }); + } + /** + * 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.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 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.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 }); + } + /** + * 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.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 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.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 = VpnConnectionService; diff --git a/lib/esm/index.d.ts b/lib/esm/index.d.ts new file mode 100644 index 0000000..5179299 --- /dev/null +++ b/lib/esm/index.d.ts @@ -0,0 +1,9995 @@ +/** + * + * [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; + /** + * 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 + */ + 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 SSO configuration of an Enterprise Account or Team. + */ +export interface IdentityProvider { + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + 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 + * + * @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; + /** + * when the identity provider is allowed to be used + */ + 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; +} +/** + * + * [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; + /** + * 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 + * + * @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; + /** + * 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 { + /** + * 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; + /** + * whether the user has enabled Eco dynos + */ + eco_dynos_enabled?: boolean; + /** + * whether pipeline cost consent was made + * + * @example "true" + */ + readonly pipeline_cost_consent?: boolean; +} +/** + * + * [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: { + readonly id: string; + 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: { + readonly id: string; + 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; + /** + * generations supported by this add-on + */ + supported_generations: Array<{ + readonly name?: string; + readonly id?: 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; + /** + * 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 + * + * @example "Ruby/Rack" + */ + readonly buildpack_provided_description: null | string; + /** + * buildpacks of the OCI image + */ + 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 + * + * @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; + /** + * whether this plan is billed per use + */ + readonly metered: 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; + /** + * whether this plan is billed per use + */ + readonly metered: boolean; + /** + * unit of price for plan + * + * @example "month" + */ + 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) + * 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 build artifacts + */ +export interface Build { + /** + * app that the build belongs to + */ + app?: BuildApp; + /** + * 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; + /** + * unique identifier of 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`). + * + * @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 (only applicable for Cedar-generation apps) + */ + 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; +} +/** + * + * 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; +} +/** + * + * 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; + /** + * generation for space + * + * @example "fir" + */ + generation: 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; + /** + * whether the enterprise account is part of the Salesforce Partner Program + */ + readonly partner_benefits: 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 (only applicable to Cedar-generation apps) + */ + buildpacks?: Array<{ + url?: string; + 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: BuildpackInstallationBuildpack; +} +/** + * + * buildpack + */ +export interface BuildpackInstallationBuildpack { + /** + * 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 { + /** + * 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 + */ + readonly cost: null | Record; + /** + * whether this dyno will be dedicated to one user + */ + readonly dedicated: boolean; + /** + * unit of consumption for Heroku Enterprise customers to 2 decimal places + * + * @example 0.28 + */ + readonly precise_dyno_units: number; + /** + * unique identifier of the dyno size + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * amount of RAM in GB + * + * @example 0.5 + */ + readonly memory: number; + /** + * name of the dyno size + * + * @example "eco" + */ + readonly name: string; + /** + * 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; +} +/** + * + * [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 - 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 { + /** + * 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 + */ + 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; + /** + * 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; + /** + * 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 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<{ + 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 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<{ + description?: string; + 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<{ + 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; + }>; + /** + * max 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; + /** + * 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 + * + * @example "Ruby/Rack" + */ + readonly buildpack_provided_description?: null | string; + /** + * buildpacks of the OCI image + */ + 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 + * + * @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; + /** + * dyno size + */ + dyno_size: FormationDynoSize; + /** + * unique identifier of this process type + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * number of processes to maintain + * + * @example 1 + */ + quantity: number; + /** + * deprecated, refer to 'dyno_size' instead + * + * @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; +} +/** + * + * 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 "dyno_size". + */ + updates: FormationBatchUpdatePayloadUpdate[]; +} +/** + * + * Properties to update a process type + */ +export interface FormationBatchUpdatePayloadUpdate { + /** + * dyno size + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} + */ + dyno_size?: FormationBatchUpdatePayloadUpdateDynoSize; + /** + * number of processes to maintain + * + * @example 1 + */ + quantity?: number; + /** + * type of process to maintain + * + * @example "web" + */ + 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 { + /** + * 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; +} +/** + * + * [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 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 | 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 + * + * @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; + /** + * 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?: []; +} +/** + * + * [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 name to limit results to + * + * @example "'web.1' (Cedar-generation) or 'web-1234abcde-123ab' (Fir-generation)" + */ + dyno?: string; + /** + * 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 + */ + 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; + /** + * human-friendly description of this OAuth authorization + * + * @example "sample authorization" + */ + readonly description: 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[]; + /** + * this authorization's session + */ + readonly session: null | Session; + /** + * 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 "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token?: string; + /** + * the version of the token + * + * @example "1" + */ + readonly version?: number; +} +/** + * + * 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 "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 + */ +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[]; +} +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) + * 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: OauthTokenAccessToken; + /** + * 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: OauthTokenRefreshToken; + /** + * 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; +} +/** + * + * 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 + */ +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; +} +/** + * + * refresh token for this authorization + */ +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; +} +/** + * + * 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 "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) + * 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" + */ + 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; +} +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) + * 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<{ + email?: string; + readonly id?: string; + permissions?: string[]; + }>; +} +/** + * + * [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 PipelineBuild { + /** + * app that the build belongs to + */ + app: PipelineBuildApp; + /** + * 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; + /** + * 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: PipelineBuildSourceBlob; + /** + * release resulting from the build + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} + */ + readonly release: null | BuildRelease; + /** + * 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; +} +/** + * + * [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 { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + 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) + * 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<{ + 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-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) + * 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; +} +/** + * + * [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 + * + * @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 the OCI image or unique identifier representing the content of the OCI image + */ + oci_image?: 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?: []; + 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<{ + readonly id?: string; + readonly domains?: []; + 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; + /** + * 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; + /** + * 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[]; + /** + * max 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 - 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) + * 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[]; +} +/** + * + * [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/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..2c62147 --- /dev/null +++ b/lib/esm/services/account-delinquency-service.js @@ -0,0 +1,38 @@ +/** + * [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.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/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..d698ba0 --- /dev/null +++ b/lib/esm/services/account-feature-service.js @@ -0,0 +1,95 @@ +/** + * [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.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 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.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 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.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/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..c236237 --- /dev/null +++ b/lib/esm/services/account-service.js @@ -0,0 +1,179 @@ +/** + * [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.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 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.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 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.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 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.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 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.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 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.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-action-service.d.ts b/lib/esm/services/add-on-action-service.d.ts new file mode 100644 index 0000000..ab36d55 --- /dev/null +++ b/lib/esm/services/add-on-action-service.d.ts @@ -0,0 +1,40 @@ +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; + /** + * 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 new file mode 100644 index 0000000..b3ff97c --- /dev/null +++ b/lib/esm/services/add-on-action-service.js @@ -0,0 +1,128 @@ +/** + * [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.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 }); + } + /** + * 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.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()); + } + 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.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..e4c534d --- /dev/null +++ b/lib/esm/services/add-on-attachment-service.js @@ -0,0 +1,233 @@ +/** + * [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.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 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.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 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.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 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.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 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.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 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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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-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..9a87727 --- /dev/null +++ b/lib/esm/services/add-on-config-service.js @@ -0,0 +1,69 @@ +/** + * [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.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 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.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-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..f041a1e --- /dev/null +++ b/lib/esm/services/add-on-region-capability-service.js @@ -0,0 +1,92 @@ +/** + * [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.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 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.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 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.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-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..fe33e85 --- /dev/null +++ b/lib/esm/services/add-on-service-service.js @@ -0,0 +1,65 @@ +/** + * [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.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 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.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-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..290c703 --- /dev/null +++ b/lib/esm/services/add-on-service.js @@ -0,0 +1,293 @@ +/** + * [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.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 }); + } + /** + * 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.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 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.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 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.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 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.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 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.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 }); + } + /** + * 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.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 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.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 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.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 }); + } + /** + * 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.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-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.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..4a8f0e6 --- /dev/null +++ b/lib/esm/services/add-on-webhook-delivery-service.js @@ -0,0 +1,67 @@ +/** + * [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.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 }); + } + /** + * 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.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-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..8208762 --- /dev/null +++ b/lib/esm/services/add-on-webhook-event-service.js @@ -0,0 +1,67 @@ +/** + * [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.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 }); + } + /** + * 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.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-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..fd28e12 --- /dev/null +++ b/lib/esm/services/add-on-webhook-service.js @@ -0,0 +1,157 @@ +/** + * [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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 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.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 }); + } + /** + * 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.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/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..66afa8b --- /dev/null +++ b/lib/esm/services/allowed-add-on-service-service.js @@ -0,0 +1,98 @@ +/** + * [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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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/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..1d032d9 --- /dev/null +++ b/lib/esm/services/app-feature-service.js @@ -0,0 +1,98 @@ +/** + * [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.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 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.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 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.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/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..b3c8f8e --- /dev/null +++ b/lib/esm/services/app-service.js @@ -0,0 +1,263 @@ +/** + * [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.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 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.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 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.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 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.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 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.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 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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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/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..d6551fc --- /dev/null +++ b/lib/esm/services/app-setup-service.js @@ -0,0 +1,68 @@ +/** + * [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.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 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.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/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..b4e3ee7 --- /dev/null +++ b/lib/esm/services/app-transfer-service.js @@ -0,0 +1,152 @@ +/** + * [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.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 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.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 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.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 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.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 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.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/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..67646ee --- /dev/null +++ b/lib/esm/services/app-webhook-delivery-service.js @@ -0,0 +1,67 @@ +/** + * [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.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 }); + } + /** + * 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.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/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..13bf58c --- /dev/null +++ b/lib/esm/services/app-webhook-event-service.js @@ -0,0 +1,67 @@ +/** + * [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.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 }); + } + /** + * 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.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/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..92da8ab --- /dev/null +++ b/lib/esm/services/app-webhook-service.js @@ -0,0 +1,157 @@ +/** + * [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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 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.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 }); + } + /** + * 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.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/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..29a0778 --- /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.sdk' + } + }); + } + /** + * 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.sdk' + } + }); + } +} 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..92e8560 --- /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.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 new file mode 100644 index 0000000..6f9628a --- /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 build artifacts + */ +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..54d1d63 --- /dev/null +++ b/lib/esm/services/build-service.js @@ -0,0 +1,143 @@ +/** + * [Heroku Build API - Build](https://devcenter.heroku.com/articles/platform-api-reference#build) + * A build represents the process of transforming a code tarball into build artifacts + */ +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.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 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.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 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.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 }); + } + /** + * 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.sdk', + '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.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/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..b42bed1 --- /dev/null +++ b/lib/esm/services/buildpack-installation-service.js @@ -0,0 +1,69 @@ +/** + * [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.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 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.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/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.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..327649d --- /dev/null +++ b/lib/esm/services/collaborator-service.js @@ -0,0 +1,126 @@ +/** + * [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.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 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.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 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.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 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.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/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..75da7a0 --- /dev/null +++ b/lib/esm/services/config-var-service.js @@ -0,0 +1,97 @@ +/** + * [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.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 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.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 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.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/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.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..d1ae59d --- /dev/null +++ b/lib/esm/services/credit-service.js @@ -0,0 +1,94 @@ +/** + * [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.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 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.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 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.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/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..fc62c35 --- /dev/null +++ b/lib/esm/services/domain-service.js @@ -0,0 +1,157 @@ +/** + * [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.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 }); + } + /** + * 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.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 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.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 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.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 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.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/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 new file mode 100644 index 0000000..fcaec9d --- /dev/null +++ b/lib/esm/services/dyno-service.d.ts @@ -0,0 +1,74 @@ +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 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. + * + * @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>; + /** + * 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. + * + * @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..a428bea --- /dev/null +++ b/lib/esm/services/dyno-service.js @@ -0,0 +1,243 @@ +/** + * [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.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 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.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()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * 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.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 }); + } + /** + * 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.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 }); + } + /** + * 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. + * + * @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.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 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.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/dyno-size-service.d.ts b/lib/esm/services/dyno-size-service.d.ts new file mode 100644 index 0000000..2d7a7ca --- /dev/null +++ b/lib/esm/services/dyno-size-service.d.ts @@ -0,0 +1,30 @@ +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 the dyno size or name of the 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; + /** + * 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 new file mode 100644 index 0000000..8edd453 --- /dev/null +++ b/lib/esm/services/dyno-size-service.js @@ -0,0 +1,92 @@ +/** + * [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 the dyno size or name of the 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.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 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.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()); + } + 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.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..eab8319 --- /dev/null +++ b/lib/esm/services/enterprise-account-daily-usage-service.js @@ -0,0 +1,42 @@ +/** + * [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.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/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..d047576 --- /dev/null +++ b/lib/esm/services/enterprise-account-member-service.js @@ -0,0 +1,129 @@ +/** + * [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.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 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.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 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.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 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.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/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..1abd917 --- /dev/null +++ b/lib/esm/services/enterprise-account-monthly-usage-service.js @@ -0,0 +1,42 @@ +/** + * [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.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/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..47a8ad3 --- /dev/null +++ b/lib/esm/services/enterprise-account-service.js @@ -0,0 +1,95 @@ +/** + * [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.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 }); + } + /** + * 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.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 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.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/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..a8f201e --- /dev/null +++ b/lib/esm/services/filter-apps-service.js @@ -0,0 +1,41 @@ +/** + * [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.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/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..86f49fc --- /dev/null +++ b/lib/esm/services/formation-service.js @@ -0,0 +1,128 @@ +/** + * [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.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 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.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 }); + } + /** + * 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.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 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.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/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 new file mode 100644 index 0000000..cd1d804 --- /dev/null +++ b/lib/esm/services/identity-provider-service.d.ts @@ -0,0 +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 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); + /** + * Info for 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. + */ + info(identityProviderIdentity: string, requestInit?: Omit): Promise; + /** + * Create an Identity Provider + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + create(payload: Heroku.IdentityProviderCreatePayload, requestInit?: Omit): Promise; + /** + * Update an Identity Provider + * + * @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. + */ + 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 new file mode 100644 index 0000000..8399d36 --- /dev/null +++ b/lib/esm/services/identity-provider-service.js @@ -0,0 +1,98 @@ +/** + * [Heroku Platform API - Identity Provider](https://devcenter.heroku.com/articles/platform-api-reference#identity-provider) + * Identity Providers represent the SSO configuration of an Enterprise Account or Team. + */ +export default class IdentityProviderService { + fetchImpl; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * Info for 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 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.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 Identity Provider + * + * @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}/identity-providers`, { + ...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 an Identity Provider + * + * @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 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.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/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..aa57b97 --- /dev/null +++ b/lib/esm/services/inbound-ruleset-service.js @@ -0,0 +1,124 @@ +/** + * [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.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 }); + } + /** + * 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.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 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.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 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.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/index.d.ts b/lib/esm/services/index.d.ts new file mode 100644 index 0000000..f1652de --- /dev/null +++ b/lib/esm/services/index.d.ts @@ -0,0 +1,114 @@ +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 './generation-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 './oci-image-service'; +export * from './password-reset-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 './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 new file mode 100644 index 0000000..f1652de --- /dev/null +++ b/lib/esm/services/index.js @@ -0,0 +1,114 @@ +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 './generation-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 './oci-image-service'; +export * from './password-reset-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 './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.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..c5ddde7 --- /dev/null +++ b/lib/esm/services/invoice-address-service.js @@ -0,0 +1,67 @@ +/** + * [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.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 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.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/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..bec1df4 --- /dev/null +++ b/lib/esm/services/invoice-service.js @@ -0,0 +1,65 @@ +/** + * [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.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 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.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/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..495f9d9 --- /dev/null +++ b/lib/esm/services/key-service.js @@ -0,0 +1,65 @@ +/** + * [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.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 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.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/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..21c2c30 --- /dev/null +++ b/lib/esm/services/log-drain-service.js @@ -0,0 +1,184 @@ +/** + * [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.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 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.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 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.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 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.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 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.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 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.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/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..c0460a2 --- /dev/null +++ b/lib/esm/services/log-session-service.js @@ -0,0 +1,42 @@ +/** + * [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.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/oauth-authorization-service.d.ts b/lib/esm/services/oauth-authorization-service.d.ts new file mode 100644 index 0000000..4668fd4 --- /dev/null +++ b/lib/esm/services/oauth-authorization-service.d.ts @@ -0,0 +1,52 @@ +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; + /** + * 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. + * + * @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..e48699a --- /dev/null +++ b/lib/esm/services/oauth-authorization-service.js @@ -0,0 +1,180 @@ +/** + * [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.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 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.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 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.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()); + } + let message = response.statusText; + try { + ({ message } = (await response.json())); + } + catch (error) { + // no-op + } + throw new Error(`${response.status}: ${message}`, { cause: response }); + } + /** + * 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.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 }); + } + /** + * 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.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/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..f777fef --- /dev/null +++ b/lib/esm/services/oauth-client-service.js @@ -0,0 +1,169 @@ +/** + * [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.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 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.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 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.sdk' + } + }); + } + /** + * 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.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 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.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 }); + } + /** + * 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.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/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..5362eb0 --- /dev/null +++ b/lib/esm/services/oauth-token-service.js @@ -0,0 +1,69 @@ +/** + * [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.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 }); + } + /** + * 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.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/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.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..fbbe3f7 --- /dev/null +++ b/lib/esm/services/password-reset-service.js @@ -0,0 +1,72 @@ +/** + * [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.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 }); + } + /** + * 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.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/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-service.d.ts b/lib/esm/services/peering-service.d.ts new file mode 100644 index 0000000..2dfdc89 --- /dev/null +++ b/lib/esm/services/peering-service.d.ts @@ -0,0 +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-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); + /** + * 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; + /** + * 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 payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + accept(spaceIdentity: string, payload: Heroku.PeeringAcceptPayload, 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; +} diff --git a/lib/esm/services/peering-service.js b/lib/esm/services/peering-service.js new file mode 100644 index 0000000..2b3c7fd --- /dev/null +++ b/lib/esm/services/peering-service.js @@ -0,0 +1,126 @@ +/** + * [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 default class PeeringService { + 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.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 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.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 }); + } + /** + * Accept a pending peering connection with 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 accept(spaceIdentity, payload, requestInit = {}) { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings`, { + ...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 }); + } + /** + * 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.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/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..395b60a --- /dev/null +++ b/lib/esm/services/permission-entity-service.js @@ -0,0 +1,39 @@ +/** + * [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.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/pipeline-build-service.d.ts b/lib/esm/services/pipeline-build-service.d.ts new file mode 100644 index 0000000..1f3deea --- /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 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; + 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..0678f09 --- /dev/null +++ b/lib/esm/services/pipeline-build-service.js @@ -0,0 +1,40 @@ +/** + * [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 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.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/pipeline-config-var-service.d.ts b/lib/esm/services/pipeline-config-var-service.d.ts new file mode 100644 index 0000000..47f044b --- /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 in Heroku CI and review apps used to manage the configuration information for 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..34ed54d --- /dev/null +++ b/lib/esm/services/pipeline-config-var-service.js @@ -0,0 +1,75 @@ +/** + * [Heroku Platform API - Pipeline Config Vars](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 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.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 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.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/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..ec0e0d2 --- /dev/null +++ b/lib/esm/services/pipeline-coupling-service.js @@ -0,0 +1,260 @@ +/** + * [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.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 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.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 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.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 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.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 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.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 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.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 }); + } + /** + * 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.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 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.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 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.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/pipeline-deployment-service.d.ts b/lib/esm/services/pipeline-deployment-service.d.ts new file mode 100644 index 0000000..53843a4 --- /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 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 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". + * @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..4be9b85 --- /dev/null +++ b/lib/esm/services/pipeline-deployment-service.js @@ -0,0 +1,40 @@ +/** + * [Heroku Platform API - Pipeline Deployment](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-deployment) + * 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; + endpoint; + constructor(fetchImpl, endpoint) { + this.fetchImpl = fetchImpl; + this.endpoint = endpoint; + } + /** + * 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". + * @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.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/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..eff4197 --- /dev/null +++ b/lib/esm/services/pipeline-promotion-service.js @@ -0,0 +1,68 @@ +/** + * [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.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 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.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/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..f86c839 --- /dev/null +++ b/lib/esm/services/pipeline-promotion-target-service.js @@ -0,0 +1,40 @@ +/** + * [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.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/pipeline-release-service.d.ts b/lib/esm/services/pipeline-release-service.d.ts new file mode 100644 index 0000000..209fcad --- /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 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; + 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..af70427 --- /dev/null +++ b/lib/esm/services/pipeline-release-service.js @@ -0,0 +1,40 @@ +/** + * [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 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.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/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..8703cc7 --- /dev/null +++ b/lib/esm/services/pipeline-service.js @@ -0,0 +1,154 @@ +/** + * [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.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 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.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 }); + } + /** + * 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.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 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.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 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.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/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..20899d0 --- /dev/null +++ b/lib/esm/services/pipeline-stack-service.js @@ -0,0 +1,40 @@ +/** + * [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.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/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..f5031f3 --- /dev/null +++ b/lib/esm/services/pipeline-transfer-service.js @@ -0,0 +1,41 @@ +/** + * [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.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/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..f7df9c1 --- /dev/null +++ b/lib/esm/services/plan-service.js @@ -0,0 +1,94 @@ +/** + * [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.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 }); + } + /** + * 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.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 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.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/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..fd17abe --- /dev/null +++ b/lib/esm/services/rate-limit-service.js @@ -0,0 +1,38 @@ +/** + * [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.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/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..f321d3e --- /dev/null +++ b/lib/esm/services/region-service.js @@ -0,0 +1,65 @@ +/** + * [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.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 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.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/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..e68f673 --- /dev/null +++ b/lib/esm/services/release-service.js @@ -0,0 +1,127 @@ +/** + * [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.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 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.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 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.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 }); + } + /** + * 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.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/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..529ba3c --- /dev/null +++ b/lib/esm/services/review-app-config-service.js @@ -0,0 +1,131 @@ +/** + * [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.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 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.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 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.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 }); + } + /** + * 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.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/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..a66042f --- /dev/null +++ b/lib/esm/services/review-app-service.js @@ -0,0 +1,151 @@ +/** + * [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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 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.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 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.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/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..ed7ed16 --- /dev/null +++ b/lib/esm/services/slug-service.js @@ -0,0 +1,70 @@ +/** + * [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.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 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.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/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..b4fd6d3 --- /dev/null +++ b/lib/esm/services/sms-number-service.js @@ -0,0 +1,95 @@ +/** + * [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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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/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..b063782 --- /dev/null +++ b/lib/esm/services/sni-endpoint-service.js @@ -0,0 +1,157 @@ +/** + * [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.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 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.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 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.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 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.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 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.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/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..26477c8 --- /dev/null +++ b/lib/esm/services/source-service.js @@ -0,0 +1,67 @@ +/** + * [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.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 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.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-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..b59e749 --- /dev/null +++ b/lib/esm/services/space-app-access-service.js @@ -0,0 +1,98 @@ +/** + * [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.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 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.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 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.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-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.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..ad5a210 --- /dev/null +++ b/lib/esm/services/space-nat-service.js @@ -0,0 +1,39 @@ +/** + * [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.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-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..c19d70f --- /dev/null +++ b/lib/esm/services/space-service.js @@ -0,0 +1,152 @@ +/** + * [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.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 }); + } + /** + * 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.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 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.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 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.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 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.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-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..110c623 --- /dev/null +++ b/lib/esm/services/space-topology-service.js @@ -0,0 +1,39 @@ +/** + * [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.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-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..b7a4e7e --- /dev/null +++ b/lib/esm/services/space-transfer-service.js @@ -0,0 +1,42 @@ +/** + * [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.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/stack-service.d.ts b/lib/esm/services/stack-service.d.ts new file mode 100644 index 0000000..18be7e7 --- /dev/null +++ b/lib/esm/services/stack-service.d.ts @@ -0,0 +1,30 @@ +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; + /** + * 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 new file mode 100644 index 0000000..e0c7c60 --- /dev/null +++ b/lib/esm/services/stack-service.js @@ -0,0 +1,92 @@ +/** + * [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.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 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.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()); + } + 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.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..270ce1c --- /dev/null +++ b/lib/esm/services/team-add-on-service.js @@ -0,0 +1,39 @@ +/** + * [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.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-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..ddfc5d3 --- /dev/null +++ b/lib/esm/services/team-app-collaborator-service.js @@ -0,0 +1,161 @@ +/** + * [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.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 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.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 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.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 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.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 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.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-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..3176d17 --- /dev/null +++ b/lib/esm/services/team-app-permission-service.js @@ -0,0 +1,38 @@ +/** + * [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.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-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..89ea051 --- /dev/null +++ b/lib/esm/services/team-app-service.js @@ -0,0 +1,178 @@ +/** + * [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.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 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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.sdk', + '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.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 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.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-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..34dcdc0 --- /dev/null +++ b/lib/esm/services/team-daily-usage-service.js @@ -0,0 +1,42 @@ +/** + * [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.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-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..80e9190 --- /dev/null +++ b/lib/esm/services/team-delinquency-service.js @@ -0,0 +1,39 @@ +/** + * [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.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-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..1fc193a --- /dev/null +++ b/lib/esm/services/team-feature-service.js @@ -0,0 +1,67 @@ +/** + * [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.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 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.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-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..a949815 --- /dev/null +++ b/lib/esm/services/team-invitation-service.js @@ -0,0 +1,156 @@ +/** + * [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.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 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.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 }); + } + /** + * 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.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 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.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 }); + } + /** + * 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.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/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..50040ef --- /dev/null +++ b/lib/esm/services/team-invoice-service.js @@ -0,0 +1,67 @@ +/** + * [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.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 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.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-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.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..88fd8bf --- /dev/null +++ b/lib/esm/services/team-member-service.js @@ -0,0 +1,186 @@ +/** + * [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.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 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.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 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.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 }); + } + /** + * 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.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 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.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 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.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-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..633f9bf --- /dev/null +++ b/lib/esm/services/team-monthly-usage-service.js @@ -0,0 +1,42 @@ +/** + * [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.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-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..cefcec0 --- /dev/null +++ b/lib/esm/services/team-preferences-service.js @@ -0,0 +1,69 @@ +/** + * [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.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 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.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/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..d30c458 --- /dev/null +++ b/lib/esm/services/team-service.js @@ -0,0 +1,209 @@ +/** + * [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.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 }); + } + /** + * 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.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 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.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 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.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 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.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 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.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 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.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/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..98a8045 --- /dev/null +++ b/lib/esm/services/team-space-service.js @@ -0,0 +1,39 @@ +/** + * [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.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-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.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..c7939c0 --- /dev/null +++ b/lib/esm/services/test-case-service.js @@ -0,0 +1,39 @@ +/** + * [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.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-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..ec404a4 --- /dev/null +++ b/lib/esm/services/test-node-service.js @@ -0,0 +1,39 @@ +/** + * [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.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-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..d7f1561 --- /dev/null +++ b/lib/esm/services/test-run-service.js @@ -0,0 +1,111 @@ +/** + * [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.sdk', + '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.sdk' + } + }); + } + /** + * 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.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 }); + } + /** + * 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.sdk' + } + }); + } + /** + * 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.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.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..4b0ab15 --- /dev/null +++ b/lib/esm/services/user-preferences-service.js @@ -0,0 +1,69 @@ +/** + * [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.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 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.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/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..6dda369 --- /dev/null +++ b/lib/esm/services/vpn-connection-service.js @@ -0,0 +1,157 @@ +/** + * [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.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 }); + } + /** + * 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.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 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.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 }); + } + /** + * 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.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 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.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/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..b4e26e4 100644 --- a/package.json +++ b/package.json @@ -3,16 +3,23 @@ "version": "1.0.25", "author": "Heroku", "bugs": "https://github.com/heroku/typescript-api-schema/issues", - "devDependencies": { - "eslint": "^8.57.0", - "eslint-config-oclif-typescript": "3.1.7", - "http-call": "^5.2.2", - "json-schema-to-typescript": "^14.1.0", - "jsonwebtoken": "^8.3.0", - "typescript": "^4.9.5" + "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", + "types": "./lib/esm/index.d.ts" + }, + "./services/*.js": { + "import": "./lib/esm/services/*.js", + "require": "./lib/cjs/services/*.js", + "types": "./lib/esm/services/*.d.ts" + } }, "engines": { - "node": ">=18.0.0" + "node": ">=16.20.1" }, "files": [ "/lib" @@ -23,8 +30,25 @@ ], "license": "MIT", "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)" + }, + "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 new file mode 100644 index 0000000..006c3a6 --- /dev/null +++ b/schema-builder.mjs @@ -0,0 +1,491 @@ +import schema from './schema.json' with {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 (!items) { + return []; + } + 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); + const typesToMap = Array.isArray(types) ? types : [types]; + return typesToMap.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. + * @param {boolean} includeDescription Boolean indicating whether to include the description in the doc block. + * @returns {string} + */ +function createInterfaceMemberFromProp(propName, schemaInfo, required, includeDescription = true) { + if (/\W/g.test(propName)) { + propName = `'${propName}'`; + } + + const {description, typeScriptType, readOnly} = createInterfaceMemberDescriptor(propName, schemaInfo); + const docBlock = includeDescription && 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) : Array.isArray(type) ? type : [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, title:schemaTitle, $ref} = schemaInfo; + let interfaceName = pascalCase(propName || schemaTitle || ''); + + // $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), !!interfaceName))) + : ['[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, alternateInterfaceName) { + if (!targetSchema) { + return 'void'; + } + const {type: types} = targetSchema; + if (types) { + return types + .map(type => getTypeDefinition(type, alternateInterfaceName, 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 encounteredNames = new Set(); + const paramDescriptors = hrefTokens.map(hrefToken => { + const [token, ref] = hrefToken; + 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)); + }); + 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 = []; + 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) + : ''; + if (payloadType && !payloadType.startsWith('Record')) { + payloadType = `Heroku.${payloadType}`; + } + + 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. + 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.sdk' + ${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}>; + } + 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(methodName)}(${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..12826e2 --- /dev/null +++ b/schema.json @@ -0,0 +1,21901 @@ +{ + "$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" + ] + }, + "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": [ + { + "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" + }, + "eco_dynos_enabled": { + "$ref": "#/definitions/account/definitions/eco_dynos_enabled" + }, + "pipeline_cost_consent": { + "$ref": "#/definitions/account/definitions/pipeline_cost_consent" + } + }, + "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" + }, + "eco_dynos_enabled": { + "$ref": "#/definitions/account/definitions/eco_dynos_enabled" + }, + "pipeline_cost_consent": { + "$ref": "#/definitions/account/definitions/pipeline_cost_consent" + } + }, + "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" + }, + "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": { + "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" + }, + { + "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": {} + }, + "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" + ] + }, + "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": [ + { + "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" + }, + "supported_generations": { + "$ref": "#/definitions/add-on-service/definitions/supported_generations" + } + } + }, + "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" + }, + "metered": { + "$ref": "#/definitions/plan/definitions/metered" + }, + "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": { + "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", + "format": "date-time", + "readOnly": true, + "type": [ + "null", + "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", + "readOnly": true, + "type": [ + "null", + "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", + "format": "date-time", + "readOnly": true, + "type": [ + "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", + "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" + ] + } + }, + "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" + }, + "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" + }, + "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" + }, + "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 build artifacts", + "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 (only applicable to Cedar-generation apps)", + "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" + } + ] + }, + "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", + "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" + }, + "labs": { + "$ref": "#/definitions/build/definitions/labs" + }, + "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 (only applicable for Cedar-generation apps)", + "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": { + "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, + "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 the 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" + } + ] + }, + "infrastructure_tier": { + "description": "infrastructure tier for this dyno", + "example": "production", + "readOnly": true, + "type": [ + "string" + ] + }, + "product_dyno_tier": { + "description": "product tier for this dyno", + "example": "standard", + "readOnly": true, + "type": [ + "string" + ] + }, + "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", + "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" + ] + } + } + }, + "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" + ] + }, + "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": [ + { + "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" + }, + { + "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" + }, + "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" + }, + "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" + } + } + }, + "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" + ] + }, + "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, + "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 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", + "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": "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)}", + "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": "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" + ] + }, + "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" + ] + }, + "partner_benefits": { + "description": "whether the enterprise account is part of the Salesforce Partner Program", + "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" + }, + "partner_benefits": { + "$ref": "#/definitions/enterprise-account/definitions/partner_benefits" + }, + "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" + ] + }, + "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", + "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": { + "deprecated": true, + "description": "deprecated, refer to 'dyno_size' instead", + "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": { + "dyno_size": { + "$ref": "#/definitions/formation/definitions/dyno_size" + }, + "quantity": { + "$ref": "#/definitions/formation/definitions/quantity" + }, + "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 \"dyno_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": { + "dyno_size": { + "$ref": "#/definitions/formation/definitions/dyno_size" + }, + "quantity": { + "$ref": "#/definitions/formation/definitions/quantity" + } + }, + "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" + }, + "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" + }, + "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" + } + } + }, + "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": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Generation", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when generation was created", + "example": "2024-12-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of generation", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/generation/definitions/name" + }, + { + "$ref": "#/definitions/generation/definitions/id" + } + ] + }, + "name": { + "description": "unique name of generation", + "example": "fir", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when generation was updated", + "example": "2024-12-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "unsupported_feature": { + "description": "unsupported feature information", + "properties": { + "name": { + "description": "name of unsupported feature", + "example": "app_maintenance", + "type": [ + "string" + ] + }, + "incompatible_type": { + "description": "type of unsupported feature", + "example": "temporary", + "type": [ + "string" + ] + }, + "scope": { + "description": "scope of unsupported feature", + "example": "app", + "type": [ + "string" + ] + } + }, + "readOnly": true, + "type": [ + "object" + ] + }, + "unsupported_features": { + "description": "features unsupported by this generation", + "type": [ + "array" + ], + "items": { + "type": [ + "string" + ], + "example": "ipv6_peering" + } + } + }, + "links": [ + { + "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/generation" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "description": "List available generations for a team.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/available-generations", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/generation" + }, + "type": [ + "array" + ] + }, + "title": "List" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/generation/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/generation/definitions/id" + }, + "name": { + "$ref": "#/definitions/generation/definitions/name" + }, + "updated_at": { + "$ref": "#/definitions/generation/definitions/updated_at" + }, + "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" + } + } + } + }, + "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 - 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", + "null" + ] + }, + "certificates": { + "description": "Array of sso certificates belonging to this identity provider", + "readOnly": false, + "type": [ + "array" + ], + "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" + ] + }, + "certificate_create": { + "description": "Nested payload for creating associated certificate", + "readOnly": false, + "additionalProperties": false, + "type": [ + "object" + ], + "properties": { + "name": { + "$ref": "#/definitions/identity-provider-certificate/definitions/name" + }, + "body": { + "$ref": "#/definitions/identity-provider-certificate/definitions/body" + } + }, + "required": [ + "body" + ] + }, + "created_at": { + "description": "when provider record was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "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 this identity provider", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/identity-provider/definitions/id" + }, + { + "$ref": "#/definitions/identity-provider/definitions/name" + } + ] + }, + "name": { + "description": "user-friendly unique identifier for this identity provider", + "example": "acme-sso", + "readOnly": false, + "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" + ] + }, + "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" + ] + }, + "heroku_start_url": { + "description": "heroku start url", + "example": "https://sso.heroku.com/saml/acme-sso/init", + "readOnly": true, + "type": [ + "string" + ] + }, + "heroku_entity_id": { + "description": "heroku entity id", + "example": "https://sso.heroku.com/saml/acme-sso", + "readOnly": true, + "type": [ + "string" + ] + }, + "heroku_acs_url": { + "description": "heroku acs url", + "example": "https://sso.heroku.com/saml/acme-sso/finalize", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Info for an Identity Provider", + "href": "/identity-providers/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/identity-provider" + }, + "title": "Info" + }, + { + "description": "Create an Identity Provider", + "href": "/identity-providers", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "certificates": { + "$ref": "#/definitions/identity-provider/definitions/certificates" + }, + "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" + }, + "owner": { + "$ref": "#/definitions/identity-provider/definitions/owner" + }, + "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" + }, + "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": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/identity-provider" + }, + "title": "Update" + } + ], + "properties": { + "certificate": { + "$ref": "#/definitions/identity-provider/definitions/certificate" + }, + "certificates": { + "$ref": "#/definitions/identity-provider/definitions/certificates" + }, + "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" + }, + "name": { + "$ref": "#/definitions/identity-provider/definitions/name" + }, + "owner": { + "$ref": "#/definitions/identity-provider/definitions/owner" + }, + "slo_target_url": { + "$ref": "#/definitions/identity-provider/definitions/slo_target_url" + }, + "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" + } + } + }, + "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 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 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 a time (for Cedar-generation apps only)", + "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" + }, + "type": { + "$ref": "#/definitions/log-session/definitions/type" + }, + "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": "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": { + "id": { + "$ref": "#/definitions/oauth-client/definitions/id" + }, + "secret": { + "$ref": "#/definitions/oauth-client/definitions/secret" + } + } + } + }, + "required": [ + "client" + ], + "type": [ + "object" + ] + }, + "title": "Update" + }, + { + "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" + }, + "version": { + "$ref": "#/definitions/oauth-token/definitions/version" + } + }, + "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" + }, + "description": { + "$ref": "#/definitions/oauth-authorization/definitions/description" + }, + "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" + }, + "session": { + "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-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": "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" + ] + }, + "version": { + "description": "the version of the token", + "example": "1", + "readOnly": true, + "type": [ + "integer" + ] + } + }, + "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" + }, + "version": { + "$ref": "#/definitions/oauth-token/definitions/version" + } + }, + "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" + ] + } + } + }, + "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": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - OCI Images", + "type": [ + "object" + ], + "definitions": { + "id": { + "description": "unique identifier of the OCI image", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "digest": { + "description": "unique identifier representing the content of the OCI image", + "example": "sha256:dc14ae5fbc1e7230e0a782bf216fb46500e210631703bcc6bab8acf2c6a23f42", + "readOnly": false, + "type": [ + "string" + ] + }, + "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" + } + ] + }, + "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" + ] + }, + "base_top_layer": { + "description": "the digest of the top most layer of the base image.", + "example": "sha256:ea36ae5fbc1e7230e0a782bf216fb46500e210382703baa6bab8acf2c6a23f78", + "readOnly": false, + "type": [ + "string" + ] + }, + "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" + ] + }, + "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" + ] + } + }, + "example": { + "name": "web", + "display_cmd": "bundle exec puma -p $PORT", + "command": "/cnb/process/web", + "working_dir": "/workspace/webapp", + "default": true + }, + "type": [ + "object" + ] + }, + "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" + ] + }, + "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" + ] + } + }, + "example": { + "id": "heroku/ruby", + "version": "2.0.0", + "homepage": "https://github.com/heroku/buildpacks-ruby" + }, + "type": [ + "object" + ] + }, + "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" + }, + "name": { + "$ref": "#/definitions/stack/definitions/name", + "example": "cnb" + } + }, + "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": "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": "self", + "targetSchema": { + "items": { + "$ref": "#/definitions/oci-image" + }, + "type": [ + "array" + ] + }, + "title": "Info" + }, + { + "description": "Create an new OCI image of an app", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/oci-images", + "method": "POST", + "rel": "create", + "schema": { + "properties": { + "architecture": { + "$ref": "#/definitions/oci-image/definitions/architecture" + }, + "base_image_name": { + "$ref": "#/definitions/oci-image/definitions/base_image_name" + }, + "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" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/oci-image" + }, + "title": "Create" + } + ], + "properties": { + "id": { + "$ref": "#/definitions/oci-image/definitions/id" + }, + "base_image_name": { + "$ref": "#/definitions/oci-image/definitions/base_image_name" + }, + "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/oci-image/definitions/stack" + }, + "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/oci-image/definitions/updated_at" + }, + "architecture": { + "$ref": "#/definitions/oci-image/definitions/architecture" + } + } + }, + "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-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": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Peering Info", + "type": [ + "object" + ], + "definitions": { + "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, + "type": [ + "string" + ] + } + }, + "properties": { + "aws_account_id": { + "$ref": "#/definitions/peering/definitions/aws_account_id" + }, + "aws_region": { + "$ref": "#/definitions/peering-info/definitions/aws_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" + } + } + } + }, + "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 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" + ] + }, + "channel_name": { + "description": "channel to create the space on", + "example": "some-channel", + "readOnly": false, + "type": [ + "string" + ] + }, + "generation": { + "description": "generation for space", + "example": "fir", + "readOnly": false, + "type": [ + "string" + ] + }, + "features": { + "description": "runtime features for the space", + "example": "[feature-name]", + "readOnly": false, + "type": [ + "array" + ] + }, + "supported_features": { + "description": "supported api features for the space", + "example": "[api-feature-name]", + "readOnly": false, + "type": [ + "array" + ] + } + }, + "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" + }, + "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": [ + "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" + }, + "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" + ] + }, + "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" + ], + "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 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" + }, + "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" + } + }, + "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": "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": "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" + ] + }, + "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" + ] + }, + "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" + ] + } + }, + "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" + }, + "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" + }, + "type": { + "$ref": "#/definitions/team/definitions/type" + }, + "updated_at": { + "$ref": "#/definitions/team/definitions/updated_at" + } + } + }, + "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", + "stability": "prototype", + "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/telemetry-drain/definitions/id" + } + ] + }, + "created_at": { + "description": "when the telemetry drain was created", + "example": "2024-12-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "updated_at": { + "description": "when telemetry drain was last updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "signal": { + "description": "OpenTelemetry signal to be sent to the telemetry drain", + "readOnly": true, + "example": "traces", + "type": [ + "string" + ], + "enum": [ + "traces", + "metrics", + "logs" + ] + }, + "signals": { + "description": "OpenTelemetry signals to send to telemetry drain", + "example": [ + "traces", + "metrics" + ], + "readOnly": false, + "minItems": 1, + "uniqueItems": true, + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/telemetry-drain/definitions/signal" + } + }, + "exporter_type": { + "description": "the transport type to be used for your OpenTelemetry consumer", + "readOnly": true, + "example": "otlphttp", + "type": [ + "string" + ], + "enum": [ + "otlphttp", + "otlp" + ] + }, + "exporter_endpoint": { + "description": "URI of your OpenTelemetry consumer", + "readOnly": false, + "example": "https://api.otelproduct.example/consumer", + "maxLength": 1000, + "type": [ + "string" + ] + }, + "exporter_headers": { + "description": "JSON headers to send to your OpenTelemetry consumer", + "readOnly": false, + "example": { + "API-Key": "example_api_key_012345", + "Environment": "production" + }, + "default": {}, + "additionalProperties": false, + "maxItems": 20, + "patternProperties": { + "^[A-Za-z0-9\\-_]{1,100}$": { + "maxLength": 1000, + "type": [ + "string" + ] + } + }, + "type": [ + "object" + ] + }, + "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" + } + }, + "required": [ + "type", + "endpoint" + ], + "type": [ + "object" + ] + }, + "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" + ] + }, + "type": { + "description": "type of owner", + "enum": [ + "app", + "space" + ], + "example": "app", + "readOnly": true, + "type": [ + "string" + ] + } + }, + "readOnly": false, + "required": [ + "id", + "type" + ], + "type": [ + "object" + ] + } + }, + "links": [ + { + "description": "Create a telemetry drain.", + "href": "/telemetry-drains", + "method": "POST", + "rel": "create", + "schema": { + "additionalProperties": false, + "properties": { + "owner": { + "$ref": "#/definitions/telemetry-drain/definitions/owner" + }, + "signals": { + "$ref": "#/definitions/telemetry-drain/definitions/signals" + }, + "exporter": { + "$ref": "#/definitions/telemetry-drain/definitions/exporter" + } + }, + "required": [ + "owner", + "signals", + "exporter" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/telemetry-drain" + }, + "title": "Create" + }, + { + "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" + }, + "type": [ + "array" + ] + }, + "title": "List by App" + }, + { + "description": "List telemetry drains for a space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/telemetry-drains", + "method": "GET", + "rel": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/telemetry-drain" + }, + "type": [ + "array" + ] + }, + "title": "List by Space" + }, + { + "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" + } + }, + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/telemetry-drain" + }, + "title": "Update" + }, + { + "description": "Delete a telemetry drain.", + "href": "/telemetry-drains/{(%23%2Fdefinitions%2Ftelemetry-drain%2Fdefinitions%2Fidentity)}", + "method": "DELETE", + "rel": "destroy", + "targetSchema": { + "$ref": "#/definitions/telemetry-drain" + }, + "title": "Delete" + }, + { + "description": "Info for a telemetry drain.", + "href": "/telemetry-drains/{(%23%2Fdefinitions%2Ftelemetry-drain%2Fdefinitions%2Fidentity)}", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/telemetry-drain" + }, + "title": "Info" + } + ], + "properties": { + "created_at": { + "$ref": "#/definitions/telemetry-drain/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/telemetry-drain/definitions/id" + }, + "owner": { + "$ref": "#/definitions/telemetry-drain/definitions/owner" + }, + "signals": { + "$ref": "#/definitions/telemetry-drain/definitions/signals" + }, + "exporter": { + "$ref": "#/definitions/telemetry-drain/definitions/exporter" + }, + "updated_at": { + "$ref": "#/definitions/telemetry-drain/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" + } + ] + }, + "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" + ], + "definitions": { + "method": { + "description": "whether this SSO request is a GET or a POST", + "enum": [ + "get", + "post" + ], + "example": "get", + "readOnly": true, + "type": [ + "string" + ] + }, + "action": { + "description": "URL to follow to initiate single sign-on", + "example": "https://slowdb.heroku.com/heroku/resources/", + "format": "uri", + "readOnly": true, + "type": [ + "string" + ] + }, + "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": { + "description": "id of this add-on with its provider", + "example": "abcd1234", + "readOnly": true, + "type": [ + "string" + ] + }, + "token": { + "description": "token generated for this request that authenticates user", + "example": "0123456789abcdef0123456789abcdef01234578", + "readOnly": true, + "type": [ + "string" + ] + }, + "resource_id": { + "description": "unique identifier of add-on", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "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": [ + "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" + ] + }, + "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" + ] + }, + "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" + ] + }, + "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" + ] + }, + "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": { + "name": { + "$ref": "#/definitions/app/definitions/name" + }, + "id": { + "$ref": "#/definitions/app/definitions/id" + } + }, + "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" + } + } + }, + "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", + "stability": "prototype", + "title": "Heroku Platform API - Capability", + "type": [ + "object" + ], + "definitions": { + "capability": { + "description": "name of the capability", + "example": "manage_dynos", + "readOnly": true, + "type": [ + "string" + ] + }, + "resource_id": { + "description": "id or name of the resource", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "readOnly": true, + "type": [ + "null", + "string" + ] + }, + "resource_type": { + "description": "type of the resource", + "example": "app", + "readOnly": true, + "type": [ + "string" + ] + }, + "capable": { + "description": "whether the user has the capability on the resource_id of type resource_type", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "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": [ + "boolean" + ] + }, + "resource_canonical_id": { + "description": "canonical id of the resource if it's present", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "readOnly": true, + "type": [ + "string" + ] + }, + "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": [ + "object" + ] + } + }, + "links": [ + { + "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": { + "capabilities": { + "description": "The list of capabilities that you want to check", + "items": { + "$ref": "#/definitions/capability/definitions/capability-request" + }, + "type": [ + "array" + ] + } + }, + "required": [ + "capabilities" + ] + }, + "targetSchema": { + "type": [ + "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": { + "capability": { + "$ref": "#/definitions/capability/definitions/capability" + }, + "resource_id": { + "$ref": "#/definitions/capability/definitions/resource_id" + }, + "resource_type": { + "$ref": "#/definitions/capability/definitions/resource_type" + }, + "capable": { + "$ref": "#/definitions/capability/definitions/capable" + }, + "requires_second_factor": { + "$ref": "#/definitions/capability/definitions/requires_second_factor" + }, + "resource_canonical_id": { + "$ref": "#/definitions/capability/definitions/resource_canonical_id" + } + } + }, + "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": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Config Vars Settings", + "type": [ + "object" + ], + "definitions": { + "key": { + "description": "name of the config var", + "example": "FOO_TOKEN", + "readOnly": false, + "type": [ + "string" + ] + }, + "value": { + "description": "value of the config var", + "example": "bar", + "readOnly": false, + "type": [ + "string", + "null" + ] + }, + "masked": { + "description": "indicates if the value is masked", + "example": false, + "readOnly": false, + "type": [ + "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": "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": "instances", + "targetSchema": { + "items": { + "$ref": "#/definitions/config-vars-settings" + }, + "type": [ + "array" + ] + }, + "title": "List" + }, + { + "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": { + "strictProperties": false, + "properties": { + "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": { + "items": { + "$ref": "#/definitions/config-vars-settings" + } + } + } + ], + "properties": { + "attachment": { + "description": "attachment that created this config var, if any", + "properties": { + "id": { + "$ref": "#/definitions/add-on-attachment/definitions/id" + } + }, + "type": [ + "object", + "null" + ] + }, + "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" + } + } + }, + "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, + "type": [ + "object" + ], + "links": [ + { + "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": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/dyno-processes" + }, + "title": "Create" + } + ], + "properties": { + "attach_url": { + "$ref": "#/definitions/dyno/definitions/attach_url" + } + } + }, + "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", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Gateway Token", + "type": [ + "object" + ], + "definitions": { + "iss": { + "description": "Token issuer", + "example": "2012-01-01T12:00:00Z", + "format": "uri", + "readOnly": true, + "type": [ + "string" + ] + }, + "iat": { + "description": "Integer representation of the timestamp the token was issued at", + "example": 1526341325, + "readOnly": true, + "type": [ + "integer" + ] + }, + "exp": { + "description": "Integer representation of the timestamp the token should expire at", + "example": 1526341325, + "readOnly": true, + "type": [ + "integer" + ] + }, + "sub": { + "description": "Unique identifier of the subject", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "user_id": { + "description": "Unique identifier of the user", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "user_email": { + "description": "Email address of the user", + "example": "username@example.com", + "format": "email", + "readOnly": true, + "type": [ + "string" + ] + }, + "authorization_id": { + "description": "Unique identifier of the OAuth authirization used in the token", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "rate_limit_enabled": { + "description": "Indicates that a rate limit should be enforced", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "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" + ] + }, + "sudo": { + "description": "Describes if the token contains sudo claim", + "example": true, + "readOnly": true, + "type": [ + "boolean" + ] + }, + "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", + "null" + ] + }, + "sudo_reason": { + "description": "Reason for using sudo if present", + "example": "Ticket #123", + "readOnly": true, + "type": [ + "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": "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": { + "$ref": "#/definitions/gateway-token" + }, + "title": "Create" + }, + { + "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/oauth-token" + }, + "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" + ] + }, + "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" + ] + } + }, + "readOnly": false, + "required": [ + "id" + ], + "type": [ + "array" + ] + }, + "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" + }, + { + "$ref": "#/definitions/identity-provider/definitions/name" + } + ] + }, + "name": { + "description": "user-friendly unique identifier for this identity provider", + "example": "acme-sso", + "readOnly": false, + "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" + ] + }, + "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": "Migrate an Identity Provider", + "href": "/identity-providers/{(%23%2Fdefinitions%2Fidentity-provider%2Fdefinitions%2Fidentity)}/migrate", + "method": "POST", + "rel": "update", + "targetSchema": { + "$ref": "#/definitions/identity-provider" + }, + "title": "Update" + } + ], + "properties": { + "certificates": { + "$ref": "#/definitions/identity-provider/definitions/certificates" + }, + "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" + }, + "name": { + "$ref": "#/definitions/identity-provider/definitions/name" + }, + "owner": { + "$ref": "#/definitions/identity-provider/definitions/owner" + }, + "slo_target_url": { + "$ref": "#/definitions/identity-provider/definitions/slo_target_url" + }, + "sso_target_url": { + "$ref": "#/definitions/identity-provider/definitions/sso_target_url" + }, + "updated_at": { + "$ref": "#/definitions/identity-provider/definitions/updated_at" + } + } + }, + "identity-provider-certificate": { + "description": "Certificates represent an sso cert attached to an Identity Provider", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Certificates", + "type": [ + "object" + ], + "definitions": { + "created_at": { + "description": "when provider record was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "description": "unique identifier of this identity provider", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": true, + "type": [ + "string" + ] + }, + "name": { + "description": "label for certificate", + "example": "Certificate 1", + "readOnly": false, + "type": [ + "string", + "null" + ] + }, + "body": { + "description": "raw contents of the public certificate (eg: .crt or .pem file)", + "example": "-----BEGIN CERTIFICATE----- ...", + "readOnly": false, + "type": [ + "string" + ] + }, + "expires_at": { + "description": "time which the certificate expires", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "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": [ + "string" + ] + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/identity-provider-certificate/definitions/id" + } + ] + } + }, + "links": [ + { + "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": { + "$ref": "#/definitions/identity-provider-certificate" + }, + "schema": { + "properties": { + "name": { + "$ref": "#/definitions/identity-provider-certificate/definitions/name" + } + } + }, + "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": { + "name": { + "$ref": "#/definitions/identity-provider-certificate/definitions/name" + }, + "body": { + "$ref": "#/definitions/identity-provider-certificate/definitions/body" + }, + "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" + }, + "identity_provider_id": { + "$ref": "#/definitions/identity-provider-certificate/definitions/identity_provider_id" + } + } + }, + "payment-method": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "The on file payment method for an account", + "stability": "prototype", + "title": "Heroku Vault API - Payment Method", + "type": [ + "object" + ], + "definitions": { + "device_data": { + "type": [ + "string" + ], + "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", + "null" + ], + "description": "street address line 1", + "example": "40 Hickory Lane" + }, + "address_2": { + "type": [ + "string" + ], + "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" + }, + "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" + }, + { + "description": "Get the current payment method for an account.", + "href": "/account/payment-method", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/payment-method" + }, + "title": "get" + }, + { + "description": "Get the verified apps on the payment-method", + "href": "/account/payment-method/apps", + "method": "GET", + "rel": "self", + "targetSchema": { + "items": { + "$ref": "#/definitions/app" + }, + "type": [ + "array" + ] + } + } + ], + "properties": { + "address_1": { + "$ref": "#/definitions/payment-method/definitions/address_1" + }, + "address_2": { + "$ref": "#/definitions/payment-method/definitions/address_2" + }, + "card_last4": { + "$ref": "#/definitions/payment-method/definitions/card_last4" + }, + "card_type": { + "$ref": "#/definitions/payment-method/definitions/card_type" + }, + "city": { + "$ref": "#/definitions/payment-method/definitions/city" + }, + "country": { + "$ref": "#/definitions/payment-method/definitions/country" + }, + "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" + } + } + }, + "payment": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "A payment represents money collected for an account", + "title": "Heroku Vault API - Payments", + "stability": "prototype", + "type": [ + "object" + ], + "definitions": { + "account_id": { + "type": [ + "integer" + ], + "description": "account that payment belongs to", + "example": 8403923, + "readOnly": true + }, + "amount": { + "type": [ + "number" + ], + "description": "amount of payment in cents", + "example": 50000, + "readOnly": false + }, + "created_at": { + "description": "when payment was created", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "id": { + "type": [ + "integer" + ], + "description": "legacy unique identifier of payment", + "example": 9403943, + "readOnly": true + }, + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/payment/definitions/id" + } + ] + }, + "state": { + "enum": [ + "failure", + "pending", + "success" + ], + "type": [ + "string" + ], + "description": "state of the payment", + "example": "pending", + "readOnly": true + }, + "updated_at": { + "description": "when credit was updated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "uuid": { + "description": "unique identifier for a payment transaction", + "example": "01234567-89ab-cdef-0123-456789abcdef", + "format": "uuid", + "readOnly": false, + "type": [ + "string" + ] + } + }, + "links": [ + { + "description": "Create a payment on an existing account", + "href": "/account/payments", + "method": "POST", + "rel": "self", + "schema": { + "properties": { + "amount": { + "$ref": "#/definitions/payment/definitions/amount" + }, + "invoice_id": { + "$ref": "#/definitions/invoice/definitions/identity" + }, + "uuid": { + "$ref": "#/definitions/payment/definitions/uuid" + } + }, + "required": [ + "amount", + "invoice_id", + "uuid" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/payment" + }, + "title": "create" + }, + { + "description": "Create a payment on an existing team", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/payments", + "method": "POST", + "rel": "self", + "schema": { + "properties": { + "amount": { + "$ref": "#/definitions/payment/definitions/amount" + }, + "invoice_id": { + "$ref": "#/definitions/invoice/definitions/identity" + }, + "uuid": { + "$ref": "#/definitions/payment/definitions/uuid" + } + }, + "required": [ + "amount", + "invoice_id", + "uuid" + ], + "type": [ + "object" + ] + }, + "targetSchema": { + "$ref": "#/definitions/payment" + }, + "title": "create" + } + ], + "properties": { + "amount": { + "$ref": "#/definitions/payment/definitions/amount" + }, + "created_at": { + "$ref": "#/definitions/payment/definitions/created_at" + }, + "id": { + "$ref": "#/definitions/payment/definitions/id" + }, + "invoice": { + "description": "identity of invoice", + "properties": { + "id": { + "$ref": "#/definitions/invoice/definitions/id" + }, + "number": { + "$ref": "#/definitions/invoice/definitions/number" + } + }, + "type": [ + "null", + "object" + ] + }, + "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/account/definitions/id" + } + }, + "strictProperties": true, + "type": [ + "object" + ] + }, + "state": { + "$ref": "#/definitions/payment/definitions/state" + } + } + }, + "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": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Space Host", + "type": [ + "object" + ], + "definitions": { + "identity": { + "anyOf": [ + { + "$ref": "#/definitions/space-host/definitions/host_id" + } + ] + }, + "host_id": { + "description": "unique identifier of this host", + "example": "h-05abcdd96ee9ca123", + "readOnly": true, + "type": [ + "string" + ] + }, + "state": { + "description": "availability of this space", + "enum": [ + "available", + "under-assessment", + "permanent-failure", + "released", + "released-permanent-failure" + ], + "example": "available", + "readOnly": true, + "type": [ + "string" + ] + }, + "available_capacity_percentage": { + "description": "approximate available capacity on this host expresses a percentage", + "example": 67, + "readOnly": true, + "type": [ + "number" + ] + }, + "allocated_at": { + "description": "when the host was allocated", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string" + ] + }, + "released_at": { + "description": "when the host was released", + "example": "2012-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "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": "Current log drain for a space.", + "href": "/spaces/{(%23%2Fdefinitions%2Fspace%2Fdefinitions%2Fidentity)}/log-drain", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/log-drain" + }, + "title": "Info" + }, + { + "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": { + "url": { + "type": [ + "string" + ] + } + } + }, + "title": "Update" + } + ] + }, + "team-license": { + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "description": "A team license is credits provided and consumed by the team.", + "stability": "prototype", + "strictProperties": true, + "title": "Heroku Platform API - Team License", + "type": [ + "object" + ], + "definitions": { + "start_date": { + "description": "when license started", + "example": "2012-01-01", + "readOnly": true, + "type": [ + "string" + ] + }, + "end_date": { + "description": "when license ended", + "example": "2012-01-01", + "readOnly": true, + "type": [ + "string" + ] + }, + "qty": { + "description": "quantity of the license", + "example": 5, + "readOnly": true, + "type": [ + "integer" + ] + }, + "consumed": { + "description": "consumed quantity", + "example": 2, + "readOnly": true, + "type": [ + "integer" + ] + }, + "code": { + "description": "code of this license change", + "example": "add", + "readOnly": true, + "type": [ + "string" + ] + }, + "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" + }, + "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": [ + "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" + }, + "licenses": { + "description": "Licenses for this period.", + "type": [ + "array" + ], + "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" + ] + }, + "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" + ] + } + } + }, + "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_token": { + "$ref": "#/definitions/telemetry-ingress-info/definitions/id_token" + }, + "token_type": { + "$ref": "#/definitions/telemetry-ingress-info/definitions/token_type" + }, + "transports": { + "$ref": "#/definitions/telemetry-ingress-info/definitions/transports" + }, + "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" + } + } + }, + "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": [ + "object" + ], + "properties": { + "quantity": { + "$ref": "#/definitions/usage/definitions/addon_meter_quantity" + } + } + }, + "addon_meter_quantity": { + "description": "total meter units used", + "type": [ + "number" + ], + "example": 1000 + }, + "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" + } + } + } + }, + "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": "Retrieves usage for an app.\n", + "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fidentity)}/usage", + "method": "GET", + "rel": "instances", + "title": "Info", + "targetSchema": { + "$ref": "#/definitions/usage" + } + }, + { + "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": "instances", + "title": "Info", + "targetSchema": { + "$ref": "#/definitions/usage" + } + }, + { + "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/usage/definitions/apps" + } + } + ], + "properties": { + "addons": { + "description": "add-on usage in the app", + "type": [ + "array" + ], + "items": { + "$ref": "#/definitions/usage/definitions/addon" + } + } + } + } + }, + "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" + }, + "generation": { + "$ref": "#/definitions/generation" + }, + "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" + }, + "oci-image": { + "$ref": "#/definitions/oci-image" + }, + "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" + }, + "telemetry-drain": { + "$ref": "#/definitions/telemetry-drain" + }, + "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" + }, + "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.", + "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" +} \ 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 new file mode 100644 index 0000000..853ef0a --- /dev/null +++ b/src/index.ts @@ -0,0 +1,9997 @@ +/** + * + * [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; + /** + * 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 + */ + 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 SSO configuration of an Enterprise Account or Team. + */ +export interface IdentityProvider { + /** + * raw contents of the public certificate (eg: .crt or .pem file) + * + * @example "-----BEGIN CERTIFICATE----- ..." + */ + 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 + * + * @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; + /** + * when the identity provider is allowed to be used + */ + 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; +} +/** + * + * [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; + /** + * 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 + * + * @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; + /** + * 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 { + /** + * 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; + /** + * whether the user has enabled Eco dynos + */ + eco_dynos_enabled?: boolean; + /** + * whether pipeline cost consent was made + * + * @example "true" + */ + readonly pipeline_cost_consent?: boolean; +} +/** + * + * [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: { + readonly id: string; + 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: { + readonly id: string; + 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; + /** + * generations supported by this add-on + */ + supported_generations: Array<{ + readonly name?: string; + readonly id?: 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; + /** + * 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 + * + * @example "Ruby/Rack" + */ + readonly buildpack_provided_description: null | string; + /** + * buildpacks of the OCI image + */ + 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 + * + * @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; + /** + * whether this plan is billed per use + */ + readonly metered: 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; + /** + * whether this plan is billed per use + */ + readonly metered: boolean; + /** + * unit of price for plan + * + * @example "month" + */ + 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) + * 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 build artifacts + */ +export interface Build { + /** + * app that the build belongs to + */ + app?: BuildApp; + /** + * 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; + /** + * unique identifier of 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`). + * + * @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 (only applicable for Cedar-generation apps) + */ + 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; +} +/** + * + * 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; +} +/** + * + * 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; + /** + * generation for space + * + * @example "fir" + */ + generation: 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; + /** + * whether the enterprise account is part of the Salesforce Partner Program + */ + readonly partner_benefits: 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 (only applicable to Cedar-generation apps) + */ + buildpacks?: Array<{ + url?: string; + 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: BuildpackInstallationBuildpack; +} +/** + * + * buildpack + */ +export interface BuildpackInstallationBuildpack { + /** + * 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 { + /** + * 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 + */ + readonly cost: null | Record; + /** + * whether this dyno will be dedicated to one user + */ + readonly dedicated: boolean; + /** + * unit of consumption for Heroku Enterprise customers to 2 decimal places + * + * @example 0.28 + */ + readonly precise_dyno_units: number; + /** + * unique identifier of the dyno size + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * amount of RAM in GB + * + * @example 0.5 + */ + readonly memory: number; + /** + * name of the dyno size + * + * @example "eco" + */ + readonly name: string; + /** + * 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; +} +/** + * + * [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 - 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 { + /** + * 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 + */ + 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; + /** + * 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; + /** + * 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 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<{ + 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 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<{ + description?: string; + 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<{ + 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; +}>; + /** + * max 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; + /** + * 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 + * + * @example "Ruby/Rack" + */ + readonly buildpack_provided_description?: null | string; + /** + * buildpacks of the OCI image + */ + 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 + * + * @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; + /** + * dyno size + */ + dyno_size: FormationDynoSize; + /** + * unique identifier of this process type + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly id: string; + /** + * number of processes to maintain + * + * @example 1 + */ + quantity: number; + /** + * deprecated, refer to 'dyno_size' instead + * + * @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; +} +/** + * + * 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 "dyno_size". + */ + updates: FormationBatchUpdatePayloadUpdate[]; +} +/** + * + * Properties to update a process type + */ +export interface FormationBatchUpdatePayloadUpdate { + /** + * dyno size + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} + */ + dyno_size?: FormationBatchUpdatePayloadUpdateDynoSize; + /** + * number of processes to maintain + * + * @example 1 + */ + quantity?: number; + /** + * type of process to maintain + * + * @example "web" + */ + 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 { + /** + * 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; +} +/** + * + * [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 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 | 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 + * + * @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; + /** + * 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?: []; +} +/** + * + * [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 name to limit results to + * + * @example "'web.1' (Cedar-generation) or 'web-1234abcde-123ab' (Fir-generation)" + */ + dyno?: string; + /** + * 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 + */ + 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; + /** + * human-friendly description of this OAuth authorization + * + * @example "sample authorization" + */ + readonly description: 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[]; + /** + * this authorization's session + */ + readonly session: null | Session; + /** + * 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 "01234567-89ab-cdef-0123-456789abcdef" + */ + readonly token?: string; + /** + * the version of the token + * + * @example "1" + */ + readonly version?: number; +} +/** + * + * 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 "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 + */ +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[]; +} +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) + * 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: OauthTokenAccessToken; + /** + * 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: OauthTokenRefreshToken; + /** + * 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; +} +/** + * + * 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 + */ +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; +} +/** + * + * refresh token for this authorization + */ +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; +} +/** + * + * 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 "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) + * 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" + */ + 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; +} +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) + * 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<{ + email?: string; + readonly id?: string; + permissions?: string[]; +}>; +} +/** + * + * [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 PipelineBuild { + /** + * app that the build belongs to + */ + app: PipelineBuildApp; + /** + * 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; + /** + * 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: PipelineBuildSourceBlob; + /** + * release resulting from the build + * + * @example {"id":"01234567-89ab-cdef-0123-456789abcdef"} + */ + readonly release: null | BuildRelease; + /** + * 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; +} +/** + * + * [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 { + /** + * unique name of app + * + * @example "example" + */ + name?: string; + /** + * unique identifier of app + * + * @example "01234567-89ab-cdef-0123-456789abcdef" + */ + 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) + * 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<{ + 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-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) + * 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; +} +/** + * + * [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 + * + * @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 the OCI image or unique identifier representing the content of the OCI image + */ + oci_image?: 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?: []; + 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<{ + readonly id?: string; + readonly domains?: []; + 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; + /** + * 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; + /** + * 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[]; + /** + * max 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 - 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) + * 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[]; +} +/** + * + * [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 new file mode 100644 index 0000000..2e1b564 --- /dev/null +++ b/src/services/account-delinquency-service.ts @@ -0,0 +1,38 @@ +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.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/account-feature-service.ts b/src/services/account-feature-service.ts new file mode 100644 index 0000000..9271f26 --- /dev/null +++ b/src/services/account-feature-service.ts @@ -0,0 +1,101 @@ +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.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 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.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 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.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/account-service.ts b/src/services/account-service.ts new file mode 100644 index 0000000..06eeb9c --- /dev/null +++ b/src/services/account-service.ts @@ -0,0 +1,190 @@ +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.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 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.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 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.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 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.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 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.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 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.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-action-service.ts b/src/services/add-on-action-service.ts new file mode 100644 index 0000000..9751e38 --- /dev/null +++ b/src/services/add-on-action-service.ts @@ -0,0 +1,140 @@ +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.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 }); + } + /** + * 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.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 }); + } + /** + * 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 new file mode 100644 index 0000000..f85d98e --- /dev/null +++ b/src/services/add-on-attachment-service.ts @@ -0,0 +1,256 @@ +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.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 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.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 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.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 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.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 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.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 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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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-config-service.ts b/src/services/add-on-config-service.ts new file mode 100644 index 0000000..8a32320 --- /dev/null +++ b/src/services/add-on-config-service.ts @@ -0,0 +1,75 @@ +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.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 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.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-region-capability-service.ts b/src/services/add-on-region-capability-service.ts new file mode 100644 index 0000000..4b16665 --- /dev/null +++ b/src/services/add-on-region-capability-service.ts @@ -0,0 +1,101 @@ +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.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 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.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 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.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-service-service.ts b/src/services/add-on-service-service.ts new file mode 100644 index 0000000..71de6a4 --- /dev/null +++ b/src/services/add-on-service-service.ts @@ -0,0 +1,68 @@ +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.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 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.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-service.ts b/src/services/add-on-service.ts new file mode 100644 index 0000000..a364db6 --- /dev/null +++ b/src/services/add-on-service.ts @@ -0,0 +1,322 @@ +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.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 }); + } + /** + * 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.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 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.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 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.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 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.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 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.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 }); + } + /** + * 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.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 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.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 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.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 }); + } + /** + * 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.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-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 new file mode 100644 index 0000000..8b77575 --- /dev/null +++ b/src/services/add-on-webhook-delivery-service.ts @@ -0,0 +1,77 @@ +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.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 }); + } + /** + * 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.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-event-service.ts b/src/services/add-on-webhook-event-service.ts new file mode 100644 index 0000000..7b785ef --- /dev/null +++ b/src/services/add-on-webhook-event-service.ts @@ -0,0 +1,77 @@ +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.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 }); + } + /** + * 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.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-service.ts b/src/services/add-on-webhook-service.ts new file mode 100644 index 0000000..99af89b --- /dev/null +++ b/src/services/add-on-webhook-service.ts @@ -0,0 +1,175 @@ +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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 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.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 }); + } + /** + * 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.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/allowed-add-on-service-service.ts b/src/services/allowed-add-on-service-service.ts new file mode 100644 index 0000000..511f4ce --- /dev/null +++ b/src/services/allowed-add-on-service-service.ts @@ -0,0 +1,111 @@ +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.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 }); + } + /** + * 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.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 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.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/app-feature-service.ts b/src/services/app-feature-service.ts new file mode 100644 index 0000000..8156e61 --- /dev/null +++ b/src/services/app-feature-service.ts @@ -0,0 +1,109 @@ +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.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 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.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 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.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/app-service.ts b/src/services/app-service.ts new file mode 100644 index 0000000..d3cf4ac --- /dev/null +++ b/src/services/app-service.ts @@ -0,0 +1,283 @@ +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.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 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.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 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.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 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.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 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.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 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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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/app-setup-service.ts b/src/services/app-setup-service.ts new file mode 100644 index 0000000..f2e7519 --- /dev/null +++ b/src/services/app-setup-service.ts @@ -0,0 +1,73 @@ +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.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 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.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/app-transfer-service.ts b/src/services/app-transfer-service.ts new file mode 100644 index 0000000..2def661 --- /dev/null +++ b/src/services/app-transfer-service.ts @@ -0,0 +1,163 @@ +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.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 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.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 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.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 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.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 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.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/app-webhook-delivery-service.ts b/src/services/app-webhook-delivery-service.ts new file mode 100644 index 0000000..d6bf765 --- /dev/null +++ b/src/services/app-webhook-delivery-service.ts @@ -0,0 +1,77 @@ +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.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 }); + } + /** + * 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.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/app-webhook-event-service.ts b/src/services/app-webhook-event-service.ts new file mode 100644 index 0000000..6c0763b --- /dev/null +++ b/src/services/app-webhook-event-service.ts @@ -0,0 +1,77 @@ +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.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 }); + } + /** + * 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.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/app-webhook-service.ts b/src/services/app-webhook-service.ts new file mode 100644 index 0000000..5e0a1f0 --- /dev/null +++ b/src/services/app-webhook-service.ts @@ -0,0 +1,175 @@ +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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 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.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 }); + } + /** + * 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.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/archive-service.ts b/src/services/archive-service.ts new file mode 100644 index 0000000..aaa9b99 --- /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.sdk' + } + }); + } + /** + * 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.sdk' + } + }); + } +} diff --git a/src/services/audit-trail-event-service.ts b/src/services/audit-trail-event-service.ts new file mode 100644 index 0000000..bf85a1d --- /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.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 new file mode 100644 index 0000000..087f1e3 --- /dev/null +++ b/src/services/build-service.ts @@ -0,0 +1,158 @@ +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 build artifacts + */ +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.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 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.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 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.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 }); + } + /** + * 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.sdk', + '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.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/buildpack-installation-service.ts b/src/services/buildpack-installation-service.ts new file mode 100644 index 0000000..3bf861b --- /dev/null +++ b/src/services/buildpack-installation-service.ts @@ -0,0 +1,75 @@ +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.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 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.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/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 new file mode 100644 index 0000000..9b55bfa --- /dev/null +++ b/src/services/collaborator-service.ts @@ -0,0 +1,146 @@ +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.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 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.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 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.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 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.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/config-var-service.ts b/src/services/config-var-service.ts new file mode 100644 index 0000000..6a6cdeb --- /dev/null +++ b/src/services/config-var-service.ts @@ -0,0 +1,109 @@ +/** + * [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.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 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.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 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.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/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 new file mode 100644 index 0000000..4474388 --- /dev/null +++ b/src/services/credit-service.ts @@ -0,0 +1,99 @@ +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.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 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.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 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.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/domain-service.ts b/src/services/domain-service.ts new file mode 100644 index 0000000..e63d2c7 --- /dev/null +++ b/src/services/domain-service.ts @@ -0,0 +1,175 @@ +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.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 }); + } + /** + * 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.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 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.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 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.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 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.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/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 new file mode 100644 index 0000000..c196460 --- /dev/null +++ b/src/services/dyno-service.ts @@ -0,0 +1,275 @@ +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.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 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.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>; + } + 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. + * + * @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.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 }); + } + /** + * 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.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 }); + } + /** + * 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. + * + * @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.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 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.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/dyno-size-service.ts b/src/services/dyno-size-service.ts new file mode 100644 index 0000000..6cfc57e --- /dev/null +++ b/src/services/dyno-size-service.ts @@ -0,0 +1,98 @@ +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 the dyno size or name of the 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.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 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.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 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 new file mode 100644 index 0000000..13eae68 --- /dev/null +++ b/src/services/enterprise-account-daily-usage-service.ts @@ -0,0 +1,45 @@ +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.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-member-service.ts b/src/services/enterprise-account-member-service.ts new file mode 100644 index 0000000..255dcc7 --- /dev/null +++ b/src/services/enterprise-account-member-service.ts @@ -0,0 +1,149 @@ +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.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 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.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 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.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 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.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/enterprise-account-monthly-usage-service.ts b/src/services/enterprise-account-monthly-usage-service.ts new file mode 100644 index 0000000..0a21a80 --- /dev/null +++ b/src/services/enterprise-account-monthly-usage-service.ts @@ -0,0 +1,45 @@ +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.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-service.ts b/src/services/enterprise-account-service.ts new file mode 100644 index 0000000..efdb12b --- /dev/null +++ b/src/services/enterprise-account-service.ts @@ -0,0 +1,101 @@ +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.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 }); + } + /** + * 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.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 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.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/filter-apps-service.ts b/src/services/filter-apps-service.ts new file mode 100644 index 0000000..982e6f9 --- /dev/null +++ b/src/services/filter-apps-service.ts @@ -0,0 +1,43 @@ +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.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/formation-service.ts b/src/services/formation-service.ts new file mode 100644 index 0000000..013d772 --- /dev/null +++ b/src/services/formation-service.ts @@ -0,0 +1,142 @@ +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.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 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.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 }); + } + /** + * 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.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 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.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/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 new file mode 100644 index 0000000..11e0165 --- /dev/null +++ b/src/services/identity-provider-service.ts @@ -0,0 +1,106 @@ +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 SSO configuration of an Enterprise Account or Team. + */ +export default class IdentityProviderService { + public constructor( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * Info for 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 info( + identityProviderIdentity: string, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/identity-providers/${identityProviderIdentity}`, { + ...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 Identity Provider + * + * @param payload Object to send to the endpoint. + * @param requestInit The initializer for the request. + */ + public async create( + payload: Heroku.IdentityProviderCreatePayload, + requestInit: Omit = {} + ): Promise { + 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.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 an Identity Provider + * + * @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 update( + identityProviderIdentity: string, + payload: Heroku.IdentityProviderUpdatePayload, + requestInit: Omit = {} + ): Promise { + 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; + } + 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/inbound-ruleset-service.ts b/src/services/inbound-ruleset-service.ts new file mode 100644 index 0000000..46b131b --- /dev/null +++ b/src/services/inbound-ruleset-service.ts @@ -0,0 +1,140 @@ +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.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 }); + } + /** + * 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.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 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.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 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.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/index.ts b/src/services/index.ts new file mode 100644 index 0000000..f1652de --- /dev/null +++ b/src/services/index.ts @@ -0,0 +1,114 @@ +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 './generation-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 './oci-image-service'; +export * from './password-reset-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 './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 new file mode 100644 index 0000000..89726b9 --- /dev/null +++ b/src/services/invoice-address-service.ts @@ -0,0 +1,69 @@ +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.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 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.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/invoice-service.ts b/src/services/invoice-service.ts new file mode 100644 index 0000000..501ea0f --- /dev/null +++ b/src/services/invoice-service.ts @@ -0,0 +1,68 @@ +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.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 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.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/key-service.ts b/src/services/key-service.ts new file mode 100644 index 0000000..8979d19 --- /dev/null +++ b/src/services/key-service.ts @@ -0,0 +1,65 @@ +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.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 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.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/log-drain-service.ts b/src/services/log-drain-service.ts new file mode 100644 index 0000000..57ed0d6 --- /dev/null +++ b/src/services/log-drain-service.ts @@ -0,0 +1,208 @@ +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.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 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.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 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.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 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.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 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.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 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.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/log-session-service.ts b/src/services/log-session-service.ts new file mode 100644 index 0000000..0fba203 --- /dev/null +++ b/src/services/log-session-service.ts @@ -0,0 +1,45 @@ +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.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/oauth-authorization-service.ts b/src/services/oauth-authorization-service.ts new file mode 100644 index 0000000..ebcd4cd --- /dev/null +++ b/src/services/oauth-authorization-service.ts @@ -0,0 +1,197 @@ +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.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 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.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 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.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 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. + * + * @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.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 }); + } + /** + * 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.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/oauth-client-service.ts b/src/services/oauth-client-service.ts new file mode 100644 index 0000000..5420f78 --- /dev/null +++ b/src/services/oauth-client-service.ts @@ -0,0 +1,187 @@ +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.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 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.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 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.sdk' + } + }); + } + /** + * 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.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 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.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 }); + } + /** + * 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.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/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..776379a --- /dev/null +++ b/src/services/oauth-token-service.ts @@ -0,0 +1,74 @@ +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.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 }); + } + /** + * 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.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/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 new file mode 100644 index 0000000..3075635 --- /dev/null +++ b/src/services/password-reset-service.ts @@ -0,0 +1,80 @@ +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.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 }); + } + /** + * 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.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/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-service.ts b/src/services/peering-service.ts new file mode 100644 index 0000000..340981d --- /dev/null +++ b/src/services/peering-service.ts @@ -0,0 +1,139 @@ +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-vpc-peering?preview=1) 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 + ) {} + + /** + * 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.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 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.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 }); + } + /** + * Accept a pending peering connection with 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 accept( + spaceIdentity: string, + payload: Heroku.PeeringAcceptPayload, + requestInit: Omit = {} + ): Promise { + const response = await this.fetchImpl(`${this.endpoint}/spaces/${spaceIdentity}/peerings`, { + ...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 }); + } + /** + * 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.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/permission-entity-service.ts b/src/services/permission-entity-service.ts new file mode 100644 index 0000000..b39bbcf --- /dev/null +++ b/src/services/permission-entity-service.ts @@ -0,0 +1,42 @@ +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.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/pipeline-build-service.ts b/src/services/pipeline-build-service.ts new file mode 100644 index 0000000..5ecc80d --- /dev/null +++ b/src/services/pipeline-build-service.ts @@ -0,0 +1,43 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [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 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.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/pipeline-config-var-service.ts b/src/services/pipeline-config-var-service.ts new file mode 100644 index 0000000..9d240fd --- /dev/null +++ b/src/services/pipeline-config-var-service.ts @@ -0,0 +1,88 @@ +/** + * [Heroku Platform API - Pipeline Config Vars](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 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.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 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.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/pipeline-coupling-service.ts b/src/services/pipeline-coupling-service.ts new file mode 100644 index 0000000..2122cd9 --- /dev/null +++ b/src/services/pipeline-coupling-service.ts @@ -0,0 +1,282 @@ +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.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 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.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 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.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 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.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 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.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 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.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 }); + } + /** + * 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.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 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.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 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.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/pipeline-deployment-service.ts b/src/services/pipeline-deployment-service.ts new file mode 100644 index 0000000..2598775 --- /dev/null +++ b/src/services/pipeline-deployment-service.ts @@ -0,0 +1,43 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [Heroku Platform API - Pipeline Deployment](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-deployment) + * 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( + protected readonly fetchImpl: typeof fetch, + protected readonly endpoint: string + ) {} + + /** + * 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". + * @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.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/pipeline-promotion-service.ts b/src/services/pipeline-promotion-service.ts new file mode 100644 index 0000000..93bebbd --- /dev/null +++ b/src/services/pipeline-promotion-service.ts @@ -0,0 +1,73 @@ +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.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 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.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/pipeline-promotion-target-service.ts b/src/services/pipeline-promotion-target-service.ts new file mode 100644 index 0000000..e7071ad --- /dev/null +++ b/src/services/pipeline-promotion-target-service.ts @@ -0,0 +1,46 @@ +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.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/pipeline-release-service.ts b/src/services/pipeline-release-service.ts new file mode 100644 index 0000000..182a6b5 --- /dev/null +++ b/src/services/pipeline-release-service.ts @@ -0,0 +1,43 @@ +import * as Heroku from '@heroku-cli/schema'; +/** + * [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 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.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/pipeline-service.ts b/src/services/pipeline-service.ts new file mode 100644 index 0000000..ab347fb --- /dev/null +++ b/src/services/pipeline-service.ts @@ -0,0 +1,165 @@ +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.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 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.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 }); + } + /** + * 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.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 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.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 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.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/pipeline-stack-service.ts b/src/services/pipeline-stack-service.ts new file mode 100644 index 0000000..a11fea2 --- /dev/null +++ b/src/services/pipeline-stack-service.ts @@ -0,0 +1,43 @@ +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.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/pipeline-transfer-service.ts b/src/services/pipeline-transfer-service.ts new file mode 100644 index 0000000..befbe84 --- /dev/null +++ b/src/services/pipeline-transfer-service.ts @@ -0,0 +1,43 @@ +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.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/plan-service.ts b/src/services/plan-service.ts new file mode 100644 index 0000000..24860b9 --- /dev/null +++ b/src/services/plan-service.ts @@ -0,0 +1,107 @@ +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.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 }); + } + /** + * 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.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 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.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/rate-limit-service.ts b/src/services/rate-limit-service.ts new file mode 100644 index 0000000..a64a209 --- /dev/null +++ b/src/services/rate-limit-service.ts @@ -0,0 +1,38 @@ +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.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/region-service.ts b/src/services/region-service.ts new file mode 100644 index 0000000..1f2e791 --- /dev/null +++ b/src/services/region-service.ts @@ -0,0 +1,68 @@ +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.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 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.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/release-service.ts b/src/services/release-service.ts new file mode 100644 index 0000000..f3b8ce0 --- /dev/null +++ b/src/services/release-service.ts @@ -0,0 +1,140 @@ +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.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 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.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 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.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 }); + } + /** + * 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.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/review-app-config-service.ts b/src/services/review-app-config-service.ts new file mode 100644 index 0000000..67b3b23 --- /dev/null +++ b/src/services/review-app-config-service.ts @@ -0,0 +1,143 @@ +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.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 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.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 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.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 }); + } + /** + * 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.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/review-app-service.ts b/src/services/review-app-service.ts new file mode 100644 index 0000000..098c1cb --- /dev/null +++ b/src/services/review-app-service.ts @@ -0,0 +1,165 @@ +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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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 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.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 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.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/slug-service.ts b/src/services/slug-service.ts new file mode 100644 index 0000000..dfb467d --- /dev/null +++ b/src/services/slug-service.ts @@ -0,0 +1,77 @@ +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.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 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.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/sms-number-service.ts b/src/services/sms-number-service.ts new file mode 100644 index 0000000..3f4b514 --- /dev/null +++ b/src/services/sms-number-service.ts @@ -0,0 +1,104 @@ +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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.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/sni-endpoint-service.ts b/src/services/sni-endpoint-service.ts new file mode 100644 index 0000000..ed6a188 --- /dev/null +++ b/src/services/sni-endpoint-service.ts @@ -0,0 +1,175 @@ +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.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 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.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 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.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 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.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 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.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/source-service.ts b/src/services/source-service.ts new file mode 100644 index 0000000..8afdebc --- /dev/null +++ b/src/services/source-service.ts @@ -0,0 +1,70 @@ +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.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 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.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-app-access-service.ts b/src/services/space-app-access-service.ts new file mode 100644 index 0000000..3919f2d --- /dev/null +++ b/src/services/space-app-access-service.ts @@ -0,0 +1,109 @@ +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.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 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.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 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.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-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 new file mode 100644 index 0000000..674bcda --- /dev/null +++ b/src/services/space-nat-service.ts @@ -0,0 +1,42 @@ +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.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-service.ts b/src/services/space-service.ts new file mode 100644 index 0000000..60bb931 --- /dev/null +++ b/src/services/space-service.ts @@ -0,0 +1,163 @@ +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.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 }); + } + /** + * 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.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 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.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 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.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 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.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-topology-service.ts b/src/services/space-topology-service.ts new file mode 100644 index 0000000..50ad90f --- /dev/null +++ b/src/services/space-topology-service.ts @@ -0,0 +1,42 @@ +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.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-transfer-service.ts b/src/services/space-transfer-service.ts new file mode 100644 index 0000000..0eadb30 --- /dev/null +++ b/src/services/space-transfer-service.ts @@ -0,0 +1,45 @@ +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.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/stack-service.ts b/src/services/stack-service.ts new file mode 100644 index 0000000..b452dda --- /dev/null +++ b/src/services/stack-service.ts @@ -0,0 +1,98 @@ +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.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 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.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 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 new file mode 100644 index 0000000..736d0db --- /dev/null +++ b/src/services/team-add-on-service.ts @@ -0,0 +1,42 @@ +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.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-app-collaborator-service.ts b/src/services/team-app-collaborator-service.ts new file mode 100644 index 0000000..21a01e0 --- /dev/null +++ b/src/services/team-app-collaborator-service.ts @@ -0,0 +1,188 @@ +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.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 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.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 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.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 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.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 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.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-app-permission-service.ts b/src/services/team-app-permission-service.ts new file mode 100644 index 0000000..42e8fcd --- /dev/null +++ b/src/services/team-app-permission-service.ts @@ -0,0 +1,38 @@ +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.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-app-service.ts b/src/services/team-app-service.ts new file mode 100644 index 0000000..5fca449 --- /dev/null +++ b/src/services/team-app-service.ts @@ -0,0 +1,196 @@ +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.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 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.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 }); + } + /** + * 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.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 }); + } + /** + * 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.sdk', + '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.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 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.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-daily-usage-service.ts b/src/services/team-daily-usage-service.ts new file mode 100644 index 0000000..4121112 --- /dev/null +++ b/src/services/team-daily-usage-service.ts @@ -0,0 +1,45 @@ +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.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-delinquency-service.ts b/src/services/team-delinquency-service.ts new file mode 100644 index 0000000..75efea4 --- /dev/null +++ b/src/services/team-delinquency-service.ts @@ -0,0 +1,42 @@ +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.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-feature-service.ts b/src/services/team-feature-service.ts new file mode 100644 index 0000000..d72477b --- /dev/null +++ b/src/services/team-feature-service.ts @@ -0,0 +1,74 @@ +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.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 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.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-invitation-service.ts b/src/services/team-invitation-service.ts new file mode 100644 index 0000000..c0985cf --- /dev/null +++ b/src/services/team-invitation-service.ts @@ -0,0 +1,175 @@ +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.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 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.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 }); + } + /** + * 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.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 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.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 }); + } + /** + * 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.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/team-invoice-service.ts b/src/services/team-invoice-service.ts new file mode 100644 index 0000000..a9b5e59 --- /dev/null +++ b/src/services/team-invoice-service.ts @@ -0,0 +1,74 @@ +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.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 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.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-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 new file mode 100644 index 0000000..311cebd --- /dev/null +++ b/src/services/team-member-service.ts @@ -0,0 +1,206 @@ +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.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 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.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 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.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 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.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 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.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 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.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-monthly-usage-service.ts b/src/services/team-monthly-usage-service.ts new file mode 100644 index 0000000..f5adf24 --- /dev/null +++ b/src/services/team-monthly-usage-service.ts @@ -0,0 +1,45 @@ +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.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-preferences-service.ts b/src/services/team-preferences-service.ts new file mode 100644 index 0000000..792fd76 --- /dev/null +++ b/src/services/team-preferences-service.ts @@ -0,0 +1,75 @@ +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.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 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.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/team-service.ts b/src/services/team-service.ts new file mode 100644 index 0000000..dc28733 --- /dev/null +++ b/src/services/team-service.ts @@ -0,0 +1,226 @@ +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.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 }); + } + /** + * 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.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 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.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 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.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 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.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 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.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 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.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/team-space-service.ts b/src/services/team-space-service.ts new file mode 100644 index 0000000..d3a3e95 --- /dev/null +++ b/src/services/team-space-service.ts @@ -0,0 +1,42 @@ +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.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-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 new file mode 100644 index 0000000..347dc83 --- /dev/null +++ b/src/services/test-case-service.ts @@ -0,0 +1,41 @@ +/** + * [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.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-node-service.ts b/src/services/test-node-service.ts new file mode 100644 index 0000000..908de72 --- /dev/null +++ b/src/services/test-node-service.ts @@ -0,0 +1,41 @@ +/** + * [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.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-run-service.ts b/src/services/test-run-service.ts new file mode 100644 index 0000000..49aede8 --- /dev/null +++ b/src/services/test-run-service.ts @@ -0,0 +1,127 @@ +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.sdk', + '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.sdk' + } + }); + } + /** + * 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.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 }); + } + /** + * 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.sdk' + } + }); + } + /** + * 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.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 new file mode 100644 index 0000000..e1e6f7f --- /dev/null +++ b/src/services/user-preferences-service.ts @@ -0,0 +1,75 @@ +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.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 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.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/vpn-connection-service.ts b/src/services/vpn-connection-service.ts new file mode 100644 index 0000000..d98fb22 --- /dev/null +++ b/src/services/vpn-connection-service.ts @@ -0,0 +1,184 @@ +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.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 }); + } + /** + * 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.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 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.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 }); + } + /** + * 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.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 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.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/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==