@space-df/sdk 0.0.1-dev.3.3 → 0.0.1-dev.31
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 +3042 -0
- package/dist/LICENSE +7 -0
- package/dist/README.md +382 -0
- package/{index.d.mts → dist/index.d.mts} +18 -1
- package/{index.d.ts → dist/index.d.ts} +18 -1
- package/dist/index.d.ts.map +1 -0
- package/{index.js → dist/index.js} +20 -5
- package/dist/index.js.map +1 -0
- package/{index.mjs → dist/index.mjs} +20 -5
- package/dist/index.mjs.map +1 -0
- package/dist/package.json +101 -0
- package/{resources → dist/resources}/auth/auth.d.ts +20 -1
- package/dist/resources/auth/auth.d.ts.map +1 -0
- package/{resources → dist/resources}/auth/auth.js +15 -0
- package/dist/resources/auth/auth.js.map +1 -0
- package/{resources → dist/resources}/auth/auth.mjs +15 -0
- package/dist/resources/auth/auth.mjs.map +1 -0
- package/{resources → dist/resources}/auth/index.d.ts +2 -0
- package/{resources → dist/resources}/auth/index.d.ts.map +1 -1
- package/{resources → dist/resources}/auth/index.js +2 -0
- package/{resources → dist/resources}/auth/index.js.map +1 -1
- package/{resources → dist/resources}/auth/index.mjs +2 -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-policies.d.ts +6 -3
- package/dist/resources/auth/space-policies.d.ts.map +1 -0
- package/dist/resources/auth/space-policies.js +29 -0
- package/dist/resources/auth/space-policies.js.map +1 -0
- package/dist/resources/auth/space-policies.mjs +25 -0
- package/dist/resources/auth/space-policies.mjs.map +1 -0
- package/dist/resources/auth/space-role-users.d.ts +27 -0
- package/dist/resources/auth/space-role-users.d.ts.map +1 -0
- package/dist/resources/auth/space-role-users.js +53 -0
- package/dist/resources/auth/space-role-users.js.map +1 -0
- package/dist/resources/auth/space-role-users.mjs +49 -0
- package/dist/resources/auth/space-role-users.mjs.map +1 -0
- package/{resources → dist/resources}/auth/space-roles.d.ts +14 -3
- package/dist/resources/auth/space-roles.d.ts.map +1 -0
- package/dist/resources/auth/space-roles.js +54 -0
- package/dist/resources/auth/space-roles.js.map +1 -0
- package/dist/resources/auth/space-roles.mjs +50 -0
- package/dist/resources/auth/space-roles.mjs.map +1 -0
- package/{resources → dist/resources}/auth/spaces.d.ts +21 -8
- package/dist/resources/auth/spaces.d.ts.map +1 -0
- package/{resources → dist/resources}/auth/spaces.js +18 -6
- package/dist/resources/auth/spaces.js.map +1 -0
- package/{resources → dist/resources}/auth/spaces.mjs +18 -6
- package/dist/resources/auth/spaces.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/{resources → dist/resources}/dashboard/index.d.ts +1 -0
- package/{resources → dist/resources}/dashboard/index.d.ts.map +1 -1
- package/{resources → dist/resources}/dashboard/index.js +1 -0
- package/{resources → dist/resources}/dashboard/index.js.map +1 -1
- package/{resources → dist/resources}/dashboard/index.mjs +1 -0
- package/dist/resources/dashboard/widget.d.ts +11 -0
- package/dist/resources/dashboard/widget.d.ts.map +1 -0
- package/dist/resources/dashboard/widget.js +15 -0
- package/dist/resources/dashboard/widget.js.map +1 -0
- package/dist/resources/dashboard/widget.mjs +11 -0
- package/dist/resources/dashboard/widget.mjs.map +1 -0
- package/dist/resources/device/device-connector.d.ts +25 -0
- package/dist/resources/device/device-connector.d.ts.map +1 -0
- package/dist/resources/device/device-connector.js +30 -0
- package/dist/resources/device/device-connector.js.map +1 -0
- package/dist/resources/device/device-connector.mjs +26 -0
- package/dist/resources/device/device-connector.mjs.map +1 -0
- package/dist/resources/device/device-model.d.ts +20 -0
- package/dist/resources/device/device-model.d.ts.map +1 -0
- package/{resources/auth/space-roles.js → dist/resources/device/device-model.js} +10 -10
- package/dist/resources/device/device-model.js.map +1 -0
- package/{resources/auth/space-roles.mjs → dist/resources/device/device-model.mjs} +8 -8
- package/dist/resources/device/device-model.mjs.map +1 -0
- package/dist/resources/device/device-spaces.d.ts +19 -0
- package/dist/resources/device/device-spaces.d.ts.map +1 -0
- package/{resources/auth/space-role-users.js → dist/resources/device/device-spaces.js} +10 -8
- package/dist/resources/device/device-spaces.js.map +1 -0
- package/{resources/auth/space-role-users.mjs → dist/resources/device/device-spaces.mjs} +8 -6
- package/dist/resources/device/device-spaces.mjs.map +1 -0
- package/dist/resources/device/devices.d.ts +19 -0
- package/dist/resources/device/devices.d.ts.map +1 -0
- package/dist/resources/device/devices.js +58 -0
- package/dist/resources/device/devices.js.map +1 -0
- package/dist/resources/device/devices.mjs +54 -0
- package/dist/resources/device/devices.mjs.map +1 -0
- package/dist/resources/device/index.d.ts +8 -0
- package/dist/resources/device/index.d.ts.map +1 -0
- package/dist/resources/device/index.js +24 -0
- package/dist/resources/device/index.js.map +1 -0
- package/dist/resources/device/index.mjs +8 -0
- package/dist/resources/device/index.mjs.map +1 -0
- package/dist/resources/device/manufacturers.d.ts +20 -0
- package/dist/resources/device/manufacturers.d.ts.map +1 -0
- package/dist/resources/device/manufacturers.js +52 -0
- package/dist/resources/device/manufacturers.js.map +1 -0
- package/dist/resources/device/manufacturers.mjs +48 -0
- package/dist/resources/device/manufacturers.mjs.map +1 -0
- package/dist/resources/device/network-server.d.ts +19 -0
- package/dist/resources/device/network-server.d.ts.map +1 -0
- package/dist/resources/device/network-server.js +52 -0
- package/dist/resources/device/network-server.js.map +1 -0
- package/dist/resources/device/network-server.mjs +48 -0
- package/dist/resources/device/network-server.mjs.map +1 -0
- package/dist/resources/device/trip.d.ts +24 -0
- package/dist/resources/device/trip.d.ts.map +1 -0
- package/dist/resources/device/trip.js +49 -0
- package/dist/resources/device/trip.js.map +1 -0
- package/dist/resources/device/trip.mjs +45 -0
- package/dist/resources/device/trip.mjs.map +1 -0
- package/{resources → dist/resources}/index.d.ts +2 -0
- package/{resources → dist/resources}/index.d.ts.map +1 -1
- package/{resources → dist/resources}/index.js +2 -0
- package/{resources → dist/resources}/index.js.map +1 -1
- package/dist/resources/index.mjs +6 -0
- package/dist/resources/organizations/index.d.ts +2 -0
- package/dist/resources/organizations/index.d.ts.map +1 -0
- package/dist/resources/organizations/index.js +18 -0
- package/dist/resources/organizations/index.js.map +1 -0
- package/dist/resources/organizations/index.mjs +2 -0
- package/dist/resources/organizations/index.mjs.map +1 -0
- package/dist/resources/organizations/organizations.d.ts +9 -0
- package/dist/resources/organizations/organizations.d.ts.map +1 -0
- package/dist/resources/organizations/organizations.js +11 -0
- package/dist/resources/organizations/organizations.js.map +1 -0
- package/dist/resources/organizations/organizations.mjs +7 -0
- package/dist/resources/organizations/organizations.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 +230 -0
- package/dist/src/libs/utils.ts +66 -0
- package/dist/src/resource.ts +9 -0
- package/dist/src/resources/auth/auth.ts +132 -0
- package/dist/src/resources/auth/credentials.ts +12 -0
- package/dist/src/resources/auth/index.ts +8 -0
- package/dist/src/resources/auth/presigned-url.ts +13 -0
- package/dist/src/resources/auth/space-policies.ts +70 -0
- package/dist/src/resources/auth/space-role-users.ts +79 -0
- package/dist/src/resources/auth/space-roles.ts +110 -0
- package/dist/src/resources/auth/spaces.ts +145 -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 +3 -0
- package/dist/src/resources/dashboard/widget.ts +17 -0
- package/dist/src/resources/device/device-connector.ts +49 -0
- package/dist/src/resources/device/device-model.ts +65 -0
- package/dist/src/resources/device/device-spaces.ts +42 -0
- package/dist/src/resources/device/devices.ts +70 -0
- package/dist/src/resources/device/index.ts +7 -0
- package/dist/src/resources/device/manufacturers.ts +65 -0
- package/dist/src/resources/device/network-server.ts +64 -0
- package/dist/src/resources/device/trip.ts +69 -0
- package/dist/src/resources/index.ts +8 -0
- package/dist/src/resources/organizations/index.ts +1 -0
- package/dist/src/resources/organizations/organizations.ts +12 -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 +28 -4
- package/src/resources/auth/auth.ts +42 -2
- package/src/resources/auth/index.ts +2 -0
- package/src/resources/auth/presigned-url.ts +13 -0
- package/src/resources/auth/space-policies.ts +22 -7
- package/src/resources/auth/space-role-users.ts +43 -6
- package/src/resources/auth/space-roles.ts +27 -12
- package/src/resources/auth/spaces.ts +42 -15
- package/src/resources/auth/users.ts +36 -0
- package/src/resources/dashboard/index.ts +1 -0
- package/src/resources/dashboard/widget.ts +17 -0
- package/src/resources/device/device-connector.ts +49 -0
- package/src/resources/device/device-model.ts +65 -0
- package/src/resources/device/device-spaces.ts +42 -0
- package/src/resources/device/devices.ts +70 -0
- package/src/resources/device/index.ts +7 -0
- package/src/resources/device/manufacturers.ts +65 -0
- package/src/resources/device/network-server.ts +64 -0
- package/src/resources/device/trip.ts +69 -0
- package/src/resources/index.ts +2 -0
- package/src/resources/organizations/index.ts +1 -0
- package/src/resources/organizations/organizations.ts +12 -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.d.ts.map +0 -1
- 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-policies.d.ts.map +0 -1
- package/resources/auth/space-policies.js +0 -18
- package/resources/auth/space-policies.js.map +0 -1
- package/resources/auth/space-policies.mjs +0 -14
- package/resources/auth/space-policies.mjs.map +0 -1
- package/resources/auth/space-role-users.d.ts +0 -17
- 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/resources/auth/space-roles.d.ts.map +0 -1
- package/resources/auth/space-roles.js.map +0 -1
- package/resources/auth/space-roles.mjs.map +0 -1
- package/resources/auth/spaces.d.ts.map +0 -1
- package/resources/auth/spaces.js.map +0 -1
- package/resources/auth/spaces.mjs.map +0 -1
- package/resources/index.mjs +0 -4
- 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}/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.mjs.map +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,3042 @@
|
|
|
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
|
+
- [Widgets](#widgets)
|
|
22
|
+
- [Device Spaces](#device-spaces)
|
|
23
|
+
- [Users](#users)
|
|
24
|
+
- [Trip](#trip)
|
|
25
|
+
|
|
26
|
+
# Auth
|
|
27
|
+
|
|
28
|
+
## Overview
|
|
29
|
+
|
|
30
|
+
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.
|
|
31
|
+
|
|
32
|
+
## Methods
|
|
33
|
+
|
|
34
|
+
<details>
|
|
35
|
+
<summary><strong>login</strong></summary>
|
|
36
|
+
|
|
37
|
+
Authenticate a user with email and password.
|
|
38
|
+
|
|
39
|
+
**Signature:**
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
login(body: AuthLoginParams, options?: Core.RequestOptions): Core.APIPromise<TokenPair>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Parameters:**
|
|
46
|
+
|
|
47
|
+
- `body` _(AuthLoginParams)_: Object containing user credentials.
|
|
48
|
+
- `email` _(string)_: User's email address.
|
|
49
|
+
- `password` _(string)_: User's password.
|
|
50
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
51
|
+
|
|
52
|
+
**Returns:** `Promise<TokenPair>`
|
|
53
|
+
|
|
54
|
+
**Example:**
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
const loginResponse = await client.auth.login({
|
|
58
|
+
email: 'user@example.com',
|
|
59
|
+
password: 'example_password',
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
</details>
|
|
64
|
+
|
|
65
|
+
<details>
|
|
66
|
+
<summary><strong>oauth2Google</strong></summary>
|
|
67
|
+
|
|
68
|
+
Log in a user via Google OAuth2.
|
|
69
|
+
|
|
70
|
+
**Signature:**
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
oauth2Google(body: AuthOauth2GoogleParams, options?: Core.RequestOptions): Core.APIPromise<OAuthLogin>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Parameters:**
|
|
77
|
+
|
|
78
|
+
- `body` _(AuthOauth2GoogleParams)_: Object containing OAuth2 parameters.
|
|
79
|
+
- `authorization_code` _(string)_: The authorization code obtained from Google.
|
|
80
|
+
- `code_verifier` _(string)_: The code verifier for PKCE.
|
|
81
|
+
|
|
82
|
+
**Returns:** `Promise<OAuthLogin>`
|
|
83
|
+
|
|
84
|
+
**Example:**
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
const googleAuthResponse = await client.auth.oauth2Google({
|
|
88
|
+
authorization_code: 'auth_code_from_google',
|
|
89
|
+
code_verifier: 'verifier',
|
|
90
|
+
});
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
</details>
|
|
94
|
+
|
|
95
|
+
<details>
|
|
96
|
+
<summary><strong>googleLogin</strong></summary>
|
|
97
|
+
|
|
98
|
+
Log in a user via Google using an authorization code.
|
|
99
|
+
|
|
100
|
+
**Signature:**
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
googleLogin(body: GoogleLogin, options?: Core.RequestOptions): Core.APIPromise<AuthTokenPair>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Parameters:**
|
|
107
|
+
|
|
108
|
+
- `body` _(GoogleLogin)_: Object containing the Google authorization code.
|
|
109
|
+
- `authorization_code` _(string)_: The authorization code received from Google OAuth2.
|
|
110
|
+
|
|
111
|
+
**Returns:** `Promise<AuthTokenPair>`
|
|
112
|
+
|
|
113
|
+
**Example:**
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
const tokenPair = await client.auth.googleLogin({
|
|
117
|
+
authorization_code: '4/0Ab_5qllO5QRK6Uct5jTNNfW2fcf2v76Ub9NCH348fOvL0UBts4c7kRjSoUqjCf_wT05VqA',
|
|
118
|
+
});
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
</details>
|
|
122
|
+
|
|
123
|
+
<details>
|
|
124
|
+
<summary><strong>oauthSendOtp</strong></summary>
|
|
125
|
+
|
|
126
|
+
Send a one-time password (OTP) to the user's email for OAuth login.
|
|
127
|
+
|
|
128
|
+
**Signature:**
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
oauthSendOtp(body: OAuthSendOtp, options?: Core.RequestOptions): Core.APIPromise<OAuthSendOtp>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Parameters:**
|
|
135
|
+
|
|
136
|
+
- `body` _(OAuthSendOtp)_: Object containing user email.
|
|
137
|
+
- `email` _(string)_: The email address to send the OTP to.
|
|
138
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
139
|
+
|
|
140
|
+
**Returns:** `Promise<OAuthSendOtp>`
|
|
141
|
+
|
|
142
|
+
**Example:**
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
await client.auth.oauthSendOtp({
|
|
146
|
+
email: 'user@example.com',
|
|
147
|
+
});
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
</details>
|
|
151
|
+
|
|
152
|
+
<details>
|
|
153
|
+
<summary><strong>forgetPassword</strong></summary>
|
|
154
|
+
|
|
155
|
+
Send a password reset request for a user's account using their token and password.
|
|
156
|
+
|
|
157
|
+
**Signature:**
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
forgetPassword(body: ForgetPasswordParams, options?: Core.RequestOptions): Core.APIPromise<ForgetPasswordParams>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Parameters:**
|
|
164
|
+
|
|
165
|
+
- `body` _(ForgetPasswordParams)_: Object containing user credentials.
|
|
166
|
+
- `token` _(string)_: The token associated with the user's account.
|
|
167
|
+
- `password` _(string)_: The new password to set for the account.
|
|
168
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
169
|
+
|
|
170
|
+
**Returns:** `Promise<ForgetPasswordParams>`
|
|
171
|
+
|
|
172
|
+
**Example:**
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
await client.auth.forgetPassword({
|
|
176
|
+
token: 'token',
|
|
177
|
+
password: 'newSecurePassword123',
|
|
178
|
+
});
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
</details>
|
|
182
|
+
|
|
183
|
+
<details>
|
|
184
|
+
<summary><strong>sendEmailConfirm</strong></summary>
|
|
185
|
+
|
|
186
|
+
Send a confirmation email to the user's address to verify ownership.
|
|
187
|
+
|
|
188
|
+
**Signature:**
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
sendEmailConfirm(body: OAuthSendEmail, options?: Core.RequestOptions): Core.APIPromise<OAuthSendEmail>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Parameters:**
|
|
195
|
+
|
|
196
|
+
- `body` _(OAuthSendEmail)_: Object containing user email.
|
|
197
|
+
- `email` _(string)_: The email address to send the confirmation link to.
|
|
198
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
199
|
+
|
|
200
|
+
**Returns:** `Promise<OAuthSendEmail>`
|
|
201
|
+
|
|
202
|
+
**Example:**
|
|
203
|
+
|
|
204
|
+
```typescript
|
|
205
|
+
await client.auth.sendEmailConfirm({
|
|
206
|
+
email: 'user@example.com',
|
|
207
|
+
});
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
</details>
|
|
211
|
+
|
|
212
|
+
<details>
|
|
213
|
+
<summary><strong>refreshToken</strong></summary>
|
|
214
|
+
|
|
215
|
+
Refresh the access token using a refresh token.
|
|
216
|
+
|
|
217
|
+
**Signature:**
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
refreshToken(body: AuthRefreshTokenParams, options?: Core.RequestOptions): Core.APIPromise<CustomTokenRefresh>
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
**Parameters:**
|
|
224
|
+
|
|
225
|
+
- `body` _(AuthRefreshTokenParams)_: Object containing the refresh token.
|
|
226
|
+
- `refresh` _(string)_: Refresh token.
|
|
227
|
+
|
|
228
|
+
**Returns:** `Promise<CustomTokenRefresh>`
|
|
229
|
+
|
|
230
|
+
**Example:**
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
const refreshResponse = await client.auth.refreshToken({
|
|
234
|
+
refresh: 'refresh_token',
|
|
235
|
+
space_slug_name: 'default-1fa0d173-9c7c-4460-afa0-5a524dfcdff6',
|
|
236
|
+
});
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
</details>
|
|
240
|
+
|
|
241
|
+
<details>
|
|
242
|
+
<summary><strong>register</strong></summary>
|
|
243
|
+
|
|
244
|
+
Register a new user account.
|
|
245
|
+
|
|
246
|
+
**Signature:**
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
register(body: AuthRegisterParams, options?: Core.RequestOptions): Core.APIPromise<Registration>
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**Parameters:**
|
|
253
|
+
|
|
254
|
+
- `body` _(AuthRegisterParams)_: Object containing user registration details.
|
|
255
|
+
- `email` _(string)_: User's email address.
|
|
256
|
+
- `password` _(string)_: User's chosen password.
|
|
257
|
+
- `first_name` _(string)_: User's first name (optional).
|
|
258
|
+
- `last_name` _(string)_: User's last name (optional).
|
|
259
|
+
- `otp` _(string)_: User's OTP code (optional).
|
|
260
|
+
|
|
261
|
+
**Returns:** `Promise<Registration>`
|
|
262
|
+
|
|
263
|
+
**Example:**
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
const registerResponse = await client.auth.register({
|
|
267
|
+
first_name: 'Example',
|
|
268
|
+
last_name: 'Example',
|
|
269
|
+
email: 'user@example.com',
|
|
270
|
+
password: 'example_password',
|
|
271
|
+
});
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
</details>
|
|
275
|
+
|
|
276
|
+
<details>
|
|
277
|
+
<summary><strong>oauth2SpaceDF</strong></summary>
|
|
278
|
+
|
|
279
|
+
Log in a user via SpaceDF Console OAuth2.
|
|
280
|
+
|
|
281
|
+
**Signature:**
|
|
282
|
+
|
|
283
|
+
```typescript
|
|
284
|
+
oauth2SpaceDF(body: OAuthSpaceDF, options?: Core.RequestOptions): Core.APIPromise<OAuthSpaceDF>
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Parameters:**
|
|
288
|
+
|
|
289
|
+
- `body` _(OAuthSpaceDF)_: Object containing OAuth2 parameters.
|
|
290
|
+
- `code_verifier` _(string)_: The code verifier for PKCE.
|
|
291
|
+
- `code` _(string)_: The authorization code obtained from SpaceDF Console.
|
|
292
|
+
- `client_id` _(string)_: The client ID of the application.
|
|
293
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
294
|
+
|
|
295
|
+
**Returns:** `Promise<OAuthSpaceDF>`
|
|
296
|
+
|
|
297
|
+
**Example:**
|
|
298
|
+
|
|
299
|
+
```typescript
|
|
300
|
+
const spaceDFAuthResponse = await client.auth.oauth2SpaceDF({
|
|
301
|
+
code_verifier: 'verifier',
|
|
302
|
+
code: 'auth_code_from_spacedf',
|
|
303
|
+
client_id: 'your-client-id',
|
|
304
|
+
});
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
</details>
|
|
308
|
+
|
|
309
|
+
<details>
|
|
310
|
+
<summary><strong>switchSpaces</strong></summary>
|
|
311
|
+
|
|
312
|
+
Switch the user's active space using a refresh token.
|
|
313
|
+
|
|
314
|
+
**Signature:**
|
|
315
|
+
|
|
316
|
+
```typescript
|
|
317
|
+
switchSpaces(body: AuthRefreshTokenParams, options?: Core.RequestOptions): Core.APIPromise<CustomTokenRefresh>
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
**Parameters:**
|
|
321
|
+
|
|
322
|
+
- `body` _(AuthRefreshTokenParams)_: Object containing the refresh token and target space.
|
|
323
|
+
- `refresh` _(string)_: Refresh token.
|
|
324
|
+
- `space` _(string)_: Target space to switch to.
|
|
325
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
326
|
+
|
|
327
|
+
**Returns:** `Promise<CustomTokenRefresh>`
|
|
328
|
+
|
|
329
|
+
**Example:**
|
|
330
|
+
|
|
331
|
+
```typescript
|
|
332
|
+
const switchResponse = await client.auth.switchSpaces({
|
|
333
|
+
refresh: 'refresh_token',
|
|
334
|
+
space: 'target_space',
|
|
335
|
+
});
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
</details>
|
|
339
|
+
|
|
340
|
+
<details>
|
|
341
|
+
<summary><strong>changePassword</strong></summary>
|
|
342
|
+
|
|
343
|
+
Change the current user password.
|
|
344
|
+
|
|
345
|
+
**Signature:**
|
|
346
|
+
|
|
347
|
+
```typescript
|
|
348
|
+
changePassword(body: AuthChangePasswordParams, options?: Core.RequestOptions): Core.APIPromise<AuthChangePasswordParams>
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
**Parameters:**
|
|
352
|
+
|
|
353
|
+
- `body` _(AuthChangePasswordParams)_: Object containing the current password and new password.
|
|
354
|
+
- `password` _(string)_: Current password.
|
|
355
|
+
- `new_password` _(string)_: New password.
|
|
356
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
357
|
+
|
|
358
|
+
**Returns:** `Promise<AuthChangePasswordParams>`
|
|
359
|
+
|
|
360
|
+
**Example:**
|
|
361
|
+
|
|
362
|
+
```typescript
|
|
363
|
+
const switchResponse = await client.auth.switchSpaces({
|
|
364
|
+
password: 'current_password',
|
|
365
|
+
new_password: 'new_password',
|
|
366
|
+
});
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
</details>
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
# Space Policies
|
|
374
|
+
|
|
375
|
+
## Overview
|
|
376
|
+
|
|
377
|
+
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.
|
|
378
|
+
|
|
379
|
+
## Methods
|
|
380
|
+
|
|
381
|
+
<details>
|
|
382
|
+
<summary><strong>retrieve</strong></summary>
|
|
383
|
+
|
|
384
|
+
Retrieve a specific space policy by its ID.
|
|
385
|
+
|
|
386
|
+
**Signature:**
|
|
387
|
+
|
|
388
|
+
```typescript
|
|
389
|
+
retrieve(id: number, options?: Core.RequestOptions): Core.APIPromise<SpacePolicy>
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
**Parameters:**
|
|
393
|
+
|
|
394
|
+
- `id` _(number)_: The ID of the space policy to retrieve.
|
|
395
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
396
|
+
|
|
397
|
+
**Returns:** `Promise<SpacePolicy>`
|
|
398
|
+
|
|
399
|
+
**Example:**
|
|
400
|
+
|
|
401
|
+
```typescript
|
|
402
|
+
const spacePolicy = await client.spacePolicies.retrieve(1);
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
</details>
|
|
406
|
+
|
|
407
|
+
<details>
|
|
408
|
+
<summary><strong>list</strong></summary>
|
|
409
|
+
|
|
410
|
+
List all space policies or filter them based on query parameters.
|
|
411
|
+
|
|
412
|
+
**Signature:**
|
|
413
|
+
|
|
414
|
+
```typescript
|
|
415
|
+
list(spaceName: string, query?: SpacePolicyListParams, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
416
|
+
list(spaceName: string, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
417
|
+
list(spaceName: string, query: SpacePolicyListParams | Core.RequestOptions = {}, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
**Parameters:**
|
|
421
|
+
|
|
422
|
+
- `spaceName` _string_: The space slug name.
|
|
423
|
+
- `query` _(SpacePolicyListParams)_: (optional) Filters to apply when listing policies.
|
|
424
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
425
|
+
|
|
426
|
+
**Returns:** `Promise<SpacePolicyListResponse>`
|
|
427
|
+
|
|
428
|
+
**Example:**
|
|
429
|
+
|
|
430
|
+
```typescript
|
|
431
|
+
const spacePolicies = await client.spacePolicies.list('your-space-slug', { page: 1, limit: 10 });
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
</details>
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
# Space Role Users
|
|
439
|
+
|
|
440
|
+
## Overview
|
|
441
|
+
|
|
442
|
+
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.
|
|
443
|
+
|
|
444
|
+
## Methods
|
|
445
|
+
|
|
446
|
+
<details>
|
|
447
|
+
<summary><strong>retrieve</strong></summary>
|
|
448
|
+
|
|
449
|
+
Retrieve a specific space role user by their ID.
|
|
450
|
+
|
|
451
|
+
**Signature:**
|
|
452
|
+
|
|
453
|
+
```typescript
|
|
454
|
+
retrieve(id: number, params: SpaceRoleUsersParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUser>
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
**Parameters:**
|
|
458
|
+
|
|
459
|
+
- `id` _(number)_: The ID of the space role user to retrieve.
|
|
460
|
+
- `params` _(SpaceRoleUsersParams)_: Parameters containing the space slug.
|
|
461
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
462
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
463
|
+
|
|
464
|
+
**Returns:** `Promise<SpaceRoleUser>`
|
|
465
|
+
|
|
466
|
+
**Example:**
|
|
467
|
+
|
|
468
|
+
```typescript
|
|
469
|
+
const spaceRoleUser = await client.spaceRoleUsers.retrieve(1, { 'X-Space': 'example-space' });
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
</details>
|
|
473
|
+
|
|
474
|
+
<details>
|
|
475
|
+
<summary><strong>list</strong></summary>
|
|
476
|
+
|
|
477
|
+
List all space role users or filter them based on query parameters.
|
|
478
|
+
|
|
479
|
+
**Signature:**
|
|
480
|
+
|
|
481
|
+
```typescript
|
|
482
|
+
list(spaceName: string, params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserListResponse>
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
**Parameters:**
|
|
486
|
+
|
|
487
|
+
- `spaceName`: _(string)_: Header param for space slug name.
|
|
488
|
+
- `params` _(SpaceRoleUserListParams)_: Parameters containing any additional filters.
|
|
489
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
490
|
+
|
|
491
|
+
**Returns:** `Promise<SpaceRoleUserListResponse>`
|
|
492
|
+
|
|
493
|
+
**Example:**
|
|
494
|
+
|
|
495
|
+
```typescript
|
|
496
|
+
const spaceRoleUsers = await client.spaceRoleUsers.list('example-space', { page: 1, limit: 10 });
|
|
497
|
+
console.log(spaceRoleUsers);
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
</details>
|
|
501
|
+
|
|
502
|
+
<details>
|
|
503
|
+
<summary><strong>update</strong></summary>
|
|
504
|
+
|
|
505
|
+
Update the details of a specific space role user.
|
|
506
|
+
|
|
507
|
+
**Signature:**
|
|
508
|
+
|
|
509
|
+
```typescript
|
|
510
|
+
update(id: number, params: SpaceRoleParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleParams>
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
**Parameters:**
|
|
514
|
+
|
|
515
|
+
- `id` _(number)_: The ID of the space role user to update.
|
|
516
|
+
- `params` _(SpaceRoleParams)_: Parameters containing updated space role details.
|
|
517
|
+
- `space_role`: _(string)_: The updated space role for the user.
|
|
518
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
519
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
520
|
+
|
|
521
|
+
**Returns:** `Promise<SpaceRoleParams>`
|
|
522
|
+
|
|
523
|
+
**Example:**
|
|
524
|
+
|
|
525
|
+
```typescript
|
|
526
|
+
const updatedRole = await client.spaceRoleUsers.update(1, { space_role: 'new-role', 'X-Space': 'your-space-slug' });
|
|
527
|
+
console.log(updatedRole);
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
</details>
|
|
531
|
+
|
|
532
|
+
<details>
|
|
533
|
+
<summary><strong>partialUpdate</strong></summary>
|
|
534
|
+
|
|
535
|
+
Partially update the details of a specific space role user.
|
|
536
|
+
|
|
537
|
+
**Signature:**
|
|
538
|
+
|
|
539
|
+
```typescript
|
|
540
|
+
partialUpdate(id: number, params: SpaceRoleParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleParams>
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
**Parameters:**
|
|
544
|
+
|
|
545
|
+
- `id` _(number)_: The ID of the space role user to partially update.
|
|
546
|
+
- `params` _(SpaceRoleParams)_: Parameters containing updated space role details.
|
|
547
|
+
- `space_role`: _(string)_: The updated space role for the user.
|
|
548
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
549
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
550
|
+
|
|
551
|
+
**Returns:** `Promise<SpaceRoleParams>`
|
|
552
|
+
|
|
553
|
+
**Example:**
|
|
554
|
+
|
|
555
|
+
```typescript
|
|
556
|
+
const partialUpdatedRole = await client.spaceRoleUsers.partialUpdate(1, { space_role: 'another-role', 'X-Space': 'your-space-slug' });
|
|
557
|
+
console.log(partialUpdatedRole);
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
</details>
|
|
561
|
+
|
|
562
|
+
<details>
|
|
563
|
+
<summary><strong>setSpaceDefault</strong></summary>
|
|
564
|
+
|
|
565
|
+
Set a specific space role user as the default for their space.
|
|
566
|
+
|
|
567
|
+
**Signature:**
|
|
568
|
+
|
|
569
|
+
```typescript
|
|
570
|
+
setSpaceDefault(id: String, params: SpaceRoleUsersParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
**Parameters:**
|
|
574
|
+
|
|
575
|
+
- `id` _(string)_: The ID of the space role user to set as default.
|
|
576
|
+
- `params` _(SpaceRoleUsersParams)_: Parameters containing the space slug.
|
|
577
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
578
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
579
|
+
|
|
580
|
+
**Returns:** `Promise<void>`
|
|
581
|
+
|
|
582
|
+
**Example:**
|
|
583
|
+
|
|
584
|
+
```typescript
|
|
585
|
+
await client.spaceRoleUsers.setSpaceDefault('3fa85f64-5717-4562-b3fc ...');
|
|
586
|
+
console.log('Space role user has been set as default.');
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
</details>
|
|
590
|
+
|
|
591
|
+
<details>
|
|
592
|
+
<summary><strong>delete</strong></summary>
|
|
593
|
+
|
|
594
|
+
Delete a specific space role user by their ID.
|
|
595
|
+
|
|
596
|
+
**Signature:**
|
|
597
|
+
|
|
598
|
+
```typescript
|
|
599
|
+
delete(id: number, params: SpaceRoleUsersParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
**Parameters:**
|
|
603
|
+
|
|
604
|
+
- `id` _(number)_: The ID of the space role user to delete.
|
|
605
|
+
- `params` _(SpaceRoleUsersParams)_: Parameters containing the space slug.
|
|
606
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
607
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
608
|
+
|
|
609
|
+
**Returns:** `Promise<void>`
|
|
610
|
+
|
|
611
|
+
**Example:**
|
|
612
|
+
|
|
613
|
+
```typescript
|
|
614
|
+
await client.spaceRoleUsers.delete(1, { 'X-Space': 'example-space' });
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
</details>
|
|
618
|
+
|
|
619
|
+
---
|
|
620
|
+
|
|
621
|
+
# Credentials
|
|
622
|
+
|
|
623
|
+
## Overview
|
|
624
|
+
|
|
625
|
+
The `Credentials` class provides methods for retrieving OAuth credentials, such as the client ID.
|
|
626
|
+
|
|
627
|
+
## Methods
|
|
628
|
+
|
|
629
|
+
<details>
|
|
630
|
+
<summary><strong>retrieve</strong></summary>
|
|
631
|
+
|
|
632
|
+
Retrieve the OAuth client ID.
|
|
633
|
+
|
|
634
|
+
**Signature:**
|
|
635
|
+
|
|
636
|
+
```typescript
|
|
637
|
+
retrieve(options?: Core.RequestOptions): Core.APIPromise<OAuthCredentials>
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
**Parameters:**
|
|
641
|
+
|
|
642
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
643
|
+
|
|
644
|
+
**Returns:** `Promise<OAuthCredentials>`
|
|
645
|
+
|
|
646
|
+
**Example:**
|
|
647
|
+
|
|
648
|
+
```typescript
|
|
649
|
+
const credentials = await client.credentials.retrieve();
|
|
650
|
+
console.log(credentials.client_id);
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
</details>
|
|
654
|
+
|
|
655
|
+
---
|
|
656
|
+
|
|
657
|
+
# Space Roles
|
|
658
|
+
|
|
659
|
+
## Overview
|
|
660
|
+
|
|
661
|
+
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.
|
|
662
|
+
|
|
663
|
+
## Methods
|
|
664
|
+
|
|
665
|
+
<details>
|
|
666
|
+
<summary><strong>create</strong></summary>
|
|
667
|
+
|
|
668
|
+
Create a new space role.
|
|
669
|
+
|
|
670
|
+
**Signature:**
|
|
671
|
+
|
|
672
|
+
```typescript
|
|
673
|
+
create(params: SpaceRoleCreateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole>
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
**Parameters:**
|
|
677
|
+
|
|
678
|
+
- `params` _(SpaceRoleCreateParams)_: Parameters for creating a new space role.
|
|
679
|
+
- `name`: _(string)_: The name of the space role.
|
|
680
|
+
- `policies`: _(Array<number>)_: An array of policy IDs associated with the space role.
|
|
681
|
+
- `X-Space`: _(string)_: Header param for space slug name.
|
|
682
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
683
|
+
|
|
684
|
+
**Returns:** `Promise<SpaceRole>`
|
|
685
|
+
|
|
686
|
+
**Example:**
|
|
687
|
+
|
|
688
|
+
```typescript
|
|
689
|
+
const newSpaceRole = await client.spaceRoles.create({
|
|
690
|
+
name: 'Admin',
|
|
691
|
+
policies: [1, 2],
|
|
692
|
+
'X-Space': 'example-space',
|
|
693
|
+
});
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
</details>
|
|
697
|
+
|
|
698
|
+
<details>
|
|
699
|
+
<summary><strong>retrieve</strong></summary>
|
|
700
|
+
|
|
701
|
+
Retrieve a specific space role by its ID.
|
|
702
|
+
|
|
703
|
+
**Signature:**
|
|
704
|
+
|
|
705
|
+
```typescript
|
|
706
|
+
retrieve(id: number, params: SpaceRolesParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole>
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
**Parameters:**
|
|
710
|
+
|
|
711
|
+
- `id` _(number)_: The ID of the space role to retrieve.
|
|
712
|
+
- `params` _(SpaceRolesParams)_: Parameters containing the space slug.
|
|
713
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
714
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
715
|
+
|
|
716
|
+
**Returns:** `Promise<SpaceRole>`
|
|
717
|
+
|
|
718
|
+
**Example:**
|
|
719
|
+
|
|
720
|
+
```typescript
|
|
721
|
+
const spaceRole = await client.spaceRoles.retrieve(1, { 'X-Space': 'example-space' });
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
</details>
|
|
725
|
+
|
|
726
|
+
<details>
|
|
727
|
+
<summary><strong>update</strong></summary>
|
|
728
|
+
|
|
729
|
+
Update a specific space role by its ID.
|
|
730
|
+
|
|
731
|
+
**Signature:**
|
|
732
|
+
|
|
733
|
+
```typescript
|
|
734
|
+
update(id: number, params: SpaceRoleUpdateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole>
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
**Parameters:**
|
|
738
|
+
|
|
739
|
+
- `id` _(number)_: The ID of the space role to update.
|
|
740
|
+
- `params` _(SpaceRoleUpdateParams)_: Parameters for updating the space role.
|
|
741
|
+
- `name`: _(string)_: The new name of the space role.
|
|
742
|
+
- `policies`: _(Array<number>)_: An updated array of policy IDs associated with the space role.
|
|
743
|
+
- `X-Space`: _(string)_: Header param for space slug name.
|
|
744
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
745
|
+
|
|
746
|
+
**Returns:** `Promise<SpaceRole>`
|
|
747
|
+
|
|
748
|
+
**Example:**
|
|
749
|
+
|
|
750
|
+
```typescript
|
|
751
|
+
const updatedSpaceRole = await client.spaceRoles.update(1, {
|
|
752
|
+
name: 'Super Admin',
|
|
753
|
+
policies: [1, 3],
|
|
754
|
+
'X-Space': 'example-space',
|
|
755
|
+
});
|
|
756
|
+
```
|
|
757
|
+
|
|
758
|
+
</details>
|
|
759
|
+
|
|
760
|
+
<details>
|
|
761
|
+
<summary><strong>list</strong></summary>
|
|
762
|
+
|
|
763
|
+
List all space roles or filter them based on query parameters.
|
|
764
|
+
|
|
765
|
+
**Signature:**
|
|
766
|
+
|
|
767
|
+
```typescript
|
|
768
|
+
list(spaceName: string, params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleListResponse>
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
**Parameters:**
|
|
772
|
+
|
|
773
|
+
- `spaceName`: _(string)_: Header param for space slug name.
|
|
774
|
+
- `params` _(ListParamsResponse)_: Parameters containing the additional filters.
|
|
775
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
776
|
+
|
|
777
|
+
**Returns:** `Promise<SpaceRoleListResponse>`
|
|
778
|
+
|
|
779
|
+
**Example:**
|
|
780
|
+
|
|
781
|
+
```typescript
|
|
782
|
+
const spaceRoles = await client.spaceRoles.list('example-space', { page: 1, limit: 10 });
|
|
783
|
+
```
|
|
784
|
+
|
|
785
|
+
</details>
|
|
786
|
+
|
|
787
|
+
<details>
|
|
788
|
+
<summary><strong>delete</strong></summary>
|
|
789
|
+
|
|
790
|
+
Delete a specific space role by its ID.
|
|
791
|
+
|
|
792
|
+
**Signature:**
|
|
793
|
+
|
|
794
|
+
```typescript
|
|
795
|
+
delete(id: number, params: SpaceRoleDeleteParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
796
|
+
```
|
|
797
|
+
|
|
798
|
+
**Parameters:**
|
|
799
|
+
|
|
800
|
+
- `id` _(number)_: The ID of the space role to delete.
|
|
801
|
+
- `params` _(SpaceRoleDeleteParams)_: Parameters containing the space slug.
|
|
802
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
803
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
804
|
+
|
|
805
|
+
**Returns:** `Promise<void>`
|
|
806
|
+
|
|
807
|
+
**Example:**
|
|
808
|
+
|
|
809
|
+
```typescript
|
|
810
|
+
await client.spaceRoles.delete(1, { 'X-Space': 'example-space' });
|
|
811
|
+
```
|
|
812
|
+
|
|
813
|
+
</details>
|
|
814
|
+
|
|
815
|
+
---
|
|
816
|
+
|
|
817
|
+
# Spaces
|
|
818
|
+
|
|
819
|
+
## Overview
|
|
820
|
+
|
|
821
|
+
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.
|
|
822
|
+
|
|
823
|
+
## Methods
|
|
824
|
+
|
|
825
|
+
<details>
|
|
826
|
+
<summary><strong>create</strong></summary>
|
|
827
|
+
|
|
828
|
+
Create a new space.
|
|
829
|
+
|
|
830
|
+
**Signature:**
|
|
831
|
+
|
|
832
|
+
```typescript
|
|
833
|
+
create(body: SpaceCreateParams, options?: Core.RequestOptions): Core.APIPromise<Space>
|
|
834
|
+
```
|
|
835
|
+
|
|
836
|
+
**Parameters:**
|
|
837
|
+
|
|
838
|
+
- `body` _(SpaceCreateParams)_: Parameters for creating a new space.
|
|
839
|
+
- `logo`: _(string)_: URL of the space logo.
|
|
840
|
+
- `name`: _(string)_: The name of the space.
|
|
841
|
+
- `slug_name`: _(string)_: Slug name for the space.
|
|
842
|
+
- `is_active` _(boolean)_: (Optional) Whether the space is active.
|
|
843
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
844
|
+
|
|
845
|
+
**Returns:** `Promise<Space>`
|
|
846
|
+
|
|
847
|
+
**Example:**
|
|
848
|
+
|
|
849
|
+
```typescript
|
|
850
|
+
const newSpace = await client.spaces.create({
|
|
851
|
+
logo: 'https://example.com/logo.png',
|
|
852
|
+
name: 'My Space',
|
|
853
|
+
slug_name: 'my-space',
|
|
854
|
+
is_active: true,
|
|
855
|
+
});
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
</details>
|
|
859
|
+
|
|
860
|
+
<details>
|
|
861
|
+
<summary><strong>update</strong></summary>
|
|
862
|
+
|
|
863
|
+
Update an existing space.
|
|
864
|
+
|
|
865
|
+
**Signature:**
|
|
866
|
+
|
|
867
|
+
```typescript
|
|
868
|
+
update(params: SpaceUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Space>
|
|
869
|
+
```
|
|
870
|
+
|
|
871
|
+
**Parameters:**
|
|
872
|
+
|
|
873
|
+
- `params` _(SpaceUpdateParams)_: Parameters for updating the space.
|
|
874
|
+
- `logo`: _(string)_: URL of the new space logo.
|
|
875
|
+
- `name`: _(string)_: The new name of the space.
|
|
876
|
+
- `slug_name`: _(string)_: The new slug name for the space.
|
|
877
|
+
- `X-Space`: _(string)_: Header param for space slug name.
|
|
878
|
+
- `is_active` _(boolean)_: (Optional) Whether the space is active.
|
|
879
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
880
|
+
|
|
881
|
+
**Returns:** `Promise<Space>`
|
|
882
|
+
|
|
883
|
+
**Example:**
|
|
884
|
+
|
|
885
|
+
```typescript
|
|
886
|
+
const updatedSpace = await client.spaces.update({
|
|
887
|
+
logo: 'https://example.com/new-logo.png',
|
|
888
|
+
name: 'Updated Space',
|
|
889
|
+
slug_name: 'updated-space',
|
|
890
|
+
'X-Space': 'my-space',
|
|
891
|
+
is_active: true,
|
|
892
|
+
});
|
|
893
|
+
```
|
|
894
|
+
|
|
895
|
+
</details>
|
|
896
|
+
|
|
897
|
+
<details>
|
|
898
|
+
<summary><strong>list</strong></summary>
|
|
899
|
+
|
|
900
|
+
List all spaces or filter them based on query parameters.
|
|
901
|
+
|
|
902
|
+
**Signature:**
|
|
903
|
+
|
|
904
|
+
```typescript
|
|
905
|
+
list(params?: SpaceListParams, options?: Core.RequestOptions): Core.APIPromise<SpaceListResponse>
|
|
906
|
+
```
|
|
907
|
+
|
|
908
|
+
**Parameters:**
|
|
909
|
+
|
|
910
|
+
- `params` _(SpaceListParams)_: (Optional) Parameters containing the space slug and any additional filters.
|
|
911
|
+
- `X-Space`: _(string)_: Header param for space slug name (optional).
|
|
912
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
913
|
+
|
|
914
|
+
**Returns:** `Promise<SpaceListResponse>`
|
|
915
|
+
|
|
916
|
+
**Example:**
|
|
917
|
+
|
|
918
|
+
```typescript
|
|
919
|
+
const spaces = await client.spaces.list({ 'X-Space': 'my-space' });
|
|
920
|
+
```
|
|
921
|
+
|
|
922
|
+
</details>
|
|
923
|
+
|
|
924
|
+
<details>
|
|
925
|
+
<summary><strong>delete</strong></summary>
|
|
926
|
+
|
|
927
|
+
Delete a specific space.
|
|
928
|
+
|
|
929
|
+
**Signature:**
|
|
930
|
+
|
|
931
|
+
```typescript
|
|
932
|
+
delete(params: SpaceParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
933
|
+
```
|
|
934
|
+
|
|
935
|
+
**Parameters:**
|
|
936
|
+
|
|
937
|
+
- `params` _(SpaceParams)_: Parameters containing the space slug.
|
|
938
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
939
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
940
|
+
|
|
941
|
+
**Returns:** `Promise<void>`
|
|
942
|
+
|
|
943
|
+
**Example:**
|
|
944
|
+
|
|
945
|
+
```typescript
|
|
946
|
+
await client.spaces.delete({ 'X-Space': 'my-space' });
|
|
947
|
+
```
|
|
948
|
+
|
|
949
|
+
</details>
|
|
950
|
+
|
|
951
|
+
<details>
|
|
952
|
+
<summary><strong>invitation</strong></summary>
|
|
953
|
+
|
|
954
|
+
Send an invitation to users to join a space.
|
|
955
|
+
|
|
956
|
+
**Signature:**
|
|
957
|
+
|
|
958
|
+
```typescript
|
|
959
|
+
invitation(params: OAuthInvitationParams, options?: Core.RequestOptions): Core.APIPromise<OAuthInvitationParams>
|
|
960
|
+
```
|
|
961
|
+
|
|
962
|
+
**Parameters:**
|
|
963
|
+
|
|
964
|
+
- `params` _(OAuthInvitationParams)_: Contains a list of receivers with emails and role IDs.
|
|
965
|
+
- `receiver_list`: _(Receiver[])_: A list of invitation targets.
|
|
966
|
+
- `email` _(string)_: Email address of the user to invite.
|
|
967
|
+
- `space_role_id` _(string)_: Role ID assigned to the user in the space.
|
|
968
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
969
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
970
|
+
|
|
971
|
+
**Returns:** `Promise<OAuthInvitationParams>`
|
|
972
|
+
|
|
973
|
+
**Example:**
|
|
974
|
+
|
|
975
|
+
```typescript
|
|
976
|
+
const invitationResponse = await client.spaces.invitation({
|
|
977
|
+
receiver_list: [
|
|
978
|
+
{
|
|
979
|
+
email: 'user1@example.com',
|
|
980
|
+
space_role_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
email: 'user2@example.com',
|
|
984
|
+
space_role_id: '3fa85f64-5717-4562-b3fc-2c963f66afb3',
|
|
985
|
+
},
|
|
986
|
+
],
|
|
987
|
+
'X-Space': 'your-space-slug',
|
|
988
|
+
});
|
|
989
|
+
```
|
|
990
|
+
|
|
991
|
+
</details>
|
|
992
|
+
|
|
993
|
+
<details>
|
|
994
|
+
<summary><strong>joinSpace</strong></summary>
|
|
995
|
+
|
|
996
|
+
Join a space using an invitation token.
|
|
997
|
+
|
|
998
|
+
**Signature:**
|
|
999
|
+
|
|
1000
|
+
```typescript
|
|
1001
|
+
joinSpace(token: string, options?: Core.RequestOptions): Core.APIPromise<JoinSpaceResponse>
|
|
1002
|
+
```
|
|
1003
|
+
|
|
1004
|
+
**Parameters:**
|
|
1005
|
+
|
|
1006
|
+
- `token` _(string)_: The unique token received in the invitation link.
|
|
1007
|
+
- `options` _(Core.RequestOptions)_: Additional request options (e.g., headers).
|
|
1008
|
+
|
|
1009
|
+
**Returns:** `Promise<JoinSpaceResponse>`
|
|
1010
|
+
|
|
1011
|
+
Where `JoinSpaceResponse` is:
|
|
1012
|
+
|
|
1013
|
+
```typescript
|
|
1014
|
+
export interface JoinSpaceResponse {
|
|
1015
|
+
result?: string;
|
|
1016
|
+
error?: string;
|
|
1017
|
+
}
|
|
1018
|
+
```
|
|
1019
|
+
|
|
1020
|
+
**Example:**
|
|
1021
|
+
|
|
1022
|
+
```typescript
|
|
1023
|
+
const joinResponse = await client.spaces.joinSpace('eyJ0b2tlbiI6ICJ4eXo0NTYiIH0...');
|
|
1024
|
+
|
|
1025
|
+
if (joinResponse.error) {
|
|
1026
|
+
console.error('Failed to join space:', joinResponse.error);
|
|
1027
|
+
} else {
|
|
1028
|
+
console.log('Joined space successfully!', joinResponse.result);
|
|
1029
|
+
}
|
|
1030
|
+
```
|
|
1031
|
+
|
|
1032
|
+
</details>
|
|
1033
|
+
|
|
1034
|
+
---
|
|
1035
|
+
|
|
1036
|
+
# Oauth2
|
|
1037
|
+
|
|
1038
|
+
## Overview
|
|
1039
|
+
|
|
1040
|
+
The `OAuth2` class provides methods for handling OAuth2 authorization and token exchange processes within an application.
|
|
1041
|
+
|
|
1042
|
+
## Methods
|
|
1043
|
+
|
|
1044
|
+
<details>
|
|
1045
|
+
<summary><strong>authorize</strong></summary>
|
|
1046
|
+
|
|
1047
|
+
Initiates the OAuth2 authorization flow by generating a code challenge and sending the authorization request.
|
|
1048
|
+
|
|
1049
|
+
**Signature:**
|
|
1050
|
+
|
|
1051
|
+
```typescript
|
|
1052
|
+
async authorize(body: OAuth2AuthorizeParams, options?: Core.RequestOptions): Promise<OAuth2Authorize>
|
|
1053
|
+
```
|
|
1054
|
+
|
|
1055
|
+
**Parameters:**
|
|
1056
|
+
|
|
1057
|
+
- `body` _(OAuth2AuthorizeParams)_: Parameters required for authorization.
|
|
1058
|
+
- `client_id`: _(string)_: The client ID of the application.
|
|
1059
|
+
- `redirect_uri`: _(string)_: The URI to redirect to after authorization.
|
|
1060
|
+
- `scopes`: _(Array<'organization'>)_: Scopes for the authorization request.
|
|
1061
|
+
- `options` _(Core.RequestOptions)_: (Optional) Additional request options.
|
|
1062
|
+
|
|
1063
|
+
**Returns:** `Promise<OAuth2Authorize>`
|
|
1064
|
+
|
|
1065
|
+
**Example:**
|
|
1066
|
+
|
|
1067
|
+
```typescript
|
|
1068
|
+
const authParams: OAuth2AuthorizeParams = {
|
|
1069
|
+
client_id: 'your-client-id',
|
|
1070
|
+
redirect_uri: 'https://yourapp.com/callback',
|
|
1071
|
+
scopes: ['organization'],
|
|
1072
|
+
};
|
|
1073
|
+
const authResponse = await client.oauth2.authorize(authParams);
|
|
1074
|
+
```
|
|
1075
|
+
|
|
1076
|
+
</details>
|
|
1077
|
+
|
|
1078
|
+
<details>
|
|
1079
|
+
<summary><strong>token</strong></summary>
|
|
1080
|
+
|
|
1081
|
+
Exchanges the authorization code for an access token.
|
|
1082
|
+
|
|
1083
|
+
**Signature:**
|
|
1084
|
+
|
|
1085
|
+
```typescript
|
|
1086
|
+
token(body: OAuth2Token, options?: Core.RequestOptions): Core.APIPromise<OAuth2Token>
|
|
1087
|
+
```
|
|
1088
|
+
|
|
1089
|
+
**Parameters:**
|
|
1090
|
+
|
|
1091
|
+
- `body` _(OAuth2Token)_: Parameters required to obtain an access token.
|
|
1092
|
+
- `client_id`: _(string)_: The client ID of the application.
|
|
1093
|
+
- `client_secret`: _(string)_: The client secret of the application.
|
|
1094
|
+
- `code`: _(string)_: The authorization code received from the authorization server.
|
|
1095
|
+
- `code_verifier`: _(string)_: The code verifier used in the authorization request.
|
|
1096
|
+
- `scopes`: _(Array<'organization'>)_: (Optional) Scopes for the token request.
|
|
1097
|
+
- `id_token`: _(string)_: (Optional) ID token if available.
|
|
1098
|
+
|
|
1099
|
+
**Returns:** `Promise<OAuth2Token>`
|
|
1100
|
+
|
|
1101
|
+
**Example:**
|
|
1102
|
+
|
|
1103
|
+
```typescript
|
|
1104
|
+
const tokenParams: OAuth2Token = {
|
|
1105
|
+
client_id: 'your-client-id',
|
|
1106
|
+
client_secret: 'your-client-secret',
|
|
1107
|
+
code: 'authorization-code',
|
|
1108
|
+
code_verifier: 'your-code-verifier',
|
|
1109
|
+
};
|
|
1110
|
+
const tokenResponse = await oauth2.token(tokenParams);
|
|
1111
|
+
```
|
|
1112
|
+
|
|
1113
|
+
</details>
|
|
1114
|
+
|
|
1115
|
+
---
|
|
1116
|
+
|
|
1117
|
+
# Dashboards
|
|
1118
|
+
|
|
1119
|
+
## Overview
|
|
1120
|
+
|
|
1121
|
+
The `Dashboards` class provides methods to manage dashboards and their associated widgets within an application.
|
|
1122
|
+
|
|
1123
|
+
## Methods
|
|
1124
|
+
|
|
1125
|
+
<details>
|
|
1126
|
+
<summary><strong>create</strong></summary>
|
|
1127
|
+
|
|
1128
|
+
Creates a new dashboard.
|
|
1129
|
+
|
|
1130
|
+
**Signature:**
|
|
1131
|
+
|
|
1132
|
+
```typescript
|
|
1133
|
+
create(params: DashboardCreateParams, options?: Core.RequestOptions): Core.APIPromise<Dashboard>
|
|
1134
|
+
```
|
|
1135
|
+
|
|
1136
|
+
**Parameters:**
|
|
1137
|
+
|
|
1138
|
+
- `params` _(DashboardCreateParams)_: Parameters required for creating a dashboard.
|
|
1139
|
+
- `name`: _(string)_: The name of the dashboard.
|
|
1140
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1141
|
+
|
|
1142
|
+
**Returns:** `Promise<Dashboard>`
|
|
1143
|
+
|
|
1144
|
+
**Example:**
|
|
1145
|
+
|
|
1146
|
+
```typescript
|
|
1147
|
+
const dashboardParams: DashboardCreateParams = {
|
|
1148
|
+
name: 'New Dashboard',
|
|
1149
|
+
'X-Space': 'your-space-slug',
|
|
1150
|
+
};
|
|
1151
|
+
const newDashboard = await client.dashboards.create(dashboardParams);
|
|
1152
|
+
```
|
|
1153
|
+
|
|
1154
|
+
</details>
|
|
1155
|
+
|
|
1156
|
+
<details>
|
|
1157
|
+
<summary><strong>retrieve</strong></summary>
|
|
1158
|
+
|
|
1159
|
+
Retrieves a specific dashboard by its ID.
|
|
1160
|
+
|
|
1161
|
+
**Signature:**
|
|
1162
|
+
|
|
1163
|
+
```typescript
|
|
1164
|
+
retrieve(id: number, params: DashboardRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<Dashboard>
|
|
1165
|
+
```
|
|
1166
|
+
|
|
1167
|
+
**Parameters:**
|
|
1168
|
+
|
|
1169
|
+
- `id` _(number)_: The ID of the dashboard to retrieve.
|
|
1170
|
+
- `params` _(DashboardRetrieveParams)_: Parameters required for retrieving a dashboard.
|
|
1171
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1172
|
+
|
|
1173
|
+
**Returns:** `Promise<Dashboard>`
|
|
1174
|
+
|
|
1175
|
+
**Example:**
|
|
1176
|
+
|
|
1177
|
+
```typescript
|
|
1178
|
+
const dashboardId = 1;
|
|
1179
|
+
const dashboardDetails = await client.dashboards.retrieve(dashboardId, { 'X-Space': 'your-space-slug' });
|
|
1180
|
+
```
|
|
1181
|
+
|
|
1182
|
+
</details>
|
|
1183
|
+
|
|
1184
|
+
<details>
|
|
1185
|
+
<summary><strong>update</strong></summary>
|
|
1186
|
+
|
|
1187
|
+
Updates an existing dashboard.
|
|
1188
|
+
|
|
1189
|
+
**Signature:**
|
|
1190
|
+
|
|
1191
|
+
```typescript
|
|
1192
|
+
update(id: number, params: DashboardUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Dashboard>
|
|
1193
|
+
```
|
|
1194
|
+
|
|
1195
|
+
**Parameters:**
|
|
1196
|
+
|
|
1197
|
+
- `id` _(number)_: The ID of the dashboard to update.
|
|
1198
|
+
- `params` _(DashboardUpdateParams)_: Parameters required for updating a dashboard.
|
|
1199
|
+
- `name`: _(string)_: The new name of the dashboard.
|
|
1200
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1201
|
+
|
|
1202
|
+
**Returns:** `Promise<Dashboard>`
|
|
1203
|
+
|
|
1204
|
+
**Example:**
|
|
1205
|
+
|
|
1206
|
+
```typescript
|
|
1207
|
+
const updateParams: DashboardUpdateParams = {
|
|
1208
|
+
name: 'Updated Dashboard',
|
|
1209
|
+
'X-Space': 'your-space-slug',
|
|
1210
|
+
};
|
|
1211
|
+
const updatedDashboard = await client.dashboards.update(dashboardId, updateParams);
|
|
1212
|
+
```
|
|
1213
|
+
|
|
1214
|
+
</details>
|
|
1215
|
+
|
|
1216
|
+
<details>
|
|
1217
|
+
<summary><strong>list</strong></summary>
|
|
1218
|
+
|
|
1219
|
+
Lists all dashboards within a specific space.
|
|
1220
|
+
|
|
1221
|
+
**Signature:**
|
|
1222
|
+
|
|
1223
|
+
```typescript
|
|
1224
|
+
list(params: DashboardListParams, options?: Core.RequestOptions): Core.APIPromise<DashboardListResponse>
|
|
1225
|
+
```
|
|
1226
|
+
|
|
1227
|
+
**Parameters:**
|
|
1228
|
+
|
|
1229
|
+
- `params` _(DashboardListParams)_: Parameters for listing dashboards.
|
|
1230
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1231
|
+
|
|
1232
|
+
**Returns:** `Promise<DashboardListResponse>`
|
|
1233
|
+
|
|
1234
|
+
**Example:**
|
|
1235
|
+
|
|
1236
|
+
```typescript
|
|
1237
|
+
const dashboardsList = await client.dashboards.list({ 'X-Space': 'your-space-slug' });
|
|
1238
|
+
```
|
|
1239
|
+
|
|
1240
|
+
</details>
|
|
1241
|
+
|
|
1242
|
+
<details>
|
|
1243
|
+
<summary><strong>delete</strong></summary>
|
|
1244
|
+
|
|
1245
|
+
Deletes a specific dashboard by its ID.
|
|
1246
|
+
|
|
1247
|
+
**Signature:**
|
|
1248
|
+
|
|
1249
|
+
```typescript
|
|
1250
|
+
delete(id: number, params: DashboardDeleteParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1251
|
+
```
|
|
1252
|
+
|
|
1253
|
+
**Parameters:**
|
|
1254
|
+
|
|
1255
|
+
- `id` _(number)_: The ID of the dashboard to delete.
|
|
1256
|
+
- `params` _(DashboardDeleteParams)_: Parameters required for deleting a dashboard.
|
|
1257
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1258
|
+
|
|
1259
|
+
**Returns:** `Promise<void>`
|
|
1260
|
+
|
|
1261
|
+
**Example:**
|
|
1262
|
+
|
|
1263
|
+
```typescript
|
|
1264
|
+
await client.dashboards.delete(dashboardId, { 'X-Space': 'your-space-slug' });
|
|
1265
|
+
```
|
|
1266
|
+
|
|
1267
|
+
</details>
|
|
1268
|
+
|
|
1269
|
+
<details>
|
|
1270
|
+
<summary><strong>createWidget</strong></summary>
|
|
1271
|
+
|
|
1272
|
+
Creates a new widget in a specified dashboard.
|
|
1273
|
+
|
|
1274
|
+
**Signature:**
|
|
1275
|
+
|
|
1276
|
+
```typescript
|
|
1277
|
+
createWidget(dashboardId: string, params: WidgetCreateParams, options?: Core.RequestOptions): Core.APIPromise<Widget>
|
|
1278
|
+
```
|
|
1279
|
+
|
|
1280
|
+
**Parameters:**
|
|
1281
|
+
|
|
1282
|
+
- `dashboardId` _(string)_: The ID of the dashboard to create the widget in.
|
|
1283
|
+
- `params` _(WidgetCreateParams)_: Parameters required for creating a widget.
|
|
1284
|
+
- `configuration`: _(any)_: Configuration settings for the widget.
|
|
1285
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1286
|
+
|
|
1287
|
+
**Returns:** `Promise<Widget>`
|
|
1288
|
+
|
|
1289
|
+
**Example:**
|
|
1290
|
+
|
|
1291
|
+
```typescript
|
|
1292
|
+
const widgetParams: WidgetCreateParams = {
|
|
1293
|
+
configuration: { /_ widget configuration _/ },
|
|
1294
|
+
'X-Space': 'your-space-slug',
|
|
1295
|
+
};
|
|
1296
|
+
const newWidget = await client.dashboards.createWidget(dashboardId, widgetParams);
|
|
1297
|
+
```
|
|
1298
|
+
|
|
1299
|
+
</details>
|
|
1300
|
+
|
|
1301
|
+
<details>
|
|
1302
|
+
<summary><strong>retrieveWidget</strong></summary>
|
|
1303
|
+
|
|
1304
|
+
Retrieves a specific widget by its ID from a dashboard.
|
|
1305
|
+
|
|
1306
|
+
**Signature:**
|
|
1307
|
+
|
|
1308
|
+
```typescript
|
|
1309
|
+
retrieveWidget(dashboardId: string, id: number, params: WidgetRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<Widget>
|
|
1310
|
+
```
|
|
1311
|
+
|
|
1312
|
+
**Parameters:**
|
|
1313
|
+
|
|
1314
|
+
- `dashboardId` _(string)_: The ID of the dashboard containing the widget.
|
|
1315
|
+
- `id` _(number)_: The ID of the widget to retrieve.
|
|
1316
|
+
- `params` _(WidgetRetrieveParams)_: Parameters required for retrieving a widget.
|
|
1317
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1318
|
+
|
|
1319
|
+
**Returns:** `Promise<Widget>`
|
|
1320
|
+
|
|
1321
|
+
**Example:**
|
|
1322
|
+
|
|
1323
|
+
```typescript
|
|
1324
|
+
const widgetDetails = await client.dashboards.retrieveWidget(dashboardId, widgetId, { 'X-Space': 'your-space-slug' });
|
|
1325
|
+
```
|
|
1326
|
+
|
|
1327
|
+
</details>
|
|
1328
|
+
|
|
1329
|
+
<details>
|
|
1330
|
+
<summary><strong>updateWidget</strong></summary>
|
|
1331
|
+
|
|
1332
|
+
Updates an existing widget in a specified dashboard.
|
|
1333
|
+
|
|
1334
|
+
**Signature:**
|
|
1335
|
+
|
|
1336
|
+
```typescript
|
|
1337
|
+
updateWidget(dashboardId: string, id: number, params: WidgetUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Widget>
|
|
1338
|
+
```
|
|
1339
|
+
|
|
1340
|
+
**Parameters:**
|
|
1341
|
+
|
|
1342
|
+
- `dashboardId` _(string)_: The ID of the dashboard containing the widget.
|
|
1343
|
+
- `id` _(number)_: The ID of the widget to update.
|
|
1344
|
+
- `params` _(WidgetUpdateParams)_: Parameters required for updating a widget.
|
|
1345
|
+
- `configuration`: _(any)_: New configuration settings for the widget.
|
|
1346
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1347
|
+
|
|
1348
|
+
**Returns:** `Promise<Widget>`
|
|
1349
|
+
|
|
1350
|
+
**Example:**
|
|
1351
|
+
|
|
1352
|
+
```typescript
|
|
1353
|
+
const updateWidgetParams: WidgetUpdateParams = {
|
|
1354
|
+
configuration: { /_ new widget configuration _/ },
|
|
1355
|
+
'X-Space': 'your-space-slug',
|
|
1356
|
+
};
|
|
1357
|
+
const updatedWidget = await client.dashboards.updateWidget(dashboardId, widgetId, updateWidgetParams);
|
|
1358
|
+
```
|
|
1359
|
+
|
|
1360
|
+
</details>
|
|
1361
|
+
|
|
1362
|
+
<details>
|
|
1363
|
+
<summary><strong>listWidgets</strong></summary>
|
|
1364
|
+
|
|
1365
|
+
Lists all widgets within a specific dashboard.
|
|
1366
|
+
|
|
1367
|
+
**Signature:**
|
|
1368
|
+
|
|
1369
|
+
```typescript
|
|
1370
|
+
listWidgets(dashboardId: string, params: WidgetListParams, options?: Core.RequestOptions): Core.APIPromise<WidgetListResponse>
|
|
1371
|
+
```
|
|
1372
|
+
|
|
1373
|
+
**Parameters:**
|
|
1374
|
+
|
|
1375
|
+
- `dashboardId` _(string)_: The ID of the dashboard to list widgets from.
|
|
1376
|
+
- `params` _(WidgetListParams)_: Parameters for listing widgets.
|
|
1377
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1378
|
+
- `ordering`: _(string)_: (Optional) Field to use when ordering the results.
|
|
1379
|
+
|
|
1380
|
+
**Returns:** `Promise<WidgetListResponse>`
|
|
1381
|
+
|
|
1382
|
+
**Example:**
|
|
1383
|
+
|
|
1384
|
+
```typescript
|
|
1385
|
+
const widgetsList = await client.dashboards.listWidgets(dashboardId, { 'X-Space': 'your-space-slug' });
|
|
1386
|
+
```
|
|
1387
|
+
|
|
1388
|
+
</details>
|
|
1389
|
+
|
|
1390
|
+
<details>
|
|
1391
|
+
<summary><strong>deleteWidget</strong></summary>
|
|
1392
|
+
|
|
1393
|
+
Deletes a specific widget by its ID from a dashboard.
|
|
1394
|
+
|
|
1395
|
+
**Signature:**
|
|
1396
|
+
|
|
1397
|
+
```typescript
|
|
1398
|
+
deleteWidget(dashboardId: string, id: number, params: WidgetDeleteParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1399
|
+
```
|
|
1400
|
+
|
|
1401
|
+
**Parameters:**
|
|
1402
|
+
|
|
1403
|
+
- `dashboardId` _(string)_: The ID of the dashboard containing the widget.
|
|
1404
|
+
- `id` _(number)_: The ID of the widget to delete.
|
|
1405
|
+
- `params` _(WidgetDeleteParams)_: Parameters required for deleting a widget.
|
|
1406
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
1407
|
+
|
|
1408
|
+
**Returns:** `Promise<void>`
|
|
1409
|
+
|
|
1410
|
+
**Example:**
|
|
1411
|
+
|
|
1412
|
+
```typescript
|
|
1413
|
+
await client.dashboards.deleteWidget(dashboardId, widgetId, { 'X-Space': 'your-space-slug' });
|
|
1414
|
+
```
|
|
1415
|
+
|
|
1416
|
+
</details>
|
|
1417
|
+
|
|
1418
|
+
# Device States
|
|
1419
|
+
|
|
1420
|
+
## Overview
|
|
1421
|
+
|
|
1422
|
+
The `Device States` class provides methods to retrieve various device state metrics (daily, hourly, minutely, monthly) from an API.
|
|
1423
|
+
|
|
1424
|
+
## Methods
|
|
1425
|
+
|
|
1426
|
+
<details>
|
|
1427
|
+
<summary><strong>retrieveDaily</strong></summary>
|
|
1428
|
+
|
|
1429
|
+
Retrieves daily device states.
|
|
1430
|
+
|
|
1431
|
+
**Signature:**
|
|
1432
|
+
|
|
1433
|
+
```typescript
|
|
1434
|
+
retrieveDaily(params: DailyRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<DailyRetrieveResponse>
|
|
1435
|
+
```
|
|
1436
|
+
|
|
1437
|
+
**Parameters:**
|
|
1438
|
+
|
|
1439
|
+
- `params` _(DailyRetrieveParams)_: Parameters for retrieving daily device states.
|
|
1440
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
1441
|
+
- Other query parameters specific to daily retrieval.
|
|
1442
|
+
|
|
1443
|
+
**Returns:** `Promise<DailyRetrieveResponse>`
|
|
1444
|
+
|
|
1445
|
+
**Example:**
|
|
1446
|
+
|
|
1447
|
+
```typescript
|
|
1448
|
+
const dailyParams: DailyRetrieveParams = {
|
|
1449
|
+
'X-Space': 'your-space-slug',
|
|
1450
|
+
// other parameters
|
|
1451
|
+
};
|
|
1452
|
+
const dailyData = await client.deviceStates.retrieveDaily(dailyParams);
|
|
1453
|
+
```
|
|
1454
|
+
|
|
1455
|
+
</details>
|
|
1456
|
+
|
|
1457
|
+
<details>
|
|
1458
|
+
<summary><strong>retrieveHourly</strong></summary>
|
|
1459
|
+
|
|
1460
|
+
Retrieves hourly device states.
|
|
1461
|
+
|
|
1462
|
+
**Signature:**
|
|
1463
|
+
|
|
1464
|
+
```typescript
|
|
1465
|
+
retrieveHourly(params: HourlyRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<HourlyRetrieveResponse>
|
|
1466
|
+
```
|
|
1467
|
+
|
|
1468
|
+
**Parameters:**
|
|
1469
|
+
|
|
1470
|
+
- `params` _(HourlyRetrieveParams)_: Parameters for retrieving hourly device states.
|
|
1471
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
1472
|
+
- Other query parameters specific to hourly retrieval.
|
|
1473
|
+
|
|
1474
|
+
**Returns:** `Promise<HourlyRetrieveResponse>`
|
|
1475
|
+
|
|
1476
|
+
**Example:**
|
|
1477
|
+
|
|
1478
|
+
```typescript
|
|
1479
|
+
const hourlyParams: HourlyRetrieveParams = {
|
|
1480
|
+
'X-Space': 'your-space-slug',
|
|
1481
|
+
// other parameters
|
|
1482
|
+
};
|
|
1483
|
+
const hourlyData = await client.deviceStates.retrieveHourly(hourlyParams);
|
|
1484
|
+
```
|
|
1485
|
+
|
|
1486
|
+
</details>
|
|
1487
|
+
|
|
1488
|
+
<details>
|
|
1489
|
+
<summary><strong>retrieveMinutely</strong></summary>
|
|
1490
|
+
|
|
1491
|
+
Retrieves minutely device states.
|
|
1492
|
+
|
|
1493
|
+
**Signature:**
|
|
1494
|
+
|
|
1495
|
+
```typescript
|
|
1496
|
+
retrieveMinutely(params: MinutelyRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<MinutelyRetrieveResponse>
|
|
1497
|
+
```
|
|
1498
|
+
|
|
1499
|
+
**Parameters:**
|
|
1500
|
+
|
|
1501
|
+
- `params` _(MinutelyRetrieveParams)_: Parameters for retrieving minutely device states.
|
|
1502
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
1503
|
+
- Other query parameters specific to minutely retrieval.
|
|
1504
|
+
|
|
1505
|
+
**Returns:** `Promise<MinutelyRetrieveResponse>`
|
|
1506
|
+
|
|
1507
|
+
**Example:**
|
|
1508
|
+
|
|
1509
|
+
```typescript
|
|
1510
|
+
const minutelyParams: MinutelyRetrieveParams = {
|
|
1511
|
+
'X-Space': 'your-space-slug',
|
|
1512
|
+
// other parameters
|
|
1513
|
+
};
|
|
1514
|
+
const minutelyData = await client.deviceStates.retrieveMinutely(minutelyParams);
|
|
1515
|
+
```
|
|
1516
|
+
|
|
1517
|
+
</details>
|
|
1518
|
+
|
|
1519
|
+
<details>
|
|
1520
|
+
<summary><strong>retrieveMonthly</strong></summary>
|
|
1521
|
+
|
|
1522
|
+
Retrieves monthly device states.
|
|
1523
|
+
|
|
1524
|
+
**Signature:**
|
|
1525
|
+
|
|
1526
|
+
```typescript
|
|
1527
|
+
retrieveMonthly(params: MonthlyRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<MonthlyRetrieveResponse>
|
|
1528
|
+
```
|
|
1529
|
+
|
|
1530
|
+
**Parameters:**
|
|
1531
|
+
|
|
1532
|
+
- `params` _(MonthlyRetrieveParams)_: Parameters for retrieving monthly device states.
|
|
1533
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
1534
|
+
- Other query parameters specific to monthly retrieval.
|
|
1535
|
+
|
|
1536
|
+
**Returns:** `Promise<MonthlyRetrieveResponse>`
|
|
1537
|
+
|
|
1538
|
+
**Example:**
|
|
1539
|
+
|
|
1540
|
+
```typescript
|
|
1541
|
+
const monthlyParams: MonthlyRetrieveParams = {
|
|
1542
|
+
'X-Space': 'your-space-slug',
|
|
1543
|
+
// other parameters
|
|
1544
|
+
};
|
|
1545
|
+
const monthlyData = await client.deviceStates.retrieveMonthly(monthlyParams);
|
|
1546
|
+
```
|
|
1547
|
+
|
|
1548
|
+
</details>
|
|
1549
|
+
|
|
1550
|
+
---
|
|
1551
|
+
|
|
1552
|
+
# Users
|
|
1553
|
+
|
|
1554
|
+
## Overview
|
|
1555
|
+
|
|
1556
|
+
The `Users` class provides methods for managing the authenticated user's profile, including retrieving, updating, and deleting their information.
|
|
1557
|
+
|
|
1558
|
+
## Methods
|
|
1559
|
+
|
|
1560
|
+
<details>
|
|
1561
|
+
<summary><strong>getMe</strong></summary>
|
|
1562
|
+
|
|
1563
|
+
Retrieve the profile of the authenticated user.
|
|
1564
|
+
|
|
1565
|
+
**Signature:**
|
|
1566
|
+
|
|
1567
|
+
```typescript
|
|
1568
|
+
getMe(options?: Core.RequestOptions): Core.APIPromise<Profile>
|
|
1569
|
+
```
|
|
1570
|
+
|
|
1571
|
+
**Parameters:**
|
|
1572
|
+
|
|
1573
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
1574
|
+
|
|
1575
|
+
**Returns:** `Promise<Profile>`
|
|
1576
|
+
|
|
1577
|
+
**Example:**
|
|
1578
|
+
|
|
1579
|
+
```typescript
|
|
1580
|
+
const userProfile = await client.users.getMe();
|
|
1581
|
+
console.log(userProfile.first_name);
|
|
1582
|
+
```
|
|
1583
|
+
|
|
1584
|
+
</details>
|
|
1585
|
+
|
|
1586
|
+
<details>
|
|
1587
|
+
<summary><strong>updateMe</strong></summary>
|
|
1588
|
+
|
|
1589
|
+
Update the profile of the authenticated user.
|
|
1590
|
+
|
|
1591
|
+
**Signature:**
|
|
1592
|
+
|
|
1593
|
+
```typescript
|
|
1594
|
+
updateMe(body: Profile, options?: Core.RequestOptions): Core.APIPromise<Profile>
|
|
1595
|
+
```
|
|
1596
|
+
|
|
1597
|
+
**Parameters:**
|
|
1598
|
+
|
|
1599
|
+
- `body` _(Profile)_: Object containing updated user profile details.
|
|
1600
|
+
- `first_name` _(string)_: User's first name.
|
|
1601
|
+
- `last_name` _(string)_: User's last name.
|
|
1602
|
+
- `email` _(string)_: User's email address.
|
|
1603
|
+
- `location` _(string)_: User's location.
|
|
1604
|
+
- `avatar` _(string)_: URL of the user's avatar.
|
|
1605
|
+
- `company_name` _(string)_: User's company name.
|
|
1606
|
+
- `title` _(string)_: User's title.
|
|
1607
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
1608
|
+
|
|
1609
|
+
**Returns:** `Promise<Profile>`
|
|
1610
|
+
|
|
1611
|
+
**Example:**
|
|
1612
|
+
|
|
1613
|
+
```typescript
|
|
1614
|
+
const updatedProfile = await client.users.updateMe({
|
|
1615
|
+
first_name: 'John',
|
|
1616
|
+
last_name: 'Doe',
|
|
1617
|
+
email: 'john.doe@example.com',
|
|
1618
|
+
});
|
|
1619
|
+
console.log(updatedProfile);
|
|
1620
|
+
```
|
|
1621
|
+
|
|
1622
|
+
</details>
|
|
1623
|
+
|
|
1624
|
+
<details>
|
|
1625
|
+
<summary><strong>deleteMe</strong></summary>
|
|
1626
|
+
|
|
1627
|
+
Delete the profile of the authenticated user.
|
|
1628
|
+
|
|
1629
|
+
**Signature:**
|
|
1630
|
+
|
|
1631
|
+
```typescript
|
|
1632
|
+
deleteMe(options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1633
|
+
```
|
|
1634
|
+
|
|
1635
|
+
**Parameters:**
|
|
1636
|
+
|
|
1637
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
1638
|
+
|
|
1639
|
+
**Returns:** `Promise<void>`
|
|
1640
|
+
|
|
1641
|
+
**Example:**
|
|
1642
|
+
|
|
1643
|
+
```typescript
|
|
1644
|
+
await client.users.deleteMe();
|
|
1645
|
+
console.log('User profile deleted.');
|
|
1646
|
+
```
|
|
1647
|
+
|
|
1648
|
+
</details>
|
|
1649
|
+
|
|
1650
|
+
---
|
|
1651
|
+
|
|
1652
|
+
# PresignedUrl
|
|
1653
|
+
|
|
1654
|
+
## Overview
|
|
1655
|
+
|
|
1656
|
+
The `PresignedUrl` class provides a method for retrieving a presigned URL along with the associated file name.
|
|
1657
|
+
|
|
1658
|
+
## Methods
|
|
1659
|
+
|
|
1660
|
+
<details>
|
|
1661
|
+
<summary><strong>get</strong></summary>
|
|
1662
|
+
|
|
1663
|
+
Retrieve a presigned URL and its associated file name.
|
|
1664
|
+
|
|
1665
|
+
**Signature:**
|
|
1666
|
+
|
|
1667
|
+
```typescript
|
|
1668
|
+
get(options?: Core.RequestOptions): Core.APIPromise<PresignedUrlResponse>
|
|
1669
|
+
```
|
|
1670
|
+
|
|
1671
|
+
**Parameters:**
|
|
1672
|
+
|
|
1673
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
1674
|
+
|
|
1675
|
+
**Returns:** `Promise<PresignedUrlResponse>`
|
|
1676
|
+
|
|
1677
|
+
**Example:**
|
|
1678
|
+
|
|
1679
|
+
```typescript
|
|
1680
|
+
const response = await client.presignedUrl.get();
|
|
1681
|
+
console.log(response.presigned_url);
|
|
1682
|
+
console.log(response.file_name);
|
|
1683
|
+
```
|
|
1684
|
+
|
|
1685
|
+
</details>
|
|
1686
|
+
|
|
1687
|
+
# DeviceConnector
|
|
1688
|
+
|
|
1689
|
+
## Overview
|
|
1690
|
+
|
|
1691
|
+
The `DeviceConnector` class provides methods for retrieving and listing connector. Below are the details for each method, including parameters, return types, and example usage.
|
|
1692
|
+
|
|
1693
|
+
## Methods
|
|
1694
|
+
|
|
1695
|
+
<details>
|
|
1696
|
+
<summary><strong>create</strong></summary>
|
|
1697
|
+
|
|
1698
|
+
Create a new device connector.
|
|
1699
|
+
|
|
1700
|
+
**Signature:**
|
|
1701
|
+
|
|
1702
|
+
```typescript
|
|
1703
|
+
create(params: DeviceConnectorParams, options?: Core.RequestOptions): Core.APIPromise<DeviceConnectorParams>
|
|
1704
|
+
```
|
|
1705
|
+
|
|
1706
|
+
**Parameters:**
|
|
1707
|
+
|
|
1708
|
+
- params (DeviceConnectorParams): Parameters for creating a device connector:
|
|
1709
|
+
- network_server (string): The URL or address of the network server.
|
|
1710
|
+
- name (string): The name of the device connector.
|
|
1711
|
+
- connector_type (string): The type of the connector (e.g., mqtt, http).
|
|
1712
|
+
- status? (string): Optional status of the connector.
|
|
1713
|
+
- deviceHttpConfig? (DeviceHttpConfig): Optional HTTP-specific configuration:
|
|
1714
|
+
- api_token (string): Token used to authenticate HTTP requests.
|
|
1715
|
+
- address_url (string): Base URL of the HTTP endpoint.
|
|
1716
|
+
- deviceMqttConfig? (DeviceMqttConfig): Optional MQTT-specific configuration:
|
|
1717
|
+
- mqtt_broker (string): Address of the MQTT broker.
|
|
1718
|
+
- username (string): Username for broker authentication.
|
|
1719
|
+
- password (string): Password for broker authentication.
|
|
1720
|
+
- options (Core.RequestOptions): Additional request options.
|
|
1721
|
+
|
|
1722
|
+
**Returns:** Promise `<DeviceConnectorParams>`
|
|
1723
|
+
|
|
1724
|
+
**Example:**
|
|
1725
|
+
|
|
1726
|
+
```typescript
|
|
1727
|
+
const newMqttConnector = await client.deviceConnector.create({
|
|
1728
|
+
network_server: 'poue4567-e89...',
|
|
1729
|
+
name: 'MQTT Connector 1',
|
|
1730
|
+
connector_type: 'mqtt_broker',
|
|
1731
|
+
deviceMqttConfig: {
|
|
1732
|
+
mqtt_broker: 'mqtt://broker.example.com',
|
|
1733
|
+
username: 'user123',
|
|
1734
|
+
password: 'secretpass',
|
|
1735
|
+
},
|
|
1736
|
+
});
|
|
1737
|
+
|
|
1738
|
+
const newHttpConnector = await client.deviceConnector.create({
|
|
1739
|
+
network_server: 'poue4567-e89...',
|
|
1740
|
+
name: 'HTTP Connector 1',
|
|
1741
|
+
connector_type: 'http_server',
|
|
1742
|
+
deviceHttpConfig: {
|
|
1743
|
+
api_token: 'your_api_token_here',
|
|
1744
|
+
address_url: 'http://api.example.com/data',
|
|
1745
|
+
},
|
|
1746
|
+
});
|
|
1747
|
+
```
|
|
1748
|
+
|
|
1749
|
+
</details>
|
|
1750
|
+
|
|
1751
|
+
<details>
|
|
1752
|
+
<summary><strong>testConnectionPreview</strong></summary>
|
|
1753
|
+
|
|
1754
|
+
Test connection to a device connector without saving it (preview only).
|
|
1755
|
+
|
|
1756
|
+
**Signature:**
|
|
1757
|
+
|
|
1758
|
+
```typescript
|
|
1759
|
+
testConnectionPreview(params: DeviceConnectorParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1760
|
+
```
|
|
1761
|
+
|
|
1762
|
+
**Parameters:**
|
|
1763
|
+
|
|
1764
|
+
- params (DeviceConnectorParams): Parameters for testing a device connector connection:
|
|
1765
|
+
- network_server (string): The URL or address of the network server.
|
|
1766
|
+
- name (string): The name of the device connector.
|
|
1767
|
+
- connector_type (string): The type of the connector (e.g., mqtt, http).
|
|
1768
|
+
- status? (string): Optional status of the connector.
|
|
1769
|
+
- deviceHttpConfig? (DeviceHttpConfig): Optional HTTP-specific configuration:
|
|
1770
|
+
- api_token (string): Token used to authenticate HTTP requests.
|
|
1771
|
+
- address_url (string): Base URL of the HTTP endpoint.
|
|
1772
|
+
- deviceMqttConfig? (DeviceMqttConfig): Optional MQTT-specific configuration:
|
|
1773
|
+
- mqtt_broker (string): Address of the MQTT broker.
|
|
1774
|
+
- username (string): Username for broker authentication.
|
|
1775
|
+
- password (string): Password for broker authentication.
|
|
1776
|
+
- options (Core.RequestOptions): Additional request options.
|
|
1777
|
+
|
|
1778
|
+
**Returns:** Promise `<void>`
|
|
1779
|
+
|
|
1780
|
+
**Example:**
|
|
1781
|
+
|
|
1782
|
+
```typescript
|
|
1783
|
+
await client.deviceConnector.testConnectionPreview({
|
|
1784
|
+
network_server: 'poue4567-e89...',
|
|
1785
|
+
name: 'MQTT Connector Preview',
|
|
1786
|
+
connector_type: 'mqtt_broker',
|
|
1787
|
+
deviceMqttConfig: {
|
|
1788
|
+
mqtt_broker: 'mqtt://broker.example.com',
|
|
1789
|
+
username: 'testuser',
|
|
1790
|
+
password: 'testpass',
|
|
1791
|
+
},
|
|
1792
|
+
});
|
|
1793
|
+
|
|
1794
|
+
await client.deviceConnector.testConnectionPreview({
|
|
1795
|
+
network_server: 'poue4567-e89...',
|
|
1796
|
+
name: 'HTTP Connector Preview',
|
|
1797
|
+
connector_type: 'http_server',
|
|
1798
|
+
deviceHttpConfig: {
|
|
1799
|
+
api_token: 'test_api_token',
|
|
1800
|
+
address_url: 'http://api.example.com/data',
|
|
1801
|
+
},
|
|
1802
|
+
});
|
|
1803
|
+
```
|
|
1804
|
+
|
|
1805
|
+
</details>
|
|
1806
|
+
|
|
1807
|
+
<details>
|
|
1808
|
+
<summary><strong>testConnection</strong></summary>
|
|
1809
|
+
|
|
1810
|
+
Test an existing device connector by ID.
|
|
1811
|
+
|
|
1812
|
+
**Signature:**
|
|
1813
|
+
|
|
1814
|
+
```typescript
|
|
1815
|
+
testConnection(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1816
|
+
```
|
|
1817
|
+
|
|
1818
|
+
**Parameters:**
|
|
1819
|
+
|
|
1820
|
+
- `id` (string): A UUID string identifying the device connector to test.
|
|
1821
|
+
- `options`? (Core.RequestOptions): Additional request options such as custom headers.
|
|
1822
|
+
|
|
1823
|
+
**Returns:** `Promise <void>`
|
|
1824
|
+
|
|
1825
|
+
**Example:**
|
|
1826
|
+
|
|
1827
|
+
```typescript
|
|
1828
|
+
await client.deviceConnector.testConnection('123e4567-e89b-12d3-a456-426614174000');
|
|
1829
|
+
```
|
|
1830
|
+
|
|
1831
|
+
</details>
|
|
1832
|
+
|
|
1833
|
+
---
|
|
1834
|
+
|
|
1835
|
+
# DeviceModel
|
|
1836
|
+
|
|
1837
|
+
## Overview
|
|
1838
|
+
|
|
1839
|
+
The `DeviceModel` class provides methods for retrieving and listing device model. Below are the details for each method, including parameters, return types, and example usage.
|
|
1840
|
+
|
|
1841
|
+
## Methods
|
|
1842
|
+
|
|
1843
|
+
<details>
|
|
1844
|
+
<summary><strong>create</strong></summary>
|
|
1845
|
+
|
|
1846
|
+
Create a new device model.
|
|
1847
|
+
|
|
1848
|
+
**Signature:**
|
|
1849
|
+
|
|
1850
|
+
```typescript
|
|
1851
|
+
create(params: DeviceModelParams, options?: Core.RequestOptions): Core.APIPromise<DeviceModelParams>
|
|
1852
|
+
```
|
|
1853
|
+
|
|
1854
|
+
**Parameters:**
|
|
1855
|
+
|
|
1856
|
+
- params (DeviceModelParams): Parameters for creating a device model:
|
|
1857
|
+
- name (string): The name of the device model.
|
|
1858
|
+
- alias (string): The alias of the device model.
|
|
1859
|
+
- image_url (string): The image URL of the device model.
|
|
1860
|
+
- default_config (object): The default configuration object.
|
|
1861
|
+
- manufacture (string): The manufacturer of the device model.
|
|
1862
|
+
- options (Core.RequestOptions): Additional request options.
|
|
1863
|
+
|
|
1864
|
+
**Returns:** Promise<DeviceModelParams>
|
|
1865
|
+
|
|
1866
|
+
**Example:**
|
|
1867
|
+
|
|
1868
|
+
```typescript
|
|
1869
|
+
const newDeviceModel = await client.deviceModel.create({
|
|
1870
|
+
name: 'Model X',
|
|
1871
|
+
alias: 'model_x',
|
|
1872
|
+
image_url: 'http://example.com/image.png',
|
|
1873
|
+
default_config: {},
|
|
1874
|
+
manufacture: '123e4567-e89...',
|
|
1875
|
+
});
|
|
1876
|
+
```
|
|
1877
|
+
|
|
1878
|
+
</details>
|
|
1879
|
+
|
|
1880
|
+
<details>
|
|
1881
|
+
<summary><strong>retrieve</strong></summary>
|
|
1882
|
+
|
|
1883
|
+
Retrieve a device model by its ID.
|
|
1884
|
+
|
|
1885
|
+
**Signature:**
|
|
1886
|
+
|
|
1887
|
+
```typescript
|
|
1888
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<DeviceModelParams>
|
|
1889
|
+
```
|
|
1890
|
+
|
|
1891
|
+
**Parameters:**
|
|
1892
|
+
|
|
1893
|
+
- `id` (string): The unique identifier of the device model to retrieve.
|
|
1894
|
+
- `options` (Core.RequestOptions): Additional request options.
|
|
1895
|
+
|
|
1896
|
+
**Returns:** `Promise<DeviceModelParams>`
|
|
1897
|
+
|
|
1898
|
+
**Example:**
|
|
1899
|
+
|
|
1900
|
+
```typescript
|
|
1901
|
+
const deviceModel = await client.deviceModel.retrieve('123e4567-e89b-12d3-a456-426614174000');
|
|
1902
|
+
console.log(deviceModel.name);
|
|
1903
|
+
```
|
|
1904
|
+
|
|
1905
|
+
</details>
|
|
1906
|
+
|
|
1907
|
+
<details>
|
|
1908
|
+
<summary><strong>update</strong></summary>
|
|
1909
|
+
|
|
1910
|
+
Update an existing device model by its ID.
|
|
1911
|
+
|
|
1912
|
+
**Signature:**
|
|
1913
|
+
|
|
1914
|
+
```typescript
|
|
1915
|
+
update(id: string, params: DeviceModelParams, options?: Core.RequestOptions): Core.APIPromise<DeviceModelParams>
|
|
1916
|
+
```
|
|
1917
|
+
|
|
1918
|
+
**Parameters:**
|
|
1919
|
+
|
|
1920
|
+
- `id` (string): The unique identifier of the device model to update.
|
|
1921
|
+
- `params` (DeviceModelParams): The data to update the device model with:
|
|
1922
|
+
- `name` (string): The name of the device model.
|
|
1923
|
+
- `alias` (string): The alias of the device model.
|
|
1924
|
+
- `image_url` (string): The image URL of the device model.
|
|
1925
|
+
- `default_config` (object): The default configuration object.
|
|
1926
|
+
- `manufacture` (string): The manufacturer of the device model.
|
|
1927
|
+
- `options` (Core.RequestOptions): Additional request options.
|
|
1928
|
+
|
|
1929
|
+
**Returns:** `Promise<DeviceModelParams>`
|
|
1930
|
+
|
|
1931
|
+
**Example:**
|
|
1932
|
+
|
|
1933
|
+
```typescript
|
|
1934
|
+
const updatedDeviceModel = await client.deviceModel.update('123e4567-e89b-12d3-a456-426614174000', {
|
|
1935
|
+
name: 'Model Y',
|
|
1936
|
+
alias: 'model_y',
|
|
1937
|
+
image_url: 'http://example.com/image2.png',
|
|
1938
|
+
default_config: { setting: true },
|
|
1939
|
+
manufacture: '123e4567-e89...',
|
|
1940
|
+
});
|
|
1941
|
+
console.log(updatedDeviceModel);
|
|
1942
|
+
```
|
|
1943
|
+
|
|
1944
|
+
</details>
|
|
1945
|
+
|
|
1946
|
+
<details>
|
|
1947
|
+
<summary><strong>list</strong></summary>
|
|
1948
|
+
|
|
1949
|
+
Retrieve a list of device models with optional filters.
|
|
1950
|
+
|
|
1951
|
+
**Signature:**
|
|
1952
|
+
|
|
1953
|
+
```typescript
|
|
1954
|
+
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<DeviceModelListResponse>
|
|
1955
|
+
```
|
|
1956
|
+
|
|
1957
|
+
**Parameters:**
|
|
1958
|
+
|
|
1959
|
+
- `params` (ListParamsResponse): Query parameters to filter and paginate the results:
|
|
1960
|
+
- `ordering` (string, optional): Which field to use when ordering the results.
|
|
1961
|
+
- `search` (string, optional): A search term.
|
|
1962
|
+
- `limit` (integer, optional): Number of results to return per page.
|
|
1963
|
+
- `offset` (integer, optional): The initial index from which to return the results.
|
|
1964
|
+
- `options` (Core.RequestOptions): Additional request options.
|
|
1965
|
+
|
|
1966
|
+
**Returns:** `Promise<DeviceModelListResponse>`
|
|
1967
|
+
|
|
1968
|
+
**Example:**
|
|
1969
|
+
|
|
1970
|
+
```typescript
|
|
1971
|
+
const deviceModels = await client.deviceModel.list({
|
|
1972
|
+
ordering: 'name',
|
|
1973
|
+
search: 'model',
|
|
1974
|
+
limit: 10,
|
|
1975
|
+
offset: 0,
|
|
1976
|
+
});
|
|
1977
|
+
console.log(deviceModels.results);
|
|
1978
|
+
```
|
|
1979
|
+
|
|
1980
|
+
</details>
|
|
1981
|
+
|
|
1982
|
+
<details>
|
|
1983
|
+
<summary><strong>delete</strong></summary>
|
|
1984
|
+
|
|
1985
|
+
Delete a device models by its ID.
|
|
1986
|
+
|
|
1987
|
+
**Signature:**
|
|
1988
|
+
|
|
1989
|
+
```typescript
|
|
1990
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1991
|
+
```
|
|
1992
|
+
|
|
1993
|
+
**Parameters:**
|
|
1994
|
+
|
|
1995
|
+
- `id` _(string)_: A UUID string identifying this device models.
|
|
1996
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
1997
|
+
|
|
1998
|
+
**Returns:** `Promise<void>`
|
|
1999
|
+
|
|
2000
|
+
**Example:**
|
|
2001
|
+
|
|
2002
|
+
```typescript
|
|
2003
|
+
await client.deviceModel.delete('a557d013-f6...');
|
|
2004
|
+
```
|
|
2005
|
+
|
|
2006
|
+
</details>
|
|
2007
|
+
|
|
2008
|
+
---
|
|
2009
|
+
|
|
2010
|
+
# Device
|
|
2011
|
+
|
|
2012
|
+
## Overview
|
|
2013
|
+
|
|
2014
|
+
The `Device` class provides methods for retrieving and listing device. Below are the details for each method, including parameters, return types, and example usage.
|
|
2015
|
+
|
|
2016
|
+
## Methods
|
|
2017
|
+
|
|
2018
|
+
<details>
|
|
2019
|
+
<summary><strong>create</strong></summary>
|
|
2020
|
+
|
|
2021
|
+
Create a new device.
|
|
2022
|
+
|
|
2023
|
+
**Signature:**
|
|
2024
|
+
|
|
2025
|
+
```typescript
|
|
2026
|
+
create(params: DeviceParams, options?: Core.RequestOptions): Core.APIPromise<DeviceParams>
|
|
2027
|
+
```
|
|
2028
|
+
|
|
2029
|
+
**Parameters:**
|
|
2030
|
+
|
|
2031
|
+
- `params` _(DeviceParams)_: Parameters for creating a device:
|
|
2032
|
+
- `status` _(string, optional)_: The status of the device.
|
|
2033
|
+
- `device_connector` _(string)_: The connector type or identifier for the device.
|
|
2034
|
+
- `device_model` _(string)_: The model identifier of the device.
|
|
2035
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2036
|
+
|
|
2037
|
+
**Returns:** `Promise<DeviceParams>`
|
|
2038
|
+
|
|
2039
|
+
**Example:**
|
|
2040
|
+
|
|
2041
|
+
```typescript
|
|
2042
|
+
const newDevice = await client.devices.create({
|
|
2043
|
+
status: 'active',
|
|
2044
|
+
device_connector: '123e4567-e89...',
|
|
2045
|
+
device_model: 'poye4567-e89...',
|
|
2046
|
+
});
|
|
2047
|
+
```
|
|
2048
|
+
|
|
2049
|
+
</details>
|
|
2050
|
+
|
|
2051
|
+
<details>
|
|
2052
|
+
<summary><strong>retrieve</strong></summary>
|
|
2053
|
+
|
|
2054
|
+
Retrieve details of a device by its ID.
|
|
2055
|
+
|
|
2056
|
+
**Signature:**
|
|
2057
|
+
|
|
2058
|
+
```typescript
|
|
2059
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<DeviceParams>
|
|
2060
|
+
```
|
|
2061
|
+
|
|
2062
|
+
**Parameters:**
|
|
2063
|
+
|
|
2064
|
+
- `id` _(string)_: The unique identifier of the device to retrieve.
|
|
2065
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2066
|
+
|
|
2067
|
+
**Returns:** `Promise<DeviceParams>`
|
|
2068
|
+
|
|
2069
|
+
**Example:**
|
|
2070
|
+
|
|
2071
|
+
```typescript
|
|
2072
|
+
const device = await client.devices.retrieve('1l3e4567-e89...');
|
|
2073
|
+
console.log(device.device_model);
|
|
2074
|
+
```
|
|
2075
|
+
|
|
2076
|
+
</details>
|
|
2077
|
+
|
|
2078
|
+
<details>
|
|
2079
|
+
<summary><strong>update</strong></summary>
|
|
2080
|
+
|
|
2081
|
+
Update an existing device by its ID.
|
|
2082
|
+
|
|
2083
|
+
**Signature:**
|
|
2084
|
+
|
|
2085
|
+
```typescript
|
|
2086
|
+
update(id: string, params: DeviceParams, options?: Core.RequestOptions): Core.APIPromise<DeviceParams>
|
|
2087
|
+
```
|
|
2088
|
+
|
|
2089
|
+
**Parameters:**
|
|
2090
|
+
|
|
2091
|
+
- `id` _(string)_: The unique identifier of the device to update.
|
|
2092
|
+
- `params` _(DeviceParams)_: Parameters to update the device with:
|
|
2093
|
+
- `status` _(string, optional)_: The status of the device.
|
|
2094
|
+
- `device_connector` _(string)_: The connector type or identifier for the device.
|
|
2095
|
+
- `device_model` _(string)_: The model identifier of the device.
|
|
2096
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2097
|
+
|
|
2098
|
+
**Returns:** `Promise<DeviceParams>`
|
|
2099
|
+
|
|
2100
|
+
**Example:**
|
|
2101
|
+
|
|
2102
|
+
```typescript
|
|
2103
|
+
const updatedDevice = await client.devices.update('device-id-123', {
|
|
2104
|
+
status: 'active',
|
|
2105
|
+
device_connector: '123e4567-e89...',
|
|
2106
|
+
device_model: 'ks3e4567-e89...',
|
|
2107
|
+
});
|
|
2108
|
+
```
|
|
2109
|
+
|
|
2110
|
+
</details>
|
|
2111
|
+
|
|
2112
|
+
<details>
|
|
2113
|
+
<summary><strong>list</strong></summary>
|
|
2114
|
+
|
|
2115
|
+
List devices with optional pagination.
|
|
2116
|
+
|
|
2117
|
+
**Signature:**
|
|
2118
|
+
|
|
2119
|
+
```typescript
|
|
2120
|
+
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<DeviceListResponse>
|
|
2121
|
+
```
|
|
2122
|
+
|
|
2123
|
+
**Parameters:**
|
|
2124
|
+
|
|
2125
|
+
- `params` _(ListParamsResponse)_: Query parameters for listing devices:
|
|
2126
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
2127
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
2128
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2129
|
+
|
|
2130
|
+
**Returns:** `Promise<DeviceListResponse>`
|
|
2131
|
+
|
|
2132
|
+
**Example:**
|
|
2133
|
+
|
|
2134
|
+
```typescript
|
|
2135
|
+
const devices = await client.devices.list({ limit: 10, offset: 0 });
|
|
2136
|
+
console.log(devices.results);
|
|
2137
|
+
```
|
|
2138
|
+
|
|
2139
|
+
</details>
|
|
2140
|
+
|
|
2141
|
+
<details>
|
|
2142
|
+
<summary><strong>delete</strong></summary>
|
|
2143
|
+
|
|
2144
|
+
Delete a device by its ID.
|
|
2145
|
+
|
|
2146
|
+
**Signature:**
|
|
2147
|
+
|
|
2148
|
+
```typescript
|
|
2149
|
+
delete(id: number, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2150
|
+
```
|
|
2151
|
+
|
|
2152
|
+
**Parameters:**
|
|
2153
|
+
|
|
2154
|
+
- `id` _(number)_: The unique identifier of the device to delete.
|
|
2155
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2156
|
+
|
|
2157
|
+
**Returns:** `Promise<void>`
|
|
2158
|
+
|
|
2159
|
+
**Example:**
|
|
2160
|
+
|
|
2161
|
+
```typescript
|
|
2162
|
+
await client.devices.delete('123e4567-e89...');
|
|
2163
|
+
console.log('Device deleted successfully.');
|
|
2164
|
+
```
|
|
2165
|
+
|
|
2166
|
+
</details>
|
|
2167
|
+
|
|
2168
|
+
<details>
|
|
2169
|
+
<summary><strong>check claim code</strong></summary>
|
|
2170
|
+
|
|
2171
|
+
Check the device by claim code
|
|
2172
|
+
|
|
2173
|
+
**Signature:**
|
|
2174
|
+
|
|
2175
|
+
```typescript
|
|
2176
|
+
checkClaimCode(claim_code: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2177
|
+
```
|
|
2178
|
+
|
|
2179
|
+
**Parameters:**
|
|
2180
|
+
|
|
2181
|
+
- `claim_code` _(string)_: The unique code of the device.
|
|
2182
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2183
|
+
|
|
2184
|
+
**Returns:** `Promise<void>`
|
|
2185
|
+
|
|
2186
|
+
**Example:**
|
|
2187
|
+
|
|
2188
|
+
```typescript
|
|
2189
|
+
await client.devices.checkClaimCode('123e4567-e89...');
|
|
2190
|
+
```
|
|
2191
|
+
|
|
2192
|
+
</details>
|
|
2193
|
+
|
|
2194
|
+
---
|
|
2195
|
+
|
|
2196
|
+
# Manufacturers
|
|
2197
|
+
|
|
2198
|
+
## Overview
|
|
2199
|
+
|
|
2200
|
+
The `Manufacturers` class provides methods for retrieving and listing manufacturers of device. Below are the details for each method, including parameters, return types, and example usage.
|
|
2201
|
+
|
|
2202
|
+
## Methods
|
|
2203
|
+
|
|
2204
|
+
<details>
|
|
2205
|
+
<summary><strong>create</strong></summary>
|
|
2206
|
+
|
|
2207
|
+
Create a new manufacturer.
|
|
2208
|
+
|
|
2209
|
+
**Signature:**
|
|
2210
|
+
|
|
2211
|
+
```typescript
|
|
2212
|
+
create(params: ManufacturersParams, options?: Core.RequestOptions): Core.APIPromise<ManufacturersParams>
|
|
2213
|
+
```
|
|
2214
|
+
|
|
2215
|
+
**Parameters:**
|
|
2216
|
+
|
|
2217
|
+
- `params` _(ManufacturersParams)_: Parameters for creating a manufacturer:
|
|
2218
|
+
- `name` _(string)_: The name of the manufacturer.
|
|
2219
|
+
- `location` _(string)_: The location of the manufacturer.
|
|
2220
|
+
- `description` _(string)_: A description of the manufacturer.
|
|
2221
|
+
- `portal_url` _(string)_: The portal URL information of the manufacturer.
|
|
2222
|
+
- `national` _(string)_: The nationality or country of the manufacturer.
|
|
2223
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2224
|
+
|
|
2225
|
+
**Returns:** `Promise<ManufacturersParams>`
|
|
2226
|
+
|
|
2227
|
+
**Example:**
|
|
2228
|
+
|
|
2229
|
+
````typescript
|
|
2230
|
+
const newManufacturer = await client.manufacturers.create({
|
|
2231
|
+
name: 'Acme Corp',
|
|
2232
|
+
location: 'USA',
|
|
2233
|
+
description: 'Leading manufacturer of widgets',
|
|
2234
|
+
portal_url: 'https://acme.example.com',
|
|
2235
|
+
national: 'US',
|
|
2236
|
+
});
|
|
2237
|
+
```
|
|
2238
|
+
</details>
|
|
2239
|
+
|
|
2240
|
+
<details>
|
|
2241
|
+
<summary><strong>retrieve</strong></summary>
|
|
2242
|
+
|
|
2243
|
+
Retrieve details of a manufacturer by its ID.
|
|
2244
|
+
|
|
2245
|
+
**Signature:**
|
|
2246
|
+
```typescript
|
|
2247
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<ManufacturersParams>
|
|
2248
|
+
````
|
|
2249
|
+
|
|
2250
|
+
**Parameters:**
|
|
2251
|
+
|
|
2252
|
+
- `id` _(string)_: The unique identifier of the manufacturer to retrieve.
|
|
2253
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2254
|
+
|
|
2255
|
+
**Returns:** `Promise<ManufacturersParams>`
|
|
2256
|
+
|
|
2257
|
+
**Example:**
|
|
2258
|
+
|
|
2259
|
+
```typescript
|
|
2260
|
+
const manufacturer = await client.manufacturers.retrieve('123e4567-e89...');
|
|
2261
|
+
console.log(manufacturer.name);
|
|
2262
|
+
```
|
|
2263
|
+
|
|
2264
|
+
</details>
|
|
2265
|
+
|
|
2266
|
+
<details>
|
|
2267
|
+
<summary><strong>update</strong></summary>
|
|
2268
|
+
|
|
2269
|
+
Update an existing manufacturer by its ID.
|
|
2270
|
+
|
|
2271
|
+
**Signature:**
|
|
2272
|
+
|
|
2273
|
+
```typescript
|
|
2274
|
+
update(id: string, params: ManufacturersParams, options?: Core.RequestOptions): Core.APIPromise<ManufacturersParams>
|
|
2275
|
+
```
|
|
2276
|
+
|
|
2277
|
+
**Parameters:**
|
|
2278
|
+
|
|
2279
|
+
- `id` _(string)_: The unique identifier of the manufacturer to update.
|
|
2280
|
+
- `params` _(ManufacturersParams)_: Parameters for updating the manufacturer:
|
|
2281
|
+
- `name` _(string)_: The name of the manufacturer.
|
|
2282
|
+
- `location` _(string)_: The location of the manufacturer.
|
|
2283
|
+
- `description` _(string)_: A description of the manufacturer.
|
|
2284
|
+
- `portal_url` _(string)_: The portal URL information of the manufacturer.
|
|
2285
|
+
- `national` _(string)_: The nationality or country of the manufacturer.
|
|
2286
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2287
|
+
|
|
2288
|
+
**Returns:** `Promise<ManufacturersParams>`
|
|
2289
|
+
|
|
2290
|
+
**Example:**
|
|
2291
|
+
|
|
2292
|
+
```typescript
|
|
2293
|
+
const updatedManufacturer = await client.manufacturers.update('123e4567-e89...', {
|
|
2294
|
+
name: 'Acme Corp Updated',
|
|
2295
|
+
location: 'USA',
|
|
2296
|
+
description: 'Updated description',
|
|
2297
|
+
portal_url: 'https://acme.example.com',
|
|
2298
|
+
national: 'US',
|
|
2299
|
+
});
|
|
2300
|
+
```
|
|
2301
|
+
|
|
2302
|
+
</details>
|
|
2303
|
+
|
|
2304
|
+
<details>
|
|
2305
|
+
<summary><strong>list</strong></summary>
|
|
2306
|
+
|
|
2307
|
+
List manufacturers with optional filtering, ordering, and pagination.
|
|
2308
|
+
|
|
2309
|
+
**Signature:**
|
|
2310
|
+
|
|
2311
|
+
```typescript
|
|
2312
|
+
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<ManufacturersListResponse>
|
|
2313
|
+
```
|
|
2314
|
+
|
|
2315
|
+
**Parameters:**
|
|
2316
|
+
|
|
2317
|
+
- `params` _(ListParamsResponse)_: Query parameters for filtering, ordering, and pagination:
|
|
2318
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
2319
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
2320
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
2321
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
2322
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2323
|
+
|
|
2324
|
+
**Returns:** `Promise<ManufacturersListResponse>`
|
|
2325
|
+
|
|
2326
|
+
**Response shape:**
|
|
2327
|
+
|
|
2328
|
+
- `count` _(integer)_: Total number of manufacturers matching the query.
|
|
2329
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
2330
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
2331
|
+
- `results` _(ManufacturersParams[])_: Array of manufacturer objects.
|
|
2332
|
+
|
|
2333
|
+
**Example:**
|
|
2334
|
+
|
|
2335
|
+
```typescript
|
|
2336
|
+
const listResponse = await client.manufacturers.list({
|
|
2337
|
+
ordering: 'name',
|
|
2338
|
+
search: 'acme',
|
|
2339
|
+
limit: 10,
|
|
2340
|
+
offset: 0,
|
|
2341
|
+
});
|
|
2342
|
+
console.log(listResponse.results);
|
|
2343
|
+
```
|
|
2344
|
+
|
|
2345
|
+
</details>
|
|
2346
|
+
|
|
2347
|
+
<details>
|
|
2348
|
+
<summary><strong>delete</strong></summary>
|
|
2349
|
+
|
|
2350
|
+
Delete a manufacturer by its ID.
|
|
2351
|
+
|
|
2352
|
+
**Signature:**
|
|
2353
|
+
|
|
2354
|
+
```typescript
|
|
2355
|
+
delete(id: number, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2356
|
+
```
|
|
2357
|
+
|
|
2358
|
+
**Parameters:**
|
|
2359
|
+
|
|
2360
|
+
- `id` _(number)_: A UUID string identifying this manufacturer. (Note: Type is `number` in code but described as UUID string)
|
|
2361
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2362
|
+
|
|
2363
|
+
**Returns:** `Promise<void>` (No content on success)
|
|
2364
|
+
|
|
2365
|
+
**Example:**
|
|
2366
|
+
|
|
2367
|
+
```typescript
|
|
2368
|
+
await client.manufacturers.delete('123e4567-e89...');
|
|
2369
|
+
```
|
|
2370
|
+
|
|
2371
|
+
</details>
|
|
2372
|
+
|
|
2373
|
+
---
|
|
2374
|
+
|
|
2375
|
+
# NetworkServer
|
|
2376
|
+
|
|
2377
|
+
## Overview
|
|
2378
|
+
|
|
2379
|
+
The `NetworkServer` class provides methods for retrieving and listing network server. Below are the details for each method, including parameters, return types, and example usage.
|
|
2380
|
+
|
|
2381
|
+
## Methods
|
|
2382
|
+
|
|
2383
|
+
<details>
|
|
2384
|
+
<summary><strong>create</strong></summary>
|
|
2385
|
+
|
|
2386
|
+
Create a new network server.
|
|
2387
|
+
|
|
2388
|
+
**Signature:**
|
|
2389
|
+
|
|
2390
|
+
```typescript
|
|
2391
|
+
reate(params: NetworkServerParams, options?: Core.RequestOptions): Core.APIPromise<NetworkServerParams>
|
|
2392
|
+
```
|
|
2393
|
+
|
|
2394
|
+
**Parameters:**
|
|
2395
|
+
|
|
2396
|
+
- `params` _(NetworkServerParams)_: Parameters for creating a new network server.
|
|
2397
|
+
- `name`: _(string)_: The name of the network server.
|
|
2398
|
+
- `logo`: _(string)_: The logo of the network server.
|
|
2399
|
+
- `description`: _(string)_: The description of the network server.
|
|
2400
|
+
- `type_connect`: _(string[])_: An array of connection types supported by the network server.
|
|
2401
|
+
Possible values may include:
|
|
2402
|
+
- `"mqtt_broker"`: The server connects using MQTT protocol.
|
|
2403
|
+
- `"http_server"`: The server exposes HTTP endpoints.
|
|
2404
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2405
|
+
|
|
2406
|
+
**Returns:** `Promise<NetworkServerParams>`
|
|
2407
|
+
|
|
2408
|
+
**Example:**
|
|
2409
|
+
|
|
2410
|
+
```typescript
|
|
2411
|
+
const newNetworkServer = await client.networkServer.create({
|
|
2412
|
+
name: 'Chirpstack',
|
|
2413
|
+
logo: 'logo-url',
|
|
2414
|
+
description: 'example-description',
|
|
2415
|
+
type_connect: ['mqtt_broker', 'http_server'],
|
|
2416
|
+
});
|
|
2417
|
+
```
|
|
2418
|
+
|
|
2419
|
+
</details>
|
|
2420
|
+
|
|
2421
|
+
<details>
|
|
2422
|
+
<summary><strong>retrieve</strong></summary>
|
|
2423
|
+
Retrieve details of a network server by its ID.
|
|
2424
|
+
|
|
2425
|
+
**Signature:**
|
|
2426
|
+
|
|
2427
|
+
```typescript
|
|
2428
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<NetworkServerParams>
|
|
2429
|
+
```
|
|
2430
|
+
|
|
2431
|
+
**Parameters:**
|
|
2432
|
+
|
|
2433
|
+
- `id` _(string)_: The unique identifier of the network server to retrieve.
|
|
2434
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2435
|
+
|
|
2436
|
+
**Returns:** `Promise<NetworkServerParams>`
|
|
2437
|
+
|
|
2438
|
+
**Example:**
|
|
2439
|
+
|
|
2440
|
+
```typescript
|
|
2441
|
+
const networkServer = await client.networkServer.retrieve('a557d013-f6...');
|
|
2442
|
+
console.log(networkServer.name);
|
|
2443
|
+
```
|
|
2444
|
+
|
|
2445
|
+
</details>
|
|
2446
|
+
|
|
2447
|
+
<details>
|
|
2448
|
+
<summary><strong>update</strong></summary>
|
|
2449
|
+
|
|
2450
|
+
Update an existing network server by its ID.
|
|
2451
|
+
|
|
2452
|
+
**Signature:**
|
|
2453
|
+
|
|
2454
|
+
```typescript
|
|
2455
|
+
update(id: string, params: NetworkServerParams, options?: Core.RequestOptions): Core.APIPromise<NetworkServerParams>
|
|
2456
|
+
```
|
|
2457
|
+
|
|
2458
|
+
**Parameters:**
|
|
2459
|
+
|
|
2460
|
+
- `id` _(string)_: The unique identifier of the network server to update.
|
|
2461
|
+
- `params` _(NetworkServerParams)_: Parameters for updating the network server.
|
|
2462
|
+
- `name`: _(string)_: The name of the network server.
|
|
2463
|
+
- `logo`: _(string)_: The logo of the network server.
|
|
2464
|
+
- `description`: _(string)_: The description of the network server.
|
|
2465
|
+
- `type_connect`: _(string[])_: An array of connection types supported by the network server. Possible values include:
|
|
2466
|
+
- `"mqtt_broker"`: The server connects using MQTT protocol.
|
|
2467
|
+
- `"http_server"`: The server exposes HTTP endpoints.
|
|
2468
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2469
|
+
|
|
2470
|
+
**Returns:** `Promise<NetworkServerParams>`
|
|
2471
|
+
|
|
2472
|
+
**Example:**
|
|
2473
|
+
|
|
2474
|
+
```typescript
|
|
2475
|
+
const updatedNetworkServer = await client.networkServer.update('a557d013-f6 ...', {
|
|
2476
|
+
name: 'Chirpstack Updated',
|
|
2477
|
+
logo: 'new-logo-url',
|
|
2478
|
+
description: 'updated-description',
|
|
2479
|
+
type_connect: ['mqtt_broker'],
|
|
2480
|
+
});
|
|
2481
|
+
```
|
|
2482
|
+
|
|
2483
|
+
</details>
|
|
2484
|
+
|
|
2485
|
+
<details>
|
|
2486
|
+
<summary><strong>list</strong></summary>
|
|
2487
|
+
|
|
2488
|
+
List network servers with optional filtering, ordering, and pagination.
|
|
2489
|
+
|
|
2490
|
+
**Signature:**
|
|
2491
|
+
|
|
2492
|
+
```typescript
|
|
2493
|
+
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<NetworkServerListResponse>
|
|
2494
|
+
```
|
|
2495
|
+
|
|
2496
|
+
**Parameters:**
|
|
2497
|
+
|
|
2498
|
+
- `params` _(ListParamsResponse)_: Query parameters for filtering, ordering, and pagination:
|
|
2499
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
2500
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
2501
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
2502
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
2503
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2504
|
+
|
|
2505
|
+
**Returns:** `Promise<NetworkServerListResponse>`
|
|
2506
|
+
|
|
2507
|
+
**Response shape:**
|
|
2508
|
+
|
|
2509
|
+
- `count` _(integer)_: Total number of network servers matching the query.
|
|
2510
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
2511
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
2512
|
+
- `results` _(NetworkServer[])_: Array of network server objects.
|
|
2513
|
+
|
|
2514
|
+
**Example:**
|
|
2515
|
+
|
|
2516
|
+
```typescript
|
|
2517
|
+
const listResponse = await client.networkServer.list({
|
|
2518
|
+
ordering: 'name',
|
|
2519
|
+
search: 'chirpstack',
|
|
2520
|
+
limit: 10,
|
|
2521
|
+
offset: 0,
|
|
2522
|
+
});
|
|
2523
|
+
console.log(listResponse.results);
|
|
2524
|
+
```
|
|
2525
|
+
|
|
2526
|
+
</details>
|
|
2527
|
+
|
|
2528
|
+
<details>
|
|
2529
|
+
<summary><strong>delete</strong></summary>
|
|
2530
|
+
|
|
2531
|
+
Delete a network server by its ID.
|
|
2532
|
+
|
|
2533
|
+
**Signature:**
|
|
2534
|
+
|
|
2535
|
+
```typescript
|
|
2536
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2537
|
+
```
|
|
2538
|
+
|
|
2539
|
+
**Parameters:**
|
|
2540
|
+
|
|
2541
|
+
- `id` _(string)_: A UUID string identifying this network server.
|
|
2542
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2543
|
+
|
|
2544
|
+
**Returns:** `Promise<void>`
|
|
2545
|
+
|
|
2546
|
+
**Example:**
|
|
2547
|
+
|
|
2548
|
+
```typescript
|
|
2549
|
+
await client.networkServer.delete('a557d013-f6...');
|
|
2550
|
+
```
|
|
2551
|
+
|
|
2552
|
+
</details>
|
|
2553
|
+
|
|
2554
|
+
---
|
|
2555
|
+
|
|
2556
|
+
# Widgets
|
|
2557
|
+
|
|
2558
|
+
## Overview
|
|
2559
|
+
|
|
2560
|
+
The `Widgets` class provides methods to manage dashboard widgets, including bulk updating widget configurations. This class allows you to update multiple widgets at once with their respective configurations.
|
|
2561
|
+
|
|
2562
|
+
## Methods
|
|
2563
|
+
|
|
2564
|
+
<details>
|
|
2565
|
+
<summary><strong>updateWidgets</strong></summary>
|
|
2566
|
+
|
|
2567
|
+
Updates multiple widgets with their configurations in a single bulk operation.
|
|
2568
|
+
|
|
2569
|
+
**Signature:**
|
|
2570
|
+
|
|
2571
|
+
```typescript
|
|
2572
|
+
updateWidgets(params: WidgetsUpdateParams[], options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2573
|
+
```
|
|
2574
|
+
|
|
2575
|
+
**Parameters:**
|
|
2576
|
+
|
|
2577
|
+
- `params` _(WidgetsUpdateParams[])_: Array of widget update parameters.
|
|
2578
|
+
- `id` _(string)_: The unique identifier of the widget to update.
|
|
2579
|
+
- `configuration` _(any)_: The configuration object for the widget.
|
|
2580
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2581
|
+
|
|
2582
|
+
**Returns:**
|
|
2583
|
+
|
|
2584
|
+
- `Core.APIPromise<void>`: A promise that resolves when the bulk update is complete.
|
|
2585
|
+
|
|
2586
|
+
**Example Usage:**
|
|
2587
|
+
|
|
2588
|
+
```typescript
|
|
2589
|
+
import { SpaceDFSDK } from 'spacedf-sdk-node';
|
|
2590
|
+
|
|
2591
|
+
const client = new SpaceDFSDK({
|
|
2592
|
+
APIKey: 'your-api-key',
|
|
2593
|
+
organization: 'your-org-id',
|
|
2594
|
+
});
|
|
2595
|
+
|
|
2596
|
+
// Update multiple widgets
|
|
2597
|
+
await client.widgets.updateWidgets([
|
|
2598
|
+
{
|
|
2599
|
+
id: 'widget-1',
|
|
2600
|
+
configuration: {
|
|
2601
|
+
title: 'Temperature Monitor',
|
|
2602
|
+
refreshInterval: 5000,
|
|
2603
|
+
chartType: 'line',
|
|
2604
|
+
},
|
|
2605
|
+
},
|
|
2606
|
+
{
|
|
2607
|
+
id: 'widget-2',
|
|
2608
|
+
configuration: {
|
|
2609
|
+
title: 'Device Status',
|
|
2610
|
+
showLegend: true,
|
|
2611
|
+
colorScheme: 'dark',
|
|
2612
|
+
},
|
|
2613
|
+
},
|
|
2614
|
+
]);
|
|
2615
|
+
```
|
|
2616
|
+
|
|
2617
|
+
**Error Handling:**
|
|
2618
|
+
|
|
2619
|
+
```typescript
|
|
2620
|
+
try {
|
|
2621
|
+
await client.widgets.updateWidgets(widgetUpdates);
|
|
2622
|
+
console.log('Widgets updated successfully');
|
|
2623
|
+
} catch (error) {
|
|
2624
|
+
if (error instanceof SpaceDFSDK.BadRequestError) {
|
|
2625
|
+
console.error('Invalid widget configuration:', error.message);
|
|
2626
|
+
} else if (error instanceof SpaceDFSDK.NotFoundError) {
|
|
2627
|
+
console.error('One or more widgets not found:', error.message);
|
|
2628
|
+
} else {
|
|
2629
|
+
console.error('Failed to update widgets:', error.message);
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
```
|
|
2633
|
+
|
|
2634
|
+
</details>
|
|
2635
|
+
|
|
2636
|
+
---
|
|
2637
|
+
|
|
2638
|
+
# Device Spaces
|
|
2639
|
+
|
|
2640
|
+
## Overview
|
|
2641
|
+
|
|
2642
|
+
The `DeviceSpaces` class provides methods for managing device spaces within an application. Device spaces allow for grouping and organizing devices within specific spaces. Below are the details for each method, including parameters, return types, and example usage.
|
|
2643
|
+
|
|
2644
|
+
## Methods
|
|
2645
|
+
|
|
2646
|
+
<details>
|
|
2647
|
+
<summary><strong>create</strong></summary>
|
|
2648
|
+
|
|
2649
|
+
Create a new device space.
|
|
2650
|
+
|
|
2651
|
+
**Signature:**
|
|
2652
|
+
|
|
2653
|
+
```typescript
|
|
2654
|
+
create(params: DeviceSpacesParams, options?: Core.RequestOptions): Core.APIPromise<DeviceSpacesParams>
|
|
2655
|
+
```
|
|
2656
|
+
|
|
2657
|
+
**Parameters:**
|
|
2658
|
+
|
|
2659
|
+
- `params` _(DeviceSpacesParams)_: Parameters for creating a new device space.
|
|
2660
|
+
- `name` _(string)_: The name of the device space.
|
|
2661
|
+
- `description` _(string)_: A description of the device space.
|
|
2662
|
+
- `dev_eui` _(string)_: A dev_eui of device space.
|
|
2663
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2664
|
+
|
|
2665
|
+
**Returns:** `Promise<DeviceSpacesParams>`
|
|
2666
|
+
|
|
2667
|
+
**Example:**
|
|
2668
|
+
|
|
2669
|
+
```typescript
|
|
2670
|
+
const newDeviceSpace = await client.deviceSpaces.create({
|
|
2671
|
+
name: 'Sensor Network A',
|
|
2672
|
+
description: 'Device space for temperature and humidity sensors',
|
|
2673
|
+
dev_eui: '8437687685476895',
|
|
2674
|
+
});
|
|
2675
|
+
```
|
|
2676
|
+
|
|
2677
|
+
</details>
|
|
2678
|
+
|
|
2679
|
+
<details>
|
|
2680
|
+
<summary><strong>list</strong></summary>
|
|
2681
|
+
|
|
2682
|
+
List device spaces with optional filtering, ordering, and pagination.
|
|
2683
|
+
|
|
2684
|
+
**Signature:**
|
|
2685
|
+
|
|
2686
|
+
```typescript
|
|
2687
|
+
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<DeviceSpacesListResponse>
|
|
2688
|
+
```
|
|
2689
|
+
|
|
2690
|
+
**Parameters:**
|
|
2691
|
+
|
|
2692
|
+
- `params` _(ListParamsResponse)_: Query parameters for filtering, ordering, and pagination:
|
|
2693
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
2694
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
2695
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
2696
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
2697
|
+
- `include_latest_checkpoint` _(boolean, optional)_: Include latest checkpoint
|
|
2698
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2699
|
+
|
|
2700
|
+
**Returns:** `Promise<DeviceSpacesListResponse>`
|
|
2701
|
+
|
|
2702
|
+
**Response shape:**
|
|
2703
|
+
|
|
2704
|
+
- `count` _(integer)_: Total number of device spaces matching the query.
|
|
2705
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
2706
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
2707
|
+
- `results` _(DeviceSpacesParams[])_: Array of device space objects.
|
|
2708
|
+
|
|
2709
|
+
**Example:**
|
|
2710
|
+
|
|
2711
|
+
```typescript
|
|
2712
|
+
const listResponse = await client.deviceSpaces.list(
|
|
2713
|
+
{
|
|
2714
|
+
ordering: 'name',
|
|
2715
|
+
search: 'sensor',
|
|
2716
|
+
limit: 10,
|
|
2717
|
+
offset: 0,
|
|
2718
|
+
},
|
|
2719
|
+
{
|
|
2720
|
+
'X-Space': 'space-slug-name',
|
|
2721
|
+
},
|
|
2722
|
+
);
|
|
2723
|
+
console.log(listResponse.results);
|
|
2724
|
+
```
|
|
2725
|
+
|
|
2726
|
+
</details>
|
|
2727
|
+
|
|
2728
|
+
<details>
|
|
2729
|
+
<summary><strong>delete</strong></summary>
|
|
2730
|
+
|
|
2731
|
+
Delete a device space by its ID.
|
|
2732
|
+
|
|
2733
|
+
**Signature:**
|
|
2734
|
+
|
|
2735
|
+
```typescript
|
|
2736
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2737
|
+
```
|
|
2738
|
+
|
|
2739
|
+
**Parameters:**
|
|
2740
|
+
|
|
2741
|
+
- `id` _(string)_: A UUID string identifying this device space.
|
|
2742
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2743
|
+
|
|
2744
|
+
**Returns:** `Promise<void>`
|
|
2745
|
+
|
|
2746
|
+
**Example:**
|
|
2747
|
+
|
|
2748
|
+
```typescript
|
|
2749
|
+
await client.deviceSpaces.delete('789e0123-e89b-12d3-a456-426614174002');
|
|
2750
|
+
```
|
|
2751
|
+
|
|
2752
|
+
</details>
|
|
2753
|
+
|
|
2754
|
+
---
|
|
2755
|
+
|
|
2756
|
+
# Trip
|
|
2757
|
+
|
|
2758
|
+
## Overview
|
|
2759
|
+
|
|
2760
|
+
The `Trip` class provides methods for managing device trips, including creating, retrieving, updating, listing, and deleting trip records. Trips represent journeys or data collection periods for devices. Below are the details for each method, including parameters, return types, and example usage.
|
|
2761
|
+
|
|
2762
|
+
## Types
|
|
2763
|
+
|
|
2764
|
+
### TripParams
|
|
2765
|
+
|
|
2766
|
+
```typescript
|
|
2767
|
+
interface TripParams {
|
|
2768
|
+
space_device: string; // The unique identifier of the device associated with this trip
|
|
2769
|
+
start_at: string; // The start timestamp of the trip (ISO 8601 format)
|
|
2770
|
+
ended_at: string; // The end timestamp of the trip (ISO 8601 format)
|
|
2771
|
+
}
|
|
2772
|
+
```
|
|
2773
|
+
|
|
2774
|
+
### TripListParams
|
|
2775
|
+
|
|
2776
|
+
```typescript
|
|
2777
|
+
interface TripListParams extends ListParamsResponse {
|
|
2778
|
+
include_checkpoints?: boolean; // Whether to include checkpoints in the response
|
|
2779
|
+
}
|
|
2780
|
+
```
|
|
2781
|
+
|
|
2782
|
+
This interface extends `ListParamsResponse` which includes:
|
|
2783
|
+
|
|
2784
|
+
- `limit?: number` - Number of results to return per page
|
|
2785
|
+
- `offset?: number` - The initial index from which to return the results
|
|
2786
|
+
- `ordering?: string` - Which field to use when ordering the results
|
|
2787
|
+
- `search?: string` - A search term to filter results
|
|
2788
|
+
|
|
2789
|
+
### TripListResponse
|
|
2790
|
+
|
|
2791
|
+
```typescript
|
|
2792
|
+
type TripListResponse = ListResponse<TripParams>;
|
|
2793
|
+
```
|
|
2794
|
+
|
|
2795
|
+
Where `ListResponse<T>` includes:
|
|
2796
|
+
|
|
2797
|
+
- `count: number` - Total number of trips matching the query
|
|
2798
|
+
- `results: TripParams[]` - Array of trip objects
|
|
2799
|
+
- `next?: string | null` - URL to the next page of results, or null
|
|
2800
|
+
- `previous?: string | null` - URL to the previous page of results, or null
|
|
2801
|
+
|
|
2802
|
+
<details>
|
|
2803
|
+
<summary><strong>create</strong></summary>
|
|
2804
|
+
|
|
2805
|
+
Create a new trip record.
|
|
2806
|
+
|
|
2807
|
+
**Signature:**
|
|
2808
|
+
|
|
2809
|
+
```typescript
|
|
2810
|
+
create(params: TripParams, options?: Core.RequestOptions): Core.APIPromise<TripParams>
|
|
2811
|
+
```
|
|
2812
|
+
|
|
2813
|
+
**Parameters:**
|
|
2814
|
+
|
|
2815
|
+
- `params` _(TripParams)_: Parameters for creating a new trip.
|
|
2816
|
+
- `space_device`: _(string)_: The unique identifier of the device associated with this trip.
|
|
2817
|
+
- `start_at`: _(string)_: The start timestamp of the trip (ISO 8601 format).
|
|
2818
|
+
- `ended_at`: _(string)_: The end timestamp of the trip (ISO 8601 format).
|
|
2819
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2820
|
+
|
|
2821
|
+
**Returns:** `Promise<TripParams>`
|
|
2822
|
+
|
|
2823
|
+
**Example:**
|
|
2824
|
+
|
|
2825
|
+
```typescript
|
|
2826
|
+
const newTrip = await client.trip.create({
|
|
2827
|
+
space_device: 'device-uuid-123',
|
|
2828
|
+
start_at: '2024-01-15T08:00:00Z',
|
|
2829
|
+
ended_at: '2024-01-15T18:30:00Z',
|
|
2830
|
+
});
|
|
2831
|
+
```
|
|
2832
|
+
|
|
2833
|
+
</details>
|
|
2834
|
+
|
|
2835
|
+
<details>
|
|
2836
|
+
<summary><strong>retrieve</strong></summary>
|
|
2837
|
+
|
|
2838
|
+
Retrieve details of a trip by its ID.
|
|
2839
|
+
|
|
2840
|
+
**Signature:**
|
|
2841
|
+
|
|
2842
|
+
```typescript
|
|
2843
|
+
retrieve(id: string, params: TripListParams, options?: Core.RequestOptions): Core.APIPromise<TripParams>
|
|
2844
|
+
```
|
|
2845
|
+
|
|
2846
|
+
**Parameters:**
|
|
2847
|
+
|
|
2848
|
+
- `id` _(string)_: The unique identifier of the trip to retrieve.
|
|
2849
|
+
- `params` _(TripListParams)_: Query parameters for the request.
|
|
2850
|
+
- `include_checkpoints` _(boolean, optional)_: Whether to include checkpoints in the response.
|
|
2851
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
2852
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
2853
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
2854
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
2855
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2856
|
+
|
|
2857
|
+
**Returns:** `Promise<TripParams>`
|
|
2858
|
+
|
|
2859
|
+
**Example:**
|
|
2860
|
+
|
|
2861
|
+
```typescript
|
|
2862
|
+
const trip = await client.trip.retrieve('trip-uuid-456', {
|
|
2863
|
+
include_checkpoints: true,
|
|
2864
|
+
});
|
|
2865
|
+
console.log(trip.space_device);
|
|
2866
|
+
```
|
|
2867
|
+
|
|
2868
|
+
</details>
|
|
2869
|
+
|
|
2870
|
+
<details>
|
|
2871
|
+
<summary><strong>list</strong></summary>
|
|
2872
|
+
|
|
2873
|
+
List trips with optional filtering, ordering, and pagination.
|
|
2874
|
+
|
|
2875
|
+
**Signature:**
|
|
2876
|
+
|
|
2877
|
+
```typescript
|
|
2878
|
+
list(params: TripListParams & { space_device__device_id: string }, options?: Core.RequestOptions): Core.APIPromise<TripListResponse>
|
|
2879
|
+
```
|
|
2880
|
+
|
|
2881
|
+
**Parameters:**
|
|
2882
|
+
|
|
2883
|
+
- `params` _(TripListParams & { space_device\_\_device_id: string })_: Query parameters for filtering, ordering, and pagination:
|
|
2884
|
+
- `space_device__device_id` _(string)_: **Required.** The device ID to filter trips by.
|
|
2885
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
2886
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
2887
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
2888
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
2889
|
+
- `include_checkpoints` _(boolean, optional)_: Whether to include checkpoints in the response.
|
|
2890
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2891
|
+
|
|
2892
|
+
**Returns:** `Promise<TripListResponse>`
|
|
2893
|
+
|
|
2894
|
+
**Response shape:**
|
|
2895
|
+
|
|
2896
|
+
- `count` _(integer)_: Total number of trips matching the query.
|
|
2897
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
2898
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
2899
|
+
- `results` _(TripParams[])_: Array of trip objects.
|
|
2900
|
+
|
|
2901
|
+
**Example:**
|
|
2902
|
+
|
|
2903
|
+
```typescript
|
|
2904
|
+
const listResponse = await client.trip.list({
|
|
2905
|
+
space_device__device_id: 'device-uuid-123',
|
|
2906
|
+
ordering: 'start_at',
|
|
2907
|
+
limit: 20,
|
|
2908
|
+
offset: 0,
|
|
2909
|
+
include_checkpoints: false,
|
|
2910
|
+
});
|
|
2911
|
+
console.log(listResponse.results);
|
|
2912
|
+
```
|
|
2913
|
+
|
|
2914
|
+
</details>
|
|
2915
|
+
|
|
2916
|
+
<details>
|
|
2917
|
+
<summary><strong>update</strong></summary>
|
|
2918
|
+
|
|
2919
|
+
Update an existing trip by its ID (full update).
|
|
2920
|
+
|
|
2921
|
+
**Signature:**
|
|
2922
|
+
|
|
2923
|
+
```typescript
|
|
2924
|
+
update(id: string, params: TripParams, options?: Core.RequestOptions): Core.APIPromise<TripParams>
|
|
2925
|
+
```
|
|
2926
|
+
|
|
2927
|
+
**Parameters:**
|
|
2928
|
+
|
|
2929
|
+
- `id` _(string)_: The unique identifier of the trip to update.
|
|
2930
|
+
- `params` _(TripParams)_: Parameters for updating the trip.
|
|
2931
|
+
- `space_device`: _(string)_: The unique identifier of the device associated with this trip.
|
|
2932
|
+
- `start_at`: _(string)_: The start timestamp of the trip (ISO 8601 format).
|
|
2933
|
+
- `ended_at`: _(string)_: The end timestamp of the trip (ISO 8601 format).
|
|
2934
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2935
|
+
|
|
2936
|
+
**Returns:** `Promise<TripParams>`
|
|
2937
|
+
|
|
2938
|
+
**Example:**
|
|
2939
|
+
|
|
2940
|
+
```typescript
|
|
2941
|
+
const updatedTrip = await client.trip.update('trip-uuid-456', {
|
|
2942
|
+
space_device: 'device-uuid-123',
|
|
2943
|
+
start_at: '2024-01-15T09:00:00Z',
|
|
2944
|
+
ended_at: '2024-01-15T19:00:00Z',
|
|
2945
|
+
});
|
|
2946
|
+
```
|
|
2947
|
+
|
|
2948
|
+
</details>
|
|
2949
|
+
|
|
2950
|
+
<details>
|
|
2951
|
+
<summary><strong>partialUpdate</strong></summary>
|
|
2952
|
+
|
|
2953
|
+
Partially update an existing trip by its ID.
|
|
2954
|
+
|
|
2955
|
+
**Signature:**
|
|
2956
|
+
|
|
2957
|
+
```typescript
|
|
2958
|
+
partialUpdate(id: string, params: Partial<TripParams>, options?: Core.RequestOptions): Core.APIPromise<TripParams>
|
|
2959
|
+
```
|
|
2960
|
+
|
|
2961
|
+
**Parameters:**
|
|
2962
|
+
|
|
2963
|
+
- `id` _(string)_: The unique identifier of the trip to update.
|
|
2964
|
+
- `params` _(Partial<TripParams>)_: Parameters for partially updating the trip. Only provided fields will be updated.
|
|
2965
|
+
- `space_device` _(string, optional)_: The unique identifier of the device associated with this trip.
|
|
2966
|
+
- `start_at` _(string, optional)_: The start timestamp of the trip (ISO 8601 format).
|
|
2967
|
+
- `ended_at` _(string, optional)_: The end timestamp of the trip (ISO 8601 format).
|
|
2968
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2969
|
+
|
|
2970
|
+
**Returns:** `Promise<TripParams>`
|
|
2971
|
+
|
|
2972
|
+
**Example:**
|
|
2973
|
+
|
|
2974
|
+
```typescript
|
|
2975
|
+
const partiallyUpdatedTrip = await client.trip.partialUpdate('trip-uuid-456', {
|
|
2976
|
+
ended_at: '2024-01-15T20:00:00Z',
|
|
2977
|
+
});
|
|
2978
|
+
```
|
|
2979
|
+
|
|
2980
|
+
</details>
|
|
2981
|
+
|
|
2982
|
+
<details>
|
|
2983
|
+
<summary><strong>delete</strong></summary>
|
|
2984
|
+
|
|
2985
|
+
Delete a trip by its ID.
|
|
2986
|
+
|
|
2987
|
+
**Signature:**
|
|
2988
|
+
|
|
2989
|
+
```typescript
|
|
2990
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2991
|
+
```
|
|
2992
|
+
|
|
2993
|
+
**Parameters:**
|
|
2994
|
+
|
|
2995
|
+
- `id` _(string)_: The unique identifier of the trip to delete.
|
|
2996
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2997
|
+
|
|
2998
|
+
**Returns:** `Promise<void>`
|
|
2999
|
+
|
|
3000
|
+
**Example:**
|
|
3001
|
+
|
|
3002
|
+
```typescript
|
|
3003
|
+
await client.trip.delete('trip-uuid-456');
|
|
3004
|
+
```
|
|
3005
|
+
|
|
3006
|
+
</details>
|
|
3007
|
+
|
|
3008
|
+
---
|
|
3009
|
+
|
|
3010
|
+
# Organizations
|
|
3011
|
+
|
|
3012
|
+
## Overview
|
|
3013
|
+
|
|
3014
|
+
The `Organizations` class provides methods for managing organizations within an application.
|
|
3015
|
+
|
|
3016
|
+
## Methods
|
|
3017
|
+
|
|
3018
|
+
<details>
|
|
3019
|
+
<summary><strong>checkSlugName</strong></summary>
|
|
3020
|
+
|
|
3021
|
+
Check organizations by slug name.
|
|
3022
|
+
|
|
3023
|
+
**Signature:**
|
|
3024
|
+
|
|
3025
|
+
```typescript
|
|
3026
|
+
checkSlugName(slugName: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
3027
|
+
```
|
|
3028
|
+
|
|
3029
|
+
**Parameters:**
|
|
3030
|
+
|
|
3031
|
+
- `slugName` _(string)_: A slug name string identifying this organization.
|
|
3032
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3033
|
+
|
|
3034
|
+
**Returns:** `Promise<void>`
|
|
3035
|
+
|
|
3036
|
+
**Example:**
|
|
3037
|
+
|
|
3038
|
+
```typescript
|
|
3039
|
+
await client.organizations.checkSlugName('danang');
|
|
3040
|
+
```
|
|
3041
|
+
|
|
3042
|
+
</details>
|