@hostinger/mail-sdk 1.19.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 (78) hide show
  1. package/.github/workflows/build-release.yaml +135 -0
  2. package/CODEOWNERS +1 -0
  3. package/README.md +9 -0
  4. package/api.ts +3791 -0
  5. package/base.ts +83 -0
  6. package/common.ts +111 -0
  7. package/configuration.ts +72 -0
  8. package/dist/api.d.ts +2457 -0
  9. package/dist/api.js +2484 -0
  10. package/dist/base.d.ts +63 -0
  11. package/dist/base.js +62 -0
  12. package/dist/common.d.ts +47 -0
  13. package/dist/common.js +118 -0
  14. package/dist/configuration.d.ts +51 -0
  15. package/dist/configuration.js +37 -0
  16. package/dist/esm/api.d.ts +2457 -0
  17. package/dist/esm/api.js +2457 -0
  18. package/dist/esm/base.d.ts +63 -0
  19. package/dist/esm/base.js +57 -0
  20. package/dist/esm/common.d.ts +47 -0
  21. package/dist/esm/common.js +109 -0
  22. package/dist/esm/configuration.d.ts +51 -0
  23. package/dist/esm/configuration.js +33 -0
  24. package/dist/esm/index.d.ts +10 -0
  25. package/dist/esm/index.js +12 -0
  26. package/dist/index.d.ts +10 -0
  27. package/dist/index.js +28 -0
  28. package/docs/AccountApi.md +55 -0
  29. package/docs/Error.md +25 -0
  30. package/docs/FoldersApi.md +259 -0
  31. package/docs/MessagesApi.md +860 -0
  32. package/docs/Pagination.md +27 -0
  33. package/docs/QuotaApi.md +63 -0
  34. package/docs/SendApi.md +68 -0
  35. package/docs/V1FolderMessagesCollection.md +23 -0
  36. package/docs/V1FolderMessagesDeleteBulkRequest.md +21 -0
  37. package/docs/V1FolderMessagesFlagsBulkRequest.md +25 -0
  38. package/docs/V1FolderMessagesFlagsRequest.md +23 -0
  39. package/docs/V1FolderMessagesMessage.md +47 -0
  40. package/docs/V1FolderMessagesMessageAddress.md +23 -0
  41. package/docs/V1FolderMessagesMessageAttachment.md +31 -0
  42. package/docs/V1FolderMessagesMessageText.md +23 -0
  43. package/docs/V1FolderMessagesMessageTextResource.md +21 -0
  44. package/docs/V1FolderMessagesMoveBulkRequest.md +23 -0
  45. package/docs/V1FolderMessagesMoveRequest.md +21 -0
  46. package/docs/V1FolderMessagesResource.md +21 -0
  47. package/docs/V1FolderMessagesSearchRequest.md +45 -0
  48. package/docs/V1FolderMessagesUpdateFlagsResult.md +21 -0
  49. package/docs/V1FolderMessagesUpdateFlagsResultData.md +22 -0
  50. package/docs/V1FolderMessagesUpdateFlagsResultDataFailedInner.md +22 -0
  51. package/docs/V1FoldersCollection.md +23 -0
  52. package/docs/V1FoldersCreateRequest.md +21 -0
  53. package/docs/V1FoldersFolder.md +31 -0
  54. package/docs/V1FoldersResource.md +21 -0
  55. package/docs/V1FoldersUpdateRequest.md +21 -0
  56. package/docs/V1MeMailbox.md +23 -0
  57. package/docs/V1MeResource.md +21 -0
  58. package/docs/V1MeResourceData.md +22 -0
  59. package/docs/V1QuotaQuota.md +29 -0
  60. package/docs/V1QuotaQuotaResource.md +27 -0
  61. package/docs/V1QuotaResource.md +21 -0
  62. package/docs/V1SendAttachment.md +29 -0
  63. package/docs/V1SendMessageRef.md +23 -0
  64. package/docs/V1SendRequest.md +39 -0
  65. package/docs/V1WebhooksCollection.md +23 -0
  66. package/docs/V1WebhooksCreateRequest.md +29 -0
  67. package/docs/V1WebhooksResource.md +21 -0
  68. package/docs/V1WebhooksResourceWithSecret.md +21 -0
  69. package/docs/V1WebhooksTestResult.md +21 -0
  70. package/docs/V1WebhooksTestResultData.md +24 -0
  71. package/docs/V1WebhooksUpdateRequest.md +29 -0
  72. package/docs/V1WebhooksWebhook.md +39 -0
  73. package/docs/V1WebhooksWebhookWithSecret.md +41 -0
  74. package/docs/WebhooksApi.md +439 -0
  75. package/index.ts +15 -0
  76. package/package.json +34 -0
  77. package/tsconfig.esm.json +7 -0
  78. package/tsconfig.json +18 -0
