From 0c68be6cb5a1ea69818b72844f9cd673a23ea533 Mon Sep 17 00:00:00 2001 From: Stefan Rinke Date: Tue, 25 Feb 2025 17:55:57 +0100 Subject: [PATCH] remove openapi.yaml fix missing executable fix missing tag option in readme --- README.md | 2 + openapi.yaml | 895 --------------------------------------------------- package.json | 5 +- 3 files changed, 6 insertions(+), 896 deletions(-) delete mode 100644 openapi.yaml diff --git a/README.md b/README.md index 8bc8adf..c180951 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ npx @octomind/cli execute \ --url \ [--environment ] \ [--description ] \ + [--tags ] \ [--json] ``` @@ -34,6 +35,7 @@ Options: - `-e, --environment`: Environment name (default: "default") - `-d, --description`: Test description - `-j, --json`: Output raw JSON response +- `-g, --tags `: comma separated list of tags ### Get Test Report diff --git a/openapi.yaml b/openapi.yaml deleted file mode 100644 index 61a05d5..0000000 --- a/openapi.yaml +++ /dev/null @@ -1,895 +0,0 @@ -openapi: 3.0.3 -info: - title: Octomind external API - description: Octomind API that allows you to execute test cases, fetch reports and register private location workers by providing a URL and an ID. - version: 1.0.0 -servers: - - url: https://app.octomind.dev/api - description: Main API Endpoint - - url: http://localhost:3000/api - description: Dev API Endpoint -components: - securitySchemes: - ApiKeyAuth: - type: apiKey - in: header - name: X-API-Key - schemas: - ExecutionContext: - oneOf: - - type: object - properties: - source: - type: string - enum: [ "github" ] - example: "github" - issueNumber: - type: integer - nullable: true - example: 123 - ref: - type: string - nullable: true - example: "refs/heads/main" - sha: - type: string - nullable: true - example: "abc123def456" - repo: - type: string - example: "my-repo" - owner: - type: string - example: "repo-owner" - triggeredBy: - type: object - nullable: true - properties: - type: - type: string - enum: [ "USER" ] - example: "USER" - userId: - type: string - example: "user123" - nodeId: - type: string - nullable: true - example: "node-123" - - - type: object - properties: - source: - type: string - enum: [ "azureDevOps" ] - example: "azureDevOps" - accessToken: - type: string - example: "token123" - organization: - type: string - example: "my-org" - project: - type: string - example: "my-project" - repositoryId: - type: string - example: "repo-123" - sha: - type: string - nullable: true - example: "abc123def456" - ref: - type: string - nullable: true - example: "refs/heads/main" - pullRequestId: - type: integer - nullable: true - example: 101 - triggeredBy: - type: object - nullable: true - properties: - type: - type: string - enum: [ "USER" ] - example: "USER" - userId: - type: string - example: "user123" - threadId: - type: string - nullable: true - example: "thread-123" - - - type: object - properties: - source: - type: string - enum: [ "discovery" ] - example: "discovery" - description: - type: string - example: "A discovery test" - triggeredBy: - oneOf: - - type: object - properties: - type: - type: string - enum: [ "INITIAL" ] - example: "INITIAL" - - type: object - properties: - type: - type: string - enum: [ "USER" ] - example: "USER" - userId: - type: string - example: "user123" - - - type: object - properties: - source: - type: string - enum: [ "manual" ] - example: "manual" - description: - type: string - example: "A manual trigger" - triggeredBy: - type: object - properties: - type: - type: string - enum: [ "USER" ] - example: "USER" - userId: - type: string - example: "user123" - - - type: object - properties: - source: - type: string - enum: [ "scheduled" ] - example: "scheduled" - triggeredBy: - type: object - nullable: true - properties: - type: - type: string - enum: [ "USER" ] - example: "USER" - userId: - type: string - example: "user123" - - - type: object - properties: - source: - type: string - enum: [ "proposal" ] - example: "proposal" - description: - type: string - example: "A proposal trigger" - triggeredBy: - oneOf: - - type: object - properties: - type: - type: string - enum: [ "INITIAL" ] - example: "INITIAL" - - type: object - properties: - type: - type: string - enum: [ "USER" ] - example: "USER" - userId: - type: string - example: "user123" - - Variables: - type: object - properties: - [key: string]: - type: array - items: - type: string - description: The variables to overwrite exclusively for this test run. - example: - "SPACE_ID": ["64ee32b4-7365-47a6-b5b0-2903b6ad849d"] - - TestTargetExecutionRequest: - type: object - properties: - testTargetId: - type: string - format: uuid - description: Unique identifier for the testTarget. - example: "2e2bb27b-a19c-47ce-a9b6-cd1bd31622dc" - url: - type: string - format: uri - description: The URL of the test target for this run. - example: "https://example.com" - context: - $ref: "#/components/schemas/ExecutionContext" - environmentName: - type: string - format: environment name - description: the environment name you want to run your test against - default: default - variablesToOverwrite: - $ref: "#/components/schemas/Variables" - tags: - type: array - items: - type: string - example: ["tag1", "tag2"] - default: [] - required: - - testTargetId - - url - - context - TestTargetExecutionResponse: - type: object - properties: - testReportUrl: - type: string - description: The URL the test target was executed. - example: "https://example.com" - testReport: - type: object - description: The test report from the run. - example: "some json" - - TestReportContext: - type: object - properties: - source: - type: string - enum: [ "manual" ] - description: The source of the test trigger. - example: "manual" - description: - type: string - description: The description of the test context. - example: "manual trigger" - triggeredBy: - type: object - properties: - type: - type: string - enum: [ "USER" ] - description: The type of entity triggering the test. - example: "USER" - userId: - type: string - format: uuid - description: The unique identifier of the user who triggered the test. - example: "2e2bb27b-a19c-47ce-a9b6-cd1bd31622dc" - - TestResult: - type: object - properties: - id: - type: string - format: uuid - description: Unique identifier for the test result. - example: "826c15af-644b-4b28-89b4-f50ff34e46b7" - testTargetId: - type: string - format: uuid - description: Unique identifier of the test report this result belongs to. - example: "3435918b-3d29-4ebd-8c68-9a540532f45a" - testCaseId: - type: string - format: uuid - description: Unique identifier of the test case this result belongs to. - example: "5b844cf1-d597-4048-9e74-7c0f9ce3e2ee" - createdAt: - type: string - format: date-time - description: The timestamp when the test result was created. - example: "2024-09-06T13:01:51.686Z" - updatedAt: - type: string - format: date-time - description: The timestamp when the test result was last updated. - example: "2024-09-06T13:01:51.686Z" - status: - type: string - enum: [ "WAITING", "PASSED", "FAILED", "ERROR" ] - description: The status of the specific test result, will be WAITING as long as the result is running, FAILED if the execution failed, PASSED if it succeeded, and ERROR if an internal error occurred. - errorMessage: - type: string - nullable: true - description: The error that has occurred during execution - only set if the status is FAILED or ERROR. - example: "TimeoutError: locator.click: Timeout 30000ms exceeded." - traceUrl: - type: string - nullable: true - description: Link to the playwright trace of the test execution - only set once the test result is finished (PASSED or FAILED). - example: "https://storage.googleapis.com/automagically-traces/826c15af-644b-4b28-89b4-f50ff34e46b7-trace.zip" - - TestReport: - type: object - properties: - id: - type: string - format: uuid - description: Unique identifier for the test report. - example: "826c15af-644b-4b28-89b4-f50ff34e46b7" - testTargetId: - type: string - format: uuid - description: The unique identifier of the test target. - example: "3435918b-3d29-4ebd-8c68-9a540532f45a" - createdAt: - type: string - format: date-time - description: The timestamp when the test report was created. - example: "2024-09-06T13:01:51.686Z" - updatedAt: - type: string - format: date-time - description: The timestamp when the test report was last updated. - example: "2024-09-06T13:01:51.686Z" - executionUrl: - type: string - format: uri - description: The URL where the test execution was performed. - example: "https://en.wikipedia.org/" - status: - type: string - enum: [ "WAITING", "PASSED", "FAILED" ] - description: The status of the test report, will be WAITING as long as any result is running, FAILED if the report is done but has any failed result and PASSED if all test results are done and successful - context: - $ref: "#/components/schemas/TestReportContext" - testResults: - type: array - items: - $ref: "#/components/schemas/TestResult" - PrivateLocationInfo: - type: object - properties: - status: - type: string - enum: - - OFFLINE - - ONLINE - address: - type: string - format: uri - example: "https://example.com:3128" - name: - type: string - example: "my-private-location" - required: - - status - - address - - name - TestReportResponse: - type: object - properties: - testReportUrl: - type: string - format: uri - description: The URL where the test report can be accessed. - example: "https://app.octomind.dev/testreports/826c15af-644b-4b28-89b4-f50ff34e46b7" - testReport: - $ref: "#/components/schemas/TestReport" - - SuccessResponse: - type: object - properties: - success: - type: boolean - description: Indicates whether the operation was successful. - example: true - - UnregisterRequest: - type: object - properties: - name: - type: string - RegisterRequest: - type: object - properties: - name: - type: string - registrationData: - type: object - properties: - proxypass: - type: string - example: secret22 - proxyuser: - type: string - example: user - address: - type: string - description: the address of the remote endpoint. IP and port - example: 34.45.23.22:23455 - EnvironmentResponse: - type: array - items: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - testTargetId: - type: string - format: uuid - updatedAt: - type: string - format: date-time - type: - type: string - discoveryUrl: - type: string - format: url - additionalHeaderFields: - type: object - additionalProperties: - type: string - nullable: true - testAccount: - type: object - properties: - username: - type: string - password: - type: string - otpInitializerKey: - type: string - nullable: true - updatedAt: - type: string - format: date-time - nullable: true - basicAuth: - type: object - properties: - username: - type: string - password: - type: string - updatedAt: - type: string - format: date-time - nullable: true - privateLocation: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - status: - type: string - type: - type: string - ZodResponse: - type: array - items: - type: object - properties: - code: - type: string - example: "invalid_type" - description: "What error code happened while parsing the request" - expected: - type: string - description: "What the expected type was" - example: "object" - received: - type: "string" - description: "What the actual passed type was" - example: "string" - path: - type: array - items: - type: string - description: "The json path to the wrong parameter" - example: "key" - message: - type: string - description: "Human-readable message of the error that occurred while parsing." - example: "Expected object, received string" -paths: - /apiKey/v2/execute: - post: - summary: Execute all tests of the given test target with a given URL - description: This endpoint triggers a test execution by sending an test target id and a URL. - security: - - ApiKeyAuth: [ ] - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/TestTargetExecutionRequest" - responses: - "200": - description: Test executed successfully - content: - application/json: - schema: - $ref: "#/components/schemas/TestReportResponse" - "400": - description: Invalid request parameters - content: - application/json: - schema: - $ref: "#/components/schemas/ZodResponse" - "401": - description: Invalid or missing API key - "500": - description: Internal server error - - /apiKey/v2/test-targets/{testTargetId}/environments/{environmentId}: - delete: - summary: Delete an environment - security: - - ApiKeyAuth: [ ] - responses: - '200': - description: Environment deleted successfully - parameters: - - in: path - name: testTargetId - required: true - schema: - type: string - format: uuid - description: ID of the test target to which the test report belongs to - - in: path - name: environmentId - required: true - schema: - type: string - format: uuid - description: ID of the environment to update - patch: - summary: Update an environment - security: - - ApiKeyAuth: [ ] - parameters: - - in: path - name: testTargetId - required: true - schema: - type: string - format: uuid - description: ID of the test target to which the test report belongs to - - in: path - name: environmentId - required: true - schema: - type: string - format: uuid - description: ID of the environment to update - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - name: - type: string - nullable: true - discoveryUrl: - type: string - format: url - nullable: true - testAccount: - type: object - properties: - username: - type: string - password: - type: string - otpInitializerKey: - type: string - nullable: true - nullable: true - basicAuth: - type: object - properties: - username: - type: string - password: - type: string - nullable: true - privateLocationName: - type: string - nullable: true - description: name of the private location - additionalHeaderFields: - type: object - additionalProperties: - type: string - nullable: true - responses: - '200': - description: Environment updated successfully - - /apiKey/v2/test-targets/{testTargetId}/environments: - post: - summary: create a environments. - description: create a custom environment. - security: - - ApiKeyAuth: [ ] - parameters: - - in: path - name: testTargetId - required: true - schema: - type: string - format: uuid - description: ID of the test target to which the test report belongs to - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - name: - type: string - discoveryUrl: - type: string - format: url - testAccount: - type: object - properties: - username: - type: string - password: - type: string - otpInitializerKey: - type: string - nullable: true - nullable: true - basicAuth: - type: object - properties: - username: - type: string - password: - type: string - nullable: true - privateLocationName: - type: string - description: name of the private location - additionalHeaderFields: - type: object - additionalProperties: - type: string - nullable: true - - responses: - "201": - description: environment created - content: - application/json: - schema: - $ref: "#/components/schemas/EnvironmentResponse" - - get: - summary: Retrieve environments. - description: get a list of all defined environments. - security: - - ApiKeyAuth: [ ] - parameters: - - in: path - name: testTargetId - required: true - schema: - type: string - format: uuid - description: ID of the test target to which the test report belongs to - responses: - "200": - description: environments - content: - application/json: - schema: - $ref: "#/components/schemas/EnvironmentResponse" - - /apiKey/v2/test-targets/{testTargetId}/test-reports/{testReportId}: - get: - summary: Retrieve information about a test report. - description: Poll from within a CI-pipeline to wait for the completion of a report. - parameters: - - in: path - name: testTargetId - required: true - schema: - type: string - format: uuid - description: ID of the test target to which the test report belongs to - - in: path - name: testReportId - required: true - schema: - type: string - format: uuid - description: ID of the test report to fetch - security: - - ApiKeyAuth: [ ] - responses: - "200": - description: Test Report information - content: - application/json: - schema: - $ref: "#/components/schemas/TestReport" - "400": - description: Invalid request parameters - content: - application/json: - schema: - $ref: "#/components/schemas/ZodResponse" - "401": - description: Invalid or missing API key - "500": - description: Internal server error - - /apiKey/v2/test-targets/{testTargetId}/test-reports: - get: - summary: Retrieve paginated information about test reports. - description: Allow fetching the history of test reports for your test target. - parameters: - - in: path - name: testTargetId - required: true - schema: - type: string - format: uuid - description: ID of the test target for which to fetch the history for - - in: query - name: key - required: false - schema: - type: object - properties: - createdAt: - type: string - format: date-time - description: The timestamp of the key of the next page to fetch - See [Keyset Pagination](https://use-the-index-luke.com/no-offset) - example: "2024-09-06T13:01:51.686Z" - - in: query - name: filter - required: false - schema: - type: array - items: - type: object - properties: - key: - type: string - description: "The name of the property to filter for, e.g. an environmentId" - example: "environmentId" - operator: - type: string - enum: ["EQUALS"] - description: How to compare the property in question, only EQUALS is supported so far. - value: - type: string - format: uuid - description: The value to compare with to find matches. - example: "3435918b-3d29-4ebd-8c68-9a540532f45a" - security: - - ApiKeyAuth: [ ] - responses: - "200": - description: Test Reports information - content: - application/json: - schema: - type: object - properties: - data: - type: array - items: - $ref: "#/components/schemas/TestReport" - key: - type: object - properties: - createdAt: - type: string - format: date-time - description: The timestamp of the key of the next page to fetch - use this in the query when fetching the next page of reports - See [Keyset Pagination](https://use-the-index-luke.com/no-offset) - example: "2024-09-06T13:01:51.686Z" - hasNextPage: - type: boolean - description: If the query in question has another page to retrieve - - - "400": - description: Invalid request parameters - content: - application/json: - schema: - $ref: "#/components/schemas/ZodResponse" - - "401": - description: Invalid or missing API key - "500": - description: Internal server error - - /apiKey/v1/private-location: - get: - security: - - ApiKeyAuth: [ ] - summary: retrieve all private locations - description: "gets a list of private location workers" - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: "#/components/schemas/PrivateLocationInfo" - - /apiKey/v1/private-location/register: - put: - security: - - ApiKeyAuth: [ ] - summary: register a private location - description: "registers a private location worker" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/RegisterRequest" - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: "#/components/schemas/SuccessResponse" - "404": - description: private location of that name not found - "500": - description: Internal server error - - /apiKey/v1/private-location/unregister: - put: - security: - - ApiKeyAuth: [ ] - summary: unregister a private location - description: "unregisters a private location worker" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/UnregisterRequest" - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: "#/components/schemas/SuccessResponse" - "404": - description: private location of that name not found - "500": - description: Internal server error diff --git a/package.json b/package.json index 17eb4b8..223f20d 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,15 @@ { "name": "@octomind/cli", - "version": "1.0.0", + "version": "1.0.1", "description": "a command line client for octomind apis", "main": "./dist/index.js", "packageManager": "pnpm@9.15.6+sha512.139cab068fdf0b751268179ac5f909b5be72afb4a75c513d1905d151befc8977b593d3cf8671ed83d4d6637c5c94b98ffbce108125de4a5a27a31233601a99de", "engines": { "node": ">=20.0.0" }, + "bin": { + "cli": "./dist/index.js" + }, "scripts": { "lint": "eslint src/**/*.ts tests/**/*.ts --max-warnings=0", "build": "tsc --project tsconfig.build.json",