@flowcore/sdk 1.6.0 → 1.7.0
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/CHANGELOG.md +7 -0
- package/esm/common/flowcore-client.d.ts +5 -0
- package/esm/common/flowcore-client.d.ts.map +1 -1
- package/esm/common/flowcore-client.js +14 -1
- package/esm/exceptions/index.d.ts +1 -0
- package/esm/exceptions/index.d.ts.map +1 -1
- package/esm/exceptions/index.js +1 -0
- package/package.json +1 -1
- package/script/common/flowcore-client.d.ts +5 -0
- package/script/common/flowcore-client.d.ts.map +1 -1
- package/script/common/flowcore-client.js +14 -1
- package/script/exceptions/index.d.ts +1 -0
- package/script/exceptions/index.d.ts.map +1 -1
- package/script/exceptions/index.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.7.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.6.0...v1.7.0) (2025-01-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* added method to override and exported command error ([e78a053](https://github.com/flowcore-io/flowcore-sdk/commit/e78a0534283d483ecac1c6bcd35637d452240380))
|
|
9
|
+
|
|
3
10
|
## [1.6.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.5.0...v1.6.0) (2024-12-31)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -33,6 +33,7 @@ export type ClientOptions = ClientOptionsBearer | ClientOptionsApiKey;
|
|
|
33
33
|
export declare class FlowcoreClient {
|
|
34
34
|
private readonly options;
|
|
35
35
|
private mode;
|
|
36
|
+
private baseUrl;
|
|
36
37
|
constructor(options: ClientOptions);
|
|
37
38
|
/**
|
|
38
39
|
* Get the auth header
|
|
@@ -42,6 +43,10 @@ export declare class FlowcoreClient {
|
|
|
42
43
|
* Execute a command (inner method)
|
|
43
44
|
*/
|
|
44
45
|
private innerExecute;
|
|
46
|
+
/**
|
|
47
|
+
* Override the base URL for all commands
|
|
48
|
+
*/
|
|
49
|
+
setBaseUrl(baseUrl: string): void;
|
|
45
50
|
/**
|
|
46
51
|
* Execute a command
|
|
47
52
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowcore-client.d.ts","sourceRoot":"","sources":["../../src/common/flowcore-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAI3C;;GAEG;AACH,UAAU,mBAAmB;IAC3B,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;IAC5D,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,MAAM,CAAA;KACnB,GAAG,IAAI,CAAA;CACT;AAED;;GAEG;AACH,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,KAAK,CAAA;IACtB,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,MAAM,CAAA;KACnB,GAAG,IAAI,CAAA;CACT;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,mBAAmB,CAAA;AAErE;;GAEG;AACH,qBAAa,cAAc;
|
|
1
|
+
{"version":3,"file":"flowcore-client.d.ts","sourceRoot":"","sources":["../../src/common/flowcore-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAI3C;;GAEG;AACH,UAAU,mBAAmB;IAC3B,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;IAC5D,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,MAAM,CAAA;KACnB,GAAG,IAAI,CAAA;CACT;AAED;;GAEG;AACH,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,KAAK,CAAA;IACtB,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,MAAM,CAAA;KACnB,GAAG,IAAI,CAAA;CACT;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,mBAAmB,CAAA;AAErE;;GAEG;AACH,qBAAa,cAAc;IAIb,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHpC,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,OAAO,CAAoB;gBAEN,OAAO,EAAE,aAAa;IAiBnD;;OAEG;YACW,aAAa;IAc3B;;OAEG;YACW,YAAY;IA0D1B;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIjC;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAGzE"}
|
|
@@ -18,6 +18,12 @@ export class FlowcoreClient {
|
|
|
18
18
|
writable: true,
|
|
19
19
|
value: void 0
|
|
20
20
|
});
|
|
21
|
+
Object.defineProperty(this, "baseUrl", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true,
|
|
25
|
+
value: void 0
|
|
26
|
+
});
|
|
21
27
|
if (this.options.getBearerToken) {
|
|
22
28
|
this.mode = "bearer";
|
|
23
29
|
}
|
|
@@ -60,8 +66,9 @@ export class FlowcoreClient {
|
|
|
60
66
|
}
|
|
61
67
|
const authHeader = await this.getAuthHeader();
|
|
62
68
|
let response;
|
|
69
|
+
const url = this.baseUrl ? this.baseUrl + request.path : request.baseUrl + request.path;
|
|
63
70
|
try {
|
|
64
|
-
response = await fetch(
|
|
71
|
+
response = await fetch(url, {
|
|
65
72
|
method: request.method,
|
|
66
73
|
headers: {
|
|
67
74
|
...request.headers,
|
|
@@ -97,6 +104,12 @@ export class FlowcoreClient {
|
|
|
97
104
|
const parsedBody = await request.parseResponse(body, this);
|
|
98
105
|
return request.waitForResponse(this, parsedBody);
|
|
99
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Override the base URL for all commands
|
|
109
|
+
*/
|
|
110
|
+
setBaseUrl(baseUrl) {
|
|
111
|
+
this.baseUrl = baseUrl;
|
|
112
|
+
}
|
|
100
113
|
/**
|
|
101
114
|
* Execute a command
|
|
102
115
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA"}
|
package/esm/exceptions/index.js
CHANGED
package/package.json
CHANGED
|
@@ -33,6 +33,7 @@ export type ClientOptions = ClientOptionsBearer | ClientOptionsApiKey;
|
|
|
33
33
|
export declare class FlowcoreClient {
|
|
34
34
|
private readonly options;
|
|
35
35
|
private mode;
|
|
36
|
+
private baseUrl;
|
|
36
37
|
constructor(options: ClientOptions);
|
|
37
38
|
/**
|
|
38
39
|
* Get the auth header
|
|
@@ -42,6 +43,10 @@ export declare class FlowcoreClient {
|
|
|
42
43
|
* Execute a command (inner method)
|
|
43
44
|
*/
|
|
44
45
|
private innerExecute;
|
|
46
|
+
/**
|
|
47
|
+
* Override the base URL for all commands
|
|
48
|
+
*/
|
|
49
|
+
setBaseUrl(baseUrl: string): void;
|
|
45
50
|
/**
|
|
46
51
|
* Execute a command
|
|
47
52
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowcore-client.d.ts","sourceRoot":"","sources":["../../src/common/flowcore-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAI3C;;GAEG;AACH,UAAU,mBAAmB;IAC3B,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;IAC5D,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,MAAM,CAAA;KACnB,GAAG,IAAI,CAAA;CACT;AAED;;GAEG;AACH,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,KAAK,CAAA;IACtB,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,MAAM,CAAA;KACnB,GAAG,IAAI,CAAA;CACT;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,mBAAmB,CAAA;AAErE;;GAEG;AACH,qBAAa,cAAc;
|
|
1
|
+
{"version":3,"file":"flowcore-client.d.ts","sourceRoot":"","sources":["../../src/common/flowcore-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAI3C;;GAEG;AACH,UAAU,mBAAmB;IAC3B,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;IAC5D,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,MAAM,CAAA;KACnB,GAAG,IAAI,CAAA;CACT;AAED;;GAEG;AACH,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,KAAK,CAAA;IACtB,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,MAAM,CAAA;KACnB,GAAG,IAAI,CAAA;CACT;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,mBAAmB,CAAA;AAErE;;GAEG;AACH,qBAAa,cAAc;IAIb,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHpC,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,OAAO,CAAoB;gBAEN,OAAO,EAAE,aAAa;IAiBnD;;OAEG;YACW,aAAa;IAc3B;;OAEG;YACW,YAAY;IA0D1B;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIjC;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAGzE"}
|
|
@@ -21,6 +21,12 @@ class FlowcoreClient {
|
|
|
21
21
|
writable: true,
|
|
22
22
|
value: void 0
|
|
23
23
|
});
|
|
24
|
+
Object.defineProperty(this, "baseUrl", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
writable: true,
|
|
28
|
+
value: void 0
|
|
29
|
+
});
|
|
24
30
|
if (this.options.getBearerToken) {
|
|
25
31
|
this.mode = "bearer";
|
|
26
32
|
}
|
|
@@ -63,8 +69,9 @@ class FlowcoreClient {
|
|
|
63
69
|
}
|
|
64
70
|
const authHeader = await this.getAuthHeader();
|
|
65
71
|
let response;
|
|
72
|
+
const url = this.baseUrl ? this.baseUrl + request.path : request.baseUrl + request.path;
|
|
66
73
|
try {
|
|
67
|
-
response = await fetch(
|
|
74
|
+
response = await fetch(url, {
|
|
68
75
|
method: request.method,
|
|
69
76
|
headers: {
|
|
70
77
|
...request.headers,
|
|
@@ -100,6 +107,12 @@ class FlowcoreClient {
|
|
|
100
107
|
const parsedBody = await request.parseResponse(body, this);
|
|
101
108
|
return request.waitForResponse(this, parsedBody);
|
|
102
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Override the base URL for all commands
|
|
112
|
+
*/
|
|
113
|
+
setBaseUrl(baseUrl) {
|
|
114
|
+
this.baseUrl = baseUrl;
|
|
115
|
+
}
|
|
103
116
|
/**
|
|
104
117
|
* Execute a command
|
|
105
118
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA"}
|
|
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./client-error.js"), exports);
|
|
18
18
|
__exportStar(require("./invalid-response.js"), exports);
|
|
19
19
|
__exportStar(require("./not-found.js"), exports);
|
|
20
|
+
__exportStar(require("./command-error.js"), exports);
|