@flowcore/sdk 1.54.0 → 1.55.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 +12 -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/esm/contracts/tenant.d.ts +17 -1
- package/esm/contracts/tenant.d.ts.map +1 -1
- package/esm/contracts/tenant.js +12 -0
- 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/script/contracts/tenant.d.ts +17 -1
- package/script/contracts/tenant.d.ts.map +1 -1
- package/script/contracts/tenant.js +13 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.55.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.54.0...v1.55.0) (2025-07-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* use new rest api for tenant list ([cfbc108](https://github.com/flowcore-io/flowcore-sdk/commit/cfbc108223b8b0ed0203e7fa8b8006556e154423))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* change tenant list response ([2b612db](https://github.com/flowcore-io/flowcore-sdk/commit/2b612dbdb1c23793901af01db4b56a8a8acea097))
|
|
14
|
+
|
|
3
15
|
## [1.54.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.53.0...v1.54.0) (2025-07-09)
|
|
4
16
|
|
|
5
17
|
|
|
@@ -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<Record<string, never>, 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,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACrF;;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
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Static, type TBoolean, type TLiteral, type TNull, type TObject, type TOptional, type TString, type TUnion } from "@sinclair/typebox";
|
|
1
|
+
import { type Static, type TArray, type TBoolean, type TLiteral, type TNull, type TObject, type TOptional, type TString, type TUnion } from "@sinclair/typebox";
|
|
2
2
|
interface TenantById {
|
|
3
3
|
tenantId: string;
|
|
4
4
|
tenant?: never;
|
|
@@ -39,5 +39,21 @@ export declare const TenantSchema: TObject<{
|
|
|
39
39
|
* The type for a tenant
|
|
40
40
|
*/
|
|
41
41
|
export type Tenant = Static<typeof TenantSchema>;
|
|
42
|
+
/**
|
|
43
|
+
* The schema for a tenant list item
|
|
44
|
+
*/
|
|
45
|
+
export declare const TenantListItemSchema: TObject<{
|
|
46
|
+
id: TString;
|
|
47
|
+
name: TString;
|
|
48
|
+
displayName: TString;
|
|
49
|
+
description: TString;
|
|
50
|
+
websiteUrl: TString;
|
|
51
|
+
isDedicated: TBoolean;
|
|
52
|
+
permissions: TArray<TString>;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* The type for a tenant list item
|
|
56
|
+
*/
|
|
57
|
+
export type TenantListItem = Static<typeof TenantListItemSchema>;
|
|
42
58
|
export {};
|
|
43
59
|
//# sourceMappingURL=tenant.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant.d.ts","sourceRoot":"","sources":["../../src/contracts/tenant.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,MAAM,EAEZ,MAAM,mBAAmB,CAAA;AAE1B,UAAU,UAAU;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,KAAK,CAAA;CACf;AAED,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB;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AC,CAAA"}
|
package/esm/contracts/tenant.js
CHANGED
|
@@ -26,3 +26,15 @@ export const TenantSchema = Type.Object({
|
|
|
26
26
|
]),
|
|
27
27
|
sensitiveDataEnabled: Type.Optional(Type.Boolean()),
|
|
28
28
|
});
|
|
29
|
+
/**
|
|
30
|
+
* The schema for a tenant list item
|
|
31
|
+
*/
|
|
32
|
+
export const TenantListItemSchema = Type.Object({
|
|
33
|
+
id: Type.String(),
|
|
34
|
+
name: Type.String(),
|
|
35
|
+
displayName: Type.String(),
|
|
36
|
+
description: Type.String(),
|
|
37
|
+
websiteUrl: Type.String(),
|
|
38
|
+
isDedicated: Type.Boolean(),
|
|
39
|
+
permissions: Type.Array(Type.String()),
|
|
40
|
+
});
|
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<Record<string, never>, 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,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACrF;;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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Static, type TBoolean, type TLiteral, type TNull, type TObject, type TOptional, type TString, type TUnion } from "@sinclair/typebox";
|
|
1
|
+
import { type Static, type TArray, type TBoolean, type TLiteral, type TNull, type TObject, type TOptional, type TString, type TUnion } from "@sinclair/typebox";
|
|
2
2
|
interface TenantById {
|
|
3
3
|
tenantId: string;
|
|
4
4
|
tenant?: never;
|
|
@@ -39,5 +39,21 @@ export declare const TenantSchema: TObject<{
|
|
|
39
39
|
* The type for a tenant
|
|
40
40
|
*/
|
|
41
41
|
export type Tenant = Static<typeof TenantSchema>;
|
|
42
|
+
/**
|
|
43
|
+
* The schema for a tenant list item
|
|
44
|
+
*/
|
|
45
|
+
export declare const TenantListItemSchema: TObject<{
|
|
46
|
+
id: TString;
|
|
47
|
+
name: TString;
|
|
48
|
+
displayName: TString;
|
|
49
|
+
description: TString;
|
|
50
|
+
websiteUrl: TString;
|
|
51
|
+
isDedicated: TBoolean;
|
|
52
|
+
permissions: TArray<TString>;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* The type for a tenant list item
|
|
56
|
+
*/
|
|
57
|
+
export type TenantListItem = Static<typeof TenantListItemSchema>;
|
|
42
58
|
export {};
|
|
43
59
|
//# sourceMappingURL=tenant.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant.d.ts","sourceRoot":"","sources":["../../src/contracts/tenant.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,MAAM,EAEZ,MAAM,mBAAmB,CAAA;AAE1B,UAAU,UAAU;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,KAAK,CAAA;CACf;AAED,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB;AAED,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,YAAY,CAAA;AAExD;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC;IACjC,EAAE,EAAE,OAAO,CAAA;IACX,IAAI,EAAE,OAAO,CAAA;IACb,WAAW,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;IACnB,WAAW,EAAE,QAA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AU,EAAE,OAAO,CAAA;IACnB,WAAW,EAAE,QAAQ,CAAA;IACrB,SAAS,EAAE,MAAM,CAAC;QAChB,KAAK;QACL,OAAO,CAAC;YACN,MAAM,EAAE,MAAM,CAAC;gBACb,QAAQ,CAAC,OAAO,CAAC;gBACjB,QAAQ,CAAC,UAAU,CAAC;gBACpB,QAAQ,CAAC,SAAS,CAAC;aACpB,CAAC,CAAA;YACF,aAAa,EAAE,OAAO,CAAC;gBACrB,MAAM,EAAE,OAAO,CAAA;gBACf,oBAAoB,EAAE,OAAO,CAAA;gBAC7B,4BAA4B,EAAE,OAAO,CAAA;aACtC,CAAC,CAAA;SACH,CAAC;KACH,CAAC,CAAA;IACF,oBAAoB,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAA;CAC1C,CAuBC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,YAAY,CAAC,CAAA;AAEhD;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC;IACzC,EAAE,EAAE,OAAO,CAAA;IACX,IAAI,EAAE,OAAO,CAAA;IACb,WAAW,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;IACnB,WAAW,EAAE,QAAQ,CAAA;IACrB,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;CAC7B,CAQC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TenantSchema = void 0;
|
|
3
|
+
exports.TenantListItemSchema = exports.TenantSchema = void 0;
|
|
4
4
|
const typebox_1 = require("@sinclair/typebox");
|
|
5
5
|
/**
|
|
6
6
|
* The schema for a tenant
|
|
@@ -29,3 +29,15 @@ exports.TenantSchema = typebox_1.Type.Object({
|
|
|
29
29
|
]),
|
|
30
30
|
sensitiveDataEnabled: typebox_1.Type.Optional(typebox_1.Type.Boolean()),
|
|
31
31
|
});
|
|
32
|
+
/**
|
|
33
|
+
* The schema for a tenant list item
|
|
34
|
+
*/
|
|
35
|
+
exports.TenantListItemSchema = typebox_1.Type.Object({
|
|
36
|
+
id: typebox_1.Type.String(),
|
|
37
|
+
name: typebox_1.Type.String(),
|
|
38
|
+
displayName: typebox_1.Type.String(),
|
|
39
|
+
description: typebox_1.Type.String(),
|
|
40
|
+
websiteUrl: typebox_1.Type.String(),
|
|
41
|
+
isDedicated: typebox_1.Type.Boolean(),
|
|
42
|
+
permissions: typebox_1.Type.Array(typebox_1.Type.String()),
|
|
43
|
+
});
|