@api-client/core 0.14.3 → 0.14.4
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/build/src/browser.d.ts +1 -1
- package/build/src/browser.d.ts.map +1 -1
- package/build/src/browser.js +1 -0
- package/build/src/browser.js.map +1 -1
- package/build/src/events/BaseEvents.d.ts +4 -0
- package/build/src/events/BaseEvents.d.ts.map +1 -1
- package/build/src/events/BaseEvents.js.map +1 -1
- package/build/src/index.d.ts +1 -1
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +1 -0
- package/build/src/index.js.map +1 -1
- package/build/src/models/kinds.d.ts +1 -0
- package/build/src/models/kinds.d.ts.map +1 -1
- package/build/src/models/kinds.js +1 -0
- package/build/src/models/kinds.js.map +1 -1
- package/build/src/models/store/Group.d.ts +76 -2
- package/build/src/models/store/Group.d.ts.map +1 -1
- package/build/src/models/store/Group.js +84 -1
- package/build/src/models/store/Group.js.map +1 -1
- package/build/src/sdk/GroupsSdk.d.ts +41 -0
- package/build/src/sdk/GroupsSdk.d.ts.map +1 -0
- package/build/src/sdk/GroupsSdk.js +135 -0
- package/build/src/sdk/GroupsSdk.js.map +1 -0
- package/build/src/sdk/RouteBuilder.d.ts +2 -0
- package/build/src/sdk/RouteBuilder.d.ts.map +1 -1
- package/build/src/sdk/RouteBuilder.js +6 -0
- package/build/src/sdk/RouteBuilder.js.map +1 -1
- package/build/src/sdk/Sdk.d.ts +2 -0
- package/build/src/sdk/Sdk.d.ts.map +1 -1
- package/build/src/sdk/Sdk.js +5 -0
- package/build/src/sdk/Sdk.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +19 -19
- package/package.json +1 -1
- package/src/events/BaseEvents.ts +4 -0
- package/src/models/kinds.ts +1 -0
- package/src/models/store/Group.ts +148 -2
- package/src/sdk/GroupsSdk.ts +150 -0
- package/src/sdk/RouteBuilder.ts +8 -0
- package/src/sdk/Sdk.ts +6 -0
|
@@ -1,22 +1,96 @@
|
|
|
1
|
+
import { GroupKind } from '../kinds.js';
|
|
2
|
+
import type { IDeletion } from './Deletion.js';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `GroupSchema` instead.
|
|
5
|
+
* This interface is kept for backward compatibility.
|
|
6
|
+
*/
|
|
7
|
+
export interface IGroup extends GroupSchema {
|
|
8
|
+
}
|
|
1
9
|
/**
|
|
2
10
|
* An object representing a user group.
|
|
3
11
|
*/
|
|
4
|
-
export interface
|
|
12
|
+
export interface GroupSchema {
|
|
13
|
+
kind: typeof GroupKind;
|
|
5
14
|
/**
|
|
6
15
|
* The key of the group.
|
|
16
|
+
* If not provided, it will be generated automatically by the API
|
|
7
17
|
*/
|
|
8
18
|
key: string;
|
|
9
19
|
/**
|
|
10
|
-
* The name of the group
|
|
20
|
+
* The name of the group.
|
|
21
|
+
* This is a required field and must be unique within the organization.
|
|
22
|
+
* @required
|
|
11
23
|
*/
|
|
12
24
|
name: string;
|
|
25
|
+
/**
|
|
26
|
+
* The description of the group.
|
|
27
|
+
*/
|
|
28
|
+
description?: string;
|
|
13
29
|
/**
|
|
14
30
|
* The id of the user that created this group.
|
|
31
|
+
* This field is ignored by the API and is set automatically.
|
|
32
|
+
* @readonly
|
|
15
33
|
*/
|
|
16
34
|
owner: string;
|
|
35
|
+
/**
|
|
36
|
+
* The icon of the group, if any.
|
|
37
|
+
* An optional icon for the group, stored as a URL or path.
|
|
38
|
+
* Max 255 characters.
|
|
39
|
+
*/
|
|
40
|
+
icon?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The color of the group, if any.
|
|
43
|
+
* An optional color for the group, stored as a hex code.
|
|
44
|
+
* Max 50 characters (including the #).
|
|
45
|
+
*/
|
|
46
|
+
color?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The organization ID this group belongs to.
|
|
49
|
+
* This field is ignored by the API and is set automatically.
|
|
50
|
+
* @readonly
|
|
51
|
+
*/
|
|
52
|
+
oid: string;
|
|
17
53
|
/**
|
|
18
54
|
* The list of users in this group.
|
|
55
|
+
* This field is ignored by the API and is set automatically.
|
|
56
|
+
* @readonly
|
|
19
57
|
*/
|
|
20
58
|
users: string[];
|
|
59
|
+
/**
|
|
60
|
+
* Describes when this group was created
|
|
61
|
+
* This field is ignored by the API and is set automatically.
|
|
62
|
+
* @readonly
|
|
63
|
+
*/
|
|
64
|
+
createdAt: number;
|
|
65
|
+
/**
|
|
66
|
+
* Describes when this group was updated
|
|
67
|
+
* This field is ignored by the API and is set automatically.
|
|
68
|
+
* @readonly
|
|
69
|
+
*/
|
|
70
|
+
updatedAt: number;
|
|
71
|
+
/**
|
|
72
|
+
* Optional deletion information if the group has been deleted.
|
|
73
|
+
* This field is ignored by the API and is set automatically.
|
|
74
|
+
* @readonly
|
|
75
|
+
*/
|
|
76
|
+
deleteInfo?: IDeletion;
|
|
77
|
+
}
|
|
78
|
+
export declare class Group implements GroupSchema {
|
|
79
|
+
kind: typeof GroupKind;
|
|
80
|
+
key: string;
|
|
81
|
+
name: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
owner: string;
|
|
84
|
+
icon?: string;
|
|
85
|
+
color?: string;
|
|
86
|
+
oid: string;
|
|
87
|
+
users: string[];
|
|
88
|
+
createdAt: number;
|
|
89
|
+
updatedAt: number;
|
|
90
|
+
deleteInfo?: IDeletion;
|
|
91
|
+
static createSchema(input?: Partial<GroupSchema>): GroupSchema;
|
|
92
|
+
static fromName(name: string, oid: string): Group;
|
|
93
|
+
constructor(state?: Partial<GroupSchema>);
|
|
94
|
+
toJSON(): GroupSchema;
|
|
21
95
|
}
|
|
22
96
|
//# sourceMappingURL=Group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../src/models/store/Group.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../src/models/store/Group.ts"],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E,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,KAAK;gBAIrC,KAAK,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC;IAexC,MAAM,IAAI,WAAW;CAyBtB"}
|
|
@@ -1,2 +1,85 @@
|
|
|
1
|
-
|
|
1
|
+
import { GroupKind } from '../kinds.js';
|
|
2
|
+
import { nanoid } from '../../nanoid.js';
|
|
3
|
+
export class Group {
|
|
4
|
+
kind = GroupKind;
|
|
5
|
+
key = '';
|
|
6
|
+
name = '';
|
|
7
|
+
description;
|
|
8
|
+
owner = '';
|
|
9
|
+
icon;
|
|
10
|
+
color;
|
|
11
|
+
oid = '';
|
|
12
|
+
users = [];
|
|
13
|
+
createdAt = 0;
|
|
14
|
+
updatedAt = 0;
|
|
15
|
+
deleteInfo;
|
|
16
|
+
static createSchema(input = {}) {
|
|
17
|
+
const { key = nanoid() } = input;
|
|
18
|
+
const result = {
|
|
19
|
+
kind: GroupKind,
|
|
20
|
+
key,
|
|
21
|
+
name: input.name || 'Unnamed group',
|
|
22
|
+
oid: input.oid || '',
|
|
23
|
+
owner: input.owner || '',
|
|
24
|
+
users: input.users || [],
|
|
25
|
+
createdAt: input.createdAt || Date.now(),
|
|
26
|
+
updatedAt: input.updatedAt || Date.now(),
|
|
27
|
+
};
|
|
28
|
+
if (input.description) {
|
|
29
|
+
result.description = input.description;
|
|
30
|
+
}
|
|
31
|
+
if (input.icon) {
|
|
32
|
+
result.icon = input.icon;
|
|
33
|
+
}
|
|
34
|
+
if (input.color) {
|
|
35
|
+
result.color = input.color;
|
|
36
|
+
}
|
|
37
|
+
if (input.deleteInfo) {
|
|
38
|
+
result.deleteInfo = input.deleteInfo;
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
static fromName(name, oid) {
|
|
43
|
+
return new Group({ name, oid });
|
|
44
|
+
}
|
|
45
|
+
constructor(state) {
|
|
46
|
+
const init = Group.createSchema(state);
|
|
47
|
+
this.key = init.key;
|
|
48
|
+
this.name = init.name;
|
|
49
|
+
this.description = init.description;
|
|
50
|
+
this.owner = init.owner;
|
|
51
|
+
this.icon = init.icon;
|
|
52
|
+
this.color = init.color;
|
|
53
|
+
this.oid = init.oid;
|
|
54
|
+
this.users = init.users;
|
|
55
|
+
this.createdAt = init.createdAt;
|
|
56
|
+
this.updatedAt = init.updatedAt;
|
|
57
|
+
this.deleteInfo = init.deleteInfo;
|
|
58
|
+
}
|
|
59
|
+
toJSON() {
|
|
60
|
+
const result = {
|
|
61
|
+
kind: this.kind,
|
|
62
|
+
key: GroupKind,
|
|
63
|
+
name: this.name,
|
|
64
|
+
oid: this.oid,
|
|
65
|
+
owner: this.owner,
|
|
66
|
+
users: [...this.users],
|
|
67
|
+
createdAt: this.createdAt,
|
|
68
|
+
updatedAt: this.updatedAt,
|
|
69
|
+
};
|
|
70
|
+
if (this.description) {
|
|
71
|
+
result.description = this.description;
|
|
72
|
+
}
|
|
73
|
+
if (this.icon) {
|
|
74
|
+
result.icon = this.icon;
|
|
75
|
+
}
|
|
76
|
+
if (this.color) {
|
|
77
|
+
result.color = this.color;
|
|
78
|
+
}
|
|
79
|
+
if (this.deleteInfo) {
|
|
80
|
+
result.deleteInfo = { ...this.deleteInfo };
|
|
81
|
+
}
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
2
85
|
//# sourceMappingURL=Group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Group.js","sourceRoot":"","sources":["../../../../src/models/store/Group.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * An object representing a user group.\n */\nexport interface
|
|
1
|
+
{"version":3,"file":"Group.js","sourceRoot":"","sources":["../../../../src/models/store/Group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AA+ExC,MAAM,OAAO,KAAK;IAChB,IAAI,GAAqB,SAAS,CAA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M,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAA;QACvC,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;QACzB,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAC3B,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,CAAC,UAAU,GAAG,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,CAAA;QAC5C,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import { GroupKind } from '../kinds.js'\nimport type { IDeletion } from './Deletion.js'\nimport { nanoid } from '../../nanoid.js'\n\n/**\n * @deprecated Use `GroupSchema` instead.\n * This interface is kept for backward compatibility.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface IGroup extends GroupSchema {}\n\n/**\n * An object representing a user group.\n */\nexport interface GroupSchema {\n kind: typeof GroupKind\n /**\n * The key of the group.\n * If not provided, it will be generated automatically by the API\n */\n key: string\n /**\n * The name of the group.\n * This is a required field and must be unique within the organization.\n * @required\n */\n name: string\n /**\n * The description of the group.\n */\n description?: string\n /**\n * The id of the user that created this group.\n * This field is ignored by the API and is set automatically.\n * @readonly\n */\n owner: string\n /**\n * The icon of the group, if any.\n * An optional icon for the group, stored as a URL or path.\n * Max 255 characters.\n */\n icon?: string\n /**\n * The color of the group, if any.\n * An optional color for the group, stored as a hex code.\n * Max 50 characters (including the #).\n */\n color?: string\n /**\n * The organization ID this group belongs to.\n * This field is ignored by the API and is set automatically.\n * @readonly\n */\n oid: string\n /**\n * The list of users in this group.\n * This field is ignored by the API and is set automatically.\n * @readonly\n */\n users: string[]\n /**\n * Describes when this group was created\n * This field is ignored by the API and is set automatically.\n * @readonly\n */\n createdAt: number\n /**\n * Describes when this group was updated\n * This field is ignored by the API and is set automatically.\n * @readonly\n */\n updatedAt: number\n /**\n * Optional deletion information if the group has been deleted.\n * This field is ignored by the API and is set automatically.\n * @readonly\n */\n deleteInfo?: IDeletion\n}\n\nexport class Group implements GroupSchema {\n kind: typeof GroupKind = GroupKind\n key = ''\n name = ''\n description?: string\n owner = ''\n icon?: string\n color?: string\n oid = ''\n users: string[] = []\n createdAt = 0\n updatedAt = 0\n deleteInfo?: IDeletion\n\n static createSchema(input: Partial<GroupSchema> = {}): GroupSchema {\n const { key = nanoid() } = input\n const result: GroupSchema = {\n kind: GroupKind,\n key,\n name: input.name || 'Unnamed group',\n oid: input.oid || '',\n owner: input.owner || '',\n users: input.users || [],\n createdAt: input.createdAt || Date.now(),\n updatedAt: input.updatedAt || Date.now(),\n }\n if (input.description) {\n result.description = input.description\n }\n if (input.icon) {\n result.icon = input.icon\n }\n if (input.color) {\n result.color = input.color\n }\n if (input.deleteInfo) {\n result.deleteInfo = input.deleteInfo\n }\n return result\n }\n\n static fromName(name: string, oid: string): Group {\n return new Group({ name, oid })\n }\n\n constructor(state?: Partial<GroupSchema>) {\n const init = Group.createSchema(state)\n this.key = init.key\n this.name = init.name\n this.description = init.description\n this.owner = init.owner\n this.icon = init.icon\n this.color = init.color\n this.oid = init.oid\n this.users = init.users\n this.createdAt = init.createdAt\n this.updatedAt = init.updatedAt\n this.deleteInfo = init.deleteInfo\n }\n\n toJSON(): GroupSchema {\n const result: GroupSchema = {\n kind: this.kind,\n key: GroupKind,\n name: this.name,\n oid: this.oid,\n owner: this.owner,\n users: [...this.users],\n createdAt: this.createdAt,\n updatedAt: this.updatedAt,\n }\n if (this.description) {\n result.description = this.description\n }\n if (this.icon) {\n result.icon = this.icon\n }\n if (this.color) {\n result.color = this.color\n }\n if (this.deleteInfo) {\n result.deleteInfo = { ...this.deleteInfo }\n }\n return result\n }\n}\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ContextListOptions, ContextListResult } from '../browser.js';
|
|
2
|
+
import type { GroupSchema } from '../models/store/Group.js';
|
|
3
|
+
import { SdkBase, type SdkOptions } from './SdkBase.js';
|
|
4
|
+
export declare class GroupsSdk extends SdkBase {
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new group in the specified organization.
|
|
7
|
+
* @param oid The organization ID where the group will be created.
|
|
8
|
+
* @param info The information about the group to create. See the `GroupSchema` interface for required fields.
|
|
9
|
+
* @param request Optional SDK options, including authentication token.
|
|
10
|
+
* @returns A promise that resolves to the created group.
|
|
11
|
+
*/
|
|
12
|
+
create(oid: string, info: Partial<GroupSchema>, request?: SdkOptions): Promise<GroupSchema>;
|
|
13
|
+
/**
|
|
14
|
+
* Lists user groups in the specified organization.
|
|
15
|
+
* If you want to list specific user groups, you can use the `uid` option to filter by user ID.
|
|
16
|
+
* @param oid The organization ID to list groups from.
|
|
17
|
+
* @param options Optional parameters for filtering, sorting, and pagination.
|
|
18
|
+
* @param request Optional SDK options, including authentication token.
|
|
19
|
+
* @returns A promise that resolves to a list of groups in the organization.
|
|
20
|
+
*/
|
|
21
|
+
list(oid: string, options?: ContextListOptions, request?: SdkOptions): Promise<ContextListResult<GroupSchema>>;
|
|
22
|
+
/**
|
|
23
|
+
* Updates an existing group in the specified organization.
|
|
24
|
+
* Note that this method support PUT requests only. Some fields are ignored by the API and are set automatically.
|
|
25
|
+
* @param oid The organization ID where the group exists.
|
|
26
|
+
* @param updated The updated information for the group. Must include the `key` of the group to update.
|
|
27
|
+
* @param request Optional SDK options, including authentication token.
|
|
28
|
+
* @returns A promise that resolves to the updated group.
|
|
29
|
+
*/
|
|
30
|
+
update(oid: string, updated: GroupSchema, request?: SdkOptions): Promise<GroupSchema>;
|
|
31
|
+
/**
|
|
32
|
+
* Deletes a group in the specified organization.
|
|
33
|
+
* The groups support soft deletion, meaning that the group is not immediately removed from the database.
|
|
34
|
+
* @param oid The organization ID where the group exists.
|
|
35
|
+
* @param gid The group ID to delete.
|
|
36
|
+
* @param request Optional SDK options, including authentication token.
|
|
37
|
+
* @returns A promise that resolves when the group is deleted.
|
|
38
|
+
*/
|
|
39
|
+
delete(oid: string, gid: string, request?: SdkOptions): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=GroupsSdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupsSdk.d.ts","sourceRoot":"","sources":["../../../src/sdk/GroupsSdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAErE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAE3D,OAAO,EAKL,OAAO,EACP,KAAK,UAAU,EAChB,MAAM,cAAc,CAAA;AAErB,qBAAa,SAAU,SAAQ,OAAO;IACpC;;;;;;OAMG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAiCrG;;;;;;;OAOG;IACG,IAAI,CACR,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,kBAAuB,EAChC,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAuB1C;;;;;;;OAOG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAiC/F;;;;;;;OAOG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC;CAWhF"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Exception } from '../exceptions/exception.js';
|
|
2
|
+
import { RouteBuilder } from './RouteBuilder.js';
|
|
3
|
+
import { E_INVALID_JSON, E_RESPONSE_NO_VALUE, E_RESPONSE_STATUS, E_RESPONSE_UNKNOWN, SdkBase, } from './SdkBase.js';
|
|
4
|
+
export class GroupsSdk extends SdkBase {
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new group in the specified organization.
|
|
7
|
+
* @param oid The organization ID where the group will be created.
|
|
8
|
+
* @param info The information about the group to create. See the `GroupSchema` interface for required fields.
|
|
9
|
+
* @param request Optional SDK options, including authentication token.
|
|
10
|
+
* @returns A promise that resolves to the created group.
|
|
11
|
+
*/
|
|
12
|
+
async create(oid, info, request = {}) {
|
|
13
|
+
const { token } = request;
|
|
14
|
+
const url = this.sdk.getUrl(RouteBuilder.groups(oid));
|
|
15
|
+
const body = JSON.stringify(info);
|
|
16
|
+
const result = await this.sdk.http.post(url.toString(), {
|
|
17
|
+
token,
|
|
18
|
+
body,
|
|
19
|
+
headers: {
|
|
20
|
+
'content-type': 'application/json',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
this.inspectCommonStatusCodes(result);
|
|
24
|
+
const E_PREFIX = 'Unable to create a group. ';
|
|
25
|
+
if (result.status !== 201) {
|
|
26
|
+
this.logInvalidResponse(result);
|
|
27
|
+
throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body);
|
|
28
|
+
}
|
|
29
|
+
if (!result.body) {
|
|
30
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status });
|
|
31
|
+
}
|
|
32
|
+
let data;
|
|
33
|
+
try {
|
|
34
|
+
data = JSON.parse(result.body);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status });
|
|
38
|
+
}
|
|
39
|
+
if (!data.key) {
|
|
40
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status });
|
|
41
|
+
}
|
|
42
|
+
return data;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Lists user groups in the specified organization.
|
|
46
|
+
* If you want to list specific user groups, you can use the `uid` option to filter by user ID.
|
|
47
|
+
* @param oid The organization ID to list groups from.
|
|
48
|
+
* @param options Optional parameters for filtering, sorting, and pagination.
|
|
49
|
+
* @param request Optional SDK options, including authentication token.
|
|
50
|
+
* @returns A promise that resolves to a list of groups in the organization.
|
|
51
|
+
*/
|
|
52
|
+
async list(oid, options = {}, request = {}) {
|
|
53
|
+
const { token } = request;
|
|
54
|
+
const url = this.sdk.getUrl(RouteBuilder.groups(oid));
|
|
55
|
+
this.sdk.appendListOptions(url, options);
|
|
56
|
+
const result = await this.sdk.http.get(url.toString(), { token });
|
|
57
|
+
this.inspectCommonStatusCodes(result);
|
|
58
|
+
const E_PREFIX = 'Unable to create a group. ';
|
|
59
|
+
if (result.status !== 200) {
|
|
60
|
+
this.logInvalidResponse(result);
|
|
61
|
+
throw this.createApiError(E_PREFIX + E_RESPONSE_STATUS + result.status, result.body);
|
|
62
|
+
}
|
|
63
|
+
if (!result.body) {
|
|
64
|
+
throw new Exception(E_PREFIX + E_RESPONSE_NO_VALUE, { code: 'E_RESPONSE_NO_VALUE', status: result.status });
|
|
65
|
+
}
|
|
66
|
+
let data;
|
|
67
|
+
try {
|
|
68
|
+
data = JSON.parse(result.body);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
throw new Exception(E_PREFIX + E_INVALID_JSON, { code: 'E_INVALID_JSON', status: result.status });
|
|
72
|
+
}
|
|
73
|
+
return data;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Updates an existing group in the specified organization.
|
|
77
|
+
* Note that this method support PUT requests only. Some fields are ignored by the API and are set automatically.
|
|
78
|
+
* @param oid The organization ID where the group exists.
|
|
79
|
+
* @param updated The updated information for the group. Must include the `key` of the group to update.
|
|
80
|
+
* @param request Optional SDK options, including authentication token.
|
|
81
|
+
* @returns A promise that resolves to the updated group.
|
|
82
|
+
*/
|
|
83
|
+
async update(oid, updated, request = {}) {
|
|
84
|
+
const { token } = request;
|
|
85
|
+
const url = this.sdk.getUrl(RouteBuilder.group(oid, updated.key));
|
|
86
|
+
const body = JSON.stringify(updated);
|
|
87
|
+
const result = await this.sdk.http.put(url.toString(), {
|
|
88
|
+
token,
|
|
89
|
+
body,
|
|
90
|
+
headers: {
|
|
91
|
+
'content-type': 'application/json',
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
this.inspectCommonStatusCodes(result);
|
|
95
|
+
const E_PREFIX = 'Unable to update a group. ';
|
|
96
|
+
if (result.status !== 200) {
|
|
97
|
+
this.logInvalidResponse(result);
|
|
98
|
+
throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body);
|
|
99
|
+
}
|
|
100
|
+
if (!result.body) {
|
|
101
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status });
|
|
102
|
+
}
|
|
103
|
+
let data;
|
|
104
|
+
try {
|
|
105
|
+
data = JSON.parse(result.body);
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status });
|
|
109
|
+
}
|
|
110
|
+
if (!data.key) {
|
|
111
|
+
throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status });
|
|
112
|
+
}
|
|
113
|
+
return data;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Deletes a group in the specified organization.
|
|
117
|
+
* The groups support soft deletion, meaning that the group is not immediately removed from the database.
|
|
118
|
+
* @param oid The organization ID where the group exists.
|
|
119
|
+
* @param gid The group ID to delete.
|
|
120
|
+
* @param request Optional SDK options, including authentication token.
|
|
121
|
+
* @returns A promise that resolves when the group is deleted.
|
|
122
|
+
*/
|
|
123
|
+
async delete(oid, gid, request = {}) {
|
|
124
|
+
const { token } = request;
|
|
125
|
+
const url = this.sdk.getUrl(RouteBuilder.group(oid, gid));
|
|
126
|
+
const result = await this.sdk.http.delete(url.toString(), { token });
|
|
127
|
+
this.inspectCommonStatusCodes(result);
|
|
128
|
+
const E_PREFIX = 'Unable to delete a group. ';
|
|
129
|
+
if (result.status !== 204) {
|
|
130
|
+
this.logInvalidResponse(result);
|
|
131
|
+
throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=GroupsSdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupsSdk.js","sourceRoot":"","sources":["../../../src/sdk/GroupsSdk.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,OAAO,GAER,MAAM,cAAc,CAAA;AAErB,MAAM,OAAO,SAAU,SAAQ,OAAO;IACpC;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CAAC,GAAW,EAAE,IAA0B,EAAE,UAAsB,EAAE;QAC5E,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;QACzB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;QACrD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QACjC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE;YACtD,KAAK;YACL,IAAI;YACJ,OAAO,EAAE;gBACP,cAA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,GAAG,QAAQ,GAAG,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;QACxG,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACd,MAAM,IAAI,SAAS,CAAC,GAAG,QAAQ,GAAG,kBAAkB,EAAE,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;QAChH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,MAAM,CAAC,GAAW,EAAE,GAAW,EAAE,UAAsB,EAAE;QAC7D,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;QACzB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;QACzD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;QACpE,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAA;QACrC,MAAM,QAAQ,GAAG,4BAA4B,CAAA;QAC7C,IAAI,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1B,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;YAC/B,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,QAAQ,GAAG,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;QAC3F,CAAC;IACH,CAAC;CACF","sourcesContent":["import { ContextListOptions, ContextListResult } from '../browser.js'\nimport { Exception } from '../exceptions/exception.js'\nimport type { GroupSchema } from '../models/store/Group.js'\nimport { RouteBuilder } from './RouteBuilder.js'\nimport {\n E_INVALID_JSON,\n E_RESPONSE_NO_VALUE,\n E_RESPONSE_STATUS,\n E_RESPONSE_UNKNOWN,\n SdkBase,\n type SdkOptions,\n} from './SdkBase.js'\n\nexport class GroupsSdk extends SdkBase {\n /**\n * Creates a new group in the specified organization.\n * @param oid The organization ID where the group will be created.\n * @param info The information about the group to create. See the `GroupSchema` interface for required fields.\n * @param request Optional SDK options, including authentication token.\n * @returns A promise that resolves to the created group.\n */\n async create(oid: string, info: Partial<GroupSchema>, request: SdkOptions = {}): Promise<GroupSchema> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.groups(oid))\n const body = JSON.stringify(info)\n const result = await this.sdk.http.post(url.toString(), {\n token,\n body,\n headers: {\n 'content-type': 'application/json',\n },\n })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to create a group. '\n if (result.status !== 201) {\n this.logInvalidResponse(result)\n throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)\n }\n\n if (!result.body) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })\n }\n let data: GroupSchema\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })\n }\n if (!data.key) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })\n }\n return data\n }\n\n /**\n * Lists user groups in the specified organization.\n * If you want to list specific user groups, you can use the `uid` option to filter by user ID.\n * @param oid The organization ID to list groups from.\n * @param options Optional parameters for filtering, sorting, and pagination.\n * @param request Optional SDK options, including authentication token.\n * @returns A promise that resolves to a list of groups in the organization.\n */\n async list(\n oid: string,\n options: ContextListOptions = {},\n request: SdkOptions = {}\n ): Promise<ContextListResult<GroupSchema>> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.groups(oid))\n this.sdk.appendListOptions(url, options)\n const result = await this.sdk.http.get(url.toString(), { token })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to create a group. '\n if (result.status !== 200) {\n this.logInvalidResponse(result)\n throw this.createApiError(E_PREFIX + E_RESPONSE_STATUS + result.status, result.body)\n }\n if (!result.body) {\n throw new Exception(E_PREFIX + E_RESPONSE_NO_VALUE, { code: 'E_RESPONSE_NO_VALUE', status: result.status })\n }\n let data: ContextListResult<GroupSchema>\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Exception(E_PREFIX + E_INVALID_JSON, { code: 'E_INVALID_JSON', status: result.status })\n }\n return data\n }\n\n /**\n * Updates an existing group in the specified organization.\n * Note that this method support PUT requests only. Some fields are ignored by the API and are set automatically.\n * @param oid The organization ID where the group exists.\n * @param updated The updated information for the group. Must include the `key` of the group to update.\n * @param request Optional SDK options, including authentication token.\n * @returns A promise that resolves to the updated group.\n */\n async update(oid: string, updated: GroupSchema, request: SdkOptions = {}): Promise<GroupSchema> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.group(oid, updated.key))\n const body = JSON.stringify(updated)\n const result = await this.sdk.http.put(url.toString(), {\n token,\n body,\n headers: {\n 'content-type': 'application/json',\n },\n })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to update a group. '\n if (result.status !== 200) {\n this.logInvalidResponse(result)\n throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)\n }\n\n if (!result.body) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })\n }\n let data: GroupSchema\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Exception(`${E_PREFIX}${E_INVALID_JSON}`, { code: 'E_INVALID_JSON', status: result.status })\n }\n if (!data.key) {\n throw new Exception(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`, { code: 'E_RESPONSE_UNKNOWN', status: result.status })\n }\n return data\n }\n\n /**\n * Deletes a group in the specified organization.\n * The groups support soft deletion, meaning that the group is not immediately removed from the database.\n * @param oid The organization ID where the group exists.\n * @param gid The group ID to delete.\n * @param request Optional SDK options, including authentication token.\n * @returns A promise that resolves when the group is deleted.\n */\n async delete(oid: string, gid: string, request: SdkOptions = {}): Promise<void> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.group(oid, gid))\n const result = await this.sdk.http.delete(url.toString(), { token })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to delete a group. '\n if (result.status !== 204) {\n this.logInvalidResponse(result)\n throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)\n }\n }\n}\n"]}
|
|
@@ -112,5 +112,7 @@ export declare class RouteBuilder {
|
|
|
112
112
|
static dataCatalogUnpublish(entryId: string): string;
|
|
113
113
|
static dataCatalogVersionDeprecate(entryId: string, version: string): string;
|
|
114
114
|
static dataCatalogVersionUnpublish(entryId: string, version: string): string;
|
|
115
|
+
static groups(oid: string): string;
|
|
116
|
+
static group(oid: string, gid: string): string;
|
|
115
117
|
}
|
|
116
118
|
//# sourceMappingURL=RouteBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteBuilder.d.ts","sourceRoot":"","sources":["../../../src/sdk/RouteBuilder.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,qBAAa,YAAY;IACvB;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAInC;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAIjC;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAIpD;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAItC;;OAEG;IACH,MAAM,CAAC,IA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C,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAIpD,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAIpD,MAAM,CAAC,2BAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;IAI5E,MAAM,CAAC,2BAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;IAI5E,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAIlC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;CAG/C"}
|
|
@@ -230,5 +230,11 @@ export class RouteBuilder {
|
|
|
230
230
|
static dataCatalogVersionUnpublish(entryId, version) {
|
|
231
231
|
return `${RouteBuilder.dataCatalogVersion(entryId, version)}/unpublish`;
|
|
232
232
|
}
|
|
233
|
+
static groups(oid) {
|
|
234
|
+
return `/v1/orgs/${oid}/groups`;
|
|
235
|
+
}
|
|
236
|
+
static group(oid, gid) {
|
|
237
|
+
return `/v1/orgs/${oid}/groups/${gid}`;
|
|
238
|
+
}
|
|
233
239
|
}
|
|
234
240
|
//# sourceMappingURL=RouteBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteBuilder.js","sourceRoot":"","sources":["../../../src/sdk/RouteBuilder.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D;;GAEG;AACH,MAAM,OAAO,YAAY;IACvB;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,GAAW;QACxB,OAAO,YAAY,GAAG,UAAU,CAAA;IAClC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,GAAW;QACtB,OAAO,YAAY,GAAG,QAAQ,CAAA;IAChC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,GAAW,EAAE,GAAW;QACzC,OAAO,G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AED,MAAM,CAAC,iBAAiB,CAAC,QAAgB;QACvC,OAAO,GAAG,YAAY,CAAC,WAAW,EAAE,WAAW,QAAQ,EAAE,CAAA;IAC3D,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,QAAgB;QACtC,OAAO,GAAG,YAAY,CAAC,WAAW,EAAE,IAAI,QAAQ,EAAE,CAAA;IACpD,CAAC;IAED,MAAM,CAAC,wBAAwB,CAAC,OAAe;QAC7C,OAAO,GAAG,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,WAAW,CAAA;IAC7D,CAAC;IAED,MAAM,CAAC,uBAAuB;QAC5B,OAAO,GAAG,YAAY,CAAC,WAAW,EAAE,eAAe,CAAA;IACrD,CAAC;IAED,MAAM,CAAC,kBAAkB,CAAC,OAAe,EAAE,OAAe;QACxD,OAAO,GAAG,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,OAAO,EAAE,CAAA;IAC/D,CAAC;IAED,MAAM,CAAC,oBAAoB,CAAC,OAAe;QACzC,OAAO,GAAG,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,YAAY,CAAA;IAC9D,CAAC;IAED,MAAM,CAAC,oBAAoB,CAAC,OAAe;QACzC,OAAO,GAAG,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,YAAY,CAAA;IAC9D,CAAC;IAED,MAAM,CAAC,2BAA2B,CAAC,OAAe,EAAE,OAAe;QACjE,OAAO,GAAG,YAAY,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAA;IACzE,CAAC;IAED,MAAM,CAAC,2BAA2B,CAAC,OAAe,EAAE,OAAe;QACjE,OAAO,GAAG,YAAY,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAA;IACzE,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/no-extraneous-class */\n/**\n * A helper class to make sure routes user and reported by this service are consistent.\n */\nexport class RouteBuilder {\n /**\n * @param oid The org id.\n * @returns The path to the /folders/{oid} route.\n */\n static folders(oid: string): string {\n return `/v1/orgs/${oid}/folders`\n }\n\n /**\n * @returns The path to the /files/{oid} route.\n */\n static files(oid: string): string {\n return `/v1/orgs/${oid}/files`\n }\n\n /**\n * Used to patch file access.\n */\n static filesAccess(oid: string, fid: string): string {\n return `${RouteBuilder.file(oid, fid)}/access`\n }\n\n /**\n * @returns The path to the /files/{oid}/batch/read-meta route.\n */\n static filesBatch(oid: string): string {\n return `${RouteBuilder.files(oid)}/batch/read-meta`\n }\n\n /**\n * @returns The path to the /files/{oid}/[id] route.\n */\n static file(oid: string, key: string): string {\n return `${RouteBuilder.files(oid)}/${key}`\n }\n\n /**\n * @returns The path to the /files/{oid}/[id] route.\n */\n static fileMedia(oid: string, key: string): string {\n return `${RouteBuilder.file(oid, key)}/media`\n }\n\n /**\n * @returns The path to the /files/{oid}/[id]/users route.\n */\n static fileUsers(oid: string, file: string): string {\n return `${RouteBuilder.file(oid, file)}/users`\n }\n\n /**\n * @returns The path to the /file/{oid}/[id]/revisions route.\n */\n static fileRevisions(oid: string, file: string): string {\n return `${RouteBuilder.file(oid, file)}/revisions`\n }\n\n /**\n * @returns The path to the /file/{oid}/[id]/revisions route.\n */\n static fileBreadcrumbs(oid: string, file: string): string {\n return `${RouteBuilder.file(oid, file)}/breadcrumbs`\n }\n\n /**\n * @deprecated Not used anymore\n */\n static backend(): string {\n return '/store'\n }\n\n /**\n * @deprecated Not used anymore\n */\n static sessions(): string {\n return '/sessions'\n }\n\n /**\n * @deprecated Not used anymore\n */\n static sessionRenew(): string {\n return '/sessions/renew'\n }\n\n static history(): string {\n return `/history`\n }\n\n static historyBatchCreate(): string {\n return `/history/batch/create`\n }\n\n static historyBatchDelete(): string {\n return `/history/batch/delete`\n }\n\n static historyItem(key: string): string {\n return `/history/${key}`\n }\n\n static historyClear(type: 'organization' | 'project' | 'request', ...key: string[]): string {\n return `/history/clear/${type}/${key.join('/')}`\n }\n\n static shared(oid: string): string {\n return `/v1/orgs/${oid}/shared`\n }\n\n static trash(oid: string): string {\n return `/v1/orgs/${oid}/trash`\n }\n\n static trashItem(oid: string, trashKey: string): string {\n // GET + DELETE (link to ./delete)\n return `${RouteBuilder.trash(oid)}/${trashKey}`\n }\n\n static trashRestore(oid: string, trashKey: string): string {\n return `${RouteBuilder.trashItem(oid, trashKey)}/restore`\n }\n\n static trashEmpty(oid: string): string {\n return `${RouteBuilder.trash(oid)}/empty`\n }\n\n static trashBatchRestore(oid: string): string {\n return `${RouteBuilder.trash(oid)}/restore`\n }\n\n static trashBatchDelete(oid: string): string {\n return `${RouteBuilder.trash(oid)}/delete`\n }\n\n static projectExecutions(): string {\n return `/project/execution`\n }\n\n static projectExecution(key: string): string {\n return `/project/execution/${key}`\n }\n\n static projectExecutionBulkDelete(): string {\n return `/project/execution/delete`\n }\n\n static projectExecutionClear(scope: 'organization' | 'project' | 'folder'): string {\n return `/project/execution/clear/${scope}`\n }\n\n static organizations(): string {\n return '/v1/orgs'\n }\n\n static organization(oid: string): string {\n return `/v1/orgs/${oid}`\n }\n\n static organizationUsers(oid: string): string {\n return `${this.organization(oid)}/users`\n }\n\n static organizationUserBatch(oid: string): string {\n return `${this.organization(oid)}/users/batch/read`\n }\n\n static organizationUser(oid: string, key: string): string {\n return `${this.organization(oid)}/users/${key}`\n }\n\n static organizationUserDeactivate(oid: string, key: string): string {\n return `${this.organization(oid)}/users/${key}/deactivate`\n }\n\n static organizationUserActivate(oid: string, key: string): string {\n return `${this.organization(oid)}/users/${key}/activate`\n }\n\n /**\n * @deprecated Use `organizationUsers` instead.\n */\n static users(oid: string): string {\n return `${this.organization(oid)}/users`\n }\n\n /**\n * @deprecated Use `organizationUser` instead.\n */\n static user(oid: string, key: string): string {\n return `${this.organization(oid)}/users/${key}`\n }\n\n static invitations(oid: string): string {\n return `${this.organization(oid)}/invitations`\n }\n\n static invitation(oid: string, id: string): string {\n return `${this.invitations(oid)}/${id}`\n }\n\n static findInvitation(): string {\n return `${this.organizations()}/find-invitation`\n }\n\n static declineInvitation(oid: string, id: string): string {\n return `${this.invitation(oid, id)}/decline`\n }\n\n static resendInvitation(oid: string, id: string): string {\n return `${this.invitation(oid, id)}/resend`\n }\n\n /**\n * @deprecated Not used anymore\n */\n static authLogin(): string {\n return '/auth/login'\n }\n\n static authGoogle(): string {\n return '/auth/google'\n }\n\n static authRenew(): string {\n return '/auth/renew'\n }\n\n /**\n * @deprecated Not used anymore\n */\n static authProvider(provider: string): string {\n return `/auth/${provider}`\n }\n\n /**\n * @deprecated Not used anymore\n */\n static authToken(code: string): string {\n return `/auth/token/${code}`\n }\n\n static usersMe(): string {\n return '/v1/users/me'\n }\n\n static dataCatalog(): string {\n return '/v1/datacatalog'\n }\n\n static dataCatalogStatus(domainId: string): string {\n return `${RouteBuilder.dataCatalog()}/status/${domainId}`\n }\n\n static dataCatalogEntry(domainId: string): string {\n return `${RouteBuilder.dataCatalog()}/${domainId}`\n }\n\n static dataCatalogEntryVersions(entryId: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/versions`\n }\n\n static dataCatalogDependencies(): string {\n return `${RouteBuilder.dataCatalog()}/dependencies`\n }\n\n static dataCatalogVersion(entryId: string, version: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/${version}`\n }\n\n static dataCatalogDeprecate(entryId: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/deprecate`\n }\n\n static dataCatalogUnpublish(entryId: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/unpublish`\n }\n\n static dataCatalogVersionDeprecate(entryId: string, version: string): string {\n return `${RouteBuilder.dataCatalogVersion(entryId, version)}/deprecate`\n }\n\n static dataCatalogVersionUnpublish(entryId: string, version: string): string {\n return `${RouteBuilder.dataCatalogVersion(entryId, version)}/unpublish`\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RouteBuilder.js","sourceRoot":"","sources":["../../../src/sdk/RouteBuilder.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D;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OAAO,CAAC,YAAY,CAAA;IACzE,CAAC;IAED,MAAM,CAAC,2BAA2B,CAAC,OAAe,EAAE,OAAe;QACjE,OAAO,GAAG,YAAY,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAA;IACzE,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,GAAW;QACvB,OAAO,YAAY,GAAG,SAAS,CAAA;IACjC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,GAAW,EAAE,GAAW;QACnC,OAAO,YAAY,GAAG,WAAW,GAAG,EAAE,CAAA;IACxC,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/no-extraneous-class */\n/**\n * A helper class to make sure routes user and reported by this service are consistent.\n */\nexport class RouteBuilder {\n /**\n * @param oid The org id.\n * @returns The path to the /folders/{oid} route.\n */\n static folders(oid: string): string {\n return `/v1/orgs/${oid}/folders`\n }\n\n /**\n * @returns The path to the /files/{oid} route.\n */\n static files(oid: string): string {\n return `/v1/orgs/${oid}/files`\n }\n\n /**\n * Used to patch file access.\n */\n static filesAccess(oid: string, fid: string): string {\n return `${RouteBuilder.file(oid, fid)}/access`\n }\n\n /**\n * @returns The path to the /files/{oid}/batch/read-meta route.\n */\n static filesBatch(oid: string): string {\n return `${RouteBuilder.files(oid)}/batch/read-meta`\n }\n\n /**\n * @returns The path to the /files/{oid}/[id] route.\n */\n static file(oid: string, key: string): string {\n return `${RouteBuilder.files(oid)}/${key}`\n }\n\n /**\n * @returns The path to the /files/{oid}/[id] route.\n */\n static fileMedia(oid: string, key: string): string {\n return `${RouteBuilder.file(oid, key)}/media`\n }\n\n /**\n * @returns The path to the /files/{oid}/[id]/users route.\n */\n static fileUsers(oid: string, file: string): string {\n return `${RouteBuilder.file(oid, file)}/users`\n }\n\n /**\n * @returns The path to the /file/{oid}/[id]/revisions route.\n */\n static fileRevisions(oid: string, file: string): string {\n return `${RouteBuilder.file(oid, file)}/revisions`\n }\n\n /**\n * @returns The path to the /file/{oid}/[id]/revisions route.\n */\n static fileBreadcrumbs(oid: string, file: string): string {\n return `${RouteBuilder.file(oid, file)}/breadcrumbs`\n }\n\n /**\n * @deprecated Not used anymore\n */\n static backend(): string {\n return '/store'\n }\n\n /**\n * @deprecated Not used anymore\n */\n static sessions(): string {\n return '/sessions'\n }\n\n /**\n * @deprecated Not used anymore\n */\n static sessionRenew(): string {\n return '/sessions/renew'\n }\n\n static history(): string {\n return `/history`\n }\n\n static historyBatchCreate(): string {\n return `/history/batch/create`\n }\n\n static historyBatchDelete(): string {\n return `/history/batch/delete`\n }\n\n static historyItem(key: string): string {\n return `/history/${key}`\n }\n\n static historyClear(type: 'organization' | 'project' | 'request', ...key: string[]): string {\n return `/history/clear/${type}/${key.join('/')}`\n }\n\n static shared(oid: string): string {\n return `/v1/orgs/${oid}/shared`\n }\n\n static trash(oid: string): string {\n return `/v1/orgs/${oid}/trash`\n }\n\n static trashItem(oid: string, trashKey: string): string {\n // GET + DELETE (link to ./delete)\n return `${RouteBuilder.trash(oid)}/${trashKey}`\n }\n\n static trashRestore(oid: string, trashKey: string): string {\n return `${RouteBuilder.trashItem(oid, trashKey)}/restore`\n }\n\n static trashEmpty(oid: string): string {\n return `${RouteBuilder.trash(oid)}/empty`\n }\n\n static trashBatchRestore(oid: string): string {\n return `${RouteBuilder.trash(oid)}/restore`\n }\n\n static trashBatchDelete(oid: string): string {\n return `${RouteBuilder.trash(oid)}/delete`\n }\n\n static projectExecutions(): string {\n return `/project/execution`\n }\n\n static projectExecution(key: string): string {\n return `/project/execution/${key}`\n }\n\n static projectExecutionBulkDelete(): string {\n return `/project/execution/delete`\n }\n\n static projectExecutionClear(scope: 'organization' | 'project' | 'folder'): string {\n return `/project/execution/clear/${scope}`\n }\n\n static organizations(): string {\n return '/v1/orgs'\n }\n\n static organization(oid: string): string {\n return `/v1/orgs/${oid}`\n }\n\n static organizationUsers(oid: string): string {\n return `${this.organization(oid)}/users`\n }\n\n static organizationUserBatch(oid: string): string {\n return `${this.organization(oid)}/users/batch/read`\n }\n\n static organizationUser(oid: string, key: string): string {\n return `${this.organization(oid)}/users/${key}`\n }\n\n static organizationUserDeactivate(oid: string, key: string): string {\n return `${this.organization(oid)}/users/${key}/deactivate`\n }\n\n static organizationUserActivate(oid: string, key: string): string {\n return `${this.organization(oid)}/users/${key}/activate`\n }\n\n /**\n * @deprecated Use `organizationUsers` instead.\n */\n static users(oid: string): string {\n return `${this.organization(oid)}/users`\n }\n\n /**\n * @deprecated Use `organizationUser` instead.\n */\n static user(oid: string, key: string): string {\n return `${this.organization(oid)}/users/${key}`\n }\n\n static invitations(oid: string): string {\n return `${this.organization(oid)}/invitations`\n }\n\n static invitation(oid: string, id: string): string {\n return `${this.invitations(oid)}/${id}`\n }\n\n static findInvitation(): string {\n return `${this.organizations()}/find-invitation`\n }\n\n static declineInvitation(oid: string, id: string): string {\n return `${this.invitation(oid, id)}/decline`\n }\n\n static resendInvitation(oid: string, id: string): string {\n return `${this.invitation(oid, id)}/resend`\n }\n\n /**\n * @deprecated Not used anymore\n */\n static authLogin(): string {\n return '/auth/login'\n }\n\n static authGoogle(): string {\n return '/auth/google'\n }\n\n static authRenew(): string {\n return '/auth/renew'\n }\n\n /**\n * @deprecated Not used anymore\n */\n static authProvider(provider: string): string {\n return `/auth/${provider}`\n }\n\n /**\n * @deprecated Not used anymore\n */\n static authToken(code: string): string {\n return `/auth/token/${code}`\n }\n\n static usersMe(): string {\n return '/v1/users/me'\n }\n\n static dataCatalog(): string {\n return '/v1/datacatalog'\n }\n\n static dataCatalogStatus(domainId: string): string {\n return `${RouteBuilder.dataCatalog()}/status/${domainId}`\n }\n\n static dataCatalogEntry(domainId: string): string {\n return `${RouteBuilder.dataCatalog()}/${domainId}`\n }\n\n static dataCatalogEntryVersions(entryId: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/versions`\n }\n\n static dataCatalogDependencies(): string {\n return `${RouteBuilder.dataCatalog()}/dependencies`\n }\n\n static dataCatalogVersion(entryId: string, version: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/${version}`\n }\n\n static dataCatalogDeprecate(entryId: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/deprecate`\n }\n\n static dataCatalogUnpublish(entryId: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/unpublish`\n }\n\n static dataCatalogVersionDeprecate(entryId: string, version: string): string {\n return `${RouteBuilder.dataCatalogVersion(entryId, version)}/deprecate`\n }\n\n static dataCatalogVersionUnpublish(entryId: string, version: string): string {\n return `${RouteBuilder.dataCatalogVersion(entryId, version)}/unpublish`\n }\n\n static groups(oid: string): string {\n return `/v1/orgs/${oid}/groups`\n }\n\n static group(oid: string, gid: string): string {\n return `/v1/orgs/${oid}/groups/${gid}`\n }\n}\n"]}
|
package/build/src/sdk/Sdk.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { TrashSdk } from './TrashSdk.js';
|
|
|
11
11
|
import { ProjectExecutionSdk } from './ProjectExecutionsSdk.js';
|
|
12
12
|
import { OrganizationsSdk } from './OrganizationsSdk.js';
|
|
13
13
|
import { DataCatalogSdk } from './DataCatalogSdk.js';
|
|
14
|
+
import { GroupsSdk } from './GroupsSdk.js';
|
|
14
15
|
declare const baseUriSymbol: unique symbol;
|
|
15
16
|
/**
|
|
16
17
|
* NodeJS API for API Client's net-store module.
|
|
@@ -57,6 +58,7 @@ export declare abstract class Sdk {
|
|
|
57
58
|
projectExecution: ProjectExecutionSdk;
|
|
58
59
|
organizations: OrganizationsSdk;
|
|
59
60
|
dataCatalog: DataCatalogSdk;
|
|
61
|
+
groups: GroupsSdk;
|
|
60
62
|
/**
|
|
61
63
|
* When set it limits log output to minimum.
|
|
62
64
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk/Sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,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8,6 +8,7 @@ import { TrashSdk } from './TrashSdk.js';
|
|
|
8
8
|
import { ProjectExecutionSdk } from './ProjectExecutionsSdk.js';
|
|
9
9
|
import { OrganizationsSdk } from './OrganizationsSdk.js';
|
|
10
10
|
import { DataCatalogSdk } from './DataCatalogSdk.js';
|
|
11
|
+
import { GroupsSdk } from './GroupsSdk.js';
|
|
11
12
|
const baseUriSymbol = Symbol('baseUri');
|
|
12
13
|
/**
|
|
13
14
|
* NodeJS API for API Client's net-store module.
|
|
@@ -50,6 +51,7 @@ export class Sdk {
|
|
|
50
51
|
projectExecution = new ProjectExecutionSdk(this);
|
|
51
52
|
organizations = new OrganizationsSdk(this);
|
|
52
53
|
dataCatalog = new DataCatalogSdk(this);
|
|
54
|
+
groups = new GroupsSdk(this);
|
|
53
55
|
/**
|
|
54
56
|
* When set it limits log output to minimum.
|
|
55
57
|
*/
|
|
@@ -136,6 +138,9 @@ export class Sdk {
|
|
|
136
138
|
if (options.oid) {
|
|
137
139
|
searchParams.set('oid', String(options.oid));
|
|
138
140
|
}
|
|
141
|
+
if (options.uid) {
|
|
142
|
+
searchParams.set('uid', String(options.uid));
|
|
143
|
+
}
|
|
139
144
|
if (options.filter) {
|
|
140
145
|
const bytes = new TextEncoder().encode(JSON.stringify(options.filter));
|
|
141
146
|
// To be used when Uint8Array.prototype.toBase64() is available.
|
package/build/src/sdk/Sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sdk.js","sourceRoot":"","sources":["../../../src/sdk/Sdk.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,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C,IAAI,CAAC,EAAE,CAAC,CAAA;YAClF,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAA;QAC7C,CAAC;IACH,CAAC;CACF","sourcesContent":["import { Http } from './Http.js'\nimport { WsClient } from './WsClient.js'\nimport { AuthSdk } from './AuthSdk.js'\nimport { FilesSdk } from './FilesSdk.js'\nimport { UsersSdk } from './UsersSdk.js'\nimport { HistorySdk } from './HistorySdk.js'\nimport { SharedSdk } from './SharedSdk.js'\nimport type { ContextListOptions } from '../events/BaseEvents.js'\nimport { RevisionsSdk } from './RevisionsSdk.js'\nimport { TrashSdk } from './TrashSdk.js'\nimport { ProjectExecutionSdk } from './ProjectExecutionsSdk.js'\nimport { OrganizationsSdk } from './OrganizationsSdk.js'\nimport { DataCatalogSdk } from './DataCatalogSdk.js'\nimport { GroupsSdk } from './GroupsSdk.js'\n\nconst baseUriSymbol = Symbol('baseUri')\n\n/**\n * NodeJS API for API Client's net-store module.\n */\nexport abstract class Sdk {\n #token?: string\n\n /**\n * The token to use with requests. Can be overwritten\n * with each API call by providing custom token.\n */\n get token(): string | undefined {\n return this.#token\n }\n\n set token(value: string | undefined) {\n this.#token = value\n }\n\n /**\n * The user authentication features.\n */\n auth = new AuthSdk(this)\n /**\n * The user organizations features.\n */\n file = new FilesSdk(this)\n /**\n * Reads user information.\n */\n user = new UsersSdk(this)\n /**\n * The HTTP(S) requests.\n */\n abstract http: Http\n /**\n * The web socket requests.\n */\n abstract ws: WsClient\n /**\n * The history data.\n */\n history = new HistorySdk(this)\n /**\n * The shared data.\n */\n shared = new SharedSdk(this)\n\n revisions = new RevisionsSdk(this)\n\n trash = new TrashSdk(this)\n\n projectExecution = new ProjectExecutionSdk(this)\n\n organizations = new OrganizationsSdk(this)\n\n dataCatalog = new DataCatalogSdk(this)\n\n groups = new GroupsSdk(this)\n /**\n * When set it limits log output to minimum.\n */\n silent = false;\n\n [baseUriSymbol] = ''\n\n /**\n * @returns The base URI to the store.\n */\n get baseUri(): string {\n return this[baseUriSymbol]\n }\n\n /**\n * @param value The base URI to the store.\n */\n set baseUri(value: string) {\n if (!value) {\n throw new Error(`Invalid value for the baseUri`)\n }\n let url: URL\n try {\n url = new URL(value)\n } catch {\n throw new Error(`Invalid baseUri: Not an URL`)\n }\n this[baseUriSymbol] = url.origin\n const { pathname } = url\n if (pathname && pathname !== '/') {\n this.basePath = pathname\n } else {\n this.basePath = undefined\n }\n }\n\n /**\n * @param baseUri The base URI to the store.\n * @param basePath The base path (the router prefix) for the server.\n */\n constructor(\n baseUri: string,\n public basePath?: string\n ) {\n this.baseUri = baseUri\n }\n\n /**\n * Creates a full URL for a path.\n * This adds the server's base path and the passed path to the configured base URL.\n * @param path The path to the endpoint, without the base path.\n */\n getUrl(path = '/'): URL {\n if (path.startsWith('http:') || path.startsWith('https:')) {\n return new URL(path)\n }\n const { baseUri, basePath = '' } = this\n let userPath = path\n if (basePath && userPath.startsWith(basePath)) {\n userPath = userPath.substring(basePath.length)\n }\n return new URL(`${basePath}${userPath}`, baseUri)\n }\n\n /**\n * Appends list options to the query parameters.\n * @param url The URL object to the API endpoint\n * @param options The list options, if any\n */\n appendListOptions(url: URL, options: ContextListOptions = {}): void {\n const { searchParams } = url\n if (options.cursor) {\n searchParams.set('cursor', options.cursor)\n }\n if (typeof options.limit === 'number') {\n searchParams.set('limit', String(options.limit))\n }\n if (options.parent) {\n searchParams.set('parent', options.parent)\n }\n if (options.since) {\n searchParams.set('since', String(options.since))\n }\n if (options.sort) {\n searchParams.set('sort', String(options.sort))\n }\n if (options.order) {\n searchParams.set('order', String(options.order))\n }\n if (options.oid) {\n searchParams.set('oid', String(options.oid))\n }\n if (options.uid) {\n searchParams.set('uid', String(options.uid))\n }\n if (options.filter) {\n const bytes = new TextEncoder().encode(JSON.stringify(options.filter))\n // To be used when Uint8Array.prototype.toBase64() is available.\n // const encoded = bytes.toBase64({ alphabet: 'base64url' })\n const binString = Array.from(bytes, (byte) => String.fromCodePoint(byte)).join('')\n searchParams.set('filter', btoa(binString))\n }\n }\n}\n"]}
|