hcloud-sdk 16.0.0 → 18.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/changelog.md +178 -51
- package/lib/Base.d.ts +2 -1
- package/lib/Hcloud.d.ts +6 -0
- package/lib/Hcloud.js +18 -0
- package/lib/helper/ValidationHelper.d.ts +74 -0
- package/lib/helper/ValidationHelper.js +360 -0
- package/lib/interfaces/auditor/index.d.ts +17 -2
- package/lib/interfaces/auditor/index.js +12 -0
- package/lib/interfaces/cosmo/asset/index.d.ts +185 -0
- package/lib/interfaces/cosmo/asset/index.js +82 -0
- package/lib/interfaces/cosmo/comment/index.d.ts +38 -0
- package/lib/interfaces/cosmo/comment/index.js +8 -0
- package/lib/interfaces/cosmo/event/index.d.ts +31 -0
- package/lib/interfaces/cosmo/event/index.js +17 -0
- package/lib/interfaces/cosmo/location/index.d.ts +4 -0
- package/lib/interfaces/cosmo/location/index.js +2 -0
- package/lib/interfaces/cosmo/namespace/index.d.ts +9 -0
- package/lib/interfaces/cosmo/namespace/index.js +9 -0
- package/lib/interfaces/cosmo/permissions.d.ts +96 -0
- package/lib/interfaces/cosmo/permissions.js +58 -0
- package/lib/interfaces/cosmo/share/index.d.ts +28 -0
- package/lib/interfaces/cosmo/share/index.js +2 -0
- package/lib/interfaces/cosmo/space/index.d.ts +25 -0
- package/lib/interfaces/cosmo/space/index.js +2 -0
- package/lib/interfaces/cosmo/tag/tag.d.ts +12 -0
- package/lib/interfaces/cosmo/tag/tag.js +2 -0
- package/lib/interfaces/frontend/config/index.d.ts +1 -0
- package/lib/interfaces/fuse/space/index.d.ts +1 -0
- package/lib/interfaces/global/Products.d.ts +3 -1
- package/lib/interfaces/global/Products.js +2 -0
- package/lib/interfaces/global/Views.d.ts +2 -1
- package/lib/interfaces/global/Views.js +1 -0
- package/lib/interfaces/high5/execution/index.d.ts +23 -2
- package/lib/interfaces/high5/execution/index.js +2 -0
- package/lib/interfaces/high5/index.d.ts +7 -7
- package/lib/interfaces/high5/index.js +7 -7
- package/lib/interfaces/high5/space/database/document/index.d.ts +34 -0
- package/lib/interfaces/high5/space/database/document/index.js +14 -0
- package/lib/interfaces/high5/space/database/index.d.ts +12 -0
- package/lib/interfaces/high5/space/database/index.js +2 -0
- package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +9 -2
- package/lib/interfaces/high5/space/event/stream/node/index.d.ts +10 -2
- package/lib/interfaces/high5/space/event/stream/node/index.js +6 -1
- package/lib/interfaces/high5/space/execution/index.d.ts +56 -2
- package/lib/interfaces/high5/space/execution/index.js +8 -0
- package/lib/interfaces/high5/space/index.d.ts +2 -0
- package/lib/interfaces/high5/space/job/JobLog.d.ts +16 -0
- package/lib/interfaces/high5/space/job/JobLog.js +2 -0
- package/lib/interfaces/high5/space/job/index.d.ts +38 -0
- package/lib/interfaces/high5/space/job/index.js +8 -0
- package/lib/interfaces/high5/space/pool/index.d.ts +5 -7
- package/lib/interfaces/high5/space/pool/index.js +0 -7
- package/lib/interfaces/high5/space/webhook/index.d.ts +3 -1
- package/lib/interfaces/high5/stats.d.ts +21 -0
- package/lib/interfaces/high5/stats.js +2 -0
- package/lib/interfaces/high5/wave/index.d.ts +8 -3
- package/lib/interfaces/idp/index.d.ts +1 -0
- package/lib/interfaces/idp/index.js +1 -0
- package/lib/interfaces/idp/oauth/index.d.ts +4 -3
- package/lib/interfaces/idp/organization/index.d.ts +1 -0
- package/lib/interfaces/idp/organization/index.js +1 -0
- package/lib/interfaces/idp/organization/license/index.d.ts +13 -0
- package/lib/interfaces/idp/organization/member/index.d.ts +2 -0
- package/lib/interfaces/idp/organization/service-accounts.d.ts +8 -0
- package/lib/interfaces/idp/organization/service-accounts.js +2 -0
- package/lib/interfaces/idp/organization/stats.d.ts +7 -0
- package/lib/interfaces/idp/organization/stats.js +2 -0
- package/lib/interfaces/idp/organization/team/index.d.ts +0 -1
- package/lib/interfaces/idp/user/GeneralSettings.d.ts +1 -0
- package/lib/interfaces/idp/user/GeneralSettings.js +1 -0
- package/lib/interfaces/idp/user/Message.d.ts +21 -0
- package/lib/interfaces/idp/user/Message.js +14 -0
- package/lib/interfaces/idp/user/NotificationSettings.d.ts +1 -0
- package/lib/interfaces/idp/user/Scopes.d.ts +8 -2
- package/lib/interfaces/idp/user/Scopes.js +9 -0
- package/lib/interfaces/idp/user/index.d.ts +2 -1
- package/lib/interfaces/mailer/index.d.ts +30 -1
- package/lib/interfaces/mailer/index.js +87 -1
- package/lib/interfaces/mothership/index.d.ts +3 -1
- package/lib/interfaces/mothership/index.js +15 -0
- package/lib/interfaces/mothership/stats.d.ts +4 -0
- package/lib/interfaces/mothership/stats.js +2 -0
- package/lib/interfaces/nats/index.d.ts +98 -9
- package/lib/interfaces/nats/index.js +136 -19
- package/lib/interfaces/shorts/index.d.ts +10 -0
- package/lib/interfaces/shorts/index.js +2 -0
- package/lib/service/agent/bundle/dev/index.d.ts +16 -6
- package/lib/service/agent/bundle/dev/index.js +12 -10
- package/lib/service/agent/bundle/index.d.ts +10 -4
- package/lib/service/agent/bundle/index.js +6 -6
- package/lib/service/agent/context/index.d.ts +26 -7
- package/lib/service/agent/context/index.js +27 -12
- package/lib/service/auditor/index.d.ts +8 -4
- package/lib/service/auditor/index.js +5 -5
- package/lib/service/auditor/internal/index.d.ts +27 -3
- package/lib/service/auditor/internal/index.js +34 -5
- package/lib/service/bouncer/features/index.d.ts +4 -2
- package/lib/service/bouncer/features/index.js +2 -2
- package/lib/service/cosmo/asset/index.d.ts +219 -0
- package/lib/service/cosmo/asset/index.js +314 -0
- package/lib/service/cosmo/comment/index.d.ts +122 -0
- package/lib/service/cosmo/comment/index.js +161 -0
- package/lib/service/cosmo/event/index.d.ts +23 -0
- package/lib/service/cosmo/event/index.js +40 -0
- package/lib/service/cosmo/folder/index.d.ts +27 -0
- package/lib/service/cosmo/folder/index.js +47 -0
- package/lib/service/cosmo/index.d.ts +49 -0
- package/lib/service/cosmo/index.js +119 -0
- package/lib/service/cosmo/internal/index.d.ts +7 -0
- package/lib/service/cosmo/internal/index.js +17 -0
- package/lib/service/cosmo/internal/space/index.d.ts +15 -0
- package/lib/service/cosmo/internal/space/index.js +34 -0
- package/lib/service/cosmo/location/index.d.ts +40 -0
- package/lib/service/cosmo/location/index.js +63 -0
- package/lib/service/cosmo/namespace/index.d.ts +42 -0
- package/lib/service/cosmo/namespace/index.js +65 -0
- package/lib/service/cosmo/organization/index.d.ts +47 -0
- package/lib/service/cosmo/organization/index.js +64 -0
- package/lib/service/cosmo/permissions/index.d.ts +131 -0
- package/lib/service/cosmo/permissions/index.js +181 -0
- package/lib/service/cosmo/production/index.d.ts +26 -0
- package/lib/service/cosmo/production/index.js +45 -0
- package/lib/service/cosmo/share/index.d.ts +161 -0
- package/lib/service/cosmo/share/index.js +215 -0
- package/lib/service/cosmo/space/index.d.ts +104 -0
- package/lib/service/cosmo/space/index.js +146 -0
- package/lib/service/cosmo/tag/index.d.ts +67 -0
- package/lib/service/cosmo/tag/index.js +93 -0
- package/lib/service/dali/DaliAvatar.d.ts +12 -0
- package/lib/service/dali/DaliAvatar.js +20 -0
- package/lib/service/dali/avatar/DaliCosmoSpace.d.ts +32 -0
- package/lib/service/dali/avatar/DaliCosmoSpace.js +59 -0
- package/lib/service/dali/avatar/DaliFuseSpace.d.ts +10 -4
- package/lib/service/dali/avatar/DaliFuseSpace.js +7 -6
- package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +10 -4
- package/lib/service/dali/avatar/DaliHigh5Pool.js +7 -6
- package/lib/service/dali/avatar/DaliHigh5Space.d.ts +10 -4
- package/lib/service/dali/avatar/DaliHigh5Space.js +7 -6
- package/lib/service/dali/avatar/DaliOAuthApp.d.ts +10 -4
- package/lib/service/dali/avatar/DaliOAuthApp.js +7 -6
- package/lib/service/dali/avatar/DaliOrganization.d.ts +10 -4
- package/lib/service/dali/avatar/DaliOrganization.js +7 -6
- package/lib/service/dali/avatar/DaliServiceAccount.d.ts +32 -0
- package/lib/service/dali/avatar/DaliServiceAccount.js +59 -0
- package/lib/service/dali/avatar/DaliTeam.d.ts +10 -4
- package/lib/service/dali/avatar/DaliTeam.js +7 -6
- package/lib/service/dali/avatar/DaliUser.d.ts +10 -4
- package/lib/service/dali/avatar/DaliUser.js +7 -6
- package/lib/service/dali/index.d.ts +4 -5
- package/lib/service/dali/index.js +2 -5
- package/lib/service/fuse/index.d.ts +4 -2
- package/lib/service/fuse/index.js +2 -2
- package/lib/service/fuse/internal/index.d.ts +4 -2
- package/lib/service/fuse/internal/index.js +3 -2
- package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +4 -2
- package/lib/service/fuse/internal/space/cronjob/log/index.js +2 -2
- package/lib/service/fuse/internal/space/index.d.ts +7 -3
- package/lib/service/fuse/internal/space/index.js +6 -4
- package/lib/service/fuse/space/cronjob/index.d.ts +35 -13
- package/lib/service/fuse/space/cronjob/index.js +48 -50
- package/lib/service/fuse/space/cronjob/log/index.d.ts +8 -4
- package/lib/service/fuse/space/cronjob/log/index.js +5 -5
- package/lib/service/fuse/space/index.d.ts +27 -11
- package/lib/service/fuse/space/index.js +19 -18
- package/lib/service/high5/execution/index.d.ts +4 -2
- package/lib/service/high5/execution/index.js +3 -2
- package/lib/service/high5/execution/status/index.d.ts +5 -3
- package/lib/service/high5/execution/status/index.js +3 -3
- package/lib/service/high5/index.d.ts +7 -2
- package/lib/service/high5/index.js +9 -2
- package/lib/service/high5/internal/index.d.ts +4 -2
- package/lib/service/high5/internal/index.js +3 -2
- package/lib/service/high5/internal/space/index.d.ts +10 -3
- package/lib/service/high5/internal/space/index.js +13 -4
- package/lib/service/high5/internal/space/job/index.d.ts +7 -0
- package/lib/service/high5/internal/space/job/index.js +17 -0
- package/lib/service/high5/internal/space/job/log/index.d.ts +17 -0
- package/lib/service/high5/internal/space/job/log/index.js +34 -0
- package/lib/service/high5/joinToken/index.d.ts +14 -6
- package/lib/service/high5/joinToken/index.js +10 -9
- package/lib/service/high5/space/database/document/array/index.d.ts +73 -0
- package/lib/service/high5/space/database/document/array/index.js +102 -0
- package/lib/service/high5/space/database/document/index.d.ts +74 -0
- package/lib/service/high5/space/database/document/index.js +112 -0
- package/lib/service/high5/space/database/document/number/index.d.ts +51 -0
- package/lib/service/high5/space/database/document/number/index.js +77 -0
- package/lib/service/high5/space/database/index.d.ts +65 -0
- package/lib/service/high5/space/database/index.js +102 -0
- package/lib/service/high5/space/event/index.d.ts +17 -7
- package/lib/service/high5/space/event/index.js +12 -11
- package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +4 -2
- package/lib/service/high5/space/event/stream/design/DesignOperations.js +5 -3
- package/lib/service/high5/space/event/stream/design/index.d.ts +10 -4
- package/lib/service/high5/space/event/stream/design/index.js +7 -6
- package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +16 -6
- package/lib/service/high5/space/event/stream/design/snapshot/index.js +12 -10
- package/lib/service/high5/space/event/stream/index.d.ts +32 -12
- package/lib/service/high5/space/event/stream/index.js +22 -21
- package/lib/service/high5/space/execution/index.d.ts +22 -7
- package/lib/service/high5/space/execution/index.js +23 -12
- package/lib/service/high5/space/execution/log/index.d.ts +8 -4
- package/lib/service/high5/space/execution/log/index.js +5 -5
- package/lib/service/high5/space/execution/status/index.d.ts +18 -7
- package/lib/service/high5/space/execution/status/index.js +20 -8
- package/lib/service/high5/space/index.d.ts +56 -18
- package/lib/service/high5/space/index.js +65 -27
- package/lib/service/high5/space/job/index.d.ts +145 -0
- package/lib/service/high5/space/job/index.js +201 -0
- package/lib/service/high5/space/job/log/index.d.ts +35 -0
- package/lib/service/high5/space/job/log/index.js +58 -0
- package/lib/service/high5/space/node/index.d.ts +20 -8
- package/lib/service/high5/space/node/index.js +14 -13
- package/lib/service/high5/space/pool/index.d.ts +27 -11
- package/lib/service/high5/space/pool/index.js +19 -18
- package/lib/service/high5/space/secret/index.d.ts +17 -7
- package/lib/service/high5/space/secret/index.js +12 -11
- package/lib/service/high5/space/stat/index.d.ts +12 -0
- package/lib/service/high5/space/stat/index.js +31 -0
- package/lib/service/high5/space/wave/index.d.ts +16 -6
- package/lib/service/high5/space/wave/index.js +11 -10
- package/lib/service/high5/space/webhook/index.d.ts +32 -12
- package/lib/service/high5/space/webhook/index.js +25 -21
- package/lib/service/high5/space/webhook/log/index.d.ts +4 -2
- package/lib/service/high5/space/webhook/log/index.js +2 -2
- package/lib/service/high5/stat/index.d.ts +11 -0
- package/lib/service/high5/stat/index.js +30 -0
- package/lib/service/high5/wave/s3/index.d.ts +31 -8
- package/lib/service/high5/wave/s3/index.js +52 -24
- package/lib/service/idp/guest/index.d.ts +42 -0
- package/lib/service/idp/guest/index.js +66 -0
- package/lib/service/idp/index.d.ts +25 -7
- package/lib/service/idp/index.js +23 -12
- package/lib/service/idp/internal/index.d.ts +5 -3
- package/lib/service/idp/internal/index.js +5 -3
- package/lib/service/idp/oauth/index.d.ts +16 -6
- package/lib/service/idp/oauth/index.js +15 -15
- package/lib/service/idp/organization/index.d.ts +25 -5
- package/lib/service/idp/organization/index.js +29 -8
- package/lib/service/idp/organization/license/index.d.ts +7 -3
- package/lib/service/idp/organization/license/index.js +4 -4
- package/lib/service/idp/organization/member/index.d.ts +21 -8
- package/lib/service/idp/organization/member/index.js +16 -13
- package/lib/service/idp/organization/member/invitations/index.d.ts +23 -9
- package/lib/service/idp/organization/member/invitations/index.js +72 -59
- package/lib/service/idp/organization/service-accounts/index.d.ts +76 -0
- package/lib/service/idp/organization/service-accounts/index.js +109 -0
- package/lib/service/idp/organization/settings/domain/index.d.ts +13 -5
- package/lib/service/idp/organization/settings/domain/index.js +9 -8
- package/lib/service/idp/organization/settings/domain/saml/index.d.ts +16 -6
- package/lib/service/idp/organization/settings/domain/saml/index.js +19 -18
- package/lib/service/idp/organization/settings/oauth/index.d.ts +23 -9
- package/lib/service/idp/organization/settings/oauth/index.js +16 -15
- package/lib/service/idp/organization/stat/index.d.ts +11 -0
- package/lib/service/idp/organization/stat/index.js +30 -0
- package/lib/service/idp/organization/team/index.d.ts +22 -10
- package/lib/service/idp/organization/team/index.js +14 -13
- package/lib/service/idp/registration/index.d.ts +10 -4
- package/lib/service/idp/registration/index.js +15 -9
- package/lib/service/idp/user/index.d.ts +33 -11
- package/lib/service/idp/user/index.js +30 -16
- package/lib/service/idp/user/license/index.d.ts +7 -3
- package/lib/service/idp/user/license/index.js +4 -4
- package/lib/service/idp/user/message/index.d.ts +61 -0
- package/lib/service/idp/user/message/index.js +92 -0
- package/lib/service/idp/user/password/index.d.ts +4 -2
- package/lib/service/idp/user/password/index.js +3 -3
- package/lib/service/idp/user/settings/connections/index.d.ts +4 -2
- package/lib/service/idp/user/settings/connections/index.js +2 -2
- package/lib/service/idp/user/settings/general/index.d.ts +10 -4
- package/lib/service/idp/user/settings/general/index.js +6 -6
- package/lib/service/idp/user/settings/notifications/index.d.ts +7 -3
- package/lib/service/idp/user/settings/notifications/index.js +4 -4
- package/lib/service/idp/user/settings/oauthApps/index.d.ts +7 -3
- package/lib/service/idp/user/settings/oauthApps/index.js +6 -5
- package/lib/service/idp/user/settings/pats/index.d.ts +22 -8
- package/lib/service/idp/user/settings/pats/index.js +17 -15
- package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +16 -6
- package/lib/service/idp/user/settings/twoFactor/totp/index.js +13 -10
- package/lib/service/mailer/index.d.ts +4 -2
- package/lib/service/mailer/index.js +2 -2
- package/lib/service/mailer/internal/index.d.ts +13 -5
- package/lib/service/mailer/internal/index.js +8 -8
- package/lib/service/mothership/index.d.ts +35 -13
- package/lib/service/mothership/index.js +32 -18
- package/lib/service/nats/index.js +58 -44
- package/lib/service/shorts/index.d.ts +18 -0
- package/lib/service/shorts/index.js +38 -0
- package/lib/service/shorts/internal/index.d.ts +72 -0
- package/lib/service/shorts/internal/index.js +104 -0
- package/lib/utils/bouncer/features/Provider.js +0 -3
- package/package.json +22 -24
|
@@ -31,14 +31,14 @@ class High5Webhook extends Base_1.default {
|
|
|
31
31
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
32
32
|
* @returns Object containing an array of Webhooks and the total number of results found in the database (independent of limit and page)
|
|
33
33
|
*/
|
|
34
|
-
searchWebhooks(_a) {
|
|
35
|
-
return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0,
|
|
34
|
+
searchWebhooks(_a, raw_1) {
|
|
35
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0 }, raw) {
|
|
36
36
|
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
|
|
37
37
|
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/webhooks/search?limit=${limit}&page=${page}`), {
|
|
38
38
|
filters: filtersDTO,
|
|
39
39
|
sorting: sorting,
|
|
40
40
|
});
|
|
41
|
-
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
41
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
@@ -48,10 +48,10 @@ class High5Webhook extends Base_1.default {
|
|
|
48
48
|
* @param webhookId ID of the Webhook
|
|
49
49
|
* @returns The requested Webhook
|
|
50
50
|
*/
|
|
51
|
-
getWebhook(orgName, spaceName, webhookId) {
|
|
51
|
+
getWebhook(orgName, spaceName, webhookId, raw) {
|
|
52
52
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
53
|
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/webhooks/${webhookId}`));
|
|
54
|
-
return resp.data;
|
|
54
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
@@ -61,10 +61,10 @@ class High5Webhook extends Base_1.default {
|
|
|
61
61
|
* @param webhookId ID of the Webhook
|
|
62
62
|
* @returns The updated Webhook
|
|
63
63
|
*/
|
|
64
|
-
regenerateWebhookUrl(orgName, spaceName, webhookId) {
|
|
64
|
+
regenerateWebhookUrl(orgName, spaceName, webhookId, raw) {
|
|
65
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
66
|
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/webhooks/${webhookId}/regenerateUrl`));
|
|
67
|
-
return resp.data;
|
|
67
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
@@ -74,10 +74,10 @@ class High5Webhook extends Base_1.default {
|
|
|
74
74
|
* @param WebhookCreate Object/JSON containing the name, token, eventId, spaceId, target and (optionally) security headers for the new webhook
|
|
75
75
|
* @returns The created Webhook
|
|
76
76
|
*/
|
|
77
|
-
createWebhook(orgName, spaceName, WebhookCreate) {
|
|
77
|
+
createWebhook(orgName, spaceName, WebhookCreate, raw) {
|
|
78
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
79
|
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/webhooks`), WebhookCreate);
|
|
80
|
-
return resp.data;
|
|
80
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
@@ -88,10 +88,10 @@ class High5Webhook extends Base_1.default {
|
|
|
88
88
|
* @param WebhookCreate Object/JSON containing the name, token, eventId, spaceId, target and (optionally) security headers for the updated webhook
|
|
89
89
|
* @returns the updated Webhook
|
|
90
90
|
*/
|
|
91
|
-
updateWebhook(orgName, spaceName, webhookId, webhookUpdate) {
|
|
91
|
+
updateWebhook(orgName, spaceName, webhookId, webhookUpdate, raw) {
|
|
92
92
|
return __awaiter(this, void 0, void 0, function* () {
|
|
93
93
|
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/webhooks/${webhookId}`), webhookUpdate);
|
|
94
|
-
return resp.data;
|
|
94
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
@@ -100,18 +100,20 @@ class High5Webhook extends Base_1.default {
|
|
|
100
100
|
* @param spaceName Name of the Space
|
|
101
101
|
* @param webhookId ID of the webhook to be deleted
|
|
102
102
|
*/
|
|
103
|
-
deleteWebhook(orgName, spaceName, webhookId) {
|
|
103
|
+
deleteWebhook(orgName, spaceName, webhookId, raw) {
|
|
104
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
-
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/webhooks/${webhookId}`));
|
|
105
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/webhooks/${webhookId}`));
|
|
106
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
106
107
|
});
|
|
107
108
|
}
|
|
108
109
|
/**
|
|
109
110
|
* Executes all Events and Streams connected to the specified Webhook.
|
|
110
111
|
* @param webhookUrl URL of the webhook to be triggered / executed
|
|
111
112
|
*/
|
|
112
|
-
triggerWebhook(webhookUrl) {
|
|
113
|
+
triggerWebhook(webhookUrl, raw) {
|
|
113
114
|
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
-
yield this.axios.post(this.getEndpoint(webhookUrl));
|
|
115
|
+
const resp = yield this.axios.post(this.getEndpoint(webhookUrl));
|
|
116
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
115
117
|
});
|
|
116
118
|
}
|
|
117
119
|
/**
|
|
@@ -120,7 +122,7 @@ class High5Webhook extends Base_1.default {
|
|
|
120
122
|
* @param payload Payload to be used in the event execution that will be triggered by the webhook, as JSON.
|
|
121
123
|
* @param headers (optional) Security headers.
|
|
122
124
|
*/
|
|
123
|
-
executeWebhookByUrl(webhookUrl, payload, headers) {
|
|
125
|
+
executeWebhookByUrl(webhookUrl, payload, headers, raw) {
|
|
124
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
125
127
|
const h = {};
|
|
126
128
|
if (headers) {
|
|
@@ -128,9 +130,10 @@ class High5Webhook extends Base_1.default {
|
|
|
128
130
|
h[key] = headers[key];
|
|
129
131
|
});
|
|
130
132
|
}
|
|
131
|
-
yield this.axios.post(this.getEndpoint(webhookUrl), payload, {
|
|
133
|
+
const resp = yield this.axios.post(this.getEndpoint(webhookUrl), payload, {
|
|
132
134
|
headers: h,
|
|
133
135
|
});
|
|
136
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
134
137
|
});
|
|
135
138
|
}
|
|
136
139
|
/**
|
|
@@ -140,10 +143,11 @@ class High5Webhook extends Base_1.default {
|
|
|
140
143
|
* @param headers (optional) HTTP headers to send in the response
|
|
141
144
|
* @param body (optional) Body to send in the HTTP response
|
|
142
145
|
*/
|
|
143
|
-
respondToWebhook(callbackURL, status, headers, body) {
|
|
146
|
+
respondToWebhook(callbackURL, status, headers, body, raw) {
|
|
144
147
|
return __awaiter(this, void 0, void 0, function* () {
|
|
145
148
|
const url = callbackURL.startsWith("http") ? callbackURL : this.getEndpoint(callbackURL);
|
|
146
|
-
yield this.axios.post(url, { status, headers: headers !== null && headers !== void 0 ? headers : {}, body }, { headers: { "Content-Type": "application/json" } });
|
|
149
|
+
const resp = yield this.axios.post(url, { status, headers: headers !== null && headers !== void 0 ? headers : {}, body }, { headers: { "Content-Type": "application/json" } });
|
|
150
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
147
151
|
});
|
|
148
152
|
}
|
|
149
153
|
/**
|
|
@@ -152,10 +156,10 @@ class High5Webhook extends Base_1.default {
|
|
|
152
156
|
* @param challenge String to be returned
|
|
153
157
|
* @returns The provided challenge string as plaint text
|
|
154
158
|
*/
|
|
155
|
-
validateWebhookUrl(webhookUrl, challenge) {
|
|
159
|
+
validateWebhookUrl(webhookUrl, challenge, raw) {
|
|
156
160
|
return __awaiter(this, void 0, void 0, function* () {
|
|
157
161
|
const resp = yield this.axios.get(this.getEndpoint(`${webhookUrl}?challenge=${challenge}`));
|
|
158
|
-
return resp.data;
|
|
162
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
159
163
|
});
|
|
160
164
|
}
|
|
161
165
|
getEndpoint(endpoint) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Base from "../../../../../Base";
|
|
1
|
+
import Base, { MaybeRaw } from "../../../../../Base";
|
|
2
2
|
import { PaginatedResponse } from "../../../../../interfaces/global";
|
|
3
3
|
import { WebhookLog } from "../../../../../interfaces/high5/space/webhook";
|
|
4
4
|
export declare class High5WebhookLog extends Base {
|
|
@@ -11,6 +11,8 @@ export declare class High5WebhookLog extends Base {
|
|
|
11
11
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
12
12
|
* @returns Object containing an array of Webhook logs and the total number of results found in the database (independent of limit and page)
|
|
13
13
|
*/
|
|
14
|
-
getWebhookLogs(orgName: string, spaceName: string, webhookId: string, limit?: number, page?: number
|
|
14
|
+
getWebhookLogs<R extends boolean = false>(orgName: string, spaceName: string, webhookId: string, limit?: number, page?: number, raw?: {
|
|
15
|
+
raw: R;
|
|
16
|
+
}): Promise<MaybeRaw<R, PaginatedResponse<WebhookLog>>>;
|
|
15
17
|
protected getEndpoint(endpoint: string): string;
|
|
16
18
|
}
|
|
@@ -22,12 +22,12 @@ class High5WebhookLog extends Base_1.default {
|
|
|
22
22
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
23
23
|
* @returns Object containing an array of Webhook logs and the total number of results found in the database (independent of limit and page)
|
|
24
24
|
*/
|
|
25
|
-
getWebhookLogs(orgName, spaceName, webhookId, limit, page) {
|
|
25
|
+
getWebhookLogs(orgName, spaceName, webhookId, limit, page, raw) {
|
|
26
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
27
|
limit = limit || 25;
|
|
28
28
|
page = page || 0;
|
|
29
29
|
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/webhooks/${webhookId}/logs?limit=${limit}&page=${page}`));
|
|
30
|
-
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
30
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
getEndpoint(endpoint) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Base from "../../../Base";
|
|
2
|
+
import { Stats } from "../../../interfaces/high5/stats";
|
|
3
|
+
export declare class High5OrgStat extends Base {
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves usage statistics for a specific organization.
|
|
6
|
+
* @param orgName Name of the organization
|
|
7
|
+
* @returns Statistics information
|
|
8
|
+
*/
|
|
9
|
+
getStats(orgName: string): Promise<Stats>;
|
|
10
|
+
protected getEndpoint(endpoint: string): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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.High5OrgStat = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
class High5OrgStat extends Base_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves usage statistics for a specific organization.
|
|
17
|
+
* @param orgName Name of the organization
|
|
18
|
+
* @returns Statistics information
|
|
19
|
+
*/
|
|
20
|
+
getStats(orgName) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const resp = yield this.axios.get(this.getEndpoint(`/org/${orgName}/stats`));
|
|
23
|
+
return resp.data;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
getEndpoint(endpoint) {
|
|
27
|
+
return `${this.options.server}/api/high5/v1${endpoint}`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.High5OrgStat = High5OrgStat;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
|
-
import Base, { Options } from "../../../../Base";
|
|
2
|
+
import Base, { MaybeRaw, Options } from "../../../../Base";
|
|
3
3
|
import { Catalog, CatalogRegistry, Engine, EngineRegistry, StreamNodeSpecifications, StreamNodeSpecificationWrappedWithEngineVersion, WildcardRegistry } from "../../../../interfaces/high5";
|
|
4
|
+
import { Release } from "../../../../interfaces/high5/wave/changelog";
|
|
4
5
|
/**
|
|
5
6
|
* Class for reading the S3 bucket of a wave engine and catalogs
|
|
6
7
|
*/
|
|
@@ -11,45 +12,67 @@ export declare class S3 extends Base {
|
|
|
11
12
|
* @param waveBucketUrl Public base url to S3 bucket
|
|
12
13
|
* @returns registry.json
|
|
13
14
|
*/
|
|
14
|
-
getCatalogRegistry(waveBucketUrl: string
|
|
15
|
+
getCatalogRegistry<R extends boolean = false>(waveBucketUrl: string, raw?: {
|
|
16
|
+
raw: R;
|
|
17
|
+
}): Promise<MaybeRaw<R, CatalogRegistry>>;
|
|
15
18
|
/**
|
|
16
19
|
* Get the registry.json of the default wave engine from the S3 bucket
|
|
17
20
|
* @param waveBucketUrl Public base url to S3 bucket
|
|
18
21
|
* @returns registry.json
|
|
19
22
|
*/
|
|
20
|
-
getEngineRegistry(waveBucketUrl: string
|
|
23
|
+
getEngineRegistry<R extends boolean = false>(waveBucketUrl: string, raw?: {
|
|
24
|
+
raw: R;
|
|
25
|
+
}): Promise<MaybeRaw<R, EngineRegistry>>;
|
|
21
26
|
/**
|
|
22
27
|
* Get the catalog.json from the S3 bucket
|
|
23
28
|
* @param catalogUrl Public url of the catalog
|
|
24
29
|
* @returns index.json of catalog
|
|
25
30
|
*/
|
|
26
|
-
getCatalog(catalogUrl: string
|
|
31
|
+
getCatalog<R extends boolean = false>(catalogUrl: string, raw?: {
|
|
32
|
+
raw: R;
|
|
33
|
+
}): Promise<MaybeRaw<R, Catalog>>;
|
|
27
34
|
/**
|
|
28
35
|
* Get the catalog.json from the S3 bucket
|
|
29
36
|
* @param catalogUrl Public url of the catalog
|
|
30
37
|
* @returns index.json of catalog
|
|
31
38
|
*/
|
|
32
|
-
getEngine(engineUrl: string
|
|
39
|
+
getEngine<R extends boolean = false>(engineUrl: string, raw?: {
|
|
40
|
+
raw: R;
|
|
41
|
+
}): Promise<MaybeRaw<R, Engine>>;
|
|
33
42
|
/**
|
|
34
43
|
* Get a list of available wildcards of a specific engine version from the S3 bucket
|
|
35
44
|
* @param engineUrl Public url of the engine
|
|
36
45
|
* @param engineVersion Version of the enigne
|
|
37
46
|
* @returns Wildcards.json list of available wildcards
|
|
38
47
|
*/
|
|
39
|
-
getWildcardsOfEngine(engineUrl: string, engineVersion: string
|
|
48
|
+
getWildcardsOfEngine<R extends boolean = false>(engineUrl: string, engineVersion: string, raw?: {
|
|
49
|
+
raw: R;
|
|
50
|
+
}): Promise<MaybeRaw<R, WildcardRegistry>>;
|
|
40
51
|
/**
|
|
41
52
|
* Get the node specifications of all nodes of a specific catalog version from the S3 bucket
|
|
42
53
|
* @param catalogUrl Public url of the catalog
|
|
43
54
|
* @param version The catalog version
|
|
44
55
|
* @returns StreamNodeSpecification[] | StreamNodeSpecificationWrappedWithEngineVersion an array of all node specification of that catalog version, maybe wrapped in an object with the engine version
|
|
45
56
|
*/
|
|
46
|
-
getCatalogVersion(catalogUrl: string, version: string
|
|
57
|
+
getCatalogVersion<R extends boolean = false>(catalogUrl: string, version: string, raw?: {
|
|
58
|
+
raw: R;
|
|
59
|
+
}): Promise<MaybeRaw<R, StreamNodeSpecifications[] | StreamNodeSpecificationWrappedWithEngineVersion>>;
|
|
47
60
|
/**
|
|
48
61
|
* Get the node documentation from the S3 bucket
|
|
49
62
|
* @param catalogUrl Public url of the catalog
|
|
50
63
|
* @param version The catalog version
|
|
51
64
|
* @returns string the markdown documentation of the node
|
|
52
65
|
*/
|
|
53
|
-
getNodeDocumentation(catalogUrl: string, version: string, nodeName: string
|
|
66
|
+
getNodeDocumentation<R extends boolean = false>(catalogUrl: string, version: string, nodeName: string, raw?: {
|
|
67
|
+
raw: R;
|
|
68
|
+
}): Promise<MaybeRaw<R, string>>;
|
|
69
|
+
/**
|
|
70
|
+
* Get the catalogs changelog from the S3 bucket
|
|
71
|
+
* @param catalogUrl Public url of the catalog
|
|
72
|
+
* @returns string the changelog.json of the node
|
|
73
|
+
*/
|
|
74
|
+
getChangelog<R extends boolean = false>(catalogUrl: string, raw?: {
|
|
75
|
+
raw: R;
|
|
76
|
+
}): Promise<MaybeRaw<R, Release[]>>;
|
|
54
77
|
protected getEndpoint(): string;
|
|
55
78
|
}
|
|
@@ -10,8 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.S3 = void 0;
|
|
13
|
+
const axios_1 = require("axios");
|
|
14
|
+
const package_json_1 = require("../../../../../package.json");
|
|
13
15
|
const Base_1 = require("../../../../Base");
|
|
14
|
-
const
|
|
16
|
+
const axios_2 = require("../../../../interfaces/axios");
|
|
17
|
+
const sdkVersion = "hcloud-sdk-js/v" + package_json_1.version;
|
|
15
18
|
/**
|
|
16
19
|
* Class for reading the S3 bucket of a wave engine and catalogs
|
|
17
20
|
*/
|
|
@@ -24,10 +27,12 @@ class S3 extends Base_1.default {
|
|
|
24
27
|
* @param waveBucketUrl Public base url to S3 bucket
|
|
25
28
|
* @returns registry.json
|
|
26
29
|
*/
|
|
27
|
-
getCatalogRegistry(waveBucketUrl) {
|
|
30
|
+
getCatalogRegistry(waveBucketUrl, raw) {
|
|
28
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
const resp = yield
|
|
30
|
-
|
|
32
|
+
const resp = yield axios_1.default.get(`${waveBucketUrl}/catalogs/registry.json`, {
|
|
33
|
+
headers: Object.assign(Object.assign({}, axios_2.disableCacheHeaders), { "x-hcloud-user-agent": sdkVersion, Authorization: undefined }),
|
|
34
|
+
});
|
|
35
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
31
36
|
});
|
|
32
37
|
}
|
|
33
38
|
/**
|
|
@@ -35,10 +40,12 @@ class S3 extends Base_1.default {
|
|
|
35
40
|
* @param waveBucketUrl Public base url to S3 bucket
|
|
36
41
|
* @returns registry.json
|
|
37
42
|
*/
|
|
38
|
-
getEngineRegistry(waveBucketUrl) {
|
|
43
|
+
getEngineRegistry(waveBucketUrl, raw) {
|
|
39
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
const resp = yield
|
|
41
|
-
|
|
45
|
+
const resp = yield axios_1.default.get(`${waveBucketUrl}/engines/registry.json`, {
|
|
46
|
+
headers: Object.assign(Object.assign({}, axios_2.disableCacheHeaders), { "x-hcloud-user-agent": sdkVersion, Authorization: undefined }),
|
|
47
|
+
});
|
|
48
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
42
49
|
});
|
|
43
50
|
}
|
|
44
51
|
/**
|
|
@@ -46,10 +53,12 @@ class S3 extends Base_1.default {
|
|
|
46
53
|
* @param catalogUrl Public url of the catalog
|
|
47
54
|
* @returns index.json of catalog
|
|
48
55
|
*/
|
|
49
|
-
getCatalog(catalogUrl) {
|
|
56
|
+
getCatalog(catalogUrl, raw) {
|
|
50
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
const resp = yield
|
|
52
|
-
|
|
58
|
+
const resp = yield axios_1.default.get(`${catalogUrl}`, {
|
|
59
|
+
headers: Object.assign(Object.assign({}, axios_2.disableCacheHeaders), { "x-hcloud-user-agent": sdkVersion, Authorization: undefined }),
|
|
60
|
+
});
|
|
61
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
53
62
|
});
|
|
54
63
|
}
|
|
55
64
|
/**
|
|
@@ -57,10 +66,12 @@ class S3 extends Base_1.default {
|
|
|
57
66
|
* @param catalogUrl Public url of the catalog
|
|
58
67
|
* @returns index.json of catalog
|
|
59
68
|
*/
|
|
60
|
-
getEngine(engineUrl) {
|
|
69
|
+
getEngine(engineUrl, raw) {
|
|
61
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
const resp = yield
|
|
63
|
-
|
|
71
|
+
const resp = yield axios_1.default.get(`${engineUrl}`, {
|
|
72
|
+
headers: Object.assign(Object.assign({}, axios_2.disableCacheHeaders), { "x-hcloud-user-agent": sdkVersion, Authorization: undefined }),
|
|
73
|
+
});
|
|
74
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
64
75
|
});
|
|
65
76
|
}
|
|
66
77
|
/**
|
|
@@ -69,12 +80,12 @@ class S3 extends Base_1.default {
|
|
|
69
80
|
* @param engineVersion Version of the enigne
|
|
70
81
|
* @returns Wildcards.json list of available wildcards
|
|
71
82
|
*/
|
|
72
|
-
getWildcardsOfEngine(engineUrl, engineVersion) {
|
|
83
|
+
getWildcardsOfEngine(engineUrl, engineVersion, raw) {
|
|
73
84
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
const resp = yield
|
|
75
|
-
headers:
|
|
85
|
+
const resp = yield axios_1.default.get(`${engineUrl.replace("/index.json", "")}/${engineVersion}/wildcards.json`, {
|
|
86
|
+
headers: Object.assign(Object.assign({}, axios_2.disableCacheHeaders), { "x-hcloud-user-agent": sdkVersion, Authorization: undefined }),
|
|
76
87
|
});
|
|
77
|
-
return resp.data;
|
|
88
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
78
89
|
});
|
|
79
90
|
}
|
|
80
91
|
/**
|
|
@@ -83,13 +94,13 @@ class S3 extends Base_1.default {
|
|
|
83
94
|
* @param version The catalog version
|
|
84
95
|
* @returns StreamNodeSpecification[] | StreamNodeSpecificationWrappedWithEngineVersion an array of all node specification of that catalog version, maybe wrapped in an object with the engine version
|
|
85
96
|
*/
|
|
86
|
-
getCatalogVersion(catalogUrl, version) {
|
|
97
|
+
getCatalogVersion(catalogUrl, version, raw) {
|
|
87
98
|
return __awaiter(this, void 0, void 0, function* () {
|
|
88
99
|
const specificationUrl = catalogUrl.split("/").slice(0, -1).join("/") + "/" + version + "/specification.json";
|
|
89
|
-
const resp = yield
|
|
90
|
-
headers:
|
|
100
|
+
const resp = yield axios_1.default.get(specificationUrl, {
|
|
101
|
+
headers: Object.assign(Object.assign({}, axios_2.disableCacheHeaders), { "x-hcloud-user-agent": sdkVersion, Authorization: undefined }),
|
|
91
102
|
});
|
|
92
|
-
return resp.data;
|
|
103
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
93
104
|
});
|
|
94
105
|
}
|
|
95
106
|
/**
|
|
@@ -98,13 +109,30 @@ class S3 extends Base_1.default {
|
|
|
98
109
|
* @param version The catalog version
|
|
99
110
|
* @returns string the markdown documentation of the node
|
|
100
111
|
*/
|
|
101
|
-
getNodeDocumentation(catalogUrl, version, nodeName) {
|
|
112
|
+
getNodeDocumentation(catalogUrl, version, nodeName, raw) {
|
|
102
113
|
return __awaiter(this, void 0, void 0, function* () {
|
|
103
114
|
const specificationUrl = catalogUrl.split("/").slice(0, -1).join("/") + `/${version}/docs/${nodeName}.md`;
|
|
104
|
-
const resp = yield
|
|
115
|
+
const resp = yield axios_1.default
|
|
116
|
+
.get(specificationUrl, { headers: Object.assign(Object.assign({}, axios_2.disableCacheHeaders), { "x-hcloud-user-agent": sdkVersion, Authorization: undefined }) })
|
|
117
|
+
.catch(err => {
|
|
118
|
+
throw new Error(`Node documentation not found: ${err}`);
|
|
119
|
+
});
|
|
120
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Get the catalogs changelog from the S3 bucket
|
|
125
|
+
* @param catalogUrl Public url of the catalog
|
|
126
|
+
* @returns string the changelog.json of the node
|
|
127
|
+
*/
|
|
128
|
+
getChangelog(catalogUrl, raw) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
const resp = yield axios_1.default
|
|
131
|
+
.get(catalogUrl + "changelog.json", { headers: Object.assign(Object.assign({}, axios_2.disableCacheHeaders), { "x-hcloud-user-agent": sdkVersion, Authorization: undefined }) })
|
|
132
|
+
.catch(err => {
|
|
105
133
|
throw new Error(`Node documentation not found: ${err}`);
|
|
106
134
|
});
|
|
107
|
-
return resp.data;
|
|
135
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
108
136
|
});
|
|
109
137
|
}
|
|
110
138
|
getEndpoint() {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
+
import { SuccessfulAuth } from "../../../interfaces/idp";
|
|
3
|
+
export declare class IdpGuest extends Base {
|
|
4
|
+
/**
|
|
5
|
+
* Creates a new guest user account.
|
|
6
|
+
*
|
|
7
|
+
* @param email - The email address of the guest to create.
|
|
8
|
+
* @param name - The display name of the guest user.
|
|
9
|
+
* @param emailHMAC - An HMAC signature of the email, used for validation.
|
|
10
|
+
* @returns A promise resolving to a `SuccessfulAuth` object containing:
|
|
11
|
+
* - `user`: The created `User` object.
|
|
12
|
+
* - `token`: An authorization token returned by the API.
|
|
13
|
+
*/
|
|
14
|
+
createGuest<R extends boolean = false>(email: string, name: string, emailHMAC: string, raw?: {
|
|
15
|
+
raw: R;
|
|
16
|
+
}): Promise<MaybeRaw<R, SuccessfulAuth>>;
|
|
17
|
+
/**
|
|
18
|
+
* Logs in as an existing guest user.
|
|
19
|
+
*
|
|
20
|
+
* @param email - The email address of the guest to log in.
|
|
21
|
+
* @param emailHMAC - An HMAC signature of the email, used for validation.
|
|
22
|
+
* @returns A promise resolving to a `SuccessfulAuth` object containing:
|
|
23
|
+
* - `user`: The authenticated `User` object.
|
|
24
|
+
* - `token`: An authorization token returned by the API.
|
|
25
|
+
*/
|
|
26
|
+
loginAsGuest<R extends boolean = false>(email: string, emailHMAC: string, raw?: {
|
|
27
|
+
raw: R;
|
|
28
|
+
}): Promise<MaybeRaw<R, SuccessfulAuth>>;
|
|
29
|
+
/**
|
|
30
|
+
* Checks whether an email corresponds to a guest account.
|
|
31
|
+
*
|
|
32
|
+
* @param email - The email address to check.
|
|
33
|
+
* @returns A promise resolving to one of:
|
|
34
|
+
* - `"no user"` → No user exists with the given email.
|
|
35
|
+
* - `"not guest"` → A user exists but is not a guest.
|
|
36
|
+
* - `"guest"` → The email belongs to a guest account.
|
|
37
|
+
*/
|
|
38
|
+
isGuest<R extends boolean = false>(email: string, raw?: {
|
|
39
|
+
raw: R;
|
|
40
|
+
}): Promise<MaybeRaw<R, "no user" | "not guest" | "guest">>;
|
|
41
|
+
protected getEndpoint(endpoint: string): string;
|
|
42
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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.IdpGuest = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
class IdpGuest extends Base_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new guest user account.
|
|
17
|
+
*
|
|
18
|
+
* @param email - The email address of the guest to create.
|
|
19
|
+
* @param name - The display name of the guest user.
|
|
20
|
+
* @param emailHMAC - An HMAC signature of the email, used for validation.
|
|
21
|
+
* @returns A promise resolving to a `SuccessfulAuth` object containing:
|
|
22
|
+
* - `user`: The created `User` object.
|
|
23
|
+
* - `token`: An authorization token returned by the API.
|
|
24
|
+
*/
|
|
25
|
+
createGuest(email, name, emailHMAC, raw) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const resp = yield this.axios.post(this.getEndpoint("/v1/guest"), { email, name, hmac: emailHMAC });
|
|
28
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw)
|
|
29
|
+
? Object.assign(Object.assign({}, resp), { data: { user: resp.data, token: resp.headers.authorization } }) : { user: resp.data, token: resp.headers.authorization });
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Logs in as an existing guest user.
|
|
34
|
+
*
|
|
35
|
+
* @param email - The email address of the guest to log in.
|
|
36
|
+
* @param emailHMAC - An HMAC signature of the email, used for validation.
|
|
37
|
+
* @returns A promise resolving to a `SuccessfulAuth` object containing:
|
|
38
|
+
* - `user`: The authenticated `User` object.
|
|
39
|
+
* - `token`: An authorization token returned by the API.
|
|
40
|
+
*/
|
|
41
|
+
loginAsGuest(email, emailHMAC, raw) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
const res = yield this.axios.put(this.getEndpoint("/v1/guest"), { email, hmac: emailHMAC });
|
|
44
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, res), { data: { user: res.data, token: res.headers.authorization } }) : { user: res.data, token: res.headers.authorization });
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Checks whether an email corresponds to a guest account.
|
|
49
|
+
*
|
|
50
|
+
* @param email - The email address to check.
|
|
51
|
+
* @returns A promise resolving to one of:
|
|
52
|
+
* - `"no user"` → No user exists with the given email.
|
|
53
|
+
* - `"not guest"` → A user exists but is not a guest.
|
|
54
|
+
* - `"guest"` → The email belongs to a guest account.
|
|
55
|
+
*/
|
|
56
|
+
isGuest(email, raw) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const res = yield this.axios.get(this.getEndpoint(`/v1/guest/email/${email}`));
|
|
59
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
getEndpoint(endpoint) {
|
|
63
|
+
return `${this.options.server}/api/account${endpoint}`;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.IdpGuest = IdpGuest;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import Base from "../../Base";
|
|
1
|
+
import Base, { MaybeRaw } from "../../Base";
|
|
2
2
|
import { Version } from "../../interfaces/global";
|
|
3
3
|
import { PreLoginResponse } from "../../interfaces/idp";
|
|
4
4
|
import { SuccessfulAuth } from "../../interfaces/idp/user/SuccessfulAuth";
|
|
5
|
+
import { IdpGuest } from "./guest";
|
|
5
6
|
import { IdpInternal } from "./internal";
|
|
6
7
|
import { IdpOAuth } from "./oauth";
|
|
7
8
|
import { IdpOrganization } from "./organization";
|
|
@@ -28,6 +29,11 @@ export default class Idp extends Base {
|
|
|
28
29
|
*/
|
|
29
30
|
get user(): IdpUser;
|
|
30
31
|
private _user?;
|
|
32
|
+
/**
|
|
33
|
+
* Handles everything around a guest
|
|
34
|
+
*/
|
|
35
|
+
get guest(): IdpGuest;
|
|
36
|
+
private _guest?;
|
|
31
37
|
/**
|
|
32
38
|
* Handles everything around idp's internal endpoints
|
|
33
39
|
*/
|
|
@@ -37,7 +43,9 @@ export default class Idp extends Base {
|
|
|
37
43
|
* Requests the endpoint version
|
|
38
44
|
* @returns Version object
|
|
39
45
|
*/
|
|
40
|
-
version(
|
|
46
|
+
version<R extends boolean = false>(raw?: {
|
|
47
|
+
raw: R;
|
|
48
|
+
}): Promise<MaybeRaw<R, Version>>;
|
|
41
49
|
/**
|
|
42
50
|
* Authenticates against the identity provider with a given email and password.
|
|
43
51
|
* @param email Email of the user
|
|
@@ -45,7 +53,9 @@ export default class Idp extends Base {
|
|
|
45
53
|
* @param token (optional) token if 2FA-TOTP is enabled
|
|
46
54
|
* @returns SuccessfulAuth object holding the token and the user
|
|
47
55
|
*/
|
|
48
|
-
login(email: string, password: string, token?: string
|
|
56
|
+
login<R extends boolean = false>(email: string, password: string, token?: string, raw?: {
|
|
57
|
+
raw: R;
|
|
58
|
+
}): Promise<MaybeRaw<R, SuccessfulAuth>>;
|
|
49
59
|
/**
|
|
50
60
|
* Starts the login process via OIDC
|
|
51
61
|
* @param origin The starting URL of the process. After obtaining the credentials, the user will be redirected back to this url.
|
|
@@ -54,14 +64,18 @@ export default class Idp extends Base {
|
|
|
54
64
|
* @param hint Valid email address of the user that wants to login. Hint must be defined when provider is not.
|
|
55
65
|
* @returns URL that must be accessed via a browser to continue the login process.
|
|
56
66
|
*/
|
|
57
|
-
loginWithOIDC(origin: string, oidcProvider?: string, hint?: string
|
|
67
|
+
loginWithOIDC<R extends boolean = false>(origin: string, oidcProvider?: string, hint?: string, raw?: {
|
|
68
|
+
raw: R;
|
|
69
|
+
}): Promise<MaybeRaw<R, string>>;
|
|
58
70
|
/**
|
|
59
71
|
* Starts the login process via SAML 2.0
|
|
60
72
|
* @param origin The starting URL of the process. After obtaining the credentials, the user will be redirected back to this url.
|
|
61
73
|
* @param email Email of the user. The email domain will be used to determine the appropriate SAML 2.0 provider to use going forward.
|
|
62
74
|
* @returns URL that must be accessed via a browser to continue the login process.
|
|
63
75
|
*/
|
|
64
|
-
loginWithSAML(origin: string, email: string
|
|
76
|
+
loginWithSAML<R extends boolean = false>(origin: string, email: string, raw?: {
|
|
77
|
+
raw: R;
|
|
78
|
+
}): Promise<MaybeRaw<R, string>>;
|
|
65
79
|
/**
|
|
66
80
|
* Determine if/how the given email can authenticate.
|
|
67
81
|
*
|
|
@@ -71,7 +85,9 @@ export default class Idp extends Base {
|
|
|
71
85
|
* @returns object that dictates if: the user needs to REGISTER; the user needs to VERIFY_EMAIL; the user can LOGIN using this email;
|
|
72
86
|
* or the authentication process should continue via an EXTERNAL provider that can be found via the location property.
|
|
73
87
|
*/
|
|
74
|
-
preLogin(email: string, origin: string
|
|
88
|
+
preLogin<R extends boolean = false>(email: string, origin: string, raw?: {
|
|
89
|
+
raw: R;
|
|
90
|
+
}): Promise<MaybeRaw<R, PreLoginResponse>>;
|
|
75
91
|
/**
|
|
76
92
|
* Initiate the password reset process. An email will be sent to the user to move to the next phase.
|
|
77
93
|
*
|
|
@@ -79,6 +95,8 @@ export default class Idp extends Base {
|
|
|
79
95
|
* @param captcha Valid google reCAPTCHAV2
|
|
80
96
|
* @param targetUrl Optional url the link in the mail will point to
|
|
81
97
|
*/
|
|
82
|
-
resetPassword(email: string, captcha: string, targetUrl?: string
|
|
98
|
+
resetPassword<R extends boolean = false>(email: string, captcha: string, targetUrl?: string, raw?: {
|
|
99
|
+
raw: R;
|
|
100
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
83
101
|
protected getEndpoint(endpoint: string): string;
|
|
84
102
|
}
|