camstreamerlib 4.0.0-beta.112 → 4.0.0-beta.113
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/CamStreamerAPI.d.ts +2 -0
- package/cjs/CamStreamerAPI.js +13 -0
- package/esm/CamStreamerAPI.js +13 -0
- package/package.json +1 -1
- package/types/CamStreamerAPI.d.ts +2 -0
package/cjs/CamStreamerAPI.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
|
|
|
14
14
|
getUtcTime(options?: THttpRequestOptions): Promise<number>;
|
|
15
15
|
getMaxFps(source?: number, options?: THttpRequestOptions): Promise<any>;
|
|
16
16
|
isCSPassValid(pass: string, options?: THttpRequestOptions): Promise<boolean>;
|
|
17
|
+
getCamStreamerAppLog(options?: THttpRequestOptions): Promise<string>;
|
|
17
18
|
getStreamList(options?: THttpRequestOptions): Promise<({
|
|
18
19
|
post: {
|
|
19
20
|
postLocation: "timeline";
|
|
@@ -2279,6 +2280,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
|
|
|
2279
2280
|
})[]>;
|
|
2280
2281
|
getFileFromCamera(path: string, options?: THttpRequestOptions): Promise<TBlobResponse<Client>>;
|
|
2281
2282
|
private _getJson;
|
|
2283
|
+
private _getText;
|
|
2282
2284
|
private _getBlob;
|
|
2283
2285
|
private parseBlobResponse;
|
|
2284
2286
|
private _postUrlEncoded;
|
package/cjs/CamStreamerAPI.js
CHANGED
|
@@ -42,6 +42,9 @@ class CamStreamerAPI {
|
|
|
42
42
|
const res = await this._getJson(`${BASE_PATH}/check_pass.cgi`, { pass }, options);
|
|
43
43
|
return res.data === '1';
|
|
44
44
|
}
|
|
45
|
+
async getCamStreamerAppLog(options) {
|
|
46
|
+
return await this._getText(`${BASE_PATH}/view_log.cgi`, undefined, options);
|
|
47
|
+
}
|
|
45
48
|
async getStreamList(options) {
|
|
46
49
|
const res = await this._getJson(`${BASE_PATH}/stream_list.cgi`, { action: 'get' }, options);
|
|
47
50
|
const oldStreamListRecord = zod_1.z.record(zod_1.z.string(), oldStreamSchema_1.oldStringStreamSchema).safeParse(res.data);
|
|
@@ -136,6 +139,16 @@ class CamStreamerAPI {
|
|
|
136
139
|
throw new errors_1.ErrorWithResponse(res);
|
|
137
140
|
}
|
|
138
141
|
}
|
|
142
|
+
async _getText(path, parameters, options) {
|
|
143
|
+
const agent = this.getClient(options?.proxyParams);
|
|
144
|
+
const res = await agent.get({ path, parameters, timeout: options?.timeout });
|
|
145
|
+
if (res.ok) {
|
|
146
|
+
return await res.text();
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
throw new errors_1.ErrorWithResponse(res);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
139
152
|
async _getBlob(path, parameters, options) {
|
|
140
153
|
const agent = this.getClient(options?.proxyParams);
|
|
141
154
|
const res = await agent.get({ path, parameters, timeout: options?.timeout });
|
package/esm/CamStreamerAPI.js
CHANGED
|
@@ -39,6 +39,9 @@ export class CamStreamerAPI {
|
|
|
39
39
|
const res = await this._getJson(`${BASE_PATH}/check_pass.cgi`, { pass }, options);
|
|
40
40
|
return res.data === '1';
|
|
41
41
|
}
|
|
42
|
+
async getCamStreamerAppLog(options) {
|
|
43
|
+
return await this._getText(`${BASE_PATH}/view_log.cgi`, undefined, options);
|
|
44
|
+
}
|
|
42
45
|
async getStreamList(options) {
|
|
43
46
|
const res = await this._getJson(`${BASE_PATH}/stream_list.cgi`, { action: 'get' }, options);
|
|
44
47
|
const oldStreamListRecord = z.record(z.string(), oldStringStreamSchema).safeParse(res.data);
|
|
@@ -133,6 +136,16 @@ export class CamStreamerAPI {
|
|
|
133
136
|
throw new ErrorWithResponse(res);
|
|
134
137
|
}
|
|
135
138
|
}
|
|
139
|
+
async _getText(path, parameters, options) {
|
|
140
|
+
const agent = this.getClient(options?.proxyParams);
|
|
141
|
+
const res = await agent.get({ path, parameters, timeout: options?.timeout });
|
|
142
|
+
if (res.ok) {
|
|
143
|
+
return await res.text();
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
throw new ErrorWithResponse(res);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
136
149
|
async _getBlob(path, parameters, options) {
|
|
137
150
|
const agent = this.getClient(options?.proxyParams);
|
|
138
151
|
const res = await agent.get({ path, parameters, timeout: options?.timeout });
|
package/package.json
CHANGED
|
@@ -14,6 +14,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
|
|
|
14
14
|
getUtcTime(options?: THttpRequestOptions): Promise<number>;
|
|
15
15
|
getMaxFps(source?: number, options?: THttpRequestOptions): Promise<any>;
|
|
16
16
|
isCSPassValid(pass: string, options?: THttpRequestOptions): Promise<boolean>;
|
|
17
|
+
getCamStreamerAppLog(options?: THttpRequestOptions): Promise<string>;
|
|
17
18
|
getStreamList(options?: THttpRequestOptions): Promise<({
|
|
18
19
|
post: {
|
|
19
20
|
postLocation: "timeline";
|
|
@@ -2279,6 +2280,7 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse, any>> {
|
|
|
2279
2280
|
})[]>;
|
|
2280
2281
|
getFileFromCamera(path: string, options?: THttpRequestOptions): Promise<TBlobResponse<Client>>;
|
|
2281
2282
|
private _getJson;
|
|
2283
|
+
private _getText;
|
|
2282
2284
|
private _getBlob;
|
|
2283
2285
|
private parseBlobResponse;
|
|
2284
2286
|
private _postUrlEncoded;
|