@serve.zone/interfaces 5.0.4 → 5.4.2

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.
Files changed (193) hide show
  1. package/.smartconfig.json +32 -0
  2. package/changelog.md +22 -0
  3. package/dist_ts/00_commitinfo_data.js +9 -0
  4. package/dist_ts/data/baremetal.d.ts +61 -0
  5. package/dist_ts/data/baremetal.js +2 -0
  6. package/{dist_ts_interfaces → dist_ts}/data/cloudlyconfig.d.ts +0 -2
  7. package/{dist_ts_interfaces → dist_ts}/data/cloudlyconfig.js +1 -1
  8. package/{dist_ts_interfaces → dist_ts}/data/cluster.d.ts +7 -3
  9. package/{dist_ts_interfaces → dist_ts}/data/cluster.js +1 -1
  10. package/dist_ts/data/clusternode.d.ts +59 -0
  11. package/dist_ts/data/clusternode.js +2 -0
  12. package/{dist_ts_interfaces → dist_ts}/data/config.js +1 -1
  13. package/dist_ts/data/deployment.d.ts +51 -0
  14. package/{dist_ts_interfaces → dist_ts}/data/deployment.js +1 -1
  15. package/dist_ts/data/dns.d.ts +85 -0
  16. package/dist_ts/data/dns.js +2 -0
  17. package/{dist_ts_interfaces → dist_ts}/data/docker.js +1 -1
  18. package/dist_ts/data/domain.d.ts +102 -0
  19. package/dist_ts/data/domain.js +2 -0
  20. package/{dist_ts_interfaces → dist_ts}/data/event.js +1 -1
  21. package/dist_ts/data/externalregistry.d.ts +92 -0
  22. package/{dist_ts_interfaces → dist_ts}/data/externalregistry.js +1 -1
  23. package/{dist_ts_interfaces → dist_ts}/data/image.js +1 -1
  24. package/{dist_ts_interfaces → dist_ts}/data/index.d.ts +6 -1
  25. package/dist_ts/data/index.js +22 -0
  26. package/{dist_ts_interfaces → dist_ts}/data/secretbundle.js +1 -1
  27. package/{dist_ts_interfaces → dist_ts}/data/secretgroup.js +1 -1
  28. package/{dist_ts_interfaces → dist_ts}/data/server.js +1 -1
  29. package/dist_ts/data/service.d.ts +75 -0
  30. package/{dist_ts_interfaces → dist_ts}/data/service.js +1 -1
  31. package/dist_ts/data/settings.d.ts +34 -0
  32. package/dist_ts/data/settings.js +2 -0
  33. package/{dist_ts_interfaces → dist_ts}/data/status.js +1 -1
  34. package/dist_ts/data/taskexecution.d.ts +72 -0
  35. package/dist_ts/data/taskexecution.js +2 -0
  36. package/{dist_ts_interfaces → dist_ts}/data/traffic.js +1 -1
  37. package/{dist_ts_interfaces → dist_ts}/data/user.js +1 -1
  38. package/{dist_ts_interfaces → dist_ts}/data/version.js +1 -1
  39. package/{dist_ts_interfaces → dist_ts}/index.js +1 -1
  40. package/{dist_ts_interfaces → dist_ts}/platformservice/aibridge.js +1 -1
  41. package/dist_ts/platformservice/index.js +7 -0
  42. package/{dist_ts_interfaces → dist_ts}/platformservice/letter.js +1 -1
  43. package/{dist_ts_interfaces → dist_ts}/platformservice/mta.js +1 -1
  44. package/dist_ts/platformservice/pushnotification.js +2 -0
  45. package/{dist_ts_interfaces → dist_ts}/platformservice/sms.js +1 -1
  46. package/{dist_ts_interfaces → dist_ts}/plugins.js +1 -1
  47. package/{dist_ts_interfaces → dist_ts}/requests/admin.js +1 -1
  48. package/dist_ts/requests/baremetal.d.ts +19 -0
  49. package/dist_ts/requests/baremetal.js +2 -0
  50. package/{dist_ts_interfaces → dist_ts}/requests/certificate.js +1 -1
  51. package/{dist_ts_interfaces → dist_ts}/requests/cluster.d.ts +1 -0
  52. package/{dist_ts_interfaces → dist_ts}/requests/cluster.js +1 -1
  53. package/{dist_ts_interfaces → dist_ts}/requests/config.js +1 -1
  54. package/dist_ts/requests/deployment.d.ts +96 -0
  55. package/dist_ts/requests/deployment.js +2 -0
  56. package/dist_ts/requests/dns.d.ts +63 -0
  57. package/dist_ts/requests/dns.js +2 -0
  58. package/dist_ts/requests/domain.d.ts +69 -0
  59. package/dist_ts/requests/domain.js +2 -0
  60. package/{dist_ts_interfaces → dist_ts}/requests/externalregistry.d.ts +13 -0
  61. package/dist_ts/requests/externalregistry.js +4 -0
  62. package/{dist_ts_interfaces → dist_ts}/requests/identity.js +1 -1
  63. package/{dist_ts_interfaces → dist_ts}/requests/image.js +1 -1
  64. package/dist_ts/requests/index.d.ts +26 -0
  65. package/dist_ts/requests/index.js +28 -0
  66. package/{dist_ts_interfaces → dist_ts}/requests/inform.js +1 -1
  67. package/{dist_ts_interfaces → dist_ts}/requests/log.js +1 -1
  68. package/{dist_ts_interfaces → dist_ts}/requests/network.js +1 -1
  69. package/dist_ts/requests/node.d.ts +29 -0
  70. package/dist_ts/requests/node.js +2 -0
  71. package/{dist_ts_interfaces → dist_ts}/requests/routing.js +1 -1
  72. package/{dist_ts_interfaces → dist_ts}/requests/secretbundle.js +1 -1
  73. package/{dist_ts_interfaces → dist_ts}/requests/secretgroup.js +1 -1
  74. package/{dist_ts_interfaces → dist_ts}/requests/server.js +1 -1
  75. package/{dist_ts_interfaces → dist_ts}/requests/service.js +1 -1
  76. package/dist_ts/requests/settings.d.ts +49 -0
  77. package/dist_ts/requests/settings.js +2 -0
  78. package/{dist_ts_interfaces → dist_ts}/requests/status.js +1 -1
  79. package/dist_ts/requests/task.d.ts +65 -0
  80. package/dist_ts/requests/task.js +4 -0
  81. package/{dist_ts_interfaces → dist_ts}/requests/version.js +1 -1
  82. package/license +1 -1
  83. package/package.json +43 -18
  84. package/readme.md +12 -206
  85. package/{ts_interfaces → ts}/00_commitinfo_data.ts +2 -2
  86. package/ts/data/baremetal.ts +73 -0
  87. package/{ts_interfaces → ts}/data/cloudlyconfig.ts +0 -2
  88. package/{ts_interfaces → ts}/data/cluster.ts +8 -3
  89. package/ts/data/clusternode.ts +71 -0
  90. package/ts/data/deployment.ts +63 -0
  91. package/ts/data/dns.ts +100 -0
  92. package/ts/data/domain.ts +124 -0
  93. package/ts/data/externalregistry.ts +110 -0
  94. package/{ts_interfaces → ts}/data/index.ts +7 -2
  95. package/ts/data/service.ts +77 -0
  96. package/ts/data/settings.ts +56 -0
  97. package/ts/data/taskexecution.ts +84 -0
  98. package/ts/requests/baremetal.ts +22 -0
  99. package/{ts_interfaces → ts}/requests/cluster.ts +1 -0
  100. package/ts/requests/deployment.ts +141 -0
  101. package/ts/requests/dns.ts +93 -0
  102. package/ts/requests/domain.ts +99 -0
  103. package/{ts_interfaces → ts}/requests/externalregistry.ts +17 -0
  104. package/{ts_interfaces → ts}/requests/index.ts +14 -0
  105. package/ts/requests/node.ts +33 -0
  106. package/ts/requests/settings.ts +59 -0
  107. package/ts/requests/task.ts +95 -0
  108. package/cli.js +0 -4
  109. package/dist_ts_interfaces/00_commitinfo_data.js +0 -9
  110. package/dist_ts_interfaces/data/deployment.d.ts +0 -11
  111. package/dist_ts_interfaces/data/externalregistry.d.ts +0 -10
  112. package/dist_ts_interfaces/data/index.js +0 -17
  113. package/dist_ts_interfaces/data/service.d.ts +0 -37
  114. package/dist_ts_interfaces/platformservice/index.js +0 -7
  115. package/dist_ts_interfaces/platformservice/pushnotification.js +0 -2
  116. package/dist_ts_interfaces/requests/externalregistry.js +0 -4
  117. package/dist_ts_interfaces/requests/index.d.ts +0 -19
  118. package/dist_ts_interfaces/requests/index.js +0 -21
  119. package/ts_interfaces/data/deployment.ts +0 -13
  120. package/ts_interfaces/data/externalregistry.ts +0 -12
  121. package/ts_interfaces/data/service.ts +0 -34
  122. package/ts_interfaces/readme.md +0 -223
  123. package/ts_interfaces/tspublish.json +0 -13
  124. /package/{dist_ts_interfaces → dist_ts}/00_commitinfo_data.d.ts +0 -0
  125. /package/{dist_ts_interfaces → dist_ts}/data/config.d.ts +0 -0
  126. /package/{dist_ts_interfaces → dist_ts}/data/docker.d.ts +0 -0
  127. /package/{dist_ts_interfaces → dist_ts}/data/event.d.ts +0 -0
  128. /package/{dist_ts_interfaces → dist_ts}/data/image.d.ts +0 -0
  129. /package/{dist_ts_interfaces → dist_ts}/data/secretbundle.d.ts +0 -0
  130. /package/{dist_ts_interfaces → dist_ts}/data/secretgroup.d.ts +0 -0
  131. /package/{dist_ts_interfaces → dist_ts}/data/server.d.ts +0 -0
  132. /package/{dist_ts_interfaces → dist_ts}/data/status.d.ts +0 -0
  133. /package/{dist_ts_interfaces → dist_ts}/data/traffic.d.ts +0 -0
  134. /package/{dist_ts_interfaces → dist_ts}/data/user.d.ts +0 -0
  135. /package/{dist_ts_interfaces → dist_ts}/data/version.d.ts +0 -0
  136. /package/{dist_ts_interfaces → dist_ts}/index.d.ts +0 -0
  137. /package/{dist_ts_interfaces → dist_ts}/platformservice/aibridge.d.ts +0 -0
  138. /package/{dist_ts_interfaces → dist_ts}/platformservice/index.d.ts +0 -0
  139. /package/{dist_ts_interfaces → dist_ts}/platformservice/letter.d.ts +0 -0
  140. /package/{dist_ts_interfaces → dist_ts}/platformservice/mta.d.ts +0 -0
  141. /package/{dist_ts_interfaces → dist_ts}/platformservice/pushnotification.d.ts +0 -0
  142. /package/{dist_ts_interfaces → dist_ts}/platformservice/sms.d.ts +0 -0
  143. /package/{dist_ts_interfaces → dist_ts}/plugins.d.ts +0 -0
  144. /package/{dist_ts_interfaces → dist_ts}/requests/admin.d.ts +0 -0
  145. /package/{dist_ts_interfaces → dist_ts}/requests/certificate.d.ts +0 -0
  146. /package/{dist_ts_interfaces → dist_ts}/requests/config.d.ts +0 -0
  147. /package/{dist_ts_interfaces → dist_ts}/requests/identity.d.ts +0 -0
  148. /package/{dist_ts_interfaces → dist_ts}/requests/image.d.ts +0 -0
  149. /package/{dist_ts_interfaces → dist_ts}/requests/inform.d.ts +0 -0
  150. /package/{dist_ts_interfaces → dist_ts}/requests/log.d.ts +0 -0
  151. /package/{dist_ts_interfaces → dist_ts}/requests/network.d.ts +0 -0
  152. /package/{dist_ts_interfaces → dist_ts}/requests/routing.d.ts +0 -0
  153. /package/{dist_ts_interfaces → dist_ts}/requests/secretbundle.d.ts +0 -0
  154. /package/{dist_ts_interfaces → dist_ts}/requests/secretgroup.d.ts +0 -0
  155. /package/{dist_ts_interfaces → dist_ts}/requests/server.d.ts +0 -0
  156. /package/{dist_ts_interfaces → dist_ts}/requests/service.d.ts +0 -0
  157. /package/{dist_ts_interfaces → dist_ts}/requests/status.d.ts +0 -0
  158. /package/{dist_ts_interfaces → dist_ts}/requests/version.d.ts +0 -0
  159. /package/{ts_interfaces → ts}/data/config.ts +0 -0
  160. /package/{ts_interfaces → ts}/data/docker.ts +0 -0
  161. /package/{ts_interfaces → ts}/data/event.ts +0 -0
  162. /package/{ts_interfaces → ts}/data/image.ts +0 -0
  163. /package/{ts_interfaces → ts}/data/secretbundle.ts +0 -0
  164. /package/{ts_interfaces → ts}/data/secretgroup.ts +0 -0
  165. /package/{ts_interfaces → ts}/data/server.ts +0 -0
  166. /package/{ts_interfaces → ts}/data/status.ts +0 -0
  167. /package/{ts_interfaces → ts}/data/traffic.ts +0 -0
  168. /package/{ts_interfaces → ts}/data/user.ts +0 -0
  169. /package/{ts_interfaces → ts}/data/version.ts +0 -0
  170. /package/{ts_interfaces → ts}/index.ts +0 -0
  171. /package/{ts_interfaces → ts}/platformservice/00readme.md +0 -0
  172. /package/{ts_interfaces → ts}/platformservice/aibridge.ts +0 -0
  173. /package/{ts_interfaces → ts}/platformservice/index.ts +0 -0
  174. /package/{ts_interfaces → ts}/platformservice/letter.ts +0 -0
  175. /package/{ts_interfaces → ts}/platformservice/mta.ts +0 -0
  176. /package/{ts_interfaces → ts}/platformservice/pushnotification.ts +0 -0
  177. /package/{ts_interfaces → ts}/platformservice/sms.ts +0 -0
  178. /package/{ts_interfaces → ts}/plugins.ts +0 -0
  179. /package/{ts_interfaces → ts}/requests/admin.ts +0 -0
  180. /package/{ts_interfaces → ts}/requests/certificate.ts +0 -0
  181. /package/{ts_interfaces → ts}/requests/config.ts +0 -0
  182. /package/{ts_interfaces → ts}/requests/identity.ts +0 -0
  183. /package/{ts_interfaces → ts}/requests/image.ts +0 -0
  184. /package/{ts_interfaces → ts}/requests/inform.ts +0 -0
  185. /package/{ts_interfaces → ts}/requests/log.ts +0 -0
  186. /package/{ts_interfaces → ts}/requests/network.ts +0 -0
  187. /package/{ts_interfaces → ts}/requests/routing.ts +0 -0
  188. /package/{ts_interfaces → ts}/requests/secretbundle.ts +0 -0
  189. /package/{ts_interfaces → ts}/requests/secretgroup.ts +0 -0
  190. /package/{ts_interfaces → ts}/requests/server.ts +0 -0
  191. /package/{ts_interfaces → ts}/requests/service.ts +0 -0
  192. /package/{ts_interfaces → ts}/requests/status.ts +0 -0
  193. /package/{ts_interfaces → ts}/requests/version.ts +0 -0
