hcloud-sdk 14.13.2 → 15.0.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.
Files changed (161) hide show
  1. package/changelog.md +36 -800
  2. package/lib/Hcloud.d.ts +20 -10
  3. package/lib/Hcloud.js +60 -10
  4. package/lib/interfaces/bouncer/features/index.d.ts +3 -6
  5. package/lib/interfaces/frontend/featureflags/index.d.ts +7 -0
  6. package/lib/interfaces/frontend/featureflags/index.js +2 -0
  7. package/lib/interfaces/high5/space/event/stream/node/index.d.ts +2 -0
  8. package/lib/interfaces/high5/space/execution/index.d.ts +11 -0
  9. package/lib/interfaces/high5/wave/changelog.d.ts +30 -0
  10. package/lib/interfaces/high5/wave/changelog.js +18 -0
  11. package/lib/interfaces/high5/wave/index.d.ts +31 -1
  12. package/lib/interfaces/high5/wave/index.js +10 -1
  13. package/lib/interfaces/idp/user/GeneralSettings.d.ts +1 -0
  14. package/lib/interfaces/mothership/index.d.ts +1 -0
  15. package/lib/interfaces/nats/index.d.ts +8 -21
  16. package/lib/interfaces/nats/index.js +72 -90
  17. package/lib/service/agent/bundle/dev/index.d.ts +2 -2
  18. package/lib/service/agent/bundle/dev/index.js +14 -10
  19. package/lib/service/agent/context/index.d.ts +7 -9
  20. package/lib/service/agent/context/index.js +41 -32
  21. package/lib/service/agent/index.d.ts +9 -7
  22. package/lib/service/agent/index.js +23 -6
  23. package/lib/service/auditor/index.d.ts +6 -7
  24. package/lib/service/auditor/index.js +23 -17
  25. package/lib/service/auditor/internal/index.d.ts +2 -2
  26. package/lib/service/auditor/internal/index.js +24 -20
  27. package/lib/service/bouncer/features/index.d.ts +1 -1
  28. package/lib/service/bouncer/features/index.js +5 -3
  29. package/lib/service/bouncer/index.d.ts +3 -10
  30. package/lib/service/bouncer/index.js +6 -21
  31. package/lib/service/dali/DaliAvatar.d.ts +13 -9
  32. package/lib/service/dali/DaliAvatar.js +53 -8
  33. package/lib/service/dali/avatar/DaliFuseSpace.d.ts +4 -6
  34. package/lib/service/dali/avatar/DaliFuseSpace.js +26 -23
  35. package/lib/service/dali/avatar/DaliHigh5Space.d.ts +4 -6
  36. package/lib/service/dali/avatar/DaliHigh5Space.js +26 -23
  37. package/lib/service/dali/avatar/DaliOAuthApp.d.ts +4 -6
  38. package/lib/service/dali/avatar/DaliOAuthApp.js +26 -23
  39. package/lib/service/dali/avatar/DaliOrganization.d.ts +4 -6
  40. package/lib/service/dali/avatar/DaliOrganization.js +23 -20
  41. package/lib/service/dali/avatar/DaliTeam.d.ts +4 -6
  42. package/lib/service/dali/avatar/DaliTeam.js +26 -23
  43. package/lib/service/dali/avatar/DaliUser.d.ts +4 -6
  44. package/lib/service/dali/avatar/DaliUser.js +20 -17
  45. package/lib/service/dali/index.d.ts +4 -5
  46. package/lib/service/dali/index.js +14 -7
  47. package/lib/service/fuse/index.d.ts +8 -7
  48. package/lib/service/fuse/index.js +23 -9
  49. package/lib/service/fuse/internal/index.d.ts +3 -4
  50. package/lib/service/fuse/internal/index.js +5 -3
  51. package/lib/service/fuse/internal/space/cronjob/index.d.ts +3 -4
  52. package/lib/service/fuse/internal/space/cronjob/index.js +5 -3
  53. package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +2 -4
  54. package/lib/service/fuse/internal/space/cronjob/log/index.js +11 -12
  55. package/lib/service/fuse/internal/space/index.d.ts +5 -6
  56. package/lib/service/fuse/internal/space/index.js +24 -18
  57. package/lib/service/fuse/space/cronjob/index.d.ts +15 -15
  58. package/lib/service/fuse/space/cronjob/index.js +133 -105
  59. package/lib/service/fuse/space/cronjob/log/index.d.ts +3 -3
  60. package/lib/service/fuse/space/cronjob/log/index.js +24 -23
  61. package/lib/service/fuse/space/index.d.ts +13 -14
  62. package/lib/service/fuse/space/index.js +88 -70
  63. package/lib/service/high5/execution/index.d.ts +5 -5
  64. package/lib/service/high5/execution/index.js +11 -4
  65. package/lib/service/high5/execution/log/index.d.ts +2 -2
  66. package/lib/service/high5/execution/log/index.js +11 -12
  67. package/lib/service/high5/execution/status/index.d.ts +2 -2
  68. package/lib/service/high5/execution/status/index.js +11 -12
  69. package/lib/service/high5/index.d.ts +12 -9
  70. package/lib/service/high5/index.js +36 -12
  71. package/lib/service/high5/internal/index.d.ts +3 -4
  72. package/lib/service/high5/internal/index.js +5 -3
  73. package/lib/service/high5/internal/space/index.d.ts +2 -2
  74. package/lib/service/high5/internal/space/index.js +19 -15
  75. package/lib/service/high5/joinToken/index.d.ts +4 -4
  76. package/lib/service/high5/joinToken/index.js +36 -28
  77. package/lib/service/high5/space/event/index.d.ts +9 -10
  78. package/lib/service/high5/space/event/index.js +58 -46
  79. package/lib/service/high5/space/event/stream/design/index.d.ts +23 -8
  80. package/lib/service/high5/space/event/stream/design/index.js +60 -25
  81. package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +5 -5
  82. package/lib/service/high5/space/event/stream/design/snapshot/index.js +65 -58
  83. package/lib/service/high5/space/event/stream/index.d.ts +14 -15
  84. package/lib/service/high5/space/event/stream/index.js +125 -103
  85. package/lib/service/high5/space/execution/index.d.ts +9 -9
  86. package/lib/service/high5/space/execution/index.js +57 -42
  87. package/lib/service/high5/space/execution/log/index.d.ts +4 -6
  88. package/lib/service/high5/space/execution/log/index.js +22 -21
  89. package/lib/service/high5/space/execution/status/index.d.ts +1 -1
  90. package/lib/service/high5/space/execution/status/index.js +10 -8
  91. package/lib/service/high5/space/index.d.ts +25 -21
  92. package/lib/service/high5/space/index.js +131 -86
  93. package/lib/service/high5/space/secret/index.d.ts +6 -6
  94. package/lib/service/high5/space/secret/index.js +59 -49
  95. package/lib/service/high5/space/wave/index.d.ts +7 -9
  96. package/lib/service/high5/space/wave/index.js +40 -33
  97. package/lib/service/high5/space/webhook/index.d.ts +21 -14
  98. package/lib/service/high5/space/webhook/index.js +106 -73
  99. package/lib/service/high5/space/webhook/log/index.d.ts +2 -4
  100. package/lib/service/high5/space/webhook/log/index.js +11 -12
  101. package/lib/service/high5/wave/s3/index.d.ts +6 -6
  102. package/lib/service/high5/wave/s3/index.js +50 -38
  103. package/lib/service/idp/index.d.ts +17 -15
  104. package/lib/service/idp/index.js +104 -56
  105. package/lib/service/idp/internal/index.d.ts +2 -4
  106. package/lib/service/idp/internal/index.js +10 -11
  107. package/lib/service/idp/oauth/index.d.ts +16 -12
  108. package/lib/service/idp/oauth/index.js +55 -43
  109. package/lib/service/idp/organization/index.d.ts +12 -10
  110. package/lib/service/idp/organization/index.js +63 -28
  111. package/lib/service/idp/organization/license/index.d.ts +2 -2
  112. package/lib/service/idp/organization/license/index.js +5 -4
  113. package/lib/service/idp/organization/member/index.d.ts +10 -11
  114. package/lib/service/idp/organization/member/index.js +62 -48
  115. package/lib/service/idp/organization/member/invitations/index.d.ts +3 -3
  116. package/lib/service/idp/organization/member/invitations/index.js +47 -43
  117. package/lib/service/idp/organization/settings/domain/index.d.ts +7 -8
  118. package/lib/service/idp/organization/settings/domain/index.js +42 -29
  119. package/lib/service/idp/organization/settings/domain/saml/index.d.ts +5 -5
  120. package/lib/service/idp/organization/settings/domain/saml/index.js +58 -48
  121. package/lib/service/idp/organization/settings/index.d.ts +5 -5
  122. package/lib/service/idp/organization/settings/index.js +17 -4
  123. package/lib/service/idp/organization/settings/oauth/index.d.ts +9 -11
  124. package/lib/service/idp/organization/settings/oauth/index.js +67 -56
  125. package/lib/service/idp/organization/team/index.d.ts +8 -8
  126. package/lib/service/idp/organization/team/index.js +64 -55
  127. package/lib/service/idp/registration/index.d.ts +4 -6
  128. package/lib/service/idp/registration/index.js +37 -34
  129. package/lib/service/idp/user/index.d.ts +16 -15
  130. package/lib/service/idp/user/index.js +86 -51
  131. package/lib/service/idp/user/license/index.d.ts +2 -2
  132. package/lib/service/idp/user/license/index.js +5 -4
  133. package/lib/service/idp/user/password/index.d.ts +1 -1
  134. package/lib/service/idp/user/password/index.js +10 -11
  135. package/lib/service/idp/user/settings/connections/index.d.ts +2 -4
  136. package/lib/service/idp/user/settings/connections/index.js +9 -10
  137. package/lib/service/idp/user/settings/general/index.d.ts +10 -6
  138. package/lib/service/idp/user/settings/general/index.js +25 -13
  139. package/lib/service/idp/user/settings/index.d.ts +13 -9
  140. package/lib/service/idp/user/settings/index.js +53 -8
  141. package/lib/service/idp/user/settings/notifications/index.d.ts +3 -5
  142. package/lib/service/idp/user/settings/notifications/index.js +14 -13
  143. package/lib/service/idp/user/settings/oauthApps/index.d.ts +3 -5
  144. package/lib/service/idp/user/settings/oauthApps/index.js +17 -16
  145. package/lib/service/idp/user/settings/pats/index.d.ts +8 -10
  146. package/lib/service/idp/user/settings/pats/index.js +55 -44
  147. package/lib/service/idp/user/settings/twoFactor/index.d.ts +3 -4
  148. package/lib/service/idp/user/settings/twoFactor/index.js +8 -3
  149. package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +6 -8
  150. package/lib/service/idp/user/settings/twoFactor/totp/index.js +36 -29
  151. package/lib/service/mailer/index.d.ts +4 -5
  152. package/lib/service/mailer/index.js +12 -8
  153. package/lib/service/mailer/internal/index.d.ts +4 -4
  154. package/lib/service/mailer/internal/index.js +38 -33
  155. package/lib/service/mothership/index.d.ts +12 -12
  156. package/lib/service/mothership/index.js +92 -79
  157. package/lib/service/nats/index.d.ts +1 -3
  158. package/lib/service/nats/index.js +2 -2
  159. package/lib/utils/bouncer/features/Provider.d.ts +3 -0
  160. package/lib/utils/bouncer/features/Provider.js +20 -2
  161. package/package.json +1 -1
@@ -1,13 +1,13 @@
1
- import { AxiosInstance } from "axios";
2
- import Base, { Options } from "../../../../Base";
1
+ import Base from "../../../../Base";
3
2
  import { Cronjob, CronjobCreate } from "../../../../interfaces/fuse/space/cronjob/Cronjob";
4
3
  import { PaginatedResponse, SearchParams } from "../../../../interfaces/global";
5
4
  import { FuseCronjobLogInternal } from "../../internal/space/cronjob/log";
6
5
  import { FuseCronjobLog } from "./log";
7
6
  export declare class FuseCronjob extends Base {
8
- cronjobLog: FuseCronjobLog;
9
- cronjobLogInternal: FuseCronjobLogInternal;
10
- constructor(options: Options, axios: AxiosInstance);
7
+ get cronjobLog(): FuseCronjobLog;
8
+ private _cronjobLog?;
9
+ get cronjobLogInternal(): FuseCronjobLogInternal;
10
+ private _cronjobLogInternal?;
11
11
  /**
12
12
  * Retrieves a cronjob by it's ID.
13
13
  * @param orgName Name of the organization
@@ -16,7 +16,7 @@ export declare class FuseCronjob extends Base {
16
16
  * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
17
17
  * @returns The requested cronjob
18
18
  */
19
- getCronjob: (orgName: string, spaceName: string, cronjobId: string, exposeNextExecution?: boolean) => Promise<Cronjob>;
19
+ getCronjob(orgName: string, spaceName: string, cronjobId: string, exposeNextExecution?: boolean): Promise<Cronjob>;
20
20
  /**
21
21
  * Retrieves the next n cronjob executions as Unix timestamps (in milliseconds).
22
22
  * @param orgName Name of the organization
@@ -24,7 +24,7 @@ export declare class FuseCronjob extends Base {
24
24
  * @param cronjobId ID of the cronjob
25
25
  * @returns Array of Unix timestamps
26
26
  */
27
- getNextCronjobExecutions: (orgName: string, spaceName: string, cronjobId: string) => Promise<number[]>;
27
+ getNextCronjobExecutions(orgName: string, spaceName: string, cronjobId: string): Promise<number[]>;
28
28
  /**
29
29
  * Creates a new cronjob in the specified Fuse space.
30
30
  * @param orgName Name of the organisation
@@ -33,7 +33,7 @@ export declare class FuseCronjob extends Base {
33
33
  * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
34
34
  * @returns Created cronjob
35
35
  */
36
- createCronjob: (orgName: string, spaceName: string, createCronjob: CronjobCreate, exposeNextExecution?: boolean) => Promise<Cronjob>;
36
+ createCronjob(orgName: string, spaceName: string, createCronjob: CronjobCreate, exposeNextExecution?: boolean): Promise<Cronjob>;
37
37
  /**
38
38
  * Updates an existing cronjob.
39
39
  * @param orgName Name of the organization
@@ -43,7 +43,7 @@ export declare class FuseCronjob extends Base {
43
43
  * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
44
44
  * @returns Updated cronjob
45
45
  */
46
- updateCronjob: (orgName: string, spaceName: string, cronjobId: string, createCronjob: CronjobCreate, exposeNextExecution?: boolean) => Promise<Cronjob>;
46
+ updateCronjob(orgName: string, spaceName: string, cronjobId: string, createCronjob: CronjobCreate, exposeNextExecution?: boolean): Promise<Cronjob>;
47
47
  /**
48
48
  * Change the cron expression of an existing cronjob
49
49
  * @param orgName Name of the organization
@@ -53,7 +53,7 @@ export declare class FuseCronjob extends Base {
53
53
  * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
54
54
  * @returns The patched cronjob
55
55
  */
56
- patchCronjobExpression: (orgName: string, spaceName: string, cronjobId: string, expression: string, exposeNextExecution?: boolean) => Promise<Cronjob>;
56
+ patchCronjobExpression(orgName: string, spaceName: string, cronjobId: string, expression: string, exposeNextExecution?: boolean): Promise<Cronjob>;
57
57
  /**
58
58
  * Change the enabled flag of an existing cronjob
59
59
  * @param orgName Name of the organization
@@ -63,7 +63,7 @@ export declare class FuseCronjob extends Base {
63
63
  * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
64
64
  * @returns The patched cronjob
65
65
  */
66
- patchCronjobEnabled: (orgName: string, spaceName: string, cronjobId: string, enabled: boolean, exposeNextExecution?: boolean) => Promise<Cronjob>;
66
+ patchCronjobEnabled(orgName: string, spaceName: string, cronjobId: string, enabled: boolean, exposeNextExecution?: boolean): Promise<Cronjob>;
67
67
  /**
68
68
  * Enable a cronjob.
69
69
  *
@@ -94,7 +94,7 @@ export declare class FuseCronjob extends Base {
94
94
  * @param spaceName Name of the space
95
95
  * @param cronjobId ID of the cronjob
96
96
  */
97
- deleteCronjob: (orgName: string, spaceName: string, cronjobId: string) => Promise<void>;
97
+ deleteCronjob(orgName: string, spaceName: string, cronjobId: string): Promise<void>;
98
98
  /**
99
99
  * Retrieves all cronjobs of a Fuse space which match the provided search filter(s). Will return all cronjobs if no filter is provided.
100
100
  * @param orgName Name of the organization
@@ -106,11 +106,11 @@ export declare class FuseCronjob extends Base {
106
106
  * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the returned cronjob objects
107
107
  * @returns Object containing an array of filtered cronjobs as well as the total number of results found in the database (independent of limit and page)
108
108
  */
109
- searchCronjobs: ({ orgName, spaceName, filters, sorting, limit, page, exposeNextExecution, }: SearchParams & {
109
+ searchCronjobs({ orgName, spaceName, filters, sorting, limit, page, exposeNextExecution, }: SearchParams & {
110
110
  orgName: string;
111
111
  spaceName: string;
112
112
  exposeNextExecution?: boolean;
113
- }) => Promise<PaginatedResponse<Cronjob>>;
113
+ }): Promise<PaginatedResponse<Cronjob>>;
114
114
  /**
115
115
  * Resolve a cron pattern along with a timezone to get the next executions in mili-seconds.
116
116
  * @param expression The cron expression
@@ -118,6 +118,6 @@ export declare class FuseCronjob extends Base {
118
118
  * @param amount The amount of returned execution-dates (limited between 1 and 10, default is 3)
119
119
  * @returns Array of Unix timestamps
120
120
  */
121
- resolveCronPatternWithTimezone: (expression: string, timezone: string, amount?: number) => Promise<number[]>;
121
+ resolveCronPatternWithTimezone(expression: string, timezone: string, amount?: number): Promise<number[]>;
122
122
  protected getEndpoint(endpoint: string): string;
123
123
  }
@@ -16,82 +16,8 @@ const searchFilter_1 = require("../../../../helper/searchFilter");
16
16
  const log_1 = require("../../internal/space/cronjob/log");
17
17
  const log_2 = require("./log");
18
18
  class FuseCronjob extends Base_1.default {
19
- constructor(options, axios) {
20
- super(options, axios);
21
- /**
22
- * Retrieves a cronjob by it's ID.
23
- * @param orgName Name of the organization
24
- * @param spaceName Name of the Fuse space
25
- * @param cronjobId ID of the cronjob
26
- * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
27
- * @returns The requested cronjob
28
- */
29
- this.getCronjob = (orgName_1, spaceName_1, cronjobId_1, ...args_1) => __awaiter(this, [orgName_1, spaceName_1, cronjobId_1, ...args_1], void 0, function* (orgName, spaceName, cronjobId, exposeNextExecution = false) {
30
- const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}?nextExecution=${exposeNextExecution}`));
31
- return resp.data;
32
- });
33
- /**
34
- * Retrieves the next n cronjob executions as Unix timestamps (in milliseconds).
35
- * @param orgName Name of the organization
36
- * @param spaceName Name of the space
37
- * @param cronjobId ID of the cronjob
38
- * @returns Array of Unix timestamps
39
- */
40
- this.getNextCronjobExecutions = (orgName, spaceName, cronjobId) => __awaiter(this, void 0, void 0, function* () {
41
- const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/next`));
42
- return resp.data;
43
- });
44
- /**
45
- * Creates a new cronjob in the specified Fuse space.
46
- * @param orgName Name of the organisation
47
- * @param spaceName Name of the Fuse space
48
- * @param createCronjob Cronjob to be created
49
- * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
50
- * @returns Created cronjob
51
- */
52
- this.createCronjob = (orgName_1, spaceName_1, createCronjob_1, ...args_1) => __awaiter(this, [orgName_1, spaceName_1, createCronjob_1, ...args_1], void 0, function* (orgName, spaceName, createCronjob, exposeNextExecution = false) {
53
- const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs?nextExecution=${exposeNextExecution}`), createCronjob);
54
- return resp.data;
55
- });
56
- /**
57
- * Updates an existing cronjob.
58
- * @param orgName Name of the organization
59
- * @param spaceName Name of the space
60
- * @param cronjobId ID of the cronjob
61
- * @param createCronjob Cronjob to be updated
62
- * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
63
- * @returns Updated cronjob
64
- */
65
- this.updateCronjob = (orgName_1, spaceName_1, cronjobId_1, createCronjob_1, ...args_1) => __awaiter(this, [orgName_1, spaceName_1, cronjobId_1, createCronjob_1, ...args_1], void 0, function* (orgName, spaceName, cronjobId, createCronjob, exposeNextExecution = false) {
66
- const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}?nextExecution=${exposeNextExecution}`), createCronjob);
67
- return resp.data;
68
- });
69
- /**
70
- * Change the cron expression of an existing cronjob
71
- * @param orgName Name of the organization
72
- * @param spaceName Name of the space
73
- * @param cronjobId ID of the cronjob
74
- * @param expression New cron expression
75
- * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
76
- * @returns The patched cronjob
77
- */
78
- this.patchCronjobExpression = (orgName_1, spaceName_1, cronjobId_1, expression_1, ...args_1) => __awaiter(this, [orgName_1, spaceName_1, cronjobId_1, expression_1, ...args_1], void 0, function* (orgName, spaceName, cronjobId, expression, exposeNextExecution = false) {
79
- const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/expression?nextExecution=${exposeNextExecution}`), { expression: expression });
80
- return resp.data;
81
- });
82
- /**
83
- * Change the enabled flag of an existing cronjob
84
- * @param orgName Name of the organization
85
- * @param spaceName Name of the space
86
- * @param cronjobId ID of the cronjob
87
- * @param enabled Boolean flag to set
88
- * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
89
- * @returns The patched cronjob
90
- */
91
- this.patchCronjobEnabled = (orgName_1, spaceName_1, cronjobId_1, enabled_1, ...args_1) => __awaiter(this, [orgName_1, spaceName_1, cronjobId_1, enabled_1, ...args_1], void 0, function* (orgName, spaceName, cronjobId, enabled, exposeNextExecution = false) {
92
- const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/enabled?nextExecution=${exposeNextExecution}`), { enabled });
93
- return resp.data;
94
- });
19
+ constructor() {
20
+ super(...arguments);
95
21
  /**
96
22
  * Enable a cronjob.
97
23
  *
@@ -120,27 +46,129 @@ class FuseCronjob extends Base_1.default {
120
46
  this.disableCronjob = (orgName, spaceName, cronjobId, exposeNextExecution = false) => {
121
47
  return this.patchCronjobEnabled(orgName, spaceName, cronjobId, false, exposeNextExecution);
122
48
  };
123
- /**
124
- * Deletes a cronjob by its ID
125
- * @param orgName Name of the organization
126
- * @param spaceName Name of the space
127
- * @param cronjobId ID of the cronjob
128
- */
129
- this.deleteCronjob = (orgName, spaceName, cronjobId) => __awaiter(this, void 0, void 0, function* () {
49
+ }
50
+ get cronjobLog() {
51
+ if (this._cronjobLog === undefined) {
52
+ this._cronjobLog = new log_2.FuseCronjobLog(this.options, this.axios);
53
+ }
54
+ return this._cronjobLog;
55
+ }
56
+ get cronjobLogInternal() {
57
+ if (this._cronjobLogInternal === undefined) {
58
+ this._cronjobLogInternal = new log_1.FuseCronjobLogInternal(this.options, this.axios);
59
+ }
60
+ return this._cronjobLogInternal;
61
+ }
62
+ /**
63
+ * Retrieves a cronjob by it's ID.
64
+ * @param orgName Name of the organization
65
+ * @param spaceName Name of the Fuse space
66
+ * @param cronjobId ID of the cronjob
67
+ * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
68
+ * @returns The requested cronjob
69
+ */
70
+ getCronjob(orgName_1, spaceName_1, cronjobId_1) {
71
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, cronjobId, exposeNextExecution = false) {
72
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}?nextExecution=${exposeNextExecution}`));
73
+ return resp.data;
74
+ });
75
+ }
76
+ /**
77
+ * Retrieves the next n cronjob executions as Unix timestamps (in milliseconds).
78
+ * @param orgName Name of the organization
79
+ * @param spaceName Name of the space
80
+ * @param cronjobId ID of the cronjob
81
+ * @returns Array of Unix timestamps
82
+ */
83
+ getNextCronjobExecutions(orgName, spaceName, cronjobId) {
84
+ return __awaiter(this, void 0, void 0, function* () {
85
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/next`));
86
+ return resp.data;
87
+ });
88
+ }
89
+ /**
90
+ * Creates a new cronjob in the specified Fuse space.
91
+ * @param orgName Name of the organisation
92
+ * @param spaceName Name of the Fuse space
93
+ * @param createCronjob Cronjob to be created
94
+ * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
95
+ * @returns Created cronjob
96
+ */
97
+ createCronjob(orgName_1, spaceName_1, createCronjob_1) {
98
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, createCronjob, exposeNextExecution = false) {
99
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs?nextExecution=${exposeNextExecution}`), createCronjob);
100
+ return resp.data;
101
+ });
102
+ }
103
+ /**
104
+ * Updates an existing cronjob.
105
+ * @param orgName Name of the organization
106
+ * @param spaceName Name of the space
107
+ * @param cronjobId ID of the cronjob
108
+ * @param createCronjob Cronjob to be updated
109
+ * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
110
+ * @returns Updated cronjob
111
+ */
112
+ updateCronjob(orgName_1, spaceName_1, cronjobId_1, createCronjob_1) {
113
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, cronjobId, createCronjob, exposeNextExecution = false) {
114
+ const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}?nextExecution=${exposeNextExecution}`), createCronjob);
115
+ return resp.data;
116
+ });
117
+ }
118
+ /**
119
+ * Change the cron expression of an existing cronjob
120
+ * @param orgName Name of the organization
121
+ * @param spaceName Name of the space
122
+ * @param cronjobId ID of the cronjob
123
+ * @param expression New cron expression
124
+ * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
125
+ * @returns The patched cronjob
126
+ */
127
+ patchCronjobExpression(orgName_1, spaceName_1, cronjobId_1, expression_1) {
128
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, cronjobId, expression, exposeNextExecution = false) {
129
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/expression?nextExecution=${exposeNextExecution}`), { expression: expression });
130
+ return resp.data;
131
+ });
132
+ }
133
+ /**
134
+ * Change the enabled flag of an existing cronjob
135
+ * @param orgName Name of the organization
136
+ * @param spaceName Name of the space
137
+ * @param cronjobId ID of the cronjob
138
+ * @param enabled Boolean flag to set
139
+ * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
140
+ * @returns The patched cronjob
141
+ */
142
+ patchCronjobEnabled(orgName_1, spaceName_1, cronjobId_1, enabled_1) {
143
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, cronjobId, enabled, exposeNextExecution = false) {
144
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/enabled?nextExecution=${exposeNextExecution}`), { enabled });
145
+ return resp.data;
146
+ });
147
+ }
148
+ /**
149
+ * Deletes a cronjob by its ID
150
+ * @param orgName Name of the organization
151
+ * @param spaceName Name of the space
152
+ * @param cronjobId ID of the cronjob
153
+ */
154
+ deleteCronjob(orgName, spaceName, cronjobId) {
155
+ return __awaiter(this, void 0, void 0, function* () {
130
156
  yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}`));
131
157
  });
132
- /**
133
- * Retrieves all cronjobs of a Fuse space which match the provided search filter(s). Will return all cronjobs if no filter is provided.
134
- * @param orgName Name of the organization
135
- * @param spaceName Name of the space
136
- * @param filters (optional) Array of search filters
137
- * @param sorting (optional) Sorting object
138
- * @param limit (optional) Max number of results (1-100; defaults to 25)
139
- * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
140
- * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the returned cronjob objects
141
- * @returns Object containing an array of filtered cronjobs as well as the total number of results found in the database (independent of limit and page)
142
- */
143
- this.searchCronjobs = (_a) => __awaiter(this, [_a], void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0, exposeNextExecution = false, }) {
158
+ }
159
+ /**
160
+ * Retrieves all cronjobs of a Fuse space which match the provided search filter(s). Will return all cronjobs if no filter is provided.
161
+ * @param orgName Name of the organization
162
+ * @param spaceName Name of the space
163
+ * @param filters (optional) Array of search filters
164
+ * @param sorting (optional) Sorting object
165
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
166
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
167
+ * @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the returned cronjob objects
168
+ * @returns Object containing an array of filtered cronjobs as well as the total number of results found in the database (independent of limit and page)
169
+ */
170
+ searchCronjobs(_a) {
171
+ return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0, exposeNextExecution = false, }) {
144
172
  const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
145
173
  return new searchFilter_1.SearchFilterDTO(f);
146
174
  });
@@ -150,14 +178,16 @@ class FuseCronjob extends Base_1.default {
150
178
  });
151
179
  return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
152
180
  });
153
- /**
154
- * Resolve a cron pattern along with a timezone to get the next executions in mili-seconds.
155
- * @param expression The cron expression
156
- * @param timezone The target IANA timezone
157
- * @param amount The amount of returned execution-dates (limited between 1 and 10, default is 3)
158
- * @returns Array of Unix timestamps
159
- */
160
- this.resolveCronPatternWithTimezone = (expression_1, timezone_1, ...args_1) => __awaiter(this, [expression_1, timezone_1, ...args_1], void 0, function* (expression, timezone, amount = 3) {
181
+ }
182
+ /**
183
+ * Resolve a cron pattern along with a timezone to get the next executions in mili-seconds.
184
+ * @param expression The cron expression
185
+ * @param timezone The target IANA timezone
186
+ * @param amount The amount of returned execution-dates (limited between 1 and 10, default is 3)
187
+ * @returns Array of Unix timestamps
188
+ */
189
+ resolveCronPatternWithTimezone(expression_1, timezone_1) {
190
+ return __awaiter(this, arguments, void 0, function* (expression, timezone, amount = 3) {
161
191
  const resp = yield this.axios.post(this.getEndpoint(`/v1/cron/resolve`), {
162
192
  expression: expression,
163
193
  timezone: timezone,
@@ -165,8 +195,6 @@ class FuseCronjob extends Base_1.default {
165
195
  });
166
196
  return resp.data;
167
197
  });
168
- this.cronjobLog = new log_2.FuseCronjobLog(this.options, this.axios);
169
- this.cronjobLogInternal = new log_1.FuseCronjobLogInternal(this.options, this.axios);
170
198
  }
171
199
  getEndpoint(endpoint) {
172
200
  return `${this.options.server}/api/fuse${endpoint}`;
@@ -13,11 +13,11 @@ export declare class FuseCronjobLog extends Base {
13
13
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
14
14
  * @returns Object containing an array of filtered cronjob logs as well as the total number of results found in the database (independent of limit and page)
15
15
  */
16
- searchCronjobLogs: ({ orgName, spaceName, cronjobId, filters, sorting, limit, page, }: SearchParams & {
16
+ searchCronjobLogs({ orgName, spaceName, cronjobId, filters, sorting, limit, page, }: SearchParams & {
17
17
  orgName: string;
18
18
  spaceName: string;
19
19
  cronjobId: string;
20
- }) => Promise<PaginatedResponse<CronjobLogDto>>;
20
+ }): Promise<PaginatedResponse<CronjobLogDto>>;
21
21
  /**
22
22
  * Retrieves a cronjob log by it's ID
23
23
  * @param orgName Name of the organization
@@ -26,6 +26,6 @@ export declare class FuseCronjobLog extends Base {
26
26
  * @param cronjobLogId ID of the cronjob log
27
27
  * @returns the cronjob log
28
28
  */
29
- getCronjobLog: (orgName: string, spaceName: string, cronjobId: string, cronjobLogId: string) => Promise<CronjobLogDto>;
29
+ getCronjobLog(orgName: string, spaceName: string, cronjobId: string, cronjobLogId: string): Promise<CronjobLogDto>;
30
30
  protected getEndpoint(endpoint: string): string;
31
31
  }
@@ -14,20 +14,19 @@ const Base_1 = require("../../../../../Base");
14
14
  const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
15
15
  const searchFilter_1 = require("../../../../../helper/searchFilter");
16
16
  class FuseCronjobLog extends Base_1.default {
17
- constructor() {
18
- super(...arguments);
19
- /**
20
- * Retrieves all cronjobs of a Fuse space which match the provided search filter(s). Will return all cronjobs if no filter is provided.
21
- * @param orgName Name of the organization
22
- * @param spaceName Name of the space
23
- * @param cronjobId ID of the cronjob
24
- * @param filters (optional) Array of search filters
25
- * @param sorting (optional) Sorting object
26
- * @param limit (optional) Max number of results (1-100; defaults to 25)
27
- * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
28
- * @returns Object containing an array of filtered cronjob logs as well as the total number of results found in the database (independent of limit and page)
29
- */
30
- this.searchCronjobLogs = (_a) => __awaiter(this, [_a], void 0, function* ({ orgName, spaceName, cronjobId, filters, sorting, limit = 25, page = 0, }) {
17
+ /**
18
+ * Retrieves all cronjobs of a Fuse space which match the provided search filter(s). Will return all cronjobs if no filter is provided.
19
+ * @param orgName Name of the organization
20
+ * @param spaceName Name of the space
21
+ * @param cronjobId ID of the cronjob
22
+ * @param filters (optional) Array of search filters
23
+ * @param sorting (optional) Sorting object
24
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
25
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
26
+ * @returns Object containing an array of filtered cronjob logs as well as the total number of results found in the database (independent of limit and page)
27
+ */
28
+ searchCronjobLogs(_a) {
29
+ return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, cronjobId, filters, sorting, limit = 25, page = 0, }) {
31
30
  const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
32
31
  return new searchFilter_1.SearchFilterDTO(f);
33
32
  });
@@ -37,15 +36,17 @@ class FuseCronjobLog extends Base_1.default {
37
36
  });
38
37
  return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
39
38
  });
40
- /**
41
- * Retrieves a cronjob log by it's ID
42
- * @param orgName Name of the organization
43
- * @param spaceName Name of the space
44
- * @param cronjobId ID of the cronjob
45
- * @param cronjobLogId ID of the cronjob log
46
- * @returns the cronjob log
47
- */
48
- this.getCronjobLog = (orgName, spaceName, cronjobId, cronjobLogId) => __awaiter(this, void 0, void 0, function* () {
39
+ }
40
+ /**
41
+ * Retrieves a cronjob log by it's ID
42
+ * @param orgName Name of the organization
43
+ * @param spaceName Name of the space
44
+ * @param cronjobId ID of the cronjob
45
+ * @param cronjobLogId ID of the cronjob log
46
+ * @returns the cronjob log
47
+ */
48
+ getCronjobLog(orgName, spaceName, cronjobId, cronjobLogId) {
49
+ return __awaiter(this, void 0, void 0, function* () {
49
50
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/logs/${cronjobLogId}`));
50
51
  return resp.data;
51
52
  });
@@ -1,31 +1,30 @@
1
- import { AxiosInstance } from "axios";
2
- import Base, { Options } from "../../../Base";
1
+ import Base from "../../../Base";
3
2
  import { FuseSpace as IFuseSpace, FuseSpaceEntityPermission as SpaceEntityPermission, FuseSpacePermission as SpacePermission } from "../../../interfaces/fuse/space";
4
3
  import { PaginatedResponse, SearchParams } from "../../../interfaces/global";
5
4
  import { FuseCronjob } from "./cronjob";
6
5
  export declare class FuseSpace extends Base {
7
- cronjob: FuseCronjob;
8
- constructor(options: Options, axios: AxiosInstance);
6
+ get cronjob(): FuseCronjob;
7
+ private _cronjob?;
9
8
  /**
10
9
  * Retrieves a Fuse space by its name
11
10
  * @param orgName Name of the organization
12
11
  * @param spaceName Name of the space
13
12
  * @returns The requested space
14
13
  */
15
- getSpace: (orgName: string, spaceName: string) => Promise<IFuseSpace>;
14
+ getSpace(orgName: string, spaceName: string): Promise<IFuseSpace>;
16
15
  /**
17
16
  * Creates a new Fuse space
18
17
  * @param orgName Name of the organization
19
18
  * @param name Name of the space to be created
20
19
  * @returns The created space
21
20
  */
22
- createSpace: (orgName: string, name: string) => Promise<IFuseSpace>;
21
+ createSpace(orgName: string, name: string): Promise<IFuseSpace>;
23
22
  /**
24
23
  * Deletes a space by its name
25
24
  * @param orgName Name of the organization
26
25
  * @param spaceName Name of the space
27
26
  */
28
- deleteSpace: (orgName: string, spaceName: string) => Promise<void>;
27
+ deleteSpace(orgName: string, spaceName: string): Promise<void>;
29
28
  /**
30
29
  * Adds/Updates/Removes the permission a user has in the specified space.
31
30
  * @param orgName Name of the organization
@@ -34,7 +33,7 @@ export declare class FuseSpace extends Base {
34
33
  * @param permission New permission
35
34
  * @returns The Fuse space with the updated permissions
36
35
  */
37
- updateUserSpacePermission: (orgName: string, spaceName: string, userId: string, permission: SpacePermission) => Promise<SpaceEntityPermission>;
36
+ updateUserSpacePermission(orgName: string, spaceName: string, userId: string, permission: SpacePermission): Promise<SpaceEntityPermission>;
38
37
  /**
39
38
  * Adds/Updates/Removes the permission a team has in the specified space. Note: A team cannot be an owner of a Space.
40
39
  * @param orgName Name of the organization
@@ -43,7 +42,7 @@ export declare class FuseSpace extends Base {
43
42
  * @param permission New permission
44
43
  * @returns The Fuse space with the updated permissions
45
44
  */
46
- updateTeamSpacePermission: (orgName: string, spaceName: string, teamName: string, permission: SpacePermission) => Promise<SpaceEntityPermission>;
45
+ updateTeamSpacePermission(orgName: string, spaceName: string, teamName: string, permission: SpacePermission): Promise<SpaceEntityPermission>;
47
46
  /**
48
47
  * Retrieves all Fuse spaces of an organization which match the provided search filter(s). Will return all spaces of the organization if no filter is provided.
49
48
  * @param orgName Name of the organization
@@ -53,9 +52,9 @@ export declare class FuseSpace extends Base {
53
52
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
54
53
  * @returns Object containing an array of filtered Fuse spaces as well as the total number of results found in the database (independent of limit and page)
55
54
  */
56
- searchSpaces: ({ orgName, filters, sorting, limit, page, }: SearchParams & {
55
+ searchSpaces({ orgName, filters, sorting, limit, page, }: SearchParams & {
57
56
  orgName: string;
58
- }) => Promise<PaginatedResponse<IFuseSpace>>;
57
+ }): Promise<PaginatedResponse<IFuseSpace>>;
59
58
  /**
60
59
  * Retrieves permissions of a space matching the search filter(s). Will return all permissions of the space if no search filter is provided.
61
60
  * @param orgName Name of the organization
@@ -66,10 +65,10 @@ export declare class FuseSpace extends Base {
66
65
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
67
66
  * @returns Object containing an array of High5 Space Permissions and the total number of results found in the database (independent of limit and page)
68
67
  */
69
- searchSpacePermissions: ({ orgName, spaceName, filters, sorting, limit, page, }: SearchParams & {
68
+ searchSpacePermissions({ orgName, spaceName, filters, sorting, limit, page, }: SearchParams & {
70
69
  orgName: string;
71
70
  spaceName: string;
72
- }) => Promise<PaginatedResponse<SpaceEntityPermission>>;
71
+ }): Promise<PaginatedResponse<SpaceEntityPermission>>;
73
72
  /**
74
73
  * Updates the name of a space.
75
74
  * @param orgName Name of the organization
@@ -77,6 +76,6 @@ export declare class FuseSpace extends Base {
77
76
  * @param newSpaceName New name for the space
78
77
  * @returns The updated space
79
78
  */
80
- renameSpace: (orgName: string, spaceName: string, newSpaceName: string) => Promise<IFuseSpace>;
79
+ renameSpace(orgName: string, spaceName: string, newSpaceName: string): Promise<IFuseSpace>;
81
80
  protected getEndpoint(endpoint: string): string;
82
81
  }