Skip to content

Commit

Permalink
build: Typescript connect updates
Browse files Browse the repository at this point in the history
  • Loading branch information
fundthmcalculus committed Jun 4, 2024
1 parent 5724e1d commit 94d0755
Show file tree
Hide file tree
Showing 31 changed files with 2,365 additions and 585 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build-connect-typescript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,11 @@ jobs:
run: ./devops/make-swagger.ps1 -language ${{ matrix.language[0] }} -swaggerFile ${{ matrix.swagger_json }} -outputFolder ${{ matrix.language[1] }}
shell: pwsh

- uses: stefanzweifel/git-auto-commit-action@v4
- name: Format code
run: |
npm ci
npm run build:prettier
working-directory: connect/typescript

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,4 @@ samples/grpc-web/build/
samples/grpc-web/lib/
samples/grpc-web/coverage/
web/dist/
connect/typescript/lib
241 changes: 153 additions & 88 deletions connect/typescript/apis/SessionApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,24 @@
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v1
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


import * as runtime from '../runtime';
import * as runtime from "../runtime";
import type {
CancelSessionResponse,
CreateSessionRequest,
CreateSessionResponse,
FailureMessage,
GetSessionResponseV1,
ListSessionsRequest,
ListSessionsResponseV1,
ValidationResult,
} from '../models/index';
CancelSessionResponse,
CreateSessionRequest,
CreateSessionResponse,
FailureMessage,
GetSessionResponseV1,
ListSessionsRequest,
ListSessionsResponseV1,
ValidationResult,
} from "../models/index";
import {
CancelSessionResponseFromJSON,
CancelSessionResponseToJSON,
Expand All @@ -41,7 +40,7 @@ import {
ListSessionsResponseV1ToJSON,
ValidationResultFromJSON,
ValidationResultToJSON,
} from '../models/index';
} from "../models/index";