@@ -0,0 +1,95 @@
1
+ import * as plugins from '../plugins.js';
2
+ import * as data from '../data/index.js';
3
+ import * as userInterfaces from '../data/user.js';
4
+
5
+ // Get all tasks
6
+ export interface IRequest_Any_Cloudly_GetTasks
7
+ extends plugins.typedrequestInterfaces.implementsTR<
8
+ plugins.typedrequestInterfaces.ITypedRequest,
9
+ IRequest_Any_Cloudly_GetTasks
10
+ > {
11
+ method: 'getTasks';
12
+ request: {
13
+ identity: userInterfaces.IIdentity;
14
+ };
15
+ response: {
16
+ tasks: Array<{
17
+ name: string;
18
+ description: string;
19
+ category: 'maintenance' | 'deployment' | 'backup' | 'monitoring' | 'cleanup' | 'system' | 'security';
20
+ schedule?: string;
21
+ lastRun?: number;
22
+ enabled: boolean;
23
+ }>;
24
+ };
25
+ }
26
+
27
+ // Get task executions
28
+ export interface IRequest_Any_Cloudly_GetTaskExecutions
29
+ extends plugins.typedrequestInterfaces.implementsTR<
30
+ plugins.typedrequestInterfaces.ITypedRequest,
31
+ IRequest_Any_Cloudly_GetTaskExecutions
32
+ > {
33
+ method: 'getTaskExecutions';
34
+ request: {
35
+ identity: userInterfaces.IIdentity;
36
+ filter?: {
37
+ taskName?: string;
38
+ status?: string;
39
+ startedAfter?: number;
40
+ startedBefore?: number;
41
+ };
42
+ };
43
+ response: {
44
+ executions: data.ITaskExecution[];
45
+ };
46
+ }
47
+
48
+ // Get task execution by ID
49
+ export interface IRequest_Any_Cloudly_GetTaskExecutionById
50
+ extends plugins.typedrequestInterfaces.implementsTR<
51
+ plugins.typedrequestInterfaces.ITypedRequest,
52
+ IRequest_Any_Cloudly_GetTaskExecutionById
53
+ > {
54
+ method: 'getTaskExecutionById';
55
+ request: {
56
+ identity: userInterfaces.IIdentity;
57
+ executionId: string;
58
+ };
59
+ response: {
60
+ execution: data.ITaskExecution;
61
+ };
62
+ }
63
+
64
+ // Trigger task manually
65
+ export interface IRequest_Any_Cloudly_TriggerTask
66
+ extends plugins.typedrequestInterfaces.implementsTR<
67
+ plugins.typedrequestInterfaces.ITypedRequest,
68
+ IRequest_Any_Cloudly_TriggerTask
69
+ > {
70
+ method: 'triggerTask';
71
+ request: {
72
+ identity: userInterfaces.IIdentity;
73
+ taskName: string;
74
+ userId?: string;
75
+ };
76
+ response: {
77
+ execution: data.ITaskExecution;
78
+ };
79
+ }
80
+
81
+ // Cancel a running task
82
+ export interface IRequest_Any_Cloudly_CancelTask
83
+ extends plugins.typedrequestInterfaces.implementsTR<
84
+ plugins.typedrequestInterfaces.ITypedRequest,
85
+ IRequest_Any_Cloudly_CancelTask
86
+ > {
87
+ method: 'cancelTask';
88
+ request: {
89
+ identity: userInterfaces.IIdentity;
90
+ executionId: string;
91
+ };
92
+ response: {
93
+ success: boolean;
94
+ };
95
+ }
package/cli.js DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- process.env.CLI_CALL = 'true';
3
- const cliTool = await import('./dist_ts_interfaces/index.js');
4
- cliTool.runCli();
@@ -1,9 +0,0 @@
1
- /**
2
- * autocreated commitinfo by @push.rocks/commitinfo
3
- */
4
- export const commitinfo = {
5
- name: '@serve.zone/interfaces',
6
- version: '1.1.2',
7
- description: 'interfaces for working with containers'
8
- };
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHNfaW50ZXJmYWNlcy8wMF9jb21taXRpbmZvX2RhdGEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFDSCxNQUFNLENBQUMsTUFBTSxVQUFVLEdBQUc7SUFDeEIsSUFBSSxFQUFFLHdCQUF3QjtJQUM5QixPQUFPLEVBQUUsT0FBTztJQUNoQixXQUFXLEVBQUUsd0NBQXdDO0NBQ3RELENBQUEifQ==
@@ -1,11 +0,0 @@
1
- /**
2
- * a deployment happens when a service is deployed
3
- * tracks the status of a deployment
4
- */
5
- export interface IDeployment {
6
- id: string;
7
- affectedServiceIds: string[];
8
- usedImageId: string;
9
- deploymentLog: string[];
10
- status: 'scheduled' | 'running' | 'deployed' | 'failed';
11
- }
@@ -1,10 +0,0 @@
1
- export interface IExternalRegistry {
2
- id: string;
3
- data: {
4
- type: 'docker' | 'npm';
5
- name: string;
6
- url: string;
7
- username: string;
8
- password: string;
9
- };
10
- }
@@ -1,17 +0,0 @@
1
- export * from './cloudlyconfig.js';
2
- export * from './cluster.js';
3
- export * from './config.js';
4
- export * from './deployment.js';
5
- export * from './docker.js';
6
- export * from './event.js';
7
- export * from './externalregistry.js';
8
- export * from './image.js';
9
- export * from './secretbundle.js';
10
- export * from './secretgroup.js';
11
- export * from './server.js';
12
- export * from './service.js';
13
- export * from './status.js';
14
- export * from './traffic.js';
15
- export * from './user.js';
16
- export * from './version.js';
17
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90c19pbnRlcmZhY2VzL2RhdGEvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLGFBQWEsQ0FBQztBQUM1QixjQUFjLGlCQUFpQixDQUFDO0FBQ2hDLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsWUFBWSxDQUFDO0FBQzNCLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyxZQUFZLENBQUM7QUFDM0IsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLGtCQUFrQixDQUFBO0FBQ2hDLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsY0FBYyxDQUFDO0FBQzdCLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsY0FBYyxDQUFDO0FBQzdCLGNBQWMsV0FBVyxDQUFDO0FBQzFCLGNBQWMsY0FBYyxDQUFDIn0=
@@ -1,37 +0,0 @@
1
- import type { IServiceRessources } from './docker.js';
2
- export interface IService {
3
- id: string;
4
- data: {
5
- name: string;
6
- description: string;
7
- imageId: string;
8
- imageVersion: string;
9
- environment: {
10
- [key: string]: string;
11
- };
12
- /**
13
- * the main secret bundle id, exclusive to the service
14
- */
15
- secretBundleId: string;
16
- /**
17
- * those secret bundle ids do not belong to the service itself
18
- * and thus live past the service lifecycle
19
- */
20
- additionalSecretBundleIds?: string[];
21
- scaleFactor: number;
22
- balancingStrategy: 'round-robin' | 'least-connections';
23
- ports: {
24
- web: number;
25
- custom?: {
26
- [domain: string]: string;
27
- };
28
- };
29
- resources?: IServiceRessources;
30
- domains: {
31
- name: string;
32
- port?: number;
33
- protocol?: 'http' | 'https' | 'ssh';
34
- }[];
35
- deploymentIds: string[];
36
- };
37
- }
@@ -1,7 +0,0 @@
1
- import * as aibridge from './aibridge.js';
2
- import * as letter from './letter.js';
3
- import * as mta from './mta.js';
4
- import * as pushnotification from './pushnotification.js';
5
- import * as sms from './sms.js';
6
- export { aibridge, letter, mta, pushnotification, sms, };
7
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90c19pbnRlcmZhY2VzL3BsYXRmb3Jtc2VydmljZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssUUFBUSxNQUFNLGVBQWUsQ0FBQztBQUMxQyxPQUFPLEtBQUssTUFBTSxNQUFNLGFBQWEsQ0FBQztBQUN0QyxPQUFPLEtBQUssR0FBRyxNQUFNLFVBQVUsQ0FBQztBQUNoQyxPQUFPLEtBQUssZ0JBQWdCLE1BQU0sdUJBQXVCLENBQUM7QUFDMUQsT0FBTyxLQUFLLEdBQUcsTUFBTSxVQUFVLENBQUM7QUFFaEMsT0FBTyxFQUNMLFFBQVEsRUFDUixNQUFNLEVBQ04sR0FBRyxFQUNILGdCQUFnQixFQUNoQixHQUFHLEdBQ0osQ0FBQSJ9
@@ -1,2 +0,0 @@
1
- import * as plugins from '../plugins.js';
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVzaG5vdGlmaWNhdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzX2ludGVyZmFjZXMvcGxhdGZvcm1zZXJ2aWNlL3B1c2hub3RpZmljYXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE9BQU8sTUFBTSxlQUFlLENBQUMifQ==
@@ -1,4 +0,0 @@
1
- import * as plugins from '../plugins.js';
2
- import * as data from '../data/index.js';
3
- import * as userInterfaces from '../data/user.js';
4
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0ZXJuYWxyZWdpc3RyeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzX2ludGVyZmFjZXMvcmVxdWVzdHMvZXh0ZXJuYWxyZWdpc3RyeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEtBQUssSUFBSSxNQUFNLGtCQUFrQixDQUFDO0FBQ3pDLE9BQU8sS0FBSyxjQUFjLE1BQU0saUJBQWlCLENBQUMifQ==
@@ -1,19 +0,0 @@
1
- import * as adminRequests from './admin.js';
2
- import * as certificateRequests from './certificate.js';
3
- import * as clusterRequests from './cluster.js';
4
- import * as configRequests from './config.js';
5
- import * as externalRegistryRequests from './externalregistry.js';
6
- import * as identityRequests from './identity.js';
7
- import * as imageRequests from './image.js';
8
- import * as informRequests from './inform.js';
9
- import * as logRequests from './log.js';
10
- import * as networkRequests from './network.js';
11
- import * as routingRequests from './routing.js';
12
- import * as secretBundleRequests from './secretbundle.js';
13
- import * as secretGroupRequests from './secretgroup.js';
14
- import * as serverRequests from './server.js';
15
- import * as serviceRequests from './service.js';
16
- import * as statusRequests from './status.js';
17
- import * as versionRequests from './version.js';
18
- export { adminRequests as admin, certificateRequests as certificate, clusterRequests as cluster, configRequests as config, externalRegistryRequests as externalRegistry, identityRequests as identity, imageRequests as image, informRequests as inform, logRequests as log, networkRequests as network, routingRequests as routing, secretBundleRequests as secretbundle, secretGroupRequests as secretgroup, serverRequests as server, serviceRequests as service, statusRequests as status, versionRequests as version, };
19
- export * from './inform.js';
@@ -1,21 +0,0 @@
1
- import * as plugins from '../plugins.js';
2
- import * as adminRequests from './admin.js';
3
- import * as certificateRequests from './certificate.js';
4
- import * as clusterRequests from './cluster.js';
5
- import * as configRequests from './config.js';
6
- import * as externalRegistryRequests from './externalregistry.js';
7
- import * as identityRequests from './identity.js';
8
- import * as imageRequests from './image.js';
9
- import * as informRequests from './inform.js';
10
- import * as logRequests from './log.js';
11
- import * as networkRequests from './network.js';
12
- import * as routingRequests from './routing.js';
13
- import * as secretBundleRequests from './secretbundle.js';
14
- import * as secretGroupRequests from './secretgroup.js';
15
- import * as serverRequests from './server.js';
16
- import * as serviceRequests from './service.js';
17
- import * as statusRequests from './status.js';
18
- import * as versionRequests from './version.js';
19
- export { adminRequests as admin, certificateRequests as certificate, clusterRequests as cluster, configRequests as config, externalRegistryRequests as externalRegistry, identityRequests as identity, imageRequests as image, informRequests as inform, logRequests as log, networkRequests as network, routingRequests as routing, secretBundleRequests as secretbundle, secretGroupRequests as secretgroup, serverRequests as server, serviceRequests as service, statusRequests as status, versionRequests as version, };
20
- export * from './inform.js';
21
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90c19pbnRlcmZhY2VzL3JlcXVlc3RzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxPQUFPLE1BQU0sZUFBZSxDQUFDO0FBRXpDLE9BQU8sS0FBSyxhQUFhLE1BQU0sWUFBWSxDQUFDO0FBQzVDLE9BQU8sS0FBSyxtQkFBbUIsTUFBTSxrQkFBa0IsQ0FBQztBQUN4RCxPQUFPLEtBQUssZUFBZSxNQUFNLGNBQWMsQ0FBQztBQUNoRCxPQUFPLEtBQUssY0FBYyxNQUFNLGFBQWEsQ0FBQztBQUM5QyxPQUFPLEtBQUssd0JBQXdCLE1BQU0sdUJBQXVCLENBQUM7QUFDbEUsT0FBTyxLQUFLLGdCQUFnQixNQUFNLGVBQWUsQ0FBQztBQUNsRCxPQUFPLEtBQUssYUFBYSxNQUFNLFlBQVksQ0FBQztBQUM1QyxPQUFPLEtBQUssY0FBYyxNQUFNLGFBQWEsQ0FBQztBQUM5QyxPQUFPLEtBQUssV0FBVyxNQUFNLFVBQVUsQ0FBQztBQUN4QyxPQUFPLEtBQUssZUFBZSxNQUFNLGNBQWMsQ0FBQztBQUNoRCxPQUFPLEtBQUssZUFBZSxNQUFNLGNBQWMsQ0FBQztBQUNoRCxPQUFPLEtBQUssb0JBQW9CLE1BQU0sbUJBQW1CLENBQUM7QUFDMUQsT0FBTyxLQUFLLG1CQUFtQixNQUFNLGtCQUFrQixDQUFDO0FBQ3hELE9BQU8sS0FBSyxjQUFjLE1BQU0sYUFBYSxDQUFDO0FBQzlDLE9BQU8sS0FBSyxlQUFlLE1BQU0sY0FBYyxDQUFDO0FBQ2hELE9BQU8sS0FBSyxjQUFjLE1BQU0sYUFBYSxDQUFDO0FBQzlDLE9BQU8sS0FBSyxlQUFlLE1BQU0sY0FBYyxDQUFDO0FBRWhELE9BQU8sRUFDTCxhQUFhLElBQUksS0FBSyxFQUN0QixtQkFBbUIsSUFBSSxXQUFXLEVBQ2xDLGVBQWUsSUFBSSxPQUFPLEVBQzFCLGNBQWMsSUFBSSxNQUFNLEVBQ3hCLHdCQUF3QixJQUFJLGdCQUFnQixFQUM1QyxnQkFBZ0IsSUFBSSxRQUFRLEVBQzVCLGFBQWEsSUFBSSxLQUFLLEVBQ3RCLGNBQWMsSUFBSSxNQUFNLEVBQ3hCLFdBQVcsSUFBSSxHQUFHLEVBQ2xCLGVBQWUsSUFBSSxPQUFPLEVBQzFCLGVBQWUsSUFBSSxPQUFPLEVBQzFCLG9CQUFvQixJQUFJLFlBQVksRUFDcEMsbUJBQW1CLElBQUksV0FBVyxFQUNsQyxjQUFjLElBQUksTUFBTSxFQUN4QixlQUFlLElBQUksT0FBTyxFQUMxQixjQUFjLElBQUksTUFBTSxFQUN4QixlQUFlLElBQUksT0FBTyxHQUMzQixDQUFDO0FBRUYsY0FBYyxhQUFhLENBQUMifQ==
@@ -1,13 +0,0 @@
1
- import * as plugins from '../plugins.js';
2
-
3
- /**
4
- * a deployment happens when a service is deployed
5
- * tracks the status of a deployment
6
- */
7
- export interface IDeployment {
8
- id: string;
9
- affectedServiceIds: string[];
10
- usedImageId: string;
11
- deploymentLog: string[];
12
- status: 'scheduled' | 'running' | 'deployed' | 'failed';
13
- }
@@ -1,12 +0,0 @@
1
- import * as plugins from '../plugins.js';
2
-
3
- export interface IExternalRegistry {
4
- id: string;
5
- data: {
6
- type: 'docker' | 'npm';
7
- name: string;
8
- url: string;
9
- username: string;
10
- password: string;
11
- };
12
- }
@@ -1,34 +0,0 @@
1
- import type { IServiceRessources } from './docker.js';
2
-
3
- export interface IService {
4
- id: string;
5
- data: {
6
- name: string;
7
- description: string;
8
- imageId: string;
9
- imageVersion: string;
10
- environment: { [key: string]: string };
11
- /**
12
- * the main secret bundle id, exclusive to the service
13
- */
14
- secretBundleId: string;
15
- /**
16
- * those secret bundle ids do not belong to the service itself
17
- * and thus live past the service lifecycle
18
- */
19
- additionalSecretBundleIds?: string[];
20
- scaleFactor: number;
21
- balancingStrategy: 'round-robin' | 'least-connections';
22
- ports: {
23
- web: number;
24
- custom?: { [domain: string]: string };
25
- };
26
- resources?: IServiceRessources;
27
- domains: {
28
- name: string;
29
- port?: number;
30
- protocol?: 'http' | 'https' | 'ssh';
31
- }[];
32
- deploymentIds: string[];
33
- };
34
- }
@@ -1,223 +0,0 @@
1
- # @serve.zone/interfaces
2
-
3
- interfaces for working with containers
4
-
5
- ## Install
6
-
7
- To install `@serve.zone/interfaces`, run the following command in your terminal:
8
-
9
- ```bash
10
- npm install @serve.zone/interfaces --save
11
- ```
12
-
13
- This will add `@serve.zone/interfaces` to your project's dependencies, allowing you to import and use various predefined interfaces that facilitate container operations and interactions within the ServeZone ecosystem.
14
-
15
- ## Usage
16
-
17
- The `@serve.zone/interfaces` module provides a robust set of TypeScript interfaces designed to standardize interaction with various services and components in a cloud-native environment. The interfaces are targeted at simplifying the integration process with container orchestration, network configurations, logging, and service definitions. The module is particularly useful if you're working on infrastructure or service orchestration solutions using Node.js and TypeScript.
18
-
19
- This document guides you through a comprehensive use case scenario of `@serve.zone/interfaces`. We will cover how to effectively utilize these interfaces to set up cloud services, manage application configurations, and handle system-related communications. This tutorial will explore various feature sets within the module, focusing on real-world implementations and practical coding strategies.
20
-
21
- ### Prerequisites
22
-
23
- Before diving in, make sure to satisfy the following prerequisites:
24
-
25
- - **Node.js**: Ensure you have Node.js installed (preferably the latest LTS version).
26
-
27
- - **TypeScript**: Your environment should support TypeScript, as this module leverages strong typing offered by TypeScript.
28
-
29
- - **Cloud Account Access**: Some of the interfaces interact with live cloud services; thus, ensure you have necessary credentials (like API tokens) available for testing or integration.
30
-
31
- ### Core Interfaces and Scenarios
32
-
33
- #### 1. Handling Typed Requests
34
-
35
- One fundamental aspect is defining typed requests, which standardizes API call definitions across different microservices or components. The module offers interfaces such as `IRequest_GetAllImages`, `IRequest_CreateCluster`, that you can extend or implement within your service logic to ensure strong typing and consistency.
36
-
37
- ```typescript
38
- import { IRequest_GetAllImages } from '@serve.zone/interfaces/requests/image';
39
-
40
- class ImageService {
41
- private cloudlyClient;
42
-
43
- constructor(cloudlyClient: CloudlyApiClient) {
44
- this.cloudlyClient = cloudlyClient;
45
- }
46
-
47
- public async fetchAllImages() {
48
- const request: IRequest_GetAllImages['request'] = {
49
- identity: this.cloudlyClient.identity,
50
- };
51
- const response = await this.cloudlyClient.typedsocketClient.fireTypedRequest<IRequest_GetAllImages>(request);
52
- return response.images;
53
- }
54
- }
55
- ```
56
-
57
- In the above code, we structured a simple function to retrieve all images from a service, assuming the `cloudlyClient` is your authenticated API client. The typed request interface ensures that both the request and response align with the expected types.
58
-
59
- #### 2. Logging and Smart Logging Interfaces
60
-
61
- Logging is a crucial aspect of cloud applications. The module provides interfaces to assist in integrating logging systems like `@push.rocks/smartlog-interfaces`.
62
-
63
- ```typescript
64
- import { ILogger, ILogConfig } from '@push.rocks/smartlog-interfaces';
65
-
66
- class LoggerService {
67
- private logger: ILogger;
68
-
69
- constructor(logConfig: ILogConfig) {
70
- this.logger = new SmartLogger(logConfig);
71
- }
72
-
73
- public logMessage(logPackage: ILogPackage) {
74
- this.logger.log(logPackage);
75
- }
76
- }
77
- ```
78
-
79
- This illustrates a logger service utilizing `ILogConfig` to configure and initiate a logging mechanism. You can log structured data using `logPackage`, thus enhancing traceability and debugging efficiency.
80
-
81
- #### 3. Container Service Management
82
-
83
- Managing containers, particularly when dealing with microservices, can be complex, but interfaces like `IService`, `ICluster`, and `IServer` aid in structuring container service management.
84
-
85
- ```typescript
86
- import { IService } from '@serve.zone/interfaces/data/service';
87
-
88
- function defineService(): IService {
89
- return {
90
- id: 'unique-service-id',
91
- data: {
92
- name: 'my-container-service',
93
- imageId: 'unique-image-id',
94
- imageVersion: '1.0.0',
95
- environment: { KEY: 'VALUE' },
96
- secretBundleId: 'bundle-id',
97
- scaleFactor: 2,
98
- balancingStrategy: 'round-robin',
99
- ports: { web: 80 },
100
- domains: [{ name: 'example.com' }],
101
- deploymentIds: [],
102
- deploymentDirectiveIds: [],
103
- }
104
- };
105
- }
106
- ```
107
-
108
- In the example, a service definition is drafted, encapsulating critical service metadata, including its environment variables, domain configuration, and load balancing strategy. Adhering to `IService` ensures that all necessary service data is encapsulated correctly.
109
-
110
- #### 4. Network Configuration and Routing
111
-
112
- Networking is integral to cloud-native applications. Interfaces in `@serve.zone/interfaces` help shape network interaction patterns.
113
-
114
- ```typescript
115
- import { IReverseProxyConfig } from '@serve.zone/interfaces/data/traffic';
116
-
117
- const proxyConfig: IReverseProxyConfig = {
118
- domain: 'example.com',
119
- path: '/',
120
- serviceAddress: 'http://service:8080',
121
- ssl: true,
122
- };
123
-
124
- function configureProxy() {
125
- // Logic to apply the proxyConfig, potentially using Typedi, Smartclient, or similar libraries.
126
- }
127
- ```
128
-
129
- Here, `IReverseProxyConfig` is used to define a reverse proxy for a service. Such configurations are necessary for routing external requests into internal services securely.
130
-
131
- ### Advanced Interface Utilization
132
-
133
- #### Monitoring and Metrics Collection
134
-
135
- For observability, you can track system metrics using `IServerMetrics` or cluster status interfaces.
136
-
137
- ```typescript
138
- import { IServerMetrics } from '@serve.zone/interfaces/data/server';
139
-
140
- function reportMetrics(metrics: IServerMetrics) {
141
- console.log(`CPU Usage: ${metrics.cpuUsageInPercent}%`);
142
- console.log(`Memory Usage: ${metrics.memoryUsageinMB}MB`);
143
- }
144
-
145
- const sampleMetrics: IServerMetrics = {
146
- serverId: 'server-123',
147
- cpuUsageInPercent: 45,
148
- memoryUsageinMB: 2048,
149
- memoryAvailableInMB: 4096,
150
- containerCount: 10,
151
- containerMetrics: [],
152
- };
153
-
154
- reportMetrics(sampleMetrics);
155
- ```
156
-
157
- Implementing such metrics tracking provides insight into performance bottlenecks and helps strategize scaling decisions.
158
-
159
- #### Certificate Management
160
-
161
- To handle SSL certificates programmatically, utilize interfaces such as `IRequest_Any_Cloudly_GetCertificateForDomain`.
162
-
163
- ```typescript
164
- import { IRequest_Any_Cloudly_GetCertificateForDomain } from '@serve.zone/interfaces/requests/certificate';
165
-
166
- async function fetchCertificate(cloudlyClient: CloudlyApiClient, domainName: string) {
167
- const request: IRequest_Any_Cloudly_GetCertificateForDomain['request'] = {
168
- identity: cloudlyClient.identity,
169
- domainName: domainName,
170
- type: 'ssl'
171
- };
172
-
173
- return await cloudlyClient.typedsocketClient.fireTypedRequest<IRequest_Any_Cloudly_GetCertificateForDomain>(request);
174
- }
175
- ```
176
-
177
- Managing certificates dynamically via typed requests simplifies deployment and automates the security dimensions of your applications.
178
-
179
- #### Integrating with External Messaging Services
180
-
181
- Use `IRequest_SendEmail` to integrate platform services for sending emails:
182
-
183
- ```typescript
184
- import { IRequest_SendEmail } from '@serve.zone/interfaces/platformservice/mta';
185
-
186
- async function sendNotification(emailClient: any) {
187
- const emailRequest: IRequest_SendEmail['request'] = {
188
- title: 'Welcome to ServeZone!',
189
- from: 'service@company.com',
190
- to: 'user@example.com',
191
- body: '<h1>Congratulations</h1><p>Your account has been created successfully.</p>',
192
- };
193
-
194
- await emailClient.sendEmail(emailRequest);
195
- }
196
- ```
197
-
198
- This approach demonstrates abstracting the email sending functionality using typed interfaces, contributing to code consistency and robustness.
199
-
200
- ### Conclusion
201
-
202
- The `@serve.zone/interfaces` module equips developers with a set of interfaces tailored for managing containers, orchestrating cloud services, and handling system interactions seamlessly. By applying these interfaces, projects can achieve coherence, reduce coupling, and simplify the integration process across various service domains.
203
-
204
- Focusing on practical applications, try extending these interfaces to suit additional requirements in your projects. Engage actively with the module community, or contribute new ideas to enhance the breadth and depth of this interface library. Explore the integration patterns showcased here and contribute toward a sophisticated cloud-native development framework.
205
-
206
- ## License and Legal Information
207
-
208
- This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
209
-
210
- **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.
211
-
212
- ### Trademarks
213
-
214
- 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 and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
215
-
216
- ### Company Information
217
-
218
- Task Venture Capital GmbH
219
- Registered at District court Bremen HRB 35230 HB, Germany
220
-
221
- For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
222
-
223
- 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.
@@ -1,13 +0,0 @@
1
- {
2
- "order": 0,
3
- "name": "@serve.zone/interfaces",
4
- "dependencies": [
5
- "@api.global/typedrequest-interfaces",
6
- "@push.rocks/smartlog-interfaces",
7
- "@tsclass/tsclass"
8
- ],
9
- "registries": [
10
- "registry.npmjs.org:public",
11
- "verdaccio.lossless.digital:public"
12
- ]
13
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes