@studiometa/forge-core 0.4.6 → 0.4.7

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.
package/README.md CHANGED
@@ -32,7 +32,7 @@ import { RESOURCES, ACTIONS } from "@studiometa/forge-core";
32
32
  // RESOURCES: ['servers', 'sites', 'deployments', 'certificates', 'databases',
33
33
  // 'database-users', 'daemons', 'env', 'nginx', 'firewall-rules', 'ssh-keys',
34
34
  // 'security-rules', 'redirect-rules', 'nginx-templates', 'monitors', 'recipes',
35
- // 'backups', 'commands', 'scheduled-jobs', 'user', 'batch']
35
+ // 'backups', 'commands', 'scheduled-jobs', 'services', 'php', 'user', 'batch']
36
36
  // ACTIONS: ['list', 'get', 'create', 'update', 'delete', 'deploy', 'reboot', 'restart',
37
37
  // 'activate', 'run', 'resolve', 'help', 'schema', 'context']
38
38
  ```
@@ -122,6 +122,13 @@ import { RESOURCES, ACTIONS } from "@studiometa/forge-core";
122
122
 
123
123
  - `listScheduledJobs`, `getScheduledJob`, `createScheduledJob`, `deleteScheduledJob`
124
124
 
125
+ ### PHP
126
+
127
+ - `listPhpVersions`, `getPhpVersion`, `resolvePhpVersionId`
128
+ - `getPhpConfig`, `updatePhpConfig` — cli, fpm or pool file; `version` is an ID or a version such as `8.3`, `php83`
129
+ - `getPhpMaxUploadSize`, `updatePhpMaxUploadSize`, `getPhpMaxExecutionTime`, `updatePhpMaxExecutionTime`
130
+ - `getPhpOpcache`, `enablePhpOpcache`, `disablePhpOpcache`
131
+
125
132
  ### User
126
133
 
127
134
  - `getUser(options, ctx)` — Get the authenticated user's profile
@@ -2,7 +2,7 @@
2
2
  * All supported resources.
3
3
  * Single source of truth — MCP schema and handlers derive from this.
4
4
  */
5
- export declare const RESOURCES: readonly ["servers", "sites", "deployments", "certificates", "databases", "database-users", "daemons", "env", "nginx", "firewall-rules", "ssh-keys", "security-rules", "redirect-rules", "nginx-templates", "monitors", "recipes", "backups", "commands", "scheduled-jobs", "services", "user", "batch"];
5
+ export declare const RESOURCES: readonly ["servers", "sites", "deployments", "certificates", "databases", "database-users", "daemons", "env", "nginx", "firewall-rules", "ssh-keys", "security-rules", "redirect-rules", "nginx-templates", "monitors", "recipes", "backups", "commands", "scheduled-jobs", "services", "php", "user", "batch"];
6
6
  export type Resource = (typeof RESOURCES)[number];
7
7
  /**
8
8
  * All supported actions.
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,SAAS,YACpB,SAAS,EACT,OAAO,EACP,aAAa,EACb,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,MAAM,EACN,OAAO,CACC,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,OAAO,YAClB,MAAM,EACN,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,UAAU,EACV,KAAK,EACL,SAAS,EACT,MAAM,EACN,QAAQ,EACR,SAAS,CACD,CAAC;AAEX,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,SAAS,YACpB,SAAS,EACT,OAAO,EACP,aAAa,EACb,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,KAAK,EACL,MAAM,EACN,OAAO,CACC,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,OAAO,YAClB,MAAM,EACN,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,UAAU,EACV,KAAK,EACL,SAAS,EACT,MAAM,EACN,QAAQ,EACR,SAAS,CACD,CAAC;AAEX,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { ExecutorContext, ExecutorResult } from "../../context.ts";
2
+ import type { GetPhpConfigOptions, UpdatePhpConfigOptions } from "./types.ts";
3
+ /**
4
+ * Get a PHP configuration file (cli, fpm or pool) for an installed version.
5
+ */
6
+ export declare function getPhpConfig(options: GetPhpConfigOptions, ctx: ExecutorContext): Promise<ExecutorResult<string>>;
7
+ /**
8
+ * Replace a PHP configuration file (cli, fpm or pool) for an installed version.
9
+ */
10
+ export declare function updatePhpConfig(options: UpdatePhpConfigOptions, ctx: ExecutorContext): Promise<ExecutorResult<void>>;
11
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/executors/php/config.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAmB9E;;GAEG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,mBAAmB,EAC5B,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAgBjC;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,EAC/B,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAkB/B"}
@@ -0,0 +1,7 @@
1
+ export { getPhpConfig, updatePhpConfig } from "./config.ts";
2
+ export { getPhpMaxExecutionTime, getPhpMaxUploadSize, updatePhpMaxExecutionTime, updatePhpMaxUploadSize, } from "./limits.ts";
3
+ export { disablePhpOpcache, enablePhpOpcache, getPhpOpcache } from "./opcache.ts";
4
+ export { getPhpVersion, listPhpVersions, resolvePhpVersionId } from "./versions.ts";
5
+ export { PHP_CONFIG_TYPES } from "./types.ts";
6
+ export type { GetPhpConfigOptions, GetPhpVersionOptions, PhpConfigType, PhpServerOptions, UpdatePhpConfigOptions, UpdatePhpMaxExecutionTimeOptions, UpdatePhpMaxUploadSizeOptions, } from "./types.ts";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/executors/php/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,gCAAgC,EAChC,6BAA6B,GAC9B,MAAM,YAAY,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { ExecutorContext, ExecutorResult } from "../../context.ts";
2
+ import type { PhpServerOptions, UpdatePhpMaxExecutionTimeOptions, UpdatePhpMaxUploadSizeOptions } from "./types.ts";
3
+ /**
4
+ * Get the PHP max upload size of a server, in megabytes.
5
+ */
6
+ export declare function getPhpMaxUploadSize(options: PhpServerOptions, ctx: ExecutorContext): Promise<ExecutorResult<string>>;
7
+ /**
8
+ * Set the PHP max upload size of a server, in megabytes.
9
+ */
10
+ export declare function updatePhpMaxUploadSize(options: UpdatePhpMaxUploadSizeOptions, ctx: ExecutorContext): Promise<ExecutorResult<void>>;
11
+ /**
12
+ * Get the PHP max execution time of a server, in seconds.
13
+ */
14
+ export declare function getPhpMaxExecutionTime(options: PhpServerOptions, ctx: ExecutorContext): Promise<ExecutorResult<string>>;
15
+ /**
16
+ * Set the PHP max execution time of a server, in seconds.
17
+ */
18
+ export declare function updatePhpMaxExecutionTime(options: UpdatePhpMaxExecutionTimeOptions, ctx: ExecutorContext): Promise<ExecutorResult<void>>;
19
+ //# sourceMappingURL=limits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/executors/php/limits.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGxE,OAAO,KAAK,EACV,gBAAgB,EAChB,gCAAgC,EAChC,6BAA6B,EAC9B,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,gBAAgB,EACzB,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAWjC;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,6BAA6B,EACtC,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAW/B;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,gBAAgB,EACzB,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAWjC;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,gCAAgC,EACzC,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAW/B"}
@@ -0,0 +1,15 @@
1
+ import type { ExecutorContext, ExecutorResult } from "../../context.ts";
2
+ import type { PhpServerOptions } from "./types.ts";
3
+ /**
4
+ * Get whether PHP OPcache is enabled on a server.
5
+ */
6
+ export declare function getPhpOpcache(options: PhpServerOptions, ctx: ExecutorContext): Promise<ExecutorResult<boolean>>;
7
+ /**
8
+ * Enable PHP OPcache on a server.
9
+ */
10
+ export declare function enablePhpOpcache(options: PhpServerOptions, ctx: ExecutorContext): Promise<ExecutorResult<void>>;
11
+ /**
12
+ * Disable PHP OPcache on a server.
13
+ */
14
+ export declare function disablePhpOpcache(options: PhpServerOptions, ctx: ExecutorContext): Promise<ExecutorResult<void>>;
15
+ //# sourceMappingURL=opcache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opcache.d.ts","sourceRoot":"","sources":["../../../src/executors/php/opcache.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;GAEG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,gBAAgB,EACzB,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAWlC;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,gBAAgB,EACzB,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAM/B;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,gBAAgB,EACzB,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAM/B"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Option types for PHP executors.
3
+ */
4
+ /**
5
+ * The PHP configuration files that Forge can read and write.
6
+ */
7
+ export declare const PHP_CONFIG_TYPES: readonly ["cli", "fpm", "pool"];
8
+ export type PhpConfigType = (typeof PHP_CONFIG_TYPES)[number];
9
+ /**
10
+ * Options for server-level PHP executors (versions list, limits, OPcache).
11
+ */
12
+ export interface PhpServerOptions {
13
+ server_id: string;
14
+ }
15
+ /**
16
+ * Options for getting one installed PHP version.
17
+ */
18
+ export interface GetPhpVersionOptions {
19
+ server_id: string;
20
+ /** PHP version ID, or a version such as "8.3", "php83" or "php8.3". */
21
+ version: string;
22
+ }
23
+ /**
24
+ * Options for getting a PHP configuration file.
25
+ */
26
+ export interface GetPhpConfigOptions {
27
+ server_id: string;
28
+ /** PHP version ID, or a version such as "8.3", "php83" or "php8.3". */
29
+ version: string;
30
+ /** One of: cli, fpm, pool. */
31
+ type: string;
32
+ /** Unix user of the FPM pool (pool only). */
33
+ user?: string;
34
+ }
35
+ /**
36
+ * Options for updating a PHP configuration file.
37
+ */
38
+ export interface UpdatePhpConfigOptions extends GetPhpConfigOptions {
39
+ content: string;
40
+ }
41
+ /**
42
+ * Options for setting the PHP max upload size.
43
+ */
44
+ export interface UpdatePhpMaxUploadSizeOptions {
45
+ server_id: string;
46
+ /** Size in megabytes. */
47
+ size: number;
48
+ }
49
+ /**
50
+ * Options for setting the PHP max execution time.
51
+ */
52
+ export interface UpdatePhpMaxExecutionTimeOptions {
53
+ server_id: string;
54
+ /** Time in seconds. */
55
+ seconds: number;
56
+ }
57
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/executors/php/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB,YAAI,KAAK,EAAE,KAAK,EAAE,MAAM,CAAU,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,24 @@
1
+ import type { PhpVersionAttributes } from "@studiometa/forge-api";
2
+ import type { ExecutorContext, ExecutorResult } from "../../context.ts";
3
+ import type { GetPhpVersionOptions, PhpServerOptions } from "./types.ts";
4
+ /**
5
+ * List the PHP versions installed on a server.
6
+ */
7
+ export declare function listPhpVersions(options: PhpServerOptions, ctx: ExecutorContext): Promise<ExecutorResult<Array<PhpVersionAttributes & {
8
+ id: number;
9
+ }>>>;
10
+ /**
11
+ * Resolve a PHP version to its ID on a server.
12
+ *
13
+ * A numeric value is an ID and is returned as is, without an API call.
14
+ * Any other value is matched against the installed versions: "8.3",
15
+ * "php8.3" (binary name) and "php83" all match version 8.3.
16
+ */
17
+ export declare function resolvePhpVersionId(server_id: string, version: string, ctx: ExecutorContext): Promise<string>;
18
+ /**
19
+ * Get one installed PHP version.
20
+ */
21
+ export declare function getPhpVersion(options: GetPhpVersionOptions, ctx: ExecutorContext): Promise<ExecutorResult<PhpVersionAttributes & {
22
+ id: number;
23
+ }>>;
24
+ //# sourceMappingURL=versions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../src/executors/php/versions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AASlE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEzE;;GAEG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,gBAAgB,EACzB,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,oBAAoB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAAC,CAWvE;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,MAAM,CAAC,CAqBjB;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,EAC7B,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,CAAC,oBAAoB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAYhE"}
@@ -2,7 +2,7 @@ import type { ServerAttributes } from "@studiometa/forge-api";
2
2
  import type { ExecutorContext, ExecutorResult } from "../../context.ts";
3
3
  import type { ListServersOptions } from "./types.ts";
4
4
  /**
5
- * List all servers.
5
+ * List all servers, from every page.
6
6
  */
7
7
  export declare function listServers(_options: ListServersOptions, ctx: ExecutorContext): Promise<ExecutorResult<Array<ServerAttributes & {
8
8
  id: number;
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/executors/servers/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAM9D,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;GAEG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,kBAAkB,EAC5B,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,gBAAgB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAAC,CAWnE"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/executors/servers/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;GAEG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,kBAAkB,EAC5B,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,gBAAgB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAAC,CAInE"}
@@ -2,7 +2,7 @@ import type { SshKeyAttributes } from "@studiometa/forge-api";
2
2
  import type { ExecutorContext, ExecutorResult } from "../../context.ts";
3
3
  import type { ListSshKeysOptions } from "./types.ts";
4
4
  /**
5
- * List SSH keys on a server.
5
+ * List SSH keys on a server, from every page. Filter by server user with `user`.
6
6
  */
7
7
  export declare function listSshKeys(options: ListSshKeysOptions, ctx: ExecutorContext): Promise<ExecutorResult<Array<SshKeyAttributes & {
8
8
  id: number;
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/executors/ssh-keys/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAM9D,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;GAEG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,kBAAkB,EAC3B,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,gBAAgB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAAC,CAWnE"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/executors/ssh-keys/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;GAEG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,kBAAkB,EAC3B,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,gBAAgB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAAC,CAUnE"}
@@ -7,6 +7,8 @@ import type { CreateSshKeyData } from "@studiometa/forge-api";
7
7
  */
8
8
  export interface ListSshKeysOptions {
9
9
  server_id: string;
10
+ /** Only list the keys of this server user. */
11
+ user?: string;
10
12
  }
11
13
  /**
12
14
  * Options for getting a single SSH key.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/executors/ssh-keys/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;CACZ"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/executors/ssh-keys/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;CACZ"}
package/dist/index.d.ts CHANGED
@@ -48,6 +48,8 @@ export { createScheduledJob, deleteScheduledJob, getScheduledJob, listScheduledJ
48
48
  export type { CreateScheduledJobOptions, DeleteScheduledJobOptions, GetScheduledJobOptions, ListScheduledJobsOptions, } from "./executors/scheduled-jobs/index.ts";
49
49
  export { listServices, restartService, RESTARTABLE_SERVICES } from "./executors/services/index.ts";
50
50
  export type { ListServicesOptions, RestartableService, RestartServiceOptions, ServiceStatus, } from "./executors/services/index.ts";
51
+ export { disablePhpOpcache, enablePhpOpcache, getPhpConfig, getPhpMaxExecutionTime, getPhpMaxUploadSize, getPhpOpcache, getPhpVersion, listPhpVersions, PHP_CONFIG_TYPES, resolvePhpVersionId, updatePhpConfig, updatePhpMaxExecutionTime, updatePhpMaxUploadSize, } from "./executors/php/index.ts";
52
+ export type { GetPhpConfigOptions, GetPhpVersionOptions, PhpConfigType, PhpServerOptions, UpdatePhpConfigOptions, UpdatePhpMaxExecutionTimeOptions, UpdatePhpMaxUploadSizeOptions, } from "./executors/php/index.ts";
51
53
  export { getUser } from "./executors/user/index.ts";
52
54
  export type { GetUserOptions } from "./executors/user/index.ts";
53
55
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACpD,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,YAAY,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGzD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC/E,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAA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M,+BAA+B,CAAC;AAGvC,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,GAClB,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EACV,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACnG,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,GACd,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,gCAAgC,EAChC,6BAA6B,GAC9B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { createWriteStream, mkdirSync } from "node:fs";
2
2
  import { homedir } from "node:os";
3
3
  import { dirname, join } from "node:path";
4
4
  import pino from "pino";
5
- import { BackgroundProcessAttributesSchema, BackgroundProcessLogAttributesSchema, BackupConfigAttributesSchema, CertificateAttributesSchema, CommandAttributesSchema, DatabaseAttributesSchema, DatabaseUserAttributesSchema, DeploymentAttributesSchema, DeploymentOutputAttributesSchema, DeploymentScriptAttributesSchema, EnvironmentAttributesSchema, FirewallRuleAttributesSchema, MonitorAttributesSchema, NginxTemplateAttributesSchema, RecipeAttributesSchema, RedirectRuleAttributesSchema, ScheduledJobAttributesSchema, SecurityRuleAttributesSchema, ServerAttributesSchema, SiteAttributesSchema, SshKeyAttributesSchema, UserAttributesSchema, jsonApiDocumentSchema, jsonApiListDocumentSchema, unwrapDocument, unwrapListDocument } from "@studiometa/forge-api";
5
+ import { BackgroundProcessAttributesSchema, BackgroundProcessLogAttributesSchema, BackupConfigAttributesSchema, CertificateAttributesSchema, CommandAttributesSchema, DatabaseAttributesSchema, DatabaseUserAttributesSchema, DeploymentAttributesSchema, DeploymentOutputAttributesSchema, DeploymentScriptAttributesSchema, EnvironmentAttributesSchema, FirewallRuleAttributesSchema, MonitorAttributesSchema, NginxTemplateAttributesSchema, PhpConfigAttributesSchema, PhpMaxExecutionTimeAttributesSchema, PhpMaxUploadSizeAttributesSchema, PhpOpcacheAttributesSchema, PhpVersionAttributesSchema, RecipeAttributesSchema, RedirectRuleAttributesSchema, ScheduledJobAttributesSchema, SecurityRuleAttributesSchema, ServerAttributesSchema, SiteAttributesSchema, SshKeyAttributesSchema, UserAttributesSchema, jsonApiDocumentSchema, jsonApiListDocumentSchema, unwrapDocument, unwrapListDocument } from "@studiometa/forge-api";
6
6
  //#region src/constants.ts
7
7
  /**
8
8
  * All supported resources.
@@ -29,6 +29,7 @@ var RESOURCES = [
29
29
  "commands",
30
30
  "scheduled-jobs",
31
31
  "services",
32
+ "php",
32
33
  "user",
33
34
  "batch"
34
35
  ];
@@ -648,6 +649,52 @@ var ROUTES = {
648
649
  method: "POST",
649
650
  path: "/orgs/:org/servers/:server_id/services/:service/actions"
650
651
  } },
652
+ php: {
653
+ listVersions: {
654
+ method: "GET",
655
+ path: "/orgs/:org/servers/:server_id/php/versions"
656
+ },
657
+ getVersion: {
658
+ method: "GET",
659
+ path: "/orgs/:org/servers/:server_id/php/versions/:version_id"
660
+ },
661
+ getConfig: {
662
+ method: "GET",
663
+ path: "/orgs/:org/servers/:server_id/php/versions/:version_id/configs/:type"
664
+ },
665
+ updateConfig: {
666
+ method: "PUT",
667
+ path: "/orgs/:org/servers/:server_id/php/versions/:version_id/configs/:type"
668
+ },
669
+ getMaxUploadSize: {
670
+ method: "GET",
671
+ path: "/orgs/:org/servers/:server_id/php/max-upload-size"
672
+ },
673
+ updateMaxUploadSize: {
674
+ method: "PUT",
675
+ path: "/orgs/:org/servers/:server_id/php/max-upload-size"
676
+ },
677
+ getMaxExecutionTime: {
678
+ method: "GET",
679
+ path: "/orgs/:org/servers/:server_id/php/max-execution-time"
680
+ },
681
+ updateMaxExecutionTime: {
682
+ method: "PUT",
683
+ path: "/orgs/:org/servers/:server_id/php/max-execution-time"
684
+ },
685
+ getOpcache: {
686
+ method: "GET",
687
+ path: "/orgs/:org/servers/:server_id/php/opcache"
688
+ },
689
+ enableOpcache: {
690
+ method: "POST",
691
+ path: "/orgs/:org/servers/:server_id/php/opcache"
692
+ },
693
+ disableOpcache: {
694
+ method: "DELETE",
695
+ path: "/orgs/:org/servers/:server_id/php/opcache"
696
+ }
697
+ },
651
698
  user: { get: {
652
699
  method: "GET",
653
700
  path: "/user"
@@ -734,12 +781,35 @@ async function getServer(options, ctx) {
734
781
  return { data: unwrapDocument(await request(ROUTES.servers.get, ctx, { server_id: options.server_id }, { schema: jsonApiDocumentSchema(ServerAttributesSchema) })) };
735
782
  }
736
783
  //#endregion
784
+ //#region src/utils/list-all-pages.ts
785
+ /**
786
+ * GET every page of a cursor-paginated list route and return all its resources.
787
+ * Follows `meta.next_cursor` until the API returns no cursor.
788
+ */
789
+ async function listAllPages(route, ctx, params, attributes, query = {}) {
790
+ const schema = jsonApiListDocumentSchema(attributes);
791
+ const items = [];
792
+ let cursor;
793
+ do {
794
+ const response = await request(route, ctx, params, {
795
+ schema,
796
+ query: cursor ? {
797
+ ...query,
798
+ "page[cursor]": cursor
799
+ } : query
800
+ });
801
+ items.push(...unwrapListDocument(response));
802
+ cursor = response.meta.next_cursor;
803
+ } while (cursor);
804
+ return items;
805
+ }
806
+ //#endregion
737
807
  //#region src/executors/servers/list.ts
738
808
  /**
739
- * List all servers.
809
+ * List all servers, from every page.
740
810
  */
741
811
  async function listServers(_options, ctx) {
742
- return { data: unwrapListDocument(await request(ROUTES.servers.list, ctx, {}, { schema: jsonApiListDocumentSchema(ServerAttributesSchema) })) };
812
+ return { data: await listAllPages(ROUTES.servers.list, ctx, {}, ServerAttributesSchema) };
743
813
  }
744
814
  //#endregion
745
815
  //#region src/executors/servers/reboot.ts
@@ -1314,10 +1384,10 @@ async function getSshKey(options, ctx) {
1314
1384
  //#endregion
1315
1385
  //#region src/executors/ssh-keys/list.ts
1316
1386
  /**
1317
- * List SSH keys on a server.
1387
+ * List SSH keys on a server, from every page. Filter by server user with `user`.
1318
1388
  */
1319
1389
  async function listSshKeys(options, ctx) {
1320
- return { data: unwrapListDocument(await request(ROUTES.sshKeys.list, ctx, { server_id: options.server_id }, { schema: jsonApiListDocumentSchema(SshKeyAttributesSchema) })) };
1390
+ return { data: await listAllPages(ROUTES.sshKeys.list, ctx, { server_id: options.server_id }, SshKeyAttributesSchema, options.user ? { "filter[user]": options.user } : {}) };
1321
1391
  }
1322
1392
  //#endregion
1323
1393
  //#region src/executors/security-rules/create.ts
@@ -1877,6 +1947,153 @@ async function restartService(options, ctx) {
1877
1947
  return { data: void 0 };
1878
1948
  }
1879
1949
  //#endregion
1950
+ //#region src/executors/php/types.ts
1951
+ /**
1952
+ * Option types for PHP executors.
1953
+ */
1954
+ /**
1955
+ * The PHP configuration files that Forge can read and write.
1956
+ */
1957
+ var PHP_CONFIG_TYPES = [
1958
+ "cli",
1959
+ "fpm",
1960
+ "pool"
1961
+ ];
1962
+ //#endregion
1963
+ //#region src/executors/php/versions.ts
1964
+ /**
1965
+ * List the PHP versions installed on a server.
1966
+ */
1967
+ async function listPhpVersions(options, ctx) {
1968
+ return { data: unwrapListDocument(await request(ROUTES.php.listVersions, ctx, { server_id: options.server_id }, { schema: jsonApiListDocumentSchema(PhpVersionAttributesSchema) })) };
1969
+ }
1970
+ /**
1971
+ * Resolve a PHP version to its ID on a server.
1972
+ *
1973
+ * A numeric value is an ID and is returned as is, without an API call.
1974
+ * Any other value is matched against the installed versions: "8.3",
1975
+ * "php8.3" (binary name) and "php83" all match version 8.3.
1976
+ */
1977
+ async function resolvePhpVersionId(server_id, version, ctx) {
1978
+ if (/^\d+$/.test(version)) return version;
1979
+ const { data: versions } = await listPhpVersions({ server_id }, ctx);
1980
+ const wanted = version.trim().toLowerCase();
1981
+ const match = versions.find((item) => [
1982
+ item.version,
1983
+ item.binary_name,
1984
+ `php${item.version}`,
1985
+ `php${item.version.replace(".", "")}`
1986
+ ].map((name) => name.toLowerCase()).includes(wanted));
1987
+ if (!match) {
1988
+ const installed = versions.map((item) => item.version).join(", ") || "none";
1989
+ throw new Error(`PHP version "${version}" is not installed on server ${server_id}. Installed: ${installed}.`);
1990
+ }
1991
+ return String(match.id);
1992
+ }
1993
+ /**
1994
+ * Get one installed PHP version.
1995
+ */
1996
+ async function getPhpVersion(options, ctx) {
1997
+ const version_id = await resolvePhpVersionId(options.server_id, options.version, ctx);
1998
+ return { data: unwrapDocument(await request(ROUTES.php.getVersion, ctx, {
1999
+ server_id: options.server_id,
2000
+ version_id
2001
+ }, { schema: jsonApiDocumentSchema(PhpVersionAttributesSchema) })) };
2002
+ }
2003
+ //#endregion
2004
+ //#region src/executors/php/config.ts
2005
+ /**
2006
+ * Throw when the configuration type is not one of cli, fpm or pool,
2007
+ * or when a user is given for a type other than pool.
2008
+ */
2009
+ function assertConfigTarget(type, user) {
2010
+ if (!PHP_CONFIG_TYPES.includes(type)) throw new Error(`Invalid PHP config type "${type}". Valid types: ${PHP_CONFIG_TYPES.join(", ")}.`);
2011
+ if (user && type !== "pool") throw new Error(`The user option applies to the pool config only, not "${type}".`);
2012
+ }
2013
+ /**
2014
+ * Get a PHP configuration file (cli, fpm or pool) for an installed version.
2015
+ */
2016
+ async function getPhpConfig(options, ctx) {
2017
+ assertConfigTarget(options.type, options.user);
2018
+ const version_id = await resolvePhpVersionId(options.server_id, options.version, ctx);
2019
+ return { data: unwrapDocument(await request(ROUTES.php.getConfig, ctx, {
2020
+ server_id: options.server_id,
2021
+ version_id,
2022
+ type: options.type
2023
+ }, {
2024
+ schema: jsonApiDocumentSchema(PhpConfigAttributesSchema),
2025
+ ...options.user ? { query: { user: options.user } } : {}
2026
+ })).configuration };
2027
+ }
2028
+ /**
2029
+ * Replace a PHP configuration file (cli, fpm or pool) for an installed version.
2030
+ */
2031
+ async function updatePhpConfig(options, ctx) {
2032
+ assertConfigTarget(options.type, options.user);
2033
+ const version_id = await resolvePhpVersionId(options.server_id, options.version, ctx);
2034
+ await request(ROUTES.php.updateConfig, ctx, {
2035
+ server_id: options.server_id,
2036
+ version_id,
2037
+ type: options.type
2038
+ }, { body: {
2039
+ config: options.content,
2040
+ ...options.user ? { user: options.user } : {}
2041
+ } });
2042
+ return { data: void 0 };
2043
+ }
2044
+ //#endregion
2045
+ //#region src/executors/php/limits.ts
2046
+ /**
2047
+ * Get the PHP max upload size of a server, in megabytes.
2048
+ */
2049
+ async function getPhpMaxUploadSize(options, ctx) {
2050
+ const response = await request(ROUTES.php.getMaxUploadSize, ctx, { server_id: options.server_id }, { schema: jsonApiDocumentSchema(PhpMaxUploadSizeAttributesSchema) });
2051
+ return { data: String(unwrapDocument(response).max_upload_size) };
2052
+ }
2053
+ /**
2054
+ * Set the PHP max upload size of a server, in megabytes.
2055
+ */
2056
+ async function updatePhpMaxUploadSize(options, ctx) {
2057
+ await request(ROUTES.php.updateMaxUploadSize, ctx, { server_id: options.server_id }, { body: { max_upload_size: options.size } });
2058
+ return { data: void 0 };
2059
+ }
2060
+ /**
2061
+ * Get the PHP max execution time of a server, in seconds.
2062
+ */
2063
+ async function getPhpMaxExecutionTime(options, ctx) {
2064
+ const response = await request(ROUTES.php.getMaxExecutionTime, ctx, { server_id: options.server_id }, { schema: jsonApiDocumentSchema(PhpMaxExecutionTimeAttributesSchema) });
2065
+ return { data: String(unwrapDocument(response).max_execution_time) };
2066
+ }
2067
+ /**
2068
+ * Set the PHP max execution time of a server, in seconds.
2069
+ */
2070
+ async function updatePhpMaxExecutionTime(options, ctx) {
2071
+ await request(ROUTES.php.updateMaxExecutionTime, ctx, { server_id: options.server_id }, { body: { max_execution_time: options.seconds } });
2072
+ return { data: void 0 };
2073
+ }
2074
+ //#endregion
2075
+ //#region src/executors/php/opcache.ts
2076
+ /**
2077
+ * Get whether PHP OPcache is enabled on a server.
2078
+ */
2079
+ async function getPhpOpcache(options, ctx) {
2080
+ return { data: unwrapDocument(await request(ROUTES.php.getOpcache, ctx, { server_id: options.server_id }, { schema: jsonApiDocumentSchema(PhpOpcacheAttributesSchema) })).opcache_enabled };
2081
+ }
2082
+ /**
2083
+ * Enable PHP OPcache on a server.
2084
+ */
2085
+ async function enablePhpOpcache(options, ctx) {
2086
+ await request(ROUTES.php.enableOpcache, ctx, { server_id: options.server_id });
2087
+ return { data: void 0 };
2088
+ }
2089
+ /**
2090
+ * Disable PHP OPcache on a server.
2091
+ */
2092
+ async function disablePhpOpcache(options, ctx) {
2093
+ await request(ROUTES.php.disableOpcache, ctx, { server_id: options.server_id });
2094
+ return { data: void 0 };
2095
+ }
2096
+ //#endregion
1880
2097
  //#region src/executors/user/get.ts
1881
2098
  /**
1882
2099
  * Get the currently authenticated user.
@@ -1885,6 +2102,6 @@ async function getUser(_options, ctx) {
1885
2102
  return { data: unwrapDocument(await request(ROUTES.user.get, ctx, {}, { schema: jsonApiDocumentSchema(UserAttributesSchema) })) };
1886
2103
  }
1887
2104
  //#endregion
1888
- export { ACTIONS, RESOURCES, RESTARTABLE_SERVICES, activateCertificate, createAuditLogger, createBackupConfig, createCertificate, createCommand, createDaemon, createDatabase, createDatabaseUser, createFirewallRule, createMonitor, createNginxTemplate, createRecipe, createRedirectRule, createScheduledJob, createSecurityRule, createServer, createSite, createSshKey, createTestExecutorContext, deleteBackupConfig, deleteCertificate, deleteDaemon, deleteDatabase, deleteDatabaseUser, deleteFirewallRule, deleteMonitor, deleteNginxTemplate, deleteRecipe, deleteRedirectRule, deleteScheduledJob, deleteSecurityRule, deleteServer, deleteSite, deleteSshKey, deploySite, deploySiteAndWait, getAuditLogPath, getBackupConfig, getCertificate, getCommand, getDaemon, getDaemonLog, getDatabase, getDatabaseUser, getDeploymentLog, getDeploymentScript, getEnv, getFirewallRule, getMonitor, getNginxConfig, getNginxTemplate, getRecipe, getRedirectRule, getScheduledJob, getSecurityRule, getServer, getSite, getSshKey, getUser, listBackupConfigs, listCommands, listDaemons, listDatabaseUsers, listDatabases, listDeployments, listFirewallRules, listMonitors, listNginxTemplates, listRecipes, listRedirectRules, listScheduledJobs, listSecurityRules, listServers, listServices, listSites, listSshKeys, matchByName, mockDocument, mockListDocument, mockResource, rebootServer, resolveServers, resolveSites, restartDaemon, restartService, runRecipe, sanitizeArgs, updateBackupConfig, updateDaemon, updateDatabaseUser, updateDeploymentScript, updateEnv, updateNginxConfig, updateNginxTemplate, updateRecipe, updateSecurityRule, updateSite };
2105
+ export { ACTIONS, PHP_CONFIG_TYPES, RESOURCES, RESTARTABLE_SERVICES, activateCertificate, createAuditLogger, createBackupConfig, createCertificate, createCommand, createDaemon, createDatabase, createDatabaseUser, createFirewallRule, createMonitor, createNginxTemplate, createRecipe, createRedirectRule, createScheduledJob, createSecurityRule, createServer, createSite, createSshKey, createTestExecutorContext, deleteBackupConfig, deleteCertificate, deleteDaemon, deleteDatabase, deleteDatabaseUser, deleteFirewallRule, deleteMonitor, deleteNginxTemplate, deleteRecipe, deleteRedirectRule, deleteScheduledJob, deleteSecurityRule, deleteServer, deleteSite, deleteSshKey, deploySite, deploySiteAndWait, disablePhpOpcache, enablePhpOpcache, getAuditLogPath, getBackupConfig, getCertificate, getCommand, getDaemon, getDaemonLog, getDatabase, getDatabaseUser, getDeploymentLog, getDeploymentScript, getEnv, getFirewallRule, getMonitor, getNginxConfig, getNginxTemplate, getPhpConfig, getPhpMaxExecutionTime, getPhpMaxUploadSize, getPhpOpcache, getPhpVersion, getRecipe, getRedirectRule, getScheduledJob, getSecurityRule, getServer, getSite, getSshKey, getUser, listBackupConfigs, listCommands, listDaemons, listDatabaseUsers, listDatabases, listDeployments, listFirewallRules, listMonitors, listNginxTemplates, listPhpVersions, listRecipes, listRedirectRules, listScheduledJobs, listSecurityRules, listServers, listServices, listSites, listSshKeys, matchByName, mockDocument, mockListDocument, mockResource, rebootServer, resolvePhpVersionId, resolveServers, resolveSites, restartDaemon, restartService, runRecipe, sanitizeArgs, updateBackupConfig, updateDaemon, updateDatabaseUser, updateDeploymentScript, updateEnv, updateNginxConfig, updateNginxTemplate, updatePhpConfig, updatePhpMaxExecutionTime, updatePhpMaxUploadSize, updateRecipe, updateSecurityRule, updateSite };
1889
2106
 
1890
2107
  //# sourceMappingURL=index.js.map