yoto-nodejs-client 0.0.1 → 0.0.3

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 (92) hide show
  1. package/README.md +523 -30
  2. package/bin/auth.js +36 -46
  3. package/bin/content.js +0 -0
  4. package/bin/device-model.d.ts +3 -0
  5. package/bin/device-model.d.ts.map +1 -0
  6. package/bin/device-model.js +360 -0
  7. package/bin/device-tui.TODO.md +125 -0
  8. package/bin/device-tui.d.ts +31 -0
  9. package/bin/device-tui.d.ts.map +1 -0
  10. package/bin/device-tui.js +1123 -0
  11. package/bin/devices.js +166 -28
  12. package/bin/groups.js +0 -0
  13. package/bin/icons.js +0 -0
  14. package/bin/lib/cli-helpers.d.ts +33 -1
  15. package/bin/lib/cli-helpers.d.ts.map +1 -1
  16. package/bin/lib/cli-helpers.js +5 -5
  17. package/bin/lib/token-helpers.d.ts +32 -0
  18. package/bin/lib/token-helpers.d.ts.map +1 -1
  19. package/bin/refresh-token.js +6 -6
  20. package/bin/token-info.js +3 -3
  21. package/index.d.ts +4 -217
  22. package/index.d.ts.map +1 -1
  23. package/index.js +11 -689
  24. package/lib/api-client.d.ts +576 -0
  25. package/lib/api-client.d.ts.map +1 -0
  26. package/lib/api-client.js +681 -0
  27. package/lib/api-endpoints/auth.d.ts +280 -4
  28. package/lib/api-endpoints/auth.d.ts.map +1 -1
  29. package/lib/api-endpoints/auth.js +224 -7
  30. package/lib/api-endpoints/auth.test.js +54 -2
  31. package/lib/api-endpoints/constants.d.ts +30 -2
  32. package/lib/api-endpoints/constants.d.ts.map +1 -1
  33. package/lib/api-endpoints/constants.js +17 -10
  34. package/lib/api-endpoints/content.d.ts +760 -0
  35. package/lib/api-endpoints/content.d.ts.map +1 -1
  36. package/lib/api-endpoints/content.test.js +1 -1
  37. package/lib/api-endpoints/devices.d.ts +917 -48
  38. package/lib/api-endpoints/devices.d.ts.map +1 -1
  39. package/lib/api-endpoints/devices.js +114 -52
  40. package/lib/api-endpoints/devices.test.js +1 -1
  41. package/lib/api-endpoints/endpoint-test-helpers.d.ts +28 -0
  42. package/lib/api-endpoints/endpoint-test-helpers.d.ts.map +1 -0
  43. package/lib/api-endpoints/family-library-groups.d.ts +187 -0
  44. package/lib/api-endpoints/family-library-groups.d.ts.map +1 -1
  45. package/lib/api-endpoints/family-library-groups.test.js +1 -1
  46. package/lib/api-endpoints/family.d.ts +88 -0
  47. package/lib/api-endpoints/family.d.ts.map +1 -1
  48. package/lib/api-endpoints/family.test.js +1 -1
  49. package/lib/api-endpoints/helpers.d.ts +37 -3
  50. package/lib/api-endpoints/helpers.d.ts.map +1 -1
  51. package/lib/api-endpoints/icons.d.ts +196 -0
  52. package/lib/api-endpoints/icons.d.ts.map +1 -1
  53. package/lib/api-endpoints/icons.test.js +1 -1
  54. package/lib/api-endpoints/media.d.ts +83 -0
  55. package/lib/api-endpoints/media.d.ts.map +1 -1
  56. package/lib/helpers/power-state.d.ts +53 -0
  57. package/lib/helpers/power-state.d.ts.map +1 -0
  58. package/lib/helpers/power-state.js +73 -0
  59. package/lib/helpers/power-state.test.js +100 -0
  60. package/lib/helpers/temperature.d.ts +24 -0
  61. package/lib/helpers/temperature.d.ts.map +1 -0
  62. package/lib/helpers/temperature.js +61 -0
  63. package/lib/helpers/temperature.test.js +58 -0
  64. package/lib/helpers/typed-keys.d.ts +7 -0
  65. package/lib/helpers/typed-keys.d.ts.map +1 -0
  66. package/lib/helpers/typed-keys.js +8 -0
  67. package/lib/mqtt/client.d.ts +610 -7
  68. package/lib/mqtt/client.d.ts.map +1 -1
  69. package/lib/mqtt/client.js +213 -31
  70. package/lib/mqtt/commands.d.ts +195 -0
  71. package/lib/mqtt/commands.d.ts.map +1 -1
  72. package/lib/mqtt/factory.d.ts +62 -1
  73. package/lib/mqtt/factory.d.ts.map +1 -1
  74. package/lib/mqtt/factory.js +27 -5
  75. package/lib/mqtt/mqtt.test.js +85 -28
  76. package/lib/mqtt/topics.d.ts +186 -1
  77. package/lib/mqtt/topics.d.ts.map +1 -1
  78. package/lib/mqtt/topics.js +54 -20
  79. package/lib/pkg.d.cts +9 -0
  80. package/lib/token.d.ts +106 -3
  81. package/lib/token.d.ts.map +1 -1
  82. package/lib/token.js +30 -23
  83. package/lib/yoto-account.d.ts +163 -0
  84. package/lib/yoto-account.d.ts.map +1 -0
  85. package/lib/yoto-account.js +340 -0
  86. package/lib/yoto-device.d.ts +656 -0
  87. package/lib/yoto-device.d.ts.map +1 -0
  88. package/lib/yoto-device.js +2850 -0
  89. package/package.json +22 -15
  90. package/lib/api-endpoints/test-helpers.d.ts +0 -7
  91. package/lib/api-endpoints/test-helpers.d.ts.map +0 -1
  92. /package/lib/api-endpoints/{test-helpers.js → endpoint-test-helpers.js} +0 -0