@@ -0,0 +1,135 @@
1
+ name: build-release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ id-token: write
13
+ contents: write
14
+ outputs:
15
+ new_version: ${{ steps.version.outputs.version }}
16
+ released: ${{ steps.version.outputs.released }}
17
+ steps:
18
+ - name: Repo checkout
19
+ uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+
23
+ - name: Resolve version from package.json
24
+ id: version
25
+ run: |
26
+ VERSION=$(jq -r .version package.json)
27
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
28
+ if git rev-parse "v$VERSION" >/dev/null 2>&1; then
29
+ echo "released=false" >> "$GITHUB_OUTPUT"
30
+ echo "Tag v$VERSION already exists — skipping release."
31
+ else
32
+ echo "released=true" >> "$GITHUB_OUTPUT"
33
+ fi
34
+
35
+ - name: Create release
36
+ if: steps.version.outputs.released == 'true'
37
+ uses: ncipollo/release-action@v1
38
+ with:
39
+ tag: v${{ steps.version.outputs.version }}
40
+ generateReleaseNotes: true
41
+
42
+ publish-npmjs:
43
+ runs-on: ubuntu-latest
44
+ needs: [release]
45
+ if: needs.release.outputs.released == 'true'
46
+ permissions:
47
+ contents: read
48
+ id-token: write
49
+ steps:
50
+ - uses: actions/checkout@v4
51
+
52
+ - uses: actions/setup-node@v4
53
+ with:
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
+
60
+ - name: Install dependencies
61
+ run: npm install
62
+
63
+ - 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-mail-api-sdk is substituted by scripts/post-typescript-axios.sh and
71
+ # is empty for an API that never had an unscoped package.
72
+ - name: Publish legacy unscoped alias
73
+ run: |
74
+ LEGACY='hostinger-mail-api-sdk'
75
+ if [ -z "$LEGACY" ]; then
76
+ echo "No legacy npm name configured — nothing to alias."
77
+ exit 0
78
+ fi
79
+ jq --arg n "$LEGACY" '.name = $n' package.json > pkg.tmp && mv pkg.tmp package.json
80
+ npm publish --provenance --access public
81
+
82
+ publish-github:
83
+ runs-on: ubuntu-latest
84
+ needs: [release]
85
+ if: needs.release.outputs.released == 'true'
86
+ permissions:
87
+ contents: read
88
+ id-token: write
89
+ packages: write
90
+ steps:
91
+ - uses: actions/checkout@v4
92
+
93
+ - uses: actions/setup-node@v4
94
+ with:
95
+ node-version: '26.x'
96
+ registry-url: 'https://npm.pkg.github.com'
97
+ scope: '@hostinger'
98
+
99
+ - name: Install dependencies
100
+ run: npm install
101
+
102
+ - name: Publish package
103
+ run: |
104
+ sed -i 's+"name": ".*+"name": "@${{ github.repository }}",+gI' ./package.json
105
+ npm publish --provenance --access public
106
+ env:
107
+ NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108
+
109
+ notify-failure:
110
+ needs: [release, publish-npmjs, publish-github]
111
+ if: failure()
112
+ runs-on: ubuntu-latest
113
+ steps:
114
+ - name: Notify Slack on release failure
115
+ uses: slackapi/slack-github-action@v4.0.0
116
+ with:
117
+ errors: true
118
+ webhook: ${{ secrets.PLATFORM_INCIDENT_SLACK_CHANNEL_WEBHOOK }}
119
+ webhook-type: incoming-webhook
120
+ payload: |
121
+ text: ":rotating_light: Release failed in ${{ github.repository }}"
122
+ blocks:
123
+ - type: section
124
+ text:
125
+ type: mrkdwn
126
+ text: |
127
+ :rotating_light: *Release failed:* `${{ github.repository }}`
128
+ *Commit:* <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>
129
+ - type: actions
130
+ elements:
131
+ - type: button
132
+ text:
133
+ type: plain_text
134
+ text: "View failed run"
135
+ url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
package/CODEOWNERS ADDED
@@ -0,0 +1 @@
1
+ * @hostinger/email
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ ## @hostinger/mail-sdk@1.19.0
2
+
3
+
4
+
5
+ ### Usage
6
+
7
+ ```
8
+ npm install @hostinger/mail-sdk@1.19.0 --save
9
+ ```