hostinger-api-sdk 2.13.1 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/.github/workflows/build-release.yaml +58 -35
  2. package/README.md +2 -2
  3. package/api.ts +716 -11
  4. package/base.ts +1 -1
  5. package/common.ts +1 -1
  6. package/configuration.ts +2 -2
  7. package/dist/api.d.ts +481 -11
  8. package/dist/api.js +469 -21
  9. package/dist/base.d.ts +1 -1
  10. package/dist/base.js +1 -1
  11. package/dist/common.d.ts +1 -1
  12. package/dist/common.js +1 -1
  13. package/dist/configuration.d.ts +1 -1
  14. package/dist/configuration.js +2 -2
  15. package/dist/esm/api.d.ts +481 -11
  16. package/dist/esm/api.js +453 -9
  17. package/dist/esm/base.d.ts +1 -1
  18. package/dist/esm/base.js +1 -1
  19. package/dist/esm/common.d.ts +1 -1
  20. package/dist/esm/common.js +1 -1
  21. package/dist/esm/configuration.d.ts +1 -1
  22. package/dist/esm/configuration.js +2 -2
  23. package/dist/esm/index.d.ts +1 -1
  24. package/dist/esm/index.js +1 -1
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.js +1 -1
  27. package/docs/HostingPocketBaseApi.md +311 -0
  28. package/docs/HostingV1OnboardingsStartOnboardingRequest.md +1 -1
  29. package/docs/HostingV1PocketBaseBackendCreatedResource.md +36 -0
  30. package/docs/HostingV1PocketBaseBackendResource.md +32 -0
  31. package/docs/HostingV1PocketBaseCreateBackendRequest.md +22 -0
  32. package/docs/HostingV1PocketBaseInstanceResource.md +32 -0
  33. package/docs/HostingV1PocketBaseSuperuserResource.md +24 -0
  34. package/docs/HostingV1PocketBaseUpdateSuperuserRequest.md +22 -0
  35. package/docs/HostingWebsitesApi.md +1 -1
  36. package/docs/WordPressInstallationsApi.md +1 -1
  37. package/docs/WordPressV1InstallationsInstallWordPressRequest.md +1 -1
  38. package/index.ts +1 -1
  39. package/package.json +1 -1
@@ -5,11 +5,12 @@ on:
5
5
  branches:
6
6
  - main
7
7
 
8
+ # npm trusted publishing trusts this whole workflow file, so only the publish jobs hold id-token: write, and
9
+ # they install and run nothing: they publish the tarballs the read-only pack job built.
8
10
  jobs:
9
11
  release:
10
12
  runs-on: ubuntu-latest
11
13
  permissions:
12
- id-token: write
13
14
  contents: write
14
15
  outputs:
15
16
  new_version: ${{ steps.version.outputs.version }}
@@ -34,61 +35,88 @@ jobs:
34
35
 
35
36
  - name: Create release
36
37
  if: steps.version.outputs.released == 'true'
37
- uses: ncipollo/release-action@v1
38
- with:
39
- tag: v${{ steps.version.outputs.version }}
40
- generateReleaseNotes: true
38
+ env:
39
+ GH_TOKEN: ${{ github.token }}
40
+ VERSION: ${{ steps.version.outputs.version }}
41
+ run: gh release create "v$VERSION" --target "$GITHUB_SHA" --generate-notes
41
42
 
42
- publish-npmjs:
43
+ pack:
43
44
  runs-on: ubuntu-latest
44
45
  needs: [release]
45
46
  if: needs.release.outputs.released == 'true'
46
47
  permissions:
47
48
  contents: read
48
- id-token: write
49
49
  steps:
50
50
  - uses: actions/checkout@v4
51
51
 
52
52
  - uses: actions/setup-node@v4
53
53
  with:
54
54
  node-version: '26.x'
55
- registry-url: 'https://registry.npmjs.org'
56
-
57
- - name: Update NPM
58
- run: npm install -g npm@latest
59
55
 
60
56
  - name: Install dependencies
61
57
  run: npm install
62
58
 
