@libretexts/cxone-expert-node 1.0.0 → 1.1.1
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/README.md +39 -39
- package/dist/cxone-expert-node.cjs.development.js +1511 -0
- package/dist/cxone-expert-node.cjs.development.js.map +1 -0
- package/dist/cxone-expert-node.cjs.production.min.js +2 -0
- package/dist/cxone-expert-node.cjs.production.min.js.map +1 -0
- package/dist/cxone-expert-node.esm.js +1505 -0
- package/dist/cxone-expert-node.esm.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +8 -0
- package/dist/modules/archive.d.ts +18 -0
- package/dist/modules/auth.d.ts +8 -0
- package/dist/modules/contextMaps.d.ts +10 -0
- package/dist/modules/events.d.ts +15 -0
- package/dist/modules/files.d.ts +23 -0
- package/dist/modules/groups.d.ts +11 -0
- package/dist/modules/pages.d.ts +68 -0
- package/dist/modules/requests.d.ts +14 -0
- package/dist/modules/site.d.ts +22 -0
- package/dist/modules/users.d.ts +16 -0
- package/dist/types/archive.d.ts +78 -0
- package/dist/types/auth.d.ts +11 -0
- package/dist/types/contextMaps.d.ts +34 -0
- package/dist/types/events.d.ts +68 -0
- package/dist/types/files.d.ts +61 -0
- package/dist/types/groups.d.ts +57 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/types/pages.d.ts +737 -0
- package/dist/types/requests.d.ts +9 -0
- package/dist/types/security.d.ts +57 -0
- package/dist/types/site.d.ts +254 -0
- package/dist/types/users.d.ts +81 -0
- package/dist/utils.d.ts +2 -0
- package/license.md +20 -20
- package/package.json +16 -5
- package/src/index.ts +105 -35
- package/src/modules/archive.ts +186 -0
- package/src/modules/auth.ts +35 -31
- package/src/modules/contextMaps.ts +56 -0
- package/src/modules/events.ts +140 -0
- package/src/modules/files.ts +291 -0
- package/src/modules/groups.ts +79 -0
- package/src/modules/pages.ts +1236 -73
- package/src/modules/requests.ts +67 -67
- package/src/modules/site.ts +266 -0
- package/src/modules/users.ts +161 -0
- package/src/types/archive.ts +101 -0
- package/src/types/auth.ts +13 -13
- package/src/types/contextMaps.ts +46 -0
- package/src/types/events.ts +91 -0
- package/src/types/files.ts +87 -0
- package/src/types/groups.ts +74 -0
- package/src/types/index.ts +21 -14
- package/src/types/pages.ts +858 -171
- package/src/types/requests.ts +10 -10
- package/src/types/security.ts +60 -47
- package/src/types/site.ts +304 -0
- package/src/types/users.ts +101 -0
- package/src/utils.ts +8 -8
- package/.github/workflows/release.yaml +0 -37
- package/.releaserc.json +0 -15
- package/tsconfig.json +0 -26
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare type ExpertUser = {
|
|
2
|
+
'@anonymous': string;
|
|
3
|
+
'@virtual': string;
|
|
4
|
+
'@id': string;
|
|
5
|
+
'@wikiid': string;
|
|
6
|
+
'@href': string;
|
|
7
|
+
'@guid': string;
|
|
8
|
+
'date.created': string;
|
|
9
|
+
'date.lastlogin': string;
|
|
10
|
+
email: string;
|
|
11
|
+
fullname: string;
|
|
12
|
+
"hash.email": string;
|
|
13
|
+
"license.seat": string;
|
|
14
|
+
nick: string;
|
|
15
|
+
password: {
|
|
16
|
+
"@exists": string;
|
|
17
|
+
} | "";
|
|
18
|
+
status: string;
|
|
19
|
+
timezone: string;
|
|
20
|
+
"uri.avatar": string;
|
|
21
|
+
"uri.gravatar": string;
|
|
22
|
+
username: string | '#RESTRICTED';
|
|
23
|
+
};
|
|
24
|
+
export declare type PageSecurity = {
|
|
25
|
+
'@href': string;
|
|
26
|
+
grants: {
|
|
27
|
+
grant: SecurityGrant | SecurityGrant[];
|
|
28
|
+
};
|
|
29
|
+
'permissions.effective': SecurityGrantPermissions | SecurityGrantPermissions[];
|
|
30
|
+
'permissions.page': SecurityGrantPermissions & SecurityGrantPermissionsRestriction | SecurityGrantPermissions & SecurityGrantPermissionsRestriction[];
|
|
31
|
+
'permissions.revoked': Record<string, {
|
|
32
|
+
operations: SecurityGrantPermissionsOperations | SecurityGrantPermissionsOperations[];
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
export declare type SecurityGrant = {
|
|
36
|
+
'date.modified': string;
|
|
37
|
+
permissions: SecurityGrantPermissions;
|
|
38
|
+
user: ExpertUser;
|
|
39
|
+
'user.modifiedby': ExpertUser;
|
|
40
|
+
};
|
|
41
|
+
export declare type SecurityGrantPermissions = {
|
|
42
|
+
operations: SecurityGrantPermissionsOperations | SecurityGrantPermissionsOperations[];
|
|
43
|
+
role: SecurityRole | SecurityRole[];
|
|
44
|
+
};
|
|
45
|
+
export declare type SecurityGrantPermissionsOperations = {
|
|
46
|
+
'@mask': string;
|
|
47
|
+
'#text': string;
|
|
48
|
+
};
|
|
49
|
+
export declare type SecurityGrantPermissionsRestriction = {
|
|
50
|
+
'@id': string;
|
|
51
|
+
'#text': string;
|
|
52
|
+
};
|
|
53
|
+
export declare type SecurityRole = {
|
|
54
|
+
'@id': string;
|
|
55
|
+
'@href': string;
|
|
56
|
+
'#text': string;
|
|
57
|
+
};
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { BaseQueryParams, PaginationQueryParams } from "./requests";
|
|
2
|
+
export declare type GetSiteActivityParams = {
|
|
3
|
+
since?: string;
|
|
4
|
+
authenticate?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare type GetSiteSubPagesTagsParams = {
|
|
7
|
+
format?: "debug" | "html" | "xml";
|
|
8
|
+
width?: number;
|
|
9
|
+
exclude?: number;
|
|
10
|
+
type?: "compact" | "expandable";
|
|
11
|
+
} & BaseQueryParams;
|
|
12
|
+
export declare type GetSiteFullNavTreeTagsParams = {
|
|
13
|
+
format?: "debug" | "html" | "xml";
|
|
14
|
+
width?: number;
|
|
15
|
+
} & BaseQueryParams;
|
|
16
|
+
export declare type GetSiteOperationsParams = {
|
|
17
|
+
authenticate?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare type GetSitePropertiesParams = {
|
|
20
|
+
names?: string;
|
|
21
|
+
contentcutoff?: number;
|
|
22
|
+
} & BaseQueryParams;
|
|
23
|
+
export declare type GetSiteKeyPropertiesParams = BaseQueryParams;
|
|
24
|
+
export declare type GetSiteKeyPropertiesInfoParams = {
|
|
25
|
+
contentcutoff?: number;
|
|
26
|
+
} & BaseQueryParams;
|
|
27
|
+
export declare type GetSiteQueryParams = {
|
|
28
|
+
parser?: "bestguess" | "term" | "filename" | "lucene";
|
|
29
|
+
nocache?: boolean;
|
|
30
|
+
authenticate?: boolean;
|
|
31
|
+
constraint?: string;
|
|
32
|
+
sortby?: SortBy;
|
|
33
|
+
verbose?: boolean;
|
|
34
|
+
format?: "xml" | "search";
|
|
35
|
+
q: string;
|
|
36
|
+
} & PaginationQueryParams;
|
|
37
|
+
export declare type GetSiteTagsParams = {
|
|
38
|
+
to?: string;
|
|
39
|
+
from?: string;
|
|
40
|
+
authenticate?: boolean;
|
|
41
|
+
type?: "text" | "date" | "user" | "define";
|
|
42
|
+
q: string;
|
|
43
|
+
pages?: boolean;
|
|
44
|
+
};
|
|
45
|
+
export declare type GetSiteTagParams = {
|
|
46
|
+
include?: string;
|
|
47
|
+
parentid?: number;
|
|
48
|
+
language?: string;
|
|
49
|
+
authenticate?: boolean;
|
|
50
|
+
};
|
|
51
|
+
declare type SortBy = "score" | "-score" | "title" | "-title" | "date" | "-date" | "size" | "-size" | "wordcount" | "-wordcount" | "rating.score" | "-rating.score" | "rating.count" | "-rating.count";
|
|
52
|
+
export declare type GetSiteActivityResponse = {
|
|
53
|
+
"@type"?: string;
|
|
54
|
+
entry?: Partial<entryBody> | Partial<entryBody>[] | "";
|
|
55
|
+
};
|
|
56
|
+
export declare type GetSiteExportGroupsResponse = {
|
|
57
|
+
"group"?: Partial<groupBody> | Partial<groupBody>[] | "";
|
|
58
|
+
};
|
|
59
|
+
export declare type GetSiteExportUsersResponse = {
|
|
60
|
+
"user"?: Partial<userBody> | Partial<userBody>[] | "";
|
|
61
|
+
};
|
|
62
|
+
export declare type GetSiteSubPagesTagsResponse = {
|
|
63
|
+
"children": {
|
|
64
|
+
"html": string;
|
|
65
|
+
"nodes": string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
export declare type GetSitePropertiesResponse = {
|
|
69
|
+
"@count"?: string;
|
|
70
|
+
"@href"?: string;
|
|
71
|
+
property?: Partial<propertyBody> | Partial<propertyBody>[] | "";
|
|
72
|
+
};
|
|
73
|
+
export declare type GetSiteKeyPropertiesInfoResponse = Partial<propertyBody>;
|
|
74
|
+
export declare type GetSiteQueryResponse = {
|
|
75
|
+
"@ranking"?: string;
|
|
76
|
+
"@queryid"?: string;
|
|
77
|
+
"@sessionid"?: string;
|
|
78
|
+
"@querycount"?: string;
|
|
79
|
+
"@count.recommendations"?: string;
|
|
80
|
+
"@count"?: string;
|
|
81
|
+
result?: Partial<queryBody> | Partial<queryBody>[] | "";
|
|
82
|
+
};
|
|
83
|
+
export declare type GetSiteStatusResponse = {
|
|
84
|
+
"@status"?: string;
|
|
85
|
+
};
|
|
86
|
+
export declare type GetSiteTagsResponse = {
|
|
87
|
+
"@count"?: string;
|
|
88
|
+
tag?: Partial<tagBody> | Partial<tagBody>[] | "";
|
|
89
|
+
};
|
|
90
|
+
export declare type GetSiteTagResponse = {
|
|
91
|
+
"@value"?: string;
|
|
92
|
+
"@id"?: string;
|
|
93
|
+
"@href"?: string;
|
|
94
|
+
pages?: {
|
|
95
|
+
"@count"?: string;
|
|
96
|
+
"@totalcount"?: string;
|
|
97
|
+
page?: Partial<PageTag> | Partial<PageTag>[] | "";
|
|
98
|
+
};
|
|
99
|
+
title?: string;
|
|
100
|
+
type?: string;
|
|
101
|
+
uri?: string;
|
|
102
|
+
};
|
|
103
|
+
declare type PageTag = {
|
|
104
|
+
"@id": string;
|
|
105
|
+
"@guid": string;
|
|
106
|
+
"@draft.state": string;
|
|
107
|
+
"@href": string;
|
|
108
|
+
"@deleted": string;
|
|
109
|
+
"date.created": string;
|
|
110
|
+
language: string;
|
|
111
|
+
namespace: string;
|
|
112
|
+
path: Partial<{
|
|
113
|
+
"@seo": string;
|
|
114
|
+
"@type": string;
|
|
115
|
+
"#text": string;
|
|
116
|
+
}>;
|
|
117
|
+
title: string;
|
|
118
|
+
"uri.ui": string;
|
|
119
|
+
};
|
|
120
|
+
export declare type tagBody = {
|
|
121
|
+
"@value": string;
|
|
122
|
+
"@id": string;
|
|
123
|
+
"@href": string;
|
|
124
|
+
title: string;
|
|
125
|
+
type: string;
|
|
126
|
+
uri: string;
|
|
127
|
+
};
|
|
128
|
+
export declare type queryBody = {
|
|
129
|
+
author: string;
|
|
130
|
+
authorDisplayName: string;
|
|
131
|
+
"date.modified": string;
|
|
132
|
+
id: string;
|
|
133
|
+
mime: string;
|
|
134
|
+
page: Partial<{
|
|
135
|
+
"@guid": string;
|
|
136
|
+
path: string;
|
|
137
|
+
rating: string;
|
|
138
|
+
title: string;
|
|
139
|
+
"uri.ui": string;
|
|
140
|
+
}>;
|
|
141
|
+
preview: string;
|
|
142
|
+
rank: string;
|
|
143
|
+
tag: string;
|
|
144
|
+
title: string;
|
|
145
|
+
type: string;
|
|
146
|
+
uri: string;
|
|
147
|
+
"uri.track": string;
|
|
148
|
+
};
|
|
149
|
+
export declare type entryBody = {
|
|
150
|
+
"@date": string;
|
|
151
|
+
"pages.created": string;
|
|
152
|
+
"pages.deleted": string;
|
|
153
|
+
"pages.edited": string;
|
|
154
|
+
"pages.total": string;
|
|
155
|
+
"users.created": string;
|
|
156
|
+
"users.total": string;
|
|
157
|
+
};
|
|
158
|
+
export declare type groupBody = {
|
|
159
|
+
"@guid": string;
|
|
160
|
+
"groupname": string;
|
|
161
|
+
"premissions.group": Partial<{
|
|
162
|
+
"operations": Partial<{
|
|
163
|
+
'@mask': string;
|
|
164
|
+
'#text': string;
|
|
165
|
+
}>;
|
|
166
|
+
"role": Partial<{
|
|
167
|
+
'@id': string;
|
|
168
|
+
'#text': string;
|
|
169
|
+
}>;
|
|
170
|
+
}>;
|
|
171
|
+
"service.authentication": object | "";
|
|
172
|
+
};
|
|
173
|
+
export declare type groupsBody = {
|
|
174
|
+
group: Partial<groupBody> | Partial<groupBody>[];
|
|
175
|
+
};
|
|
176
|
+
declare type userBody = {
|
|
177
|
+
"@anonymous": string;
|
|
178
|
+
"@virtual": string;
|
|
179
|
+
"date.created": string;
|
|
180
|
+
"date.lastlogin": string;
|
|
181
|
+
email: string;
|
|
182
|
+
fullname: string;
|
|
183
|
+
groups: groupsBody | "";
|
|
184
|
+
"hash.email": string;
|
|
185
|
+
language: string;
|
|
186
|
+
"license.seat": Partial<{
|
|
187
|
+
"@owner": string;
|
|
188
|
+
"#text": string;
|
|
189
|
+
}>;
|
|
190
|
+
nick: string;
|
|
191
|
+
password: object;
|
|
192
|
+
"permissions.effective": Partial<{
|
|
193
|
+
operations: Partial<{
|
|
194
|
+
'@mask': string;
|
|
195
|
+
'#text': string;
|
|
196
|
+
}>;
|
|
197
|
+
}>;
|
|
198
|
+
"permissions.revoked": object | "";
|
|
199
|
+
"permissions.user": Partial<{
|
|
200
|
+
operations: Partial<{
|
|
201
|
+
'@mask': string;
|
|
202
|
+
'#text': string;
|
|
203
|
+
}>;
|
|
204
|
+
role: Partial<{
|
|
205
|
+
'@id': string;
|
|
206
|
+
'#text': string;
|
|
207
|
+
}>;
|
|
208
|
+
}>;
|
|
209
|
+
"service.authentication": object | "";
|
|
210
|
+
status: string;
|
|
211
|
+
timezone: string;
|
|
212
|
+
"uri.avatar": string;
|
|
213
|
+
"uri.gravatar": string;
|
|
214
|
+
username: string;
|
|
215
|
+
};
|
|
216
|
+
export declare type propertyBody = {
|
|
217
|
+
"@revision": string;
|
|
218
|
+
"@resid": string;
|
|
219
|
+
"@name": string;
|
|
220
|
+
"@href": string;
|
|
221
|
+
"@etag": string;
|
|
222
|
+
"@resource-is-deleted": string;
|
|
223
|
+
"@resource-rev-is-deleted": string;
|
|
224
|
+
contents: Partial<{
|
|
225
|
+
"@type": string;
|
|
226
|
+
"@size": string;
|
|
227
|
+
"@href": string;
|
|
228
|
+
}>;
|
|
229
|
+
"date.modified": string;
|
|
230
|
+
"user.modified": Partial<userModifiedBody>;
|
|
231
|
+
};
|
|
232
|
+
export declare type userModifiedBody = {
|
|
233
|
+
"@anonymous": string;
|
|
234
|
+
"@virtual": string;
|
|
235
|
+
"@id": string;
|
|
236
|
+
"@wikiid": string;
|
|
237
|
+
"@href": string;
|
|
238
|
+
"date.created": string;
|
|
239
|
+
"date.lastlogin"?: string;
|
|
240
|
+
"email": string;
|
|
241
|
+
"fullname": string;
|
|
242
|
+
"hash.email": string;
|
|
243
|
+
"license.seat": Partial<{
|
|
244
|
+
"@owner": string;
|
|
245
|
+
"#text": string;
|
|
246
|
+
}>;
|
|
247
|
+
nick: string;
|
|
248
|
+
password: object;
|
|
249
|
+
status: string;
|
|
250
|
+
"uri.avatar": string;
|
|
251
|
+
"uri.gravatar": string;
|
|
252
|
+
username: string;
|
|
253
|
+
};
|
|
254
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { BaseQueryParams, PaginationQueryParams } from "./requests";
|
|
2
|
+
import { ExpertUser } from "./security";
|
|
3
|
+
import { Group } from "./groups";
|
|
4
|
+
import { PageBase, PageProperty } from "./pages";
|
|
5
|
+
export declare type GetUsersParams = {
|
|
6
|
+
verbose?: boolean;
|
|
7
|
+
sortby?: string;
|
|
8
|
+
seatfilter?: string;
|
|
9
|
+
activatedfilter?: boolean;
|
|
10
|
+
rolefilter?: string;
|
|
11
|
+
authprovider?: number;
|
|
12
|
+
usernameemailfilter?: string;
|
|
13
|
+
fullnamefilter?: string;
|
|
14
|
+
usernamefilter?: string;
|
|
15
|
+
} & PaginationQueryParams & BaseQueryParams;
|
|
16
|
+
export declare type GetUsersResponse = {
|
|
17
|
+
"@count"?: string;
|
|
18
|
+
"@querycount"?: string;
|
|
19
|
+
"@totalcount"?: string;
|
|
20
|
+
"@seateduserstotalcount"?: string;
|
|
21
|
+
"@href": string;
|
|
22
|
+
user: Partial<userBody> | Partial<userBody>[] | "";
|
|
23
|
+
};
|
|
24
|
+
export declare type GetUserParams = {
|
|
25
|
+
exclude?: string;
|
|
26
|
+
} & BaseQueryParams;
|
|
27
|
+
export declare type GetUserResponse = Partial<userBody> | "";
|
|
28
|
+
export declare type GetUserMetricsParams = BaseQueryParams;
|
|
29
|
+
export declare type GetUserMetricsResponse = {
|
|
30
|
+
"@user.id"?: string;
|
|
31
|
+
"@href"?: string;
|
|
32
|
+
"metric.comments"?: string;
|
|
33
|
+
"metric.files-added"?: string;
|
|
34
|
+
"metric.pages-created"?: string;
|
|
35
|
+
"metric.pages-edited"?: string;
|
|
36
|
+
"metric.ratings-down"?: string;
|
|
37
|
+
"metric.ratings-up"?: string;
|
|
38
|
+
};
|
|
39
|
+
export declare type GetUserPropertiesParams = {
|
|
40
|
+
names?: string;
|
|
41
|
+
contentcutoff?: number;
|
|
42
|
+
} & BaseQueryParams;
|
|
43
|
+
export declare type GetUserPropertiesResponse = {
|
|
44
|
+
"@count"?: string;
|
|
45
|
+
"@href"?: string;
|
|
46
|
+
property?: Partial<PageProperty> | Partial<PageProperty>[] | "";
|
|
47
|
+
};
|
|
48
|
+
export declare type GetUserPropertiesKeyParams = BaseQueryParams;
|
|
49
|
+
export declare type GetUserPropertiesKeyResponse = {
|
|
50
|
+
property: {
|
|
51
|
+
"@name"?: string;
|
|
52
|
+
contents?: {
|
|
53
|
+
"@type"?: string;
|
|
54
|
+
"#text"?: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export declare type GetUserPropertiesKeyInfoParams = {
|
|
59
|
+
contentcutoff?: number;
|
|
60
|
+
} & BaseQueryParams;
|
|
61
|
+
export declare type GetUserPropertiesKeyInfoResponse = PageProperty;
|
|
62
|
+
export declare type GetUserSearchParams = {
|
|
63
|
+
format?: string;
|
|
64
|
+
groupid?: number;
|
|
65
|
+
seated?: boolean;
|
|
66
|
+
active?: boolean;
|
|
67
|
+
authprovider?: number;
|
|
68
|
+
fullname?: string;
|
|
69
|
+
username?: string;
|
|
70
|
+
email?: string;
|
|
71
|
+
} & BaseQueryParams & PaginationQueryParams;
|
|
72
|
+
export declare type GetUserSearchResponse = {
|
|
73
|
+
"@count"?: string;
|
|
74
|
+
user?: Partial<userBody> | Partial<userBody>[] | "";
|
|
75
|
+
};
|
|
76
|
+
export declare type userBody = {
|
|
77
|
+
groups: {
|
|
78
|
+
group?: Partial<Group> | Partial<Group>[];
|
|
79
|
+
} | "";
|
|
80
|
+
"page.home": Partial<PageBase> | Partial<PageBase>[] | "";
|
|
81
|
+
} & (Partial<ExpertUser> | Partial<ExpertUser>[]);
|
package/dist/utils.d.ts
ADDED
package/license.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 LibreTexts
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 LibreTexts
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libretexts/cxone-expert-node",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "",
|
|
5
|
-
"
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/LibreTexts/cxone-expert-node"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"typings": "dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"src",
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
6
15
|
"scripts": {
|
|
7
|
-
"
|
|
8
|
-
"
|
|
16
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
17
|
+
"build": "tsdx build --target node",
|
|
18
|
+
"prepare": "tsdx build --target node"
|
|
9
19
|
},
|
|
10
20
|
"keywords": [],
|
|
11
21
|
"author": "LibreTexts, Inc.",
|
|
12
22
|
"license": "MIT",
|
|
13
23
|
"devDependencies": {
|
|
14
|
-
"@types/node": "^22.
|
|
24
|
+
"@types/node": "^22.15.3",
|
|
15
25
|
"dotenv": "^16.4.5",
|
|
26
|
+
"tsdx": "^0.14.1",
|
|
16
27
|
"tsx": "^4.17.0",
|
|
17
28
|
"typescript": "^5.5.4"
|
|
18
29
|
},
|
package/src/index.ts
CHANGED
|
@@ -1,35 +1,105 @@
|
|
|
1
|
-
import pages from './modules/pages';
|
|
2
|
-
import auth from './modules/auth';
|
|
3
|
-
import requests from './modules/requests';
|
|
4
|
-
import { AuthObject, BaseArgs, BrowserTokenParams, ExpertGlobalOptions, ServerTokenParams } from './types';
|
|
5
|
-
import Pages from './modules/pages';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
import pages from './modules/pages';
|
|
2
|
+
import auth from './modules/auth';
|
|
3
|
+
import requests from './modules/requests';
|
|
4
|
+
import { AuthObject, BaseArgs, BrowserTokenParams, ExpertGlobalOptions, ServerTokenParams } from './types';
|
|
5
|
+
import Pages from './modules/pages';
|
|
6
|
+
import Groups from './modules/groups';
|
|
7
|
+
import Events from './modules/events';
|
|
8
|
+
import Archive from './modules/archive';
|
|
9
|
+
import Site from './modules/site';
|
|
10
|
+
import contextMaps from './modules/contextMaps';
|
|
11
|
+
import Users from './modules/users';
|
|
12
|
+
import Files from './modules/files';
|
|
13
|
+
|
|
14
|
+
export * from './types/index';
|
|
15
|
+
|
|
16
|
+
export default class Expert {
|
|
17
|
+
private globals: ExpertGlobalOptions = {};
|
|
18
|
+
private _pages?: Pages;
|
|
19
|
+
private _groups?: Groups;
|
|
20
|
+
private _site?: Site;
|
|
21
|
+
private _auth?: auth;
|
|
22
|
+
private _archive?: Archive;
|
|
23
|
+
private _events?: Events;
|
|
24
|
+
private _contextMaps?: contextMaps;
|
|
25
|
+
private _users?: Users;
|
|
26
|
+
private _files?: Files;
|
|
27
|
+
|
|
28
|
+
constructor(tld?: string) {
|
|
29
|
+
if (tld) {
|
|
30
|
+
this.globals.tld = tld;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public get pages(): Pages {
|
|
35
|
+
if (!this._pages) {
|
|
36
|
+
this._pages = new pages(this.globals);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return this._pages;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public get auth(): auth {
|
|
43
|
+
if (!this._auth) {
|
|
44
|
+
this._auth = new auth();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return this._auth;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public get site(): Site {
|
|
51
|
+
if (!this._site) {
|
|
52
|
+
this._site = new Site(this.globals);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return this._site;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public get archive(): Archive {
|
|
59
|
+
if (!this._archive) {
|
|
60
|
+
this._archive = new Archive(this.globals);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return this._archive;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public get groups(): Groups {
|
|
67
|
+
if (!this._groups) {
|
|
68
|
+
this._groups = new Groups(this.globals);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return this._groups;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public get events(): Events {
|
|
75
|
+
if (!this._events) {
|
|
76
|
+
this._events = new Events(this.globals);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return this._events;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public get contextMaps(): contextMaps {
|
|
83
|
+
if (!this._contextMaps) {
|
|
84
|
+
this._contextMaps = new contextMaps(this.globals);
|
|
85
|
+
}
|
|
86
|
+
return this._contextMaps;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public get users(): Users {
|
|
90
|
+
if (!this._users) {
|
|
91
|
+
this._users = new Users(this.globals);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return this._users;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
public get files(): Files {
|
|
98
|
+
if (!this._files) {
|
|
99
|
+
this._files = new Files(this.globals);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return this._files;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
}
|