Skip to content

Commit

Permalink
Updated portal client with custom activities
Browse files Browse the repository at this point in the history
  • Loading branch information
Sumanth Kanakala committed Sep 19, 2023
1 parent ee83e97 commit b05ba76
Show file tree
Hide file tree
Showing 4 changed files with 384 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clients/customer-portal-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epilot/customer-portal-client",
"version": "0.8.46",
"version": "0.8.47",
"description": "API Client for epilot portal API",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
18 changes: 18 additions & 0 deletions clients/customer-portal-client/src/openapi-runtime.json
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,24 @@
]
}
},
"/v2/portal/entity/activity": {
"put": {
"operationId": "createCustomEntityActivity",
"parameters": [
{
"in": "query",
"name": "entities",
"style": "form",
"explode": false
}
],
"requestBody": {
"content": {
"application/json": {}
}
}
}
},
"/v2/portal/entity/file": {
"post": {
"operationId": "saveEntityFile",
Expand Down
169 changes: 169 additions & 0 deletions clients/customer-portal-client/src/openapi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,133 @@ declare namespace Components {
};
actions?: WidgetAction[];
}
export interface Activity {
/**
* example:
* MyCustomActivity
*/
type: string;
/**
* Title for activity. Supports handlebars syntax.
* example:
* My custom activity
*/
title: string;
/**
* Message for activity. Supports handlebars syntax.
* example:
* {{caller}} did something with {{entity payload.entity.id}}.
*/
message: string;
/**
* example:
* {
* "entity": {
* "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
* "schema": "contact"
* }
* }
*/
payload?: {
[name: string]: any;
};
}
export interface ActivityCallerContext {
[name: string]: any;
PortalAuth?: {
/**
* example:
* {
* "cognito:username": "[email protected]",
* "custom:contact_entity_id": "7579d22f-9400-41d1-b460-04730239ee91",
* "custom:org_id": "123456",
* "custom:origin": "END_CUSTOMER_PORTAL",
* "custom:portal_user_id": "06c78f9d-af75-4483-893d-a3fad524400f",
* "email": "[email protected]",
* "email_verified": true,
* "exp": 1694693219,
* "iat": 1694689619,
* "sub": "8cc73157-3dc4-47f3-b163-d3a5039bba72"
* }
*/
token?: {
/**
* example:
* 8cc73157-3dc4-47f3-b163-d3a5039bba72
*/
sub?: string;
/**
* example:
* [email protected]
*/
email?: string;
/**
* example:
* [email protected]
*/
"cognito:username"?: string;
/**
* example:
* 06c78f9d-af75-4483-893d-a3fad524400f
*/
"custom:portal_user_id"?: string;
/**
* example:
* 7579d22f-9400-41d1-b460-04730239ee91
*/
"custom:contact_entity_id"?: string;
};
};
}
/**
* See https://github.com/ulid/spec
* example:
* 01F130Q52Q6MWSNS8N2AVXV4JN
*/
export type ActivityId = string; // ulid
export interface ActivityItem {
_id?: /**
* See https://github.com/ulid/spec
* example:
* 01F130Q52Q6MWSNS8N2AVXV4JN
*/
ActivityId /* ulid */;
timestamp?: string; // date-time
/**
* example:
* MyCustomActivity
*/
type: string;
/**
* Title for activity. Supports handlebars syntax.
* example:
* My custom activity
*/
title: string;
/**
* Message for activity. Supports handlebars syntax.
* example:
* {{caller}} did something with {{entity payload.entity.id}}.
*/
message: string;
/**
* example:
* {
* "entity": {
* "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
* "schema": "contact"
* }
* }
*/
payload?: {
[name: string]: any;
entity?: {
id?: string;
schema?: string;
};
caller?: ActivityCallerContext;
};
}
export interface AdminUser {
[name: string]: any;
/**
Expand Down Expand Up @@ -1682,6 +1809,26 @@ declare namespace Paths {
export type $500 = Components.Responses.InternalServerError;
}
}
namespace CreateCustomEntityActivity {
namespace Parameters {
export type Entities = /**
* Entity ID
* example:
* 5da0a718-c822-403d-9f5d-20d4584e0528
*/
Components.Schemas.EntityId[];
}
export interface QueryParameters {
entities?: Parameters.Entities;
}
export type RequestBody = Components.Schemas.Activity;
namespace Responses {
export type $201 = Components.Schemas.ActivityItem;
export type $401 = Components.Responses.Unauthorized;
export type $403 = Components.Responses.Forbidden;
export type $500 = Components.Responses.InternalServerError;
}
}
namespace CreateSSOUser {
namespace Parameters {
export type Origin = /* Origin of the portal */ Components.Schemas.Origin;
Expand Down Expand Up @@ -3178,6 +3325,16 @@ export interface OperationMethods {
data?: any,
config?: AxiosRequestConfig
): OperationResponse<Paths.AddEndCustomerRelationToEntity.Responses.$200>
/**
* createCustomEntityActivity - createCustomEntityActivity
*
* Create a custom activity that can be displayed in activity feed of an entity.
*/
'createCustomEntityActivity'(
parameters?: Parameters<Paths.CreateCustomEntityActivity.QueryParameters> | null,
data?: Paths.CreateCustomEntityActivity.RequestBody,
config?: AxiosRequestConfig
): OperationResponse<Paths.CreateCustomEntityActivity.Responses.$201>
/**
* saveEntityFile - saveEntityFile
*
Expand Down Expand Up @@ -3727,6 +3884,18 @@ export interface PathsDictionary {
config?: AxiosRequestConfig
): OperationResponse<Paths.AddEndCustomerRelationToEntity.Responses.$200>
}
['/v2/portal/entity/activity']: {
/**
* createCustomEntityActivity - createCustomEntityActivity
*
* Create a custom activity that can be displayed in activity feed of an entity.
*/
'put'(
parameters?: Parameters<Paths.CreateCustomEntityActivity.QueryParameters> | null,
data?: Paths.CreateCustomEntityActivity.RequestBody,
config?: AxiosRequestConfig
): OperationResponse<Paths.CreateCustomEntityActivity.Responses.$201>
}
['/v2/portal/entity/file']: {
/**
* saveEntityFile - saveEntityFile
Expand Down
Loading

0 comments on commit b05ba76

Please sign in to comment.