@serve.zone/interfaces 4.12.1 → 4.13.0

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.
@@ -19,21 +19,25 @@ export interface ISecretBundle {
19
19
  * the bundle is a secret bundle that is used by an external service
20
20
  */
21
21
  type: 'service' | 'npmci' | 'gitzone' | 'external';
22
+ /**
23
+ * set this if the secretBundle belongs to a service
24
+ */
25
+ serviceId?: string;
22
26
  /**
23
27
  * You can add specific secret groups using this
24
28
  */
25
29
  includedSecretGroupIds: string[];
26
30
  /**
27
- * You can add specific tags using this
31
+ * access to this secretBundle also grants access to resources with matching tags
28
32
  */
29
33
  includedTags: {
30
34
  key: string;
31
35
  value?: string;
32
36
  }[];
33
37
  /**
34
- * add images
38
+ * access to this secretBundle also grants access to the images
35
39
  */
36
- includedImages: {
40
+ imageClaims: {
37
41
  imageId: string;
38
42
  permissions: ('read' | 'write')[];
39
43
  }[];
@@ -9,7 +9,15 @@ export interface IService {
9
9
  environment: {
10
10
  [key: string]: string;
11
11
  };
12
+ /**
13
+ * the main secret bundle id, exclusive to the service
14
+ */
12
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[];
13
21
  scaleFactor: number;
14
22
  balancingStrategy: 'round-robin' | 'least-connections';
15
23
  ports: {
@@ -1,7 +1,6 @@
1
1
  import * as plugins from '../plugins.js';
2
2
  import type { IService } from '../data/service.js';
3
3
  import type { IIdentity } from '../data/user.js';
4
- import type { IServiceRessources } from '../data/docker.js';
5
4
  export interface IRequest_Any_Cloudly_GetServiceById extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IRequest_Any_Cloudly_GetServiceById> {
6
5
  method: 'getServiceById';
7
6
  request: {
@@ -25,28 +24,7 @@ export interface IRequest_Any_Cloudly_CreateService extends plugins.typedrequest
25
24
  method: 'createService';
26
25
  request: {
27
26
  identity: IIdentity;
28
- name: string;
29
- description: string;
30
- imageId: string;
31
- imageVersion: string;
32
- environment: {
33
- [key: string]: string;
34
- };
35
- secretBundleId: string;
36
- scaleFactor: number;
37
- balancingStrategy: 'round-robin' | 'least-connections';
38
- ports: {
39
- web: number;
40
- custom?: {
41
- [domain: string]: string;
42
- };
43
- };
44
- resources?: IServiceRessources;
45
- domains: {
46
- name: string;
47
- port?: number;
48
- protocol?: 'http' | 'https' | 'ssh';
49
- }[];
27
+ serviceData: IService['data'];
50
28
  };
51
29
  response: {
52
30
  service: IService;
@@ -57,35 +35,14 @@ export interface IRequest_Any_Cloudly_UpdateService extends plugins.typedrequest
57
35
  request: {
58
36
  identity: IIdentity;
59
37
  serviceId: string;
60
- name: string;
61
- description: string;
62
- imageId: string;
63
- imageVersion: string;
64
- environment: {
65
- [key: string]: string;
66
- };
67
- secretBundleId: string;
68
- scaleFactor: number;
69
- balancingStrategy: 'round-robin' | 'least-connections';
70
- ports: {
71
- web: number;
72
- custom?: {
73
- [domain: string]: string;
74
- };
75
- };
76
- resources?: IServiceRessources;
77
- domains: {
78
- name: string;
79
- port?: number;
80
- protocol?: 'http' | 'https' | 'ssh';
81
- }[];
38
+ serviceData: IService['data'];
82
39
  };
83
40
  response: {
84
41
  service: IService;
85
42
  };
86
43
  }
87
- export interface IRequest_Any_Cloudly_DeleteService extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IRequest_Any_Cloudly_DeleteService> {
88
- method: 'deleteService';
44
+ export interface IRequest_Any_Cloudly_DeleteServiceById extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IRequest_Any_Cloudly_DeleteServiceById> {
45
+ method: 'deleteServiceById';
89
46
  request: {
90
47
  identity: IIdentity;
91
48
  serviceId: string;
@@ -94,3 +51,16 @@ export interface IRequest_Any_Cloudly_DeleteService extends plugins.typedrequest
94
51
  success: boolean;
95
52
  };
96
53
  }
54
+ export interface IRequest_Any_Cloudly_GetServiceSecretBundlesAsFlatObject extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IRequest_Any_Cloudly_GetServiceSecretBundlesAsFlatObject> {
55
+ method: 'getServiceSecretBundlesAsFlatObject';
56
+ request: {
57
+ identity: IIdentity;
58
+ serviceId: string;
59
+ environment: string;
60
+ };
61
+ response: {
62
+ flatKeyValueObject: {
63
+ [key: string]: string;
64
+ };
65
+ };
66
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serve.zone/interfaces",
3
- "version": "4.12.1",
3
+ "version": "4.13.0",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "exports": {
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@api.global/typedrequest-interfaces": "^3.0.19",
13
13
  "@push.rocks/smartlog-interfaces": "^3.0.2",
14
- "@tsclass/tsclass": "^4.2.0"
14
+ "@tsclass/tsclass": "^9.0.0"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@git.zone/tsbuild": "2.1.67"
@@ -21,13 +21,19 @@ export interface ISecretBundle {
21
21
  */
22
22
  type: 'service' | 'npmci' | 'gitzone' | 'external';
23
23
 
24
+
25
+ /**
26
+ * set this if the secretBundle belongs to a service
27
+ */
28
+ serviceId?: string;
29
+
24
30
  /**
25
31
  * You can add specific secret groups using this
26
32
  */
27
33
  includedSecretGroupIds: string[];
28
34
 
29
35
  /**
30
- * You can add specific tags using this
36
+ * access to this secretBundle also grants access to resources with matching tags
31
37
  */
32
38
  includedTags: {
33
39
  key: string;
@@ -35,12 +41,12 @@ export interface ISecretBundle {
35
41
  }[];
36
42
 
37
43
  /**
38
- * add images
44
+ * access to this secretBundle also grants access to the images
39
45
  */
40
- includedImages: {
46
+ imageClaims: {
41
47
  imageId: string;
42
48
  permissions: ('read' | 'write')[];
43
- }[];
49
+ }[];
44
50
 
45
51
  /**
46
52
  * authrozations select a specific environment of a config bundle
@@ -8,7 +8,15 @@ export interface IService {
8
8
  imageId: string;
9
9
  imageVersion: string;
10
10
  environment: { [key: string]: string };
11
+ /**
12
+ * the main secret bundle id, exclusive to the service
13
+ */
11
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[];
12
20
  scaleFactor: number;
13
21
  balancingStrategy: 'round-robin' | 'least-connections';
14
22
  ports: {
@@ -40,24 +40,7 @@ extends plugins.typedrequestInterfaces.implementsTR<
40
40
  method: 'createService';
41
41
  request: {
42
42
  identity: IIdentity;
43
- name: string;
44
- description: string;
45
- imageId: string;
46
- imageVersion: string;
47
- environment: { [key: string]: string };
48
- secretBundleId: string;
49
- scaleFactor: number;
50
- balancingStrategy: 'round-robin' | 'least-connections';
51
- ports: {
52
- web: number;
53
- custom?: { [domain: string]: string };
54
- };
55
- resources?: IServiceRessources;
56
- domains: {
57
- name: string;
58
- port?: number;
59
- protocol?: 'http' | 'https' | 'ssh';
60
- }[];
43
+ serviceData: IService['data'];
61
44
  };
62
45
  response: {
63
46
  service: IService;
@@ -73,36 +56,19 @@ extends plugins.typedrequestInterfaces.implementsTR<
73
56
  request: {
74
57
  identity: IIdentity;
75
58
  serviceId: string;
76
- name: string;
77
- description: string;
78
- imageId: string;
79
- imageVersion: string;
80
- environment: { [key: string]: string };
81
- secretBundleId: string;
82
- scaleFactor: number;
83
- balancingStrategy: 'round-robin' | 'least-connections';
84
- ports: {
85
- web: number;
86
- custom?: { [domain: string]: string };
87
- };
88
- resources?: IServiceRessources;
89
- domains: {
90
- name: string;
91
- port?: number;
92
- protocol?: 'http' | 'https' | 'ssh';
93
- }[];
59
+ serviceData: IService['data'];
94
60
  };
95
61
  response: {
96
62
  service: IService;
97
63
  };
98
64
  }
99
65
 
100
- export interface IRequest_Any_Cloudly_DeleteService
66
+ export interface IRequest_Any_Cloudly_DeleteServiceById
101
67
  extends plugins.typedrequestInterfaces.implementsTR<
102
68
  plugins.typedrequestInterfaces.ITypedRequest,
103
- IRequest_Any_Cloudly_DeleteService
69
+ IRequest_Any_Cloudly_DeleteServiceById
104
70
  > {
105
- method: 'deleteService';
71
+ method: 'deleteServiceById';
106
72
  request: {
107
73
  identity: IIdentity;
108
74
  serviceId: string;
@@ -111,3 +77,19 @@ extends plugins.typedrequestInterfaces.implementsTR<
111
77
  success: boolean;
112
78
  };
113
79
  }
80
+
81
+ export interface IRequest_Any_Cloudly_GetServiceSecretBundlesAsFlatObject
82
+ extends plugins.typedrequestInterfaces.implementsTR<
83
+ plugins.typedrequestInterfaces.ITypedRequest,
84
+ IRequest_Any_Cloudly_GetServiceSecretBundlesAsFlatObject
85
+ > {
86
+ method: 'getServiceSecretBundlesAsFlatObject';
87
+ request: {
88
+ identity: IIdentity;
89
+ serviceId: string;
90
+ environment: string;
91
+ };
92
+ response: {
93
+ flatKeyValueObject: {[key: string]: string};
94
+ };
95
+ }