Skip to content

Commit

Permalink
SDK updates
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Apr 4, 2024
1 parent 24752b0 commit 33c930b
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 27 deletions.
3 changes: 2 additions & 1 deletion src/generated/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ models/AppInfo.ts
models/AppResponse.ts
models/AppleUserSocialConnection.ts
models/AuthMethods.ts
models/CreateTransactionRequest.ts
models/CreateTransactionAuthenticateRequest.ts
models/CreateTransactionRegisterRequest.ts
models/CreateTransactionResponse.ts
models/ElementCustomization.ts
models/FontFamily.ts
Expand Down
83 changes: 68 additions & 15 deletions src/generated/apis/TransactionsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

import * as runtime from '../runtime';
import type {
CreateTransactionRequest,
CreateTransactionAuthenticateRequest,
CreateTransactionRegisterRequest,
CreateTransactionResponse,
Model400Error,
Model401Error,
Expand All @@ -25,8 +26,10 @@ import type {
Model500Error,
} from '../models/index';
import {
CreateTransactionRequestFromJSON,
CreateTransactionRequestToJSON,
CreateTransactionAuthenticateRequestFromJSON,
CreateTransactionAuthenticateRequestToJSON,
CreateTransactionRegisterRequestFromJSON,
CreateTransactionRegisterRequestToJSON,
CreateTransactionResponseFromJSON,
CreateTransactionResponseToJSON,
Model400ErrorFromJSON,
Expand All @@ -43,9 +46,14 @@ import {
Model500ErrorToJSON,
} from '../models/index';

export interface CreateTransactionOperationRequest {
export interface CreateAuthenticateTransactionRequest {
appId: string;
createTransactionRequest: CreateTransactionRequest;
createTransactionAuthenticateRequest: CreateTransactionAuthenticateRequest;
}

export interface CreateRegisterTransactionRequest {
appId: string;
createTransactionRegisterRequest: CreateTransactionRegisterRequest;
}

/**
Expand All @@ -54,15 +62,60 @@ export interface CreateTransactionOperationRequest {
export class TransactionsApi extends runtime.BaseAPI {

/**
* Create a transaction to start a user\'s registration or authentication process
* Create a transaction to start a user\'s authentication process
*/
async createAuthenticateTransactionRaw(requestParameters: CreateAuthenticateTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateTransactionResponse>> {
if (requestParameters.appId === null || requestParameters.appId === undefined) {
throw new runtime.RequiredError('appId','Required parameter requestParameters.appId was null or undefined when calling createAuthenticateTransaction.');
}

if (requestParameters.createTransactionAuthenticateRequest === null || requestParameters.createTransactionAuthenticateRequest === undefined) {
throw new runtime.RequiredError('createTransactionAuthenticateRequest','Required parameter requestParameters.createTransactionAuthenticateRequest was null or undefined when calling createAuthenticateTransaction.');
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

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

if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("bearerAuth", []);

if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/apps/{app_id}/transactions/authenticate`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters.appId))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: CreateTransactionAuthenticateRequestToJSON(requestParameters.createTransactionAuthenticateRequest),
}, initOverrides);

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

/**
* Create a transaction to start a user\'s authentication process
*/
async createAuthenticateTransaction(requestParameters: CreateAuthenticateTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateTransactionResponse> {
const response = await this.createAuthenticateTransactionRaw(requestParameters, initOverrides);
return await response.value();
}

/**
* Create a transaction to start a user\'s registration process
*/
async createTransactionRaw(requestParameters: CreateTransactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateTransactionResponse>> {
async createRegisterTransactionRaw(requestParameters: CreateRegisterTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateTransactionResponse>> {
if (requestParameters.appId === null || requestParameters.appId === undefined) {
throw new runtime.RequiredError('appId','Required parameter requestParameters.appId was null or undefined when calling createTransaction.');
throw new runtime.RequiredError('appId','Required parameter requestParameters.appId was null or undefined when calling createRegisterTransaction.');
}

if (requestParameters.createTransactionRequest === null || requestParameters.createTransactionRequest === undefined) {
throw new runtime.RequiredError('createTransactionRequest','Required parameter requestParameters.createTransactionRequest was null or undefined when calling createTransaction.');
if (requestParameters.createTransactionRegisterRequest === null || requestParameters.createTransactionRegisterRequest === undefined) {
throw new runtime.RequiredError('createTransactionRegisterRequest','Required parameter requestParameters.createTransactionRegisterRequest was null or undefined when calling createRegisterTransaction.');
}

const queryParameters: any = {};
Expand All @@ -80,21 +133,21 @@ export class TransactionsApi extends runtime.BaseAPI {
}
}
const response = await this.request({
path: `/apps/{app_id}/transactions`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters.appId))),
path: `/apps/{app_id}/transactions/register`.replace(`{${"app_id"}}`, encodeURIComponent(String(requestParameters.appId))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: CreateTransactionRequestToJSON(requestParameters.createTransactionRequest),
body: CreateTransactionRegisterRequestToJSON(requestParameters.createTransactionRegisterRequest),
}, initOverrides);

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

/**
* Create a transaction to start a user\'s registration or authentication process
* Create a transaction to start a user\'s registration process
*/
async createTransaction(requestParameters: CreateTransactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateTransactionResponse> {
const response = await this.createTransactionRaw(requestParameters, initOverrides);
async createRegisterTransaction(requestParameters: CreateRegisterTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateTransactionResponse> {
const response = await this.createRegisterTransactionRaw(requestParameters, initOverrides);
return await response.value();
}

Expand Down
66 changes: 66 additions & 0 deletions src/generated/models/CreateTransactionAuthenticateRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/* tslint:disable */
/* eslint-disable */
/**
* Passage Management API
* Passage\'s management API to manage your Passage apps and users.
*
* The version of the OpenAPI document: 1
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface CreateTransactionAuthenticateRequest
*/
export interface CreateTransactionAuthenticateRequest {
/**
* the user's unique identifier that will be associated with this transaction
* @type {string}
* @memberof CreateTransactionAuthenticateRequest
*/
externalId: string;
}

/**
* Check if a given object implements the CreateTransactionAuthenticateRequest interface.
*/
export function instanceOfCreateTransactionAuthenticateRequest(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "externalId" in value;

return isInstance;
}

export function CreateTransactionAuthenticateRequestFromJSON(json: any): CreateTransactionAuthenticateRequest {
return CreateTransactionAuthenticateRequestFromJSONTyped(json, false);
}

export function CreateTransactionAuthenticateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTransactionAuthenticateRequest {
if ((json === undefined) || (json === null)) {
return json;
}
return {

'externalId': json['external_id'],
};
}

export function CreateTransactionAuthenticateRequestToJSON(value?: CreateTransactionAuthenticateRequest | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {

'external_id': value.externalId,
};
}

Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,39 @@ import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface CreateTransactionRequest
* @interface CreateTransactionRegisterRequest
*/
export interface CreateTransactionRequest {
export interface CreateTransactionRegisterRequest {
/**
* the user's unique identifier that will be associated with this transaction
* @type {string}
* @memberof CreateTransactionRequest
* @memberof CreateTransactionRegisterRequest
*/
externalId: string;
/**
* the immutable display name of the passkey that the user will see
* @type {string}
* @memberof CreateTransactionRequest
* @memberof CreateTransactionRegisterRequest
*/
passkeyDisplayName: string;
}

/**
* Check if a given object implements the CreateTransactionRequest interface.
* Check if a given object implements the CreateTransactionRegisterRequest interface.
*/
export function instanceOfCreateTransactionRequest(value: object): boolean {
export function instanceOfCreateTransactionRegisterRequest(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "externalId" in value;
isInstance = isInstance && "passkeyDisplayName" in value;

return isInstance;
}

export function CreateTransactionRequestFromJSON(json: any): CreateTransactionRequest {
return CreateTransactionRequestFromJSONTyped(json, false);
export function CreateTransactionRegisterRequestFromJSON(json: any): CreateTransactionRegisterRequest {
return CreateTransactionRegisterRequestFromJSONTyped(json, false);
}

export function CreateTransactionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTransactionRequest {
export function CreateTransactionRegisterRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTransactionRegisterRequest {
if ((json === undefined) || (json === null)) {
return json;
}
Expand All @@ -59,7 +59,7 @@ export function CreateTransactionRequestFromJSONTyped(json: any, ignoreDiscrimin
};
}

export function CreateTransactionRequestToJSON(value?: CreateTransactionRequest | null): any {
export function CreateTransactionRegisterRequestToJSON(value?: CreateTransactionRegisterRequest | null): any {
if (value === undefined) {
return undefined;
}
Expand Down
9 changes: 9 additions & 0 deletions src/generated/models/ListPaginatedUsersItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ export interface ListPaginatedUsersItem {
* @memberof ListPaginatedUsersItem
*/
emailVerified: boolean;
/**
* The external ID of the user. Only set if the user was created in a Flex app.
* @type {string}
* @memberof ListPaginatedUsersItem
*/
externalId: string;
/**
*
* @type {string}
Expand Down Expand Up @@ -102,6 +108,7 @@ export function instanceOfListPaginatedUsersItem(value: object): boolean {
isInstance = isInstance && "createdAt" in value;
isInstance = isInstance && "email" in value;
isInstance = isInstance && "emailVerified" in value;
isInstance = isInstance && "externalId" in value;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "lastLoginAt" in value;
isInstance = isInstance && "loginCount" in value;
Expand All @@ -127,6 +134,7 @@ export function ListPaginatedUsersItemFromJSONTyped(json: any, ignoreDiscriminat
'createdAt': (new Date(json['created_at'])),
'email': json['email'],
'emailVerified': json['email_verified'],
'externalId': json['external_id'],
'id': json['id'],
'lastLoginAt': (new Date(json['last_login_at'])),
'loginCount': json['login_count'],
Expand All @@ -150,6 +158,7 @@ export function ListPaginatedUsersItemToJSON(value?: ListPaginatedUsersItem | nu
'created_at': (value.createdAt.toISOString()),
'email': value.email,
'email_verified': value.emailVerified,
'external_id': value.externalId,
'id': value.id,
'last_login_at': (value.lastLoginAt.toISOString()),
'login_count': value.loginCount,
Expand Down
9 changes: 9 additions & 0 deletions src/generated/models/UserInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ export interface UserInfo {
* @memberof UserInfo
*/
emailVerified: boolean;
/**
* The external ID of the user. Only set if the user was created in a Flex app.
* @type {string}
* @memberof UserInfo
*/
externalId: string;
/**
*
* @type {string}
Expand Down Expand Up @@ -156,6 +162,7 @@ export function instanceOfUserInfo(value: object): boolean {
isInstance = isInstance && "createdAt" in value;
isInstance = isInstance && "email" in value;
isInstance = isInstance && "emailVerified" in value;
isInstance = isInstance && "externalId" in value;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "lastLoginAt" in value;
isInstance = isInstance && "loginCount" in value;
Expand Down Expand Up @@ -186,6 +193,7 @@ export function UserInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean):
'createdAt': (new Date(json['created_at'])),
'email': json['email'],
'emailVerified': json['email_verified'],
'externalId': json['external_id'],
'id': json['id'],
'lastLoginAt': (new Date(json['last_login_at'])),
'loginCount': json['login_count'],
Expand Down Expand Up @@ -214,6 +222,7 @@ export function UserInfoToJSON(value?: UserInfo | null): any {
'created_at': (value.createdAt.toISOString()),
'email': value.email,
'email_verified': value.emailVerified,
'external_id': value.externalId,
'id': value.id,
'last_login_at': (value.lastLoginAt.toISOString()),
'login_count': value.loginCount,
Expand Down
3 changes: 2 additions & 1 deletion src/generated/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ export * from './AppInfo';
export * from './AppResponse';
export * from './AppleUserSocialConnection';
export * from './AuthMethods';
export * from './CreateTransactionRequest';
export * from './CreateTransactionAuthenticateRequest';
export * from './CreateTransactionRegisterRequest';
export * from './CreateTransactionResponse';
export * from './ElementCustomization';
export * from './FontFamily';
Expand Down

0 comments on commit 33c930b

Please sign in to comment.