hcloud-sdk 16.0.0 → 17.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.
Files changed (80) hide show
  1. package/changelog.md +78 -51
  2. package/lib/Hcloud.d.ts +3 -0
  3. package/lib/Hcloud.js +7 -0
  4. package/lib/helper/ValidationHelper.d.ts +66 -0
  5. package/lib/helper/ValidationHelper.js +312 -0
  6. package/lib/interfaces/auditor/index.d.ts +6 -2
  7. package/lib/interfaces/auditor/index.js +4 -0
  8. package/lib/interfaces/friday/index.d.ts +3 -0
  9. package/lib/interfaces/friday/index.js +19 -0
  10. package/lib/interfaces/friday/space/database/document/index.d.ts +34 -0
  11. package/lib/interfaces/friday/space/database/document/index.js +13 -0
  12. package/lib/interfaces/friday/space/database/index.d.ts +12 -0
  13. package/lib/interfaces/friday/space/database/index.js +2 -0
  14. package/lib/interfaces/friday/space/index.d.ts +21 -0
  15. package/lib/interfaces/friday/space/index.js +11 -0
  16. package/lib/interfaces/frontend/config/index.d.ts +1 -0
  17. package/lib/interfaces/fuse/space/index.d.ts +1 -0
  18. package/lib/interfaces/global/Products.d.ts +3 -1
  19. package/lib/interfaces/global/Products.js +2 -0
  20. package/lib/interfaces/global/Views.d.ts +2 -1
  21. package/lib/interfaces/global/Views.js +1 -0
  22. package/lib/interfaces/high5/execution/index.d.ts +23 -2
  23. package/lib/interfaces/high5/execution/index.js +2 -0
  24. package/lib/interfaces/high5/space/event/stream/node/index.d.ts +10 -2
  25. package/lib/interfaces/high5/space/event/stream/node/index.js +6 -1
  26. package/lib/interfaces/high5/space/execution/index.d.ts +54 -1
  27. package/lib/interfaces/high5/space/execution/index.js +8 -0
  28. package/lib/interfaces/high5/space/index.d.ts +2 -0
  29. package/lib/interfaces/high5/space/pool/index.d.ts +5 -7
  30. package/lib/interfaces/high5/space/pool/index.js +0 -7
  31. package/lib/interfaces/high5/space/webhook/index.d.ts +3 -1
  32. package/lib/interfaces/high5/wave/index.d.ts +8 -3
  33. package/lib/interfaces/idp/index.d.ts +1 -0
  34. package/lib/interfaces/idp/index.js +1 -0
  35. package/lib/interfaces/idp/organization/license/index.d.ts +11 -0
  36. package/lib/interfaces/idp/organization/member/index.d.ts +1 -0
  37. package/lib/interfaces/idp/organization/service-accounts.d.ts +8 -0
  38. package/lib/interfaces/idp/organization/service-accounts.js +2 -0
  39. package/lib/interfaces/idp/user/GeneralSettings.d.ts +1 -0
  40. package/lib/interfaces/idp/user/GeneralSettings.js +1 -0
  41. package/lib/interfaces/idp/user/Scopes.d.ts +14 -2
  42. package/lib/interfaces/idp/user/Scopes.js +18 -0
  43. package/lib/interfaces/nats/index.d.ts +68 -9
  44. package/lib/interfaces/nats/index.js +100 -12
  45. package/lib/service/agent/context/index.d.ts +5 -0
  46. package/lib/service/agent/context/index.js +14 -0
  47. package/lib/service/dali/DaliAvatar.d.ts +12 -0
  48. package/lib/service/dali/DaliAvatar.js +20 -0
  49. package/lib/service/dali/avatar/DaliCosmoSpace.d.ts +26 -0
  50. package/lib/service/dali/avatar/DaliCosmoSpace.js +58 -0
  51. package/lib/service/dali/avatar/DaliServiceAccount.d.ts +26 -0
  52. package/lib/service/dali/avatar/DaliServiceAccount.js +58 -0
  53. package/lib/service/friday/index.d.ts +13 -0
  54. package/lib/service/friday/index.js +35 -0
  55. package/lib/service/friday/space/database/document/index.d.ts +58 -0
  56. package/lib/service/friday/space/database/document/index.js +97 -0
  57. package/lib/service/friday/space/database/index.d.ts +55 -0
  58. package/lib/service/friday/space/database/index.js +101 -0
  59. package/lib/service/friday/space/index.d.ts +81 -0
  60. package/lib/service/friday/space/index.js +150 -0
  61. package/lib/service/high5/space/event/stream/design/DesignOperations.js +3 -1
  62. package/lib/service/high5/space/execution/index.d.ts +4 -1
  63. package/lib/service/high5/space/execution/index.js +8 -2
  64. package/lib/service/high5/space/execution/status/index.d.ts +13 -6
  65. package/lib/service/high5/space/execution/status/index.js +20 -8
  66. package/lib/service/high5/space/index.d.ts +15 -6
  67. package/lib/service/high5/space/index.js +23 -7
  68. package/lib/service/high5/wave/s3/index.js +17 -10
  69. package/lib/service/idp/organization/index.d.ts +6 -0
  70. package/lib/service/idp/organization/index.js +10 -0
  71. package/lib/service/idp/organization/member/index.d.ts +2 -1
  72. package/lib/service/idp/organization/member/index.js +2 -1
  73. package/lib/service/idp/organization/service-accounts/index.d.ts +64 -0
  74. package/lib/service/idp/organization/service-accounts/index.js +108 -0
  75. package/lib/service/idp/user/index.js +1 -0
  76. package/lib/service/idp/user/password/index.js +1 -1
  77. package/lib/service/mothership/index.js +0 -1
  78. package/lib/service/nats/index.js +2 -3
  79. package/lib/utils/bouncer/features/Provider.js +0 -3
  80. package/package.json +22 -24
