diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 71506b0..eb72bce 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/interfaces', - version: '1.0.30', + version: '1.0.31', description: 'interfaces for working with containers' } diff --git a/ts/index.ts b/ts/index.ts index 6972202..e992c34 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -1,7 +1,9 @@ import * as data from './data/index.js'; +import * as platformservice from './platformservice/index.js'; import * as requests from './requests/index.js'; export { data, + platformservice, requests } diff --git a/ts/platformservice/00readme.md b/ts/platformservice/00readme.md new file mode 100644 index 0000000..a160700 --- /dev/null +++ b/ts/platformservice/00readme.md @@ -0,0 +1 @@ +The platform folder contains types that can be used for talking with the underlying platform by apps running on serve.zone. \ No newline at end of file diff --git a/ts/platformservice/aibridge.ts b/ts/platformservice/aibridge.ts new file mode 100644 index 0000000..54e51dc --- /dev/null +++ b/ts/platformservice/aibridge.ts @@ -0,0 +1,23 @@ +import * as plugins from '../plugins.js'; + +export interface IChat { + systemMessage: string; + messages: { + role: 'assistant' | 'user'; + content: string; + }[]; +} + +export interface IReq_Chat extends plugins.typedrequestInterfaces.implementsTR< + plugins.typedrequestInterfaces.ITypedRequest, + IReq_Chat +> { + method: 'chat', + request: { + chat: IChat; + }; + response: { + chat: IChat; + latestMessage: string; + } +} \ No newline at end of file diff --git a/ts/platformservice/index.ts b/ts/platformservice/index.ts new file mode 100644 index 0000000..162a6ae --- /dev/null +++ b/ts/platformservice/index.ts @@ -0,0 +1,11 @@ +import * as aibridge from './aibridge.js'; +import * as letter from './letter.js'; +import * as mta from './mta.js'; +import * as sms from './sms.js'; + +export { + aibridge, + letter, + mta, + sms, +} diff --git a/ts/platformservice/letter.ts b/ts/platformservice/letter.ts new file mode 100644 index 0000000..e69de29 diff --git a/ts/platformservice/mta.ts b/ts/platformservice/mta.ts new file mode 100644 index 0000000..a9d4985 --- /dev/null +++ b/ts/platformservice/mta.ts @@ -0,0 +1,39 @@ +import * as plugins from '../plugins.js'; + +export type TTemplates = 'default' | 'linkaction' | 'notification'; + +export interface IRequestSendEmail extends plugins.typedrequestInterfaces.implementsTR< + plugins.typedrequestInterfaces.ITypedRequest, + IRequestSendEmail +> { + method: 'sendEmail'; + request: { + title: string; + from: string; + to: string; + body: string; + attachments?: Array<{ + name: string; + binaryAttachmentString: string; + }> + }; + response: { + /** + * the response id allows for handling of responses to that email + */ + responseId: string; + }; +} + +export interface IRequestRegisterRecipient extends plugins.typedrequestInterfaces.implementsTR< + plugins.typedrequestInterfaces.ITypedRequest, + IRequestRegisterRecipient +> { + method: 'registerRecepient'; + request: { + emailAddress: string; + }; + response: { + status: 'ok' | 'not ok'; + }; +} diff --git a/ts/platformservice/sms.ts b/ts/platformservice/sms.ts new file mode 100644 index 0000000..9150c99 --- /dev/null +++ b/ts/platformservice/sms.ts @@ -0,0 +1,33 @@ +import * as plugins from '../plugins.js'; + +export interface IRequest_SendSms + extends plugins.typedrequestInterfaces.implementsTR< + plugins.typedrequestInterfaces.ITypedRequest, + IRequest_SendSms + > { + method: 'sendSms'; + request: { + toNumber: number; + fromName: string; + messageText: string; + }; + response: { + status: 'ok' | 'not ok'; + } + } + + export interface IRequest_SendVerificationCode + extends plugins.typedrequestInterfaces.implementsTR< + plugins.typedrequestInterfaces.ITypedRequest, + IRequest_SendVerificationCode + > { + method: 'sendVerificationCode'; + request: { + toNumber: number; + fromName: string; + }; + response: { + status: 'ok' | 'not ok'; + verificationCode: string; + } + }