* chore: 🤖 add @openapitools/openapi-generator-cli * chore: 🤖 Add @nestjs/core and @openapitools/openapi-generator-cli to ignoredBuiltDependencies These packages use postinstall for a opencollective notice * chore: 🤖 add package.json scripts for open-api client gen * chore: 🤖 add openapi generated files * chore: 🤖 add boundary api client fixture * chore: 🤖 incorporate api client fixture with base fixture * chore: 🤖 migrate existing test to use boundary api fixture * refactor: 💡 remove org cleanup from test * refactor: 💡 update sorting e2e test to use api client * refactor: 💡 clean up api client resource clean up logging * docs: ✏️ update jsdoc links for domain clients * chore: 🤖 avoid adding copywright headers to generated api * Add missing copyright headers * chore: 🤖 remove fetch argument from api client class The hope was to use request.fetch but playwright's fetch is a non-standard fetch which causes the generated api client to fail when using .clone() on the response * chore: 🤖 add optional OPENAPI_SWAGGER_URL_OR_FILE for openapi-client generation The OPENAPI_SWAGGER_URL_OR_FILE env var can be used to specify the -i flag the generate:api-client script with either: * a relative path * an absolute path * a url like: https://raw.githubusercontent.com/hashicorp/boundary/refs/heads/main/internal/gen/controller.swagger.json * refactor: 💡 clean up and refactor boundary-api-client fixture * chore: 🤖 add extra doc links and delete methods * test: 💍 add test to ensure that api-client fixture works * test: 💍 update existing e2e test examples with api-client * docs: ✏️ add comment for api-client e2e test * docs: ✏️ add additional links to service docs for api clients * refactor: 💡 cleanup api-client and corresponding test * docs: ✏️ add api client fixture docs to e2e README * fix: 🐛 fix regex * remove unnecessary capture group * add "-" to regex to allow for url segments like "storage-buckets" in "/v1/storage-buckets" * docs: ✏️ comment potential edge case in e2e api client cleanup * docs: ✏️ fix comment typo Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com> * docs: ✏️ remove auth flag for generating e2e client * docs: ✏️ add mention that java is required for generate:api * chore: 🤖 implement pr feedback * chore: 🤖 Clean up api client and add more extensive test * chore: 🤖 fix casing in api-client test Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com> --------- Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
257 lines
15 KiB
TypeScript
257 lines
15 KiB
TypeScript
/* tslint:disable */
|
|
/* eslint-disable */
|
|
/**
|
|
* Boundary controller HTTP API
|
|
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
|
*
|
|
* The version of the OpenAPI document: 0.19.0
|
|
*
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
import { mapValues } from '../runtime';
|
|
import type { ControllerApiResourcesSessionrecordingsV1ValuesAtTime } from './ControllerApiResourcesSessionrecordingsV1ValuesAtTime';
|
|
import {
|
|
ControllerApiResourcesSessionrecordingsV1ValuesAtTimeFromJSON,
|
|
ControllerApiResourcesSessionrecordingsV1ValuesAtTimeFromJSONTyped,
|
|
ControllerApiResourcesSessionrecordingsV1ValuesAtTimeToJSON,
|
|
ControllerApiResourcesSessionrecordingsV1ValuesAtTimeToJSONTyped,
|
|
} from './ControllerApiResourcesSessionrecordingsV1ValuesAtTime';
|
|
import type { ControllerApiResourcesSessionrecordingsV1ConnectionRecording } from './ControllerApiResourcesSessionrecordingsV1ConnectionRecording';
|
|
import {
|
|
ControllerApiResourcesSessionrecordingsV1ConnectionRecordingFromJSON,
|
|
ControllerApiResourcesSessionrecordingsV1ConnectionRecordingFromJSONTyped,
|
|
ControllerApiResourcesSessionrecordingsV1ConnectionRecordingToJSON,
|
|
ControllerApiResourcesSessionrecordingsV1ConnectionRecordingToJSONTyped,
|
|
} from './ControllerApiResourcesSessionrecordingsV1ConnectionRecording';
|
|
import type { ControllerApiResourcesScopesV1ScopeInfo } from './ControllerApiResourcesScopesV1ScopeInfo';
|
|
import {
|
|
ControllerApiResourcesScopesV1ScopeInfoFromJSON,
|
|
ControllerApiResourcesScopesV1ScopeInfoFromJSONTyped,
|
|
ControllerApiResourcesScopesV1ScopeInfoToJSON,
|
|
ControllerApiResourcesScopesV1ScopeInfoToJSONTyped,
|
|
} from './ControllerApiResourcesScopesV1ScopeInfo';
|
|
|
|
/**
|
|
* SessionRecording contains information about the recording of a Session.
|
|
* @export
|
|
* @interface ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
export interface ControllerApiResourcesSessionrecordingsV1SessionRecording {
|
|
/**
|
|
* The ID of the Session recording.
|
|
* @type {string}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
id?: string;
|
|
/**
|
|
*
|
|
* @type {ControllerApiResourcesScopesV1ScopeInfo}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
scope?: ControllerApiResourcesScopesV1ScopeInfo;
|
|
/**
|
|
* The ID of the Session which this Session Recording recorded.
|
|
* @type {string}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
sessionId?: string;
|
|
/**
|
|
* The ID of the Storage Bucket for the Target of this Session Recording.
|
|
* @type {string}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
storageBucketId?: string;
|
|
/**
|
|
* The total number of bytes uploaded from the client in the Session.
|
|
* This includes all bytes uploaded over all Connections, including
|
|
* any protocol overhead.
|
|
* @type {string}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
bytesUp?: string;
|
|
/**
|
|
* The total number of bytes downloaded to the client in the Session.
|
|
* This includes all bytes downloaded over all Connections, including
|
|
* any protocol overhead.
|
|
* @type {string}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
bytesDown?: string;
|
|
/**
|
|
* The time the Session Recording was created in the controller.
|
|
* @type {Date}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
createdTime?: Date;
|
|
/**
|
|
* The time of the most recent update to the Session Recording.
|
|
* @type {Date}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
updatedTime?: Date;
|
|
/**
|
|
* The time the Session started.
|
|
* @type {Date}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
startTime?: Date;
|
|
/**
|
|
* The time the Session ended.
|
|
* @type {Date}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
endTime?: Date;
|
|
/**
|
|
* The total duration of the Session.
|
|
* @type {string}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
duration?: string;
|
|
/**
|
|
* Type of the Session that was recorded (e.g. ssh).
|
|
* @type {string}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
type?: string;
|
|
/**
|
|
* The current state of the session recording. One of
|
|
* "started", "available" and "unknown".
|
|
* @type {string}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
state?: string;
|
|
/**
|
|
* Any error seen during the closing of the session recording.
|
|
* Currently only set if state is "unknown".
|
|
* @type {string}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
errorDetails?: string;
|
|
/**
|
|
* MimeTypes define the mime types that can
|
|
* be used to consume the recording of this Session.
|
|
* No mime types are currently supported.
|
|
* @type {Array<string>}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
mimeTypes?: Array<string>;
|
|
/**
|
|
* The endpoint of the Session; that is, the address to which the egress worker connected.
|
|
* @type {string}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
endpoint?: string;
|
|
/**
|
|
* The recordings of the connections that were created in the Session.
|
|
* This field may be unset when listing Session recordings.
|
|
* @type {Array<ControllerApiResourcesSessionrecordingsV1ConnectionRecording>}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
connectionRecordings?: Array<ControllerApiResourcesSessionrecordingsV1ConnectionRecording>;
|
|
/**
|
|
*
|
|
* @type {ControllerApiResourcesSessionrecordingsV1ValuesAtTime}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
createTimeValues?: ControllerApiResourcesSessionrecordingsV1ValuesAtTime;
|
|
/**
|
|
* The available actions on this resource for this user.
|
|
* @type {Array<string>}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
authorizedActions?: Array<string>;
|
|
/**
|
|
* The time until a session recording is required to be stored.
|
|
* @type {Date}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
retainUntil?: Date;
|
|
/**
|
|
* The time a session recording is scheduled to be automatically deleted.
|
|
* @type {Date}
|
|
* @memberof ControllerApiResourcesSessionrecordingsV1SessionRecording
|
|
*/
|
|
deleteAfter?: Date;
|
|
}
|
|
|
|
/**
|
|
* Check if a given object implements the ControllerApiResourcesSessionrecordingsV1SessionRecording interface.
|
|
*/
|
|
export function instanceOfControllerApiResourcesSessionrecordingsV1SessionRecording(value: object): value is ControllerApiResourcesSessionrecordingsV1SessionRecording {
|
|
return true;
|
|
}
|
|
|
|
export function ControllerApiResourcesSessionrecordingsV1SessionRecordingFromJSON(json: any): ControllerApiResourcesSessionrecordingsV1SessionRecording {
|
|
return ControllerApiResourcesSessionrecordingsV1SessionRecordingFromJSONTyped(json, false);
|
|
}
|
|
|
|
export function ControllerApiResourcesSessionrecordingsV1SessionRecordingFromJSONTyped(json: any, ignoreDiscriminator: boolean): ControllerApiResourcesSessionrecordingsV1SessionRecording {
|
|
if (json == null) {
|
|
return json;
|
|
}
|
|
return {
|
|
|
|
'id': json['id'] == null ? undefined : json['id'],
|
|
'scope': json['scope'] == null ? undefined : ControllerApiResourcesScopesV1ScopeInfoFromJSON(json['scope']),
|
|
'sessionId': json['session_id'] == null ? undefined : json['session_id'],
|
|
'storageBucketId': json['storage_bucket_id'] == null ? undefined : json['storage_bucket_id'],
|
|
'bytesUp': json['bytes_up'] == null ? undefined : json['bytes_up'],
|
|
'bytesDown': json['bytes_down'] == null ? undefined : json['bytes_down'],
|
|
'createdTime': json['created_time'] == null ? undefined : (new Date(json['created_time'])),
|
|
'updatedTime': json['updated_time'] == null ? undefined : (new Date(json['updated_time'])),
|
|
'startTime': json['start_time'] == null ? undefined : (new Date(json['start_time'])),
|
|
'endTime': json['end_time'] == null ? undefined : (new Date(json['end_time'])),
|
|
'duration': json['duration'] == null ? undefined : json['duration'],
|
|
'type': json['type'] == null ? undefined : json['type'],
|
|
'state': json['state'] == null ? undefined : json['state'],
|
|
'errorDetails': json['error_details'] == null ? undefined : json['error_details'],
|
|
'mimeTypes': json['mime_types'] == null ? undefined : json['mime_types'],
|
|
'endpoint': json['endpoint'] == null ? undefined : json['endpoint'],
|
|
'connectionRecordings': json['connection_recordings'] == null ? undefined : ((json['connection_recordings'] as Array<any>).map(ControllerApiResourcesSessionrecordingsV1ConnectionRecordingFromJSON)),
|
|
'createTimeValues': json['create_time_values'] == null ? undefined : ControllerApiResourcesSessionrecordingsV1ValuesAtTimeFromJSON(json['create_time_values']),
|
|
'authorizedActions': json['authorized_actions'] == null ? undefined : json['authorized_actions'],
|
|
'retainUntil': json['retain_until'] == null ? undefined : (new Date(json['retain_until'])),
|
|
'deleteAfter': json['delete_after'] == null ? undefined : (new Date(json['delete_after'])),
|
|
};
|
|
}
|
|
|
|
export function ControllerApiResourcesSessionrecordingsV1SessionRecordingToJSON(json: any): ControllerApiResourcesSessionrecordingsV1SessionRecording {
|
|
return ControllerApiResourcesSessionrecordingsV1SessionRecordingToJSONTyped(json, false);
|
|
}
|
|
|
|
export function ControllerApiResourcesSessionrecordingsV1SessionRecordingToJSONTyped(value?: ControllerApiResourcesSessionrecordingsV1SessionRecording | null, ignoreDiscriminator: boolean = false): any {
|
|
if (value == null) {
|
|
return value;
|
|
}
|
|
|
|
return {
|
|
|
|
'id': value['id'],
|
|
'scope': ControllerApiResourcesScopesV1ScopeInfoToJSON(value['scope']),
|
|
'session_id': value['sessionId'],
|
|
'storage_bucket_id': value['storageBucketId'],
|
|
'bytes_up': value['bytesUp'],
|
|
'bytes_down': value['bytesDown'],
|
|
'created_time': value['createdTime'] == null ? undefined : ((value['createdTime']).toISOString()),
|
|
'updated_time': value['updatedTime'] == null ? undefined : ((value['updatedTime']).toISOString()),
|
|
'start_time': value['startTime'] == null ? undefined : ((value['startTime']).toISOString()),
|
|
'end_time': value['endTime'] == null ? undefined : ((value['endTime']).toISOString()),
|
|
'duration': value['duration'],
|
|
'type': value['type'],
|
|
'state': value['state'],
|
|
'error_details': value['errorDetails'],
|
|
'mime_types': value['mimeTypes'],
|
|
'endpoint': value['endpoint'],
|
|
'connection_recordings': value['connectionRecordings'] == null ? undefined : ((value['connectionRecordings'] as Array<any>).map(ControllerApiResourcesSessionrecordingsV1ConnectionRecordingToJSON)),
|
|
'create_time_values': ControllerApiResourcesSessionrecordingsV1ValuesAtTimeToJSON(value['createTimeValues']),
|
|
'authorized_actions': value['authorizedActions'],
|
|
'retain_until': value['retainUntil'] == null ? undefined : ((value['retainUntil']).toISOString()),
|
|
'delete_after': value['deleteAfter'] == null ? undefined : ((value['deleteAfter']).toISOString()),
|
|
};
|
|
}
|
|
|