@serve.zone/interfaces 5.4.3 → 5.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_ts/index.d.ts +2 -1
- package/dist_ts/index.js +3 -2
- package/dist_ts/platform/ai.d.ts +18 -0
- package/dist_ts/platform/ai.js +2 -0
- package/dist_ts/platform/backup.d.ts +9 -0
- package/dist_ts/platform/backup.js +2 -0
- package/dist_ts/platform/database.d.ts +7 -0
- package/dist_ts/platform/database.js +2 -0
- package/dist_ts/platform/email.d.ts +57 -0
- package/dist_ts/platform/email.js +2 -0
- package/dist_ts/platform/index.d.ts +13 -0
- package/dist_ts/platform/index.js +14 -0
- package/dist_ts/platform/letter.d.ts +21 -0
- package/dist_ts/platform/letter.js +2 -0
- package/dist_ts/platform/logging.d.ts +5 -0
- package/dist_ts/platform/logging.js +2 -0
- package/dist_ts/platform/objectstorage.d.ts +6 -0
- package/dist_ts/platform/objectstorage.js +2 -0
- package/dist_ts/platform/pushnotification.d.ts +13 -0
- package/dist_ts/platform/pushnotification.js +2 -0
- package/dist_ts/platform/sip.d.ts +6 -0
- package/dist_ts/platform/sip.js +2 -0
- package/dist_ts/platform/sms.d.ts +25 -0
- package/dist_ts/platform/sms.js +2 -0
- package/dist_ts/platform/types.d.ts +58 -0
- package/dist_ts/platform/types.js +2 -0
- package/dist_ts/platformservice/aibridge.d.ts +1 -0
- package/dist_ts/platformservice/letter.d.ts +1 -0
- package/dist_ts/platformservice/mta.d.ts +4 -0
- package/dist_ts/platformservice/pushnotification.d.ts +1 -0
- package/dist_ts/platformservice/sms.d.ts +2 -0
- package/dist_ts/requests/config.d.ts +5 -0
- package/dist_ts/requests/index.d.ts +2 -1
- package/dist_ts/requests/index.js +3 -2
- package/dist_ts/requests/platform.d.ts +98 -0
- package/dist_ts/requests/platform.js +2 -0
- package/package.json +8 -9
- package/readme.md +192 -5
- package/ts/index.ts +2 -0
- package/ts/platform/ai.ts +23 -0
- package/ts/platform/backup.ts +10 -0
- package/ts/platform/database.ts +8 -0
- package/ts/platform/email.ts +73 -0
- package/ts/platform/index.ts +27 -0
- package/ts/platform/letter.ts +26 -0
- package/ts/platform/logging.ts +5 -0
- package/ts/platform/objectstorage.ts +6 -0
- package/ts/platform/pushnotification.ts +18 -0
- package/ts/platform/sip.ts +6 -0
- package/ts/platform/sms.ts +34 -0
- package/ts/platform/types.ts +82 -0
- package/ts/platformservice/aibridge.ts +3 -1
- package/ts/platformservice/letter.ts +3 -1
- package/ts/platformservice/mta.ts +5 -0
- package/ts/platformservice/pushnotification.ts +3 -1
- package/ts/platformservice/sms.ts +3 -0
- package/ts/requests/config.ts +5 -0
- package/ts/requests/index.ts +3 -1
- package/ts/requests/platform.ts +148 -0
package/readme.md
CHANGED
|
@@ -2,7 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`@serve.zone/interfaces` is the contract package used by Cloudly, Spark, Coreflow, Coretraffic, Platformclient, CLI clients, and external integrators. It contains only public data shapes and typed RPC request definitions, so services can evolve independently while speaking the same language.
|
|
6
|
+
|
|
7
|
+
## Issue Reporting and Security
|
|
8
|
+
|
|
9
|
+
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
|
|
10
|
+
|
|
11
|
+
## What This Package Provides
|
|
12
|
+
|
|
13
|
+
- `data` contains persistent platform shapes such as clusters, cluster nodes, deployments, services, images, DNS records, domains, secrets, users, identities, settings, status, traffic, server metadata, bare-metal inventory, and task executions.
|
|
14
|
+
- `requests` contains `@api.global/typedrequest-interfaces` contracts for Cloudly and platform RPC methods. Each request defines its method name, request payload, and response payload.
|
|
15
|
+
- `platform` contains current platform-service contracts for email, SMS, push notifications, letters, AI, backups, databases, logging, object storage, and SIP.
|
|
16
|
+
- `platformservice` contains legacy compatibility contracts used by older platform-service clients.
|
|
17
|
+
|
|
18
|
+
The package intentionally has no service implementation logic. It is a stable shared vocabulary for the rest of serve.zone.
|
|
6
19
|
|
|
7
20
|
## Install
|
|
8
21
|
|
|
@@ -10,12 +23,151 @@ This package contains the public contracts consumed by Cloudly, Spark, Coreflow,
|
|
|
10
23
|
pnpm add @serve.zone/interfaces
|
|
11
24
|
```
|
|
12
25
|
|
|
13
|
-
##
|
|
26
|
+
## Public API
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import { data, platform, platformservice, requests } from '@serve.zone/interfaces';
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The root export exposes four namespaces:
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
export {
|
|
36
|
+
data,
|
|
37
|
+
platform,
|
|
38
|
+
platformservice,
|
|
39
|
+
requests,
|
|
40
|
+
};
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Data Interfaces
|
|
44
|
+
|
|
45
|
+
Use `data` when you need durable serve.zone object shapes.
|
|
14
46
|
|
|
15
47
|
```typescript
|
|
16
|
-
import { data
|
|
48
|
+
import { data } from '@serve.zone/interfaces';
|
|
49
|
+
|
|
50
|
+
const service: data.IService = {
|
|
51
|
+
id: 'service-api',
|
|
52
|
+
data: {
|
|
53
|
+
name: 'api',
|
|
54
|
+
description: 'Public API service',
|
|
55
|
+
imageId: 'image-api',
|
|
56
|
+
imageVersion: '1.0.0',
|
|
57
|
+
environment: {
|
|
58
|
+
NODE_ENV: 'production',
|
|
59
|
+
},
|
|
60
|
+
secretBundleId: 'secretbundle-api',
|
|
61
|
+
serviceCategory: 'workload',
|
|
62
|
+
deploymentStrategy: 'limited-replicas',
|
|
63
|
+
scaleFactor: 2,
|
|
64
|
+
balancingStrategy: 'round-robin',
|
|
65
|
+
ports: {
|
|
66
|
+
web: 3000,
|
|
67
|
+
},
|
|
68
|
+
domains: [
|
|
69
|
+
{
|
|
70
|
+
name: 'api',
|
|
71
|
+
protocol: 'https',
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
deploymentIds: [],
|
|
75
|
+
},
|
|
76
|
+
};
|
|
17
77
|
```
|
|
18
78
|
|
|
79
|
+
Common data contracts include:
|
|
80
|
+
|
|
81
|
+
- `ICluster` and `IClusterNode` for cluster membership and provisioning metadata.
|
|
82
|
+
- `IService`, `IDeployment`, and `IImage` for workload configuration and deployment state.
|
|
83
|
+
- `IDnsEntry`, `IDomain`, and traffic interfaces for routing and domain management.
|
|
84
|
+
- `ISecretBundle` and `ISecretGroup` for secret ownership and grouping.
|
|
85
|
+
- `IUser`, `IIdentity`, and token-related interfaces for authentication context.
|
|
86
|
+
- `ICloudlyConfig`, settings, status, server, bare-metal, and task execution interfaces for control-plane state.
|
|
87
|
+
|
|
88
|
+
## TypedRequest Contracts
|
|
89
|
+
|
|
90
|
+
Use `requests` when registering handlers or creating typed clients with `@api.global/typedrequest` or `@api.global/typedsocket`.
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
import { requests } from '@serve.zone/interfaces';
|
|
94
|
+
|
|
95
|
+
type GetClustersRequest = requests.cluster.IReq_Any_Cloudly_GetClusters;
|
|
96
|
+
|
|
97
|
+
const methodName: GetClustersRequest['method'] = 'getClusters';
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Each request interface follows the same structure:
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
interface IExampleRequest {
|
|
104
|
+
method: 'methodName';
|
|
105
|
+
request: Record<string, unknown>;
|
|
106
|
+
response: Record<string, unknown>;
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Request groups are exported by domain:
|
|
111
|
+
|
|
112
|
+
- `requests.admin`
|
|
113
|
+
- `requests.baremetal`
|
|
114
|
+
- `requests.certificate`
|
|
115
|
+
- `requests.cluster`
|
|
116
|
+
- `requests.config`
|
|
117
|
+
- `requests.deployment`
|
|
118
|
+
- `requests.dns`
|
|
119
|
+
- `requests.domain`
|
|
120
|
+
- `requests.externalRegistry`
|
|
121
|
+
- `requests.identity`
|
|
122
|
+
- `requests.image`
|
|
123
|
+
- `requests.inform`
|
|
124
|
+
- `requests.log`
|
|
125
|
+
- `requests.network`
|
|
126
|
+
- `requests.node`
|
|
127
|
+
- `requests.routing`
|
|
128
|
+
- `requests.secretbundle`
|
|
129
|
+
- `requests.secretgroup`
|
|
130
|
+
- `requests.server`
|
|
131
|
+
- `requests.service`
|
|
132
|
+
- `requests.settings`
|
|
133
|
+
- `requests.status`
|
|
134
|
+
- `requests.task`
|
|
135
|
+
- `requests.version`
|
|
136
|
+
|
|
137
|
+
## Platform Contracts
|
|
138
|
+
|
|
139
|
+
Use `platform` for current product-facing platform APIs.
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
import { platform } from '@serve.zone/interfaces';
|
|
143
|
+
|
|
144
|
+
type SendEmailRequest = platform.email.IReq_SendEmail;
|
|
145
|
+
|
|
146
|
+
const sendEmailMethod: SendEmailRequest['method'] = 'sendEmail';
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Available platform modules:
|
|
150
|
+
|
|
151
|
+
- `platform.email` for email sending, recipient registration, status checks, and email stats.
|
|
152
|
+
- `platform.sms` for SMS delivery contracts.
|
|
153
|
+
- `platform.pushnotification` for push-notification contracts.
|
|
154
|
+
- `platform.letter` for physical letter workflows.
|
|
155
|
+
- `platform.ai` for AI bridge contracts.
|
|
156
|
+
- `platform.backup`, `platform.database`, `platform.logging`, `platform.objectstorage`, and `platform.sip` for infrastructure-facing platform features.
|
|
157
|
+
- `platform.types` for shared platform service metadata.
|
|
158
|
+
|
|
159
|
+
## Legacy Platformservice Contracts
|
|
160
|
+
|
|
161
|
+
`platformservice` is retained for older integrations that still consume the previous namespace layout.
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
import { platformservice } from '@serve.zone/interfaces';
|
|
165
|
+
|
|
166
|
+
type LegacySendEmailRequest = platformservice.mta.IRequest_SendEmail;
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
New code should prefer the `platform` namespace unless it must remain compatible with an existing platformservice consumer.
|
|
170
|
+
|
|
19
171
|
## Development
|
|
20
172
|
|
|
21
173
|
```bash
|
|
@@ -24,6 +176,41 @@ pnpm run build
|
|
|
24
176
|
pnpm test
|
|
25
177
|
```
|
|
26
178
|
|
|
27
|
-
|
|
179
|
+
This package is built with `tsbuild` and tested with `@git.zone/tstest`.
|
|
180
|
+
|
|
181
|
+
## Ownership Rules
|
|
182
|
+
|
|
183
|
+
Only ecosystem-wide public contracts belong in this package. Cloudly-internal implementation details, service-private DTOs, and temporary migration helpers should stay in the consuming project until they become real shared contracts.
|
|
184
|
+
|
|
185
|
+
Good candidates for this package:
|
|
186
|
+
|
|
187
|
+
- Types persisted or exchanged across multiple serve.zone services.
|
|
188
|
+
- TypedRequest contracts used by more than one project.
|
|
189
|
+
- External SDK-facing interfaces that must remain stable.
|
|
190
|
+
|
|
191
|
+
Poor candidates for this package:
|
|
192
|
+
|
|
193
|
+
- Private implementation details of a single service.
|
|
194
|
+
- Convenience wrappers with runtime behavior.
|
|
195
|
+
- Backward-compatibility aliases without an active consumer.
|
|
196
|
+
|
|
197
|
+
## License and Legal Information
|
|
198
|
+
|
|
199
|
+
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [license](./license) file.
|
|
200
|
+
|
|
201
|
+
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
|
202
|
+
|
|
203
|
+
### Trademarks
|
|
204
|
+
|
|
205
|
+
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
|
|
206
|
+
|
|
207
|
+
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
|
|
208
|
+
|
|
209
|
+
### Company Information
|
|
210
|
+
|
|
211
|
+
Task Venture Capital GmbH
|
|
212
|
+
Registered at District Court Bremen HRB 35230 HB, Germany
|
|
213
|
+
|
|
214
|
+
For any legal inquiries or further information, please contact us via email at hello@task.vc.
|
|
28
215
|
|
|
29
|
-
|
|
216
|
+
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
package/ts/index.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as data from './data/index.js';
|
|
2
|
+
import * as platform from './platform/index.js';
|
|
2
3
|
import * as platformservice from './platformservice/index.js';
|
|
3
4
|
import * as requests from './requests/index.js';
|
|
4
5
|
|
|
5
6
|
export {
|
|
6
7
|
data,
|
|
8
|
+
platform,
|
|
7
9
|
platformservice,
|
|
8
10
|
requests
|
|
9
11
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
|
|
3
|
+
export interface IChat {
|
|
4
|
+
systemMessage: string;
|
|
5
|
+
messages: {
|
|
6
|
+
role: 'assistant' | 'user';
|
|
7
|
+
content: string;
|
|
8
|
+
}[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface IReq_Chat extends plugins.typedrequestInterfaces.implementsTR<
|
|
12
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
13
|
+
IReq_Chat
|
|
14
|
+
> {
|
|
15
|
+
method: 'chat';
|
|
16
|
+
request: {
|
|
17
|
+
chat: IChat;
|
|
18
|
+
};
|
|
19
|
+
response: {
|
|
20
|
+
chat: IChat;
|
|
21
|
+
latestMessage: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
|
|
3
|
+
export type TTemplates = 'default' | 'linkaction' | 'notification';
|
|
4
|
+
|
|
5
|
+
export interface IReq_SendEmail extends plugins.typedrequestInterfaces.implementsTR<
|
|
6
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
7
|
+
IReq_SendEmail
|
|
8
|
+
> {
|
|
9
|
+
method: 'sendEmail';
|
|
10
|
+
request: {
|
|
11
|
+
title: string;
|
|
12
|
+
from: string;
|
|
13
|
+
to: string;
|
|
14
|
+
body: string;
|
|
15
|
+
attachments?: Array<{
|
|
16
|
+
name: string;
|
|
17
|
+
binaryAttachmentString: string;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
response: {
|
|
21
|
+
responseId: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface IReq_RegisterRecipient extends plugins.typedrequestInterfaces.implementsTR<
|
|
26
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
27
|
+
IReq_RegisterRecipient
|
|
28
|
+
> {
|
|
29
|
+
method: 'registerRecipient';
|
|
30
|
+
request: {
|
|
31
|
+
emailAddress: string;
|
|
32
|
+
};
|
|
33
|
+
response: {
|
|
34
|
+
status: 'ok' | 'not ok';
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface IReq_CheckEmailStatus extends plugins.typedrequestInterfaces.implementsTR<
|
|
39
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
40
|
+
IReq_CheckEmailStatus
|
|
41
|
+
> {
|
|
42
|
+
method: 'checkEmailStatus';
|
|
43
|
+
request: {
|
|
44
|
+
emailId: string;
|
|
45
|
+
};
|
|
46
|
+
response: {
|
|
47
|
+
status: string;
|
|
48
|
+
details?: { message: string };
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface IReq_GetEmailStats extends plugins.typedrequestInterfaces.implementsTR<
|
|
53
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
54
|
+
IReq_GetEmailStats
|
|
55
|
+
> {
|
|
56
|
+
method: 'getEmailStats';
|
|
57
|
+
request: {
|
|
58
|
+
jwt: string;
|
|
59
|
+
};
|
|
60
|
+
response: {
|
|
61
|
+
totalEmailsSent: number;
|
|
62
|
+
totalEmailsDelivered: number;
|
|
63
|
+
totalEmailsBounced: number;
|
|
64
|
+
averageDeliveryTimeMs: number;
|
|
65
|
+
lastUpdated: string;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type IReq_GetEMailStats = IReq_GetEmailStats;
|
|
70
|
+
export type IRequest_SendEmail = IReq_SendEmail;
|
|
71
|
+
export type IRequest_RegisterRecipient = IReq_RegisterRecipient;
|
|
72
|
+
export type IRequest_CheckEmailStatus = IReq_CheckEmailStatus;
|
|
73
|
+
export type IRequest_GetEMailStats = IReq_GetEmailStats;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as ai from './ai.js';
|
|
2
|
+
import * as backup from './backup.js';
|
|
3
|
+
import * as database from './database.js';
|
|
4
|
+
import * as email from './email.js';
|
|
5
|
+
import * as letter from './letter.js';
|
|
6
|
+
import * as logging from './logging.js';
|
|
7
|
+
import * as objectstorage from './objectstorage.js';
|
|
8
|
+
import * as pushnotification from './pushnotification.js';
|
|
9
|
+
import * as sip from './sip.js';
|
|
10
|
+
import * as sms from './sms.js';
|
|
11
|
+
import * as types from './types.js';
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
ai,
|
|
15
|
+
backup,
|
|
16
|
+
database,
|
|
17
|
+
email,
|
|
18
|
+
letter,
|
|
19
|
+
logging,
|
|
20
|
+
objectstorage,
|
|
21
|
+
pushnotification,
|
|
22
|
+
sip,
|
|
23
|
+
sms,
|
|
24
|
+
types,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export * from './types.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
|
|
3
|
+
export interface IReq_SendLetter extends plugins.typedrequestInterfaces.implementsTR<
|
|
4
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
5
|
+
IReq_SendLetter
|
|
6
|
+
> {
|
|
7
|
+
method: 'sendLetter';
|
|
8
|
+
request: {
|
|
9
|
+
description: string;
|
|
10
|
+
needsCover: boolean;
|
|
11
|
+
title?: string;
|
|
12
|
+
from?: plugins.tsclass.business.IAddress;
|
|
13
|
+
to?: plugins.tsclass.business.IAddress;
|
|
14
|
+
coverBody?: string;
|
|
15
|
+
service: 'Einschreiben'[];
|
|
16
|
+
pdfAttachments?: Array<{
|
|
17
|
+
name: string;
|
|
18
|
+
binaryAttachmentString: string;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
response: {
|
|
22
|
+
processId: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type IRequest_SendLetter = IReq_SendLetter;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
|
|
3
|
+
export interface IReq_SendPushNotification extends plugins.typedrequestInterfaces.implementsTR<
|
|
4
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
5
|
+
IReq_SendPushNotification
|
|
6
|
+
> {
|
|
7
|
+
method: 'sendPushNotification';
|
|
8
|
+
request: {
|
|
9
|
+
deviceToken: string;
|
|
10
|
+
message: string;
|
|
11
|
+
};
|
|
12
|
+
response: {
|
|
13
|
+
ok: boolean;
|
|
14
|
+
status: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type IRequest_SendPushNotification = IReq_SendPushNotification;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
|
|
3
|
+
export interface IReq_SendSms extends plugins.typedrequestInterfaces.implementsTR<
|
|
4
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
5
|
+
IReq_SendSms
|
|
6
|
+
> {
|
|
7
|
+
method: 'sendSms';
|
|
8
|
+
request: {
|
|
9
|
+
toNumber: number;
|
|
10
|
+
fromName: string;
|
|
11
|
+
messageText: string;
|
|
12
|
+
};
|
|
13
|
+
response: {
|
|
14
|
+
status: 'ok' | 'not ok';
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface IReq_SendVerificationCode extends plugins.typedrequestInterfaces.implementsTR<
|
|
19
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
20
|
+
IReq_SendVerificationCode
|
|
21
|
+
> {
|
|
22
|
+
method: 'sendVerificationCode';
|
|
23
|
+
request: {
|
|
24
|
+
toNumber: number;
|
|
25
|
+
fromName: string;
|
|
26
|
+
};
|
|
27
|
+
response: {
|
|
28
|
+
status: 'ok' | 'not ok';
|
|
29
|
+
verificationCode: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type IRequest_SendSms = IReq_SendSms;
|
|
34
|
+
export type IRequest_SendVerificationCode = IReq_SendVerificationCode;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export type TPlatformCapability =
|
|
2
|
+
| 'email'
|
|
3
|
+
| 'sms'
|
|
4
|
+
| 'pushnotification'
|
|
5
|
+
| 'letter'
|
|
6
|
+
| 'ai'
|
|
7
|
+
| 'database'
|
|
8
|
+
| 'objectstorage'
|
|
9
|
+
| 'logging'
|
|
10
|
+
| 'backup'
|
|
11
|
+
| 'sip';
|
|
12
|
+
|
|
13
|
+
export type TPlatformAccessMode = 'rpc' | 'binding' | 'sidecar' | 'internal';
|
|
14
|
+
export type TPlatformBindingStatus = 'requested' | 'provisioning' | 'ready' | 'degraded' | 'failed' | 'disabled';
|
|
15
|
+
export type TPlatformDesiredState = 'enabled' | 'disabled';
|
|
16
|
+
export type TPlatformEndpointProtocol =
|
|
17
|
+
| 'typedrequest'
|
|
18
|
+
| 'http'
|
|
19
|
+
| 'tcp'
|
|
20
|
+
| 'udp'
|
|
21
|
+
| 'smtp'
|
|
22
|
+
| 's3'
|
|
23
|
+
| 'postgres'
|
|
24
|
+
| 'mongodb'
|
|
25
|
+
| 'sip';
|
|
26
|
+
|
|
27
|
+
export type TPlatformConfigValue =
|
|
28
|
+
| string
|
|
29
|
+
| number
|
|
30
|
+
| boolean
|
|
31
|
+
| null
|
|
32
|
+
| TPlatformConfigValue[]
|
|
33
|
+
| { [key: string]: TPlatformConfigValue };
|
|
34
|
+
|
|
35
|
+
export interface IPlatformCapability {
|
|
36
|
+
id: TPlatformCapability;
|
|
37
|
+
title: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
accessMode: TPlatformAccessMode;
|
|
40
|
+
defaultProviderType?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface IPlatformProviderConfig {
|
|
44
|
+
id: string;
|
|
45
|
+
capability: TPlatformCapability;
|
|
46
|
+
providerType: string;
|
|
47
|
+
name: string;
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
config?: { [key: string]: TPlatformConfigValue };
|
|
50
|
+
secretBundleId?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface IPlatformCredentialRef {
|
|
54
|
+
secretBundleId?: string;
|
|
55
|
+
secretGroupIds?: string[];
|
|
56
|
+
dockerSecretName?: string;
|
|
57
|
+
env?: { [key: string]: string };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface IPlatformServiceEndpoint {
|
|
61
|
+
name: string;
|
|
62
|
+
capability: TPlatformCapability;
|
|
63
|
+
protocol: TPlatformEndpointProtocol;
|
|
64
|
+
internalUrl?: string;
|
|
65
|
+
externalUrl?: string;
|
|
66
|
+
networkAlias?: string;
|
|
67
|
+
port?: number;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface IPlatformBinding {
|
|
71
|
+
id: string;
|
|
72
|
+
serviceId: string;
|
|
73
|
+
capability: TPlatformCapability;
|
|
74
|
+
desiredState: TPlatformDesiredState;
|
|
75
|
+
status: TPlatformBindingStatus;
|
|
76
|
+
providerConfigId?: string;
|
|
77
|
+
config?: { [key: string]: TPlatformConfigValue };
|
|
78
|
+
endpoints?: IPlatformServiceEndpoint[];
|
|
79
|
+
credentials?: IPlatformCredentialRef[];
|
|
80
|
+
createdAt?: number;
|
|
81
|
+
updatedAt?: number;
|
|
82
|
+
}
|
|
@@ -68,3 +68,8 @@ export interface IReq_GetEMailStats extends plugins.typedrequestInterfaces.imple
|
|
|
68
68
|
lastUpdated: string;
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
+
|
|
72
|
+
export type IRequest_SendEmail = IReq_SendEmail;
|
|
73
|
+
export type IRequest_RegisterRecipient = IReq_RegisterRecipient;
|
|
74
|
+
export type IRequest_CheckEmailStatus = IReq_CheckEmailStatus;
|
|
75
|
+
export type IRequest_GetEMailStats = IReq_GetEMailStats;
|
package/ts/requests/config.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as clusterInterfaces from '../data/cluster.js';
|
|
|
3
3
|
import * as serverInterfaces from '../data/server.js';
|
|
4
4
|
import * as userInterfaces from '../data/user.js';
|
|
5
5
|
import type { IService } from '../data/service.js';
|
|
6
|
+
import type { IPlatformBinding, IPlatformProviderConfig } from '../platform/types.js';
|
|
6
7
|
|
|
7
8
|
export interface IRequest_Any_Cloudly_GetServerConfig
|
|
8
9
|
extends plugins.typedrequestInterfaces.implementsTR<
|
|
@@ -31,6 +32,8 @@ extends plugins.typedrequestInterfaces.implementsTR<
|
|
|
31
32
|
response: {
|
|
32
33
|
configData: clusterInterfaces.ICluster;
|
|
33
34
|
services: IService[];
|
|
35
|
+
platformProviderConfigs?: IPlatformProviderConfig[];
|
|
36
|
+
platformBindings?: IPlatformBinding[];
|
|
34
37
|
};
|
|
35
38
|
}
|
|
36
39
|
|
|
@@ -43,6 +46,8 @@ extends plugins.typedrequestInterfaces.implementsTR<
|
|
|
43
46
|
request: {
|
|
44
47
|
configData: clusterInterfaces.ICluster;
|
|
45
48
|
services: IService[];
|
|
49
|
+
platformProviderConfigs?: IPlatformProviderConfig[];
|
|
50
|
+
platformBindings?: IPlatformBinding[];
|
|
46
51
|
};
|
|
47
52
|
response: {};
|
|
48
53
|
}
|
package/ts/requests/index.ts
CHANGED
|
@@ -15,6 +15,7 @@ import * as informRequests from './inform.js';
|
|
|
15
15
|
import * as logRequests from './log.js';
|
|
16
16
|
import * as networkRequests from './network.js';
|
|
17
17
|
import * as nodeRequests from './node.js';
|
|
18
|
+
import * as platformRequests from './platform.js';
|
|
18
19
|
import * as routingRequests from './routing.js';
|
|
19
20
|
import * as secretBundleRequests from './secretbundle.js';
|
|
20
21
|
import * as secretGroupRequests from './secretgroup.js';
|
|
@@ -41,6 +42,7 @@ export {
|
|
|
41
42
|
logRequests as log,
|
|
42
43
|
networkRequests as network,
|
|
43
44
|
nodeRequests as node,
|
|
45
|
+
platformRequests as platform,
|
|
44
46
|
routingRequests as routing,
|
|
45
47
|
secretBundleRequests as secretbundle,
|
|
46
48
|
secretGroupRequests as secretgroup,
|
|
@@ -52,4 +54,4 @@ export {
|
|
|
52
54
|
versionRequests as version,
|
|
53
55
|
};
|
|
54
56
|
|
|
55
|
-
export * from './inform.js';
|
|
57
|
+
export * from './inform.js';
|