hcloud-sdk 18.0.0 → 19.1.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 +17 -184
- package/lib/Hcloud.d.ts +18 -3
- package/lib/Hcloud.js +113 -21
- package/lib/helper/ErrorHelper.js +5 -2
- package/lib/helper/ValidationHelper.d.ts +6 -4
- package/lib/helper/ValidationHelper.js +30 -18
- package/lib/interfaces/agent/index.d.ts +1 -0
- package/lib/interfaces/agent/logging/cloudwatch.d.ts +23 -0
- package/lib/interfaces/agent/logging/index.d.ts +2 -0
- package/lib/interfaces/{fuse → agent/logging}/index.js +2 -3
- package/lib/interfaces/agent/logging/log-collector.d.ts +35 -0
- package/lib/interfaces/agent/logging/log-collector.js +2 -0
- package/lib/interfaces/agent/module/index.d.ts +7 -0
- package/lib/interfaces/agent/module/index.js +2 -0
- package/lib/interfaces/auditor/index.d.ts +0 -1
- package/lib/interfaces/auditor/index.js +0 -1
- package/lib/interfaces/axios/index.d.ts +5 -0
- package/lib/interfaces/cosmo/asset/index.d.ts +45 -9
- package/lib/interfaces/cosmo/asset/index.js +9 -1
- package/lib/interfaces/cosmo/comment/index.d.ts +18 -1
- package/lib/interfaces/cosmo/comment/index.js +13 -1
- package/lib/interfaces/cosmo/event/index.d.ts +34 -5
- package/lib/interfaces/cosmo/event/index.js +16 -2
- package/lib/interfaces/cosmo/share/index.d.ts +100 -8
- package/lib/interfaces/cosmo/share/index.js +21 -0
- package/lib/interfaces/cosmo/space/index.d.ts +6 -0
- package/lib/interfaces/cosmo/stats/index.d.ts +11 -0
- package/lib/interfaces/cosmo/stats/index.js +2 -0
- package/lib/interfaces/cosmo/tag/tag.d.ts +3 -1
- package/lib/interfaces/global/Products.d.ts +0 -1
- package/lib/interfaces/global/Products.js +0 -1
- package/lib/interfaces/global/Views.d.ts +0 -1
- package/lib/interfaces/global/Views.js +0 -1
- package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +1 -0
- package/lib/interfaces/high5/space/event/stream/node/index.d.ts +1 -0
- package/lib/interfaces/high5/space/execution/index.d.ts +5 -1
- package/lib/interfaces/high5/space/job/JobLog.d.ts +10 -6
- package/lib/interfaces/high5/space/job/index.d.ts +65 -20
- package/lib/interfaces/high5/space/job/index.js +9 -6
- package/lib/interfaces/high5/wave/dependentInputs.d.ts +42 -0
- package/lib/interfaces/high5/wave/dependentInputs.js +144 -0
- package/lib/interfaces/high5/wave/dependentInputsValidation.d.ts +22 -0
- package/lib/interfaces/high5/wave/dependentInputsValidation.js +220 -0
- package/lib/interfaces/high5/wave/index.d.ts +9 -0
- package/lib/interfaces/high5/wave/index.js +4 -0
- package/lib/interfaces/idp/index.d.ts +3 -3
- package/lib/interfaces/idp/index.js +3 -3
- package/lib/interfaces/idp/oauth/device.d.ts +18 -0
- package/lib/interfaces/idp/oauth/device.js +2 -0
- package/lib/interfaces/idp/oauth/index.d.ts +17 -4
- package/lib/interfaces/idp/organization/index.d.ts +1 -0
- package/lib/interfaces/idp/organization/index.js +1 -0
- package/lib/interfaces/idp/organization/settings/oauthApp/index.d.ts +4 -0
- package/lib/interfaces/idp/user/Message.d.ts +1 -0
- package/lib/interfaces/idp/user/Scopes.d.ts +1 -9
- package/lib/interfaces/idp/user/Scopes.js +0 -12
- package/lib/interfaces/idp/user/index.d.ts +3 -0
- package/lib/interfaces/mailer/index.d.ts +20 -1
- package/lib/interfaces/mailer/index.js +14 -2
- package/lib/interfaces/nats/index.d.ts +30 -32
- package/lib/interfaces/nats/index.js +103 -117
- package/lib/interfaces/shorts/index.d.ts +7 -0
- package/lib/interfaces/shorts/index.js +6 -0
- package/lib/service/agent/bundle/dev/index.js +4 -1
- package/lib/service/agent/bundle/index.js +4 -1
- package/lib/service/agent/context/index.js +4 -1
- package/lib/service/agent/index.d.ts +6 -0
- package/lib/service/agent/index.js +18 -1
- package/lib/service/agent/installer/index.js +4 -1
- package/lib/service/agent/logging/index.d.ts +69 -0
- package/lib/service/agent/logging/index.js +117 -0
- package/lib/service/agent/module/index.d.ts +36 -0
- package/lib/service/agent/module/index.js +65 -0
- package/lib/service/auditor/index.js +4 -1
- package/lib/service/auditor/internal/index.js +4 -1
- package/lib/service/bouncer/features/index.js +4 -1
- package/lib/service/bouncer/index.js +5 -2
- package/lib/service/cosmo/asset/index.d.ts +49 -3
- package/lib/service/cosmo/asset/index.js +111 -5
- package/lib/service/cosmo/comment/index.d.ts +10 -37
- package/lib/service/cosmo/comment/index.js +20 -43
- package/lib/service/cosmo/event/index.js +4 -1
- package/lib/service/cosmo/folder/index.js +4 -1
- package/lib/service/cosmo/index.d.ts +3 -0
- package/lib/service/cosmo/index.js +11 -1
- package/lib/service/cosmo/internal/index.js +4 -1
- package/lib/service/cosmo/internal/space/index.js +4 -1
- package/lib/service/cosmo/location/index.js +4 -1
- package/lib/service/cosmo/namespace/index.d.ts +15 -1
- package/lib/service/cosmo/namespace/index.js +21 -1
- package/lib/service/cosmo/organization/index.js +4 -1
- package/lib/service/cosmo/permissions/index.js +4 -1
- package/lib/service/cosmo/production/index.js +4 -1
- package/lib/service/cosmo/share/index.d.ts +55 -29
- package/lib/service/cosmo/share/index.js +71 -35
- package/lib/service/cosmo/space/index.d.ts +28 -1
- package/lib/service/cosmo/space/index.js +45 -1
- package/lib/service/cosmo/stats/index.d.ts +35 -0
- package/lib/service/cosmo/stats/index.js +58 -0
- package/lib/service/cosmo/tag/index.d.ts +13 -0
- package/lib/service/cosmo/tag/index.js +22 -1
- package/lib/service/dali/DaliAvatar.d.ts +0 -6
- package/lib/service/dali/DaliAvatar.js +4 -11
- package/lib/service/dali/avatar/DaliCosmoSpace.js +4 -1
- package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +2 -1
- package/lib/service/dali/avatar/DaliHigh5Pool.js +5 -2
- package/lib/service/dali/avatar/DaliHigh5Space.d.ts +2 -1
- package/lib/service/dali/avatar/DaliHigh5Space.js +5 -2
- package/lib/service/dali/avatar/DaliOAuthApp.d.ts +2 -1
- package/lib/service/dali/avatar/DaliOAuthApp.js +5 -2
- package/lib/service/dali/avatar/DaliOrganization.d.ts +2 -1
- package/lib/service/dali/avatar/DaliOrganization.js +5 -2
- package/lib/service/dali/avatar/DaliServiceAccount.d.ts +1 -1
- package/lib/service/dali/avatar/DaliServiceAccount.js +6 -3
- package/lib/service/dali/avatar/DaliTeam.d.ts +2 -1
- package/lib/service/dali/avatar/DaliTeam.js +5 -2
- package/lib/service/dali/avatar/DaliUser.d.ts +2 -1
- package/lib/service/dali/avatar/DaliUser.js +5 -2
- package/lib/service/dali/index.js +4 -1
- package/lib/service/high5/execution/index.js +4 -1
- package/lib/service/high5/execution/log/index.js +4 -1
- package/lib/service/high5/execution/status/index.js +4 -1
- package/lib/service/high5/index.js +4 -1
- package/lib/service/high5/internal/index.js +4 -1
- package/lib/service/high5/internal/space/index.js +4 -1
- package/lib/service/high5/internal/space/job/index.js +4 -1
- package/lib/service/high5/internal/space/job/log/index.js +4 -1
- package/lib/service/high5/joinToken/index.js +4 -1
- package/lib/service/high5/space/database/document/array/index.js +4 -1
- package/lib/service/high5/space/database/document/index.js +4 -1
- package/lib/service/high5/space/database/document/number/index.js +4 -1
- package/lib/service/high5/space/database/index.js +4 -1
- package/lib/service/high5/space/event/index.js +4 -1
- package/lib/service/high5/space/event/stream/design/DesignOperations.js +4 -1
- package/lib/service/high5/space/event/stream/design/index.js +6 -3
- package/lib/service/high5/space/event/stream/design/snapshot/index.js +4 -1
- package/lib/service/high5/space/event/stream/index.js +4 -1
- package/lib/service/high5/space/execution/index.d.ts +2 -1
- package/lib/service/high5/space/execution/index.js +7 -3
- package/lib/service/high5/space/execution/log/index.js +4 -1
- package/lib/service/high5/space/execution/status/index.js +4 -1
- package/lib/service/high5/space/index.d.ts +10 -0
- package/lib/service/high5/space/index.js +25 -5
- package/lib/service/high5/space/job/index.js +4 -1
- package/lib/service/high5/space/job/log/index.js +4 -1
- package/lib/service/high5/space/node/index.js +4 -1
- package/lib/service/high5/space/pool/index.d.ts +11 -0
- package/lib/service/high5/space/pool/index.js +22 -1
- package/lib/service/high5/space/secret/index.js +4 -1
- package/lib/service/high5/space/stat/index.js +4 -1
- package/lib/service/high5/space/wave/index.js +4 -1
- package/lib/service/high5/space/webhook/index.js +4 -1
- package/lib/service/high5/space/webhook/log/index.js +4 -1
- package/lib/service/high5/stat/index.js +4 -1
- package/lib/service/high5/wave/index.js +4 -1
- package/lib/service/high5/wave/s3/index.js +5 -2
- package/lib/service/idp/guest/index.js +4 -1
- package/lib/service/idp/index.js +4 -1
- package/lib/service/idp/internal/index.js +4 -1
- package/lib/service/idp/oauth/device.d.ts +131 -0
- package/lib/service/idp/oauth/device.js +177 -0
- package/lib/service/idp/oauth/index.d.ts +3 -0
- package/lib/service/idp/oauth/index.js +11 -1
- package/lib/service/idp/organization/index.d.ts +9 -0
- package/lib/service/idp/organization/index.js +22 -3
- package/lib/service/idp/organization/license/index.js +4 -1
- package/lib/service/idp/organization/member/index.js +5 -2
- package/lib/service/idp/organization/member/invitations/index.d.ts +19 -0
- package/lib/service/idp/organization/member/invitations/index.js +23 -1
- package/lib/service/idp/organization/service-accounts/index.d.ts +11 -1
- package/lib/service/idp/organization/service-accounts/index.js +22 -2
- package/lib/service/idp/organization/settings/domain/index.js +4 -1
- package/lib/service/idp/organization/settings/domain/saml/index.js +4 -1
- package/lib/service/idp/organization/settings/index.js +4 -1
- package/lib/service/idp/organization/settings/oauth/index.d.ts +10 -0
- package/lib/service/idp/organization/settings/oauth/index.js +21 -1
- package/lib/service/idp/organization/stat/index.js +4 -1
- package/lib/service/idp/organization/team/index.d.ts +10 -0
- package/lib/service/idp/organization/team/index.js +21 -1
- package/lib/service/idp/registration/index.js +4 -1
- package/lib/service/idp/user/index.d.ts +8 -0
- package/lib/service/idp/user/index.js +20 -3
- package/lib/service/idp/user/license/index.js +4 -1
- package/lib/service/idp/user/message/index.d.ts +1 -0
- package/lib/service/idp/user/message/index.js +4 -1
- package/lib/service/idp/user/password/index.js +4 -1
- package/lib/service/idp/user/settings/connections/index.js +4 -1
- package/lib/service/idp/user/settings/general/index.js +4 -1
- package/lib/service/idp/user/settings/index.js +4 -1
- package/lib/service/idp/user/settings/notifications/index.js +4 -1
- package/lib/service/idp/user/settings/oauthApps/index.js +4 -1
- package/lib/service/idp/user/settings/pats/index.js +4 -1
- package/lib/service/idp/user/settings/twoFactor/index.js +4 -1
- package/lib/service/idp/user/settings/twoFactor/totp/index.js +4 -1
- package/lib/service/mailer/index.js +5 -2
- package/lib/service/mailer/internal/index.d.ts +2 -2
- package/lib/service/mailer/internal/index.js +5 -2
- package/lib/service/mothership/index.js +4 -1
- package/lib/service/nats/index.d.ts +7 -0
- package/lib/service/nats/index.js +19 -1
- package/lib/service/shorts/index.js +4 -1
- package/lib/service/shorts/internal/index.d.ts +6 -3
- package/lib/service/shorts/internal/index.js +20 -6
- package/lib/utils/bouncer/features/Provider.js +0 -1
- package/package.json +2 -2
- package/lib/interfaces/fuse/index.d.ts +0 -3
- package/lib/interfaces/fuse/space/cronjob/Cronjob.d.ts +0 -38
- package/lib/interfaces/fuse/space/cronjob/Cronjob.js +0 -8
- package/lib/interfaces/fuse/space/cronjob/CronjobLog.d.ts +0 -16
- package/lib/interfaces/fuse/space/index.d.ts +0 -22
- package/lib/interfaces/fuse/space/index.js +0 -11
- package/lib/service/dali/avatar/DaliFuseSpace.d.ts +0 -32
- package/lib/service/dali/avatar/DaliFuseSpace.js +0 -59
- package/lib/service/fuse/index.d.ts +0 -20
- package/lib/service/fuse/index.js +0 -48
- package/lib/service/fuse/internal/index.d.ts +0 -10
- package/lib/service/fuse/internal/index.js +0 -32
- package/lib/service/fuse/internal/space/cronjob/index.d.ts +0 -7
- package/lib/service/fuse/internal/space/cronjob/index.js +0 -17
- package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +0 -17
- package/lib/service/fuse/internal/space/cronjob/log/index.js +0 -34
- package/lib/service/fuse/internal/space/index.d.ts +0 -26
- package/lib/service/fuse/internal/space/index.js +0 -51
- package/lib/service/fuse/space/cronjob/index.d.ts +0 -145
- package/lib/service/fuse/space/cronjob/index.js +0 -201
- package/lib/service/fuse/space/cronjob/log/index.d.ts +0 -35
- package/lib/service/fuse/space/cronjob/log/index.js +0 -58
- package/lib/service/fuse/space/index.d.ts +0 -97
- package/lib/service/fuse/space/index.js +0 -153
- /package/lib/interfaces/{fuse/space/cronjob/CronjobLog.js → agent/logging/cloudwatch.js} +0 -0
|
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.IdpOAuthApp = void 0;
|
|
13
|
-
const Base_1 = require("../../../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../../../Base"));
|
|
14
17
|
const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
|
|
15
18
|
const searchFilter_1 = require("../../../../../helper/searchFilter");
|
|
16
19
|
class IdpOAuthApp extends Base_1.default {
|
|
@@ -111,6 +114,23 @@ class IdpOAuthApp extends Base_1.default {
|
|
|
111
114
|
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
112
115
|
});
|
|
113
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Updates the avatar of the specified OAuth App
|
|
119
|
+
* @param orgName Name of the organization
|
|
120
|
+
* @param oauthAppId ID of the OAuthApp
|
|
121
|
+
* @param file Image as Javascript File
|
|
122
|
+
* @returns OAuth App details with updated avatar
|
|
123
|
+
*/
|
|
124
|
+
updateAvatar(orgName, oauthAppId, file, raw) {
|
|
125
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
const data = new FormData();
|
|
127
|
+
data.append("avatar", file);
|
|
128
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/settings/applications/oauth/${oauthAppId}/avatar`), data, {
|
|
129
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
130
|
+
});
|
|
131
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
114
134
|
getEndpoint(endpoint) {
|
|
115
135
|
return `${this.options.server}/api/account${endpoint}`;
|
|
116
136
|
}
|
|
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.IdpOrganizationStat = void 0;
|
|
13
|
-
const Base_1 = require("../../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../../Base"));
|
|
14
17
|
class IdpOrganizationStat extends Base_1.default {
|
|
15
18
|
/**
|
|
16
19
|
* Retrieves usage statistics for a specific organization.
|
|
@@ -80,5 +80,15 @@ export declare class IdpOrganizationTeams extends Base {
|
|
|
80
80
|
}): Promise<MaybeRaw<R, PaginatedResponse<ReducedUser & {
|
|
81
81
|
email: string;
|
|
82
82
|
}>>>;
|
|
83
|
+
/**
|
|
84
|
+
* Updates the avatar of the specified team
|
|
85
|
+
* @param orgName Name of the organization
|
|
86
|
+
* @param teamName Name of the Team
|
|
87
|
+
* @param file Image as Javascript File
|
|
88
|
+
* @returns Team details with updated avatar
|
|
89
|
+
*/
|
|
90
|
+
updateAvatar<R extends boolean = false>(orgName: string, teamName: string, file: File, raw?: {
|
|
91
|
+
raw: R;
|
|
92
|
+
}): Promise<MaybeRaw<R, Team>>;
|
|
83
93
|
protected getEndpoint(endpoint: string): string;
|
|
84
94
|
}
|
|
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.IdpOrganizationTeams = void 0;
|
|
13
|
-
const Base_1 = require("../../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../../Base"));
|
|
14
17
|
const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseHelper");
|
|
15
18
|
const searchFilter_1 = require("../../../../helper/searchFilter");
|
|
16
19
|
class IdpOrganizationTeams extends Base_1.default {
|
|
@@ -118,6 +121,23 @@ class IdpOrganizationTeams extends Base_1.default {
|
|
|
118
121
|
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));
|
|
119
122
|
});
|
|
120
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Updates the avatar of the specified team
|
|
126
|
+
* @param orgName Name of the organization
|
|
127
|
+
* @param teamName Name of the Team
|
|
128
|
+
* @param file Image as Javascript File
|
|
129
|
+
* @returns Team details with updated avatar
|
|
130
|
+
*/
|
|
131
|
+
updateAvatar(orgName, teamName, file, raw) {
|
|
132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
+
const data = new FormData();
|
|
134
|
+
data.append("avatar", file);
|
|
135
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/teams/${teamName}/avatar`), data, {
|
|
136
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
137
|
+
});
|
|
138
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
121
141
|
getEndpoint(endpoint) {
|
|
122
142
|
return `${this.options.server}/api/account/v1/org${endpoint}`;
|
|
123
143
|
}
|
|
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.IdpRegistration = void 0;
|
|
13
|
-
const Base_1 = require("../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
14
17
|
class IdpRegistration extends Base_1.default {
|
|
15
18
|
/**
|
|
16
19
|
* Registers a User in the HCloud system. This endpoint will send a verification link (with expiration date) to the Users' email address.
|
|
@@ -65,6 +65,14 @@ export declare class IdpUser extends Base {
|
|
|
65
65
|
deleteUser<R extends boolean = false>(raw?: {
|
|
66
66
|
raw: R;
|
|
67
67
|
}): Promise<MaybeRaw<R, void>>;
|
|
68
|
+
/**
|
|
69
|
+
* Updates user's avatar
|
|
70
|
+
* @param file Image as Javascript File
|
|
71
|
+
* @returns User details with updated avatar
|
|
72
|
+
*/
|
|
73
|
+
updateAvatar<R extends boolean = false>(file: File, raw?: {
|
|
74
|
+
raw: R;
|
|
75
|
+
}): Promise<MaybeRaw<R, User>>;
|
|
68
76
|
/**
|
|
69
77
|
* Retrieves all Organizations of a user that match the provided search filter(s). Returns all Organizations of the user if no search filter is provided.
|
|
70
78
|
* @param filters (optional) Array of search filters
|
|
@@ -8,14 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.IdpUser = void 0;
|
|
13
|
-
const Base_1 = require("../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
14
17
|
const paginatedResponseHelper_1 = require("../../../helper/paginatedResponseHelper");
|
|
15
18
|
const searchFilter_1 = require("../../../helper/searchFilter");
|
|
16
19
|
const license_1 = require("./license");
|
|
17
20
|
const message_1 = require("./message");
|
|
18
|
-
const password_1 = require("./password");
|
|
21
|
+
const password_1 = __importDefault(require("./password"));
|
|
19
22
|
const settings_1 = require("./settings");
|
|
20
23
|
class IdpUser extends Base_1.default {
|
|
21
24
|
/**
|
|
@@ -114,6 +117,21 @@ class IdpUser extends Base_1.default {
|
|
|
114
117
|
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
115
118
|
});
|
|
116
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Updates user's avatar
|
|
122
|
+
* @param file Image as Javascript File
|
|
123
|
+
* @returns User details with updated avatar
|
|
124
|
+
*/
|
|
125
|
+
updateAvatar(file, raw) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
const data = new FormData();
|
|
128
|
+
data.append("avatar", file);
|
|
129
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/avatar`), data, {
|
|
130
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
131
|
+
});
|
|
132
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
117
135
|
/**
|
|
118
136
|
* Retrieves all Organizations of a user that match the provided search filter(s). Returns all Organizations of the user if no search filter is provided.
|
|
119
137
|
* @param filters (optional) Array of search filters
|
|
@@ -123,7 +141,6 @@ class IdpUser extends Base_1.default {
|
|
|
123
141
|
* @param options (optional) Defines query options to retrieve additional properties for the returned Organization objects.
|
|
124
142
|
* @returns Object containing an array of Organizations and the total number of results found in the database (independent of limit and page)
|
|
125
143
|
*/
|
|
126
|
-
// eslint-disable-next-line complexity
|
|
127
144
|
searchOrganizations(params, raw) {
|
|
128
145
|
return __awaiter(this, void 0, void 0, function* () {
|
|
129
146
|
var _a, _b, _c;
|
|
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.IdpUserLicense = void 0;
|
|
13
|
-
const Base_1 = require("../../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../../Base"));
|
|
14
17
|
class IdpUserLicense extends Base_1.default {
|
|
15
18
|
getLicense(raw) {
|
|
16
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.IdpMessage = void 0;
|
|
13
|
-
const Base_1 = require("../../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../../Base"));
|
|
14
17
|
const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseHelper");
|
|
15
18
|
const searchFilter_1 = require("../../../../helper/searchFilter");
|
|
16
19
|
class IdpMessage extends Base_1.default {
|
|
@@ -8,8 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const Base_1 = require("../../../../Base");
|
|
15
|
+
const Base_1 = __importDefault(require("../../../../Base"));
|
|
13
16
|
class UserPasswordService extends Base_1.default {
|
|
14
17
|
/**
|
|
15
18
|
* 2nd phase of the reset password flow
|
|
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.IdpConnections = void 0;
|
|
13
|
-
const Base_1 = require("../../../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../../../Base"));
|
|
14
17
|
class IdpConnections extends Base_1.default {
|
|
15
18
|
/**
|
|
16
19
|
* Get connection settings for all organizations the user is a part of.
|
|
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.IdpGeneral = void 0;
|
|
13
|
-
const Base_1 = require("../../../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../../../Base"));
|
|
14
17
|
class IdpGeneral extends Base_1.default {
|
|
15
18
|
/**
|
|
16
19
|
* Retrieves the current active user settings.
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.IdpSettings = void 0;
|
|
4
|
-
const Base_1 = require("../../../../Base");
|
|
7
|
+
const Base_1 = __importDefault(require("../../../../Base"));
|
|
5
8
|
const connections_1 = require("./connections");
|
|
6
9
|
const general_1 = require("./general");
|
|
7
10
|
const notifications_1 = require("./notifications");
|
|
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.IdpNotifications = void 0;
|
|
13
|
-
const Base_1 = require("../../../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../../../Base"));
|
|
14
17
|
class IdpNotifications extends Base_1.default {
|
|
15
18
|
/**
|
|
16
19
|
* Retrieves the notification settings of the requesting user.
|
|
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.IdpOAuthApps = void 0;
|
|
13
|
-
const Base_1 = require("../../../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../../../Base"));
|
|
14
17
|
const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
|
|
15
18
|
const searchFilter_1 = require("../../../../../helper/searchFilter");
|
|
16
19
|
class IdpOAuthApps extends Base_1.default {
|
|
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.IdpPat = void 0;
|
|
13
|
-
const Base_1 = require("../../../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../../../Base"));
|
|
14
17
|
const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
|
|
15
18
|
const searchFilter_1 = require("../../../../../helper/searchFilter");
|
|
16
19
|
class IdpPat extends Base_1.default {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.IdpTwoFactor = void 0;
|
|
4
|
-
const Base_1 = require("../../../../../Base");
|
|
7
|
+
const Base_1 = __importDefault(require("../../../../../Base"));
|
|
5
8
|
const totp_1 = require("./totp");
|
|
6
9
|
class IdpTwoFactor extends Base_1.default {
|
|
7
10
|
/**
|
|
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.IdpTotp = void 0;
|
|
13
|
-
const Base_1 = require("../../../../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../../../../Base"));
|
|
14
17
|
class IdpTotp extends Base_1.default {
|
|
15
18
|
/**
|
|
16
19
|
* Creates a new TOTP for the requesting User.
|
|
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const Base_1 = require("../../Base");
|
|
13
|
-
const internal_1 = require("./internal");
|
|
15
|
+
const Base_1 = __importDefault(require("../../Base"));
|
|
16
|
+
const internal_1 = __importDefault(require("./internal"));
|
|
14
17
|
class Mailer extends Base_1.default {
|
|
15
18
|
get internal() {
|
|
16
19
|
if (this._internal === undefined) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
-
import { HtmlMail, MailjetMailDTO, MustacheMail, TemplateMail } from "../../../interfaces/mailer";
|
|
2
|
+
import { HtmlMail, MailjetMailDTO, MailjetResponse, MustacheMail, TemplateMail } from "../../../interfaces/mailer";
|
|
3
3
|
export default class MailerInternal extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* Sends a new mail based on a mailjet template.
|
|
@@ -9,7 +9,7 @@ export default class MailerInternal extends Base {
|
|
|
9
9
|
*/
|
|
10
10
|
sendMailMailjet<R extends boolean = false>(mail: MailjetMailDTO, raw?: {
|
|
11
11
|
raw: R;
|
|
12
|
-
}): Promise<MaybeRaw<R,
|
|
12
|
+
}): Promise<MaybeRaw<R, MailjetResponse>>;
|
|
13
13
|
/**
|
|
14
14
|
* Sends a new mail based on a mustache html body.
|
|
15
15
|
*
|
|
@@ -8,8 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const Base_1 = require("../../../Base");
|
|
15
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
13
16
|
class MailerInternal extends Base_1.default {
|
|
14
17
|
/**
|
|
15
18
|
* Sends a new mail based on a mailjet template.
|
|
@@ -20,7 +23,7 @@ class MailerInternal extends Base_1.default {
|
|
|
20
23
|
sendMailMailjet(mail, raw) {
|
|
21
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
25
|
const resp = yield this.axios.post(this.getEndpoint("/v1/send/mailjet"), mail);
|
|
23
|
-
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp :
|
|
26
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
24
27
|
});
|
|
25
28
|
}
|
|
26
29
|
/**
|
|
@@ -8,8 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const Base_1 = require("../../Base");
|
|
15
|
+
const Base_1 = __importDefault(require("../../Base"));
|
|
13
16
|
const paginatedResponseHelper_1 = require("../../helper/paginatedResponseHelper");
|
|
14
17
|
const searchFilter_1 = require("../../helper/searchFilter");
|
|
15
18
|
class MothershipService extends Base_1.default {
|
|
@@ -45,5 +45,12 @@ declare class Nats extends Base {
|
|
|
45
45
|
requestAndWaitForResponse(subject: string, type: NatsMessageType, objectType: NatsObjectType, object: unknown, options?: RequestOptions): Promise<Msg | undefined>;
|
|
46
46
|
respond(msg: Msg | RawMsg, data: unknown): void;
|
|
47
47
|
protected getEndpoint(endpoint: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* Gracefully closes the NATS connection.
|
|
50
|
+
* * This method uses 'drain' to ensure that all outgoing messages are sent
|
|
51
|
+
* and all buffered incoming messages are processed by their respective subscribers before the connection is physically closed
|
|
52
|
+
* * @returns {Promise<void>} A promise that resolves when the connection is fully drained and closed
|
|
53
|
+
*/
|
|
54
|
+
disconnect(): Promise<void>;
|
|
48
55
|
}
|
|
49
56
|
export default Nats;
|
|
@@ -8,10 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
const nats_1 = require("nats");
|
|
13
16
|
const nats_ws_1 = require("nats.ws");
|
|
14
|
-
const Base_1 = require("../../Base");
|
|
17
|
+
const Base_1 = __importDefault(require("../../Base"));
|
|
15
18
|
const isBrowser = typeof window !== "undefined";
|
|
16
19
|
class Nats extends Base_1.default {
|
|
17
20
|
constructor() {
|
|
@@ -148,5 +151,20 @@ class Nats extends Base_1.default {
|
|
|
148
151
|
getEndpoint(endpoint) {
|
|
149
152
|
return `${this.options.server}/ws/nats${endpoint}`;
|
|
150
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Gracefully closes the NATS connection.
|
|
156
|
+
* * This method uses 'drain' to ensure that all outgoing messages are sent
|
|
157
|
+
* and all buffered incoming messages are processed by their respective subscribers before the connection is physically closed
|
|
158
|
+
* * @returns {Promise<void>} A promise that resolves when the connection is fully drained and closed
|
|
159
|
+
*/
|
|
160
|
+
disconnect() {
|
|
161
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
if (this.natsConnection && !this.natsConnection.isClosed()) {
|
|
163
|
+
yield this.natsConnection.drain();
|
|
164
|
+
this.natsConnection = undefined;
|
|
165
|
+
this.subMap = [];
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
151
169
|
}
|
|
152
170
|
exports.default = Nats;
|
|
@@ -8,8 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const Base_1 = require("../../Base");
|
|
15
|
+
const Base_1 = __importDefault(require("../../Base"));
|
|
13
16
|
const internal_1 = require("./internal");
|
|
14
17
|
class Shorts extends Base_1.default {
|
|
15
18
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
-
import { Short } from "../../../interfaces/shorts";
|
|
2
|
+
import { Short, ShortType } from "../../../interfaces/shorts";
|
|
3
3
|
export declare class ShortsInternal extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* Generates a shortened alias for the provided long URL and sets a maximum number of allowed visits.
|
|
@@ -9,10 +9,13 @@ export declare class ShortsInternal extends Base {
|
|
|
9
9
|
* @param organizationId ID of the organization
|
|
10
10
|
* @param spaceId ID of the space
|
|
11
11
|
* @param url Original long URL that needs to be shortened
|
|
12
|
-
* @param
|
|
12
|
+
* @param type Type of the short URL, can be GENERIC or COSMO
|
|
13
|
+
* @param visitsLimit Optional maximum number of times the shortened link can be accessed, after which it will become inactive (max 100 for GENERIC type)
|
|
14
|
+
* @param expireDate Optional expiration date for the shortened URL, represented as a timestamp in milliseconds
|
|
15
|
+
*
|
|
13
16
|
* @returns the created short url
|
|
14
17
|
*/
|
|
15
|
-
createShort<R extends boolean = false>(organizationId: string, spaceId: string, url: string, visitsLimit
|
|
18
|
+
createShort<R extends boolean = false>(organizationId: string, spaceId: string, url: string, type?: ShortType, visitsLimit?: number, expireDate?: number, raw?: {
|
|
16
19
|
raw: R;
|
|
17
20
|
}): Promise<MaybeRaw<R, Short>>;
|
|
18
21
|
/**
|
|
@@ -8,9 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.ShortsInternal = void 0;
|
|
13
|
-
const Base_1 = require("../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
17
|
+
const shorts_1 = require("../../../interfaces/shorts");
|
|
14
18
|
class ShortsInternal extends Base_1.default {
|
|
15
19
|
/**
|
|
16
20
|
* Generates a shortened alias for the provided long URL and sets a maximum number of allowed visits.
|
|
@@ -20,12 +24,22 @@ class ShortsInternal extends Base_1.default {
|
|
|
20
24
|
* @param organizationId ID of the organization
|
|
21
25
|
* @param spaceId ID of the space
|
|
22
26
|
* @param url Original long URL that needs to be shortened
|
|
23
|
-
* @param
|
|
27
|
+
* @param type Type of the short URL, can be GENERIC or COSMO
|
|
28
|
+
* @param visitsLimit Optional maximum number of times the shortened link can be accessed, after which it will become inactive (max 100 for GENERIC type)
|
|
29
|
+
* @param expireDate Optional expiration date for the shortened URL, represented as a timestamp in milliseconds
|
|
30
|
+
*
|
|
24
31
|
* @returns the created short url
|
|
25
32
|
*/
|
|
26
|
-
createShort(
|
|
27
|
-
return __awaiter(this,
|
|
28
|
-
const res = yield this.axios.post(this.getEndpoint(`/internal/v1/short`), {
|
|
33
|
+
createShort(organizationId_1, spaceId_1, url_1) {
|
|
34
|
+
return __awaiter(this, arguments, void 0, function* (organizationId, spaceId, url, type = shorts_1.ShortType.GENERIC, visitsLimit, expireDate, raw) {
|
|
35
|
+
const res = yield this.axios.post(this.getEndpoint(`/internal/v1/short`), {
|
|
36
|
+
organizationId,
|
|
37
|
+
spaceId,
|
|
38
|
+
url,
|
|
39
|
+
type,
|
|
40
|
+
visitsLimit,
|
|
41
|
+
expireDate,
|
|
42
|
+
});
|
|
29
43
|
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
30
44
|
});
|
|
31
45
|
}
|
|
@@ -98,7 +112,7 @@ class ShortsInternal extends Base_1.default {
|
|
|
98
112
|
});
|
|
99
113
|
}
|
|
100
114
|
getEndpoint(endpoint) {
|
|
101
|
-
return `${this.options.server}/api/
|
|
115
|
+
return `${this.options.server}/api/shorts${endpoint}`;
|
|
102
116
|
}
|
|
103
117
|
}
|
|
104
118
|
exports.ShortsInternal = ShortsInternal;
|
|
@@ -11,7 +11,6 @@ class BouncerProvider {
|
|
|
11
11
|
this.context = context;
|
|
12
12
|
this.logger = logger;
|
|
13
13
|
}
|
|
14
|
-
/* eslint-disable complexity */
|
|
15
14
|
isEnabled(featureName, defaultValue, context) {
|
|
16
15
|
const feature = this.features.find(f => f.name === featureName);
|
|
17
16
|
let result = defaultValue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hcloud-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.1.0",
|
|
4
4
|
"description": "hcloud platform sdk",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"typescript": "^5.8.3"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"axios": "^1.
|
|
53
|
+
"axios": "^1.13.2",
|
|
54
54
|
"nats": "^2.29.3",
|
|
55
55
|
"nats.ws": "^1.30.3"
|
|
56
56
|
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Select } from "../../../../utils/Types";
|
|
2
|
-
import { Header, HttpMethod, ReducedSpace } from "../../../global";
|
|
3
|
-
import { ReducedOrganization } from "../../../idp/organization";
|
|
4
|
-
import { ReducedUser } from "../../../idp/user";
|
|
5
|
-
export interface Cronjob {
|
|
6
|
-
_id: string;
|
|
7
|
-
name: string;
|
|
8
|
-
expression: string;
|
|
9
|
-
organization: ReducedOrganization;
|
|
10
|
-
creator: ReducedUser;
|
|
11
|
-
space: ReducedSpace;
|
|
12
|
-
targetUrl: string;
|
|
13
|
-
httpMethod: HttpMethod;
|
|
14
|
-
acceptInvalidSSL: boolean;
|
|
15
|
-
timezone: string;
|
|
16
|
-
description?: string;
|
|
17
|
-
headers?: Header[];
|
|
18
|
-
body?: string;
|
|
19
|
-
enabled?: boolean;
|
|
20
|
-
createDate: number;
|
|
21
|
-
modifyDate: number;
|
|
22
|
-
nextExecution?: number[];
|
|
23
|
-
lastStatus?: number;
|
|
24
|
-
lastTriggered?: number;
|
|
25
|
-
hmacSettings?: HmacSettings;
|
|
26
|
-
}
|
|
27
|
-
export type HmacSettings = {
|
|
28
|
-
headerName: string;
|
|
29
|
-
secret: string;
|
|
30
|
-
algorithm: HmacHashingAlgo;
|
|
31
|
-
};
|
|
32
|
-
export declare enum HmacHashingAlgo {
|
|
33
|
-
SHA_1 = "SHA-1",
|
|
34
|
-
SHA_256 = "SHA-256"
|
|
35
|
-
}
|
|
36
|
-
export type CronjobCreate = Pick<Cronjob, "name" | "expression" | "targetUrl" | "httpMethod" | "headers" | "body" | "enabled" | "description" | "lastStatus" | "lastTriggered"> & Partial<Pick<Cronjob, "acceptInvalidSSL" | "timezone">> & {
|
|
37
|
-
hmacSettings: Select<HmacSettings, "headerName" | "algorithm", "secret">;
|
|
38
|
-
};
|