From fef6181beb3a9c9d86b822c90c6cb0120265b33b Mon Sep 17 00:00:00 2001 From: ebauger Date: Thu, 11 Jun 2026 15:58:45 -0400 Subject: [PATCH] feat(hostinger): add @distilled.cloud/hostinger SDK from OpenAPI spec --- .github/workflows/nuke.yml | 4 + .github/workflows/test.yml | 23 +++ .gitmodules | 3 + bun.lock | 59 +++++--- packages/hostinger/README.md | 74 ++++++++++ packages/hostinger/package.json | 88 ++++++++++++ .../001-add-subscription-cancel.patch.json | 40 ++++++ .../002-action-state-open-enum.patch.json | 13 ++ packages/hostinger/scripts/generate.ts | 24 ++++ packages/hostinger/specs/api | 1 + packages/hostinger/src/category.ts | 4 + packages/hostinger/src/client.ts | 95 ++++++++++++ packages/hostinger/src/credentials.ts | 36 +++++ packages/hostinger/src/errors.ts | 59 ++++++++ packages/hostinger/src/index.ts | 16 +++ .../src/operations/DNSDeleteDNSRecordsV1.ts | 57 ++++++++ .../src/operations/DNSGetDNSRecordsV1.ts | 56 ++++++++ .../src/operations/DNSGetDNSSnapshotListV1.ts | 39 +++++ .../src/operations/DNSGetDNSSnapshotV1.ts | 70 +++++++++ .../src/operations/DNSResetDNSRecordsV1.ts | 38 +++++ .../src/operations/DNSRestoreDNSSnapshotV1.ts | 42 ++++++ .../src/operations/DNSUpdateDNSRecordsV1.ts | 62 ++++++++ .../src/operations/DNSValidateDNSRecordsV1.ts | 65 +++++++++ .../src/operations/VPSActivateFirewallV1.ts | 48 +++++++ .../src/operations/VPSAttachPublicKeyV1.ts | 46 ++++++ .../src/operations/VPSCreateFirewallRuleV1.ts | 82 +++++++++++ .../src/operations/VPSCreateNewFirewallV1.ts | 67 +++++++++ .../src/operations/VPSCreateNewProjectV1.ts | 52 +++++++ .../src/operations/VPSCreatePTRRecordV1.ts | 47 ++++++ .../VPSCreatePostInstallScriptV1.ts | 42 ++++++ .../src/operations/VPSCreatePublicKeyV1.ts | 36 +++++ .../src/operations/VPSCreateSnapshotV1.ts | 45 ++++++ .../src/operations/VPSDeactivateFirewallV1.ts | 48 +++++++ .../src/operations/VPSDeleteFirewallRuleV1.ts | 44 ++++++ .../src/operations/VPSDeleteFirewallV1.ts | 34 +++++ .../src/operations/VPSDeletePTRRecordV1.ts | 46 ++++++ .../VPSDeletePostInstallScriptV1.ts | 39 +++++ .../src/operations/VPSDeleteProjectV1.ts | 46 ++++++ .../src/operations/VPSDeletePublicKeyV1.ts | 36 +++++ .../src/operations/VPSDeleteSnapshotV1.ts | 40 ++++++ .../src/operations/VPSGetActionDetailsV1.ts | 45 ++++++ .../src/operations/VPSGetActionsV1.ts | 57 ++++++++ .../operations/VPSGetAttachedPublicKeysV1.ts | 57 ++++++++ .../src/operations/VPSGetBackupsV1.ts | 53 +++++++ .../src/operations/VPSGetDataCenterListV1.ts | 39 +++++ .../src/operations/VPSGetFirewallDetailsV1.ts | 67 +++++++++ .../src/operations/VPSGetFirewallListV1.ts | 78 ++++++++++ .../src/operations/VPSGetMetricsV1.ts | 49 +++++++ .../operations/VPSGetPostInstallScriptV1.ts | 44 ++++++ .../operations/VPSGetPostInstallScriptsV1.ts | 52 +++++++ .../operations/VPSGetProjectContainersV1.ts | 89 ++++++++++++ .../src/operations/VPSGetProjectContentsV1.ts | 47 ++++++ .../src/operations/VPSGetProjectListV1.ts | 104 ++++++++++++++ .../src/operations/VPSGetProjectLogsV1.ts | 53 +++++++ .../src/operations/VPSGetPublicKeysV1.ts | 46 ++++++ .../src/operations/VPSGetScanMetricsV1.ts | 48 +++++++ .../src/operations/VPSGetSnapshotV1.ts | 39 +++++ .../src/operations/VPSGetTemplateDetailsV1.ts | 40 ++++++ .../src/operations/VPSGetTemplatesV1.ts | 32 +++++ .../VPSGetVirtualMachineDetailsV1.ts | 75 ++++++++++ .../src/operations/VPSGetVirtualMachinesV1.ts | 71 +++++++++ .../src/operations/VPSInstallMonarxV1.ts | 46 ++++++ .../VPSPurchaseNewVirtualMachineV1.ts | 136 ++++++++++++++++++ .../operations/VPSRecreateVirtualMachineV1.ts | 63 ++++++++ .../src/operations/VPSResetHostnameV1.ts | 40 ++++++ .../src/operations/VPSRestartProjectV1.ts | 46 ++++++ .../operations/VPSRestartVirtualMachineV1.ts | 45 ++++++ .../src/operations/VPSRestoreBackupV1.ts | 44 ++++++ .../src/operations/VPSRestoreSnapshotV1.ts | 44 ++++++ .../src/operations/VPSSetHostnameV1.ts | 46 ++++++ .../src/operations/VPSSetNameserversV1.ts | 47 ++++++ .../src/operations/VPSSetPanelPasswordV1.ts | 50 +++++++ .../src/operations/VPSSetRootPasswordV1.ts | 48 +++++++ .../VPSSetupPurchasedVirtualMachineV1.ts | 93 ++++++++++++ .../src/operations/VPSStartProjectV1.ts | 46 ++++++ .../src/operations/VPSStartRecoveryModeV1.ts | 52 +++++++ .../operations/VPSStartVirtualMachineV1.ts | 45 ++++++ .../src/operations/VPSStopProjectV1.ts | 46 ++++++ .../src/operations/VPSStopRecoveryModeV1.ts | 44 ++++++ .../src/operations/VPSStopVirtualMachineV1.ts | 45 ++++++ .../src/operations/VPSSyncFirewallV1.ts | 46 ++++++ .../src/operations/VPSUninstallMonarxV1.ts | 45 ++++++ .../src/operations/VPSUpdateFirewallRuleV1.ts | 85 +++++++++++ .../VPSUpdatePostInstallScriptV1.ts | 47 ++++++ .../src/operations/VPSUpdateProjectV1.ts | 47 ++++++ .../operations/billingCancelSubscriptionV1.ts | 39 +++++ .../billingDeletePaymentMethodV1.ts | 39 +++++ .../operations/billingDisableAutoRenewalV1.ts | 61 ++++++++ .../operations/billingEnableAutoRenewalV1.ts | 61 ++++++++ .../operations/billingGetCatalogItemListV1.ts | 59 ++++++++ .../billingGetPaymentMethodListV1.ts | 44 ++++++ .../billingGetSubscriptionListV1.ts | 55 +++++++ .../billingSetDefaultPaymentMethodV1.ts | 39 +++++ .../domainsCheckDomainAvailabilityV1.ts | 45 ++++++ .../domainsCreateDomainForwardingV1.ts | 40 ++++++ .../operations/domainsCreateWHOISProfileV1.ts | 48 +++++++ .../domainsDeleteDomainForwardingV1.ts | 36 +++++ .../operations/domainsDeleteWHOISProfileV1.ts | 37 +++++ .../operations/domainsDisableDomainLockV1.ts | 41 ++++++ .../domainsDisablePrivacyProtectionV1.ts | 40 ++++++ .../operations/domainsEnableDomainLockV1.ts | 42 ++++++ .../domainsEnablePrivacyProtectionV1.ts | 40 ++++++ .../operations/domainsGetDomainDetailsV1.ts | 76 ++++++++++ .../domainsGetDomainForwardingV1.ts | 40 ++++++ .../src/operations/domainsGetDomainListV1.ts | 58 ++++++++ .../domainsGetWHOISProfileListV1.ts | 45 ++++++ .../domainsGetWHOISProfileUsageV1.ts | 34 +++++ .../operations/domainsGetWHOISProfileV1.ts | 44 ++++++ .../operations/domainsPurchaseNewDomainV1.ts | 86 +++++++++++ .../domainsUpdateDomainNameserversV1.ts | 46 ++++++ .../src/operations/ecommerceCreateStoreV1.ts | 70 +++++++++ .../src/operations/ecommerceGetStoresV1.ts | 50 +++++++ .../hostingChangeDatabasePasswordV1.ts | 45 ++++++ .../hostingCreateAccountDatabaseV1.ts | 44 ++++++ .../hostingCreateNodeJSBuildFromArchiveV1.ts | 88 ++++++++++++ .../hostingCreateWebsiteParkedDomainV1.ts | 44 ++++++ .../hostingCreateWebsiteSubdomainV1.ts | 46 ++++++ .../src/operations/hostingCreateWebsiteV1.ts | 43 ++++++ .../hostingDeleteAccountDatabaseV1.ts | 40 ++++++ .../hostingDeleteWebsiteParkedDomainV1.ts | 41 ++++++ .../hostingDeleteWebsiteSubdomainV1.ts | 41 ++++++ .../hostingGenerateAFreeSubdomainV1.ts | 33 +++++ .../operations/hostingGetNodeJSBuildLogsV1.ts | 51 +++++++ .../operations/hostingGetPhpMyAdminLinkV1.ts | 42 ++++++ .../operations/hostingInstallWordPressV1.ts | 74 ++++++++++ .../hostingListAccountDatabasesV1.ts | 68 +++++++++ .../hostingListAvailableDatacentersV1.ts | 45 ++++++ .../operations/hostingListNodeJSBuildsV1.ts | 68 +++++++++ .../src/operations/hostingListOrdersV1.ts | 62 ++++++++ .../hostingListWebsiteParkedDomainsV1.ts | 47 ++++++ .../hostingListWebsiteSubdomainsV1.ts | 47 ++++++ .../src/operations/hostingListWebsitesV1.ts | 71 +++++++++ .../hostingListWordPressInstallationsV1.ts | 58 ++++++++ .../src/operations/hostingRepairDatabaseV1.ts | 42 ++++++ .../hostingVerifyDomainOwnershipV1.ts | 45 ++++++ packages/hostinger/src/operations/index.ts | 129 +++++++++++++++++ .../reachCreateANewContactSegmentV1.ts | 99 +++++++++++++ .../operations/reachCreateNewContactsV1.ts | 49 +++++++ .../src/operations/reachDeleteAContactV1.ts | 34 +++++ .../operations/reachGetSegmentDetailsV1.ts | 45 ++++++ .../src/operations/reachListContactsV1.ts | 62 ++++++++ .../src/operations/reachListProfilesV1.ts | 51 +++++++ .../operations/reachListSegmentContactsV1.ts | 69 +++++++++ .../src/operations/reachListSegmentsV1.ts | 34 +++++ .../v2GetDomainVerificationsDIRECT.ts | 67 +++++++++ packages/hostinger/src/retry.ts | 55 +++++++ packages/hostinger/src/sensitive.ts | 4 + packages/hostinger/src/traits.ts | 4 + packages/hostinger/tsconfig.json | 20 +++ packages/hostinger/tsconfig.test.json | 16 +++ packages/hostinger/vitest.config.ts | 17 +++ 151 files changed, 7482 insertions(+), 20 deletions(-) create mode 100644 packages/hostinger/README.md create mode 100644 packages/hostinger/package.json create mode 100644 packages/hostinger/patches/001-add-subscription-cancel.patch.json create mode 100644 packages/hostinger/patches/002-action-state-open-enum.patch.json create mode 100644 packages/hostinger/scripts/generate.ts create mode 160000 packages/hostinger/specs/api create mode 100644 packages/hostinger/src/category.ts create mode 100644 packages/hostinger/src/client.ts create mode 100644 packages/hostinger/src/credentials.ts create mode 100644 packages/hostinger/src/errors.ts create mode 100644 packages/hostinger/src/index.ts create mode 100644 packages/hostinger/src/operations/DNSDeleteDNSRecordsV1.ts create mode 100644 packages/hostinger/src/operations/DNSGetDNSRecordsV1.ts create mode 100644 packages/hostinger/src/operations/DNSGetDNSSnapshotListV1.ts create mode 100644 packages/hostinger/src/operations/DNSGetDNSSnapshotV1.ts create mode 100644 packages/hostinger/src/operations/DNSResetDNSRecordsV1.ts create mode 100644 packages/hostinger/src/operations/DNSRestoreDNSSnapshotV1.ts create mode 100644 packages/hostinger/src/operations/DNSUpdateDNSRecordsV1.ts create mode 100644 packages/hostinger/src/operations/DNSValidateDNSRecordsV1.ts create mode 100644 packages/hostinger/src/operations/VPSActivateFirewallV1.ts create mode 100644 packages/hostinger/src/operations/VPSAttachPublicKeyV1.ts create mode 100644 packages/hostinger/src/operations/VPSCreateFirewallRuleV1.ts create mode 100644 packages/hostinger/src/operations/VPSCreateNewFirewallV1.ts create mode 100644 packages/hostinger/src/operations/VPSCreateNewProjectV1.ts create mode 100644 packages/hostinger/src/operations/VPSCreatePTRRecordV1.ts create mode 100644 packages/hostinger/src/operations/VPSCreatePostInstallScriptV1.ts create mode 100644 packages/hostinger/src/operations/VPSCreatePublicKeyV1.ts create mode 100644 packages/hostinger/src/operations/VPSCreateSnapshotV1.ts create mode 100644 packages/hostinger/src/operations/VPSDeactivateFirewallV1.ts create mode 100644 packages/hostinger/src/operations/VPSDeleteFirewallRuleV1.ts create mode 100644 packages/hostinger/src/operations/VPSDeleteFirewallV1.ts create mode 100644 packages/hostinger/src/operations/VPSDeletePTRRecordV1.ts create mode 100644 packages/hostinger/src/operations/VPSDeletePostInstallScriptV1.ts create mode 100644 packages/hostinger/src/operations/VPSDeleteProjectV1.ts create mode 100644 packages/hostinger/src/operations/VPSDeletePublicKeyV1.ts create mode 100644 packages/hostinger/src/operations/VPSDeleteSnapshotV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetActionDetailsV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetActionsV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetAttachedPublicKeysV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetBackupsV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetDataCenterListV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetFirewallDetailsV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetFirewallListV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetMetricsV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetPostInstallScriptV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetPostInstallScriptsV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetProjectContainersV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetProjectContentsV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetProjectListV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetProjectLogsV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetPublicKeysV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetScanMetricsV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetSnapshotV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetTemplateDetailsV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetTemplatesV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetVirtualMachineDetailsV1.ts create mode 100644 packages/hostinger/src/operations/VPSGetVirtualMachinesV1.ts create mode 100644 packages/hostinger/src/operations/VPSInstallMonarxV1.ts create mode 100644 packages/hostinger/src/operations/VPSPurchaseNewVirtualMachineV1.ts create mode 100644 packages/hostinger/src/operations/VPSRecreateVirtualMachineV1.ts create mode 100644 packages/hostinger/src/operations/VPSResetHostnameV1.ts create mode 100644 packages/hostinger/src/operations/VPSRestartProjectV1.ts create mode 100644 packages/hostinger/src/operations/VPSRestartVirtualMachineV1.ts create mode 100644 packages/hostinger/src/operations/VPSRestoreBackupV1.ts create mode 100644 packages/hostinger/src/operations/VPSRestoreSnapshotV1.ts create mode 100644 packages/hostinger/src/operations/VPSSetHostnameV1.ts create mode 100644 packages/hostinger/src/operations/VPSSetNameserversV1.ts create mode 100644 packages/hostinger/src/operations/VPSSetPanelPasswordV1.ts create mode 100644 packages/hostinger/src/operations/VPSSetRootPasswordV1.ts create mode 100644 packages/hostinger/src/operations/VPSSetupPurchasedVirtualMachineV1.ts create mode 100644 packages/hostinger/src/operations/VPSStartProjectV1.ts create mode 100644 packages/hostinger/src/operations/VPSStartRecoveryModeV1.ts create mode 100644 packages/hostinger/src/operations/VPSStartVirtualMachineV1.ts create mode 100644 packages/hostinger/src/operations/VPSStopProjectV1.ts create mode 100644 packages/hostinger/src/operations/VPSStopRecoveryModeV1.ts create mode 100644 packages/hostinger/src/operations/VPSStopVirtualMachineV1.ts create mode 100644 packages/hostinger/src/operations/VPSSyncFirewallV1.ts create mode 100644 packages/hostinger/src/operations/VPSUninstallMonarxV1.ts create mode 100644 packages/hostinger/src/operations/VPSUpdateFirewallRuleV1.ts create mode 100644 packages/hostinger/src/operations/VPSUpdatePostInstallScriptV1.ts create mode 100644 packages/hostinger/src/operations/VPSUpdateProjectV1.ts create mode 100644 packages/hostinger/src/operations/billingCancelSubscriptionV1.ts create mode 100644 packages/hostinger/src/operations/billingDeletePaymentMethodV1.ts create mode 100644 packages/hostinger/src/operations/billingDisableAutoRenewalV1.ts create mode 100644 packages/hostinger/src/operations/billingEnableAutoRenewalV1.ts create mode 100644 packages/hostinger/src/operations/billingGetCatalogItemListV1.ts create mode 100644 packages/hostinger/src/operations/billingGetPaymentMethodListV1.ts create mode 100644 packages/hostinger/src/operations/billingGetSubscriptionListV1.ts create mode 100644 packages/hostinger/src/operations/billingSetDefaultPaymentMethodV1.ts create mode 100644 packages/hostinger/src/operations/domainsCheckDomainAvailabilityV1.ts create mode 100644 packages/hostinger/src/operations/domainsCreateDomainForwardingV1.ts create mode 100644 packages/hostinger/src/operations/domainsCreateWHOISProfileV1.ts create mode 100644 packages/hostinger/src/operations/domainsDeleteDomainForwardingV1.ts create mode 100644 packages/hostinger/src/operations/domainsDeleteWHOISProfileV1.ts create mode 100644 packages/hostinger/src/operations/domainsDisableDomainLockV1.ts create mode 100644 packages/hostinger/src/operations/domainsDisablePrivacyProtectionV1.ts create mode 100644 packages/hostinger/src/operations/domainsEnableDomainLockV1.ts create mode 100644 packages/hostinger/src/operations/domainsEnablePrivacyProtectionV1.ts create mode 100644 packages/hostinger/src/operations/domainsGetDomainDetailsV1.ts create mode 100644 packages/hostinger/src/operations/domainsGetDomainForwardingV1.ts create mode 100644 packages/hostinger/src/operations/domainsGetDomainListV1.ts create mode 100644 packages/hostinger/src/operations/domainsGetWHOISProfileListV1.ts create mode 100644 packages/hostinger/src/operations/domainsGetWHOISProfileUsageV1.ts create mode 100644 packages/hostinger/src/operations/domainsGetWHOISProfileV1.ts create mode 100644 packages/hostinger/src/operations/domainsPurchaseNewDomainV1.ts create mode 100644 packages/hostinger/src/operations/domainsUpdateDomainNameserversV1.ts create mode 100644 packages/hostinger/src/operations/ecommerceCreateStoreV1.ts create mode 100644 packages/hostinger/src/operations/ecommerceGetStoresV1.ts create mode 100644 packages/hostinger/src/operations/hostingChangeDatabasePasswordV1.ts create mode 100644 packages/hostinger/src/operations/hostingCreateAccountDatabaseV1.ts create mode 100644 packages/hostinger/src/operations/hostingCreateNodeJSBuildFromArchiveV1.ts create mode 100644 packages/hostinger/src/operations/hostingCreateWebsiteParkedDomainV1.ts create mode 100644 packages/hostinger/src/operations/hostingCreateWebsiteSubdomainV1.ts create mode 100644 packages/hostinger/src/operations/hostingCreateWebsiteV1.ts create mode 100644 packages/hostinger/src/operations/hostingDeleteAccountDatabaseV1.ts create mode 100644 packages/hostinger/src/operations/hostingDeleteWebsiteParkedDomainV1.ts create mode 100644 packages/hostinger/src/operations/hostingDeleteWebsiteSubdomainV1.ts create mode 100644 packages/hostinger/src/operations/hostingGenerateAFreeSubdomainV1.ts create mode 100644 packages/hostinger/src/operations/hostingGetNodeJSBuildLogsV1.ts create mode 100644 packages/hostinger/src/operations/hostingGetPhpMyAdminLinkV1.ts create mode 100644 packages/hostinger/src/operations/hostingInstallWordPressV1.ts create mode 100644 packages/hostinger/src/operations/hostingListAccountDatabasesV1.ts create mode 100644 packages/hostinger/src/operations/hostingListAvailableDatacentersV1.ts create mode 100644 packages/hostinger/src/operations/hostingListNodeJSBuildsV1.ts create mode 100644 packages/hostinger/src/operations/hostingListOrdersV1.ts create mode 100644 packages/hostinger/src/operations/hostingListWebsiteParkedDomainsV1.ts create mode 100644 packages/hostinger/src/operations/hostingListWebsiteSubdomainsV1.ts create mode 100644 packages/hostinger/src/operations/hostingListWebsitesV1.ts create mode 100644 packages/hostinger/src/operations/hostingListWordPressInstallationsV1.ts create mode 100644 packages/hostinger/src/operations/hostingRepairDatabaseV1.ts create mode 100644 packages/hostinger/src/operations/hostingVerifyDomainOwnershipV1.ts create mode 100644 packages/hostinger/src/operations/index.ts create mode 100644 packages/hostinger/src/operations/reachCreateANewContactSegmentV1.ts create mode 100644 packages/hostinger/src/operations/reachCreateNewContactsV1.ts create mode 100644 packages/hostinger/src/operations/reachDeleteAContactV1.ts create mode 100644 packages/hostinger/src/operations/reachGetSegmentDetailsV1.ts create mode 100644 packages/hostinger/src/operations/reachListContactsV1.ts create mode 100644 packages/hostinger/src/operations/reachListProfilesV1.ts create mode 100644 packages/hostinger/src/operations/reachListSegmentContactsV1.ts create mode 100644 packages/hostinger/src/operations/reachListSegmentsV1.ts create mode 100644 packages/hostinger/src/operations/v2GetDomainVerificationsDIRECT.ts create mode 100644 packages/hostinger/src/retry.ts create mode 100644 packages/hostinger/src/sensitive.ts create mode 100644 packages/hostinger/src/traits.ts create mode 100644 packages/hostinger/tsconfig.json create mode 100644 packages/hostinger/tsconfig.test.json create mode 100644 packages/hostinger/vitest.config.ts diff --git a/.github/workflows/nuke.yml b/.github/workflows/nuke.yml index 9a26d96d8..7ca4ce5c5 100644 --- a/.github/workflows/nuke.yml +++ b/.github/workflows/nuke.yml @@ -70,6 +70,10 @@ on: description: "Eas" type: boolean default: false + hostinger: + description: "Hostinger" + type: boolean + default: false env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 30c3bc584..b0d837fd4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,6 +42,7 @@ jobs: typesense: ${{ steps.force.outputs.all || steps.changes.outputs.typesense }} workos: ${{ steps.force.outputs.all || steps.changes.outputs.workos }} expo-eas: ${{ steps.force.outputs.all || steps.changes.outputs.expo-eas }} + hostinger: ${{ steps.force.outputs.all || steps.changes.outputs.hostinger }} steps: - id: force if: contains(github.event.pull_request.labels.*.name, 'force-ci') @@ -110,6 +111,9 @@ jobs: expo-eas: - 'packages/expo-eas/**' - 'packages/core/**' + hostinger: + - 'packages/hostinger/**' + - 'packages/core/**' ci-core: needs: detect-changes @@ -494,3 +498,22 @@ jobs: working-directory: packages/expo-eas env: EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} + + ci-hostinger: + needs: detect-changes + if: needs.detect-changes.outputs.hostinger == 'true' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + - run: bun install + - run: bun run build + working-directory: packages/core + - run: bun run check + working-directory: packages/hostinger + - run: bun run test + working-directory: packages/hostinger + env: + HOSTINGER_API_TOKEN: ${{ secrets.HOSTINGER_API_TOKEN }} diff --git a/.gitmodules b/.gitmodules index e326dc56a..a20d4b84f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -107,3 +107,6 @@ shallow = true ignore = dirty fetchRecurseSubmodules = false +[submodule "packages/hostinger/specs/api"] + path = packages/hostinger/specs/api + url = https://github.com/hostinger/api.git diff --git a/bun.lock b/bun.lock index b4c18219a..1df6832bd 100644 --- a/bun.lock +++ b/bun.lock @@ -23,7 +23,7 @@ }, "packages/aws": { "name": "@distilled.cloud/aws", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@aws-crypto/crc32": "catalog:", "@aws-crypto/util": "catalog:", @@ -54,7 +54,7 @@ }, "packages/axiom": { "name": "@distilled.cloud/axiom", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -70,7 +70,7 @@ }, "packages/azure": { "name": "@distilled.cloud/azure", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -86,7 +86,7 @@ }, "packages/cloudflare": { "name": "@distilled.cloud/cloudflare", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -105,7 +105,7 @@ }, "packages/coinbase": { "name": "@distilled.cloud/coinbase", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -122,7 +122,7 @@ }, "packages/core": { "name": "@distilled.cloud/core", - "version": "0.21.3", + "version": "0.24.9", "devDependencies": { "@types/bun": "catalog:", "@types/node": "catalog:", @@ -135,7 +135,7 @@ }, "packages/expo-eas": { "name": "@distilled.cloud/expo-eas", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -151,7 +151,7 @@ }, "packages/fly-io": { "name": "@distilled.cloud/fly-io", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -167,7 +167,7 @@ }, "packages/gcp": { "name": "@distilled.cloud/gcp", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -181,9 +181,26 @@ "effect": "catalog:", }, }, + "packages/hostinger": { + "name": "@distilled.cloud/hostinger", + "version": "0.2.0-alpha", + "dependencies": { + "@distilled.cloud/core": "workspace:*", + "effect": "catalog:", + }, + "devDependencies": { + "@types/bun": "catalog:", + "@types/node": "catalog:", + "dotenv": "catalog:", + "vitest": "catalog:", + }, + "peerDependencies": { + "effect": "catalog:", + }, + }, "packages/kubernetes": { "name": "@distilled.cloud/kubernetes", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -199,7 +216,7 @@ }, "packages/mongodb-atlas": { "name": "@distilled.cloud/mongodb-atlas", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -215,7 +232,7 @@ }, "packages/neon": { "name": "@distilled.cloud/neon", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -231,7 +248,7 @@ }, "packages/planetscale": { "name": "@distilled.cloud/planetscale", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -247,7 +264,7 @@ }, "packages/posthog": { "name": "@distilled.cloud/posthog", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -265,7 +282,7 @@ }, "packages/prisma-postgres": { "name": "@distilled.cloud/prisma-postgres", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -281,7 +298,7 @@ }, "packages/stripe": { "name": "@distilled.cloud/stripe", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -297,7 +314,7 @@ }, "packages/supabase": { "name": "@distilled.cloud/supabase", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -313,7 +330,7 @@ }, "packages/turso": { "name": "@distilled.cloud/turso", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -329,7 +346,7 @@ }, "packages/typesense": { "name": "@distilled.cloud/typesense", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -346,7 +363,7 @@ }, "packages/workos": { "name": "@distilled.cloud/workos", - "version": "0.21.3", + "version": "0.24.9", "dependencies": { "@distilled.cloud/core": "workspace:*", }, @@ -486,6 +503,8 @@ "@distilled.cloud/gcp": ["@distilled.cloud/gcp@workspace:packages/gcp"], + "@distilled.cloud/hostinger": ["@distilled.cloud/hostinger@workspace:packages/hostinger"], + "@distilled.cloud/kubernetes": ["@distilled.cloud/kubernetes@workspace:packages/kubernetes"], "@distilled.cloud/mongodb-atlas": ["@distilled.cloud/mongodb-atlas@workspace:packages/mongodb-atlas"], diff --git a/packages/hostinger/README.md b/packages/hostinger/README.md new file mode 100644 index 000000000..4f2dcadff --- /dev/null +++ b/packages/hostinger/README.md @@ -0,0 +1,74 @@ +# @distilled.cloud/hostinger + +Effect-native SDK for the [Hostinger API](https://developers.hostinger.com), generated from the official [OpenAPI specification](https://github.com/hostinger/api). Covers VPS, DNS, Domains, Hosting, Billing and Reach with exhaustive error typing. + +## Installation + +```bash +npm install @distilled.cloud/hostinger effect +``` + +## Quick Start + +```typescript +import { Effect, Layer } from "effect"; +import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient"; +import { CredentialsFromEnv } from "@distilled.cloud/hostinger/credentials"; +import { VPSGetDataCenterListV1 } from "@distilled.cloud/hostinger/operations"; + +const MainLayer = Layer.merge(CredentialsFromEnv, FetchHttpClient.layer); + +const program = Effect.gen(function* () { + const dataCenters = yield* VPSGetDataCenterListV1({}); + for (const dc of dataCenters) { + console.log(`${dc.id}: ${dc.name} (${dc.city})`); + } +}); + +await Effect.runPromise(program.pipe(Effect.provide(MainLayer))); +``` + +## Configuration + +| Environment variable | Description | +|---|---| +| `HOSTINGER_API_TOKEN` | API token — create one at [hpanel.hostinger.com/profile/api](https://hpanel.hostinger.com/profile/api) | +| `HOSTINGER_API_BASE_URL` | Optional override of the API base URL (default `https://developers.hostinger.com`) | + +## Error Handling + +Every operation returns typed errors in the Effect error channel: + +```typescript +import { Effect } from "effect"; +import { VPSGetVirtualMachineV1 } from "@distilled.cloud/hostinger/operations"; +import { NotFound, UnknownHostingerError, HostingerValidationError } from "@distilled.cloud/hostinger/errors"; + +const vm = yield* VPSGetVirtualMachineV1({ virtualMachineId: 123 }).pipe( + Effect.catchTags({ + NotFound: () => Effect.succeed(undefined), + HostingerValidationError: (e) => + Effect.dieMessage(`Invalid input: ${JSON.stringify(e.errors)}`), + UnknownHostingerError: (e) => Effect.dieMessage(e.message ?? "unknown"), + }), +); +``` + +Validation errors (HTTP 422) are surfaced as `HostingerValidationError` with per-field details in `errors`. + +## Services + +- **VPS: Virtual machines** — purchase, list, get, setup, start, stop, restart, recreate, hostname, root/panel password, nameservers, metrics +- **VPS: Firewall** — create, list, delete firewalls; create/update/delete rules; activate/deactivate/sync per VM +- **VPS: Docker Manager** — compose projects: create, update, start, stop, restart, down, containers, logs +- **VPS: Snapshots** — create, get, delete, restore (one snapshot per VM) +- **VPS: Public keys / Post-install scripts / PTR records / Backups / Recovery / Malware scanner / OS templates / Data centers / Actions** +- **DNS** — get/update/delete zone records (bulk), reset, validate; snapshots: list, get, restore +- **Domains** — portfolio (purchase, nameservers, privacy, lock), forwarding, WHOIS, availability +- **Hosting** — websites, subdomains, databases, WordPress, Node.js builds, datacenters, orders +- **Billing** — catalog, subscriptions, auto-renewal, payment methods +- **Reach** — contacts, segments, profiles + +## License + +MIT diff --git a/packages/hostinger/package.json b/packages/hostinger/package.json new file mode 100644 index 000000000..37fbfd6eb --- /dev/null +++ b/packages/hostinger/package.json @@ -0,0 +1,88 @@ +{ + "name": "@distilled.cloud/hostinger", + "version": "0.2.0-alpha", + "repository": { + "type": "git", + "url": "https://github.com/alchemy-run/distilled", + "directory": "packages/hostinger" + }, + "type": "module", + "sideEffects": false, + "module": "src/index.ts", + "files": [ + "lib", + "src" + ], + "exports": { + ".": { + "types": "./lib/index.d.ts", + "bun": "./src/index.ts", + "default": "./lib/index.js" + }, + "./Category": { + "types": "./lib/category.d.ts", + "bun": "./src/category.ts", + "default": "./lib/category.js" + }, + "./Client": { + "types": "./lib/client.d.ts", + "bun": "./src/client.ts", + "default": "./lib/client.js" + }, + "./Credentials": { + "types": "./lib/credentials.d.ts", + "bun": "./src/credentials.ts", + "default": "./lib/credentials.js" + }, + "./Errors": { + "types": "./lib/errors.d.ts", + "bun": "./src/errors.ts", + "default": "./lib/errors.js" + }, + "./Operations": { + "types": "./lib/operations/index.d.ts", + "bun": "./src/operations/index.ts", + "default": "./lib/operations/index.js" + }, + "./Retry": { + "types": "./lib/retry.d.ts", + "bun": "./src/retry.ts", + "default": "./lib/retry.js" + }, + "./Sensitive": { + "types": "./lib/sensitive.d.ts", + "bun": "./src/sensitive.ts", + "default": "./lib/sensitive.js" + }, + "./Traits": { + "types": "./lib/traits.d.ts", + "bun": "./src/traits.ts", + "default": "./lib/traits.js" + } + }, + "scripts": { + "typecheck": "tsgo", + "build": "tsgo -b", + "fmt": "oxfmt --write src", + "lint": "oxlint --fix src", + "check": "tsgo && oxlint src && oxfmt --check src", + "test": "bunx vitest run test --passWithNoTests", + "publish:npm": "bun run build && bun publish --access public", + "generate": "bun run scripts/generate.ts && oxlint --fix src && oxfmt --write src && oxfmt --write src", + "specs:fetch": "git submodule update --force --init --recursive --depth=1 specs/api && git -C specs/api checkout -- .", + "specs:update": "git -C specs/api fetch && git -C specs/api checkout main && git -C specs/api pull" + }, + "dependencies": { + "@distilled.cloud/core": "workspace:*", + "effect": "catalog:" + }, + "devDependencies": { + "@types/bun": "catalog:", + "@types/node": "catalog:", + "dotenv": "catalog:", + "vitest": "catalog:" + }, + "peerDependencies": { + "effect": "catalog:" + } +} diff --git a/packages/hostinger/patches/001-add-subscription-cancel.patch.json b/packages/hostinger/patches/001-add-subscription-cancel.patch.json new file mode 100644 index 000000000..fd950aa18 --- /dev/null +++ b/packages/hostinger/patches/001-add-subscription-cancel.patch.json @@ -0,0 +1,40 @@ +{ + "description": "Add the undocumented DELETE /api/billing/v1/subscriptions/{subscriptionId} (cancel subscription) endpoint. Not present in the published OpenAPI spec, but used by Hostinger's own official Terraform provider (hostinger/terraform-provider-hostinger hostinger/client.go CancelSubscription), which treats HTTP 200/204 as success. This is the only way to delete a VPS: cancelling its backing billing subscription.", + "patches": [ + { + "op": "add", + "path": "/paths/~1api~1billing~1v1~1subscriptions~1{subscriptionId}", + "value": { + "delete": { + "tags": ["Billing: Subscriptions"], + "summary": "Cancel subscription", + "description": "Cancel a subscription. UNDOCUMENTED endpoint observed in Hostinger's official Terraform provider; cancelling the subscription of a VPS deprovisions the virtual machine.", + "operationId": "billing_cancelSubscriptionV1", + "parameters": [ + { + "$ref": "#/components/parameters/subscriptionId" + } + ], + "responses": { + "200": { + "description": "Success empty response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Common.SuccessEmptyResource" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Common.Response.UnauthorizedResponse" + }, + "500": { + "$ref": "#/components/responses/Common.Response.ErrorResponse" + } + } + } + } + } + ] +} diff --git a/packages/hostinger/patches/002-action-state-open-enum.patch.json b/packages/hostinger/patches/002-action-state-open-enum.patch.json new file mode 100644 index 000000000..3ad5a6bd6 --- /dev/null +++ b/packages/hostinger/patches/002-action-state-open-enum.patch.json @@ -0,0 +1,13 @@ +{ + "description": "Drop the closed enum on action state. The published spec declares success|error|delayed|sent|created, but the live API also returns at least \"started\" (observed on a ct_set_hostname action during live testing, 2026-06-11), which made schema decoding fail. The set of states is provably open — treat it as a plain string and let clients pattern-match the terminal states they know.", + "patches": [ + { + "op": "remove", + "path": "/components/schemas/VPS.V1.Action.ActionResource/properties/state/enum" + }, + { + "op": "remove", + "path": "/components/schemas/VPS.V1.Action.ActionResource/properties/state/x-enum-descriptions" + } + ] +} diff --git a/packages/hostinger/scripts/generate.ts b/packages/hostinger/scripts/generate.ts new file mode 100644 index 000000000..a50ff044a --- /dev/null +++ b/packages/hostinger/scripts/generate.ts @@ -0,0 +1,24 @@ +/** + * Hostinger SDK Code Generator + * + * Uses the shared OpenAPI generator from sdk-core to generate operations + * from the Hostinger OpenAPI 3.0 spec (specs/api submodule, openapi.json + * at the repo root). + */ +import * as path from "path"; +import { generateFromOpenAPI } from "@distilled.cloud/core/openapi/generate"; + +const rootDir = path.join(import.meta.dir, ".."); + +generateFromOpenAPI({ + specPath: path.join(rootDir, "specs/api/openapi.json"), + patchDir: path.join(rootDir, "patches"), + outputDir: path.join(rootDir, "src/operations"), + importPrefix: "..", + clientImport: "../client", + traitsImport: "../traits", + sensitiveImport: "../sensitive", + errorsImport: "../errors", + includeOperationErrors: true, + skipDeprecated: true, +}); diff --git a/packages/hostinger/specs/api b/packages/hostinger/specs/api new file mode 160000 index 000000000..fed3b0683 --- /dev/null +++ b/packages/hostinger/specs/api @@ -0,0 +1 @@ +Subproject commit fed3b0683d3b98d504725d7f12c15ca34701d322 diff --git a/packages/hostinger/src/category.ts b/packages/hostinger/src/category.ts new file mode 100644 index 000000000..a09ac2ecc --- /dev/null +++ b/packages/hostinger/src/category.ts @@ -0,0 +1,4 @@ +/** + * Re-export the shared category system from sdk-core. + */ +export * from "@distilled.cloud/core/category"; diff --git a/packages/hostinger/src/client.ts b/packages/hostinger/src/client.ts new file mode 100644 index 000000000..67f8ec49a --- /dev/null +++ b/packages/hostinger/src/client.ts @@ -0,0 +1,95 @@ +/** + * Hostinger API Client. + * + * Wraps the shared REST client from sdk-core with Hostinger-specific + * error matching and credential handling. + */ +import * as Effect from "effect/Effect"; +import * as Redacted from "effect/Redacted"; +import * as Schema from "effect/Schema"; +import { makeAPI } from "@distilled.cloud/core/client"; +import { parseRetryAfterForStatus } from "@distilled.cloud/core/retry-after"; +import { + HTTP_STATUS_MAP, + UnknownHostingerError, + HostingerParseError, + HostingerValidationError, +} from "./errors.ts"; + +// Re-export for backwards compatibility +export { UnknownHostingerError } from "./errors.ts"; +import { Credentials } from "./credentials.ts"; +import { Retry } from "./retry.ts"; + +// API Error Response Schema — Hostinger errors are +// { message: string, correlation_id?: string } and validation errors (422) +// additionally carry { errors: Record }. +const ApiErrorResponse = Schema.Struct({ + message: Schema.String, + correlation_id: Schema.optional(Schema.String), + errors: Schema.optional( + Schema.Record(Schema.String, Schema.Array(Schema.String)), + ), +}); + +/** + * Match a Hostinger API error response to the appropriate error class based on HTTP status. + * + * For status codes whose error class declares `retryAfter`, pass + * `retryAfter: parseRetryAfterForStatus(status, headers)`. That is `undefined` + * when no standard `Retry-After` / `RateLimit` hint is present — omitting the + * field is fine; the default retry policy still uses exponential backoff. + * For bespoke rate-limit hints, parse them here and pass `retryAfter` when known. + */ +const matchError = ( + status: number, + errorBody: unknown, + _errors?: readonly unknown[], + headers?: Record, +): Effect.Effect => { + try { + const parsed = Schema.decodeUnknownSync(ApiErrorResponse)(errorBody); + // 422 with per-field details → typed validation error + if (status === 422 && parsed.errors !== undefined) { + return Effect.fail( + new HostingerValidationError({ + message: parsed.message, + errors: parsed.errors, + correlationId: parsed.correlation_id, + }), + ); + } + const ErrorClass = (HTTP_STATUS_MAP as any)[status]; + if (ErrorClass) { + return Effect.fail( + new ErrorClass({ + message: parsed.message ?? "", + retryAfter: parseRetryAfterForStatus(status, headers), + }), + ); + } + return Effect.fail( + new UnknownHostingerError({ + message: parsed.message, + body: errorBody, + }), + ); + } catch { + return Effect.fail(new UnknownHostingerError({ body: errorBody })); + } +}; + +/** + * Hostinger API client. + */ +export const API = makeAPI({ + credentials: Credentials as any, + getBaseUrl: (creds: any) => creds.apiBaseUrl, + // Hostinger uses HTTP Bearer token auth (token from hpanel.hostinger.com/profile/api) + getAuthHeaders: (creds: any): Record => ({ + Authorization: `Bearer ${Redacted.value(creds.apiKey)}`, + }), + matchError, + ParseError: HostingerParseError as any, + retry: Retry as any, +}); diff --git a/packages/hostinger/src/credentials.ts b/packages/hostinger/src/credentials.ts new file mode 100644 index 000000000..b493797cf --- /dev/null +++ b/packages/hostinger/src/credentials.ts @@ -0,0 +1,36 @@ +import { ConfigError } from "@distilled.cloud/core/errors"; +import * as Context from "effect/Context"; +import * as Effect from "effect/Effect"; +import * as Layer from "effect/Layer"; +import * as Redacted from "effect/Redacted"; + +export const DEFAULT_API_BASE_URL = "https://developers.hostinger.com"; + +export interface Config { + readonly apiKey: Redacted.Redacted; + readonly apiBaseUrl: string; +} + +export class Credentials extends Context.Service< + Credentials, + Effect.Effect +>()("HostingerCredentials") {} + +export const CredentialsFromEnv = Layer.succeed( + Credentials, + Effect.gen(function* () { + const apiKey = process.env.HOSTINGER_API_TOKEN; + + if (!apiKey) { + return yield* new ConfigError({ + message: + "HOSTINGER_API_TOKEN environment variable is required — create a token at https://hpanel.hostinger.com/profile/api", + }); + } + + return { + apiKey: Redacted.make(apiKey), + apiBaseUrl: process.env.HOSTINGER_API_BASE_URL ?? DEFAULT_API_BASE_URL, + }; + }).pipe(Effect.orDie), +); diff --git a/packages/hostinger/src/errors.ts b/packages/hostinger/src/errors.ts new file mode 100644 index 000000000..f98d9a44a --- /dev/null +++ b/packages/hostinger/src/errors.ts @@ -0,0 +1,59 @@ +/** + * Hostinger-specific error types. + * + * Re-exports common HTTP errors from sdk-core and adds Hostinger-specific + * error matching and API error types. + */ +export { + BadGateway, + BadRequest, + Conflict, + ConfigError, + Forbidden, + GatewayTimeout, + InternalServerError, + Locked, + NotFound, + ServiceUnavailable, + TooManyRequests, + Unauthorized, + UnprocessableEntity, + HTTP_STATUS_MAP, + DEFAULT_ERRORS, + API_ERRORS, +} from "@distilled.cloud/core/errors"; +export type { DefaultErrors } from "@distilled.cloud/core/errors"; + +import * as Schema from "effect/Schema"; +import * as Category from "@distilled.cloud/core/category"; + +// Validation error (422) - carries per-field error details from the API +export class HostingerValidationError extends Schema.TaggedErrorClass()( + "HostingerValidationError", + { + message: Schema.String, + errors: Schema.optional( + Schema.Record(Schema.String, Schema.Array(Schema.String)), + ), + correlationId: Schema.optional(Schema.String), + }, +).pipe(Category.withBadRequestError) {} + +// Unknown Hostinger error - returned when an error code is not recognized +export class UnknownHostingerError extends Schema.TaggedErrorClass()( + "UnknownHostingerError", + { + code: Schema.optional(Schema.String), + message: Schema.optional(Schema.String), + body: Schema.Unknown, + }, +).pipe(Category.withServerError) {} + +// Schema parse error wrapper +export class HostingerParseError extends Schema.TaggedErrorClass()( + "HostingerParseError", + { + body: Schema.Unknown, + cause: Schema.Unknown, + }, +).pipe(Category.withParseError) {} diff --git a/packages/hostinger/src/index.ts b/packages/hostinger/src/index.ts new file mode 100644 index 000000000..5d3915c38 --- /dev/null +++ b/packages/hostinger/src/index.ts @@ -0,0 +1,16 @@ +/** + * Hostinger SDK for Effect + * + * @example + * \`\`\`ts + * import * as Hostinger from "@distilled.cloud/hostinger"; + * \`\`\` + */ +export * from "./credentials.ts"; +export * as Category from "./category.ts"; +export * as T from "./traits.ts"; +export * as Retry from "./retry.ts"; +export { API } from "./client.ts"; +export * from "./errors.ts"; +export * from "./operations/index.ts"; +export { SensitiveString, SensitiveNullableString } from "./sensitive.ts"; diff --git a/packages/hostinger/src/operations/DNSDeleteDNSRecordsV1.ts b/packages/hostinger/src/operations/DNSDeleteDNSRecordsV1.ts new file mode 100644 index 000000000..adb1d66de --- /dev/null +++ b/packages/hostinger/src/operations/DNSDeleteDNSRecordsV1.ts @@ -0,0 +1,57 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const DNSDeleteDNSRecordsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + filters: Schema.Array( + Schema.Struct({ + name: Schema.String, + type: Schema.Literals([ + "A", + "AAAA", + "CNAME", + "ALIAS", + "MX", + "TXT", + "NS", + "SOA", + "SRV", + "CAA", + ]), + }), + ), + }).pipe(T.Http({ method: "DELETE", path: "/api/dns/v1/zones/{domain}" })); +export type DNSDeleteDNSRecordsV1Input = typeof DNSDeleteDNSRecordsV1Input.Type; + +// Output Schema +export const DNSDeleteDNSRecordsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type DNSDeleteDNSRecordsV1Output = + typeof DNSDeleteDNSRecordsV1Output.Type; + +// The operation +/** + * Delete DNS records + * + * Delete DNS records for the selected domain. + * To filter which records to delete, add the `name` of the record and `type` to the filter. + * Multiple filters can be provided with single request. + * If you have multiple records with the same name and type, and you want to delete only part of them, + * refer to the `Update zone records` endpoint. + * Use this endpoint to remove specific DNS records from domains. + * + * @param domain - Domain name + */ +export const DNSDeleteDNSRecordsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: DNSDeleteDNSRecordsV1Input, + outputSchema: DNSDeleteDNSRecordsV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/DNSGetDNSRecordsV1.ts b/packages/hostinger/src/operations/DNSGetDNSRecordsV1.ts new file mode 100644 index 000000000..95bc7c5a5 --- /dev/null +++ b/packages/hostinger/src/operations/DNSGetDNSRecordsV1.ts @@ -0,0 +1,56 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DNSGetDNSRecordsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + }).pipe(T.Http({ method: "GET", path: "/api/dns/v1/zones/{domain}" })); +export type DNSGetDNSRecordsV1Input = typeof DNSGetDNSRecordsV1Input.Type; + +// Output Schema +export const DNSGetDNSRecordsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + name: Schema.optional(Schema.String), + records: Schema.optional( + Schema.Array( + Schema.Struct({ + content: Schema.optional(Schema.String), + is_disabled: Schema.optional(Schema.Boolean), + }), + ), + ), + ttl: Schema.optional(Schema.Number), + type: Schema.optional( + Schema.Literals([ + "A", + "AAAA", + "CNAME", + "ALIAS", + "MX", + "TXT", + "NS", + "SOA", + "SRV", + "CAA", + ]), + ), + }), + ); +export type DNSGetDNSRecordsV1Output = typeof DNSGetDNSRecordsV1Output.Type; + +// The operation +/** + * Get DNS records + * + * Retrieve DNS zone records for a specific domain. + * Use this endpoint to view current DNS configuration for domain management. + * + * @param domain - Domain name + */ +export const DNSGetDNSRecordsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: DNSGetDNSRecordsV1Input, + outputSchema: DNSGetDNSRecordsV1Output, +})); diff --git a/packages/hostinger/src/operations/DNSGetDNSSnapshotListV1.ts b/packages/hostinger/src/operations/DNSGetDNSSnapshotListV1.ts new file mode 100644 index 000000000..ffadfbcde --- /dev/null +++ b/packages/hostinger/src/operations/DNSGetDNSSnapshotListV1.ts @@ -0,0 +1,39 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DNSGetDNSSnapshotListV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + }).pipe(T.Http({ method: "GET", path: "/api/dns/v1/snapshots/{domain}" })); +export type DNSGetDNSSnapshotListV1Input = + typeof DNSGetDNSSnapshotListV1Input.Type; + +// Output Schema +export const DNSGetDNSSnapshotListV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + reason: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + }), + ); +export type DNSGetDNSSnapshotListV1Output = + typeof DNSGetDNSSnapshotListV1Output.Type; + +// The operation +/** + * Get DNS snapshot list + * + * Retrieve DNS snapshots for a domain. + * Use this endpoint to view available DNS backup points for restoration. + * + * @param domain - Domain name + */ +export const DNSGetDNSSnapshotListV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: DNSGetDNSSnapshotListV1Input, + outputSchema: DNSGetDNSSnapshotListV1Output, + }), +); diff --git a/packages/hostinger/src/operations/DNSGetDNSSnapshotV1.ts b/packages/hostinger/src/operations/DNSGetDNSSnapshotV1.ts new file mode 100644 index 000000000..fee74225d --- /dev/null +++ b/packages/hostinger/src/operations/DNSGetDNSSnapshotV1.ts @@ -0,0 +1,70 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DNSGetDNSSnapshotV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + snapshotId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "GET", + path: "/api/dns/v1/snapshots/{domain}/{snapshotId}", + }), + ); +export type DNSGetDNSSnapshotV1Input = typeof DNSGetDNSSnapshotV1Input.Type; + +// Output Schema +export const DNSGetDNSSnapshotV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + reason: Schema.optional(Schema.String), + snapshot: Schema.optional( + Schema.Array( + Schema.Struct({ + name: Schema.optional(Schema.String), + records: Schema.optional( + Schema.Array( + Schema.Struct({ + content: Schema.optional(Schema.String), + is_disabled: Schema.optional(Schema.Boolean), + }), + ), + ), + ttl: Schema.optional(Schema.Number), + type: Schema.optional( + Schema.Literals([ + "A", + "AAAA", + "CNAME", + "ALIAS", + "MX", + "TXT", + "NS", + "SOA", + "SRV", + "CAA", + ]), + ), + }), + ), + ), + created_at: Schema.optional(Schema.String), + }); +export type DNSGetDNSSnapshotV1Output = typeof DNSGetDNSSnapshotV1Output.Type; + +// The operation +/** + * Get DNS snapshot + * + * Retrieve particular DNS snapshot with contents of DNS zone records. + * Use this endpoint to view historical DNS configurations for domains. + * + * @param domain - Domain name + * @param snapshotId - Snapshot ID + */ +export const DNSGetDNSSnapshotV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: DNSGetDNSSnapshotV1Input, + outputSchema: DNSGetDNSSnapshotV1Output, +})); diff --git a/packages/hostinger/src/operations/DNSResetDNSRecordsV1.ts b/packages/hostinger/src/operations/DNSResetDNSRecordsV1.ts new file mode 100644 index 000000000..2a7dbca69 --- /dev/null +++ b/packages/hostinger/src/operations/DNSResetDNSRecordsV1.ts @@ -0,0 +1,38 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const DNSResetDNSRecordsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + sync: Schema.optional(Schema.Boolean), + reset_email_records: Schema.optional(Schema.Boolean), + whitelisted_record_types: Schema.optional(Schema.Array(Schema.String)), + }).pipe(T.Http({ method: "POST", path: "/api/dns/v1/zones/{domain}/reset" })); +export type DNSResetDNSRecordsV1Input = typeof DNSResetDNSRecordsV1Input.Type; + +// Output Schema +export const DNSResetDNSRecordsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type DNSResetDNSRecordsV1Output = typeof DNSResetDNSRecordsV1Output.Type; + +// The operation +/** + * Reset DNS records + * + * Reset DNS zone to the default records. + * Use this endpoint to restore domain DNS to original configuration. + * + * @param domain - Domain name + */ +export const DNSResetDNSRecordsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: DNSResetDNSRecordsV1Input, + outputSchema: DNSResetDNSRecordsV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/DNSRestoreDNSSnapshotV1.ts b/packages/hostinger/src/operations/DNSRestoreDNSSnapshotV1.ts new file mode 100644 index 000000000..1657420bd --- /dev/null +++ b/packages/hostinger/src/operations/DNSRestoreDNSSnapshotV1.ts @@ -0,0 +1,42 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DNSRestoreDNSSnapshotV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + snapshotId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "POST", + path: "/api/dns/v1/snapshots/{domain}/{snapshotId}/restore", + }), + ); +export type DNSRestoreDNSSnapshotV1Input = + typeof DNSRestoreDNSSnapshotV1Input.Type; + +// Output Schema +export const DNSRestoreDNSSnapshotV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type DNSRestoreDNSSnapshotV1Output = + typeof DNSRestoreDNSSnapshotV1Output.Type; + +// The operation +/** + * Restore DNS snapshot + * + * Restore DNS zone to the selected snapshot. + * Use this endpoint to revert domain DNS to a previous configuration. + * + * @param domain - Domain name + * @param snapshotId - Snapshot ID + */ +export const DNSRestoreDNSSnapshotV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: DNSRestoreDNSSnapshotV1Input, + outputSchema: DNSRestoreDNSSnapshotV1Output, + }), +); diff --git a/packages/hostinger/src/operations/DNSUpdateDNSRecordsV1.ts b/packages/hostinger/src/operations/DNSUpdateDNSRecordsV1.ts new file mode 100644 index 000000000..c822b51ca --- /dev/null +++ b/packages/hostinger/src/operations/DNSUpdateDNSRecordsV1.ts @@ -0,0 +1,62 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const DNSUpdateDNSRecordsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + overwrite: Schema.optional(Schema.Boolean), + zone: Schema.Array( + Schema.Struct({ + name: Schema.String, + records: Schema.Array( + Schema.Struct({ + content: Schema.String, + }), + ), + ttl: Schema.optional(Schema.Number), + type: Schema.Literals([ + "A", + "AAAA", + "CNAME", + "ALIAS", + "MX", + "TXT", + "NS", + "SOA", + "SRV", + "CAA", + ]), + }), + ), + }).pipe(T.Http({ method: "PUT", path: "/api/dns/v1/zones/{domain}" })); +export type DNSUpdateDNSRecordsV1Input = typeof DNSUpdateDNSRecordsV1Input.Type; + +// Output Schema +export const DNSUpdateDNSRecordsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type DNSUpdateDNSRecordsV1Output = + typeof DNSUpdateDNSRecordsV1Output.Type; + +// The operation +/** + * Update DNS records + * + * Update DNS records for the selected domain. + * Using `overwrite = true` will replace existing records with the provided ones. + * Otherwise existing records will be updated and new records will be added. + * Use this endpoint to modify domain DNS configuration. + * + * @param domain - Domain name + */ +export const DNSUpdateDNSRecordsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: DNSUpdateDNSRecordsV1Input, + outputSchema: DNSUpdateDNSRecordsV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/DNSValidateDNSRecordsV1.ts b/packages/hostinger/src/operations/DNSValidateDNSRecordsV1.ts new file mode 100644 index 000000000..5d6e07c9b --- /dev/null +++ b/packages/hostinger/src/operations/DNSValidateDNSRecordsV1.ts @@ -0,0 +1,65 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const DNSValidateDNSRecordsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + overwrite: Schema.optional(Schema.Boolean), + zone: Schema.Array( + Schema.Struct({ + name: Schema.String, + records: Schema.Array( + Schema.Struct({ + content: Schema.String, + }), + ), + ttl: Schema.optional(Schema.Number), + type: Schema.Literals([ + "A", + "AAAA", + "CNAME", + "ALIAS", + "MX", + "TXT", + "NS", + "SOA", + "SRV", + "CAA", + ]), + }), + ), + }).pipe( + T.Http({ method: "POST", path: "/api/dns/v1/zones/{domain}/validate" }), + ); +export type DNSValidateDNSRecordsV1Input = + typeof DNSValidateDNSRecordsV1Input.Type; + +// Output Schema +export const DNSValidateDNSRecordsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type DNSValidateDNSRecordsV1Output = + typeof DNSValidateDNSRecordsV1Output.Type; + +// The operation +/** + * Validate DNS records + * + * Validate DNS records prior to update for the selected domain. + * If the validation is successful, the response will contain `200 Success` code. + * If there is validation error, the response will fail with `422 Validation error` code. + * Use this endpoint to verify DNS record validity before applying changes. + * + * @param domain - Domain name + */ +export const DNSValidateDNSRecordsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: DNSValidateDNSRecordsV1Input, + outputSchema: DNSValidateDNSRecordsV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSActivateFirewallV1.ts b/packages/hostinger/src/operations/VPSActivateFirewallV1.ts new file mode 100644 index 000000000..47d61ab7a --- /dev/null +++ b/packages/hostinger/src/operations/VPSActivateFirewallV1.ts @@ -0,0 +1,48 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSActivateFirewallV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + firewallId: Schema.Number.pipe(T.PathParam()), + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/firewall/{firewallId}/activate/{virtualMachineId}", + }), + ); +export type VPSActivateFirewallV1Input = typeof VPSActivateFirewallV1Input.Type; + +// Output Schema +export const VPSActivateFirewallV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSActivateFirewallV1Output = + typeof VPSActivateFirewallV1Output.Type; + +// The operation +/** + * Activate firewall + * + * Activate a firewall for a specified virtual machine. + * Only one firewall can be active for a virtual machine at a time. + * Use this endpoint to apply firewall rules to VPS instances. + * + * @param firewallId - Firewall ID + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSActivateFirewallV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSActivateFirewallV1Input, + outputSchema: VPSActivateFirewallV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSAttachPublicKeyV1.ts b/packages/hostinger/src/operations/VPSAttachPublicKeyV1.ts new file mode 100644 index 000000000..759bd9445 --- /dev/null +++ b/packages/hostinger/src/operations/VPSAttachPublicKeyV1.ts @@ -0,0 +1,46 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSAttachPublicKeyV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + ids: Schema.Array(Schema.Number), + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/public-keys/attach/{virtualMachineId}", + }), + ); +export type VPSAttachPublicKeyV1Input = typeof VPSAttachPublicKeyV1Input.Type; + +// Output Schema +export const VPSAttachPublicKeyV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSAttachPublicKeyV1Output = typeof VPSAttachPublicKeyV1Output.Type; + +// The operation +/** + * Attach public key + * + * Attach existing public keys from your account to a specified virtual machine. + * Multiple keys can be attached to a single virtual machine. + * Use this endpoint to enable SSH key authentication for VPS instances. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSAttachPublicKeyV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSAttachPublicKeyV1Input, + outputSchema: VPSAttachPublicKeyV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSCreateFirewallRuleV1.ts b/packages/hostinger/src/operations/VPSCreateFirewallRuleV1.ts new file mode 100644 index 000000000..ef4e816ac --- /dev/null +++ b/packages/hostinger/src/operations/VPSCreateFirewallRuleV1.ts @@ -0,0 +1,82 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSCreateFirewallRuleV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + firewallId: Schema.Number.pipe(T.PathParam()), + protocol: Schema.Literals([ + "TCP", + "UDP", + "ICMP", + "GRE", + "any", + "ESP", + "AH", + "ICMPv6", + "SSH", + "HTTP", + "HTTPS", + "MySQL", + "PostgreSQL", + ]), + port: Schema.String, + source: Schema.Literals(["any", "custom"]), + source_detail: Schema.String, + }).pipe( + T.Http({ method: "POST", path: "/api/vps/v1/firewall/{firewallId}/rules" }), + ); +export type VPSCreateFirewallRuleV1Input = + typeof VPSCreateFirewallRuleV1Input.Type; + +// Output Schema +export const VPSCreateFirewallRuleV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + action: Schema.optional(Schema.Literals(["accept", "drop"])), + protocol: Schema.optional( + Schema.Literals([ + "TCP", + "UDP", + "ICMP", + "GRE", + "any", + "ESP", + "AH", + "ICMPv6", + "SSH", + "HTTP", + "HTTPS", + "MySQL", + "PostgreSQL", + ]), + ), + port: Schema.optional(Schema.String), + source: Schema.optional(Schema.String), + source_detail: Schema.optional(Schema.String), + }); +export type VPSCreateFirewallRuleV1Output = + typeof VPSCreateFirewallRuleV1Output.Type; + +// The operation +/** + * Create firewall rule + * + * Create new firewall rule for a specified firewall. + * By default, the firewall drops all incoming traffic, + * which means you must add accept rules for all ports you want to use. + * Any virtual machine that has this firewall activated will lose sync with the firewall + * and will have to be synced again manually. + * Use this endpoint to add new security rules to firewalls. + * + * @param firewallId - Firewall ID + */ +export const VPSCreateFirewallRuleV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSCreateFirewallRuleV1Input, + outputSchema: VPSCreateFirewallRuleV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSCreateNewFirewallV1.ts b/packages/hostinger/src/operations/VPSCreateNewFirewallV1.ts new file mode 100644 index 000000000..8b620bcf5 --- /dev/null +++ b/packages/hostinger/src/operations/VPSCreateNewFirewallV1.ts @@ -0,0 +1,67 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSCreateNewFirewallV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + name: Schema.String, + }).pipe(T.Http({ method: "POST", path: "/api/vps/v1/firewall" })); +export type VPSCreateNewFirewallV1Input = + typeof VPSCreateNewFirewallV1Input.Type; + +// Output Schema +export const VPSCreateNewFirewallV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + is_synced: Schema.optional(Schema.Boolean), + rules: Schema.optional( + Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + action: Schema.optional(Schema.Literals(["accept", "drop"])), + protocol: Schema.optional( + Schema.Literals([ + "TCP", + "UDP", + "ICMP", + "GRE", + "any", + "ESP", + "AH", + "ICMPv6", + "SSH", + "HTTP", + "HTTPS", + "MySQL", + "PostgreSQL", + ]), + ), + port: Schema.optional(Schema.String), + source: Schema.optional(Schema.String), + source_detail: Schema.optional(Schema.String), + }), + ), + ), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSCreateNewFirewallV1Output = + typeof VPSCreateNewFirewallV1Output.Type; + +// The operation +/** + * Create new firewall + * + * Create a new firewall. + * Use this endpoint to set up new firewall configurations for VPS security. + */ +export const VPSCreateNewFirewallV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSCreateNewFirewallV1Input, + outputSchema: VPSCreateNewFirewallV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSCreateNewProjectV1.ts b/packages/hostinger/src/operations/VPSCreateNewProjectV1.ts new file mode 100644 index 000000000..a5af3e2af --- /dev/null +++ b/packages/hostinger/src/operations/VPSCreateNewProjectV1.ts @@ -0,0 +1,52 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSCreateNewProjectV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + project_name: Schema.String, + content: Schema.String, + environment: Schema.optional(Schema.NullOr(Schema.String)), + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/docker", + }), + ); +export type VPSCreateNewProjectV1Input = typeof VPSCreateNewProjectV1Input.Type; + +// Output Schema +export const VPSCreateNewProjectV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSCreateNewProjectV1Output = + typeof VPSCreateNewProjectV1Output.Type; + +// The operation +/** + * Create new project + * + * Deploy new project from docker-compose.yaml contents or download contents from URL. + * URL can be Github repository url in format https://github.com/[user]/[repo] + * and it will be automatically resolved to docker-compose.yaml file in + * master branch. Any other URL provided must return docker-compose.yaml + * file contents. + * If project with the same name already exists, existing project will be replaced. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSCreateNewProjectV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSCreateNewProjectV1Input, + outputSchema: VPSCreateNewProjectV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSCreatePTRRecordV1.ts b/packages/hostinger/src/operations/VPSCreatePTRRecordV1.ts new file mode 100644 index 000000000..00e4fcd78 --- /dev/null +++ b/packages/hostinger/src/operations/VPSCreatePTRRecordV1.ts @@ -0,0 +1,47 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSCreatePTRRecordV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + ipAddressId: Schema.Number.pipe(T.PathParam()), + domain: Schema.String, + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/ptr/{ipAddressId}", + }), + ); +export type VPSCreatePTRRecordV1Input = typeof VPSCreatePTRRecordV1Input.Type; + +// Output Schema +export const VPSCreatePTRRecordV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSCreatePTRRecordV1Output = typeof VPSCreatePTRRecordV1Output.Type; + +// The operation +/** + * Create PTR record + * + * Create or update a PTR (Pointer) record for a specified virtual machine. + * Use this endpoint to configure reverse DNS lookup for VPS IP addresses. + * + * @param virtualMachineId - Virtual Machine ID + * @param ipAddressId - IP Address ID + */ +export const VPSCreatePTRRecordV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSCreatePTRRecordV1Input, + outputSchema: VPSCreatePTRRecordV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSCreatePostInstallScriptV1.ts b/packages/hostinger/src/operations/VPSCreatePostInstallScriptV1.ts new file mode 100644 index 000000000..4485af7ee --- /dev/null +++ b/packages/hostinger/src/operations/VPSCreatePostInstallScriptV1.ts @@ -0,0 +1,42 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSCreatePostInstallScriptV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + name: Schema.String, + content: Schema.String, + }).pipe(T.Http({ method: "POST", path: "/api/vps/v1/post-install-scripts" })); +export type VPSCreatePostInstallScriptV1Input = + typeof VPSCreatePostInstallScriptV1Input.Type; + +// Output Schema +export const VPSCreatePostInstallScriptV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + content: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSCreatePostInstallScriptV1Output = + typeof VPSCreatePostInstallScriptV1Output.Type; + +// The operation +/** + * Create post-install script + * + * Add a new post-install script to your account, which can then be used after virtual machine installation. + * The script contents will be saved to the file `/post_install` with executable attribute set + * and will be executed once virtual machine is installed. + * The output of the script will be redirected to `/post_install.log`. Maximum script size is 48KB. + * Use this endpoint to create automation scripts for VPS setup tasks. + */ +export const VPSCreatePostInstallScriptV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSCreatePostInstallScriptV1Input, + outputSchema: VPSCreatePostInstallScriptV1Output, + errors: [UnprocessableEntity] as const, + })); diff --git a/packages/hostinger/src/operations/VPSCreatePublicKeyV1.ts b/packages/hostinger/src/operations/VPSCreatePublicKeyV1.ts new file mode 100644 index 000000000..7d381e2e2 --- /dev/null +++ b/packages/hostinger/src/operations/VPSCreatePublicKeyV1.ts @@ -0,0 +1,36 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSCreatePublicKeyV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + name: Schema.String, + key: Schema.String, + }).pipe(T.Http({ method: "POST", path: "/api/vps/v1/public-keys" })); +export type VPSCreatePublicKeyV1Input = typeof VPSCreatePublicKeyV1Input.Type; + +// Output Schema +export const VPSCreatePublicKeyV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + key: Schema.optional(Schema.String), + }); +export type VPSCreatePublicKeyV1Output = typeof VPSCreatePublicKeyV1Output.Type; + +// The operation +/** + * Create public key + * + * Add a new public key to your account. + * Use this endpoint to register SSH keys for VPS authentication. + */ +export const VPSCreatePublicKeyV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSCreatePublicKeyV1Input, + outputSchema: VPSCreatePublicKeyV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSCreateSnapshotV1.ts b/packages/hostinger/src/operations/VPSCreateSnapshotV1.ts new file mode 100644 index 000000000..26de81a89 --- /dev/null +++ b/packages/hostinger/src/operations/VPSCreateSnapshotV1.ts @@ -0,0 +1,45 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSCreateSnapshotV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot", + }), + ); +export type VPSCreateSnapshotV1Input = typeof VPSCreateSnapshotV1Input.Type; + +// Output Schema +export const VPSCreateSnapshotV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSCreateSnapshotV1Output = typeof VPSCreateSnapshotV1Output.Type; + +// The operation +/** + * Create snapshot + * + * Create a snapshot of a specified virtual machine. + * A snapshot captures the state and data of the virtual machine at a specific point in time, + * allowing users to restore the virtual machine to that state if needed. + * This operation is useful for backup purposes, system recovery, + * and testing changes without affecting the current state of the virtual machine. + * **Creating new snapshot will overwrite the existing snapshot!** + * Use this endpoint to capture VPS state for backup and recovery purposes. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSCreateSnapshotV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSCreateSnapshotV1Input, + outputSchema: VPSCreateSnapshotV1Output, +})); diff --git a/packages/hostinger/src/operations/VPSDeactivateFirewallV1.ts b/packages/hostinger/src/operations/VPSDeactivateFirewallV1.ts new file mode 100644 index 000000000..df2a6b5d3 --- /dev/null +++ b/packages/hostinger/src/operations/VPSDeactivateFirewallV1.ts @@ -0,0 +1,48 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSDeactivateFirewallV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + firewallId: Schema.Number.pipe(T.PathParam()), + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/firewall/{firewallId}/deactivate/{virtualMachineId}", + }), + ); +export type VPSDeactivateFirewallV1Input = + typeof VPSDeactivateFirewallV1Input.Type; + +// Output Schema +export const VPSDeactivateFirewallV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSDeactivateFirewallV1Output = + typeof VPSDeactivateFirewallV1Output.Type; + +// The operation +/** + * Deactivate firewall + * + * Deactivate a firewall for a specified virtual machine. + * Use this endpoint to remove firewall protection from VPS instances. + * + * @param firewallId - Firewall ID + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSDeactivateFirewallV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSDeactivateFirewallV1Input, + outputSchema: VPSDeactivateFirewallV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSDeleteFirewallRuleV1.ts b/packages/hostinger/src/operations/VPSDeleteFirewallRuleV1.ts new file mode 100644 index 000000000..57d63ac71 --- /dev/null +++ b/packages/hostinger/src/operations/VPSDeleteFirewallRuleV1.ts @@ -0,0 +1,44 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSDeleteFirewallRuleV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + firewallId: Schema.Number.pipe(T.PathParam()), + ruleId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/vps/v1/firewall/{firewallId}/rules/{ruleId}", + }), + ); +export type VPSDeleteFirewallRuleV1Input = + typeof VPSDeleteFirewallRuleV1Input.Type; + +// Output Schema +export const VPSDeleteFirewallRuleV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type VPSDeleteFirewallRuleV1Output = + typeof VPSDeleteFirewallRuleV1Output.Type; + +// The operation +/** + * Delete firewall rule + * + * Delete a specific firewall rule from a specified firewall. + * Any virtual machine that has this firewall activated will lose sync with the firewall + * and will have to be synced again manually. + * Use this endpoint to remove specific firewall rules. + * + * @param firewallId - Firewall ID + * @param ruleId - Firewall Rule ID + */ +export const VPSDeleteFirewallRuleV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSDeleteFirewallRuleV1Input, + outputSchema: VPSDeleteFirewallRuleV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSDeleteFirewallV1.ts b/packages/hostinger/src/operations/VPSDeleteFirewallV1.ts new file mode 100644 index 000000000..4a652db0f --- /dev/null +++ b/packages/hostinger/src/operations/VPSDeleteFirewallV1.ts @@ -0,0 +1,34 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSDeleteFirewallV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + firewallId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ method: "DELETE", path: "/api/vps/v1/firewall/{firewallId}" }), + ); +export type VPSDeleteFirewallV1Input = typeof VPSDeleteFirewallV1Input.Type; + +// Output Schema +export const VPSDeleteFirewallV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type VPSDeleteFirewallV1Output = typeof VPSDeleteFirewallV1Output.Type; + +// The operation +/** + * Delete firewall + * + * Delete a specified firewall. + * Any virtual machine that has this firewall activated will automatically have it deactivated. + * Use this endpoint to remove unused firewall configurations. + * + * @param firewallId - Firewall ID + */ +export const VPSDeleteFirewallV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSDeleteFirewallV1Input, + outputSchema: VPSDeleteFirewallV1Output, +})); diff --git a/packages/hostinger/src/operations/VPSDeletePTRRecordV1.ts b/packages/hostinger/src/operations/VPSDeletePTRRecordV1.ts new file mode 100644 index 000000000..f260d2ac3 --- /dev/null +++ b/packages/hostinger/src/operations/VPSDeletePTRRecordV1.ts @@ -0,0 +1,46 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSDeletePTRRecordV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + ipAddressId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/ptr/{ipAddressId}", + }), + ); +export type VPSDeletePTRRecordV1Input = typeof VPSDeletePTRRecordV1Input.Type; + +// Output Schema +export const VPSDeletePTRRecordV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSDeletePTRRecordV1Output = typeof VPSDeletePTRRecordV1Output.Type; + +// The operation +/** + * Delete PTR record + * + * Delete a PTR (Pointer) record for a specified virtual machine. + * Once deleted, reverse DNS lookups to the virtual machine's IP address will + * no longer return the previously configured hostname. + * Use this endpoint to remove reverse DNS configuration from VPS instances. + * + * @param virtualMachineId - Virtual Machine ID + * @param ipAddressId - IP Address ID + */ +export const VPSDeletePTRRecordV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSDeletePTRRecordV1Input, + outputSchema: VPSDeletePTRRecordV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSDeletePostInstallScriptV1.ts b/packages/hostinger/src/operations/VPSDeletePostInstallScriptV1.ts new file mode 100644 index 000000000..173457e6f --- /dev/null +++ b/packages/hostinger/src/operations/VPSDeletePostInstallScriptV1.ts @@ -0,0 +1,39 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSDeletePostInstallScriptV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + postInstallScriptId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/vps/v1/post-install-scripts/{postInstallScriptId}", + }), + ); +export type VPSDeletePostInstallScriptV1Input = + typeof VPSDeletePostInstallScriptV1Input.Type; + +// Output Schema +export const VPSDeletePostInstallScriptV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type VPSDeletePostInstallScriptV1Output = + typeof VPSDeletePostInstallScriptV1Output.Type; + +// The operation +/** + * Delete post-install script + * + * Delete a post-install script from your account. + * Use this endpoint to remove unused automation scripts. + * + * @param postInstallScriptId - Post-install script ID + */ +export const VPSDeletePostInstallScriptV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSDeletePostInstallScriptV1Input, + outputSchema: VPSDeletePostInstallScriptV1Output, + })); diff --git a/packages/hostinger/src/operations/VPSDeleteProjectV1.ts b/packages/hostinger/src/operations/VPSDeleteProjectV1.ts new file mode 100644 index 000000000..596b85d58 --- /dev/null +++ b/packages/hostinger/src/operations/VPSDeleteProjectV1.ts @@ -0,0 +1,46 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSDeleteProjectV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + projectName: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/docker/{projectName}/down", + }), + ); +export type VPSDeleteProjectV1Input = typeof VPSDeleteProjectV1Input.Type; + +// Output Schema +export const VPSDeleteProjectV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSDeleteProjectV1Output = typeof VPSDeleteProjectV1Output.Type; + +// The operation +/** + * Delete project + * + * Completely removes a Docker Compose project from the virtual machine, stopping all containers and cleaning up + * associated resources including networks, volumes, and images. + * This operation is irreversible and will delete all project data. + * Use this when you want to permanently remove a project and free up system resources. + * + * @param virtualMachineId - Virtual Machine ID + * @param projectName - Docker Compose project name using alphanumeric characters, dashes, and underscores only + */ +export const VPSDeleteProjectV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSDeleteProjectV1Input, + outputSchema: VPSDeleteProjectV1Output, + errors: [UnprocessableEntity] as const, +})); diff --git a/packages/hostinger/src/operations/VPSDeletePublicKeyV1.ts b/packages/hostinger/src/operations/VPSDeletePublicKeyV1.ts new file mode 100644 index 000000000..054b87008 --- /dev/null +++ b/packages/hostinger/src/operations/VPSDeletePublicKeyV1.ts @@ -0,0 +1,36 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSDeletePublicKeyV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + publicKeyId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ method: "DELETE", path: "/api/vps/v1/public-keys/{publicKeyId}" }), + ); +export type VPSDeletePublicKeyV1Input = typeof VPSDeletePublicKeyV1Input.Type; + +// Output Schema +export const VPSDeletePublicKeyV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type VPSDeletePublicKeyV1Output = typeof VPSDeletePublicKeyV1Output.Type; + +// The operation +/** + * Delete public key + * + * Delete a public key from your account. + * **Deleting public key from account does not remove it from virtual machine** + * Use this endpoint to remove unused SSH keys from account. + * + * @param publicKeyId - Public Key ID + */ +export const VPSDeletePublicKeyV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSDeletePublicKeyV1Input, + outputSchema: VPSDeletePublicKeyV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSDeleteSnapshotV1.ts b/packages/hostinger/src/operations/VPSDeleteSnapshotV1.ts new file mode 100644 index 000000000..079fa0c46 --- /dev/null +++ b/packages/hostinger/src/operations/VPSDeleteSnapshotV1.ts @@ -0,0 +1,40 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSDeleteSnapshotV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot", + }), + ); +export type VPSDeleteSnapshotV1Input = typeof VPSDeleteSnapshotV1Input.Type; + +// Output Schema +export const VPSDeleteSnapshotV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSDeleteSnapshotV1Output = typeof VPSDeleteSnapshotV1Output.Type; + +// The operation +/** + * Delete snapshot + * + * Delete a snapshot of a specified virtual machine. + * Use this endpoint to remove VPS snapshots. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSDeleteSnapshotV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSDeleteSnapshotV1Input, + outputSchema: VPSDeleteSnapshotV1Output, +})); diff --git a/packages/hostinger/src/operations/VPSGetActionDetailsV1.ts b/packages/hostinger/src/operations/VPSGetActionDetailsV1.ts new file mode 100644 index 000000000..0e532ff8d --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetActionDetailsV1.ts @@ -0,0 +1,45 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSGetActionDetailsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + actionId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "GET", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/actions/{actionId}", + }), + ); +export type VPSGetActionDetailsV1Input = typeof VPSGetActionDetailsV1Input.Type; + +// Output Schema +export const VPSGetActionDetailsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSGetActionDetailsV1Output = + typeof VPSGetActionDetailsV1Output.Type; + +// The operation +/** + * Get action details + * + * Retrieve detailed information about a specific action performed on a specified virtual machine. + * Use this endpoint to monitor specific VPS operation status and details. + * + * @param virtualMachineId - Virtual Machine ID + * @param actionId - Action ID + */ +export const VPSGetActionDetailsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSGetActionDetailsV1Input, + outputSchema: VPSGetActionDetailsV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSGetActionsV1.ts b/packages/hostinger/src/operations/VPSGetActionsV1.ts new file mode 100644 index 000000000..addc4d449 --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetActionsV1.ts @@ -0,0 +1,57 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSGetActionsV1Input = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + page: Schema.optional(Schema.Number), +}).pipe( + T.Http({ + method: "GET", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/actions", + }), +); +export type VPSGetActionsV1Input = typeof VPSGetActionsV1Input.Type; + +// Output Schema +export const VPSGetActionsV1Output = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + data: Schema.optional( + Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }), + ), + ), + meta: Schema.optional( + Schema.Struct({ + current_page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + total: Schema.optional(Schema.Number), + }), + ), +}); +export type VPSGetActionsV1Output = typeof VPSGetActionsV1Output.Type; + +// The operation +/** + * Get actions + * + * Retrieve actions performed on a specified virtual machine. + * Actions are operations or events that have been executed on the virtual + * machine, such as starting, stopping, or modifying the machine. This endpoint + * allows you to view the history of these actions, providing details about + * each action, such as the action name, timestamp, and status. + * Use this endpoint to view VPS operation history and troubleshoot issues. + * + * @param virtualMachineId - Virtual Machine ID + * @param page - Page number + */ +export const VPSGetActionsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSGetActionsV1Input, + outputSchema: VPSGetActionsV1Output, +})); diff --git a/packages/hostinger/src/operations/VPSGetAttachedPublicKeysV1.ts b/packages/hostinger/src/operations/VPSGetAttachedPublicKeysV1.ts new file mode 100644 index 000000000..33707aa15 --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetAttachedPublicKeysV1.ts @@ -0,0 +1,57 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSGetAttachedPublicKeysV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + page: Schema.optional(Schema.Number), + }).pipe( + T.Http({ + method: "GET", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/public-keys", + }), + ); +export type VPSGetAttachedPublicKeysV1Input = + typeof VPSGetAttachedPublicKeysV1Input.Type; + +// Output Schema +export const VPSGetAttachedPublicKeysV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + data: Schema.optional( + Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + key: Schema.optional(Schema.String), + }), + ), + ), + meta: Schema.optional( + Schema.Struct({ + current_page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + total: Schema.optional(Schema.Number), + }), + ), + }); +export type VPSGetAttachedPublicKeysV1Output = + typeof VPSGetAttachedPublicKeysV1Output.Type; + +// The operation +/** + * Get attached public keys + * + * Retrieve public keys attached to a specified virtual machine. + * Use this endpoint to view SSH keys configured for specific VPS instances. + * + * @param virtualMachineId - Virtual Machine ID + * @param page - Page number + */ +export const VPSGetAttachedPublicKeysV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSGetAttachedPublicKeysV1Input, + outputSchema: VPSGetAttachedPublicKeysV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSGetBackupsV1.ts b/packages/hostinger/src/operations/VPSGetBackupsV1.ts new file mode 100644 index 000000000..2524f15d6 --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetBackupsV1.ts @@ -0,0 +1,53 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSGetBackupsV1Input = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + page: Schema.optional(Schema.Number), +}).pipe( + T.Http({ + method: "GET", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/backups", + }), +); +export type VPSGetBackupsV1Input = typeof VPSGetBackupsV1Input.Type; + +// Output Schema +export const VPSGetBackupsV1Output = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + data: Schema.optional( + Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + size: Schema.optional(Schema.Number), + restore_time: Schema.optional(Schema.Number), + location: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + }), + ), + ), + meta: Schema.optional( + Schema.Struct({ + current_page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + total: Schema.optional(Schema.Number), + }), + ), +}); +export type VPSGetBackupsV1Output = typeof VPSGetBackupsV1Output.Type; + +// The operation +/** + * Get backups + * + * Retrieve backups for a specified virtual machine. + * Use this endpoint to view available backup points for VPS data recovery. + * + * @param virtualMachineId - Virtual Machine ID + * @param page - Page number + */ +export const VPSGetBackupsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSGetBackupsV1Input, + outputSchema: VPSGetBackupsV1Output, +})); diff --git a/packages/hostinger/src/operations/VPSGetDataCenterListV1.ts b/packages/hostinger/src/operations/VPSGetDataCenterListV1.ts new file mode 100644 index 000000000..144fe2953 --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetDataCenterListV1.ts @@ -0,0 +1,39 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSGetDataCenterListV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe( + T.Http({ method: "GET", path: "/api/vps/v1/data-centers" }), + ); +export type VPSGetDataCenterListV1Input = + typeof VPSGetDataCenterListV1Input.Type; + +// Output Schema +export const VPSGetDataCenterListV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.NullOr(Schema.String)), + location: Schema.optional(Schema.NullOr(Schema.String)), + city: Schema.optional(Schema.NullOr(Schema.String)), + continent: Schema.optional(Schema.NullOr(Schema.String)), + }), + ); +export type VPSGetDataCenterListV1Output = + typeof VPSGetDataCenterListV1Output.Type; + +// The operation +/** + * Get data center list + * + * Retrieve all available data centers. + * Use this endpoint to view location options before deploying VPS instances. + */ +export const VPSGetDataCenterListV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSGetDataCenterListV1Input, + outputSchema: VPSGetDataCenterListV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSGetFirewallDetailsV1.ts b/packages/hostinger/src/operations/VPSGetFirewallDetailsV1.ts new file mode 100644 index 000000000..3b1e0beb8 --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetFirewallDetailsV1.ts @@ -0,0 +1,67 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSGetFirewallDetailsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + firewallId: Schema.Number.pipe(T.PathParam()), + }).pipe(T.Http({ method: "GET", path: "/api/vps/v1/firewall/{firewallId}" })); +export type VPSGetFirewallDetailsV1Input = + typeof VPSGetFirewallDetailsV1Input.Type; + +// Output Schema +export const VPSGetFirewallDetailsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + is_synced: Schema.optional(Schema.Boolean), + rules: Schema.optional( + Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + action: Schema.optional(Schema.Literals(["accept", "drop"])), + protocol: Schema.optional( + Schema.Literals([ + "TCP", + "UDP", + "ICMP", + "GRE", + "any", + "ESP", + "AH", + "ICMPv6", + "SSH", + "HTTP", + "HTTPS", + "MySQL", + "PostgreSQL", + ]), + ), + port: Schema.optional(Schema.String), + source: Schema.optional(Schema.String), + source_detail: Schema.optional(Schema.String), + }), + ), + ), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSGetFirewallDetailsV1Output = + typeof VPSGetFirewallDetailsV1Output.Type; + +// The operation +/** + * Get firewall details + * + * Retrieve firewall by its ID and rules associated with it. + * Use this endpoint to view specific firewall configuration and rules. + * + * @param firewallId - Firewall ID + */ +export const VPSGetFirewallDetailsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSGetFirewallDetailsV1Input, + outputSchema: VPSGetFirewallDetailsV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSGetFirewallListV1.ts b/packages/hostinger/src/operations/VPSGetFirewallListV1.ts new file mode 100644 index 000000000..5f707a6a5 --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetFirewallListV1.ts @@ -0,0 +1,78 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSGetFirewallListV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + page: Schema.optional(Schema.Number), + }).pipe(T.Http({ method: "GET", path: "/api/vps/v1/firewall" })); +export type VPSGetFirewallListV1Input = typeof VPSGetFirewallListV1Input.Type; + +// Output Schema +export const VPSGetFirewallListV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + data: Schema.optional( + Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + is_synced: Schema.optional(Schema.Boolean), + rules: Schema.optional( + Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + action: Schema.optional(Schema.Literals(["accept", "drop"])), + protocol: Schema.optional( + Schema.Literals([ + "TCP", + "UDP", + "ICMP", + "GRE", + "any", + "ESP", + "AH", + "ICMPv6", + "SSH", + "HTTP", + "HTTPS", + "MySQL", + "PostgreSQL", + ]), + ), + port: Schema.optional(Schema.String), + source: Schema.optional(Schema.String), + source_detail: Schema.optional(Schema.String), + }), + ), + ), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }), + ), + ), + meta: Schema.optional( + Schema.Struct({ + current_page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + total: Schema.optional(Schema.Number), + }), + ), + }); +export type VPSGetFirewallListV1Output = typeof VPSGetFirewallListV1Output.Type; + +// The operation +/** + * Get firewall list + * + * Retrieve all available firewalls. + * Use this endpoint to view existing firewall configurations. + * + * @param page - Page number + */ +export const VPSGetFirewallListV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSGetFirewallListV1Input, + outputSchema: VPSGetFirewallListV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSGetMetricsV1.ts b/packages/hostinger/src/operations/VPSGetMetricsV1.ts new file mode 100644 index 000000000..2375e2554 --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetMetricsV1.ts @@ -0,0 +1,49 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSGetMetricsV1Input = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + date_from: Schema.String, + date_to: Schema.String, +}).pipe( + T.Http({ + method: "GET", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/metrics", + }), +); +export type VPSGetMetricsV1Input = typeof VPSGetMetricsV1Input.Type; + +// Output Schema +export const VPSGetMetricsV1Output = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + cpu_usage: Schema.optional(Schema.Unknown), + ram_usage: Schema.optional(Schema.Unknown), + disk_space: Schema.optional(Schema.Unknown), + outgoing_traffic: Schema.optional(Schema.Unknown), + incoming_traffic: Schema.optional(Schema.Unknown), + uptime: Schema.optional(Schema.Unknown), +}); +export type VPSGetMetricsV1Output = typeof VPSGetMetricsV1Output.Type; + +// The operation +/** + * Get metrics + * + * Retrieve historical metrics for a specified virtual machine. + * It includes the following metrics: + * - CPU usage + * - Memory usage + * - Disk usage + * - Network usage + * - Uptime + * Use this endpoint to monitor VPS performance and resource utilization over time. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSGetMetricsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSGetMetricsV1Input, + outputSchema: VPSGetMetricsV1Output, + errors: [UnprocessableEntity] as const, +})); diff --git a/packages/hostinger/src/operations/VPSGetPostInstallScriptV1.ts b/packages/hostinger/src/operations/VPSGetPostInstallScriptV1.ts new file mode 100644 index 000000000..6a53055fb --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetPostInstallScriptV1.ts @@ -0,0 +1,44 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSGetPostInstallScriptV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + postInstallScriptId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "GET", + path: "/api/vps/v1/post-install-scripts/{postInstallScriptId}", + }), + ); +export type VPSGetPostInstallScriptV1Input = + typeof VPSGetPostInstallScriptV1Input.Type; + +// Output Schema +export const VPSGetPostInstallScriptV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + content: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSGetPostInstallScriptV1Output = + typeof VPSGetPostInstallScriptV1Output.Type; + +// The operation +/** + * Get post-install script + * + * Retrieve post-install script by its ID. + * Use this endpoint to view specific automation script details. + * + * @param postInstallScriptId - Post-install script ID + */ +export const VPSGetPostInstallScriptV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSGetPostInstallScriptV1Input, + outputSchema: VPSGetPostInstallScriptV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSGetPostInstallScriptsV1.ts b/packages/hostinger/src/operations/VPSGetPostInstallScriptsV1.ts new file mode 100644 index 000000000..db5b5bebd --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetPostInstallScriptsV1.ts @@ -0,0 +1,52 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSGetPostInstallScriptsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + page: Schema.optional(Schema.Number), + }).pipe(T.Http({ method: "GET", path: "/api/vps/v1/post-install-scripts" })); +export type VPSGetPostInstallScriptsV1Input = + typeof VPSGetPostInstallScriptsV1Input.Type; + +// Output Schema +export const VPSGetPostInstallScriptsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + data: Schema.optional( + Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + content: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }), + ), + ), + meta: Schema.optional( + Schema.Struct({ + current_page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + total: Schema.optional(Schema.Number), + }), + ), + }); +export type VPSGetPostInstallScriptsV1Output = + typeof VPSGetPostInstallScriptsV1Output.Type; + +// The operation +/** + * Get post-install scripts + * + * Retrieve post-install scripts associated with your account. + * Use this endpoint to view available automation scripts for VPS deployment. + * + * @param page - Page number + */ +export const VPSGetPostInstallScriptsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSGetPostInstallScriptsV1Input, + outputSchema: VPSGetPostInstallScriptsV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSGetProjectContainersV1.ts b/packages/hostinger/src/operations/VPSGetProjectContainersV1.ts new file mode 100644 index 000000000..62b45d612 --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetProjectContainersV1.ts @@ -0,0 +1,89 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSGetProjectContainersV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + projectName: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "GET", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/docker/{projectName}/containers", + }), + ); +export type VPSGetProjectContainersV1Input = + typeof VPSGetProjectContainersV1Input.Type; + +// Output Schema +export const VPSGetProjectContainersV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.String), + name: Schema.optional(Schema.String), + image: Schema.optional(Schema.String), + command: Schema.optional(Schema.String), + status: Schema.optional(Schema.String), + state: Schema.optional( + Schema.Literals([ + "created", + "running", + "restarting", + "exited", + "paused", + "dead", + "stopping", + ]), + ), + health: Schema.optional( + Schema.Literals(["starting", "healthy", "unhealthy", ""]), + ), + ports: Schema.optional( + Schema.Array( + Schema.Struct({ + type: Schema.optional( + Schema.Literals([ + "published", + "published_range", + "exposed", + "exposed_range", + ]), + ), + protocol: Schema.optional(Schema.Literals(["tcp", "udp"])), + host_ip: Schema.optional(Schema.NullOr(Schema.String)), + host_port: Schema.optional(Schema.NullOr(Schema.Number)), + container_port: Schema.optional(Schema.NullOr(Schema.Number)), + host_port_start: Schema.optional(Schema.NullOr(Schema.Number)), + host_port_end: Schema.optional(Schema.NullOr(Schema.Number)), + container_port_start: Schema.optional(Schema.NullOr(Schema.Number)), + container_port_end: Schema.optional(Schema.NullOr(Schema.Number)), + }), + ), + ), + stats: Schema.optional(Schema.Unknown), + }), + ); +export type VPSGetProjectContainersV1Output = + typeof VPSGetProjectContainersV1Output.Type; + +// The operation +/** + * Get project containers + * + * Retrieves a list of all containers belonging to a specific Docker Compose project on the virtual machine. + * This endpoint returns detailed information about each container including + * their current status, port mappings, and runtime configuration. + * Use this to monitor the health and state of all services within your Docker Compose project. + * + * @param virtualMachineId - Virtual Machine ID + * @param projectName - Docker Compose project name using alphanumeric characters, dashes, and underscores only + */ +export const VPSGetProjectContainersV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSGetProjectContainersV1Input, + outputSchema: VPSGetProjectContainersV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSGetProjectContentsV1.ts b/packages/hostinger/src/operations/VPSGetProjectContentsV1.ts new file mode 100644 index 000000000..5a24070a6 --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetProjectContentsV1.ts @@ -0,0 +1,47 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSGetProjectContentsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + projectName: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "GET", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/docker/{projectName}", + }), + ); +export type VPSGetProjectContentsV1Input = + typeof VPSGetProjectContentsV1Input.Type; + +// Output Schema +export const VPSGetProjectContentsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + content: Schema.optional(Schema.String), + environment: Schema.optional(Schema.NullOr(Schema.String)), + }); +export type VPSGetProjectContentsV1Output = + typeof VPSGetProjectContentsV1Output.Type; + +// The operation +/** + * Get project contents + * + * Retrieves the complete project information including the docker-compose.yml + * file contents, project metadata, and current deployment status. + * This endpoint provides the full configuration and state details of a specific Docker Compose project. + * Use this to inspect project settings, review the compose file, or check the overall project health. + * + * @param virtualMachineId - Virtual Machine ID + * @param projectName - Docker Compose project name using alphanumeric characters, dashes, and underscores only + */ +export const VPSGetProjectContentsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSGetProjectContentsV1Input, + outputSchema: VPSGetProjectContentsV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSGetProjectListV1.ts b/packages/hostinger/src/operations/VPSGetProjectListV1.ts new file mode 100644 index 000000000..09420a9f1 --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetProjectListV1.ts @@ -0,0 +1,104 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSGetProjectListV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "GET", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/docker", + }), + ); +export type VPSGetProjectListV1Input = typeof VPSGetProjectListV1Input.Type; + +// Output Schema +export const VPSGetProjectListV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + name: Schema.optional(Schema.String), + status: Schema.optional(Schema.String), + state: Schema.optional( + Schema.Literals(["running", "stopped", "created", "mixed", "unknown"]), + ), + path: Schema.optional(Schema.String), + containers: Schema.optional( + Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.String), + name: Schema.optional(Schema.String), + image: Schema.optional(Schema.String), + command: Schema.optional(Schema.String), + status: Schema.optional(Schema.String), + state: Schema.optional( + Schema.Literals([ + "created", + "running", + "restarting", + "exited", + "paused", + "dead", + "stopping", + ]), + ), + health: Schema.optional( + Schema.Literals(["starting", "healthy", "unhealthy", ""]), + ), + ports: Schema.optional( + Schema.Array( + Schema.Struct({ + type: Schema.optional( + Schema.Literals([ + "published", + "published_range", + "exposed", + "exposed_range", + ]), + ), + protocol: Schema.optional(Schema.Literals(["tcp", "udp"])), + host_ip: Schema.optional(Schema.NullOr(Schema.String)), + host_port: Schema.optional(Schema.NullOr(Schema.Number)), + container_port: Schema.optional(Schema.NullOr(Schema.Number)), + host_port_start: Schema.optional( + Schema.NullOr(Schema.Number), + ), + host_port_end: Schema.optional(Schema.NullOr(Schema.Number)), + container_port_start: Schema.optional( + Schema.NullOr(Schema.Number), + ), + container_port_end: Schema.optional( + Schema.NullOr(Schema.Number), + ), + }), + ), + ), + stats: Schema.optional(Schema.Unknown), + }), + ), + ), + }), + ); +export type VPSGetProjectListV1Output = typeof VPSGetProjectListV1Output.Type; + +// The operation +/** + * Get project list + * + * Retrieves a list of all Docker Compose projects currently deployed on the virtual machine. + * This endpoint returns basic information about each project including name, + * status, file path and list of containers with details about their names, + * image, status, health and ports. Container stats are omitted in this + * endpoint. If you need to get detailed information about container with + * stats included, use the `Get project containers` endpoint. + * Use this to get an overview of all Docker projects on your VPS instance. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSGetProjectListV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSGetProjectListV1Input, + outputSchema: VPSGetProjectListV1Output, + errors: [UnprocessableEntity] as const, +})); diff --git a/packages/hostinger/src/operations/VPSGetProjectLogsV1.ts b/packages/hostinger/src/operations/VPSGetProjectLogsV1.ts new file mode 100644 index 000000000..cf7515ac7 --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetProjectLogsV1.ts @@ -0,0 +1,53 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSGetProjectLogsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + projectName: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "GET", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/docker/{projectName}/logs", + }), + ); +export type VPSGetProjectLogsV1Input = typeof VPSGetProjectLogsV1Input.Type; + +// Output Schema +export const VPSGetProjectLogsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + service: Schema.optional(Schema.String), + entries: Schema.optional( + Schema.Array( + Schema.Struct({ + timestamp: Schema.optional(Schema.String), + line: Schema.optional(Schema.String), + }), + ), + ), + }), + ); +export type VPSGetProjectLogsV1Output = typeof VPSGetProjectLogsV1Output.Type; + +// The operation +/** + * Get project logs + * + * Retrieves aggregated log entries from all services within a Docker Compose project. + * This endpoint returns recent log output from each container, organized by service name with timestamps. + * The response contains the last 300 log entries across all services. + * Use this for debugging, monitoring application behavior, and + * troubleshooting issues across your entire project stack. + * + * @param virtualMachineId - Virtual Machine ID + * @param projectName - Docker Compose project name using alphanumeric characters, dashes, and underscores only + */ +export const VPSGetProjectLogsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSGetProjectLogsV1Input, + outputSchema: VPSGetProjectLogsV1Output, + errors: [UnprocessableEntity] as const, +})); diff --git a/packages/hostinger/src/operations/VPSGetPublicKeysV1.ts b/packages/hostinger/src/operations/VPSGetPublicKeysV1.ts new file mode 100644 index 000000000..b2fb02ff4 --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetPublicKeysV1.ts @@ -0,0 +1,46 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSGetPublicKeysV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + page: Schema.optional(Schema.Number), + }).pipe(T.Http({ method: "GET", path: "/api/vps/v1/public-keys" })); +export type VPSGetPublicKeysV1Input = typeof VPSGetPublicKeysV1Input.Type; + +// Output Schema +export const VPSGetPublicKeysV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + data: Schema.optional( + Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + key: Schema.optional(Schema.String), + }), + ), + ), + meta: Schema.optional( + Schema.Struct({ + current_page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + total: Schema.optional(Schema.Number), + }), + ), + }); +export type VPSGetPublicKeysV1Output = typeof VPSGetPublicKeysV1Output.Type; + +// The operation +/** + * Get public keys + * + * Retrieve public keys associated with your account. + * Use this endpoint to view available SSH keys for VPS authentication. + * + * @param page - Page number + */ +export const VPSGetPublicKeysV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSGetPublicKeysV1Input, + outputSchema: VPSGetPublicKeysV1Output, +})); diff --git a/packages/hostinger/src/operations/VPSGetScanMetricsV1.ts b/packages/hostinger/src/operations/VPSGetScanMetricsV1.ts new file mode 100644 index 000000000..0a592ed6f --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetScanMetricsV1.ts @@ -0,0 +1,48 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSGetScanMetricsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "GET", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/monarx", + }), + ); +export type VPSGetScanMetricsV1Input = typeof VPSGetScanMetricsV1Input.Type; + +// Output Schema +export const VPSGetScanMetricsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + records: Schema.optional(Schema.Number), + malicious: Schema.optional(Schema.Number), + compromised: Schema.optional(Schema.Number), + scanned_files: Schema.optional(Schema.Number), + scan_started_at: Schema.optional(Schema.String), + scan_ended_at: Schema.optional(Schema.NullOr(Schema.String)), + }); +export type VPSGetScanMetricsV1Output = typeof VPSGetScanMetricsV1Output.Type; + +// The operation +/** + * Get scan metrics + * + * Retrieve scan metrics for the [Monarx](https://www.monarx.com/) malware scanner + * installed on a specified virtual machine. + * The scan metrics provide detailed information about malware scans performed + * by Monarx, including number of scans, detected threats, and other relevant + * statistics. This information is useful for monitoring security status of the + * virtual machine and assessing effectiveness of the malware scanner. + * Use this endpoint to monitor VPS security scan results and threat detection. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSGetScanMetricsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSGetScanMetricsV1Input, + outputSchema: VPSGetScanMetricsV1Output, + errors: [UnprocessableEntity] as const, +})); diff --git a/packages/hostinger/src/operations/VPSGetSnapshotV1.ts b/packages/hostinger/src/operations/VPSGetSnapshotV1.ts new file mode 100644 index 000000000..40a63874c --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetSnapshotV1.ts @@ -0,0 +1,39 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSGetSnapshotV1Input = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), +}).pipe( + T.Http({ + method: "GET", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot", + }), +); +export type VPSGetSnapshotV1Input = typeof VPSGetSnapshotV1Input.Type; + +// Output Schema +export const VPSGetSnapshotV1Output = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct( + { + id: Schema.optional(Schema.Number), + restore_time: Schema.optional(Schema.Number), + created_at: Schema.optional(Schema.String), + expires_at: Schema.optional(Schema.String), + }, +); +export type VPSGetSnapshotV1Output = typeof VPSGetSnapshotV1Output.Type; + +// The operation +/** + * Get snapshot + * + * Retrieve snapshot for a specified virtual machine. + * Use this endpoint to view current VPS snapshot information. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSGetSnapshotV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSGetSnapshotV1Input, + outputSchema: VPSGetSnapshotV1Output, +})); diff --git a/packages/hostinger/src/operations/VPSGetTemplateDetailsV1.ts b/packages/hostinger/src/operations/VPSGetTemplateDetailsV1.ts new file mode 100644 index 000000000..4614ea228 --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetTemplateDetailsV1.ts @@ -0,0 +1,40 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSGetTemplateDetailsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + templateId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ method: "GET", path: "/api/vps/v1/templates/{templateId}" }), + ); +export type VPSGetTemplateDetailsV1Input = + typeof VPSGetTemplateDetailsV1Input.Type; + +// Output Schema +export const VPSGetTemplateDetailsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + description: Schema.optional(Schema.String), + documentation: Schema.optional(Schema.NullOr(Schema.String)), + }); +export type VPSGetTemplateDetailsV1Output = + typeof VPSGetTemplateDetailsV1Output.Type; + +// The operation +/** + * Get template details + * + * Retrieve detailed information about a specific OS template for virtual machines. + * Use this endpoint to view specific template specifications before deployment. + * + * @param templateId - Template ID + */ +export const VPSGetTemplateDetailsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSGetTemplateDetailsV1Input, + outputSchema: VPSGetTemplateDetailsV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSGetTemplatesV1.ts b/packages/hostinger/src/operations/VPSGetTemplatesV1.ts new file mode 100644 index 000000000..baa2489a9 --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetTemplatesV1.ts @@ -0,0 +1,32 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSGetTemplatesV1Input = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct( + {}, +).pipe(T.Http({ method: "GET", path: "/api/vps/v1/templates" })); +export type VPSGetTemplatesV1Input = typeof VPSGetTemplatesV1Input.Type; + +// Output Schema +export const VPSGetTemplatesV1Output = /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + description: Schema.optional(Schema.String), + documentation: Schema.optional(Schema.NullOr(Schema.String)), + }), +); +export type VPSGetTemplatesV1Output = typeof VPSGetTemplatesV1Output.Type; + +// The operation +/** + * Get templates + * + * Retrieve available OS templates for virtual machines. + * Use this endpoint to view operating system options before creating or recreating VPS instances. + */ +export const VPSGetTemplatesV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSGetTemplatesV1Input, + outputSchema: VPSGetTemplatesV1Output, +})); diff --git a/packages/hostinger/src/operations/VPSGetVirtualMachineDetailsV1.ts b/packages/hostinger/src/operations/VPSGetVirtualMachineDetailsV1.ts new file mode 100644 index 000000000..3599c29db --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetVirtualMachineDetailsV1.ts @@ -0,0 +1,75 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSGetVirtualMachineDetailsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "GET", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}", + }), + ); +export type VPSGetVirtualMachineDetailsV1Input = + typeof VPSGetVirtualMachineDetailsV1Input.Type; + +// Output Schema +export const VPSGetVirtualMachineDetailsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + firewall_group_id: Schema.optional(Schema.NullOr(Schema.Number)), + subscription_id: Schema.optional(Schema.NullOr(Schema.String)), + data_center_id: Schema.optional(Schema.NullOr(Schema.Number)), + plan: Schema.optional(Schema.NullOr(Schema.String)), + hostname: Schema.optional(Schema.String), + state: Schema.optional( + Schema.Literals([ + "running", + "starting", + "stopping", + "stopped", + "creating", + "initial", + "error", + "suspending", + "unsuspending", + "suspended", + "destroying", + "destroyed", + "recreating", + "restoring", + "recovery", + "stopping_recovery", + ]), + ), + actions_lock: Schema.optional(Schema.Literals(["unlocked", "locked"])), + cpus: Schema.optional(Schema.Number), + memory: Schema.optional(Schema.Number), + disk: Schema.optional(Schema.Number), + bandwidth: Schema.optional(Schema.Number), + ns1: Schema.optional(Schema.NullOr(Schema.String)), + ns2: Schema.optional(Schema.NullOr(Schema.String)), + ipv4: Schema.optional(Schema.Unknown), + ipv6: Schema.optional(Schema.Unknown), + template: Schema.optional(Schema.Unknown), + created_at: Schema.optional(Schema.String), + }); +export type VPSGetVirtualMachineDetailsV1Output = + typeof VPSGetVirtualMachineDetailsV1Output.Type; + +// The operation +/** + * Get virtual machine details + * + * Retrieve detailed information about a specified virtual machine. + * Use this endpoint to view comprehensive VPS configuration and status. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSGetVirtualMachineDetailsV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSGetVirtualMachineDetailsV1Input, + outputSchema: VPSGetVirtualMachineDetailsV1Output, + })); diff --git a/packages/hostinger/src/operations/VPSGetVirtualMachinesV1.ts b/packages/hostinger/src/operations/VPSGetVirtualMachinesV1.ts new file mode 100644 index 000000000..0847bd3a4 --- /dev/null +++ b/packages/hostinger/src/operations/VPSGetVirtualMachinesV1.ts @@ -0,0 +1,71 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSGetVirtualMachinesV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe( + T.Http({ method: "GET", path: "/api/vps/v1/virtual-machines" }), + ); +export type VPSGetVirtualMachinesV1Input = + typeof VPSGetVirtualMachinesV1Input.Type; + +// Output Schema +export const VPSGetVirtualMachinesV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + firewall_group_id: Schema.optional(Schema.NullOr(Schema.Number)), + subscription_id: Schema.optional(Schema.NullOr(Schema.String)), + data_center_id: Schema.optional(Schema.NullOr(Schema.Number)), + plan: Schema.optional(Schema.NullOr(Schema.String)), + hostname: Schema.optional(Schema.String), + state: Schema.optional( + Schema.Literals([ + "running", + "starting", + "stopping", + "stopped", + "creating", + "initial", + "error", + "suspending", + "unsuspending", + "suspended", + "destroying", + "destroyed", + "recreating", + "restoring", + "recovery", + "stopping_recovery", + ]), + ), + actions_lock: Schema.optional(Schema.Literals(["unlocked", "locked"])), + cpus: Schema.optional(Schema.Number), + memory: Schema.optional(Schema.Number), + disk: Schema.optional(Schema.Number), + bandwidth: Schema.optional(Schema.Number), + ns1: Schema.optional(Schema.NullOr(Schema.String)), + ns2: Schema.optional(Schema.NullOr(Schema.String)), + ipv4: Schema.optional(Schema.Unknown), + ipv6: Schema.optional(Schema.Unknown), + template: Schema.optional(Schema.Unknown), + created_at: Schema.optional(Schema.String), + }), + ); +export type VPSGetVirtualMachinesV1Output = + typeof VPSGetVirtualMachinesV1Output.Type; + +// The operation +/** + * Get virtual machines + * + * Retrieve all available virtual machines. + * Use this endpoint to view available VPS instances. + */ +export const VPSGetVirtualMachinesV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSGetVirtualMachinesV1Input, + outputSchema: VPSGetVirtualMachinesV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSInstallMonarxV1.ts b/packages/hostinger/src/operations/VPSInstallMonarxV1.ts new file mode 100644 index 000000000..0ff10ce5e --- /dev/null +++ b/packages/hostinger/src/operations/VPSInstallMonarxV1.ts @@ -0,0 +1,46 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSInstallMonarxV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/monarx", + }), + ); +export type VPSInstallMonarxV1Input = typeof VPSInstallMonarxV1Input.Type; + +// Output Schema +export const VPSInstallMonarxV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSInstallMonarxV1Output = typeof VPSInstallMonarxV1Output.Type; + +// The operation +/** + * Install Monarx + * + * Install the Monarx malware scanner on a specified virtual machine. + * [Monarx](https://www.monarx.com/) is a security tool designed to detect and + * prevent malware infections on virtual machines. By installing Monarx, users + * can enhance the security of their virtual machines, ensuring that they are + * protected against malicious software. + * Use this endpoint to enable malware protection on VPS instances. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSInstallMonarxV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSInstallMonarxV1Input, + outputSchema: VPSInstallMonarxV1Output, + errors: [UnprocessableEntity] as const, +})); diff --git a/packages/hostinger/src/operations/VPSPurchaseNewVirtualMachineV1.ts b/packages/hostinger/src/operations/VPSPurchaseNewVirtualMachineV1.ts new file mode 100644 index 000000000..0be2e777b --- /dev/null +++ b/packages/hostinger/src/operations/VPSPurchaseNewVirtualMachineV1.ts @@ -0,0 +1,136 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; +import { SensitiveString } from "../sensitive.ts"; + +// Input Schema +export const VPSPurchaseNewVirtualMachineV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + item_id: Schema.String, + payment_method_id: Schema.optional(Schema.Number), + setup: Schema.Struct({ + template_id: Schema.Number, + data_center_id: Schema.Number, + post_install_script_id: Schema.optional(Schema.Number), + password: Schema.optional(SensitiveString), + hostname: Schema.optional(Schema.String), + install_monarx: Schema.optional(Schema.Boolean), + enable_backups: Schema.optional(Schema.Boolean), + ns1: Schema.optional(Schema.String), + ns2: Schema.optional(Schema.String), + public_key: Schema.optional( + Schema.Struct({ + name: Schema.optional(Schema.String), + key: Schema.optional(Schema.String), + }), + ), + }), + coupons: Schema.optional(Schema.Array(Schema.Unknown)), + }).pipe(T.Http({ method: "POST", path: "/api/vps/v1/virtual-machines" })); +export type VPSPurchaseNewVirtualMachineV1Input = + typeof VPSPurchaseNewVirtualMachineV1Input.Type; + +// Output Schema +export const VPSPurchaseNewVirtualMachineV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + order: Schema.optional( + Schema.Struct({ + id: Schema.optional(Schema.Number), + subscription_id: Schema.optional(Schema.String), + status: Schema.optional( + Schema.Literals([ + "completed", + "pending", + "processing", + "failed", + "refunded", + "cancelled", + "awaiting_payment", + "payment_initiated", + "fraud_refund", + ]), + ), + currency: Schema.optional(Schema.String), + subtotal: Schema.optional(Schema.Number), + total: Schema.optional(Schema.Number), + billing_address: Schema.optional( + Schema.Struct({ + first_name: Schema.optional(Schema.String), + last_name: Schema.optional(Schema.String), + company: Schema.optional(Schema.NullOr(Schema.String)), + address_1: Schema.optional(Schema.NullOr(Schema.String)), + address_2: Schema.optional(Schema.NullOr(Schema.String)), + city: Schema.optional(Schema.NullOr(Schema.String)), + state: Schema.optional(Schema.NullOr(Schema.String)), + zip: Schema.optional(Schema.NullOr(Schema.String)), + country: Schema.optional(Schema.NullOr(Schema.String)), + phone: Schema.optional(Schema.NullOr(Schema.String)), + email: Schema.optional(Schema.String), + }), + ), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }), + ), + virtual_machine: Schema.optional( + Schema.Struct({ + id: Schema.optional(Schema.Number), + firewall_group_id: Schema.optional(Schema.NullOr(Schema.Number)), + subscription_id: Schema.optional(Schema.NullOr(Schema.String)), + data_center_id: Schema.optional(Schema.NullOr(Schema.Number)), + plan: Schema.optional(Schema.NullOr(Schema.String)), + hostname: Schema.optional(Schema.String), + state: Schema.optional( + Schema.Literals([ + "running", + "starting", + "stopping", + "stopped", + "creating", + "initial", + "error", + "suspending", + "unsuspending", + "suspended", + "destroying", + "destroyed", + "recreating", + "restoring", + "recovery", + "stopping_recovery", + ]), + ), + actions_lock: Schema.optional(Schema.Literals(["unlocked", "locked"])), + cpus: Schema.optional(Schema.Number), + memory: Schema.optional(Schema.Number), + disk: Schema.optional(Schema.Number), + bandwidth: Schema.optional(Schema.Number), + ns1: Schema.optional(Schema.NullOr(Schema.String)), + ns2: Schema.optional(Schema.NullOr(Schema.String)), + ipv4: Schema.optional(Schema.Unknown), + ipv6: Schema.optional(Schema.Unknown), + template: Schema.optional(Schema.Unknown), + created_at: Schema.optional(Schema.String), + }), + ), + }); +export type VPSPurchaseNewVirtualMachineV1Output = + typeof VPSPurchaseNewVirtualMachineV1Output.Type; + +// The operation +/** + * Purchase new virtual machine + * + * Purchase and setup a new virtual machine. + * If virtual machine setup fails for any reason, login to + * [hPanel](https://hpanel.hostinger.com/) and complete the setup manually. + * If no payment method is provided, your default payment method will be used automatically. + * Use this endpoint to create new VPS instances. + */ +export const VPSPurchaseNewVirtualMachineV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSPurchaseNewVirtualMachineV1Input, + outputSchema: VPSPurchaseNewVirtualMachineV1Output, + errors: [UnprocessableEntity] as const, + })); diff --git a/packages/hostinger/src/operations/VPSRecreateVirtualMachineV1.ts b/packages/hostinger/src/operations/VPSRecreateVirtualMachineV1.ts new file mode 100644 index 000000000..40cbd431f --- /dev/null +++ b/packages/hostinger/src/operations/VPSRecreateVirtualMachineV1.ts @@ -0,0 +1,63 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; +import { SensitiveString } from "../sensitive.ts"; + +// Input Schema +export const VPSRecreateVirtualMachineV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + template_id: Schema.Number, + password: Schema.optional(SensitiveString), + panel_password: Schema.optional(SensitiveString), + post_install_script_id: Schema.optional(Schema.Number), + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/recreate", + }), + ); +export type VPSRecreateVirtualMachineV1Input = + typeof VPSRecreateVirtualMachineV1Input.Type; + +// Output Schema +export const VPSRecreateVirtualMachineV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSRecreateVirtualMachineV1Output = + typeof VPSRecreateVirtualMachineV1Output.Type; + +// The operation +/** + * Recreate virtual machine + * + * Recreate a virtual machine from scratch. + * The recreation process involves reinstalling the operating system and + * resetting the virtual machine to its initial state. + * Snapshots, if there are any, will be deleted. + * ## Password Requirements + * Password will be checked against leaked password databases. + * Requirements for the password are: + * - At least 12 characters long + * - At least one uppercase letter + * - At least one lowercase letter + * - At least one number + * - Is not leaked publicly + * **This operation is irreversible and will result in the loss of all data stored on the virtual machine!** + * Use this endpoint to completely rebuild VPS instances with fresh OS installation. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSRecreateVirtualMachineV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSRecreateVirtualMachineV1Input, + outputSchema: VPSRecreateVirtualMachineV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSResetHostnameV1.ts b/packages/hostinger/src/operations/VPSResetHostnameV1.ts new file mode 100644 index 000000000..04d241e9b --- /dev/null +++ b/packages/hostinger/src/operations/VPSResetHostnameV1.ts @@ -0,0 +1,40 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSResetHostnameV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/hostname", + }), + ); +export type VPSResetHostnameV1Input = typeof VPSResetHostnameV1Input.Type; + +// Output Schema +export const VPSResetHostnameV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSResetHostnameV1Output = typeof VPSResetHostnameV1Output.Type; + +// The operation +/** + * Reset hostname + * + * Reset hostname and PTR record of a specified virtual machine to default value. + * Use this endpoint to restore default hostname configuration for VPS instances. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSResetHostnameV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSResetHostnameV1Input, + outputSchema: VPSResetHostnameV1Output, +})); diff --git a/packages/hostinger/src/operations/VPSRestartProjectV1.ts b/packages/hostinger/src/operations/VPSRestartProjectV1.ts new file mode 100644 index 000000000..efe94c7ad --- /dev/null +++ b/packages/hostinger/src/operations/VPSRestartProjectV1.ts @@ -0,0 +1,46 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSRestartProjectV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + projectName: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/docker/{projectName}/restart", + }), + ); +export type VPSRestartProjectV1Input = typeof VPSRestartProjectV1Input.Type; + +// Output Schema +export const VPSRestartProjectV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSRestartProjectV1Output = typeof VPSRestartProjectV1Output.Type; + +// The operation +/** + * Restart project + * + * Restarts all services in a Docker Compose project by stopping and starting + * containers in the correct dependency order. + * This operation preserves data volumes and network configurations while refreshing the running containers. + * Use this to apply configuration changes or recover from service failures. + * + * @param virtualMachineId - Virtual Machine ID + * @param projectName - Docker Compose project name using alphanumeric characters, dashes, and underscores only + */ +export const VPSRestartProjectV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSRestartProjectV1Input, + outputSchema: VPSRestartProjectV1Output, + errors: [UnprocessableEntity] as const, +})); diff --git a/packages/hostinger/src/operations/VPSRestartVirtualMachineV1.ts b/packages/hostinger/src/operations/VPSRestartVirtualMachineV1.ts new file mode 100644 index 000000000..2e786015f --- /dev/null +++ b/packages/hostinger/src/operations/VPSRestartVirtualMachineV1.ts @@ -0,0 +1,45 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSRestartVirtualMachineV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/restart", + }), + ); +export type VPSRestartVirtualMachineV1Input = + typeof VPSRestartVirtualMachineV1Input.Type; + +// Output Schema +export const VPSRestartVirtualMachineV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSRestartVirtualMachineV1Output = + typeof VPSRestartVirtualMachineV1Output.Type; + +// The operation +/** + * Restart virtual machine + * + * Restart a specified virtual machine by fully stopping and starting it. + * If the virtual machine was stopped, it will be started. + * Use this endpoint to reboot VPS instances. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSRestartVirtualMachineV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSRestartVirtualMachineV1Input, + outputSchema: VPSRestartVirtualMachineV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSRestoreBackupV1.ts b/packages/hostinger/src/operations/VPSRestoreBackupV1.ts new file mode 100644 index 000000000..219a647bf --- /dev/null +++ b/packages/hostinger/src/operations/VPSRestoreBackupV1.ts @@ -0,0 +1,44 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSRestoreBackupV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + backupId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/backups/{backupId}/restore", + }), + ); +export type VPSRestoreBackupV1Input = typeof VPSRestoreBackupV1Input.Type; + +// Output Schema +export const VPSRestoreBackupV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSRestoreBackupV1Output = typeof VPSRestoreBackupV1Output.Type; + +// The operation +/** + * Restore backup + * + * Restore a backup for a specified virtual machine. + * The system will then initiate the restore process, which may take some time depending on the size of the backup. + * **All data on the virtual machine will be overwritten with the data from the backup.** + * Use this endpoint to recover VPS data from backup points. + * + * @param virtualMachineId - Virtual Machine ID + * @param backupId - Backup ID + */ +export const VPSRestoreBackupV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSRestoreBackupV1Input, + outputSchema: VPSRestoreBackupV1Output, +})); diff --git a/packages/hostinger/src/operations/VPSRestoreSnapshotV1.ts b/packages/hostinger/src/operations/VPSRestoreSnapshotV1.ts new file mode 100644 index 000000000..a74c4f507 --- /dev/null +++ b/packages/hostinger/src/operations/VPSRestoreSnapshotV1.ts @@ -0,0 +1,44 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSRestoreSnapshotV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot/restore", + }), + ); +export type VPSRestoreSnapshotV1Input = typeof VPSRestoreSnapshotV1Input.Type; + +// Output Schema +export const VPSRestoreSnapshotV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSRestoreSnapshotV1Output = typeof VPSRestoreSnapshotV1Output.Type; + +// The operation +/** + * Restore snapshot + * + * Restore a specified virtual machine to a previous state using a snapshot. + * Restoring from a snapshot allows users to revert the virtual machine to that state, + * which is useful for system recovery, undoing changes, or testing. + * Use this endpoint to revert VPS instances to previous saved states. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSRestoreSnapshotV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSRestoreSnapshotV1Input, + outputSchema: VPSRestoreSnapshotV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSSetHostnameV1.ts b/packages/hostinger/src/operations/VPSSetHostnameV1.ts new file mode 100644 index 000000000..2dbabd758 --- /dev/null +++ b/packages/hostinger/src/operations/VPSSetHostnameV1.ts @@ -0,0 +1,46 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSSetHostnameV1Input = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + hostname: Schema.String, +}).pipe( + T.Http({ + method: "PUT", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/hostname", + }), +); +export type VPSSetHostnameV1Input = typeof VPSSetHostnameV1Input.Type; + +// Output Schema +export const VPSSetHostnameV1Output = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct( + { + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }, +); +export type VPSSetHostnameV1Output = typeof VPSSetHostnameV1Output.Type; + +// The operation +/** + * Set hostname + * + * Set hostname for a specified virtual machine. + * Changing hostname does not update PTR record automatically. + * If you want your virtual machine to be reachable by a hostname, + * you need to point your domain A/AAAA records to virtual machine IP as well. + * Use this endpoint to configure custom hostnames for VPS instances. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSSetHostnameV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSSetHostnameV1Input, + outputSchema: VPSSetHostnameV1Output, + errors: [UnprocessableEntity] as const, +})); diff --git a/packages/hostinger/src/operations/VPSSetNameserversV1.ts b/packages/hostinger/src/operations/VPSSetNameserversV1.ts new file mode 100644 index 000000000..a95899ff7 --- /dev/null +++ b/packages/hostinger/src/operations/VPSSetNameserversV1.ts @@ -0,0 +1,47 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSSetNameserversV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + ns1: Schema.String, + ns2: Schema.optional(Schema.NullOr(Schema.String)), + ns3: Schema.optional(Schema.NullOr(Schema.String)), + }).pipe( + T.Http({ + method: "PUT", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/nameservers", + }), + ); +export type VPSSetNameserversV1Input = typeof VPSSetNameserversV1Input.Type; + +// Output Schema +export const VPSSetNameserversV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSSetNameserversV1Output = typeof VPSSetNameserversV1Output.Type; + +// The operation +/** + * Set nameservers + * + * Set nameservers for a specified virtual machine. + * Be aware, that improper nameserver configuration can lead to the virtual + * machine being unable to resolve domain names. + * Use this endpoint to configure custom DNS resolvers for VPS instances. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSSetNameserversV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSSetNameserversV1Input, + outputSchema: VPSSetNameserversV1Output, + errors: [UnprocessableEntity] as const, +})); diff --git a/packages/hostinger/src/operations/VPSSetPanelPasswordV1.ts b/packages/hostinger/src/operations/VPSSetPanelPasswordV1.ts new file mode 100644 index 000000000..ce7810074 --- /dev/null +++ b/packages/hostinger/src/operations/VPSSetPanelPasswordV1.ts @@ -0,0 +1,50 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; +import { SensitiveString } from "../sensitive.ts"; + +// Input Schema +export const VPSSetPanelPasswordV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + password: SensitiveString, + }).pipe( + T.Http({ + method: "PUT", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/panel-password", + }), + ); +export type VPSSetPanelPasswordV1Input = typeof VPSSetPanelPasswordV1Input.Type; + +// Output Schema +export const VPSSetPanelPasswordV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSSetPanelPasswordV1Output = + typeof VPSSetPanelPasswordV1Output.Type; + +// The operation +/** + * Set panel password + * + * Set panel password for a specified virtual machine. + * If virtual machine does not use panel OS, the request will still be processed without any effect. + * Requirements for password are same as in the [recreate virtual machine + * endpoint](/#tag/vps-virtual-machine/POST/api/vps/v1/virtual-machines/{virtualMachineId}/recreate). + * Use this endpoint to configure control panel access credentials for VPS instances. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSSetPanelPasswordV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSSetPanelPasswordV1Input, + outputSchema: VPSSetPanelPasswordV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSSetRootPasswordV1.ts b/packages/hostinger/src/operations/VPSSetRootPasswordV1.ts new file mode 100644 index 000000000..f2784ccf5 --- /dev/null +++ b/packages/hostinger/src/operations/VPSSetRootPasswordV1.ts @@ -0,0 +1,48 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; +import { SensitiveString } from "../sensitive.ts"; + +// Input Schema +export const VPSSetRootPasswordV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + password: SensitiveString, + }).pipe( + T.Http({ + method: "PUT", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/root-password", + }), + ); +export type VPSSetRootPasswordV1Input = typeof VPSSetRootPasswordV1Input.Type; + +// Output Schema +export const VPSSetRootPasswordV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSSetRootPasswordV1Output = typeof VPSSetRootPasswordV1Output.Type; + +// The operation +/** + * Set root password + * + * Set root password for a specified virtual machine. + * Requirements for password are same as in the [recreate virtual machine + * endpoint](/#tag/vps-virtual-machine/POST/api/vps/v1/virtual-machines/{virtualMachineId}/recreate). + * Use this endpoint to update administrator credentials for VPS instances. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSSetRootPasswordV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSSetRootPasswordV1Input, + outputSchema: VPSSetRootPasswordV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSSetupPurchasedVirtualMachineV1.ts b/packages/hostinger/src/operations/VPSSetupPurchasedVirtualMachineV1.ts new file mode 100644 index 000000000..583fde9f9 --- /dev/null +++ b/packages/hostinger/src/operations/VPSSetupPurchasedVirtualMachineV1.ts @@ -0,0 +1,93 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; +import { SensitiveString } from "../sensitive.ts"; + +// Input Schema +export const VPSSetupPurchasedVirtualMachineV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + template_id: Schema.Number, + data_center_id: Schema.Number, + post_install_script_id: Schema.optional(Schema.Number), + password: Schema.optional(SensitiveString), + hostname: Schema.optional(Schema.String), + install_monarx: Schema.optional(Schema.Boolean), + enable_backups: Schema.optional(Schema.Boolean), + ns1: Schema.optional(Schema.String), + ns2: Schema.optional(Schema.String), + public_key: Schema.optional( + Schema.Struct({ + name: Schema.optional(Schema.String), + key: Schema.optional(Schema.String), + }), + ), + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/setup", + }), + ); +export type VPSSetupPurchasedVirtualMachineV1Input = + typeof VPSSetupPurchasedVirtualMachineV1Input.Type; + +// Output Schema +export const VPSSetupPurchasedVirtualMachineV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + firewall_group_id: Schema.optional(Schema.NullOr(Schema.Number)), + subscription_id: Schema.optional(Schema.NullOr(Schema.String)), + data_center_id: Schema.optional(Schema.NullOr(Schema.Number)), + plan: Schema.optional(Schema.NullOr(Schema.String)), + hostname: Schema.optional(Schema.String), + state: Schema.optional( + Schema.Literals([ + "running", + "starting", + "stopping", + "stopped", + "creating", + "initial", + "error", + "suspending", + "unsuspending", + "suspended", + "destroying", + "destroyed", + "recreating", + "restoring", + "recovery", + "stopping_recovery", + ]), + ), + actions_lock: Schema.optional(Schema.Literals(["unlocked", "locked"])), + cpus: Schema.optional(Schema.Number), + memory: Schema.optional(Schema.Number), + disk: Schema.optional(Schema.Number), + bandwidth: Schema.optional(Schema.Number), + ns1: Schema.optional(Schema.NullOr(Schema.String)), + ns2: Schema.optional(Schema.NullOr(Schema.String)), + ipv4: Schema.optional(Schema.Unknown), + ipv6: Schema.optional(Schema.Unknown), + template: Schema.optional(Schema.Unknown), + created_at: Schema.optional(Schema.String), + }); +export type VPSSetupPurchasedVirtualMachineV1Output = + typeof VPSSetupPurchasedVirtualMachineV1Output.Type; + +// The operation +/** + * Setup purchased virtual machine + * + * Setup newly purchased virtual machine with `initial` state. + * Use this endpoint to configure and initialize purchased VPS instances. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSSetupPurchasedVirtualMachineV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSSetupPurchasedVirtualMachineV1Input, + outputSchema: VPSSetupPurchasedVirtualMachineV1Output, + errors: [UnprocessableEntity] as const, + })); diff --git a/packages/hostinger/src/operations/VPSStartProjectV1.ts b/packages/hostinger/src/operations/VPSStartProjectV1.ts new file mode 100644 index 000000000..97c0e80eb --- /dev/null +++ b/packages/hostinger/src/operations/VPSStartProjectV1.ts @@ -0,0 +1,46 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSStartProjectV1Input = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct( + { + virtualMachineId: Schema.Number.pipe(T.PathParam()), + projectName: Schema.String.pipe(T.PathParam()), + }, +).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/docker/{projectName}/start", + }), +); +export type VPSStartProjectV1Input = typeof VPSStartProjectV1Input.Type; + +// Output Schema +export const VPSStartProjectV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSStartProjectV1Output = typeof VPSStartProjectV1Output.Type; + +// The operation +/** + * Start project + * + * Starts all services in a Docker Compose project that are currently stopped. + * This operation brings up containers in the correct dependency order as defined in the compose file. + * Use this to resume a project that was previously stopped or to start services after a system reboot. + * + * @param virtualMachineId - Virtual Machine ID + * @param projectName - Docker Compose project name using alphanumeric characters, dashes, and underscores only + */ +export const VPSStartProjectV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSStartProjectV1Input, + outputSchema: VPSStartProjectV1Output, + errors: [UnprocessableEntity] as const, +})); diff --git a/packages/hostinger/src/operations/VPSStartRecoveryModeV1.ts b/packages/hostinger/src/operations/VPSStartRecoveryModeV1.ts new file mode 100644 index 000000000..0d2e13d29 --- /dev/null +++ b/packages/hostinger/src/operations/VPSStartRecoveryModeV1.ts @@ -0,0 +1,52 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; +import { SensitiveString } from "../sensitive.ts"; + +// Input Schema +export const VPSStartRecoveryModeV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + root_password: SensitiveString, + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/recovery", + }), + ); +export type VPSStartRecoveryModeV1Input = + typeof VPSStartRecoveryModeV1Input.Type; + +// Output Schema +export const VPSStartRecoveryModeV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSStartRecoveryModeV1Output = + typeof VPSStartRecoveryModeV1Output.Type; + +// The operation +/** + * Start recovery mode + * + * Initiate recovery mode for a specified virtual machine. + * Recovery mode is a special state that allows users to perform system rescue operations, + * such as repairing file systems, recovering data, or troubleshooting issues that prevent the virtual machine + * from booting normally. + * Virtual machine will boot recovery disk image and original disk image will be mounted in `/mnt` directory. + * Use this endpoint to enable system rescue operations on VPS instances. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSStartRecoveryModeV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSStartRecoveryModeV1Input, + outputSchema: VPSStartRecoveryModeV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSStartVirtualMachineV1.ts b/packages/hostinger/src/operations/VPSStartVirtualMachineV1.ts new file mode 100644 index 000000000..2540f29f0 --- /dev/null +++ b/packages/hostinger/src/operations/VPSStartVirtualMachineV1.ts @@ -0,0 +1,45 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSStartVirtualMachineV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/start", + }), + ); +export type VPSStartVirtualMachineV1Input = + typeof VPSStartVirtualMachineV1Input.Type; + +// Output Schema +export const VPSStartVirtualMachineV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSStartVirtualMachineV1Output = + typeof VPSStartVirtualMachineV1Output.Type; + +// The operation +/** + * Start virtual machine + * + * Start a specified virtual machine. + * If the virtual machine is already running, the request will still be processed without any effect. + * Use this endpoint to power on stopped VPS instances. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSStartVirtualMachineV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSStartVirtualMachineV1Input, + outputSchema: VPSStartVirtualMachineV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSStopProjectV1.ts b/packages/hostinger/src/operations/VPSStopProjectV1.ts new file mode 100644 index 000000000..730c63a7b --- /dev/null +++ b/packages/hostinger/src/operations/VPSStopProjectV1.ts @@ -0,0 +1,46 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSStopProjectV1Input = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + projectName: Schema.String.pipe(T.PathParam()), +}).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/docker/{projectName}/stop", + }), +); +export type VPSStopProjectV1Input = typeof VPSStopProjectV1Input.Type; + +// Output Schema +export const VPSStopProjectV1Output = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct( + { + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }, +); +export type VPSStopProjectV1Output = typeof VPSStopProjectV1Output.Type; + +// The operation +/** + * Stop project + * + * Stops all running services in a Docker Compose project while preserving + * container configurations and data volumes. + * This operation gracefully shuts down containers in reverse dependency order. + * Use this to temporarily halt a project without removing data or configurations. + * + * @param virtualMachineId - Virtual Machine ID + * @param projectName - Docker Compose project name using alphanumeric characters, dashes, and underscores only + */ +export const VPSStopProjectV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSStopProjectV1Input, + outputSchema: VPSStopProjectV1Output, + errors: [UnprocessableEntity] as const, +})); diff --git a/packages/hostinger/src/operations/VPSStopRecoveryModeV1.ts b/packages/hostinger/src/operations/VPSStopRecoveryModeV1.ts new file mode 100644 index 000000000..0aa9201cd --- /dev/null +++ b/packages/hostinger/src/operations/VPSStopRecoveryModeV1.ts @@ -0,0 +1,44 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSStopRecoveryModeV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/recovery", + }), + ); +export type VPSStopRecoveryModeV1Input = typeof VPSStopRecoveryModeV1Input.Type; + +// Output Schema +export const VPSStopRecoveryModeV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSStopRecoveryModeV1Output = + typeof VPSStopRecoveryModeV1Output.Type; + +// The operation +/** + * Stop recovery mode + * + * Stop recovery mode for a specified virtual machine. + * If virtual machine is not in recovery mode, this operation will fail. + * Use this endpoint to exit system rescue mode and return VPS to normal operation. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSStopRecoveryModeV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSStopRecoveryModeV1Input, + outputSchema: VPSStopRecoveryModeV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSStopVirtualMachineV1.ts b/packages/hostinger/src/operations/VPSStopVirtualMachineV1.ts new file mode 100644 index 000000000..a5d2a0d74 --- /dev/null +++ b/packages/hostinger/src/operations/VPSStopVirtualMachineV1.ts @@ -0,0 +1,45 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const VPSStopVirtualMachineV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/stop", + }), + ); +export type VPSStopVirtualMachineV1Input = + typeof VPSStopVirtualMachineV1Input.Type; + +// Output Schema +export const VPSStopVirtualMachineV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSStopVirtualMachineV1Output = + typeof VPSStopVirtualMachineV1Output.Type; + +// The operation +/** + * Stop virtual machine + * + * Stop a specified virtual machine. + * If the virtual machine is already stopped, the request will still be processed without any effect. + * Use this endpoint to power off running VPS instances. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSStopVirtualMachineV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSStopVirtualMachineV1Input, + outputSchema: VPSStopVirtualMachineV1Output, + }), +); diff --git a/packages/hostinger/src/operations/VPSSyncFirewallV1.ts b/packages/hostinger/src/operations/VPSSyncFirewallV1.ts new file mode 100644 index 000000000..fc629d0fe --- /dev/null +++ b/packages/hostinger/src/operations/VPSSyncFirewallV1.ts @@ -0,0 +1,46 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSSyncFirewallV1Input = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct( + { + firewallId: Schema.Number.pipe(T.PathParam()), + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }, +).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/firewall/{firewallId}/sync/{virtualMachineId}", + }), +); +export type VPSSyncFirewallV1Input = typeof VPSSyncFirewallV1Input.Type; + +// Output Schema +export const VPSSyncFirewallV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSSyncFirewallV1Output = typeof VPSSyncFirewallV1Output.Type; + +// The operation +/** + * Sync firewall + * + * Sync a firewall for a specified virtual machine. + * Firewall can lose sync with virtual machine if the firewall has new rules added, removed or updated. + * Use this endpoint to apply updated firewall rules to VPS instances. + * + * @param firewallId - Firewall ID + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSSyncFirewallV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSSyncFirewallV1Input, + outputSchema: VPSSyncFirewallV1Output, + errors: [UnprocessableEntity] as const, +})); diff --git a/packages/hostinger/src/operations/VPSUninstallMonarxV1.ts b/packages/hostinger/src/operations/VPSUninstallMonarxV1.ts new file mode 100644 index 000000000..c422e3525 --- /dev/null +++ b/packages/hostinger/src/operations/VPSUninstallMonarxV1.ts @@ -0,0 +1,45 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSUninstallMonarxV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/monarx", + }), + ); +export type VPSUninstallMonarxV1Input = typeof VPSUninstallMonarxV1Input.Type; + +// Output Schema +export const VPSUninstallMonarxV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSUninstallMonarxV1Output = typeof VPSUninstallMonarxV1Output.Type; + +// The operation +/** + * Uninstall Monarx + * + * Uninstall the Monarx malware scanner on a specified virtual machine. + * If Monarx is not installed, the request will still be processed without any effect. + * Use this endpoint to remove malware scanner from VPS instances. + * + * @param virtualMachineId - Virtual Machine ID + */ +export const VPSUninstallMonarxV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSUninstallMonarxV1Input, + outputSchema: VPSUninstallMonarxV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSUpdateFirewallRuleV1.ts b/packages/hostinger/src/operations/VPSUpdateFirewallRuleV1.ts new file mode 100644 index 000000000..42ae980b1 --- /dev/null +++ b/packages/hostinger/src/operations/VPSUpdateFirewallRuleV1.ts @@ -0,0 +1,85 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSUpdateFirewallRuleV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + firewallId: Schema.Number.pipe(T.PathParam()), + ruleId: Schema.Number.pipe(T.PathParam()), + protocol: Schema.Literals([ + "TCP", + "UDP", + "ICMP", + "GRE", + "any", + "ESP", + "AH", + "ICMPv6", + "SSH", + "HTTP", + "HTTPS", + "MySQL", + "PostgreSQL", + ]), + port: Schema.String, + source: Schema.Literals(["any", "custom"]), + source_detail: Schema.String, + }).pipe( + T.Http({ + method: "PUT", + path: "/api/vps/v1/firewall/{firewallId}/rules/{ruleId}", + }), + ); +export type VPSUpdateFirewallRuleV1Input = + typeof VPSUpdateFirewallRuleV1Input.Type; + +// Output Schema +export const VPSUpdateFirewallRuleV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + action: Schema.optional(Schema.Literals(["accept", "drop"])), + protocol: Schema.optional( + Schema.Literals([ + "TCP", + "UDP", + "ICMP", + "GRE", + "any", + "ESP", + "AH", + "ICMPv6", + "SSH", + "HTTP", + "HTTPS", + "MySQL", + "PostgreSQL", + ]), + ), + port: Schema.optional(Schema.String), + source: Schema.optional(Schema.String), + source_detail: Schema.optional(Schema.String), + }); +export type VPSUpdateFirewallRuleV1Output = + typeof VPSUpdateFirewallRuleV1Output.Type; + +// The operation +/** + * Update firewall rule + * + * Update a specific firewall rule from a specified firewall. + * Any virtual machine that has this firewall activated will lose sync with the firewall + * and will have to be synced again manually. + * Use this endpoint to modify existing firewall rules. + * + * @param firewallId - Firewall ID + * @param ruleId - Firewall Rule ID + */ +export const VPSUpdateFirewallRuleV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: VPSUpdateFirewallRuleV1Input, + outputSchema: VPSUpdateFirewallRuleV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/VPSUpdatePostInstallScriptV1.ts b/packages/hostinger/src/operations/VPSUpdatePostInstallScriptV1.ts new file mode 100644 index 000000000..811db2aed --- /dev/null +++ b/packages/hostinger/src/operations/VPSUpdatePostInstallScriptV1.ts @@ -0,0 +1,47 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSUpdatePostInstallScriptV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + postInstallScriptId: Schema.Number.pipe(T.PathParam()), + name: Schema.String, + content: Schema.String, + }).pipe( + T.Http({ + method: "PUT", + path: "/api/vps/v1/post-install-scripts/{postInstallScriptId}", + }), + ); +export type VPSUpdatePostInstallScriptV1Input = + typeof VPSUpdatePostInstallScriptV1Input.Type; + +// Output Schema +export const VPSUpdatePostInstallScriptV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + content: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSUpdatePostInstallScriptV1Output = + typeof VPSUpdatePostInstallScriptV1Output.Type; + +// The operation +/** + * Update post-install script + * + * Update a specific post-install script. + * Use this endpoint to modify existing automation scripts. + * + * @param postInstallScriptId - Post-install script ID + */ +export const VPSUpdatePostInstallScriptV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSUpdatePostInstallScriptV1Input, + outputSchema: VPSUpdatePostInstallScriptV1Output, + errors: [UnprocessableEntity] as const, + })); diff --git a/packages/hostinger/src/operations/VPSUpdateProjectV1.ts b/packages/hostinger/src/operations/VPSUpdateProjectV1.ts new file mode 100644 index 000000000..082960d54 --- /dev/null +++ b/packages/hostinger/src/operations/VPSUpdateProjectV1.ts @@ -0,0 +1,47 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const VPSUpdateProjectV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + virtualMachineId: Schema.Number.pipe(T.PathParam()), + projectName: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "POST", + path: "/api/vps/v1/virtual-machines/{virtualMachineId}/docker/{projectName}/update", + }), + ); +export type VPSUpdateProjectV1Input = typeof VPSUpdateProjectV1Input.Type; + +// Output Schema +export const VPSUpdateProjectV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + state: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type VPSUpdateProjectV1Output = typeof VPSUpdateProjectV1Output.Type; + +// The operation +/** + * Update project + * + * Updates a Docker Compose project by pulling the latest image versions and + * recreating containers with new configurations. + * This operation preserves data volumes while applying changes from the compose file. + * Use this to deploy application updates, apply configuration changes, or + * refresh container images to their latest versions. + * + * @param virtualMachineId - Virtual Machine ID + * @param projectName - Docker Compose project name using alphanumeric characters, dashes, and underscores only + */ +export const VPSUpdateProjectV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: VPSUpdateProjectV1Input, + outputSchema: VPSUpdateProjectV1Output, + errors: [UnprocessableEntity] as const, +})); diff --git a/packages/hostinger/src/operations/billingCancelSubscriptionV1.ts b/packages/hostinger/src/operations/billingCancelSubscriptionV1.ts new file mode 100644 index 000000000..4894b7609 --- /dev/null +++ b/packages/hostinger/src/operations/billingCancelSubscriptionV1.ts @@ -0,0 +1,39 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const BillingCancelSubscriptionV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + subscriptionId: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/billing/v1/subscriptions/{subscriptionId}", + }), + ); +export type BillingCancelSubscriptionV1Input = + typeof BillingCancelSubscriptionV1Input.Type; + +// Output Schema +export const BillingCancelSubscriptionV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type BillingCancelSubscriptionV1Output = + typeof BillingCancelSubscriptionV1Output.Type; + +// The operation +/** + * Cancel subscription + * + * Cancel a subscription. UNDOCUMENTED endpoint observed in Hostinger's official Terraform provider; cancelling the subscription of a VPS deprovisions the virtual machine. + * + * @param subscriptionId - Subscription ID + */ +export const billingCancelSubscriptionV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: BillingCancelSubscriptionV1Input, + outputSchema: BillingCancelSubscriptionV1Output, + }), +); diff --git a/packages/hostinger/src/operations/billingDeletePaymentMethodV1.ts b/packages/hostinger/src/operations/billingDeletePaymentMethodV1.ts new file mode 100644 index 000000000..689670afd --- /dev/null +++ b/packages/hostinger/src/operations/billingDeletePaymentMethodV1.ts @@ -0,0 +1,39 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const BillingDeletePaymentMethodV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + paymentMethodId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/billing/v1/payment-methods/{paymentMethodId}", + }), + ); +export type BillingDeletePaymentMethodV1Input = + typeof BillingDeletePaymentMethodV1Input.Type; + +// Output Schema +export const BillingDeletePaymentMethodV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type BillingDeletePaymentMethodV1Output = + typeof BillingDeletePaymentMethodV1Output.Type; + +// The operation +/** + * Delete payment method + * + * Delete a payment method from your account. + * Use this endpoint to remove unused payment methods from user accounts. + * + * @param paymentMethodId - Payment method ID + */ +export const billingDeletePaymentMethodV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: BillingDeletePaymentMethodV1Input, + outputSchema: BillingDeletePaymentMethodV1Output, + })); diff --git a/packages/hostinger/src/operations/billingDisableAutoRenewalV1.ts b/packages/hostinger/src/operations/billingDisableAutoRenewalV1.ts new file mode 100644 index 000000000..67349e608 --- /dev/null +++ b/packages/hostinger/src/operations/billingDisableAutoRenewalV1.ts @@ -0,0 +1,61 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const BillingDisableAutoRenewalV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + subscriptionId: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/billing/v1/subscriptions/{subscriptionId}/auto-renewal/disable", + }), + ); +export type BillingDisableAutoRenewalV1Input = + typeof BillingDisableAutoRenewalV1Input.Type; + +// Output Schema +export const BillingDisableAutoRenewalV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.String), + name: Schema.optional(Schema.String), + status: Schema.optional( + Schema.Literals([ + "active", + "paused", + "cancelled", + "not_renewing", + "transferred", + "in_trial", + "future", + ]), + ), + billing_period: Schema.optional(Schema.Number), + billing_period_unit: Schema.optional(Schema.String), + currency_code: Schema.optional(Schema.String), + total_price: Schema.optional(Schema.Number), + renewal_price: Schema.optional(Schema.Number), + is_auto_renewed: Schema.optional(Schema.Boolean), + created_at: Schema.optional(Schema.String), + expires_at: Schema.optional(Schema.NullOr(Schema.String)), + next_billing_at: Schema.optional(Schema.NullOr(Schema.String)), + }); +export type BillingDisableAutoRenewalV1Output = + typeof BillingDisableAutoRenewalV1Output.Type; + +// The operation +/** + * Disable auto-renewal + * + * Disable auto-renewal for a subscription. + * Use this endpoint when disable auto-renewal for a subscription. + * + * @param subscriptionId - Subscription ID + */ +export const billingDisableAutoRenewalV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: BillingDisableAutoRenewalV1Input, + outputSchema: BillingDisableAutoRenewalV1Output, + }), +); diff --git a/packages/hostinger/src/operations/billingEnableAutoRenewalV1.ts b/packages/hostinger/src/operations/billingEnableAutoRenewalV1.ts new file mode 100644 index 000000000..ad201de38 --- /dev/null +++ b/packages/hostinger/src/operations/billingEnableAutoRenewalV1.ts @@ -0,0 +1,61 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const BillingEnableAutoRenewalV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + subscriptionId: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "PATCH", + path: "/api/billing/v1/subscriptions/{subscriptionId}/auto-renewal/enable", + }), + ); +export type BillingEnableAutoRenewalV1Input = + typeof BillingEnableAutoRenewalV1Input.Type; + +// Output Schema +export const BillingEnableAutoRenewalV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.String), + name: Schema.optional(Schema.String), + status: Schema.optional( + Schema.Literals([ + "active", + "paused", + "cancelled", + "not_renewing", + "transferred", + "in_trial", + "future", + ]), + ), + billing_period: Schema.optional(Schema.Number), + billing_period_unit: Schema.optional(Schema.String), + currency_code: Schema.optional(Schema.String), + total_price: Schema.optional(Schema.Number), + renewal_price: Schema.optional(Schema.Number), + is_auto_renewed: Schema.optional(Schema.Boolean), + created_at: Schema.optional(Schema.String), + expires_at: Schema.optional(Schema.NullOr(Schema.String)), + next_billing_at: Schema.optional(Schema.NullOr(Schema.String)), + }); +export type BillingEnableAutoRenewalV1Output = + typeof BillingEnableAutoRenewalV1Output.Type; + +// The operation +/** + * Enable auto-renewal + * + * Enable auto-renewal for a subscription. + * Use this endpoint when enable auto-renewal for a subscription. + * + * @param subscriptionId - Subscription ID + */ +export const billingEnableAutoRenewalV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: BillingEnableAutoRenewalV1Input, + outputSchema: BillingEnableAutoRenewalV1Output, + }), +); diff --git a/packages/hostinger/src/operations/billingGetCatalogItemListV1.ts b/packages/hostinger/src/operations/billingGetCatalogItemListV1.ts new file mode 100644 index 000000000..0a562cf44 --- /dev/null +++ b/packages/hostinger/src/operations/billingGetCatalogItemListV1.ts @@ -0,0 +1,59 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const BillingGetCatalogItemListV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + category: Schema.optional(Schema.Literals(["DOMAIN", "VPS"])), + name: Schema.optional(Schema.String), + }).pipe(T.Http({ method: "GET", path: "/api/billing/v1/catalog" })); +export type BillingGetCatalogItemListV1Input = + typeof BillingGetCatalogItemListV1Input.Type; + +// Output Schema +export const BillingGetCatalogItemListV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.String), + name: Schema.optional(Schema.String), + category: Schema.optional(Schema.String), + metadata: Schema.optional(Schema.NullOr(Schema.Unknown)), + prices: Schema.optional( + Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.String), + name: Schema.optional(Schema.String), + currency: Schema.optional(Schema.String), + price: Schema.optional(Schema.Number), + first_period_price: Schema.optional(Schema.Number), + period: Schema.optional(Schema.Number), + period_unit: Schema.optional( + Schema.Literals(["day", "week", "month", "year", "none"]), + ), + }), + ), + ), + }), + ); +export type BillingGetCatalogItemListV1Output = + typeof BillingGetCatalogItemListV1Output.Type; + +// The operation +/** + * Get catalog item list + * + * Retrieve catalog items available for order. + * Prices in catalog items is displayed as cents (without floating point), + * e.g: float `17.99` is displayed as integer `1799`. + * Use this endpoint to view available services and pricing before placing orders. + * + * @param category - Filter catalog items by category + * @param name - Filter catalog items by name. Use `*` for wildcard search, e.g. `.COM*` to find .com domain + */ +export const billingGetCatalogItemListV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: BillingGetCatalogItemListV1Input, + outputSchema: BillingGetCatalogItemListV1Output, + }), +); diff --git a/packages/hostinger/src/operations/billingGetPaymentMethodListV1.ts b/packages/hostinger/src/operations/billingGetPaymentMethodListV1.ts new file mode 100644 index 000000000..71b643470 --- /dev/null +++ b/packages/hostinger/src/operations/billingGetPaymentMethodListV1.ts @@ -0,0 +1,44 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const BillingGetPaymentMethodListV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe( + T.Http({ method: "GET", path: "/api/billing/v1/payment-methods" }), + ); +export type BillingGetPaymentMethodListV1Input = + typeof BillingGetPaymentMethodListV1Input.Type; + +// Output Schema +export const BillingGetPaymentMethodListV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + name: Schema.optional(Schema.String), + identifier: Schema.optional(Schema.String), + payment_method: Schema.optional(Schema.String), + is_default: Schema.optional(Schema.Boolean), + is_expired: Schema.optional(Schema.Boolean), + is_suspended: Schema.optional(Schema.Boolean), + created_at: Schema.optional(Schema.String), + expires_at: Schema.optional(Schema.String), + }), + ); +export type BillingGetPaymentMethodListV1Output = + typeof BillingGetPaymentMethodListV1Output.Type; + +// The operation +/** + * Get payment method list + * + * Retrieve available payment methods that can be used for placing new orders. + * If you want to add new payment method, + * please use [hPanel](https://hpanel.hostinger.com/billing/payment-methods). + * Use this endpoint to view available payment options before creating orders. + */ +export const billingGetPaymentMethodListV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: BillingGetPaymentMethodListV1Input, + outputSchema: BillingGetPaymentMethodListV1Output, + })); diff --git a/packages/hostinger/src/operations/billingGetSubscriptionListV1.ts b/packages/hostinger/src/operations/billingGetSubscriptionListV1.ts new file mode 100644 index 000000000..c307ed508 --- /dev/null +++ b/packages/hostinger/src/operations/billingGetSubscriptionListV1.ts @@ -0,0 +1,55 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const BillingGetSubscriptionListV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe( + T.Http({ method: "GET", path: "/api/billing/v1/subscriptions" }), + ); +export type BillingGetSubscriptionListV1Input = + typeof BillingGetSubscriptionListV1Input.Type; + +// Output Schema +export const BillingGetSubscriptionListV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.String), + name: Schema.optional(Schema.String), + status: Schema.optional( + Schema.Literals([ + "active", + "paused", + "cancelled", + "not_renewing", + "transferred", + "in_trial", + "future", + ]), + ), + billing_period: Schema.optional(Schema.Number), + billing_period_unit: Schema.optional(Schema.String), + currency_code: Schema.optional(Schema.String), + total_price: Schema.optional(Schema.Number), + renewal_price: Schema.optional(Schema.Number), + is_auto_renewed: Schema.optional(Schema.Boolean), + created_at: Schema.optional(Schema.String), + expires_at: Schema.optional(Schema.NullOr(Schema.String)), + next_billing_at: Schema.optional(Schema.NullOr(Schema.String)), + }), + ); +export type BillingGetSubscriptionListV1Output = + typeof BillingGetSubscriptionListV1Output.Type; + +// The operation +/** + * Get subscription list + * + * Retrieve a list of all subscriptions associated with your account. + * Use this endpoint to monitor active services and billing status. + */ +export const billingGetSubscriptionListV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: BillingGetSubscriptionListV1Input, + outputSchema: BillingGetSubscriptionListV1Output, + })); diff --git a/packages/hostinger/src/operations/billingSetDefaultPaymentMethodV1.ts b/packages/hostinger/src/operations/billingSetDefaultPaymentMethodV1.ts new file mode 100644 index 000000000..87eed38ca --- /dev/null +++ b/packages/hostinger/src/operations/billingSetDefaultPaymentMethodV1.ts @@ -0,0 +1,39 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const BillingSetDefaultPaymentMethodV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + paymentMethodId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "POST", + path: "/api/billing/v1/payment-methods/{paymentMethodId}", + }), + ); +export type BillingSetDefaultPaymentMethodV1Input = + typeof BillingSetDefaultPaymentMethodV1Input.Type; + +// Output Schema +export const BillingSetDefaultPaymentMethodV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type BillingSetDefaultPaymentMethodV1Output = + typeof BillingSetDefaultPaymentMethodV1Output.Type; + +// The operation +/** + * Set default payment method + * + * Set the default payment method for your account. + * Use this endpoint to configure the primary payment method for future orders. + * + * @param paymentMethodId - Payment method ID + */ +export const billingSetDefaultPaymentMethodV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: BillingSetDefaultPaymentMethodV1Input, + outputSchema: BillingSetDefaultPaymentMethodV1Output, + })); diff --git a/packages/hostinger/src/operations/domainsCheckDomainAvailabilityV1.ts b/packages/hostinger/src/operations/domainsCheckDomainAvailabilityV1.ts new file mode 100644 index 000000000..cee09d7e5 --- /dev/null +++ b/packages/hostinger/src/operations/domainsCheckDomainAvailabilityV1.ts @@ -0,0 +1,45 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const DomainsCheckDomainAvailabilityV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String, + tlds: Schema.Array(Schema.String), + with_alternatives: Schema.optional(Schema.Boolean), + }).pipe(T.Http({ method: "POST", path: "/api/domains/v1/availability" })); +export type DomainsCheckDomainAvailabilityV1Input = + typeof DomainsCheckDomainAvailabilityV1Input.Type; + +// Output Schema +export const DomainsCheckDomainAvailabilityV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + domain: Schema.optional(Schema.NullOr(Schema.String)), + is_available: Schema.optional(Schema.Boolean), + is_alternative: Schema.optional(Schema.Boolean), + restriction: Schema.optional(Schema.NullOr(Schema.String)), + }), + ); +export type DomainsCheckDomainAvailabilityV1Output = + typeof DomainsCheckDomainAvailabilityV1Output.Type; + +// The operation +/** + * Check domain availability + * + * Check availability of domain names across multiple TLDs. + * Multiple TLDs can be checked at once. + * If you want alternative domains with response, provide only one TLD and set `with_alternatives` to `true`. + * TLDs should be provided without leading dot (e.g. `com`, `net`, `org`). + * Endpoint has rate limit of 10 requests per minute. + * Use this endpoint to verify domain availability before purchase. + */ +export const domainsCheckDomainAvailabilityV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: DomainsCheckDomainAvailabilityV1Input, + outputSchema: DomainsCheckDomainAvailabilityV1Output, + errors: [UnprocessableEntity] as const, + })); diff --git a/packages/hostinger/src/operations/domainsCreateDomainForwardingV1.ts b/packages/hostinger/src/operations/domainsCreateDomainForwardingV1.ts new file mode 100644 index 000000000..5a30ce449 --- /dev/null +++ b/packages/hostinger/src/operations/domainsCreateDomainForwardingV1.ts @@ -0,0 +1,40 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const DomainsCreateDomainForwardingV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String, + redirect_type: Schema.Literals(["301", "302"]), + redirect_url: Schema.String, + }).pipe(T.Http({ method: "POST", path: "/api/domains/v1/forwarding" })); +export type DomainsCreateDomainForwardingV1Input = + typeof DomainsCreateDomainForwardingV1Input.Type; + +// Output Schema +export const DomainsCreateDomainForwardingV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.optional(Schema.NullOr(Schema.String)), + redirect_type: Schema.optional(Schema.Literals(["301", "302"])), + redirect_url: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.NullOr(Schema.String)), + }); +export type DomainsCreateDomainForwardingV1Output = + typeof DomainsCreateDomainForwardingV1Output.Type; + +// The operation +/** + * Create domain forwarding + * + * Create domain forwarding configuration. + * Use this endpoint to set up domain redirects to other URLs. + */ +export const domainsCreateDomainForwardingV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: DomainsCreateDomainForwardingV1Input, + outputSchema: DomainsCreateDomainForwardingV1Output, + errors: [UnprocessableEntity] as const, + })); diff --git a/packages/hostinger/src/operations/domainsCreateWHOISProfileV1.ts b/packages/hostinger/src/operations/domainsCreateWHOISProfileV1.ts new file mode 100644 index 000000000..95f3563b4 --- /dev/null +++ b/packages/hostinger/src/operations/domainsCreateWHOISProfileV1.ts @@ -0,0 +1,48 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const DomainsCreateWHOISProfileV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + tld: Schema.String, + country: Schema.String, + entity_type: Schema.Literals(["individual", "organization"]), + tld_details: Schema.optional(Schema.Unknown), + whois_details: Schema.Unknown, + }).pipe(T.Http({ method: "POST", path: "/api/domains/v1/whois" })); +export type DomainsCreateWHOISProfileV1Input = + typeof DomainsCreateWHOISProfileV1Input.Type; + +// Output Schema +export const DomainsCreateWHOISProfileV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + tld: Schema.optional(Schema.String), + country: Schema.optional(Schema.String), + entity_type: Schema.optional( + Schema.Literals(["individual", "organization"]), + ), + whois_details: Schema.optional(Schema.Unknown), + tld_details: Schema.optional(Schema.Unknown), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type DomainsCreateWHOISProfileV1Output = + typeof DomainsCreateWHOISProfileV1Output.Type; + +// The operation +/** + * Create WHOIS profile + * + * Create WHOIS contact profile. + * Use this endpoint to add new contact information for domain registration. + */ +export const domainsCreateWHOISProfileV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: DomainsCreateWHOISProfileV1Input, + outputSchema: DomainsCreateWHOISProfileV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/domainsDeleteDomainForwardingV1.ts b/packages/hostinger/src/operations/domainsDeleteDomainForwardingV1.ts new file mode 100644 index 000000000..06b48fa35 --- /dev/null +++ b/packages/hostinger/src/operations/domainsDeleteDomainForwardingV1.ts @@ -0,0 +1,36 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DomainsDeleteDomainForwardingV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ method: "DELETE", path: "/api/domains/v1/forwarding/{domain}" }), + ); +export type DomainsDeleteDomainForwardingV1Input = + typeof DomainsDeleteDomainForwardingV1Input.Type; + +// Output Schema +export const DomainsDeleteDomainForwardingV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type DomainsDeleteDomainForwardingV1Output = + typeof DomainsDeleteDomainForwardingV1Output.Type; + +// The operation +/** + * Delete domain forwarding + * + * Delete domain forwarding data. + * Use this endpoint to remove redirect configuration from domains. + * + * @param domain - Domain name + */ +export const domainsDeleteDomainForwardingV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: DomainsDeleteDomainForwardingV1Input, + outputSchema: DomainsDeleteDomainForwardingV1Output, + })); diff --git a/packages/hostinger/src/operations/domainsDeleteWHOISProfileV1.ts b/packages/hostinger/src/operations/domainsDeleteWHOISProfileV1.ts new file mode 100644 index 000000000..46edf827c --- /dev/null +++ b/packages/hostinger/src/operations/domainsDeleteWHOISProfileV1.ts @@ -0,0 +1,37 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DomainsDeleteWHOISProfileV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + whoisId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ method: "DELETE", path: "/api/domains/v1/whois/{whoisId}" }), + ); +export type DomainsDeleteWHOISProfileV1Input = + typeof DomainsDeleteWHOISProfileV1Input.Type; + +// Output Schema +export const DomainsDeleteWHOISProfileV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type DomainsDeleteWHOISProfileV1Output = + typeof DomainsDeleteWHOISProfileV1Output.Type; + +// The operation +/** + * Delete WHOIS profile + * + * Delete WHOIS contact profile. + * Use this endpoint to remove unused contact profiles from account. + * + * @param whoisId - WHOIS ID + */ +export const domainsDeleteWHOISProfileV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: DomainsDeleteWHOISProfileV1Input, + outputSchema: DomainsDeleteWHOISProfileV1Output, + }), +); diff --git a/packages/hostinger/src/operations/domainsDisableDomainLockV1.ts b/packages/hostinger/src/operations/domainsDisableDomainLockV1.ts new file mode 100644 index 000000000..28db3885a --- /dev/null +++ b/packages/hostinger/src/operations/domainsDisableDomainLockV1.ts @@ -0,0 +1,41 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DomainsDisableDomainLockV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/domains/v1/portfolio/{domain}/domain-lock", + }), + ); +export type DomainsDisableDomainLockV1Input = + typeof DomainsDisableDomainLockV1Input.Type; + +// Output Schema +export const DomainsDisableDomainLockV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type DomainsDisableDomainLockV1Output = + typeof DomainsDisableDomainLockV1Output.Type; + +// The operation +/** + * Disable domain lock + * + * Disable domain lock for the domain. + * Domain lock needs to be disabled before transferring the domain to another registrar. + * Use this endpoint to prepare domains for transfer to other registrars. + * + * @param domain - Domain name + */ +export const domainsDisableDomainLockV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: DomainsDisableDomainLockV1Input, + outputSchema: DomainsDisableDomainLockV1Output, + }), +); diff --git a/packages/hostinger/src/operations/domainsDisablePrivacyProtectionV1.ts b/packages/hostinger/src/operations/domainsDisablePrivacyProtectionV1.ts new file mode 100644 index 000000000..87cb40c66 --- /dev/null +++ b/packages/hostinger/src/operations/domainsDisablePrivacyProtectionV1.ts @@ -0,0 +1,40 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DomainsDisablePrivacyProtectionV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/domains/v1/portfolio/{domain}/privacy-protection", + }), + ); +export type DomainsDisablePrivacyProtectionV1Input = + typeof DomainsDisablePrivacyProtectionV1Input.Type; + +// Output Schema +export const DomainsDisablePrivacyProtectionV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type DomainsDisablePrivacyProtectionV1Output = + typeof DomainsDisablePrivacyProtectionV1Output.Type; + +// The operation +/** + * Disable privacy protection + * + * Disable privacy protection for the domain. + * When privacy protection is disabled, domain owner's personal information is visible in public WHOIS database. + * Use this endpoint to make domain owner's information publicly visible. + * + * @param domain - Domain name + */ +export const domainsDisablePrivacyProtectionV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: DomainsDisablePrivacyProtectionV1Input, + outputSchema: DomainsDisablePrivacyProtectionV1Output, + })); diff --git a/packages/hostinger/src/operations/domainsEnableDomainLockV1.ts b/packages/hostinger/src/operations/domainsEnableDomainLockV1.ts new file mode 100644 index 000000000..1a30c9425 --- /dev/null +++ b/packages/hostinger/src/operations/domainsEnableDomainLockV1.ts @@ -0,0 +1,42 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DomainsEnableDomainLockV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "PUT", + path: "/api/domains/v1/portfolio/{domain}/domain-lock", + }), + ); +export type DomainsEnableDomainLockV1Input = + typeof DomainsEnableDomainLockV1Input.Type; + +// Output Schema +export const DomainsEnableDomainLockV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type DomainsEnableDomainLockV1Output = + typeof DomainsEnableDomainLockV1Output.Type; + +// The operation +/** + * Enable domain lock + * + * Enable domain lock for the domain. + * When domain lock is enabled, + * the domain cannot be transferred to another registrar without first disabling the lock. + * Use this endpoint to secure domains against unauthorized transfers. + * + * @param domain - Domain name + */ +export const domainsEnableDomainLockV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: DomainsEnableDomainLockV1Input, + outputSchema: DomainsEnableDomainLockV1Output, + }), +); diff --git a/packages/hostinger/src/operations/domainsEnablePrivacyProtectionV1.ts b/packages/hostinger/src/operations/domainsEnablePrivacyProtectionV1.ts new file mode 100644 index 000000000..84375bcef --- /dev/null +++ b/packages/hostinger/src/operations/domainsEnablePrivacyProtectionV1.ts @@ -0,0 +1,40 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DomainsEnablePrivacyProtectionV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "PUT", + path: "/api/domains/v1/portfolio/{domain}/privacy-protection", + }), + ); +export type DomainsEnablePrivacyProtectionV1Input = + typeof DomainsEnablePrivacyProtectionV1Input.Type; + +// Output Schema +export const DomainsEnablePrivacyProtectionV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type DomainsEnablePrivacyProtectionV1Output = + typeof DomainsEnablePrivacyProtectionV1Output.Type; + +// The operation +/** + * Enable privacy protection + * + * Enable privacy protection for the domain. + * When privacy protection is enabled, domain owner's personal information is hidden from public WHOIS database. + * Use this endpoint to protect domain owner's personal information from public view. + * + * @param domain - Domain name + */ +export const domainsEnablePrivacyProtectionV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: DomainsEnablePrivacyProtectionV1Input, + outputSchema: DomainsEnablePrivacyProtectionV1Output, + })); diff --git a/packages/hostinger/src/operations/domainsGetDomainDetailsV1.ts b/packages/hostinger/src/operations/domainsGetDomainDetailsV1.ts new file mode 100644 index 000000000..ae81c9b25 --- /dev/null +++ b/packages/hostinger/src/operations/domainsGetDomainDetailsV1.ts @@ -0,0 +1,76 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DomainsGetDomainDetailsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ method: "GET", path: "/api/domains/v1/portfolio/{domain}" }), + ); +export type DomainsGetDomainDetailsV1Input = + typeof DomainsGetDomainDetailsV1Input.Type; + +// Output Schema +export const DomainsGetDomainDetailsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.optional(Schema.String), + status: Schema.optional( + Schema.Literals([ + "active", + "pending_setup", + "expired", + "requested", + "pending_verification", + "deleted", + "suspended", + "failed", + ]), + ), + message: Schema.optional(Schema.NullOr(Schema.String)), + is_privacy_protection_allowed: Schema.optional(Schema.Boolean), + is_privacy_protected: Schema.optional(Schema.Boolean), + is_lockable: Schema.optional(Schema.Boolean), + is_locked: Schema.optional(Schema.Boolean), + name_servers: Schema.optional( + Schema.Struct({ + ns1: Schema.optional(Schema.String), + ns2: Schema.optional(Schema.String), + }), + ), + child_name_servers: Schema.optional( + Schema.Array(Schema.Array(Schema.String)), + ), + domain_contacts: Schema.optional( + Schema.Struct({ + admin_id: Schema.optional(Schema.Number), + owner_id: Schema.optional(Schema.Number), + billing_id: Schema.optional(Schema.Number), + tech_id: Schema.optional(Schema.Number), + }), + ), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + "60_days_lock_expires_at": Schema.optional(Schema.NullOr(Schema.String)), + registered_at: Schema.optional(Schema.NullOr(Schema.String)), + expires_at: Schema.optional(Schema.NullOr(Schema.String)), + }); +export type DomainsGetDomainDetailsV1Output = + typeof DomainsGetDomainDetailsV1Output.Type; + +// The operation +/** + * Get domain details + * + * Retrieve detailed information for specified domain. + * Use this endpoint to view comprehensive domain configuration and status. + * + * @param domain - Domain name + */ +export const domainsGetDomainDetailsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: DomainsGetDomainDetailsV1Input, + outputSchema: DomainsGetDomainDetailsV1Output, + }), +); diff --git a/packages/hostinger/src/operations/domainsGetDomainForwardingV1.ts b/packages/hostinger/src/operations/domainsGetDomainForwardingV1.ts new file mode 100644 index 000000000..9a9a7f83c --- /dev/null +++ b/packages/hostinger/src/operations/domainsGetDomainForwardingV1.ts @@ -0,0 +1,40 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DomainsGetDomainForwardingV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ method: "GET", path: "/api/domains/v1/forwarding/{domain}" }), + ); +export type DomainsGetDomainForwardingV1Input = + typeof DomainsGetDomainForwardingV1Input.Type; + +// Output Schema +export const DomainsGetDomainForwardingV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.optional(Schema.NullOr(Schema.String)), + redirect_type: Schema.optional(Schema.Literals(["301", "302"])), + redirect_url: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.NullOr(Schema.String)), + }); +export type DomainsGetDomainForwardingV1Output = + typeof DomainsGetDomainForwardingV1Output.Type; + +// The operation +/** + * Get domain forwarding + * + * Retrieve domain forwarding data. + * Use this endpoint to view current redirect configuration for domains. + * + * @param domain - Domain name + */ +export const domainsGetDomainForwardingV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: DomainsGetDomainForwardingV1Input, + outputSchema: DomainsGetDomainForwardingV1Output, + })); diff --git a/packages/hostinger/src/operations/domainsGetDomainListV1.ts b/packages/hostinger/src/operations/domainsGetDomainListV1.ts new file mode 100644 index 000000000..8b4db022e --- /dev/null +++ b/packages/hostinger/src/operations/domainsGetDomainListV1.ts @@ -0,0 +1,58 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DomainsGetDomainListV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe( + T.Http({ method: "GET", path: "/api/domains/v1/portfolio" }), + ); +export type DomainsGetDomainListV1Input = + typeof DomainsGetDomainListV1Input.Type; + +// Output Schema +export const DomainsGetDomainListV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + domain: Schema.optional(Schema.NullOr(Schema.String)), + type: Schema.optional( + Schema.Literals([ + "domain", + "free_domain", + "domain_transfer", + "free_domain_transfer", + ]), + ), + status: Schema.optional( + Schema.Literals([ + "active", + "pending_setup", + "expired", + "requested", + "pending_verification", + "deleted", + "suspended", + "failed", + ]), + ), + created_at: Schema.optional(Schema.String), + expires_at: Schema.optional(Schema.NullOr(Schema.String)), + }), + ); +export type DomainsGetDomainListV1Output = + typeof DomainsGetDomainListV1Output.Type; + +// The operation +/** + * Get domain list + * + * Retrieve all domains associated with your account. + * Use this endpoint to view user's domain portfolio. + */ +export const domainsGetDomainListV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: DomainsGetDomainListV1Input, + outputSchema: DomainsGetDomainListV1Output, + }), +); diff --git a/packages/hostinger/src/operations/domainsGetWHOISProfileListV1.ts b/packages/hostinger/src/operations/domainsGetWHOISProfileListV1.ts new file mode 100644 index 000000000..a41a20e4a --- /dev/null +++ b/packages/hostinger/src/operations/domainsGetWHOISProfileListV1.ts @@ -0,0 +1,45 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DomainsGetWHOISProfileListV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + tld: Schema.optional(Schema.String), + }).pipe(T.Http({ method: "GET", path: "/api/domains/v1/whois" })); +export type DomainsGetWHOISProfileListV1Input = + typeof DomainsGetWHOISProfileListV1Input.Type; + +// Output Schema +export const DomainsGetWHOISProfileListV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + tld: Schema.optional(Schema.String), + country: Schema.optional(Schema.String), + entity_type: Schema.optional( + Schema.Literals(["individual", "organization"]), + ), + whois_details: Schema.optional(Schema.Unknown), + tld_details: Schema.optional(Schema.Unknown), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }), + ); +export type DomainsGetWHOISProfileListV1Output = + typeof DomainsGetWHOISProfileListV1Output.Type; + +// The operation +/** + * Get WHOIS profile list + * + * Retrieve WHOIS contact profiles. + * Use this endpoint to view available contact profiles for domain registration. + * + * @param tld - Filter by TLD (without leading dot) + */ +export const domainsGetWHOISProfileListV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: DomainsGetWHOISProfileListV1Input, + outputSchema: DomainsGetWHOISProfileListV1Output, + })); diff --git a/packages/hostinger/src/operations/domainsGetWHOISProfileUsageV1.ts b/packages/hostinger/src/operations/domainsGetWHOISProfileUsageV1.ts new file mode 100644 index 000000000..050af4b97 --- /dev/null +++ b/packages/hostinger/src/operations/domainsGetWHOISProfileUsageV1.ts @@ -0,0 +1,34 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DomainsGetWHOISProfileUsageV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + whoisId: Schema.Number.pipe(T.PathParam()), + }).pipe( + T.Http({ method: "GET", path: "/api/domains/v1/whois/{whoisId}/usage" }), + ); +export type DomainsGetWHOISProfileUsageV1Input = + typeof DomainsGetWHOISProfileUsageV1Input.Type; + +// Output Schema +export const DomainsGetWHOISProfileUsageV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array(Schema.String); +export type DomainsGetWHOISProfileUsageV1Output = + typeof DomainsGetWHOISProfileUsageV1Output.Type; + +// The operation +/** + * Get WHOIS profile usage + * + * Retrieve domain list where provided WHOIS contact profile is used. + * Use this endpoint to view which domains use specific contact profiles. + * + * @param whoisId - WHOIS ID + */ +export const domainsGetWHOISProfileUsageV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: DomainsGetWHOISProfileUsageV1Input, + outputSchema: DomainsGetWHOISProfileUsageV1Output, + })); diff --git a/packages/hostinger/src/operations/domainsGetWHOISProfileV1.ts b/packages/hostinger/src/operations/domainsGetWHOISProfileV1.ts new file mode 100644 index 000000000..451c3fae2 --- /dev/null +++ b/packages/hostinger/src/operations/domainsGetWHOISProfileV1.ts @@ -0,0 +1,44 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const DomainsGetWHOISProfileV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + whoisId: Schema.Number.pipe(T.PathParam()), + }).pipe(T.Http({ method: "GET", path: "/api/domains/v1/whois/{whoisId}" })); +export type DomainsGetWHOISProfileV1Input = + typeof DomainsGetWHOISProfileV1Input.Type; + +// Output Schema +export const DomainsGetWHOISProfileV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + tld: Schema.optional(Schema.String), + country: Schema.optional(Schema.String), + entity_type: Schema.optional( + Schema.Literals(["individual", "organization"]), + ), + whois_details: Schema.optional(Schema.Unknown), + tld_details: Schema.optional(Schema.Unknown), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type DomainsGetWHOISProfileV1Output = + typeof DomainsGetWHOISProfileV1Output.Type; + +// The operation +/** + * Get WHOIS profile + * + * Retrieve a WHOIS contact profile. + * Use this endpoint to view domain registration contact information. + * + * @param whoisId - WHOIS ID + */ +export const domainsGetWHOISProfileV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: DomainsGetWHOISProfileV1Input, + outputSchema: DomainsGetWHOISProfileV1Output, + }), +); diff --git a/packages/hostinger/src/operations/domainsPurchaseNewDomainV1.ts b/packages/hostinger/src/operations/domainsPurchaseNewDomainV1.ts new file mode 100644 index 000000000..a074dcfd3 --- /dev/null +++ b/packages/hostinger/src/operations/domainsPurchaseNewDomainV1.ts @@ -0,0 +1,86 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const DomainsPurchaseNewDomainV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String, + item_id: Schema.String, + payment_method_id: Schema.optional(Schema.Number), + domain_contacts: Schema.optional( + Schema.Struct({ + owner_id: Schema.optional(Schema.Number), + admin_id: Schema.optional(Schema.Number), + billing_id: Schema.optional(Schema.Number), + tech_id: Schema.optional(Schema.Number), + }), + ), + additional_details: Schema.optional(Schema.Unknown), + coupons: Schema.optional(Schema.Array(Schema.Unknown)), + }).pipe(T.Http({ method: "POST", path: "/api/domains/v1/portfolio" })); +export type DomainsPurchaseNewDomainV1Input = + typeof DomainsPurchaseNewDomainV1Input.Type; + +// Output Schema +export const DomainsPurchaseNewDomainV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + id: Schema.optional(Schema.Number), + subscription_id: Schema.optional(Schema.String), + status: Schema.optional( + Schema.Literals([ + "completed", + "pending", + "processing", + "failed", + "refunded", + "cancelled", + "awaiting_payment", + "payment_initiated", + "fraud_refund", + ]), + ), + currency: Schema.optional(Schema.String), + subtotal: Schema.optional(Schema.Number), + total: Schema.optional(Schema.Number), + billing_address: Schema.optional( + Schema.Struct({ + first_name: Schema.optional(Schema.String), + last_name: Schema.optional(Schema.String), + company: Schema.optional(Schema.NullOr(Schema.String)), + address_1: Schema.optional(Schema.NullOr(Schema.String)), + address_2: Schema.optional(Schema.NullOr(Schema.String)), + city: Schema.optional(Schema.NullOr(Schema.String)), + state: Schema.optional(Schema.NullOr(Schema.String)), + zip: Schema.optional(Schema.NullOr(Schema.String)), + country: Schema.optional(Schema.NullOr(Schema.String)), + phone: Schema.optional(Schema.NullOr(Schema.String)), + email: Schema.optional(Schema.String), + }), + ), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type DomainsPurchaseNewDomainV1Output = + typeof DomainsPurchaseNewDomainV1Output.Type; + +// The operation +/** + * Purchase new domain + * + * Purchase and register a new domain name. + * If registration fails, login to [hPanel](https://hpanel.hostinger.com/) and check domain registration status. + * If no payment method is provided, your default payment method will be used automatically. + * If no WHOIS information is provided, default contact information for that TLD will be used. + * Before making request, ensure WHOIS information for desired TLD exists in your account. + * Some TLDs require `additional_details` to be provided and these will be validated before completing purchase. + * Use this endpoint to register new domains for users. + */ +export const domainsPurchaseNewDomainV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: DomainsPurchaseNewDomainV1Input, + outputSchema: DomainsPurchaseNewDomainV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/domainsUpdateDomainNameserversV1.ts b/packages/hostinger/src/operations/domainsUpdateDomainNameserversV1.ts new file mode 100644 index 000000000..778509c9b --- /dev/null +++ b/packages/hostinger/src/operations/domainsUpdateDomainNameserversV1.ts @@ -0,0 +1,46 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const DomainsUpdateDomainNameserversV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String.pipe(T.PathParam()), + ns1: Schema.String, + ns2: Schema.String, + ns3: Schema.optional(Schema.String), + ns4: Schema.optional(Schema.String), + }).pipe( + T.Http({ + method: "PUT", + path: "/api/domains/v1/portfolio/{domain}/nameservers", + }), + ); +export type DomainsUpdateDomainNameserversV1Input = + typeof DomainsUpdateDomainNameserversV1Input.Type; + +// Output Schema +export const DomainsUpdateDomainNameserversV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type DomainsUpdateDomainNameserversV1Output = + typeof DomainsUpdateDomainNameserversV1Output.Type; + +// The operation +/** + * Update domain nameservers + * + * Set nameservers for a specified domain. + * Be aware, that improper nameserver configuration can lead to the domain being unresolvable or unavailable. + * Use this endpoint to configure custom DNS hosting for domains. + * + * @param domain - Domain name + */ +export const domainsUpdateDomainNameserversV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: DomainsUpdateDomainNameserversV1Input, + outputSchema: DomainsUpdateDomainNameserversV1Output, + errors: [UnprocessableEntity] as const, + })); diff --git a/packages/hostinger/src/operations/ecommerceCreateStoreV1.ts b/packages/hostinger/src/operations/ecommerceCreateStoreV1.ts new file mode 100644 index 000000000..7560bee05 --- /dev/null +++ b/packages/hostinger/src/operations/ecommerceCreateStoreV1.ts @@ -0,0 +1,70 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const EcommerceCreateStoreV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + name: Schema.optional(Schema.String), + country_code: Schema.optional(Schema.String), + company_email: Schema.optional(Schema.String), + company_name: Schema.optional(Schema.String), + language: Schema.optional(Schema.String), + sales_channel: Schema.optional( + Schema.Struct({ + type: Schema.optional(Schema.Literals(["custom"])), + external_id: Schema.optional(Schema.NullOr(Schema.String)), + }), + ), + }).pipe(T.Http({ method: "POST", path: "/api/ecommerce/v1/stores" })); +export type EcommerceCreateStoreV1Input = + typeof EcommerceCreateStoreV1Input.Type; + +// Output Schema +export const EcommerceCreateStoreV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + store: Schema.optional( + Schema.Struct({ + id: Schema.optional(Schema.String), + name: Schema.optional(Schema.NullOr(Schema.String)), + company_name: Schema.optional(Schema.NullOr(Schema.String)), + h_panel_id: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + default_currency_code: Schema.optional(Schema.String), + }), + ), + sales_channel: Schema.optional( + Schema.Struct({ + id: Schema.optional(Schema.String), + type: Schema.optional( + Schema.Literals([ + "builder", + "horizons", + "tiktok", + "custom", + "quick-link", + "wordpress", + ]), + ), + external_id: Schema.optional(Schema.NullOr(Schema.String)), + }), + ), + }); +export type EcommerceCreateStoreV1Output = + typeof EcommerceCreateStoreV1Output.Type; + +// The operation +/** + * Create store + * + * Create a new store for your account. + * A primary sales channel is created alongside the store. + */ +export const ecommerceCreateStoreV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: EcommerceCreateStoreV1Input, + outputSchema: EcommerceCreateStoreV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/ecommerceGetStoresV1.ts b/packages/hostinger/src/operations/ecommerceGetStoresV1.ts new file mode 100644 index 000000000..3b703bbe6 --- /dev/null +++ b/packages/hostinger/src/operations/ecommerceGetStoresV1.ts @@ -0,0 +1,50 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const EcommerceGetStoresV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + page: Schema.optional(Schema.Number), + }).pipe(T.Http({ method: "GET", path: "/api/ecommerce/v1/stores" })); +export type EcommerceGetStoresV1Input = typeof EcommerceGetStoresV1Input.Type; + +// Output Schema +export const EcommerceGetStoresV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + data: Schema.optional( + Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.String), + name: Schema.optional(Schema.NullOr(Schema.String)), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + version: Schema.optional(Schema.String), + company_name: Schema.optional(Schema.NullOr(Schema.String)), + }), + ), + ), + meta: Schema.optional( + Schema.Struct({ + current_page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + total: Schema.optional(Schema.Number), + }), + ), + }); +export type EcommerceGetStoresV1Output = typeof EcommerceGetStoresV1Output.Type; + +// The operation +/** + * Get stores + * + * Retrieve the stores associated with your account. + * + * @param page - Page number + */ +export const ecommerceGetStoresV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: EcommerceGetStoresV1Input, + outputSchema: EcommerceGetStoresV1Output, + }), +); diff --git a/packages/hostinger/src/operations/hostingChangeDatabasePasswordV1.ts b/packages/hostinger/src/operations/hostingChangeDatabasePasswordV1.ts new file mode 100644 index 000000000..852e670ca --- /dev/null +++ b/packages/hostinger/src/operations/hostingChangeDatabasePasswordV1.ts @@ -0,0 +1,45 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; +import { SensitiveString } from "../sensitive.ts"; + +// Input Schema +export const HostingChangeDatabasePasswordV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + name: Schema.String.pipe(T.PathParam()), + password: SensitiveString, + }).pipe( + T.Http({ + method: "PATCH", + path: "/api/hosting/v1/accounts/{username}/databases/{name}/change-password", + }), + ); +export type HostingChangeDatabasePasswordV1Input = + typeof HostingChangeDatabasePasswordV1Input.Type; + +// Output Schema +export const HostingChangeDatabasePasswordV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type HostingChangeDatabasePasswordV1Output = + typeof HostingChangeDatabasePasswordV1Output.Type; + +// The operation +/** + * Change database password + * + * Changes the password for the specified database user. + * The database name must be the full name returned by the list databases endpoint. + * The password must also be updated in any website configuration that uses this database. + * + * @param name - Full database name as returned by the list databases endpoint. + */ +export const hostingChangeDatabasePasswordV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingChangeDatabasePasswordV1Input, + outputSchema: HostingChangeDatabasePasswordV1Output, + errors: [UnprocessableEntity] as const, + })); diff --git a/packages/hostinger/src/operations/hostingCreateAccountDatabaseV1.ts b/packages/hostinger/src/operations/hostingCreateAccountDatabaseV1.ts new file mode 100644 index 000000000..fc73363db --- /dev/null +++ b/packages/hostinger/src/operations/hostingCreateAccountDatabaseV1.ts @@ -0,0 +1,44 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; +import { SensitiveString } from "../sensitive.ts"; + +// Input Schema +export const HostingCreateAccountDatabaseV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + name: Schema.String, + user: Schema.String, + password: SensitiveString, + website_domain: Schema.String, + }).pipe( + T.Http({ + method: "POST", + path: "/api/hosting/v1/accounts/{username}/databases", + }), + ); +export type HostingCreateAccountDatabaseV1Input = + typeof HostingCreateAccountDatabaseV1Input.Type; + +// Output Schema +export const HostingCreateAccountDatabaseV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type HostingCreateAccountDatabaseV1Output = + typeof HostingCreateAccountDatabaseV1Output.Type; + +// The operation +/** + * Create account database + * + * Creates a database with a database user and password for the specified account. + * The database name and user are automatically prefixed with the account username when needed. + */ +export const hostingCreateAccountDatabaseV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingCreateAccountDatabaseV1Input, + outputSchema: HostingCreateAccountDatabaseV1Output, + errors: [UnprocessableEntity] as const, + })); diff --git a/packages/hostinger/src/operations/hostingCreateNodeJSBuildFromArchiveV1.ts b/packages/hostinger/src/operations/hostingCreateNodeJSBuildFromArchiveV1.ts new file mode 100644 index 000000000..5557e19fc --- /dev/null +++ b/packages/hostinger/src/operations/hostingCreateNodeJSBuildFromArchiveV1.ts @@ -0,0 +1,88 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const HostingCreateNodeJSBuildFromArchiveV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + domain: Schema.String.pipe(T.PathParam()), + archive: Schema.String, + node_version: Schema.optional( + Schema.NullOr(Schema.Literals([18, 20, 22, 24])), + ), + app_type: Schema.optional( + Schema.NullOr( + Schema.Literals([ + "create-react-app", + "vite", + "angular", + "react", + "vue", + "parcel", + "express", + "fastify", + "nest", + ]), + ), + ), + root_directory: Schema.optional(Schema.NullOr(Schema.String)), + output_directory: Schema.optional(Schema.NullOr(Schema.String)), + build_script: Schema.optional(Schema.NullOr(Schema.String)), + entry_file: Schema.optional(Schema.NullOr(Schema.String)), + package_manager: Schema.optional( + Schema.NullOr(Schema.Literals(["npm", "yarn", "pnpm"])), + ), + }).pipe( + T.Http({ + method: "POST", + path: "/api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/builds/from-archive", + }), + ); +export type HostingCreateNodeJSBuildFromArchiveV1Input = + typeof HostingCreateNodeJSBuildFromArchiveV1Input.Type; + +// Output Schema +export const HostingCreateNodeJSBuildFromArchiveV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + uuid: Schema.optional(Schema.String), + state: Schema.optional( + Schema.Literals(["pending", "running", "completed", "failed"]), + ), + options: Schema.optional(Schema.Unknown), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type HostingCreateNodeJSBuildFromArchiveV1Output = + typeof HostingCreateNodeJSBuildFromArchiveV1Output.Type; + +// The operation +/** + * Create NodeJS build from archive + * + * Upload a project archive, auto-detect build settings, and immediately start a Node.js build. + * This is the recommended single-step approach for deploying a Node.js application. + * The archive is uploaded to the website's file storage, build settings are auto-detected + * from the package.json inside the archive, and the build process starts automatically. + * Optional override fields take precedence over auto-detected values. + * Maximum archive size is 50MB. + * Before archiving, exclude `node_modules/` and any build output directories + * (e.g. `dist/`, `.next/`, `build/`) — they are not needed because the build + * process runs the install step automatically, and including them unnecessarily + * increases the archive size. This also helps keep the archive well under the 50MB limit. + * Example (zip): + * ``` + * zip -r archive.zip . --exclude "node_modules/*" --exclude "dist/*" + * ``` + * The returned build `uuid` can be used to poll progress and retrieve logs via + * the `Get Node.js Build Logs` endpoint. + * + * @param domain - Domain name + */ +export const hostingCreateNodeJSBuildFromArchiveV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingCreateNodeJSBuildFromArchiveV1Input, + outputSchema: HostingCreateNodeJSBuildFromArchiveV1Output, + errors: [UnprocessableEntity] as const, + })); diff --git a/packages/hostinger/src/operations/hostingCreateWebsiteParkedDomainV1.ts b/packages/hostinger/src/operations/hostingCreateWebsiteParkedDomainV1.ts new file mode 100644 index 000000000..e36014611 --- /dev/null +++ b/packages/hostinger/src/operations/hostingCreateWebsiteParkedDomainV1.ts @@ -0,0 +1,44 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const HostingCreateWebsiteParkedDomainV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + domain: Schema.String.pipe(T.PathParam()), + parked_domain: Schema.String, + }).pipe( + T.Http({ + method: "POST", + path: "/api/hosting/v1/accounts/{username}/websites/{domain}/parked-domains", + }), + ); +export type HostingCreateWebsiteParkedDomainV1Input = + typeof HostingCreateWebsiteParkedDomainV1Input.Type; + +// Output Schema +export const HostingCreateWebsiteParkedDomainV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type HostingCreateWebsiteParkedDomainV1Output = + typeof HostingCreateWebsiteParkedDomainV1Output.Type; + +// The operation +/** + * Create website parked domain + * + * Create a parked or alias domain for the selected website. + * Provide a domain name or IP address to park on the website so it serves the same content + * as the parent domain. + * + * @param domain - Domain name + */ +export const hostingCreateWebsiteParkedDomainV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingCreateWebsiteParkedDomainV1Input, + outputSchema: HostingCreateWebsiteParkedDomainV1Output, + errors: [UnprocessableEntity] as const, + })); diff --git a/packages/hostinger/src/operations/hostingCreateWebsiteSubdomainV1.ts b/packages/hostinger/src/operations/hostingCreateWebsiteSubdomainV1.ts new file mode 100644 index 000000000..3d241bf75 --- /dev/null +++ b/packages/hostinger/src/operations/hostingCreateWebsiteSubdomainV1.ts @@ -0,0 +1,46 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const HostingCreateWebsiteSubdomainV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + domain: Schema.String.pipe(T.PathParam()), + subdomain: Schema.String, + directory: Schema.optional(Schema.NullOr(Schema.String)), + is_using_public_directory: Schema.optional(Schema.Boolean), + }).pipe( + T.Http({ + method: "POST", + path: "/api/hosting/v1/accounts/{username}/websites/{domain}/subdomains", + }), + ); +export type HostingCreateWebsiteSubdomainV1Input = + typeof HostingCreateWebsiteSubdomainV1Input.Type; + +// Output Schema +export const HostingCreateWebsiteSubdomainV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type HostingCreateWebsiteSubdomainV1Output = + typeof HostingCreateWebsiteSubdomainV1Output.Type; + +// The operation +/** + * Create website subdomain + * + * Create a new subdomain for the selected website. + * Provide a subdomain prefix and, optionally, a custom directory or the + * website public directory to use as the subdomain root. + * + * @param domain - Domain name + */ +export const hostingCreateWebsiteSubdomainV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingCreateWebsiteSubdomainV1Input, + outputSchema: HostingCreateWebsiteSubdomainV1Output, + errors: [UnprocessableEntity] as const, + })); diff --git a/packages/hostinger/src/operations/hostingCreateWebsiteV1.ts b/packages/hostinger/src/operations/hostingCreateWebsiteV1.ts new file mode 100644 index 000000000..1754cc396 --- /dev/null +++ b/packages/hostinger/src/operations/hostingCreateWebsiteV1.ts @@ -0,0 +1,43 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const HostingCreateWebsiteV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String, + order_id: Schema.Number, + datacenter_code: Schema.optional(Schema.NullOr(Schema.String)), + }).pipe(T.Http({ method: "POST", path: "/api/hosting/v1/websites" })); +export type HostingCreateWebsiteV1Input = + typeof HostingCreateWebsiteV1Input.Type; + +// Output Schema +export const HostingCreateWebsiteV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type HostingCreateWebsiteV1Output = + typeof HostingCreateWebsiteV1Output.Type; + +// The operation +/** + * Create website + * + * Create a new website for the authenticated client. + * Provide the domain name and associated order ID to create a new website. + * The datacenter_code parameter is required when creating the first website + * on a new hosting plan - this will set up and configure new hosting account + * in the selected datacenter. + * Subsequent websites will be hosted on the same datacenter automatically. + * Website creation takes up to a few minutes to complete. Check the + * websites list endpoint to see when your new website becomes available. + */ +export const hostingCreateWebsiteV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: HostingCreateWebsiteV1Input, + outputSchema: HostingCreateWebsiteV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/hostingDeleteAccountDatabaseV1.ts b/packages/hostinger/src/operations/hostingDeleteAccountDatabaseV1.ts new file mode 100644 index 000000000..76df27e8a --- /dev/null +++ b/packages/hostinger/src/operations/hostingDeleteAccountDatabaseV1.ts @@ -0,0 +1,40 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const HostingDeleteAccountDatabaseV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + name: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/hosting/v1/accounts/{username}/databases/{name}", + }), + ); +export type HostingDeleteAccountDatabaseV1Input = + typeof HostingDeleteAccountDatabaseV1Input.Type; + +// Output Schema +export const HostingDeleteAccountDatabaseV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type HostingDeleteAccountDatabaseV1Output = + typeof HostingDeleteAccountDatabaseV1Output.Type; + +// The operation +/** + * Delete account database + * + * Permanently deletes a database and its remote connections. + * The database name must be the full name returned by the list databases endpoint. + * + * @param name - Full database name as returned by the list databases endpoint. + */ +export const hostingDeleteAccountDatabaseV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingDeleteAccountDatabaseV1Input, + outputSchema: HostingDeleteAccountDatabaseV1Output, + })); diff --git a/packages/hostinger/src/operations/hostingDeleteWebsiteParkedDomainV1.ts b/packages/hostinger/src/operations/hostingDeleteWebsiteParkedDomainV1.ts new file mode 100644 index 000000000..d94831aca --- /dev/null +++ b/packages/hostinger/src/operations/hostingDeleteWebsiteParkedDomainV1.ts @@ -0,0 +1,41 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const HostingDeleteWebsiteParkedDomainV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + domain: Schema.String.pipe(T.PathParam()), + parkedDomain: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/hosting/v1/accounts/{username}/websites/{domain}/parked-domains/{parkedDomain}", + }), + ); +export type HostingDeleteWebsiteParkedDomainV1Input = + typeof HostingDeleteWebsiteParkedDomainV1Input.Type; + +// Output Schema +export const HostingDeleteWebsiteParkedDomainV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type HostingDeleteWebsiteParkedDomainV1Output = + typeof HostingDeleteWebsiteParkedDomainV1Output.Type; + +// The operation +/** + * Delete website parked domain + * + * Delete an existing parked or alias domain from the selected website. + * Use this endpoint to remove parked domains that are no longer needed. + * + * @param domain - Domain name + */ +export const hostingDeleteWebsiteParkedDomainV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingDeleteWebsiteParkedDomainV1Input, + outputSchema: HostingDeleteWebsiteParkedDomainV1Output, + })); diff --git a/packages/hostinger/src/operations/hostingDeleteWebsiteSubdomainV1.ts b/packages/hostinger/src/operations/hostingDeleteWebsiteSubdomainV1.ts new file mode 100644 index 000000000..80535c704 --- /dev/null +++ b/packages/hostinger/src/operations/hostingDeleteWebsiteSubdomainV1.ts @@ -0,0 +1,41 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const HostingDeleteWebsiteSubdomainV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + domain: Schema.String.pipe(T.PathParam()), + subdomain: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "DELETE", + path: "/api/hosting/v1/accounts/{username}/websites/{domain}/subdomains/{subdomain}", + }), + ); +export type HostingDeleteWebsiteSubdomainV1Input = + typeof HostingDeleteWebsiteSubdomainV1Input.Type; + +// Output Schema +export const HostingDeleteWebsiteSubdomainV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type HostingDeleteWebsiteSubdomainV1Output = + typeof HostingDeleteWebsiteSubdomainV1Output.Type; + +// The operation +/** + * Delete website subdomain + * + * Delete an existing subdomain from the selected website. + * Use this endpoint to remove subdomains that are no longer needed. + * + * @param domain - Domain name + */ +export const hostingDeleteWebsiteSubdomainV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingDeleteWebsiteSubdomainV1Input, + outputSchema: HostingDeleteWebsiteSubdomainV1Output, + })); diff --git a/packages/hostinger/src/operations/hostingGenerateAFreeSubdomainV1.ts b/packages/hostinger/src/operations/hostingGenerateAFreeSubdomainV1.ts new file mode 100644 index 000000000..04d3ae117 --- /dev/null +++ b/packages/hostinger/src/operations/hostingGenerateAFreeSubdomainV1.ts @@ -0,0 +1,33 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const HostingGenerateAFreeSubdomainV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe( + T.Http({ method: "POST", path: "/api/hosting/v1/domains/free-subdomains" }), + ); +export type HostingGenerateAFreeSubdomainV1Input = + typeof HostingGenerateAFreeSubdomainV1Input.Type; + +// Output Schema +export const HostingGenerateAFreeSubdomainV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.optional(Schema.String), + }); +export type HostingGenerateAFreeSubdomainV1Output = + typeof HostingGenerateAFreeSubdomainV1Output.Type; + +// The operation +/** + * Generate a free subdomain + * + * Generate a unique free subdomain that can be used for hosting services without purchasing custom domains. + * Free subdomains allow you to start using hosting services immediately + * and you can always connect a custom domain to your site later. + */ +export const hostingGenerateAFreeSubdomainV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingGenerateAFreeSubdomainV1Input, + outputSchema: HostingGenerateAFreeSubdomainV1Output, + })); diff --git a/packages/hostinger/src/operations/hostingGetNodeJSBuildLogsV1.ts b/packages/hostinger/src/operations/hostingGetNodeJSBuildLogsV1.ts new file mode 100644 index 000000000..b756d4c55 --- /dev/null +++ b/packages/hostinger/src/operations/hostingGetNodeJSBuildLogsV1.ts @@ -0,0 +1,51 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const HostingGetNodeJSBuildLogsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + domain: Schema.String.pipe(T.PathParam()), + uuid: Schema.String.pipe(T.PathParam()), + from_line: Schema.optional(Schema.Number), + }).pipe( + T.Http({ + method: "GET", + path: "/api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/builds/{uuid}/logs", + }), + ); +export type HostingGetNodeJSBuildLogsV1Input = + typeof HostingGetNodeJSBuildLogsV1Input.Type; + +// Output Schema +export const HostingGetNodeJSBuildLogsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + logs: Schema.NullOr(Schema.String), + lines: Schema.Number, + }); +export type HostingGetNodeJSBuildLogsV1Output = + typeof HostingGetNodeJSBuildLogsV1Output.Type; + +// The operation +/** + * Get NodeJS build logs + * + * Retrieve logs from a specific Node.js build process. + * To stream live output while a build is running, poll this endpoint repeatedly + * while the build state is `running`, passing the previously returned `lines` count + * as `from_line` to fetch only new output since the last call. + * Log content may contain ANSI escape sequences (color codes). + * + * @param domain - Domain name + * @param uuid - Build UUID + * @param from_line - Line from which to start retrieving logs + */ +export const hostingGetNodeJSBuildLogsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: HostingGetNodeJSBuildLogsV1Input, + outputSchema: HostingGetNodeJSBuildLogsV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/hostingGetPhpMyAdminLinkV1.ts b/packages/hostinger/src/operations/hostingGetPhpMyAdminLinkV1.ts new file mode 100644 index 000000000..03fa1b95b --- /dev/null +++ b/packages/hostinger/src/operations/hostingGetPhpMyAdminLinkV1.ts @@ -0,0 +1,42 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const HostingGetPhpMyAdminLinkV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + name: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "GET", + path: "/api/hosting/v1/accounts/{username}/databases/{name}/phpmyadmin-link", + }), + ); +export type HostingGetPhpMyAdminLinkV1Input = + typeof HostingGetPhpMyAdminLinkV1Input.Type; + +// Output Schema +export const HostingGetPhpMyAdminLinkV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + link: Schema.String, + }); +export type HostingGetPhpMyAdminLinkV1Output = + typeof HostingGetPhpMyAdminLinkV1Output.Type; + +// The operation +/** + * Get phpMyAdmin link + * + * Returns a direct sign-on link to phpMyAdmin for the specified database. + * Use this when a visual database interface is needed for SQL queries, imports, exports, or table management. + * The database name must be the full name returned by the list databases endpoint. + * + * @param name - Full database name as returned by the list databases endpoint. + */ +export const hostingGetPhpMyAdminLinkV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: HostingGetPhpMyAdminLinkV1Input, + outputSchema: HostingGetPhpMyAdminLinkV1Output, + }), +); diff --git a/packages/hostinger/src/operations/hostingInstallWordPressV1.ts b/packages/hostinger/src/operations/hostingInstallWordPressV1.ts new file mode 100644 index 000000000..dabf01052 --- /dev/null +++ b/packages/hostinger/src/operations/hostingInstallWordPressV1.ts @@ -0,0 +1,74 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; +import { SensitiveString, SensitiveNullableString } from "../sensitive.ts"; + +// Input Schema +export const HostingInstallWordPressV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + domain: Schema.String, + site_title: Schema.String, + language: Schema.optional(Schema.NullOr(Schema.String)), + directory: Schema.optional(Schema.NullOr(Schema.String)), + overwrite: Schema.optional(Schema.NullOr(Schema.Boolean)), + auto_updates: Schema.optional( + Schema.NullOr(Schema.Literals(["all", "none", "minor"])), + ), + version: Schema.optional(Schema.NullOr(Schema.String)), + credentials: Schema.Struct({ + email: Schema.String, + login: Schema.String, + password: SensitiveString, + }), + database: Schema.optional( + Schema.NullOr( + Schema.Struct({ + name: Schema.optional(Schema.String), + password: Schema.optional(SensitiveNullableString), + }), + ), + ), + }).pipe( + T.Http({ + method: "POST", + path: "/api/hosting/v1/accounts/{username}/wordpress/installations", + }), + ); +export type HostingInstallWordPressV1Input = + typeof HostingInstallWordPressV1Input.Type; + +// Output Schema +export const HostingInstallWordPressV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type HostingInstallWordPressV1Output = + typeof HostingInstallWordPressV1Output.Type; + +// The operation +/** + * Install WordPress + * + * Install WordPress on an existing website. + * The website must already exist before calling this endpoint. To create a new + * website first, use POST /api/hosting/v1/websites and poll + * GET /api/hosting/v1/websites until it appears. + * Call GET /api/hosting/v1/wordpress/installations filtered by username and + * domain before proceeding to check whether WordPress is already installed on + * the target domain/path. If WordPress already exists and `overwrite` is false + * (the default), the async job will fail. + * This operation is asynchronous: a successful response only means the install + * job has been queued, not that WordPress is ready. Installation typically + * takes 1-2 minutes. Poll GET /api/hosting/v1/wordpress/installations filtered + * by username and domain to track progress. When the installation appears in + * that list, WordPress is ready. + */ +export const hostingInstallWordPressV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: HostingInstallWordPressV1Input, + outputSchema: HostingInstallWordPressV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/hostingListAccountDatabasesV1.ts b/packages/hostinger/src/operations/hostingListAccountDatabasesV1.ts new file mode 100644 index 000000000..b08d97442 --- /dev/null +++ b/packages/hostinger/src/operations/hostingListAccountDatabasesV1.ts @@ -0,0 +1,68 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const HostingListAccountDatabasesV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + domain: Schema.optional(Schema.String), + is_assigned: Schema.optional(Schema.Boolean), + search: Schema.optional(Schema.String), + }).pipe( + T.Http({ + method: "GET", + path: "/api/hosting/v1/accounts/{username}/databases", + }), + ); +export type HostingListAccountDatabasesV1Input = + typeof HostingListAccountDatabasesV1Input.Type; + +// Output Schema +export const HostingListAccountDatabasesV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + data: Schema.optional( + Schema.Array( + Schema.Struct({ + name: Schema.optional(Schema.String), + user: Schema.optional(Schema.String), + domain: Schema.optional(Schema.NullOr(Schema.String)), + permissions: Schema.optional(Schema.Unknown), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + disk_usage_mb: Schema.optional(Schema.NullOr(Schema.Number)), + max_size_mb: Schema.optional(Schema.Number), + }), + ), + ), + meta: Schema.optional( + Schema.Struct({ + current_page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + total: Schema.optional(Schema.Number), + }), + ), + }); +export type HostingListAccountDatabasesV1Output = + typeof HostingListAccountDatabasesV1Output.Type; + +// The operation +/** + * List account databases + * + * Returns a paginated list of databases for the specified account. + * Use the domain and is_assigned filters to find databases assigned to a specific domain. + * + * @param page - Page number + * @param per_page - Number of items per page + * @param domain - Filter by domain name (exact match) + * @param is_assigned - When used with domain, return only databases assigned to that domain. + * @param search - Search databases by name, user, or creation date. + */ +export const hostingListAccountDatabasesV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingListAccountDatabasesV1Input, + outputSchema: HostingListAccountDatabasesV1Output, + })); diff --git a/packages/hostinger/src/operations/hostingListAvailableDatacentersV1.ts b/packages/hostinger/src/operations/hostingListAvailableDatacentersV1.ts new file mode 100644 index 000000000..e4b9949f4 --- /dev/null +++ b/packages/hostinger/src/operations/hostingListAvailableDatacentersV1.ts @@ -0,0 +1,45 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const HostingListAvailableDatacentersV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + order_id: Schema.Number, + }).pipe(T.Http({ method: "GET", path: "/api/hosting/v1/datacenters" })); +export type HostingListAvailableDatacentersV1Input = + typeof HostingListAvailableDatacentersV1Input.Type; + +// Output Schema +export const HostingListAvailableDatacentersV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + title: Schema.optional(Schema.String), + code: Schema.optional(Schema.String), + coordinates: Schema.optional( + Schema.Struct({ + latitude: Schema.optional(Schema.Number), + longitude: Schema.optional(Schema.Number), + }), + ), + }), + ); +export type HostingListAvailableDatacentersV1Output = + typeof HostingListAvailableDatacentersV1Output.Type; + +// The operation +/** + * List available datacenters + * + * Retrieve a list of datacenters available for setting up hosting plans + * based on available datacenter capacity and hosting plan of your order. + * The first item in the list is the best match for your specific order + * requirements. + * + * @param order_id - Order ID + */ +export const hostingListAvailableDatacentersV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingListAvailableDatacentersV1Input, + outputSchema: HostingListAvailableDatacentersV1Output, + })); diff --git a/packages/hostinger/src/operations/hostingListNodeJSBuildsV1.ts b/packages/hostinger/src/operations/hostingListNodeJSBuildsV1.ts new file mode 100644 index 000000000..1aa46d080 --- /dev/null +++ b/packages/hostinger/src/operations/hostingListNodeJSBuildsV1.ts @@ -0,0 +1,68 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const HostingListNodeJSBuildsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + domain: Schema.String.pipe(T.PathParam()), + page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + states: Schema.optional(Schema.String), + }).pipe( + T.Http({ + method: "GET", + path: "/api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/builds", + }), + ); +export type HostingListNodeJSBuildsV1Input = + typeof HostingListNodeJSBuildsV1Input.Type; + +// Output Schema +export const HostingListNodeJSBuildsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + data: Schema.optional( + Schema.Array( + Schema.Struct({ + uuid: Schema.optional(Schema.String), + state: Schema.optional( + Schema.Literals(["pending", "running", "completed", "failed"]), + ), + options: Schema.optional(Schema.Unknown), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }), + ), + ), + meta: Schema.optional( + Schema.Struct({ + current_page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + total: Schema.optional(Schema.Number), + }), + ), + }); +export type HostingListNodeJSBuildsV1Output = + typeof HostingListNodeJSBuildsV1Output.Type; + +// The operation +/** + * List NodeJS builds + * + * Retrieve a paginated list of Node.js build processes for a specific website. + * Each build represents a single run of the Node.js build pipeline. Use the `states` + * query parameter to filter results by build state (pending, running, completed, failed). + * Use the `uuid` from a build to poll its output via the `Get Node.js Build Logs` endpoint. + * + * @param domain - Domain name + * @param page - Page number + * @param per_page - Number of items per page + * @param states - Build states to filter by + */ +export const hostingListNodeJSBuildsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: HostingListNodeJSBuildsV1Input, + outputSchema: HostingListNodeJSBuildsV1Output, + }), +); diff --git a/packages/hostinger/src/operations/hostingListOrdersV1.ts b/packages/hostinger/src/operations/hostingListOrdersV1.ts new file mode 100644 index 000000000..b047976f6 --- /dev/null +++ b/packages/hostinger/src/operations/hostingListOrdersV1.ts @@ -0,0 +1,62 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const HostingListOrdersV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + statuses: Schema.optional(Schema.String), + order_ids: Schema.optional(Schema.String), + }).pipe(T.Http({ method: "GET", path: "/api/hosting/v1/orders" })); +export type HostingListOrdersV1Input = typeof HostingListOrdersV1Input.Type; + +// Output Schema +export const HostingListOrdersV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + data: Schema.optional( + Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.Number), + client_id: Schema.optional(Schema.Number), + subscription_id: Schema.optional(Schema.NullOr(Schema.String)), + created_at: Schema.optional(Schema.String), + plan: Schema.optional( + Schema.Struct({ + name: Schema.optional(Schema.String), + }), + ), + status: Schema.optional(Schema.String), + }), + ), + ), + meta: Schema.optional( + Schema.Struct({ + current_page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + total: Schema.optional(Schema.Number), + }), + ), + }); +export type HostingListOrdersV1Output = typeof HostingListOrdersV1Output.Type; + +// The operation +/** + * List orders + * + * Retrieve a paginated list of orders accessible to the authenticated client. + * This endpoint returns orders of your hosting accounts as well as orders + * of other client hosting accounts that have shared access with you. + * Use the available query parameters to filter results by order statuses + * or specific order IDs for more targeted results. + * + * @param page - Page number + * @param per_page - Number of items per page + * @param statuses - Filter by order statuses + * @param order_ids - Filter by specific order IDs + */ +export const hostingListOrdersV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingListOrdersV1Input, + outputSchema: HostingListOrdersV1Output, +})); diff --git a/packages/hostinger/src/operations/hostingListWebsiteParkedDomainsV1.ts b/packages/hostinger/src/operations/hostingListWebsiteParkedDomainsV1.ts new file mode 100644 index 000000000..b34eb8382 --- /dev/null +++ b/packages/hostinger/src/operations/hostingListWebsiteParkedDomainsV1.ts @@ -0,0 +1,47 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const HostingListWebsiteParkedDomainsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + domain: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "GET", + path: "/api/hosting/v1/accounts/{username}/websites/{domain}/parked-domains", + }), + ); +export type HostingListWebsiteParkedDomainsV1Input = + typeof HostingListWebsiteParkedDomainsV1Input.Type; + +// Output Schema +export const HostingListWebsiteParkedDomainsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + username: Schema.optional(Schema.String), + domain: Schema.optional(Schema.String), + parent_domain: Schema.optional(Schema.String), + root_directory: Schema.optional(Schema.String), + type: Schema.optional(Schema.Literals(["domain", "ip"])), + }), + ); +export type HostingListWebsiteParkedDomainsV1Output = + typeof HostingListWebsiteParkedDomainsV1Output.Type; + +// The operation +/** + * List website parked domains + * + * Retrieve all parked or alias domains created under the selected website. + * Use this endpoint to inspect parked domain configuration for a specific website, + * including the parent domain and root directory assigned to each parked domain. + * + * @param domain - Domain name + */ +export const hostingListWebsiteParkedDomainsV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingListWebsiteParkedDomainsV1Input, + outputSchema: HostingListWebsiteParkedDomainsV1Output, + })); diff --git a/packages/hostinger/src/operations/hostingListWebsiteSubdomainsV1.ts b/packages/hostinger/src/operations/hostingListWebsiteSubdomainsV1.ts new file mode 100644 index 000000000..82a1aee16 --- /dev/null +++ b/packages/hostinger/src/operations/hostingListWebsiteSubdomainsV1.ts @@ -0,0 +1,47 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const HostingListWebsiteSubdomainsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + domain: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "GET", + path: "/api/hosting/v1/accounts/{username}/websites/{domain}/subdomains", + }), + ); +export type HostingListWebsiteSubdomainsV1Input = + typeof HostingListWebsiteSubdomainsV1Input.Type; + +// Output Schema +export const HostingListWebsiteSubdomainsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + username: Schema.optional(Schema.String), + domain: Schema.optional(Schema.String), + parent_domain: Schema.optional(Schema.String), + root_directory: Schema.optional(Schema.String), + subdomain: Schema.optional(Schema.String), + }), + ); +export type HostingListWebsiteSubdomainsV1Output = + typeof HostingListWebsiteSubdomainsV1Output.Type; + +// The operation +/** + * List website subdomains + * + * Retrieve all subdomains created under the selected website. + * Use this endpoint to inspect subdomain configuration for a specific website, + * including the parent domain and root directory assigned to each subdomain. + * + * @param domain - Domain name + */ +export const hostingListWebsiteSubdomainsV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingListWebsiteSubdomainsV1Input, + outputSchema: HostingListWebsiteSubdomainsV1Output, + })); diff --git a/packages/hostinger/src/operations/hostingListWebsitesV1.ts b/packages/hostinger/src/operations/hostingListWebsitesV1.ts new file mode 100644 index 000000000..cfbd9acae --- /dev/null +++ b/packages/hostinger/src/operations/hostingListWebsitesV1.ts @@ -0,0 +1,71 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const HostingListWebsitesV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + username: Schema.optional(Schema.String), + order_id: Schema.optional(Schema.Number), + is_enabled: Schema.optional(Schema.Boolean), + domain: Schema.optional(Schema.String), + }).pipe(T.Http({ method: "GET", path: "/api/hosting/v1/websites" })); +export type HostingListWebsitesV1Input = typeof HostingListWebsitesV1Input.Type; + +// Output Schema +export const HostingListWebsitesV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + data: Schema.optional( + Schema.Array( + Schema.Struct({ + domain: Schema.optional(Schema.String), + vhost_type: Schema.optional( + Schema.Literals(["main", "addon", "parked", "subdomain"]), + ), + is_enabled: Schema.optional(Schema.Boolean), + username: Schema.optional(Schema.String), + client_id: Schema.optional(Schema.Number), + order_id: Schema.optional(Schema.Number), + created_at: Schema.optional(Schema.String), + root_directory: Schema.optional(Schema.String), + parent_domain: Schema.optional(Schema.NullOr(Schema.String)), + }), + ), + ), + meta: Schema.optional( + Schema.Struct({ + current_page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + total: Schema.optional(Schema.Number), + }), + ), + }); +export type HostingListWebsitesV1Output = + typeof HostingListWebsitesV1Output.Type; + +// The operation +/** + * List websites + * + * Retrieve a paginated list of websites (main and addon types) accessible to the authenticated client. + * This endpoint returns websites from your hosting accounts as well as + * websites from other client hosting accounts that have shared access + * with you. + * Use the available query parameters to filter results by username, + * order ID, enabled status, or domain name for more targeted results. + * + * @param page - Page number + * @param per_page - Number of items per page + * @param username - Filter by specific username + * @param order_id - Order ID + * @param is_enabled - Filter by enabled status + * @param domain - Filter by domain name (exact match) + */ +export const hostingListWebsitesV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: HostingListWebsitesV1Input, + outputSchema: HostingListWebsitesV1Output, + }), +); diff --git a/packages/hostinger/src/operations/hostingListWordPressInstallationsV1.ts b/packages/hostinger/src/operations/hostingListWordPressInstallationsV1.ts new file mode 100644 index 000000000..c47104829 --- /dev/null +++ b/packages/hostinger/src/operations/hostingListWordPressInstallationsV1.ts @@ -0,0 +1,58 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const HostingListWordPressInstallationsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.optional(Schema.String), + domain: Schema.optional(Schema.String), + ownership: Schema.optional(Schema.Literals(["owned", "managed", "all"])), + }).pipe( + T.Http({ method: "GET", path: "/api/hosting/v1/wordpress/installations" }), + ); +export type HostingListWordPressInstallationsV1Input = + typeof HostingListWordPressInstallationsV1Input.Type; + +// Output Schema +export const HostingListWordPressInstallationsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + id: Schema.optional(Schema.String), + username: Schema.optional(Schema.String), + domain: Schema.optional(Schema.String), + site_title: Schema.optional(Schema.String), + url: Schema.optional(Schema.String), + directory: Schema.optional(Schema.String), + language: Schema.optional(Schema.String), + login: Schema.optional(Schema.String), + email: Schema.optional(Schema.String), + is_valid: Schema.optional(Schema.Boolean), + validation_error: Schema.optional(Schema.NullOr(Schema.String)), + created_at: Schema.optional(Schema.String), + }), + ); +export type HostingListWordPressInstallationsV1Output = + typeof HostingListWordPressInstallationsV1Output.Type; + +// The operation +/** + * List WordPress installations + * + * List WordPress installations accessible to the authenticated client. + * Use this endpoint to discover existing WordPress installations and to poll + * for installation status after calling the install endpoint. When a newly + * requested installation appears in this list, WordPress is ready. Filter by + * username and domain to narrow results to a specific website. + * Each installation includes a `valid` flag and, when invalid, a + * `validationError` describing why. + * + * @param username - Filter by specific username + * @param domain - Filter by domain name (exact match) + * @param ownership - Filter by ownership type. Defaults to "owned". Use "all" to include both owned and managed installations. + */ +export const hostingListWordPressInstallationsV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingListWordPressInstallationsV1Input, + outputSchema: HostingListWordPressInstallationsV1Output, + })); diff --git a/packages/hostinger/src/operations/hostingRepairDatabaseV1.ts b/packages/hostinger/src/operations/hostingRepairDatabaseV1.ts new file mode 100644 index 000000000..81407edfe --- /dev/null +++ b/packages/hostinger/src/operations/hostingRepairDatabaseV1.ts @@ -0,0 +1,42 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const HostingRepairDatabaseV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + username: Schema.String.pipe(T.PathParam()), + name: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "PATCH", + path: "/api/hosting/v1/accounts/{username}/databases/{name}/repair", + }), + ); +export type HostingRepairDatabaseV1Input = + typeof HostingRepairDatabaseV1Input.Type; + +// Output Schema +export const HostingRepairDatabaseV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type HostingRepairDatabaseV1Output = + typeof HostingRepairDatabaseV1Output.Type; + +// The operation +/** + * Repair database + * + * Repairs corrupted database tables asynchronously. + * Use when database errors, crashes, or corruption are reported. + * The database name must be the full name returned by the list databases endpoint. + * + * @param name - Full database name as returned by the list databases endpoint. + */ +export const hostingRepairDatabaseV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: HostingRepairDatabaseV1Input, + outputSchema: HostingRepairDatabaseV1Output, + }), +); diff --git a/packages/hostinger/src/operations/hostingVerifyDomainOwnershipV1.ts b/packages/hostinger/src/operations/hostingVerifyDomainOwnershipV1.ts new file mode 100644 index 000000000..47658eb21 --- /dev/null +++ b/packages/hostinger/src/operations/hostingVerifyDomainOwnershipV1.ts @@ -0,0 +1,45 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const HostingVerifyDomainOwnershipV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.String, + }).pipe( + T.Http({ + method: "POST", + path: "/api/hosting/v1/domains/verify-ownership", + }), + ); +export type HostingVerifyDomainOwnershipV1Input = + typeof HostingVerifyDomainOwnershipV1Input.Type; + +// Output Schema +export const HostingVerifyDomainOwnershipV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domain: Schema.optional(Schema.String), + is_accessible: Schema.optional(Schema.Boolean), + txt_to_verify: Schema.optional(Schema.String), + }); +export type HostingVerifyDomainOwnershipV1Output = + typeof HostingVerifyDomainOwnershipV1Output.Type; + +// The operation +/** + * Verify domain ownership + * + * Verify ownership of a single domain and return the verification status. + * Use this endpoint to check if a domain is accessible for you before using it for new websites. + * If the domain is accessible, the response will have `is_accessible: true`. + * If not, add the given TXT record to your domain's DNS records and try verifying again. + * Keep in mind that it may take up to 10 minutes for new TXT DNS records to propagate. + * Skip this verification when using Hostinger's free subdomains (*.hostingersite.com). + */ +export const hostingVerifyDomainOwnershipV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: HostingVerifyDomainOwnershipV1Input, + outputSchema: HostingVerifyDomainOwnershipV1Output, + errors: [UnprocessableEntity] as const, + })); diff --git a/packages/hostinger/src/operations/index.ts b/packages/hostinger/src/operations/index.ts new file mode 100644 index 000000000..51cacdb22 --- /dev/null +++ b/packages/hostinger/src/operations/index.ts @@ -0,0 +1,129 @@ +export * from "./billingGetCatalogItemListV1.ts"; +export * from "./billingSetDefaultPaymentMethodV1.ts"; +export * from "./billingDeletePaymentMethodV1.ts"; +export * from "./billingGetPaymentMethodListV1.ts"; +export * from "./billingGetSubscriptionListV1.ts"; +export * from "./billingDisableAutoRenewalV1.ts"; +export * from "./billingEnableAutoRenewalV1.ts"; +export * from "./DNSGetDNSSnapshotV1.ts"; +export * from "./DNSGetDNSSnapshotListV1.ts"; +export * from "./DNSRestoreDNSSnapshotV1.ts"; +export * from "./DNSGetDNSRecordsV1.ts"; +export * from "./DNSUpdateDNSRecordsV1.ts"; +export * from "./DNSDeleteDNSRecordsV1.ts"; +export * from "./DNSResetDNSRecordsV1.ts"; +export * from "./DNSValidateDNSRecordsV1.ts"; +export * from "./v2GetDomainVerificationsDIRECT.ts"; +export * from "./domainsCheckDomainAvailabilityV1.ts"; +export * from "./domainsGetDomainForwardingV1.ts"; +export * from "./domainsDeleteDomainForwardingV1.ts"; +export * from "./domainsCreateDomainForwardingV1.ts"; +export * from "./domainsEnableDomainLockV1.ts"; +export * from "./domainsDisableDomainLockV1.ts"; +export * from "./domainsGetDomainDetailsV1.ts"; +export * from "./domainsGetDomainListV1.ts"; +export * from "./domainsPurchaseNewDomainV1.ts"; +export * from "./domainsEnablePrivacyProtectionV1.ts"; +export * from "./domainsDisablePrivacyProtectionV1.ts"; +export * from "./domainsUpdateDomainNameserversV1.ts"; +export * from "./domainsGetWHOISProfileV1.ts"; +export * from "./domainsDeleteWHOISProfileV1.ts"; +export * from "./domainsGetWHOISProfileListV1.ts"; +export * from "./domainsCreateWHOISProfileV1.ts"; +export * from "./domainsGetWHOISProfileUsageV1.ts"; +export * from "./ecommerceGetStoresV1.ts"; +export * from "./ecommerceCreateStoreV1.ts"; +export * from "./hostingChangeDatabasePasswordV1.ts"; +export * from "./hostingListAccountDatabasesV1.ts"; +export * from "./hostingCreateAccountDatabaseV1.ts"; +export * from "./hostingDeleteAccountDatabaseV1.ts"; +export * from "./hostingRepairDatabaseV1.ts"; +export * from "./hostingGetPhpMyAdminLinkV1.ts"; +export * from "./hostingListAvailableDatacentersV1.ts"; +export * from "./hostingGenerateAFreeSubdomainV1.ts"; +export * from "./hostingListWebsiteParkedDomainsV1.ts"; +export * from "./hostingCreateWebsiteParkedDomainV1.ts"; +export * from "./hostingDeleteWebsiteParkedDomainV1.ts"; +export * from "./hostingListWebsiteSubdomainsV1.ts"; +export * from "./hostingCreateWebsiteSubdomainV1.ts"; +export * from "./hostingDeleteWebsiteSubdomainV1.ts"; +export * from "./hostingVerifyDomainOwnershipV1.ts"; +export * from "./hostingListNodeJSBuildsV1.ts"; +export * from "./hostingCreateNodeJSBuildFromArchiveV1.ts"; +export * from "./hostingGetNodeJSBuildLogsV1.ts"; +export * from "./hostingListOrdersV1.ts"; +export * from "./hostingListWebsitesV1.ts"; +export * from "./hostingCreateWebsiteV1.ts"; +export * from "./hostingInstallWordPressV1.ts"; +export * from "./hostingListWordPressInstallationsV1.ts"; +export * from "./reachDeleteAContactV1.ts"; +export * from "./reachListContactsV1.ts"; +export * from "./reachListSegmentsV1.ts"; +export * from "./reachCreateANewContactSegmentV1.ts"; +export * from "./reachListSegmentContactsV1.ts"; +export * from "./reachGetSegmentDetailsV1.ts"; +export * from "./reachCreateNewContactsV1.ts"; +export * from "./reachListProfilesV1.ts"; +export * from "./VPSGetDataCenterListV1.ts"; +export * from "./VPSGetProjectContainersV1.ts"; +export * from "./VPSGetProjectContentsV1.ts"; +export * from "./VPSDeleteProjectV1.ts"; +export * from "./VPSGetProjectListV1.ts"; +export * from "./VPSCreateNewProjectV1.ts"; +export * from "./VPSGetProjectLogsV1.ts"; +export * from "./VPSRestartProjectV1.ts"; +export * from "./VPSStartProjectV1.ts"; +export * from "./VPSStopProjectV1.ts"; +export * from "./VPSUpdateProjectV1.ts"; +export * from "./VPSActivateFirewallV1.ts"; +export * from "./VPSDeactivateFirewallV1.ts"; +export * from "./VPSGetFirewallDetailsV1.ts"; +export * from "./VPSDeleteFirewallV1.ts"; +export * from "./VPSGetFirewallListV1.ts"; +export * from "./VPSCreateNewFirewallV1.ts"; +export * from "./VPSUpdateFirewallRuleV1.ts"; +export * from "./VPSDeleteFirewallRuleV1.ts"; +export * from "./VPSCreateFirewallRuleV1.ts"; +export * from "./VPSSyncFirewallV1.ts"; +export * from "./VPSGetPostInstallScriptV1.ts"; +export * from "./VPSUpdatePostInstallScriptV1.ts"; +export * from "./VPSDeletePostInstallScriptV1.ts"; +export * from "./VPSGetPostInstallScriptsV1.ts"; +export * from "./VPSCreatePostInstallScriptV1.ts"; +export * from "./VPSAttachPublicKeyV1.ts"; +export * from "./VPSDeletePublicKeyV1.ts"; +export * from "./VPSGetPublicKeysV1.ts"; +export * from "./VPSCreatePublicKeyV1.ts"; +export * from "./VPSGetTemplateDetailsV1.ts"; +export * from "./VPSGetTemplatesV1.ts"; +export * from "./VPSGetActionDetailsV1.ts"; +export * from "./VPSGetActionsV1.ts"; +export * from "./VPSGetAttachedPublicKeysV1.ts"; +export * from "./VPSGetBackupsV1.ts"; +export * from "./VPSRestoreBackupV1.ts"; +export * from "./VPSSetHostnameV1.ts"; +export * from "./VPSResetHostnameV1.ts"; +export * from "./VPSGetVirtualMachineDetailsV1.ts"; +export * from "./VPSGetVirtualMachinesV1.ts"; +export * from "./VPSPurchaseNewVirtualMachineV1.ts"; +export * from "./VPSGetScanMetricsV1.ts"; +export * from "./VPSInstallMonarxV1.ts"; +export * from "./VPSUninstallMonarxV1.ts"; +export * from "./VPSGetMetricsV1.ts"; +export * from "./VPSSetNameserversV1.ts"; +export * from "./VPSCreatePTRRecordV1.ts"; +export * from "./VPSDeletePTRRecordV1.ts"; +export * from "./VPSSetPanelPasswordV1.ts"; +export * from "./VPSStartRecoveryModeV1.ts"; +export * from "./VPSStopRecoveryModeV1.ts"; +export * from "./VPSRecreateVirtualMachineV1.ts"; +export * from "./VPSRestartVirtualMachineV1.ts"; +export * from "./VPSSetRootPasswordV1.ts"; +export * from "./VPSSetupPurchasedVirtualMachineV1.ts"; +export * from "./VPSGetSnapshotV1.ts"; +export * from "./VPSCreateSnapshotV1.ts"; +export * from "./VPSDeleteSnapshotV1.ts"; +export * from "./VPSRestoreSnapshotV1.ts"; +export * from "./VPSStartVirtualMachineV1.ts"; +export * from "./VPSStopVirtualMachineV1.ts"; +export * from "./billingCancelSubscriptionV1.ts"; diff --git a/packages/hostinger/src/operations/reachCreateANewContactSegmentV1.ts b/packages/hostinger/src/operations/reachCreateANewContactSegmentV1.ts new file mode 100644 index 000000000..a273fe2da --- /dev/null +++ b/packages/hostinger/src/operations/reachCreateANewContactSegmentV1.ts @@ -0,0 +1,99 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const ReachCreateANewContactSegmentV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + name: Schema.String, + conditions: Schema.Array( + Schema.Struct({ + operator: Schema.optional( + Schema.Literals([ + "equals", + "not_equals", + "contains", + "not_contains", + "gte", + "lte", + "exists", + "within_last_days", + "not_within_last_days", + "older_than_days", + "processed", + "not_processed", + "delivered", + "not_delivered", + "dropped", + "not_dropped", + "bounced", + "not_bounced", + "opened", + "not_opened", + "clicked", + "not_clicked", + "unsubscribed", + "not_unsubscribed", + ]), + ), + value: Schema.optional(Schema.Unknown), + attribute: Schema.optional( + Schema.Literals([ + "note", + "comment", + "domain", + "integration", + "source", + "name", + "surname", + "email", + "subscribed_at", + "unsubscribed_at", + "subscription_status", + "processed", + "opened", + "clicked", + "delivered", + "bounced", + "unsubscribed", + "dropped", + "tag", + "campaigns", + ]), + ), + }), + ), + logic: Schema.Literals(["AND", "OR"]), + }).pipe( + T.Http({ method: "POST", path: "/api/reach/v1/segmentation/segments" }), + ); +export type ReachCreateANewContactSegmentV1Input = + typeof ReachCreateANewContactSegmentV1Input.Type; + +// Output Schema +export const ReachCreateANewContactSegmentV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + uuid: Schema.optional(Schema.String), + name: Schema.optional(Schema.String), + query: Schema.optional(Schema.Array(Schema.Unknown)), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type ReachCreateANewContactSegmentV1Output = + typeof ReachCreateANewContactSegmentV1Output.Type; + +// The operation +/** + * Create a new contact segment + * + * Create a new contact segment. + * This endpoint allows creating a new contact segment that can be used to organize contacts. + * The segment can be configured with specific criteria like email, name, subscription status, etc. + */ +export const reachCreateANewContactSegmentV1 = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: ReachCreateANewContactSegmentV1Input, + outputSchema: ReachCreateANewContactSegmentV1Output, + errors: [UnprocessableEntity] as const, + })); diff --git a/packages/hostinger/src/operations/reachCreateNewContactsV1.ts b/packages/hostinger/src/operations/reachCreateNewContactsV1.ts new file mode 100644 index 000000000..f54587bc6 --- /dev/null +++ b/packages/hostinger/src/operations/reachCreateNewContactsV1.ts @@ -0,0 +1,49 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const ReachCreateNewContactsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + profileUuid: Schema.String.pipe(T.PathParam()), + email: Schema.String, + name: Schema.optional(Schema.NullOr(Schema.String)), + surname: Schema.optional(Schema.NullOr(Schema.String)), + phone: Schema.optional(Schema.NullOr(Schema.String)), + note: Schema.optional(Schema.NullOr(Schema.String)), + }).pipe( + T.Http({ + method: "POST", + path: "/api/reach/v1/profiles/{profileUuid}/contacts", + }), + ); +export type ReachCreateNewContactsV1Input = + typeof ReachCreateNewContactsV1Input.Type; + +// Output Schema +export const ReachCreateNewContactsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type ReachCreateNewContactsV1Output = + typeof ReachCreateNewContactsV1Output.Type; + +// The operation +/** + * Create new contacts + * + * Create a new contact in the email marketing system. + * This endpoint allows you to create a new contact with basic information like name, email, and surname. + * If double opt-in is enabled, the contact will be created with a pending status + * and a confirmation email will be sent. + * + * @param profileUuid - Profile uuid parameter + */ +export const reachCreateNewContactsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: ReachCreateNewContactsV1Input, + outputSchema: ReachCreateNewContactsV1Output, + errors: [UnprocessableEntity] as const, + }), +); diff --git a/packages/hostinger/src/operations/reachDeleteAContactV1.ts b/packages/hostinger/src/operations/reachDeleteAContactV1.ts new file mode 100644 index 000000000..fe91dfaea --- /dev/null +++ b/packages/hostinger/src/operations/reachDeleteAContactV1.ts @@ -0,0 +1,34 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const ReachDeleteAContactV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + uuid: Schema.String.pipe(T.PathParam()), + }).pipe(T.Http({ method: "DELETE", path: "/api/reach/v1/contacts/{uuid}" })); +export type ReachDeleteAContactV1Input = typeof ReachDeleteAContactV1Input.Type; + +// Output Schema +export const ReachDeleteAContactV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + message: Schema.optional(Schema.String), + }); +export type ReachDeleteAContactV1Output = + typeof ReachDeleteAContactV1Output.Type; + +// The operation +/** + * Delete a contact + * + * Delete a contact with the specified UUID. + * This endpoint permanently removes a contact from the email marketing system. + * + * @param uuid - UUID of the contact to delete + */ +export const reachDeleteAContactV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: ReachDeleteAContactV1Input, + outputSchema: ReachDeleteAContactV1Output, + }), +); diff --git a/packages/hostinger/src/operations/reachGetSegmentDetailsV1.ts b/packages/hostinger/src/operations/reachGetSegmentDetailsV1.ts new file mode 100644 index 000000000..9f1213eac --- /dev/null +++ b/packages/hostinger/src/operations/reachGetSegmentDetailsV1.ts @@ -0,0 +1,45 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const ReachGetSegmentDetailsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + segmentUuid: Schema.String.pipe(T.PathParam()), + }).pipe( + T.Http({ + method: "GET", + path: "/api/reach/v1/segmentation/segments/{segmentUuid}", + }), + ); +export type ReachGetSegmentDetailsV1Input = + typeof ReachGetSegmentDetailsV1Input.Type; + +// Output Schema +export const ReachGetSegmentDetailsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + uuid: Schema.optional(Schema.String), + name: Schema.optional(Schema.String), + query: Schema.optional(Schema.Array(Schema.Unknown)), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }); +export type ReachGetSegmentDetailsV1Output = + typeof ReachGetSegmentDetailsV1Output.Type; + +// The operation +/** + * Get segment details + * + * Get details of a specific segment. + * This endpoint retrieves information about a single segment identified by UUID. + * Segments are used to organize and group contacts based on specific criteria. + * + * @param segmentUuid - Segment uuid parameter + */ +export const reachGetSegmentDetailsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: ReachGetSegmentDetailsV1Input, + outputSchema: ReachGetSegmentDetailsV1Output, + }), +); diff --git a/packages/hostinger/src/operations/reachListContactsV1.ts b/packages/hostinger/src/operations/reachListContactsV1.ts new file mode 100644 index 000000000..99e361a07 --- /dev/null +++ b/packages/hostinger/src/operations/reachListContactsV1.ts @@ -0,0 +1,62 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const ReachListContactsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + group_uuid: Schema.optional(Schema.String), + subscription_status: Schema.optional( + Schema.Literals(["subscribed", "unsubscribed"]), + ), + page: Schema.optional(Schema.Number), + }).pipe(T.Http({ method: "GET", path: "/api/reach/v1/contacts" })); +export type ReachListContactsV1Input = typeof ReachListContactsV1Input.Type; + +// Output Schema +export const ReachListContactsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + data: Schema.optional( + Schema.Array( + Schema.Struct({ + uuid: Schema.optional(Schema.String), + name: Schema.optional(Schema.NullOr(Schema.String)), + surname: Schema.optional(Schema.NullOr(Schema.String)), + email: Schema.optional(Schema.String), + subscription_status: Schema.optional( + Schema.Literals(["subscribed", "unsubscribed"]), + ), + subscribed_at: Schema.optional(Schema.String), + source: Schema.optional( + Schema.NullOr(Schema.Literals(["sync", "import", "manual"])), + ), + note: Schema.optional(Schema.NullOr(Schema.String)), + }), + ), + ), + meta: Schema.optional( + Schema.Struct({ + current_page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + total: Schema.optional(Schema.Number), + }), + ), + }); +export type ReachListContactsV1Output = typeof ReachListContactsV1Output.Type; + +// The operation +/** + * List contacts + * + * Get a list of contacts, optionally filtered by group and subscription status. + * This endpoint returns a paginated list of contacts with their basic information. + * You can filter contacts by group UUID and subscription status. + * + * @param group_uuid - Filter contacts by group UUID + * @param subscription_status - Filter contacts by subscription status + * @param page - Page number + */ +export const reachListContactsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: ReachListContactsV1Input, + outputSchema: ReachListContactsV1Output, +})); diff --git a/packages/hostinger/src/operations/reachListProfilesV1.ts b/packages/hostinger/src/operations/reachListProfilesV1.ts new file mode 100644 index 000000000..13cf9f57e --- /dev/null +++ b/packages/hostinger/src/operations/reachListProfilesV1.ts @@ -0,0 +1,51 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const ReachListProfilesV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe( + T.Http({ method: "GET", path: "/api/reach/v1/profiles" }), + ); +export type ReachListProfilesV1Input = typeof ReachListProfilesV1Input.Type; + +// Output Schema +export const ReachListProfilesV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + limits: Schema.optional( + Schema.Struct({ + ai_messages_limit: Schema.optional(Schema.Number), + subscribers_limit: Schema.optional(Schema.Number), + emails_monthly_limit: Schema.optional(Schema.Number), + ai_messages_additional: Schema.optional(Schema.Number), + }), + ), + is_trial: Schema.optional(Schema.Boolean), + expires_at: Schema.optional(Schema.String), + resource_id: Schema.optional(Schema.Number), + status: Schema.optional(Schema.String), + profiles: Schema.optional( + Schema.Array( + Schema.Struct({ + uuid: Schema.optional(Schema.String), + domain: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }), + ), + ), + }), + ); +export type ReachListProfilesV1Output = typeof ReachListProfilesV1Output.Type; + +// The operation +/** + * List Profiles + * + * This endpoint returns all profiles available to the client, including their basic information. + */ +export const reachListProfilesV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: ReachListProfilesV1Input, + outputSchema: ReachListProfilesV1Output, +})); diff --git a/packages/hostinger/src/operations/reachListSegmentContactsV1.ts b/packages/hostinger/src/operations/reachListSegmentContactsV1.ts new file mode 100644 index 000000000..9b1732a5a --- /dev/null +++ b/packages/hostinger/src/operations/reachListSegmentContactsV1.ts @@ -0,0 +1,69 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const ReachListSegmentContactsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + segmentUuid: Schema.String.pipe(T.PathParam()), + page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + }).pipe( + T.Http({ + method: "GET", + path: "/api/reach/v1/segmentation/segments/{segmentUuid}/contacts", + }), + ); +export type ReachListSegmentContactsV1Input = + typeof ReachListSegmentContactsV1Input.Type; + +// Output Schema +export const ReachListSegmentContactsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + data: Schema.optional( + Schema.Array( + Schema.Struct({ + uuid: Schema.optional(Schema.String), + name: Schema.optional(Schema.NullOr(Schema.String)), + surname: Schema.optional(Schema.NullOr(Schema.String)), + email: Schema.optional(Schema.String), + subscription_status: Schema.optional( + Schema.Literals(["subscribed", "unsubscribed"]), + ), + subscribed_at: Schema.optional(Schema.String), + source: Schema.optional( + Schema.NullOr(Schema.Literals(["sync", "import", "manual"])), + ), + note: Schema.optional(Schema.NullOr(Schema.String)), + }), + ), + ), + meta: Schema.optional( + Schema.Struct({ + current_page: Schema.optional(Schema.Number), + per_page: Schema.optional(Schema.Number), + total: Schema.optional(Schema.Number), + }), + ), + }); +export type ReachListSegmentContactsV1Output = + typeof ReachListSegmentContactsV1Output.Type; + +// The operation +/** + * List segment contacts + * + * Retrieve contacts associated with a specific segment. + * This endpoint allows you to fetch and filter contacts that belong to a particular segment, + * identified by its UUID. + * + * @param segmentUuid - Segment uuid parameter + * @param page - Page number + * @param per_page - Number of items per page + */ +export const reachListSegmentContactsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make( + () => ({ + inputSchema: ReachListSegmentContactsV1Input, + outputSchema: ReachListSegmentContactsV1Output, + }), +); diff --git a/packages/hostinger/src/operations/reachListSegmentsV1.ts b/packages/hostinger/src/operations/reachListSegmentsV1.ts new file mode 100644 index 000000000..2fe6c567b --- /dev/null +++ b/packages/hostinger/src/operations/reachListSegmentsV1.ts @@ -0,0 +1,34 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; + +// Input Schema +export const ReachListSegmentsV1Input = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe( + T.Http({ method: "GET", path: "/api/reach/v1/segmentation/segments" }), + ); +export type ReachListSegmentsV1Input = typeof ReachListSegmentsV1Input.Type; + +// Output Schema +export const ReachListSegmentsV1Output = + /*@__PURE__*/ /*#__PURE__*/ Schema.Array( + Schema.Struct({ + uuid: Schema.optional(Schema.String), + name: Schema.optional(Schema.String), + created_at: Schema.optional(Schema.String), + updated_at: Schema.optional(Schema.String), + }), + ); +export type ReachListSegmentsV1Output = typeof ReachListSegmentsV1Output.Type; + +// The operation +/** + * List segments + * + * Get a list of all contact segments. + * This endpoint returns a list of contact segments that can be used to organize contacts. + */ +export const reachListSegmentsV1 = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: ReachListSegmentsV1Input, + outputSchema: ReachListSegmentsV1Output, +})); diff --git a/packages/hostinger/src/operations/v2GetDomainVerificationsDIRECT.ts b/packages/hostinger/src/operations/v2GetDomainVerificationsDIRECT.ts new file mode 100644 index 000000000..e5f09014f --- /dev/null +++ b/packages/hostinger/src/operations/v2GetDomainVerificationsDIRECT.ts @@ -0,0 +1,67 @@ +import * as Schema from "effect/Schema"; +import { API } from "../client.ts"; +import * as T from "../traits.ts"; +import { UnprocessableEntity } from "../errors.ts"; + +// Input Schema +export const V2GetDomainVerificationsDIRECTInput = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + domains: Schema.Array(Schema.String), + }).pipe( + T.Http({ method: "GET", path: "/api/v2/direct/verifications/active" }), + ); +export type V2GetDomainVerificationsDIRECTInput = + typeof V2GetDomainVerificationsDIRECTInput.Type; + +// Output Schema +export const V2GetDomainVerificationsDIRECTOutput = + /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({ + data: Schema.optional( + Schema.Struct({ + PENDING: Schema.optional( + Schema.Struct({ + "DOMAIN.TLD": Schema.optional( + Schema.Struct({ + VERIFICATION_TYPE: Schema.optional( + Schema.Struct({ + records: Schema.optional(Schema.Array(Schema.String)), + last_verification_attempt: Schema.optional(Schema.String), + next_verification_attempt: Schema.optional(Schema.String), + verification_expiration: Schema.optional(Schema.String), + }), + ), + }), + ), + }), + ), + VERIFIED: Schema.optional( + Schema.Struct({ + "DOMAIN.TLD": Schema.optional( + Schema.Struct({ + VERIFICATION_TYPE: Schema.optional( + Schema.Struct({ + records: Schema.optional(Schema.Array(Schema.String)), + }), + ), + }), + ), + }), + ), + }), + ), + }); +export type V2GetDomainVerificationsDIRECTOutput = + typeof V2GetDomainVerificationsDIRECTOutput.Type; + +// The operation +/** + * Get domain verifications + * + * Retrieve a list of pending and completed domain verifications. + */ +export const v2GetDomainVerificationsDIRECT = + /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({ + inputSchema: V2GetDomainVerificationsDIRECTInput, + outputSchema: V2GetDomainVerificationsDIRECTOutput, + errors: [UnprocessableEntity] as const, + })); diff --git a/packages/hostinger/src/retry.ts b/packages/hostinger/src/retry.ts new file mode 100644 index 000000000..7507e601b --- /dev/null +++ b/packages/hostinger/src/retry.ts @@ -0,0 +1,55 @@ +/** + * Hostinger retry configuration. + * + * Defines the per-SDK `Retry` Context.Service tag that + * `packages/hostinger/src/client.ts` wires into `makeAPI`. Callers can + * install a blanket retry policy at the layer level and have every + * Hostinger API call below it pick it up: + * + * @example + * ```ts + * import * as Hostinger from "@distilled.cloud/hostinger"; + * + * myEffect.pipe(Hostinger.Retry.transient); + * Effect.provide(myEffect, Layer.succeed(Hostinger.Retry.Retry, customPolicy)); + * ``` + */ +import * as Context from "effect/Context"; +import * as Effect from "effect/Effect"; +import * as Layer from "effect/Layer"; +import { + type Policy, + throttlingFactory, + transientFactory, +} from "@distilled.cloud/core/retry"; + +export { + type Options, + type Factory, + type Policy, + makeDefault, + jittered, + capped, + throttlingOptions, + transientOptions, + throttlingFactory, + transientFactory, +} from "@distilled.cloud/core/retry"; + +/** Context tag for configuring retry behavior of Hostinger API calls. */ +export class Retry extends Context.Service()("HostingerRetry") {} + +/** Provides a custom retry policy to every Hostinger API call below it. */ +export const policy = (optionsOrFactory: Policy) => + Effect.provide(Layer.succeed(Retry, optionsOrFactory)); + +/** Disables all automatic retries. */ +export const none = Effect.provide( + Layer.succeed(Retry, { while: () => false }), +); + +/** Apply the throttling retry policy (retries throttling errors indefinitely). */ +export const throttling = policy(throttlingFactory); + +/** Apply the transient retry policy (retries all transient errors indefinitely). */ +export const transient = policy(transientFactory); diff --git a/packages/hostinger/src/sensitive.ts b/packages/hostinger/src/sensitive.ts new file mode 100644 index 000000000..2167a39b2 --- /dev/null +++ b/packages/hostinger/src/sensitive.ts @@ -0,0 +1,4 @@ +/** + * Re-export sensitive data schemas from sdk-core. + */ +export * from "@distilled.cloud/core/sensitive"; diff --git a/packages/hostinger/src/traits.ts b/packages/hostinger/src/traits.ts new file mode 100644 index 000000000..cf13e396a --- /dev/null +++ b/packages/hostinger/src/traits.ts @@ -0,0 +1,4 @@ +/** + * Re-export the shared traits system from sdk-core. + */ +export * from "@distilled.cloud/core/traits"; diff --git a/packages/hostinger/tsconfig.json b/packages/hostinger/tsconfig.json new file mode 100644 index 000000000..3760701b6 --- /dev/null +++ b/packages/hostinger/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.base.json", + "include": [ + "src/**/*.ts" + ], + "compilerOptions": { + "outDir": "./lib", + "rootDir": "./src", + "paths": { + "~/*": [ + "./src/*" + ] + } + }, + "references": [ + { + "path": "../core" + } + ] +} \ No newline at end of file diff --git a/packages/hostinger/tsconfig.test.json b/packages/hostinger/tsconfig.test.json new file mode 100644 index 000000000..b2af39b25 --- /dev/null +++ b/packages/hostinger/tsconfig.test.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.base.json", + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ], + "compilerOptions": { + "rootDir": ".", + "noEmit": true, + "paths": { + "~/*": [ + "./src/*" + ] + } + } +} \ No newline at end of file diff --git a/packages/hostinger/vitest.config.ts b/packages/hostinger/vitest.config.ts new file mode 100644 index 000000000..fdad53402 --- /dev/null +++ b/packages/hostinger/vitest.config.ts @@ -0,0 +1,17 @@ +import { config } from "dotenv"; +import { resolve } from "path"; + +config({ path: resolve(__dirname, "../../.env") }); +config({ path: resolve(__dirname, ".env") }); + +export default { + test: { + include: ["test/**/*.test.ts"], + testTimeout: 120000, + }, + resolve: { + alias: { + "~": new URL("./src", import.meta.url).pathname, + }, + }, +};