hcloud-sdk 0.0.16 → 14.13.2
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 +809 -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 +80 -0
- package/lib/Hcloud.js +134 -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 +10 -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/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 +60 -0
- package/lib/interfaces/high5/space/event/stream/node/index.js +7 -0
- package/lib/interfaces/high5/space/execution/index.d.ts +137 -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/index.d.ts +171 -0
- package/lib/interfaces/high5/wave/index.js +52 -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 +44 -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 +27 -0
- package/lib/interfaces/mothership/index.js +8 -0
- package/lib/interfaces/nats/index.d.ts +252 -0
- package/lib/interfaces/nats/index.js +334 -0
- package/lib/service/agent/bundle/dev/index.d.ts +17 -0
- package/lib/service/agent/bundle/dev/index.js +40 -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 +37 -0
- package/lib/service/agent/context/index.js +81 -0
- package/lib/service/agent/index.d.ts +14 -0
- package/lib/service/agent/index.js +20 -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 +26 -0
- package/lib/service/auditor/index.js +49 -0
- package/lib/service/auditor/internal/index.d.ts +27 -0
- package/lib/service/{AuditorInternal.js → auditor/internal/index.js} +20 -24
- package/lib/service/bouncer/features/index.d.ts +8 -0
- package/lib/service/bouncer/features/index.js +25 -0
- package/lib/service/bouncer/index.d.ts +14 -0
- package/lib/service/bouncer/index.js +31 -0
- package/lib/service/dali/DaliAvatar.d.ts +36 -0
- package/lib/service/dali/DaliAvatar.js +25 -0
- package/lib/service/dali/avatar/DaliFuseSpace.d.ts +28 -0
- package/lib/service/dali/avatar/DaliFuseSpace.js +55 -0
- package/lib/service/dali/avatar/DaliHigh5Space.d.ts +28 -0
- package/lib/service/dali/avatar/DaliHigh5Space.js +55 -0
- package/lib/service/dali/avatar/DaliOAuthApp.d.ts +28 -0
- package/lib/service/dali/avatar/DaliOAuthApp.js +55 -0
- package/lib/service/dali/avatar/DaliOrganization.d.ts +25 -0
- package/lib/service/dali/avatar/DaliOrganization.js +52 -0
- package/lib/service/dali/avatar/DaliTeam.d.ts +28 -0
- package/lib/service/dali/avatar/DaliTeam.js +55 -0
- package/lib/service/dali/avatar/DaliUser.d.ts +22 -0
- package/lib/service/dali/avatar/DaliUser.js +49 -0
- package/lib/service/dali/index.d.ts +16 -0
- package/lib/service/dali/index.js +30 -0
- package/lib/service/fuse/index.d.ts +17 -0
- package/lib/service/fuse/index.js +34 -0
- package/lib/service/fuse/internal/index.d.ts +9 -0
- package/lib/service/fuse/internal/index.js +29 -0
- package/lib/service/fuse/internal/space/cronjob/index.d.ts +8 -0
- package/lib/service/fuse/internal/space/cronjob/index.js +15 -0
- package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +17 -0
- package/lib/service/fuse/internal/space/cronjob/log/index.js +35 -0
- package/lib/service/fuse/internal/space/index.d.ts +23 -0
- package/lib/service/fuse/internal/space/index.js +43 -0
- package/lib/service/fuse/space/cronjob/index.d.ts +123 -0
- package/lib/service/fuse/space/cronjob/index.js +175 -0
- package/lib/service/fuse/space/cronjob/log/index.d.ts +31 -0
- package/lib/service/fuse/space/cronjob/log/index.js +57 -0
- package/lib/service/fuse/space/index.d.ts +82 -0
- package/lib/service/fuse/space/index.js +134 -0
- package/lib/service/high5/execution/index.d.ts +10 -0
- package/lib/service/high5/execution/index.js +17 -0
- package/lib/service/high5/execution/log/index.d.ts +19 -0
- package/lib/service/high5/execution/log/index.js +41 -0
- package/lib/service/high5/execution/status/index.d.ts +18 -0
- package/lib/service/high5/execution/status/index.js +41 -0
- package/lib/service/high5/index.d.ts +22 -0
- package/lib/service/high5/index.js +39 -0
- package/lib/service/high5/internal/index.d.ts +9 -0
- package/lib/service/high5/internal/index.js +29 -0
- package/lib/service/high5/internal/space/index.d.ts +21 -0
- package/lib/service/high5/internal/space/index.js +41 -0
- package/lib/service/high5/joinToken/index.d.ts +40 -0
- package/lib/service/high5/joinToken/index.js +64 -0
- package/lib/service/high5/space/event/index.d.ts +56 -0
- package/lib/service/high5/space/event/index.js +89 -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 +38 -0
- package/lib/service/high5/space/event/stream/design/index.js +56 -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 +100 -0
- package/lib/service/high5/space/event/stream/index.d.ts +114 -0
- package/lib/service/high5/space/event/stream/index.js +164 -0
- package/lib/service/high5/space/execution/index.d.ts +48 -0
- package/lib/service/high5/space/execution/index.js +74 -0
- package/lib/service/high5/space/execution/log/index.d.ts +31 -0
- package/lib/service/high5/space/execution/log/index.js +57 -0
- package/lib/service/high5/space/execution/status/index.d.ts +16 -0
- package/lib/service/high5/space/execution/status/index.js +34 -0
- package/lib/service/high5/space/index.d.ts +107 -0
- package/lib/service/high5/space/index.js +160 -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 +92 -0
- package/lib/service/high5/space/wave/index.d.ts +38 -0
- package/lib/service/high5/space/wave/index.js +66 -0
- package/lib/service/high5/space/webhook/index.d.ts +83 -0
- package/lib/service/high5/space/webhook/index.js +132 -0
- package/lib/service/high5/space/webhook/log/index.d.ts +18 -0
- package/lib/service/high5/space/webhook/log/index.js +38 -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 +88 -0
- package/lib/service/idp/index.d.ts +82 -0
- package/lib/service/idp/index.js +137 -0
- package/lib/service/idp/internal/index.d.ts +19 -0
- package/lib/service/idp/internal/index.js +34 -0
- package/lib/service/idp/oauth/index.d.ts +45 -0
- package/lib/service/idp/oauth/index.js +105 -0
- package/lib/service/idp/organization/index.d.ts +54 -0
- package/lib/service/idp/organization/index.js +79 -0
- package/lib/service/idp/organization/license/index.d.ts +7 -0
- package/lib/service/idp/organization/license/index.js +30 -0
- package/lib/service/idp/organization/member/index.d.ts +58 -0
- package/lib/service/idp/organization/member/index.js +96 -0
- package/lib/service/idp/organization/member/invitations/index.d.ts +79 -0
- package/lib/service/idp/organization/member/invitations/index.js +118 -0
- package/lib/service/idp/organization/settings/domain/index.d.ts +38 -0
- package/lib/service/idp/organization/settings/domain/index.js +63 -0
- package/lib/service/idp/organization/settings/domain/saml/index.d.ts +43 -0
- package/lib/service/idp/organization/settings/domain/saml/index.js +88 -0
- package/lib/service/idp/organization/settings/index.d.ts +16 -0
- package/lib/service/idp/organization/settings/index.js +16 -0
- package/lib/service/idp/organization/settings/oauth/index.d.ts +64 -0
- package/lib/service/idp/organization/settings/oauth/index.js +106 -0
- package/lib/service/idp/organization/team/index.d.ts +72 -0
- package/lib/service/idp/organization/team/index.js +115 -0
- package/lib/service/idp/registration/index.d.ts +39 -0
- package/lib/service/idp/registration/index.js +84 -0
- package/lib/service/idp/user/index.d.ts +82 -0
- package/lib/service/idp/user/index.js +125 -0
- package/lib/service/idp/user/license/index.d.ts +7 -0
- package/lib/service/idp/user/license/index.js +30 -0
- package/lib/service/idp/user/password/index.d.ts +19 -0
- package/lib/service/idp/user/password/index.js +52 -0
- package/lib/service/idp/user/settings/connections/index.d.ts +15 -0
- package/lib/service/idp/user/settings/connections/index.js +33 -0
- package/lib/service/idp/user/settings/general/index.d.ts +18 -0
- package/lib/service/idp/user/settings/general/index.js +39 -0
- package/lib/service/idp/user/settings/index.d.ts +36 -0
- package/lib/service/idp/user/settings/index.js +25 -0
- package/lib/service/idp/user/settings/notifications/index.d.ts +18 -0
- package/lib/service/idp/user/settings/notifications/index.js +39 -0
- package/lib/service/idp/user/settings/oauthApps/index.d.ts +22 -0
- package/lib/service/idp/user/settings/oauthApps/index.js +54 -0
- package/lib/service/idp/user/settings/pats/index.d.ts +50 -0
- package/lib/service/idp/user/settings/pats/index.js +93 -0
- package/lib/service/idp/user/settings/twoFactor/index.d.ts +11 -0
- package/lib/service/idp/user/settings/twoFactor/index.js +15 -0
- package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +34 -0
- package/lib/service/idp/user/settings/twoFactor/totp/index.js +65 -0
- package/lib/service/mailer/index.d.ts +14 -0
- package/lib/service/{Mailer.js → mailer/index.js} +9 -12
- package/lib/service/mailer/internal/index.d.ts +36 -0
- package/lib/service/mailer/internal/index.js +64 -0
- package/lib/service/mothership/index.d.ts +97 -0
- package/lib/service/mothership/index.js +136 -0
- package/lib/service/nats/index.d.ts +51 -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 +16 -0
- package/lib/utils/bouncer/features/Provider.js +83 -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/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
|
@@ -0,0 +1,89 @@
|
|
|
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.High5Event = void 0;
|
|
13
|
+
const Base_1 = require("../../../../Base");
|
|
14
|
+
const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseHelper");
|
|
15
|
+
const searchFilter_1 = require("../../../../helper/searchFilter");
|
|
16
|
+
const stream_1 = require("./stream");
|
|
17
|
+
class High5Event extends Base_1.default {
|
|
18
|
+
constructor(options, axios) {
|
|
19
|
+
super(options, axios);
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves all Events of a High5 Space which match the provided search filter(s). Will return all Events of the Space if no filter is provided.
|
|
22
|
+
* @param orgName Name of the Organization
|
|
23
|
+
* @param spaceName Name of the Space
|
|
24
|
+
* @param filters (optional) Array of search filters
|
|
25
|
+
* @param sorting (optional) Sorting object
|
|
26
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
27
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
28
|
+
* @returns Object containing an array of Events and the total number of results found in the database (independent of limit and page)
|
|
29
|
+
*/
|
|
30
|
+
this.searchEvents = (_a) => __awaiter(this, [_a], void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0, }) {
|
|
31
|
+
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
|
|
32
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/search?page=${page}&limit=${limit}`), {
|
|
33
|
+
filters: filtersDTO,
|
|
34
|
+
sorting: sorting,
|
|
35
|
+
});
|
|
36
|
+
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves an Event by its name.
|
|
40
|
+
* @param orgName Name of the Organization
|
|
41
|
+
* @param spaceName Name of the Space
|
|
42
|
+
* @param eventName Name of the Event
|
|
43
|
+
* @returns The requested Event
|
|
44
|
+
*/
|
|
45
|
+
this.getEvent = (orgName, spaceName, eventName) => __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}`));
|
|
47
|
+
return resp.data;
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* Creates a new Event in the provided Space.
|
|
51
|
+
* @param orgName Name of the Organization
|
|
52
|
+
* @param spaceName Name of the Space
|
|
53
|
+
* @param name Name of the new Event
|
|
54
|
+
* @returns The created Event
|
|
55
|
+
*/
|
|
56
|
+
this.createEvent = (orgName, spaceName, name) => __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events`), { name: name });
|
|
58
|
+
return resp.data;
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* Rename an event
|
|
62
|
+
* @param orgName Name of the Organization
|
|
63
|
+
* @param spaceName Name of the Space
|
|
64
|
+
* @param eventName Name of the Event
|
|
65
|
+
* @param name New name of the Event
|
|
66
|
+
* @returns Updated Event
|
|
67
|
+
*/
|
|
68
|
+
this.renameEvent = (orgName, spaceName, eventName, name) => __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}/name`), {
|
|
70
|
+
name: name,
|
|
71
|
+
});
|
|
72
|
+
return resp.data;
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* Deletes an Event by its name.
|
|
76
|
+
* @param orgName Name of the Organization
|
|
77
|
+
* @param spaceName Name of the Space
|
|
78
|
+
* @param eventName Name of the Event
|
|
79
|
+
*/
|
|
80
|
+
this.deleteEvent = (orgName, spaceName, eventName) => __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}`));
|
|
82
|
+
});
|
|
83
|
+
this.stream = new stream_1.High5Stream(this.options, this.axios);
|
|
84
|
+
}
|
|
85
|
+
getEndpoint(endpoint) {
|
|
86
|
+
return `${this.options.server}/api/high5${endpoint}`;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.High5Event = High5Event;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Base from "../../../../../../Base";
|
|
2
|
+
import { Design } from "../../../../../../interfaces/high5";
|
|
3
|
+
import { AddNode, DesignOperation, EditNode, LinkNodes, MoveNode } from "../../../../../../interfaces/high5/space/event/stream/design/DesignOperation";
|
|
4
|
+
import { DesignerNode } from "../../../../../../interfaces/high5/space/event/stream/design/StreamDesign";
|
|
5
|
+
export default class DesignOperations extends Base {
|
|
6
|
+
send(orgName: string, spaceName: string, eventName: string, streamId: string, designHash: string, operations: DesignOperation[]): Promise<Design>;
|
|
7
|
+
queue(): OperationQueue;
|
|
8
|
+
addNode(details: DesignerNode): OperationQueue;
|
|
9
|
+
deleteNode(uuid: string): OperationQueue;
|
|
10
|
+
moveNode(uuid: string, newCoords: MoveNode["newCoords"]): OperationQueue;
|
|
11
|
+
editNode(uuid: string, changes: EditNode["changes"]): OperationQueue;
|
|
12
|
+
linkNodes(details: LinkNodes["details"]): OperationQueue;
|
|
13
|
+
unlinkNodes(uuid: string): OperationQueue;
|
|
14
|
+
protected getEndpoint(endpoint: string): string;
|
|
15
|
+
}
|
|
16
|
+
declare class OperationQueue {
|
|
17
|
+
operations: DesignOperation[];
|
|
18
|
+
parent: DesignOperations;
|
|
19
|
+
constructor(parent: DesignOperations);
|
|
20
|
+
send(orgName: string, spaceName: string, eventName: string, streamId: string, designHash: string): Promise<Design>;
|
|
21
|
+
addNode(details: AddNode["details"]): this;
|
|
22
|
+
deleteNode(uuid: string): this;
|
|
23
|
+
moveNode(uuid: string, newCoords: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
}): this;
|
|
27
|
+
editNode(uuid: string, changes: EditNode["changes"]): this;
|
|
28
|
+
linkNodes(details: LinkNodes["details"]): this;
|
|
29
|
+
unlinkNodes(uuid: string): this;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
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 DesignOperation_1 = require("../../../../../../interfaces/high5/space/event/stream/design/DesignOperation");
|
|
14
|
+
class DesignOperations extends Base_1.default {
|
|
15
|
+
send(orgName, spaceName, eventName, streamId, designHash, operations) {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}/streams/${streamId}/design/operations`), { hash: designHash, operations });
|
|
18
|
+
return resp.data;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
queue() {
|
|
22
|
+
return new OperationQueue(this);
|
|
23
|
+
}
|
|
24
|
+
addNode(details) {
|
|
25
|
+
const queue = new OperationQueue(this);
|
|
26
|
+
return queue.addNode(details);
|
|
27
|
+
}
|
|
28
|
+
deleteNode(uuid) {
|
|
29
|
+
const queue = new OperationQueue(this);
|
|
30
|
+
return queue.deleteNode(uuid);
|
|
31
|
+
}
|
|
32
|
+
moveNode(uuid, newCoords) {
|
|
33
|
+
const queue = new OperationQueue(this);
|
|
34
|
+
return queue.moveNode(uuid, newCoords);
|
|
35
|
+
}
|
|
36
|
+
editNode(uuid, changes) {
|
|
37
|
+
const queue = new OperationQueue(this);
|
|
38
|
+
return queue.editNode(uuid, changes);
|
|
39
|
+
}
|
|
40
|
+
linkNodes(details) {
|
|
41
|
+
const queue = new OperationQueue(this);
|
|
42
|
+
return queue.linkNodes(details);
|
|
43
|
+
}
|
|
44
|
+
unlinkNodes(uuid) {
|
|
45
|
+
const queue = new OperationQueue(this);
|
|
46
|
+
return queue.unlinkNodes(uuid);
|
|
47
|
+
}
|
|
48
|
+
getEndpoint(endpoint) {
|
|
49
|
+
return `${this.options.server}/api/high5${endpoint}`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.default = DesignOperations;
|
|
53
|
+
class OperationQueue {
|
|
54
|
+
constructor(parent) {
|
|
55
|
+
this.operations = [];
|
|
56
|
+
this.parent = parent;
|
|
57
|
+
}
|
|
58
|
+
send(orgName, spaceName, eventName, streamId, designHash) {
|
|
59
|
+
return this.parent.send(orgName, spaceName, eventName, streamId, designHash, this.operations);
|
|
60
|
+
}
|
|
61
|
+
addNode(details) {
|
|
62
|
+
const op = {
|
|
63
|
+
target: DesignOperation_1.OperationTarget.NODE,
|
|
64
|
+
type: DesignOperation_1.NodeOperation.ADD,
|
|
65
|
+
details,
|
|
66
|
+
};
|
|
67
|
+
this.operations.push(op);
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
deleteNode(uuid) {
|
|
71
|
+
const op = {
|
|
72
|
+
target: DesignOperation_1.OperationTarget.NODE,
|
|
73
|
+
type: DesignOperation_1.NodeOperation.DELETE,
|
|
74
|
+
uuid,
|
|
75
|
+
};
|
|
76
|
+
this.operations.push(op);
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
moveNode(uuid, newCoords) {
|
|
80
|
+
const op = {
|
|
81
|
+
target: DesignOperation_1.OperationTarget.NODE,
|
|
82
|
+
type: DesignOperation_1.NodeOperation.MOVE,
|
|
83
|
+
uuid,
|
|
84
|
+
newCoords,
|
|
85
|
+
};
|
|
86
|
+
this.operations.push(op);
|
|
87
|
+
return this;
|
|
88
|
+
}
|
|
89
|
+
editNode(uuid, changes) {
|
|
90
|
+
const op = {
|
|
91
|
+
target: DesignOperation_1.OperationTarget.NODE,
|
|
92
|
+
type: DesignOperation_1.NodeOperation.EDIT,
|
|
93
|
+
uuid,
|
|
94
|
+
changes,
|
|
95
|
+
};
|
|
96
|
+
this.operations.push(op);
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
linkNodes(details) {
|
|
100
|
+
const op = {
|
|
101
|
+
target: DesignOperation_1.OperationTarget.LINK,
|
|
102
|
+
type: DesignOperation_1.LinkOperation.LINK,
|
|
103
|
+
details,
|
|
104
|
+
};
|
|
105
|
+
this.operations.push(op);
|
|
106
|
+
return this;
|
|
107
|
+
}
|
|
108
|
+
unlinkNodes(uuid) {
|
|
109
|
+
const op = {
|
|
110
|
+
target: DesignOperation_1.OperationTarget.LINK,
|
|
111
|
+
type: DesignOperation_1.LinkOperation.UNLINK,
|
|
112
|
+
uuid,
|
|
113
|
+
};
|
|
114
|
+
this.operations.push(op);
|
|
115
|
+
return this;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import Base, { Options } from "../../../../../../Base";
|
|
3
|
+
import { Design } from "../../../../../../interfaces/high5/space/event/stream/design";
|
|
4
|
+
import { DesignContent } from "../../../../../../interfaces/high5/space/event/stream/design/StreamDesign";
|
|
5
|
+
import DesignOperations from "./DesignOperations";
|
|
6
|
+
import High5DesignSnapshots from "./snapshot";
|
|
7
|
+
export declare class High5Design extends Base {
|
|
8
|
+
/**
|
|
9
|
+
* API to manage design snapshots
|
|
10
|
+
*/
|
|
11
|
+
snapshots: High5DesignSnapshots;
|
|
12
|
+
/**
|
|
13
|
+
* API to perform operations on the Stream Design
|
|
14
|
+
*/
|
|
15
|
+
operations: DesignOperations;
|
|
16
|
+
constructor(options: Options, axios: AxiosInstance);
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves a stream's design.
|
|
19
|
+
* @param orgName Name of the organization
|
|
20
|
+
* @param spaceName Name of the space
|
|
21
|
+
* @param eventName Name of the event
|
|
22
|
+
* @param streamId ID of the stream
|
|
23
|
+
* @returns The requested design
|
|
24
|
+
*/
|
|
25
|
+
getDesign: (orgName: string, spaceName: string, eventName: string, streamId: string) => Promise<Design>;
|
|
26
|
+
/**
|
|
27
|
+
* Creates/overwrites a new design for the specified stream.
|
|
28
|
+
* @param orgName Name of the organization
|
|
29
|
+
* @param spaceName Name of the space
|
|
30
|
+
* @param eventName Name of the event
|
|
31
|
+
* @param streamId ID of the stream
|
|
32
|
+
* @param content Design as Json payload (schema created by Stream Designer Studio)
|
|
33
|
+
* @param build Rendered design as Json payload (schema created by Stream Designer Studio; ready to be executed by wave engine)
|
|
34
|
+
* @returns The created design
|
|
35
|
+
*/
|
|
36
|
+
createDesign: (orgName: string, spaceName: string, eventName: string, streamId: string, name: string, content: DesignContent, build?: unknown) => Promise<Design>;
|
|
37
|
+
protected getEndpoint(endpoint: string): string;
|
|
38
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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.High5Design = void 0;
|
|
13
|
+
const Base_1 = require("../../../../../../Base");
|
|
14
|
+
const DesignOperations_1 = require("./DesignOperations");
|
|
15
|
+
const snapshot_1 = require("./snapshot");
|
|
16
|
+
class High5Design extends Base_1.default {
|
|
17
|
+
constructor(options, axios) {
|
|
18
|
+
super(options, axios);
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves a stream's design.
|
|
21
|
+
* @param orgName Name of the organization
|
|
22
|
+
* @param spaceName Name of the space
|
|
23
|
+
* @param eventName Name of the event
|
|
24
|
+
* @param streamId ID of the stream
|
|
25
|
+
* @returns The requested design
|
|
26
|
+
*/
|
|
27
|
+
this.getDesign = (orgName, spaceName, eventName, streamId) => __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}/streams/${streamId}/design`));
|
|
29
|
+
return resp.data;
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Creates/overwrites a new design for the specified stream.
|
|
33
|
+
* @param orgName Name of the organization
|
|
34
|
+
* @param spaceName Name of the space
|
|
35
|
+
* @param eventName Name of the event
|
|
36
|
+
* @param streamId ID of the stream
|
|
37
|
+
* @param content Design as Json payload (schema created by Stream Designer Studio)
|
|
38
|
+
* @param build Rendered design as Json payload (schema created by Stream Designer Studio; ready to be executed by wave engine)
|
|
39
|
+
* @returns The created design
|
|
40
|
+
*/
|
|
41
|
+
this.createDesign = (orgName, spaceName, eventName, streamId, name, content, build) => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}/streams/${streamId}/design`), {
|
|
43
|
+
name,
|
|
44
|
+
content,
|
|
45
|
+
build,
|
|
46
|
+
});
|
|
47
|
+
return resp.data;
|
|
48
|
+
});
|
|
49
|
+
this.operations = new DesignOperations_1.default(options, axios);
|
|
50
|
+
this.snapshots = new snapshot_1.default(options, axios);
|
|
51
|
+
}
|
|
52
|
+
getEndpoint(endpoint) {
|
|
53
|
+
return `${this.options.server}/api/high5${endpoint}`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.High5Design = High5Design;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import Base from "../../../../../../../Base";
|
|
2
|
+
import { PaginatedResponse, SearchParams } from "../../../../../../../interfaces/global";
|
|
3
|
+
import DesignSnapshot from "../../../../../../../interfaces/high5/space/event/stream/design/snapshot";
|
|
4
|
+
export default class High5DesignSnapshots extends Base {
|
|
5
|
+
/**
|
|
6
|
+
* Search the snapshots of stream's design.
|
|
7
|
+
* @param orgName Name of the organization
|
|
8
|
+
* @param spaceName Name of the space
|
|
9
|
+
* @param eventName Name of the event
|
|
10
|
+
* @param streamId ID of the stream
|
|
11
|
+
* @param content (optional) Is it necessary to retrieve content for each snapshot (disabled by default)
|
|
12
|
+
* @param filters Search filters to apply
|
|
13
|
+
* @param sorting Sorting criteria for the result
|
|
14
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
15
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
16
|
+
* @returns Object containing an array of snapshots of the stream design and the total number of results found in the database (independent of limit and page)
|
|
17
|
+
*/
|
|
18
|
+
search: (orgName: string, spaceName: string, eventName: string, streamId: string, content: boolean | undefined, { filters, sorting, limit, page }: SearchParams) => Promise<PaginatedResponse<DesignSnapshot>>;
|
|
19
|
+
/**
|
|
20
|
+
* Create a snapshot of stream's design.
|
|
21
|
+
* @param orgName Name of the organization
|
|
22
|
+
* @param spaceName Name of the space
|
|
23
|
+
* @param eventName Name of the event
|
|
24
|
+
* @param streamId ID of the stream
|
|
25
|
+
* @param name Name of the snapshot
|
|
26
|
+
* @returns The snapshot
|
|
27
|
+
*/
|
|
28
|
+
create: (orgName: string, spaceName: string, eventName: string, streamId: string, name: string) => Promise<DesignSnapshot>;
|
|
29
|
+
/**
|
|
30
|
+
* Update a snapshot's name.
|
|
31
|
+
* @param orgName Name of the organization
|
|
32
|
+
* @param spaceName Name of the space
|
|
33
|
+
* @param eventName Name of the event
|
|
34
|
+
* @param streamId ID of the stream
|
|
35
|
+
* @param snapshotId ID of the snapshot
|
|
36
|
+
* @param name Name of the snapshot
|
|
37
|
+
* @returns The snapshot
|
|
38
|
+
*/
|
|
39
|
+
update: (orgName: string, spaceName: string, eventName: string, streamId: string, snapshotId: string, name: string) => Promise<DesignSnapshot>;
|
|
40
|
+
/**
|
|
41
|
+
* Delete a stream design's snapshot.
|
|
42
|
+
* @param orgName Name of the organization
|
|
43
|
+
* @param spaceName Name of the space
|
|
44
|
+
* @param eventName Name of the event
|
|
45
|
+
* @param streamId ID of the stream
|
|
46
|
+
* @param snapshotId ID of the snapshot
|
|
47
|
+
*/
|
|
48
|
+
delete: (orgName: string, spaceName: string, eventName: string, streamId: string, snapshotId: string) => Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Restore a stream's design to a certain snapshot.
|
|
51
|
+
*
|
|
52
|
+
* **WARNING**: This is a destructive action. It will overwrite the current design for the stream.
|
|
53
|
+
*
|
|
54
|
+
* @param orgName Name of the organization
|
|
55
|
+
* @param spaceName Name of the space
|
|
56
|
+
* @param eventName Name of the event
|
|
57
|
+
* @param streamId ID of the stream
|
|
58
|
+
* @param snapshotId ID of the snapshot
|
|
59
|
+
*/
|
|
60
|
+
restore: (orgName: string, spaceName: string, eventName: string, streamId: string, snapshotId: string) => Promise<void>;
|
|
61
|
+
protected getEndpoint(endpoint: string): string;
|
|
62
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
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 paginatedResponseHelper_1 = require("../../../../../../../helper/paginatedResponseHelper");
|
|
14
|
+
const searchFilter_1 = require("../../../../../../../helper/searchFilter");
|
|
15
|
+
class High5DesignSnapshots extends Base_1.default {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
/**
|
|
19
|
+
* Search the snapshots of stream's design.
|
|
20
|
+
* @param orgName Name of the organization
|
|
21
|
+
* @param spaceName Name of the space
|
|
22
|
+
* @param eventName Name of the event
|
|
23
|
+
* @param streamId ID of the stream
|
|
24
|
+
* @param content (optional) Is it necessary to retrieve content for each snapshot (disabled by default)
|
|
25
|
+
* @param filters Search filters to apply
|
|
26
|
+
* @param sorting Sorting criteria for the result
|
|
27
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
28
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
29
|
+
* @returns Object containing an array of snapshots of the stream design and the total number of results found in the database (independent of limit and page)
|
|
30
|
+
*/
|
|
31
|
+
this.search = (orgName_1, spaceName_1, eventName_1, streamId_1, ...args_1) => __awaiter(this, [orgName_1, spaceName_1, eventName_1, streamId_1, ...args_1], void 0, function* (orgName, spaceName, eventName, streamId, content = false, { filters, sorting, limit = 25, page = 0 }) {
|
|
32
|
+
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
|
|
33
|
+
return new searchFilter_1.SearchFilterDTO(f);
|
|
34
|
+
});
|
|
35
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}/streams/${streamId}/design/snapshots/search`), {
|
|
36
|
+
filters: filtersDTO,
|
|
37
|
+
sorting,
|
|
38
|
+
}, {
|
|
39
|
+
params: { content, limit, page },
|
|
40
|
+
});
|
|
41
|
+
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* Create a snapshot of stream's design.
|
|
45
|
+
* @param orgName Name of the organization
|
|
46
|
+
* @param spaceName Name of the space
|
|
47
|
+
* @param eventName Name of the event
|
|
48
|
+
* @param streamId ID of the stream
|
|
49
|
+
* @param name Name of the snapshot
|
|
50
|
+
* @returns The snapshot
|
|
51
|
+
*/
|
|
52
|
+
this.create = (orgName, spaceName, eventName, streamId, name) => __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}/streams/${streamId}/design/snapshots`), { name });
|
|
54
|
+
return resp.data;
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* Update a snapshot's name.
|
|
58
|
+
* @param orgName Name of the organization
|
|
59
|
+
* @param spaceName Name of the space
|
|
60
|
+
* @param eventName Name of the event
|
|
61
|
+
* @param streamId ID of the stream
|
|
62
|
+
* @param snapshotId ID of the snapshot
|
|
63
|
+
* @param name Name of the snapshot
|
|
64
|
+
* @returns The snapshot
|
|
65
|
+
*/
|
|
66
|
+
this.update = (orgName, spaceName, eventName, streamId, snapshotId, name) => __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}/streams/${streamId}/design/snapshots/${snapshotId}`), { name });
|
|
68
|
+
return resp.data;
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* Delete a stream design's snapshot.
|
|
72
|
+
* @param orgName Name of the organization
|
|
73
|
+
* @param spaceName Name of the space
|
|
74
|
+
* @param eventName Name of the event
|
|
75
|
+
* @param streamId ID of the stream
|
|
76
|
+
* @param snapshotId ID of the snapshot
|
|
77
|
+
*/
|
|
78
|
+
this.delete = (orgName, spaceName, eventName, streamId, snapshotId) => __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}/streams/${streamId}/design/snapshots/${snapshotId}`));
|
|
80
|
+
});
|
|
81
|
+
/**
|
|
82
|
+
* Restore a stream's design to a certain snapshot.
|
|
83
|
+
*
|
|
84
|
+
* **WARNING**: This is a destructive action. It will overwrite the current design for the stream.
|
|
85
|
+
*
|
|
86
|
+
* @param orgName Name of the organization
|
|
87
|
+
* @param spaceName Name of the space
|
|
88
|
+
* @param eventName Name of the event
|
|
89
|
+
* @param streamId ID of the stream
|
|
90
|
+
* @param snapshotId ID of the snapshot
|
|
91
|
+
*/
|
|
92
|
+
this.restore = (orgName, spaceName, eventName, streamId, snapshotId) => __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}/streams/${streamId}/design/snapshots/${snapshotId}/restore`));
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
getEndpoint(endpoint) {
|
|
97
|
+
return `${this.options.server}/api/high5${endpoint}`;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.default = High5DesignSnapshots;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import Base, { Options } from "../../../../../Base";
|
|
3
|
+
import { PaginatedResponse, SearchParams } from "../../../../../interfaces/global";
|
|
4
|
+
import { SingleStreamPatchOrder, Stream, StreamPatchActive, StreamPatchOrder } from "../../../../../interfaces/high5/space/event/stream";
|
|
5
|
+
import { High5Design } from "./design";
|
|
6
|
+
export declare class High5Stream extends Base {
|
|
7
|
+
design: High5Design;
|
|
8
|
+
constructor(options: Options, axios: AxiosInstance);
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves all Streams of an Event which match the provided search filter(s). Will return all Streams if no filter is provided.
|
|
11
|
+
* @param orgName Name of the organization
|
|
12
|
+
* @param spaceName Name of the space
|
|
13
|
+
* @param eventName Name of the event
|
|
14
|
+
* @param filters (optional) Array of search filters
|
|
15
|
+
* @param sorting (optional) Sorting object
|
|
16
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
17
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
18
|
+
* @returns Object containing an array of streams as well as the total number of results found in the database (independent of limit and page)
|
|
19
|
+
*/
|
|
20
|
+
searchStreams: ({ orgName, spaceName, eventName, filters, sorting, limit, page, }: SearchParams & {
|
|
21
|
+
orgName: string;
|
|
22
|
+
spaceName: string;
|
|
23
|
+
eventName: string;
|
|
24
|
+
}) => Promise<PaginatedResponse<Stream>>;
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves a Stream by its ID.
|
|
27
|
+
* @param orgName Name of the organization
|
|
28
|
+
* @param spaceName Name of the space
|
|
29
|
+
* @param eventName Name of the event
|
|
30
|
+
* @param streamId ID of the stream
|
|
31
|
+
* @returns The requested stream
|
|
32
|
+
*/
|
|
33
|
+
getStream: (orgName: string, spaceName: string, eventName: string, streamId: string) => Promise<Stream>;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a new Stream for the specified Event.
|
|
36
|
+
* @param orgName Name of the organization
|
|
37
|
+
* @param spaceName Name of the space
|
|
38
|
+
* @param eventName Name of the event
|
|
39
|
+
* @param name Name for the new stream
|
|
40
|
+
* @returns The created stream
|
|
41
|
+
*/
|
|
42
|
+
createStream: (orgName: string, spaceName: string, eventName: string, name: string) => Promise<Stream>;
|
|
43
|
+
/**
|
|
44
|
+
* Duplicate a Stream for the specified Event.
|
|
45
|
+
* @param orgName Name of the organization
|
|
46
|
+
* @param spaceName Name of the space
|
|
47
|
+
* @param eventName Name of the event
|
|
48
|
+
* @param name Name for the new stream
|
|
49
|
+
* @param sourceStreamId ID for the stream to duplicate
|
|
50
|
+
* @returns The created stream
|
|
51
|
+
*/
|
|
52
|
+
duplicateStream: (orgName: string, spaceName: string, eventName: string, name: string, sourceStreamId: string) => Promise<Stream>;
|
|
53
|
+
/**
|
|
54
|
+
* Patches the order of Streams for an Event.
|
|
55
|
+
* @param orgName Name of the organization
|
|
56
|
+
* @param spaceName Name of the space
|
|
57
|
+
* @param eventName Name of the event
|
|
58
|
+
* @param StreamPatchOrder List of all event streams with their new order
|
|
59
|
+
* @returns Array of updated Streams
|
|
60
|
+
*/
|
|
61
|
+
patchStreamOrderMulti: (orgName: string, spaceName: string, eventName: string, streamList: StreamPatchOrder[]) => Promise<Stream[]>;
|
|
62
|
+
/**
|
|
63
|
+
* Activate or deactivate a stream
|
|
64
|
+
* @param orgName Name of the organization
|
|
65
|
+
* @param spaceName Name of the space
|
|
66
|
+
* @param eventName Name of the event
|
|
67
|
+
* @param streamId ID of the stream
|
|
68
|
+
* @param StreamPatchActive Object defining if stream should be active or inactive
|
|
69
|
+
* @returns Details of the updated stream
|
|
70
|
+
*/
|
|
71
|
+
patchStreamState: (orgName: string, spaceName: string, eventName: string, streamId: string, streamPatchActive: StreamPatchActive) => Promise<Stream>;
|
|
72
|
+
/**
|
|
73
|
+
* Moves a Stream up or down in the existing Streams order.
|
|
74
|
+
* @param orgName Name of the organization
|
|
75
|
+
* @param spaceName Name of the space
|
|
76
|
+
* @param eventName Name of the event
|
|
77
|
+
* @param streamId ID of the stream
|
|
78
|
+
* @param SingleStreamPatchOrder Object defining if stream should move up or down
|
|
79
|
+
* @returns Array of updated Streams
|
|
80
|
+
*/
|
|
81
|
+
patchStreamOrder: (orgName: string, spaceName: string, eventName: string, streamId: string, singleStreamPatchOrder: SingleStreamPatchOrder) => Promise<Stream[]>;
|
|
82
|
+
/**
|
|
83
|
+
* Rename a stream
|
|
84
|
+
* @param orgName Name of the organization
|
|
85
|
+
* @param spaceName Name of the space
|
|
86
|
+
* @param eventName Name of the event
|
|
87
|
+
* @param streamId ID of the stream
|
|
88
|
+
* @param name New name of the stream
|
|
89
|
+
* @returns Updated stream
|
|
90
|
+
*/
|
|
91
|
+
renameStream: (orgName: string, spaceName: string, eventName: string, streamId: string, name: string) => Promise<Stream>;
|
|
92
|
+
/**
|
|
93
|
+
* Moves a Stream to another event.
|
|
94
|
+
*
|
|
95
|
+
* @param orgName Name of the organization
|
|
96
|
+
* @param spaceName Name of the space
|
|
97
|
+
* @param eventName Name of the event
|
|
98
|
+
* @param streamId ID of the stream
|
|
99
|
+
* @param newEventName Name of the new event
|
|
100
|
+
* @param [name] (optional) New name for stream. Is the new event already has a stream with the same name as this one, this parameter is mandatory.
|
|
101
|
+
* @param [order] (optional) Order the stream should have in the new event
|
|
102
|
+
* @returns Updated Stream
|
|
103
|
+
*/
|
|
104
|
+
moveStream: (orgName: string, spaceName: string, eventName: string, streamId: string, newEventName: string, name?: string, order?: number) => Promise<Stream>;
|
|
105
|
+
/**
|
|
106
|
+
* Deletes a Stream by its ID.
|
|
107
|
+
* @param orgName Name of the organization
|
|
108
|
+
* @param spaceName Name of the space
|
|
109
|
+
* @param eventName Name of the event
|
|
110
|
+
* @param streamId ID of the stream
|
|
111
|
+
*/
|
|
112
|
+
deleteStream: (orgName: string, spaceName: string, eventName: string, streamId: string) => Promise<void>;
|
|
113
|
+
protected getEndpoint(endpoint: string): string;
|
|
114
|
+
}
|