@studiometa/forge-core 0.2.5 → 0.4.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.
- package/README.md +27 -3
- package/dist/context.d.ts +2 -5
- package/dist/context.d.ts.map +1 -1
- package/dist/executors/backups/create.d.ts +2 -3
- package/dist/executors/backups/create.d.ts.map +1 -1
- package/dist/executors/backups/delete.d.ts.map +1 -1
- package/dist/executors/backups/get.d.ts +5 -3
- package/dist/executors/backups/get.d.ts.map +1 -1
- package/dist/executors/backups/index.d.ts +2 -1
- package/dist/executors/backups/index.d.ts.map +1 -1
- package/dist/executors/backups/list.d.ts +4 -2
- package/dist/executors/backups/list.d.ts.map +1 -1
- package/dist/executors/backups/types.d.ts +8 -1
- package/dist/executors/backups/types.d.ts.map +1 -1
- package/dist/executors/backups/update.d.ts +7 -0
- package/dist/executors/backups/update.d.ts.map +1 -0
- package/dist/executors/certificates/activate.d.ts +1 -1
- package/dist/executors/certificates/activate.d.ts.map +1 -1
- package/dist/executors/certificates/create.d.ts +5 -3
- package/dist/executors/certificates/create.d.ts.map +1 -1
- package/dist/executors/certificates/delete.d.ts +1 -1
- package/dist/executors/certificates/delete.d.ts.map +1 -1
- package/dist/executors/certificates/get.d.ts +5 -3
- package/dist/executors/certificates/get.d.ts.map +1 -1
- package/dist/executors/certificates/index.d.ts +1 -2
- package/dist/executors/certificates/index.d.ts.map +1 -1
- package/dist/executors/certificates/types.d.ts +11 -14
- package/dist/executors/certificates/types.d.ts.map +1 -1
- package/dist/executors/commands/create.d.ts +1 -2
- package/dist/executors/commands/create.d.ts.map +1 -1
- package/dist/executors/commands/get.d.ts +4 -2
- package/dist/executors/commands/get.d.ts.map +1 -1
- package/dist/executors/commands/list.d.ts +4 -2
- package/dist/executors/commands/list.d.ts.map +1 -1
- package/dist/executors/daemons/create.d.ts +5 -3
- package/dist/executors/daemons/create.d.ts.map +1 -1
- package/dist/executors/daemons/delete.d.ts.map +1 -1
- package/dist/executors/daemons/get.d.ts +4 -2
- package/dist/executors/daemons/get.d.ts.map +1 -1
- package/dist/executors/daemons/index.d.ts +2 -1
- package/dist/executors/daemons/index.d.ts.map +1 -1
- package/dist/executors/daemons/list.d.ts +5 -3
- package/dist/executors/daemons/list.d.ts.map +1 -1
- package/dist/executors/daemons/restart.d.ts.map +1 -1
- package/dist/executors/daemons/types.d.ts +8 -1
- package/dist/executors/daemons/types.d.ts.map +1 -1
- package/dist/executors/daemons/update.d.ts +10 -0
- package/dist/executors/daemons/update.d.ts.map +1 -0
- package/dist/executors/database-users/create.d.ts +4 -2
- package/dist/executors/database-users/create.d.ts.map +1 -1
- package/dist/executors/database-users/delete.d.ts.map +1 -1
- package/dist/executors/database-users/get.d.ts +4 -2
- package/dist/executors/database-users/get.d.ts.map +1 -1
- package/dist/executors/database-users/index.d.ts +2 -1
- package/dist/executors/database-users/index.d.ts.map +1 -1
- package/dist/executors/database-users/list.d.ts +4 -2
- package/dist/executors/database-users/list.d.ts.map +1 -1
- package/dist/executors/database-users/types.d.ts +8 -1
- package/dist/executors/database-users/types.d.ts.map +1 -1
- package/dist/executors/database-users/update.d.ts +10 -0
- package/dist/executors/database-users/update.d.ts.map +1 -0
- package/dist/executors/databases/create.d.ts +4 -2
- package/dist/executors/databases/create.d.ts.map +1 -1
- package/dist/executors/databases/delete.d.ts.map +1 -1
- package/dist/executors/databases/get.d.ts +4 -2
- package/dist/executors/databases/get.d.ts.map +1 -1
- package/dist/executors/databases/list.d.ts +4 -2
- package/dist/executors/databases/list.d.ts.map +1 -1
- package/dist/executors/deployments/deploy-and-wait.d.ts +6 -5
- package/dist/executors/deployments/deploy-and-wait.d.ts.map +1 -1
- package/dist/executors/deployments/deploy.d.ts.map +1 -1
- package/dist/executors/deployments/get-log.d.ts.map +1 -1
- package/dist/executors/deployments/get-script.d.ts.map +1 -1
- package/dist/executors/deployments/index.d.ts +1 -2
- package/dist/executors/deployments/index.d.ts.map +1 -1
- package/dist/executors/deployments/list.d.ts +4 -2
- package/dist/executors/deployments/list.d.ts.map +1 -1
- package/dist/executors/deployments/types.d.ts +6 -8
- package/dist/executors/deployments/types.d.ts.map +1 -1
- package/dist/executors/deployments/update-script.d.ts.map +1 -1
- package/dist/executors/env/get.d.ts.map +1 -1
- package/dist/executors/env/update.d.ts.map +1 -1
- package/dist/executors/firewall-rules/create.d.ts +4 -2
- package/dist/executors/firewall-rules/create.d.ts.map +1 -1
- package/dist/executors/firewall-rules/delete.d.ts +3 -0
- package/dist/executors/firewall-rules/delete.d.ts.map +1 -1
- package/dist/executors/firewall-rules/get.d.ts +7 -2
- package/dist/executors/firewall-rules/get.d.ts.map +1 -1
- package/dist/executors/firewall-rules/list.d.ts +7 -2
- package/dist/executors/firewall-rules/list.d.ts.map +1 -1
- package/dist/executors/monitors/create.d.ts +7 -2
- package/dist/executors/monitors/create.d.ts.map +1 -1
- package/dist/executors/monitors/delete.d.ts +3 -0
- package/dist/executors/monitors/delete.d.ts.map +1 -1
- package/dist/executors/monitors/get.d.ts +7 -2
- package/dist/executors/monitors/get.d.ts.map +1 -1
- package/dist/executors/monitors/list.d.ts +7 -2
- package/dist/executors/monitors/list.d.ts.map +1 -1
- package/dist/executors/nginx/get.d.ts.map +1 -1
- package/dist/executors/nginx/update.d.ts.map +1 -1
- package/dist/executors/nginx-templates/create.d.ts +7 -2
- package/dist/executors/nginx-templates/create.d.ts.map +1 -1
- package/dist/executors/nginx-templates/delete.d.ts +3 -0
- package/dist/executors/nginx-templates/delete.d.ts.map +1 -1
- package/dist/executors/nginx-templates/get.d.ts +7 -2
- package/dist/executors/nginx-templates/get.d.ts.map +1 -1
- package/dist/executors/nginx-templates/list.d.ts +7 -2
- package/dist/executors/nginx-templates/list.d.ts.map +1 -1
- package/dist/executors/nginx-templates/update.d.ts +7 -2
- package/dist/executors/nginx-templates/update.d.ts.map +1 -1
- package/dist/executors/recipes/create.d.ts +7 -2
- package/dist/executors/recipes/create.d.ts.map +1 -1
- package/dist/executors/recipes/delete.d.ts +3 -0
- package/dist/executors/recipes/delete.d.ts.map +1 -1
- package/dist/executors/recipes/get.d.ts +7 -2
- package/dist/executors/recipes/get.d.ts.map +1 -1
- package/dist/executors/recipes/index.d.ts +2 -1
- package/dist/executors/recipes/index.d.ts.map +1 -1
- package/dist/executors/recipes/list.d.ts +7 -2
- package/dist/executors/recipes/list.d.ts.map +1 -1
- package/dist/executors/recipes/run.d.ts.map +1 -1
- package/dist/executors/recipes/types.d.ts +7 -1
- package/dist/executors/recipes/types.d.ts.map +1 -1
- package/dist/executors/recipes/update.d.ts +10 -0
- package/dist/executors/recipes/update.d.ts.map +1 -0
- package/dist/executors/redirect-rules/create.d.ts +4 -2
- package/dist/executors/redirect-rules/create.d.ts.map +1 -1
- package/dist/executors/redirect-rules/delete.d.ts +3 -0
- package/dist/executors/redirect-rules/delete.d.ts.map +1 -1
- package/dist/executors/redirect-rules/get.d.ts +7 -2
- package/dist/executors/redirect-rules/get.d.ts.map +1 -1
- package/dist/executors/redirect-rules/list.d.ts +7 -2
- package/dist/executors/redirect-rules/list.d.ts.map +1 -1
- package/dist/executors/scheduled-jobs/create.d.ts +5 -3
- package/dist/executors/scheduled-jobs/create.d.ts.map +1 -1
- package/dist/executors/scheduled-jobs/delete.d.ts.map +1 -1
- package/dist/executors/scheduled-jobs/get.d.ts +4 -2
- package/dist/executors/scheduled-jobs/get.d.ts.map +1 -1
- package/dist/executors/scheduled-jobs/list.d.ts +5 -3
- package/dist/executors/scheduled-jobs/list.d.ts.map +1 -1
- package/dist/executors/scheduled-jobs/types.d.ts +4 -0
- package/dist/executors/scheduled-jobs/types.d.ts.map +1 -1
- package/dist/executors/security-rules/create.d.ts +7 -2
- package/dist/executors/security-rules/create.d.ts.map +1 -1
- package/dist/executors/security-rules/delete.d.ts +3 -0
- package/dist/executors/security-rules/delete.d.ts.map +1 -1
- package/dist/executors/security-rules/get.d.ts +7 -2
- package/dist/executors/security-rules/get.d.ts.map +1 -1
- package/dist/executors/security-rules/index.d.ts +2 -1
- package/dist/executors/security-rules/index.d.ts.map +1 -1
- package/dist/executors/security-rules/list.d.ts +7 -2
- package/dist/executors/security-rules/list.d.ts.map +1 -1
- package/dist/executors/security-rules/types.d.ts +9 -1
- package/dist/executors/security-rules/types.d.ts.map +1 -1
- package/dist/executors/security-rules/update.d.ts +10 -0
- package/dist/executors/security-rules/update.d.ts.map +1 -0
- package/dist/executors/servers/create.d.ts +4 -2
- package/dist/executors/servers/create.d.ts.map +1 -1
- package/dist/executors/servers/delete.d.ts.map +1 -1
- package/dist/executors/servers/get.d.ts +4 -2
- package/dist/executors/servers/get.d.ts.map +1 -1
- package/dist/executors/servers/list.d.ts +4 -2
- package/dist/executors/servers/list.d.ts.map +1 -1
- package/dist/executors/servers/reboot.d.ts.map +1 -1
- package/dist/executors/servers/resolve.d.ts.map +1 -1
- package/dist/executors/sites/create.d.ts +4 -2
- package/dist/executors/sites/create.d.ts.map +1 -1
- package/dist/executors/sites/delete.d.ts.map +1 -1
- package/dist/executors/sites/get.d.ts +7 -2
- package/dist/executors/sites/get.d.ts.map +1 -1
- package/dist/executors/sites/index.d.ts +2 -1
- package/dist/executors/sites/index.d.ts.map +1 -1
- package/dist/executors/sites/list.d.ts +4 -2
- package/dist/executors/sites/list.d.ts.map +1 -1
- package/dist/executors/sites/resolve.d.ts +0 -3
- package/dist/executors/sites/resolve.d.ts.map +1 -1
- package/dist/executors/sites/types.d.ts +12 -1
- package/dist/executors/sites/types.d.ts.map +1 -1
- package/dist/executors/sites/update.d.ts +10 -0
- package/dist/executors/sites/update.d.ts.map +1 -0
- package/dist/executors/ssh-keys/create.d.ts +4 -2
- package/dist/executors/ssh-keys/create.d.ts.map +1 -1
- package/dist/executors/ssh-keys/delete.d.ts +3 -0
- package/dist/executors/ssh-keys/delete.d.ts.map +1 -1
- package/dist/executors/ssh-keys/get.d.ts +7 -2
- package/dist/executors/ssh-keys/get.d.ts.map +1 -1
- package/dist/executors/ssh-keys/list.d.ts +7 -2
- package/dist/executors/ssh-keys/list.d.ts.map +1 -1
- package/dist/executors/user/get.d.ts +4 -2
- package/dist/executors/user/get.d.ts.map +1 -1
- package/dist/index.d.ts +17 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1063 -125
- package/dist/index.js.map +1 -1
- package/dist/routes.d.ts +457 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/test-helpers.d.ts +21 -0
- package/dist/test-helpers.d.ts.map +1 -0
- package/package.json +4 -3
- package/dist/executors/certificates/list.d.ts +0 -8
- package/dist/executors/certificates/list.d.ts.map +0 -1
- package/dist/executors/deployments/get-output.d.ts +0 -7
- package/dist/executors/deployments/get-output.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createWriteStream, mkdirSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
|
+
import { BackgroundProcessAttributesSchema, 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";
|
|
4
5
|
var __create = Object.create;
|
|
5
6
|
var __defProp = Object.defineProperty;
|
|
6
7
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -663,35 +664,586 @@ function createTestExecutorContext(overrides = {}) {
|
|
|
663
664
|
};
|
|
664
665
|
}
|
|
665
666
|
/**
|
|
667
|
+
* Create a mock JSON:API resource.
|
|
668
|
+
*/
|
|
669
|
+
function mockResource(id, type, attributes) {
|
|
670
|
+
return {
|
|
671
|
+
id: String(id),
|
|
672
|
+
type,
|
|
673
|
+
attributes,
|
|
674
|
+
links: { self: { href: `/api/${type}/${id}` } }
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* Create a mock JSON:API single-resource document.
|
|
679
|
+
*/
|
|
680
|
+
function mockDocument(id, type, attributes) {
|
|
681
|
+
return { data: mockResource(id, type, attributes) };
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* Create a mock JSON:API list document.
|
|
685
|
+
*/
|
|
686
|
+
function mockListDocument(type, items) {
|
|
687
|
+
return {
|
|
688
|
+
data: items.map((item) => mockResource(item.id, type, item.attributes)),
|
|
689
|
+
links: {
|
|
690
|
+
next: null,
|
|
691
|
+
prev: null
|
|
692
|
+
},
|
|
693
|
+
meta: {
|
|
694
|
+
per_page: 30,
|
|
695
|
+
next_cursor: null,
|
|
696
|
+
prev_cursor: null
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
var store$4;
|
|
701
|
+
/**
|
|
702
|
+
* Returns the global configuration.
|
|
703
|
+
*
|
|
704
|
+
* @param config The config to merge.
|
|
705
|
+
*
|
|
706
|
+
* @returns The configuration.
|
|
707
|
+
*/
|
|
708
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
709
|
+
function getGlobalConfig(config$1) {
|
|
710
|
+
return {
|
|
711
|
+
lang: config$1?.lang ?? store$4?.lang,
|
|
712
|
+
message: config$1?.message,
|
|
713
|
+
abortEarly: config$1?.abortEarly ?? store$4?.abortEarly,
|
|
714
|
+
abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* A Valibot error with useful information.
|
|
719
|
+
*/
|
|
720
|
+
var ValiError = class extends Error {
|
|
721
|
+
/**
|
|
722
|
+
* Creates a Valibot error with useful information.
|
|
723
|
+
*
|
|
724
|
+
* @param issues The error issues.
|
|
725
|
+
*/
|
|
726
|
+
constructor(issues) {
|
|
727
|
+
super(issues[0].message);
|
|
728
|
+
this.name = "ValiError";
|
|
729
|
+
this.issues = issues;
|
|
730
|
+
}
|
|
731
|
+
};
|
|
732
|
+
/**
|
|
733
|
+
* Parses an unknown input based on a schema.
|
|
734
|
+
*
|
|
735
|
+
* @param schema The schema to be used.
|
|
736
|
+
* @param input The input to be parsed.
|
|
737
|
+
* @param config The parse configuration.
|
|
738
|
+
*
|
|
739
|
+
* @returns The parsed input.
|
|
740
|
+
*/
|
|
741
|
+
function parse(schema, input, config$1) {
|
|
742
|
+
const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));
|
|
743
|
+
if (dataset.issues) throw new ValiError(dataset.issues);
|
|
744
|
+
return dataset.value;
|
|
745
|
+
}
|
|
746
|
+
const ROUTES = {
|
|
747
|
+
servers: {
|
|
748
|
+
list: {
|
|
749
|
+
method: "GET",
|
|
750
|
+
path: "/orgs/:org/servers"
|
|
751
|
+
},
|
|
752
|
+
get: {
|
|
753
|
+
method: "GET",
|
|
754
|
+
path: "/orgs/:org/servers/:server_id"
|
|
755
|
+
},
|
|
756
|
+
create: {
|
|
757
|
+
method: "POST",
|
|
758
|
+
path: "/orgs/:org/servers"
|
|
759
|
+
},
|
|
760
|
+
delete: {
|
|
761
|
+
method: "DELETE",
|
|
762
|
+
path: "/orgs/:org/servers/:server_id"
|
|
763
|
+
},
|
|
764
|
+
reboot: {
|
|
765
|
+
method: "POST",
|
|
766
|
+
path: "/orgs/:org/servers/:server_id/actions"
|
|
767
|
+
}
|
|
768
|
+
},
|
|
769
|
+
sites: {
|
|
770
|
+
list: {
|
|
771
|
+
method: "GET",
|
|
772
|
+
path: "/orgs/:org/servers/:server_id/sites"
|
|
773
|
+
},
|
|
774
|
+
get: {
|
|
775
|
+
method: "GET",
|
|
776
|
+
path: "/orgs/:org/sites/:site_id"
|
|
777
|
+
},
|
|
778
|
+
create: {
|
|
779
|
+
method: "POST",
|
|
780
|
+
path: "/orgs/:org/servers/:server_id/sites"
|
|
781
|
+
},
|
|
782
|
+
update: {
|
|
783
|
+
method: "PUT",
|
|
784
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id"
|
|
785
|
+
},
|
|
786
|
+
delete: {
|
|
787
|
+
method: "DELETE",
|
|
788
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id"
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
databases: {
|
|
792
|
+
list: {
|
|
793
|
+
method: "GET",
|
|
794
|
+
path: "/orgs/:org/servers/:server_id/database/schemas"
|
|
795
|
+
},
|
|
796
|
+
get: {
|
|
797
|
+
method: "GET",
|
|
798
|
+
path: "/orgs/:org/servers/:server_id/database/schemas/:id"
|
|
799
|
+
},
|
|
800
|
+
create: {
|
|
801
|
+
method: "POST",
|
|
802
|
+
path: "/orgs/:org/servers/:server_id/database/schemas"
|
|
803
|
+
},
|
|
804
|
+
delete: {
|
|
805
|
+
method: "DELETE",
|
|
806
|
+
path: "/orgs/:org/servers/:server_id/database/schemas/:id"
|
|
807
|
+
}
|
|
808
|
+
},
|
|
809
|
+
databaseUsers: {
|
|
810
|
+
list: {
|
|
811
|
+
method: "GET",
|
|
812
|
+
path: "/orgs/:org/servers/:server_id/database/users"
|
|
813
|
+
},
|
|
814
|
+
get: {
|
|
815
|
+
method: "GET",
|
|
816
|
+
path: "/orgs/:org/servers/:server_id/database/users/:id"
|
|
817
|
+
},
|
|
818
|
+
create: {
|
|
819
|
+
method: "POST",
|
|
820
|
+
path: "/orgs/:org/servers/:server_id/database/users"
|
|
821
|
+
},
|
|
822
|
+
update: {
|
|
823
|
+
method: "PUT",
|
|
824
|
+
path: "/orgs/:org/servers/:server_id/database/users/:id"
|
|
825
|
+
},
|
|
826
|
+
delete: {
|
|
827
|
+
method: "DELETE",
|
|
828
|
+
path: "/orgs/:org/servers/:server_id/database/users/:id"
|
|
829
|
+
}
|
|
830
|
+
},
|
|
831
|
+
daemons: {
|
|
832
|
+
list: {
|
|
833
|
+
method: "GET",
|
|
834
|
+
path: "/orgs/:org/servers/:server_id/background-processes"
|
|
835
|
+
},
|
|
836
|
+
get: {
|
|
837
|
+
method: "GET",
|
|
838
|
+
path: "/orgs/:org/servers/:server_id/background-processes/:id"
|
|
839
|
+
},
|
|
840
|
+
create: {
|
|
841
|
+
method: "POST",
|
|
842
|
+
path: "/orgs/:org/servers/:server_id/background-processes"
|
|
843
|
+
},
|
|
844
|
+
update: {
|
|
845
|
+
method: "PUT",
|
|
846
|
+
path: "/orgs/:org/servers/:server_id/background-processes/:id"
|
|
847
|
+
},
|
|
848
|
+
delete: {
|
|
849
|
+
method: "DELETE",
|
|
850
|
+
path: "/orgs/:org/servers/:server_id/background-processes/:id"
|
|
851
|
+
},
|
|
852
|
+
action: {
|
|
853
|
+
method: "POST",
|
|
854
|
+
path: "/orgs/:org/servers/:server_id/background-processes/:id/actions"
|
|
855
|
+
},
|
|
856
|
+
log: {
|
|
857
|
+
method: "GET",
|
|
858
|
+
path: "/orgs/:org/servers/:server_id/background-processes/:id/log"
|
|
859
|
+
}
|
|
860
|
+
},
|
|
861
|
+
deployments: {
|
|
862
|
+
list: {
|
|
863
|
+
method: "GET",
|
|
864
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/deployments"
|
|
865
|
+
},
|
|
866
|
+
get: {
|
|
867
|
+
method: "GET",
|
|
868
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/deployments/:id"
|
|
869
|
+
},
|
|
870
|
+
create: {
|
|
871
|
+
method: "POST",
|
|
872
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/deployments"
|
|
873
|
+
},
|
|
874
|
+
getLog: {
|
|
875
|
+
method: "GET",
|
|
876
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/deployments/:id/log"
|
|
877
|
+
},
|
|
878
|
+
getScript: {
|
|
879
|
+
method: "GET",
|
|
880
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/deployments/script"
|
|
881
|
+
},
|
|
882
|
+
updateScript: {
|
|
883
|
+
method: "PUT",
|
|
884
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/deployments/script"
|
|
885
|
+
},
|
|
886
|
+
getStatus: {
|
|
887
|
+
method: "GET",
|
|
888
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/deployments/status"
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
certificates: {
|
|
892
|
+
get: {
|
|
893
|
+
method: "GET",
|
|
894
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/domains/:domain_id/certificate"
|
|
895
|
+
},
|
|
896
|
+
create: {
|
|
897
|
+
method: "POST",
|
|
898
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/domains/:domain_id/certificate"
|
|
899
|
+
},
|
|
900
|
+
delete: {
|
|
901
|
+
method: "DELETE",
|
|
902
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/domains/:domain_id/certificate"
|
|
903
|
+
},
|
|
904
|
+
activate: {
|
|
905
|
+
method: "POST",
|
|
906
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/domains/:domain_id/certificate/actions"
|
|
907
|
+
}
|
|
908
|
+
},
|
|
909
|
+
env: {
|
|
910
|
+
get: {
|
|
911
|
+
method: "GET",
|
|
912
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/environment"
|
|
913
|
+
},
|
|
914
|
+
update: {
|
|
915
|
+
method: "PUT",
|
|
916
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/environment"
|
|
917
|
+
}
|
|
918
|
+
},
|
|
919
|
+
nginx: {
|
|
920
|
+
get: {
|
|
921
|
+
method: "GET",
|
|
922
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/nginx"
|
|
923
|
+
},
|
|
924
|
+
update: {
|
|
925
|
+
method: "PUT",
|
|
926
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/nginx"
|
|
927
|
+
}
|
|
928
|
+
},
|
|
929
|
+
nginxTemplates: {
|
|
930
|
+
list: {
|
|
931
|
+
method: "GET",
|
|
932
|
+
path: "/orgs/:org/servers/:server_id/nginx/templates"
|
|
933
|
+
},
|
|
934
|
+
get: {
|
|
935
|
+
method: "GET",
|
|
936
|
+
path: "/orgs/:org/servers/:server_id/nginx/templates/:id"
|
|
937
|
+
},
|
|
938
|
+
create: {
|
|
939
|
+
method: "POST",
|
|
940
|
+
path: "/orgs/:org/servers/:server_id/nginx/templates"
|
|
941
|
+
},
|
|
942
|
+
update: {
|
|
943
|
+
method: "PUT",
|
|
944
|
+
path: "/orgs/:org/servers/:server_id/nginx/templates/:id"
|
|
945
|
+
},
|
|
946
|
+
delete: {
|
|
947
|
+
method: "DELETE",
|
|
948
|
+
path: "/orgs/:org/servers/:server_id/nginx/templates/:id"
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
firewallRules: {
|
|
952
|
+
list: {
|
|
953
|
+
method: "GET",
|
|
954
|
+
path: "/orgs/:org/servers/:server_id/firewall-rules"
|
|
955
|
+
},
|
|
956
|
+
get: {
|
|
957
|
+
method: "GET",
|
|
958
|
+
path: "/orgs/:org/servers/:server_id/firewall-rules/:id"
|
|
959
|
+
},
|
|
960
|
+
create: {
|
|
961
|
+
method: "POST",
|
|
962
|
+
path: "/orgs/:org/servers/:server_id/firewall-rules"
|
|
963
|
+
},
|
|
964
|
+
delete: {
|
|
965
|
+
method: "DELETE",
|
|
966
|
+
path: "/orgs/:org/servers/:server_id/firewall-rules/:id"
|
|
967
|
+
}
|
|
968
|
+
},
|
|
969
|
+
sshKeys: {
|
|
970
|
+
list: {
|
|
971
|
+
method: "GET",
|
|
972
|
+
path: "/orgs/:org/servers/:server_id/ssh-keys"
|
|
973
|
+
},
|
|
974
|
+
get: {
|
|
975
|
+
method: "GET",
|
|
976
|
+
path: "/orgs/:org/servers/:server_id/ssh-keys/:id"
|
|
977
|
+
},
|
|
978
|
+
create: {
|
|
979
|
+
method: "POST",
|
|
980
|
+
path: "/orgs/:org/servers/:server_id/ssh-keys"
|
|
981
|
+
},
|
|
982
|
+
delete: {
|
|
983
|
+
method: "DELETE",
|
|
984
|
+
path: "/orgs/:org/servers/:server_id/ssh-keys/:id"
|
|
985
|
+
}
|
|
986
|
+
},
|
|
987
|
+
securityRules: {
|
|
988
|
+
list: {
|
|
989
|
+
method: "GET",
|
|
990
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/security-rules"
|
|
991
|
+
},
|
|
992
|
+
get: {
|
|
993
|
+
method: "GET",
|
|
994
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/security-rules/:id"
|
|
995
|
+
},
|
|
996
|
+
create: {
|
|
997
|
+
method: "POST",
|
|
998
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/security-rules"
|
|
999
|
+
},
|
|
1000
|
+
update: {
|
|
1001
|
+
method: "PUT",
|
|
1002
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/security-rules/:id"
|
|
1003
|
+
},
|
|
1004
|
+
delete: {
|
|
1005
|
+
method: "DELETE",
|
|
1006
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/security-rules/:id"
|
|
1007
|
+
}
|
|
1008
|
+
},
|
|
1009
|
+
redirectRules: {
|
|
1010
|
+
list: {
|
|
1011
|
+
method: "GET",
|
|
1012
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/redirect-rules"
|
|
1013
|
+
},
|
|
1014
|
+
get: {
|
|
1015
|
+
method: "GET",
|
|
1016
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/redirect-rules/:id"
|
|
1017
|
+
},
|
|
1018
|
+
create: {
|
|
1019
|
+
method: "POST",
|
|
1020
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/redirect-rules"
|
|
1021
|
+
},
|
|
1022
|
+
delete: {
|
|
1023
|
+
method: "DELETE",
|
|
1024
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/redirect-rules/:id"
|
|
1025
|
+
}
|
|
1026
|
+
},
|
|
1027
|
+
monitors: {
|
|
1028
|
+
list: {
|
|
1029
|
+
method: "GET",
|
|
1030
|
+
path: "/orgs/:org/servers/:server_id/monitors"
|
|
1031
|
+
},
|
|
1032
|
+
get: {
|
|
1033
|
+
method: "GET",
|
|
1034
|
+
path: "/orgs/:org/servers/:server_id/monitors/:id"
|
|
1035
|
+
},
|
|
1036
|
+
create: {
|
|
1037
|
+
method: "POST",
|
|
1038
|
+
path: "/orgs/:org/servers/:server_id/monitors"
|
|
1039
|
+
},
|
|
1040
|
+
delete: {
|
|
1041
|
+
method: "DELETE",
|
|
1042
|
+
path: "/orgs/:org/servers/:server_id/monitors/:id"
|
|
1043
|
+
}
|
|
1044
|
+
},
|
|
1045
|
+
recipes: {
|
|
1046
|
+
list: {
|
|
1047
|
+
method: "GET",
|
|
1048
|
+
path: "/orgs/:org/recipes"
|
|
1049
|
+
},
|
|
1050
|
+
get: {
|
|
1051
|
+
method: "GET",
|
|
1052
|
+
path: "/orgs/:org/recipes/:id"
|
|
1053
|
+
},
|
|
1054
|
+
create: {
|
|
1055
|
+
method: "POST",
|
|
1056
|
+
path: "/orgs/:org/recipes"
|
|
1057
|
+
},
|
|
1058
|
+
update: {
|
|
1059
|
+
method: "PUT",
|
|
1060
|
+
path: "/orgs/:org/recipes/:id"
|
|
1061
|
+
},
|
|
1062
|
+
delete: {
|
|
1063
|
+
method: "DELETE",
|
|
1064
|
+
path: "/orgs/:org/recipes/:id"
|
|
1065
|
+
},
|
|
1066
|
+
run: {
|
|
1067
|
+
method: "POST",
|
|
1068
|
+
path: "/orgs/:org/recipes/:id/runs"
|
|
1069
|
+
}
|
|
1070
|
+
},
|
|
1071
|
+
backups: {
|
|
1072
|
+
list: {
|
|
1073
|
+
method: "GET",
|
|
1074
|
+
path: "/orgs/:org/servers/:server_id/database/backups"
|
|
1075
|
+
},
|
|
1076
|
+
get: {
|
|
1077
|
+
method: "GET",
|
|
1078
|
+
path: "/orgs/:org/servers/:server_id/database/backups/:id"
|
|
1079
|
+
},
|
|
1080
|
+
create: {
|
|
1081
|
+
method: "POST",
|
|
1082
|
+
path: "/orgs/:org/servers/:server_id/database/backups"
|
|
1083
|
+
},
|
|
1084
|
+
update: {
|
|
1085
|
+
method: "PUT",
|
|
1086
|
+
path: "/orgs/:org/servers/:server_id/database/backups/:id"
|
|
1087
|
+
},
|
|
1088
|
+
delete: {
|
|
1089
|
+
method: "DELETE",
|
|
1090
|
+
path: "/orgs/:org/servers/:server_id/database/backups/:id"
|
|
1091
|
+
}
|
|
1092
|
+
},
|
|
1093
|
+
commands: {
|
|
1094
|
+
list: {
|
|
1095
|
+
method: "GET",
|
|
1096
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/commands"
|
|
1097
|
+
},
|
|
1098
|
+
get: {
|
|
1099
|
+
method: "GET",
|
|
1100
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/commands/:id"
|
|
1101
|
+
},
|
|
1102
|
+
create: {
|
|
1103
|
+
method: "POST",
|
|
1104
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/commands"
|
|
1105
|
+
},
|
|
1106
|
+
delete: {
|
|
1107
|
+
method: "DELETE",
|
|
1108
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/commands/:id"
|
|
1109
|
+
},
|
|
1110
|
+
getOutput: {
|
|
1111
|
+
method: "GET",
|
|
1112
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/commands/:id/output"
|
|
1113
|
+
}
|
|
1114
|
+
},
|
|
1115
|
+
scheduledJobs: {
|
|
1116
|
+
list: {
|
|
1117
|
+
method: "GET",
|
|
1118
|
+
path: "/orgs/:org/servers/:server_id/scheduled-jobs"
|
|
1119
|
+
},
|
|
1120
|
+
get: {
|
|
1121
|
+
method: "GET",
|
|
1122
|
+
path: "/orgs/:org/servers/:server_id/scheduled-jobs/:id"
|
|
1123
|
+
},
|
|
1124
|
+
create: {
|
|
1125
|
+
method: "POST",
|
|
1126
|
+
path: "/orgs/:org/servers/:server_id/scheduled-jobs"
|
|
1127
|
+
},
|
|
1128
|
+
delete: {
|
|
1129
|
+
method: "DELETE",
|
|
1130
|
+
path: "/orgs/:org/servers/:server_id/scheduled-jobs/:id"
|
|
1131
|
+
},
|
|
1132
|
+
getOutput: {
|
|
1133
|
+
method: "GET",
|
|
1134
|
+
path: "/orgs/:org/servers/:server_id/scheduled-jobs/:id/output"
|
|
1135
|
+
},
|
|
1136
|
+
siteList: {
|
|
1137
|
+
method: "GET",
|
|
1138
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/scheduled-jobs"
|
|
1139
|
+
},
|
|
1140
|
+
siteGet: {
|
|
1141
|
+
method: "GET",
|
|
1142
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/scheduled-jobs/:id"
|
|
1143
|
+
},
|
|
1144
|
+
siteCreate: {
|
|
1145
|
+
method: "POST",
|
|
1146
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/scheduled-jobs"
|
|
1147
|
+
},
|
|
1148
|
+
siteDelete: {
|
|
1149
|
+
method: "DELETE",
|
|
1150
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/scheduled-jobs/:id"
|
|
1151
|
+
},
|
|
1152
|
+
siteGetOutput: {
|
|
1153
|
+
method: "GET",
|
|
1154
|
+
path: "/orgs/:org/servers/:server_id/sites/:site_id/scheduled-jobs/:id/output"
|
|
1155
|
+
}
|
|
1156
|
+
},
|
|
1157
|
+
user: { get: {
|
|
1158
|
+
method: "GET",
|
|
1159
|
+
path: "/user"
|
|
1160
|
+
} }
|
|
1161
|
+
};
|
|
1162
|
+
/**
|
|
1163
|
+
* Build a URL from a route definition, replacing `:param` placeholders.
|
|
1164
|
+
*
|
|
1165
|
+
* Auto-injects `:org` from `ctx.organizationSlug`.
|
|
1166
|
+
* Throws on missing required params.
|
|
1167
|
+
*/
|
|
1168
|
+
function buildUrl(route, ctx, params = {}, query) {
|
|
1169
|
+
const allParams = {
|
|
1170
|
+
...ctx.organizationSlug ? { org: ctx.organizationSlug } : {},
|
|
1171
|
+
...params
|
|
1172
|
+
};
|
|
1173
|
+
let url = route.path;
|
|
1174
|
+
const missing = [];
|
|
1175
|
+
url = url.replaceAll(/:(\w+)/g, (_, key) => {
|
|
1176
|
+
const value = allParams[key];
|
|
1177
|
+
if (value === void 0) {
|
|
1178
|
+
missing.push(key);
|
|
1179
|
+
return `:${key}`;
|
|
1180
|
+
}
|
|
1181
|
+
return String(value);
|
|
1182
|
+
});
|
|
1183
|
+
if (missing.length > 0) throw new Error(`Missing route params: ${missing.join(", ")}`);
|
|
1184
|
+
if (query) {
|
|
1185
|
+
const qs = new URLSearchParams(query).toString();
|
|
1186
|
+
if (qs) url += `?${qs}`;
|
|
1187
|
+
}
|
|
1188
|
+
return url;
|
|
1189
|
+
}
|
|
1190
|
+
async function request(route, ctx, params = {}, options) {
|
|
1191
|
+
const url = buildUrl(route, ctx, params, options?.query);
|
|
1192
|
+
const client = ctx.client;
|
|
1193
|
+
let response;
|
|
1194
|
+
switch (route.method) {
|
|
1195
|
+
case "GET":
|
|
1196
|
+
response = await client.get(url);
|
|
1197
|
+
break;
|
|
1198
|
+
case "POST":
|
|
1199
|
+
response = await client.post(url, options?.body);
|
|
1200
|
+
break;
|
|
1201
|
+
case "PUT":
|
|
1202
|
+
response = await client.put(url, options?.body);
|
|
1203
|
+
break;
|
|
1204
|
+
case "PATCH":
|
|
1205
|
+
response = await client.patch(url, options?.body);
|
|
1206
|
+
break;
|
|
1207
|
+
case "DELETE":
|
|
1208
|
+
response = await client.delete(url);
|
|
1209
|
+
break;
|
|
1210
|
+
}
|
|
1211
|
+
if (options?.schema) return parse(options.schema, response);
|
|
1212
|
+
return response;
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
666
1215
|
* Create a new server.
|
|
667
1216
|
*/
|
|
668
1217
|
async function createServer(options, ctx) {
|
|
669
|
-
return { data: (await
|
|
1218
|
+
return { data: unwrapDocument(await request(ROUTES.servers.create, ctx, {}, {
|
|
1219
|
+
body: options,
|
|
1220
|
+
schema: jsonApiDocumentSchema(ServerAttributesSchema)
|
|
1221
|
+
})) };
|
|
670
1222
|
}
|
|
671
1223
|
/**
|
|
672
1224
|
* Delete a server.
|
|
673
1225
|
*/
|
|
674
1226
|
async function deleteServer(options, ctx) {
|
|
675
|
-
await
|
|
1227
|
+
await request(ROUTES.servers.delete, ctx, { server_id: options.server_id });
|
|
676
1228
|
return { data: void 0 };
|
|
677
1229
|
}
|
|
678
1230
|
/**
|
|
679
1231
|
* Get a specific server by ID.
|
|
680
1232
|
*/
|
|
681
1233
|
async function getServer(options, ctx) {
|
|
682
|
-
return { data: (await
|
|
1234
|
+
return { data: unwrapDocument(await request(ROUTES.servers.get, ctx, { server_id: options.server_id }, { schema: jsonApiDocumentSchema(ServerAttributesSchema) })) };
|
|
683
1235
|
}
|
|
684
1236
|
/**
|
|
685
1237
|
* List all servers.
|
|
686
1238
|
*/
|
|
687
1239
|
async function listServers(_options, ctx) {
|
|
688
|
-
return { data: (await
|
|
1240
|
+
return { data: unwrapListDocument(await request(ROUTES.servers.list, ctx, {}, { schema: jsonApiListDocumentSchema(ServerAttributesSchema) })) };
|
|
689
1241
|
}
|
|
690
1242
|
/**
|
|
691
1243
|
* Reboot a server.
|
|
692
1244
|
*/
|
|
693
1245
|
async function rebootServer(options, ctx) {
|
|
694
|
-
await
|
|
1246
|
+
await request(ROUTES.servers.reboot, ctx, { server_id: options.server_id }, { body: { action: "reboot" } });
|
|
695
1247
|
return { data: void 0 };
|
|
696
1248
|
}
|
|
697
1249
|
/**
|
|
@@ -701,8 +1253,7 @@ async function rebootServer(options, ctx) {
|
|
|
701
1253
|
* Otherwise all partial matches are returned.
|
|
702
1254
|
*/
|
|
703
1255
|
async function resolveServers(options, ctx) {
|
|
704
|
-
const
|
|
705
|
-
const match = matchByName(servers, options.query, (s) => s.name);
|
|
1256
|
+
const match = matchByName(unwrapListDocument(await request(ROUTES.servers.list, ctx, {}, { schema: jsonApiListDocumentSchema(ServerAttributesSchema) })), options.query, (s) => s.name);
|
|
706
1257
|
const matches = match.exact.length === 1 ? match.exact : match.partial;
|
|
707
1258
|
return { data: {
|
|
708
1259
|
query: options.query,
|
|
@@ -718,36 +1269,41 @@ async function resolveServers(options, ctx) {
|
|
|
718
1269
|
*/
|
|
719
1270
|
async function createSite(options, ctx) {
|
|
720
1271
|
const { server_id, ...data } = options;
|
|
721
|
-
return { data: (await
|
|
1272
|
+
return { data: unwrapDocument(await request(ROUTES.sites.create, ctx, { server_id }, {
|
|
1273
|
+
body: data,
|
|
1274
|
+
schema: jsonApiDocumentSchema(SiteAttributesSchema)
|
|
1275
|
+
})) };
|
|
722
1276
|
}
|
|
723
1277
|
/**
|
|
724
1278
|
* Delete a site.
|
|
725
1279
|
*/
|
|
726
1280
|
async function deleteSite(options, ctx) {
|
|
727
|
-
await
|
|
1281
|
+
await request(ROUTES.sites.delete, ctx, {
|
|
1282
|
+
server_id: options.server_id,
|
|
1283
|
+
site_id: options.site_id
|
|
1284
|
+
});
|
|
728
1285
|
return { data: void 0 };
|
|
729
1286
|
}
|
|
730
1287
|
/**
|
|
731
1288
|
* Get a specific site by ID.
|
|
1289
|
+
*
|
|
1290
|
+
* Uses the org-scoped path `/orgs/{slug}/sites/{siteId}` — the v2 API
|
|
1291
|
+
* does not support GET on the server-scoped site path.
|
|
732
1292
|
*/
|
|
733
1293
|
async function getSite(options, ctx) {
|
|
734
|
-
return { data: (await
|
|
1294
|
+
return { data: unwrapDocument(await request(ROUTES.sites.get, ctx, { site_id: options.site_id }, { schema: jsonApiDocumentSchema(SiteAttributesSchema) })) };
|
|
735
1295
|
}
|
|
736
1296
|
/**
|
|
737
1297
|
* List all sites on a server.
|
|
738
1298
|
*/
|
|
739
1299
|
async function listSites(options, ctx) {
|
|
740
|
-
return { data: (await
|
|
1300
|
+
return { data: unwrapListDocument(await request(ROUTES.sites.list, ctx, { server_id: options.server_id }, { schema: jsonApiListDocumentSchema(SiteAttributesSchema) })) };
|
|
741
1301
|
}
|
|
742
1302
|
/**
|
|
743
1303
|
* Resolve sites by domain name — partial, case-insensitive match.
|
|
744
|
-
*
|
|
745
|
-
* If exactly one site matches the query exactly, it is returned as a single result.
|
|
746
|
-
* Otherwise all partial matches are returned.
|
|
747
1304
|
*/
|
|
748
1305
|
async function resolveSites(options, ctx) {
|
|
749
|
-
const
|
|
750
|
-
const match = matchByName(sites, options.query, (s) => s.name);
|
|
1306
|
+
const match = matchByName(unwrapListDocument(await request(ROUTES.sites.list, ctx, { server_id: options.server_id }, { schema: jsonApiListDocumentSchema(SiteAttributesSchema) })), options.query, (s) => s.name);
|
|
751
1307
|
const matches = match.exact.length === 1 ? match.exact : match.partial;
|
|
752
1308
|
return { data: {
|
|
753
1309
|
query: options.query,
|
|
@@ -759,26 +1315,49 @@ async function resolveSites(options, ctx) {
|
|
|
759
1315
|
} };
|
|
760
1316
|
}
|
|
761
1317
|
/**
|
|
1318
|
+
* Update an existing site on a server.
|
|
1319
|
+
*/
|
|
1320
|
+
async function updateSite(options, ctx) {
|
|
1321
|
+
const { server_id, site_id, ...data } = options;
|
|
1322
|
+
return { data: unwrapDocument(await request(ROUTES.sites.update, ctx, {
|
|
1323
|
+
server_id,
|
|
1324
|
+
site_id
|
|
1325
|
+
}, {
|
|
1326
|
+
body: data,
|
|
1327
|
+
schema: jsonApiDocumentSchema(SiteAttributesSchema)
|
|
1328
|
+
})) };
|
|
1329
|
+
}
|
|
1330
|
+
/**
|
|
762
1331
|
* Trigger a deployment for a site.
|
|
763
1332
|
*/
|
|
764
1333
|
async function deploySite(options, ctx) {
|
|
765
|
-
await
|
|
1334
|
+
await request(ROUTES.deployments.create, ctx, {
|
|
1335
|
+
server_id: options.server_id,
|
|
1336
|
+
site_id: options.site_id
|
|
1337
|
+
}, { body: {} });
|
|
766
1338
|
return { data: void 0 };
|
|
767
1339
|
}
|
|
768
1340
|
/**
|
|
769
|
-
* Trigger a deployment and wait for it to complete.
|
|
1341
|
+
* Trigger a deployment and wait for it to complete, streaming logs in real time.
|
|
770
1342
|
*
|
|
771
1343
|
* 1. POSTs to the deploy endpoint.
|
|
772
|
-
* 2. Polls
|
|
773
|
-
* 3.
|
|
774
|
-
* 4.
|
|
775
|
-
* 5.
|
|
1344
|
+
* 2. Polls deployment status every `poll_interval_ms` ms.
|
|
1345
|
+
* 3. On each poll, fetches the latest deployment log and emits new content via `onLog`.
|
|
1346
|
+
* 4. When status becomes null/idle the deploy is done.
|
|
1347
|
+
* 5. Fetches the final deployment log to emit any remaining content.
|
|
1348
|
+
* 6. Checks the most recent deployment to determine success/failure.
|
|
776
1349
|
*/
|
|
777
1350
|
async function deploySiteAndWait(options, ctx) {
|
|
778
|
-
const { server_id, site_id, poll_interval_ms = 3e3, timeout_ms = 6e5, onProgress } = options;
|
|
779
|
-
const
|
|
780
|
-
|
|
1351
|
+
const { server_id, site_id, poll_interval_ms = 3e3, timeout_ms = 6e5, onProgress, onLog } = options;
|
|
1352
|
+
const deploymentId = unwrapDocument(await request(ROUTES.deployments.create, ctx, {
|
|
1353
|
+
server_id,
|
|
1354
|
+
site_id
|
|
1355
|
+
}, {
|
|
1356
|
+
body: {},
|
|
1357
|
+
schema: jsonApiDocumentSchema(DeploymentAttributesSchema)
|
|
1358
|
+
})).id;
|
|
781
1359
|
const startTime = Date.now();
|
|
1360
|
+
let logOffset = 0;
|
|
782
1361
|
await new Promise((resolve) => {
|
|
783
1362
|
const tick = async () => {
|
|
784
1363
|
const elapsed_ms = Date.now() - startTime;
|
|
@@ -786,30 +1365,64 @@ async function deploySiteAndWait(options, ctx) {
|
|
|
786
1365
|
resolve();
|
|
787
1366
|
return;
|
|
788
1367
|
}
|
|
789
|
-
|
|
1368
|
+
let currentStatus = null;
|
|
1369
|
+
try {
|
|
1370
|
+
currentStatus = unwrapDocument(await request(ROUTES.deployments.get, ctx, {
|
|
1371
|
+
server_id,
|
|
1372
|
+
site_id,
|
|
1373
|
+
id: deploymentId
|
|
1374
|
+
}, { schema: jsonApiDocumentSchema(DeploymentAttributesSchema) })).status;
|
|
1375
|
+
} catch {
|
|
1376
|
+
currentStatus = null;
|
|
1377
|
+
}
|
|
790
1378
|
if (onProgress) onProgress({
|
|
791
1379
|
status: currentStatus ?? "done",
|
|
792
1380
|
elapsed_ms
|
|
793
1381
|
});
|
|
794
|
-
if (
|
|
1382
|
+
if (onLog) try {
|
|
1383
|
+
const logData = unwrapDocument(await request(ROUTES.deployments.getLog, ctx, {
|
|
1384
|
+
server_id,
|
|
1385
|
+
site_id,
|
|
1386
|
+
id: deploymentId
|
|
1387
|
+
}, { schema: jsonApiDocumentSchema(DeploymentOutputAttributesSchema) }));
|
|
1388
|
+
if (logData.output && logData.output.length > logOffset) {
|
|
1389
|
+
onLog(logData.output.slice(logOffset));
|
|
1390
|
+
logOffset = logData.output.length;
|
|
1391
|
+
}
|
|
1392
|
+
} catch {}
|
|
1393
|
+
if (currentStatus === null || [
|
|
1394
|
+
"finished",
|
|
1395
|
+
"failed",
|
|
1396
|
+
"failed-build"
|
|
1397
|
+
].includes(currentStatus)) {
|
|
795
1398
|
resolve();
|
|
796
1399
|
return;
|
|
797
1400
|
}
|
|
798
|
-
await new Promise((r) =>
|
|
1401
|
+
await new Promise((r) => {
|
|
1402
|
+
setTimeout(r, poll_interval_ms);
|
|
1403
|
+
});
|
|
799
1404
|
await tick();
|
|
800
1405
|
};
|
|
801
1406
|
tick().catch(() => resolve());
|
|
802
1407
|
});
|
|
803
1408
|
const elapsed_ms = Date.now() - startTime;
|
|
804
1409
|
let log = "";
|
|
805
|
-
try {
|
|
806
|
-
log = await ctx.client.get(`${baseUrl}/deployment/log`);
|
|
807
|
-
} catch {}
|
|
808
1410
|
let deployStatus = "failed";
|
|
809
1411
|
try {
|
|
810
|
-
|
|
811
|
-
|
|
1412
|
+
deployStatus = unwrapDocument(await request(ROUTES.deployments.get, ctx, {
|
|
1413
|
+
server_id,
|
|
1414
|
+
site_id,
|
|
1415
|
+
id: deploymentId
|
|
1416
|
+
}, { schema: jsonApiDocumentSchema(DeploymentAttributesSchema) })).status === "finished" ? "success" : "failed";
|
|
1417
|
+
try {
|
|
1418
|
+
log = unwrapDocument(await request(ROUTES.deployments.getLog, ctx, {
|
|
1419
|
+
server_id,
|
|
1420
|
+
site_id,
|
|
1421
|
+
id: deploymentId
|
|
1422
|
+
}, { schema: jsonApiDocumentSchema(DeploymentOutputAttributesSchema) })).output ?? "";
|
|
1423
|
+
} catch {}
|
|
812
1424
|
} catch {}
|
|
1425
|
+
if (onLog && log.length > logOffset) onLog(log.slice(logOffset));
|
|
813
1426
|
if (elapsed_ms >= timeout_ms) deployStatus = "failed";
|
|
814
1427
|
return { data: {
|
|
815
1428
|
status: deployStatus,
|
|
@@ -821,361 +1434,686 @@ async function deploySiteAndWait(options, ctx) {
|
|
|
821
1434
|
* Get the deployment log for a site.
|
|
822
1435
|
*/
|
|
823
1436
|
async function getDeploymentLog(options, ctx) {
|
|
824
|
-
return { data: await
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
async function getDeploymentOutput(options, ctx) {
|
|
830
|
-
return { data: await ctx.client.get(`/servers/${options.server_id}/sites/${options.site_id}/deployments/${options.deployment_id}/output`) };
|
|
1437
|
+
return { data: unwrapDocument(await request(ROUTES.deployments.getLog, ctx, {
|
|
1438
|
+
server_id: options.server_id,
|
|
1439
|
+
site_id: options.site_id,
|
|
1440
|
+
id: options.deployment_id
|
|
1441
|
+
}, { schema: jsonApiDocumentSchema(DeploymentOutputAttributesSchema) })).output };
|
|
831
1442
|
}
|
|
832
1443
|
/**
|
|
833
1444
|
* Get the deployment script for a site.
|
|
834
1445
|
*/
|
|
835
1446
|
async function getDeploymentScript(options, ctx) {
|
|
836
|
-
return { data: await
|
|
1447
|
+
return { data: unwrapDocument(await request(ROUTES.deployments.getScript, ctx, {
|
|
1448
|
+
server_id: options.server_id,
|
|
1449
|
+
site_id: options.site_id
|
|
1450
|
+
}, { schema: jsonApiDocumentSchema(DeploymentScriptAttributesSchema) })).content };
|
|
837
1451
|
}
|
|
838
1452
|
/**
|
|
839
1453
|
* List all deployments for a site.
|
|
840
1454
|
*/
|
|
841
1455
|
async function listDeployments(options, ctx) {
|
|
842
|
-
return { data: (await
|
|
1456
|
+
return { data: unwrapListDocument(await request(ROUTES.deployments.list, ctx, {
|
|
1457
|
+
server_id: options.server_id,
|
|
1458
|
+
site_id: options.site_id
|
|
1459
|
+
}, {
|
|
1460
|
+
query: { sort: "-created_at" },
|
|
1461
|
+
schema: jsonApiListDocumentSchema(DeploymentAttributesSchema)
|
|
1462
|
+
})) };
|
|
843
1463
|
}
|
|
844
1464
|
/**
|
|
845
1465
|
* Update the deployment script for a site.
|
|
846
1466
|
*/
|
|
847
1467
|
async function updateDeploymentScript(options, ctx) {
|
|
848
|
-
await
|
|
1468
|
+
await request(ROUTES.deployments.updateScript, ctx, {
|
|
1469
|
+
server_id: options.server_id,
|
|
1470
|
+
site_id: options.site_id
|
|
1471
|
+
}, { body: { content: options.content } });
|
|
849
1472
|
return { data: void 0 };
|
|
850
1473
|
}
|
|
851
1474
|
/**
|
|
852
|
-
* Activate
|
|
1475
|
+
* Activate the SSL certificate for a domain.
|
|
853
1476
|
*/
|
|
854
1477
|
async function activateCertificate(options, ctx) {
|
|
855
|
-
await
|
|
1478
|
+
await request(ROUTES.certificates.activate, ctx, {
|
|
1479
|
+
server_id: options.server_id,
|
|
1480
|
+
site_id: options.site_id,
|
|
1481
|
+
domain_id: options.domain_id
|
|
1482
|
+
}, { body: { action: "activate" } });
|
|
856
1483
|
return { data: void 0 };
|
|
857
1484
|
}
|
|
858
1485
|
/**
|
|
859
|
-
* Create
|
|
1486
|
+
* Create an SSL certificate for a domain.
|
|
860
1487
|
*/
|
|
861
1488
|
async function createCertificate(options, ctx) {
|
|
862
|
-
const { server_id, site_id, ...data } = options;
|
|
863
|
-
return { data: (await
|
|
1489
|
+
const { server_id, site_id, domain_id, ...data } = options;
|
|
1490
|
+
return { data: unwrapDocument(await request(ROUTES.certificates.create, ctx, {
|
|
1491
|
+
server_id,
|
|
1492
|
+
site_id,
|
|
1493
|
+
domain_id
|
|
1494
|
+
}, {
|
|
1495
|
+
body: data,
|
|
1496
|
+
schema: jsonApiDocumentSchema(CertificateAttributesSchema)
|
|
1497
|
+
})) };
|
|
864
1498
|
}
|
|
865
1499
|
/**
|
|
866
|
-
* Delete
|
|
1500
|
+
* Delete the SSL certificate for a domain.
|
|
867
1501
|
*/
|
|
868
1502
|
async function deleteCertificate(options, ctx) {
|
|
869
|
-
await
|
|
1503
|
+
await request(ROUTES.certificates.delete, ctx, {
|
|
1504
|
+
server_id: options.server_id,
|
|
1505
|
+
site_id: options.site_id,
|
|
1506
|
+
domain_id: options.domain_id
|
|
1507
|
+
});
|
|
870
1508
|
return { data: void 0 };
|
|
871
1509
|
}
|
|
872
1510
|
/**
|
|
873
|
-
* Get
|
|
1511
|
+
* Get the SSL certificate for a domain.
|
|
874
1512
|
*/
|
|
875
1513
|
async function getCertificate(options, ctx) {
|
|
876
|
-
return { data: (await
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
async function listCertificates(options, ctx) {
|
|
882
|
-
return { data: (await ctx.client.get(`/servers/${options.server_id}/sites/${options.site_id}/certificates`)).certificates };
|
|
1514
|
+
return { data: unwrapDocument(await request(ROUTES.certificates.get, ctx, {
|
|
1515
|
+
server_id: options.server_id,
|
|
1516
|
+
site_id: options.site_id,
|
|
1517
|
+
domain_id: options.domain_id
|
|
1518
|
+
}, { schema: jsonApiDocumentSchema(CertificateAttributesSchema) })) };
|
|
883
1519
|
}
|
|
884
1520
|
/**
|
|
885
1521
|
* Create a new database.
|
|
886
1522
|
*/
|
|
887
1523
|
async function createDatabase(options, ctx) {
|
|
888
1524
|
const { server_id, ...data } = options;
|
|
889
|
-
return { data: (await
|
|
1525
|
+
return { data: unwrapDocument(await request(ROUTES.databases.create, ctx, { server_id }, {
|
|
1526
|
+
body: data,
|
|
1527
|
+
schema: jsonApiDocumentSchema(DatabaseAttributesSchema)
|
|
1528
|
+
})) };
|
|
890
1529
|
}
|
|
891
1530
|
/**
|
|
892
1531
|
* Delete a database.
|
|
893
1532
|
*/
|
|
894
1533
|
async function deleteDatabase(options, ctx) {
|
|
895
|
-
await
|
|
1534
|
+
await request(ROUTES.databases.delete, ctx, {
|
|
1535
|
+
server_id: options.server_id,
|
|
1536
|
+
id: options.id
|
|
1537
|
+
});
|
|
896
1538
|
return { data: void 0 };
|
|
897
1539
|
}
|
|
898
1540
|
/**
|
|
899
1541
|
* Get a single database.
|
|
900
1542
|
*/
|
|
901
1543
|
async function getDatabase(options, ctx) {
|
|
902
|
-
return { data: (await
|
|
1544
|
+
return { data: unwrapDocument(await request(ROUTES.databases.get, ctx, {
|
|
1545
|
+
server_id: options.server_id,
|
|
1546
|
+
id: options.id
|
|
1547
|
+
}, { schema: jsonApiDocumentSchema(DatabaseAttributesSchema) })) };
|
|
903
1548
|
}
|
|
904
1549
|
/**
|
|
905
1550
|
* List databases on a server.
|
|
906
1551
|
*/
|
|
907
1552
|
async function listDatabases(options, ctx) {
|
|
908
|
-
return { data: (await
|
|
1553
|
+
return { data: unwrapListDocument(await request(ROUTES.databases.list, ctx, { server_id: options.server_id }, { schema: jsonApiListDocumentSchema(DatabaseAttributesSchema) })) };
|
|
909
1554
|
}
|
|
910
1555
|
/**
|
|
911
1556
|
* Create a new database user.
|
|
912
1557
|
*/
|
|
913
1558
|
async function createDatabaseUser(options, ctx) {
|
|
914
1559
|
const { server_id, ...data } = options;
|
|
915
|
-
return { data: (await
|
|
1560
|
+
return { data: unwrapDocument(await request(ROUTES.databaseUsers.create, ctx, { server_id }, {
|
|
1561
|
+
body: data,
|
|
1562
|
+
schema: jsonApiDocumentSchema(DatabaseUserAttributesSchema)
|
|
1563
|
+
})) };
|
|
916
1564
|
}
|
|
917
1565
|
/**
|
|
918
1566
|
* Delete a database user.
|
|
919
1567
|
*/
|
|
920
1568
|
async function deleteDatabaseUser(options, ctx) {
|
|
921
|
-
await
|
|
1569
|
+
await request(ROUTES.databaseUsers.delete, ctx, {
|
|
1570
|
+
server_id: options.server_id,
|
|
1571
|
+
id: options.id
|
|
1572
|
+
});
|
|
922
1573
|
return { data: void 0 };
|
|
923
1574
|
}
|
|
924
1575
|
/**
|
|
925
1576
|
* Get a single database user.
|
|
926
1577
|
*/
|
|
927
1578
|
async function getDatabaseUser(options, ctx) {
|
|
928
|
-
return { data: (await
|
|
1579
|
+
return { data: unwrapDocument(await request(ROUTES.databaseUsers.get, ctx, {
|
|
1580
|
+
server_id: options.server_id,
|
|
1581
|
+
id: options.id
|
|
1582
|
+
}, { schema: jsonApiDocumentSchema(DatabaseUserAttributesSchema) })) };
|
|
929
1583
|
}
|
|
930
1584
|
/**
|
|
931
1585
|
* List database users on a server.
|
|
932
1586
|
*/
|
|
933
1587
|
async function listDatabaseUsers(options, ctx) {
|
|
934
|
-
return { data: (await
|
|
1588
|
+
return { data: unwrapListDocument(await request(ROUTES.databaseUsers.list, ctx, { server_id: options.server_id }, { schema: jsonApiListDocumentSchema(DatabaseUserAttributesSchema) })) };
|
|
935
1589
|
}
|
|
936
1590
|
/**
|
|
937
|
-
*
|
|
1591
|
+
* Update an existing database user.
|
|
1592
|
+
*/
|
|
1593
|
+
async function updateDatabaseUser(options, ctx) {
|
|
1594
|
+
const { server_id, id, ...data } = options;
|
|
1595
|
+
return { data: unwrapDocument(await request(ROUTES.databaseUsers.update, ctx, {
|
|
1596
|
+
server_id,
|
|
1597
|
+
id
|
|
1598
|
+
}, {
|
|
1599
|
+
body: data,
|
|
1600
|
+
schema: jsonApiDocumentSchema(DatabaseUserAttributesSchema)
|
|
1601
|
+
})) };
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* Create a new daemon.
|
|
938
1605
|
*/
|
|
939
1606
|
async function createDaemon(options, ctx) {
|
|
940
1607
|
const { server_id, ...data } = options;
|
|
941
|
-
return { data: (await
|
|
1608
|
+
return { data: unwrapDocument(await request(ROUTES.daemons.create, ctx, { server_id }, {
|
|
1609
|
+
body: data,
|
|
1610
|
+
schema: jsonApiDocumentSchema(BackgroundProcessAttributesSchema)
|
|
1611
|
+
})) };
|
|
942
1612
|
}
|
|
943
1613
|
/**
|
|
944
1614
|
* Delete a daemon.
|
|
945
1615
|
*/
|
|
946
1616
|
async function deleteDaemon(options, ctx) {
|
|
947
|
-
await
|
|
1617
|
+
await request(ROUTES.daemons.delete, ctx, {
|
|
1618
|
+
server_id: options.server_id,
|
|
1619
|
+
id: options.id
|
|
1620
|
+
});
|
|
948
1621
|
return { data: void 0 };
|
|
949
1622
|
}
|
|
950
1623
|
/**
|
|
951
1624
|
* Get a single daemon.
|
|
952
1625
|
*/
|
|
953
1626
|
async function getDaemon(options, ctx) {
|
|
954
|
-
return { data: (await
|
|
1627
|
+
return { data: unwrapDocument(await request(ROUTES.daemons.get, ctx, {
|
|
1628
|
+
server_id: options.server_id,
|
|
1629
|
+
id: options.id
|
|
1630
|
+
}, { schema: jsonApiDocumentSchema(BackgroundProcessAttributesSchema) })) };
|
|
955
1631
|
}
|
|
956
1632
|
/**
|
|
957
|
-
* List daemons
|
|
1633
|
+
* List daemons on a server.
|
|
958
1634
|
*/
|
|
959
1635
|
async function listDaemons(options, ctx) {
|
|
960
|
-
return { data: (await
|
|
1636
|
+
return { data: unwrapListDocument(await request(ROUTES.daemons.list, ctx, { server_id: options.server_id }, { schema: jsonApiListDocumentSchema(BackgroundProcessAttributesSchema) })) };
|
|
961
1637
|
}
|
|
962
1638
|
/**
|
|
963
1639
|
* Restart a daemon.
|
|
964
1640
|
*/
|
|
965
1641
|
async function restartDaemon(options, ctx) {
|
|
966
|
-
await
|
|
1642
|
+
await request(ROUTES.daemons.action, ctx, {
|
|
1643
|
+
server_id: options.server_id,
|
|
1644
|
+
id: options.id
|
|
1645
|
+
}, { body: { action: "restart" } });
|
|
967
1646
|
return { data: void 0 };
|
|
968
1647
|
}
|
|
1648
|
+
/**
|
|
1649
|
+
* Update an existing daemon.
|
|
1650
|
+
*/
|
|
1651
|
+
async function updateDaemon(options, ctx) {
|
|
1652
|
+
const { server_id, id, ...data } = options;
|
|
1653
|
+
return { data: unwrapDocument(await request(ROUTES.daemons.update, ctx, {
|
|
1654
|
+
server_id,
|
|
1655
|
+
id
|
|
1656
|
+
}, {
|
|
1657
|
+
body: data,
|
|
1658
|
+
schema: jsonApiDocumentSchema(BackgroundProcessAttributesSchema)
|
|
1659
|
+
})) };
|
|
1660
|
+
}
|
|
1661
|
+
/**
|
|
1662
|
+
* Create a firewall rule.
|
|
1663
|
+
*/
|
|
969
1664
|
async function createFirewallRule(options, ctx) {
|
|
970
1665
|
const { server_id, ...data } = options;
|
|
971
|
-
|
|
1666
|
+
await request(ROUTES.firewallRules.create, ctx, { server_id }, { body: data });
|
|
1667
|
+
return { data: void 0 };
|
|
972
1668
|
}
|
|
1669
|
+
/**
|
|
1670
|
+
* Delete a firewall rule.
|
|
1671
|
+
*/
|
|
973
1672
|
async function deleteFirewallRule(options, ctx) {
|
|
974
|
-
await
|
|
1673
|
+
await request(ROUTES.firewallRules.delete, ctx, {
|
|
1674
|
+
server_id: options.server_id,
|
|
1675
|
+
id: options.id
|
|
1676
|
+
});
|
|
975
1677
|
return { data: void 0 };
|
|
976
1678
|
}
|
|
1679
|
+
/**
|
|
1680
|
+
* Get a single firewall rule.
|
|
1681
|
+
*/
|
|
977
1682
|
async function getFirewallRule(options, ctx) {
|
|
978
|
-
return { data: (await
|
|
1683
|
+
return { data: unwrapDocument(await request(ROUTES.firewallRules.get, ctx, {
|
|
1684
|
+
server_id: options.server_id,
|
|
1685
|
+
id: options.id
|
|
1686
|
+
}, { schema: jsonApiDocumentSchema(FirewallRuleAttributesSchema) })) };
|
|
979
1687
|
}
|
|
1688
|
+
/**
|
|
1689
|
+
* List firewall rules on a server.
|
|
1690
|
+
*/
|
|
980
1691
|
async function listFirewallRules(options, ctx) {
|
|
981
|
-
return { data: (await
|
|
1692
|
+
return { data: unwrapListDocument(await request(ROUTES.firewallRules.list, ctx, { server_id: options.server_id }, { schema: jsonApiListDocumentSchema(FirewallRuleAttributesSchema) })) };
|
|
982
1693
|
}
|
|
1694
|
+
/**
|
|
1695
|
+
* Create an SSH key.
|
|
1696
|
+
*/
|
|
983
1697
|
async function createSshKey(options, ctx) {
|
|
984
1698
|
const { server_id, ...data } = options;
|
|
985
|
-
|
|
1699
|
+
await request(ROUTES.sshKeys.create, ctx, { server_id }, { body: data });
|
|
1700
|
+
return { data: void 0 };
|
|
986
1701
|
}
|
|
1702
|
+
/**
|
|
1703
|
+
* Delete an SSH key.
|
|
1704
|
+
*/
|
|
987
1705
|
async function deleteSshKey(options, ctx) {
|
|
988
|
-
await
|
|
1706
|
+
await request(ROUTES.sshKeys.delete, ctx, {
|
|
1707
|
+
server_id: options.server_id,
|
|
1708
|
+
id: options.id
|
|
1709
|
+
});
|
|
989
1710
|
return { data: void 0 };
|
|
990
1711
|
}
|
|
1712
|
+
/**
|
|
1713
|
+
* Get a single SSH key.
|
|
1714
|
+
*/
|
|
991
1715
|
async function getSshKey(options, ctx) {
|
|
992
|
-
return { data: (await
|
|
1716
|
+
return { data: unwrapDocument(await request(ROUTES.sshKeys.get, ctx, {
|
|
1717
|
+
server_id: options.server_id,
|
|
1718
|
+
id: options.id
|
|
1719
|
+
}, { schema: jsonApiDocumentSchema(SshKeyAttributesSchema) })) };
|
|
993
1720
|
}
|
|
1721
|
+
/**
|
|
1722
|
+
* List SSH keys on a server.
|
|
1723
|
+
*/
|
|
994
1724
|
async function listSshKeys(options, ctx) {
|
|
995
|
-
return { data: (await
|
|
1725
|
+
return { data: unwrapListDocument(await request(ROUTES.sshKeys.list, ctx, { server_id: options.server_id }, { schema: jsonApiListDocumentSchema(SshKeyAttributesSchema) })) };
|
|
996
1726
|
}
|
|
1727
|
+
/**
|
|
1728
|
+
* Create a security rule.
|
|
1729
|
+
*/
|
|
997
1730
|
async function createSecurityRule(options, ctx) {
|
|
998
1731
|
const { server_id, site_id, ...data } = options;
|
|
999
|
-
return { data: (await
|
|
1732
|
+
return { data: unwrapDocument(await request(ROUTES.securityRules.create, ctx, {
|
|
1733
|
+
server_id,
|
|
1734
|
+
site_id
|
|
1735
|
+
}, {
|
|
1736
|
+
body: data,
|
|
1737
|
+
schema: jsonApiDocumentSchema(SecurityRuleAttributesSchema)
|
|
1738
|
+
})) };
|
|
1000
1739
|
}
|
|
1740
|
+
/**
|
|
1741
|
+
* Delete a security rule.
|
|
1742
|
+
*/
|
|
1001
1743
|
async function deleteSecurityRule(options, ctx) {
|
|
1002
|
-
await
|
|
1744
|
+
await request(ROUTES.securityRules.delete, ctx, {
|
|
1745
|
+
server_id: options.server_id,
|
|
1746
|
+
site_id: options.site_id,
|
|
1747
|
+
id: options.id
|
|
1748
|
+
});
|
|
1003
1749
|
return { data: void 0 };
|
|
1004
1750
|
}
|
|
1751
|
+
/**
|
|
1752
|
+
* Get a single security rule.
|
|
1753
|
+
*/
|
|
1005
1754
|
async function getSecurityRule(options, ctx) {
|
|
1006
|
-
return { data: (await
|
|
1755
|
+
return { data: unwrapDocument(await request(ROUTES.securityRules.get, ctx, {
|
|
1756
|
+
server_id: options.server_id,
|
|
1757
|
+
site_id: options.site_id,
|
|
1758
|
+
id: options.id
|
|
1759
|
+
}, { schema: jsonApiDocumentSchema(SecurityRuleAttributesSchema) })) };
|
|
1007
1760
|
}
|
|
1761
|
+
/**
|
|
1762
|
+
* List security rules for a site.
|
|
1763
|
+
*/
|
|
1008
1764
|
async function listSecurityRules(options, ctx) {
|
|
1009
|
-
return { data: (await
|
|
1765
|
+
return { data: unwrapListDocument(await request(ROUTES.securityRules.list, ctx, {
|
|
1766
|
+
server_id: options.server_id,
|
|
1767
|
+
site_id: options.site_id
|
|
1768
|
+
}, { schema: jsonApiListDocumentSchema(SecurityRuleAttributesSchema) })) };
|
|
1769
|
+
}
|
|
1770
|
+
/**
|
|
1771
|
+
* Update a security rule.
|
|
1772
|
+
*/
|
|
1773
|
+
async function updateSecurityRule(options, ctx) {
|
|
1774
|
+
const { server_id, site_id, id, ...data } = options;
|
|
1775
|
+
return { data: unwrapDocument(await request(ROUTES.securityRules.update, ctx, {
|
|
1776
|
+
server_id,
|
|
1777
|
+
site_id,
|
|
1778
|
+
id
|
|
1779
|
+
}, {
|
|
1780
|
+
body: data,
|
|
1781
|
+
schema: jsonApiDocumentSchema(SecurityRuleAttributesSchema)
|
|
1782
|
+
})) };
|
|
1010
1783
|
}
|
|
1784
|
+
/**
|
|
1785
|
+
* Create a redirect rule.
|
|
1786
|
+
*/
|
|
1011
1787
|
async function createRedirectRule(options, ctx) {
|
|
1012
1788
|
const { server_id, site_id, ...data } = options;
|
|
1013
|
-
|
|
1789
|
+
await request(ROUTES.redirectRules.create, ctx, {
|
|
1790
|
+
server_id,
|
|
1791
|
+
site_id
|
|
1792
|
+
}, { body: data });
|
|
1793
|
+
return { data: void 0 };
|
|
1014
1794
|
}
|
|
1795
|
+
/**
|
|
1796
|
+
* Delete a redirect rule.
|
|
1797
|
+
*/
|
|
1015
1798
|
async function deleteRedirectRule(options, ctx) {
|
|
1016
|
-
await
|
|
1799
|
+
await request(ROUTES.redirectRules.delete, ctx, {
|
|
1800
|
+
server_id: options.server_id,
|
|
1801
|
+
site_id: options.site_id,
|
|
1802
|
+
id: options.id
|
|
1803
|
+
});
|
|
1017
1804
|
return { data: void 0 };
|
|
1018
1805
|
}
|
|
1806
|
+
/**
|
|
1807
|
+
* Get a single redirect rule.
|
|
1808
|
+
*/
|
|
1019
1809
|
async function getRedirectRule(options, ctx) {
|
|
1020
|
-
return { data: (await
|
|
1810
|
+
return { data: unwrapDocument(await request(ROUTES.redirectRules.get, ctx, {
|
|
1811
|
+
server_id: options.server_id,
|
|
1812
|
+
site_id: options.site_id,
|
|
1813
|
+
id: options.id
|
|
1814
|
+
}, { schema: jsonApiDocumentSchema(RedirectRuleAttributesSchema) })) };
|
|
1021
1815
|
}
|
|
1816
|
+
/**
|
|
1817
|
+
* List redirect rules for a site.
|
|
1818
|
+
*/
|
|
1022
1819
|
async function listRedirectRules(options, ctx) {
|
|
1023
|
-
return { data: (await
|
|
1820
|
+
return { data: unwrapListDocument(await request(ROUTES.redirectRules.list, ctx, {
|
|
1821
|
+
server_id: options.server_id,
|
|
1822
|
+
site_id: options.site_id
|
|
1823
|
+
}, { schema: jsonApiListDocumentSchema(RedirectRuleAttributesSchema) })) };
|
|
1024
1824
|
}
|
|
1825
|
+
/**
|
|
1826
|
+
* Create a monitor.
|
|
1827
|
+
*/
|
|
1025
1828
|
async function createMonitor(options, ctx) {
|
|
1026
1829
|
const { server_id, ...data } = options;
|
|
1027
|
-
return { data: (await
|
|
1830
|
+
return { data: unwrapDocument(await request(ROUTES.monitors.create, ctx, { server_id }, {
|
|
1831
|
+
body: data,
|
|
1832
|
+
schema: jsonApiDocumentSchema(MonitorAttributesSchema)
|
|
1833
|
+
})) };
|
|
1028
1834
|
}
|
|
1835
|
+
/**
|
|
1836
|
+
* Delete a monitor.
|
|
1837
|
+
*/
|
|
1029
1838
|
async function deleteMonitor(options, ctx) {
|
|
1030
|
-
await
|
|
1839
|
+
await request(ROUTES.monitors.delete, ctx, {
|
|
1840
|
+
server_id: options.server_id,
|
|
1841
|
+
id: options.id
|
|
1842
|
+
});
|
|
1031
1843
|
return { data: void 0 };
|
|
1032
1844
|
}
|
|
1845
|
+
/**
|
|
1846
|
+
* Get a single monitor.
|
|
1847
|
+
*/
|
|
1033
1848
|
async function getMonitor(options, ctx) {
|
|
1034
|
-
return { data: (await
|
|
1849
|
+
return { data: unwrapDocument(await request(ROUTES.monitors.get, ctx, {
|
|
1850
|
+
server_id: options.server_id,
|
|
1851
|
+
id: options.id
|
|
1852
|
+
}, { schema: jsonApiDocumentSchema(MonitorAttributesSchema) })) };
|
|
1035
1853
|
}
|
|
1854
|
+
/**
|
|
1855
|
+
* List monitors on a server.
|
|
1856
|
+
*/
|
|
1036
1857
|
async function listMonitors(options, ctx) {
|
|
1037
|
-
return { data: (await
|
|
1858
|
+
return { data: unwrapListDocument(await request(ROUTES.monitors.list, ctx, { server_id: options.server_id }, { schema: jsonApiListDocumentSchema(MonitorAttributesSchema) })) };
|
|
1038
1859
|
}
|
|
1860
|
+
/**
|
|
1861
|
+
* Create a Nginx template.
|
|
1862
|
+
*/
|
|
1039
1863
|
async function createNginxTemplate(options, ctx) {
|
|
1040
1864
|
const { server_id, ...data } = options;
|
|
1041
|
-
return { data: (await
|
|
1865
|
+
return { data: unwrapDocument(await request(ROUTES.nginxTemplates.create, ctx, { server_id }, {
|
|
1866
|
+
body: data,
|
|
1867
|
+
schema: jsonApiDocumentSchema(NginxTemplateAttributesSchema)
|
|
1868
|
+
})) };
|
|
1042
1869
|
}
|
|
1870
|
+
/**
|
|
1871
|
+
* Delete a Nginx template.
|
|
1872
|
+
*/
|
|
1043
1873
|
async function deleteNginxTemplate(options, ctx) {
|
|
1044
|
-
await
|
|
1874
|
+
await request(ROUTES.nginxTemplates.delete, ctx, {
|
|
1875
|
+
server_id: options.server_id,
|
|
1876
|
+
id: options.id
|
|
1877
|
+
});
|
|
1045
1878
|
return { data: void 0 };
|
|
1046
1879
|
}
|
|
1880
|
+
/**
|
|
1881
|
+
* Get a single Nginx template.
|
|
1882
|
+
*/
|
|
1047
1883
|
async function getNginxTemplate(options, ctx) {
|
|
1048
|
-
return { data: (await
|
|
1884
|
+
return { data: unwrapDocument(await request(ROUTES.nginxTemplates.get, ctx, {
|
|
1885
|
+
server_id: options.server_id,
|
|
1886
|
+
id: options.id
|
|
1887
|
+
}, { schema: jsonApiDocumentSchema(NginxTemplateAttributesSchema) })) };
|
|
1049
1888
|
}
|
|
1889
|
+
/**
|
|
1890
|
+
* List Nginx templates on a server.
|
|
1891
|
+
*/
|
|
1050
1892
|
async function listNginxTemplates(options, ctx) {
|
|
1051
|
-
return { data: (await
|
|
1893
|
+
return { data: unwrapListDocument(await request(ROUTES.nginxTemplates.list, ctx, { server_id: options.server_id }, { schema: jsonApiListDocumentSchema(NginxTemplateAttributesSchema) })) };
|
|
1052
1894
|
}
|
|
1895
|
+
/**
|
|
1896
|
+
* Update a Nginx template.
|
|
1897
|
+
*/
|
|
1053
1898
|
async function updateNginxTemplate(options, ctx) {
|
|
1054
1899
|
const { server_id, id, ...data } = options;
|
|
1055
|
-
return { data: (await
|
|
1900
|
+
return { data: unwrapDocument(await request(ROUTES.nginxTemplates.update, ctx, {
|
|
1901
|
+
server_id,
|
|
1902
|
+
id
|
|
1903
|
+
}, {
|
|
1904
|
+
body: data,
|
|
1905
|
+
schema: jsonApiDocumentSchema(NginxTemplateAttributesSchema)
|
|
1906
|
+
})) };
|
|
1056
1907
|
}
|
|
1057
1908
|
/**
|
|
1058
1909
|
* Get environment variables for a site.
|
|
1059
1910
|
*/
|
|
1060
1911
|
async function getEnv(options, ctx) {
|
|
1061
|
-
return { data: await
|
|
1912
|
+
return { data: unwrapDocument(await request(ROUTES.env.get, ctx, {
|
|
1913
|
+
server_id: options.server_id,
|
|
1914
|
+
site_id: options.site_id
|
|
1915
|
+
}, { schema: jsonApiDocumentSchema(EnvironmentAttributesSchema) })).content };
|
|
1062
1916
|
}
|
|
1063
1917
|
/**
|
|
1064
1918
|
* Update environment variables for a site.
|
|
1065
1919
|
*/
|
|
1066
1920
|
async function updateEnv(options, ctx) {
|
|
1067
|
-
await
|
|
1921
|
+
await request(ROUTES.env.update, ctx, {
|
|
1922
|
+
server_id: options.server_id,
|
|
1923
|
+
site_id: options.site_id
|
|
1924
|
+
}, { body: { content: options.content } });
|
|
1068
1925
|
return { data: void 0 };
|
|
1069
1926
|
}
|
|
1070
1927
|
/**
|
|
1071
1928
|
* Get Nginx configuration for a site.
|
|
1072
1929
|
*/
|
|
1073
1930
|
async function getNginxConfig(options, ctx) {
|
|
1074
|
-
return { data: await
|
|
1931
|
+
return { data: unwrapDocument(await request(ROUTES.nginx.get, ctx, {
|
|
1932
|
+
server_id: options.server_id,
|
|
1933
|
+
site_id: options.site_id
|
|
1934
|
+
}, { schema: jsonApiDocumentSchema(EnvironmentAttributesSchema) })).content };
|
|
1075
1935
|
}
|
|
1076
1936
|
/**
|
|
1077
1937
|
* Update Nginx configuration for a site.
|
|
1078
1938
|
*/
|
|
1079
1939
|
async function updateNginxConfig(options, ctx) {
|
|
1080
|
-
await
|
|
1940
|
+
await request(ROUTES.nginx.update, ctx, {
|
|
1941
|
+
server_id: options.server_id,
|
|
1942
|
+
site_id: options.site_id
|
|
1943
|
+
}, { body: { content: options.content } });
|
|
1081
1944
|
return { data: void 0 };
|
|
1082
1945
|
}
|
|
1946
|
+
/**
|
|
1947
|
+
* Create a recipe.
|
|
1948
|
+
*/
|
|
1083
1949
|
async function createRecipe(options, ctx) {
|
|
1084
|
-
return { data: (await
|
|
1950
|
+
return { data: unwrapDocument(await request(ROUTES.recipes.create, ctx, {}, {
|
|
1951
|
+
body: options,
|
|
1952
|
+
schema: jsonApiDocumentSchema(RecipeAttributesSchema)
|
|
1953
|
+
})) };
|
|
1085
1954
|
}
|
|
1955
|
+
/**
|
|
1956
|
+
* Delete a recipe.
|
|
1957
|
+
*/
|
|
1086
1958
|
async function deleteRecipe(options, ctx) {
|
|
1087
|
-
await
|
|
1959
|
+
await request(ROUTES.recipes.delete, ctx, { id: options.id });
|
|
1088
1960
|
return { data: void 0 };
|
|
1089
1961
|
}
|
|
1962
|
+
/**
|
|
1963
|
+
* Get a single recipe.
|
|
1964
|
+
*/
|
|
1090
1965
|
async function getRecipe(options, ctx) {
|
|
1091
|
-
return { data: (await
|
|
1966
|
+
return { data: unwrapDocument(await request(ROUTES.recipes.get, ctx, { id: options.id }, { schema: jsonApiDocumentSchema(RecipeAttributesSchema) })) };
|
|
1092
1967
|
}
|
|
1968
|
+
/**
|
|
1969
|
+
* List all recipes.
|
|
1970
|
+
*/
|
|
1093
1971
|
async function listRecipes(_options, ctx) {
|
|
1094
|
-
return { data: (await
|
|
1972
|
+
return { data: unwrapListDocument(await request(ROUTES.recipes.list, ctx, {}, { schema: jsonApiListDocumentSchema(RecipeAttributesSchema) })) };
|
|
1095
1973
|
}
|
|
1096
1974
|
/**
|
|
1097
1975
|
* Run a recipe on specified servers.
|
|
1098
1976
|
*/
|
|
1099
1977
|
async function runRecipe(options, ctx) {
|
|
1100
|
-
await
|
|
1978
|
+
await request(ROUTES.recipes.run, ctx, { id: options.id }, { body: { servers: options.servers } });
|
|
1101
1979
|
return { data: void 0 };
|
|
1102
1980
|
}
|
|
1103
1981
|
/**
|
|
1104
|
-
*
|
|
1982
|
+
* Update a recipe.
|
|
1983
|
+
*/
|
|
1984
|
+
async function updateRecipe(options, ctx) {
|
|
1985
|
+
const { id, ...body } = options;
|
|
1986
|
+
return { data: unwrapDocument(await request(ROUTES.recipes.update, ctx, { id }, {
|
|
1987
|
+
body,
|
|
1988
|
+
schema: jsonApiDocumentSchema(RecipeAttributesSchema)
|
|
1989
|
+
})) };
|
|
1990
|
+
}
|
|
1991
|
+
/**
|
|
1992
|
+
* Create a backup configuration.
|
|
1105
1993
|
*/
|
|
1106
1994
|
async function createBackupConfig(options, ctx) {
|
|
1107
1995
|
const { server_id, ...data } = options;
|
|
1108
|
-
|
|
1996
|
+
await request(ROUTES.backups.create, ctx, { server_id }, { body: data });
|
|
1997
|
+
return { data: void 0 };
|
|
1109
1998
|
}
|
|
1110
1999
|
/**
|
|
1111
2000
|
* Delete a backup configuration.
|
|
1112
2001
|
*/
|
|
1113
2002
|
async function deleteBackupConfig(options, ctx) {
|
|
1114
|
-
await
|
|
2003
|
+
await request(ROUTES.backups.delete, ctx, {
|
|
2004
|
+
server_id: options.server_id,
|
|
2005
|
+
id: options.id
|
|
2006
|
+
});
|
|
1115
2007
|
return { data: void 0 };
|
|
1116
2008
|
}
|
|
1117
2009
|
/**
|
|
1118
|
-
*
|
|
2010
|
+
* Update a backup configuration.
|
|
2011
|
+
*/
|
|
2012
|
+
async function updateBackupConfig(options, ctx) {
|
|
2013
|
+
const { server_id, id, ...data } = options;
|
|
2014
|
+
await request(ROUTES.backups.update, ctx, {
|
|
2015
|
+
server_id,
|
|
2016
|
+
id
|
|
2017
|
+
}, { body: data });
|
|
2018
|
+
return { data: void 0 };
|
|
2019
|
+
}
|
|
2020
|
+
/**
|
|
2021
|
+
* Get a single backup configuration.
|
|
1119
2022
|
*/
|
|
1120
2023
|
async function getBackupConfig(options, ctx) {
|
|
1121
|
-
return { data: (await
|
|
2024
|
+
return { data: unwrapDocument(await request(ROUTES.backups.get, ctx, {
|
|
2025
|
+
server_id: options.server_id,
|
|
2026
|
+
id: options.id
|
|
2027
|
+
}, { schema: jsonApiDocumentSchema(BackupConfigAttributesSchema) })) };
|
|
1122
2028
|
}
|
|
1123
2029
|
/**
|
|
1124
2030
|
* List backup configurations for a server.
|
|
1125
2031
|
*/
|
|
1126
2032
|
async function listBackupConfigs(options, ctx) {
|
|
1127
|
-
return { data: (await
|
|
2033
|
+
return { data: unwrapListDocument(await request(ROUTES.backups.list, ctx, { server_id: options.server_id }, { schema: jsonApiListDocumentSchema(BackupConfigAttributesSchema) })) };
|
|
1128
2034
|
}
|
|
1129
2035
|
/**
|
|
1130
2036
|
* Execute a command on a site.
|
|
1131
2037
|
*/
|
|
1132
2038
|
async function createCommand(options, ctx) {
|
|
1133
|
-
|
|
2039
|
+
await request(ROUTES.commands.create, ctx, {
|
|
2040
|
+
server_id: options.server_id,
|
|
2041
|
+
site_id: options.site_id
|
|
2042
|
+
}, { body: { command: options.command } });
|
|
2043
|
+
return { data: void 0 };
|
|
1134
2044
|
}
|
|
1135
2045
|
/**
|
|
1136
2046
|
* Get a specific command.
|
|
1137
2047
|
*/
|
|
1138
2048
|
async function getCommand(options, ctx) {
|
|
1139
|
-
return { data: (await
|
|
2049
|
+
return { data: unwrapDocument(await request(ROUTES.commands.get, ctx, {
|
|
2050
|
+
server_id: options.server_id,
|
|
2051
|
+
site_id: options.site_id,
|
|
2052
|
+
id: options.id
|
|
2053
|
+
}, { schema: jsonApiDocumentSchema(CommandAttributesSchema) })) };
|
|
1140
2054
|
}
|
|
1141
2055
|
/**
|
|
1142
2056
|
* List commands executed on a site.
|
|
1143
2057
|
*/
|
|
1144
2058
|
async function listCommands(options, ctx) {
|
|
1145
|
-
return { data: (await
|
|
2059
|
+
return { data: unwrapListDocument(await request(ROUTES.commands.list, ctx, {
|
|
2060
|
+
server_id: options.server_id,
|
|
2061
|
+
site_id: options.site_id
|
|
2062
|
+
}, { schema: jsonApiListDocumentSchema(CommandAttributesSchema) })) };
|
|
1146
2063
|
}
|
|
1147
2064
|
/**
|
|
1148
|
-
* Create a
|
|
2065
|
+
* Create a scheduled job.
|
|
1149
2066
|
*/
|
|
1150
2067
|
async function createScheduledJob(options, ctx) {
|
|
1151
|
-
const { server_id, ...data } = options;
|
|
1152
|
-
|
|
2068
|
+
const { server_id, site_id, ...data } = options;
|
|
2069
|
+
const route = site_id ? ROUTES.scheduledJobs.siteCreate : ROUTES.scheduledJobs.create;
|
|
2070
|
+
const params = { server_id };
|
|
2071
|
+
if (site_id) params.site_id = site_id;
|
|
2072
|
+
return { data: unwrapDocument(await request(route, ctx, params, {
|
|
2073
|
+
body: data,
|
|
2074
|
+
schema: jsonApiDocumentSchema(ScheduledJobAttributesSchema)
|
|
2075
|
+
})) };
|
|
1153
2076
|
}
|
|
1154
2077
|
/**
|
|
1155
2078
|
* Delete a scheduled job.
|
|
1156
2079
|
*/
|
|
1157
2080
|
async function deleteScheduledJob(options, ctx) {
|
|
1158
|
-
|
|
2081
|
+
const route = options.site_id ? ROUTES.scheduledJobs.siteDelete : ROUTES.scheduledJobs.delete;
|
|
2082
|
+
const params = {
|
|
2083
|
+
server_id: options.server_id,
|
|
2084
|
+
id: options.id
|
|
2085
|
+
};
|
|
2086
|
+
if (options.site_id) params.site_id = options.site_id;
|
|
2087
|
+
await request(route, ctx, params);
|
|
1159
2088
|
return { data: void 0 };
|
|
1160
2089
|
}
|
|
1161
2090
|
/**
|
|
1162
2091
|
* Get a specific scheduled job.
|
|
1163
2092
|
*/
|
|
1164
2093
|
async function getScheduledJob(options, ctx) {
|
|
1165
|
-
|
|
2094
|
+
const route = options.site_id ? ROUTES.scheduledJobs.siteGet : ROUTES.scheduledJobs.get;
|
|
2095
|
+
const params = {
|
|
2096
|
+
server_id: options.server_id,
|
|
2097
|
+
id: options.id
|
|
2098
|
+
};
|
|
2099
|
+
if (options.site_id) params.site_id = options.site_id;
|
|
2100
|
+
return { data: unwrapDocument(await request(route, ctx, params, { schema: jsonApiDocumentSchema(ScheduledJobAttributesSchema) })) };
|
|
1166
2101
|
}
|
|
1167
2102
|
/**
|
|
1168
|
-
* List scheduled jobs
|
|
2103
|
+
* List scheduled jobs on a server.
|
|
1169
2104
|
*/
|
|
1170
2105
|
async function listScheduledJobs(options, ctx) {
|
|
1171
|
-
|
|
2106
|
+
const route = options.site_id ? ROUTES.scheduledJobs.siteList : ROUTES.scheduledJobs.list;
|
|
2107
|
+
const params = { server_id: options.server_id };
|
|
2108
|
+
if (options.site_id) params.site_id = options.site_id;
|
|
2109
|
+
return { data: unwrapListDocument(await request(route, ctx, params, { schema: jsonApiListDocumentSchema(ScheduledJobAttributesSchema) })) };
|
|
1172
2110
|
}
|
|
1173
2111
|
/**
|
|
1174
2112
|
* Get the currently authenticated user.
|
|
1175
2113
|
*/
|
|
1176
2114
|
async function getUser(_options, ctx) {
|
|
1177
|
-
return { data: (await
|
|
2115
|
+
return { data: unwrapDocument(await request(ROUTES.user.get, ctx, {}, { schema: jsonApiDocumentSchema(UserAttributesSchema) })) };
|
|
1178
2116
|
}
|
|
1179
|
-
export { ACTIONS, RESOURCES, 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, getDatabase, getDatabaseUser, getDeploymentLog,
|
|
2117
|
+
export { ACTIONS, RESOURCES, 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, 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, listSites, listSshKeys, matchByName, mockDocument, mockListDocument, mockResource, rebootServer, resolveServers, resolveSites, restartDaemon, runRecipe, sanitizeArgs, updateBackupConfig, updateDaemon, updateDatabaseUser, updateDeploymentScript, updateEnv, updateNginxConfig, updateNginxTemplate, updateRecipe, updateSecurityRule, updateSite };
|
|
1180
2118
|
|
|
1181
2119
|
//# sourceMappingURL=index.js.map
|