camstreamerlib 4.0.0-beta.119 → 4.0.0-beta.120

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 (75) hide show
  1. package/cjs/CamOverlayAPI.d.ts +83 -91
  2. package/cjs/CamOverlayAPI.js +10 -62
  3. package/cjs/CamScripterAPI.d.ts +4 -8
  4. package/cjs/CamScripterAPI.js +4 -29
  5. package/cjs/CamStreamerAPI.d.ts +1427 -1596
  6. package/cjs/CamStreamerAPI.js +7 -76
  7. package/cjs/CamSwitcherAPI.d.ts +18 -21
  8. package/cjs/CamSwitcherAPI.js +5 -26
  9. package/cjs/PlaneTrackerAPI.d.ts +9 -15
  10. package/cjs/PlaneTrackerAPI.js +6 -69
  11. package/cjs/internal/BasicAPI.d.ts +15 -0
  12. package/cjs/internal/BasicAPI.js +97 -0
  13. package/cjs/internal/versionCompare.d.ts +2 -2
  14. package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +296 -296
  15. package/cjs/types/CamOverlayAPI/accuweatherSchema.d.ts +6 -6
  16. package/cjs/types/CamOverlayAPI/customGraphicsSchema.d.ts +26 -26
  17. package/cjs/types/CamOverlayAPI/imagesSchema.d.ts +8 -8
  18. package/cjs/types/CamOverlayAPI/infotickerSchema.d.ts +6 -6
  19. package/cjs/types/CamOverlayAPI/pipSchema.d.ts +6 -6
  20. package/cjs/types/CamOverlayAPI/ptzCompassSchema.d.ts +6 -6
  21. package/cjs/types/CamOverlayAPI/ptzSchema.d.ts +11 -11
  22. package/cjs/types/CamOverlayAPI/scoreBoardSchema.d.ts +18 -18
  23. package/cjs/types/CamOverlayAPI/screenSharingSchema.d.ts +6 -6
  24. package/cjs/types/CamOverlayAPI/serviceCommonTypes.d.ts +12 -12
  25. package/cjs/types/CamOverlayAPI/webCameraSharingSchema.d.ts +6 -6
  26. package/cjs/types/CamStreamerAPI/CamStreamerAPI.d.ts +7796 -9156
  27. package/cjs/types/CamStreamerAPI/facebookSchema.d.ts +146 -174
  28. package/cjs/types/CamStreamerAPI/oldStreamSchema.d.ts +22 -22
  29. package/cjs/types/CamStreamerAPI/streamCommonTypes.d.ts +140 -168
  30. package/cjs/types/CamStreamerAPI/streamCommonTypes.js +22 -32
  31. package/cjs/types/CamStreamerAPI/streamsSchema.d.ts +2513 -3017
  32. package/cjs/types/CamStreamerAPI/windySchema.d.ts +138 -166
  33. package/cjs/types/CamStreamerAPI/youtubeSchema.d.ts +148 -176
  34. package/cjs/types/CamSwitcherAPI.d.ts +66 -66
  35. package/cjs/types/PlaneTrackerAPI.d.ts +12 -12
  36. package/cjs/types/ws/CamStreamerEvents.d.ts +8 -8
  37. package/cjs/types/ws/CamSwitcherEvents.d.ts +8 -8
  38. package/esm/CamOverlayAPI.js +11 -63
  39. package/esm/CamScripterAPI.js +4 -29
  40. package/esm/CamStreamerAPI.js +8 -77
  41. package/esm/CamSwitcherAPI.js +6 -27
  42. package/esm/PlaneTrackerAPI.js +7 -70
  43. package/esm/internal/BasicAPI.js +93 -0
  44. package/esm/types/CamStreamerAPI/streamCommonTypes.js +22 -32
  45. package/package.json +1 -1
  46. package/types/CamOverlayAPI.d.ts +83 -91
  47. package/types/CamScripterAPI.d.ts +4 -8
  48. package/types/CamStreamerAPI.d.ts +1427 -1596
  49. package/types/CamSwitcherAPI.d.ts +18 -21
  50. package/types/PlaneTrackerAPI.d.ts +9 -15
  51. package/types/internal/BasicAPI.d.ts +15 -0
  52. package/types/internal/versionCompare.d.ts +2 -2
  53. package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +296 -296
  54. package/types/types/CamOverlayAPI/accuweatherSchema.d.ts +6 -6
  55. package/types/types/CamOverlayAPI/customGraphicsSchema.d.ts +26 -26
  56. package/types/types/CamOverlayAPI/imagesSchema.d.ts +8 -8
  57. package/types/types/CamOverlayAPI/infotickerSchema.d.ts +6 -6
  58. package/types/types/CamOverlayAPI/pipSchema.d.ts +6 -6
  59. package/types/types/CamOverlayAPI/ptzCompassSchema.d.ts +6 -6
  60. package/types/types/CamOverlayAPI/ptzSchema.d.ts +11 -11
  61. package/types/types/CamOverlayAPI/scoreBoardSchema.d.ts +18 -18
  62. package/types/types/CamOverlayAPI/screenSharingSchema.d.ts +6 -6
  63. package/types/types/CamOverlayAPI/serviceCommonTypes.d.ts +12 -12
  64. package/types/types/CamOverlayAPI/webCameraSharingSchema.d.ts +6 -6
  65. package/types/types/CamStreamerAPI/CamStreamerAPI.d.ts +7796 -9156
  66. package/types/types/CamStreamerAPI/facebookSchema.d.ts +146 -174
  67. package/types/types/CamStreamerAPI/oldStreamSchema.d.ts +22 -22
  68. package/types/types/CamStreamerAPI/streamCommonTypes.d.ts +140 -168
  69. package/types/types/CamStreamerAPI/streamsSchema.d.ts +2513 -3017
  70. package/types/types/CamStreamerAPI/windySchema.d.ts +138 -166
  71. package/types/types/CamStreamerAPI/youtubeSchema.d.ts +148 -176
  72. package/types/types/CamSwitcherAPI.d.ts +66 -66
  73. package/types/types/PlaneTrackerAPI.d.ts +12 -12
  74. package/types/types/ws/CamStreamerEvents.d.ts +8 -8
  75. package/types/types/ws/CamSwitcherEvents.d.ts +8 -8
