@space-df/sdk 0.0.1-dev.3.3 → 0.0.1-dev.4

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