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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) 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 +1537 -0
  9. package/dist/LICENSE +7 -0
  10. package/dist/README.md +382 -0
  11. package/{index.d.mts → dist/index.d.mts} +4 -0
  12. package/{index.d.ts → dist/index.d.ts} +4 -0
  13. package/{index.d.ts.map → dist/index.d.ts.map} +1 -1
  14. package/{index.js → dist/index.js} +4 -0
  15. package/dist/index.js.map +1 -0
  16. package/{index.mjs → dist/index.mjs} +4 -0
  17. package/dist/index.mjs.map +1 -0
  18. package/dist/package.json +101 -0
  19. package/{resources → dist/resources}/auth/auth.d.ts +5 -0
  20. package/dist/resources/auth/auth.d.ts.map +1 -0
  21. package/{resources → dist/resources}/auth/auth.js +3 -0
  22. package/dist/resources/auth/auth.js.map +1 -0
  23. package/{resources → dist/resources}/auth/auth.mjs +3 -0
  24. package/dist/resources/auth/auth.mjs.map +1 -0
  25. package/{resources → dist/resources}/auth/index.d.ts +4 -0
  26. package/{resources → dist/resources}/auth/index.d.ts.map +1 -1
  27. package/{resources → dist/resources}/auth/index.js +4 -0
  28. package/{resources → dist/resources}/auth/index.js.map +1 -1
  29. package/{resources → dist/resources}/auth/index.mjs +4 -0
  30. package/dist/resources/auth/invitation.d.ts +13 -0
  31. package/dist/resources/auth/invitation.d.ts.map +1 -0
  32. package/dist/resources/auth/invitation.js +11 -0
  33. package/dist/resources/auth/invitation.js.map +1 -0
  34. package/dist/resources/auth/invitation.mjs +7 -0
  35. package/dist/resources/auth/invitation.mjs.map +1 -0
  36. package/dist/resources/auth/join-space.d.ts +6 -0
  37. package/dist/resources/auth/join-space.d.ts.map +1 -0
  38. package/dist/resources/auth/join-space.js +11 -0
  39. package/dist/resources/auth/join-space.js.map +1 -0
  40. package/dist/resources/auth/join-space.mjs +7 -0
  41. package/dist/resources/auth/join-space.mjs.map +1 -0
  42. package/dist/resources/auth/presigned-url.d.ts +10 -0
  43. package/dist/resources/auth/presigned-url.d.ts.map +1 -0
  44. package/dist/resources/auth/presigned-url.js +11 -0
  45. package/dist/resources/auth/presigned-url.js.map +1 -0
  46. package/dist/resources/auth/presigned-url.mjs +7 -0
  47. package/dist/resources/auth/presigned-url.mjs.map +1 -0
  48. package/{resources → dist/resources}/auth/space-role-users.d.ts +5 -0
  49. package/dist/resources/auth/space-role-users.d.ts.map +1 -0
  50. package/{resources → dist/resources}/auth/space-role-users.js +16 -0
  51. package/dist/resources/auth/space-role-users.js.map +1 -0
  52. package/{resources → dist/resources}/auth/space-role-users.mjs +16 -0
  53. package/dist/resources/auth/space-role-users.mjs.map +1 -0
  54. package/dist/resources/auth/users.d.ts +19 -0
  55. package/dist/resources/auth/users.d.ts.map +1 -0
  56. package/dist/resources/auth/users.js +17 -0
  57. package/dist/resources/auth/users.js.map +1 -0
  58. package/dist/resources/auth/users.mjs +13 -0
  59. package/dist/resources/auth/users.mjs.map +1 -0
  60. package/dist/src/_shims/MultipartBody.ts +9 -0
  61. package/dist/src/_shims/README.md +46 -0
  62. package/dist/src/_shims/auto/runtime-bun.ts +4 -0
  63. package/dist/src/_shims/auto/runtime-node.ts +4 -0
  64. package/dist/src/_shims/auto/runtime.ts +4 -0
  65. package/dist/src/_shims/auto/types-node.ts +4 -0
  66. package/dist/src/_shims/auto/types.d.ts +101 -0
  67. package/dist/src/_shims/auto/types.js +3 -0
  68. package/dist/src/_shims/auto/types.mjs +3 -0
  69. package/dist/src/_shims/bun-runtime.ts +14 -0
  70. package/dist/src/_shims/index.d.ts +72 -0
  71. package/dist/src/_shims/index.js +13 -0
  72. package/dist/src/_shims/index.mjs +7 -0
  73. package/dist/src/_shims/manual-types.d.ts +12 -0
  74. package/dist/src/_shims/manual-types.js +3 -0
  75. package/dist/src/_shims/manual-types.mjs +3 -0
  76. package/dist/src/_shims/node-runtime.ts +78 -0
  77. package/dist/src/_shims/node-types.d.ts +42 -0
  78. package/dist/src/_shims/node-types.js +3 -0
  79. package/dist/src/_shims/node-types.mjs +3 -0
  80. package/dist/src/_shims/registry.ts +60 -0
  81. package/dist/src/_shims/web-runtime.ts +91 -0
  82. package/dist/src/_shims/web-types.d.ts +83 -0
  83. package/dist/src/_shims/web-types.js +3 -0
  84. package/dist/src/_shims/web-types.mjs +3 -0
  85. package/dist/src/core.ts +1061 -0
  86. package/dist/src/error.ts +134 -0
  87. package/dist/src/index.ts +210 -0
  88. package/dist/src/libs/utils.ts +66 -0
  89. package/dist/src/resource.ts +9 -0
  90. package/dist/src/resources/auth/auth.ts +102 -0
  91. package/dist/src/resources/auth/credentials.ts +12 -0
  92. package/dist/src/resources/auth/index.ts +10 -0
  93. package/dist/src/resources/auth/invitation.ts +17 -0
  94. package/dist/src/resources/auth/join-space.ts +8 -0
  95. package/dist/src/resources/auth/presigned-url.ts +13 -0
  96. package/dist/src/resources/auth/space-policies.ts +55 -0
  97. package/dist/src/resources/auth/space-role-users.ts +64 -0
  98. package/dist/src/resources/auth/space-roles.ts +95 -0
  99. package/dist/src/resources/auth/spaces.ts +118 -0
  100. package/dist/src/resources/auth/users.ts +36 -0
  101. package/dist/src/resources/console/index.ts +1 -0
  102. package/dist/src/resources/console/oauth2.ts +83 -0
  103. package/dist/src/resources/dashboard/dashboards.ts +171 -0
  104. package/dist/src/resources/dashboard/device-states.ts +142 -0
  105. package/dist/src/resources/dashboard/index.ts +2 -0
  106. package/dist/src/resources/index.ts +6 -0
  107. package/dist/src/shims/node.ts +50 -0
  108. package/dist/src/shims/web.ts +50 -0
  109. package/dist/src/types/api.ts +31 -0
  110. package/dist/src/types/jwt.ts +12 -0
  111. package/dist/src/version.ts +1 -0
  112. package/dist/version.d.ts +2 -0
  113. package/dist/version.d.ts.map +1 -0
  114. package/{version.js → dist/version.js} +1 -1
  115. package/dist/version.js.map +1 -0
  116. package/dist/version.mjs +2 -0
  117. package/{version.mjs.map → dist/version.mjs.map} +1 -1
  118. package/eslint.config.mjs +33 -0
  119. package/examples/auth/login.ts +14 -0
  120. package/examples/auth/register.ts +15 -0
  121. package/examples/console/oauth2.ts +15 -0
  122. package/package.json +52 -36
  123. package/scripts/build +56 -0
  124. package/scripts/utils/check-version.cjs +20 -0
  125. package/scripts/utils/fix-index-exports.cjs +8 -0
  126. package/scripts/utils/make-dist-package-json.cjs +21 -0
  127. package/scripts/utils/postprocess-files.cjs +153 -0
  128. package/src/_shims/auto/runtime-deno.ts +4 -0
  129. package/src/_shims/auto/types-deno.ts +4 -0
  130. package/src/_shims/auto/types.d.ts +18 -18
  131. package/src/_shims/index-deno.ts +105 -0
  132. package/src/_shims/index.d.ts +1 -1
  133. package/src/_shims/index.mjs +1 -1
  134. package/src/index.ts +4 -0
  135. package/src/resources/auth/auth.ts +10 -0
  136. package/src/resources/auth/index.ts +4 -0
  137. package/src/resources/auth/invitation.ts +17 -0
  138. package/src/resources/auth/join-space.ts +8 -0
  139. package/src/resources/auth/presigned-url.ts +13 -0
  140. package/src/resources/auth/space-role-users.ts +22 -0
  141. package/src/resources/auth/users.ts +36 -0
  142. package/src/version.ts +1 -1
  143. package/tsc-multi.json +7 -0
  144. package/tsconfig.build.json +18 -0
  145. package/tsconfig.deno.json +20 -0
  146. package/tsconfig.dist-src.json +11 -0
  147. package/tsconfig.json +38 -0
  148. package/index.js.map +0 -1
  149. package/index.mjs.map +0 -1
  150. package/resources/auth/auth.d.ts.map +0 -1
  151. package/resources/auth/auth.js.map +0 -1
  152. package/resources/auth/auth.mjs.map +0 -1
  153. package/resources/auth/space-role-users.d.ts.map +0 -1
  154. package/resources/auth/space-role-users.js.map +0 -1
  155. package/resources/auth/space-role-users.mjs.map +0 -1
  156. package/src/resources/.DS_Store +0 -0
  157. package/version.d.ts +0 -2
  158. package/version.d.ts.map +0 -1
  159. package/version.js.map +0 -1
  160. package/version.mjs +0 -2
  161. package/yarn.lock +0 -268
  162. /package/{_shims → dist/_shims}/MultipartBody.d.ts +0 -0
  163. /package/{_shims → dist/_shims}/MultipartBody.d.ts.map +0 -0
  164. /package/{_shims → dist/_shims}/MultipartBody.js +0 -0
  165. /package/{_shims → dist/_shims}/MultipartBody.js.map +0 -0
  166. /package/{_shims → dist/_shims}/MultipartBody.mjs +0 -0
  167. /package/{_shims → dist/_shims}/MultipartBody.mjs.map +0 -0
  168. /package/{_shims → dist/_shims}/README.md +0 -0
  169. /package/{_shims → dist/_shims}/auto/runtime-bun.d.ts +0 -0
  170. /package/{_shims → dist/_shims}/auto/runtime-bun.d.ts.map +0 -0
  171. /package/{_shims → dist/_shims}/auto/runtime-bun.js +0 -0
  172. /package/{_shims → dist/_shims}/auto/runtime-bun.js.map +0 -0
  173. /package/{_shims → dist/_shims}/auto/runtime-bun.mjs +0 -0
  174. /package/{_shims → dist/_shims}/auto/runtime-bun.mjs.map +0 -0
  175. /package/{_shims → dist/_shims}/auto/runtime-node.d.ts +0 -0
  176. /package/{_shims → dist/_shims}/auto/runtime-node.d.ts.map +0 -0
  177. /package/{_shims → dist/_shims}/auto/runtime-node.js +0 -0
  178. /package/{_shims → dist/_shims}/auto/runtime-node.js.map +0 -0
  179. /package/{_shims → dist/_shims}/auto/runtime-node.mjs +0 -0
  180. /package/{_shims → dist/_shims}/auto/runtime-node.mjs.map +0 -0
  181. /package/{_shims → dist/_shims}/auto/runtime.d.ts +0 -0
  182. /package/{_shims → dist/_shims}/auto/runtime.d.ts.map +0 -0
  183. /package/{_shims → dist/_shims}/auto/runtime.js +0 -0
  184. /package/{_shims → dist/_shims}/auto/runtime.js.map +0 -0
  185. /package/{_shims → dist/_shims}/auto/runtime.mjs +0 -0
  186. /package/{_shims → dist/_shims}/auto/runtime.mjs.map +0 -0
  187. /package/{_shims → dist/_shims}/auto/types-node.d.ts +0 -0
  188. /package/{_shims → dist/_shims}/auto/types-node.d.ts.map +0 -0
  189. /package/{_shims → dist/_shims}/auto/types-node.js +0 -0
  190. /package/{_shims → dist/_shims}/auto/types-node.js.map +0 -0
  191. /package/{_shims → dist/_shims}/auto/types-node.mjs +0 -0
  192. /package/{_shims → dist/_shims}/auto/types-node.mjs.map +0 -0
  193. /package/{_shims → dist/_shims}/auto/types.d.ts +0 -0
  194. /package/{_shims → dist/_shims}/auto/types.js +0 -0
  195. /package/{_shims → dist/_shims}/auto/types.mjs +0 -0
  196. /package/{_shims → dist/_shims}/bun-runtime.d.ts +0 -0
  197. /package/{_shims → dist/_shims}/bun-runtime.d.ts.map +0 -0
  198. /package/{_shims → dist/_shims}/bun-runtime.js +0 -0
  199. /package/{_shims → dist/_shims}/bun-runtime.js.map +0 -0
  200. /package/{_shims → dist/_shims}/bun-runtime.mjs +0 -0
  201. /package/{_shims → dist/_shims}/bun-runtime.mjs.map +0 -0
  202. /package/{_shims → dist/_shims}/index.d.ts +0 -0
  203. /package/{_shims → dist/_shims}/index.js +0 -0
  204. /package/{_shims → dist/_shims}/index.mjs +0 -0
  205. /package/{_shims → dist/_shims}/manual-types.d.ts +0 -0
  206. /package/{_shims → dist/_shims}/manual-types.js +0 -0
  207. /package/{_shims → dist/_shims}/manual-types.mjs +0 -0
  208. /package/{_shims → dist/_shims}/node-runtime.d.ts +0 -0
  209. /package/{_shims → dist/_shims}/node-runtime.d.ts.map +0 -0
  210. /package/{_shims → dist/_shims}/node-runtime.js +0 -0
  211. /package/{_shims → dist/_shims}/node-runtime.js.map +0 -0
  212. /package/{_shims → dist/_shims}/node-runtime.mjs +0 -0
  213. /package/{_shims → dist/_shims}/node-runtime.mjs.map +0 -0
  214. /package/{_shims → dist/_shims}/node-types.d.ts +0 -0
  215. /package/{_shims → dist/_shims}/node-types.js +0 -0
  216. /package/{_shims → dist/_shims}/node-types.mjs +0 -0
  217. /package/{_shims → dist/_shims}/registry.d.ts +0 -0
  218. /package/{_shims → dist/_shims}/registry.d.ts.map +0 -0
  219. /package/{_shims → dist/_shims}/registry.js +0 -0
  220. /package/{_shims → dist/_shims}/registry.js.map +0 -0
  221. /package/{_shims → dist/_shims}/registry.mjs +0 -0
  222. /package/{_shims → dist/_shims}/registry.mjs.map +0 -0
  223. /package/{_shims → dist/_shims}/web-runtime.d.ts +0 -0
  224. /package/{_shims → dist/_shims}/web-runtime.d.ts.map +0 -0
  225. /package/{_shims → dist/_shims}/web-runtime.js +0 -0
  226. /package/{_shims → dist/_shims}/web-runtime.js.map +0 -0
  227. /package/{_shims → dist/_shims}/web-runtime.mjs +0 -0
  228. /package/{_shims → dist/_shims}/web-runtime.mjs.map +0 -0
  229. /package/{_shims → dist/_shims}/web-types.d.ts +0 -0
  230. /package/{_shims → dist/_shims}/web-types.js +0 -0
  231. /package/{_shims → dist/_shims}/web-types.mjs +0 -0
  232. /package/{core.d.ts → dist/core.d.ts} +0 -0
  233. /package/{core.d.ts.map → dist/core.d.ts.map} +0 -0
  234. /package/{core.js → dist/core.js} +0 -0
  235. /package/{core.js.map → dist/core.js.map} +0 -0
  236. /package/{core.mjs → dist/core.mjs} +0 -0
  237. /package/{core.mjs.map → dist/core.mjs.map} +0 -0
  238. /package/{error.d.ts → dist/error.d.ts} +0 -0
  239. /package/{error.d.ts.map → dist/error.d.ts.map} +0 -0
  240. /package/{error.js → dist/error.js} +0 -0
  241. /package/{error.js.map → dist/error.js.map} +0 -0
  242. /package/{error.mjs → dist/error.mjs} +0 -0
  243. /package/{error.mjs.map → dist/error.mjs.map} +0 -0
  244. /package/{libs → dist/libs}/utils.d.ts +0 -0
  245. /package/{libs → dist/libs}/utils.d.ts.map +0 -0
  246. /package/{libs → dist/libs}/utils.js +0 -0
  247. /package/{libs → dist/libs}/utils.js.map +0 -0
  248. /package/{libs → dist/libs}/utils.mjs +0 -0
  249. /package/{libs → dist/libs}/utils.mjs.map +0 -0
  250. /package/{resource.d.ts → dist/resource.d.ts} +0 -0
  251. /package/{resource.d.ts.map → dist/resource.d.ts.map} +0 -0
  252. /package/{resource.js → dist/resource.js} +0 -0
  253. /package/{resource.js.map → dist/resource.js.map} +0 -0
  254. /package/{resource.mjs → dist/resource.mjs} +0 -0
  255. /package/{resource.mjs.map → dist/resource.mjs.map} +0 -0
  256. /package/{resources → dist/resources}/auth/credentials.d.ts +0 -0
  257. /package/{resources → dist/resources}/auth/credentials.d.ts.map +0 -0
  258. /package/{resources → dist/resources}/auth/credentials.js +0 -0
  259. /package/{resources → dist/resources}/auth/credentials.js.map +0 -0
  260. /package/{resources → dist/resources}/auth/credentials.mjs +0 -0
  261. /package/{resources → dist/resources}/auth/credentials.mjs.map +0 -0
  262. /package/{resources → dist/resources}/auth/index.mjs.map +0 -0
  263. /package/{resources → dist/resources}/auth/space-policies.d.ts +0 -0
  264. /package/{resources → dist/resources}/auth/space-policies.d.ts.map +0 -0
  265. /package/{resources → dist/resources}/auth/space-policies.js +0 -0
  266. /package/{resources → dist/resources}/auth/space-policies.js.map +0 -0
  267. /package/{resources → dist/resources}/auth/space-policies.mjs +0 -0
  268. /package/{resources → dist/resources}/auth/space-policies.mjs.map +0 -0
  269. /package/{resources → dist/resources}/auth/space-roles.d.ts +0 -0
  270. /package/{resources → dist/resources}/auth/space-roles.d.ts.map +0 -0
  271. /package/{resources → dist/resources}/auth/space-roles.js +0 -0
  272. /package/{resources → dist/resources}/auth/space-roles.js.map +0 -0
  273. /package/{resources → dist/resources}/auth/space-roles.mjs +0 -0
  274. /package/{resources → dist/resources}/auth/space-roles.mjs.map +0 -0
  275. /package/{resources → dist/resources}/auth/spaces.d.ts +0 -0
  276. /package/{resources → dist/resources}/auth/spaces.d.ts.map +0 -0
  277. /package/{resources → dist/resources}/auth/spaces.js +0 -0
  278. /package/{resources → dist/resources}/auth/spaces.js.map +0 -0
  279. /package/{resources → dist/resources}/auth/spaces.mjs +0 -0
  280. /package/{resources → dist/resources}/auth/spaces.mjs.map +0 -0
  281. /package/{resources → dist/resources}/console/index.d.ts +0 -0
  282. /package/{resources → dist/resources}/console/index.d.ts.map +0 -0
  283. /package/{resources → dist/resources}/console/index.js +0 -0
  284. /package/{resources → dist/resources}/console/index.js.map +0 -0
  285. /package/{resources → dist/resources}/console/index.mjs +0 -0
  286. /package/{resources → dist/resources}/console/index.mjs.map +0 -0
  287. /package/{resources → dist/resources}/console/oauth2.d.ts +0 -0
  288. /package/{resources → dist/resources}/console/oauth2.d.ts.map +0 -0
  289. /package/{resources → dist/resources}/console/oauth2.js +0 -0
  290. /package/{resources → dist/resources}/console/oauth2.js.map +0 -0
  291. /package/{resources → dist/resources}/console/oauth2.mjs +0 -0
  292. /package/{resources → dist/resources}/console/oauth2.mjs.map +0 -0
  293. /package/{resources → dist/resources}/dashboard/dashboards.d.ts +0 -0
  294. /package/{resources → dist/resources}/dashboard/dashboards.d.ts.map +0 -0
  295. /package/{resources → dist/resources}/dashboard/dashboards.js +0 -0
  296. /package/{resources → dist/resources}/dashboard/dashboards.js.map +0 -0
  297. /package/{resources → dist/resources}/dashboard/dashboards.mjs +0 -0
  298. /package/{resources → dist/resources}/dashboard/dashboards.mjs.map +0 -0
  299. /package/{resources → dist/resources}/dashboard/device-states.d.ts +0 -0
  300. /package/{resources → dist/resources}/dashboard/device-states.d.ts.map +0 -0
  301. /package/{resources → dist/resources}/dashboard/device-states.js +0 -0
  302. /package/{resources → dist/resources}/dashboard/device-states.js.map +0 -0
  303. /package/{resources → dist/resources}/dashboard/device-states.mjs +0 -0
  304. /package/{resources → dist/resources}/dashboard/device-states.mjs.map +0 -0
  305. /package/{resources → dist/resources}/dashboard/index.d.ts +0 -0
  306. /package/{resources → dist/resources}/dashboard/index.d.ts.map +0 -0
  307. /package/{resources → dist/resources}/dashboard/index.js +0 -0
  308. /package/{resources → dist/resources}/dashboard/index.js.map +0 -0
  309. /package/{resources → dist/resources}/dashboard/index.mjs +0 -0
  310. /package/{resources → dist/resources}/dashboard/index.mjs.map +0 -0
  311. /package/{resources → dist/resources}/index.d.ts +0 -0
  312. /package/{resources → dist/resources}/index.d.ts.map +0 -0
  313. /package/{resources → dist/resources}/index.js +0 -0
  314. /package/{resources → dist/resources}/index.js.map +0 -0
  315. /package/{resources → dist/resources}/index.mjs +0 -0
  316. /package/{resources → dist/resources}/index.mjs.map +0 -0
  317. /package/{shims → dist/shims}/node.d.ts +0 -0
  318. /package/{shims → dist/shims}/node.d.ts.map +0 -0
  319. /package/{shims → dist/shims}/node.js +0 -0
  320. /package/{shims → dist/shims}/node.js.map +0 -0
  321. /package/{shims → dist/shims}/node.mjs +0 -0
  322. /package/{shims → dist/shims}/node.mjs.map +0 -0
  323. /package/{shims → dist/shims}/web.d.ts +0 -0
  324. /package/{shims → dist/shims}/web.d.ts.map +0 -0
  325. /package/{shims → dist/shims}/web.js +0 -0
  326. /package/{shims → dist/shims}/web.js.map +0 -0
  327. /package/{shims → dist/shims}/web.mjs +0 -0
  328. /package/{shims → dist/shims}/web.mjs.map +0 -0
  329. /package/{src → dist/src}/tsconfig.json +0 -0
  330. /package/{types → dist/types}/api.d.ts +0 -0
  331. /package/{types → dist/types}/api.d.ts.map +0 -0
  332. /package/{types → dist/types}/api.js +0 -0
  333. /package/{types → dist/types}/api.js.map +0 -0
  334. /package/{types → dist/types}/api.mjs +0 -0
  335. /package/{types → dist/types}/api.mjs.map +0 -0
  336. /package/{types → dist/types}/jwt.d.ts +0 -0
  337. /package/{types → dist/types}/jwt.d.ts.map +0 -0
  338. /package/{types → dist/types}/jwt.js +0 -0
  339. /package/{types → dist/types}/jwt.js.map +0 -0
  340. /package/{types → dist/types}/jwt.mjs +0 -0
  341. /package/{types → dist/types}/jwt.mjs.map +0 -0