59
+ # The package was published unscoped before moving to @hostinger. Each release is republished under
60
+ # the old name so existing installs keep updating. Both names point their npm trusted publisher at this
61
+ # workflow file, which is what the config keys on — the job/step it runs in is not part of it.
62
+ # hostinger-api-sdk is substituted by scripts/post-typescript-axios.sh and is empty for an API that
63
+ # never had an unscoped package. GitHub Packages gets its own copy named after the repository.
64
+ - name: Pack
65
+ env:
66
+ LEGACY: 'hostinger-api-sdk'
67
+ run: |
68
+ mkdir -p "$RUNNER_TEMP/pkg/npmjs" "$RUNNER_TEMP/pkg/legacy" "$RUNNER_TEMP/pkg/github"
69
+ npm pack --pack-destination "$RUNNER_TEMP/pkg/npmjs"
70
+ if [ -n "$LEGACY" ]; then
71
+ jq --arg n "$LEGACY" '.name = $n' package.json > pkg.tmp && mv pkg.tmp package.json
72
+ npm pack --ignore-scripts --pack-destination "$RUNNER_TEMP/pkg/legacy"
73
+ fi
74
+ jq --arg n "@$GITHUB_REPOSITORY" '.name = $n' package.json > pkg.tmp && mv pkg.tmp package.json
75
+ npm pack --ignore-scripts --pack-destination "$RUNNER_TEMP/pkg/github"
76
+
77
+ - uses: actions/upload-artifact@v4
78
+ with:
79
+ name: packages
80
+ path: ${{ runner.temp }}/pkg/
81
+
82
+ publish-npmjs:
83
+ runs-on: ubuntu-latest
84
+ needs: [pack]
85
+ permissions:
86
+ id-token: write
87
+ steps:
88
+ - uses: actions/download-artifact@v4
89
+ with:
90
+ name: packages
91
+ path: pkg
92
+
93
+ - uses: actions/setup-node@v4
94
+ with:
95
+ node-version: '26.x'
96
+ registry-url: 'https://registry.npmjs.org'
97
+
63
98
  - name: Publish package
64
- run: npm publish --provenance --access public
65
-
66
- # The package was published unscoped before moving to @hostinger. Republish
67
- # each release under the old name so existing installs keep updating.
68
- # Both names point their npm trusted publisher at this workflow file, which
69
- # is what the config keys on — the job/step it runs in is not part of it.
70
- # hostinger-api-sdk is substituted by scripts/post-typescript-axios.sh and
71
- # is empty for an API that never had an unscoped package.
99
+ run: npm publish pkg/npmjs/*.tgz --provenance --access public --ignore-scripts
100
+
72
101
  - name: Publish legacy unscoped alias
73
102
  run: |
74
- LEGACY='hostinger-api-sdk'
75
- if [ -z "$LEGACY" ]; then
103
+ if ! ls pkg/legacy/*.tgz >/dev/null 2>&1; then
76
104
  echo "No legacy npm name configured — nothing to alias."
77
105
  exit 0
78
106
  fi
79
- jq --arg n "$LEGACY" '.name = $n' package.json > pkg.tmp && mv pkg.tmp package.json
80
- npm publish --provenance --access public
107
+ npm publish pkg/legacy/*.tgz --provenance --access public --ignore-scripts
81
108
 
82
109
  publish-github:
83
110
  runs-on: ubuntu-latest
84
- needs: [release]
85
- if: needs.release.outputs.released == 'true'
111
+ needs: [pack]
86
112
  permissions:
87
- contents: read
88
113
  id-token: write
89
114
  packages: write
90
115
  steps:
91
- - uses: actions/checkout@v4
116
+ - uses: actions/download-artifact@v4
117
+ with:
118
+ name: packages
119
+ path: pkg
92
120
 
93
121
  - uses: actions/setup-node@v4
94
122
  with:
@@ -96,23 +124,18 @@ jobs:
96
124
  registry-url: 'https://npm.pkg.github.com'
97
125
  scope: '@hostinger'
98
126
 
99
- - name: Install dependencies
100
- run: npm install
101
-
102
127
  - name: Publish package
103
- run: |
104
- sed -i 's+"name": ".*+"name": "@${{ github.repository }}",+gI' ./package.json
105
- npm publish --provenance --access public
128
+ run: npm publish pkg/github/*.tgz --provenance --access public --ignore-scripts
106
129
  env:
107
130
  NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108
131
 
109
132
  notify-failure:
110
- needs: [release, publish-npmjs, publish-github]
133
+ needs: [release, pack, publish-npmjs, publish-github]
111
134
  if: failure()
112
135
  runs-on: ubuntu-latest
113
136
  steps:
114
137
  - name: Notify Slack on release failure
115
- uses: slackapi/slack-github-action@v4.0.0
138
+ uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v4.0.0
116
139
  with:
117
140
  errors: true
118
141
  webhook: ${{ secrets.PLATFORM_INCIDENT_SLACK_CHANNEL_WEBHOOK }}
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
- ## @hostinger/sdk@2.13.1
1
+ ## @hostinger/sdk@2.14.0
2
2
 
3
3
  For more information, please visit [https://developers.hostinger.com](https://developers.hostinger.com).
4
4
 
5
5
  ### Usage
6
6
 
7
7
  ```
8
- npm install @hostinger/sdk@2.13.1 --save
8
+ npm install @hostinger/sdk@2.14.0 --save
9
9
  ```