@northflank/js-client 0.4.1 → 0.5.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 (258) hide show
  1. package/README.md +4 -4
  2. package/dist/cjs/api-client.d.ts +5819 -0
  3. package/dist/cjs/api-client.js +1 -0
  4. package/dist/cjs/package.json +3 -0
  5. package/dist/esm/api-client.d.ts +5819 -0
  6. package/dist/esm/api-client.js +15 -0
  7. package/dist/esm/package.json +3 -0
  8. package/package.json +13 -20
  9. package/dist/api-client.d.ts +0 -481
  10. package/dist/api-client.js +0 -748
  11. package/dist/api-endpoint.d.ts +0 -63
  12. package/dist/api-endpoint.js +0 -216
  13. package/dist/context/api-client-context-provider.d.ts +0 -47
  14. package/dist/context/api-client-context-provider.js +0 -332
  15. package/dist/context/api-client-file-context-provider.d.ts +0 -11
  16. package/dist/context/api-client-file-context-provider.js +0 -138
  17. package/dist/context/api-client-in-memory-context-provider.d.ts +0 -6
  18. package/dist/context/api-client-in-memory-context-provider.js +0 -82
  19. package/dist/context/index.d.ts +0 -3
  20. package/dist/context/index.js +0 -15
  21. package/dist/endpoints/abort/addon/backup.d.ts +0 -21
  22. package/dist/endpoints/abort/addon/backup.js +0 -36
  23. package/dist/endpoints/abort/addon/restore.d.ts +0 -26
  24. package/dist/endpoints/abort/addon/restore.js +0 -36
  25. package/dist/endpoints/abort/job/build.d.ts +0 -21
  26. package/dist/endpoints/abort/job/build.js +0 -36
  27. package/dist/endpoints/abort/job/run.d.ts +0 -21
  28. package/dist/endpoints/abort/job/run.js +0 -36
  29. package/dist/endpoints/abort/service/build.d.ts +0 -21
  30. package/dist/endpoints/abort/service/build.js +0 -36
  31. package/dist/endpoints/add/domain/subdomain.d.ts +0 -33
  32. package/dist/endpoints/add/domain/subdomain.js +0 -36
  33. package/dist/endpoints/add/registryCredentials.d.ts +0 -47
  34. package/dist/endpoints/add/registryCredentials.js +0 -36
  35. package/dist/endpoints/assign/subdomain/service.d.ts +0 -28
  36. package/dist/endpoints/assign/subdomain/service.js +0 -36
  37. package/dist/endpoints/backup/addon.d.ts +0 -51
  38. package/dist/endpoints/backup/addon.js +0 -36
  39. package/dist/endpoints/create/addon.d.ts +0 -90
  40. package/dist/endpoints/create/addon.js +0 -36
  41. package/dist/endpoints/create/domain.d.ts +0 -27
  42. package/dist/endpoints/create/domain.js +0 -36
  43. package/dist/endpoints/create/job/cron.d.ts +0 -157
  44. package/dist/endpoints/create/job/cron.js +0 -36
  45. package/dist/endpoints/create/job/manual.d.ts +0 -147
  46. package/dist/endpoints/create/job/manual.js +0 -36
  47. package/dist/endpoints/create/project.d.ts +0 -29
  48. package/dist/endpoints/create/project.js +0 -36
  49. package/dist/endpoints/create/secret.d.ts +0 -79
  50. package/dist/endpoints/create/secret.js +0 -36
  51. package/dist/endpoints/create/service/build.d.ts +0 -116
  52. package/dist/endpoints/create/service/build.js +0 -36
  53. package/dist/endpoints/create/service/combined.d.ts +0 -166
  54. package/dist/endpoints/create/service/combined.js +0 -36
  55. package/dist/endpoints/create/service/deployment.d.ts +0 -137
  56. package/dist/endpoints/create/service/deployment.js +0 -36
  57. package/dist/endpoints/delete/addon.d.ts +0 -19
  58. package/dist/endpoints/delete/addon.js +0 -36
  59. package/dist/endpoints/delete/backup.d.ts +0 -21
  60. package/dist/endpoints/delete/backup.js +0 -36
  61. package/dist/endpoints/delete/domain.d.ts +0 -17
  62. package/dist/endpoints/delete/domain.js +0 -36
  63. package/dist/endpoints/delete/job.d.ts +0 -19
  64. package/dist/endpoints/delete/job.js +0 -36
  65. package/dist/endpoints/delete/project.d.ts +0 -17
  66. package/dist/endpoints/delete/project.js +0 -36
  67. package/dist/endpoints/delete/registryCredentials.d.ts +0 -17
  68. package/dist/endpoints/delete/registryCredentials.js +0 -36
  69. package/dist/endpoints/delete/secret.d.ts +0 -19
  70. package/dist/endpoints/delete/secret.js +0 -36
  71. package/dist/endpoints/delete/secretLink.d.ts +0 -21
  72. package/dist/endpoints/delete/secretLink.js +0 -36
  73. package/dist/endpoints/delete/service.d.ts +0 -19
  74. package/dist/endpoints/delete/service.js +0 -36
  75. package/dist/endpoints/delete/subdomain.d.ts +0 -19
  76. package/dist/endpoints/delete/subdomain.js +0 -36
  77. package/dist/endpoints/get/addon/backup/download.d.ts +0 -24
  78. package/dist/endpoints/get/addon/backup/download.js +0 -36
  79. package/dist/endpoints/get/addon/backup.d.ts +0 -46
  80. package/dist/endpoints/get/addon/backup.js +0 -36
  81. package/dist/endpoints/get/addon/backups.d.ts +0 -54
  82. package/dist/endpoints/get/addon/backups.js +0 -40
  83. package/dist/endpoints/get/addon/containers.d.ts +0 -40
  84. package/dist/endpoints/get/addon/containers.js +0 -40
  85. package/dist/endpoints/get/addon/credentials.d.ts +0 -24
  86. package/dist/endpoints/get/addon/credentials.js +0 -36
  87. package/dist/endpoints/get/addon/types.d.ts +0 -48
  88. package/dist/endpoints/get/addon/types.js +0 -36
  89. package/dist/endpoints/get/addon/version.d.ts +0 -53
  90. package/dist/endpoints/get/addon/version.js +0 -36
  91. package/dist/endpoints/get/addon.d.ts +0 -69
  92. package/dist/endpoints/get/addon.js +0 -36
  93. package/dist/endpoints/get/dnsId.d.ts +0 -15
  94. package/dist/endpoints/get/dnsId.js +0 -36
  95. package/dist/endpoints/get/domain.d.ts +0 -33
  96. package/dist/endpoints/get/domain.js +0 -36
  97. package/dist/endpoints/get/job/buildArguments.d.ts +0 -19
  98. package/dist/endpoints/get/job/buildArguments.js +0 -36
  99. package/dist/endpoints/get/job/builds.d.ts +0 -50
  100. package/dist/endpoints/get/job/builds.js +0 -39
  101. package/dist/endpoints/get/job/containers.d.ts +0 -40
  102. package/dist/endpoints/get/job/containers.js +0 -40
  103. package/dist/endpoints/get/job/deployment.d.ts +0 -51
  104. package/dist/endpoints/get/job/deployment.js +0 -36
  105. package/dist/endpoints/get/job/environment.d.ts +0 -24
  106. package/dist/endpoints/get/job/environment.js +0 -40
  107. package/dist/endpoints/get/job/environmentDetails.d.ts +0 -42
  108. package/dist/endpoints/get/job/environmentDetails.js +0 -36
  109. package/dist/endpoints/get/job/healthChecks.d.ts +0 -44
  110. package/dist/endpoints/get/job/healthChecks.js +0 -36
  111. package/dist/endpoints/get/job/run.d.ts +0 -42
  112. package/dist/endpoints/get/job/run.js +0 -36
  113. package/dist/endpoints/get/job/runs.d.ts +0 -52
  114. package/dist/endpoints/get/job/runs.js +0 -39
  115. package/dist/endpoints/get/job.d.ts +0 -86
  116. package/dist/endpoints/get/job.js +0 -36
  117. package/dist/endpoints/get/project.d.ts +0 -72
  118. package/dist/endpoints/get/project.js +0 -36
  119. package/dist/endpoints/get/registryCredentials.d.ts +0 -34
  120. package/dist/endpoints/get/registryCredentials.js +0 -36
  121. package/dist/endpoints/get/secret.d.ts +0 -55
  122. package/dist/endpoints/get/secret.js +0 -39
  123. package/dist/endpoints/get/secretDetails.d.ts +0 -63
  124. package/dist/endpoints/get/secretDetails.js +0 -36
  125. package/dist/endpoints/get/secretLink.d.ts +0 -44
  126. package/dist/endpoints/get/secretLink.js +0 -36
  127. package/dist/endpoints/get/service/buildArguments.d.ts +0 -19
  128. package/dist/endpoints/get/service/buildArguments.js +0 -36
  129. package/dist/endpoints/get/service/builds.d.ts +0 -50
  130. package/dist/endpoints/get/service/builds.js +0 -40
  131. package/dist/endpoints/get/service/containers.d.ts +0 -40
  132. package/dist/endpoints/get/service/containers.js +0 -40
  133. package/dist/endpoints/get/service/deployment.d.ts +0 -51
  134. package/dist/endpoints/get/service/deployment.js +0 -36
  135. package/dist/endpoints/get/service/environmentVariableDetails.d.ts +0 -42
  136. package/dist/endpoints/get/service/environmentVariableDetails.js +0 -36
  137. package/dist/endpoints/get/service/environmentVariables.d.ts +0 -24
  138. package/dist/endpoints/get/service/environmentVariables.js +0 -40
  139. package/dist/endpoints/get/service/healthChecks.d.ts +0 -44
  140. package/dist/endpoints/get/service/healthChecks.js +0 -36
  141. package/dist/endpoints/get/service/ports.d.ts +0 -35
  142. package/dist/endpoints/get/service/ports.js +0 -36
  143. package/dist/endpoints/get/service.d.ts +0 -103
  144. package/dist/endpoints/get/service.js +0 -36
  145. package/dist/endpoints/get/subdomain.d.ts +0 -30
  146. package/dist/endpoints/get/subdomain.js +0 -36
  147. package/dist/endpoints/import/addon/backup.d.ts +0 -31
  148. package/dist/endpoints/import/addon/backup.js +0 -36
  149. package/dist/endpoints/list/addons.d.ts +0 -45
  150. package/dist/endpoints/list/addons.js +0 -39
  151. package/dist/endpoints/list/domains.d.ts +0 -34
  152. package/dist/endpoints/list/domains.js +0 -39
  153. package/dist/endpoints/list/jobs.d.ts +0 -44
  154. package/dist/endpoints/list/jobs.js +0 -39
  155. package/dist/endpoints/list/plans.d.ts +0 -30
  156. package/dist/endpoints/list/plans.js +0 -36
  157. package/dist/endpoints/list/projects.d.ts +0 -32
  158. package/dist/endpoints/list/projects.js +0 -39
  159. package/dist/endpoints/list/regions.d.ts +0 -18
  160. package/dist/endpoints/list/regions.js +0 -36
  161. package/dist/endpoints/list/registryCredentials.d.ts +0 -41
  162. package/dist/endpoints/list/registryCredentials.js +0 -39
  163. package/dist/endpoints/list/secrets.d.ts +0 -52
  164. package/dist/endpoints/list/secrets.js +0 -39
  165. package/dist/endpoints/list/services.d.ts +0 -44
  166. package/dist/endpoints/list/services.js +0 -39
  167. package/dist/endpoints/list/vcs.d.ts +0 -51
  168. package/dist/endpoints/list/vcs.js +0 -36
  169. package/dist/endpoints/pause/addon.d.ts +0 -19
  170. package/dist/endpoints/pause/addon.js +0 -36
  171. package/dist/endpoints/pause/service.d.ts +0 -19
  172. package/dist/endpoints/pause/service.js +0 -36
  173. package/dist/endpoints/restart/addon.d.ts +0 -19
  174. package/dist/endpoints/restart/addon.js +0 -36
  175. package/dist/endpoints/restart/service.d.ts +0 -19
  176. package/dist/endpoints/restart/service.js +0 -36
  177. package/dist/endpoints/restore/addon/backup.d.ts +0 -21
  178. package/dist/endpoints/restore/addon/backup.js +0 -36
  179. package/dist/endpoints/resume/addon.d.ts +0 -19
  180. package/dist/endpoints/resume/addon.js +0 -36
  181. package/dist/endpoints/resume/service.d.ts +0 -24
  182. package/dist/endpoints/resume/service.js +0 -36
  183. package/dist/endpoints/scale/addon.d.ts +0 -28
  184. package/dist/endpoints/scale/addon.js +0 -36
  185. package/dist/endpoints/scale/service.d.ts +0 -26
  186. package/dist/endpoints/scale/service.js +0 -36
  187. package/dist/endpoints/start/job/build.d.ts +0 -37
  188. package/dist/endpoints/start/job/build.js +0 -36
  189. package/dist/endpoints/start/job/run.d.ts +0 -37
  190. package/dist/endpoints/start/job/run.js +0 -36
  191. package/dist/endpoints/start/service/build.d.ts +0 -41
  192. package/dist/endpoints/start/service/build.js +0 -36
  193. package/dist/endpoints/unassign/subdomain.d.ts +0 -19
  194. package/dist/endpoints/unassign/subdomain.js +0 -36
  195. package/dist/endpoints/update/addon/networkSettings.d.ts +0 -26
  196. package/dist/endpoints/update/addon/networkSettings.js +0 -36
  197. package/dist/endpoints/update/addon/security.d.ts +0 -29
  198. package/dist/endpoints/update/addon/security.js +0 -36
  199. package/dist/endpoints/update/addon/version.d.ts +0 -24
  200. package/dist/endpoints/update/addon/version.js +0 -36
  201. package/dist/endpoints/update/job/buildArguments.d.ts +0 -24
  202. package/dist/endpoints/update/job/buildArguments.js +0 -36
  203. package/dist/endpoints/update/job/cmdOverride.d.ts +0 -24
  204. package/dist/endpoints/update/job/cmdOverride.js +0 -36
  205. package/dist/endpoints/update/job/deployment.d.ts +0 -37
  206. package/dist/endpoints/update/job/deployment.js +0 -36
  207. package/dist/endpoints/update/job/environment.d.ts +0 -24
  208. package/dist/endpoints/update/job/environment.js +0 -36
  209. package/dist/endpoints/update/job/healthChecks.d.ts +0 -45
  210. package/dist/endpoints/update/job/healthChecks.js +0 -36
  211. package/dist/endpoints/update/job/settings.d.ts +0 -30
  212. package/dist/endpoints/update/job/settings.js +0 -36
  213. package/dist/endpoints/update/registryCredentials.d.ts +0 -31
  214. package/dist/endpoints/update/registryCredentials.js +0 -36
  215. package/dist/endpoints/update/secret.d.ts +0 -54
  216. package/dist/endpoints/update/secret.js +0 -36
  217. package/dist/endpoints/update/secretLink.d.ts +0 -40
  218. package/dist/endpoints/update/secretLink.js +0 -36
  219. package/dist/endpoints/update/service/buildArguments.d.ts +0 -24
  220. package/dist/endpoints/update/service/buildArguments.js +0 -36
  221. package/dist/endpoints/update/service/buildOptions.d.ts +0 -52
  222. package/dist/endpoints/update/service/buildOptions.js +0 -36
  223. package/dist/endpoints/update/service/cmdOverride.d.ts +0 -24
  224. package/dist/endpoints/update/service/cmdOverride.js +0 -36
  225. package/dist/endpoints/update/service/deployment.d.ts +0 -37
  226. package/dist/endpoints/update/service/deployment.js +0 -36
  227. package/dist/endpoints/update/service/environmentVariables.d.ts +0 -29
  228. package/dist/endpoints/update/service/environmentVariables.js +0 -36
  229. package/dist/endpoints/update/service/healthChecks.d.ts +0 -45
  230. package/dist/endpoints/update/service/healthChecks.js +0 -36
  231. package/dist/endpoints/update/service/ports.d.ts +0 -55
  232. package/dist/endpoints/update/service/ports.js +0 -36
  233. package/dist/endpoints/verify/domain.d.ts +0 -17
  234. package/dist/endpoints/verify/domain.js +0 -36
  235. package/dist/endpoints/verify/subdomain.d.ts +0 -19
  236. package/dist/endpoints/verify/subdomain.js +0 -36
  237. package/dist/port-forward/client/api-helper.d.ts +0 -30
  238. package/dist/port-forward/client/api-helper.js +0 -102
  239. package/dist/port-forward/client/atomic-write.d.ts +0 -3
  240. package/dist/port-forward/client/atomic-write.js +0 -95
  241. package/dist/port-forward/client/host-file-ast.d.ts +0 -52
  242. package/dist/port-forward/client/host-file-ast.js +0 -279
  243. package/dist/port-forward/client/host-file.d.ts +0 -26
  244. package/dist/port-forward/client/host-file.js +0 -226
  245. package/dist/port-forward/client/loopback.d.ts +0 -4
  246. package/dist/port-forward/client/loopback.js +0 -219
  247. package/dist/port-forward/client/port-forwarder.d.ts +0 -86
  248. package/dist/port-forward/client/port-forwarder.js +0 -593
  249. package/dist/port-forward/client/port-tunnel-tcp.d.ts +0 -34
  250. package/dist/port-forward/client/port-tunnel-tcp.js +0 -209
  251. package/dist/port-forward/client/port-tunnel-udp.d.ts +0 -25
  252. package/dist/port-forward/client/port-tunnel-udp.js +0 -147
  253. package/dist/port-forward/client/port-tunnel.d.ts +0 -32
  254. package/dist/port-forward/client/port-tunnel.js +0 -2
  255. package/dist/port-forward/client/promise-mutex.d.ts +0 -4
  256. package/dist/port-forward/client/promise-mutex.js +0 -62
  257. package/dist/utils.d.ts +0 -8
  258. 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[];