export interface SessionCancelSessionRequest {
trinsicAuthorization: string;
Expand All @@ -64,30 +63,34 @@ export interface SessionListSessionsRequest {
}

/**
*
*
*/
export class SessionApi extends runtime.BaseAPI {

/**
*/
async sessionCancelSessionRaw(requestParameters: SessionCancelSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CancelSessionResponse>> {
if (requestParameters['trinsicAuthorization'] == null) {
async sessionCancelSessionRaw(
requestParameters: SessionCancelSessionRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<CancelSessionResponse>> {
if (requestParameters["trinsicAuthorization"] == null) {
throw new runtime.RequiredError(
'trinsicAuthorization',
'Required parameter "trinsicAuthorization" was null or undefined when calling sessionCancelSession().'
"trinsicAuthorization",
'Required parameter "trinsicAuthorization" was null or undefined when calling sessionCancelSession().',
);
}

const queryParameters: any = {};

if (requestParameters['sessionId'] != null) {
queryParameters['sessionId'] = requestParameters['sessionId'];
if (requestParameters["sessionId"] != null) {
queryParameters["sessionId"] = requestParameters["sessionId"];
}

const headerParameters: runtime.HTTPHeaders = {};

if (requestParameters['trinsicAuthorization'] != null) {
headerParameters['TrinsicAuthorization'] = String(requestParameters['trinsicAuthorization']);
if (requestParameters["trinsicAuthorization"] != null) {
headerParameters["TrinsicAuthorization"] = String(
requestParameters["trinsicAuthorization"],
);
}

if (this.configuration && this.configuration.accessToken) {
Expand All @@ -98,41 +101,57 @@ export class SessionApi extends runtime.BaseAPI {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/sessions/cancel`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => CancelSessionResponseFromJSON(jsonValue));
const response = await this.request(
{
path: `/v1/sessions/cancel`,
method: "POST",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);

return new runtime.JSONApiResponse(response, (jsonValue) =>
CancelSessionResponseFromJSON(jsonValue),
);
}

/**
*/
async sessionCancelSession(requestParameters: SessionCancelSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CancelSessionResponse> {
const response = await this.sessionCancelSessionRaw(requestParameters, initOverrides);
async sessionCancelSession(
requestParameters: SessionCancelSessionRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<CancelSessionResponse> {
const response = await this.sessionCancelSessionRaw(
requestParameters,
initOverrides,
);
return await response.value();
}

/**
*/
async sessionCreateSessionRaw(requestParameters: SessionCreateSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateSessionResponse>> {
if (requestParameters['trinsicAuthorization'] == null) {
async sessionCreateSessionRaw(
requestParameters: SessionCreateSessionRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<CreateSessionResponse>> {
if (requestParameters["trinsicAuthorization"] == null) {
throw new runtime.RequiredError(
'trinsicAuthorization',
'Required parameter "trinsicAuthorization" was null or undefined when calling sessionCreateSession().'
"trinsicAuthorization",
'Required parameter "trinsicAuthorization" was null or undefined when calling sessionCreateSession().',
);
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';
headerParameters["Content-Type"] = "application/json";

if (requestParameters['trinsicAuthorization'] != null) {
headerParameters['TrinsicAuthorization'] = String(requestParameters['trinsicAuthorization']);
if (requestParameters["trinsicAuthorization"] != null) {
headerParameters["TrinsicAuthorization"] = String(
requestParameters["trinsicAuthorization"],
);
}

if (this.configuration && this.configuration.accessToken) {
Expand All @@ -143,44 +162,62 @@ export class SessionApi extends runtime.BaseAPI {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/sessions`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: CreateSessionRequestToJSON(requestParameters['createSessionRequest']),
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => CreateSessionResponseFromJSON(jsonValue));
const response = await this.request(
{
path: `/v1/sessions`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: CreateSessionRequestToJSON(
requestParameters["createSessionRequest"],
),
},
initOverrides,
);

return new runtime.JSONApiResponse(response, (jsonValue) =>
CreateSessionResponseFromJSON(jsonValue),
);
}

/**
*/
async sessionCreateSession(requestParameters: SessionCreateSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateSessionResponse> {
const response = await this.sessionCreateSessionRaw(requestParameters, initOverrides);
async sessionCreateSession(
requestParameters: SessionCreateSessionRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<CreateSessionResponse> {
const response = await this.sessionCreateSessionRaw(
requestParameters,
initOverrides,
);
return await response.value();
}

/**
*/
async sessionGetSessionRaw(requestParameters: SessionGetSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetSessionResponseV1>> {
if (requestParameters['trinsicAuthorization'] == null) {
async sessionGetSessionRaw(
requestParameters: SessionGetSessionRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<GetSessionResponseV1>> {
if (requestParameters["trinsicAuthorization"] == null) {
throw new runtime.RequiredError(
'trinsicAuthorization',
'Required parameter "trinsicAuthorization" was null or undefined when calling sessionGetSession().'
"trinsicAuthorization",
'Required parameter "trinsicAuthorization" was null or undefined when calling sessionGetSession().',
);
}

const queryParameters: any = {};

if (requestParameters['sessionId'] != null) {
queryParameters['sessionId'] = requestParameters['sessionId'];
if (requestParameters["sessionId"] != null) {
queryParameters["sessionId"] = requestParameters["sessionId"];
}

const headerParameters: runtime.HTTPHeaders = {};

if (requestParameters['trinsicAuthorization'] != null) {
headerParameters['TrinsicAuthorization'] = String(requestParameters['trinsicAuthorization']);
if (requestParameters["trinsicAuthorization"] != null) {
headerParameters["TrinsicAuthorization"] = String(
requestParameters["trinsicAuthorization"],
);
}

if (this.configuration && this.configuration.accessToken) {
Expand All @@ -191,41 +228,57 @@ export class SessionApi extends runtime.BaseAPI {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/sessions/get`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => GetSessionResponseV1FromJSON(jsonValue));
const response = await this.request(
{
path: `/v1/sessions/get`,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);

return new runtime.JSONApiResponse(response, (jsonValue) =>
GetSessionResponseV1FromJSON(jsonValue),
);
}

/**
*/
async sessionGetSession(requestParameters: SessionGetSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetSessionResponseV1> {
const response = await this.sessionGetSessionRaw(requestParameters, initOverrides);
async sessionGetSession(
requestParameters: SessionGetSessionRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<GetSessionResponseV1> {
const response = await this.sessionGetSessionRaw(
requestParameters,
initOverrides,
);
return await response.value();
}

/**
*/
async sessionListSessionsRaw(requestParameters: SessionListSessionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListSessionsResponseV1>> {
if (requestParameters['trinsicAuthorization'] == null) {
async sessionListSessionsRaw(
requestParameters: SessionListSessionsRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<ListSessionsResponseV1>> {
if (requestParameters["trinsicAuthorization"] == null) {
throw new runtime.RequiredError(
'trinsicAuthorization',
'Required parameter "trinsicAuthorization" was null or undefined when calling sessionListSessions().'
"trinsicAuthorization",
'Required parameter "trinsicAuthorization" was null or undefined when calling sessionListSessions().',
);
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';
headerParameters["Content-Type"] = "application/json";

if (requestParameters['trinsicAuthorization'] != null) {
headerParameters['TrinsicAuthorization'] = String(requestParameters['trinsicAuthorization']);
if (requestParameters["trinsicAuthorization"] != null) {
headerParameters["TrinsicAuthorization"] = String(
requestParameters["trinsicAuthorization"],
);
}

if (this.configuration && this.configuration.accessToken) {
Expand All @@ -236,22 +289,34 @@ export class SessionApi extends runtime.BaseAPI {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/sessions/list`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ListSessionsRequestToJSON(requestParameters['listSessionsRequest']),
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => ListSessionsResponseV1FromJSON(jsonValue));
const response = await this.request(
{
path: `/v1/sessions/list`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ListSessionsRequestToJSON(
requestParameters["listSessionsRequest"],
),
},
initOverrides,
);

return new runtime.JSONApiResponse(response, (jsonValue) =>
ListSessionsResponseV1FromJSON(jsonValue),
);
}

/**
*/
async sessionListSessions(requestParameters: SessionListSessionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListSessionsResponseV1> {
const response = await this.sessionListSessionsRaw(requestParameters, initOverrides);
async sessionListSessions(
requestParameters: SessionListSessionsRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<ListSessionsResponseV1> {
const response = await this.sessionListSessionsRaw(
requestParameters,
initOverrides,
);
return await response.value();
}

}
2 changes: 1 addition & 1 deletion connect/typescript/apis/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* tslint:disable */
/* eslint-disable */
export * from './SessionApi';
export * from "./SessionApi";
Loading

0 comments on commit 94d0755

Please sign in to comment.