hcloud-sdk 17.0.0 → 19.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +87 -76
- package/lib/Base.d.ts +2 -1
- package/lib/Hcloud.d.ts +24 -6
- package/lib/Hcloud.js +127 -24
- package/lib/helper/ErrorHelper.js +5 -2
- package/lib/helper/ValidationHelper.d.ts +14 -4
- package/lib/helper/ValidationHelper.js +71 -11
- package/lib/interfaces/agent/logging/cloudwatch.d.ts +23 -0
- package/lib/interfaces/agent/logging/index.d.ts +2 -0
- package/lib/interfaces/{friday → agent/logging}/index.js +2 -3
- package/lib/interfaces/agent/logging/log-collector.d.ts +35 -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 +13 -3
- package/lib/interfaces/auditor/index.js +9 -2
- package/lib/interfaces/axios/index.d.ts +5 -0
- package/lib/interfaces/cosmo/asset/index.d.ts +216 -0
- package/lib/interfaces/cosmo/asset/index.js +90 -0
- package/lib/interfaces/cosmo/comment/index.d.ts +41 -0
- package/lib/interfaces/cosmo/comment/index.js +8 -0
- package/lib/interfaces/cosmo/event/index.d.ts +60 -0
- package/lib/interfaces/cosmo/event/index.js +31 -0
- package/lib/interfaces/cosmo/location/index.d.ts +4 -0
- package/lib/interfaces/cosmo/location/index.js +2 -0
- package/lib/interfaces/cosmo/namespace/index.d.ts +9 -0
- package/lib/interfaces/cosmo/namespace/index.js +9 -0
- package/lib/interfaces/cosmo/permissions.d.ts +96 -0
- package/lib/interfaces/cosmo/permissions.js +58 -0
- package/lib/interfaces/cosmo/share/index.d.ts +110 -0
- package/lib/interfaces/cosmo/share/index.js +23 -0
- package/lib/interfaces/cosmo/space/index.d.ts +31 -0
- package/lib/interfaces/cosmo/space/index.js +2 -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 +13 -0
- package/lib/interfaces/cosmo/tag/tag.js +2 -0
- package/lib/interfaces/global/Products.d.ts +2 -3
- package/lib/interfaces/global/Products.js +1 -2
- package/lib/interfaces/global/Views.d.ts +0 -1
- package/lib/interfaces/global/Views.js +0 -1
- package/lib/interfaces/high5/index.d.ts +7 -7
- package/lib/interfaces/high5/index.js +7 -7
- package/lib/interfaces/{friday → high5}/space/database/document/index.d.ts +1 -1
- package/lib/interfaces/{friday → high5}/space/database/document/index.js +2 -1
- package/lib/interfaces/high5/space/database/index.js +2 -0
- package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +10 -2
- package/lib/interfaces/high5/space/event/stream/node/index.d.ts +1 -0
- package/lib/interfaces/high5/space/execution/index.d.ts +3 -1
- package/lib/interfaces/{fuse/space/cronjob/CronjobLog.d.ts → high5/space/job/JobLog.d.ts} +3 -3
- package/lib/interfaces/high5/space/job/JobLog.js +2 -0
- package/lib/interfaces/high5/space/job/index.d.ts +83 -0
- package/lib/interfaces/high5/space/job/index.js +11 -0
- package/lib/interfaces/high5/stats.d.ts +21 -0
- package/lib/interfaces/high5/stats.js +2 -0
- 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/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 +19 -5
- package/lib/interfaces/idp/organization/index.d.ts +2 -0
- package/lib/interfaces/idp/organization/index.js +2 -0
- package/lib/interfaces/idp/organization/license/index.d.ts +13 -11
- package/lib/interfaces/idp/organization/member/index.d.ts +1 -0
- package/lib/interfaces/idp/organization/settings/oauthApp/index.d.ts +4 -0
- package/lib/interfaces/idp/organization/stats.d.ts +7 -0
- package/lib/interfaces/idp/organization/stats.js +2 -0
- package/lib/interfaces/idp/organization/team/index.d.ts +0 -1
- package/lib/interfaces/idp/user/Message.d.ts +22 -0
- package/lib/interfaces/idp/user/Message.js +14 -0
- package/lib/interfaces/idp/user/NotificationSettings.d.ts +1 -0
- package/lib/interfaces/idp/user/Scopes.d.ts +1 -15
- package/lib/interfaces/idp/user/Scopes.js +0 -21
- package/lib/interfaces/idp/user/index.d.ts +5 -1
- package/lib/interfaces/mailer/index.d.ts +50 -2
- package/lib/interfaces/mailer/index.js +100 -2
- package/lib/interfaces/mothership/index.d.ts +3 -1
- package/lib/interfaces/mothership/index.js +15 -0
- package/lib/interfaces/mothership/stats.d.ts +4 -0
- package/lib/interfaces/mothership/stats.js +2 -0
- package/lib/interfaces/nats/index.d.ts +79 -51
- package/lib/interfaces/nats/index.js +140 -125
- package/lib/interfaces/shorts/index.d.ts +17 -0
- package/lib/interfaces/shorts/index.js +8 -0
- package/lib/service/agent/bundle/dev/index.d.ts +16 -6
- package/lib/service/agent/bundle/dev/index.js +16 -11
- package/lib/service/agent/bundle/index.d.ts +10 -4
- package/lib/service/agent/bundle/index.js +10 -7
- package/lib/service/agent/context/index.d.ts +22 -8
- package/lib/service/agent/context/index.js +19 -15
- 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.d.ts +8 -4
- package/lib/service/auditor/index.js +9 -6
- package/lib/service/auditor/internal/index.d.ts +27 -3
- package/lib/service/auditor/internal/index.js +38 -6
- package/lib/service/bouncer/features/index.d.ts +4 -2
- package/lib/service/bouncer/features/index.js +6 -3
- package/lib/service/bouncer/index.js +5 -2
- package/lib/service/cosmo/asset/index.d.ts +265 -0
- package/lib/service/cosmo/asset/index.js +420 -0
- package/lib/service/cosmo/comment/index.d.ts +93 -0
- package/lib/service/cosmo/comment/index.js +136 -0
- package/lib/service/cosmo/event/index.d.ts +23 -0
- package/lib/service/cosmo/event/index.js +43 -0
- package/lib/service/cosmo/folder/index.d.ts +27 -0
- package/lib/service/cosmo/folder/index.js +50 -0
- package/lib/service/cosmo/index.d.ts +52 -0
- package/lib/service/cosmo/index.js +129 -0
- package/lib/service/cosmo/internal/index.d.ts +7 -0
- package/lib/service/cosmo/internal/index.js +20 -0
- package/lib/service/cosmo/internal/space/index.d.ts +15 -0
- package/lib/service/cosmo/internal/space/index.js +37 -0
- package/lib/service/cosmo/location/index.d.ts +40 -0
- package/lib/service/cosmo/location/index.js +66 -0
- package/lib/service/cosmo/namespace/index.d.ts +56 -0
- package/lib/service/cosmo/namespace/index.js +85 -0
- package/lib/service/cosmo/organization/index.d.ts +47 -0
- package/lib/service/cosmo/organization/index.js +67 -0
- package/lib/service/cosmo/permissions/index.d.ts +131 -0
- package/lib/service/cosmo/permissions/index.js +184 -0
- package/lib/service/cosmo/production/index.d.ts +26 -0
- package/lib/service/cosmo/production/index.js +48 -0
- package/lib/service/cosmo/share/index.d.ts +169 -0
- package/lib/service/cosmo/share/index.js +227 -0
- package/lib/service/cosmo/space/index.d.ts +131 -0
- package/lib/service/cosmo/space/index.js +190 -0
- 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 +67 -0
- package/lib/service/cosmo/tag/index.js +96 -0
- package/lib/service/dali/DaliAvatar.d.ts +0 -6
- package/lib/service/dali/DaliAvatar.js +4 -11
- package/lib/service/dali/avatar/DaliCosmoSpace.d.ts +10 -4
- package/lib/service/dali/avatar/DaliCosmoSpace.js +12 -8
- package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +11 -4
- package/lib/service/dali/avatar/DaliHigh5Pool.js +12 -8
- package/lib/service/dali/avatar/DaliHigh5Space.d.ts +11 -4
- package/lib/service/dali/avatar/DaliHigh5Space.js +12 -8
- package/lib/service/dali/avatar/DaliOAuthApp.d.ts +11 -4
- package/lib/service/dali/avatar/DaliOAuthApp.js +12 -8
- package/lib/service/dali/avatar/DaliOrganization.d.ts +11 -4
- package/lib/service/dali/avatar/DaliOrganization.js +12 -8
- package/lib/service/dali/avatar/DaliServiceAccount.d.ts +10 -4
- package/lib/service/dali/avatar/DaliServiceAccount.js +12 -8
- package/lib/service/dali/avatar/DaliTeam.d.ts +11 -4
- package/lib/service/dali/avatar/DaliTeam.js +12 -8
- package/lib/service/dali/avatar/DaliUser.d.ts +11 -4
- package/lib/service/dali/avatar/DaliUser.js +12 -8
- package/lib/service/dali/index.d.ts +4 -5
- package/lib/service/dali/index.js +6 -6
- package/lib/service/high5/execution/index.d.ts +4 -2
- package/lib/service/high5/execution/index.js +7 -3
- package/lib/service/high5/execution/log/index.js +4 -1
- package/lib/service/high5/execution/status/index.d.ts +5 -3
- package/lib/service/high5/execution/status/index.js +7 -4
- package/lib/service/high5/index.d.ts +7 -2
- package/lib/service/high5/index.js +13 -3
- package/lib/service/high5/internal/index.d.ts +4 -2
- package/lib/service/high5/internal/index.js +7 -3
- package/lib/service/high5/internal/space/index.d.ts +10 -3
- package/lib/service/high5/internal/space/index.js +17 -5
- package/lib/service/high5/internal/space/job/index.d.ts +7 -0
- package/lib/service/high5/internal/space/job/index.js +20 -0
- package/lib/service/high5/internal/space/job/log/index.d.ts +17 -0
- package/lib/service/{fuse/internal/space/cronjob → high5/internal/space/job}/log/index.js +13 -10
- package/lib/service/high5/joinToken/index.d.ts +14 -6
- package/lib/service/high5/joinToken/index.js +14 -10
- package/lib/service/high5/space/database/document/array/index.d.ts +73 -0
- package/lib/service/high5/space/database/document/array/index.js +105 -0
- package/lib/service/{friday → high5}/space/database/document/index.d.ts +26 -10
- package/lib/service/{friday → high5}/space/database/document/index.js +35 -17
- package/lib/service/high5/space/database/document/number/index.d.ts +51 -0
- package/lib/service/high5/space/database/document/number/index.js +80 -0
- package/lib/service/{friday → high5}/space/database/index.d.ts +22 -12
- package/lib/service/{friday → high5}/space/database/index.js +22 -18
- package/lib/service/high5/space/event/index.d.ts +17 -7
- package/lib/service/high5/space/event/index.js +16 -12
- package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +4 -2
- package/lib/service/high5/space/event/stream/design/DesignOperations.js +6 -3
- package/lib/service/high5/space/event/stream/design/index.d.ts +10 -4
- package/lib/service/high5/space/event/stream/design/index.js +13 -9
- package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +16 -6
- package/lib/service/high5/space/event/stream/design/snapshot/index.js +16 -11
- package/lib/service/high5/space/event/stream/index.d.ts +32 -12
- package/lib/service/high5/space/event/stream/index.js +26 -22
- package/lib/service/high5/space/execution/index.d.ts +19 -7
- package/lib/service/high5/space/execution/index.js +21 -13
- package/lib/service/high5/space/execution/log/index.d.ts +8 -4
- package/lib/service/high5/space/execution/log/index.js +9 -6
- package/lib/service/high5/space/execution/status/index.d.ts +7 -3
- package/lib/service/high5/space/execution/status/index.js +8 -5
- package/lib/service/high5/space/index.d.ts +53 -14
- package/lib/service/high5/space/index.js +70 -28
- package/lib/service/{fuse/space/cronjob → high5/space/job}/index.d.ts +57 -35
- package/lib/service/{fuse/space/cronjob → high5/space/job}/index.js +88 -87
- package/lib/service/{fuse/space/cronjob → high5/space/job}/log/index.d.ts +15 -11
- package/lib/service/{fuse/space/cronjob → high5/space/job}/log/index.js +19 -16
- package/lib/service/high5/space/node/index.d.ts +20 -8
- package/lib/service/high5/space/node/index.js +18 -14
- package/lib/service/high5/space/pool/index.d.ts +38 -11
- package/lib/service/high5/space/pool/index.js +41 -19
- package/lib/service/high5/space/secret/index.d.ts +17 -7
- package/lib/service/high5/space/secret/index.js +16 -12
- package/lib/service/high5/space/stat/index.d.ts +12 -0
- package/lib/service/high5/space/stat/index.js +34 -0
- package/lib/service/high5/space/wave/index.d.ts +16 -6
- package/lib/service/high5/space/wave/index.js +15 -11
- package/lib/service/high5/space/webhook/index.d.ts +32 -12
- package/lib/service/high5/space/webhook/index.js +29 -22
- package/lib/service/high5/space/webhook/log/index.d.ts +4 -2
- package/lib/service/high5/space/webhook/log/index.js +6 -3
- package/lib/service/high5/stat/index.d.ts +11 -0
- package/lib/service/{fuse/internal → high5/stat}/index.js +16 -14
- package/lib/service/high5/wave/index.js +4 -1
- package/lib/service/high5/wave/s3/index.d.ts +31 -8
- package/lib/service/high5/wave/s3/index.js +47 -23
- package/lib/service/idp/guest/index.d.ts +42 -0
- package/lib/service/idp/guest/index.js +69 -0
- package/lib/service/idp/index.d.ts +25 -7
- package/lib/service/idp/index.js +27 -13
- package/lib/service/idp/internal/index.d.ts +5 -3
- package/lib/service/idp/internal/index.js +9 -4
- 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 +19 -6
- package/lib/service/idp/oauth/index.js +26 -16
- package/lib/service/idp/organization/index.d.ts +28 -5
- package/lib/service/idp/organization/index.js +41 -11
- package/lib/service/idp/organization/license/index.d.ts +7 -3
- package/lib/service/idp/organization/license/index.js +8 -5
- package/lib/service/idp/organization/member/index.d.ts +20 -8
- package/lib/service/idp/organization/member/index.js +20 -15
- package/lib/service/idp/organization/member/invitations/index.d.ts +42 -9
- package/lib/service/idp/organization/member/invitations/index.js +94 -59
- package/lib/service/idp/organization/service-accounts/index.d.ts +31 -9
- package/lib/service/idp/organization/service-accounts/index.js +35 -14
- package/lib/service/idp/organization/settings/domain/index.d.ts +13 -5
- package/lib/service/idp/organization/settings/domain/index.js +13 -9
- package/lib/service/idp/organization/settings/domain/saml/index.d.ts +16 -6
- package/lib/service/idp/organization/settings/domain/saml/index.js +23 -19
- package/lib/service/idp/organization/settings/index.js +4 -1
- package/lib/service/idp/organization/settings/oauth/index.d.ts +33 -9
- package/lib/service/idp/organization/settings/oauth/index.js +37 -16
- package/lib/service/idp/organization/stat/index.d.ts +11 -0
- package/lib/service/idp/organization/stat/index.js +33 -0
- package/lib/service/idp/organization/team/index.d.ts +32 -10
- package/lib/service/idp/organization/team/index.js +35 -14
- package/lib/service/idp/registration/index.d.ts +10 -4
- package/lib/service/idp/registration/index.js +19 -10
- package/lib/service/idp/user/index.d.ts +41 -11
- package/lib/service/idp/user/index.js +49 -19
- package/lib/service/idp/user/license/index.d.ts +7 -3
- package/lib/service/idp/user/license/index.js +8 -5
- package/lib/service/idp/user/message/index.d.ts +62 -0
- package/lib/service/idp/user/message/index.js +95 -0
- package/lib/service/idp/user/password/index.d.ts +4 -2
- package/lib/service/idp/user/password/index.js +6 -3
- package/lib/service/idp/user/settings/connections/index.d.ts +4 -2
- package/lib/service/idp/user/settings/connections/index.js +6 -3
- package/lib/service/idp/user/settings/general/index.d.ts +10 -4
- package/lib/service/idp/user/settings/general/index.js +10 -7
- package/lib/service/idp/user/settings/index.js +4 -1
- package/lib/service/idp/user/settings/notifications/index.d.ts +7 -3
- package/lib/service/idp/user/settings/notifications/index.js +8 -5
- package/lib/service/idp/user/settings/oauthApps/index.d.ts +7 -3
- package/lib/service/idp/user/settings/oauthApps/index.js +10 -6
- package/lib/service/idp/user/settings/pats/index.d.ts +22 -8
- package/lib/service/idp/user/settings/pats/index.js +21 -16
- package/lib/service/idp/user/settings/twoFactor/index.js +4 -1
- package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +16 -6
- package/lib/service/idp/user/settings/twoFactor/totp/index.js +17 -11
- package/lib/service/mailer/index.d.ts +4 -2
- package/lib/service/mailer/index.js +7 -4
- package/lib/service/mailer/internal/index.d.ts +14 -6
- package/lib/service/mailer/internal/index.js +12 -9
- package/lib/service/mothership/index.d.ts +35 -13
- package/lib/service/mothership/index.js +36 -18
- package/lib/service/nats/index.d.ts +7 -0
- package/lib/service/nats/index.js +77 -44
- package/lib/service/shorts/index.d.ts +18 -0
- package/lib/service/{friday → shorts}/index.js +17 -11
- package/lib/service/shorts/internal/index.d.ts +75 -0
- package/lib/service/shorts/internal/index.js +118 -0
- package/lib/utils/bouncer/features/Provider.js +0 -1
- package/package.json +2 -2
- package/lib/interfaces/friday/index.d.ts +0 -3
- package/lib/interfaces/friday/space/index.d.ts +0 -21
- package/lib/interfaces/friday/space/index.js +0 -11
- package/lib/interfaces/fuse/index.d.ts +0 -3
- package/lib/interfaces/fuse/index.js +0 -19
- 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/index.d.ts +0 -22
- package/lib/interfaces/fuse/space/index.js +0 -11
- package/lib/service/dali/avatar/DaliFuseSpace.d.ts +0 -26
- package/lib/service/dali/avatar/DaliFuseSpace.js +0 -58
- package/lib/service/friday/index.d.ts +0 -13
- package/lib/service/friday/space/index.d.ts +0 -81
- package/lib/service/friday/space/index.js +0 -150
- package/lib/service/fuse/index.d.ts +0 -18
- package/lib/service/fuse/index.js +0 -48
- package/lib/service/fuse/internal/index.d.ts +0 -8
- 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 -15
- package/lib/service/fuse/internal/space/index.d.ts +0 -22
- package/lib/service/fuse/internal/space/index.js +0 -49
- package/lib/service/fuse/space/index.d.ts +0 -81
- package/lib/service/fuse/space/index.js +0 -152
- /package/lib/interfaces/{friday/space/database/index.js → agent/logging/cloudwatch.js} +0 -0
- /package/lib/interfaces/{fuse/space/cronjob/CronjobLog.js → agent/logging/log-collector.js} +0 -0
- /package/lib/interfaces/{friday → high5}/space/database/index.d.ts +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
+
import { Asset, AssetFilter, AssetSearchContext } from "../../../interfaces/cosmo/asset";
|
|
3
|
+
import { Sorting } from "../../../interfaces/global";
|
|
4
|
+
/**
|
|
5
|
+
* @class Organization
|
|
6
|
+
* @extends Base
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* **Under development, breaking changes possible**
|
|
10
|
+
*
|
|
11
|
+
* Represents an Organization resource in Cosmo, providing methods to interact with the Organization API.
|
|
12
|
+
*/
|
|
13
|
+
export declare class CosmoOrganization extends Base {
|
|
14
|
+
protected getEndpoint(endpoint: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Search Assets of an Organization across all Spaces
|
|
17
|
+
* @remarks
|
|
18
|
+
* ** Under development, breaking changes possible**
|
|
19
|
+
* @param orgName Name of the Organization
|
|
20
|
+
* @param context Context to search in (e.g., ORGANIZATION, TRASH, SHARE)
|
|
21
|
+
* @param limit Maximum number of Assets to return
|
|
22
|
+
* @param page Page number for pagination
|
|
23
|
+
* @param recursive Flag for searching recursively
|
|
24
|
+
* @param spaceName Name of Space to restrict search (mandatory if context is not ORGANIZATION)
|
|
25
|
+
* @param namespace Name of Namespace to restrict search
|
|
26
|
+
* @param parentId ID of parent (folder, etc.) to restrict search
|
|
27
|
+
* @param shareId ID of Share to restrict search (mandatory if context is SHARE)
|
|
28
|
+
* @param assetFilter Filter criteria for Assets
|
|
29
|
+
* @param sorting Sorting criteria for the results
|
|
30
|
+
* @returns List of found Assets
|
|
31
|
+
*/
|
|
32
|
+
searchAssets<R extends boolean = false>({ orgName, context, limit, page, recursive, spaceName, namespace, parentId, shareId, assetFilter, sorting, }: {
|
|
33
|
+
orgName: string;
|
|
34
|
+
context: AssetSearchContext;
|
|
35
|
+
limit?: number;
|
|
36
|
+
page?: number;
|
|
37
|
+
recursive?: boolean;
|
|
38
|
+
spaceName?: string;
|
|
39
|
+
namespace?: string[] | string;
|
|
40
|
+
parentId?: string;
|
|
41
|
+
shareId?: string;
|
|
42
|
+
assetFilter?: AssetFilter[];
|
|
43
|
+
sorting?: Sorting;
|
|
44
|
+
}, raw?: {
|
|
45
|
+
raw: R;
|
|
46
|
+
}): Promise<MaybeRaw<R, Asset[]>>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CosmoOrganization = void 0;
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
17
|
+
/**
|
|
18
|
+
* @class Organization
|
|
19
|
+
* @extends Base
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* **Under development, breaking changes possible**
|
|
23
|
+
*
|
|
24
|
+
* Represents an Organization resource in Cosmo, providing methods to interact with the Organization API.
|
|
25
|
+
*/
|
|
26
|
+
class CosmoOrganization extends Base_1.default {
|
|
27
|
+
getEndpoint(endpoint) {
|
|
28
|
+
return `${this.options.server}/api/cosmo${endpoint}`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Search Assets of an Organization across all Spaces
|
|
32
|
+
* @remarks
|
|
33
|
+
* ** Under development, breaking changes possible**
|
|
34
|
+
* @param orgName Name of the Organization
|
|
35
|
+
* @param context Context to search in (e.g., ORGANIZATION, TRASH, SHARE)
|
|
36
|
+
* @param limit Maximum number of Assets to return
|
|
37
|
+
* @param page Page number for pagination
|
|
38
|
+
* @param recursive Flag for searching recursively
|
|
39
|
+
* @param spaceName Name of Space to restrict search (mandatory if context is not ORGANIZATION)
|
|
40
|
+
* @param namespace Name of Namespace to restrict search
|
|
41
|
+
* @param parentId ID of parent (folder, etc.) to restrict search
|
|
42
|
+
* @param shareId ID of Share to restrict search (mandatory if context is SHARE)
|
|
43
|
+
* @param assetFilter Filter criteria for Assets
|
|
44
|
+
* @param sorting Sorting criteria for the results
|
|
45
|
+
* @returns List of found Assets
|
|
46
|
+
*/
|
|
47
|
+
searchAssets(_a, raw_1) {
|
|
48
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, context, limit, page, recursive = false, spaceName, namespace, parentId, shareId, assetFilter, sorting, }, raw) {
|
|
49
|
+
limit = limit !== null && limit !== void 0 ? limit : 100;
|
|
50
|
+
page = page !== null && page !== void 0 ? page : 0;
|
|
51
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/assets/search`), Object.assign({ filters: assetFilter !== null && assetFilter !== void 0 ? assetFilter : [] }, (sorting ? { sorting } : {})), {
|
|
52
|
+
params: {
|
|
53
|
+
context,
|
|
54
|
+
limit,
|
|
55
|
+
page,
|
|
56
|
+
recursive,
|
|
57
|
+
spaceName,
|
|
58
|
+
namespace,
|
|
59
|
+
parentId,
|
|
60
|
+
shareId,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.CosmoOrganization = CosmoOrganization;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
+
import { DetailedRole, Permission, PermissionDiscovery, Role } from "../../../interfaces/cosmo/permissions";
|
|
3
|
+
import { SearchFilter, Sorting } from "../../../interfaces/global";
|
|
4
|
+
export declare class CosmoPermissions extends Base {
|
|
5
|
+
/**
|
|
6
|
+
* Fetches a list of all available permissions that can be assigned to roles.
|
|
7
|
+
*
|
|
8
|
+
* @returns A promise resolving to the permission discovery metadata.
|
|
9
|
+
*/
|
|
10
|
+
listAllPermissions<R extends boolean = false>(raw?: {
|
|
11
|
+
raw: R;
|
|
12
|
+
}): Promise<MaybeRaw<R, PermissionDiscovery>>;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a new role within a specified organization and space.
|
|
15
|
+
*
|
|
16
|
+
* @param orgName - The name of the organization.
|
|
17
|
+
* @param spaceName - The name of the space.
|
|
18
|
+
* @param roleName - The name of the new role.
|
|
19
|
+
* @param permissions - A record of resource keys to arrays of permission names.
|
|
20
|
+
* @returns A promise resolving to the created role object.
|
|
21
|
+
*/
|
|
22
|
+
createRole<R extends boolean = false>(orgName: string, spaceName: string, roleName: string, permissions: Record<string, Permission["name"][]>, raw?: {
|
|
23
|
+
raw: R;
|
|
24
|
+
}): Promise<MaybeRaw<R, Role>>;
|
|
25
|
+
/**
|
|
26
|
+
* Searches for roles within a space based on filters, sorting, and pagination.
|
|
27
|
+
*
|
|
28
|
+
* @param options - An object containing search parameters.
|
|
29
|
+
* @param options.orgName - The name of the organization.
|
|
30
|
+
* @param options.spaceName - The name of the space.
|
|
31
|
+
* @param options.filters - Optional array of search filters.
|
|
32
|
+
* @param options.sorting - Optional sorting criteria.
|
|
33
|
+
* @param options.limit - Optional limit for pagination.
|
|
34
|
+
* @param options.page - Optional page number for pagination.
|
|
35
|
+
* @returns A promise resolving to a list of matching role objects.
|
|
36
|
+
*/
|
|
37
|
+
searchRoles<R extends boolean = false>({ orgName, spaceName, filters, sorting, limit, page, }: {
|
|
38
|
+
orgName: string;
|
|
39
|
+
spaceName: string;
|
|
40
|
+
filters?: SearchFilter[];
|
|
41
|
+
sorting?: Sorting;
|
|
42
|
+
limit?: number;
|
|
43
|
+
page?: number;
|
|
44
|
+
}, raw?: {
|
|
45
|
+
raw: R;
|
|
46
|
+
}): Promise<MaybeRaw<R, Role[]>>;
|
|
47
|
+
/**
|
|
48
|
+
* Updates an existing role's name and permissions.
|
|
49
|
+
*
|
|
50
|
+
* @param orgName - The name of the organization.
|
|
51
|
+
* @param spaceName - The name of the space.
|
|
52
|
+
* @param roleId - The ID of the role to update.
|
|
53
|
+
* @param newName - The new name for the role.
|
|
54
|
+
* @param permissions - The updated permissions mapping.
|
|
55
|
+
* @returns A promise resolving to the updated role.
|
|
56
|
+
*/
|
|
57
|
+
updateRole<R extends boolean = false>(orgName: string, spaceName: string, roleId: string, newName: string, permissions: Record<string, Permission["name"][]>, raw?: {
|
|
58
|
+
raw: R;
|
|
59
|
+
}): Promise<MaybeRaw<R, Role>>;
|
|
60
|
+
/**
|
|
61
|
+
* Fetches detailed information about a specific role.
|
|
62
|
+
*
|
|
63
|
+
* @param orgName - The name of the organization.
|
|
64
|
+
* @param spaceName - The name of the space.
|
|
65
|
+
* @param roleId - The ID of the role to retrieve.
|
|
66
|
+
* @returns A promise resolving to the detailed role object.
|
|
67
|
+
*/
|
|
68
|
+
fetchRole<R extends boolean = false>(orgName: string, spaceName: string, roleId: string, raw?: {
|
|
69
|
+
raw: R;
|
|
70
|
+
}): Promise<MaybeRaw<R, DetailedRole>>;
|
|
71
|
+
/**
|
|
72
|
+
* Deletes a role by its ID.
|
|
73
|
+
*
|
|
74
|
+
* @param orgName - The name of the organization.
|
|
75
|
+
* @param spaceName - The name of the space.
|
|
76
|
+
* @param roleId - The ID of the role to delete.
|
|
77
|
+
* @returns A promise that resolves when the role is deleted.
|
|
78
|
+
*/
|
|
79
|
+
deleteRole<R extends boolean = false>(orgName: string, spaceName: string, roleId: string, raw?: {
|
|
80
|
+
raw: R;
|
|
81
|
+
}): Promise<MaybeRaw<R, DetailedRole>>;
|
|
82
|
+
/**
|
|
83
|
+
* Assigns a user to a role.
|
|
84
|
+
*
|
|
85
|
+
* @param orgName - The name of the organization.
|
|
86
|
+
* @param spaceName - The name of the space.
|
|
87
|
+
* @param roleId - The ID of the role.
|
|
88
|
+
* @param userId - The ID of the user to assign.
|
|
89
|
+
* @returns A promise that resolves when the assignment is complete.
|
|
90
|
+
*/
|
|
91
|
+
assignUserToRole<R extends boolean = false>(orgName: string, spaceName: string, roleId: string, userId: string, raw?: {
|
|
92
|
+
raw: R;
|
|
93
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
94
|
+
/**
|
|
95
|
+
* Unassigns a user from a role.
|
|
96
|
+
*
|
|
97
|
+
* @param orgName - The name of the organization.
|
|
98
|
+
* @param spaceName - The name of the space.
|
|
99
|
+
* @param roleId - The ID of the role.
|
|
100
|
+
* @param userId - The ID of the user to unassign.
|
|
101
|
+
* @returns A promise that resolves when the user is removed.
|
|
102
|
+
*/
|
|
103
|
+
unassignUserFromRole<R extends boolean = false>(orgName: string, spaceName: string, roleId: string, userId: string, raw?: {
|
|
104
|
+
raw: R;
|
|
105
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
106
|
+
/**
|
|
107
|
+
* Assigns a team to a role.
|
|
108
|
+
*
|
|
109
|
+
* @param orgName - The name of the organization.
|
|
110
|
+
* @param spaceName - The name of the space.
|
|
111
|
+
* @param roleId - The ID of the role.
|
|
112
|
+
* @param teamName - The name of the team to assign.
|
|
113
|
+
* @returns A promise that resolves when the assignment is complete.
|
|
114
|
+
*/
|
|
115
|
+
assignTeamToRole<R extends boolean = false>(orgName: string, spaceName: string, roleId: string, teamName: string, raw?: {
|
|
116
|
+
raw: R;
|
|
117
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
118
|
+
/**
|
|
119
|
+
* Unassigns a team from a role.
|
|
120
|
+
*
|
|
121
|
+
* @param orgName - The name of the organization.
|
|
122
|
+
* @param spaceName - The name of the space.
|
|
123
|
+
* @param roleId - The ID of the role.
|
|
124
|
+
* @param teamName - The name of the team to unassign.
|
|
125
|
+
* @returns A promise that resolves when the team is removed.
|
|
126
|
+
*/
|
|
127
|
+
unassignTeamFromRole<R extends boolean = false>(orgName: string, spaceName: string, roleId: string, teamName: string, raw?: {
|
|
128
|
+
raw: R;
|
|
129
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
130
|
+
protected getEndpoint(endpoint: string): string;
|
|
131
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CosmoPermissions = void 0;
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
17
|
+
class CosmoPermissions extends Base_1.default {
|
|
18
|
+
/**
|
|
19
|
+
* Fetches a list of all available permissions that can be assigned to roles.
|
|
20
|
+
*
|
|
21
|
+
* @returns A promise resolving to the permission discovery metadata.
|
|
22
|
+
*/
|
|
23
|
+
listAllPermissions(raw) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const res = yield this.axios.get(`/v1/permissions/discovery`);
|
|
26
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Creates a new role within a specified organization and space.
|
|
31
|
+
*
|
|
32
|
+
* @param orgName - The name of the organization.
|
|
33
|
+
* @param spaceName - The name of the space.
|
|
34
|
+
* @param roleName - The name of the new role.
|
|
35
|
+
* @param permissions - A record of resource keys to arrays of permission names.
|
|
36
|
+
* @returns A promise resolving to the created role object.
|
|
37
|
+
*/
|
|
38
|
+
createRole(orgName, spaceName, roleName, permissions, raw) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const res = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/roles`), {
|
|
41
|
+
name: roleName,
|
|
42
|
+
permissions,
|
|
43
|
+
});
|
|
44
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Searches for roles within a space based on filters, sorting, and pagination.
|
|
49
|
+
*
|
|
50
|
+
* @param options - An object containing search parameters.
|
|
51
|
+
* @param options.orgName - The name of the organization.
|
|
52
|
+
* @param options.spaceName - The name of the space.
|
|
53
|
+
* @param options.filters - Optional array of search filters.
|
|
54
|
+
* @param options.sorting - Optional sorting criteria.
|
|
55
|
+
* @param options.limit - Optional limit for pagination.
|
|
56
|
+
* @param options.page - Optional page number for pagination.
|
|
57
|
+
* @returns A promise resolving to a list of matching role objects.
|
|
58
|
+
*/
|
|
59
|
+
searchRoles(_a, raw_1) {
|
|
60
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit, page, }, raw) {
|
|
61
|
+
const res = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/roles/search`), {
|
|
62
|
+
filters,
|
|
63
|
+
sorting,
|
|
64
|
+
}, {
|
|
65
|
+
params: {
|
|
66
|
+
limit,
|
|
67
|
+
page,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Updates an existing role's name and permissions.
|
|
75
|
+
*
|
|
76
|
+
* @param orgName - The name of the organization.
|
|
77
|
+
* @param spaceName - The name of the space.
|
|
78
|
+
* @param roleId - The ID of the role to update.
|
|
79
|
+
* @param newName - The new name for the role.
|
|
80
|
+
* @param permissions - The updated permissions mapping.
|
|
81
|
+
* @returns A promise resolving to the updated role.
|
|
82
|
+
*/
|
|
83
|
+
updateRole(orgName, spaceName, roleId, newName, permissions, raw) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
const res = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/roles/${roleId}`), {
|
|
86
|
+
name: newName,
|
|
87
|
+
permissions,
|
|
88
|
+
});
|
|
89
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Fetches detailed information about a specific role.
|
|
94
|
+
*
|
|
95
|
+
* @param orgName - The name of the organization.
|
|
96
|
+
* @param spaceName - The name of the space.
|
|
97
|
+
* @param roleId - The ID of the role to retrieve.
|
|
98
|
+
* @returns A promise resolving to the detailed role object.
|
|
99
|
+
*/
|
|
100
|
+
fetchRole(orgName, spaceName, roleId, raw) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
const res = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/roles/${roleId}`));
|
|
103
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Deletes a role by its ID.
|
|
108
|
+
*
|
|
109
|
+
* @param orgName - The name of the organization.
|
|
110
|
+
* @param spaceName - The name of the space.
|
|
111
|
+
* @param roleId - The ID of the role to delete.
|
|
112
|
+
* @returns A promise that resolves when the role is deleted.
|
|
113
|
+
*/
|
|
114
|
+
deleteRole(orgName, spaceName, roleId, raw) {
|
|
115
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
116
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/roles/${roleId}`));
|
|
117
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Assigns a user to a role.
|
|
122
|
+
*
|
|
123
|
+
* @param orgName - The name of the organization.
|
|
124
|
+
* @param spaceName - The name of the space.
|
|
125
|
+
* @param roleId - The ID of the role.
|
|
126
|
+
* @param userId - The ID of the user to assign.
|
|
127
|
+
* @returns A promise that resolves when the assignment is complete.
|
|
128
|
+
*/
|
|
129
|
+
assignUserToRole(orgName, spaceName, roleId, userId, raw) {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/roles/${roleId}/user`), { userId });
|
|
132
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Unassigns a user from a role.
|
|
137
|
+
*
|
|
138
|
+
* @param orgName - The name of the organization.
|
|
139
|
+
* @param spaceName - The name of the space.
|
|
140
|
+
* @param roleId - The ID of the role.
|
|
141
|
+
* @param userId - The ID of the user to unassign.
|
|
142
|
+
* @returns A promise that resolves when the user is removed.
|
|
143
|
+
*/
|
|
144
|
+
unassignUserFromRole(orgName, spaceName, roleId, userId, raw) {
|
|
145
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/roles/${roleId}/user/${userId}`));
|
|
147
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Assigns a team to a role.
|
|
152
|
+
*
|
|
153
|
+
* @param orgName - The name of the organization.
|
|
154
|
+
* @param spaceName - The name of the space.
|
|
155
|
+
* @param roleId - The ID of the role.
|
|
156
|
+
* @param teamName - The name of the team to assign.
|
|
157
|
+
* @returns A promise that resolves when the assignment is complete.
|
|
158
|
+
*/
|
|
159
|
+
assignTeamToRole(orgName, spaceName, roleId, teamName, raw) {
|
|
160
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/roles/${roleId}/team`), { teamName });
|
|
162
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Unassigns a team from a role.
|
|
167
|
+
*
|
|
168
|
+
* @param orgName - The name of the organization.
|
|
169
|
+
* @param spaceName - The name of the space.
|
|
170
|
+
* @param roleId - The ID of the role.
|
|
171
|
+
* @param teamName - The name of the team to unassign.
|
|
172
|
+
* @returns A promise that resolves when the team is removed.
|
|
173
|
+
*/
|
|
174
|
+
unassignTeamFromRole(orgName, spaceName, roleId, teamName, raw) {
|
|
175
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
176
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/roles/${roleId}/team/${teamName}`));
|
|
177
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
getEndpoint(endpoint) {
|
|
181
|
+
return `${this.options.server}/api/cosmo${endpoint}`;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
exports.CosmoPermissions = CosmoPermissions;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
+
import { Asset } from "../../../interfaces/cosmo/asset";
|
|
3
|
+
/**
|
|
4
|
+
* @class Production
|
|
5
|
+
* @extends Base
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* **Under development, breaking changes possible**
|
|
9
|
+
*
|
|
10
|
+
* Represents a Production resource in Cosmo, providing methods to interact with the Production API.
|
|
11
|
+
*/
|
|
12
|
+
export declare class CosmoProduction extends Base {
|
|
13
|
+
protected getEndpoint(endpoint: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new Production in the specified Organization and Space.
|
|
16
|
+
* @remarks
|
|
17
|
+
* ** Under development, breaking changes possible**
|
|
18
|
+
* @param orgName Name of the Organization
|
|
19
|
+
* @param spaceName Name of the Space
|
|
20
|
+
* @param productionName Name of the Production to create
|
|
21
|
+
* @returns The created Production
|
|
22
|
+
*/
|
|
23
|
+
createProduction<R extends boolean = false>(orgName: string, spaceName: string, productionName: string, raw?: {
|
|
24
|
+
raw: R;
|
|
25
|
+
}): Promise<MaybeRaw<R, Asset>>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CosmoProduction = void 0;
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
17
|
+
/**
|
|
18
|
+
* @class Production
|
|
19
|
+
* @extends Base
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* **Under development, breaking changes possible**
|
|
23
|
+
*
|
|
24
|
+
* Represents a Production resource in Cosmo, providing methods to interact with the Production API.
|
|
25
|
+
*/
|
|
26
|
+
class CosmoProduction extends Base_1.default {
|
|
27
|
+
getEndpoint(endpoint) {
|
|
28
|
+
return `${this.options.server}/api/cosmo${endpoint}`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a new Production in the specified Organization and Space.
|
|
32
|
+
* @remarks
|
|
33
|
+
* ** Under development, breaking changes possible**
|
|
34
|
+
* @param orgName Name of the Organization
|
|
35
|
+
* @param spaceName Name of the Space
|
|
36
|
+
* @param productionName Name of the Production to create
|
|
37
|
+
* @returns The created Production
|
|
38
|
+
*/
|
|
39
|
+
createProduction(orgName, spaceName, productionName, raw) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/productions`), {
|
|
42
|
+
name: productionName,
|
|
43
|
+
});
|
|
44
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.CosmoProduction = CosmoProduction;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
+
import { Share, ShareCreate, SharePatch, ShareWithUsers } from "../../../interfaces/cosmo/share";
|
|
3
|
+
import { SearchFilter, Sorting } from "../../../interfaces/global";
|
|
4
|
+
/**
|
|
5
|
+
* @class Share
|
|
6
|
+
* @extends Base
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* **Under development, breaking changes possible**
|
|
10
|
+
*
|
|
11
|
+
* Represents a Share resource in Cosmo, providing methods to interact with the Share API.
|
|
12
|
+
*/
|
|
13
|
+
export declare class CosmoShare extends Base {
|
|
14
|
+
protected getEndpoint(endpoint: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Create a new Share in the specified Organization and Space.
|
|
17
|
+
* @remarks
|
|
18
|
+
* ** Under development, breaking changes possible**
|
|
19
|
+
* @param orgName Name of the Organization
|
|
20
|
+
* @param spaceName Name of the Space
|
|
21
|
+
* @param createShare The Share object to create
|
|
22
|
+
*
|
|
23
|
+
* @returns The created Share
|
|
24
|
+
*/
|
|
25
|
+
createShare<R extends boolean = false>(orgName: string, spaceName: string, createShare: ShareCreate, raw?: {
|
|
26
|
+
raw: R;
|
|
27
|
+
}): Promise<MaybeRaw<R, Share>>;
|
|
28
|
+
/**
|
|
29
|
+
* Links the user to a Share, making the assets shared available to the user
|
|
30
|
+
* @remarks
|
|
31
|
+
* ** Under development, breaking changes possible**
|
|
32
|
+
* @param orgName Name of the Organization
|
|
33
|
+
* @param spaceName Name of the Space
|
|
34
|
+
* @param shareId The ID of the Share to link
|
|
35
|
+
*
|
|
36
|
+
* @returns The created Share
|
|
37
|
+
*/
|
|
38
|
+
linkShare<R extends boolean = false>(orgName: string, spaceName: string, shareId: string, password?: string, shareIdHMAC?: string, raw?: {
|
|
39
|
+
raw: R;
|
|
40
|
+
}): Promise<MaybeRaw<R, Share>>;
|
|
41
|
+
/**
|
|
42
|
+
* Delete Shares by ID.
|
|
43
|
+
* @remarks
|
|
44
|
+
* ** Under development, breaking changes possible**
|
|
45
|
+
* @param orgName Name of the Organization
|
|
46
|
+
* @param spaceName Name of the Space
|
|
47
|
+
* @param shareIds The IDs of the Shares to delete
|
|
48
|
+
*
|
|
49
|
+
* @returns 204 No Content if successful
|
|
50
|
+
*/
|
|
51
|
+
deleteShare<R extends boolean = false>(orgName: string, spaceName: string, shareIds: string[], raw?: {
|
|
52
|
+
raw: R;
|
|
53
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
54
|
+
/**
|
|
55
|
+
* Fetch a Share.
|
|
56
|
+
* @param orgName Name of the Organization
|
|
57
|
+
* @param spaceName Name of the Space
|
|
58
|
+
* @param shareId The ID of the Share to link
|
|
59
|
+
*
|
|
60
|
+
* @returns Detailed Share object
|
|
61
|
+
*/
|
|
62
|
+
fetchShare<R extends boolean = false>(orgName: string, spaceName: string, shareId: string, raw?: {
|
|
63
|
+
raw: R;
|
|
64
|
+
}): Promise<MaybeRaw<R, Share>>;
|
|
65
|
+
/**
|
|
66
|
+
* Searches for shares within a specific space in an organization.
|
|
67
|
+
*
|
|
68
|
+
* @param {string} orgName - The name of the organization.
|
|
69
|
+
* @param {string} spaceName - The name of the space.
|
|
70
|
+
* @param {{ sorting?: Sorting, filters?: SearchFilter[] }} search - Search criteria including optional sorting and filters.
|
|
71
|
+
* @param {number} limit - Maximum number of results per page.
|
|
72
|
+
* @param {number} page - The page number to retrieve.
|
|
73
|
+
* @returns {Promise<ShareWithUsers[]>} A promise that resolves to a list of shares with their associated users.
|
|
74
|
+
*/
|
|
75
|
+
searchSharesOfSpace<R extends boolean = false>(orgName: string, spaceName: string, search: {
|
|
76
|
+
sorting?: Sorting;
|
|
77
|
+
filters?: SearchFilter[];
|
|
78
|
+
}, limit: number, page: number, raw?: {
|
|
79
|
+
raw: R;
|
|
80
|
+
}): Promise<MaybeRaw<R, ShareWithUsers[]>>;
|
|
81
|
+
/**
|
|
82
|
+
* Searches for shares the current user is linked to.
|
|
83
|
+
*
|
|
84
|
+
* @param {{ sorting?: Sorting, filters?: SearchFilter[] }} search - Search criteria including optional sorting and filters.
|
|
85
|
+
* @param {number} limit - Maximum number of results per page.
|
|
86
|
+
* @param {number} page - The page number to retrieve.
|
|
87
|
+
* @returns {Promise<Share[]>} A promise that resolves to a list of shares the current user is linked to.
|
|
88
|
+
*/
|
|
89
|
+
searchSharesOfUser<R extends boolean = false>(search: {
|
|
90
|
+
sorting?: Sorting;
|
|
91
|
+
filters?: SearchFilter[];
|
|
92
|
+
}, limit: number, page: number, raw?: {
|
|
93
|
+
raw: R;
|
|
94
|
+
}): Promise<MaybeRaw<R, Share[]>>;
|
|
95
|
+
/**
|
|
96
|
+
* Unlinks the current user from a specific share in a space.
|
|
97
|
+
*
|
|
98
|
+
* @param {string} orgName - The name of the organization.
|
|
99
|
+
* @param {string} spaceName - The name of the space.
|
|
100
|
+
* @param {string} shareId - The ID of the share to unlink from.
|
|
101
|
+
* @returns {Promise<void>} A promise that resolves when the unlinking is complete.
|
|
102
|
+
*/
|
|
103
|
+
unlinkSelf<R extends boolean = false>(orgName: string, spaceName: string, shareId: string, raw?: {
|
|
104
|
+
raw: R;
|
|
105
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
106
|
+
/**
|
|
107
|
+
* Unlinks another user from a specific share in a space.
|
|
108
|
+
*
|
|
109
|
+
* @param {string} orgName - The name of the organization.
|
|
110
|
+
* @param {string} spaceName - The name of the space.
|
|
111
|
+
* @param {string} shareId - The ID of the share to unlink from.
|
|
112
|
+
* @param {string} userId - The ID of the user to unlink.
|
|
113
|
+
* @returns {Promise<void>} A promise that resolves when the unlinking is complete.
|
|
114
|
+
*/
|
|
115
|
+
unlinkOther<R extends boolean = false>(orgName: string, spaceName: string, shareId: string, userId: string, raw?: {
|
|
116
|
+
raw: R;
|
|
117
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
118
|
+
/**
|
|
119
|
+
* Patch a Share in the specified Organization and Space.
|
|
120
|
+
* @remarks
|
|
121
|
+
* ** Under development, breaking changes possible**
|
|
122
|
+
* @param orgName Name of the Organization
|
|
123
|
+
* @param spaceName Name of the Space
|
|
124
|
+
* @param shareId ID of the Share
|
|
125
|
+
* @param patchObject An object whose properties will be used to replace the existing Share ones
|
|
126
|
+
*
|
|
127
|
+
* @returns The patched Share
|
|
128
|
+
*/
|
|
129
|
+
patchShare<R extends boolean = false>(orgName: string, spaceName: string, shareId: string, patchObject: SharePatch, raw?: {
|
|
130
|
+
raw: R;
|
|
131
|
+
}): Promise<MaybeRaw<R, Share>>;
|
|
132
|
+
/**
|
|
133
|
+
* Resends share emails to **all recipients** associated with a share.
|
|
134
|
+
*
|
|
135
|
+
* This will trigger the backend to re-send the share notification email
|
|
136
|
+
* to every email address that has previously been invited to the share.
|
|
137
|
+
*
|
|
138
|
+
* @typeParam R - When `true`, the raw Axios response is returned instead of `undefined`
|
|
139
|
+
*
|
|
140
|
+
* @param orgName - The organization identifier
|
|
141
|
+
* @param spaceName - The space identifier within the organization
|
|
142
|
+
* @param shareId - The share ID whose emails should be resent
|
|
143
|
+
* @param raw - Optional flag to return the raw Axios response
|
|
144
|
+
*
|
|
145
|
+
* @returns `undefined` by default, or the raw Axios response when `raw.raw` is `true`
|
|
146
|
+
*/
|
|
147
|
+
resendAllEmails<R extends boolean = false>(orgName: string, spaceName: string, shareId: string, raw?: {
|
|
148
|
+
raw: R;
|
|
149
|
+
}): Promise<MaybeRaw<R, undefined>>;
|
|
150
|
+
/**
|
|
151
|
+
* Resends share emails to **specific recipients** for a share.
|
|
152
|
+
*
|
|
153
|
+
* Only the provided email addresses will receive a new share notification.
|
|
154
|
+
* At least one email address must be provided.
|
|
155
|
+
*
|
|
156
|
+
* @typeParam R - When `true`, the raw Axios response is returned instead of `undefined`
|
|
157
|
+
*
|
|
158
|
+
* @param orgName - The organization identifier
|
|
159
|
+
* @param spaceName - The space identifier within the organization
|
|
160
|
+
* @param shareId - The share ID whose emails should be resent
|
|
161
|
+
* @param emails - A non-empty list of email addresses to resend the share to
|
|
162
|
+
* @param raw - Optional flag to return the raw Axios response
|
|
163
|
+
*
|
|
164
|
+
* @returns `undefined` by default, or the raw Axios response when `raw.raw` is `true`
|
|
165
|
+
*/
|
|
166
|
+
resendEmails<R extends boolean = false>(orgName: string, spaceName: string, shareId: string, emails: [string, ...string[]], raw?: {
|
|
167
|
+
raw: R;
|
|
168
|
+
}): Promise<MaybeRaw<R, undefined>>;
|
|
169
|
+
}
|