hcloud-sdk 0.0.16 → 15.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/changelog.md +45 -0
- package/index.d.ts +3 -2
- package/index.js +5 -2
- package/lib/Base.d.ts +26 -0
- package/lib/Base.js +12 -0
- package/lib/Hcloud.d.ts +90 -0
- package/lib/Hcloud.js +184 -0
- package/lib/helper/ErrorHelper.d.ts +7 -0
- package/lib/helper/ErrorHelper.js +19 -0
- package/lib/helper/paginatedResponseHelper.d.ts +3 -0
- package/lib/helper/paginatedResponseHelper.js +9 -0
- package/lib/helper/searchFilter.d.ts +9 -0
- package/lib/helper/searchFilter.js +12 -0
- package/lib/interfaces/agent/bundle/dev/index.d.ts +3 -0
- package/lib/interfaces/agent/context/index.d.ts +19 -0
- package/lib/interfaces/agent/index.d.ts +21 -0
- package/lib/interfaces/agent/index.js +2 -0
- package/lib/interfaces/{Auditor.d.ts → auditor/index.d.ts} +31 -5
- package/lib/interfaces/{Auditor.js → auditor/index.js} +15 -5
- package/lib/interfaces/axios/index.d.ts +5 -0
- package/lib/interfaces/axios/index.js +8 -0
- package/lib/interfaces/bouncer/features/index.d.ts +7 -0
- package/lib/interfaces/bouncer/features/index.js +2 -0
- package/lib/interfaces/bouncer/index.d.ts +6 -0
- package/lib/interfaces/bouncer/index.js +17 -0
- package/lib/interfaces/dali/index.d.ts +3 -0
- package/lib/interfaces/dali/index.js +2 -0
- package/lib/interfaces/frontend/config/index.d.ts +33 -0
- package/lib/interfaces/frontend/config/index.js +10 -0
- package/lib/interfaces/frontend/featureflags/index.d.ts +7 -0
- package/lib/interfaces/frontend/featureflags/index.js +2 -0
- package/lib/interfaces/fuse/index.d.ts +3 -0
- package/lib/interfaces/fuse/index.js +19 -0
- package/lib/interfaces/fuse/space/cronjob/Cronjob.d.ts +38 -0
- package/lib/interfaces/fuse/space/cronjob/Cronjob.js +8 -0
- package/lib/interfaces/fuse/space/cronjob/CronjobLog.d.ts +16 -0
- package/lib/interfaces/fuse/space/cronjob/CronjobLog.js +2 -0
- package/lib/interfaces/fuse/space/index.d.ts +21 -0
- package/lib/interfaces/fuse/space/index.js +11 -0
- package/lib/interfaces/global/HCloudError.d.ts +8 -0
- package/lib/interfaces/global/HCloudError.js +13 -0
- package/lib/interfaces/global/Header.d.ts +4 -0
- package/lib/interfaces/global/Header.js +2 -0
- package/lib/interfaces/global/HttpMethod.d.ts +7 -0
- package/lib/interfaces/global/HttpMethod.js +11 -0
- package/lib/interfaces/global/PaginatedResponse.d.ts +4 -0
- package/lib/interfaces/global/PaginatedResponse.js +2 -0
- package/lib/interfaces/global/Products.d.ts +11 -0
- package/lib/interfaces/global/Products.js +15 -0
- package/lib/interfaces/global/SearchFilters.d.ts +86 -0
- package/lib/interfaces/global/SearchFilters.js +49 -0
- package/lib/interfaces/global/Space.d.ts +20 -0
- package/lib/interfaces/global/Space.js +8 -0
- package/lib/interfaces/global/Version.d.ts +3 -0
- package/lib/interfaces/global/Version.js +2 -0
- package/lib/interfaces/global/Views.d.ts +8 -0
- package/lib/interfaces/global/Views.js +12 -0
- package/lib/interfaces/global/index.d.ts +9 -0
- package/lib/interfaces/global/index.js +25 -0
- package/lib/interfaces/high5/index.d.ts +16 -0
- package/lib/interfaces/high5/index.js +32 -0
- package/lib/interfaces/high5/joinToken/index.d.ts +10 -0
- package/lib/interfaces/high5/joinToken/index.js +2 -0
- package/lib/interfaces/high5/space/event/index.d.ts +15 -0
- package/lib/interfaces/high5/space/event/index.js +2 -0
- package/lib/interfaces/high5/space/event/stream/design/DesignOperation.d.ts +68 -0
- package/lib/interfaces/high5/space/event/stream/design/DesignOperation.js +20 -0
- package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +92 -0
- package/lib/interfaces/high5/space/event/stream/design/StreamDesign.js +20 -0
- package/lib/interfaces/high5/space/event/stream/design/index.d.ts +22 -0
- package/lib/interfaces/high5/space/event/stream/design/index.js +2 -0
- package/lib/interfaces/high5/space/event/stream/design/snapshot/index.d.ts +30 -0
- package/lib/interfaces/high5/space/event/stream/design/snapshot/index.js +8 -0
- package/lib/interfaces/high5/space/event/stream/index.d.ts +77 -0
- package/lib/interfaces/high5/space/event/stream/index.js +13 -0
- package/lib/interfaces/high5/space/event/stream/node/index.d.ts +62 -0
- package/lib/interfaces/high5/space/event/stream/node/index.js +7 -0
- package/lib/interfaces/high5/space/execution/index.d.ts +148 -0
- package/lib/interfaces/high5/space/execution/index.js +21 -0
- package/lib/interfaces/high5/space/index.d.ts +23 -0
- package/lib/interfaces/high5/space/index.js +12 -0
- package/lib/interfaces/high5/space/secret/index.d.ts +12 -0
- package/lib/interfaces/high5/space/secret/index.js +2 -0
- package/lib/interfaces/high5/space/webhook/index.d.ts +75 -0
- package/lib/interfaces/high5/space/webhook/index.js +9 -0
- package/lib/interfaces/high5/wave/changelog.d.ts +30 -0
- package/lib/interfaces/high5/wave/changelog.js +18 -0
- package/lib/interfaces/high5/wave/index.d.ts +201 -0
- package/lib/interfaces/high5/wave/index.js +61 -0
- package/lib/interfaces/idp/index.d.ts +26 -0
- package/lib/interfaces/idp/index.js +38 -0
- package/lib/interfaces/idp/oauth/index.d.ts +19 -0
- package/lib/interfaces/idp/oauth/index.js +8 -0
- package/lib/interfaces/idp/organization/index.d.ts +32 -0
- package/lib/interfaces/idp/organization/index.js +25 -0
- package/lib/interfaces/idp/organization/license/index.d.ts +84 -0
- package/lib/interfaces/idp/organization/license/index.js +15 -0
- package/lib/interfaces/idp/organization/member/index.d.ts +15 -0
- package/lib/interfaces/idp/organization/member/index.js +2 -0
- package/lib/interfaces/idp/organization/member/invitations/index.d.ts +26 -0
- package/lib/interfaces/idp/organization/member/invitations/index.js +18 -0
- package/lib/interfaces/idp/organization/settings/domain/index.d.ts +19 -0
- package/lib/interfaces/idp/organization/settings/domain/index.js +8 -0
- package/lib/interfaces/idp/organization/settings/domain/saml/index.d.ts +10 -0
- package/lib/interfaces/idp/organization/settings/domain/saml/index.js +2 -0
- package/lib/interfaces/idp/organization/settings/oauthApp/index.d.ts +37 -0
- package/lib/interfaces/idp/organization/settings/oauthApp/index.js +2 -0
- package/lib/interfaces/idp/organization/team/index.d.ts +24 -0
- package/lib/interfaces/idp/organization/team/index.js +9 -0
- package/lib/interfaces/idp/user/ConnectionSettings.d.ts +6 -0
- package/lib/interfaces/idp/user/ConnectionSettings.js +2 -0
- package/lib/interfaces/idp/user/GeneralSettings.d.ts +45 -0
- package/lib/interfaces/idp/user/GeneralSettings.js +38 -0
- package/lib/interfaces/idp/user/NotificationSettings.d.ts +8 -0
- package/lib/interfaces/idp/user/NotificationSettings.js +2 -0
- package/lib/interfaces/idp/user/Pat.d.ts +19 -0
- package/lib/interfaces/idp/user/Pat.js +2 -0
- package/lib/interfaces/idp/user/Scopes.d.ts +40 -0
- package/lib/interfaces/idp/user/Scopes.js +50 -0
- package/lib/interfaces/idp/user/SuccessfulAuth.d.ts +5 -0
- package/lib/interfaces/idp/user/SuccessfulAuth.js +2 -0
- package/lib/interfaces/idp/user/Totp.d.ts +20 -0
- package/lib/interfaces/idp/user/Totp.js +2 -0
- package/lib/interfaces/idp/user/index.d.ts +23 -0
- package/lib/interfaces/idp/user/index.js +2 -0
- package/lib/interfaces/mailer/index.d.ts +66 -0
- package/lib/interfaces/mailer/index.js +81 -0
- package/lib/interfaces/mothership/index.d.ts +28 -0
- package/lib/interfaces/mothership/index.js +8 -0
- package/lib/interfaces/nats/index.d.ts +239 -0
- package/lib/interfaces/nats/index.js +316 -0
- package/lib/service/agent/bundle/dev/index.d.ts +17 -0
- package/lib/service/agent/bundle/dev/index.js +44 -0
- package/lib/service/agent/bundle/index.d.ts +11 -0
- package/lib/service/agent/bundle/index.js +55 -0
- package/lib/service/agent/context/index.d.ts +35 -0
- package/lib/service/agent/context/index.js +90 -0
- package/lib/service/agent/index.d.ts +16 -0
- package/lib/service/agent/index.js +37 -0
- package/lib/service/agent/installer/index.d.ts +15 -0
- package/lib/service/agent/installer/index.js +97 -0
- package/lib/service/auditor/index.d.ts +25 -0
- package/lib/service/auditor/index.js +55 -0
- package/lib/service/auditor/internal/index.d.ts +27 -0
- package/lib/service/auditor/internal/index.js +65 -0
- package/lib/service/bouncer/features/index.d.ts +8 -0
- package/lib/service/bouncer/features/index.js +27 -0
- package/lib/service/bouncer/index.d.ts +7 -0
- package/lib/service/bouncer/index.js +16 -0
- package/lib/service/dali/DaliAvatar.d.ts +40 -0
- package/lib/service/dali/DaliAvatar.js +70 -0
- package/lib/service/dali/avatar/DaliFuseSpace.d.ts +26 -0
- package/lib/service/dali/avatar/DaliFuseSpace.js +58 -0
- package/lib/service/dali/avatar/DaliHigh5Space.d.ts +26 -0
- package/lib/service/dali/avatar/DaliHigh5Space.js +58 -0
- package/lib/service/dali/avatar/DaliOAuthApp.d.ts +26 -0
- package/lib/service/dali/avatar/DaliOAuthApp.js +58 -0
- package/lib/service/dali/avatar/DaliOrganization.d.ts +23 -0
- package/lib/service/dali/avatar/DaliOrganization.js +55 -0
- package/lib/service/dali/avatar/DaliTeam.d.ts +26 -0
- package/lib/service/dali/avatar/DaliTeam.js +58 -0
- package/lib/service/dali/avatar/DaliUser.d.ts +20 -0
- package/lib/service/dali/avatar/DaliUser.js +52 -0
- package/lib/service/dali/index.d.ts +15 -0
- package/lib/service/dali/index.js +37 -0
- package/lib/service/fuse/index.d.ts +18 -0
- package/lib/service/fuse/index.js +48 -0
- package/lib/service/fuse/internal/index.d.ts +8 -0
- package/lib/service/fuse/internal/index.js +31 -0
- package/lib/service/fuse/internal/space/cronjob/index.d.ts +7 -0
- package/lib/service/fuse/internal/space/cronjob/index.js +17 -0
- package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +15 -0
- package/lib/service/fuse/internal/space/cronjob/log/index.js +34 -0
- package/lib/service/fuse/internal/space/index.d.ts +22 -0
- package/lib/service/fuse/internal/space/index.js +49 -0
- package/lib/service/fuse/space/cronjob/index.d.ts +123 -0
- package/lib/service/fuse/space/cronjob/index.js +203 -0
- package/lib/service/fuse/space/cronjob/log/index.d.ts +31 -0
- package/lib/service/fuse/space/cronjob/log/index.js +58 -0
- package/lib/service/fuse/space/index.d.ts +81 -0
- package/lib/service/fuse/space/index.js +152 -0
- package/lib/service/high5/execution/index.d.ts +10 -0
- package/lib/service/high5/execution/index.js +24 -0
- package/lib/service/high5/execution/log/index.d.ts +19 -0
- package/lib/service/high5/execution/log/index.js +40 -0
- package/lib/service/high5/execution/status/index.d.ts +18 -0
- package/lib/service/high5/execution/status/index.js +40 -0
- package/lib/service/high5/index.d.ts +25 -0
- package/lib/service/high5/index.js +63 -0
- package/lib/service/high5/internal/index.d.ts +8 -0
- package/lib/service/high5/internal/index.js +31 -0
- package/lib/service/high5/internal/space/index.d.ts +21 -0
- package/lib/service/high5/internal/space/index.js +45 -0
- package/lib/service/high5/joinToken/index.d.ts +40 -0
- package/lib/service/high5/joinToken/index.js +72 -0
- package/lib/service/high5/space/event/index.d.ts +55 -0
- package/lib/service/high5/space/event/index.js +101 -0
- package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +31 -0
- package/lib/service/high5/space/event/stream/design/DesignOperations.js +117 -0
- package/lib/service/high5/space/event/stream/design/index.d.ts +53 -0
- package/lib/service/high5/space/event/stream/design/index.js +91 -0
- package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +62 -0
- package/lib/service/high5/space/event/stream/design/snapshot/index.js +107 -0
- package/lib/service/high5/space/event/stream/index.d.ts +113 -0
- package/lib/service/high5/space/event/stream/index.js +186 -0
- package/lib/service/high5/space/execution/index.d.ts +48 -0
- package/lib/service/high5/space/execution/index.js +89 -0
- package/lib/service/high5/space/execution/log/index.d.ts +29 -0
- package/lib/service/high5/space/execution/log/index.js +58 -0
- package/lib/service/high5/space/execution/status/index.d.ts +16 -0
- package/lib/service/high5/space/execution/status/index.js +36 -0
- package/lib/service/high5/space/index.d.ts +111 -0
- package/lib/service/high5/space/index.js +205 -0
- package/lib/service/high5/space/node/index.d.ts +58 -0
- package/lib/service/high5/space/node/index.js +116 -0
- package/lib/service/high5/space/secret/index.d.ts +60 -0
- package/lib/service/high5/space/secret/index.js +102 -0
- package/lib/service/high5/space/wave/index.d.ts +36 -0
- package/lib/service/high5/space/wave/index.js +73 -0
- package/lib/service/high5/space/webhook/index.d.ts +90 -0
- package/lib/service/high5/space/webhook/index.js +165 -0
- package/lib/service/high5/space/webhook/log/index.d.ts +16 -0
- package/lib/service/high5/space/webhook/log/index.js +37 -0
- package/lib/service/high5/wave/index.d.ts +8 -0
- package/lib/service/high5/wave/index.js +15 -0
- package/lib/service/high5/wave/s3/index.d.ts +48 -0
- package/lib/service/high5/wave/s3/index.js +100 -0
- package/lib/service/idp/index.d.ts +84 -0
- package/lib/service/idp/index.js +185 -0
- package/lib/service/idp/internal/index.d.ts +17 -0
- package/lib/service/idp/internal/index.js +33 -0
- package/lib/service/idp/oauth/index.d.ts +49 -0
- package/lib/service/idp/oauth/index.js +117 -0
- package/lib/service/idp/organization/index.d.ts +56 -0
- package/lib/service/idp/organization/index.js +114 -0
- package/lib/service/idp/organization/license/index.d.ts +7 -0
- package/lib/service/idp/organization/license/index.js +31 -0
- package/lib/service/idp/organization/member/index.d.ts +57 -0
- package/lib/service/idp/organization/member/index.js +110 -0
- package/lib/service/idp/organization/member/invitations/index.d.ts +79 -0
- package/lib/service/idp/organization/member/invitations/index.js +122 -0
- package/lib/service/idp/organization/settings/domain/index.d.ts +37 -0
- package/lib/service/idp/organization/settings/domain/index.js +76 -0
- package/lib/service/idp/organization/settings/domain/saml/index.d.ts +43 -0
- package/lib/service/idp/organization/settings/domain/saml/index.js +98 -0
- package/lib/service/idp/organization/settings/index.d.ts +16 -0
- package/lib/service/idp/organization/settings/index.js +29 -0
- package/lib/service/idp/organization/settings/oauth/index.d.ts +62 -0
- package/lib/service/idp/organization/settings/oauth/index.js +117 -0
- package/lib/service/idp/organization/team/index.d.ts +72 -0
- package/lib/service/idp/organization/team/index.js +124 -0
- package/lib/service/idp/registration/index.d.ts +37 -0
- package/lib/service/idp/registration/index.js +87 -0
- package/lib/service/idp/user/index.d.ts +83 -0
- package/lib/service/idp/user/index.js +160 -0
- package/lib/service/idp/user/license/index.d.ts +7 -0
- package/lib/service/idp/user/license/index.js +31 -0
- package/lib/service/idp/user/password/index.d.ts +19 -0
- package/lib/service/idp/user/password/index.js +51 -0
- package/lib/service/idp/user/settings/connections/index.d.ts +13 -0
- package/lib/service/idp/user/settings/connections/index.js +32 -0
- package/lib/service/idp/user/settings/general/index.d.ts +22 -0
- package/lib/service/idp/user/settings/general/index.js +51 -0
- package/lib/service/idp/user/settings/index.d.ts +40 -0
- package/lib/service/idp/user/settings/index.js +70 -0
- package/lib/service/idp/user/settings/notifications/index.d.ts +16 -0
- package/lib/service/idp/user/settings/notifications/index.js +40 -0
- package/lib/service/idp/user/settings/oauthApps/index.d.ts +20 -0
- package/lib/service/idp/user/settings/oauthApps/index.js +55 -0
- package/lib/service/idp/user/settings/pats/index.d.ts +48 -0
- package/lib/service/idp/user/settings/pats/index.js +104 -0
- package/lib/service/idp/user/settings/twoFactor/index.d.ts +10 -0
- package/lib/service/idp/user/settings/twoFactor/index.js +20 -0
- package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +32 -0
- package/lib/service/idp/user/settings/twoFactor/totp/index.js +72 -0
- package/lib/service/mailer/index.d.ts +13 -0
- package/lib/service/{Mailer.js → mailer/index.js} +17 -16
- package/lib/service/mailer/internal/index.d.ts +36 -0
- package/lib/service/mailer/internal/index.js +69 -0
- package/lib/service/mothership/index.d.ts +97 -0
- package/lib/service/mothership/index.js +149 -0
- package/lib/service/nats/index.d.ts +49 -0
- package/lib/service/nats/index.js +138 -0
- package/lib/utils/Types.d.ts +1 -0
- package/lib/utils/Types.js +2 -0
- package/lib/utils/bouncer/features/Provider.d.ts +19 -0
- package/lib/utils/bouncer/features/Provider.js +101 -0
- package/package.json +37 -29
- package/lib/base.d.ts +0 -12
- package/lib/base.js +0 -8
- package/lib/hcloud.d.ts +0 -13
- package/lib/hcloud.js +0 -29
- package/lib/interfaces/Global.d.ts +0 -8
- package/lib/interfaces/IDP.d.ts +0 -9
- package/lib/interfaces/Mail.d.ts +0 -29
- package/lib/interfaces/Mail.js +0 -8
- package/lib/service/Auditor.d.ts +0 -22
- package/lib/service/Auditor.js +0 -61
- package/lib/service/AuditorInternal.d.ts +0 -28
- package/lib/service/AuditorInternal.js +0 -65
- package/lib/service/High5.d.ts +0 -4
- package/lib/service/High5.js +0 -9
- package/lib/service/IDP.d.ts +0 -39
- package/lib/service/IDP.js +0 -84
- package/lib/service/Mailer.d.ts +0 -13
- package/lib/service/MailerInternal.d.ts +0 -32
- package/lib/service/MailerInternal.js +0 -64
- /package/lib/interfaces/{Global.js → agent/bundle/dev/index.js} +0 -0
- /package/lib/interfaces/{IDP.js → agent/context/index.js} +0 -0
package/lib/hcloud.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import base, { Options } from "./base";
|
|
2
|
-
import IDPService from "./service/IDP";
|
|
3
|
-
import AuditorService from "./service/Auditor";
|
|
4
|
-
import High5Service from "./service/High5";
|
|
5
|
-
import MailerService from "./service/Mailer";
|
|
6
|
-
export default class hcloud extends base {
|
|
7
|
-
Auditor: AuditorService;
|
|
8
|
-
High5: High5Service;
|
|
9
|
-
IDP: IDPService;
|
|
10
|
-
Mailer: MailerService;
|
|
11
|
-
constructor(opts: Options);
|
|
12
|
-
setAuthToken(token: string): hcloud;
|
|
13
|
-
}
|
package/lib/hcloud.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const base_1 = require("./base");
|
|
4
|
-
const IDP_1 = require("./service/IDP");
|
|
5
|
-
const Auditor_1 = require("./service/Auditor");
|
|
6
|
-
const High5_1 = require("./service/High5");
|
|
7
|
-
const Mailer_1 = require("./service/Mailer");
|
|
8
|
-
const axios_1 = require("axios");
|
|
9
|
-
const package_json_1 = require("../package.json");
|
|
10
|
-
// tslint:disable-next-line
|
|
11
|
-
class hcloud extends base_1.default {
|
|
12
|
-
constructor(opts) {
|
|
13
|
-
super(opts);
|
|
14
|
-
this.Auditor = new Auditor_1.default(this.opts);
|
|
15
|
-
this.High5 = new High5_1.default(this.opts);
|
|
16
|
-
this.IDP = new IDP_1.default(this.opts);
|
|
17
|
-
this.Mailer = new Mailer_1.default(this.opts);
|
|
18
|
-
axios_1.default.defaults.headers.common = {
|
|
19
|
-
"User-Agent": "hcloud-sdk-js/v" + package_json_1.version,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
setAuthToken(token) {
|
|
23
|
-
axios_1.default.defaults.headers.common = Object.assign(axios_1.default.defaults.headers.common, {
|
|
24
|
-
Authorization: token,
|
|
25
|
-
});
|
|
26
|
-
return this;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.default = hcloud;
|
package/lib/interfaces/IDP.d.ts
DELETED
package/lib/interfaces/Mail.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export declare enum Template {
|
|
2
|
-
REGISTER = "register",
|
|
3
|
-
RESET_PASSWORD = "reset_password"
|
|
4
|
-
}
|
|
5
|
-
export interface Mail {
|
|
6
|
-
recipients: string[];
|
|
7
|
-
subject: string;
|
|
8
|
-
}
|
|
9
|
-
export interface MailReplacement {
|
|
10
|
-
key: string;
|
|
11
|
-
value: string;
|
|
12
|
-
}
|
|
13
|
-
export interface TemplateMail extends Mail {
|
|
14
|
-
template: Template;
|
|
15
|
-
replacements: MailReplacement[];
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* @param html base64 encoded html string
|
|
19
|
-
*/
|
|
20
|
-
export interface HtmlMail extends Mail {
|
|
21
|
-
html: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* @param html base64 encoded html string
|
|
25
|
-
*/
|
|
26
|
-
export interface MustacheMail extends Mail {
|
|
27
|
-
html: string;
|
|
28
|
-
replacements: MailReplacement[];
|
|
29
|
-
}
|
package/lib/interfaces/Mail.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Template = void 0;
|
|
4
|
-
var Template;
|
|
5
|
-
(function (Template) {
|
|
6
|
-
Template["REGISTER"] = "register";
|
|
7
|
-
Template["RESET_PASSWORD"] = "reset_password";
|
|
8
|
-
})(Template = exports.Template || (exports.Template = {}));
|
package/lib/service/Auditor.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import base, { Options } from "../base";
|
|
2
|
-
import { AuditLog } from "../interfaces/Auditor";
|
|
3
|
-
import { Version } from "../interfaces/Global";
|
|
4
|
-
import { AuditorInternal } from "./AuditorInternal";
|
|
5
|
-
export default class Auditor extends base {
|
|
6
|
-
internal: AuditorInternal;
|
|
7
|
-
constructor(opts: Options);
|
|
8
|
-
/**
|
|
9
|
-
* Version requests the endpoint version
|
|
10
|
-
* @returns Version object
|
|
11
|
-
*/
|
|
12
|
-
version: () => Promise<Version>;
|
|
13
|
-
/**
|
|
14
|
-
* GetAuditLog requests logs from
|
|
15
|
-
* @param organizationId an optional organization ID to receive audit logs for
|
|
16
|
-
* @param limit an opitional response limit (1-1000; dafaults to 500)
|
|
17
|
-
* @param page an opitional page to skip certain results (page * limit; defaults to 0)
|
|
18
|
-
* @returns User object
|
|
19
|
-
*/
|
|
20
|
-
getAuditLogs: (organizationId: string | null, limit: number | null, page: number | null) => Promise<AuditLog[]>;
|
|
21
|
-
private getEndpoint;
|
|
22
|
-
}
|
package/lib/service/Auditor.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const base_1 = require("../base");
|
|
13
|
-
const axios_1 = require("axios");
|
|
14
|
-
const AuditorInternal_1 = require("./AuditorInternal");
|
|
15
|
-
class Auditor extends base_1.default {
|
|
16
|
-
constructor(opts) {
|
|
17
|
-
super(opts);
|
|
18
|
-
/**
|
|
19
|
-
* Version requests the endpoint version
|
|
20
|
-
* @returns Version object
|
|
21
|
-
*/
|
|
22
|
-
this.version = () => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
const resp = yield axios_1.default.get(this.getEndpoint("/v1/version"), {}).catch((err) => {
|
|
24
|
-
throw err;
|
|
25
|
-
});
|
|
26
|
-
return resp.data;
|
|
27
|
-
});
|
|
28
|
-
/**
|
|
29
|
-
* GetAuditLog requests logs from
|
|
30
|
-
* @param organizationId an optional organization ID to receive audit logs for
|
|
31
|
-
* @param limit an opitional response limit (1-1000; dafaults to 500)
|
|
32
|
-
* @param page an opitional page to skip certain results (page * limit; defaults to 0)
|
|
33
|
-
* @returns User object
|
|
34
|
-
*/
|
|
35
|
-
this.getAuditLogs = (organizationId, limit, page) => __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
const parameters = [];
|
|
37
|
-
let url = "";
|
|
38
|
-
if (organizationId !== null) {
|
|
39
|
-
parameters.push("organization=" + organizationId);
|
|
40
|
-
}
|
|
41
|
-
if (limit !== null) {
|
|
42
|
-
parameters.push("limit=" + limit);
|
|
43
|
-
}
|
|
44
|
-
if (page !== null) {
|
|
45
|
-
parameters.push("page=" + page);
|
|
46
|
-
}
|
|
47
|
-
if (parameters.length > 0) {
|
|
48
|
-
url = "?" + parameters.join("&");
|
|
49
|
-
}
|
|
50
|
-
const resp = yield axios_1.default.get(this.getEndpoint("/v1/logs") + url, {}).catch((err) => {
|
|
51
|
-
throw err;
|
|
52
|
-
});
|
|
53
|
-
return resp.data;
|
|
54
|
-
});
|
|
55
|
-
this.internal = new AuditorInternal_1.AuditorInternal(opts);
|
|
56
|
-
}
|
|
57
|
-
getEndpoint(endpoint) {
|
|
58
|
-
return `${this.opts.api}/api/auditor${endpoint}`;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.default = Auditor;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import base from "../base";
|
|
2
|
-
import { AuditLog } from "../interfaces/Auditor";
|
|
3
|
-
export declare class AuditorInternal extends base {
|
|
4
|
-
private queueExecutionInterval;
|
|
5
|
-
private logQueue;
|
|
6
|
-
private logQueueTimer;
|
|
7
|
-
/**
|
|
8
|
-
* AddAuditLogs adds log entries
|
|
9
|
-
*
|
|
10
|
-
* THIS ENDPOINT WORKS INTERNALLY ONLY
|
|
11
|
-
*
|
|
12
|
-
* CAN ONLY BE USED FROM BACKENDS WITHIN THE hcloud DEPLOYMENT AS THE ENDPOINT IS NOT PUBLICLY EXPOSED
|
|
13
|
-
* @param logs array (add multiple logs entries at once)
|
|
14
|
-
* @returns AuditLog array
|
|
15
|
-
*/
|
|
16
|
-
addAuditLogs: (logs: AuditLog[]) => Promise<AuditLog[]>;
|
|
17
|
-
/**
|
|
18
|
-
* QueueAuditLogs adds log entries to a queue that will be processed periodically
|
|
19
|
-
*
|
|
20
|
-
* THIS COMES WITH DOWNSIDE OF LOG TIMESTAMPS BEING INACCURATE AS THEY ARE CREATED BY THE Auditor SERVER
|
|
21
|
-
*
|
|
22
|
-
* TIMESTAMPS MIGHT DIFFER AS MUCH AS: this.opts.auditor.queue.executionInterval || 500
|
|
23
|
-
* @param logs array (add multiple logs entries at once)
|
|
24
|
-
*/
|
|
25
|
-
queueAuditLogs: (logs: AuditLog[]) => Promise<void>;
|
|
26
|
-
private startQueue;
|
|
27
|
-
private getEndpoint;
|
|
28
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AuditorInternal = void 0;
|
|
13
|
-
const axios_1 = require("axios");
|
|
14
|
-
const base_1 = require("../base");
|
|
15
|
-
class AuditorInternal extends base_1.default {
|
|
16
|
-
constructor() {
|
|
17
|
-
var _a, _b;
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.queueExecutionInterval = ((_b = (_a = this.opts.auditor) === null || _a === void 0 ? void 0 : _a.queue) === null || _b === void 0 ? void 0 : _b.executionInterval) || 500;
|
|
20
|
-
this.logQueue = [];
|
|
21
|
-
/**
|
|
22
|
-
* AddAuditLogs adds log entries
|
|
23
|
-
*
|
|
24
|
-
* THIS ENDPOINT WORKS INTERNALLY ONLY
|
|
25
|
-
*
|
|
26
|
-
* CAN ONLY BE USED FROM BACKENDS WITHIN THE hcloud DEPLOYMENT AS THE ENDPOINT IS NOT PUBLICLY EXPOSED
|
|
27
|
-
* @param logs array (add multiple logs entries at once)
|
|
28
|
-
* @returns AuditLog array
|
|
29
|
-
*/
|
|
30
|
-
this.addAuditLogs = (logs) => __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
const resp = yield axios_1.default.post(this.getEndpoint("/v1/logs"), logs).catch((err) => {
|
|
32
|
-
throw err;
|
|
33
|
-
});
|
|
34
|
-
return resp.data;
|
|
35
|
-
});
|
|
36
|
-
/**
|
|
37
|
-
* QueueAuditLogs adds log entries to a queue that will be processed periodically
|
|
38
|
-
*
|
|
39
|
-
* THIS COMES WITH DOWNSIDE OF LOG TIMESTAMPS BEING INACCURATE AS THEY ARE CREATED BY THE Auditor SERVER
|
|
40
|
-
*
|
|
41
|
-
* TIMESTAMPS MIGHT DIFFER AS MUCH AS: this.opts.auditor.queue.executionInterval || 500
|
|
42
|
-
* @param logs array (add multiple logs entries at once)
|
|
43
|
-
*/
|
|
44
|
-
this.queueAuditLogs = (logs) => __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
if (!this.logQueueTimer) {
|
|
46
|
-
this.startQueue();
|
|
47
|
-
}
|
|
48
|
-
this.logQueue = this.logQueue.concat(logs);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
startQueue() {
|
|
52
|
-
if (!this.logQueueTimer) {
|
|
53
|
-
this.logQueueTimer = setTimeout(() => {
|
|
54
|
-
if (this.logQueue.length > 0) {
|
|
55
|
-
this.addAuditLogs(this.logQueue);
|
|
56
|
-
this.logQueue = [];
|
|
57
|
-
}
|
|
58
|
-
}, this.queueExecutionInterval);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
getEndpoint(endpoint) {
|
|
62
|
-
return `${this.opts.api}/api/auditor/internal${endpoint}`;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.AuditorInternal = AuditorInternal;
|
package/lib/service/High5.d.ts
DELETED
package/lib/service/High5.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const base_1 = require("../base");
|
|
4
|
-
class High5 extends base_1.default {
|
|
5
|
-
getEndpoint(endpoint) {
|
|
6
|
-
return `${this.opts.api}/api/high5${endpoint}`;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
exports.default = High5;
|
package/lib/service/IDP.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import base from "../base";
|
|
2
|
-
import { Token, User } from "../interfaces/IDP";
|
|
3
|
-
import { Version } from "../interfaces/Global";
|
|
4
|
-
export default class IDP extends base {
|
|
5
|
-
/**
|
|
6
|
-
* Version requests the endpoint version
|
|
7
|
-
* @returns Version object
|
|
8
|
-
*/
|
|
9
|
-
version: () => Promise<Version>;
|
|
10
|
-
/**
|
|
11
|
-
* Authorize validates a token
|
|
12
|
-
* @param token
|
|
13
|
-
* @returns User object
|
|
14
|
-
*/
|
|
15
|
-
authorize: () => Promise<User>;
|
|
16
|
-
/**
|
|
17
|
-
* Register against the identity provider
|
|
18
|
-
* @param name
|
|
19
|
-
* @param email
|
|
20
|
-
* @param password
|
|
21
|
-
* @returns Bearer Token
|
|
22
|
-
*/
|
|
23
|
-
register: (name: string, email: string, password: string) => Promise<User>;
|
|
24
|
-
/**
|
|
25
|
-
* Authenticate against the identity provider with a given email and password.
|
|
26
|
-
* @param email
|
|
27
|
-
* @param password
|
|
28
|
-
* @returns Bearer Token
|
|
29
|
-
*/
|
|
30
|
-
authenticate: (email: string, password: string) => Promise<Token>;
|
|
31
|
-
/**
|
|
32
|
-
* authenticateReturnUser against the identity provider with a given email and password.
|
|
33
|
-
* @param email
|
|
34
|
-
* @param password
|
|
35
|
-
* @returns User object
|
|
36
|
-
*/
|
|
37
|
-
authenticateReturnUser: (email: string, password: string) => Promise<User>;
|
|
38
|
-
private getEndpoint;
|
|
39
|
-
}
|
package/lib/service/IDP.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const base_1 = require("../base");
|
|
13
|
-
const axios_1 = require("axios");
|
|
14
|
-
class IDP extends base_1.default {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
/**
|
|
18
|
-
* Version requests the endpoint version
|
|
19
|
-
* @returns Version object
|
|
20
|
-
*/
|
|
21
|
-
this.version = () => __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
const resp = yield axios_1.default.get(this.getEndpoint("/v1/version"), {}).catch((err) => {
|
|
23
|
-
throw err;
|
|
24
|
-
});
|
|
25
|
-
return resp.data;
|
|
26
|
-
});
|
|
27
|
-
/**
|
|
28
|
-
* Authorize validates a token
|
|
29
|
-
* @param token
|
|
30
|
-
* @returns User object
|
|
31
|
-
*/
|
|
32
|
-
this.authorize = () => __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const resp = yield axios_1.default.get(this.getEndpoint("/v1/authorize"), {}).catch((err) => {
|
|
34
|
-
throw err;
|
|
35
|
-
});
|
|
36
|
-
return resp.data;
|
|
37
|
-
});
|
|
38
|
-
/**
|
|
39
|
-
* Register against the identity provider
|
|
40
|
-
* @param name
|
|
41
|
-
* @param email
|
|
42
|
-
* @param password
|
|
43
|
-
* @returns Bearer Token
|
|
44
|
-
*/
|
|
45
|
-
this.register = (name, email, password) => __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
const resp = yield axios_1.default
|
|
47
|
-
.post(this.getEndpoint("/v1/registration"), { name: name, email: email, password: password })
|
|
48
|
-
.catch((err) => {
|
|
49
|
-
throw err;
|
|
50
|
-
});
|
|
51
|
-
return resp.data;
|
|
52
|
-
});
|
|
53
|
-
/**
|
|
54
|
-
* Authenticate against the identity provider with a given email and password.
|
|
55
|
-
* @param email
|
|
56
|
-
* @param password
|
|
57
|
-
* @returns Bearer Token
|
|
58
|
-
*/
|
|
59
|
-
this.authenticate = (email, password) => __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
const resp = yield axios_1.default.post(this.getEndpoint("/v1/authenticate"), { email: email, password: password }).catch((err) => {
|
|
61
|
-
throw err;
|
|
62
|
-
});
|
|
63
|
-
// tslint-disable: no-string-literal
|
|
64
|
-
const token = { token: resp.headers.authorization };
|
|
65
|
-
return token;
|
|
66
|
-
});
|
|
67
|
-
/**
|
|
68
|
-
* authenticateReturnUser against the identity provider with a given email and password.
|
|
69
|
-
* @param email
|
|
70
|
-
* @param password
|
|
71
|
-
* @returns User object
|
|
72
|
-
*/
|
|
73
|
-
this.authenticateReturnUser = (email, password) => __awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
const resp = yield axios_1.default.post(this.getEndpoint("/v1/authenticate"), { email: email, password: password }).catch((err) => {
|
|
75
|
-
throw err;
|
|
76
|
-
});
|
|
77
|
-
return resp.data;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
getEndpoint(endpoint) {
|
|
81
|
-
return `${this.opts.api}/api/account${endpoint}`;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
exports.default = IDP;
|
package/lib/service/Mailer.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import base, { Options } from "../base";
|
|
2
|
-
import { Version } from "../interfaces/Global";
|
|
3
|
-
import MailerInternal from "./MailerInternal";
|
|
4
|
-
export default class Mailer extends base {
|
|
5
|
-
interal: MailerInternal;
|
|
6
|
-
constructor(opts: Options);
|
|
7
|
-
/**
|
|
8
|
-
* Version requests the endpoint version
|
|
9
|
-
* @returns Version object
|
|
10
|
-
*/
|
|
11
|
-
version: () => Promise<Version>;
|
|
12
|
-
private getEndpoint;
|
|
13
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import base from "../base";
|
|
2
|
-
import { HtmlMail, MustacheMail, TemplateMail } from "../interfaces/Mail";
|
|
3
|
-
export default class MailerInternal extends base {
|
|
4
|
-
/**
|
|
5
|
-
* sendMailMustache sends a new mail based on a mustache html body
|
|
6
|
-
*
|
|
7
|
-
* THIS ENDPOINT WORKS INTERNALLY ONLY
|
|
8
|
-
*
|
|
9
|
-
* CAN ONLY BE USED FROM BACKENDS WITHIN THE hcloud DEPLOYMENT AS THE ENDPOINT IS NOT PUBLICLY EXPOSED
|
|
10
|
-
* @param mail TemplateMail
|
|
11
|
-
*/
|
|
12
|
-
sendMailMustache: (mail: MustacheMail) => Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* sendMailHtml sends a new mail based on a html body
|
|
15
|
-
*
|
|
16
|
-
* THIS ENDPOINT WORKS INTERNALLY ONLY
|
|
17
|
-
*
|
|
18
|
-
* CAN ONLY BE USED FROM BACKENDS WITHIN THE hcloud DEPLOYMENT AS THE ENDPOINT IS NOT PUBLICLY EXPOSED
|
|
19
|
-
* @param mail TemplateMail
|
|
20
|
-
*/
|
|
21
|
-
sendMailHtml: (mail: HtmlMail) => Promise<void>;
|
|
22
|
-
/**
|
|
23
|
-
* sendMailTemplate sends a new mail based on an existing template
|
|
24
|
-
*
|
|
25
|
-
* THIS ENDPOINT WORKS INTERNALLY ONLY
|
|
26
|
-
*
|
|
27
|
-
* CAN ONLY BE USED FROM BACKENDS WITHIN THE hcloud DEPLOYMENT AS THE ENDPOINT IS NOT PUBLICLY EXPOSED
|
|
28
|
-
* @param mail TemplateMail
|
|
29
|
-
*/
|
|
30
|
-
sendMailTemplate: (mail: TemplateMail) => Promise<void>;
|
|
31
|
-
private getEndpoint;
|
|
32
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const base_1 = require("../base");
|
|
13
|
-
const axios_1 = require("axios");
|
|
14
|
-
class MailerInternal extends base_1.default {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
/**
|
|
18
|
-
* sendMailMustache sends a new mail based on a mustache html body
|
|
19
|
-
*
|
|
20
|
-
* THIS ENDPOINT WORKS INTERNALLY ONLY
|
|
21
|
-
*
|
|
22
|
-
* CAN ONLY BE USED FROM BACKENDS WITHIN THE hcloud DEPLOYMENT AS THE ENDPOINT IS NOT PUBLICLY EXPOSED
|
|
23
|
-
* @param mail TemplateMail
|
|
24
|
-
*/
|
|
25
|
-
this.sendMailMustache = (mail) => __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
const resp = yield axios_1.default.post(this.getEndpoint("/v1/send/mustache"), mail).catch((err) => {
|
|
27
|
-
throw err;
|
|
28
|
-
});
|
|
29
|
-
return resp.data;
|
|
30
|
-
});
|
|
31
|
-
/**
|
|
32
|
-
* sendMailHtml sends a new mail based on a html body
|
|
33
|
-
*
|
|
34
|
-
* THIS ENDPOINT WORKS INTERNALLY ONLY
|
|
35
|
-
*
|
|
36
|
-
* CAN ONLY BE USED FROM BACKENDS WITHIN THE hcloud DEPLOYMENT AS THE ENDPOINT IS NOT PUBLICLY EXPOSED
|
|
37
|
-
* @param mail TemplateMail
|
|
38
|
-
*/
|
|
39
|
-
this.sendMailHtml = (mail) => __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
const resp = yield axios_1.default.post(this.getEndpoint("/v1/send/html"), mail).catch((err) => {
|
|
41
|
-
throw err;
|
|
42
|
-
});
|
|
43
|
-
return resp.data;
|
|
44
|
-
});
|
|
45
|
-
/**
|
|
46
|
-
* sendMailTemplate sends a new mail based on an existing template
|
|
47
|
-
*
|
|
48
|
-
* THIS ENDPOINT WORKS INTERNALLY ONLY
|
|
49
|
-
*
|
|
50
|
-
* CAN ONLY BE USED FROM BACKENDS WITHIN THE hcloud DEPLOYMENT AS THE ENDPOINT IS NOT PUBLICLY EXPOSED
|
|
51
|
-
* @param mail TemplateMail
|
|
52
|
-
*/
|
|
53
|
-
this.sendMailTemplate = (mail) => __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
const resp = yield axios_1.default.post(this.getEndpoint("/v1/send/template"), mail).catch((err) => {
|
|
55
|
-
throw err;
|
|
56
|
-
});
|
|
57
|
-
return resp.data;
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
getEndpoint(endpoint) {
|
|
61
|
-
return `${this.opts.api}/api/mailer/internal${endpoint}`;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.default = MailerInternal;
|
|
File without changes
|
|
File without changes
|