fix(core): update

This commit is contained in:
Philipp Kunz 2024-02-14 14:04:47 +01:00
parent ea2e80bfea
commit a817814959
8 changed files with 110 additions and 1 deletions

View File

@ -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'
}

View File

@ -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
}

View File

@ -0,0 +1 @@
The platform folder contains types that can be used for talking with the underlying platform by apps running on serve.zone.

View File

@ -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;
}
}

View File

@ -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,
}

View File

39
ts/platformservice/mta.ts Normal file
View File

@ -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';
};
}

33
ts/platformservice/sms.ts Normal file
View File

@ -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;
}
}