@flowcore/sdk 1.55.1 → 1.55.2
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/commands/tenant/tenant.list.d.ts +13 -17
- package/esm/commands/tenant/tenant.list.d.ts.map +1 -1
- package/esm/commands/tenant/tenant.list.js +20 -66
- package/package.json +1 -1
- package/script/commands/tenant/tenant.list.d.ts +13 -17
- package/script/commands/tenant/tenant.list.d.ts.map +1 -1
- package/script/commands/tenant/tenant.list.js +20 -66
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.55.2](https://github.com/flowcore-io/flowcore-sdk/compare/v1.55.1...v1.55.2) (2025-07-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* tenant list back to rest ([bbddaf1](https://github.com/flowcore-io/flowcore-sdk/commit/bbddaf145d891f270f12e0835040a9df940e276b))
|
|
9
|
+
|
|
3
10
|
## [1.55.1](https://github.com/flowcore-io/flowcore-sdk/compare/v1.55.0...v1.55.1) (2025-07-17)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
displayName: string;
|
|
6
|
-
description: string;
|
|
7
|
-
websiteUrl: string;
|
|
8
|
-
linkType: "OWNER" | "COLLABORATOR";
|
|
9
|
-
}
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { type TenantListItem } from "../../contracts/tenant.js";
|
|
10
3
|
/**
|
|
11
4
|
* List tenants
|
|
12
5
|
*/
|
|
13
|
-
export declare class TenantListCommand extends
|
|
6
|
+
export declare class TenantListCommand extends Command<void, TenantListItem[]> {
|
|
14
7
|
/**
|
|
15
|
-
*
|
|
8
|
+
* Get the method
|
|
16
9
|
*/
|
|
17
|
-
protected
|
|
10
|
+
protected getMethod(): string;
|
|
18
11
|
/**
|
|
19
|
-
*
|
|
12
|
+
* Get the base url
|
|
20
13
|
*/
|
|
21
|
-
protected
|
|
14
|
+
protected getBaseUrl(): string;
|
|
22
15
|
/**
|
|
23
|
-
* Get the
|
|
16
|
+
* Get the path
|
|
24
17
|
*/
|
|
25
|
-
protected
|
|
18
|
+
protected getPath(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Parse the response
|
|
21
|
+
*/
|
|
22
|
+
protected parseResponse(rawResponse: unknown): TenantListItem[];
|
|
26
23
|
}
|
|
27
|
-
export {};
|
|
28
24
|
//# sourceMappingURL=tenant.list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant.list.d.ts","sourceRoot":"","sources":["../../../src/commands/tenant/tenant.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tenant.list.d.ts","sourceRoot":"","sources":["../../../src/commands/tenant/tenant.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,2BAA2B,CAAA;AAGrF;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,CAAC;IACpE;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,cAAc,EAAE;CAIzE"}
|
|
@@ -1,80 +1,34 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import {
|
|
2
|
+
import { Command } from "../../common/command.js";
|
|
3
|
+
import { TenantListItemSchema } from "../../contracts/tenant.js";
|
|
3
4
|
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
|
-
import { CommandError } from "../../exceptions/command-error.js";
|
|
5
|
-
const graphQlQueryById = `
|
|
6
|
-
query FLOWCORE_SDK_TENANT_LIST {
|
|
7
|
-
me {
|
|
8
|
-
organizations {
|
|
9
|
-
linkType
|
|
10
|
-
organization {
|
|
11
|
-
id
|
|
12
|
-
org
|
|
13
|
-
displayName
|
|
14
|
-
description
|
|
15
|
-
website
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
21
|
-
const responseSchema = Type.Object({
|
|
22
|
-
data: Type.Union([
|
|
23
|
-
Type.Object({
|
|
24
|
-
me: Type.Object({
|
|
25
|
-
organizations: Type.Array(Type.Object({
|
|
26
|
-
linkType: Type.Union([Type.Literal("OWNER"), Type.Literal("COLLABORATOR")]),
|
|
27
|
-
organization: Type.Object({
|
|
28
|
-
id: Type.String(),
|
|
29
|
-
org: Type.String(),
|
|
30
|
-
displayName: Type.String(),
|
|
31
|
-
description: Type.String(),
|
|
32
|
-
website: Type.String(),
|
|
33
|
-
}),
|
|
34
|
-
})),
|
|
35
|
-
}),
|
|
36
|
-
}),
|
|
37
|
-
Type.Null(),
|
|
38
|
-
]),
|
|
39
|
-
errors: Type.Optional(Type.Array(Type.Object({
|
|
40
|
-
message: Type.String(),
|
|
41
|
-
path: Type.Optional(Type.Array(Type.String())),
|
|
42
|
-
}))),
|
|
43
|
-
});
|
|
44
5
|
/**
|
|
45
6
|
* List tenants
|
|
46
7
|
*/
|
|
47
|
-
export class TenantListCommand extends
|
|
8
|
+
export class TenantListCommand extends Command {
|
|
48
9
|
/**
|
|
49
|
-
*
|
|
10
|
+
* Get the method
|
|
50
11
|
*/
|
|
51
|
-
|
|
12
|
+
getMethod() {
|
|
13
|
+
return "GET";
|
|
14
|
+
}
|
|
52
15
|
/**
|
|
53
|
-
*
|
|
16
|
+
* Get the base url
|
|
54
17
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (response.errors?.length) {
|
|
58
|
-
throw new CommandError(this.constructor.name, response.errors.map((error) => error.message).join("; "));
|
|
59
|
-
}
|
|
60
|
-
else if (!response.data) {
|
|
61
|
-
throw new CommandError(this.constructor.name, "No data returned from the command");
|
|
62
|
-
}
|
|
63
|
-
return response.data.me.organizations.flatMap((organization) => ({
|
|
64
|
-
id: organization.organization.id,
|
|
65
|
-
name: organization.organization.org,
|
|
66
|
-
displayName: organization.organization.displayName,
|
|
67
|
-
description: organization.organization.description,
|
|
68
|
-
websiteUrl: organization.organization.website,
|
|
69
|
-
linkType: organization.linkType,
|
|
70
|
-
}));
|
|
18
|
+
getBaseUrl() {
|
|
19
|
+
return "https://tenant.api.flowcore.io";
|
|
71
20
|
}
|
|
72
21
|
/**
|
|
73
|
-
* Get the
|
|
22
|
+
* Get the path
|
|
74
23
|
*/
|
|
75
|
-
|
|
76
|
-
return
|
|
77
|
-
|
|
78
|
-
|
|
24
|
+
getPath() {
|
|
25
|
+
return `/api/v1/tenants/list`;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Parse the response
|
|
29
|
+
*/
|
|
30
|
+
parseResponse(rawResponse) {
|
|
31
|
+
const response = parseResponseHelper(Type.Array(TenantListItemSchema), rawResponse);
|
|
32
|
+
return response;
|
|
79
33
|
}
|
|
80
34
|
}
|
package/package.json
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
displayName: string;
|
|
6
|
-
description: string;
|
|
7
|
-
websiteUrl: string;
|
|
8
|
-
linkType: "OWNER" | "COLLABORATOR";
|
|
9
|
-
}
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { type TenantListItem } from "../../contracts/tenant.js";
|
|
10
3
|
/**
|
|
11
4
|
* List tenants
|
|
12
5
|
*/
|
|
13
|
-
export declare class TenantListCommand extends
|
|
6
|
+
export declare class TenantListCommand extends Command<void, TenantListItem[]> {
|
|
14
7
|
/**
|
|
15
|
-
*
|
|
8
|
+
* Get the method
|
|
16
9
|
*/
|
|
17
|
-
protected
|
|
10
|
+
protected getMethod(): string;
|
|
18
11
|
/**
|
|
19
|
-
*
|
|
12
|
+
* Get the base url
|
|
20
13
|
*/
|
|
21
|
-
protected
|
|
14
|
+
protected getBaseUrl(): string;
|
|
22
15
|
/**
|
|
23
|
-
* Get the
|
|
16
|
+
* Get the path
|
|
24
17
|
*/
|
|
25
|
-
protected
|
|
18
|
+
protected getPath(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Parse the response
|
|
21
|
+
*/
|
|
22
|
+
protected parseResponse(rawResponse: unknown): TenantListItem[];
|
|
26
23
|
}
|
|
27
|
-
export {};
|
|
28
24
|
//# sourceMappingURL=tenant.list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant.list.d.ts","sourceRoot":"","sources":["../../../src/commands/tenant/tenant.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tenant.list.d.ts","sourceRoot":"","sources":["../../../src/commands/tenant/tenant.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,2BAA2B,CAAA;AAGrF;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,CAAC;IACpE;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,cAAc,EAAE;CAIzE"}
|
|
@@ -2,83 +2,37 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TenantListCommand = void 0;
|
|
4
4
|
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
-
const
|
|
5
|
+
const command_js_1 = require("../../common/command.js");
|
|
6
|
+
const tenant_js_1 = require("../../contracts/tenant.js");
|
|
6
7
|
const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
|
|
7
|
-
const command_error_js_1 = require("../../exceptions/command-error.js");
|
|
8
|
-
const graphQlQueryById = `
|
|
9
|
-
query FLOWCORE_SDK_TENANT_LIST {
|
|
10
|
-
me {
|
|
11
|
-
organizations {
|
|
12
|
-
linkType
|
|
13
|
-
organization {
|
|
14
|
-
id
|
|
15
|
-
org
|
|
16
|
-
displayName
|
|
17
|
-
description
|
|
18
|
-
website
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
24
|
-
const responseSchema = typebox_1.Type.Object({
|
|
25
|
-
data: typebox_1.Type.Union([
|
|
26
|
-
typebox_1.Type.Object({
|
|
27
|
-
me: typebox_1.Type.Object({
|
|
28
|
-
organizations: typebox_1.Type.Array(typebox_1.Type.Object({
|
|
29
|
-
linkType: typebox_1.Type.Union([typebox_1.Type.Literal("OWNER"), typebox_1.Type.Literal("COLLABORATOR")]),
|
|
30
|
-
organization: typebox_1.Type.Object({
|
|
31
|
-
id: typebox_1.Type.String(),
|
|
32
|
-
org: typebox_1.Type.String(),
|
|
33
|
-
displayName: typebox_1.Type.String(),
|
|
34
|
-
description: typebox_1.Type.String(),
|
|
35
|
-
website: typebox_1.Type.String(),
|
|
36
|
-
}),
|
|
37
|
-
})),
|
|
38
|
-
}),
|
|
39
|
-
}),
|
|
40
|
-
typebox_1.Type.Null(),
|
|
41
|
-
]),
|
|
42
|
-
errors: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
|
|
43
|
-
message: typebox_1.Type.String(),
|
|
44
|
-
path: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())),
|
|
45
|
-
}))),
|
|
46
|
-
});
|
|
47
8
|
/**
|
|
48
9
|
* List tenants
|
|
49
10
|
*/
|
|
50
|
-
class TenantListCommand extends
|
|
11
|
+
class TenantListCommand extends command_js_1.Command {
|
|
51
12
|
/**
|
|
52
|
-
*
|
|
13
|
+
* Get the method
|
|
53
14
|
*/
|
|
54
|
-
|
|
15
|
+
getMethod() {
|
|
16
|
+
return "GET";
|
|
17
|
+
}
|
|
55
18
|
/**
|
|
56
|
-
*
|
|
19
|
+
* Get the base url
|
|
57
20
|
*/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (response.errors?.length) {
|
|
61
|
-
throw new command_error_js_1.CommandError(this.constructor.name, response.errors.map((error) => error.message).join("; "));
|
|
62
|
-
}
|
|
63
|
-
else if (!response.data) {
|
|
64
|
-
throw new command_error_js_1.CommandError(this.constructor.name, "No data returned from the command");
|
|
65
|
-
}
|
|
66
|
-
return response.data.me.organizations.flatMap((organization) => ({
|
|
67
|
-
id: organization.organization.id,
|
|
68
|
-
name: organization.organization.org,
|
|
69
|
-
displayName: organization.organization.displayName,
|
|
70
|
-
description: organization.organization.description,
|
|
71
|
-
websiteUrl: organization.organization.website,
|
|
72
|
-
linkType: organization.linkType,
|
|
73
|
-
}));
|
|
21
|
+
getBaseUrl() {
|
|
22
|
+
return "https://tenant.api.flowcore.io";
|
|
74
23
|
}
|
|
75
24
|
/**
|
|
76
|
-
* Get the
|
|
25
|
+
* Get the path
|
|
77
26
|
*/
|
|
78
|
-
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
|
|
27
|
+
getPath() {
|
|
28
|
+
return `/api/v1/tenants/list`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Parse the response
|
|
32
|
+
*/
|
|
33
|
+
parseResponse(rawResponse) {
|
|
34
|
+
const response = (0, parse_response_helper_js_1.parseResponseHelper)(typebox_1.Type.Array(tenant_js_1.TenantListItemSchema), rawResponse);
|
|
35
|
+
return response;
|
|
82
36
|
}
|
|
83
37
|
}
|
|
84
38
|
exports.TenantListCommand = TenantListCommand;
|