@@ -0,0 +1,13 @@
1
+ import Base from "../../Base";
2
+ import { Version } from "../../interfaces/global";
3
+ import { FridaySpace } from "./space";
4
+ export default class Friday extends Base {
5
+ get space(): FridaySpace;
6
+ private _space?;
7
+ /**
8
+ * Requests the endpoint version
9
+ * @returns Version object
10
+ */
11
+ version(): Promise<Version>;
12
+ protected getEndpoint(endpoint: string): string;
13
+ }
@@ -0,0 +1,35 @@
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 space_1 = require("./space");
14
+ class Friday extends Base_1.default {
15
+ get space() {
16
+ if (this._space === undefined) {
17
+ this._space = new space_1.FridaySpace(this.options, this.axios);
18
+ }
19
+ return this._space;
20
+ }
21
+ /**
22
+ * Requests the endpoint version
23
+ * @returns Version object
24
+ */
25
+ version() {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ const resp = yield this.axios.get(this.getEndpoint("/v1/version"));
28
+ return resp.data;
29
+ });
30
+ }
31
+ getEndpoint(endpoint) {
32
+ return `${this.options.server}/api/friday${endpoint}`;
33
+ }
34
+ }
35
+ exports.default = Friday;
@@ -0,0 +1,58 @@
1
+ import Base from "../../../../../Base";
2
+ import { Document, DocumentCreateDto, DocumentPatchDto } from "../../../../../interfaces/friday";
3
+ import { PaginatedResponse, SearchParams } from "../../../../../interfaces/global";
4
+ export declare class FridayDocument extends Base {
5
+ /**
6
+ * Retrieves all Documents of a Friday Database which match the provided search filter(s). Will return all Documents of the Database if no filter is provided.
7
+ * @param orgName Name of the Organization
8
+ * @param spaceName Name of the Space
9
+ * @param dbName Name of the Database
10
+ * @param filters (optional) Array of search filters
11
+ * @param sorting (optional) Sorting object
12
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
13
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
14
+ * @returns Object containing an array of Documents and the total number of results found in the database (independent of limit and page)
15
+ */
16
+ searchDatabases({ orgName, spaceName, dbName, filters, sorting, limit, page, }: SearchParams & {
17
+ orgName: string;
18
+ spaceName: string;
19
+ dbName: string;
20
+ }): Promise<PaginatedResponse<Document>>;
21
+ /**
22
+ * Retrieves a Document by its name.
23
+ * @param orgName Name of the Organization
24
+ * @param spaceName Name of the Space
25
+ * @param dbName Name of the Database
26
+ * @param key Key of the Document
27
+ * @returns The requested Document
28
+ */
29
+ getDocument(orgName: string, spaceName: string, dbName: string, key: string): Promise<Document>;
30
+ /**
31
+ * Creates a new Document in the provided Database.
32
+ * @param orgName Name of the Organization
33
+ * @param spaceName Name of the Space
34
+ * @param dbName Name of the Database
35
+ * @param document New document details
36
+ * @returns The created Document
37
+ */
38
+ createDocument(orgName: string, spaceName: string, dbName: string, document: DocumentCreateDto): Promise<Document>;
39
+ /**
40
+ * Update existing Document
41
+ * @param orgName Name of the Organization
42
+ * @param spaceName Name of the Space
43
+ * @param dbName Name of the Database
44
+ * @param key Key of the Document
45
+ * @param document New value to update the Document
46
+ * @returns Updated Document
47
+ */
48
+ updateDocument(orgName: string, spaceName: string, dbName: string, key: string, document: DocumentPatchDto): Promise<Document>;
49
+ /**
50
+ * Deletes a Document by its key.
51
+ * @param orgName Name of the Organization
52
+ * @param spaceName Name of the Space
53
+ * @param dbName Name of the Database
54
+ * @param key Key of the Document
55
+ */
56
+ deleteDocument(orgName: string, spaceName: string, dbName: string, key: string): Promise<void>;
57
+ protected getEndpoint(endpoint: string): string;
58
+ }
@@ -0,0 +1,97 @@
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.FridayDocument = void 0;
13
+ const Base_1 = require("../../../../../Base");
14
+ const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
15
+ const searchFilter_1 = require("../../../../../helper/searchFilter");
16
+ class FridayDocument extends Base_1.default {
17
+ /**
18
+ * Retrieves all Documents of a Friday Database which match the provided search filter(s). Will return all Documents of the Database if no filter is provided.
19
+ * @param orgName Name of the Organization
20
+ * @param spaceName Name of the Space
21
+ * @param dbName Name of the Database
22
+ * @param filters (optional) Array of search filters
23
+ * @param sorting (optional) Sorting object
24
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
25
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
26
+ * @returns Object containing an array of Documents and the total number of results found in the database (independent of limit and page)
27
+ */
28
+ searchDatabases(_a) {
29
+ return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, dbName, filters, sorting, limit = 25, page = 0, }) {
30
+ const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
31
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/search?page=${page}&limit=${limit}`), {
32
+ filters: filtersDTO,
33
+ sorting: sorting,
34
+ });
35
+ return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
36
+ });
37
+ }
38
+ /**
39
+ * Retrieves a Document by its name.
40
+ * @param orgName Name of the Organization
41
+ * @param spaceName Name of the Space
42
+ * @param dbName Name of the Database
43
+ * @param key Key of the Document
44
+ * @returns The requested Document
45
+ */
46
+ getDocument(orgName, spaceName, dbName, key) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}`));
49
+ return resp.data;
50
+ });
51
+ }
52
+ /**
53
+ * Creates a new Document in the provided Database.
54
+ * @param orgName Name of the Organization
55
+ * @param spaceName Name of the Space
56
+ * @param dbName Name of the Database
57
+ * @param document New document details
58
+ * @returns The created Document
59
+ */
60
+ createDocument(orgName, spaceName, dbName, document) {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents`), document);
63
+ return resp.data;
64
+ });
65
+ }
66
+ /**
67
+ * Update existing Document
68
+ * @param orgName Name of the Organization
69
+ * @param spaceName Name of the Space
70
+ * @param dbName Name of the Database
71
+ * @param key Key of the Document
72
+ * @param document New value to update the Document
73
+ * @returns Updated Document
74
+ */
75
+ updateDocument(orgName, spaceName, dbName, key, document) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}`), document);
78
+ return resp.data;
79
+ });
80
+ }
81
+ /**
82
+ * Deletes a Document by its key.
83
+ * @param orgName Name of the Organization
84
+ * @param spaceName Name of the Space
85
+ * @param dbName Name of the Database
86
+ * @param key Key of the Document
87
+ */
88
+ deleteDocument(orgName, spaceName, dbName, key) {
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}`));
91
+ });
92
+ }
93
+ getEndpoint(endpoint) {
94
+ return `${this.options.server}/api/friday${endpoint}`;
95
+ }
96
+ }
97
+ exports.FridayDocument = FridayDocument;
@@ -0,0 +1,55 @@
1
+ import Base from "../../../../Base";
2
+ import { Database } from "../../../../interfaces/friday";
3
+ import { PaginatedResponse, SearchParams } from "../../../../interfaces/global";
4
+ import { FridayDocument } from "./document";
5
+ export declare class FridayDatabase extends Base {
6
+ get document(): FridayDocument;
7
+ private _document?;
8
+ /**
9
+ * Retrieves all Databases of a Friday Space which match the provided search filter(s). Will return all Databases of the Space if no filter is provided.
10
+ * @param orgName Name of the Organization
11
+ * @param spaceName Name of the Space
12
+ * @param filters (optional) Array of search filters
13
+ * @param sorting (optional) Sorting object
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 Databases and the total number of results found in the database (independent of limit and page)
17
+ */
18
+ searchDatabases({ orgName, spaceName, filters, sorting, limit, page, }: SearchParams & {
19
+ orgName: string;
20
+ spaceName: string;
21
+ }): Promise<PaginatedResponse<Database>>;
22
+ /**
23
+ * Retrieves a Database by its name.
24
+ * @param orgName Name of the Organization
25
+ * @param spaceName Name of the Space
26
+ * @param dbName Name of the Database
27
+ * @returns The requested Database
28
+ */
29
+ getDatabase(orgName: string, spaceName: string, dbName: string): Promise<Database>;
30
+ /**
31
+ * Creates a new Database in the provided Space.
32
+ * @param orgName Name of the Organization
33
+ * @param spaceName Name of the Space
34
+ * @param name Name of the new Database
35
+ * @returns The created Database
36
+ */
37
+ createDatabase(orgName: string, spaceName: string, name: string): Promise<Database>;
38
+ /**
39
+ * Rename a Database
40
+ * @param orgName Name of the Organization
41
+ * @param spaceName Name of the Space
42
+ * @param dbName Name of the Database
43
+ * @param name New name of the Database
44
+ * @returns Updated Database
45
+ */
46
+ renameDatabase(orgName: string, spaceName: string, dbName: string, name: string): Promise<Database>;
47
+ /**
48
+ * Deletes a Database by its name.
49
+ * @param orgName Name of the Organization
50
+ * @param spaceName Name of the Space
51
+ * @param dbName Name of the Database
52
+ */
53
+ deleteDatabase(orgName: string, spaceName: string, dbName: string): Promise<void>;
54
+ protected getEndpoint(endpoint: string): string;
55
+ }
@@ -0,0 +1,101 @@
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.FridayDatabase = void 0;
13
+ const Base_1 = require("../../../../Base");
14
+ const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseHelper");
15
+ const searchFilter_1 = require("../../../../helper/searchFilter");
16
+ const document_1 = require("./document");
17
+ class FridayDatabase extends Base_1.default {
18
+ get document() {
19
+ if (this._document === undefined) {
20
+ this._document = new document_1.FridayDocument(this.options, this.axios);
21
+ }
22
+ return this._document;
23
+ }
24
+ /**
25
+ * Retrieves all Databases of a Friday Space which match the provided search filter(s). Will return all Databases of the Space if no filter is provided.
26
+ * @param orgName Name of the Organization
27
+ * @param spaceName Name of the Space
28
+ * @param filters (optional) Array of search filters
29
+ * @param sorting (optional) Sorting object
30
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
31
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
32
+ * @returns Object containing an array of Databases and the total number of results found in the database (independent of limit and page)
33
+ */
34
+ searchDatabases(_a) {
35
+ return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0, }) {
36
+ const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
37
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/search?page=${page}&limit=${limit}`), {
38
+ filters: filtersDTO,
39
+ sorting: sorting,
40
+ });
41
+ return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
42
+ });
43
+ }
44
+ /**
45
+ * Retrieves a Database by its name.
46
+ * @param orgName Name of the Organization
47
+ * @param spaceName Name of the Space
48
+ * @param dbName Name of the Database
49
+ * @returns The requested Database
50
+ */
51
+ getDatabase(orgName, spaceName, dbName) {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}`));
54
+ return resp.data;
55
+ });
56
+ }
57
+ /**
58
+ * Creates a new Database in the provided Space.
59
+ * @param orgName Name of the Organization
60
+ * @param spaceName Name of the Space
61
+ * @param name Name of the new Database
62
+ * @returns The created Database
63
+ */
64
+ createDatabase(orgName, spaceName, name) {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases`), { name });
67
+ return resp.data;
68
+ });
69
+ }
70
+ /**
71
+ * Rename a Database
72
+ * @param orgName Name of the Organization
73
+ * @param spaceName Name of the Space
74
+ * @param dbName Name of the Database
75
+ * @param name New name of the Database
76
+ * @returns Updated Database
77
+ */
78
+ renameDatabase(orgName, spaceName, dbName, name) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/name`), {
81
+ name: name,
82
+ });
83
+ return resp.data;
84
+ });
85
+ }
86
+ /**
87
+ * Deletes a Database by its name.
88
+ * @param orgName Name of the Organization
89
+ * @param spaceName Name of the Space
90
+ * @param dbName Name of the Database
91
+ */
92
+ deleteDatabase(orgName, spaceName, dbName) {
93
+ return __awaiter(this, void 0, void 0, function* () {
94
+ yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}`));
95
+ });
96
+ }
97
+ getEndpoint(endpoint) {
98
+ return `${this.options.server}/api/friday${endpoint}`;
99
+ }
100
+ }
101
+ exports.FridayDatabase = FridayDatabase;
@@ -0,0 +1,81 @@
1
+ import Base from "../../../Base";
2
+ import { FridaySpace as Space, FridaySpaceEntityPermission as SpaceEntityPermission, FridaySpacePermission as SpacePermission } from "../../../interfaces/friday/space";
3
+ import { PaginatedResponse, SearchParams } from "../../../interfaces/global";
4
+ import { FridayDatabase } from "./database";
5
+ export declare class FridaySpace extends Base {
6
+ get database(): FridayDatabase;
7
+ private _database?;
8
+ /**
9
+ * Retrieves all Friday Spaces of the specified Organization matching the search filter(s). Will return all Spaces if no search filter is provided.
10
+ * @param orgName Name of the organization
11
+ * @param filters (optional) Array of search filters
12
+ * @param sorting (optional) Sorting object
13
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
14
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
15
+ * @returns Object containing an array of Friday Spaces and the total number of results found in the database (independent of limit and page)
16
+ */
17
+ searchSpaces({ orgName, filters, sorting, limit, page }: SearchParams & {
18
+ orgName: string;
19
+ }): Promise<PaginatedResponse<Space>>;
20
+ /**
21
+ * Retrieves a Friday Space by its name.
22
+ * @param orgName Name of the Organization
23
+ * @param spaceName Name of the Friday Space
24
+ * @returns The requested Space
25
+ */
26
+ getSpace(orgName: string, spaceName: string): Promise<Space>;
27
+ /**
28
+ * Creates a new Friday Space in the specified Organization.
29
+ * @param orgName Name of the Organization
30
+ * @param name Name for the new Space
31
+ * @returns The created Space
32
+ */
33
+ createSpace(orgName: string, name: string): Promise<Space>;
34
+ /**
35
+ * Delete a space by its name.
36
+ * @param orgName Name of the Organization
37
+ * @param spaceName Name of the Space
38
+ */
39
+ deleteSpace(orgName: string, spaceName: string): Promise<void>;
40
+ /**
41
+ * Updates the name of a space.
42
+ * @param orgName Name of the organization
43
+ * @param spaceName Current name of the space
44
+ * @param newSpaceName New name for the space
45
+ * @returns The updated space
46
+ */
47
+ renameSpace(orgName: string, spaceName: string, newSpaceName: string): Promise<Space>;
48
+ /**
49
+ * Retrieves permissions of a space matching the search filter(s). Will return all permissions of the space if no search filter is provided.
50
+ * @param orgName Name of the organization
51
+ * @param spaceName Name of the space
52
+ * @param filters (optional) Array of search filters
53
+ * @param sorting (optional) Sorting object
54
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
55
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
56
+ * @returns Object containing an array of Friday Space Permissions and the total number of results found in the database (independent of limit and page)
57
+ */
58
+ searchSpacePermissions({ orgName, spaceName, filters, sorting, limit, page, }: SearchParams & {
59
+ orgName: string;
60
+ spaceName: string;
61
+ }): Promise<PaginatedResponse<SpaceEntityPermission>>;
62
+ /**
63
+ * Adds/Updates/Removes the permission a user has in the specified space.
64
+ * @param orgName Name of the Organization
65
+ * @param spaceName Name of the Space
66
+ * @param userId ID of the User
67
+ * @param permission New permission
68
+ * @returns The Space with updated permissions
69
+ */
70
+ updateUserSpacePermission(orgName: string, spaceName: string, userId: string, permission: SpacePermission): Promise<SpaceEntityPermission>;
71
+ /**
72
+ * Adds/Updates/Removes the permission a team has in the specified space. Note: A team cannot be an owner of a Space.
73
+ * @param orgName Name of the Organization
74
+ * @param spaceName Name of the Space
75
+ * @param teamName Name of the Team
76
+ * @param permission New permission
77
+ * @returns The Space with updated permissions
78
+ */
79
+ updateTeamSpacePermission(orgName: string, spaceName: string, teamName: string, permission: SpacePermission): Promise<SpaceEntityPermission>;
80
+ protected getEndpoint(endpoint: string): string;
81
+ }
@@ -0,0 +1,150 @@
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.FridaySpace = void 0;
13
+ const Base_1 = require("../../../Base");
14
+ const paginatedResponseHelper_1 = require("../../../helper/paginatedResponseHelper");
15
+ const searchFilter_1 = require("../../../helper/searchFilter");
16
+ const database_1 = require("./database");
17
+ class FridaySpace extends Base_1.default {
18
+ get database() {
19
+ if (this._database === undefined) {
20
+ this._database = new database_1.FridayDatabase(this.options, this.axios);
21
+ }
22
+ return this._database;
23
+ }
24
+ /**
25
+ * Retrieves all Friday Spaces of the specified Organization matching the search filter(s). Will return all Spaces if no search filter is provided.
26
+ * @param orgName Name of the organization
27
+ * @param filters (optional) Array of search filters
28
+ * @param sorting (optional) Sorting object
29
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
30
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
31
+ * @returns Object containing an array of Friday Spaces and the total number of results found in the database (independent of limit and page)
32
+ */
33
+ searchSpaces(_a) {
34
+ return __awaiter(this, arguments, void 0, function* ({ orgName, filters, sorting, limit = 25, page = 0 }) {
35
+ const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
36
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/search?page=${page}&limit=${limit}`), {
37
+ filters: filtersDTO,
38
+ sorting: sorting,
39
+ });
40
+ return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
41
+ });
42
+ }
43
+ /**
44
+ * Retrieves a Friday Space by its name.
45
+ * @param orgName Name of the Organization
46
+ * @param spaceName Name of the Friday Space
47
+ * @returns The requested Space
48
+ */
49
+ getSpace(orgName, spaceName) {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}`));
52
+ return resp.data;
53
+ });
54
+ }
55
+ /**
56
+ * Creates a new Friday Space in the specified Organization.
57
+ * @param orgName Name of the Organization
58
+ * @param name Name for the new Space
59
+ * @returns The created Space
60
+ */
61
+ createSpace(orgName, name) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces`), { name });
64
+ return resp.data;
65
+ });
66
+ }
67
+ /**
68
+ * Delete a space by its name.
69
+ * @param orgName Name of the Organization
70
+ * @param spaceName Name of the Space
71
+ */
72
+ deleteSpace(orgName, spaceName) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}`));
75
+ });
76
+ }
77
+ /**
78
+ * Updates the name of a space.
79
+ * @param orgName Name of the organization
80
+ * @param spaceName Current name of the space
81
+ * @param newSpaceName New name for the space
82
+ * @returns The updated space
83
+ */
84
+ renameSpace(orgName, spaceName, newSpaceName) {
85
+ return __awaiter(this, void 0, void 0, function* () {
86
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/name`), {
87
+ newSpaceName,
88
+ });
89
+ return resp.data;
90
+ });
91
+ }
92
+ /**
93
+ * Retrieves permissions of a space matching the search filter(s). Will return all permissions of the space if no search filter is provided.
94
+ * @param orgName Name of the organization
95
+ * @param spaceName Name of the space
96
+ * @param filters (optional) Array of search filters
97
+ * @param sorting (optional) Sorting object
98
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
99
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
100
+ * @returns Object containing an array of Friday Space Permissions and the total number of results found in the database (independent of limit and page)
101
+ */
102
+ searchSpacePermissions(_a) {
103
+ return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0, }) {
104
+ const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
105
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/permissions/search?page=${page}&limit=${limit}`), {
106
+ filters: filtersDTO,
107
+ sorting: sorting,
108
+ });
109
+ return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
110
+ });
111
+ }
112
+ /**
113
+ * Adds/Updates/Removes the permission a user has in the specified space.
114
+ * @param orgName Name of the Organization
115
+ * @param spaceName Name of the Space
116
+ * @param userId ID of the User
117
+ * @param permission New permission
118
+ * @returns The Space with updated permissions
119
+ */
120
+ updateUserSpacePermission(orgName, spaceName, userId, permission) {
121
+ return __awaiter(this, void 0, void 0, function* () {
122
+ const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/permissions/user`), {
123
+ userId,
124
+ permission,
125
+ });
126
+ return resp.data;
127
+ });
128
+ }
129
+ /**
130
+ * Adds/Updates/Removes the permission a team has in the specified space. Note: A team cannot be an owner of a Space.
131
+ * @param orgName Name of the Organization
132
+ * @param spaceName Name of the Space
133
+ * @param teamName Name of the Team
134
+ * @param permission New permission
135
+ * @returns The Space with updated permissions
136
+ */
137
+ updateTeamSpacePermission(orgName, spaceName, teamName, permission) {
138
+ return __awaiter(this, void 0, void 0, function* () {
139
+ const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/permissions/team`), {
140
+ teamName,
141
+ permission,
142
+ });
143
+ return resp.data;
144
+ });
145
+ }
146
+ getEndpoint(endpoint) {
147
+ return `${this.options.server}/api/friday${endpoint}`;
148
+ }
149
+ }
150
+ exports.FridaySpace = FridaySpace;
@@ -57,7 +57,9 @@ class OperationQueue {
57
57
  this.parent = parent;
58
58
  }
