camstreamerlib 4.0.33-55dd1f0 → 4.0.33-dfd8bbb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/CamOverlayAPI.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> exten
|
|
|
14
14
|
}[]>;
|
|
15
15
|
wsAuthorization(options?: THttpRequestOptions): Promise<string>;
|
|
16
16
|
getMjpegStreamImage(mjpegUrl: string, options?: THttpRequestOptions): Promise<ReturnType<Awaited<ReturnType<Client["get"]>>["blob"]>>;
|
|
17
|
+
isViewerPassValid(pass: string, options?: THttpRequestOptions): Promise<boolean>;
|
|
17
18
|
listFiles<T extends TFileType>(fileType: T, options?: THttpRequestOptions): Promise<TFileList<T>>;
|
|
18
19
|
uploadFile<T extends TFileType>(fileType: T, formData: Parameters<Client['post']>[0]['data'], storage: TFileStorageType<T>, options?: THttpRequestOptions): Promise<void>;
|
|
19
20
|
removeFile<T extends TFileType>(fileType: T, fileParams: TFile<T>, options?: THttpRequestOptions): Promise<void>;
|
package/cjs/CamOverlayAPI.js
CHANGED
|
@@ -29,6 +29,13 @@ class CamOverlayAPI extends BasicAPI_1.BasicAPI {
|
|
|
29
29
|
async getMjpegStreamImage(mjpegUrl, options) {
|
|
30
30
|
return await this._getBlob(`${BASE_PATH}/fetch_mjpeg_image.cgi`, { mjpeg_url: decodeURIComponent(mjpegUrl) }, options);
|
|
31
31
|
}
|
|
32
|
+
async isViewerPassValid(pass, options) {
|
|
33
|
+
const res = await this._getJson(`${BASE_PATH}/check_pass.cgi`, { pass }, options);
|
|
34
|
+
if (res.status !== 200) {
|
|
35
|
+
throw new Error(res.message);
|
|
36
|
+
}
|
|
37
|
+
return res.data === '1';
|
|
38
|
+
}
|
|
32
39
|
async listFiles(fileType, options) {
|
|
33
40
|
const res = await this._getJson(`${BASE_PATH}/upload_${fileType}.cgi`, { action: 'list' }, options);
|
|
34
41
|
return (0, CamOverlayAPI_1.getFileListSchema)(fileType).parse(res.list);
|
package/esm/CamOverlayAPI.js
CHANGED
|
@@ -26,6 +26,13 @@ export class CamOverlayAPI extends BasicAPI {
|
|
|
26
26
|
async getMjpegStreamImage(mjpegUrl, options) {
|
|
27
27
|
return await this._getBlob(`${BASE_PATH}/fetch_mjpeg_image.cgi`, { mjpeg_url: decodeURIComponent(mjpegUrl) }, options);
|
|
28
28
|
}
|
|
29
|
+
async isViewerPassValid(pass, options) {
|
|
30
|
+
const res = await this._getJson(`${BASE_PATH}/check_pass.cgi`, { pass }, options);
|
|
31
|
+
if (res.status !== 200) {
|
|
32
|
+
throw new Error(res.message);
|
|
33
|
+
}
|
|
34
|
+
return res.data === '1';
|
|
35
|
+
}
|
|
29
36
|
async listFiles(fileType, options) {
|
|
30
37
|
const res = await this._getJson(`${BASE_PATH}/upload_${fileType}.cgi`, { action: 'list' }, options);
|
|
31
38
|
return getFileListSchema(fileType).parse(res.list);
|
package/package.json
CHANGED
package/types/CamOverlayAPI.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> exten
|
|
|
14
14
|
}[]>;
|
|
15
15
|
wsAuthorization(options?: THttpRequestOptions): Promise<string>;
|
|
16
16
|
getMjpegStreamImage(mjpegUrl: string, options?: THttpRequestOptions): Promise<ReturnType<Awaited<ReturnType<Client["get"]>>["blob"]>>;
|
|
17
|
+
isViewerPassValid(pass: string, options?: THttpRequestOptions): Promise<boolean>;
|
|
17
18
|
listFiles<T extends TFileType>(fileType: T, options?: THttpRequestOptions): Promise<TFileList<T>>;
|
|
18
19
|
uploadFile<T extends TFileType>(fileType: T, formData: Parameters<Client['post']>[0]['data'], storage: TFileStorageType<T>, options?: THttpRequestOptions): Promise<void>;
|
|
19
20
|
removeFile<T extends TFileType>(fileType: T, fileParams: TFile<T>, options?: THttpRequestOptions): Promise<void>;
|