@@ -1,20 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CamScripterAPI = void 0;
4
- const errors_1 = require("./errors/errors");
5
- const ProxyClient_1 = require("./internal/ProxyClient");
4
+ const BasicAPI_1 = require("./internal/BasicAPI");
6
5
  const CamScripterAPI_1 = require("./types/CamScripterAPI");
7
6
  const common_1 = require("./types/common");
8
7
  const BASE_PATH = '/local/camscripter';
9
- class CamScripterAPI {
10
- client;
11
- constructor(client) {
12
- this.client = client;
13
- }
8
+ class CamScripterAPI extends BasicAPI_1.BasicAPI {
14
9
  static getProxyPath = () => `${BASE_PATH}/proxy.cgi`;
15
- getClient(proxyParams) {
16
- return proxyParams ? new ProxyClient_1.ProxyClient(this.client, proxyParams) : this.client;
17
- }
18
10
  async checkAPIAvailable(options) {
19
11
  await this._getJson(`${BASE_PATH}/api_check.cgi`, undefined, options);
20
12
  }
@@ -59,25 +51,8 @@ class CamScripterAPI {
59
51
  async installNodejs(storage, options) {
60
52
  await this._getJson(`${BASE_PATH}/node_update.cgi`, { storage: storage }, options);
61
53
  }
62
- async _getJson(path, parameters, options) {
63
- const agent = this.getClient(options?.proxyParams);
64
- const res = await agent.get({ path, parameters, timeout: options?.timeout });
65
- if (res.ok) {
66
- return await res.json();
67
- }
68
- else {
69
- throw new errors_1.ErrorWithResponse(res);
70
- }
71
- }
72
- async _post(path, data, parameters, options, headers) {
73
- const agent = this.getClient(options?.proxyParams);
74
- const res = await agent.post({ path, data, parameters, headers, timeout: options?.timeout });
75
- if (res.ok) {
76
- return await res.json();
77
- }
78
- else {
79
- throw new errors_1.ErrorWithResponse(res);
80
- }
54
+ downloadReport(options) {
55
+ return this._getText(`${BASE_PATH}/report.cgi`, undefined, options);
81
56
  }
82
57
  }
83
58
  exports.CamScripterAPI = CamScripterAPI;