From 091b77ed3793b2fb74ee1f0cabcae0b8ebbcacd7 Mon Sep 17 00:00:00 2001 From: Russell Vinegar <38586679+rustyjux@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:26:09 -0800 Subject: [PATCH] update ns --> gw in API endpoint names and descriptions * rename namespace-profile endpoint * update ns --> gw in API descriptions * delete routes.ts and openapi.yaml (generated during build) --- src/controllers/v3/DatasetController.ts | 4 +- src/controllers/v3/GatewayController.ts | 16 +- .../v3/GatewayDirectoryController.ts | 2 +- .../v3/GatewayServicesController.ts | 2 +- src/controllers/v3/IssuerController.ts | 4 +- src/controllers/v3/OrganizationController.ts | 12 +- src/controllers/v3/openapi.yaml | 1722 ---------------- src/controllers/v3/routes.ts | 1726 ----------------- 8 files changed, 20 insertions(+), 3468 deletions(-) delete mode 100644 src/controllers/v3/openapi.yaml delete mode 100644 src/controllers/v3/routes.ts diff --git a/src/controllers/v3/DatasetController.ts b/src/controllers/v3/DatasetController.ts index 57ff6a119..0bab150bd 100644 --- a/src/controllers/v3/DatasetController.ts +++ b/src/controllers/v3/DatasetController.ts @@ -40,7 +40,7 @@ export class DatasetController extends Controller { /** * Update metadata about a Dataset - * > `Required Scope:` Namespace.Manage + * > `Required Scope:` Gateway.Manage * * @summary Update Dataset */ @@ -66,7 +66,7 @@ export class DatasetController extends Controller { /** * Get metadata about a Dataset - * > `Required Scope:` Namespace.Manage + * > `Required Scope:` Gateway.Manage * * @summary Get Dataset */ diff --git a/src/controllers/v3/GatewayController.ts b/src/controllers/v3/GatewayController.ts index 20e208481..7e7e70831 100644 --- a/src/controllers/v3/GatewayController.ts +++ b/src/controllers/v3/GatewayController.ts @@ -121,7 +121,7 @@ export class NamespaceController extends Controller { /** * Get details about the gateway, such as permissions for what the gateway is setup with. - * > `Required Scope:` Namespace.Manage + * > `Required Scope:` Gateway.Manage * * @summary Gateway Summary * @param ns @@ -129,7 +129,7 @@ export class NamespaceController extends Controller { * @returns */ @Get('/{gatewayId}') - @OperationId('namespace-profile') + @OperationId('gateway-profile') @Security('jwt', ['Namespace.Manage']) public async profile( @Path() gatewayId: string, @@ -174,7 +174,7 @@ export class NamespaceController extends Controller { errors[`d${ind}`] = { message: err.message }; }); logger.error('%j', result); - throw new ValidateError(errors, 'Unable to create namespace'); + throw new ValidateError(errors, 'Unable to create Gateway'); } return { gatewayId: result.data.createNamespace.name, @@ -184,7 +184,7 @@ export class NamespaceController extends Controller { /** * Delete the gateway - * > `Required Scope:` Namespace.Manage + * > `Required Scope:` Gateway.Manage * * @summary Delete Gateway * @param ns @@ -192,7 +192,7 @@ export class NamespaceController extends Controller { * @returns */ @Delete('/{gatewayId}') - @OperationId('delete-namespace') + @OperationId('delete-gateway') @Security('jwt', ['Namespace.Manage']) public async delete( @Path() gatewayId: string, @@ -218,9 +218,9 @@ export class NamespaceController extends Controller { } /** - * > `Required Scope:` Namespace.View + * > `Required Scope:` Gateway.View * - * @summary Get administration activity for this gateway + * @summary Get administration activity for this Gateway * @param ns * @param first * @param skip @@ -251,7 +251,7 @@ export class NamespaceController extends Controller { /** * Get a summary of your endpoints - * > `Required Scope:` Namespace.Manage + * > `Required Scope:` Gateway.Manage * * @summary Get endpoints */ diff --git a/src/controllers/v3/GatewayDirectoryController.ts b/src/controllers/v3/GatewayDirectoryController.ts index a5de7ce90..fbbb44bbf 100644 --- a/src/controllers/v3/GatewayDirectoryController.ts +++ b/src/controllers/v3/GatewayDirectoryController.ts @@ -61,7 +61,7 @@ export class GatewayDirectoryController extends Controller { /** * Used primarily for "Preview Mode" - * List the datasets belonging to a particular namespace + * List the datasets belonging to a particular Gateway * * @param ns * @param name diff --git a/src/controllers/v3/GatewayServicesController.ts b/src/controllers/v3/GatewayServicesController.ts index 801e5837b..eb902cce6 100644 --- a/src/controllers/v3/GatewayServicesController.ts +++ b/src/controllers/v3/GatewayServicesController.ts @@ -47,7 +47,7 @@ export class GatewayController extends Controller { /** * Get a summary of your Gateway Services - * > `Required Scope:` Namespace.Manage + * > `Required Scope:` Gateway.Manage * * @summary Get Gateway Services */ diff --git a/src/controllers/v3/IssuerController.ts b/src/controllers/v3/IssuerController.ts index 98598932c..e87b34c85 100644 --- a/src/controllers/v3/IssuerController.ts +++ b/src/controllers/v3/IssuerController.ts @@ -60,8 +60,8 @@ export class IssuerController extends Controller { } /** - * Get Authorization Profiles setup in this namespace - * > `Required Scope:` Namespace.Manage + * Get Authorization Profiles setup in this Gateway + * > `Required Scope:` Gateway.Manage * * @summary Get Authorization Profiles */ diff --git a/src/controllers/v3/OrganizationController.ts b/src/controllers/v3/OrganizationController.ts index a4d904cfc..1597c3a26 100644 --- a/src/controllers/v3/OrganizationController.ts +++ b/src/controllers/v3/OrganizationController.ts @@ -181,7 +181,7 @@ export class OrganizationController extends Controller { } /** - * > `Required Scope:` Namespace.Assign + * > `Required Scope:` Gateway.Assign */ @Get('{org}/gateways') @OperationId('organization-gateways') @@ -196,7 +196,7 @@ export class OrganizationController extends Controller { } /** - * > `Required Scope:` Namespace.Assign + * > `Required Scope:` Gateway.Assign */ @Put('{org}/{orgUnit}/gateways/{gatewayId}') @OperationId('assign-namespace-to-organization') @@ -231,7 +231,7 @@ export class OrganizationController extends Controller { } /** - * > `Required Scope:` Namespace.Assign + * > `Required Scope:` Gateway.Assign */ @Delete('{org}/{orgUnit}/gateways/{gatewayId}') @OperationId('unassign-namespace-from-organization') @@ -265,16 +265,16 @@ export class OrganizationController extends Controller { } /** - * > `Required Scope:` Namespace.Assign + * > `Required Scope:` Gateway.Assign * - * @summary Get administration activity for gateways associated with this Organization + * @summary Get administration activity for Gateways associated with this Organization * @param org * @param first * @param skip * @returns Activity[] */ @Get('{org}/activity') - @OperationId('org-namespace-activity') + @OperationId('org-gateway-activity') @Security('jwt', ['Namespace.Assign']) public async namespaceActivity( @Path() org: string, diff --git a/src/controllers/v3/openapi.yaml b/src/controllers/v3/openapi.yaml deleted file mode 100644 index ec2d79f47..000000000 --- a/src/controllers/v3/openapi.yaml +++ /dev/null @@ -1,1722 +0,0 @@ -components: - examples: {} - headers: {} - parameters: {} - requestBodies: {} - responses: {} - schemas: - DatasetContact: - properties: - name: - type: string - email: - type: string - role: - type: string - enum: - - pointOfContact - nullable: false - type: object - additionalProperties: false - DatasetResource: - properties: - id: - type: string - name: - type: string - format: - type: string - enum: - - openapi-json - - json - url: - type: string - type: object - additionalProperties: false - OrganizationRefID: - type: string - OrganizationUnitRefID: - type: string - Dataset: - properties: - extForeignKey: - type: string - name: - type: string - license_title: - type: string - security_class: - type: string - view_audience: - type: string - download_audience: - type: string - record_publish_date: - type: string - notes: - type: string - title: - type: string - isInCatalog: - type: string - isDraft: - type: string - contacts: - items: - $ref: '#/components/schemas/DatasetContact' - type: array - resources: - items: - $ref: '#/components/schemas/DatasetResource' - type: array - extSource: - type: string - extRecordHash: - type: string - tags: - items: - type: string - type: array - organization: - $ref: '#/components/schemas/OrganizationRefID' - organizationUnit: - $ref: '#/components/schemas/OrganizationUnitRefID' - type: object - additionalProperties: false - BatchResult: - properties: - status: - type: number - format: double - result: - type: string - reason: - type: string - id: - type: string - ownedBy: - type: string - childResults: - items: - $ref: '#/components/schemas/BatchResult' - type: array - required: - - status - - result - type: object - additionalProperties: false - DraftDataset: - properties: - name: - type: string - license_title: - type: string - security_class: - type: string - enum: - - HIGH-CABINET - - HIGH-CONFIDENTIAL - - HIGH-SENSITIVITY - - MEDIUM-SENSITIVITY - - MEDIUM-PERSONAL - - LOW-SENSITIVITY - - LOW-PUBLIC - - PUBLIC - - 'PROTECTED A' - - 'PROTECTED B' - - 'PROTECTED C' - view_audience: - type: string - enum: - - Public - - Government - - 'Named users' - - 'Government and Business BCeID' - download_audience: - type: string - enum: - - Public - - Government - - 'Named users' - - 'Government and Business BCeID' - record_publish_date: - type: string - notes: - type: string - title: - type: string - isInCatalog: - type: boolean - isDraft: - type: boolean - contacts: - items: - $ref: '#/components/schemas/DatasetContact' - type: array - resources: - items: - $ref: '#/components/schemas/DatasetResource' - type: array - tags: - items: - type: string - type: array - organization: - $ref: '#/components/schemas/OrganizationRefID' - organizationUnit: - $ref: '#/components/schemas/OrganizationUnitRefID' - type: object - additionalProperties: false - example: - name: my_sample_dataset - license_title: 'Open Government Licence - British Columbia' - security_class: PUBLIC - view_audience: Public - download_audience: Public - record_publish_date: '2017-09-05' - notes: 'Some notes' - title: 'A title about my dataset' - tags: - - tag1 - - tag2 - organization: ministry-of-citizens-services - organizationUnit: databc - Gateway: - properties: - gatewayId: - type: string - displayName: - type: string - type: object - additionalProperties: false - ActivityDetail: - properties: - id: - type: string - message: - type: string - params: - properties: {} - additionalProperties: - type: string - type: object - activityAt: {} - blob: {} - required: - - message - - params - - activityAt - type: object - additionalProperties: false - PublishResult: - properties: - message: - type: string - results: - type: string - error: - type: string - type: object - additionalProperties: false - GatewayServiceRefID: - type: string - GatewayRouteRefID: - type: string - GatewayPlugin: - properties: - extForeignKey: - type: string - name: - type: string - extSource: - type: string - extRecordHash: - type: string - tags: - items: - type: string - type: array - config: {} - service: - $ref: '#/components/schemas/GatewayServiceRefID' - route: - $ref: '#/components/schemas/GatewayRouteRefID' - type: object - additionalProperties: false - GatewayRoute: - properties: - extForeignKey: - type: string - name: - type: string - gatewayId: - type: string - extSource: - type: string - extRecordHash: - type: string - tags: - items: - type: string - type: array - methods: - items: - type: string - type: array - paths: - items: - type: string - type: array - hosts: - items: - type: string - type: array - service: - $ref: '#/components/schemas/GatewayServiceRefID' - plugins: - items: - $ref: '#/components/schemas/GatewayPlugin' - type: array - type: object - additionalProperties: false - IssuerEnvironmentConfig: - properties: - environment: - type: string - exists: - type: boolean - issuerUrl: - type: string - clientRegistration: - type: string - enum: - - anonymous - - managed - - iat - clientId: - type: string - clientSecret: - type: string - initialAccessToken: - type: string - type: object - additionalProperties: false - example: - environment: dev - issuerUrl: 'https://idp.site/auth/realms/my-realm' - clientRegistration: managed - clientId: a-client-id - clientSecret: a-client-secret - undefinedRefID: - type: string - CredentialIssuer: - properties: - name: - type: string - gatewayId: - type: string - description: - type: string - flow: - type: string - enum: - - client-credentials - nullable: false - mode: - type: string - enum: - - auto - nullable: false - authPlugin: - type: string - clientAuthenticator: - type: string - enum: - - client-secret - - client-jwt - - client-jwt-jwks-url - instruction: - type: string - environmentDetails: - items: - $ref: '#/components/schemas/IssuerEnvironmentConfig' - type: array - resourceType: - type: string - resourceAccessScope: - type: string - isShared: - type: boolean - apiKeyName: - type: string - availableScopes: - items: - type: string - type: array - resourceScopes: - items: - type: string - type: array - clientRoles: - items: - type: string - type: array - clientMappers: - items: - type: string - type: array - inheritFrom: - $ref: '#/components/schemas/undefinedRefID' - owner: - $ref: '#/components/schemas/undefinedRefID' - type: object - additionalProperties: false - example: - name: my-auth-profile - description: 'Auth connection to my IdP' - flow: client-credentials - clientAuthenticator: client-secret - mode: auto - environmentDetails: [] - owner: janis@gov.bc.ca - OrganizationUnit: - properties: - extForeignKey: - type: string - name: - type: string - sector: - type: string - title: - type: string - description: - type: string - extSource: - type: string - extRecordHash: - type: string - tags: - items: - type: string - type: array - type: object - additionalProperties: false - Organization: - properties: - extForeignKey: - type: string - name: - type: string - sector: - type: string - title: - type: string - description: - type: string - extSource: - type: string - extRecordHash: - type: string - tags: - items: - type: string - type: array - orgUnits: - items: - $ref: '#/components/schemas/OrganizationUnit' - type: array - type: object - additionalProperties: false - GroupPermission: - properties: - resource: - type: string - scopes: - items: - type: string - type: array - required: - - scopes - type: object - additionalProperties: false - GroupRole: - properties: - name: - type: string - permissions: - items: - $ref: '#/components/schemas/GroupPermission' - type: array - required: - - name - - permissions - type: object - additionalProperties: false - GroupAccess: - properties: - name: - type: string - parent: - type: string - roles: - items: - $ref: '#/components/schemas/GroupRole' - type: array - required: - - roles - type: object - additionalProperties: false - UserReference: - properties: - id: - type: string - email: - type: string - type: object - additionalProperties: false - GroupMember: - properties: - member: - $ref: '#/components/schemas/UserReference' - roles: - items: - type: string - type: array - required: - - member - - roles - type: object - additionalProperties: false - GroupMembership: - properties: - name: - type: string - parent: - type: string - members: - items: - $ref: '#/components/schemas/GroupMember' - type: array - type: object - additionalProperties: false - OrgNamespace: - properties: - name: - type: string - orgUnit: - type: string - enabled: - type: boolean - updatedAt: - type: number - format: double - required: - - name - - orgUnit - - enabled - - updatedAt - type: object - additionalProperties: false - DraftDatasetRefID: - type: string - LegalRefID: - type: string - CredentialIssuerRefID: - type: string - Environment: - properties: - appId: - type: string - name: - type: string - enum: - - dev - - test - - prod - - sandbox - - other - active: - type: boolean - approval: - type: boolean - flow: - type: string - enum: - - public - - protected-externally - - authorization-code - - client-credentials - - kong-acl-only - - kong-api-key-only - - kong-api-key-acl - additionalDetailsToRequest: - type: string - services: - items: - $ref: '#/components/schemas/GatewayServiceRefID' - type: array - legal: - $ref: '#/components/schemas/LegalRefID' - credentialIssuer: - $ref: '#/components/schemas/CredentialIssuerRefID' - type: object - additionalProperties: false - example: - name: dev - active: false - approval: false - flow: public - appId: '00000000' - Product: - properties: - appId: - type: string - name: - type: string - description: - type: string - gatewayId: - type: string - dataset: - $ref: '#/components/schemas/DraftDatasetRefID' - environments: - items: - $ref: '#/components/schemas/Environment' - type: array - type: object - additionalProperties: false - example: - name: my-new-product - appId: '000000000000' - environments: - - - name: dev - active: false - approval: false - flow: public - appId: '00000000' - securitySchemes: - jwt: - type: oauth2 - description: 'Authz Client Credential' - flows: - clientCredentials: - tokenUrl: 'https://token_endpoint' - scopes: {} - portal: - type: http - description: 'Authz Portal Login' - scheme: bearer - bearerFormat: JWT - openid: - type: openIdConnect - description: 'OIDC Login' - openIdConnectUrl: 'https://well_known_endpoint' -info: - title: 'APS Directory API' - version: 3.0.0 - description: 'API Services Portal by BC Gov API Programme Services' - license: - name: MIT - contact: - name: 'BC Gov APS' -openapi: 3.0.0 -paths: - '/organizations/{org}/datasets': - get: - operationId: organization-datasets - responses: - '200': - description: Ok - content: - application/json: - schema: - items: - $ref: '#/components/schemas/Dataset' - type: array - description: "Get metadata about Datasets that are available by API for this organization\n> `Required Scope:` Dataset.Manage" - summary: 'Get Organization Datasets' - tags: - - 'API Directory (Administration)' - security: - - - jwt: - - Dataset.Manage - parameters: - - - in: path - name: org - required: true - schema: - type: string - put: - operationId: put-organization-dataset - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/BatchResult' - description: "Manage metadata about Datasets that are available by API for this organization\n> `Required Scope:` Dataset.Manage" - summary: 'Manage Organization Datasets' - tags: - - 'API Directory (Administration)' - security: - - - jwt: - - Dataset.Manage - parameters: - - - in: path - name: org - required: true - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/DraftDataset' - '/organizations/{org}/datasets/{name}': - delete: - operationId: delete-dataset - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/BatchResult' - description: "Delete a Dataset\n> `Required Scope:` Dataset.Manage" - summary: 'Delete a dataset' - tags: - - 'API Directory (Administration)' - security: - - - jwt: - - Dataset.Manage - parameters: - - - in: path - name: org - required: true - schema: - type: string - - - in: path - name: name - required: true - schema: - type: string - get: - operationId: get-organization-dataset - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/Dataset' - description: "Get metadata about a Dataset that are available by API for this organization\n> `Required Scope:` Dataset.Manage" - summary: 'Get Organization Dataset' - tags: - - 'API Directory (Administration)' - security: - - - jwt: - - Dataset.Manage - parameters: - - - in: path - name: org - required: true - schema: - type: string - - - in: path - name: name - required: true - schema: - type: string - /directory: - get: - operationId: directory-list - responses: - '200': - description: Ok - content: - application/json: - schema: {} - tags: - - 'API Directory' - security: [] - parameters: [] - '/directory/{id}': - get: - operationId: directory-item - responses: - '200': - description: Ok - content: - application/json: - schema: {} - tags: - - 'API Directory' - security: [] - parameters: - - - in: path - name: id - required: true - schema: - type: string - '/gateways/{gatewayId}/datasets': - put: - operationId: put-dataset - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/BatchResult' - description: "Update metadata about a Dataset\n> `Required Scope:` Namespace.Manage" - summary: 'Update Dataset' - tags: - - 'API Directory (Administration)' - security: - - - jwt: - - Namespace.Manage - parameters: - - - in: path - name: gatewayId - required: true - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/DraftDataset' - '/gateways/{gatewayId}/datasets/{name}': - get: - operationId: get-dataset - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/Dataset' - description: "Get metadata about a Dataset\n> `Required Scope:` Namespace.Manage" - summary: 'Get Dataset' - tags: - - 'API Directory (Administration)' - security: - - - jwt: - - Namespace.Manage - parameters: - - - in: path - name: gatewayId - required: true - schema: - type: string - - - in: path - name: name - required: true - schema: - type: string - /routes/availability: - get: - operationId: check-availability - responses: - '200': - description: Ok - content: - application/json: - schema: {} - tags: - - 'Service Routes' - security: [] - parameters: - - - in: query - name: serviceName - required: true - schema: - type: string - - - in: query - name: gatewayId - required: true - schema: - type: string - /gateways/report: - get: - operationId: report - responses: - '200': - description: Ok - content: - application/json: - schema: {} - tags: - - Gateways - security: - - - jwt: [] - parameters: - - - in: query - name: ids - required: false - schema: - default: '[]' - type: string - /gateways: - get: - operationId: gateway-list - responses: - '200': - description: Ok - content: - application/json: - schema: - items: - $ref: '#/components/schemas/Gateway' - type: array - summary: 'List of Gateways available to the user' - tags: - - Gateways - security: - - - jwt: [] - parameters: [] - post: - operationId: create-gateway - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/Gateway' - description: 'Create a gateway' - summary: 'Create Gateway' - tags: - - Gateways - security: - - - jwt: [] - parameters: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Gateway' - '/gateways/{gatewayId}': - get: - operationId: namespace-profile - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/Gateway' - description: "Get details about the gateway, such as permissions for what the gateway is setup with.\n> `Required Scope:` Namespace.Manage" - summary: 'Gateway Summary' - tags: - - Gateways - security: - - - jwt: - - Namespace.Manage - parameters: - - - in: path - name: gatewayId - required: true - schema: - type: string - delete: - operationId: delete-namespace - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/Gateway' - description: "Delete the gateway\n> `Required Scope:` Namespace.Manage" - summary: 'Delete Gateway' - tags: - - Gateways - security: - - - jwt: - - Namespace.Manage - parameters: - - - in: path - name: gatewayId - required: true - schema: - type: string - - - in: query - name: force - required: false - schema: - default: false - type: boolean - '/gateways/{gatewayId}/activity': - get: - operationId: gateway-admin-activity - responses: - '200': - description: 'Activity[]' - content: - application/json: - schema: - items: - $ref: '#/components/schemas/ActivityDetail' - type: array - description: '> `Required Scope:` Namespace.View' - summary: 'Get administration activity for this gateway' - tags: - - Gateways - security: - - - jwt: - - Namespace.View - parameters: - - - in: path - name: gatewayId - required: true - schema: - type: string - - - in: query - name: first - required: false - schema: - default: 20 - format: double - type: number - - - in: query - name: skip - required: false - schema: - default: 0 - format: double - type: number - '/gateways/{gatewayId}/links': - get: - operationId: get-gateway-links - responses: - '200': - description: Ok - content: - application/json: - schema: - items: - properties: {host: {type: string}} - required: [host] - type: object - type: array - description: "Get a summary of your endpoints\n> `Required Scope:` Namespace.Manage" - summary: 'Get endpoints' - tags: - - Gateways - security: - - - jwt: - - Namespace.Manage - parameters: - - - in: path - name: gatewayId - required: true - schema: - type: string - '/gateways/{gatewayId}/directory/{id}': - get: - operationId: get-ns-directory-dataset - responses: - '200': - description: Ok - content: - application/json: - schema: {} - description: "Used primarily for \"Preview Mode\"\nGet a particular Dataset" - tags: - - 'API Directory (Administration)' - security: - - - jwt: - - Namespace.Manage - parameters: - - - in: path - name: gatewayId - required: true - schema: - type: string - - - in: path - name: id - required: true - schema: - type: string - '/gateways/{gatewayId}/directory': - get: - operationId: get-ns-directory - responses: - '200': - description: Ok - content: - application/json: - schema: {} - description: "Used primarily for \"Preview Mode\"\nList the datasets belonging to a particular namespace" - tags: - - 'API Directory (Administration)' - security: - - - jwt: - - Namespace.Manage - parameters: - - - in: path - name: gatewayId - required: true - schema: - type: string - '/gateways/{gatewayId}/services': - put: - operationId: publish-gateway-config - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/PublishResult' - tags: - - 'Gateway Services' - security: - - - jwt: - - Gateway.Config - parameters: [] - requestBody: - required: true - content: - multipart/form-data: - schema: - type: object - properties: - dryRun: - type: string - configFile: - type: string - format: binary - required: - - dryRun - - configFile - get: - operationId: get-gateway-routes - responses: - '200': - description: Ok - content: - application/json: - schema: - items: - $ref: '#/components/schemas/GatewayRoute' - type: array - description: "Get a summary of your Gateway Services\n> `Required Scope:` Namespace.Manage" - summary: 'Get Gateway Services' - tags: - - 'Gateway Services' - security: - - - jwt: - - Namespace.Manage - parameters: - - - in: path - name: gatewayId - required: true - schema: - type: string - '/identifiers/{type}': - get: - operationId: GetNewID - responses: - '200': - description: Ok - content: - application/json: - schema: - type: string - tags: - - 'New Identifiers' - security: [] - parameters: - - - in: path - name: type - required: true - schema: - type: string - enum: - - environment - - product - - application - - gateway - '/gateways/{gatewayId}/issuers': - put: - operationId: put-issuer - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/BatchResult' - description: "Create or Update Authorization Profiles\n> `Required Scope:` CredentialIssuer.Admin" - summary: 'Manage Authorization Profiles' - tags: - - 'Authorization Profiles' - security: - - - jwt: - - CredentialIssuer.Admin - parameters: - - - in: path - name: gatewayId - required: true - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CredentialIssuer' - get: - operationId: get-issuers - responses: - '200': - description: Ok - content: - application/json: - schema: - items: - $ref: '#/components/schemas/CredentialIssuer' - type: array - description: "Get Authorization Profiles setup in this namespace\n> `Required Scope:` Namespace.Manage" - summary: 'Get Authorization Profiles' - tags: - - 'Authorization Profiles' - security: - - - jwt: - - Namespace.Manage - parameters: - - - in: path - name: gatewayId - required: true - schema: - type: string - '/gateways/{gatewayId}/issuers/{name}': - delete: - operationId: delete-issuer - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/BatchResult' - description: "Delete an Authorization Profile\n> `Required Scope:` CredentialIssuer.Admin" - summary: 'Delete Profile' - tags: - - 'Authorization Profiles' - security: - - - jwt: - - CredentialIssuer.Admin - parameters: - - - in: path - name: gatewayId - required: true - schema: - type: string - - - in: path - name: name - required: true - schema: - type: string - /organizations: - get: - operationId: organization-list - responses: - '200': - description: Ok - content: - application/json: - schema: - items: {} - type: array - tags: - - Organizations - security: [] - parameters: [] - '/organizations/{org}': - put: - operationId: put-organization - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/BatchResult' - description: "Create Organization\n> `Required Scope:` GroupAccess.Manage" - summary: 'Create Organizations' - tags: - - Organizations - security: - - - jwt: - - GroupAccess.Manage - parameters: - - - in: path - name: org - required: true - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Organization' - get: - operationId: organization-units - responses: - '200': - description: Ok - content: - application/json: - schema: {} - tags: - - Organizations - security: [] - parameters: - - - in: path - name: org - required: true - schema: - type: string - '/organizations/{org}/roles': - get: - operationId: get-organization-roles - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/GroupAccess' - description: '> `Required Scope:` GroupAccess.Manage' - tags: - - Organizations - security: - - - jwt: - - GroupAccess.Manage - parameters: - - - in: path - name: org - required: true - schema: - type: string - '/organizations/{org}/access': - get: - operationId: get-organization-access - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/GroupMembership' - description: '> `Required Scope:` GroupAccess.Manage' - tags: - - Organizations - security: - - - jwt: - - GroupAccess.Manage - parameters: - - - in: path - name: org - required: true - schema: - type: string - put: - operationId: put-organization-access - responses: - '204': - description: 'No content' - description: '> `Required Scope:` GroupAccess.Manage' - tags: - - Organizations - security: - - - jwt: - - GroupAccess.Manage - parameters: - - - in: path - name: org - required: true - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/GroupMembership' - '/organizations/{org}/gateways': - get: - operationId: organization-gateways - responses: - '200': - description: Ok - content: - application/json: - schema: - items: - $ref: '#/components/schemas/OrgNamespace' - type: array - description: '> `Required Scope:` Namespace.Assign' - tags: - - Organizations - security: - - - jwt: - - Namespace.Assign - parameters: - - - in: path - name: org - required: true - schema: - type: string - '/organizations/{org}/{orgUnit}/gateways/{gatewayId}': - put: - operationId: assign-namespace-to-organization - responses: - '200': - description: Ok - content: - application/json: - schema: - properties: - result: {type: string} - required: - - result - type: object - description: '> `Required Scope:` Namespace.Assign' - tags: - - Organizations - security: - - - jwt: - - Namespace.Assign - parameters: - - - in: path - name: org - required: true - schema: - type: string - - - in: path - name: orgUnit - required: true - schema: - type: string - - - in: path - name: gatewayId - required: true - schema: - type: string - - - in: query - name: enable - required: false - schema: - default: true - type: boolean - delete: - operationId: unassign-namespace-from-organization - responses: - '200': - description: Ok - content: - application/json: - schema: - properties: - result: {type: string} - required: - - result - type: object - description: '> `Required Scope:` Namespace.Assign' - tags: - - Organizations - security: - - - jwt: - - Namespace.Assign - parameters: - - - in: path - name: org - required: true - schema: - type: string - - - in: path - name: orgUnit - required: true - schema: - type: string - - - in: path - name: gatewayId - required: true - schema: - type: string - '/organizations/{org}/activity': - get: - operationId: org-namespace-activity - responses: - '200': - description: 'Activity[]' - content: - application/json: - schema: - items: - $ref: '#/components/schemas/ActivityDetail' - type: array - description: '> `Required Scope:` Namespace.Assign' - summary: 'Get administration activity for gateways associated with this Organization' - tags: - - Organizations - security: - - - jwt: - - Namespace.Assign - parameters: - - - in: path - name: org - required: true - schema: - type: string - - - in: query - name: first - required: false - schema: - default: 20 - format: double - type: number - - - in: query - name: skip - required: false - schema: - default: 0 - format: double - type: number - /roles: - get: - operationId: GetRoles - responses: - '200': - description: Ok - content: - application/json: - schema: {} - tags: - - Organizations - security: [] - parameters: [] - '/gateways/{gatewayId}/products': - put: - operationId: put-product - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/BatchResult' - description: "Manage Products for APIs that will appear on the API Directory\n> `Required Scope:` Namespace.Manage" - summary: 'Manage Products' - tags: - - Products - security: - - - jwt: - - Namespace.Manage - parameters: - - - in: path - name: gatewayId - required: true - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - get: - operationId: get-products - responses: - '200': - description: Ok - content: - application/json: - schema: - items: - $ref: '#/components/schemas/Product' - type: array - description: "Get Products describing APIs that will appear on the API Directory\n> `Required Scope:` Namespace.Manage" - summary: 'Get Products' - tags: - - Products - security: - - - jwt: - - Namespace.Manage - parameters: [] - '/gateways/{gatewayId}/products/{appId}': - delete: - operationId: delete-product - responses: - '200': - description: Ok - content: - application/json: - schema: - $ref: '#/components/schemas/BatchResult' - description: "Delete a Product\n> `Required Scope:` Namespace.Manage" - summary: 'Manage Products' - tags: - - Products - security: - - - jwt: - - Namespace.Manage - parameters: - - - in: path - name: gatewayId - required: true - schema: - type: string - - - in: path - name: appId - required: true - schema: - type: string - '/gateways/{gatewayId}/environments/{appId}': - delete: - operationId: delete-product-environment - responses: - '204': - description: 'No content' - description: "Delete a Product Environment\n> `Required Scope:` Namespace.Manage" - summary: 'Delete a Product Environment' - tags: - - Products - security: - - - jwt: - - Namespace.Manage - parameters: - - - in: path - name: gatewayId - required: true - schema: - type: string - - - in: path - name: appId - required: true - schema: - type: string - - - in: query - name: force - required: false - schema: - default: false - type: boolean -servers: - - - url: /ds/api/v3 -tags: - - - name: 'API Directory' - description: 'Discover all the great BC Government APIs' - - - name: 'API Directory (Administration)' - description: 'Administer datasets on the API Directory' - - - name: Organizations - description: 'Manage organizational access control' - - - name: Gateways - description: 'Get aggregated information about gateways' - - - name: 'Gateway Services' - description: 'View your Gateway Service details' - - - name: Products - description: 'Manage your Products and Environments for publishing to the API Directory' - - - name: 'Authorization Profiles' - description: 'Configure the integration to external Identity Providers' diff --git a/src/controllers/v3/routes.ts b/src/controllers/v3/routes.ts deleted file mode 100644 index 3de19b1d6..000000000 --- a/src/controllers/v3/routes.ts +++ /dev/null @@ -1,1726 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { Controller, ValidationService, FieldErrors, ValidateError, TsoaRoute, HttpStatusCodeLiteral, TsoaResponse } from '@tsoa/runtime'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { OrgDatasetController } from './OrgDatasetController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { DirectoryController } from './DirectoryController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { DatasetController } from './DatasetController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { EndpointsController } from './EndpointsController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { NamespaceController } from './GatewayController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { GatewayDirectoryController } from './GatewayDirectoryController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { GatewayController } from './GatewayServicesController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { IdentifiersController } from './IdentifierController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { IssuerController } from './IssuerController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { OrganizationController } from './OrganizationController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { OrgRoleController } from './OrgRoleController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { ProductController } from './ProductController'; -import { expressAuthentication } from './../../auth/auth-tsoa'; -// @ts-ignore - no great way to install types from subpackage -const promiseAny = require('promise.any'); -import { iocContainer } from './../ioc'; -import { IocContainer, IocContainerFactory } from '@tsoa/runtime'; -import * as express from 'express'; -const multer = require('multer'); -const upload = multer(); - -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - -const models: TsoaRoute.Models = { - "DatasetContact": { - "dataType": "refObject", - "properties": { - "name": {"dataType":"string"}, - "email": {"dataType":"string"}, - "role": {"dataType":"enum","enums":["pointOfContact"]}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DatasetResource": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string"}, - "name": {"dataType":"string"}, - "format": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["openapi-json"]},{"dataType":"enum","enums":["json"]}]}, - "url": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OrganizationRefID": { - "dataType": "refAlias", - "type": {"dataType":"string","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OrganizationUnitRefID": { - "dataType": "refAlias", - "type": {"dataType":"string","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Dataset": { - "dataType": "refObject", - "properties": { - "extForeignKey": {"dataType":"string"}, - "name": {"dataType":"string"}, - "license_title": {"dataType":"string"}, - "security_class": {"dataType":"string"}, - "view_audience": {"dataType":"string"}, - "download_audience": {"dataType":"string"}, - "record_publish_date": {"dataType":"string"}, - "notes": {"dataType":"string"}, - "title": {"dataType":"string"}, - "isInCatalog": {"dataType":"string"}, - "isDraft": {"dataType":"string"}, - "contacts": {"dataType":"array","array":{"dataType":"refObject","ref":"DatasetContact"}}, - "resources": {"dataType":"array","array":{"dataType":"refObject","ref":"DatasetResource"}}, - "extSource": {"dataType":"string"}, - "extRecordHash": {"dataType":"string"}, - "tags": {"dataType":"array","array":{"dataType":"string"}}, - "organization": {"ref":"OrganizationRefID"}, - "organizationUnit": {"ref":"OrganizationUnitRefID"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "BatchResult": { - "dataType": "refObject", - "properties": { - "status": {"dataType":"double","required":true}, - "result": {"dataType":"string","required":true}, - "reason": {"dataType":"string"}, - "id": {"dataType":"string"}, - "ownedBy": {"dataType":"string"}, - "childResults": {"dataType":"array","array":{"dataType":"refObject","ref":"BatchResult"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DraftDataset": { - "dataType": "refObject", - "properties": { - "name": {"dataType":"string"}, - "license_title": {"dataType":"string"}, - "security_class": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["HIGH-CABINET"]},{"dataType":"enum","enums":["HIGH-CONFIDENTIAL"]},{"dataType":"enum","enums":["HIGH-SENSITIVITY"]},{"dataType":"enum","enums":["MEDIUM-SENSITIVITY"]},{"dataType":"enum","enums":["MEDIUM-PERSONAL"]},{"dataType":"enum","enums":["LOW-SENSITIVITY"]},{"dataType":"enum","enums":["LOW-PUBLIC"]},{"dataType":"enum","enums":["PUBLIC"]},{"dataType":"enum","enums":["PROTECTED A"]},{"dataType":"enum","enums":["PROTECTED B"]},{"dataType":"enum","enums":["PROTECTED C"]}]}, - "view_audience": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["Public"]},{"dataType":"enum","enums":["Government"]},{"dataType":"enum","enums":["Named users"]},{"dataType":"enum","enums":["Government and Business BCeID"]}]}, - "download_audience": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["Public"]},{"dataType":"enum","enums":["Government"]},{"dataType":"enum","enums":["Named users"]},{"dataType":"enum","enums":["Government and Business BCeID"]}]}, - "record_publish_date": {"dataType":"string"}, - "notes": {"dataType":"string"}, - "title": {"dataType":"string"}, - "isInCatalog": {"dataType":"boolean"}, - "isDraft": {"dataType":"boolean"}, - "contacts": {"dataType":"array","array":{"dataType":"refObject","ref":"DatasetContact"}}, - "resources": {"dataType":"array","array":{"dataType":"refObject","ref":"DatasetResource"}}, - "tags": {"dataType":"array","array":{"dataType":"string"}}, - "organization": {"ref":"OrganizationRefID"}, - "organizationUnit": {"ref":"OrganizationUnitRefID"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Gateway": { - "dataType": "refObject", - "properties": { - "gatewayId": {"dataType":"string"}, - "displayName": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ActivityDetail": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string"}, - "message": {"dataType":"string","required":true}, - "params": {"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"dataType":"string"},"required":true}, - "activityAt": {"dataType":"any","required":true}, - "blob": {"dataType":"any"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "PublishResult": { - "dataType": "refObject", - "properties": { - "message": {"dataType":"string"}, - "results": {"dataType":"string"}, - "error": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "GatewayServiceRefID": { - "dataType": "refAlias", - "type": {"dataType":"string","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "GatewayRouteRefID": { - "dataType": "refAlias", - "type": {"dataType":"string","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "GatewayPlugin": { - "dataType": "refObject", - "properties": { - "extForeignKey": {"dataType":"string"}, - "name": {"dataType":"string"}, - "extSource": {"dataType":"string"}, - "extRecordHash": {"dataType":"string"}, - "tags": {"dataType":"array","array":{"dataType":"string"}}, - "config": {"dataType":"any"}, - "service": {"ref":"GatewayServiceRefID"}, - "route": {"ref":"GatewayRouteRefID"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "GatewayRoute": { - "dataType": "refObject", - "properties": { - "extForeignKey": {"dataType":"string"}, - "name": {"dataType":"string"}, - "gatewayId": {"dataType":"string"}, - "extSource": {"dataType":"string"}, - "extRecordHash": {"dataType":"string"}, - "tags": {"dataType":"array","array":{"dataType":"string"}}, - "methods": {"dataType":"array","array":{"dataType":"string"}}, - "paths": {"dataType":"array","array":{"dataType":"string"}}, - "hosts": {"dataType":"array","array":{"dataType":"string"}}, - "service": {"ref":"GatewayServiceRefID"}, - "plugins": {"dataType":"array","array":{"dataType":"refObject","ref":"GatewayPlugin"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "IssuerEnvironmentConfig": { - "dataType": "refObject", - "properties": { - "environment": {"dataType":"string"}, - "exists": {"dataType":"boolean"}, - "issuerUrl": {"dataType":"string"}, - "clientRegistration": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["anonymous"]},{"dataType":"enum","enums":["managed"]},{"dataType":"enum","enums":["iat"]}]}, - "clientId": {"dataType":"string"}, - "clientSecret": {"dataType":"string"}, - "initialAccessToken": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "undefinedRefID": { - "dataType": "refAlias", - "type": {"dataType":"string","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialIssuer": { - "dataType": "refObject", - "properties": { - "name": {"dataType":"string"}, - "gatewayId": {"dataType":"string"}, - "description": {"dataType":"string"}, - "flow": {"dataType":"enum","enums":["client-credentials"]}, - "mode": {"dataType":"enum","enums":["auto"]}, - "authPlugin": {"dataType":"string"}, - "clientAuthenticator": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["client-secret"]},{"dataType":"enum","enums":["client-jwt"]},{"dataType":"enum","enums":["client-jwt-jwks-url"]}]}, - "instruction": {"dataType":"string"}, - "environmentDetails": {"dataType":"array","array":{"dataType":"refObject","ref":"IssuerEnvironmentConfig"}}, - "resourceType": {"dataType":"string"}, - "resourceAccessScope": {"dataType":"string"}, - "isShared": {"dataType":"boolean"}, - "apiKeyName": {"dataType":"string"}, - "availableScopes": {"dataType":"array","array":{"dataType":"string"}}, - "resourceScopes": {"dataType":"array","array":{"dataType":"string"}}, - "clientRoles": {"dataType":"array","array":{"dataType":"string"}}, - "clientMappers": {"dataType":"array","array":{"dataType":"string"}}, - "inheritFrom": {"ref":"undefinedRefID"}, - "owner": {"ref":"undefinedRefID"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OrganizationUnit": { - "dataType": "refObject", - "properties": { - "extForeignKey": {"dataType":"string"}, - "name": {"dataType":"string"}, - "sector": {"dataType":"string"}, - "title": {"dataType":"string"}, - "description": {"dataType":"string"}, - "extSource": {"dataType":"string"}, - "extRecordHash": {"dataType":"string"}, - "tags": {"dataType":"array","array":{"dataType":"string"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Organization": { - "dataType": "refObject", - "properties": { - "extForeignKey": {"dataType":"string"}, - "name": {"dataType":"string"}, - "sector": {"dataType":"string"}, - "title": {"dataType":"string"}, - "description": {"dataType":"string"}, - "extSource": {"dataType":"string"}, - "extRecordHash": {"dataType":"string"}, - "tags": {"dataType":"array","array":{"dataType":"string"}}, - "orgUnits": {"dataType":"array","array":{"dataType":"refObject","ref":"OrganizationUnit"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "GroupPermission": { - "dataType": "refObject", - "properties": { - "resource": {"dataType":"string"}, - "scopes": {"dataType":"array","array":{"dataType":"string"},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "GroupRole": { - "dataType": "refObject", - "properties": { - "name": {"dataType":"string","required":true}, - "permissions": {"dataType":"array","array":{"dataType":"refObject","ref":"GroupPermission"},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "GroupAccess": { - "dataType": "refObject", - "properties": { - "name": {"dataType":"string"}, - "parent": {"dataType":"string"}, - "roles": {"dataType":"array","array":{"dataType":"refObject","ref":"GroupRole"},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "UserReference": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string"}, - "email": {"dataType":"string"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "GroupMember": { - "dataType": "refObject", - "properties": { - "member": {"ref":"UserReference","required":true}, - "roles": {"dataType":"array","array":{"dataType":"string"},"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "GroupMembership": { - "dataType": "refObject", - "properties": { - "name": {"dataType":"string"}, - "parent": {"dataType":"string"}, - "members": {"dataType":"array","array":{"dataType":"refObject","ref":"GroupMember"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "OrgNamespace": { - "dataType": "refObject", - "properties": { - "name": {"dataType":"string","required":true}, - "orgUnit": {"dataType":"string","required":true}, - "enabled": {"dataType":"boolean","required":true}, - "updatedAt": {"dataType":"double","required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DraftDatasetRefID": { - "dataType": "refAlias", - "type": {"dataType":"string","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "LegalRefID": { - "dataType": "refAlias", - "type": {"dataType":"string","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "CredentialIssuerRefID": { - "dataType": "refAlias", - "type": {"dataType":"string","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Environment": { - "dataType": "refObject", - "properties": { - "appId": {"dataType":"string"}, - "name": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["dev"]},{"dataType":"enum","enums":["test"]},{"dataType":"enum","enums":["prod"]},{"dataType":"enum","enums":["sandbox"]},{"dataType":"enum","enums":["other"]}]}, - "active": {"dataType":"boolean"}, - "approval": {"dataType":"boolean"}, - "flow": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["public"]},{"dataType":"enum","enums":["protected-externally"]},{"dataType":"enum","enums":["authorization-code"]},{"dataType":"enum","enums":["client-credentials"]},{"dataType":"enum","enums":["kong-acl-only"]},{"dataType":"enum","enums":["kong-api-key-only"]},{"dataType":"enum","enums":["kong-api-key-acl"]}]}, - "additionalDetailsToRequest": {"dataType":"string"}, - "services": {"dataType":"array","array":{"dataType":"refAlias","ref":"GatewayServiceRefID"}}, - "legal": {"ref":"LegalRefID"}, - "credentialIssuer": {"ref":"CredentialIssuerRefID"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Product": { - "dataType": "refObject", - "properties": { - "appId": {"dataType":"string"}, - "name": {"dataType":"string"}, - "description": {"dataType":"string"}, - "gatewayId": {"dataType":"string"}, - "dataset": {"ref":"DraftDatasetRefID"}, - "environments": {"dataType":"array","array":{"dataType":"refObject","ref":"Environment"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -}; -const validationService = new ValidationService(models); - -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - -export function RegisterRoutes(app: express.Router) { - // ########################################################################################################### - // NOTE: If you do not see routes for all of your controllers in this file, then you might not have informed tsoa of where to look - // Please look into the "controllerPathGlobs" config option described in the readme: https://github.com/lukeautry/tsoa - // ########################################################################################################### - app.get('/ds/api/v3/organizations/:org/datasets', - authenticateMiddleware([{"jwt":["Dataset.Manage"]}]), - - async function OrgDatasetController_getDatasets(request: any, response: any, next: any) { - const args = { - org: {"in":"path","name":"org","required":true,"dataType":"string"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OrgDatasetController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.getDatasets.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.put('/ds/api/v3/organizations/:org/datasets', - authenticateMiddleware([{"jwt":["Dataset.Manage"]}]), - - async function OrgDatasetController_putDataset(request: any, response: any, next: any) { - const args = { - org: {"in":"path","name":"org","required":true,"dataType":"string"}, - body: {"in":"body","name":"body","required":true,"ref":"DraftDataset"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OrgDatasetController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.putDataset.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.delete('/ds/api/v3/organizations/:org/datasets/:name', - authenticateMiddleware([{"jwt":["Dataset.Manage"]}]), - - async function OrgDatasetController_delete(request: any, response: any, next: any) { - const args = { - org: {"in":"path","name":"org","required":true,"dataType":"string"}, - name: {"in":"path","name":"name","required":true,"dataType":"string"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OrgDatasetController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.delete.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/organizations/:org/datasets/:name', - authenticateMiddleware([{"jwt":["Dataset.Manage"]}]), - - async function OrgDatasetController_getDataset(request: any, response: any, next: any) { - const args = { - org: {"in":"path","name":"org","required":true,"dataType":"string"}, - name: {"in":"path","name":"name","required":true,"dataType":"string"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OrgDatasetController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.getDataset.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/directory', - - async function DirectoryController_list(request: any, response: any, next: any) { - const args = { - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(DirectoryController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.list.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/directory/:id', - - async function DirectoryController_get(request: any, response: any, next: any) { - const args = { - id: {"in":"path","name":"id","required":true,"dataType":"string"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(DirectoryController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.get.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.put('/ds/api/v3/gateways/:gatewayId/datasets', - authenticateMiddleware([{"jwt":["Namespace.Manage"]}]), - - async function DatasetController_put(request: any, response: any, next: any) { - const args = { - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - body: {"in":"body","name":"body","required":true,"ref":"DraftDataset"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(DatasetController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.put.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/gateways/:gatewayId/datasets/:name', - authenticateMiddleware([{"jwt":["Namespace.Manage"]}]), - - async function DatasetController_getDataset(request: any, response: any, next: any) { - const args = { - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - name: {"in":"path","name":"name","required":true,"dataType":"string"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(DatasetController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.getDataset.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/routes/availability', - - async function EndpointsController_check(request: any, response: any, next: any) { - const args = { - serviceName: {"in":"query","name":"serviceName","required":true,"dataType":"string"}, - gatewayId: {"in":"query","name":"gatewayId","required":true,"dataType":"string"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(EndpointsController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.check.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/gateways/report', - authenticateMiddleware([{"jwt":[]}]), - - async function NamespaceController_report(request: any, response: any, next: any) { - const args = { - req: {"in":"request","name":"req","required":true,"dataType":"object"}, - ids: {"default":"[]","in":"query","name":"ids","dataType":"string"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(NamespaceController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.report.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/gateways', - authenticateMiddleware([{"jwt":[]}]), - - async function NamespaceController_list(request: any, response: any, next: any) { - const args = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(NamespaceController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.list.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/gateways/:gatewayId', - authenticateMiddleware([{"jwt":["Namespace.Manage"]}]), - - async function NamespaceController_profile(request: any, response: any, next: any) { - const args = { - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(NamespaceController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.profile.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/ds/api/v3/gateways', - authenticateMiddleware([{"jwt":[]}]), - - async function NamespaceController_create(request: any, response: any, next: any) { - const args = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - vars: {"in":"body","name":"vars","required":true,"ref":"Gateway"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(NamespaceController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.create.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.delete('/ds/api/v3/gateways/:gatewayId', - authenticateMiddleware([{"jwt":["Namespace.Manage"]}]), - - async function NamespaceController_delete(request: any, response: any, next: any) { - const args = { - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - force: {"default":false,"in":"query","name":"force","dataType":"boolean"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(NamespaceController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.delete.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/gateways/:gatewayId/activity', - authenticateMiddleware([{"jwt":["Namespace.View"]}]), - - async function NamespaceController_namespaceActivity(request: any, response: any, next: any) { - const args = { - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - first: {"default":20,"in":"query","name":"first","dataType":"double"}, - skip: {"default":0,"in":"query","name":"skip","dataType":"double"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(NamespaceController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.namespaceActivity.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/gateways/:gatewayId/links', - authenticateMiddleware([{"jwt":["Namespace.Manage"]}]), - - async function NamespaceController_get(request: any, response: any, next: any) { - const args = { - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(NamespaceController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.get.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/gateways/:gatewayId/directory/:id', - authenticateMiddleware([{"jwt":["Namespace.Manage"]}]), - - async function GatewayDirectoryController_getDataset(request: any, response: any, next: any) { - const args = { - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - id: {"in":"path","name":"id","required":true,"dataType":"string"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(GatewayDirectoryController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.getDataset.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/gateways/:gatewayId/directory', - authenticateMiddleware([{"jwt":["Namespace.Manage"]}]), - - async function GatewayDirectoryController_getDatasets(request: any, response: any, next: any) { - const args = { - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(GatewayDirectoryController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.getDatasets.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.put('/ds/api/v3/gateways/:gatewayId/services', - authenticateMiddleware([{"jwt":["Gateway.Config"]}]), - upload.single('configFile'), - - async function GatewayController_put(request: any, response: any, next: any) { - const args = { - dryRun: {"in":"formData","name":"dryRun","required":true,"dataType":"string"}, - configFile: {"in":"formData","name":"configFile","required":true,"dataType":"file"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(GatewayController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.put.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/gateways/:gatewayId/services', - authenticateMiddleware([{"jwt":["Namespace.Manage"]}]), - - async function GatewayController_getServices(request: any, response: any, next: any) { - const args = { - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(GatewayController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.getServices.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/identifiers/:type', - - async function IdentifiersController_getNewID(request: any, response: any, next: any) { - const args = { - type: {"in":"path","name":"type","required":true,"dataType":"union","subSchemas":[{"dataType":"enum","enums":["environment"]},{"dataType":"enum","enums":["product"]},{"dataType":"enum","enums":["application"]},{"dataType":"enum","enums":["gateway"]}]}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(IdentifiersController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.getNewID.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.put('/ds/api/v3/gateways/:gatewayId/issuers', - authenticateMiddleware([{"jwt":["CredentialIssuer.Admin"]}]), - - async function IssuerController_put(request: any, response: any, next: any) { - const args = { - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - body: {"in":"body","name":"body","required":true,"ref":"CredentialIssuer"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(IssuerController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.put.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/gateways/:gatewayId/issuers', - authenticateMiddleware([{"jwt":["Namespace.Manage"]}]), - - async function IssuerController_get(request: any, response: any, next: any) { - const args = { - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(IssuerController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.get.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.delete('/ds/api/v3/gateways/:gatewayId/issuers/:name', - authenticateMiddleware([{"jwt":["CredentialIssuer.Admin"]}]), - - async function IssuerController_delete(request: any, response: any, next: any) { - const args = { - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - name: {"in":"path","name":"name","required":true,"dataType":"string"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(IssuerController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.delete.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/organizations', - - async function OrganizationController_listOrganizations(request: any, response: any, next: any) { - const args = { - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OrganizationController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.listOrganizations.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.put('/ds/api/v3/organizations/:org', - authenticateMiddleware([{"jwt":["GroupAccess.Manage"]}]), - - async function OrganizationController_post(request: any, response: any, next: any) { - const args = { - org: {"in":"path","name":"org","required":true,"dataType":"string"}, - body: {"in":"body","name":"body","required":true,"ref":"Organization"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OrganizationController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.post.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/organizations/:org', - - async function OrganizationController_listOrganizationUnits(request: any, response: any, next: any) { - const args = { - org: {"in":"path","name":"org","required":true,"dataType":"string"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OrganizationController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.listOrganizationUnits.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/organizations/:org/roles', - authenticateMiddleware([{"jwt":["GroupAccess.Manage"]}]), - - async function OrganizationController_getPolicies(request: any, response: any, next: any) { - const args = { - org: {"in":"path","name":"org","required":true,"dataType":"string"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OrganizationController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.getPolicies.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/organizations/:org/access', - authenticateMiddleware([{"jwt":["GroupAccess.Manage"]}]), - - async function OrganizationController_get(request: any, response: any, next: any) { - const args = { - org: {"in":"path","name":"org","required":true,"dataType":"string"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OrganizationController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.get.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.put('/ds/api/v3/organizations/:org/access', - authenticateMiddleware([{"jwt":["GroupAccess.Manage"]}]), - - async function OrganizationController_put(request: any, response: any, next: any) { - const args = { - org: {"in":"path","name":"org","required":true,"dataType":"string"}, - body: {"in":"body","name":"body","required":true,"ref":"GroupMembership"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OrganizationController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.put.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/organizations/:org/gateways', - authenticateMiddleware([{"jwt":["Namespace.Assign"]}]), - - async function OrganizationController_listNamespaces(request: any, response: any, next: any) { - const args = { - org: {"in":"path","name":"org","required":true,"dataType":"string"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OrganizationController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.listNamespaces.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.put('/ds/api/v3/organizations/:org/:orgUnit/gateways/:gatewayId', - authenticateMiddleware([{"jwt":["Namespace.Assign"]}]), - - async function OrganizationController_assignNamespace(request: any, response: any, next: any) { - const args = { - org: {"in":"path","name":"org","required":true,"dataType":"string"}, - orgUnit: {"in":"path","name":"orgUnit","required":true,"dataType":"string"}, - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - enable: {"default":true,"in":"query","name":"enable","dataType":"boolean"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OrganizationController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.assignNamespace.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.delete('/ds/api/v3/organizations/:org/:orgUnit/gateways/:gatewayId', - authenticateMiddleware([{"jwt":["Namespace.Assign"]}]), - - async function OrganizationController_unassignNamespace(request: any, response: any, next: any) { - const args = { - org: {"in":"path","name":"org","required":true,"dataType":"string"}, - orgUnit: {"in":"path","name":"orgUnit","required":true,"dataType":"string"}, - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OrganizationController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.unassignNamespace.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/organizations/:org/activity', - authenticateMiddleware([{"jwt":["Namespace.Assign"]}]), - - async function OrganizationController_namespaceActivity(request: any, response: any, next: any) { - const args = { - org: {"in":"path","name":"org","required":true,"dataType":"string"}, - first: {"default":20,"in":"query","name":"first","dataType":"double"}, - skip: {"default":0,"in":"query","name":"skip","dataType":"double"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OrganizationController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.namespaceActivity.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/roles', - - async function OrgRoleController_getRoles(request: any, response: any, next: any) { - const args = { - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(OrgRoleController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.getRoles.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.put('/ds/api/v3/gateways/:gatewayId/products', - authenticateMiddleware([{"jwt":["Namespace.Manage"]}]), - - async function ProductController_put(request: any, response: any, next: any) { - const args = { - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - body: {"in":"body","name":"body","required":true,"ref":"Product"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ProductController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.put.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/ds/api/v3/gateways/:gatewayId/products', - authenticateMiddleware([{"jwt":["Namespace.Manage"]}]), - - async function ProductController_get(request: any, response: any, next: any) { - const args = { - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ProductController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.get.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.delete('/ds/api/v3/gateways/:gatewayId/products/:appId', - authenticateMiddleware([{"jwt":["Namespace.Manage"]}]), - - async function ProductController_delete(request: any, response: any, next: any) { - const args = { - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - appId: {"in":"path","name":"appId","required":true,"dataType":"string"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ProductController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.delete.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.delete('/ds/api/v3/gateways/:gatewayId/environments/:appId', - authenticateMiddleware([{"jwt":["Namespace.Manage"]}]), - - async function ProductController_deleteEnvironment(request: any, response: any, next: any) { - const args = { - gatewayId: {"in":"path","name":"gatewayId","required":true,"dataType":"string"}, - appId: {"in":"path","name":"appId","required":true,"dataType":"string"}, - force: {"default":false,"in":"query","name":"force","dataType":"boolean"}, - request: {"in":"request","name":"request","required":true,"dataType":"object"}, - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - let validatedArgs: any[] = []; - try { - validatedArgs = getValidatedArgs(args, request, response); - - const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; - - const controller: any = await container.get(ProductController); - if (typeof controller['setStatus'] === 'function') { - controller.setStatus(undefined); - } - - - const promise = controller.deleteEnvironment.apply(controller, validatedArgs as any); - promiseHandler(controller, promise, response, undefined, next); - } catch (err) { - return next(err); - } - }); - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - function authenticateMiddleware(security: TsoaRoute.Security[] = []) { - return async function runAuthenticationMiddleware(request: any, _response: any, next: any) { - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - // keep track of failed auth attempts so we can hand back the most - // recent one. This behavior was previously existing so preserving it - // here - const failedAttempts: any[] = []; - const pushAndRethrow = (error: any) => { - failedAttempts.push(error); - throw error; - }; - - const secMethodOrPromises: Promise[] = []; - for (const secMethod of security) { - if (Object.keys(secMethod).length > 1) { - const secMethodAndPromises: Promise[] = []; - - for (const name in secMethod) { - secMethodAndPromises.push( - expressAuthentication(request, name, secMethod[name]) - .catch(pushAndRethrow) - ); - } - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - secMethodOrPromises.push(Promise.all(secMethodAndPromises) - .then(users => { return users[0]; })); - } else { - for (const name in secMethod) { - secMethodOrPromises.push( - expressAuthentication(request, name, secMethod[name]) - .catch(pushAndRethrow) - ); - } - } - } - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - try { - request['user'] = await promiseAny(secMethodOrPromises); - next(); - } - catch(err) { - // Show most recent error as response - const error = failedAttempts.pop(); - error.status = error.status || 401; - next(error); - } - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - } - } - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - function isController(object: any): object is Controller { - return 'getHeaders' in object && 'getStatus' in object && 'setStatus' in object; - } - - function promiseHandler(controllerObj: any, promise: any, response: any, successStatus: any, next: any) { - return Promise.resolve(promise) - .then((data: any) => { - let statusCode = successStatus; - let headers; - if (isController(controllerObj)) { - headers = controllerObj.getHeaders(); - statusCode = controllerObj.getStatus() || statusCode; - } - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - returnHandler(response, statusCode, data, headers) - }) - .catch((error: any) => next(error)); - } - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - function returnHandler(response: any, statusCode?: number, data?: any, headers: any = {}) { - if (response.headersSent) { - return; - } - Object.keys(headers).forEach((name: string) => { - response.set(name, headers[name]); - }); - if (data && typeof data.pipe === 'function' && data.readable && typeof data._read === 'function') { - data.pipe(response); - } else if (data !== null && data !== undefined) { - response.status(statusCode || 200).json(data); - } else { - response.status(statusCode || 204).end(); - } - } - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - function responder(response: any): TsoaResponse { - return function(status, data, headers) { - returnHandler(response, status, data, headers); - }; - }; - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - - function getValidatedArgs(args: any, request: any, response: any): any[] { - const fieldErrors: FieldErrors = {}; - const values = Object.keys(args).map((key) => { - const name = args[key].name; - switch (args[key].in) { - case 'request': - return request; - case 'query': - return validationService.ValidateParam(args[key], request.query[name], name, fieldErrors, undefined, {"noImplicitAdditionalProperties":"throw-on-extras"}); - case 'path': - return validationService.ValidateParam(args[key], request.params[name], name, fieldErrors, undefined, {"noImplicitAdditionalProperties":"throw-on-extras"}); - case 'header': - return validationService.ValidateParam(args[key], request.header(name), name, fieldErrors, undefined, {"noImplicitAdditionalProperties":"throw-on-extras"}); - case 'body': - return validationService.ValidateParam(args[key], request.body, name, fieldErrors, undefined, {"noImplicitAdditionalProperties":"throw-on-extras"}); - case 'body-prop': - return validationService.ValidateParam(args[key], request.body[name], name, fieldErrors, 'body.', {"noImplicitAdditionalProperties":"throw-on-extras"}); - case 'formData': - if (args[key].dataType === 'file') { - return validationService.ValidateParam(args[key], request.file, name, fieldErrors, undefined, {"noImplicitAdditionalProperties":"throw-on-extras"}); - } else if (args[key].dataType === 'array' && args[key].array.dataType === 'file') { - return validationService.ValidateParam(args[key], request.files, name, fieldErrors, undefined, {"noImplicitAdditionalProperties":"throw-on-extras"}); - } else { - return validationService.ValidateParam(args[key], request.body[name], name, fieldErrors, undefined, {"noImplicitAdditionalProperties":"throw-on-extras"}); - } - case 'res': - return responder(response); - } - }); - - if (Object.keys(fieldErrors).length > 0) { - throw new ValidateError(fieldErrors, ''); - } - return values; - } - - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -} - -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa