@northflank/js-client 0.4.1 → 0.5.0-beta.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 (257) hide show
  1. package/dist/cjs/api-client.d.ts +6013 -0
  2. package/dist/cjs/api-client.js +1 -0
  3. package/dist/cjs/package.json +3 -0
  4. package/dist/esm/api-client.d.ts +6013 -0
  5. package/dist/esm/api-client.js +15 -0
  6. package/dist/esm/package.json +3 -0
  7. package/package.json +12 -19
  8. package/dist/api-client.d.ts +0 -481
  9. package/dist/api-client.js +0 -748
  10. package/dist/api-endpoint.d.ts +0 -63
  11. package/dist/api-endpoint.js +0 -216
  12. package/dist/context/api-client-context-provider.d.ts +0 -47
  13. package/dist/context/api-client-context-provider.js +0 -332
  14. package/dist/context/api-client-file-context-provider.d.ts +0 -11
  15. package/dist/context/api-client-file-context-provider.js +0 -138
  16. package/dist/context/api-client-in-memory-context-provider.d.ts +0 -6
  17. package/dist/context/api-client-in-memory-context-provider.js +0 -82
  18. package/dist/context/index.d.ts +0 -3
  19. package/dist/context/index.js +0 -15
  20. package/dist/endpoints/abort/addon/backup.d.ts +0 -21
  21. package/dist/endpoints/abort/addon/backup.js +0 -36
  22. package/dist/endpoints/abort/addon/restore.d.ts +0 -26
  23. package/dist/endpoints/abort/addon/restore.js +0 -36
  24. package/dist/endpoints/abort/job/build.d.ts +0 -21
  25. package/dist/endpoints/abort/job/build.js +0 -36
  26. package/dist/endpoints/abort/job/run.d.ts +0 -21
  27. package/dist/endpoints/abort/job/run.js +0 -36
  28. package/dist/endpoints/abort/service/build.d.ts +0 -21
  29. package/dist/endpoints/abort/service/build.js +0 -36
  30. package/dist/endpoints/add/domain/subdomain.d.ts +0 -33
  31. package/dist/endpoints/add/domain/subdomain.js +0 -36
  32. package/dist/endpoints/add/registryCredentials.d.ts +0 -47
  33. package/dist/endpoints/add/registryCredentials.js +0 -36
  34. package/dist/endpoints/assign/subdomain/service.d.ts +0 -28
  35. package/dist/endpoints/assign/subdomain/service.js +0 -36
  36. package/dist/endpoints/backup/addon.d.ts +0 -51
  37. package/dist/endpoints/backup/addon.js +0 -36
  38. package/dist/endpoints/create/addon.d.ts +0 -90
  39. package/dist/endpoints/create/addon.js +0 -36
  40. package/dist/endpoints/create/domain.d.ts +0 -27
  41. package/dist/endpoints/create/domain.js +0 -36
  42. package/dist/endpoints/create/job/cron.d.ts +0 -157
  43. package/dist/endpoints/create/job/cron.js +0 -36
  44. package/dist/endpoints/create/job/manual.d.ts +0 -147
  45. package/dist/endpoints/create/job/manual.js +0 -36
  46. package/dist/endpoints/create/project.d.ts +0 -29
  47. package/dist/endpoints/create/project.js +0 -36
  48. package/dist/endpoints/create/secret.d.ts +0 -79
  49. package/dist/endpoints/create/secret.js +0 -36
  50. package/dist/endpoints/create/service/build.d.ts +0 -116
  51. package/dist/endpoints/create/service/build.js +0 -36
  52. package/dist/endpoints/create/service/combined.d.ts +0 -166
  53. package/dist/endpoints/create/service/combined.js +0 -36
  54. package/dist/endpoints/create/service/deployment.d.ts +0 -137
  55. package/dist/endpoints/create/service/deployment.js +0 -36
  56. package/dist/endpoints/delete/addon.d.ts +0 -19
  57. package/dist/endpoints/delete/addon.js +0 -36
  58. package/dist/endpoints/delete/backup.d.ts +0 -21
  59. package/dist/endpoints/delete/backup.js +0 -36
  60. package/dist/endpoints/delete/domain.d.ts +0 -17
  61. package/dist/endpoints/delete/domain.js +0 -36
  62. package/dist/endpoints/delete/job.d.ts +0 -19
  63. package/dist/endpoints/delete/job.js +0 -36
  64. package/dist/endpoints/delete/project.d.ts +0 -17
  65. package/dist/endpoints/delete/project.js +0 -36
  66. package/dist/endpoints/delete/registryCredentials.d.ts +0 -17
  67. package/dist/endpoints/delete/registryCredentials.js +0 -36
  68. package/dist/endpoints/delete/secret.d.ts +0 -19
  69. package/dist/endpoints/delete/secret.js +0 -36
  70. package/dist/endpoints/delete/secretLink.d.ts +0 -21
  71. package/dist/endpoints/delete/secretLink.js +0 -36
  72. package/dist/endpoints/delete/service.d.ts +0 -19
  73. package/dist/endpoints/delete/service.js +0 -36
  74. package/dist/endpoints/delete/subdomain.d.ts +0 -19
  75. package/dist/endpoints/delete/subdomain.js +0 -36
  76. package/dist/endpoints/get/addon/backup/download.d.ts +0 -24
  77. package/dist/endpoints/get/addon/backup/download.js +0 -36
  78. package/dist/endpoints/get/addon/backup.d.ts +0 -46
  79. package/dist/endpoints/get/addon/backup.js +0 -36
  80. package/dist/endpoints/get/addon/backups.d.ts +0 -54
  81. package/dist/endpoints/get/addon/backups.js +0 -40
  82. package/dist/endpoints/get/addon/containers.d.ts +0 -40
  83. package/dist/endpoints/get/addon/containers.js +0 -40
  84. package/dist/endpoints/get/addon/credentials.d.ts +0 -24
  85. package/dist/endpoints/get/addon/credentials.js +0 -36
  86. package/dist/endpoints/get/addon/types.d.ts +0 -48
  87. package/dist/endpoints/get/addon/types.js +0 -36
  88. package/dist/endpoints/get/addon/version.d.ts +0 -53
  89. package/dist/endpoints/get/addon/version.js +0 -36
  90. package/dist/endpoints/get/addon.d.ts +0 -69
  91. package/dist/endpoints/get/addon.js +0 -36
  92. package/dist/endpoints/get/dnsId.d.ts +0 -15
  93. package/dist/endpoints/get/dnsId.js +0 -36
  94. package/dist/endpoints/get/domain.d.ts +0 -33
  95. package/dist/endpoints/get/domain.js +0 -36
  96. package/dist/endpoints/get/job/buildArguments.d.ts +0 -19
  97. package/dist/endpoints/get/job/buildArguments.js +0 -36
  98. package/dist/endpoints/get/job/builds.d.ts +0 -50
  99. package/dist/endpoints/get/job/builds.js +0 -39
  100. package/dist/endpoints/get/job/containers.d.ts +0 -40
  101. package/dist/endpoints/get/job/containers.js +0 -40
  102. package/dist/endpoints/get/job/deployment.d.ts +0 -51
  103. package/dist/endpoints/get/job/deployment.js +0 -36
  104. package/dist/endpoints/get/job/environment.d.ts +0 -24
  105. package/dist/endpoints/get/job/environment.js +0 -40
  106. package/dist/endpoints/get/job/environmentDetails.d.ts +0 -42
  107. package/dist/endpoints/get/job/environmentDetails.js +0 -36
  108. package/dist/endpoints/get/job/healthChecks.d.ts +0 -44
  109. package/dist/endpoints/get/job/healthChecks.js +0 -36
  110. package/dist/endpoints/get/job/run.d.ts +0 -42
  111. package/dist/endpoints/get/job/run.js +0 -36
  112. package/dist/endpoints/get/job/runs.d.ts +0 -52
  113. package/dist/endpoints/get/job/runs.js +0 -39
  114. package/dist/endpoints/get/job.d.ts +0 -86
  115. package/dist/endpoints/get/job.js +0 -36
  116. package/dist/endpoints/get/project.d.ts +0 -72
  117. package/dist/endpoints/get/project.js +0 -36
  118. package/dist/endpoints/get/registryCredentials.d.ts +0 -34
  119. package/dist/endpoints/get/registryCredentials.js +0 -36
  120. package/dist/endpoints/get/secret.d.ts +0 -55
  121. package/dist/endpoints/get/secret.js +0 -39
  122. package/dist/endpoints/get/secretDetails.d.ts +0 -63
  123. package/dist/endpoints/get/secretDetails.js +0 -36
  124. package/dist/endpoints/get/secretLink.d.ts +0 -44
  125. package/dist/endpoints/get/secretLink.js +0 -36
  126. package/dist/endpoints/get/service/buildArguments.d.ts +0 -19
  127. package/dist/endpoints/get/service/buildArguments.js +0 -36
  128. package/dist/endpoints/get/service/builds.d.ts +0 -50
  129. package/dist/endpoints/get/service/builds.js +0 -40
  130. package/dist/endpoints/get/service/containers.d.ts +0 -40
  131. package/dist/endpoints/get/service/containers.js +0 -40
  132. package/dist/endpoints/get/service/deployment.d.ts +0 -51
  133. package/dist/endpoints/get/service/deployment.js +0 -36
  134. package/dist/endpoints/get/service/environmentVariableDetails.d.ts +0 -42
  135. package/dist/endpoints/get/service/environmentVariableDetails.js +0 -36
  136. package/dist/endpoints/get/service/environmentVariables.d.ts +0 -24
  137. package/dist/endpoints/get/service/environmentVariables.js +0 -40
  138. package/dist/endpoints/get/service/healthChecks.d.ts +0 -44
  139. package/dist/endpoints/get/service/healthChecks.js +0 -36
  140. package/dist/endpoints/get/service/ports.d.ts +0 -35
  141. package/dist/endpoints/get/service/ports.js +0 -36
  142. package/dist/endpoints/get/service.d.ts +0 -103
  143. package/dist/endpoints/get/service.js +0 -36
  144. package/dist/endpoints/get/subdomain.d.ts +0 -30
  145. package/dist/endpoints/get/subdomain.js +0 -36
  146. package/dist/endpoints/import/addon/backup.d.ts +0 -31
  147. package/dist/endpoints/import/addon/backup.js +0 -36
  148. package/dist/endpoints/list/addons.d.ts +0 -45
  149. package/dist/endpoints/list/addons.js +0 -39
  150. package/dist/endpoints/list/domains.d.ts +0 -34
  151. package/dist/endpoints/list/domains.js +0 -39
  152. package/dist/endpoints/list/jobs.d.ts +0 -44
  153. package/dist/endpoints/list/jobs.js +0 -39
  154. package/dist/endpoints/list/plans.d.ts +0 -30
  155. package/dist/endpoints/list/plans.js +0 -36
  156. package/dist/endpoints/list/projects.d.ts +0 -32
  157. package/dist/endpoints/list/projects.js +0 -39
  158. package/dist/endpoints/list/regions.d.ts +0 -18
  159. package/dist/endpoints/list/regions.js +0 -36
  160. package/dist/endpoints/list/registryCredentials.d.ts +0 -41
  161. package/dist/endpoints/list/registryCredentials.js +0 -39
  162. package/dist/endpoints/list/secrets.d.ts +0 -52
  163. package/dist/endpoints/list/secrets.js +0 -39
  164. package/dist/endpoints/list/services.d.ts +0 -44
  165. package/dist/endpoints/list/services.js +0 -39
  166. package/dist/endpoints/list/vcs.d.ts +0 -51
  167. package/dist/endpoints/list/vcs.js +0 -36
  168. package/dist/endpoints/pause/addon.d.ts +0 -19
  169. package/dist/endpoints/pause/addon.js +0 -36
  170. package/dist/endpoints/pause/service.d.ts +0 -19
  171. package/dist/endpoints/pause/service.js +0 -36
  172. package/dist/endpoints/restart/addon.d.ts +0 -19
  173. package/dist/endpoints/restart/addon.js +0 -36
  174. package/dist/endpoints/restart/service.d.ts +0 -19
  175. package/dist/endpoints/restart/service.js +0 -36
  176. package/dist/endpoints/restore/addon/backup.d.ts +0 -21
  177. package/dist/endpoints/restore/addon/backup.js +0 -36
  178. package/dist/endpoints/resume/addon.d.ts +0 -19
  179. package/dist/endpoints/resume/addon.js +0 -36
  180. package/dist/endpoints/resume/service.d.ts +0 -24
  181. package/dist/endpoints/resume/service.js +0 -36
  182. package/dist/endpoints/scale/addon.d.ts +0 -28
  183. package/dist/endpoints/scale/addon.js +0 -36
  184. package/dist/endpoints/scale/service.d.ts +0 -26
  185. package/dist/endpoints/scale/service.js +0 -36
  186. package/dist/endpoints/start/job/build.d.ts +0 -37
  187. package/dist/endpoints/start/job/build.js +0 -36
  188. package/dist/endpoints/start/job/run.d.ts +0 -37
  189. package/dist/endpoints/start/job/run.js +0 -36
  190. package/dist/endpoints/start/service/build.d.ts +0 -41
  191. package/dist/endpoints/start/service/build.js +0 -36
  192. package/dist/endpoints/unassign/subdomain.d.ts +0 -19
  193. package/dist/endpoints/unassign/subdomain.js +0 -36
  194. package/dist/endpoints/update/addon/networkSettings.d.ts +0 -26
  195. package/dist/endpoints/update/addon/networkSettings.js +0 -36
  196. package/dist/endpoints/update/addon/security.d.ts +0 -29
  197. package/dist/endpoints/update/addon/security.js +0 -36
  198. package/dist/endpoints/update/addon/version.d.ts +0 -24
  199. package/dist/endpoints/update/addon/version.js +0 -36
  200. package/dist/endpoints/update/job/buildArguments.d.ts +0 -24
  201. package/dist/endpoints/update/job/buildArguments.js +0 -36
  202. package/dist/endpoints/update/job/cmdOverride.d.ts +0 -24
  203. package/dist/endpoints/update/job/cmdOverride.js +0 -36
  204. package/dist/endpoints/update/job/deployment.d.ts +0 -37
  205. package/dist/endpoints/update/job/deployment.js +0 -36
  206. package/dist/endpoints/update/job/environment.d.ts +0 -24
  207. package/dist/endpoints/update/job/environment.js +0 -36
  208. package/dist/endpoints/update/job/healthChecks.d.ts +0 -45
  209. package/dist/endpoints/update/job/healthChecks.js +0 -36
  210. package/dist/endpoints/update/job/settings.d.ts +0 -30
  211. package/dist/endpoints/update/job/settings.js +0 -36
  212. package/dist/endpoints/update/registryCredentials.d.ts +0 -31
  213. package/dist/endpoints/update/registryCredentials.js +0 -36
  214. package/dist/endpoints/update/secret.d.ts +0 -54
  215. package/dist/endpoints/update/secret.js +0 -36
  216. package/dist/endpoints/update/secretLink.d.ts +0 -40
  217. package/dist/endpoints/update/secretLink.js +0 -36
  218. package/dist/endpoints/update/service/buildArguments.d.ts +0 -24
  219. package/dist/endpoints/update/service/buildArguments.js +0 -36
  220. package/dist/endpoints/update/service/buildOptions.d.ts +0 -52
  221. package/dist/endpoints/update/service/buildOptions.js +0 -36
  222. package/dist/endpoints/update/service/cmdOverride.d.ts +0 -24
  223. package/dist/endpoints/update/service/cmdOverride.js +0 -36
  224. package/dist/endpoints/update/service/deployment.d.ts +0 -37
  225. package/dist/endpoints/update/service/deployment.js +0 -36
  226. package/dist/endpoints/update/service/environmentVariables.d.ts +0 -29
  227. package/dist/endpoints/update/service/environmentVariables.js +0 -36
  228. package/dist/endpoints/update/service/healthChecks.d.ts +0 -45
  229. package/dist/endpoints/update/service/healthChecks.js +0 -36
  230. package/dist/endpoints/update/service/ports.d.ts +0 -55
  231. package/dist/endpoints/update/service/ports.js +0 -36
  232. package/dist/endpoints/verify/domain.d.ts +0 -17
  233. package/dist/endpoints/verify/domain.js +0 -36
  234. package/dist/endpoints/verify/subdomain.d.ts +0 -19
  235. package/dist/endpoints/verify/subdomain.js +0 -36
  236. package/dist/port-forward/client/api-helper.d.ts +0 -30
  237. package/dist/port-forward/client/api-helper.js +0 -102
  238. package/dist/port-forward/client/atomic-write.d.ts +0 -3
  239. package/dist/port-forward/client/atomic-write.js +0 -95
  240. package/dist/port-forward/client/host-file-ast.d.ts +0 -52
  241. package/dist/port-forward/client/host-file-ast.js +0 -279
  242. package/dist/port-forward/client/host-file.d.ts +0 -26
  243. package/dist/port-forward/client/host-file.js +0 -226
  244. package/dist/port-forward/client/loopback.d.ts +0 -4
  245. package/dist/port-forward/client/loopback.js +0 -219
  246. package/dist/port-forward/client/port-forwarder.d.ts +0 -86
  247. package/dist/port-forward/client/port-forwarder.js +0 -593
  248. package/dist/port-forward/client/port-tunnel-tcp.d.ts +0 -34
  249. package/dist/port-forward/client/port-tunnel-tcp.js +0 -209
  250. package/dist/port-forward/client/port-tunnel-udp.d.ts +0 -25
  251. package/dist/port-forward/client/port-tunnel-udp.js +0 -147
  252. package/dist/port-forward/client/port-tunnel.d.ts +0 -32
  253. package/dist/port-forward/client/port-tunnel.js +0 -2
  254. package/dist/port-forward/client/promise-mutex.d.ts +0 -4
  255. package/dist/port-forward/client/promise-mutex.js +0 -62
  256. package/dist/utils.d.ts +0 -8
  257. package/dist/utils.js +0 -97
@@ -1,55 +0,0 @@
1
- /** WARNING: Autogenerated Code - do not modify! */
2
- import { ApiCallResponse, PostApiEndpoint } from '../../../api-endpoint';
3
- export declare type UpdateServicePortsResult = any | any;
4
- export declare type UpdateServicePortsCall = (opts: UpdateServicePortsRequest) => Promise<ApiCallResponse<UpdateServicePortsResult>>;
5
- export declare type UpdateServicePortsRequest = {
6
- parameters: UpdateServicePortsParameters;
7
- data: UpdateServicePortsData;
8
- };
9
- export declare type UpdateServicePortsParameters = {
10
- /** ID of the project */ 'projectId': string;
11
- /** ID of the service */
12
- 'serviceId': string;
13
- };
14
- export declare type UpdateServicePortsData = {
15
- /** An array of ports to replace or update existing ports with. */
16
- 'ports': {
17
- /** The id of an existing port. Pass this when changing in order to keep security configurations. Example: "eonyui" */
18
- 'id'?: string;
19
- /** The name used to identify the port. Example: "port-1" */
20
- 'name': string;
21
- /** The port number. Example: 12345 */
22
- 'internalPort': number;
23
- /** If true, the port will be exposed publicly. Example: true */
24
- 'public'?: boolean;
25
- /** The protocol to use for the port. Public ports only support HTTP. Example: "HTTP" */
26
- 'protocol': 'HTTP' | 'TCP' | 'UDP';
27
- /** An array of domains to redirect to this port. Each domain must first be verified and registered to your account. */
28
- 'domains'?: string[];
29
- 'security'?: {
30
- /** An array of credentials to access the service. */
31
- 'credentials'?: {
32
- /** The username to access the service Example: "admin" */
33
- 'username': string;
34
- /** The password to access the service with this username. Example: "password123" */
35
- 'password': string;
36
- /** The type of authentication used Example: "basic-auth" */
37
- 'type': 'basic-auth';
38
- }[];
39
- /** An array of IP address policies. */
40
- 'policies'?: {
41
- /** An array of IP addresses used for this rule */
42
- 'addresses': string[];
43
- /** The action for this rule. Example: "DENY" */
44
- 'action': 'ALLOW' | 'DENY';
45
- }[];
46
- };
47
- }[];
48
- };
49
- /** Updates the list of ports for the given service. */
50
- export declare class UpdateServicePortsEndpoint extends PostApiEndpoint<UpdateServicePortsRequest, UpdateServicePortsResult> {
51
- description: string;
52
- withAuth: boolean;
53
- endpointUrl: (opts: UpdateServicePortsRequest) => string;
54
- body: (payload: UpdateServicePortsRequest) => string;
55
- }
@@ -1,36 +0,0 @@
1
- "use strict";
2
- /** WARNING: Autogenerated Code - do not modify! */
3
- var __extends = (this && this.__extends) || (function () {
4
- var extendStatics = function (d, b) {
5
- extendStatics = Object.setPrototypeOf ||
6
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
7
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
8
- return extendStatics(d, b);
9
- };
10
- return function (d, b) {
11
- if (typeof b !== "function" && b !== null)
12
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
13
- extendStatics(d, b);
14
- function __() { this.constructor = d; }
15
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
16
- };
17
- })();
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.UpdateServicePortsEndpoint = void 0;
20
- var api_endpoint_1 = require("../../../api-endpoint");
21
- /** Updates the list of ports for the given service. */
22
- var UpdateServicePortsEndpoint = /** @class */ (function (_super) {
23
- __extends(UpdateServicePortsEndpoint, _super);
24
- function UpdateServicePortsEndpoint() {
25
- var _this = _super !== null && _super.apply(this, arguments) || this;
26
- _this.description = 'Updates the list of ports for the given service.';
27
- _this.withAuth = true;
28
- _this.endpointUrl = function (opts) {
29
- return "/v1/projects/" + opts.parameters.projectId + "/services/" + opts.parameters.serviceId + "/ports";
30
- };
31
- _this.body = function (payload) { return JSON.stringify(payload.data); };
32
- return _this;
33
- }
34
- return UpdateServicePortsEndpoint;
35
- }(api_endpoint_1.PostApiEndpoint));
36
- exports.UpdateServicePortsEndpoint = UpdateServicePortsEndpoint;
@@ -1,17 +0,0 @@
1
- /** WARNING: Autogenerated Code - do not modify! */
2
- import { ApiCallResponse, PostApiEndpoint } from '../../api-endpoint';
3
- export declare type VerifyDomainResult = any | any;
4
- export declare type VerifyDomainCall = (opts: VerifyDomainRequest) => Promise<ApiCallResponse<VerifyDomainResult>>;
5
- export declare type VerifyDomainRequest = {
6
- parameters: VerifyDomainParameters;
7
- };
8
- export declare type VerifyDomainParameters = {
9
- /** Name of the domain */ 'domain': string;
10
- };
11
- /** Attempts to verify the domain */
12
- export declare class VerifyDomainEndpoint extends PostApiEndpoint<VerifyDomainRequest, VerifyDomainResult> {
13
- description: string;
14
- withAuth: boolean;
15
- endpointUrl: (opts: VerifyDomainRequest) => string;
16
- body: () => undefined;
17
- }
@@ -1,36 +0,0 @@
1
- "use strict";
2
- /** WARNING: Autogenerated Code - do not modify! */
3
- var __extends = (this && this.__extends) || (function () {
4
- var extendStatics = function (d, b) {
5
- extendStatics = Object.setPrototypeOf ||
6
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
7
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
8
- return extendStatics(d, b);
9
- };
10
- return function (d, b) {
11
- if (typeof b !== "function" && b !== null)
12
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
13
- extendStatics(d, b);
14
- function __() { this.constructor = d; }
15
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
16
- };
17
- })();
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.VerifyDomainEndpoint = void 0;
20
- var api_endpoint_1 = require("../../api-endpoint");
21
- /** Attempts to verify the domain */
22
- var VerifyDomainEndpoint = /** @class */ (function (_super) {
23
- __extends(VerifyDomainEndpoint, _super);
24
- function VerifyDomainEndpoint() {
25
- var _this = _super !== null && _super.apply(this, arguments) || this;
26
- _this.description = 'Attempts to verify the domain';
27
- _this.withAuth = true;
28
- _this.endpointUrl = function (opts) {
29
- return "/v1/domains/" + opts.parameters.domain + "/verify";
30
- };
31
- _this.body = function () { return undefined; };
32
- return _this;
33
- }
34
- return VerifyDomainEndpoint;
35
- }(api_endpoint_1.PostApiEndpoint));
36
- exports.VerifyDomainEndpoint = VerifyDomainEndpoint;
@@ -1,19 +0,0 @@
1
- /** WARNING: Autogenerated Code - do not modify! */
2
- import { ApiCallResponse, PostApiEndpoint } from '../../api-endpoint';
3
- export declare type VerifySubdomainResult = any | any;
4
- export declare type VerifySubdomainCall = (opts: VerifySubdomainRequest) => Promise<ApiCallResponse<VerifySubdomainResult>>;
5
- export declare type VerifySubdomainRequest = {
6
- parameters: VerifySubdomainParameters;
7
- };
8
- export declare type VerifySubdomainParameters = {
9
- /** Name of the domain */ 'domain': string;
10
- /** Name of the subdomain */
11
- 'subdomain': string;
12
- };
13
- /** Gets details about the given subdomain */
14
- export declare class VerifySubdomainEndpoint extends PostApiEndpoint<VerifySubdomainRequest, VerifySubdomainResult> {
15
- description: string;
16
- withAuth: boolean;
17
- endpointUrl: (opts: VerifySubdomainRequest) => string;
18
- body: () => undefined;
19
- }
@@ -1,36 +0,0 @@
1
- "use strict";
2
- /** WARNING: Autogenerated Code - do not modify! */
3
- var __extends = (this && this.__extends) || (function () {
4
- var extendStatics = function (d, b) {
5
- extendStatics = Object.setPrototypeOf ||
6
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
7
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
8
- return extendStatics(d, b);
9
- };
10
- return function (d, b) {
11
- if (typeof b !== "function" && b !== null)
12
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
13
- extendStatics(d, b);
14
- function __() { this.constructor = d; }
15
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
16
- };
17
- })();
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.VerifySubdomainEndpoint = void 0;
20
- var api_endpoint_1 = require("../../api-endpoint");
21
- /** Gets details about the given subdomain */
22
- var VerifySubdomainEndpoint = /** @class */ (function (_super) {
23
- __extends(VerifySubdomainEndpoint, _super);
24
- function VerifySubdomainEndpoint() {
25
- var _this = _super !== null && _super.apply(this, arguments) || this;
26
- _this.description = 'Gets details about the given subdomain';
27
- _this.withAuth = true;
28
- _this.endpointUrl = function (opts) {
29
- return "/v1/domains/" + opts.parameters.domain + "/subdomains/" + opts.parameters.subdomain + "/verify";
30
- };
31
- _this.body = function () { return undefined; };
32
- return _this;
33
- }
34
- return VerifySubdomainEndpoint;
35
- }(api_endpoint_1.PostApiEndpoint));
36
- exports.VerifySubdomainEndpoint = VerifySubdomainEndpoint;
@@ -1,30 +0,0 @@
1
- import { ApiClientContextProvider } from '../../context';
2
- interface ServiceInfo {
3
- targetDomain: string;
4
- namespace: string;
5
- instances: {
6
- podName: string;
7
- }[];
8
- ports: PortInfo[];
9
- }
10
- interface AddonInfo {
11
- targetDomain: string;
12
- instances: {
13
- podName: string;
14
- internalHostname: string;
15
- ports: PortInfo[];
16
- }[];
17
- }
18
- export interface PortInfo {
19
- name?: string;
20
- internalPort: number;
21
- protocol?: 'HTTP' | 'TCP' | 'UDP';
22
- }
23
- export declare class PortProxyApiClient {
24
- private readonly contextProvider;
25
- constructor(contextProvider: ApiClientContextProvider);
26
- getServiceDetails(project: string, service: string): Promise<ServiceInfo>;
27
- getAddonDetails(project: string, addon: string): Promise<AddonInfo>;
28
- private fetch;
29
- }
30
- export {};
@@ -1,102 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __importDefault = (this && this.__importDefault) || function (mod) {
50
- return (mod && mod.__esModule) ? mod : { "default": mod };
51
- };
52
- Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.PortProxyApiClient = void 0;
54
- var lodash_1 = __importDefault(require("lodash"));
55
- var node_fetch_1 = __importDefault(require("node-fetch"));
56
- var PortProxyApiClient = /** @class */ (function () {
57
- function PortProxyApiClient(contextProvider) {
58
- this.contextProvider = contextProvider;
59
- }
60
- PortProxyApiClient.prototype.getServiceDetails = function (project, service) {
61
- return __awaiter(this, void 0, void 0, function () {
62
- return __generator(this, function (_a) {
63
- return [2 /*return*/, this.fetch(this.contextProvider.getCurrentBaseUrl() + "/v1/port-forwarding/info/projects/" + project + "/services/" + service)];
64
- });
65
- });
66
- };
67
- PortProxyApiClient.prototype.getAddonDetails = function (project, addon) {
68
- return __awaiter(this, void 0, void 0, function () {
69
- return __generator(this, function (_a) {
70
- return [2 /*return*/, this.fetch(this.contextProvider.getCurrentBaseUrl() + "/v1/port-forwarding/info/projects/" + project + "/addons/" + addon)];
71
- });
72
- });
73
- };
74
- PortProxyApiClient.prototype.fetch = function (endpoint, options) {
75
- return __awaiter(this, void 0, void 0, function () {
76
- var mergedOptions, response, _a, _b, _c;
77
- return __generator(this, function (_d) {
78
- switch (_d.label) {
79
- case 0:
80
- mergedOptions = lodash_1.default.merge({}, {
81
- headers: {
82
- 'Authorization': "Bearer " + this.contextProvider.getCurrentToken(),
83
- 'Content-Type': 'application/json',
84
- },
85
- }, __assign({}, options));
86
- return [4 /*yield*/, node_fetch_1.default(endpoint, mergedOptions)];
87
- case 1:
88
- response = _d.sent();
89
- if (!!response.ok) return [3 /*break*/, 3];
90
- _a = Error.bind;
91
- _c = (_b = JSON).stringify;
92
- return [4 /*yield*/, response.json()];
93
- case 2: throw new (_a.apply(Error, [void 0, _c.apply(_b, [_d.sent()])]))();
94
- case 3: return [4 /*yield*/, response.json()];
95
- case 4: return [2 /*return*/, _d.sent()];
96
- }
97
- });
98
- });
99
- };
100
- return PortProxyApiClient;
101
- }());
102
- exports.PortProxyApiClient = PortProxyApiClient;
@@ -1,3 +0,0 @@
1
- /// <reference types="node" />
2
- import fs from 'fs';
3
- export declare const writeFile: (filePath: string, data: any, options?: fs.WriteFileOptions | undefined) => Promise<void>;
@@ -1,95 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
39
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
40
- to[j] = from[i];
41
- return to;
42
- };
43
- var __importDefault = (this && this.__importDefault) || function (mod) {
44
- return (mod && mod.__esModule) ? mod : { "default": mod };
45
- };
46
- Object.defineProperty(exports, "__esModule", { value: true });
47
- exports.writeFile = void 0;
48
- var fs_1 = __importDefault(require("fs"));
49
- var path_1 = __importDefault(require("path"));
50
- var writeFile = function (filePath, data, options) { return __awaiter(void 0, void 0, void 0, function () {
51
- var tempFilePath, e_1;
52
- return __generator(this, function (_a) {
53
- switch (_a.label) {
54
- case 0:
55
- tempFilePath = getTempFilePath(filePath, 10);
56
- return [4 /*yield*/, fs_1.default.promises.writeFile(tempFilePath, data, options)];
57
- case 1:
58
- _a.sent();
59
- _a.label = 2;
60
- case 2:
61
- _a.trys.push([2, 4, , 6]);
62
- return [4 /*yield*/, fs_1.default.promises.rename(tempFilePath, filePath)];
63
- case 3:
64
- _a.sent();
65
- return [3 /*break*/, 6];
66
- case 4:
67
- e_1 = _a.sent();
68
- return [4 /*yield*/, fs_1.default.promises.unlink(tempFilePath).catch(function () {
69
- // deliberately ignore this exception
70
- })];
71
- case 5:
72
- _a.sent();
73
- throw e_1;
74
- case 6: return [2 /*return*/];
75
- }
76
- });
77
- }); };
78
- exports.writeFile = writeFile;
79
- var getTempFilePath = function (filePath, maxRetries) {
80
- var _a;
81
- var getRandomPrefix = function (size) {
82
- return __spreadArray([], Array(size)).map(function () { return Math.floor(Math.random() * 16).toString(16); }).join('');
83
- };
84
- var tempFileDir = path_1.default.dirname(filePath);
85
- var tempFileName = path_1.default.basename(filePath);
86
- for (var i = 0; (_a = i < maxRetries) !== null && _a !== void 0 ? _a : 10; i += 1) {
87
- var randomPrefix = getRandomPrefix(16);
88
- var filename = "." + randomPrefix + "." + tempFileName;
89
- var tempFilePath = path_1.default.join(tempFileDir, filename);
90
- if (!fs_1.default.existsSync(tempFilePath)) {
91
- return tempFilePath;
92
- }
93
- }
94
- throw new Error("Could not write file to file '" + filePath + "'.");
95
- };
@@ -1,52 +0,0 @@
1
- export interface InvalidNode {
2
- type: 'invalid';
3
- line: string;
4
- }
5
- export interface EolNode {
6
- type: 'eol';
7
- line: string;
8
- }
9
- export interface BlankNode {
10
- type: 'blank';
11
- line: string;
12
- }
13
- export interface CommentNode {
14
- type: 'comment';
15
- line: string;
16
- }
17
- export interface EntryNode {
18
- type: 'entry';
19
- ipPrefixWhitespace: string;
20
- ip: string;
21
- hosts: {
22
- whitespace: string;
23
- host: string;
24
- }[];
25
- }
26
- export declare type HostsFileNode = InvalidNode | EolNode | BlankNode | CommentNode | EntryNode;
27
- export interface HostsFileAstOptions {
28
- eol: string;
29
- indent: number;
30
- ipPrefixWhitespace: string;
31
- }
32
- export declare class HostsFileAst {
33
- private nodes;
34
- private readonly config;
35
- constructor(nodes: HostsFileNode[], config: HostsFileAstOptions);
36
- add(ip: string, hosts: string[], header?: string): this;
37
- remove(ip: string, hosts: string[]): this;
38
- removeHosts(hosts: string[]): void;
39
- removeIps(ips: string[]): this;
40
- resolveHosts(ip: string): string[];
41
- resolveIps(host: string): string[];
42
- toString(): string;
43
- private removeEntry;
44
- private findEntries;
45
- private findOrCreateEntry;
46
- private insertAt;
47
- private makeEntry;
48
- static fromNodes(nodes: HostsFileNode[], options?: Partial<HostsFileAstOptions>): HostsFileAst;
49
- static parse(data: string, options?: Partial<HostsFileAstOptions>): HostsFileAst;
50
- }
51
- export declare const generateHostsFile: (nodes: HostsFileNode[], eol?: string | undefined) => string;
52
- export declare const parseHostsFile: (data: string) => HostsFileNode[];