@@ -0,0 +1,64 @@
1
+ import { APIResource } from '../../resource';
2
+ import { ListParamsResponse, ListResponse } from '../../types/api';
3
+ import * as Core from '../../core';
4
+
5
+ export class SpaceRoleUsers extends APIResource {
6
+ retrieve(id: number, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUser> {
7
+ return this._client.get(`/space-role-users/${id}`, {
8
+ ...options,
9
+ headers: { ...options?.headers },
10
+ });
11
+ }
12
+
13
+ list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserListResponse> {
14
+ const { ...query } = params;
15
+ return this._client.get(`/space-role-users`, {
16
+ query,
17
+ ...options,
18
+ headers: { ...options?.headers },
19
+ });
20
+ }
21
+
22
+ update(id: number, params: SpaceRoleParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleParams> {
23
+ const { ...body } = params;
24
+ return this._client.put(`/space-role-users/${id}`, {
25
+ body,
26
+ ...options,
27
+ headers: { ...options?.headers },
28
+ });
29
+ }
30
+
31
+ partialUpdate(id: number, params: SpaceRoleParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleParams> {
32
+ const { ...body } = params;
33
+ return this._client.patch(`/space-role-users/${id}`, {
34
+ body,
35
+ ...options,
36
+ headers: { ...options?.headers },
37
+ });
38
+ }
39
+
40
+ delete(id: number, options?: Core.RequestOptions): Core.APIPromise<void> {
41
+ return this._client.delete(`/space-role-users/${id}`, {
42
+ ...options,
43
+ headers: { Accept: '*/*', ...options?.headers },
44
+ });
45
+ }
46
+ }
47
+
48
+ export interface SpaceRoleUser {
49
+ organization_user: number;
50
+
51
+ space_role: number;
52
+
53
+ id?: number;
54
+
55
+ readonly created_at?: string;
56
+
57
+ readonly updated_at?: string;
58
+ }
59
+
60
+ export interface SpaceRoleParams {
61
+ space_role: string;
62
+ }
63
+
64
+ export type SpaceRoleUserListResponse = ListResponse<SpaceRoleUser>;
@@ -0,0 +1,95 @@
1
+ import { APIResource } from '../../resource';
2
+ import { ListParamsResponse, ListResponse } from '../../types/api';
3
+ import * as Core from '../../core';
4
+
5
+ export class SpaceRoles extends APIResource {
6
+ create(params: SpaceRoleCreateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole> {
7
+ const { ...body } = params;
8
+ return this._client.post(`/space-roles`, {
9
+ body,
10
+ ...options,
11
+ headers: { ...options?.headers },
12
+ });
13
+ }
14
+
15
+ retrieve(id: number, options?: Core.RequestOptions): Core.APIPromise<SpaceRole> {
16
+ return this._client.get(`/space-roles/${id}`, {
17
+ ...options,
18
+ headers: { ...options?.headers },
19
+ });
20
+ }
21
+
22
+ update(id: number, params: SpaceRoleUpdateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole> {
23
+ const { ...body } = params;
24
+ return this._client.put(`/space-roles/${id}`, {
25
+ body,
26
+ ...options,
27
+ headers: { ...options?.headers },
28
+ });
29
+ }
30
+
31
+ partialUpdate(id: number, params: SpaceRoleUpdateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole> {
32
+ const { ...body } = params;
33
+ return this._client.patch(`/space-roles/${id}`, {
34
+ body,
35
+ ...options,
36
+ headers: { ...options?.headers },
37
+ });
38
+ }
39
+
40
+ list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleListResponse> {
41
+ const { ...query } = params;
42
+ return this._client.get(`/space-roles`, {
43
+ query,
44
+ ...options,
45
+ headers: { ...options?.headers },
46
+ });
47
+ }
48
+
49
+ delete(id: number, options?: Core.RequestOptions): Core.APIPromise<void> {
50
+ return this._client.delete(`/space-roles/${id}`, {
51
+ ...options,
52
+ headers: { Accept: '*/*', ...options?.headers },
53
+ });
54
+ }
55
+ }
56
+
57
+ export interface SpaceRole {
58
+ name: string;
59
+
60
+ policies: Array<number>;
61
+
62
+ id?: number;
63
+
64
+ readonly created_at?: string;
65
+
66
+ space?: number;
67
+
68
+ updated_at?: string;
69
+ }
70
+
71
+ export type SpaceRoleListResponse = ListResponse<SpaceRole>;
72
+
73
+ export interface SpaceRoleCreateParams {
74
+ /**
75
+ * Body param:
76
+ */
77
+ name: string;
78
+
79
+ /**
80
+ * Body param:
81
+ */
82
+ policies: Array<number>;
83
+ }
84
+
85
+ export interface SpaceRoleUpdateParams {
86
+ /**
87
+ * Body param:
88
+ */
89
+ name: string;
90
+
91
+ /**
92
+ * Body param:
93
+ */
94
+ policies: Array<number>;
95
+ }
@@ -0,0 +1,118 @@
1
+ import { APIResource } from '../../resource';
2
+ import { isRequestOptions } from '../../core';
3
+ import { ListParamsResponse, ListResponse } from '../../types/api';
4
+ import * as Core from '../../core';
5
+
6
+ export class Spaces extends APIResource {
7
+ create(body: SpaceCreateParams, options?: Core.RequestOptions): Core.APIPromise<Space> {
8
+ return this._client.post(`/spaces`, { body, ...options });
9
+ }
10
+
11
+ update(params: SpaceUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Space> {
12
+ const { ...body } = params;
13
+ return this._client.put(`/spaces`, {
14
+ body,
15
+ ...options,
16
+ headers: { ...options?.headers },
17
+ });
18
+ }
19
+
20
+ partialUpdate(params: SpaceUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Space> {
21
+ const { ...body } = params;
22
+ return this._client.patch(`/spaces`, {
23
+ body,
24
+ ...options,
25
+ headers: { ...options?.headers },
26
+ });
27
+ }
28
+
29
+ list(params?: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceListResponse>;
30
+ list(options?: Core.RequestOptions): Core.APIPromise<SpaceListResponse>;
31
+ list(params: ListParamsResponse | Core.RequestOptions = {}, options?: Core.RequestOptions): Core.APIPromise<SpaceListResponse> {
32
+ if (isRequestOptions(params)) {
33
+ return this.list({}, params);
34
+ }
35
+ const { ...query } = params;
36
+ return this._client.get(`/spaces`, {
37
+ query,
38
+ ...options,
39
+ headers: { ...options?.headers },
40
+ });
41
+ }
42
+
43
+ delete(options?: Core.RequestOptions): Core.APIPromise<void> {
44
+ return this._client.delete(`/spaces`, {
45
+ ...options,
46
+ headers: { Accept: '*/*', ...options?.headers },
47
+ });
48
+ }
49
+ }
50
+
51
+ export interface Space {
52
+ logo: string;
53
+
54
+ name: string;
55
+
56
+ slug_name: string;
57
+
58
+ id?: number;
59
+
60
+ created_by?: number | null;
61
+
62
+ is_active?: boolean;
63
+
64
+ total_devices: number;
65
+
66
+ readonly created_at?: string;
67
+
68
+ readonly updated_at?: string;
69
+ }
70
+
71
+ export type SpaceListResponse = ListResponse<Space>;
72
+
73
+ export interface SpaceCreateParams {
74
+ logo: string;
75
+
76
+ name: string;
77
+
78
+ slug_name: string;
79
+ }
80
+
81
+ export interface SpaceUpdateParams {
82
+ /**
83
+ * Body param:
84
+ */
85
+ logo: string;
86
+
87
+ /**
88
+ * Body param:
89
+ */
90
+ name: string;
91
+
92
+ /**
93
+ * Body param:
94
+ */
95
+ slug_name: string;
96
+ }
97
+
98
+ export interface SpaceUpdateParams {
99
+ /**
100
+ * Body param:
101
+ */
102
+ logo: string;
103
+
104
+ /**
105
+ * Body param:
106
+ */
107
+ name: string;
108
+
109
+ /**
110
+ * Body param:
111
+ */
112
+ slug_name: string;
113
+
114
+ /**
115
+ * Body param:
116
+ */
117
+ is_active?: boolean;
118
+ }
@@ -0,0 +1,36 @@
1
+ import { APIResource } from '../../resource';
2
+ import * as Core from '../../core';
3
+
4
+ export class Users extends APIResource {
5
+ getMe(options?: Core.RequestOptions): Core.APIPromise<Profile> {
6
+ return this._client.get(`/users/me`, options);
7
+ }
8
+
9
+ updateMe(body: Profile, options?: Core.RequestOptions): Core.APIPromise<Profile> {
10
+ return this._client.put(`/users/me`, { body, ...options });
11
+ }
12
+
13
+ deleteMe(options?: Core.RequestOptions): Core.APIPromise<void> {
14
+ return this._client.delete(`/users/me`, options);
15
+ }
16
+ }
17
+
18
+ export interface Profile {
19
+ id?: string;
20
+
21
+ first_name?: string;
22
+
23
+ last_name?: string;
24
+
25
+ email?: string;
26
+
27
+ location?: string;
28
+
29
+ avatar?: string;
30
+
31
+ company_name?: string;
32
+
33
+ title?: string;
34
+
35
+ is_owner?: boolean;
36
+ }
@@ -0,0 +1 @@
1
+ export * from './oauth2';
@@ -0,0 +1,83 @@
1
+ import { APIResource } from '../../resource';
2
+ import * as Core from '../../core';
3
+ import { rstripBase64, toBase64, toSHA256, uuid4 } from '../../libs/utils';
4
+
5
+ export class OAuth2 extends APIResource {
6
+ async authorize(body: OAuth2AuthorizeParams, options?: Core.RequestOptions): Promise<OAuth2Authorize> {
7
+ const verifier = rstripBase64(toBase64(uuid4()));
8
+ const codeChallenge = rstripBase64(toBase64(await toSHA256(verifier)));
9
+
10
+ const oAuth2AuthorizeBody: OAuth2Authorize = {
11
+ ...body,
12
+ response_type: 'code',
13
+ code_challenge: codeChallenge,
14
+ code_challenge_method: 'S256',
15
+ };
16
+
17
+ return (
18
+ this._client.post(`/auth/login`, { body: oAuth2AuthorizeBody, ...options }) as Core.APIPromise<{
19
+ data: OAuth2Authorize;
20
+ }>
21
+ )._thenUnwrap((obj) => ({ ...obj.data, verifier }));
22
+ }
23
+ }
24
+
25
+ export type OAuth2AuthorizeParams = Pick<OAuth2Authorize, 'client_id' | 'redirect_uri' | 'scopes'>;
26
+
27
+ export interface OAuth2Authorize {
28
+ /**
29
+ * Response type
30
+ */
31
+ response_type: 'code';
32
+
33
+ /**
34
+ * Code challenge, require min length > 1
35
+ */
36
+ code_challenge: string;
37
+
38
+ /**
39
+ * Code challenge method
40
+ */
41
+ code_challenge_method: 'plain' | 'S256';
42
+
43
+ /**
44
+ * Client id
45
+ */
46
+ client_id: string;
47
+
48
+ /**
49
+ * Redirect uri
50
+ */
51
+ redirect_uri: string;
52
+
53
+ scopes: Array<'organization'>;
54
+ }
55
+
56
+ export interface OAuth2Token {
57
+ /**
58
+ * Client id
59
+ */
60
+ client_id: string;
61
+
62
+ /**
63
+ * Client secret
64
+ */
65
+ client_secret: string;
66
+
67
+ /**
68
+ * Code
69
+ */
70
+ code: string;
71
+
72
+ /**
73
+ * Code verifier
74
+ */
75
+ code_verifier: string;
76
+
77
+ readonly scopes?: Array<'organization'>;
78
+
79
+ /**
80
+ * Id token
81
+ */
82
+ readonly id_token?: string;
83
+ }
@@ -0,0 +1,171 @@
1
+ import { APIResource } from '../../resource';
2
+ import * as Core from '../../core';
3
+ import { ListParamsResponse, ListResponse } from '../../types/api';
4
+
5
+ export class Dashboards extends APIResource {
6
+ create(params: DashboardCreateParams, options?: Core.RequestOptions): Core.APIPromise<Dashboard> {
7
+ const { ...body } = params;
8
+ return this._client.post(`/dashboards`, {
9
+ body,
10
+ ...options,
11
+ headers: { ...options?.headers },
12
+ });
13
+ }
14
+
15
+ retrieve(id: number, options?: Core.RequestOptions): Core.APIPromise<Dashboard> {
16
+ return this._client.get(`/dashboards/${id}`, {
17
+ ...options,
18
+ headers: { ...options?.headers },
19
+ });
20
+ }
21
+
22
+ update(id: number, params: DashboardUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Dashboard> {
23
+ const { ...body } = params;
24
+ return this._client.put(`/dashboards/${id}`, {
25
+ body,
26
+ ...options,
27
+ headers: { ...options?.headers },
28
+ });
29
+ }
30
+
31
+ partialUpdate(id: number, params: DashboardUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Dashboard> {
32
+ const { ...body } = params;
33
+ return this._client.patch(`/dashboards/${id}`, {
34
+ body,
35
+ ...options,
36
+ headers: { ...options?.headers },
37
+ });
38
+ }
39
+
40
+ list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<DashboardListResponse> {
41
+ const { ...query } = params;
42
+ return this._client.get(`/dashboards`, {
43
+ query,
44
+ ...options,
45
+ headers: { ...options?.headers },
46
+ });
47
+ }
48
+
49
+ delete(id: number, options?: Core.RequestOptions): Core.APIPromise<void> {
50
+ return this._client.delete(`/dashboards/${id}`, {
51
+ ...options,
52
+ headers: { Accept: '*/*', ...options?.headers },
53
+ });
54
+ }
55
+
56
+ createWidget(dashboardId: string, params: WidgetCreateParams, options?: Core.RequestOptions): Core.APIPromise<Widget> {
57
+ const { ...body } = params;
58
+ return this._client.post(`/dashboards/${dashboardId}/widgets`, {
59
+ body,
60
+ ...options,
61
+ headers: { ...options?.headers },
62
+ });
63
+ }
64
+
65
+ retrieveWidget(dashboardId: string, id: number, options?: Core.RequestOptions): Core.APIPromise<Widget> {
66
+ return this._client.get(`/dashboards/${dashboardId}/widgets/${id}`, {
67
+ ...options,
68
+ headers: { ...options?.headers },
69
+ });
70
+ }
71
+
72
+ updateWidget(dashboardId: string, id: number, params: WidgetUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Widget> {
73
+ const { ...body } = params;
74
+ return this._client.put(`/dashboards/${dashboardId}/widgets/${id}`, {
75
+ body,
76
+ ...options,
77
+ headers: { ...options?.headers },
78
+ });
79
+ }
80
+
81
+ partialUpdateWidget(dashboardId: string, id: number, params: WidgetUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Widget> {
82
+ const { ...body } = params;
83
+ return this._client.patch(`/dashboards/${dashboardId}/widgets/${id}`, {
84
+ body,
85
+ ...options,
86
+ headers: { ...options?.headers },
87
+ });
88
+ }
89
+
90
+ listWidgets(dashboardId: string, params: WidgetListParams, options?: Core.RequestOptions): Core.APIPromise<WidgetListResponse> {
91
+ const { ...query } = params;
92
+ return this._client.get(`/dashboards/${dashboardId}/widgets`, {
93
+ query,
94
+ ...options,
95
+ headers: { ...options?.headers },
96
+ });
97
+ }
98
+
99
+ deleteWidget(dashboardId: string, id: number, options?: Core.RequestOptions): Core.APIPromise<void> {
100
+ return this._client.delete(`/dashboards/${dashboardId}/widgets/${id}`, {
101
+ ...options,
102
+ headers: { Accept: '*/*', ...options?.headers },
103
+ });
104
+ }
105
+ }
106
+
107
+ export interface Dashboard {
108
+ name: string;
109
+
110
+ id?: number;
111
+
112
+ space?: number;
113
+
114
+ readonly created_at?: string;
115
+
116
+ readonly updated_at?: string;
117
+ }
118
+
119
+ export type DashboardListResponse = ListResponse<Dashboard>;
120
+
121
+ export interface DashboardCreateParams {
122
+ /**
123
+ * Body param:
124
+ */
125
+ name: string;
126
+ }
127
+
128
+ export interface DashboardUpdateParams {
129
+ /**
130
+ * Body param:
131
+ */
132
+ name: string;
133
+ }
134
+
135
+ /** ------------------------------------
136
+ * Widget type
137
+ ---------------------------------------*/
138
+ export interface Widget {
139
+ readonly id?: number;
140
+
141
+ configuration: any;
142
+
143
+ readonly dashboard?: number;
144
+
145
+ readonly created_at?: string;
146
+
147
+ readonly updated_at?: string;
148
+ }
149
+
150
+ export type WidgetListResponse = Array<Widget>;
151
+
152
+ export interface WidgetCreateParams {
153
+ /**
154
+ * Body param:
155
+ */
156
+ configuration: any;
157
+ }
158
+
159
+ export interface WidgetUpdateParams {
160
+ /**
161
+ * Body param:
162
+ */
163
+ configuration: any;
164
+ }
165
+
166
+ export interface WidgetListParams {
167
+ /**
168
+ * Query param: Which field to use when ordering the results.
169
+ */
170
+ ordering?: string;
171
+ }
@@ -0,0 +1,142 @@
1
+ import { APIResource } from '../../resource';
2
+ import { ListParamsResponse, ListResponse } from '../../types/api';
3
+ import * as Core from '../../core';
4
+
5
+ export class DeviceStates extends APIResource {
6
+ retrieveDaily(params: DailyRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<DailyRetrieveResponse> {
7
+ const { ...query } = params;
8
+ return this._client.get(`/device-states/daily`, {
9
+ query,
10
+ ...options,
11
+ headers: { ...options?.headers },
12
+ });
13
+ }
14
+
15
+ retrieveHourly(params: HourlyRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<HourlyRetrieveResponse> {
16
+ const { ...query } = params;
17
+ return this._client.get(`/device-states/hourly`, {
18
+ query,
19
+ ...options,
20
+ headers: { ...options?.headers },
21
+ });
22
+ }
23
+
24
+ retrieveMinutely(params: MinutelyRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<MinutelyRetrieveResponse> {
25
+ const { ...query } = params;
26
+ return this._client.get(`/device-states/minutely`, {
27
+ query,
28
+ ...options,
29
+ headers: { ...options?.headers },
30
+ });
31
+ }
32
+
33
+ retrieveMonthly(params: MonthlyRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<MonthlyRetrieveResponse> {
34
+ const { ...query } = params;
35
+ return this._client.get(`/device-states/monthly`, {
36
+ query,
37
+ ...options,
38
+ headers: { ...options?.headers },
39
+ });
40
+ }
41
+ }
42
+
43
+ export type DeviceStateListResponse<T> = ListResponse<T>;
44
+
45
+ export interface DeviceStateListParams extends Omit<ListParamsResponse, 'search'> {
46
+ /**
47
+ * Query param: device_slug_name
48
+ */
49
+ device_slug_name?: string;
50
+
51
+ /**
52
+ * Query param: state_name
53
+ */
54
+ state_name?: string;
55
+ }
56
+
57
+ export type DailyRetrieveResponse = DeviceStateListResponse<DailyRetrieveResult>;
58
+
59
+ export interface DailyRetrieveResult {
60
+ device_slug_name: string;
61
+
62
+ from_timestamp: string;
63
+
64
+ space: number;
65
+
66
+ state_name: string;
67
+
68
+ value: string;
69
+
70
+ id?: number;
71
+
72
+ readonly created_at?: string;
73
+
74
+ readonly updated_at?: string;
75
+ }
76
+
77
+ export type DailyRetrieveParams = DeviceStateListParams;
78
+
79
+ export type MinutelyRetrieveResponse = ListResponse<MinutelyRetrieveResult>;
80
+
81
+ export interface MinutelyRetrieveResult {
82
+ device_slug_name: string;
83
+
84
+ from_timestamp: string;
85
+
86
+ space: number;
87
+
88
+ state_name: string;
89
+
90
+ value: string;
91
+
92
+ id?: number;
93
+
94
+ readonly created_at?: string;
95
+
96
+ readonly updated_at?: string;
97
+ }
98
+
99
+ export type MinutelyRetrieveParams = DeviceStateListParams;
100
+
101
+ export type MonthlyRetrieveResponse = ListResponse<MonthlyRetrieveResult>;
102
+
103
+ export interface MonthlyRetrieveResult {
104
+ device_slug_name: string;
105
+
106
+ from_timestamp: string;
107
+
108
+ space: number;
109
+
110
+ state_name: string;
111
+
112
+ value: string;
113
+
114
+ id?: number;
115
+
116
+ readonly created_at?: string;
117
+
118
+ readonly updated_at?: string;
119
+ }
120
+
121
+ export type MonthlyRetrieveParams = DeviceStateListParams;
122
+
123
+ export type HourlyRetrieveResponse = ListResponse<HourlyRetrieveResult>;
124
+ export interface HourlyRetrieveResult {
125
+ device_slug_name: string;
126
+
127
+ from_timestamp: string;
128
+
129
+ space: number;
130
+
131
+ state_name: string;
132
+
133
+ value: string;
134
+
135
+ id?: number;
136
+
137
+ readonly created_at?: string;
138
+
139
+ readonly updated_at?: string;
140
+ }
141
+
142
+ export type HourlyRetrieveParams = DeviceStateListParams;