camstreamerlib 4.0.0-beta.126 → 4.0.0-beta.127
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/VapixAPI.d.ts +2 -2
- package/cjs/VapixAPI.js +15 -2
- package/esm/VapixAPI.js +15 -2
- package/package.json +1 -1
- package/types/VapixAPI.d.ts +2 -2
package/cjs/VapixAPI.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IClient,
|
|
1
|
+
import { IClient, TResponse } from './internal/types';
|
|
2
2
|
import { TAudioDevice, TPortSetSchema, TPortSequenceStateSchema } from './types/VapixAPI';
|
|
3
3
|
import { TCameraImageConfig, THttpRequestOptions } from './types/common';
|
|
4
4
|
import { BasicAPI } from './internal/BasicAPI';
|
|
@@ -8,7 +8,7 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> extends Ba
|
|
|
8
8
|
new (form?: HTMLFormElement | undefined, submitter?: HTMLElement | null | undefined): FormData;
|
|
9
9
|
prototype: FormData;
|
|
10
10
|
});
|
|
11
|
-
postJson: (path: string, data: string
|
|
11
|
+
postJson: (path: string, data: Record<string, any>, headers?: Record<string, string>, options?: THttpRequestOptions) => Promise<TResponse>;
|
|
12
12
|
getCameraImage(parameters: TCameraImageConfig, options?: THttpRequestOptions): Promise<ReturnType<Client["get"]>>;
|
|
13
13
|
getEventDeclarations(options?: THttpRequestOptions): Promise<string>;
|
|
14
14
|
getSupportedAudioSampleRate(options?: THttpRequestOptions): Promise<{
|
package/cjs/VapixAPI.js
CHANGED
|
@@ -13,8 +13,21 @@ class VapixAPI extends BasicAPI_1.BasicAPI {
|
|
|
13
13
|
super(client);
|
|
14
14
|
this.CustomFormData = CustomFormData;
|
|
15
15
|
}
|
|
16
|
-
postJson = (path, data,
|
|
17
|
-
|
|
16
|
+
postJson = async (path, data, headers, options) => {
|
|
17
|
+
const agent = this.getClient(options?.proxyParams);
|
|
18
|
+
const jsonData = JSON.stringify(data);
|
|
19
|
+
const res = await agent.post({
|
|
20
|
+
path,
|
|
21
|
+
data: jsonData,
|
|
22
|
+
headers: { ...headers, 'Content-Type': 'application/json' },
|
|
23
|
+
timeout: options?.timeout,
|
|
24
|
+
});
|
|
25
|
+
if (res.ok) {
|
|
26
|
+
return res;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
throw new errors_1.ErrorWithResponse(res);
|
|
30
|
+
}
|
|
18
31
|
};
|
|
19
32
|
async getCameraImage(parameters, options) {
|
|
20
33
|
const agent = this.getClient(options?.proxyParams);
|
package/esm/VapixAPI.js
CHANGED
|
@@ -10,8 +10,21 @@ export class VapixAPI extends BasicAPI {
|
|
|
10
10
|
super(client);
|
|
11
11
|
this.CustomFormData = CustomFormData;
|
|
12
12
|
}
|
|
13
|
-
postJson = (path, data,
|
|
14
|
-
|
|
13
|
+
postJson = async (path, data, headers, options) => {
|
|
14
|
+
const agent = this.getClient(options?.proxyParams);
|
|
15
|
+
const jsonData = JSON.stringify(data);
|
|
16
|
+
const res = await agent.post({
|
|
17
|
+
path,
|
|
18
|
+
data: jsonData,
|
|
19
|
+
headers: { ...headers, 'Content-Type': 'application/json' },
|
|
20
|
+
timeout: options?.timeout,
|
|
21
|
+
});
|
|
22
|
+
if (res.ok) {
|
|
23
|
+
return res;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
throw new ErrorWithResponse(res);
|
|
27
|
+
}
|
|
15
28
|
};
|
|
16
29
|
async getCameraImage(parameters, options) {
|
|
17
30
|
const agent = this.getClient(options?.proxyParams);
|
package/package.json
CHANGED
package/types/VapixAPI.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IClient,
|
|
1
|
+
import { IClient, TResponse } from './internal/types';
|
|
2
2
|
import { TAudioDevice, TPortSetSchema, TPortSequenceStateSchema } from './types/VapixAPI';
|
|
3
3
|
import { TCameraImageConfig, THttpRequestOptions } from './types/common';
|
|
4
4
|
import { BasicAPI } from './internal/BasicAPI';
|
|
@@ -8,7 +8,7 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> extends Ba
|
|
|
8
8
|
new (form?: HTMLFormElement | undefined, submitter?: HTMLElement | null | undefined): FormData;
|
|
9
9
|
prototype: FormData;
|
|
10
10
|
});
|
|
11
|
-
postJson: (path: string, data: string
|
|
11
|
+
postJson: (path: string, data: Record<string, any>, headers?: Record<string, string>, options?: THttpRequestOptions) => Promise<TResponse>;
|
|
12
12
|
getCameraImage(parameters: TCameraImageConfig, options?: THttpRequestOptions): Promise<ReturnType<Client["get"]>>;
|
|
13
13
|
getEventDeclarations(options?: THttpRequestOptions): Promise<string>;
|
|
14
14
|
getSupportedAudioSampleRate(options?: THttpRequestOptions): Promise<{
|