@space-df/sdk 0.0.1-dev.3.3 → 0.0.1-dev.30
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} +17 -3
- package/dist/index.js.map +1 -0
- package/{index.mjs → dist/index.mjs} +17 -3
- 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 +229 -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 +25 -2
- 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
|
@@ -4,43 +4,43 @@
|
|
|
4
4
|
export type Agent = any;
|
|
5
5
|
|
|
6
6
|
// @ts-ignore
|
|
7
|
-
declare const _fetch:
|
|
7
|
+
declare const _fetch: unknown extends typeof fetch ? never : typeof fetch;
|
|
8
8
|
export { _fetch as fetch };
|
|
9
9
|
|
|
10
10
|
// @ts-ignore
|
|
11
|
-
type _Request =
|
|
11
|
+
type _Request = unknown extends Request ? never : Request;
|
|
12
12
|
export { _Request as Request };
|
|
13
13
|
|
|
14
14
|
// @ts-ignore
|
|
15
|
-
type _RequestInfo =
|
|
15
|
+
type _RequestInfo = unknown extends RequestInfo ? never : RequestInfo;
|
|
16
16
|
export { type _RequestInfo as RequestInfo };
|
|
17
17
|
|
|
18
18
|
// @ts-ignore
|
|
19
|
-
type _RequestInit =
|
|
19
|
+
type _RequestInit = unknown extends RequestInit ? never : RequestInit;
|
|
20
20
|
export { type _RequestInit as RequestInit };
|
|
21
21
|
|
|
22
22
|
// @ts-ignore
|
|
23
|
-
type _Response =
|
|
23
|
+
type _Response = unknown extends Response ? never : Response;
|
|
24
24
|
export { _Response as Response };
|
|
25
25
|
|
|
26
26
|
// @ts-ignore
|
|
27
|
-
type _ResponseInit =
|
|
27
|
+
type _ResponseInit = unknown extends ResponseInit ? never : ResponseInit;
|
|
28
28
|
export { type _ResponseInit as ResponseInit };
|
|
29
29
|
|
|
30
30
|
// @ts-ignore
|
|
31
|
-
type _ResponseType =
|
|
31
|
+
type _ResponseType = unknown extends ResponseType ? never : ResponseType;
|
|
32
32
|
export { type _ResponseType as ResponseType };
|
|
33
33
|
|
|
34
34
|
// @ts-ignore
|
|
35
|
-
type _BodyInit =
|
|
35
|
+
type _BodyInit = unknown extends BodyInit ? never : BodyInit;
|
|
36
36
|
export { type _BodyInit as BodyInit };
|
|
37
37
|
|
|
38
38
|
// @ts-ignore
|
|
39
|
-
type _Headers =
|
|
39
|
+
type _Headers = unknown extends Headers ? never : Headers;
|
|
40
40
|
export { _Headers as Headers };
|
|
41
41
|
|
|
42
42
|
// @ts-ignore
|
|
43
|
-
type _HeadersInit =
|
|
43
|
+
type _HeadersInit = unknown extends HeadersInit ? never : HeadersInit;
|
|
44
44
|
export { type _HeadersInit as HeadersInit };
|
|
45
45
|
|
|
46
46
|
type EndingType = 'native' | 'transparent';
|
|
@@ -57,21 +57,21 @@ export interface FilePropertyBag extends BlobPropertyBag {
|
|
|
57
57
|
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
|
58
58
|
|
|
59
59
|
// @ts-ignore
|
|
60
|
-
type _FormData =
|
|
60
|
+
type _FormData = unknown extends FormData ? never : FormData;
|
|
61
61
|
// @ts-ignore
|
|
62
|
-
declare const _FormData:
|
|
62
|
+
declare const _FormData: unknown extends typeof FormData ? never : typeof FormData;
|
|
63
63
|
export { _FormData as FormData };
|
|
64
64
|
|
|
65
65
|
// @ts-ignore
|
|
66
|
-
type _File =
|
|
66
|
+
type _File = unknown extends File ? never : File;
|
|
67
67
|
// @ts-ignore
|
|
68
|
-
declare const _File:
|
|
68
|
+
declare const _File: unknown extends typeof File ? never : typeof File;
|
|
69
69
|
export { _File as File };
|
|
70
70
|
|
|
71
71
|
// @ts-ignore
|
|
72
|
-
type _Blob =
|
|
72
|
+
type _Blob = unknown extends Blob ? never : Blob;
|
|
73
73
|
// @ts-ignore
|
|
74
|
-
declare const _Blob:
|
|
74
|
+
declare const _Blob: unknown extends typeof Blob ? never : typeof Blob;
|
|
75
75
|
export { _Blob as Blob };
|
|
76
76
|
|
|
77
77
|
export declare class Readable {
|
|
@@ -95,7 +95,7 @@ export declare class FsReadStream extends Readable {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
// @ts-ignore
|
|
98
|
-
type _ReadableStream<R = any> =
|
|
98
|
+
type _ReadableStream<R = any> = unknown extends ReadableStream<R> ? never : ReadableStream<R>;
|
|
99
99
|
// @ts-ignore
|
|
100
|
-
declare const _ReadableStream:
|
|
100
|
+
declare const _ReadableStream: unknown extends typeof ReadableStream ? never : typeof ReadableStream;
|
|
101
101
|
export { _ReadableStream as ReadableStream };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { MultipartBody } from './MultipartBody';
|
|
2
|
+
import { type RequestOptions } from '../core';
|
|
3
|
+
|
|
4
|
+
export const kind: string = 'web';
|
|
5
|
+
|
|
6
|
+
export type Agent = any;
|
|
7
|
+
|
|
8
|
+
const _fetch = fetch;
|
|
9
|
+
type _fetch = typeof fetch;
|
|
10
|
+
export { _fetch as fetch };
|
|
11
|
+
|
|
12
|
+
const _Request = Request;
|
|
13
|
+
type _Request = Request;
|
|
14
|
+
export { _Request as Request };
|
|
15
|
+
|
|
16
|
+
type _RequestInfo = RequestInfo;
|
|
17
|
+
export { type _RequestInfo as RequestInfo };
|
|
18
|
+
|
|
19
|
+
type _RequestInit = RequestInit;
|
|
20
|
+
export { type _RequestInit as RequestInit };
|
|
21
|
+
|
|
22
|
+
const _Response = Response;
|
|
23
|
+
type _Response = Response;
|
|
24
|
+
export { _Response as Response };
|
|
25
|
+
|
|
26
|
+
type _ResponseInit = ResponseInit;
|
|
27
|
+
export { type _ResponseInit as ResponseInit };
|
|
28
|
+
|
|
29
|
+
type _ResponseType = ResponseType;
|
|
30
|
+
export { type _ResponseType as ResponseType };
|
|
31
|
+
|
|
32
|
+
type _BodyInit = BodyInit;
|
|
33
|
+
export { type _BodyInit as BodyInit };
|
|
34
|
+
|
|
35
|
+
const _Headers = Headers;
|
|
36
|
+
type _Headers = Headers;
|
|
37
|
+
export { _Headers as Headers };
|
|
38
|
+
|
|
39
|
+
type _HeadersInit = HeadersInit;
|
|
40
|
+
export { type _HeadersInit as HeadersInit };
|
|
41
|
+
|
|
42
|
+
type EndingType = 'native' | 'transparent';
|
|
43
|
+
|
|
44
|
+
export interface BlobPropertyBag {
|
|
45
|
+
endings?: EndingType;
|
|
46
|
+
type?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface FilePropertyBag extends BlobPropertyBag {
|
|
50
|
+
lastModified?: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
|
54
|
+
|
|
55
|
+
const _FormData = FormData;
|
|
56
|
+
type _FormData = FormData;
|
|
57
|
+
export { _FormData as FormData };
|
|
58
|
+
|
|
59
|
+
const _File = File;
|
|
60
|
+
type _File = File;
|
|
61
|
+
export { _File as File };
|
|
62
|
+
|
|
63
|
+
const _Blob = Blob;
|
|
64
|
+
type _Blob = Blob;
|
|
65
|
+
export { _Blob as Blob };
|
|
66
|
+
|
|
67
|
+
export async function getMultipartRequestOptions<T = Record<string, unknown>>(form: FormData, opts: RequestOptions<T>): Promise<RequestOptions<T>> {
|
|
68
|
+
return {
|
|
69
|
+
...opts,
|
|
70
|
+
body: new MultipartBody(form) as any,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function getDefaultAgent(url: string) {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
export function fileFromPath() {
|
|
78
|
+
throw new Error('The `fileFromPath` function is only supported in Node.');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const isFsReadStream = (value: any) => false;
|
|
82
|
+
|
|
83
|
+
export declare class Readable {
|
|
84
|
+
readable: boolean;
|
|
85
|
+
readonly readableEnded: boolean;
|
|
86
|
+
readonly readableFlowing: boolean | null;
|
|
87
|
+
readonly readableHighWaterMark: number;
|
|
88
|
+
readonly readableLength: number;
|
|
89
|
+
readonly readableObjectMode: boolean;
|
|
90
|
+
destroyed: boolean;
|
|
91
|
+
read(size?: number): any;
|
|
92
|
+
pause(): this;
|
|
93
|
+
resume(): this;
|
|
94
|
+
isPaused(): boolean;
|
|
95
|
+
destroy(error?: Error): this;
|
|
96
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<any>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export declare class FsReadStream extends Readable {
|
|
100
|
+
path: object; // node type is string | Buffer
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const _ReadableStream = ReadableStream;
|
|
104
|
+
type _ReadableStream = ReadableStream;
|
|
105
|
+
export { _ReadableStream as ReadableStream };
|
package/src/_shims/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
3
|
*/
|
|
4
4
|
import { manual } from './manual-types';
|
|
5
|
-
import * as auto from
|
|
5
|
+
import * as auto from '@space-df/sdk/_shims/auto/types';
|
|
6
6
|
import { type RequestOptions } from '../core';
|
|
7
7
|
|
|
8
8
|
type SelectType<Manual, Auto> = unknown extends Manual ? Auto : Manual;
|
package/src/_shims/index.mjs
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
3
|
*/
|
|
4
4
|
import * as shims from './registry.mjs';
|
|
5
|
-
import * as auto from
|
|
5
|
+
import * as auto from '@space-df/sdk/_shims/auto/runtime';
|
|
6
6
|
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
|
|
7
7
|
export * from './registry.mjs';
|
package/src/index.ts
CHANGED
|
@@ -74,6 +74,13 @@ export interface ClientOptions {
|
|
|
74
74
|
* @default false
|
|
75
75
|
*/
|
|
76
76
|
allowMultiOrgs?: boolean;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* By default, use the development environment.
|
|
80
|
+
*
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
development?: boolean;
|
|
77
84
|
}
|
|
78
85
|
|
|
79
86
|
/**
|
|
@@ -104,21 +111,26 @@ export class SpaceDFSDK extends Core.APIClient {
|
|
|
104
111
|
organization = Core.readEnv('SPACEDF_ORG_ID') ?? null,
|
|
105
112
|
APIKey = Core.readEnv('SPACEDF_API_KEY'),
|
|
106
113
|
allowMultiOrgs = false,
|
|
114
|
+
development = false,
|
|
107
115
|
...opts
|
|
108
116
|
}: ClientOptions = {}) {
|
|
117
|
+
// Determine base URL based on development flag
|
|
118
|
+
let finalBaseURL = development ? `https://api.myspacedf.net/api` : `https://api.myspacedf.com/api`;
|
|
119
|
+
|
|
109
120
|
if (!allowMultiOrgs) {
|
|
110
121
|
if (baseURL && organization)
|
|
111
122
|
throw new Errors.SpaceDFError('`baseURL` will be overridden by `organization`. You should only configure a single property.');
|
|
112
123
|
|
|
113
124
|
if (organization) {
|
|
114
|
-
|
|
125
|
+
finalBaseURL = development ? `https://${organization}.api.myspacedf.net/api` : (finalBaseURL = `https://${organization}.api.myspacedf.com/api`);
|
|
115
126
|
}
|
|
116
127
|
}
|
|
117
128
|
|
|
118
129
|
const options: ClientOptions = {
|
|
119
130
|
organization,
|
|
120
131
|
APIKey,
|
|
121
|
-
baseURL:
|
|
132
|
+
baseURL: finalBaseURL,
|
|
133
|
+
development,
|
|
122
134
|
...opts,
|
|
123
135
|
};
|
|
124
136
|
|
|
@@ -143,9 +155,20 @@ export class SpaceDFSDK extends Core.APIClient {
|
|
|
143
155
|
spaceRoles: API.SpaceRoles = new API.SpaceRoles(this);
|
|
144
156
|
spaces: API.Spaces = new API.Spaces(this);
|
|
145
157
|
dashboards: API.Dashboards = new API.Dashboards(this);
|
|
158
|
+
widgets: API.Widgets = new API.Widgets(this);
|
|
146
159
|
deviceStates: API.DeviceStates = new API.DeviceStates(this);
|
|
147
160
|
oauth2: API.OAuth2 = new API.OAuth2(this);
|
|
148
161
|
credentials: API.Credentials = new API.Credentials(this);
|
|
162
|
+
users: API.Users = new API.Users(this);
|
|
163
|
+
presignedUrl: API.PresignedUrl = new API.PresignedUrl(this);
|
|
164
|
+
deviceConnector: API.DeviceConnector = new API.DeviceConnector(this);
|
|
165
|
+
deviceModel: API.DeviceModel = new API.DeviceModel(this);
|
|
166
|
+
device: API.Device = new API.Device(this);
|
|
167
|
+
manufacturers: API.Manufacturers = new API.Manufacturers(this);
|
|
168
|
+
networkServer: API.NetworkServer = new API.NetworkServer(this);
|
|
169
|
+
deviceSpaces: API.DeviceSpaces = new API.DeviceSpaces(this);
|
|
170
|
+
trip: API.Trip = new API.Trip(this);
|
|
171
|
+
organizations: API.Organizations = new API.Organizations(this);
|
|
149
172
|
|
|
150
173
|
protected override defaultQuery(): Core.DefaultQuery | undefined {
|
|
151
174
|
return this._options.defaultQuery;
|
|
@@ -10,6 +10,22 @@ export class Auth extends APIResource {
|
|
|
10
10
|
return this._client.post(`/auth/oauth2/google`, { body, ...options });
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
googleLogin(body: GoogleLogin, options?: Core.RequestOptions): Core.APIPromise<AuthTokenPair> {
|
|
14
|
+
return this._client.post(`/auth/google/login`, { body, ...options });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
oauthSendOtp(body: OAuthSendEmail, options?: Core.RequestOptions): Core.APIPromise<OAuthSendEmail> {
|
|
18
|
+
return this._client.post(`/auth/send-otp`, { body, ...options });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
forgetPassword(body: ForgetPasswordParams, options?: Core.RequestOptions): Core.APIPromise<ForgetPasswordParams> {
|
|
22
|
+
return this._client.post(`/auth/forget-password`, { body, ...options });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
sendEmailConfirm(body: OAuthSendEmail, options?: Core.RequestOptions): Core.APIPromise<OAuthSendEmail> {
|
|
26
|
+
return this._client.post(`/auth/send-email-confirm`, { body, ...options });
|
|
27
|
+
}
|
|
28
|
+
|
|
13
29
|
oauth2SpaceDF(body: OAuthSpaceDF, options?: Core.RequestOptions): Core.APIPromise<OAuthSpaceDF> {
|
|
14
30
|
return this._client.post(`/auth/oauth2/spacedf-console`, { body, ...options });
|
|
15
31
|
}
|
|
@@ -25,6 +41,10 @@ export class Auth extends APIResource {
|
|
|
25
41
|
switchSpaces(body: AuthRefreshTokenParams, options?: Core.RequestOptions): Core.APIPromise<CustomTokenRefresh> {
|
|
26
42
|
return this._client.post(`/auth/spaces/switch`, { body, ...options });
|
|
27
43
|
}
|
|
44
|
+
|
|
45
|
+
changePassword(body: AuthChangePasswordParams, options?: Core.RequestOptions): Core.APIPromise<AuthChangePasswordParams> {
|
|
46
|
+
return this._client.put(`/auth/change-password`, { body, ...options });
|
|
47
|
+
}
|
|
28
48
|
}
|
|
29
49
|
|
|
30
50
|
export interface AuthTokenPair {
|
|
@@ -49,6 +69,14 @@ export interface OAuthLogin {
|
|
|
49
69
|
code_verifier: string;
|
|
50
70
|
}
|
|
51
71
|
|
|
72
|
+
export interface GoogleLogin {
|
|
73
|
+
authorization_code: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface OAuthSendEmail {
|
|
77
|
+
email: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
52
80
|
export interface OAuthSpaceDF {
|
|
53
81
|
code_verifier: string;
|
|
54
82
|
|
|
@@ -75,10 +103,20 @@ export interface AuthLoginParams {
|
|
|
75
103
|
password: string;
|
|
76
104
|
}
|
|
77
105
|
|
|
106
|
+
export interface ForgetPasswordParams {
|
|
107
|
+
token: string;
|
|
108
|
+
|
|
109
|
+
password: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface AuthChangePasswordParams {
|
|
113
|
+
password: string;
|
|
114
|
+
|
|
115
|
+
new_password: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
78
118
|
export interface AuthRefreshTokenParams {
|
|
79
119
|
refresh: string;
|
|
80
|
-
|
|
81
|
-
space: string;
|
|
82
120
|
}
|
|
83
121
|
|
|
84
122
|
export interface AuthRegisterParams {
|
|
@@ -89,4 +127,6 @@ export interface AuthRegisterParams {
|
|
|
89
127
|
first_name: string;
|
|
90
128
|
|
|
91
129
|
last_name: string;
|
|
130
|
+
|
|
131
|
+
otp: string;
|
|
92
132
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { APIResource } from '../../resource';
|
|
2
|
+
import * as Core from '../../core';
|
|
3
|
+
|
|
4
|
+
export class PresignedUrl extends APIResource {
|
|
5
|
+
get(options?: Core.RequestOptions): Core.APIPromise<PresignedUrlResponse> {
|
|
6
|
+
return this._client.get('/presigned-url', options);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface PresignedUrlResponse {
|
|
11
|
+
presigned_url: string;
|
|
12
|
+
file_name: string;
|
|
13
|
+
}
|
|
@@ -4,17 +4,28 @@ import { ListParamsResponse, ListResponse } from '../../types/api';
|
|
|
4
4
|
import * as Core from '../../core';
|
|
5
5
|
|
|
6
6
|
export class SpacePolicies extends APIResource {
|
|
7
|
-
retrieve(id: number, options?: Core.RequestOptions): Core.APIPromise<SpacePolicy> {
|
|
8
|
-
|
|
7
|
+
retrieve(id: number, params: SpacePolicyParams, options?: Core.RequestOptions): Core.APIPromise<SpacePolicy> {
|
|
8
|
+
const { 'X-Space': xspace } = params;
|
|
9
|
+
return this._client.get(`/space-policies/${id}`, {
|
|
10
|
+
...options,
|
|
11
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
12
|
+
});
|
|
9
13
|
}
|
|
10
14
|
|
|
11
|
-
list(query?: SpacePolicyListParams, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
12
|
-
list(options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
13
|
-
list(query: SpacePolicyListParams | Core.RequestOptions = {}, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse> {
|
|
15
|
+
list(spaceName: string, query?: SpacePolicyListParams, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
16
|
+
list(spaceName: string, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
17
|
+
list(spaceName: string, query: SpacePolicyListParams | Core.RequestOptions = {}, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse> {
|
|
14
18
|
if (isRequestOptions(query)) {
|
|
15
|
-
return this.list({}, query);
|
|
19
|
+
return this.list(spaceName, {}, query);
|
|
16
20
|
}
|
|
17
|
-
|
|
21
|
+
const mergedOptions: Core.RequestOptions = {
|
|
22
|
+
...options,
|
|
23
|
+
headers: {
|
|
24
|
+
...(options?.headers || {}),
|
|
25
|
+
'X-Space': spaceName,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
return this._client.get(`/space-policies`, { query, ...mergedOptions });
|
|
18
29
|
}
|
|
19
30
|
}
|
|
20
31
|
|
|
@@ -53,3 +64,7 @@ export interface SpacePolicy {
|
|
|
53
64
|
export type SpacePolicyListResponse = ListResponse<SpacePolicy>;
|
|
54
65
|
|
|
55
66
|
export type SpacePolicyListParams = ListParamsResponse;
|
|
67
|
+
|
|
68
|
+
export interface SpacePolicyParams {
|
|
69
|
+
'X-Space': string;
|
|
70
|
+
}
|
|
@@ -3,26 +3,54 @@ import { ListParamsResponse, ListResponse } from '../../types/api';
|
|
|
3
3
|
import * as Core from '../../core';
|
|
4
4
|
|
|
5
5
|
export class SpaceRoleUsers extends APIResource {
|
|
6
|
-
retrieve(id: number, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUser> {
|
|
6
|
+
retrieve(id: number, params: SpaceRoleUsersParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUser> {
|
|
7
|
+
const { 'X-Space': xspace } = params;
|
|
7
8
|
return this._client.get(`/space-role-users/${id}`, {
|
|
8
9
|
...options,
|
|
9
|
-
headers: { ...options?.headers },
|
|
10
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
10
11
|
});
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserListResponse> {
|
|
14
|
+
list(spaceName: string, params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserListResponse> {
|
|
14
15
|
const { ...query } = params;
|
|
15
16
|
return this._client.get(`/space-role-users`, {
|
|
16
17
|
query,
|
|
17
18
|
...options,
|
|
18
|
-
headers: { ...options?.headers },
|
|
19
|
+
headers: { ...options?.headers, 'X-Space': spaceName },
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
update(id: number, params: SpaceRoleUserUpdateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserUpdateParams> {
|
|
24
|
+
const { 'X-Space': xspace, ...body } = params;
|
|
25
|
+
return this._client.put(`/space-role-users/${id}`, {
|
|
26
|
+
body,
|
|
27
|
+
...options,
|
|
28
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
partialUpdate(id: number, params: SpaceRoleUserUpdateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserUpdateParams> {
|
|
33
|
+
const { 'X-Space': xspace, ...body } = params;
|
|
34
|
+
return this._client.patch(`/space-role-users/${id}`, {
|
|
35
|
+
body,
|
|
36
|
+
...options,
|
|
37
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
setSpaceDefault(id: String, params: SpaceRoleUsersParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
42
|
+
const { 'X-Space': xspace } = params;
|
|
43
|
+
return this._client.post(`/space-role-users/${id}/default`, {
|
|
44
|
+
...options,
|
|
45
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
delete(id: number, params: SpaceRoleUsersParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
50
|
+
const { 'X-Space': xspace } = params;
|
|
23
51
|
return this._client.delete(`/space-role-users/${id}`, {
|
|
24
52
|
...options,
|
|
25
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
53
|
+
headers: { Accept: '*/*', ...options?.headers, 'X-Space': xspace },
|
|
26
54
|
});
|
|
27
55
|
}
|
|
28
56
|
}
|
|
@@ -39,4 +67,13 @@ export interface SpaceRoleUser {
|
|
|
39
67
|
readonly updated_at?: string;
|
|
40
68
|
}
|
|
41
69
|
|
|
70
|
+
export interface SpaceRoleUserUpdateParams {
|
|
71
|
+
space_role: string;
|
|
72
|
+
'X-Space': string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface SpaceRoleUsersParams {
|
|
76
|
+
'X-Space': string;
|
|
77
|
+
}
|
|
78
|
+
|
|
42
79
|
export type SpaceRoleUserListResponse = ListResponse<SpaceRoleUser>;
|
|
@@ -4,52 +4,54 @@ import * as Core from '../../core';
|
|
|
4
4
|
|
|
5
5
|
export class SpaceRoles extends APIResource {
|
|
6
6
|
create(params: SpaceRoleCreateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole> {
|
|
7
|
-
const { ...body } = params;
|
|
7
|
+
const { 'X-Space': xspace, ...body } = params;
|
|
8
8
|
return this._client.post(`/space-roles`, {
|
|
9
9
|
body,
|
|
10
10
|
...options,
|
|
11
|
-
headers: { ...options?.headers },
|
|
11
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
retrieve(id: number, options?: Core.RequestOptions): Core.APIPromise<SpaceRole> {
|
|
15
|
+
retrieve(id: number, params: SpaceRoleParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole> {
|
|
16
|
+
const { 'X-Space': xspace } = params;
|
|
16
17
|
return this._client.get(`/space-roles/${id}`, {
|
|
17
18
|
...options,
|
|
18
|
-
headers: { ...options?.headers },
|
|
19
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
update(id: number, params: SpaceRoleUpdateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole> {
|
|
23
|
-
const { ...body } = params;
|
|
24
|
+
const { 'X-Space': xspace, ...body } = params;
|
|
24
25
|
return this._client.put(`/space-roles/${id}`, {
|
|
25
26
|
body,
|
|
26
27
|
...options,
|
|
27
|
-
headers: { ...options?.headers },
|
|
28
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
partialUpdate(id: number, params: SpaceRoleUpdateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole> {
|
|
32
|
-
const { ...body } = params;
|
|
33
|
+
const { 'X-Space': xspace, ...body } = params;
|
|
33
34
|
return this._client.patch(`/space-roles/${id}`, {
|
|
34
35
|
body,
|
|
35
36
|
...options,
|
|
36
|
-
headers: { ...options?.headers },
|
|
37
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleListResponse> {
|
|
41
|
+
list(spaceName: string, params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleListResponse> {
|
|
41
42
|
const { ...query } = params;
|
|
42
43
|
return this._client.get(`/space-roles`, {
|
|
43
44
|
query,
|
|
44
45
|
...options,
|
|
45
|
-
headers: { ...options?.headers },
|
|
46
|
+
headers: { ...options?.headers, 'X-Space': spaceName },
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
delete(id: number, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
50
|
+
delete(id: number, params: SpaceRoleParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
51
|
+
const { 'X-Space': xspace } = params;
|
|
50
52
|
return this._client.delete(`/space-roles/${id}`, {
|
|
51
53
|
...options,
|
|
52
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
54
|
+
headers: { Accept: '*/*', ...options?.headers, 'X-Space': xspace },
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
57
|
}
|
|
@@ -80,6 +82,11 @@ export interface SpaceRoleCreateParams {
|
|
|
80
82
|
* Body param:
|
|
81
83
|
*/
|
|
82
84
|
policies: Array<number>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Header param:
|
|
88
|
+
*/
|
|
89
|
+
'X-Space': string;
|
|
83
90
|
}
|
|
84
91
|
|
|
85
92
|
export interface SpaceRoleUpdateParams {
|
|
@@ -92,4 +99,12 @@ export interface SpaceRoleUpdateParams {
|
|
|
92
99
|
* Body param:
|
|
93
100
|
*/
|
|
94
101
|
policies: Array<number>;
|
|
102
|
+
/**
|
|
103
|
+
* Header param:
|
|
104
|
+
*/
|
|
105
|
+
'X-Space': string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface SpaceRoleParams {
|
|
109
|
+
'X-Space': string;
|
|
95
110
|
}
|