cobrili-client 1.0.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/README.md +119 -0
- package/dist/index.browser.js +2468 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/index.d.mts +13278 -0
- package/dist/index.d.ts +13278 -0
- package/dist/index.js +2466 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2443 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +58 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2443 @@
|
|
|
1
|
+
// src/api-registry.ts
|
|
2
|
+
var field = (name, type, options) => ({ name, type, ...options });
|
|
3
|
+
var API_METHODS = {
|
|
4
|
+
// ==========================================================================
|
|
5
|
+
// Authentication
|
|
6
|
+
// ==========================================================================
|
|
7
|
+
login: {
|
|
8
|
+
requestFields: [
|
|
9
|
+
field("loginUser", "object", { optional: true, objectType: "LoginUser", xmlTag: "LoginUser", varname: "login_user" }),
|
|
10
|
+
field("anonymousUser", "object", { optional: true, objectType: "AnonymousLoginData", xmlTag: "AnonymousLoginData", varname: "anonymous_user" })
|
|
11
|
+
],
|
|
12
|
+
responseFields: [
|
|
13
|
+
field("userID", "double"),
|
|
14
|
+
field("userName", "string"),
|
|
15
|
+
field("userFullName", "string"),
|
|
16
|
+
field("userType", "string"),
|
|
17
|
+
field("groups", "array", { itemObjectType: "GroupDataWithoutUsersAndRights" })
|
|
18
|
+
],
|
|
19
|
+
category: "Authentication",
|
|
20
|
+
description: "Authenticate a user (regular or anonymous)"
|
|
21
|
+
},
|
|
22
|
+
logout: {
|
|
23
|
+
requestFields: [field("not_used_at_the_moment", "boolean", {})],
|
|
24
|
+
responseFields: [field("success", "boolean")],
|
|
25
|
+
category: "Authentication",
|
|
26
|
+
description: "Log out the current user"
|
|
27
|
+
},
|
|
28
|
+
// ==========================================================================
|
|
29
|
+
// Navigation
|
|
30
|
+
// ==========================================================================
|
|
31
|
+
getNavigation: {
|
|
32
|
+
requestFields: [field("currentNavigationID", "double", {})],
|
|
33
|
+
responseFields: [field("navigationEntries", "array", { itemObjectType: "NavigationEntry", xmlTag: "navigationEntries" })],
|
|
34
|
+
category: "Navigation",
|
|
35
|
+
description: "Get navigation tree for the current position"
|
|
36
|
+
},
|
|
37
|
+
getBreadCrumb: {
|
|
38
|
+
method: "GetBreadCrumb",
|
|
39
|
+
requestType: "GetBreadcrumbRequest",
|
|
40
|
+
requestFields: [field("navigationID", "double", {})],
|
|
41
|
+
responseFields: [field("breadcrumbs", "array", { itemObjectType: "BreadCrumbEntry" }), field("breadCrumbStartBehavior", "string")],
|
|
42
|
+
category: "Navigation",
|
|
43
|
+
description: "Get breadcrumb trail for the given navigation ID"
|
|
44
|
+
},
|
|
45
|
+
getNextPage: {
|
|
46
|
+
requestFields: [field("navigationID", "double", {})],
|
|
47
|
+
responseFields: [field("topicID", "double"), field("navigationID", "double"), field("topicTitle", "string")],
|
|
48
|
+
category: "Navigation",
|
|
49
|
+
description: "Get the next page in navigation order"
|
|
50
|
+
},
|
|
51
|
+
getPreviousPage: {
|
|
52
|
+
requestFields: [field("navigationID", "double", {})],
|
|
53
|
+
responseFields: [field("topicID", "double"), field("navigationID", "double"), field("topicTitle", "string")],
|
|
54
|
+
category: "Navigation",
|
|
55
|
+
description: "Get the previous page in navigation order"
|
|
56
|
+
},
|
|
57
|
+
navigateToTopic: {
|
|
58
|
+
requestFields: [field("topicID", "double", {}), field("navigationID", "double", {})],
|
|
59
|
+
responseFields: [field("activeHelpsetHasBeenChanged", "boolean")],
|
|
60
|
+
category: "Navigation",
|
|
61
|
+
description: "Navigate to a specific topic"
|
|
62
|
+
},
|
|
63
|
+
// ==========================================================================
|
|
64
|
+
// Content
|
|
65
|
+
// ==========================================================================
|
|
66
|
+
getContent: {
|
|
67
|
+
requestFields: [field("topicID", "double", {})],
|
|
68
|
+
responseFields: [field("content", "string"), field("extraContents", "array", { optional: true, itemObjectType: "AdditionalContent" })],
|
|
69
|
+
category: "Content",
|
|
70
|
+
description: "Get HTML content for a topic"
|
|
71
|
+
},
|
|
72
|
+
getTemplate: {
|
|
73
|
+
requestFields: [field("templateType", "string", { keytype: "TemplateTypesEnum" })],
|
|
74
|
+
responseFields: [field("content", "string")],
|
|
75
|
+
category: "Content",
|
|
76
|
+
description: "Get a template by type"
|
|
77
|
+
},
|
|
78
|
+
hasTemplate: {
|
|
79
|
+
requestFields: [field("templateType", "string", { keytype: "TemplateTypesEnum" })],
|
|
80
|
+
responseFields: [field("hasTemplate", "boolean", { xmlTag: "templateExists" })],
|
|
81
|
+
category: "Content",
|
|
82
|
+
description: "Check if a template exists"
|
|
83
|
+
},
|
|
84
|
+
// ==========================================================================
|
|
85
|
+
// Topics
|
|
86
|
+
// ==========================================================================
|
|
87
|
+
getTopicForExternalId: {
|
|
88
|
+
requestFields: [field("externalIdForTopic", "string", {}), field("externalIdForHelpset", "string", {}), field("metaData", "stringMap")],
|
|
89
|
+
responseFields: [field("topicID", "double"), field("navigationID", "double")],
|
|
90
|
+
category: "Topics",
|
|
91
|
+
description: "Find a topic by its external ID"
|
|
92
|
+
},
|
|
93
|
+
getExternalIdForTopic: {
|
|
94
|
+
requestFields: [field("topicID", "double", {})],
|
|
95
|
+
responseFields: [field("externalIdForTopic", "string"), field("externalIdForHelpset", "string"), field("metaDataForHelpset", "stringArray")],
|
|
96
|
+
category: "Topics",
|
|
97
|
+
description: "Get external ID for a topic"
|
|
98
|
+
},
|
|
99
|
+
getTitleForTopic: {
|
|
100
|
+
requestFields: [field("topicID", "double", {})],
|
|
101
|
+
responseFields: [field("title", "string"), field("externalTopicID", "string")],
|
|
102
|
+
category: "Topics",
|
|
103
|
+
description: "Get the title of a topic"
|
|
104
|
+
},
|
|
105
|
+
getHomeTopicId: {
|
|
106
|
+
requestFields: [field("helpsetID", "double", {})],
|
|
107
|
+
responseFields: [field("topicID", "double"), field("navigationID", "double")],
|
|
108
|
+
category: "Topics",
|
|
109
|
+
description: "Get the home topic for a helpset"
|
|
110
|
+
},
|
|
111
|
+
getRelatedTopics: {
|
|
112
|
+
requestFields: [field("currentTopicID", "double", {}), field("withMetaData", "boolean", {}), field("wantedMetaKeys", "stringArray"), field("localizeMetaValues", "boolean", {})],
|
|
113
|
+
responseFields: [field("relatedTopics", "array", { itemObjectType: "RelatedTopicInfo" })],
|
|
114
|
+
category: "Topics",
|
|
115
|
+
description: "Get related topics for a given topic"
|
|
116
|
+
},
|
|
117
|
+
// ==========================================================================
|
|
118
|
+
// Helpsets
|
|
119
|
+
// ==========================================================================
|
|
120
|
+
getAllHelpsets: {
|
|
121
|
+
requestFields: [field("masterHelpSetApplicationIdentifier", "string", {}), field("withMetadata", "boolean", { xmlTag: "with_metadata" })],
|
|
122
|
+
responseFields: [field("helpsetInfos", "array", { itemObjectType: "HelpsetInfo", xmlTag: "helpsetInfos" })],
|
|
123
|
+
category: "Helpsets",
|
|
124
|
+
description: "Get all helpsets for a master helpset"
|
|
125
|
+
},
|
|
126
|
+
getHelpsetInfoForTopic: {
|
|
127
|
+
requestFields: [field("topicID", "double", {})],
|
|
128
|
+
responseFields: [field("helpsetInfo", "object", { objectType: "HelpsetInfo" })],
|
|
129
|
+
category: "Helpsets",
|
|
130
|
+
description: "Get helpset info for a topic"
|
|
131
|
+
},
|
|
132
|
+
getHelpsetInfoForActiveHelpset: {
|
|
133
|
+
requestFields: [field("notUsed", "boolean", {})],
|
|
134
|
+
responseFields: [field("helpsetInfo", "object", { objectType: "HelpsetInfo", xmlTag: "HelpsetInfo" })],
|
|
135
|
+
category: "Helpsets",
|
|
136
|
+
description: "Get info for the currently active helpset"
|
|
137
|
+
},
|
|
138
|
+
switchMasterHelpSet: {
|
|
139
|
+
requestFields: [
|
|
140
|
+
field("masterHelpSetApplicationIdentifier", "string", {}),
|
|
141
|
+
field("initActiveHelpset", "boolean", {}),
|
|
142
|
+
field("externalHelpsetID_forActiveHelpset", "string", { optional: true })
|
|
143
|
+
],
|
|
144
|
+
responseFields: [
|
|
145
|
+
field("pathToIndexHTHML", "string"),
|
|
146
|
+
field("masterHelpsetDescription", "stringMap"),
|
|
147
|
+
field("startTopicID", "double", { xmlTag: "root_topic_id" }),
|
|
148
|
+
field("activeHelpsetID", "double", { xmlTag: "masterHelpSetId" })
|
|
149
|
+
],
|
|
150
|
+
category: "Helpsets",
|
|
151
|
+
description: "Switch to a different master helpset"
|
|
152
|
+
},
|
|
153
|
+
// ==========================================================================
|
|
154
|
+
// Search
|
|
155
|
+
// ==========================================================================
|
|
156
|
+
startSearch: {
|
|
157
|
+
requestFields: [field("searchString", "string", {}), field("searchParameters", "object", { objectType: "SearchQueryParameters" })],
|
|
158
|
+
responseFields: [field("searchID", "double"), field("numberOfHits", "int")],
|
|
159
|
+
category: "Search",
|
|
160
|
+
description: "Start a new search"
|
|
161
|
+
},
|
|
162
|
+
getSearchResults: {
|
|
163
|
+
requestFields: [field("searchID", "double", {}), field("hitRangeBegin", "int", {}), field("hitRangeEnd", "int", {})],
|
|
164
|
+
responseFields: [field("results", "array", { itemObjectType: "SearchResult" })],
|
|
165
|
+
category: "Search",
|
|
166
|
+
description: "Get search results for a search ID"
|
|
167
|
+
},
|
|
168
|
+
// ==========================================================================
|
|
169
|
+
// History
|
|
170
|
+
// ==========================================================================
|
|
171
|
+
recordHistoryEntry: {
|
|
172
|
+
requestFields: [
|
|
173
|
+
field("topicID", "double", {}),
|
|
174
|
+
field("navigationID", "double", {}),
|
|
175
|
+
field("pageType", "string", { keytype: "HistoryEntryPageType" }),
|
|
176
|
+
field("searchHistoryEntry", "object", { optional: true, objectType: "SearchHistoryEntry", varname: "searchHistoryEntry" })
|
|
177
|
+
],
|
|
178
|
+
responseFields: [field("success", "boolean")],
|
|
179
|
+
category: "History",
|
|
180
|
+
description: "Record a history entry"
|
|
181
|
+
},
|
|
182
|
+
getHistoryList: {
|
|
183
|
+
requestFields: [field("not_used_at_the_moment", "boolean", {})],
|
|
184
|
+
responseFields: [field("historyStackPointer", "int"), field("entries", "array", { itemObjectType: "HistoryEntry" })],
|
|
185
|
+
category: "History",
|
|
186
|
+
description: "Get the history list"
|
|
187
|
+
},
|
|
188
|
+
historyForward: {
|
|
189
|
+
requestFields: [field("steps", "int", {})],
|
|
190
|
+
responseFields: [field("historyEntry", "object", { objectType: "HistoryEntry", xmlTag: "HistoryEntry", varname: "historyEntry" })],
|
|
191
|
+
category: "History",
|
|
192
|
+
description: "Go forward in history"
|
|
193
|
+
},
|
|
194
|
+
historyBack: {
|
|
195
|
+
requestFields: [field("steps", "int", {})],
|
|
196
|
+
responseFields: [field("historyEntry", "object", { objectType: "HistoryEntry", xmlTag: "HistoryEntry", varname: "historyEntry" })],
|
|
197
|
+
category: "History",
|
|
198
|
+
description: "Go back in history"
|
|
199
|
+
},
|
|
200
|
+
// ==========================================================================
|
|
201
|
+
// Bookmarks
|
|
202
|
+
// ==========================================================================
|
|
203
|
+
addBookmark: {
|
|
204
|
+
requestFields: [field("topicID", "double", {}), field("navigationID", "double", {}), field("bookmarkTitle", "string", {})],
|
|
205
|
+
responseFields: [field("bookmarkEntry", "object", { objectType: "BookmarkEntry", xmlTag: "BookmarkEntry", varname: "bookmarkEntry" })],
|
|
206
|
+
category: "Bookmarks",
|
|
207
|
+
description: "Add a bookmark"
|
|
208
|
+
},
|
|
209
|
+
deleteBookmark: {
|
|
210
|
+
requestFields: [field("bookmarkID", "double", {})],
|
|
211
|
+
responseFields: [field("success", "boolean")],
|
|
212
|
+
category: "Bookmarks",
|
|
213
|
+
description: "Delete a bookmark"
|
|
214
|
+
},
|
|
215
|
+
renameBookmark: {
|
|
216
|
+
requestFields: [field("bookmarkID", "double", {}), field("bookmarkTitle", "string", {})],
|
|
217
|
+
responseFields: [field("success", "boolean")],
|
|
218
|
+
category: "Bookmarks",
|
|
219
|
+
description: "Rename a bookmark"
|
|
220
|
+
},
|
|
221
|
+
getBookmarkList: {
|
|
222
|
+
requestFields: [field("not_used_at_the_moment", "boolean", {})],
|
|
223
|
+
responseFields: [field("entries", "array", { itemObjectType: "BookmarkEntry", xmlTag: "entries" })],
|
|
224
|
+
category: "Bookmarks",
|
|
225
|
+
description: "Get all bookmarks for a user"
|
|
226
|
+
},
|
|
227
|
+
isInBookmarks: {
|
|
228
|
+
requestFields: [field("topicID", "double", {}), field("navigationID", "double", {})],
|
|
229
|
+
responseFields: [field("isBookmarked", "boolean"), field("entry", "object", { optional: true, objectType: "BookmarkEntry", xmlTag: "BookmarkEntry", varname: "entry" })],
|
|
230
|
+
category: "Bookmarks",
|
|
231
|
+
description: "Check if a topic is bookmarked"
|
|
232
|
+
},
|
|
233
|
+
// ==========================================================================
|
|
234
|
+
// Metadata
|
|
235
|
+
// ==========================================================================
|
|
236
|
+
getUsedMetaValues: {
|
|
237
|
+
requestFields: [
|
|
238
|
+
field("metaKey", "string", {}),
|
|
239
|
+
field("externalHelpsetID", "string", { optional: true }),
|
|
240
|
+
field("localizeMetaValues", "boolean", {}),
|
|
241
|
+
field("sortMetaValues", "boolean", {})
|
|
242
|
+
],
|
|
243
|
+
responseFields: [field("values", "stringArray", { optional: true }), field("sortedAndLocalizedEntries", "array", { itemObjectType: "LocalizedEntry", optional: true })],
|
|
244
|
+
category: "Metadata",
|
|
245
|
+
description: "Get used metadata values"
|
|
246
|
+
},
|
|
247
|
+
changeMetadataForHelpset: {
|
|
248
|
+
requestFields: [
|
|
249
|
+
field("currentTopicID", "double", {}),
|
|
250
|
+
field("currentNavigationID", "double", {}),
|
|
251
|
+
field("metaKey", "string", {}),
|
|
252
|
+
field("metaValue", "string", {})
|
|
253
|
+
],
|
|
254
|
+
responseFields: [field("newTopicID", "double"), field("newNavigationID", "double")],
|
|
255
|
+
category: "Metadata",
|
|
256
|
+
description: "Change metadata filter for current helpset"
|
|
257
|
+
},
|
|
258
|
+
getMetaKeyWhichRepresentsLanguage: {
|
|
259
|
+
requestFields: [field("notUsed", "boolean", {})],
|
|
260
|
+
responseFields: [field("metaKey", "string")],
|
|
261
|
+
category: "Metadata",
|
|
262
|
+
description: "Get the metadata key that represents language"
|
|
263
|
+
},
|
|
264
|
+
// ==========================================================================
|
|
265
|
+
// GUI Language
|
|
266
|
+
// ==========================================================================
|
|
267
|
+
switchGUILan: {
|
|
268
|
+
requestFields: [field("lan", "string", {})],
|
|
269
|
+
responseFields: [field("result", "boolean")],
|
|
270
|
+
category: "GUI Language",
|
|
271
|
+
description: "Switch GUI language"
|
|
272
|
+
},
|
|
273
|
+
getCurrentGUILanguage: {
|
|
274
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
275
|
+
responseFields: [field("guiLanguage", "string")],
|
|
276
|
+
category: "GUI Language",
|
|
277
|
+
description: "Get current GUI language"
|
|
278
|
+
},
|
|
279
|
+
// ==========================================================================
|
|
280
|
+
// Resources
|
|
281
|
+
// ==========================================================================
|
|
282
|
+
getResourceStrings: {
|
|
283
|
+
requestFields: [field("wantedResourceIds", "stringArray", {}), field("wantedLanguage", "string", {})],
|
|
284
|
+
responseFields: [field("resourceStringsInWantedLanguage", "stringArray")],
|
|
285
|
+
category: "Resources",
|
|
286
|
+
description: "Get resource strings for localization"
|
|
287
|
+
},
|
|
288
|
+
// ==========================================================================
|
|
289
|
+
// Cobrili Links
|
|
290
|
+
// ==========================================================================
|
|
291
|
+
getCobriliLinkForTopicId: {
|
|
292
|
+
requestFields: [field("topicID", "double", {})],
|
|
293
|
+
responseFields: [field("cobriliLink", "string")],
|
|
294
|
+
category: "Cobrili Links",
|
|
295
|
+
description: "Generate a Cobrili link for a topic"
|
|
296
|
+
},
|
|
297
|
+
// ==========================================================================
|
|
298
|
+
// Configuration
|
|
299
|
+
// ==========================================================================
|
|
300
|
+
getConfigurationData: {
|
|
301
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
302
|
+
responseFields: [field("metaKeyForLanguage", "string"), field("defaultGuiLanguage", "string"), field("searchFacetKeys", "stringArray")],
|
|
303
|
+
category: "Configuration",
|
|
304
|
+
description: "Get configuration data"
|
|
305
|
+
},
|
|
306
|
+
getCurrentCobriliVersion: {
|
|
307
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
308
|
+
responseFields: [field("version", "string"), field("buildDate", "string")],
|
|
309
|
+
category: "Configuration",
|
|
310
|
+
description: "Get current Cobrili version"
|
|
311
|
+
},
|
|
312
|
+
// ==========================================================================
|
|
313
|
+
// Helpset Import/Export/Management
|
|
314
|
+
// ==========================================================================
|
|
315
|
+
importHelpset: {
|
|
316
|
+
requestFields: [
|
|
317
|
+
field("zipDocument", "object", { objectType: "FileTransport", varname: "zipDocument" }),
|
|
318
|
+
field("withDialog", "boolean", {}),
|
|
319
|
+
field("overwriteExistingHelpset", "boolean", {}),
|
|
320
|
+
field("uri_to_webapp_for_refresh_cache_after_helpset_import", "string", { optional: true })
|
|
321
|
+
],
|
|
322
|
+
responseFields: [field("success", "boolean"), field("helpsetID", "double"), field("message", "string")],
|
|
323
|
+
category: "Helpset Import/Export/Management",
|
|
324
|
+
description: "Import a helpset from a ZIP file"
|
|
325
|
+
},
|
|
326
|
+
importMasterHelpset: {
|
|
327
|
+
requestFields: [
|
|
328
|
+
field("masterHelpSetApplicationIdentifier", "string", {}),
|
|
329
|
+
field("masterHelpset", "object", { objectType: "FileTransport", varname: "masterHelpset" }),
|
|
330
|
+
field("withDialog", "boolean", {}),
|
|
331
|
+
field("overwriteExistingMasterHelpset", "boolean", {}),
|
|
332
|
+
field("forceOverwrite", "boolean", {})
|
|
333
|
+
],
|
|
334
|
+
responseFields: [field("success", "boolean"), field("masterHelpsetID", "double")],
|
|
335
|
+
category: "Helpset Import/Export/Management",
|
|
336
|
+
description: "Import a master helpset"
|
|
337
|
+
},
|
|
338
|
+
createMasterHelpSet: {
|
|
339
|
+
requestFields: [
|
|
340
|
+
field("masterHelpSetApplicationIdentifier", "string", {}),
|
|
341
|
+
field("masterHelpSetStoreDirectory", "string", {}),
|
|
342
|
+
field("loggingInfo", "object", { optional: true, objectType: "LoggingInformation", varname: "loggingInfo" }),
|
|
343
|
+
field("defaultGuiLanguage", "string", {}),
|
|
344
|
+
field("databaseSettings", "object", { optional: true, objectType: "DatabaseSettings", varname: "databaseSettings" })
|
|
345
|
+
],
|
|
346
|
+
responseFields: [field("masterHelpSetID", "double"), field("isNew", "boolean")],
|
|
347
|
+
category: "Helpset Import/Export/Management",
|
|
348
|
+
description: "Create a new master helpset or return existing"
|
|
349
|
+
},
|
|
350
|
+
deleteHelpset: {
|
|
351
|
+
requestFields: [field("helpsetID", "double", {})],
|
|
352
|
+
responseFields: [field("success", "boolean")],
|
|
353
|
+
category: "Helpset Import/Export/Management",
|
|
354
|
+
description: "Delete a helpset"
|
|
355
|
+
},
|
|
356
|
+
deleteHelpsetsByExternalID: {
|
|
357
|
+
requestFields: [field("externalHelpsetID", "string", {}), field("metaData", "stringMap", {})],
|
|
358
|
+
responseFields: [field("not_used_at_the_moment", "boolean")],
|
|
359
|
+
category: "Helpset Import/Export/Management",
|
|
360
|
+
description: "Delete helpsets by external ID"
|
|
361
|
+
},
|
|
362
|
+
deleteHelpsetByZipNameOrPath: {
|
|
363
|
+
requestFields: [field("zipFileNameOrPath", "string", {})],
|
|
364
|
+
responseFields: [field("not_used_at_the_moment", "boolean")],
|
|
365
|
+
category: "Helpset Import/Export/Management",
|
|
366
|
+
description: "Delete a helpset by zip name or path"
|
|
367
|
+
},
|
|
368
|
+
importHelpsets: {
|
|
369
|
+
requestFields: [
|
|
370
|
+
field("listOfHelpsets", "array", { itemObjectType: "FileTransport", varname: "listOfHelpsets" }),
|
|
371
|
+
field("withDialog", "boolean", {}),
|
|
372
|
+
field("overwriteExistingHelpset", "boolean", {}),
|
|
373
|
+
field("uri_to_webapp_for_refresh_cache_after_helpset_import", "string", { optional: true })
|
|
374
|
+
],
|
|
375
|
+
responseFields: [field("success", "boolean"), field("importedCount", "int")],
|
|
376
|
+
category: "Helpset Import/Export/Management",
|
|
377
|
+
description: "Import multiple helpsets from a folder"
|
|
378
|
+
},
|
|
379
|
+
checkMasterHelpsetID: {
|
|
380
|
+
requestFields: [field("masterHelpSetApplicationIdentifier", "string", {})],
|
|
381
|
+
responseFields: [field("isValid", "boolean"), field("masterHelpsetID", "double")],
|
|
382
|
+
category: "Helpset Import/Export/Management",
|
|
383
|
+
description: "Check if master helpset ID is valid"
|
|
384
|
+
},
|
|
385
|
+
loadActiveHelpset: {
|
|
386
|
+
requestFields: [field("helpsetID", "double", {})],
|
|
387
|
+
responseFields: [field("loadedSuccessfully", "boolean")],
|
|
388
|
+
category: "Helpset Import/Export/Management",
|
|
389
|
+
description: "Load active helpset for navigation (required before GetNavigation/GetBreadcrumb)"
|
|
390
|
+
},
|
|
391
|
+
getHelpsetInfosExtended: {
|
|
392
|
+
requestFields: [field("onlyNotContainedHelpsets", "boolean", {}), field("withMetaData", "boolean", {})],
|
|
393
|
+
responseFields: [field("helpsetInfos", "array", { itemObjectType: "HelpsetInfo" })],
|
|
394
|
+
category: "Helpset Import/Export/Management",
|
|
395
|
+
description: "Get helpset infos with extended filtering"
|
|
396
|
+
},
|
|
397
|
+
exportHelpsetStorage: {
|
|
398
|
+
requestFields: [field("notUsed", "boolean", {})],
|
|
399
|
+
responseFields: [field("zipFileData", "string")],
|
|
400
|
+
category: "Helpset Import/Export/Management",
|
|
401
|
+
description: "Export helpset storage as ZIP"
|
|
402
|
+
},
|
|
403
|
+
importHelpsetStorage: {
|
|
404
|
+
requestFields: [field("zipfile", "object", { objectType: "FileTransport", varname: "zipfile" })],
|
|
405
|
+
responseFields: [field("success", "boolean")],
|
|
406
|
+
category: "Helpset Import/Export/Management",
|
|
407
|
+
description: "Import helpset storage from ZIP"
|
|
408
|
+
},
|
|
409
|
+
getAllTopicsOfHelpset: {
|
|
410
|
+
requestFields: [field("helpsetID", "double", {})],
|
|
411
|
+
responseFields: [field("entries", "array", { itemObjectType: "TopicInfo", varname: "entries" })],
|
|
412
|
+
category: "Helpset Import/Export/Management",
|
|
413
|
+
description: "Get all topics of a helpset"
|
|
414
|
+
},
|
|
415
|
+
// ==========================================================================
|
|
416
|
+
// Search Extended
|
|
417
|
+
// ==========================================================================
|
|
418
|
+
getSearchData: {
|
|
419
|
+
requestFields: [field("searchID", "double", {})],
|
|
420
|
+
responseFields: [field("searchString", "string"), field("searchParameters", "object", { objectType: "SearchQueryParameters" }), field("numberOfResults", "int")],
|
|
421
|
+
category: "Search Extended",
|
|
422
|
+
description: "Get search parameters for a search ID"
|
|
423
|
+
},
|
|
424
|
+
getSuggestionsForSearchInput: {
|
|
425
|
+
requestFields: [field("searchInput", "string", {})],
|
|
426
|
+
responseFields: [field("suggestions", "stringArray"), field("lastSearches", "stringArray"), field("searchInput", "string")],
|
|
427
|
+
category: "Search Extended",
|
|
428
|
+
description: "Get search suggestions"
|
|
429
|
+
},
|
|
430
|
+
getChangeInNumberOfSearchResultsForFacet: {
|
|
431
|
+
requestFields: [
|
|
432
|
+
field("searchID", "double", {}),
|
|
433
|
+
field("metaKey", "string", {}),
|
|
434
|
+
field("metaValue", "string", {}),
|
|
435
|
+
field("addFacet", "boolean", {})
|
|
436
|
+
],
|
|
437
|
+
responseFields: [field("searchID", "double"), field("changes", "int"), field("changeAsText", "string")],
|
|
438
|
+
category: "Search Extended",
|
|
439
|
+
description: "Get result count change for a facet"
|
|
440
|
+
},
|
|
441
|
+
getUsedLuceneQueryAsString: {
|
|
442
|
+
requestFields: [field("searchID", "double", {})],
|
|
443
|
+
responseFields: [field("luceneQuery", "string")],
|
|
444
|
+
category: "Search Extended",
|
|
445
|
+
description: "Get Lucene query as string"
|
|
446
|
+
},
|
|
447
|
+
getMetaKeysWhichBehaveAsSearchFacets: {
|
|
448
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
449
|
+
responseFields: [field("facetKeys", "stringArray")],
|
|
450
|
+
category: "Search Extended",
|
|
451
|
+
description: "Get metadata keys that behave as search facets"
|
|
452
|
+
},
|
|
453
|
+
getSuggestionsForSearchInputWithParameters: {
|
|
454
|
+
method: "GetSuggestionsForSearchInputWithParameters",
|
|
455
|
+
requestType: "StartSearchRequest",
|
|
456
|
+
requestFields: [field("searchString", "string", {}), field("searchParameters", "object", { objectType: "SearchQueryParameters", varname: "searchParameters" })],
|
|
457
|
+
responseFields: [field("suggestions", "stringArray"), field("lastSearches", "stringArray"), field("searchInput", "string")],
|
|
458
|
+
category: "Search Extended",
|
|
459
|
+
description: "Get search suggestions with parameters"
|
|
460
|
+
},
|
|
461
|
+
rebuildSearchIndex: {
|
|
462
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
463
|
+
responseFields: [field("not_used", "boolean")],
|
|
464
|
+
category: "Search Extended",
|
|
465
|
+
description: "Rebuild the search index"
|
|
466
|
+
},
|
|
467
|
+
startSearchWithLuceneAnalyzer: {
|
|
468
|
+
requestFields: [
|
|
469
|
+
field("searchString", "string", {}),
|
|
470
|
+
field("searchParameters", "object", { objectType: "SearchQueryParameters", optional: true, varname: "searchParameters" }),
|
|
471
|
+
field("matchSimilarWords", "boolean", {}),
|
|
472
|
+
field("usedLuceneAnalyzer", "string", { optional: true })
|
|
473
|
+
],
|
|
474
|
+
responseFields: [field("searchID", "double"), field("numberOfHits", "int")],
|
|
475
|
+
category: "Search Extended",
|
|
476
|
+
description: "Start search with specific Lucene analyzer"
|
|
477
|
+
},
|
|
478
|
+
checkSearchIndex: {
|
|
479
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
480
|
+
responseFields: [field("operationSucceeded", "boolean")],
|
|
481
|
+
category: "Search Extended",
|
|
482
|
+
description: "Check and optionally repair search index"
|
|
483
|
+
},
|
|
484
|
+
getSearchResultsWithMetadata: {
|
|
485
|
+
requestFields: [
|
|
486
|
+
field("searchID", "double", {}),
|
|
487
|
+
field("hitRangeBegin", "int", {}),
|
|
488
|
+
field("hitRangeEnd", "int", {}),
|
|
489
|
+
field("wantedMetaKeys", "stringArray", {})
|
|
490
|
+
],
|
|
491
|
+
responseFields: [field("results", "array", { itemObjectType: "SearchResultWithMetadata" })],
|
|
492
|
+
category: "Search Extended",
|
|
493
|
+
description: "Get search results with metadata"
|
|
494
|
+
},
|
|
495
|
+
getAllChangesInNumberOfSearchResultsForFacets: {
|
|
496
|
+
requestFields: [field("searchID", "double", {}), field("facets", "array", { itemObjectType: "FacetInputData", varname: "facets" })],
|
|
497
|
+
responseFields: [field("facetResults", "array", { itemObjectType: "FacetChange", varname: "facetResults" })],
|
|
498
|
+
category: "Search Extended",
|
|
499
|
+
description: "Get all facet changes for search"
|
|
500
|
+
},
|
|
501
|
+
startSearchForGivenLanguage: {
|
|
502
|
+
method: "StartSearch_ForGivenLanguage",
|
|
503
|
+
requestType: "StartSearch_ForGivenLanguageRequest",
|
|
504
|
+
requestFields: [
|
|
505
|
+
field("searchString", "string", {}),
|
|
506
|
+
field("searchParameters", "object", { objectType: "SearchQueryParameters", optional: true, varname: "searchParameters" }),
|
|
507
|
+
field("givenLanguage", "string", {})
|
|
508
|
+
],
|
|
509
|
+
responseFields: [field("searchID", "double"), field("numberOfHits", "int")],
|
|
510
|
+
category: "Search Extended",
|
|
511
|
+
description: "Start search for a given language"
|
|
512
|
+
},
|
|
513
|
+
getExecutedSearches: {
|
|
514
|
+
requestFields: [field("dateStart", "double", {}), field("dateEnd", "double", {})],
|
|
515
|
+
responseFields: [field("searches", "array", { itemObjectType: "ExecutedSearch" })],
|
|
516
|
+
category: "Search Extended",
|
|
517
|
+
description: "Get executed searches in date range"
|
|
518
|
+
},
|
|
519
|
+
startExtendedSearch: {
|
|
520
|
+
requestFields: [
|
|
521
|
+
field("searchInTopicTypes", "string", { keytype: "SearchInTopicTypesEnum" }),
|
|
522
|
+
field("searchString", "string", {}),
|
|
523
|
+
field("searchParameters", "object", { objectType: "SearchQueryParameters", optional: true, varname: "searchParameters" }),
|
|
524
|
+
field("matchSimilarWords", "boolean", {}),
|
|
525
|
+
field("usedLuceneAnalyzer", "string", { optional: true }),
|
|
526
|
+
field("searchLanguage", "string", { optional: true }),
|
|
527
|
+
field("searchBelowTheseTopics", "array", { itemType: "double", varname: "searchBelowTheseTopics" })
|
|
528
|
+
],
|
|
529
|
+
responseFields: [field("searchID", "double"), field("numberOfResults", "int")],
|
|
530
|
+
category: "Search Extended",
|
|
531
|
+
description: "Start extended search with topic types"
|
|
532
|
+
},
|
|
533
|
+
getSearchResultsExtended: {
|
|
534
|
+
requestFields: [
|
|
535
|
+
field("searchID", "double", {}),
|
|
536
|
+
field("getResultsForTopicTypes", "string", { keytype: "SearchInTopicTypesEnum" }),
|
|
537
|
+
field("hitRangeBegin", "int", {}),
|
|
538
|
+
field("hitRangeEnd", "int", {}),
|
|
539
|
+
field("wantedMetaKeys", "stringArray", {})
|
|
540
|
+
],
|
|
541
|
+
responseFields: [field("results", "array", { itemObjectType: "SearchResultWithMetadata" })],
|
|
542
|
+
category: "Search Extended",
|
|
543
|
+
description: "Get extended search results"
|
|
544
|
+
},
|
|
545
|
+
getAllChangesInNumberOfSearchResultsForFacetsExtended: {
|
|
546
|
+
requestFields: [field("searchIDs", "array", { itemType: "double" }), field("facets", "array", { itemObjectType: "FacetInputData", varname: "facets" })],
|
|
547
|
+
responseFields: [
|
|
548
|
+
field("facetResultsForEachSearch", "array", { itemObjectType: "FacetResultsForSearch" }),
|
|
549
|
+
field("combinedResults", "array", { itemObjectType: "FacetChange" })
|
|
550
|
+
],
|
|
551
|
+
category: "Search Extended",
|
|
552
|
+
description: "Get facet changes for extended search"
|
|
553
|
+
},
|
|
554
|
+
startSearchWithSearchProposals: {
|
|
555
|
+
requestFields: [field("data", "object", { objectType: "StartExtendedSearchRequest", xmlTag: "StartExtendedSearchRequest", varname: "data" })],
|
|
556
|
+
responseFields: [
|
|
557
|
+
field("data", "object", { objectType: "StartExtendedSearchResponse", xmlTag: "StartExtendedSearchResponse", varname: "data" }),
|
|
558
|
+
field("propsals", "array", { itemObjectType: "SearchProposalResult" })
|
|
559
|
+
],
|
|
560
|
+
category: "Search Extended",
|
|
561
|
+
description: "Start search with proposals"
|
|
562
|
+
},
|
|
563
|
+
getSearchSettings: {
|
|
564
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
565
|
+
responseFields: [field("SearchSettings", "object")],
|
|
566
|
+
category: "Search Extended",
|
|
567
|
+
description: "Get search settings"
|
|
568
|
+
},
|
|
569
|
+
getSearchTermChangedByAnalyzer: {
|
|
570
|
+
requestFields: [
|
|
571
|
+
field("searchTerm", "string", {}),
|
|
572
|
+
field("analyzerName", "string", {}),
|
|
573
|
+
field("searchLanguage", "string", {})
|
|
574
|
+
],
|
|
575
|
+
responseFields: [field("changedSearchTerm", "string")],
|
|
576
|
+
category: "Search Extended",
|
|
577
|
+
description: "Get search term transformed by analyzer"
|
|
578
|
+
},
|
|
579
|
+
searchInRDFData: {
|
|
580
|
+
requestFields: [field("searchID", "double", {}), field("usedRDFSearchType", "string", {})],
|
|
581
|
+
responseFields: [field("results", "array", { itemObjectType: "SearchResult" })],
|
|
582
|
+
category: "Search Extended",
|
|
583
|
+
description: "Search in RDF data"
|
|
584
|
+
},
|
|
585
|
+
// ==========================================================================
|
|
586
|
+
// History Extended
|
|
587
|
+
// ==========================================================================
|
|
588
|
+
updateCurrentHistoryEntry: {
|
|
589
|
+
requestFields: [field("scrollPosition", "int", {}), field("hitRangeBegin", "int", {}), field("hitRangeEnd", "int", {})],
|
|
590
|
+
responseFields: [field("success", "boolean")],
|
|
591
|
+
category: "History Extended",
|
|
592
|
+
description: "Update current history entry scroll position"
|
|
593
|
+
},
|
|
594
|
+
recordHistoryEntryExtended: {
|
|
595
|
+
requestFields: [
|
|
596
|
+
field("topicID", "double", {}),
|
|
597
|
+
field("navigationID", "double", {}),
|
|
598
|
+
field("pageType", "string", {}),
|
|
599
|
+
field("searchHistoryEntry", "object", { optional: true, objectType: "SearchHistoryEntry" })
|
|
600
|
+
],
|
|
601
|
+
responseFields: [field("success", "boolean")],
|
|
602
|
+
category: "History Extended",
|
|
603
|
+
description: "Record extended history entry"
|
|
604
|
+
},
|
|
605
|
+
historyForwardExtended: {
|
|
606
|
+
method: "HistoryForwardExtended",
|
|
607
|
+
requestType: "HistoryForwardRequest",
|
|
608
|
+
requestFields: [field("steps", "int", {})],
|
|
609
|
+
responseFields: [field("entry", "object", { objectType: "HistoryEntryExtended" })],
|
|
610
|
+
category: "History Extended",
|
|
611
|
+
description: "Go forward in history (extended)"
|
|
612
|
+
},
|
|
613
|
+
historyBackExtended: {
|
|
614
|
+
method: "HistoryBackExtended",
|
|
615
|
+
requestType: "HistoryBackRequest",
|
|
616
|
+
requestFields: [field("steps", "int", {})],
|
|
617
|
+
responseFields: [field("entry", "object", { objectType: "HistoryEntryExtended" })],
|
|
618
|
+
category: "History Extended",
|
|
619
|
+
description: "Go back in history (extended)"
|
|
620
|
+
},
|
|
621
|
+
getHistoryListExtended: {
|
|
622
|
+
method: "GetHistoryListExtended",
|
|
623
|
+
requestType: "GetHistoryListRequest",
|
|
624
|
+
requestFields: [field("not_used_at_the_moment", "boolean", {})],
|
|
625
|
+
responseFields: [field("entries", "array", { itemObjectType: "HistoryEntryExtended" }), field("currentPosition", "int")],
|
|
626
|
+
category: "History Extended",
|
|
627
|
+
description: "Get extended history list"
|
|
628
|
+
},
|
|
629
|
+
updateCurrentHistoryEntryExtended: {
|
|
630
|
+
requestFields: [
|
|
631
|
+
field("scrollPosition", "int", {}),
|
|
632
|
+
field("hitRangeBegin", "int", {}),
|
|
633
|
+
field("hitRangeEnd", "int", {}),
|
|
634
|
+
field("hitRangeBeginVideo", "int", {}),
|
|
635
|
+
field("hitRangeEndVideo", "int", {})
|
|
636
|
+
],
|
|
637
|
+
responseFields: [field("success", "boolean")],
|
|
638
|
+
category: "History Extended",
|
|
639
|
+
description: "Update extended history entry"
|
|
640
|
+
},
|
|
641
|
+
// ==========================================================================
|
|
642
|
+
// Metadata Extended
|
|
643
|
+
// ==========================================================================
|
|
644
|
+
getAllowedMetaKeysForMasterhelpset: {
|
|
645
|
+
requestFields: [field("masterHelpSetApplicationIdentifier", "string", {})],
|
|
646
|
+
responseFields: [field("metaKeys", "array", { itemObjectType: "MetaKeyDefinition" })],
|
|
647
|
+
category: "Metadata Extended",
|
|
648
|
+
description: "Get allowed metadata keys for master helpset"
|
|
649
|
+
},
|
|
650
|
+
getPossibleMetaValuesByMetaKeyID: {
|
|
651
|
+
method: "GetPossibleMetaValuesByMetaKeyId",
|
|
652
|
+
requestType: "GetPossibleMetaValuesByMetaKeyIdRequest",
|
|
653
|
+
requestFields: [field("metaKeyId", "double", {})],
|
|
654
|
+
responseFields: [field("metaKeyId", "double"), field("values", "stringArray")],
|
|
655
|
+
category: "Metadata Extended",
|
|
656
|
+
description: "Get possible values by meta key ID"
|
|
657
|
+
},
|
|
658
|
+
getPossibleMetaValues: {
|
|
659
|
+
requestFields: [field("metaKey", "string", {})],
|
|
660
|
+
responseFields: [field("metaKeyId", "double"), field("values", "stringArray")],
|
|
661
|
+
category: "Metadata Extended",
|
|
662
|
+
description: "Get possible metadata values"
|
|
663
|
+
},
|
|
664
|
+
getUsedMetaValuesFilteredByOtherMetaValues: {
|
|
665
|
+
requestFields: [
|
|
666
|
+
field("metaKey", "string", {}),
|
|
667
|
+
field("filteredBy", "stringMap", {}),
|
|
668
|
+
field("localizeMetaValues", "boolean", {}),
|
|
669
|
+
field("sortMetaValues", "boolean", {})
|
|
670
|
+
],
|
|
671
|
+
responseFields: [field("entries", "array", { itemObjectType: "LocalizedEntry" })],
|
|
672
|
+
category: "Metadata Extended",
|
|
673
|
+
description: "Get filtered metadata values"
|
|
674
|
+
},
|
|
675
|
+
getHelpsetInfosForMetadata: {
|
|
676
|
+
requestFields: [field("metaValues", "stringMap", {})],
|
|
677
|
+
responseFields: [field("helpsetInfos", "array", { itemObjectType: "HelpsetInfo" })],
|
|
678
|
+
category: "Metadata Extended",
|
|
679
|
+
description: "Get helpset infos for metadata"
|
|
680
|
+
},
|
|
681
|
+
getMetaValueForTopic: {
|
|
682
|
+
requestFields: [field("metaKey", "string", {}), field("topicID", "double", {})],
|
|
683
|
+
responseFields: [field("metaValue", "string")],
|
|
684
|
+
category: "Metadata Extended",
|
|
685
|
+
description: "Get metadata value for topic"
|
|
686
|
+
},
|
|
687
|
+
getAvailableLanguagesForMetaData: {
|
|
688
|
+
requestFields: [field("metaKey", "string", {}), field("metaValue", "string", {})],
|
|
689
|
+
responseFields: [field("languages", "stringArray")],
|
|
690
|
+
category: "Metadata Extended",
|
|
691
|
+
description: "Get available languages for metadata"
|
|
692
|
+
},
|
|
693
|
+
getStartUpMetaValues: {
|
|
694
|
+
requestFields: [field("metaKey", "string", {})],
|
|
695
|
+
responseFields: [field("metaData", "object")],
|
|
696
|
+
category: "Metadata Extended",
|
|
697
|
+
description: "Get startup meta values"
|
|
698
|
+
},
|
|
699
|
+
setStartUpMetaValues: {
|
|
700
|
+
requestFields: [field("metaValues", "array", { itemObjectType: "StartUpMetaValuePair", varname: "metaValues" })],
|
|
701
|
+
responseFields: [field("not_used", "boolean")],
|
|
702
|
+
category: "Metadata Extended",
|
|
703
|
+
description: "Set startup meta values"
|
|
704
|
+
},
|
|
705
|
+
getNavigationWithMetaData: {
|
|
706
|
+
requestFields: [
|
|
707
|
+
field("currentNavigationID", "double", {}),
|
|
708
|
+
field("wantedMetaKeys", "stringArray", {}),
|
|
709
|
+
field("useHelpsetMetadataFallback", "boolean", {})
|
|
710
|
+
],
|
|
711
|
+
responseFields: [field("navigationEntries", "array", { itemObjectType: "NavigationEntryWithMetaData" })],
|
|
712
|
+
category: "Metadata Extended",
|
|
713
|
+
description: "Get navigation with metadata"
|
|
714
|
+
},
|
|
715
|
+
getBreadCrumbWithMetaData: {
|
|
716
|
+
method: "GetBreadcrumbWithMetaData",
|
|
717
|
+
requestType: "GetBreadcrumbWithMetaDataRequest",
|
|
718
|
+
requestFields: [
|
|
719
|
+
field("navigationID", "double", {}),
|
|
720
|
+
field("wantedMetaKeys", "stringArray", {}),
|
|
721
|
+
field("useHelpsetMetadataFallback", "boolean", {})
|
|
722
|
+
],
|
|
723
|
+
responseFields: [field("breadcrumbs", "array", { itemObjectType: "BreadCrumbWithMetaDataEntry" }), field("breadCrumbStartBehavior", "string")],
|
|
724
|
+
category: "Metadata Extended",
|
|
725
|
+
description: "Get breadcrumb with metadata"
|
|
726
|
+
},
|
|
727
|
+
getChildTopicsBasedOnMetadataOfGivenTopic: {
|
|
728
|
+
requestFields: [field("topicID", "double", {})],
|
|
729
|
+
responseFields: [field("childTopicEntries", "array", { itemObjectType: "ChildTopicBasedOnMetadata" })],
|
|
730
|
+
category: "Metadata Extended",
|
|
731
|
+
description: "Get child topics based on metadata"
|
|
732
|
+
},
|
|
733
|
+
getHelpsetInfoForExternalIDAndMetaData: {
|
|
734
|
+
requestFields: [field("externalHelpsetID", "string", {}), field("metaData", "stringMap", {})],
|
|
735
|
+
responseFields: [field("helpsetInfo", "object", { objectType: "HelpsetInfo" })],
|
|
736
|
+
category: "Metadata Extended",
|
|
737
|
+
description: "Get helpset info by external ID and metadata"
|
|
738
|
+
},
|
|
739
|
+
getAllMetaValuesForTopic: {
|
|
740
|
+
requestFields: [field("metaKey", "string", {}), field("topicID", "double", { optional: true })],
|
|
741
|
+
responseFields: [field("metaValues", "stringArray")],
|
|
742
|
+
category: "Metadata Extended",
|
|
743
|
+
description: "Get all metadata values for topic"
|
|
744
|
+
},
|
|
745
|
+
getUsedMetaValuesForGivenLanguage: {
|
|
746
|
+
method: "GetUsedMetaValues_ForGivenLanguage",
|
|
747
|
+
requestType: "GetUsedMetaValues_ForGivenLanguageRequest",
|
|
748
|
+
requestFields: [
|
|
749
|
+
field("metaKey", "string", {}),
|
|
750
|
+
field("externalHelpsetID", "string", { optional: true }),
|
|
751
|
+
field("localizeMetaValues", "boolean", {}),
|
|
752
|
+
field("sortMetaValues", "boolean", {}),
|
|
753
|
+
field("givenLanguage", "string", {})
|
|
754
|
+
],
|
|
755
|
+
responseFields: [field("values", "stringArray"), field("sortedAndLocalizedEntries", "array", { itemObjectType: "LocalizedEntry" })],
|
|
756
|
+
category: "Metadata Extended",
|
|
757
|
+
description: "Get metadata values for language"
|
|
758
|
+
},
|
|
759
|
+
getUsedMetaValuesFilteredByOtherMetaValuesForGivenLanguage: {
|
|
760
|
+
method: "GetUsedMetaValuesFilteredByOtherMetaValues_ForGivenLanguage",
|
|
761
|
+
requestType: "GetUsedMetaValuesFilteredByOtherMetaValues_ForGivenLanguageRequest",
|
|
762
|
+
requestFields: [
|
|
763
|
+
field("metaKey", "string", {}),
|
|
764
|
+
field("filteredBy", "stringMap", {}),
|
|
765
|
+
field("localizeMetaValues", "boolean", {}),
|
|
766
|
+
field("sortMetaValues", "boolean", {}),
|
|
767
|
+
field("givenLanguage", "string", {})
|
|
768
|
+
],
|
|
769
|
+
responseFields: [field("values", "stringArray"), field("sortedAndLocalizedEntries", "array", { itemObjectType: "LocalizedEntry" })],
|
|
770
|
+
category: "Metadata Extended",
|
|
771
|
+
description: "Get filtered metadata values for language"
|
|
772
|
+
},
|
|
773
|
+
getNavigationWithMetaDataForGivenLanguage: {
|
|
774
|
+
method: "GetNavigationWithMetaData_ForGivenLanguage",
|
|
775
|
+
requestType: "GetNavigationWithMetaData_ForGivenLanguageRequest",
|
|
776
|
+
requestFields: [
|
|
777
|
+
field("currentNavigationID", "double", {}),
|
|
778
|
+
field("wantedMetaKeys", "stringArray", {}),
|
|
779
|
+
field("useHelpsetMetadataFallback", "boolean", {}),
|
|
780
|
+
field("givenLanguage", "string", {})
|
|
781
|
+
],
|
|
782
|
+
responseFields: [field("navigationEntries", "array", { itemObjectType: "NavigationEntryWithMetaData" })],
|
|
783
|
+
category: "Metadata Extended",
|
|
784
|
+
description: "Get navigation with metadata for language"
|
|
785
|
+
},
|
|
786
|
+
getBreadCrumbWithMetaDataForGivenLanguage: {
|
|
787
|
+
method: "GetBreadcrumbWithMetaData_ForGivenLanguage",
|
|
788
|
+
requestType: "GetBreadcrumbWithMetaData_ForGivenLanguageRequest",
|
|
789
|
+
requestFields: [
|
|
790
|
+
field("navigationID", "double", {}),
|
|
791
|
+
field("wantedMetaKeys", "stringArray", {}),
|
|
792
|
+
field("useHelpsetMetadataFallback", "boolean", {}),
|
|
793
|
+
field("givenLanguage", "string", {})
|
|
794
|
+
],
|
|
795
|
+
responseFields: [field("breadcrumbs", "array", { itemObjectType: "BreadCrumbWithMetaDataEntry" }), field("breadCrumbStartBehavior", "string")],
|
|
796
|
+
category: "Metadata Extended",
|
|
797
|
+
description: "Get breadcrumb with metadata for language"
|
|
798
|
+
},
|
|
799
|
+
getMetaValuesForFacets: {
|
|
800
|
+
requestFields: [field("facetName", "string", {})],
|
|
801
|
+
responseFields: [field("values", "stringArray")],
|
|
802
|
+
category: "Metadata Extended",
|
|
803
|
+
description: "Get metadata values for facets"
|
|
804
|
+
},
|
|
805
|
+
getMetaValuesForFacetsForGivenLanguage: {
|
|
806
|
+
method: "GetMetaValuesForFacets_ForGivenLanguage",
|
|
807
|
+
requestType: "GetMetaValuesForFacets_ForGivenLanguageRequest",
|
|
808
|
+
requestFields: [field("facetName", "string", {}), field("givenLanguage", "string", {})],
|
|
809
|
+
responseFields: [field("values", "stringArray")],
|
|
810
|
+
category: "Metadata Extended",
|
|
811
|
+
description: "Get metadata values for facets for language"
|
|
812
|
+
},
|
|
813
|
+
getMetaKeysWhichBehaveAsVisibilityRights: {
|
|
814
|
+
method: "GetMetaKeysWhichBehaveAsVisiblityRights",
|
|
815
|
+
requestType: "GetMetaKeysWhichBehaveAsVisiblityRightsRequest",
|
|
816
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
817
|
+
responseFields: [field("metaKeys", "array", { itemObjectType: "MetaKeyWithID", varname: "metaKeys" })],
|
|
818
|
+
category: "Metadata Extended",
|
|
819
|
+
description: "Get metadata keys for visibility rights"
|
|
820
|
+
},
|
|
821
|
+
getMetaDataDefinitionsForCustomerCriteria: {
|
|
822
|
+
requestFields: [
|
|
823
|
+
field("customerType", "string", { keytype: "CustomerDefinitionEnum" }),
|
|
824
|
+
field("criteria", "stringArray", { varname: "criteria", keytype: "vector" })
|
|
825
|
+
],
|
|
826
|
+
responseFields: [field("definitions", "array", { itemObjectType: "MetaDataDefinition" })],
|
|
827
|
+
category: "Metadata Extended",
|
|
828
|
+
description: "Get metadata definitions for customer criteria"
|
|
829
|
+
},
|
|
830
|
+
setCurrentMetaDataSetForSession: {
|
|
831
|
+
requestFields: [field("metaData", "array", { itemObjectType: "MetaValuePair", keytype: "vector" })],
|
|
832
|
+
responseFields: [field("success", "boolean")],
|
|
833
|
+
category: "Metadata Extended",
|
|
834
|
+
description: "Set current metadata set for session"
|
|
835
|
+
},
|
|
836
|
+
getCurrentMetaDataSetForSession: {
|
|
837
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
838
|
+
responseFields: [field("metaData", "object")],
|
|
839
|
+
category: "Metadata Extended",
|
|
840
|
+
description: "Get current metadata set for session"
|
|
841
|
+
},
|
|
842
|
+
addToCurrentMetaDataSetForSession: {
|
|
843
|
+
requestFields: [field("metaKey", "string", {}), field("metaValue", "string", {})],
|
|
844
|
+
responseFields: [field("success", "boolean")],
|
|
845
|
+
category: "Metadata Extended",
|
|
846
|
+
description: "Add to current metadata set for session"
|
|
847
|
+
},
|
|
848
|
+
removeFromCurrentMetaDataSetForSession: {
|
|
849
|
+
requestFields: [field("metaKey", "string", {}), field("metaValue", "string", {})],
|
|
850
|
+
responseFields: [field("success", "boolean")],
|
|
851
|
+
category: "Metadata Extended",
|
|
852
|
+
description: "Remove from current metadata set for session"
|
|
853
|
+
},
|
|
854
|
+
getMetaKeysWhichAreConfiguredForContentFiltering: {
|
|
855
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
856
|
+
responseFields: [field("metaKeys", "array", { itemObjectType: "MetaKeyWithID", varname: "metaKeys" })],
|
|
857
|
+
category: "Metadata Extended",
|
|
858
|
+
description: "Get metadata keys for content filtering"
|
|
859
|
+
},
|
|
860
|
+
getMetaValuesForTopics: {
|
|
861
|
+
requestFields: [
|
|
862
|
+
field("wantedMetaKeys", "stringArray", {}),
|
|
863
|
+
field("withMetadataFromHelpset", "boolean", {}),
|
|
864
|
+
field("externalTopicIDs", "stringArray", { keytype: "vector" })
|
|
865
|
+
],
|
|
866
|
+
responseFields: [field("result", "array", { itemObjectType: "MetaValuesForTopicEntry", varname: "result" })],
|
|
867
|
+
category: "Metadata Extended",
|
|
868
|
+
description: "Get metadata values for multiple topics"
|
|
869
|
+
},
|
|
870
|
+
// ==========================================================================
|
|
871
|
+
// User Management
|
|
872
|
+
// ==========================================================================
|
|
873
|
+
getLoggedInUserInfo: {
|
|
874
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
875
|
+
responseFields: [
|
|
876
|
+
field("userID", "double"),
|
|
877
|
+
field("userName", "string"),
|
|
878
|
+
field("userFullName", "string"),
|
|
879
|
+
field("userType", "string"),
|
|
880
|
+
field("emailAdress", "string"),
|
|
881
|
+
field("groups", "array", { itemObjectType: "GroupDataWithoutUsers", varname: "groups" })
|
|
882
|
+
],
|
|
883
|
+
category: "User Management",
|
|
884
|
+
description: "Get info about logged in user"
|
|
885
|
+
},
|
|
886
|
+
createUser: {
|
|
887
|
+
requestFields: [
|
|
888
|
+
field("userName", "string", {}),
|
|
889
|
+
field("password", "string", {}),
|
|
890
|
+
field("userFullName", "string", { optional: true }),
|
|
891
|
+
field("emailAdress", "string", { optional: true }),
|
|
892
|
+
field("state", "int", {}),
|
|
893
|
+
field("creationTimestamp", "double", {}),
|
|
894
|
+
field("validFromTimestamp", "double", { optional: true }),
|
|
895
|
+
field("validToTimestamp", "double", { optional: true })
|
|
896
|
+
],
|
|
897
|
+
responseFields: [field("user", "object", { objectType: "UserData", xmlTag: "UserData", varname: "user" })],
|
|
898
|
+
category: "User Management",
|
|
899
|
+
description: "Create a new user"
|
|
900
|
+
},
|
|
901
|
+
changePassword: {
|
|
902
|
+
requestFields: [
|
|
903
|
+
field("oldPassword", "string", { xmlType: "SiriusBase64String", varname: "old_password", isBase64: true }),
|
|
904
|
+
field("newPassword", "string", { xmlType: "SiriusBase64String", varname: "new_password", isBase64: true })
|
|
905
|
+
],
|
|
906
|
+
responseFields: [field("passwordChanged", "boolean")],
|
|
907
|
+
category: "User Management",
|
|
908
|
+
description: "Change password"
|
|
909
|
+
},
|
|
910
|
+
deleteUser: {
|
|
911
|
+
requestFields: [field("userID", "double", {})],
|
|
912
|
+
responseFields: [field("success", "boolean")],
|
|
913
|
+
category: "User Management",
|
|
914
|
+
description: "Delete a user"
|
|
915
|
+
},
|
|
916
|
+
modifyUser: {
|
|
917
|
+
requestFields: [field("user", "object", { objectType: "UserInfo" })],
|
|
918
|
+
responseFields: [field("success", "boolean")],
|
|
919
|
+
category: "User Management",
|
|
920
|
+
description: "Modify a user"
|
|
921
|
+
},
|
|
922
|
+
getAllUsers: {
|
|
923
|
+
requestFields: [field("withAnonymousUsers", "boolean", {})],
|
|
924
|
+
responseFields: [field("users", "array", { itemObjectType: "UserInfo" })],
|
|
925
|
+
category: "User Management",
|
|
926
|
+
description: "Get all users"
|
|
927
|
+
},
|
|
928
|
+
createSelfRegisteredUser: {
|
|
929
|
+
requestFields: [
|
|
930
|
+
field("loginName", "string", {}),
|
|
931
|
+
field("email", "string", {}),
|
|
932
|
+
field("passwordBase64Encoded", "string", { xmlTag: "password_base64_encoded" }),
|
|
933
|
+
field("serverDomainURL", "string", {}),
|
|
934
|
+
field("realName", "string", {}),
|
|
935
|
+
field("additionalDataForRegistrationProcess", "string", { optional: true })
|
|
936
|
+
],
|
|
937
|
+
responseFields: [field("not_used", "boolean")],
|
|
938
|
+
category: "User Management",
|
|
939
|
+
description: "Create self-registered user"
|
|
940
|
+
},
|
|
941
|
+
activateSelfRegisteredUser: {
|
|
942
|
+
requestFields: [field("userName", "string", {}), field("activationToken", "string", {})],
|
|
943
|
+
responseFields: [field("success", "boolean")],
|
|
944
|
+
category: "User Management",
|
|
945
|
+
description: "Activate a self-registered user"
|
|
946
|
+
},
|
|
947
|
+
startForgotPasswordProcess: {
|
|
948
|
+
requestFields: [
|
|
949
|
+
field("email", "string", {}),
|
|
950
|
+
field("serverDomainURL", "string", {}),
|
|
951
|
+
field("additionalDataForForgotPasswordProcess", "string", { optional: true })
|
|
952
|
+
],
|
|
953
|
+
responseFields: [field("success", "boolean")],
|
|
954
|
+
category: "User Management",
|
|
955
|
+
description: "Start forgot password process"
|
|
956
|
+
},
|
|
957
|
+
finishForgotPasswordProcess: {
|
|
958
|
+
requestFields: [
|
|
959
|
+
field("token", "string", {}),
|
|
960
|
+
field("passwordBase64Encoded", "string", { xmlTag: "password_base64_encoded" }),
|
|
961
|
+
field("additionalDataForForgotPasswordProcess", "string", { optional: true })
|
|
962
|
+
],
|
|
963
|
+
responseFields: [field("username", "string")],
|
|
964
|
+
category: "User Management",
|
|
965
|
+
description: "Finish forgot password process"
|
|
966
|
+
},
|
|
967
|
+
getAllCustomUserSettingsForUserID: {
|
|
968
|
+
requestFields: [field("userID", "double", {})],
|
|
969
|
+
responseFields: [field("settings", "array", { itemObjectType: "CustomSetting" })],
|
|
970
|
+
category: "User Management",
|
|
971
|
+
description: "Get all custom settings for user"
|
|
972
|
+
},
|
|
973
|
+
performActionAfterOpenIDAuthentification: {
|
|
974
|
+
requestFields: [field("data", "string", {})],
|
|
975
|
+
responseFields: [field("success", "boolean"), field("userID", "double")],
|
|
976
|
+
category: "User Management",
|
|
977
|
+
description: "Perform action after OpenID auth"
|
|
978
|
+
},
|
|
979
|
+
// ==========================================================================
|
|
980
|
+
// Group/Rights Management
|
|
981
|
+
// ==========================================================================
|
|
982
|
+
getAllGroups: {
|
|
983
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
984
|
+
responseFields: [field("groups", "array", { itemObjectType: "GroupData" })],
|
|
985
|
+
category: "Group/Rights Management",
|
|
986
|
+
description: "Get all groups"
|
|
987
|
+
},
|
|
988
|
+
createGroup: {
|
|
989
|
+
requestFields: [field("groupData", "object", { objectType: "GroupData", xmlTag: "GroupData", varname: "groupData" })],
|
|
990
|
+
responseFields: [field("groupID", "double")],
|
|
991
|
+
category: "Group/Rights Management",
|
|
992
|
+
description: "Create a group"
|
|
993
|
+
},
|
|
994
|
+
modifyGroup: {
|
|
995
|
+
requestFields: [field("groupData", "object", { objectType: "GroupData" })],
|
|
996
|
+
responseFields: [field("success", "boolean")],
|
|
997
|
+
category: "Group/Rights Management",
|
|
998
|
+
description: "Modify a group"
|
|
999
|
+
},
|
|
1000
|
+
deleteGroup: {
|
|
1001
|
+
requestFields: [field("groupID", "double", {})],
|
|
1002
|
+
responseFields: [field("success", "boolean")],
|
|
1003
|
+
category: "Group/Rights Management",
|
|
1004
|
+
description: "Delete a group"
|
|
1005
|
+
},
|
|
1006
|
+
updateGroupRights: {
|
|
1007
|
+
requestFields: [
|
|
1008
|
+
field("groupID", "double", {}),
|
|
1009
|
+
field("rightsType", "string", {}),
|
|
1010
|
+
field("updateData", "array", { itemObjectType: "MetaValueForGroupRightEntry", keytype: "vector" })
|
|
1011
|
+
],
|
|
1012
|
+
responseFields: [field("success", "boolean")],
|
|
1013
|
+
category: "Group/Rights Management",
|
|
1014
|
+
description: "Update group rights"
|
|
1015
|
+
},
|
|
1016
|
+
getGroupRights: {
|
|
1017
|
+
requestFields: [field("groupID", "double", {}), field("rightsType", "string", {})],
|
|
1018
|
+
responseFields: [field("rights", "object")],
|
|
1019
|
+
category: "Group/Rights Management",
|
|
1020
|
+
description: "Get group rights"
|
|
1021
|
+
},
|
|
1022
|
+
precompileFacetsBasedOnGroupRights: {
|
|
1023
|
+
requestFields: [field("callOptimizeImportData", "boolean", {})],
|
|
1024
|
+
responseFields: [field("success", "boolean")],
|
|
1025
|
+
category: "Group/Rights Management",
|
|
1026
|
+
description: "Precompile facets based on group rights"
|
|
1027
|
+
},
|
|
1028
|
+
// ==========================================================================
|
|
1029
|
+
// Settings & Configuration
|
|
1030
|
+
// ==========================================================================
|
|
1031
|
+
getCustomUserSetting: {
|
|
1032
|
+
requestFields: [field("keyForValue", "string", {})],
|
|
1033
|
+
responseFields: [field("keyForValue", "string"), field("value", "string")],
|
|
1034
|
+
category: "Settings & Configuration",
|
|
1035
|
+
description: "Get custom user setting"
|
|
1036
|
+
},
|
|
1037
|
+
setCustomUserSetting: {
|
|
1038
|
+
requestFields: [field("keyForValue", "string", {}), field("value", "string", {})],
|
|
1039
|
+
responseFields: [field("operationSucceeded", "boolean")],
|
|
1040
|
+
category: "Settings & Configuration",
|
|
1041
|
+
description: "Set custom user setting"
|
|
1042
|
+
},
|
|
1043
|
+
getCustomGlobalSetting: {
|
|
1044
|
+
requestFields: [field("keyForValue", "string", {})],
|
|
1045
|
+
responseFields: [field("keyForValue", "string"), field("value", "string")],
|
|
1046
|
+
category: "Settings & Configuration",
|
|
1047
|
+
description: "Get custom global setting"
|
|
1048
|
+
},
|
|
1049
|
+
setCustomGlobalSetting: {
|
|
1050
|
+
requestFields: [field("keyForValue", "string", {}), field("value", "string", {})],
|
|
1051
|
+
responseFields: [field("operationSucceeded", "boolean")],
|
|
1052
|
+
category: "Settings & Configuration",
|
|
1053
|
+
description: "Set custom global setting"
|
|
1054
|
+
},
|
|
1055
|
+
// ==========================================================================
|
|
1056
|
+
// GUI/Language Extended
|
|
1057
|
+
// ==========================================================================
|
|
1058
|
+
isValidGUILanguage: {
|
|
1059
|
+
requestFields: [field("lanCode", "string", {})],
|
|
1060
|
+
responseFields: [field("isValid", "boolean")],
|
|
1061
|
+
category: "GUI/Language Extended",
|
|
1062
|
+
description: "Check if GUI language is valid"
|
|
1063
|
+
},
|
|
1064
|
+
getGUILanguageFromDatabase: {
|
|
1065
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
1066
|
+
responseFields: [field("guiLanguage", "string")],
|
|
1067
|
+
category: "GUI/Language Extended",
|
|
1068
|
+
description: "Get GUI language from database"
|
|
1069
|
+
},
|
|
1070
|
+
getResourceStringMap: {
|
|
1071
|
+
method: "GetResourceStringMap",
|
|
1072
|
+
requestType: "GetResourceStringsRequest",
|
|
1073
|
+
requestFields: [field("wantedResourceIds", "stringArray", {}), field("wantedLanguage", "string", {})],
|
|
1074
|
+
responseFields: [field("resourceStringsInWantedLanguage", "stringArray")],
|
|
1075
|
+
category: "GUI/Language Extended",
|
|
1076
|
+
description: "Get resource strings as map"
|
|
1077
|
+
},
|
|
1078
|
+
// ==========================================================================
|
|
1079
|
+
// Topic/Navigation Extended
|
|
1080
|
+
// ==========================================================================
|
|
1081
|
+
getAdditionalInfoAboutHelpset: {
|
|
1082
|
+
requestFields: [field("helpsetID", "double", {})],
|
|
1083
|
+
responseFields: [field("info", "object")],
|
|
1084
|
+
category: "Topic/Navigation Extended",
|
|
1085
|
+
description: "Get additional helpset info"
|
|
1086
|
+
},
|
|
1087
|
+
isValidHelpsetID: {
|
|
1088
|
+
requestFields: [field("helpsetID", "double", {})],
|
|
1089
|
+
responseFields: [field("isValid", "boolean")],
|
|
1090
|
+
category: "Topic/Navigation Extended",
|
|
1091
|
+
description: "Check if helpset ID is valid"
|
|
1092
|
+
},
|
|
1093
|
+
isValidTopicID: {
|
|
1094
|
+
requestFields: [field("topicID", "string", {})],
|
|
1095
|
+
responseFields: [field("isValid", "boolean")],
|
|
1096
|
+
category: "Topic/Navigation Extended",
|
|
1097
|
+
description: "Check if topic ID is valid"
|
|
1098
|
+
},
|
|
1099
|
+
getProtocolHandlerPrefix: {
|
|
1100
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
1101
|
+
responseFields: [field("prefix", "string")],
|
|
1102
|
+
description: "Get protocol handler prefix"
|
|
1103
|
+
},
|
|
1104
|
+
getHomeTopicExternalId: {
|
|
1105
|
+
requestFields: [field("helpsetExternalID", "string", {})],
|
|
1106
|
+
responseFields: [field("externalId", "string")],
|
|
1107
|
+
description: "Get home topic external ID"
|
|
1108
|
+
},
|
|
1109
|
+
getHelpsetInfosForExternalID: {
|
|
1110
|
+
requestFields: [field("externalHelpsetID", "string", {})],
|
|
1111
|
+
responseFields: [field("helpsets", "array", { itemObjectType: "HelpsetInfo" })],
|
|
1112
|
+
description: "Get helpset infos by external ID"
|
|
1113
|
+
},
|
|
1114
|
+
getCurrentActiveTopicID: {
|
|
1115
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
1116
|
+
responseFields: [field("topicID", "double"), field("navigationID", "double")],
|
|
1117
|
+
description: "Get current active topic ID"
|
|
1118
|
+
},
|
|
1119
|
+
getExternalIdForTopicIgnoreContainerHelpsets: {
|
|
1120
|
+
method: "GetExternalIdForTopic_IgnoreContainerHelpsets",
|
|
1121
|
+
requestType: "GetExternalIdForTopic_IgnoreContainerHelpsetsRequest",
|
|
1122
|
+
requestFields: [field("topicID", "double", {})],
|
|
1123
|
+
responseFields: [field("externalId", "string"), field("externalHelpsetId", "string")],
|
|
1124
|
+
description: "Get external ID ignoring container helpsets"
|
|
1125
|
+
},
|
|
1126
|
+
getChildTopics: {
|
|
1127
|
+
requestFields: [field("navigationID", "double", {}), field("metaData_for_contained_helpset_resolving", "stringMap", {})],
|
|
1128
|
+
responseFields: [field("entries", "array", { itemObjectType: "ChildTopicInfo" })],
|
|
1129
|
+
description: "Get child topics"
|
|
1130
|
+
},
|
|
1131
|
+
getTopicForExternalIdForGivenLanguage: {
|
|
1132
|
+
method: "GetTopicForExternalId_ForGivenLanguage",
|
|
1133
|
+
requestType: "GetTopicForExternalId_ForGivenLanguageRequest",
|
|
1134
|
+
requestFields: [
|
|
1135
|
+
field("externalIdForTopic", "string", {}),
|
|
1136
|
+
field("externalIdForHelpset", "string", {}),
|
|
1137
|
+
field("metaData", "stringMap", {}),
|
|
1138
|
+
field("givenLanguage", "string", {})
|
|
1139
|
+
],
|
|
1140
|
+
responseFields: [field("topicID", "double"), field("navigationID", "double"), field("helpsetID", "double")],
|
|
1141
|
+
description: "Get topic for external ID for language"
|
|
1142
|
+
},
|
|
1143
|
+
getRelatedTopicsWithLinks: {
|
|
1144
|
+
requestFields: [
|
|
1145
|
+
field("currentTopicID", "double", {}),
|
|
1146
|
+
field("withMetaData", "boolean", {}),
|
|
1147
|
+
field("wantedMetaKeys", "stringArray", {}),
|
|
1148
|
+
field("localizeMetaValues", "boolean", {})
|
|
1149
|
+
],
|
|
1150
|
+
responseFields: [field("relatedTopics", "array", { itemObjectType: "RelatedTopicWithLinkInfo" })],
|
|
1151
|
+
description: "Get related topics with links"
|
|
1152
|
+
},
|
|
1153
|
+
getTopicInfo: {
|
|
1154
|
+
requestFields: [field("topicID", "double", {})],
|
|
1155
|
+
responseFields: [field("topicInfo", "object", { objectType: "TopicInfo" })],
|
|
1156
|
+
description: "Get topic info"
|
|
1157
|
+
},
|
|
1158
|
+
isTopicVisible: {
|
|
1159
|
+
requestFields: [field("topicID", "double", {})],
|
|
1160
|
+
responseFields: [field("isVisible", "boolean")],
|
|
1161
|
+
description: "Check if topic is visible"
|
|
1162
|
+
},
|
|
1163
|
+
getAllPossibleTopicsForExternalTopicID: {
|
|
1164
|
+
requestFields: [field("externalTopicID", "string", {}), field("metaData", "stringMap", {})],
|
|
1165
|
+
responseFields: [field("topics", "array", { itemObjectType: "TopicInfo" })],
|
|
1166
|
+
description: "Get all possible topics for external ID"
|
|
1167
|
+
},
|
|
1168
|
+
getRDFRelatedTopics: {
|
|
1169
|
+
requestFields: [
|
|
1170
|
+
field("topicID", "double", {}),
|
|
1171
|
+
field("metaKey", "string", {}),
|
|
1172
|
+
field("sparqlQueryName", "string", {})
|
|
1173
|
+
],
|
|
1174
|
+
responseFields: [field("topics", "array", { itemObjectType: "TopicInfo" })],
|
|
1175
|
+
description: "Get RDF related topics"
|
|
1176
|
+
},
|
|
1177
|
+
getTopicInfoForUniqueTopicID: {
|
|
1178
|
+
requestFields: [field("uniqueTopicID", "string", {})],
|
|
1179
|
+
responseFields: [field("topicInfo", "object", { objectType: "TopicInfo" })],
|
|
1180
|
+
description: "Get topic info for unique topic ID"
|
|
1181
|
+
},
|
|
1182
|
+
getRawNavigationEntriesForHelpset: {
|
|
1183
|
+
requestFields: [field("helpsetID", "double", {})],
|
|
1184
|
+
responseFields: [field("entries", "array", { itemObjectType: "RawNavigationEntry" })],
|
|
1185
|
+
description: "Get raw navigation entries for helpset"
|
|
1186
|
+
},
|
|
1187
|
+
getDatabaseIDsForCobriliLink: {
|
|
1188
|
+
requestFields: [field("cobriliLink", "string", {})],
|
|
1189
|
+
responseFields: [field("topicID", "double"), field("navigationID", "double"), field("helpsetID", "double")],
|
|
1190
|
+
description: "Get database IDs for Cobrili link"
|
|
1191
|
+
},
|
|
1192
|
+
getSynonymList: {
|
|
1193
|
+
requestFields: [field("language", "string", {})],
|
|
1194
|
+
responseFields: [field("synonyms", "array", { itemObjectType: "SynonymEntry" })],
|
|
1195
|
+
description: "Get synonym list"
|
|
1196
|
+
},
|
|
1197
|
+
// ==========================================================================
|
|
1198
|
+
// Bookmark Extended
|
|
1199
|
+
// ==========================================================================
|
|
1200
|
+
deleteBookmarkByTopicID: {
|
|
1201
|
+
requestFields: [field("topicID", "double", {})],
|
|
1202
|
+
responseFields: [field("success", "boolean")],
|
|
1203
|
+
description: "Delete bookmark by topic ID"
|
|
1204
|
+
},
|
|
1205
|
+
addBookmarkForUser: {
|
|
1206
|
+
requestFields: [field("userId", "double", {}), field("bookmark", "object", { objectType: "BookmarkData" })],
|
|
1207
|
+
responseFields: [field("bookmarkID", "double"), field("success", "boolean")],
|
|
1208
|
+
description: "Add bookmark for a user"
|
|
1209
|
+
},
|
|
1210
|
+
// ==========================================================================
|
|
1211
|
+
// System/Admin
|
|
1212
|
+
// ==========================================================================
|
|
1213
|
+
getLastCobriliErrorCode: {
|
|
1214
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
1215
|
+
responseFields: [field("errorCode", "string")],
|
|
1216
|
+
description: "Get last Cobrili error code"
|
|
1217
|
+
},
|
|
1218
|
+
getErrorLinkForErrorCode: {
|
|
1219
|
+
requestFields: [field("cobriliErrorCode", "string", {})],
|
|
1220
|
+
responseFields: [field("errorLink", "string")],
|
|
1221
|
+
description: "Get error link for error code"
|
|
1222
|
+
},
|
|
1223
|
+
canApplicationDisplayData: {
|
|
1224
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
1225
|
+
responseFields: [field("canDisplay", "boolean")],
|
|
1226
|
+
description: "Check if application can display data"
|
|
1227
|
+
},
|
|
1228
|
+
makeDatabaseUpdate: {
|
|
1229
|
+
requestFields: [
|
|
1230
|
+
field("dbUpdateFile", "string", {}),
|
|
1231
|
+
field("withDialog", "boolean", {}),
|
|
1232
|
+
field("masterHelpsetID", "string", {})
|
|
1233
|
+
],
|
|
1234
|
+
responseFields: [field("not_used", "boolean")],
|
|
1235
|
+
description: "Make database update"
|
|
1236
|
+
},
|
|
1237
|
+
clearStaticCaches: {
|
|
1238
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
1239
|
+
responseFields: [field("success", "boolean")],
|
|
1240
|
+
description: "Clear static caches"
|
|
1241
|
+
},
|
|
1242
|
+
refreshStaticCaches: {
|
|
1243
|
+
requestFields: [
|
|
1244
|
+
field("secretToken", "string", {}),
|
|
1245
|
+
field("uniqueHelpsetIdentifier", "string", {}),
|
|
1246
|
+
field("deletedHelpsetID", "double", {}),
|
|
1247
|
+
field("deletedHelpsetExternalID", "string", {}),
|
|
1248
|
+
field("deletedHelpsetLanguage", "string", {}),
|
|
1249
|
+
field("deletedTopicIDs", "array", { itemType: "double", keytype: "vector" }),
|
|
1250
|
+
field("deletedNavigationIDs", "array", { itemType: "double", keytype: "vector" })
|
|
1251
|
+
],
|
|
1252
|
+
responseFields: [field("success", "boolean")],
|
|
1253
|
+
description: "Refresh static caches"
|
|
1254
|
+
},
|
|
1255
|
+
exportDataForTest: {
|
|
1256
|
+
requestFields: [field("not_used", "boolean", {})],
|
|
1257
|
+
responseFields: [field("testData", "string", {})],
|
|
1258
|
+
description: "Export data for test"
|
|
1259
|
+
},
|
|
1260
|
+
getStateOfLongRunningOperation: {
|
|
1261
|
+
requestFields: [field("long_runnning_operation_id", "int", { keytype: "long" })],
|
|
1262
|
+
responseFields: [field("operationState", "string", {}), field("operationProgress", "int", {}), field("operationStateMessage", "string", {})],
|
|
1263
|
+
description: "Get state of long running operation"
|
|
1264
|
+
},
|
|
1265
|
+
getResultOfLongRunningOperation: {
|
|
1266
|
+
requestFields: [field("long_runnning_operation_id", "int", { keytype: "long" })],
|
|
1267
|
+
responseFields: [field("string_result", "string", {}), field("fileTransport", "object", { objectType: "FileTransport", xmlTag: "FileTransport", varname: "fileTransport" })],
|
|
1268
|
+
description: "Get result of long running operation"
|
|
1269
|
+
},
|
|
1270
|
+
sendFeedbackEmail: {
|
|
1271
|
+
requestFields: [field("emailContent", "string", {}), field("userEmailAdress", "string", {})],
|
|
1272
|
+
responseFields: [field("not_used", "boolean", {})],
|
|
1273
|
+
description: "Send feedback email"
|
|
1274
|
+
}
|
|
1275
|
+
};
|
|
1276
|
+
var API_TYPES = {
|
|
1277
|
+
LoginUser: [field("username", "string", {}), field("password", "string", { xmlType: "SiriusBase64String", varname: "password", isBase64: true })],
|
|
1278
|
+
AnonymousLoginData: [field("Anonymous_ID", "string", {})],
|
|
1279
|
+
MetaValuePair: [field("metaKey", "string", {}), field("metaValue", "string", {})],
|
|
1280
|
+
StartUpMetaValuePair: [field("metaKey", "string", {}), field("metaValue", "string", {})],
|
|
1281
|
+
MetaValuesForTopicEntry: [
|
|
1282
|
+
field("externalTopicID", "string", {}),
|
|
1283
|
+
field("topicID", "double", {}),
|
|
1284
|
+
field("navigationID", "double", {}),
|
|
1285
|
+
field("metaValues", "array", { itemObjectType: "MetaValuePair", varname: "metaValues" })
|
|
1286
|
+
],
|
|
1287
|
+
MetaKeyWithID: [field("metaKeyID", "double", {}), field("metaKeyName", "string", {})],
|
|
1288
|
+
MetaValueForGroupRightEntry: [field("metaKeyID", "double", {}), field("metaValue", "string", {})],
|
|
1289
|
+
GroupRights: [field("metaDataBasedRights", "array", { itemObjectType: "MetaValueForGroupRightEntry", varname: "metaDataBasedRights", keytype: "vector" })],
|
|
1290
|
+
GroupDataWithoutUsers: [field("groupID", "double", {}), field("groupName", "string", {}), field("rights", "map", { varkeytype: "RightsTypesEnum", vartype: "GroupRights" })],
|
|
1291
|
+
GroupData: [
|
|
1292
|
+
field("groupID", "double", {}),
|
|
1293
|
+
field("groupName", "string", {}),
|
|
1294
|
+
field("users", "array", { itemType: "double", varname: "users" }),
|
|
1295
|
+
field("rights", "map", { varkeytype: "RightsTypesEnum", vartype: "GroupRights" })
|
|
1296
|
+
],
|
|
1297
|
+
UserData: [
|
|
1298
|
+
field("userID", "double", {}),
|
|
1299
|
+
field("userName", "string", {}),
|
|
1300
|
+
field("password", "string", { optional: true }),
|
|
1301
|
+
field("userFullName", "string", { optional: true }),
|
|
1302
|
+
field("userType", "string", { keytype: "UserRolesEnum" }),
|
|
1303
|
+
field("emailAdress", "string", { optional: true }),
|
|
1304
|
+
field("groups", "array", { itemObjectType: "GroupDataWithoutUsers", varname: "groups", keytype: "vector" }),
|
|
1305
|
+
field("state", "int", { keytype: "UserStateFlag" }),
|
|
1306
|
+
field("creationTimestamp", "double", {}),
|
|
1307
|
+
field("validFromTimestamp", "double", { optional: true }),
|
|
1308
|
+
field("validToTimestamp", "double", { optional: true })
|
|
1309
|
+
],
|
|
1310
|
+
SearchProposalResult: [field("changedSearchForWithSynonyms", "string", {}), field("searchID", "double", {}), field("numberOfHits", "map", { varkeytype: "TopicType", vartype: "int" })],
|
|
1311
|
+
StartExtendedSearchRequest: [
|
|
1312
|
+
field("searchInTopicTypes", "string", { keytype: "SearchInTopicTypesEnum" }),
|
|
1313
|
+
field("searchString", "string", {}),
|
|
1314
|
+
field("searchParameters", "object", { objectType: "SearchQueryParameters", optional: true, varname: "searchParameters" }),
|
|
1315
|
+
field("matchSimilarWords", "boolean", {}),
|
|
1316
|
+
field("usedLuceneAnalyzer", "string", { optional: true }),
|
|
1317
|
+
field("searchLanguage", "string", { optional: true }),
|
|
1318
|
+
field("searchBelowTheseTopics", "array", { itemType: "double", varname: "searchBelowTheseTopics" })
|
|
1319
|
+
],
|
|
1320
|
+
StartExtendedSearchResponse: [field("searchID", "double", {}), field("numberOfHits", "map", { varkeytype: "AlpTString", vartype: "int" })],
|
|
1321
|
+
ImportHelpsetStorageRequest: [field("zipfile", "object", { objectType: "FileTransport", varname: "zipfile" })],
|
|
1322
|
+
GetMetaDataDefinitionsForCustomerCriteriaRequest: [field("customerType", "string", { keytype: "CustomerDefinitionEnum" }), field("criteria", "stringArray", { varname: "criteria" })],
|
|
1323
|
+
FileTransport: [
|
|
1324
|
+
field("filePath", "string", {}),
|
|
1325
|
+
field("owns", "boolean", {}),
|
|
1326
|
+
field("creationDate", "double", { optional: true }),
|
|
1327
|
+
field("modificationDate", "double", { optional: true }),
|
|
1328
|
+
field("TransportedFileName", "string", {})
|
|
1329
|
+
],
|
|
1330
|
+
LoggingInformation: [
|
|
1331
|
+
field("LoggingFile", "string", {}),
|
|
1332
|
+
field("LoggingLevel", "int", { keytype: "UINT" }),
|
|
1333
|
+
field("MaxLoggingSize", "int", { keytype: "DWORD" }),
|
|
1334
|
+
field("DebugMode", "boolean", {}),
|
|
1335
|
+
field("LoggingAdvancedFeatures", "int", {})
|
|
1336
|
+
],
|
|
1337
|
+
MSSQL_DatabaseSettings: [field("serverName", "string", {}), field("databaseName", "string", {}), field("userName", "string", {}), field("password", "string", {}), field("integratedSecurity", "boolean", {})],
|
|
1338
|
+
DatabaseSettings: [
|
|
1339
|
+
field("databaseType", "string", { keytype: "DatabaseTypeEnum" }),
|
|
1340
|
+
field("MSSQL_DatabaseSettings", "object", { optional: true, objectType: "MSSQL_DatabaseSettings", varname: "MSSQL_DatabaseSettings" })
|
|
1341
|
+
],
|
|
1342
|
+
HistoryEntryExtended: [
|
|
1343
|
+
field("topicID", "double", {}),
|
|
1344
|
+
field("navigationID", "double", {}),
|
|
1345
|
+
field("title", "string", {}),
|
|
1346
|
+
field("timestamp", "double", {}),
|
|
1347
|
+
field("helpsetID", "double", {}),
|
|
1348
|
+
field("scrollPosition", "int", {}),
|
|
1349
|
+
field("hitRangeBegin", "int", {}),
|
|
1350
|
+
field("hitRangeEnd", "int", {}),
|
|
1351
|
+
field("searchHistoryEntry", "object", { objectType: "SearchHistoryEntry", varname: "searchHistoryEntry" })
|
|
1352
|
+
],
|
|
1353
|
+
HistoryEntry: [field("topicID", "double", {}), field("navigationID", "double", {}), field("title", "string", {}), field("timestamp", "double", {}), field("helpsetID", "double", {})],
|
|
1354
|
+
BookmarkEntry: [field("bookmarkID", "double", {}), field("topicID", "double", {}), field("navigationID", "double", {}), field("title", "string", {}), field("creationTimestamp", "double", {})],
|
|
1355
|
+
NavigationEntry: [
|
|
1356
|
+
field("navigationID", "double", {}),
|
|
1357
|
+
field("topicID", "double", {}),
|
|
1358
|
+
field("parentNavigationID", "double", {}),
|
|
1359
|
+
field("title", "string", {}),
|
|
1360
|
+
field("hasChildren", "boolean", {}),
|
|
1361
|
+
field("target", "string", {}),
|
|
1362
|
+
field("iconName", "string", {}),
|
|
1363
|
+
field("isTopicVisible", "boolean", {})
|
|
1364
|
+
],
|
|
1365
|
+
MetaValuesList: [field("metaValues", "stringArray", { varname: "metaValues" })],
|
|
1366
|
+
TopicMetaData: [field("metaData", "map", { varkeytype: "AlpTString", vartype: "MetaValuesList" })],
|
|
1367
|
+
BreadCrumbEntry: [field("title", "string", {}), field("topicID", "double", {}), field("navigationID", "double", {}), field("longTitle", "string", {})],
|
|
1368
|
+
AdditionalContent: [field("content", "string", {}), field("targetName", "string", {})],
|
|
1369
|
+
RelatedTopicInfo: [
|
|
1370
|
+
field("topicID", "double", {}),
|
|
1371
|
+
field("navigationID", "double", {}),
|
|
1372
|
+
field("title", "string", {}),
|
|
1373
|
+
field("metaData", "object", { optional: true, objectType: "TopicMetaData", xmlTag: "TopicMetaData", varname: "metaData" })
|
|
1374
|
+
],
|
|
1375
|
+
HelpsetInfo: [
|
|
1376
|
+
field("helpsetId", "double", { xmlTag: "helpsetId" }),
|
|
1377
|
+
field("name", "string", {}),
|
|
1378
|
+
field("uniqueIdentifier", "string", {}),
|
|
1379
|
+
field("externalID", "string", {}),
|
|
1380
|
+
field("metaData", "stringMap", { optional: true }),
|
|
1381
|
+
field("masterHelpSetApplicationIdentifier", "string", {}),
|
|
1382
|
+
field("topicDirectory", "string", { optional: true }),
|
|
1383
|
+
field("helpsetType", "string", {})
|
|
1384
|
+
],
|
|
1385
|
+
SearchResult: [
|
|
1386
|
+
field("content", "string", {}),
|
|
1387
|
+
field("topicID", "double", {}),
|
|
1388
|
+
field("navigationID", "double", {}),
|
|
1389
|
+
field("helpsetID", "double", {}),
|
|
1390
|
+
field("luceneScore", "double", {})
|
|
1391
|
+
],
|
|
1392
|
+
LocalizedEntry: [field("metaValue", "string", {}), field("localizedValue", "string", {})],
|
|
1393
|
+
TopicInfo: [field("topicID", "double", {}), field("navigationID", "double", {}), field("helpsetID", "double", {}), field("title", "string", {}), field("target", "string", {})],
|
|
1394
|
+
SearchSuggestion: [field("term", "string", {}), field("weight", "double", {})],
|
|
1395
|
+
MetaKeyDefinition: [field("metaKeyID", "double", {}), field("metaKey", "string", {}), field("displayName", "string", {})],
|
|
1396
|
+
NavigationEntryWithMetaData: [
|
|
1397
|
+
field("title", "string", {}),
|
|
1398
|
+
field("helpsetID", "double", {}),
|
|
1399
|
+
field("topicID", "double", {}),
|
|
1400
|
+
field("navigationID", "double", {}),
|
|
1401
|
+
field("children", "object", { objectType: "NavigationEntryWithMetaDataList", xmlTag: "NavigationEntryWithMetaDataList", varname: "children" }),
|
|
1402
|
+
field("nextNavID", "double", { optional: true }),
|
|
1403
|
+
field("prevNavID", "double", { optional: true }),
|
|
1404
|
+
field("parentNavID", "double", { optional: true }),
|
|
1405
|
+
field("hasChildren", "boolean", {}),
|
|
1406
|
+
field("isPlaceHolderForContainedHelpset", "boolean", {}),
|
|
1407
|
+
field("cobriliLink", "string", {}),
|
|
1408
|
+
field("requestedMetaData", "array", { itemObjectType: "MetaValuePair" }),
|
|
1409
|
+
field("isMetaDataDrivenNavigationEntry", "boolean", {})
|
|
1410
|
+
],
|
|
1411
|
+
NavigationEntryWithMetaDataList: [field("entries", "array", { itemObjectType: "NavigationEntryWithMetaData" })],
|
|
1412
|
+
BreadCrumbWithMetaDataEntry: [
|
|
1413
|
+
field("title", "string", {}),
|
|
1414
|
+
field("topicID", "double", {}),
|
|
1415
|
+
field("navigationID", "double", {}),
|
|
1416
|
+
field("longTitle", "string", {}),
|
|
1417
|
+
field("cobriliLink", "string", {}),
|
|
1418
|
+
field("requestedMetaData", "array", { itemObjectType: "MetaValuePair" })
|
|
1419
|
+
],
|
|
1420
|
+
BreadCrumbEntryWithMetaData: [
|
|
1421
|
+
field("title", "string", {}),
|
|
1422
|
+
field("topicID", "double", {}),
|
|
1423
|
+
field("navigationID", "double", {}),
|
|
1424
|
+
field("longTitle", "string", {}),
|
|
1425
|
+
field("cobriliLink", "string", {}),
|
|
1426
|
+
field("requestedMetaData", "array", { itemObjectType: "MetaValuePair" })
|
|
1427
|
+
],
|
|
1428
|
+
MetaDataDefinition: [field("metaKey", "string", {}), field("displayName", "string", {}), field("possibleValues", "array", { itemType: "string" })],
|
|
1429
|
+
UserInfo: [
|
|
1430
|
+
field("userID", "double", {}),
|
|
1431
|
+
field("userName", "string", {}),
|
|
1432
|
+
field("userFullName", "string", {}),
|
|
1433
|
+
field("emailAdress", "string", {}),
|
|
1434
|
+
field("isAdmin", "boolean", {}),
|
|
1435
|
+
field("isAnonymous", "boolean", {}),
|
|
1436
|
+
field("state", "int", { keytype: "UserStateFlag" }),
|
|
1437
|
+
field("groups", "array", { itemObjectType: "GroupDataWithoutUsersAndRights" })
|
|
1438
|
+
],
|
|
1439
|
+
GroupDataWithoutUsersAndRights: [field("groupID", "double", {}), field("groupName", "string", {}), field("description", "string", {})],
|
|
1440
|
+
CustomSetting: [field("key", "string", {}), field("value", "string", {})],
|
|
1441
|
+
RelatedTopicWithLinks: [field("topicID", "double", {}), field("navigationID", "double", {}), field("title", "string", {}), field("target", "string", {}), field("cobriliLink", "string", {})],
|
|
1442
|
+
RelatedTopicWithLinkInfo: [field("normalRelatedTopicInfo", "object", { objectType: "RelatedTopicInfo", varname: "normalRelatedTopicInfo" }), field("cobriliLink", "string", {})],
|
|
1443
|
+
RawNavigationEntry: [field("navigationID", "double", {}), field("topicID", "double", {}), field("parentNavigationID", "double", {}), field("title", "string", {}), field("sortOrder", "int", {})],
|
|
1444
|
+
ChildTopicBasedOnMetadata: [field("topicID", "double", {}), field("linkToTopic", "string", {}), field("title", "string", {})],
|
|
1445
|
+
ChildTopicInfo: [field("title", "string", {}), field("topicID", "double", {}), field("navigationID", "double", {}), field("hasChildren", "boolean", {}), field("linkToTopic", "string", {})],
|
|
1446
|
+
SynonymEntry: [field("word", "string", {}), field("synonyms", "array", { itemType: "string" })],
|
|
1447
|
+
SearchResultWithMetadata: [
|
|
1448
|
+
field("content", "string", {}),
|
|
1449
|
+
field("topicID", "double", {}),
|
|
1450
|
+
field("navigationID", "double", {}),
|
|
1451
|
+
field("helpsetID", "double", {}),
|
|
1452
|
+
field("luceneScore", "double", {}),
|
|
1453
|
+
field("requestedMetaData", "array", { itemObjectType: "MetaValuePair" })
|
|
1454
|
+
],
|
|
1455
|
+
FacetChange: [field("metaKey", "string", {}), field("metaValue", "string", {}), field("changes", "int", {}), field("changeAsText", "string", {})],
|
|
1456
|
+
FacetInputData: [field("metaKey", "string", {}), field("metaValue", "string", {}), field("addFacet", "boolean", {})],
|
|
1457
|
+
FacetResultsForSearch: [field("searchID", "double", {}), field("facetResults", "array", { itemObjectType: "FacetChange" })],
|
|
1458
|
+
ExecutedSearch: [field("searchID", "double", {}), field("searchString", "string", {}), field("timestamp", "double", {}), field("numberOfResults", "int", {})],
|
|
1459
|
+
TopicType: [field("topicType", "string", { keytype: "SearchInTopicTypesEnum" })],
|
|
1460
|
+
SearchSuggestionsSettings: [field("maxSuggestions", "int", {}), field("minChars", "int", {})],
|
|
1461
|
+
BookmarkData: [field("topicID", "double", {}), field("navigationID", "double", {}), field("title", "string", {})],
|
|
1462
|
+
SearchQueryParameters: [
|
|
1463
|
+
field("searchString", "string", {}),
|
|
1464
|
+
field("searchLanguage", "string", {}),
|
|
1465
|
+
field("maxResults", "int", {}),
|
|
1466
|
+
field("searchType", "string", { keytype: "SearchTypeEnum" }),
|
|
1467
|
+
field("analyzerName", "string", {}),
|
|
1468
|
+
field("searchInHelpsets", "array", { itemType: "double" })
|
|
1469
|
+
],
|
|
1470
|
+
SearchHistoryEntry: [field("searchID", "double", {}), field("hitRangeBegin", "int", {}), field("hitRangeEnd", "int", {})]
|
|
1471
|
+
};
|
|
1472
|
+
|
|
1473
|
+
// src/xml-utils.ts
|
|
1474
|
+
function parseXml(xmlString) {
|
|
1475
|
+
if (typeof DOMParser !== "undefined") {
|
|
1476
|
+
return parseXmlBrowser(xmlString);
|
|
1477
|
+
}
|
|
1478
|
+
return parseXmlSimple(xmlString);
|
|
1479
|
+
}
|
|
1480
|
+
function parseXmlBrowser(xmlString) {
|
|
1481
|
+
const parser = new DOMParser();
|
|
1482
|
+
const doc = parser.parseFromString(xmlString, "text/xml");
|
|
1483
|
+
const root = doc.documentElement;
|
|
1484
|
+
if (!root) {
|
|
1485
|
+
throw new Error("Invalid XML: no root element");
|
|
1486
|
+
}
|
|
1487
|
+
return parseElement(root);
|
|
1488
|
+
}
|
|
1489
|
+
function parseElement(element) {
|
|
1490
|
+
const node = {
|
|
1491
|
+
name: element.tagName,
|
|
1492
|
+
attributes: {},
|
|
1493
|
+
children: [],
|
|
1494
|
+
value: null
|
|
1495
|
+
};
|
|
1496
|
+
for (let i = 0; i < element.attributes.length; i++) {
|
|
1497
|
+
const attr = element.attributes[i];
|
|
1498
|
+
node.attributes[attr.name] = attr.value;
|
|
1499
|
+
}
|
|
1500
|
+
for (let i = 0; i < element.childNodes.length; i++) {
|
|
1501
|
+
const child = element.childNodes[i];
|
|
1502
|
+
if (child.nodeType === 1) {
|
|
1503
|
+
node.children.push(parseElement(child));
|
|
1504
|
+
} else if (child.nodeType === 3) {
|
|
1505
|
+
const text = child.nodeValue?.trim();
|
|
1506
|
+
if (text) {
|
|
1507
|
+
if (element.childNodes.length === 1) {
|
|
1508
|
+
node.value = child.nodeValue;
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
return node;
|
|
1514
|
+
}
|
|
1515
|
+
function parseXmlSimple(xmlString) {
|
|
1516
|
+
xmlString = xmlString.replace(/<\?xml[^?]*\?>/g, "").trim();
|
|
1517
|
+
xmlString = xmlString.replace(/<!--([\s\S]*?)-->/g, "").trim();
|
|
1518
|
+
xmlString = xmlString.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g, (_, cdata) => String(cdata));
|
|
1519
|
+
const parseTag = (str, start) => {
|
|
1520
|
+
const tagStart = str.indexOf("<", start);
|
|
1521
|
+
if (tagStart === -1) return null;
|
|
1522
|
+
const tagEnd = str.indexOf(">", tagStart);
|
|
1523
|
+
if (tagEnd === -1) return null;
|
|
1524
|
+
const tagContent = str.slice(tagStart + 1, tagEnd);
|
|
1525
|
+
const isSelfClosing = tagContent.endsWith("/");
|
|
1526
|
+
const tagParts = (isSelfClosing ? tagContent.slice(0, -1) : tagContent).trim().split(/\s+/);
|
|
1527
|
+
const tagName = tagParts[0];
|
|
1528
|
+
const attributes = {};
|
|
1529
|
+
const attrRegex = /([^\s=]+)\s*=\s*("([^"]*)"|'([^']*)')/g;
|
|
1530
|
+
let attrMatch;
|
|
1531
|
+
while ((attrMatch = attrRegex.exec(tagContent)) !== null) {
|
|
1532
|
+
const name = attrMatch[1];
|
|
1533
|
+
const rawValue = attrMatch[3] ?? attrMatch[4] ?? "";
|
|
1534
|
+
attributes[name] = unescapeXml(rawValue);
|
|
1535
|
+
}
|
|
1536
|
+
const node = {
|
|
1537
|
+
name: tagName,
|
|
1538
|
+
attributes,
|
|
1539
|
+
children: [],
|
|
1540
|
+
value: null
|
|
1541
|
+
};
|
|
1542
|
+
if (isSelfClosing) {
|
|
1543
|
+
return { node, end: tagEnd + 1 };
|
|
1544
|
+
}
|
|
1545
|
+
const closingTag = `</${tagName}>`;
|
|
1546
|
+
let depth = 1;
|
|
1547
|
+
let pos = tagEnd + 1;
|
|
1548
|
+
const contentStart = pos;
|
|
1549
|
+
while (depth > 0 && pos < str.length) {
|
|
1550
|
+
const nextOpen = str.indexOf(`<${tagName}`, pos);
|
|
1551
|
+
const nextClose = str.indexOf(closingTag, pos);
|
|
1552
|
+
if (nextClose === -1) break;
|
|
1553
|
+
if (nextOpen !== -1 && nextOpen < nextClose) {
|
|
1554
|
+
depth++;
|
|
1555
|
+
pos = nextOpen + tagName.length + 1;
|
|
1556
|
+
} else {
|
|
1557
|
+
depth--;
|
|
1558
|
+
if (depth === 0) {
|
|
1559
|
+
const content = str.slice(contentStart, nextClose).trim();
|
|
1560
|
+
if (content.startsWith("<")) {
|
|
1561
|
+
let childPos = 0;
|
|
1562
|
+
while (childPos < content.length) {
|
|
1563
|
+
const childResult = parseTag(content, childPos);
|
|
1564
|
+
if (childResult) {
|
|
1565
|
+
node.children.push(childResult.node);
|
|
1566
|
+
childPos = childResult.end;
|
|
1567
|
+
} else {
|
|
1568
|
+
break;
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
} else if (content) {
|
|
1572
|
+
node.value = unescapeXml(content);
|
|
1573
|
+
}
|
|
1574
|
+
return { node, end: nextClose + closingTag.length };
|
|
1575
|
+
}
|
|
1576
|
+
pos = nextClose + closingTag.length;
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
return { node, end: str.length };
|
|
1580
|
+
};
|
|
1581
|
+
const result = parseTag(xmlString, 0);
|
|
1582
|
+
if (!result) {
|
|
1583
|
+
throw new Error("Invalid XML");
|
|
1584
|
+
}
|
|
1585
|
+
return result.node;
|
|
1586
|
+
}
|
|
1587
|
+
function serializeXml(node) {
|
|
1588
|
+
return '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>' + serializeNode(node);
|
|
1589
|
+
}
|
|
1590
|
+
function serializeNode(node) {
|
|
1591
|
+
let result = `<${node.name}`;
|
|
1592
|
+
for (const [key, value] of Object.entries(node.attributes)) {
|
|
1593
|
+
result += ` ${key}="${escapeXml(value)}"`;
|
|
1594
|
+
}
|
|
1595
|
+
result += ">";
|
|
1596
|
+
if (node.children.length > 0) {
|
|
1597
|
+
for (const child of node.children) {
|
|
1598
|
+
result += serializeNode(child);
|
|
1599
|
+
}
|
|
1600
|
+
} else if (node.value !== null) {
|
|
1601
|
+
result += escapeXml(node.value);
|
|
1602
|
+
}
|
|
1603
|
+
result += `</${node.name}>`;
|
|
1604
|
+
return result;
|
|
1605
|
+
}
|
|
1606
|
+
function escapeXml(str) {
|
|
1607
|
+
return str.replace(/[<>&'"]/g, (c) => {
|
|
1608
|
+
switch (c) {
|
|
1609
|
+
case "<":
|
|
1610
|
+
return "<";
|
|
1611
|
+
case ">":
|
|
1612
|
+
return ">";
|
|
1613
|
+
case "&":
|
|
1614
|
+
return "&";
|
|
1615
|
+
case "'":
|
|
1616
|
+
return "'";
|
|
1617
|
+
case '"':
|
|
1618
|
+
return """;
|
|
1619
|
+
default:
|
|
1620
|
+
return c;
|
|
1621
|
+
}
|
|
1622
|
+
});
|
|
1623
|
+
}
|
|
1624
|
+
function unescapeXml(str) {
|
|
1625
|
+
return str.replace(/("|<|>|&|')/g, (c) => {
|
|
1626
|
+
switch (c) {
|
|
1627
|
+
case "<":
|
|
1628
|
+
return "<";
|
|
1629
|
+
case ">":
|
|
1630
|
+
return ">";
|
|
1631
|
+
case "&":
|
|
1632
|
+
return "&";
|
|
1633
|
+
case "'":
|
|
1634
|
+
return "'";
|
|
1635
|
+
case """:
|
|
1636
|
+
return '"';
|
|
1637
|
+
default:
|
|
1638
|
+
return c;
|
|
1639
|
+
}
|
|
1640
|
+
});
|
|
1641
|
+
}
|
|
1642
|
+
function createRequestXml(namespace, requestType, fields, data) {
|
|
1643
|
+
const rootNode = {
|
|
1644
|
+
name: namespace,
|
|
1645
|
+
attributes: {},
|
|
1646
|
+
children: [],
|
|
1647
|
+
value: null
|
|
1648
|
+
};
|
|
1649
|
+
const requestNode = {
|
|
1650
|
+
name: requestType,
|
|
1651
|
+
attributes: {},
|
|
1652
|
+
children: [],
|
|
1653
|
+
value: null
|
|
1654
|
+
};
|
|
1655
|
+
rootNode.children.push(requestNode);
|
|
1656
|
+
for (const field2 of fields) {
|
|
1657
|
+
const value = data[field2.name] ?? field2.defaultValue;
|
|
1658
|
+
if (value === void 0 || value === null) {
|
|
1659
|
+
if (field2.optional) continue;
|
|
1660
|
+
continue;
|
|
1661
|
+
}
|
|
1662
|
+
const fieldNode = createFieldNode(field2, value);
|
|
1663
|
+
if (fieldNode) {
|
|
1664
|
+
requestNode.children.push(fieldNode);
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
return rootNode;
|
|
1668
|
+
}
|
|
1669
|
+
function createFieldNode(field2, value) {
|
|
1670
|
+
const nodeName = field2.xmlTag || field2.name;
|
|
1671
|
+
const node = {
|
|
1672
|
+
name: nodeName,
|
|
1673
|
+
attributes: { keytype: field2.keytype || getKeyType(field2.type) },
|
|
1674
|
+
children: [],
|
|
1675
|
+
value: null
|
|
1676
|
+
};
|
|
1677
|
+
if (field2.varname) {
|
|
1678
|
+
node.attributes.varname = field2.varname;
|
|
1679
|
+
}
|
|
1680
|
+
if (field2.xmlType === "SiriusBase64String") {
|
|
1681
|
+
node.name = field2.xmlType;
|
|
1682
|
+
delete node.attributes.keytype;
|
|
1683
|
+
if (field2.varname) node.attributes.varname = field2.varname;
|
|
1684
|
+
const contentNode = {
|
|
1685
|
+
name: "content",
|
|
1686
|
+
attributes: { keytype: "AlpTString" },
|
|
1687
|
+
children: [],
|
|
1688
|
+
value: field2.isBase64 ? toBase64(String(value)) : String(value)
|
|
1689
|
+
};
|
|
1690
|
+
node.children.push(contentNode);
|
|
1691
|
+
return node;
|
|
1692
|
+
}
|
|
1693
|
+
switch (field2.type) {
|
|
1694
|
+
case "string":
|
|
1695
|
+
node.value = field2.isBase64 ? toBase64(String(value)) : String(value);
|
|
1696
|
+
break;
|
|
1697
|
+
case "number":
|
|
1698
|
+
case "double":
|
|
1699
|
+
node.value = String(value);
|
|
1700
|
+
break;
|
|
1701
|
+
case "int":
|
|
1702
|
+
node.value = String(Math.floor(value));
|
|
1703
|
+
break;
|
|
1704
|
+
case "boolean":
|
|
1705
|
+
node.value = value ? "true" : "false";
|
|
1706
|
+
break;
|
|
1707
|
+
case "stringArray": {
|
|
1708
|
+
node.attributes.keytype = field2.keytype || "list";
|
|
1709
|
+
node.attributes.varkeytype = "AlpTString";
|
|
1710
|
+
const strArr = value;
|
|
1711
|
+
for (const item of strArr) {
|
|
1712
|
+
node.children.push({
|
|
1713
|
+
name: field2.name,
|
|
1714
|
+
// Use field.name instead of field.xmlTag || field.name
|
|
1715
|
+
attributes: { keytype: "AlpTString" },
|
|
1716
|
+
children: [],
|
|
1717
|
+
value: item
|
|
1718
|
+
});
|
|
1719
|
+
}
|
|
1720
|
+
break;
|
|
1721
|
+
}
|
|
1722
|
+
case "stringMap": {
|
|
1723
|
+
node.attributes.keytype = field2.keytype || "map";
|
|
1724
|
+
node.attributes.varkeytype = "AlpTString";
|
|
1725
|
+
node.attributes.vartype = "AlpTString";
|
|
1726
|
+
const mapValue = value;
|
|
1727
|
+
for (const [key, val] of Object.entries(mapValue)) {
|
|
1728
|
+
node.children.push({
|
|
1729
|
+
name: field2.name,
|
|
1730
|
+
attributes: { keytype: "AlpTString" },
|
|
1731
|
+
children: [],
|
|
1732
|
+
value: key
|
|
1733
|
+
});
|
|
1734
|
+
node.children.push({
|
|
1735
|
+
name: field2.name,
|
|
1736
|
+
attributes: { keytype: "AlpTString" },
|
|
1737
|
+
children: [],
|
|
1738
|
+
value: val
|
|
1739
|
+
});
|
|
1740
|
+
}
|
|
1741
|
+
break;
|
|
1742
|
+
}
|
|
1743
|
+
case "map": {
|
|
1744
|
+
node.attributes.keytype = field2.keytype || "map";
|
|
1745
|
+
node.attributes.varkeytype = field2.varkeytype || "AlpTString";
|
|
1746
|
+
node.attributes.vartype = field2.vartype || "AlpTString";
|
|
1747
|
+
const genericMapValue = value;
|
|
1748
|
+
for (const [key, val] of Object.entries(genericMapValue)) {
|
|
1749
|
+
node.children.push({
|
|
1750
|
+
name: field2.name,
|
|
1751
|
+
attributes: { keytype: field2.varkeytype || "AlpTString" },
|
|
1752
|
+
children: [],
|
|
1753
|
+
value: key
|
|
1754
|
+
});
|
|
1755
|
+
if (field2.vartype && API_TYPES[field2.vartype]) {
|
|
1756
|
+
const valueNode = {
|
|
1757
|
+
name: field2.name,
|
|
1758
|
+
attributes: { keytype: field2.vartype },
|
|
1759
|
+
children: [],
|
|
1760
|
+
value: null
|
|
1761
|
+
};
|
|
1762
|
+
const objectRootNode = {
|
|
1763
|
+
name: field2.vartype,
|
|
1764
|
+
attributes: {},
|
|
1765
|
+
children: [],
|
|
1766
|
+
value: null
|
|
1767
|
+
};
|
|
1768
|
+
objectRootNode.attributes.varname = field2.name;
|
|
1769
|
+
const objFields = API_TYPES[field2.vartype];
|
|
1770
|
+
const objValue = val;
|
|
1771
|
+
for (const childField of objFields) {
|
|
1772
|
+
const childValue = objValue[childField.name];
|
|
1773
|
+
if (childValue !== void 0 && childValue !== null) {
|
|
1774
|
+
const childNode = createFieldNode(childField, childValue);
|
|
1775
|
+
if (childNode) {
|
|
1776
|
+
objectRootNode.children.push(childNode);
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
valueNode.children.push(objectRootNode);
|
|
1781
|
+
node.children.push(valueNode);
|
|
1782
|
+
} else {
|
|
1783
|
+
node.children.push({
|
|
1784
|
+
name: field2.name,
|
|
1785
|
+
attributes: { keytype: field2.vartype || "AlpTString" },
|
|
1786
|
+
children: [],
|
|
1787
|
+
value: String(val)
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
break;
|
|
1792
|
+
}
|
|
1793
|
+
case "array": {
|
|
1794
|
+
node.attributes.keytype = field2.keytype || "list";
|
|
1795
|
+
if (field2.itemObjectType) {
|
|
1796
|
+
node.attributes.varkeytype = field2.itemObjectType;
|
|
1797
|
+
} else if (field2.itemType) {
|
|
1798
|
+
node.attributes.varkeytype = getKeyType(field2.itemType);
|
|
1799
|
+
}
|
|
1800
|
+
if (Array.isArray(value)) {
|
|
1801
|
+
for (const item of value) {
|
|
1802
|
+
if (field2.itemObjectType && API_TYPES[field2.itemObjectType]) {
|
|
1803
|
+
const itemNode = {
|
|
1804
|
+
name: field2.itemObjectType,
|
|
1805
|
+
attributes: { keytype: field2.itemObjectType, varname: field2.varname || field2.name },
|
|
1806
|
+
children: [],
|
|
1807
|
+
value: null
|
|
1808
|
+
};
|
|
1809
|
+
const objFields = API_TYPES[field2.itemObjectType];
|
|
1810
|
+
const objValue = item;
|
|
1811
|
+
for (const childField of objFields) {
|
|
1812
|
+
const childValue = objValue[childField.name];
|
|
1813
|
+
if (childValue !== void 0 && childValue !== null) {
|
|
1814
|
+
const childNode = createFieldNode(childField, childValue);
|
|
1815
|
+
if (childNode) itemNode.children.push(childNode);
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
node.children.push(itemNode);
|
|
1819
|
+
} else if (field2.itemType) {
|
|
1820
|
+
const itemName = field2.xmlTag || field2.name;
|
|
1821
|
+
node.children.push({
|
|
1822
|
+
name: itemName,
|
|
1823
|
+
attributes: { keytype: getKeyType(field2.itemType) },
|
|
1824
|
+
children: [],
|
|
1825
|
+
value: String(item)
|
|
1826
|
+
});
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
break;
|
|
1831
|
+
}
|
|
1832
|
+
case "object":
|
|
1833
|
+
if (field2.objectType && API_TYPES[field2.objectType]) {
|
|
1834
|
+
const objFields = API_TYPES[field2.objectType];
|
|
1835
|
+
const objValue = value;
|
|
1836
|
+
for (const childField of objFields) {
|
|
1837
|
+
const childValue = objValue[childField.name];
|
|
1838
|
+
if (childValue !== void 0 && childValue !== null) {
|
|
1839
|
+
const childNode = createFieldNode(childField, childValue);
|
|
1840
|
+
if (childNode) {
|
|
1841
|
+
node.children.push(childNode);
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
} else {
|
|
1846
|
+
if (typeof value === "object" && value !== null) {
|
|
1847
|
+
const objValue = value;
|
|
1848
|
+
for (const [key, val] of Object.entries(objValue)) {
|
|
1849
|
+
if (val !== void 0 && val !== null) {
|
|
1850
|
+
const childNode = {
|
|
1851
|
+
name: key,
|
|
1852
|
+
attributes: { keytype: inferKeyType(val) },
|
|
1853
|
+
children: [],
|
|
1854
|
+
value: String(val)
|
|
1855
|
+
};
|
|
1856
|
+
node.children.push(childNode);
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
break;
|
|
1862
|
+
}
|
|
1863
|
+
return node;
|
|
1864
|
+
}
|
|
1865
|
+
function toBase64(str) {
|
|
1866
|
+
if (typeof btoa === "function") {
|
|
1867
|
+
return btoa(str);
|
|
1868
|
+
}
|
|
1869
|
+
if (typeof Buffer !== "undefined") {
|
|
1870
|
+
return Buffer.from(str).toString("base64");
|
|
1871
|
+
}
|
|
1872
|
+
return str;
|
|
1873
|
+
}
|
|
1874
|
+
function getKeyType(type) {
|
|
1875
|
+
switch (type) {
|
|
1876
|
+
case "string":
|
|
1877
|
+
return "AlpTString";
|
|
1878
|
+
case "number":
|
|
1879
|
+
return "double";
|
|
1880
|
+
case "double":
|
|
1881
|
+
return "double";
|
|
1882
|
+
case "int":
|
|
1883
|
+
return "int";
|
|
1884
|
+
case "boolean":
|
|
1885
|
+
return "bool";
|
|
1886
|
+
case "array":
|
|
1887
|
+
return "list";
|
|
1888
|
+
case "object":
|
|
1889
|
+
return "object";
|
|
1890
|
+
default:
|
|
1891
|
+
return "AlpTString";
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
function inferKeyType(value) {
|
|
1895
|
+
if (typeof value === "string") return "AlpTString";
|
|
1896
|
+
if (typeof value === "number") return Number.isInteger(value) ? "int" : "double";
|
|
1897
|
+
if (typeof value === "boolean") return "bool";
|
|
1898
|
+
return "AlpTString";
|
|
1899
|
+
}
|
|
1900
|
+
function parseResponseXml(xmlNode, fields) {
|
|
1901
|
+
const result = {};
|
|
1902
|
+
const expectedTags = new Set(fields.map((f) => f.xmlTag || f.name));
|
|
1903
|
+
const expectedVarnames = new Set(fields.map((f) => f.varname).filter(Boolean));
|
|
1904
|
+
const hasExpectedFields = (node) => {
|
|
1905
|
+
return node.children.some((child) => expectedTags.has(child.name) || child.attributes.varname && expectedVarnames.has(child.attributes.varname));
|
|
1906
|
+
};
|
|
1907
|
+
const pureWrappers = /* @__PURE__ */ new Set(["Envelope", "Body", "CobriliData", "return", "Result"]);
|
|
1908
|
+
const ambiguousWrappers = /* @__PURE__ */ new Set(["Success"]);
|
|
1909
|
+
let current = xmlNode;
|
|
1910
|
+
let depth = 0;
|
|
1911
|
+
const MAX_DEPTH = 10;
|
|
1912
|
+
while (depth < MAX_DEPTH) {
|
|
1913
|
+
if (hasExpectedFields(current)) {
|
|
1914
|
+
break;
|
|
1915
|
+
}
|
|
1916
|
+
let nextNode;
|
|
1917
|
+
nextNode = current.children.find((c) => pureWrappers.has(c.name));
|
|
1918
|
+
if (!nextNode) {
|
|
1919
|
+
nextNode = current.children.find((c) => c.name.endsWith("Response"));
|
|
1920
|
+
}
|
|
1921
|
+
if (!nextNode) {
|
|
1922
|
+
const ambiguousChild = current.children.find((c) => ambiguousWrappers.has(c.name));
|
|
1923
|
+
if (ambiguousChild) {
|
|
1924
|
+
const isField = fields.some((f) => f.name === ambiguousChild.name);
|
|
1925
|
+
if (!isField) {
|
|
1926
|
+
nextNode = ambiguousChild;
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
if (nextNode) {
|
|
1931
|
+
current = nextNode;
|
|
1932
|
+
depth++;
|
|
1933
|
+
} else {
|
|
1934
|
+
break;
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
const responseNode = current;
|
|
1938
|
+
const fieldByTag = /* @__PURE__ */ new Map();
|
|
1939
|
+
const fieldByVarname = /* @__PURE__ */ new Map();
|
|
1940
|
+
for (const field2 of fields) {
|
|
1941
|
+
fieldByTag.set(field2.name, field2);
|
|
1942
|
+
fieldByTag.set(field2.xmlTag || field2.name, field2);
|
|
1943
|
+
if (field2.varname) {
|
|
1944
|
+
fieldByVarname.set(field2.varname, field2);
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
for (const child of responseNode.children) {
|
|
1948
|
+
const field2 = fieldByTag.get(child.name) || (child.attributes.varname ? fieldByVarname.get(child.attributes.varname) : void 0);
|
|
1949
|
+
if (field2) {
|
|
1950
|
+
result[field2.name] = parseFieldValue(child, field2);
|
|
1951
|
+
continue;
|
|
1952
|
+
}
|
|
1953
|
+
const parsed = autoParseField(child);
|
|
1954
|
+
if (child.attributes.varname) {
|
|
1955
|
+
result[child.attributes.varname] = parsed;
|
|
1956
|
+
if (child.attributes.varname !== child.name) {
|
|
1957
|
+
result[child.name] = parsed;
|
|
1958
|
+
}
|
|
1959
|
+
} else {
|
|
1960
|
+
result[child.name] = parsed;
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
return result;
|
|
1964
|
+
}
|
|
1965
|
+
function parseFieldValue(node, field2) {
|
|
1966
|
+
switch (field2.type) {
|
|
1967
|
+
case "string":
|
|
1968
|
+
return node.value || "";
|
|
1969
|
+
case "number":
|
|
1970
|
+
case "double":
|
|
1971
|
+
return node.value ? parseFloat(node.value) : 0;
|
|
1972
|
+
case "int":
|
|
1973
|
+
return node.value ? parseInt(node.value, 10) : 0;
|
|
1974
|
+
case "boolean":
|
|
1975
|
+
return node.value === "true";
|
|
1976
|
+
case "stringArray":
|
|
1977
|
+
return node.children.map((child) => child.value || "");
|
|
1978
|
+
case "array": {
|
|
1979
|
+
if (field2.itemObjectType && API_TYPES[field2.itemObjectType]) {
|
|
1980
|
+
return node.children.map((child) => {
|
|
1981
|
+
const itemField = { name: field2.itemObjectType, type: "object", objectType: field2.itemObjectType };
|
|
1982
|
+
return parseFieldValue(child, itemField);
|
|
1983
|
+
});
|
|
1984
|
+
}
|
|
1985
|
+
if (field2.itemType) {
|
|
1986
|
+
return node.children.map((child) => {
|
|
1987
|
+
const value = autoParseField(child);
|
|
1988
|
+
if (typeof value === "string") {
|
|
1989
|
+
switch (field2.itemType) {
|
|
1990
|
+
case "int":
|
|
1991
|
+
return parseInt(value, 10) || 0;
|
|
1992
|
+
case "double":
|
|
1993
|
+
case "number":
|
|
1994
|
+
return parseFloat(value) || 0;
|
|
1995
|
+
case "boolean":
|
|
1996
|
+
return value === "true";
|
|
1997
|
+
default:
|
|
1998
|
+
return value;
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
return value;
|
|
2002
|
+
});
|
|
2003
|
+
}
|
|
2004
|
+
return node.children.map((child) => autoParseField(child));
|
|
2005
|
+
}
|
|
2006
|
+
case "object": {
|
|
2007
|
+
const obj = {};
|
|
2008
|
+
if (field2.objectType && API_TYPES[field2.objectType]) {
|
|
2009
|
+
const objFields = API_TYPES[field2.objectType];
|
|
2010
|
+
const byTag = /* @__PURE__ */ new Map();
|
|
2011
|
+
const byVarname = /* @__PURE__ */ new Map();
|
|
2012
|
+
for (const f of objFields) {
|
|
2013
|
+
byTag.set(f.name, f);
|
|
2014
|
+
byTag.set(f.xmlTag || f.name, f);
|
|
2015
|
+
if (f.varname) byVarname.set(f.varname, f);
|
|
2016
|
+
}
|
|
2017
|
+
for (const child of node.children) {
|
|
2018
|
+
const f = byTag.get(child.name) || (child.attributes.varname ? byVarname.get(child.attributes.varname) : void 0);
|
|
2019
|
+
if (f) {
|
|
2020
|
+
obj[f.name] = parseFieldValue(child, f);
|
|
2021
|
+
} else {
|
|
2022
|
+
const key = child.attributes.varname || child.name;
|
|
2023
|
+
obj[key] = autoParseField(child);
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
return obj;
|
|
2027
|
+
}
|
|
2028
|
+
for (const child of node.children) {
|
|
2029
|
+
const key = child.attributes.varname || child.name;
|
|
2030
|
+
obj[key] = autoParseField(child);
|
|
2031
|
+
}
|
|
2032
|
+
return obj;
|
|
2033
|
+
}
|
|
2034
|
+
case "stringMap": {
|
|
2035
|
+
const parsed = parseMapNode(node, {
|
|
2036
|
+
keyField: { name: "key", type: "string" },
|
|
2037
|
+
valueField: { name: "value", type: "string" }
|
|
2038
|
+
});
|
|
2039
|
+
return parsed;
|
|
2040
|
+
}
|
|
2041
|
+
case "map": {
|
|
2042
|
+
const keyField = inferMapFieldDefinition(field2.varkeytype);
|
|
2043
|
+
const valueField = inferMapFieldDefinition(field2.vartype);
|
|
2044
|
+
const parsed = parseMapNode(node, { keyField, valueField });
|
|
2045
|
+
if (field2.vartype === "MetaValuesList") {
|
|
2046
|
+
const unwrapped = {};
|
|
2047
|
+
for (const [k, v] of Object.entries(parsed)) {
|
|
2048
|
+
if (v && typeof v === "object" && "metaValues" in v && Array.isArray(v.metaValues)) {
|
|
2049
|
+
unwrapped[k] = v.metaValues;
|
|
2050
|
+
} else {
|
|
2051
|
+
unwrapped[k] = v;
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
return unwrapped;
|
|
2055
|
+
}
|
|
2056
|
+
return parsed;
|
|
2057
|
+
}
|
|
2058
|
+
default:
|
|
2059
|
+
return node.value;
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
function inferMapFieldDefinition(typeName) {
|
|
2063
|
+
if (!typeName) return void 0;
|
|
2064
|
+
if (API_TYPES[typeName]) {
|
|
2065
|
+
return { name: typeName, type: "object", objectType: typeName };
|
|
2066
|
+
}
|
|
2067
|
+
switch (typeName) {
|
|
2068
|
+
case "AlpTString":
|
|
2069
|
+
case "string":
|
|
2070
|
+
return { name: typeName, type: "string" };
|
|
2071
|
+
case "double":
|
|
2072
|
+
case "number":
|
|
2073
|
+
return { name: typeName, type: "double" };
|
|
2074
|
+
case "int":
|
|
2075
|
+
return { name: typeName, type: "int" };
|
|
2076
|
+
case "boolean":
|
|
2077
|
+
case "bool":
|
|
2078
|
+
return { name: typeName, type: "boolean" };
|
|
2079
|
+
case "stringArray":
|
|
2080
|
+
return { name: typeName, type: "stringArray" };
|
|
2081
|
+
default:
|
|
2082
|
+
return void 0;
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
function parseMapNode(node, opts = {}) {
|
|
2086
|
+
const result = {};
|
|
2087
|
+
const children = node.children;
|
|
2088
|
+
const tryUnwrapMetaValuesListLike = (value) => {
|
|
2089
|
+
const normalizeToStrings = (v) => {
|
|
2090
|
+
if (typeof v === "string") return [v];
|
|
2091
|
+
if (Array.isArray(v)) return v.filter((x) => typeof x === "string");
|
|
2092
|
+
return [];
|
|
2093
|
+
};
|
|
2094
|
+
const unwrapObject = (obj) => {
|
|
2095
|
+
if (!obj || typeof obj !== "object") return null;
|
|
2096
|
+
if (!("metaValues" in obj)) return null;
|
|
2097
|
+
return normalizeToStrings(obj.metaValues);
|
|
2098
|
+
};
|
|
2099
|
+
const direct = unwrapObject(value);
|
|
2100
|
+
if (direct) {
|
|
2101
|
+
return direct.length === 1 ? direct[0] : direct;
|
|
2102
|
+
}
|
|
2103
|
+
if (Array.isArray(value) && value.length > 0) {
|
|
2104
|
+
const all = value.map((v) => unwrapObject(v)).filter((v) => Array.isArray(v));
|
|
2105
|
+
if (all.length === value.length) {
|
|
2106
|
+
const flattened = all.flat();
|
|
2107
|
+
if (flattened.length === 1) return flattened[0];
|
|
2108
|
+
return flattened;
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
return value;
|
|
2112
|
+
};
|
|
2113
|
+
for (let i = 0; i + 1 < children.length; i += 2) {
|
|
2114
|
+
const keyNode = children[i];
|
|
2115
|
+
const valueNode = children[i + 1];
|
|
2116
|
+
const parsedKey = opts.keyField ? parseFieldValue(keyNode, opts.keyField) : autoParseField(keyNode);
|
|
2117
|
+
const key = typeof parsedKey === "string" ? parsedKey : String(parsedKey);
|
|
2118
|
+
if (!key) continue;
|
|
2119
|
+
let value = opts.valueField ? parseFieldValue(valueNode, opts.valueField) : autoParseField(valueNode);
|
|
2120
|
+
if (!opts.valueField) {
|
|
2121
|
+
value = tryUnwrapMetaValuesListLike(value);
|
|
2122
|
+
}
|
|
2123
|
+
result[key] = value;
|
|
2124
|
+
}
|
|
2125
|
+
return result;
|
|
2126
|
+
}
|
|
2127
|
+
function autoParseField(node) {
|
|
2128
|
+
const keytype = node.attributes.keytype;
|
|
2129
|
+
const hasChildren = node.children.length > 0;
|
|
2130
|
+
const hasTextValue = node.value !== null && node.value !== void 0 && node.value !== "";
|
|
2131
|
+
const parseObjectArray = (children) => {
|
|
2132
|
+
return children.map((child) => {
|
|
2133
|
+
const obj = {};
|
|
2134
|
+
for (const grandChild of child.children) {
|
|
2135
|
+
const key = grandChild.attributes.varname || grandChild.name;
|
|
2136
|
+
obj[key] = autoParseField(grandChild);
|
|
2137
|
+
}
|
|
2138
|
+
return obj;
|
|
2139
|
+
});
|
|
2140
|
+
};
|
|
2141
|
+
if (keytype === "list" || keytype === "vector") {
|
|
2142
|
+
if (!hasChildren) return [];
|
|
2143
|
+
const firstChildName = node.children[0]?.name;
|
|
2144
|
+
const allSameName = !!firstChildName && node.children.every((c) => c.name === firstChildName);
|
|
2145
|
+
if (allSameName && node.children.every((c) => c.children.length > 0)) {
|
|
2146
|
+
return parseObjectArray(node.children);
|
|
2147
|
+
}
|
|
2148
|
+
if (node.children.every((c) => c.value !== null)) {
|
|
2149
|
+
return node.children.map((c) => c.value);
|
|
2150
|
+
}
|
|
2151
|
+
return node.children.map((child) => autoParseField(child));
|
|
2152
|
+
}
|
|
2153
|
+
if (keytype === "map") {
|
|
2154
|
+
return parseMapNode(node);
|
|
2155
|
+
}
|
|
2156
|
+
if (hasChildren && !hasTextValue) {
|
|
2157
|
+
if (keytype === "map") {
|
|
2158
|
+
return parseMapNode(node);
|
|
2159
|
+
}
|
|
2160
|
+
const firstChildName = node.children[0]?.name;
|
|
2161
|
+
const allSameName = !!firstChildName && node.children.every((c) => c.name === firstChildName);
|
|
2162
|
+
if (allSameName) {
|
|
2163
|
+
if (node.children.every((c) => c.children.length > 0)) {
|
|
2164
|
+
return parseObjectArray(node.children);
|
|
2165
|
+
}
|
|
2166
|
+
if (node.children.every((c) => c.value !== null)) {
|
|
2167
|
+
return node.children.map((c) => c.value);
|
|
2168
|
+
}
|
|
2169
|
+
return node.children.map((child) => autoParseField(child));
|
|
2170
|
+
}
|
|
2171
|
+
const obj = {};
|
|
2172
|
+
for (const child of node.children) {
|
|
2173
|
+
const key = child.attributes.varname || child.name;
|
|
2174
|
+
obj[key] = autoParseField(child);
|
|
2175
|
+
}
|
|
2176
|
+
return obj;
|
|
2177
|
+
}
|
|
2178
|
+
switch (keytype) {
|
|
2179
|
+
case "AlpTString":
|
|
2180
|
+
return node.value || "";
|
|
2181
|
+
case "double":
|
|
2182
|
+
return node.value ? parseFloat(node.value) : 0;
|
|
2183
|
+
case "int":
|
|
2184
|
+
case "UINT":
|
|
2185
|
+
case "DWORD":
|
|
2186
|
+
case "long":
|
|
2187
|
+
return node.value ? parseInt(node.value, 10) : 0;
|
|
2188
|
+
case "bool":
|
|
2189
|
+
return node.value === "true";
|
|
2190
|
+
default:
|
|
2191
|
+
if (node.value === null && node.children.length > 0) {
|
|
2192
|
+
const obj = {};
|
|
2193
|
+
for (const child of node.children) {
|
|
2194
|
+
obj[child.name] = autoParseField(child);
|
|
2195
|
+
}
|
|
2196
|
+
return obj;
|
|
2197
|
+
}
|
|
2198
|
+
return node.value;
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
function isExceptionResponse(xmlNode) {
|
|
2202
|
+
return xmlNode.name === "GeneralException" || xmlNode.children[0]?.children[0]?.name === "ServerActionFailedException";
|
|
2203
|
+
}
|
|
2204
|
+
function extractException(xmlNode) {
|
|
2205
|
+
if (xmlNode.name === "GeneralException") {
|
|
2206
|
+
const messageNode = xmlNode.children.find((c) => c.name === "message");
|
|
2207
|
+
const codeNode = xmlNode.children.find((c) => c.name === "code");
|
|
2208
|
+
return {
|
|
2209
|
+
code: codeNode?.value || "GENERAL_EXCEPTION",
|
|
2210
|
+
message: messageNode?.value || "Unknown error",
|
|
2211
|
+
details: autoParseField(xmlNode)
|
|
2212
|
+
};
|
|
2213
|
+
}
|
|
2214
|
+
let exceptionNode;
|
|
2215
|
+
if (xmlNode.name === "ServerActionFailedException") {
|
|
2216
|
+
exceptionNode = xmlNode;
|
|
2217
|
+
} else if (xmlNode.children[0]?.children[0]?.name === "ServerActionFailedException") {
|
|
2218
|
+
exceptionNode = xmlNode.children[0].children[0];
|
|
2219
|
+
}
|
|
2220
|
+
if (exceptionNode) {
|
|
2221
|
+
const listNode = exceptionNode.children.find((c) => c.name === "CServerActionFailedList");
|
|
2222
|
+
if (listNode) {
|
|
2223
|
+
const contentNode = listNode.children.find((c) => c.name === "content");
|
|
2224
|
+
if (contentNode) {
|
|
2225
|
+
const items = contentNode.children.map((itemNode) => {
|
|
2226
|
+
const item = {};
|
|
2227
|
+
itemNode.children.forEach((c) => {
|
|
2228
|
+
const cleanName = c.name.replace(/^(mstr_|me_|ml_|mb_)/, "");
|
|
2229
|
+
item[cleanName] = c.value;
|
|
2230
|
+
});
|
|
2231
|
+
return item;
|
|
2232
|
+
});
|
|
2233
|
+
const firstItem = items[0];
|
|
2234
|
+
return {
|
|
2235
|
+
code: firstItem?.message || "SERVER_ERROR",
|
|
2236
|
+
// me_message usually contains the error code/id
|
|
2237
|
+
message: firstItem?.message || "Server action failed",
|
|
2238
|
+
details: items
|
|
2239
|
+
};
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
const messageNode = exceptionNode.children.find((c) => c.name === "message");
|
|
2243
|
+
const codeNode = exceptionNode.children.find((c) => c.name === "errorCode");
|
|
2244
|
+
return {
|
|
2245
|
+
code: codeNode?.value || "SERVER_ERROR",
|
|
2246
|
+
message: messageNode?.value || "Server action failed",
|
|
2247
|
+
details: autoParseField(exceptionNode)
|
|
2248
|
+
};
|
|
2249
|
+
}
|
|
2250
|
+
return { code: "UNKNOWN", message: "Unknown error", details: xmlNode };
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
// src/client.ts
|
|
2254
|
+
var DEFAULT_CONFIG = {
|
|
2255
|
+
baseUrl: "http://localhost:5000",
|
|
2256
|
+
endpoint: "/api/cobrili",
|
|
2257
|
+
timeout: 3e4,
|
|
2258
|
+
headers: {},
|
|
2259
|
+
debug: false
|
|
2260
|
+
};
|
|
2261
|
+
var CobriliClient = class {
|
|
2262
|
+
constructor(config) {
|
|
2263
|
+
this.initialized = false;
|
|
2264
|
+
this.initPromise = null;
|
|
2265
|
+
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
2266
|
+
this.init();
|
|
2267
|
+
return new Proxy(this, {
|
|
2268
|
+
get: (target, prop) => {
|
|
2269
|
+
if (prop in target) {
|
|
2270
|
+
return target[prop];
|
|
2271
|
+
}
|
|
2272
|
+
if (typeof prop === "string" && prop in API_METHODS) {
|
|
2273
|
+
return (params) => target.call(prop, params);
|
|
2274
|
+
}
|
|
2275
|
+
return void 0;
|
|
2276
|
+
}
|
|
2277
|
+
});
|
|
2278
|
+
}
|
|
2279
|
+
unwrapSuccessPayload(payload) {
|
|
2280
|
+
if (!payload || typeof payload !== "object") return payload;
|
|
2281
|
+
const record = payload;
|
|
2282
|
+
const unwrapSingleItemArray = (value) => {
|
|
2283
|
+
if (Array.isArray(value) && value.length === 1) return value[0];
|
|
2284
|
+
return value;
|
|
2285
|
+
};
|
|
2286
|
+
if ("SuccessObject" in record) {
|
|
2287
|
+
return unwrapSingleItemArray(record.SuccessObject);
|
|
2288
|
+
}
|
|
2289
|
+
const keys = Object.keys(record);
|
|
2290
|
+
if (keys.length === 1) {
|
|
2291
|
+
const key = keys[0];
|
|
2292
|
+
const value = record[key];
|
|
2293
|
+
const looksLikeSuccessWrapper = /(^|Response)Success$/.test(key) && key !== "success";
|
|
2294
|
+
if (looksLikeSuccessWrapper && typeof value !== "boolean") {
|
|
2295
|
+
return unwrapSingleItemArray(value);
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
return payload;
|
|
2299
|
+
}
|
|
2300
|
+
setConfig(config) {
|
|
2301
|
+
this.config = { ...this.config, ...config };
|
|
2302
|
+
}
|
|
2303
|
+
getConfig() {
|
|
2304
|
+
return { ...this.config };
|
|
2305
|
+
}
|
|
2306
|
+
/**
|
|
2307
|
+
* Initialize the Cobrili session. This is called automatically on the first API request.
|
|
2308
|
+
* You can also call it explicitly if you want to control when initialization happens.
|
|
2309
|
+
*/
|
|
2310
|
+
async init(hash = "") {
|
|
2311
|
+
if (this.initialized) {
|
|
2312
|
+
return { alreadyInitialized: true };
|
|
2313
|
+
}
|
|
2314
|
+
if (this.initPromise) {
|
|
2315
|
+
return this.initPromise;
|
|
2316
|
+
}
|
|
2317
|
+
this.initPromise = this.performInit(hash);
|
|
2318
|
+
try {
|
|
2319
|
+
const result = await this.initPromise;
|
|
2320
|
+
this.initialized = true;
|
|
2321
|
+
return result;
|
|
2322
|
+
} catch (error) {
|
|
2323
|
+
this.initPromise = null;
|
|
2324
|
+
throw error;
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
async performInit(hash) {
|
|
2328
|
+
const url = `${this.config.baseUrl}${this.config.endpoint}/init`;
|
|
2329
|
+
const response = await fetch(url, {
|
|
2330
|
+
method: "POST",
|
|
2331
|
+
headers: {
|
|
2332
|
+
"Content-Type": "application/json; charset=utf-8",
|
|
2333
|
+
...this.config.headers
|
|
2334
|
+
},
|
|
2335
|
+
credentials: "include",
|
|
2336
|
+
body: JSON.stringify(hash)
|
|
2337
|
+
});
|
|
2338
|
+
if (!response.ok) {
|
|
2339
|
+
throw new Error(`Init failed: ${response.status} ${response.statusText}`);
|
|
2340
|
+
}
|
|
2341
|
+
const initData = await response.json();
|
|
2342
|
+
this.initialized = true;
|
|
2343
|
+
return initData;
|
|
2344
|
+
}
|
|
2345
|
+
async ensureInitialized() {
|
|
2346
|
+
if (!this.initialized) {
|
|
2347
|
+
await this.init();
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
async call(methodName, params) {
|
|
2351
|
+
await this.ensureInitialized();
|
|
2352
|
+
const methodDef = API_METHODS[methodName];
|
|
2353
|
+
if (!methodDef) {
|
|
2354
|
+
return {
|
|
2355
|
+
error: {
|
|
2356
|
+
code: "INVALID_METHOD",
|
|
2357
|
+
message: `Unknown API method: ${String(methodName)}`
|
|
2358
|
+
}
|
|
2359
|
+
};
|
|
2360
|
+
}
|
|
2361
|
+
const apiMethod = methodDef.method || String(methodName).charAt(0).toUpperCase() + String(methodName).slice(1);
|
|
2362
|
+
const requestType = methodDef.requestType || `${apiMethod}Request`;
|
|
2363
|
+
try {
|
|
2364
|
+
const requestNode = createRequestXml("CobriliData", requestType, methodDef.requestFields, params);
|
|
2365
|
+
const xmlRequest = serializeXml(requestNode);
|
|
2366
|
+
const jsonPayload = JSON.stringify({
|
|
2367
|
+
methodName: apiMethod,
|
|
2368
|
+
requestData: xmlRequest
|
|
2369
|
+
});
|
|
2370
|
+
const response = await this.sendHttpRequest(apiMethod, jsonPayload);
|
|
2371
|
+
try {
|
|
2372
|
+
const xmlNode = parseXml(response);
|
|
2373
|
+
if (isExceptionResponse(xmlNode)) {
|
|
2374
|
+
const exception = extractException(xmlNode);
|
|
2375
|
+
return {
|
|
2376
|
+
error: {
|
|
2377
|
+
code: exception.code,
|
|
2378
|
+
message: exception.message,
|
|
2379
|
+
details: exception.details
|
|
2380
|
+
}
|
|
2381
|
+
};
|
|
2382
|
+
}
|
|
2383
|
+
const parsedResponse = parseResponseXml(xmlNode, methodDef.responseFields);
|
|
2384
|
+
const unwrapped = this.unwrapSuccessPayload(parsedResponse);
|
|
2385
|
+
return { data: unwrapped };
|
|
2386
|
+
} catch (parseError) {
|
|
2387
|
+
return {
|
|
2388
|
+
error: {
|
|
2389
|
+
code: "PARSE_ERROR",
|
|
2390
|
+
message: parseError instanceof Error ? parseError.message : "Failed to parse XML response",
|
|
2391
|
+
details: response
|
|
2392
|
+
}
|
|
2393
|
+
};
|
|
2394
|
+
}
|
|
2395
|
+
} catch (error) {
|
|
2396
|
+
return {
|
|
2397
|
+
error: {
|
|
2398
|
+
code: "CLIENT_ERROR",
|
|
2399
|
+
message: error instanceof Error ? error.message : String(error)
|
|
2400
|
+
}
|
|
2401
|
+
};
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
async sendHttpRequest(method, body) {
|
|
2405
|
+
const controller = new AbortController();
|
|
2406
|
+
const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);
|
|
2407
|
+
try {
|
|
2408
|
+
const response = await fetch(`${this.config.baseUrl}${this.config.endpoint}?method=${method}`, {
|
|
2409
|
+
method: "POST",
|
|
2410
|
+
headers: {
|
|
2411
|
+
"Content-Type": "application/json",
|
|
2412
|
+
...this.config.headers || {}
|
|
2413
|
+
},
|
|
2414
|
+
body,
|
|
2415
|
+
signal: controller.signal,
|
|
2416
|
+
credentials: "include"
|
|
2417
|
+
// Include cookies for session management
|
|
2418
|
+
});
|
|
2419
|
+
if (!response.ok) {
|
|
2420
|
+
throw new Error(`HTTP Error: ${response.status} ${response.statusText}`);
|
|
2421
|
+
}
|
|
2422
|
+
return await response.text();
|
|
2423
|
+
} finally {
|
|
2424
|
+
clearTimeout(timeoutId);
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
};
|
|
2428
|
+
function createCobriliClient(config) {
|
|
2429
|
+
return new CobriliClient(config);
|
|
2430
|
+
}
|
|
2431
|
+
export {
|
|
2432
|
+
API_METHODS,
|
|
2433
|
+
API_TYPES,
|
|
2434
|
+
CobriliClient,
|
|
2435
|
+
createCobriliClient,
|
|
2436
|
+
createRequestXml,
|
|
2437
|
+
escapeXml,
|
|
2438
|
+
parseResponseXml,
|
|
2439
|
+
parseXml,
|
|
2440
|
+
serializeXml,
|
|
2441
|
+
unescapeXml
|
|
2442
|
+
};
|
|
2443
|
+
//# sourceMappingURL=index.mjs.map
|