59
59
  send(orgName, spaceName, eventName, streamId, designHash) {
60
- return this.parent.send(orgName, spaceName, eventName, streamId, designHash, this.operations);
60
+ const entriesToSend = [...this.operations];
61
+ this.operations = [];
62
+ return this.parent.send(orgName, spaceName, eventName, streamId, designHash, entriesToSend);
61
63
  }
62
64
  addNode(details) {
63
65
  const op = {
@@ -14,9 +14,12 @@ export declare class High5SpaceExecute extends Base {
14
14
  * @param spaceName the spaces's name
15
15
  * @param streamId to identify the stream
16
16
  * @param high5ExecutionRequest the stream execution request, containing the data, target, wait boolean and timeout
17
+ * @param design if true the stream will execute the current design rather than the published design build
18
+ * @param debug if true the stream will execute in debug mode and consider breakpoints
19
+ * @param overrideUserAgent if true the User-Agent header will be overwritten with "hcloud-stream" to identify this execution got triggered from within a stream with the TriggerStreamAction node
17
20
  * @returns the stream result
18
21
  */
19
- executeHigh5Stream(orgName: string, spaceName: string, streamId: string, high5ExecutionRequest: High5ExecutionRequest, design?: boolean, debug?: boolean): Promise<High5ExecutionResponse>;
22
+ executeHigh5Stream(orgName: string, spaceName: string, streamId: string, high5ExecutionRequest: High5ExecutionRequest, design?: boolean, debug?: boolean, overrideUserAgent?: boolean): Promise<High5ExecutionResponse>;
20
23
  /**
21
24
  * Executes all streams within an event.
22
25
  * @param orgName Name of the Organization
@@ -32,10 +32,16 @@ class High5SpaceExecute extends Base_1.default {
32
32
  * @param spaceName the spaces's name
33
33
  * @param streamId to identify the stream
34
34
  * @param high5ExecutionRequest the stream execution request, containing the data, target, wait boolean and timeout
35
+ * @param design if true the stream will execute the current design rather than the published design build
36
+ * @param debug if true the stream will execute in debug mode and consider breakpoints
37
+ * @param overrideUserAgent if true the User-Agent header will be overwritten with "hcloud-stream" to identify this execution got triggered from within a stream with the TriggerStreamAction node
35
38
  * @returns the stream result
36
39
  */
37
40
  executeHigh5Stream(orgName_1, spaceName_1, streamId_1, high5ExecutionRequest_1) {
38
- return __awaiter(this, arguments, void 0, function* (orgName, spaceName, streamId, high5ExecutionRequest, design = false, debug = false) {
41
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, streamId, high5ExecutionRequest, design = false, debug = false, overrideUserAgent = false) {
42
+ if (overrideUserAgent) {
43
+ this.axios.defaults.headers.common["User-Agent"] = "hcloud-stream";
44
+ }
39
45
  const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/execute/stream/id/${streamId}`), high5ExecutionRequest, {
40
46
  params: {
41
47
  design,
@@ -102,7 +108,7 @@ class High5SpaceExecute extends Base_1.default {
102
108
  */
103
109
  issueDebugCommand(orgName, spaceName, executionId, command) {
104
110
  return __awaiter(this, void 0, void 0, function* () {
105
- yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/execute/${executionId}`), command);
111
+ yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/execute/${executionId}/debug`), command);
106
112
  });
107
113
  }
108
114
  /**