@space-df/sdk 0.0.1-dev.3.3 → 0.0.1-dev.5
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/.editorconfig +24 -0
- package/.github/pull_request_template.md +25 -0
- package/.github/workflows/bump-version.yml +67 -0
- package/.github/workflows/publish-package.yml +28 -0
- package/.gitignore +11 -0
- package/CODE_OF_CONDUCT.md +128 -0
- package/CONTRIBUTING.md +89 -0
- package/api.doc.md +1537 -0
- package/dist/LICENSE +7 -0
- package/dist/README.md +382 -0
- package/{index.d.mts → dist/index.d.mts} +4 -0
- package/{index.d.ts → dist/index.d.ts} +4 -0
- package/{index.d.ts.map → dist/index.d.ts.map} +1 -1
- package/{index.js → dist/index.js} +4 -0
- package/dist/index.js.map +1 -0
- package/{index.mjs → dist/index.mjs} +4 -0
- package/dist/index.mjs.map +1 -0
- package/dist/package.json +101 -0
- package/{resources → dist/resources}/auth/auth.d.ts +5 -0
- package/dist/resources/auth/auth.d.ts.map +1 -0
- package/{resources → dist/resources}/auth/auth.js +3 -0
- package/dist/resources/auth/auth.js.map +1 -0
- package/{resources → dist/resources}/auth/auth.mjs +3 -0
- package/dist/resources/auth/auth.mjs.map +1 -0
- package/{resources → dist/resources}/auth/index.d.ts +4 -0
- package/{resources → dist/resources}/auth/index.d.ts.map +1 -1
- package/{resources → dist/resources}/auth/index.js +4 -0
- package/{resources → dist/resources}/auth/index.js.map +1 -1
- package/{resources → dist/resources}/auth/index.mjs +4 -0
- package/dist/resources/auth/invitation.d.ts +13 -0
- package/dist/resources/auth/invitation.d.ts.map +1 -0
- package/dist/resources/auth/invitation.js +11 -0
- package/dist/resources/auth/invitation.js.map +1 -0
- package/dist/resources/auth/invitation.mjs +7 -0
- package/dist/resources/auth/invitation.mjs.map +1 -0
- package/dist/resources/auth/join-space.d.ts +6 -0
- package/dist/resources/auth/join-space.d.ts.map +1 -0
- package/dist/resources/auth/join-space.js +11 -0
- package/dist/resources/auth/join-space.js.map +1 -0
- package/dist/resources/auth/join-space.mjs +7 -0
- package/dist/resources/auth/join-space.mjs.map +1 -0
- package/dist/resources/auth/presigned-url.d.ts +10 -0
- package/dist/resources/auth/presigned-url.d.ts.map +1 -0
- package/dist/resources/auth/presigned-url.js +11 -0
- package/dist/resources/auth/presigned-url.js.map +1 -0
- package/dist/resources/auth/presigned-url.mjs +7 -0
- package/dist/resources/auth/presigned-url.mjs.map +1 -0
- package/{resources → dist/resources}/auth/space-role-users.d.ts +5 -0
- package/dist/resources/auth/space-role-users.d.ts.map +1 -0
- package/{resources → dist/resources}/auth/space-role-users.js +16 -0
- package/dist/resources/auth/space-role-users.js.map +1 -0
- package/{resources → dist/resources}/auth/space-role-users.mjs +16 -0
- package/dist/resources/auth/space-role-users.mjs.map +1 -0
- package/dist/resources/auth/users.d.ts +19 -0
- package/dist/resources/auth/users.d.ts.map +1 -0
- package/dist/resources/auth/users.js +17 -0
- package/dist/resources/auth/users.js.map +1 -0
- package/dist/resources/auth/users.mjs +13 -0
- package/dist/resources/auth/users.mjs.map +1 -0
- package/dist/src/_shims/MultipartBody.ts +9 -0
- package/dist/src/_shims/README.md +46 -0
- package/dist/src/_shims/auto/runtime-bun.ts +4 -0
- package/dist/src/_shims/auto/runtime-node.ts +4 -0
- package/dist/src/_shims/auto/runtime.ts +4 -0
- package/dist/src/_shims/auto/types-node.ts +4 -0
- package/dist/src/_shims/auto/types.d.ts +101 -0
- package/dist/src/_shims/auto/types.js +3 -0
- package/dist/src/_shims/auto/types.mjs +3 -0
- package/dist/src/_shims/bun-runtime.ts +14 -0
- package/dist/src/_shims/index.d.ts +72 -0
- package/dist/src/_shims/index.js +13 -0
- package/dist/src/_shims/index.mjs +7 -0
- package/dist/src/_shims/manual-types.d.ts +12 -0
- package/dist/src/_shims/manual-types.js +3 -0
- package/dist/src/_shims/manual-types.mjs +3 -0
- package/dist/src/_shims/node-runtime.ts +78 -0
- package/dist/src/_shims/node-types.d.ts +42 -0
- package/dist/src/_shims/node-types.js +3 -0
- package/dist/src/_shims/node-types.mjs +3 -0
- package/dist/src/_shims/registry.ts +60 -0
- package/dist/src/_shims/web-runtime.ts +91 -0
- package/dist/src/_shims/web-types.d.ts +83 -0
- package/dist/src/_shims/web-types.js +3 -0
- package/dist/src/_shims/web-types.mjs +3 -0
- package/dist/src/core.ts +1061 -0
- package/dist/src/error.ts +134 -0
- package/dist/src/index.ts +210 -0
- package/dist/src/libs/utils.ts +66 -0
- package/dist/src/resource.ts +9 -0
- package/dist/src/resources/auth/auth.ts +102 -0
- package/dist/src/resources/auth/credentials.ts +12 -0
- package/dist/src/resources/auth/index.ts +10 -0
- package/dist/src/resources/auth/invitation.ts +17 -0
- package/dist/src/resources/auth/join-space.ts +8 -0
- package/dist/src/resources/auth/presigned-url.ts +13 -0
- package/dist/src/resources/auth/space-policies.ts +55 -0
- package/dist/src/resources/auth/space-role-users.ts +64 -0
- package/dist/src/resources/auth/space-roles.ts +95 -0
- package/dist/src/resources/auth/spaces.ts +118 -0
- package/dist/src/resources/auth/users.ts +36 -0
- package/dist/src/resources/console/index.ts +1 -0
- package/dist/src/resources/console/oauth2.ts +83 -0
- package/dist/src/resources/dashboard/dashboards.ts +171 -0
- package/dist/src/resources/dashboard/device-states.ts +142 -0
- package/dist/src/resources/dashboard/index.ts +2 -0
- package/dist/src/resources/index.ts +6 -0
- package/dist/src/shims/node.ts +50 -0
- package/dist/src/shims/web.ts +50 -0
- package/dist/src/types/api.ts +31 -0
- package/dist/src/types/jwt.ts +12 -0
- package/dist/src/version.ts +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/{version.js → dist/version.js} +1 -1
- package/dist/version.js.map +1 -0
- package/dist/version.mjs +2 -0
- package/{version.mjs.map → dist/version.mjs.map} +1 -1
- package/eslint.config.mjs +33 -0
- package/examples/auth/login.ts +14 -0
- package/examples/auth/register.ts +15 -0
- package/examples/console/oauth2.ts +15 -0
- package/package.json +52 -36
- package/scripts/build +56 -0
- package/scripts/utils/check-version.cjs +20 -0
- package/scripts/utils/fix-index-exports.cjs +8 -0
- package/scripts/utils/make-dist-package-json.cjs +21 -0
- package/scripts/utils/postprocess-files.cjs +153 -0
- package/src/_shims/auto/runtime-deno.ts +4 -0
- package/src/_shims/auto/types-deno.ts +4 -0
- package/src/_shims/auto/types.d.ts +18 -18
- package/src/_shims/index-deno.ts +105 -0
- package/src/_shims/index.d.ts +1 -1
- package/src/_shims/index.mjs +1 -1
- package/src/index.ts +4 -0
- package/src/resources/auth/auth.ts +10 -0
- package/src/resources/auth/index.ts +4 -0
- package/src/resources/auth/invitation.ts +17 -0
- package/src/resources/auth/join-space.ts +8 -0
- package/src/resources/auth/presigned-url.ts +13 -0
- package/src/resources/auth/space-role-users.ts +22 -0
- package/src/resources/auth/users.ts +36 -0
- package/src/version.ts +1 -1
- package/tsc-multi.json +7 -0
- package/tsconfig.build.json +18 -0
- package/tsconfig.deno.json +20 -0
- package/tsconfig.dist-src.json +11 -0
- package/tsconfig.json +38 -0
- package/index.js.map +0 -1
- package/index.mjs.map +0 -1
- package/resources/auth/auth.d.ts.map +0 -1
- package/resources/auth/auth.js.map +0 -1
- package/resources/auth/auth.mjs.map +0 -1
- package/resources/auth/space-role-users.d.ts.map +0 -1
- package/resources/auth/space-role-users.js.map +0 -1
- package/resources/auth/space-role-users.mjs.map +0 -1
- package/src/resources/.DS_Store +0 -0
- package/version.d.ts +0 -2
- package/version.d.ts.map +0 -1
- package/version.js.map +0 -1
- package/version.mjs +0 -2
- package/yarn.lock +0 -268
- /package/{_shims → dist/_shims}/MultipartBody.d.ts +0 -0
- /package/{_shims → dist/_shims}/MultipartBody.d.ts.map +0 -0
- /package/{_shims → dist/_shims}/MultipartBody.js +0 -0
- /package/{_shims → dist/_shims}/MultipartBody.js.map +0 -0
- /package/{_shims → dist/_shims}/MultipartBody.mjs +0 -0
- /package/{_shims → dist/_shims}/MultipartBody.mjs.map +0 -0
- /package/{_shims → dist/_shims}/README.md +0 -0
- /package/{_shims → dist/_shims}/auto/runtime-bun.d.ts +0 -0
- /package/{_shims → dist/_shims}/auto/runtime-bun.d.ts.map +0 -0
- /package/{_shims → dist/_shims}/auto/runtime-bun.js +0 -0
- /package/{_shims → dist/_shims}/auto/runtime-bun.js.map +0 -0
- /package/{_shims → dist/_shims}/auto/runtime-bun.mjs +0 -0
- /package/{_shims → dist/_shims}/auto/runtime-bun.mjs.map +0 -0
- /package/{_shims → dist/_shims}/auto/runtime-node.d.ts +0 -0
- /package/{_shims → dist/_shims}/auto/runtime-node.d.ts.map +0 -0
- /package/{_shims → dist/_shims}/auto/runtime-node.js +0 -0
- /package/{_shims → dist/_shims}/auto/runtime-node.js.map +0 -0
- /package/{_shims → dist/_shims}/auto/runtime-node.mjs +0 -0
- /package/{_shims → dist/_shims}/auto/runtime-node.mjs.map +0 -0
- /package/{_shims → dist/_shims}/auto/runtime.d.ts +0 -0
- /package/{_shims → dist/_shims}/auto/runtime.d.ts.map +0 -0
- /package/{_shims → dist/_shims}/auto/runtime.js +0 -0
- /package/{_shims → dist/_shims}/auto/runtime.js.map +0 -0
- /package/{_shims → dist/_shims}/auto/runtime.mjs +0 -0
- /package/{_shims → dist/_shims}/auto/runtime.mjs.map +0 -0
- /package/{_shims → dist/_shims}/auto/types-node.d.ts +0 -0
- /package/{_shims → dist/_shims}/auto/types-node.d.ts.map +0 -0
- /package/{_shims → dist/_shims}/auto/types-node.js +0 -0
- /package/{_shims → dist/_shims}/auto/types-node.js.map +0 -0
- /package/{_shims → dist/_shims}/auto/types-node.mjs +0 -0
- /package/{_shims → dist/_shims}/auto/types-node.mjs.map +0 -0
- /package/{_shims → dist/_shims}/auto/types.d.ts +0 -0
- /package/{_shims → dist/_shims}/auto/types.js +0 -0
- /package/{_shims → dist/_shims}/auto/types.mjs +0 -0
- /package/{_shims → dist/_shims}/bun-runtime.d.ts +0 -0
- /package/{_shims → dist/_shims}/bun-runtime.d.ts.map +0 -0
- /package/{_shims → dist/_shims}/bun-runtime.js +0 -0
- /package/{_shims → dist/_shims}/bun-runtime.js.map +0 -0
- /package/{_shims → dist/_shims}/bun-runtime.mjs +0 -0
- /package/{_shims → dist/_shims}/bun-runtime.mjs.map +0 -0
- /package/{_shims → dist/_shims}/index.d.ts +0 -0
- /package/{_shims → dist/_shims}/index.js +0 -0
- /package/{_shims → dist/_shims}/index.mjs +0 -0
- /package/{_shims → dist/_shims}/manual-types.d.ts +0 -0
- /package/{_shims → dist/_shims}/manual-types.js +0 -0
- /package/{_shims → dist/_shims}/manual-types.mjs +0 -0
- /package/{_shims → dist/_shims}/node-runtime.d.ts +0 -0
- /package/{_shims → dist/_shims}/node-runtime.d.ts.map +0 -0
- /package/{_shims → dist/_shims}/node-runtime.js +0 -0
- /package/{_shims → dist/_shims}/node-runtime.js.map +0 -0
- /package/{_shims → dist/_shims}/node-runtime.mjs +0 -0
- /package/{_shims → dist/_shims}/node-runtime.mjs.map +0 -0
- /package/{_shims → dist/_shims}/node-types.d.ts +0 -0
- /package/{_shims → dist/_shims}/node-types.js +0 -0
- /package/{_shims → dist/_shims}/node-types.mjs +0 -0
- /package/{_shims → dist/_shims}/registry.d.ts +0 -0
- /package/{_shims → dist/_shims}/registry.d.ts.map +0 -0
- /package/{_shims → dist/_shims}/registry.js +0 -0
- /package/{_shims → dist/_shims}/registry.js.map +0 -0
- /package/{_shims → dist/_shims}/registry.mjs +0 -0
- /package/{_shims → dist/_shims}/registry.mjs.map +0 -0
- /package/{_shims → dist/_shims}/web-runtime.d.ts +0 -0
- /package/{_shims → dist/_shims}/web-runtime.d.ts.map +0 -0
- /package/{_shims → dist/_shims}/web-runtime.js +0 -0
- /package/{_shims → dist/_shims}/web-runtime.js.map +0 -0
- /package/{_shims → dist/_shims}/web-runtime.mjs +0 -0
- /package/{_shims → dist/_shims}/web-runtime.mjs.map +0 -0
- /package/{_shims → dist/_shims}/web-types.d.ts +0 -0
- /package/{_shims → dist/_shims}/web-types.js +0 -0
- /package/{_shims → dist/_shims}/web-types.mjs +0 -0
- /package/{core.d.ts → dist/core.d.ts} +0 -0
- /package/{core.d.ts.map → dist/core.d.ts.map} +0 -0
- /package/{core.js → dist/core.js} +0 -0
- /package/{core.js.map → dist/core.js.map} +0 -0
- /package/{core.mjs → dist/core.mjs} +0 -0
- /package/{core.mjs.map → dist/core.mjs.map} +0 -0
- /package/{error.d.ts → dist/error.d.ts} +0 -0
- /package/{error.d.ts.map → dist/error.d.ts.map} +0 -0
- /package/{error.js → dist/error.js} +0 -0
- /package/{error.js.map → dist/error.js.map} +0 -0
- /package/{error.mjs → dist/error.mjs} +0 -0
- /package/{error.mjs.map → dist/error.mjs.map} +0 -0
- /package/{libs → dist/libs}/utils.d.ts +0 -0
- /package/{libs → dist/libs}/utils.d.ts.map +0 -0
- /package/{libs → dist/libs}/utils.js +0 -0
- /package/{libs → dist/libs}/utils.js.map +0 -0
- /package/{libs → dist/libs}/utils.mjs +0 -0
- /package/{libs → dist/libs}/utils.mjs.map +0 -0
- /package/{resource.d.ts → dist/resource.d.ts} +0 -0
- /package/{resource.d.ts.map → dist/resource.d.ts.map} +0 -0
- /package/{resource.js → dist/resource.js} +0 -0
- /package/{resource.js.map → dist/resource.js.map} +0 -0
- /package/{resource.mjs → dist/resource.mjs} +0 -0
- /package/{resource.mjs.map → dist/resource.mjs.map} +0 -0
- /package/{resources → dist/resources}/auth/credentials.d.ts +0 -0
- /package/{resources → dist/resources}/auth/credentials.d.ts.map +0 -0
- /package/{resources → dist/resources}/auth/credentials.js +0 -0
- /package/{resources → dist/resources}/auth/credentials.js.map +0 -0
- /package/{resources → dist/resources}/auth/credentials.mjs +0 -0
- /package/{resources → dist/resources}/auth/credentials.mjs.map +0 -0
- /package/{resources → dist/resources}/auth/index.mjs.map +0 -0
- /package/{resources → dist/resources}/auth/space-policies.d.ts +0 -0
- /package/{resources → dist/resources}/auth/space-policies.d.ts.map +0 -0
- /package/{resources → dist/resources}/auth/space-policies.js +0 -0
- /package/{resources → dist/resources}/auth/space-policies.js.map +0 -0
- /package/{resources → dist/resources}/auth/space-policies.mjs +0 -0
- /package/{resources → dist/resources}/auth/space-policies.mjs.map +0 -0
- /package/{resources → dist/resources}/auth/space-roles.d.ts +0 -0
- /package/{resources → dist/resources}/auth/space-roles.d.ts.map +0 -0
- /package/{resources → dist/resources}/auth/space-roles.js +0 -0
- /package/{resources → dist/resources}/auth/space-roles.js.map +0 -0
- /package/{resources → dist/resources}/auth/space-roles.mjs +0 -0
- /package/{resources → dist/resources}/auth/space-roles.mjs.map +0 -0
- /package/{resources → dist/resources}/auth/spaces.d.ts +0 -0
- /package/{resources → dist/resources}/auth/spaces.d.ts.map +0 -0
- /package/{resources → dist/resources}/auth/spaces.js +0 -0
- /package/{resources → dist/resources}/auth/spaces.js.map +0 -0
- /package/{resources → dist/resources}/auth/spaces.mjs +0 -0
- /package/{resources → dist/resources}/auth/spaces.mjs.map +0 -0
- /package/{resources → dist/resources}/console/index.d.ts +0 -0
- /package/{resources → dist/resources}/console/index.d.ts.map +0 -0
- /package/{resources → dist/resources}/console/index.js +0 -0
- /package/{resources → dist/resources}/console/index.js.map +0 -0
- /package/{resources → dist/resources}/console/index.mjs +0 -0
- /package/{resources → dist/resources}/console/index.mjs.map +0 -0
- /package/{resources → dist/resources}/console/oauth2.d.ts +0 -0
- /package/{resources → dist/resources}/console/oauth2.d.ts.map +0 -0
- /package/{resources → dist/resources}/console/oauth2.js +0 -0
- /package/{resources → dist/resources}/console/oauth2.js.map +0 -0
- /package/{resources → dist/resources}/console/oauth2.mjs +0 -0
- /package/{resources → dist/resources}/console/oauth2.mjs.map +0 -0
- /package/{resources → dist/resources}/dashboard/dashboards.d.ts +0 -0
- /package/{resources → dist/resources}/dashboard/dashboards.d.ts.map +0 -0
- /package/{resources → dist/resources}/dashboard/dashboards.js +0 -0
- /package/{resources → dist/resources}/dashboard/dashboards.js.map +0 -0
- /package/{resources → dist/resources}/dashboard/dashboards.mjs +0 -0
- /package/{resources → dist/resources}/dashboard/dashboards.mjs.map +0 -0
- /package/{resources → dist/resources}/dashboard/device-states.d.ts +0 -0
- /package/{resources → dist/resources}/dashboard/device-states.d.ts.map +0 -0
- /package/{resources → dist/resources}/dashboard/device-states.js +0 -0
- /package/{resources → dist/resources}/dashboard/device-states.js.map +0 -0
- /package/{resources → dist/resources}/dashboard/device-states.mjs +0 -0
- /package/{resources → dist/resources}/dashboard/device-states.mjs.map +0 -0
- /package/{resources → dist/resources}/dashboard/index.d.ts +0 -0
- /package/{resources → dist/resources}/dashboard/index.d.ts.map +0 -0
- /package/{resources → dist/resources}/dashboard/index.js +0 -0
- /package/{resources → dist/resources}/dashboard/index.js.map +0 -0
- /package/{resources → dist/resources}/dashboard/index.mjs +0 -0
- /package/{resources → dist/resources}/dashboard/index.mjs.map +0 -0
- /package/{resources → dist/resources}/index.d.ts +0 -0
- /package/{resources → dist/resources}/index.d.ts.map +0 -0
- /package/{resources → dist/resources}/index.js +0 -0
- /package/{resources → dist/resources}/index.js.map +0 -0
- /package/{resources → dist/resources}/index.mjs +0 -0
- /package/{resources → dist/resources}/index.mjs.map +0 -0
- /package/{shims → dist/shims}/node.d.ts +0 -0
- /package/{shims → dist/shims}/node.d.ts.map +0 -0
- /package/{shims → dist/shims}/node.js +0 -0
- /package/{shims → dist/shims}/node.js.map +0 -0
- /package/{shims → dist/shims}/node.mjs +0 -0
- /package/{shims → dist/shims}/node.mjs.map +0 -0
- /package/{shims → dist/shims}/web.d.ts +0 -0
- /package/{shims → dist/shims}/web.d.ts.map +0 -0
- /package/{shims → dist/shims}/web.js +0 -0
- /package/{shims → dist/shims}/web.js.map +0 -0
- /package/{shims → dist/shims}/web.mjs +0 -0
- /package/{shims → dist/shims}/web.mjs.map +0 -0
- /package/{src → dist/src}/tsconfig.json +0 -0
- /package/{types → dist/types}/api.d.ts +0 -0
- /package/{types → dist/types}/api.d.ts.map +0 -0
- /package/{types → dist/types}/api.js +0 -0
- /package/{types → dist/types}/api.js.map +0 -0
- /package/{types → dist/types}/api.mjs +0 -0
- /package/{types → dist/types}/api.mjs.map +0 -0
- /package/{types → dist/types}/jwt.d.ts +0 -0
- /package/{types → dist/types}/jwt.d.ts.map +0 -0
- /package/{types → dist/types}/jwt.js +0 -0
- /package/{types → dist/types}/jwt.js.map +0 -0
- /package/{types → dist/types}/jwt.mjs +0 -0
- /package/{types → dist/types}/jwt.mjs.map +0 -0
package/api.doc.md
ADDED
|
@@ -0,0 +1,1537 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://www.digitalfortress.dev/">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://digitalfortress-s3-bucket-vpcxuhhdwecuj.s3.amazonaws.com/Group+1410083530.svg">
|
|
5
|
+
<img alt="Digital Fortress logo" src="https://digitalfortress-s3-bucket-vpcxuhhdwecuj.s3.amazonaws.com/Group+1410083530.svg">
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
# Table of Contents
|
|
11
|
+
|
|
12
|
+
- [Auth](#Auth)
|
|
13
|
+
- [Credentials](#credentials)
|
|
14
|
+
- [Space Policies](#space-policies)
|
|
15
|
+
- [Space Role Users](#space-role-users)
|
|
16
|
+
- [Space Roles](#space-roles)
|
|
17
|
+
- [Spaces](#spaces)
|
|
18
|
+
- [Oauth2](#oauth2)
|
|
19
|
+
- [Dashboards](#dashboards)
|
|
20
|
+
- [Device States](#deviceStates)
|
|
21
|
+
- [Users](#users)
|
|
22
|
+
|
|
23
|
+
# Auth
|
|
24
|
+
|
|
25
|
+
## Overview
|
|
26
|
+
|
|
27
|
+
The `Auth` class provides authentication-related methods for user login, registration, OAuth login with Google, token refresh, switching spaces, and OAuth login with SpaceDF Console. Below are the details for each method, including parameters, return types, and example usage.
|
|
28
|
+
|
|
29
|
+
## Methods
|
|
30
|
+
|
|
31
|
+
<details>
|
|
32
|
+
<summary><strong>login</strong></summary>
|
|
33
|
+
|
|
34
|
+
Authenticate a user with email and password.
|
|
35
|
+
|
|
36
|
+
**Signature:**
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
login(body: AuthLoginParams, options?: Core.RequestOptions): Core.APIPromise<TokenPair>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Parameters:**
|
|
43
|
+
|
|
44
|
+
- `body` _(AuthLoginParams)_: Object containing user credentials.
|
|
45
|
+
- `email` _(string)_: User's email address.
|
|
46
|
+
- `password` _(string)_: User's password.
|
|
47
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
48
|
+
|
|
49
|
+
**Returns:** `Promise<TokenPair>`
|
|
50
|
+
|
|
51
|
+
**Example:**
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
const loginResponse = await client.auth.login({
|
|
55
|
+
email: 'user@example.com',
|
|
56
|
+
password: 'example_password',
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
</details>
|
|
61
|
+
|
|
62
|
+
<details>
|
|
63
|
+
<summary><strong>oauth2Google</strong></summary>
|
|
64
|
+
|
|
65
|
+
Log in a user via Google OAuth2.
|
|
66
|
+
|
|
67
|
+
**Signature:**
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
oauth2Google(body: AuthOauth2GoogleParams, options?: Core.RequestOptions): Core.APIPromise<OAuthLogin>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Parameters:**
|
|
74
|
+
|
|
75
|
+
- `body` _(AuthOauth2GoogleParams)_: Object containing OAuth2 parameters.
|
|
76
|
+
- `authorization_code` _(string)_: The authorization code obtained from Google.
|
|
77
|
+
- `code_verifier` _(string)_: The code verifier for PKCE.
|
|
78
|
+
|
|
79
|
+
**Returns:** `Promise<OAuthLogin>`
|
|
80
|
+
|
|
81
|
+
**Example:**
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
const googleAuthResponse = await client.auth.oauth2Google({
|
|
85
|
+
authorization_code: 'auth_code_from_google',
|
|
86
|
+
code_verifier: 'verifier',
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
</details>
|
|
91
|
+
|
|
92
|
+
<details>
|
|
93
|
+
<summary><strong>oauthSendOtp</strong></summary>
|
|
94
|
+
|
|
95
|
+
Send a one-time password (OTP) to the user's email for OAuth login.
|
|
96
|
+
|
|
97
|
+
**Signature:**
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
oauthSendOtp(body: OAuthSendOtp, options?: Core.RequestOptions): Core.APIPromise<OAuthSendOtp>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Parameters:**
|
|
104
|
+
|
|
105
|
+
- `body` _(OAuthSendOtp)_: Object containing user email.
|
|
106
|
+
- `email` _(string)_: The email address to send the OTP to.
|
|
107
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
108
|
+
|
|
109
|
+
**Returns:** `Promise<OAuthSendOtp>`
|
|
110
|
+
|
|
111
|
+
**Example:**
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
await client.auth.oauthSendOtp({
|
|
115
|
+
email: 'user@example.com',
|
|
116
|
+
});
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
</details>
|
|
120
|
+
|
|
121
|
+
<details>
|
|
122
|
+
<summary><strong>refreshToken</strong></summary>
|
|
123
|
+
|
|
124
|
+
Refresh the access token using a refresh token.
|
|
125
|
+
|
|
126
|
+
**Signature:**
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
refreshToken(body: AuthRefreshTokenParams, options?: Core.RequestOptions): Core.APIPromise<CustomTokenRefresh>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Parameters:**
|
|
133
|
+
|
|
134
|
+
- `body` _(AuthRefreshTokenParams)_: Object containing the refresh token.
|
|
135
|
+
- `refresh` _(string)_: Refresh token.
|
|
136
|
+
|
|
137
|
+
**Returns:** `Promise<CustomTokenRefresh>`
|
|
138
|
+
|
|
139
|
+
**Example:**
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
const refreshResponse = await client.auth.refreshToken({
|
|
143
|
+
refresh: 'refresh_token',
|
|
144
|
+
});
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
</details>
|
|
148
|
+
|
|
149
|
+
<details>
|
|
150
|
+
<summary><strong>register</strong></summary>
|
|
151
|
+
|
|
152
|
+
Register a new user account.
|
|
153
|
+
|
|
154
|
+
**Signature:**
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
register(body: AuthRegisterParams, options?: Core.RequestOptions): Core.APIPromise<Registration>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Parameters:**
|
|
161
|
+
|
|
162
|
+
- `body` _(AuthRegisterParams)_: Object containing user registration details.
|
|
163
|
+
- `email` _(string)_: User's email address.
|
|
164
|
+
- `password` _(string)_: User's chosen password.
|
|
165
|
+
- `first_name` _(string)_: User's first name (optional).
|
|
166
|
+
- `last_name` _(string)_: User's last name (optional).
|
|
167
|
+
- `otp` _(string)_: User's OTP code (optional).
|
|
168
|
+
|
|
169
|
+
**Returns:** `Promise<Registration>`
|
|
170
|
+
|
|
171
|
+
**Example:**
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
const registerResponse = await client.auth.register({
|
|
175
|
+
first_name: 'Example',
|
|
176
|
+
last_name: 'Example',
|
|
177
|
+
email: 'user@example.com',
|
|
178
|
+
password: 'example_password',
|
|
179
|
+
});
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
</details>
|
|
183
|
+
|
|
184
|
+
<details>
|
|
185
|
+
<summary><strong>oauth2SpaceDF</strong></summary>
|
|
186
|
+
|
|
187
|
+
Log in a user via SpaceDF Console OAuth2.
|
|
188
|
+
|
|
189
|
+
**Signature:**
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
oauth2SpaceDF(body: OAuthSpaceDF, options?: Core.RequestOptions): Core.APIPromise<OAuthSpaceDF>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Parameters:**
|
|
196
|
+
|
|
197
|
+
- `body` _(OAuthSpaceDF)_: Object containing OAuth2 parameters.
|
|
198
|
+
- `code_verifier` _(string)_: The code verifier for PKCE.
|
|
199
|
+
- `code` _(string)_: The authorization code obtained from SpaceDF Console.
|
|
200
|
+
- `client_id` _(string)_: The client ID of the application.
|
|
201
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
202
|
+
|
|
203
|
+
**Returns:** `Promise<OAuthSpaceDF>`
|
|
204
|
+
|
|
205
|
+
**Example:**
|
|
206
|
+
|
|
207
|
+
```typescript
|
|
208
|
+
const spaceDFAuthResponse = await client.auth.oauth2SpaceDF({
|
|
209
|
+
code_verifier: 'verifier',
|
|
210
|
+
code: 'auth_code_from_spacedf',
|
|
211
|
+
client_id: 'your-client-id',
|
|
212
|
+
});
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
</details>
|
|
216
|
+
|
|
217
|
+
<details>
|
|
218
|
+
<summary><strong>switchSpaces</strong></summary>
|
|
219
|
+
|
|
220
|
+
Switch the user's active space using a refresh token.
|
|
221
|
+
|
|
222
|
+
**Signature:**
|
|
223
|
+
|
|
224
|
+
```typescript
|
|
225
|
+
switchSpaces(body: AuthRefreshTokenParams, options?: Core.RequestOptions): Core.APIPromise<CustomTokenRefresh>
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**Parameters:**
|
|
229
|
+
|
|
230
|
+
- `body` _(AuthRefreshTokenParams)_: Object containing the refresh token and target space.
|
|
231
|
+
- `refresh` _(string)_: Refresh token.
|
|
232
|
+
- `space` _(string)_: Target space to switch to.
|
|
233
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
234
|
+
|
|
235
|
+
**Returns:** `Promise<CustomTokenRefresh>`
|
|
236
|
+
|
|
237
|
+
**Example:**
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
const switchResponse = await client.auth.switchSpaces({
|
|
241
|
+
refresh: 'refresh_token',
|
|
242
|
+
space: 'target_space',
|
|
243
|
+
});
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
</details>
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
# Space Policies
|
|
251
|
+
|
|
252
|
+
## Overview
|
|
253
|
+
|
|
254
|
+
The `SpacePolicies` class provides methods for retrieving and listing space policies. Below are the details for each method, including parameters, return types, and example usage.
|
|
255
|
+
|
|
256
|
+
## Methods
|
|
257
|
+
|
|
258
|
+
<details>
|
|
259
|
+
<summary><strong>retrieve</strong></summary>
|
|
260
|
+
|
|
261
|
+
Retrieve a specific space policy by its ID.
|
|
262
|
+
|
|
263
|
+
**Signature:**
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
retrieve(id: number, options?: Core.RequestOptions): Core.APIPromise<SpacePolicy>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**Parameters:**
|
|
270
|
+
|
|
271
|
+
- `id` _(number)_: The ID of the space policy to retrieve.
|
|
272
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
273
|
+
|
|
274
|
+
**Returns:** `Promise<SpacePolicy>`
|
|
275
|
+
|
|
276
|
+
**Example:**
|
|
277
|
+
|
|
278
|
+
```typescript
|
|
279
|
+
const spacePolicy = await client.spacePolicies.retrieve(1);
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
</details>
|
|
283
|
+
|
|
284
|
+
<details>
|
|
285
|
+
<summary><strong>list</strong></summary>
|
|
286
|
+
|
|
287
|
+
List all space policies or filter them based on query parameters.
|
|
288
|
+
|
|
289
|
+
**Signature:**
|
|
290
|
+
|
|
291
|
+
```typescript
|
|
292
|
+
list(query?: SpacePolicyListParams, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
293
|
+
list(options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
294
|
+
list(query: SpacePolicyListParams | Core.RequestOptions = {}, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
**Parameters:**
|
|
298
|
+
|
|
299
|
+
- `query` _(SpacePolicyListParams)_: (optional) Filters to apply when listing policies.
|
|
300
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
301
|
+
|
|
302
|
+
**Returns:** `Promise<SpacePolicyListResponse>`
|
|
303
|
+
|
|
304
|
+
**Example:**
|
|
305
|
+
|
|
306
|
+
```typescript
|
|
307
|
+
const spacePolicies = await client.spacePolicies.list({ page: 1, limit: 10 });
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
</details>
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
# Space Role Users
|
|
315
|
+
|
|
316
|
+
## Overview
|
|
317
|
+
|
|
318
|
+
The `SpaceRoleUsers` class provides methods for managing users within specific space roles. Below are the details for each method, including parameters, return types, and example usage.
|
|
319
|
+
|
|
320
|
+
## Methods
|
|
321
|
+
|
|
322
|
+
<details>
|
|
323
|
+
<summary><strong>retrieve</strong></summary>
|
|
324
|
+
|
|
325
|
+
Retrieve a specific space role user by their ID.
|
|
326
|
+
|
|
327
|
+
**Signature:**
|
|
328
|
+
|
|
329
|
+
```typescript
|
|
330
|
+
retrieve(id: number, params: SpaceRoleUserRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUser>
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
**Parameters:**
|
|
334
|
+
|
|
335
|
+
- `id` _(number)_: The ID of the space role user to retrieve.
|
|
336
|
+
- `params` _(SpaceRoleUserRetrieveParams)_: Parameters containing the space slug.
|
|
337
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
338
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
339
|
+
|
|
340
|
+
**Returns:** `Promise<SpaceRoleUser>`
|
|
341
|
+
|
|
342
|
+
**Example:**
|
|
343
|
+
|
|
344
|
+
```typescript
|
|
345
|
+
const spaceRoleUser = await client.spaceRoleUsers.retrieve(1, { 'X-Space': 'example-space' });
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
</details>
|
|
349
|
+
|
|
350
|
+
<details>
|
|
351
|
+
<summary><strong>list</strong></summary>
|
|
352
|
+
|
|
353
|
+
List all space role users or filter them based on query parameters.
|
|
354
|
+
|
|
355
|
+
**Signature:**
|
|
356
|
+
|
|
357
|
+
```typescript
|
|
358
|
+
list(params: SpaceRoleUserListParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserListResponse>
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
**Parameters:**
|
|
362
|
+
|
|
363
|
+
- `params` _(SpaceRoleUserListParams)_: Parameters containing the space slug and any additional filters.
|
|
364
|
+
- `X-Space`: _(string)_: Header param for space slug name.
|
|
365
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
366
|
+
|
|
367
|
+
**Returns:** `Promise<SpaceRoleUserListResponse>`
|
|
368
|
+
|
|
369
|
+
**Example:**
|
|
370
|
+
|
|
371
|
+
```typescript
|
|
372
|
+
const spaceRoleUsers = await client.spaceRoleUsers.list({ 'X-Space': 'example-space', page: 1, limit: 10 });
|
|
373
|
+
console.log(spaceRoleUsers);
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
</details>
|
|
377
|
+
|
|
378
|
+
<details>
|
|
379
|
+
<summary><strong>update</strong></summary>
|
|
380
|
+
|
|
381
|
+
Update the details of a specific space role user.
|
|
382
|
+
|
|
383
|
+
**Signature:**
|
|
384
|
+
|
|
385
|
+
```typescript
|
|
386
|
+
update(id: number, params: SpaceRoleParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleParams>
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
**Parameters:**
|
|
390
|
+
|
|
391
|
+
- `id` _(number)_: The ID of the space role user to update.
|
|
392
|
+
- `params` _(SpaceRoleParams)_: Parameters containing updated space role details.
|
|
393
|
+
- `space_role`: _(string)_: The updated space role for the user.
|
|
394
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
395
|
+
|
|
396
|
+
**Returns:** `Promise<SpaceRoleParams>`
|
|
397
|
+
|
|
398
|
+
**Example:**
|
|
399
|
+
|
|
400
|
+
```typescript
|
|
401
|
+
const updatedRole = await client.spaceRoleUsers.update(1, { space_role: 'new-role' });
|
|
402
|
+
console.log(updatedRole);
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
</details>
|
|
406
|
+
|
|
407
|
+
<details>
|
|
408
|
+
<summary><strong>partialUpdate</strong></summary>
|
|
409
|
+
|
|
410
|
+
Partially update the details of a specific space role user.
|
|
411
|
+
|
|
412
|
+
**Signature:**
|
|
413
|
+
|
|
414
|
+
```typescript
|
|
415
|
+
partialUpdate(id: number, params: SpaceRoleParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleParams>
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
**Parameters:**
|
|
419
|
+
|
|
420
|
+
- `id` _(number)_: The ID of the space role user to partially update.
|
|
421
|
+
- `params` _(SpaceRoleParams)_: Parameters containing updated space role details.
|
|
422
|
+
- `space_role`: _(string)_: The updated space role for the user.
|
|
423
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
424
|
+
|
|
425
|
+
**Returns:** `Promise<SpaceRoleParams>`
|
|
426
|
+
|
|
427
|
+
**Example:**
|
|
428
|
+
|
|
429
|
+
```typescript
|
|
430
|
+
const partialUpdatedRole = await client.spaceRoleUsers.partialUpdate(1, { space_role: 'another-role' });
|
|
431
|
+
console.log(partialUpdatedRole);
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
</details>
|
|
435
|
+
|
|
436
|
+
<details>
|
|
437
|
+
<summary><strong>delete</strong></summary>
|
|
438
|
+
|
|
439
|
+
Delete a specific space role user by their ID.
|
|
440
|
+
|
|
441
|
+
**Signature:**
|
|
442
|
+
|
|
443
|
+
```typescript
|
|
444
|
+
delete(id: number, params: SpaceRoleUserDeleteParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
**Parameters:**
|
|
448
|
+
|
|
449
|
+
- `id` _(number)_: The ID of the space role user to delete.
|
|
450
|
+
- `params` _(SpaceRoleUserDeleteParams)_: Parameters containing the space slug.
|
|
451
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
452
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
453
|
+
|
|
454
|
+
**Returns:** `Promise<void>`
|
|
455
|
+
|
|
456
|
+
**Example:**
|
|
457
|
+
|
|
458
|
+
```typescript
|
|
459
|
+
await client.spaceRoleUsers.delete(1, { 'X-Space': 'example-space' });
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
</details>
|
|
463
|
+
|
|
464
|
+
---
|
|
465
|
+
|
|
466
|
+
# Credentials
|
|
467
|
+
|
|
468
|
+
## Overview
|
|
469
|
+
|
|
470
|
+
The `Credentials` class provides methods for retrieving OAuth credentials, such as the client ID.
|
|
471
|
+
|
|
472
|
+
## Methods
|
|
473
|
+
|
|
474
|
+
<details>
|
|
475
|
+
<summary><strong>retrieve</strong></summary>
|
|
476
|
+
|
|
477
|
+
Retrieve the OAuth client ID.
|
|
478
|
+
|
|
479
|
+
**Signature:**
|
|
480
|
+
|
|
481
|
+
```typescript
|
|
482
|
+
retrieve(options?: Core.RequestOptions): Core.APIPromise<OAuthCredentials>
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
**Parameters:**
|
|
486
|
+
|
|
487
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
488
|
+
|
|
489
|
+
**Returns:** `Promise<OAuthCredentials>`
|
|
490
|
+
|
|
491
|
+
**Example:**
|
|
492
|
+
|
|
493
|
+
```typescript
|
|
494
|
+
const credentials = await client.credentials.retrieve();
|
|
495
|
+
console.log(credentials.client_id);
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
</details>
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
502
|
+
# Space Roles
|
|
503
|
+
|
|
504
|
+
## Overview
|
|
505
|
+
|
|
506
|
+
The `SpaceRoles` class provides methods for managing roles within specific spaces. Below are the details for each method, including parameters, return types, and example usage.
|
|
507
|
+
|
|
508
|
+
## Methods
|
|
509
|
+
|
|
510
|
+
<details>
|
|
511
|
+
<summary><strong>create</strong></summary>
|
|
512
|
+
|
|
513
|
+
Create a new space role.
|
|
514
|
+
|
|
515
|
+
**Signature:**
|
|
516
|
+
|
|
517
|
+
```typescript
|
|
518
|
+
create(params: SpaceRoleCreateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole>
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
**Parameters:**
|
|
522
|
+
|
|
523
|
+
- `params` _(SpaceRoleCreateParams)_: Parameters for creating a new space role.
|
|
524
|
+
- `name`: _(string)_: The name of the space role.
|
|
525
|
+
- `policies`: _(Array<number>)_: An array of policy IDs associated with the space role.
|
|
526
|
+
- `X-Space`: _(string)_: Header param for space slug name.
|
|
527
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
528
|
+
|
|
529
|
+
**Returns:** `Promise<SpaceRole>`
|
|
530
|
+
|
|
531
|
+
**Example:**
|
|
532
|
+
|
|
533
|
+
```typescript
|
|
534
|
+
const newSpaceRole = await client.spaceRoles.create({
|
|
535
|
+
name: 'Admin',
|
|
536
|
+
policies: [1, 2],
|
|
537
|
+
'X-Space': 'example-space',
|
|
538
|
+
});
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
</details>
|
|
542
|
+
|
|
543
|
+
<details>
|
|
544
|
+
<summary><strong>retrieve</strong></summary>
|
|
545
|
+
|
|
546
|
+
Retrieve a specific space role by its ID.
|
|
547
|
+
|
|
548
|
+
**Signature:**
|
|
549
|
+
|
|
550
|
+
```typescript
|
|
551
|
+
retrieve(id: number, params: SpaceRoleRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole>
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
**Parameters:**
|
|
555
|
+
|
|
556
|
+
- `id` _(number)_: The ID of the space role to retrieve.
|
|
557
|
+
- `params` _(SpaceRoleRetrieveParams)_: Parameters containing the space slug.
|
|
558
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
559
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
560
|
+
|
|
561
|
+
**Returns:** `Promise<SpaceRole>`
|
|
562
|
+
|
|
563
|
+
**Example:**
|
|
564
|
+
|
|
565
|
+
```typescript
|
|
566
|
+
const spaceRole = await client.spaceRoles.retrieve(1, { 'X-Space': 'example-space' });
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
</details>
|
|
570
|
+
|
|
571
|
+
<details>
|
|
572
|
+
<summary><strong>update</strong></summary>
|
|
573
|
+
|
|
574
|
+
Update a specific space role by its ID.
|
|
575
|
+
|
|
576
|
+
**Signature:**
|
|
577
|
+
|
|
578
|
+
```typescript
|
|
579
|
+
update(id: number, params: SpaceRoleUpdateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole>
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
**Parameters:**
|
|
583
|
+
|
|
584
|
+
- `id` _(number)_: The ID of the space role to update.
|
|
585
|
+
- `params` _(SpaceRoleUpdateParams)_: Parameters for updating the space role.
|
|
586
|
+
- `name`: _(string)_: The new name of the space role.
|
|
587
|
+
- `policies`: _(Array<number>)_: An updated array of policy IDs associated with the space role.
|
|
588
|
+
- `X-Space`: _(string)_: Header param for space slug name.
|
|
589
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
590
|
+
|
|
591
|
+
**Returns:** `Promise<SpaceRole>`
|
|
592
|
+
|
|
593
|
+
**Example:**
|
|
594
|
+
|
|
595
|
+
```typescript
|
|
596
|
+
const updatedSpaceRole = await client.spaceRoles.update(1, {
|
|
597
|
+
name: 'Super Admin',
|
|
598
|
+
policies: [1, 3],
|
|
599
|
+
'X-Space': 'example-space',
|
|
600
|
+
});
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
</details>
|
|
604
|
+
|
|
605
|
+
<details>
|
|
606
|
+
<summary><strong>list</strong></summary>
|
|
607
|
+
|
|
608
|
+
List all space roles or filter them based on query parameters.
|
|
609
|
+
|
|
610
|
+
**Signature:**
|
|
611
|
+
|
|
612
|
+
```typescript
|
|
613
|
+
list(params: SpaceRoleListParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleListResponse>
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
**Parameters:**
|
|
617
|
+
|
|
618
|
+
- `params` _(SpaceRoleListParams)_: Parameters containing the space slug and any additional filters.
|
|
619
|
+
- `X-Space`: _(string)_: Header param for space slug name.
|
|
620
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
621
|
+
|
|
622
|
+
**Returns:** `Promise<SpaceRoleListResponse>`
|
|
623
|
+
|
|
624
|
+
**Example:**
|
|
625
|
+
|
|
626
|
+
```typescript
|
|
627
|
+
const spaceRoles = await client.spaceRoles.list({ 'X-Space': 'example-space', page: 1, limit: 10 });
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
</details>
|
|
631
|
+
|
|
632
|
+
<details>
|
|
633
|
+
<summary><strong>delete</strong></summary>
|
|
634
|
+
|
|
635
|
+
Delete a specific space role by its ID.
|
|
636
|
+
|
|
637
|
+
**Signature:**
|
|
638
|
+
|
|
639
|
+
```typescript
|
|
640
|
+
delete(id: number, params: SpaceRoleDeleteParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
**Parameters:**
|
|
644
|
+
|
|
645
|
+
- `id` _(number)_: The ID of the space role to delete.
|
|
646
|
+
- `params` _(SpaceRoleDeleteParams)_: Parameters containing the space slug.
|
|
647
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
648
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
649
|
+
|
|
650
|
+
**Returns:** `Promise<void>`
|
|
651
|
+
|
|
652
|
+
**Example:**
|
|
653
|
+
|
|
654
|
+
```typescript
|
|
655
|
+
await client.spaceRoles.delete(1, { 'X-Space': 'example-space' });
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
</details>
|
|
659
|
+
|
|
660
|
+
---
|
|
661
|
+
|
|
662
|
+
# Spaces
|
|
663
|
+
|
|
664
|
+
## Overview
|
|
665
|
+
|
|
666
|
+
The `Spaces` class provides methods for managing spaces within an application. Below are the details for each method, including parameters, return types, and example usage.
|
|
667
|
+
|
|
668
|
+
## Methods
|
|
669
|
+
|
|
670
|
+
<details>
|
|
671
|
+
<summary><strong>create</strong></summary>
|
|
672
|
+
|
|
673
|
+
Create a new space.
|
|
674
|
+
|
|
675
|
+
**Signature:**
|
|
676
|
+
|
|
677
|
+
```typescript
|
|
678
|
+
create(body: SpaceCreateParams, options?: Core.RequestOptions): Core.APIPromise<Space>
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
**Parameters:**
|
|
682
|
+
|
|
683
|
+
- `body` _(SpaceCreateParams)_: Parameters for creating a new space.
|
|
684
|
+
- `logo`: _(string)_: URL of the space logo.
|
|
685
|
+
- `name`: _(string)_: The name of the space.
|
|
686
|
+
- `slug_name`: _(string)_: Slug name for the space.
|
|
687
|
+
- `is_active` _(boolean)_: (Optional) Whether the space is active.
|
|
688
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
689
|
+
|
|
690
|
+
**Returns:** `Promise<Space>`
|
|
691
|
+
|
|
692
|
+
**Example:**
|
|
693
|
+
|
|
694
|
+
```typescript
|
|
695
|
+
const newSpace = await client.spaces.create({
|
|
696
|
+
logo: 'https://example.com/logo.png',
|
|
697
|
+
name: 'My Space',
|
|
698
|
+
slug_name: 'my-space',
|
|
699
|
+
is_active: true,
|
|
700
|
+
});
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
</details>
|
|
704
|
+
|
|
705
|
+
<details>
|
|
706
|
+
<summary><strong>update</strong></summary>
|
|
707
|
+
|
|
708
|
+
Update an existing space.
|
|
709
|
+
|
|
710
|
+
**Signature:**
|
|
711
|
+
|
|
712
|
+
```typescript
|
|
713
|
+
update(params: SpaceUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Space>
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
**Parameters:**
|
|
717
|
+
|
|
718
|
+
- `params` _(SpaceUpdateParams)_: Parameters for updating the space.
|
|
719
|
+
- `logo`: _(string)_: URL of the new space logo.
|
|
720
|
+
- `name`: _(string)_: The new name of the space.
|
|
721
|
+
- `slug_name`: _(string)_: The new slug name for the space.
|
|
722
|
+
- `X-Space`: _(string)_: Header param for space slug name.
|
|
723
|
+
- `is_active` _(boolean)_: (Optional) Whether the space is active.
|
|
724
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
725
|
+
|
|
726
|
+
**Returns:** `Promise<Space>`
|
|
727
|
+
|
|
728
|
+
**Example:**
|
|
729
|
+
|
|
730
|
+
```typescript
|
|
731
|
+
const updatedSpace = await client.spaces.update({
|
|
732
|
+
logo: 'https://example.com/new-logo.png',
|
|
733
|
+
name: 'Updated Space',
|
|
734
|
+
slug_name: 'updated-space',
|
|
735
|
+
'X-Space': 'my-space',
|
|
736
|
+
is_active: true,
|
|
737
|
+
});
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
</details>
|
|
741
|
+
|
|
742
|
+
<details>
|
|
743
|
+
<summary><strong>list</strong></summary>
|
|
744
|
+
|
|
745
|
+
List all spaces or filter them based on query parameters.
|
|
746
|
+
|
|
747
|
+
**Signature:**
|
|
748
|
+
|
|
749
|
+
```typescript
|
|
750
|
+
list(params?: SpaceListParams, options?: Core.RequestOptions): Core.APIPromise<SpaceListResponse>
|
|
751
|
+
```
|
|
752
|
+
|
|
753
|
+
**Parameters:**
|
|
754
|
+
|
|
755
|
+
- `params` _(SpaceListParams)_: (Optional) Parameters containing the space slug and any additional filters.
|
|
756
|
+
- `X-Space`: _(string)_: Header param for space slug name (optional).
|
|
757
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
758
|
+
|
|
759
|
+
**Returns:** `Promise<SpaceListResponse>`
|
|
760
|
+
|
|
761
|
+
**Example:**
|
|
762
|
+
|
|
763
|
+
```typescript
|
|
764
|
+
const spaces = await client.spaces.list({ 'X-Space': 'my-space' });
|
|
765
|
+
```
|
|
766
|
+
|
|
767
|
+
</details>
|
|
768
|
+
|
|
769
|
+
<details>
|
|
770
|
+
<summary><strong>delete</strong></summary>
|
|
771
|
+
|
|
772
|
+
Delete a specific space.
|
|
773
|
+
|
|
774
|
+
**Signature:**
|
|
775
|
+
|
|
776
|
+
```typescript
|
|
777
|
+
delete(params: SpaceDeleteParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
778
|
+
```
|
|
779
|
+
|
|
780
|
+
**Parameters:**
|
|
781
|
+
|
|
782
|
+
- `params` _(SpaceDeleteParams)_: Parameters containing the space slug.
|
|
783
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
784
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
785
|
+
|
|
786
|
+
**Returns:** `Promise<void>`
|
|
787
|
+
|
|
788
|
+
**Example:**
|
|
789
|
+
|
|
790
|
+
```typescript
|
|
791
|
+
await client.spaces.delete({ 'X-Space': 'my-space' });
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
</details>
|
|
795
|
+
|
|
796
|
+
---
|
|
797
|
+
|
|
798
|
+
# Oauth2
|
|
799
|
+
|
|
800
|
+
## Overview
|
|
801
|
+
|
|
802
|
+
The `OAuth2` class provides methods for handling OAuth2 authorization and token exchange processes within an application.
|
|
803
|
+
|
|
804
|
+
## Methods
|
|
805
|
+
|
|
806
|
+
<details>
|
|
807
|
+
<summary><strong>authorize</strong></summary>
|
|
808
|
+
|
|
809
|
+
Initiates the OAuth2 authorization flow by generating a code challenge and sending the authorization request.
|
|
810
|
+
|
|
811
|
+
**Signature:**
|
|
812
|
+
|
|
813
|
+
```typescript
|
|
814
|
+
async authorize(body: OAuth2AuthorizeParams, options?: Core.RequestOptions): Promise<OAuth2Authorize>
|
|
815
|
+
```
|
|
816
|
+
|
|
817
|
+
**Parameters:**
|
|
818
|
+
|
|
819
|
+
- `body` _(OAuth2AuthorizeParams)_: Parameters required for authorization.
|
|
820
|
+
- `client_id`: _(string)_: The client ID of the application.
|
|
821
|
+
- `redirect_uri`: _(string)_: The URI to redirect to after authorization.
|
|
822
|
+
- `scopes`: _(Array<'organization'>)_: Scopes for the authorization request.
|
|
823
|
+
- `options` _(Core.RequestOptions)_: (Optional) Additional request options.
|
|
824
|
+
|
|
825
|
+
**Returns:** `Promise<OAuth2Authorize>`
|
|
826
|
+
|
|
827
|
+
**Example:**
|
|
828
|
+
|
|
829
|
+
```typescript
|
|
830
|
+
const authParams: OAuth2AuthorizeParams = {
|
|
831
|
+
client_id: 'your-client-id',
|
|
832
|
+
redirect_uri: 'https://yourapp.com/callback',
|
|
833
|
+
scopes: ['organization'],
|
|
834
|
+
};
|
|
835
|
+
const authResponse = await client.oauth2.authorize(authParams);
|
|
836
|
+
```
|
|
837
|
+
|
|
838
|
+
</details>
|
|
839
|
+
|
|
840
|
+
<details>
|
|
841
|
+
<summary><strong>token</strong></summary>
|
|
842
|
+
|
|
843
|
+
Exchanges the authorization code for an access token.
|
|
844
|
+
|
|
845
|
+
**Signature:**
|
|
846
|
+
|
|
847
|
+
```typescript
|
|
848
|
+
token(body: OAuth2Token, options?: Core.RequestOptions): Core.APIPromise<OAuth2Token>
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
**Parameters:**
|
|
852
|
+
|
|
853
|
+
- `body` _(OAuth2Token)_: Parameters required to obtain an access token.
|
|
854
|
+
- `client_id`: _(string)_: The client ID of the application.
|
|
855
|
+
- `client_secret`: _(string)_: The client secret of the application.
|
|
856
|
+
- `code`: _(string)_: The authorization code received from the authorization server.
|
|
857
|
+
- `code_verifier`: _(string)_: The code verifier used in the authorization request.
|
|
858
|
+
- `scopes`: _(Array<'organization'>)_: (Optional) Scopes for the token request.
|
|
859
|
+
- `id_token`: _(string)_: (Optional) ID token if available.
|
|
860
|
+
|
|
861
|
+
**Returns:** `Promise<OAuth2Token>`
|
|
862
|
+
|
|
863
|
+
**Example:**
|
|
864
|
+
|
|
865
|
+
```typescript
|
|
866
|
+
const tokenParams: OAuth2Token = {
|
|
867
|
+
client_id: 'your-client-id',
|
|
868
|
+
client_secret: 'your-client-secret',
|
|
869
|
+
code: 'authorization-code',
|
|
870
|
+
code_verifier: 'your-code-verifier',
|
|
871
|
+
};
|
|
872
|
+
const tokenResponse = await oauth2.token(tokenParams);
|
|
873
|
+
```
|
|
874
|
+
|
|
875
|
+
</details>
|
|
876
|
+
|
|
877
|
+
---
|
|
878
|
+
|
|
879
|
+
# Dashboards
|
|
880
|
+
|
|
881
|
+
## Overview
|
|
882
|
+
|
|
883
|
+
The `Dashboards` class provides methods to manage dashboards and their associated widgets within an application.
|
|
884
|
+
|
|
885
|
+
## Methods
|
|
886
|
+
|
|
887
|
+
<details>
|
|
888
|
+
<summary><strong>create</strong></summary>
|
|
889
|
+
|
|
890
|
+
Creates a new dashboard.
|
|
891
|
+
|
|
892
|
+
**Signature:**
|
|
893
|
+
|
|
894
|
+
```typescript
|
|
895
|
+
create(params: DashboardCreateParams, options?: Core.RequestOptions): Core.APIPromise<Dashboard>
|
|
896
|
+
```
|
|
897
|
+
|
|
898
|
+
**Parameters:**
|
|
899
|
+
|
|
900
|
+
- `params` _(DashboardCreateParams)_: Parameters required for creating a dashboard.
|
|
901
|
+
- `name`: _(string)_: The name of the dashboard.
|
|
902
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
903
|
+
|
|
904
|
+
**Returns:** `Promise<Dashboard>`
|
|
905
|
+
|
|
906
|
+
**Example:**
|
|
907
|
+
|
|
908
|
+
```typescript
|
|
909
|
+
const dashboardParams: DashboardCreateParams = {
|
|
910
|
+
name: 'New Dashboard',
|
|
911
|
+
'X-Space': 'your-space-slug',
|
|
912
|
+
};
|
|
913
|
+
const newDashboard = await client.dashboards.create(dashboardParams);
|
|
914
|
+
```
|
|
915
|
+
|
|
916
|
+
</details>
|
|
917
|
+
|
|
918
|
+
<details>
|
|
919
|
+
<summary><strong>retrieve</strong></summary>
|
|
920
|
+
|
|
921
|
+
Retrieves a specific dashboard by its ID.
|
|
922
|
+
|
|
923
|
+
**Signature:**
|
|
924
|
+
|
|
925
|
+
```typescript
|
|
926
|
+
retrieve(id: number, params: DashboardRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<Dashboard>
|
|
927
|
+
```
|
|
928
|
+
|
|
929
|
+
**Parameters:**
|
|
930
|
+
|
|
931
|
+
- `id` _(number)_: The ID of the dashboard to retrieve.
|
|
932
|
+
- `params` _(DashboardRetrieveParams)_: Parameters required for retrieving a dashboard.
|
|
933
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
934
|
+
|
|
935
|
+
**Returns:** `Promise<Dashboard>`
|
|
936
|
+
|
|
937
|
+
**Example:**
|
|
938
|
+
|
|
939
|
+
```typescript
|
|
940
|
+
const dashboardId = 1;
|
|
941
|
+
const dashboardDetails = await client.dashboards.retrieve(dashboardId, { 'X-Space': 'your-space-slug' });
|
|
942
|
+
```
|
|
943
|
+
|
|
944
|
+
</details>
|
|
945
|
+
|
|
946
|
+
<details>
|
|
947
|
+
<summary><strong>update</strong></summary>
|
|
948
|
+
|
|
949
|
+
Updates an existing dashboard.
|
|
950
|
+
|
|
951
|
+
**Signature:**
|
|
952
|
+
|
|
953
|
+
```typescript
|
|
954
|
+
update(id: number, params: DashboardUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Dashboard>
|
|
955
|
+
```
|
|
956
|
+
|
|
957
|
+
**Parameters:**
|
|
958
|
+
|
|
959
|
+
- `id` _(number)_: The ID of the dashboard to update.
|
|
960
|
+
- `params` _(DashboardUpdateParams)_: Parameters required for updating a dashboard.
|
|
961
|
+
- `name`: _(string)_: The new name of the dashboard.
|
|
962
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
963
|
+
|
|
964
|
+
**Returns:** `Promise<Dashboard>`
|
|
965
|
+
|
|
966
|
+
**Example:**
|
|
967
|
+
|
|
968
|
+
```typescript
|
|
969
|
+
const updateParams: DashboardUpdateParams = {
|
|
970
|
+
name: 'Updated Dashboard',
|
|
971
|
+
'X-Space': 'your-space-slug',
|
|
972
|
+
};
|
|
973
|
+
const updatedDashboard = await client.dashboards.update(dashboardId, updateParams);
|
|
974
|
+
```
|
|
975
|
+
|
|
976
|
+
</details>
|
|
977
|
+
|
|
978
|
+
<details>
|
|
979
|
+
<summary><strong>list</strong></summary>
|
|
980
|
+
|
|
981
|
+
Lists all dashboards within a specific space.
|
|
982
|
+
|
|
983
|
+
**Signature:**
|
|
984
|
+
|
|
985
|
+
```typescript
|
|
986
|
+
list(params: DashboardListParams, options?: Core.RequestOptions): Core.APIPromise<DashboardListResponse>
|
|
987
|
+
```
|
|
988
|
+
|
|
989
|
+
**Parameters:**
|
|
990
|
+
|
|
991
|
+
- `params` _(DashboardListParams)_: Parameters for listing dashboards.
|
|
992
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
993
|
+
|
|
994
|
+
**Returns:** `Promise<DashboardListResponse>`
|
|
995
|
+
|
|
996
|
+
**Example:**
|
|
997
|
+
|
|
998
|
+
```typescript
|
|
999
|
+
const dashboardsList = await client.dashboards.list({ 'X-Space': 'your-space-slug' });
|
|
1000
|
+
```
|
|
1001
|
+
|
|
1002
|
+
</details>
|
|
1003
|
+
|
|
1004
|
+
<details>
|
|
1005
|
+
<summary><strong>delete</strong></summary>
|
|
1006
|
+
|
|
1007
|
+
Deletes a specific dashboard by its ID.
|
|
1008
|
+
|
|
1009
|
+
**Signature:**
|
|
1010
|
+
|
|
1011
|
+
```typescript
|
|
1012
|
+
delete(id: number, params: DashboardDeleteParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1013
|
+
```
|
|
1014
|
+
|
|
1015
|
+
**Parameters:**
|
|
1016
|
+
|
|
1017
|
+
- `id` _(number)_: The ID of the dashboard to delete.
|
|
1018
|
+
- `params` _(DashboardDeleteParams)_: Parameters required for deleting a dashboard.
|
|
1019
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1020
|
+
|
|
1021
|
+
**Returns:** `Promise<void>`
|
|
1022
|
+
|
|
1023
|
+
**Example:**
|
|
1024
|
+
|
|
1025
|
+
```typescript
|
|
1026
|
+
await client.dashboards.delete(dashboardId, { 'X-Space': 'your-space-slug' });
|
|
1027
|
+
```
|
|
1028
|
+
|
|
1029
|
+
</details>
|
|
1030
|
+
|
|
1031
|
+
<details>
|
|
1032
|
+
<summary><strong>createWidget</strong></summary>
|
|
1033
|
+
|
|
1034
|
+
Creates a new widget in a specified dashboard.
|
|
1035
|
+
|
|
1036
|
+
**Signature:**
|
|
1037
|
+
|
|
1038
|
+
```typescript
|
|
1039
|
+
createWidget(dashboardId: string, params: WidgetCreateParams, options?: Core.RequestOptions): Core.APIPromise<Widget>
|
|
1040
|
+
```
|
|
1041
|
+
|
|
1042
|
+
**Parameters:**
|
|
1043
|
+
|
|
1044
|
+
- `dashboardId` _(string)_: The ID of the dashboard to create the widget in.
|
|
1045
|
+
- `params` _(WidgetCreateParams)_: Parameters required for creating a widget.
|
|
1046
|
+
- `configuration`: _(any)_: Configuration settings for the widget.
|
|
1047
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1048
|
+
|
|
1049
|
+
**Returns:** `Promise<Widget>`
|
|
1050
|
+
|
|
1051
|
+
**Example:**
|
|
1052
|
+
|
|
1053
|
+
```typescript
|
|
1054
|
+
const widgetParams: WidgetCreateParams = {
|
|
1055
|
+
configuration: { /_ widget configuration _/ },
|
|
1056
|
+
'X-Space': 'your-space-slug',
|
|
1057
|
+
};
|
|
1058
|
+
const newWidget = await client.dashboards.createWidget(dashboardId, widgetParams);
|
|
1059
|
+
```
|
|
1060
|
+
|
|
1061
|
+
</details>
|
|
1062
|
+
|
|
1063
|
+
<details>
|
|
1064
|
+
<summary><strong>retrieveWidget</strong></summary>
|
|
1065
|
+
|
|
1066
|
+
Retrieves a specific widget by its ID from a dashboard.
|
|
1067
|
+
|
|
1068
|
+
**Signature:**
|
|
1069
|
+
|
|
1070
|
+
```typescript
|
|
1071
|
+
retrieveWidget(dashboardId: string, id: number, params: WidgetRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<Widget>
|
|
1072
|
+
```
|
|
1073
|
+
|
|
1074
|
+
**Parameters:**
|
|
1075
|
+
|
|
1076
|
+
- `dashboardId` _(string)_: The ID of the dashboard containing the widget.
|
|
1077
|
+
- `id` _(number)_: The ID of the widget to retrieve.
|
|
1078
|
+
- `params` _(WidgetRetrieveParams)_: Parameters required for retrieving a widget.
|
|
1079
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1080
|
+
|
|
1081
|
+
**Returns:** `Promise<Widget>`
|
|
1082
|
+
|
|
1083
|
+
**Example:**
|
|
1084
|
+
|
|
1085
|
+
```typescript
|
|
1086
|
+
const widgetDetails = await client.dashboards.retrieveWidget(dashboardId, widgetId, { 'X-Space': 'your-space-slug' });
|
|
1087
|
+
```
|
|
1088
|
+
|
|
1089
|
+
</details>
|
|
1090
|
+
|
|
1091
|
+
<details>
|
|
1092
|
+
<summary><strong>updateWidget</strong></summary>
|
|
1093
|
+
|
|
1094
|
+
Updates an existing widget in a specified dashboard.
|
|
1095
|
+
|
|
1096
|
+
**Signature:**
|
|
1097
|
+
|
|
1098
|
+
```typescript
|
|
1099
|
+
updateWidget(dashboardId: string, id: number, params: WidgetUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Widget>
|
|
1100
|
+
```
|
|
1101
|
+
|
|
1102
|
+
**Parameters:**
|
|
1103
|
+
|
|
1104
|
+
- `dashboardId` _(string)_: The ID of the dashboard containing the widget.
|
|
1105
|
+
- `id` _(number)_: The ID of the widget to update.
|
|
1106
|
+
- `params` _(WidgetUpdateParams)_: Parameters required for updating a widget.
|
|
1107
|
+
- `configuration`: _(any)_: New configuration settings for the widget.
|
|
1108
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1109
|
+
|
|
1110
|
+
**Returns:** `Promise<Widget>`
|
|
1111
|
+
|
|
1112
|
+
**Example:**
|
|
1113
|
+
|
|
1114
|
+
```typescript
|
|
1115
|
+
const updateWidgetParams: WidgetUpdateParams = {
|
|
1116
|
+
configuration: { /_ new widget configuration _/ },
|
|
1117
|
+
'X-Space': 'your-space-slug',
|
|
1118
|
+
};
|
|
1119
|
+
const updatedWidget = await client.dashboards.updateWidget(dashboardId, widgetId, updateWidgetParams);
|
|
1120
|
+
```
|
|
1121
|
+
|
|
1122
|
+
</details>
|
|
1123
|
+
|
|
1124
|
+
<details>
|
|
1125
|
+
<summary><strong>listWidgets</strong></summary>
|
|
1126
|
+
|
|
1127
|
+
Lists all widgets within a specific dashboard.
|
|
1128
|
+
|
|
1129
|
+
**Signature:**
|
|
1130
|
+
|
|
1131
|
+
```typescript
|
|
1132
|
+
listWidgets(dashboardId: string, params: WidgetListParams, options?: Core.RequestOptions): Core.APIPromise<WidgetListResponse>
|
|
1133
|
+
```
|
|
1134
|
+
|
|
1135
|
+
**Parameters:**
|
|
1136
|
+
|
|
1137
|
+
- `dashboardId` _(string)_: The ID of the dashboard to list widgets from.
|
|
1138
|
+
- `params` _(WidgetListParams)_: Parameters for listing widgets.
|
|
1139
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1140
|
+
- `ordering`: _(string)_: (Optional) Field to use when ordering the results.
|
|
1141
|
+
|
|
1142
|
+
**Returns:** `Promise<WidgetListResponse>`
|
|
1143
|
+
|
|
1144
|
+
**Example:**
|
|
1145
|
+
|
|
1146
|
+
```typescript
|
|
1147
|
+
const widgetsList = await client.dashboards.listWidgets(dashboardId, { 'X-Space': 'your-space-slug' });
|
|
1148
|
+
```
|
|
1149
|
+
|
|
1150
|
+
</details>
|
|
1151
|
+
|
|
1152
|
+
<details>
|
|
1153
|
+
<summary><strong>deleteWidget</strong></summary>
|
|
1154
|
+
|
|
1155
|
+
Deletes a specific widget by its ID from a dashboard.
|
|
1156
|
+
|
|
1157
|
+
**Signature:**
|
|
1158
|
+
|
|
1159
|
+
```typescript
|
|
1160
|
+
deleteWidget(dashboardId: string, id: number, params: WidgetDeleteParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1161
|
+
```
|
|
1162
|
+
|
|
1163
|
+
**Parameters:**
|
|
1164
|
+
|
|
1165
|
+
- `dashboardId` _(string)_: The ID of the dashboard containing the widget.
|
|
1166
|
+
- `id` _(number)_: The ID of the widget to delete.
|
|
1167
|
+
- `params` _(WidgetDeleteParams)_: Parameters required for deleting a widget.
|
|
1168
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1169
|
+
|
|
1170
|
+
**Returns:** `Promise<void>`
|
|
1171
|
+
|
|
1172
|
+
**Example:**
|
|
1173
|
+
|
|
1174
|
+
```typescript
|
|
1175
|
+
await client.dashboards.deleteWidget(dashboardId, widgetId, { 'X-Space': 'your-space-slug' });
|
|
1176
|
+
```
|
|
1177
|
+
|
|
1178
|
+
</details>
|
|
1179
|
+
|
|
1180
|
+
# Device States
|
|
1181
|
+
|
|
1182
|
+
## Overview
|
|
1183
|
+
|
|
1184
|
+
The `Device States` class provides methods to retrieve various device state metrics (daily, hourly, minutely, monthly) from an API.
|
|
1185
|
+
|
|
1186
|
+
## Methods
|
|
1187
|
+
|
|
1188
|
+
<details>
|
|
1189
|
+
<summary><strong>retrieveDaily</strong></summary>
|
|
1190
|
+
|
|
1191
|
+
Retrieves daily device states.
|
|
1192
|
+
|
|
1193
|
+
**Signature:**
|
|
1194
|
+
|
|
1195
|
+
```typescript
|
|
1196
|
+
retrieveDaily(params: DailyRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<DailyRetrieveResponse>
|
|
1197
|
+
```
|
|
1198
|
+
|
|
1199
|
+
**Parameters:**
|
|
1200
|
+
|
|
1201
|
+
- `params` _(DailyRetrieveParams)_: Parameters for retrieving daily device states.
|
|
1202
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
1203
|
+
- Other query parameters specific to daily retrieval.
|
|
1204
|
+
|
|
1205
|
+
**Returns:** `Promise<DailyRetrieveResponse>`
|
|
1206
|
+
|
|
1207
|
+
**Example:**
|
|
1208
|
+
|
|
1209
|
+
```typescript
|
|
1210
|
+
const dailyParams: DailyRetrieveParams = {
|
|
1211
|
+
'X-Space': 'your-space-slug',
|
|
1212
|
+
// other parameters
|
|
1213
|
+
};
|
|
1214
|
+
const dailyData = await client.deviceStates.retrieveDaily(dailyParams);
|
|
1215
|
+
```
|
|
1216
|
+
|
|
1217
|
+
</details>
|
|
1218
|
+
|
|
1219
|
+
<details>
|
|
1220
|
+
<summary><strong>retrieveHourly</strong></summary>
|
|
1221
|
+
|
|
1222
|
+
Retrieves hourly device states.
|
|
1223
|
+
|
|
1224
|
+
**Signature:**
|
|
1225
|
+
|
|
1226
|
+
```typescript
|
|
1227
|
+
retrieveHourly(params: HourlyRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<HourlyRetrieveResponse>
|
|
1228
|
+
```
|
|
1229
|
+
|
|
1230
|
+
**Parameters:**
|
|
1231
|
+
|
|
1232
|
+
- `params` _(HourlyRetrieveParams)_: Parameters for retrieving hourly device states.
|
|
1233
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
1234
|
+
- Other query parameters specific to hourly retrieval.
|
|
1235
|
+
|
|
1236
|
+
**Returns:** `Promise<HourlyRetrieveResponse>`
|
|
1237
|
+
|
|
1238
|
+
**Example:**
|
|
1239
|
+
|
|
1240
|
+
```typescript
|
|
1241
|
+
const hourlyParams: HourlyRetrieveParams = {
|
|
1242
|
+
'X-Space': 'your-space-slug',
|
|
1243
|
+
// other parameters
|
|
1244
|
+
};
|
|
1245
|
+
const hourlyData = await client.deviceStates.retrieveHourly(hourlyParams);
|
|
1246
|
+
```
|
|
1247
|
+
|
|
1248
|
+
</details>
|
|
1249
|
+
|
|
1250
|
+
<details>
|
|
1251
|
+
<summary><strong>retrieveMinutely</strong></summary>
|
|
1252
|
+
|
|
1253
|
+
Retrieves minutely device states.
|
|
1254
|
+
|
|
1255
|
+
**Signature:**
|
|
1256
|
+
|
|
1257
|
+
```typescript
|
|
1258
|
+
retrieveMinutely(params: MinutelyRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<MinutelyRetrieveResponse>
|
|
1259
|
+
```
|
|
1260
|
+
|
|
1261
|
+
**Parameters:**
|
|
1262
|
+
|
|
1263
|
+
- `params` _(MinutelyRetrieveParams)_: Parameters for retrieving minutely device states.
|
|
1264
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
1265
|
+
- Other query parameters specific to minutely retrieval.
|
|
1266
|
+
|
|
1267
|
+
**Returns:** `Promise<MinutelyRetrieveResponse>`
|
|
1268
|
+
|
|
1269
|
+
**Example:**
|
|
1270
|
+
|
|
1271
|
+
```typescript
|
|
1272
|
+
const minutelyParams: MinutelyRetrieveParams = {
|
|
1273
|
+
'X-Space': 'your-space-slug',
|
|
1274
|
+
// other parameters
|
|
1275
|
+
};
|
|
1276
|
+
const minutelyData = await client.deviceStates.retrieveMinutely(minutelyParams);
|
|
1277
|
+
```
|
|
1278
|
+
|
|
1279
|
+
</details>
|
|
1280
|
+
|
|
1281
|
+
<details>
|
|
1282
|
+
<summary><strong>retrieveMonthly</strong></summary>
|
|
1283
|
+
|
|
1284
|
+
Retrieves monthly device states.
|
|
1285
|
+
|
|
1286
|
+
**Signature:**
|
|
1287
|
+
|
|
1288
|
+
```typescript
|
|
1289
|
+
retrieveMonthly(params: MonthlyRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<MonthlyRetrieveResponse>
|
|
1290
|
+
```
|
|
1291
|
+
|
|
1292
|
+
**Parameters:**
|
|
1293
|
+
|
|
1294
|
+
- `params` _(MonthlyRetrieveParams)_: Parameters for retrieving monthly device states.
|
|
1295
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
1296
|
+
- Other query parameters specific to monthly retrieval.
|
|
1297
|
+
|
|
1298
|
+
**Returns:** `Promise<MonthlyRetrieveResponse>`
|
|
1299
|
+
|
|
1300
|
+
**Example:**
|
|
1301
|
+
|
|
1302
|
+
```typescript
|
|
1303
|
+
const monthlyParams: MonthlyRetrieveParams = {
|
|
1304
|
+
'X-Space': 'your-space-slug',
|
|
1305
|
+
// other parameters
|
|
1306
|
+
};
|
|
1307
|
+
const monthlyData = await client.deviceStates.retrieveMonthly(monthlyParams);
|
|
1308
|
+
```
|
|
1309
|
+
|
|
1310
|
+
</details>
|
|
1311
|
+
|
|
1312
|
+
---
|
|
1313
|
+
|
|
1314
|
+
# Users
|
|
1315
|
+
|
|
1316
|
+
## Overview
|
|
1317
|
+
|
|
1318
|
+
The `Users` class provides methods for managing the authenticated user's profile, including retrieving, updating, and deleting their information.
|
|
1319
|
+
|
|
1320
|
+
## Methods
|
|
1321
|
+
|
|
1322
|
+
<details>
|
|
1323
|
+
<summary><strong>getMe</strong></summary>
|
|
1324
|
+
|
|
1325
|
+
Retrieve the profile of the authenticated user.
|
|
1326
|
+
|
|
1327
|
+
**Signature:**
|
|
1328
|
+
|
|
1329
|
+
```typescript
|
|
1330
|
+
getMe(options?: Core.RequestOptions): Core.APIPromise<Profile>
|
|
1331
|
+
```
|
|
1332
|
+
|
|
1333
|
+
**Parameters:**
|
|
1334
|
+
|
|
1335
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
1336
|
+
|
|
1337
|
+
**Returns:** `Promise<Profile>`
|
|
1338
|
+
|
|
1339
|
+
**Example:**
|
|
1340
|
+
|
|
1341
|
+
```typescript
|
|
1342
|
+
const userProfile = await client.users.getMe();
|
|
1343
|
+
console.log(userProfile.first_name);
|
|
1344
|
+
```
|
|
1345
|
+
|
|
1346
|
+
</details>
|
|
1347
|
+
|
|
1348
|
+
<details>
|
|
1349
|
+
<summary><strong>updateMe</strong></summary>
|
|
1350
|
+
|
|
1351
|
+
Update the profile of the authenticated user.
|
|
1352
|
+
|
|
1353
|
+
**Signature:**
|
|
1354
|
+
|
|
1355
|
+
```typescript
|
|
1356
|
+
updateMe(body: Profile, options?: Core.RequestOptions): Core.APIPromise<Profile>
|
|
1357
|
+
```
|
|
1358
|
+
|
|
1359
|
+
**Parameters:**
|
|
1360
|
+
|
|
1361
|
+
- `body` _(Profile)_: Object containing updated user profile details.
|
|
1362
|
+
- `first_name` _(string)_: User's first name.
|
|
1363
|
+
- `last_name` _(string)_: User's last name.
|
|
1364
|
+
- `email` _(string)_: User's email address.
|
|
1365
|
+
- `location` _(string)_: User's location.
|
|
1366
|
+
- `avatar` _(string)_: URL of the user's avatar.
|
|
1367
|
+
- `company_name` _(string)_: User's company name.
|
|
1368
|
+
- `title` _(string)_: User's title.
|
|
1369
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
1370
|
+
|
|
1371
|
+
**Returns:** `Promise<Profile>`
|
|
1372
|
+
|
|
1373
|
+
**Example:**
|
|
1374
|
+
|
|
1375
|
+
```typescript
|
|
1376
|
+
const updatedProfile = await client.users.updateMe({
|
|
1377
|
+
first_name: 'John',
|
|
1378
|
+
last_name: 'Doe',
|
|
1379
|
+
email: 'john.doe@example.com',
|
|
1380
|
+
});
|
|
1381
|
+
console.log(updatedProfile);
|
|
1382
|
+
```
|
|
1383
|
+
|
|
1384
|
+
</details>
|
|
1385
|
+
|
|
1386
|
+
<details>
|
|
1387
|
+
<summary><strong>deleteMe</strong></summary>
|
|
1388
|
+
|
|
1389
|
+
Delete the profile of the authenticated user.
|
|
1390
|
+
|
|
1391
|
+
**Signature:**
|
|
1392
|
+
|
|
1393
|
+
```typescript
|
|
1394
|
+
deleteMe(options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1395
|
+
```
|
|
1396
|
+
|
|
1397
|
+
**Parameters:**
|
|
1398
|
+
|
|
1399
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
1400
|
+
|
|
1401
|
+
**Returns:** `Promise<void>`
|
|
1402
|
+
|
|
1403
|
+
**Example:**
|
|
1404
|
+
|
|
1405
|
+
```typescript
|
|
1406
|
+
await client.users.deleteMe();
|
|
1407
|
+
console.log('User profile deleted.');
|
|
1408
|
+
```
|
|
1409
|
+
|
|
1410
|
+
</details>
|
|
1411
|
+
|
|
1412
|
+
---
|
|
1413
|
+
|
|
1414
|
+
# Invitation
|
|
1415
|
+
|
|
1416
|
+
## Overview
|
|
1417
|
+
|
|
1418
|
+
The `Invitation` class provides a method for sending invitation(s) to users to join a space with a specific role.
|
|
1419
|
+
|
|
1420
|
+
## Methods
|
|
1421
|
+
|
|
1422
|
+
<details>
|
|
1423
|
+
<summary><strong>create</strong></summary>
|
|
1424
|
+
|
|
1425
|
+
Send an invitation to one or more users to join a space.
|
|
1426
|
+
|
|
1427
|
+
**Signature:**
|
|
1428
|
+
|
|
1429
|
+
```typescript
|
|
1430
|
+
create(id: number, body: OAuthInvitation, options?: Core.RequestOptions): Core.APIPromise<OAuthInvitation>
|
|
1431
|
+
```
|
|
1432
|
+
|
|
1433
|
+
**Parameters:**
|
|
1434
|
+
|
|
1435
|
+
- `id` _(number)_: The ID of the space or context where the invitation is being sent.
|
|
1436
|
+
- `body` _(OAuthInvitation)_: The invitation details.
|
|
1437
|
+
- `receiver_list` _(Receiver[])_: A list of invited users.
|
|
1438
|
+
- `email` _(string)_: Email address of the invited user.
|
|
1439
|
+
- `space_role_id` _(string)_: Role ID the invited user will have in the space.
|
|
1440
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
1441
|
+
|
|
1442
|
+
**Returns:** `Promise<OAuthInvitation>`
|
|
1443
|
+
|
|
1444
|
+
**Example:**
|
|
1445
|
+
|
|
1446
|
+
```typescript
|
|
1447
|
+
const invitation = await client.invitation.create(123, {
|
|
1448
|
+
receiver_list: [
|
|
1449
|
+
{
|
|
1450
|
+
email: 'alice@example.com',
|
|
1451
|
+
space_role_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
email: 'bob@example.com',
|
|
1455
|
+
space_role_id: '3fa85f64-5717-4562-b3fc-2c963f66afb3',
|
|
1456
|
+
},
|
|
1457
|
+
],
|
|
1458
|
+
});
|
|
1459
|
+
console.log(invitation);
|
|
1460
|
+
```
|
|
1461
|
+
|
|
1462
|
+
</details>
|
|
1463
|
+
|
|
1464
|
+
---
|
|
1465
|
+
|
|
1466
|
+
# JoinSpace
|
|
1467
|
+
|
|
1468
|
+
## Overview
|
|
1469
|
+
|
|
1470
|
+
The `JoinSpace` class provides a method for joining a space using a token.
|
|
1471
|
+
|
|
1472
|
+
## Methods
|
|
1473
|
+
|
|
1474
|
+
<details>
|
|
1475
|
+
<summary><strong>get</strong></summary>
|
|
1476
|
+
|
|
1477
|
+
Join a space using the provided token.
|
|
1478
|
+
|
|
1479
|
+
**Signature:**
|
|
1480
|
+
|
|
1481
|
+
```typescript
|
|
1482
|
+
get(token: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1483
|
+
```
|
|
1484
|
+
|
|
1485
|
+
**Parameters:**
|
|
1486
|
+
|
|
1487
|
+
- `token` _(string)_: The token used to join the space.
|
|
1488
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
1489
|
+
|
|
1490
|
+
**Returns:** `Promise<void>`
|
|
1491
|
+
|
|
1492
|
+
**Example:**
|
|
1493
|
+
|
|
1494
|
+
```typescript
|
|
1495
|
+
const token = 'your-token-here';
|
|
1496
|
+
await client.joinSpace.get(token);
|
|
1497
|
+
console.log('Joined the space successfully');
|
|
1498
|
+
```
|
|
1499
|
+
|
|
1500
|
+
</details>
|
|
1501
|
+
|
|
1502
|
+
---
|
|
1503
|
+
|
|
1504
|
+
# PresignedUrl
|
|
1505
|
+
|
|
1506
|
+
## Overview
|
|
1507
|
+
|
|
1508
|
+
The `PresignedUrl` class provides a method for retrieving a presigned URL along with the associated file name.
|
|
1509
|
+
|
|
1510
|
+
## Methods
|
|
1511
|
+
|
|
1512
|
+
<details>
|
|
1513
|
+
<summary><strong>get</strong></summary>
|
|
1514
|
+
|
|
1515
|
+
Retrieve a presigned URL and its associated file name.
|
|
1516
|
+
|
|
1517
|
+
**Signature:**
|
|
1518
|
+
|
|
1519
|
+
```typescript
|
|
1520
|
+
get(options?: Core.RequestOptions): Core.APIPromise<PresignedUrlResponse>
|
|
1521
|
+
```
|
|
1522
|
+
|
|
1523
|
+
**Parameters:**
|
|
1524
|
+
|
|
1525
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
1526
|
+
|
|
1527
|
+
**Returns:** `Promise<PresignedUrlResponse>`
|
|
1528
|
+
|
|
1529
|
+
**Example:**
|
|
1530
|
+
|
|
1531
|
+
```typescript
|
|
1532
|
+
const response = await client.presignedUrl.get();
|
|
1533
|
+
console.log(response.presigned_url);
|
|
1534
|
+
console.log(response.file_name);
|
|
1535
|
+
```
|
|
1536
|
+
|
|
1537
|
+
</details>
|