@@ -1,6 +1,34 @@
1
+ /**
2
+ * Default OAuth client ID for testing and development
3
+ * This is a public client ID for the app "yoto-nodejs-client".
4
+ * Generate a new one at https://dashboard.yoto.dev or use the default.
5
+ * @constant {string}
6
+ */
1
7
  export const DEFAULT_CLIENT_ID: "ix91Qy0B4uA8187JhI0tQbQQ5I5nUKYh";
2
- export const DEFAULT_AUDIENCE: "https://api.yotoplay.com";
3
- export const DEFAULT_SCOPE: "openid profile offline_access";
8
+ /**
9
+ * Yoto API base URL
10
+ * @constant {string}
11
+ */
4
12
  export const YOTO_API_URL: "https://api.yotoplay.com";
13
+ /**
14
+ * Yoto login/authentication base URL
15
+ * @constant {string}
16
+ */
5
17
  export const YOTO_LOGIN_URL: "https://login.yotoplay.com";
18
+ /**
19
+ * Default OAuth audience for Yoto API
20
+ * @constant {string}
21
+ */
22
+ export const DEFAULT_AUDIENCE: "https://api.yotoplay.com";
23
+ /**
24
+ * Default OAuth scope for Yoto API
25
+ * Includes OpenID Connect, profile information, and offline access (refresh tokens)
26
+ * @constant {string}
27
+ */
28
+ export const DEFAULT_SCOPE: "openid profile offline_access";
29
+ /**
30
+ * OAuth device code grant type
31
+ * @constant {string}
32
+ */
33
+ export const DEVICE_CODE_GRANT_TYPE: "urn:ietf:params:oauth:grant-type:device_code";
6
34
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.js"],"names":[],"mappings":"AAKA,gCAAiC,kCAAkC,CAAA;AAMnE,+BAAgC,0BAA0B,CAAA;AAO1D,4BAA6B,+BAA+B,CAAA;AAM5D,2BAA4B,0BAA0B,CAAA;AAMtD,6BAA8B,4BAA4B,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,gCAAiC,kCAAkC,CAAA;AAEnE;;;GAGG;AACH,2BAA4B,0BAA0B,CAAA;AAEtD;;;GAGG;AACH,6BAA8B,4BAA4B,CAAA;AAE1D;;;GAGG;AACH,0DAA4C;AAE5C;;;;GAIG;AACH,4BAA6B,+BAA+B,CAAA;AAE5D;;;GAGG;AACH,qCAAsC,8CAA8C,CAAA"}
@@ -1,31 +1,38 @@
1
1
  /**
2
2
  * Default OAuth client ID for testing and development
3
- * This is a public client ID provided by Yoto for development purposes
3
+ * This is a public client ID for the app "yoto-nodejs-client".
4
+ * Generate a new one at https://dashboard.yoto.dev or use the default.
4
5
  * @constant {string}
5
6
  */
6
7
  export const DEFAULT_CLIENT_ID = 'ix91Qy0B4uA8187JhI0tQbQQ5I5nUKYh'
7
8
 
8
9
  /**
9
- * Default OAuth audience for Yoto API
10
+ * Yoto API base URL
10
11
  * @constant {string}
11
12
  */
12
- export const DEFAULT_AUDIENCE = 'https://api.yotoplay.com'
13
+ export const YOTO_API_URL = 'https://api.yotoplay.com'
13
14
 
14
15
  /**
15
- * Default OAuth scope for Yoto API
16
- * Includes OpenID Connect, profile information, and offline access (refresh tokens)
16
+ * Yoto login/authentication base URL
17
17
  * @constant {string}
18
18
  */
19
- export const DEFAULT_SCOPE = 'openid profile offline_access'
19
+ export const YOTO_LOGIN_URL = 'https://login.yotoplay.com'
20
20
 
21
21
  /**
22
- * Yoto API base URL
22
+ * Default OAuth audience for Yoto API
23
23
  * @constant {string}
24
24
  */
25
- export const YOTO_API_URL = 'https://api.yotoplay.com'
25
+ export const DEFAULT_AUDIENCE = YOTO_API_URL
26
26
 
27
27
  /**
28
- * Yoto login/authentication base URL
28
+ * Default OAuth scope for Yoto API
29
+ * Includes OpenID Connect, profile information, and offline access (refresh tokens)
29
30
  * @constant {string}
30
31
  */
31
- export const YOTO_LOGIN_URL = 'https://login.yotoplay.com'
32
+ export const DEFAULT_SCOPE = 'openid profile offline_access'
33
+
34
+ /**
35
+ * OAuth device code grant type
36
+ * @constant {string}
37
+ */
38
+ export const DEVICE_CODE_GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:device_code'