@gyldendalas/gyldendal-divine-api 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -20,6 +20,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ CookieConsentLog: () => CookieConsentLog,
24
+ HighlightResultType: () => HighlightResultType,
25
+ HighlightService: () => HighlightService,
26
+ PollyService: () => PollyService,
27
+ SSMLSpeechSpeeds: () => SSMLSpeechSpeeds,
23
28
  TaggingService: () => TaggingService,
24
29
  UserFolders: () => UserFolders,
25
30
  UserSettingsBookmarks: () => UserSettingsBookmarks,
@@ -80,55 +85,55 @@ var BaseService = class {
80
85
  async getAsync({
81
86
  url,
82
87
  headers,
88
+ addAuthHeaders = true,
83
89
  timeout
84
90
  }) {
85
91
  const method = "GET";
86
- const response = await this.callAsync({ url, body: null, method, headers, timeout });
87
- return response.json();
92
+ return await this.callAsync({ url, body: null, method, headers, addAuthHeaders, timeout });
88
93
  }
89
94
  async putAsync({
90
95
  url,
91
96
  headers,
97
+ addAuthHeaders = true,
92
98
  body,
93
99
  timeout
94
100
  }) {
95
101
  const method = "PUT";
96
- const response = await this.callAsync({ url, body, method, headers, timeout });
97
- return response.json();
102
+ return await this.callAsync({ url, body, method, headers, addAuthHeaders, timeout });
98
103
  }
99
104
  async postAsync({
100
105
  url,
101
106
  headers,
107
+ addAuthHeaders = true,
102
108
  body,
103
109
  timeout
104
110
  }) {
105
111
  const method = "POST";
106
- const response = await this.callAsync({ url, body, method, headers, timeout });
107
- return response.json();
112
+ return await this.callAsync({ url, body, method, headers, addAuthHeaders, timeout });
108
113
  }
109
114
  async deleteAsync({
110
115
  url,
111
116
  headers,
117
+ addAuthHeaders = true,
112
118
  timeout
113
119
  }) {
114
120
  const method = "DELETE";
115
- const response = await this.callAsync({ url, body: null, method, headers, timeout });
116
- if (response.status === 204) {
117
- return {};
118
- }
119
- return response.json();
121
+ return await this.callAsync({ url, body: null, method, headers, addAuthHeaders, timeout });
120
122
  }
121
123
  async callAsync({
122
124
  url,
123
125
  body,
124
126
  method,
125
127
  headers,
126
- timeout
128
+ timeout,
129
+ addAuthHeaders
127
130
  }) {
128
131
  if (!headers) {
129
132
  headers = new Headers();
130
133
  }
131
- headers = await this.addAuthHeaders(headers);
134
+ if (addAuthHeaders) {
135
+ headers = await this.addAuthHeaders(headers);
136
+ }
132
137
  const response = await fetch(url, {
133
138
  method,
134
139
  body,
@@ -165,7 +170,8 @@ var TaggingService = class extends base_service_default {
165
170
  }) {
166
171
  const url = `${this.getUrlPrefix()}/tags/by_resource/${identity}${resource_type ? `/${resource_type}` : ""}${resource_name ? `/${resource_name}` : ""}${tag_name ? `/${tag_name}` : ""}`;
167
172
  const headers = new Headers();
168
- return await this.getAsync({ url, headers, timeout });
173
+ const response = await this.getAsync({ url, headers, timeout });
174
+ return response.json();
169
175
  }
170
176
  async getTagsByName({
171
177
  identity,
@@ -176,7 +182,8 @@ var TaggingService = class extends base_service_default {
176
182
  }) {
177
183
  const url = `${this.getUrlPrefix()}/tags/by_tag_name/${identity}/${tag_name}${resource_type ? `/${resource_type}` : ""}${resource_name ? `/${resource_name}` : ""}`;
178
184
  const headers = new Headers();
179
- return await this.getAsync({ url, headers, timeout });
185
+ const response = await this.getAsync({ url, headers, timeout });
186
+ return await response.json();
180
187
  }
181
188
  async createTag({
182
189
  tag,
@@ -185,7 +192,8 @@ var TaggingService = class extends base_service_default {
185
192
  const url = `${this.getUrlPrefix()}/tags`;
186
193
  const headers = new Headers();
187
194
  headers.append("Content-Type", "application/json");
188
- return await this.postAsync({ url, headers, body: JSON.stringify(tag), timeout });
195
+ const response = await this.postAsync({ url, headers, body: JSON.stringify(tag), timeout });
196
+ return await response.json();
189
197
  }
190
198
  async updateTag({
191
199
  tag,
@@ -194,7 +202,8 @@ var TaggingService = class extends base_service_default {
194
202
  const url = `${this.getUrlPrefix()}/tags`;
195
203
  const headers = new Headers();
196
204
  headers.append("Content-Type", "application/json");
197
- return await this.putAsync({ url, headers, body: JSON.stringify(tag), timeout });
205
+ const response = await this.putAsync({ url, headers, body: JSON.stringify(tag), timeout });
206
+ return await response.json();
198
207
  }
199
208
  async deleteTag({
200
209
  identity,
@@ -205,11 +214,163 @@ var TaggingService = class extends base_service_default {
205
214
  }) {
206
215
  const url = `${this.getUrlPrefix()}/tags/${identity}${resource_type ? `/${resource_type}` : ""}${resource_name ? `/${resource_name}` : ""}${tag_name ? `/${tag_name}` : ""}`;
207
216
  const headers = new Headers();
208
- await this.deleteAsync({ url, headers, timeout });
217
+ const response = await this.deleteAsync({ url, headers, timeout });
218
+ await response.json();
219
+ return;
209
220
  }
210
221
  };
211
222
  var tagging_service_default = TaggingService;
212
223
 
224
+ // src/services/polly_service.ts
225
+ var SSMLSpeechSpeeds = /* @__PURE__ */ ((SSMLSpeechSpeeds2) => {
226
+ SSMLSpeechSpeeds2[SSMLSpeechSpeeds2["X_SLOW"] = 1] = "X_SLOW";
227
+ SSMLSpeechSpeeds2[SSMLSpeechSpeeds2["SLOW"] = 2] = "SLOW";
228
+ SSMLSpeechSpeeds2[SSMLSpeechSpeeds2["MEDIUM"] = 3] = "MEDIUM";
229
+ SSMLSpeechSpeeds2[SSMLSpeechSpeeds2["FAST"] = 4] = "FAST";
230
+ SSMLSpeechSpeeds2[SSMLSpeechSpeeds2["X_FAST"] = 5] = "X_FAST";
231
+ return SSMLSpeechSpeeds2;
232
+ })(SSMLSpeechSpeeds || {});
233
+ var PollyService = class extends base_service_default {
234
+ discoverUrlPrefix() {
235
+ switch (this.environment) {
236
+ case "production":
237
+ return `https://appear-polly.services.${this.baseDomain}`;
238
+ case "development":
239
+ case "local":
240
+ return `https://staging-appear-polly.services.${this.baseDomain}`;
241
+ default:
242
+ throw new Error(`Unknown environment: ${this.environment}`);
243
+ }
244
+ }
245
+ async synthesize({
246
+ body,
247
+ timeout = 3e3
248
+ }) {
249
+ const url = `${this.getUrlPrefix()}/synthesizeSpeech`;
250
+ const headers = new Headers();
251
+ headers.append("Content-Type", "application/json");
252
+ const response = await this.postAsync({ url, headers, body: JSON.stringify(body), timeout });
253
+ return response.json();
254
+ }
255
+ };
256
+
257
+ // src/services/cookie_consent_log.ts
258
+ var CookieConsentLog = class extends base_service_default {
259
+ discoverUrlPrefix() {
260
+ switch (this.environment) {
261
+ case "production":
262
+ return `https://cookieconsentlog.services.${this.baseDomain}`;
263
+ case "development":
264
+ case "local":
265
+ return `https://staging-cookieconsentlog.services.${this.baseDomain}`;
266
+ default:
267
+ throw new Error(`Unknown environment: ${this.environment}`);
268
+ }
269
+ }
270
+ async logCookieConsent({
271
+ body,
272
+ timeout = 3e3
273
+ }) {
274
+ const url = `${this.getUrlPrefix()}/log`;
275
+ const headers = new Headers();
276
+ headers.append("Content-Type", "application/json");
277
+ const response = await this.postAsync({ url, headers, body: JSON.stringify(body), addAuthHeaders: false, timeout });
278
+ return response.text();
279
+ }
280
+ };
281
+
282
+ // src/services/highlight_service.ts
283
+ var HighlightResultType = /* @__PURE__ */ ((HighlightResultType2) => {
284
+ HighlightResultType2["highlight"] = "highlight";
285
+ HighlightResultType2["note"] = "note";
286
+ return HighlightResultType2;
287
+ })(HighlightResultType || {});
288
+ var HighlightService = class extends base_service_default {
289
+ discoverUrlPrefix() {
290
+ switch (this.environment) {
291
+ case "production":
292
+ return `https://highlights.services.${this.baseDomain}`;
293
+ case "development":
294
+ case "local":
295
+ return `https://staging-highlights.services.${this.baseDomain}`;
296
+ default:
297
+ throw new Error(`Unknown environment: ${this.environment}`);
298
+ }
299
+ }
300
+ async search({
301
+ search,
302
+ timeout = 3e3
303
+ }) {
304
+ const url = `${this.getUrlPrefix()}/v2/search`;
305
+ const headers = new Headers();
306
+ headers.append("Content-Type", "application/json");
307
+ const response = await this.postAsync({ url, headers, body: JSON.stringify(search), timeout });
308
+ return response.json();
309
+ }
310
+ async deleteHighlightOrNote({
311
+ isbn,
312
+ pid,
313
+ key,
314
+ timeout = 3e3
315
+ }) {
316
+ const url = `${this.getUrlPrefix()}/v2/isbn/${isbn}/pid/${pid}/key/${key}`;
317
+ const headers = new Headers();
318
+ headers.append("Content-Type", "application/json");
319
+ const response = await this.deleteAsync({ url, headers, timeout });
320
+ return response.json();
321
+ }
322
+ async getHighlightOrNote({
323
+ isbn,
324
+ pid,
325
+ timeout = 3e3
326
+ }) {
327
+ let url = `${this.getUrlPrefix()}/v2/isbn/${isbn}`;
328
+ if (pid) {
329
+ url += `/pid/${pid}`;
330
+ }
331
+ const headers = new Headers();
332
+ const response = await this.getAsync({ url, headers, timeout });
333
+ return response.json();
334
+ }
335
+ async getHighlightOrNoteCounts({
336
+ noteType,
337
+ timeout = 3e3
338
+ }) {
339
+ let url = `${this.getUrlPrefix()}/v2/count`;
340
+ if (noteType) {
341
+ url += `/${noteType}`;
342
+ }
343
+ const headers = new Headers();
344
+ const response = await this.getAsync({ url, headers, timeout });
345
+ return response.json();
346
+ }
347
+ async updateHighlightOrNote({
348
+ payload,
349
+ isbn,
350
+ pid,
351
+ key,
352
+ timeout = 5e3
353
+ }) {
354
+ const url = `${this.getUrlPrefix()}/v2/isbn/${isbn}/pid/${pid}/key/${key}`;
355
+ const headers = new Headers();
356
+ headers.set("Content-Type", "application/json");
357
+ const response = await this.putAsync({ url, headers, body: JSON.stringify(payload), timeout });
358
+ return response.json();
359
+ }
360
+ async addHighlightOrNote({
361
+ payload,
362
+ isbn,
363
+ pid,
364
+ timeout = 5e3
365
+ }) {
366
+ const url = `${this.getUrlPrefix()}/v2/isbn/${isbn}/pid/${pid}`;
367
+ const headers = new Headers();
368
+ headers.set("Content-Type", "application/json");
369
+ const response = await this.postAsync({ url, headers, body: JSON.stringify(payload), timeout });
370
+ return response.json();
371
+ }
372
+ };
373
+
213
374
  // src/services/user_settings_base.ts
214
375
  var UserSettingsBase = class extends base_service_default {
215
376
  discoverUrlPrefix() {
@@ -235,7 +396,8 @@ var UserSettingsClientSettings = class extends user_settings_base_default {
235
396
  const url = `${this.getUrlPrefix()}/clientsettings/isbn/${isbn}`;
236
397
  const headers = new Headers();
237
398
  try {
238
- return await this.getAsync({ url, headers, timeout });
399
+ const response = await this.getAsync({ url, headers, timeout });
400
+ return response.json();
239
401
  } catch (Error2) {
240
402
  if (Error2 instanceof HTTPError && Error2.response.status === 404) {
241
403
  return {};
@@ -252,7 +414,8 @@ var UserSettingsClientSettings = class extends user_settings_base_default {
252
414
  const url = `${this.getUrlPrefix()}/clientsettings/isbn/${isbn}`;
253
415
  const headers = new Headers();
254
416
  headers.set("Content-Type", "application/json");
255
- return await this.putAsync({ url, headers, body: JSON.stringify(settings), timeout });
417
+ const response = await this.putAsync({ url, headers, body: JSON.stringify(settings), timeout });
418
+ return response.json();
256
419
  }
257
420
  async deleteSettings({
258
421
  isbn,
@@ -279,7 +442,8 @@ var UserSettingsBookmarks = class extends user_settings_base_default {
279
442
  headers.set("external-user-id", externalUserId);
280
443
  }
281
444
  headers.set("Content-Type", "application/json");
282
- return await this.putAsync({ url, headers, body: JSON.stringify(bookmark), timeout });
445
+ const response = await this.putAsync({ url, headers, body: JSON.stringify(bookmark), timeout });
446
+ return response.json();
283
447
  }
284
448
  async deleteBookmark({
285
449
  isbn,
@@ -308,7 +472,8 @@ var UserSettingsBookmarks = class extends user_settings_base_default {
308
472
  url += `/page/${pageId}`;
309
473
  }
310
474
  const headers = new Headers();
311
- return await this.getAsync({ url, headers, timeout });
475
+ const response = await this.getAsync({ url, headers, timeout });
476
+ return response.json();
312
477
  }
313
478
  // Favourites are bookmarks that are ISBN specific, with a pageId of 0.
314
479
  async getFavourite({
@@ -316,7 +481,8 @@ var UserSettingsBookmarks = class extends user_settings_base_default {
316
481
  }) {
317
482
  let url = `${this.getUrlPrefix()}/bookmark/favourite`;
318
483
  const headers = new Headers();
319
- return await this.getAsync({ url, headers, timeout });
484
+ const response = await this.getAsync({ url, headers, timeout });
485
+ return response.json();
320
486
  }
321
487
  };
322
488
 
@@ -337,7 +503,8 @@ var UserSettingsContinue = class extends user_settings_base_default {
337
503
  headers.set("external-user-id", externalUserId);
338
504
  }
339
505
  headers.set("Content-Type", "application/json");
340
- return await this.putAsync({ url, headers, body: JSON.stringify(continueBody), timeout });
506
+ const response = await this.putAsync({ url, headers, body: JSON.stringify(continueBody), timeout });
507
+ return response.json();
341
508
  }
342
509
  async deleteContinue({
343
510
  isbn,
@@ -355,7 +522,8 @@ var UserSettingsContinue = class extends user_settings_base_default {
355
522
  let url = `${this.getUrlPrefix()}/continue/isbn/${isbn}`;
356
523
  const headers = new Headers();
357
524
  try {
358
- return await this.getAsync({ url, headers, timeout });
525
+ const response = await this.getAsync({ url, headers, timeout });
526
+ return response.json();
359
527
  } catch (Error2) {
360
528
  if (Error2 instanceof HTTPError && Error2.response.status === 404) {
361
529
  return {};
@@ -379,7 +547,8 @@ var UserSettingsMRU = class extends user_settings_base_default {
379
547
  headers.set("external-user-id", externalUserId);
380
548
  }
381
549
  headers.set("Content-Type", "application/json");
382
- return await this.postAsync({ url, headers, body: JSON.stringify(mru), timeout });
550
+ const response = await this.postAsync({ url, headers, body: JSON.stringify(mru), timeout });
551
+ return response.json();
383
552
  }
384
553
  async clearMRU({
385
554
  timeout = 5e3
@@ -394,7 +563,8 @@ var UserSettingsMRU = class extends user_settings_base_default {
394
563
  }) {
395
564
  let url = `${this.getUrlPrefix()}/mru`;
396
565
  const headers = new Headers();
397
- return await this.getAsync({ url, headers, timeout });
566
+ const response = await this.getAsync({ url, headers, timeout });
567
+ return response.json();
398
568
  }
399
569
  };
400
570
 
@@ -750,6 +920,11 @@ var UserFolders = class extends tagging_service_default {
750
920
  };
751
921
  // Annotate the CommonJS export names for ESM import in node:
752
922
  0 && (module.exports = {
923
+ CookieConsentLog,
924
+ HighlightResultType,
925
+ HighlightService,
926
+ PollyService,
927
+ SSMLSpeechSpeeds,
753
928
  TaggingService,
754
929
  UserFolders,
755
930
  UserSettingsBookmarks,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/services/base_service.ts","../src/services/tagging_service.ts","../src/services/user_settings_base.ts","../src/services/user_settings_clientsettings.ts","../src/services/user_settings_bookmarks.ts","../src/services/user_settings_continue.ts","../src/services/user_settings_mru.ts","../src/services/highlevel/tagging/user_folders.ts"],"sourcesContent":["export * from 'services/tagging_service.js';\nexport * from 'services/user_settings_clientsettings.js';\nexport * from 'services/user_settings_bookmarks.js';\nexport * from 'services/user_settings_continue.js';\nexport * from 'services/user_settings_mru.js';\nexport * from 'services/highlevel/tagging/user_folders.js';\n","export class HTTPError extends Error {\n public response: Response;\n \n constructor(message: string, response: Response) {\n super();\n this.message = message;\n this.response = response;\n }\n}\n\nexport class BaseService {\n public bearerToken: string | undefined;\n public apiKey: string | undefined;\n public serviceUrl: string | undefined;\n public environment: string;\n public myAccountId: string;\n public baseDomain: string;\n\n constructor({\n bearerToken = undefined,\n apiKey = undefined,\n serviceUrl = undefined,\n environment = 'production',\n myAccountId = 'SYSTIMEMYACCOUNT',\n baseDomain = 'systime.dk',\n } : {\n bearerToken?: string,\n apiKey?: string,\n serviceUrl?: string,\n environment: string,\n myAccountId: string,\n baseDomain?: string\n }) {\n this.bearerToken = bearerToken;\n this.apiKey = apiKey;\n this.serviceUrl = serviceUrl;\n this.environment = environment;\n this.myAccountId = myAccountId;\n this.baseDomain = baseDomain;\n }\n\n protected discoverUrlPrefix(): string {\n throw new Error('Method not implemented.');\n }\n\n public getUrlPrefix(): string {\n // If the URL has been explicitly set, return it.\n if (this.serviceUrl) {\n return this.serviceUrl;\n }\n return this.discoverUrlPrefix()\n }\n\n public async addAuthHeaders(requestHeaders: Headers): Promise<Headers> {\n if (this.bearerToken) {\n requestHeaders.set('Authorization', `Bearer ${this.bearerToken}`);\n } else if (this.apiKey) {\n requestHeaders.set('x-api-key', this.apiKey);\n }\n return requestHeaders;\n }\n\n async getAsync(\n {\n url,\n headers,\n timeout\n }:\n {\n url: URL | string,\n headers: Headers | undefined | null,\n timeout: number\n }\n ): Promise<object> {\n const method = 'GET';\n const response = await this.callAsync({ url, body: null, method, headers, timeout });\n return response.json();\n }\n\n async putAsync(\n {\n url,\n headers,\n body,\n timeout\n }:\n {\n url: URL | string,\n headers: Headers | undefined | null,\n body: string | null | undefined,\n timeout: number\n }\n ): Promise<object> {\n const method = 'PUT';\n const response = await this.callAsync({ url, body, method, headers, timeout });\n return response.json();\n }\n\n async postAsync(\n {\n url,\n headers,\n body,\n timeout\n }:\n {\n url: URL | string,\n headers: Headers | undefined | null,\n body: string | null | undefined,\n timeout: number\n }\n ): Promise<object> {\n const method = 'POST';\n const response = await this.callAsync({ url, body, method, headers, timeout });\n return response.json();\n }\n\n async deleteAsync(\n {\n url,\n headers,\n timeout\n }:\n {\n url: URL | string,\n headers: Headers | undefined | null,\n timeout: number\n }\n ): Promise<object> {\n const method = 'DELETE';\n const response = await this.callAsync({ url, body: null, method, headers, timeout });\n if (response.status === 204) {\n return {};\n }\n return response.json();\n }\n\n async callAsync(\n {\n url,\n body,\n method,\n headers,\n timeout\n }:\n {\n url: URL | string,\n body: string | null | undefined,\n method: string,\n headers: Headers | undefined | null,\n timeout: number\n }\n ): Promise<Response> {\n if (!headers) {\n headers = new Headers();\n }\n\n headers = await this.addAuthHeaders(headers);\n const response = await fetch(url, {\n\t method: method,\n body: body,\n headers: headers,\n signal: AbortSignal.timeout(timeout)\n });\n\n if (!response.ok) {\n\t\tthrow new HTTPError(`Got ${response.status} while calling ${response.url}`, response);\n }\n return response;\n }\n}\nexport default BaseService;\n","import BaseService from './base_service.js';\n\nexport interface Tag {\n identity: string;\n resource_type: string;\n resource_name: string;\n tag_name: string;\n tag_value: string;\n}\n\nexport interface TagOutput extends Tag {\n created_at: number;\n}\n\nexport class TaggingService extends BaseService {\n discoverUrlPrefix(): string {\n switch (this.environment) {\n case 'production':\n return `https://tagging.services.${this.baseDomain}`;\n case 'development':\n case 'local':\n return `https://staging-tagging.services.${this.baseDomain}`;\n default:\n throw new Error(`Unknown environment: ${this.environment}`);\n }\n };\n\n async getTagsByResource(\n {\n identity,\n resource_type,\n resource_name,\n tag_name,\n timeout = 3000\n }:\n {\n identity: string,\n tag_name?: string,\n resource_type?: string,\n resource_name?: string,\n timeout?: number\n }\n ): Promise<TagOutput[]> {\n const url = `${this.getUrlPrefix()}/tags/by_resource/${identity}${resource_type ? `/${resource_type}` : ''}${resource_name ? `/${resource_name}` : ''}${tag_name ? `/${tag_name}` : ''}`;\n\n const headers: HeadersInit = new Headers();\n return await this.getAsync({url, headers, timeout}) as TagOutput[];\n }\n\n async getTagsByName(\n {\n identity,\n resource_type,\n resource_name,\n tag_name,\n timeout = 3000\n }:\n {\n identity: string,\n tag_name: string,\n resource_type?: string,\n resource_name?: string,\n timeout?: number\n }\n ): Promise<TagOutput[]> {\n const url = `${this.getUrlPrefix()}/tags/by_tag_name/${identity}/${tag_name}${resource_type ? `/${resource_type}` : ''}${resource_name ? `/${resource_name}` : ''}`;\n\n const headers: HeadersInit = new Headers();\n return await this.getAsync({url, headers, timeout}) as TagOutput[];\n }\n\n async createTag(\n {\n tag,\n timeout = 3000\n }:\n {\n tag: Tag,\n timeout?: number\n }\n ): Promise<TagOutput> {\n const url = `${this.getUrlPrefix()}/tags`;\n const headers: HeadersInit = new Headers();\n\n headers.append('Content-Type', \"application/json\");\n return await this.postAsync({url, headers, body: JSON.stringify(tag), timeout}) as TagOutput;\n }\n\n async updateTag(\n {\n tag,\n timeout = 3000\n }:\n {\n tag: Tag,\n timeout?: number\n }\n ): Promise<TagOutput> {\n const url = `${this.getUrlPrefix()}/tags`;\n const headers: HeadersInit = new Headers();\n\n headers.append('Content-Type', \"application/json\");\n return await this.putAsync({url, headers, body: JSON.stringify(tag), timeout}) as TagOutput;\n }\n\n async deleteTag(\n {\n identity,\n resource_type,\n resource_name,\n tag_name,\n timeout = 3000\n }:\n {\n identity: string,\n resource_type?: string,\n resource_name?: string,\n tag_name?: string,\n timeout?: number\n }\n ): Promise<void> {\n const url = `${this.getUrlPrefix()}/tags/${identity}${resource_type ? `/${resource_type}` : ''}${resource_name ? `/${resource_name}` : ''}${tag_name ? `/${tag_name}` : ''}`;\n\n const headers: HeadersInit = new Headers();\n await this.deleteAsync({url, headers, timeout});\n }\n}\n\nexport default TaggingService;\n","import BaseService from './base_service.js';\n\nexport class UserSettingsBase extends BaseService {\n discoverUrlPrefix(): string {\n switch (this.environment) {\n case 'production':\n return `https://user-settings-service.services.${this.baseDomain}`;\n case 'development':\n case 'local':\n return `https://staging-user-settings-service.services.${this.baseDomain}`;\n default:\n throw new Error(`Unknown environment: ${this.environment}`);\n }\n }\n}\n\nexport default UserSettingsBase;\n","import UserSettingsBase from './user_settings_base.js';\nimport {HTTPError} from './base_service.js'\n\nexport interface ClientSettings {\n readabilities?: Readability;\n darkMode?: boolean;\n displayMode?: string;\n enableKeyboardShortcuts?: boolean;\n showBookmarks?: boolean;\n showNoteHighlights?: boolean;\n featureGalleryVersion?: number;\n readAloudStore?: ReadAloudStore;\n leftDrawerWidth?: number;\n recentSearches?: string[];\n materialListImagesView?: string;\n frontPageSections?: FrontPageSection[];\n activePublicationFilters?: ActivePublicationFilters;\n cardsView?: string;\n cardsSorting?: string;\n foldersView?: string;\n foldersSorting?: string;\n onboardingPromptTime?: string;\n}\n\nexport interface ActivePublicationFilters {\n educations?: string[];\n displaySubjects?: string[];\n categoriesNames?: string[];\n categoriesLevels?: string[];\n publishers?: string[];\n}\n\nexport interface Readability {\n letterSpacing?: number;\n lineHeight?: number;\n textSize?: number;\n fontFamily?: fontFamily;\n}\n\nexport interface fontFamily {\n name?: string;\n defaultSize?: string;\n url?: string;\n}\n\nexport interface ReadAloudStore {\n currentVoiceSelection?: currentVoiceSelection;\n currentSpeedSelection?: currentSpeedSelection;\n}\n\nexport interface currentSpeedSelection {\n speed?: number;\n text?: string;\n}\n\nexport interface currentVoiceSelection {\n voice?: number;\n gender?: number;\n language?: number;\n}\n\nexport interface FrontPageSection {\n changeable?: boolean;\n code?: string;\n enabled?: boolean;\n name?: string;\n position?: number;\n}\n\nexport class UserSettingsClientSettings extends UserSettingsBase {\n async getSettings(\n {\n isbn,\n timeout = 5000\n }:\n {\n isbn: string,\n timeout?: number\n }\n ): Promise<ClientSettings> {\n const url = `${this.getUrlPrefix()}/clientsettings/isbn/${isbn}`;\n const headers: HeadersInit = new Headers();\n\n try {\n return await this.getAsync({url, headers, timeout}) as ClientSettings;\n } catch (Error) {\n if (Error instanceof HTTPError && Error.response.status === 404) {\n return {} as ClientSettings;\n } else {\n throw HTTPError;\n }\n }\n }\n\n async setSettings(\n {\n isbn,\n settings,\n timeout = 5000\n }: \n {\n isbn: string,\n settings: ClientSettings,\n timeout?: number\n }\n ): Promise<ClientSettings> {\n const url = `${this.getUrlPrefix()}/clientsettings/isbn/${isbn}`;\n const headers: HeadersInit = new Headers();\n\n headers.set('Content-Type', 'application/json');\n return await this.putAsync({url, headers, body: JSON.stringify(settings), timeout}) as ClientSettings;\n }\n\n async deleteSettings(\n {\n isbn,\n timeout = 5000\n }: \n {\n isbn: string,\n timeout?: number\n }\n ): Promise<void> {\n const url = `${this.getUrlPrefix()}/clientsettings/isbn/${isbn}`;\n const headers: HeadersInit = new Headers();\n\n await this.deleteAsync({url, headers, timeout});\n return;\n }\n}\n\nexport default UserSettingsClientSettings;\n","import UserSettingsBase from './user_settings_base.js';\n\nexport interface Bookmark extends BookmarkUpdate {\n createdTimeStamp: number;\n isbn?: string;\n}\n\nexport interface BookmarkUpdate {\n pageId: number;\n contentId: number;\n}\n\nexport interface BookmarkResponse {\n bookmarks: Bookmark[];\n}\n\nexport class UserSettingsBookmarks extends UserSettingsBase {\n async setBookmark(\n {\n isbn,\n bookmark,\n externalUserId,\n timeout = 5000\n }:\n {\n isbn: string,\n bookmark: BookmarkUpdate,\n externalUserId?: string,\n timeout?: number\n }\n ): Promise<Bookmark> {\n const url = `${this.getUrlPrefix()}/bookmark/isbn/${isbn}`;\n const headers: HeadersInit = new Headers();\n\n if (externalUserId) {\n headers.set('external-user-id', externalUserId);\n }\n\n headers.set('Content-Type', 'application/json');\n return await this.putAsync({url, headers, body: JSON.stringify(bookmark), timeout}) as Bookmark;\n }\n\n async deleteBookmark(\n {\n isbn,\n pageId,\n contentId,\n timeout = 5000\n }:\n {\n isbn: string,\n pageId: number,\n contentId: number,\n timeout?: number\n }\n ): Promise<void> {\n const url = `${this.getUrlPrefix()}/bookmark/isbn/${isbn}/page/${pageId}/content/${contentId}`;\n const headers: HeadersInit = new Headers();\n\n await this.deleteAsync({url, headers, timeout});\n return\n }\n\n async getBookmark(\n {\n isbn,\n pageId,\n timeout = 5000\n }:\n {\n isbn?: string,\n pageId?: number,\n timeout?: number\n }\n ): Promise<BookmarkResponse> {\n if (!isbn && pageId) {\n throw new Error('The isbn parameter is required if pageId is provided.');\n }\n\n let url = `${this.getUrlPrefix()}/bookmark/`;\n if (isbn) {\n url += `isbn/${isbn}`;\n }\n\n if (pageId) {\n url += `/page/${pageId}`;\n }\n const headers: HeadersInit = new Headers();\n\n return await this.getAsync({url, headers, timeout}) as BookmarkResponse;\n }\n\n // Favourites are bookmarks that are ISBN specific, with a pageId of 0.\n async getFavourite(\n {\n timeout = 5000\n }:\n {\n timeout?: number\n }\n ): Promise<BookmarkResponse> {\n let url = `${this.getUrlPrefix()}/bookmark/favourite`;\n\n const headers: HeadersInit = new Headers();\n\n return await this.getAsync({url, headers, timeout}) as BookmarkResponse;\n }\n\n}\n\nexport default UserSettingsBookmarks;\n","import UserSettingsBase from './user_settings_base.js';\nimport {HTTPError} from './base_service.js'\n\nexport interface Continue extends ContinueUpdate {\n createdTimeStamp?: number;\n}\n\nexport interface ContinueUpdate {\n pageId: number;\n}\n\nexport class UserSettingsContinue extends UserSettingsBase {\n async setContinue(\n {\n isbn,\n pageId,\n externalUserId,\n timeout = 5000\n }:\n {\n isbn: string,\n pageId: number,\n externalUserId?: string,\n timeout?: number\n }\n ): Promise<Continue> {\n\n const continueBody: ContinueUpdate = {\n pageId\n };\n const url = `${this.getUrlPrefix()}/continue/isbn/${isbn}`;\n const headers: HeadersInit = new Headers();\n\n if (externalUserId) {\n headers.set('external-user-id', externalUserId);\n }\n\n headers.set('Content-Type', 'application/json');\n return await this.putAsync({url, headers, body: JSON.stringify(continueBody), timeout}) as Continue;\n }\n\n async deleteContinue(\n {\n isbn,\n timeout = 5000\n }:\n {\n isbn: string,\n timeout?: number\n }\n ): Promise<void> {\n const url = `${this.getUrlPrefix()}/continue/isbn/${isbn}`;\n const headers: HeadersInit = new Headers();\n\n await this.deleteAsync({url, headers, timeout});\n return\n }\n\n async getContinue(\n {\n isbn,\n timeout = 5000\n }:\n {\n isbn: string,\n timeout?: number\n }\n ): Promise<Continue> {\n let url = `${this.getUrlPrefix()}/continue/isbn/${isbn}`;\n\n const headers: HeadersInit = new Headers();\n\n try {\n return await this.getAsync({url, headers, timeout}) as Continue;\n } catch (Error) {\n if (Error instanceof HTTPError && Error.response.status === 404) {\n return {} as Continue;\n } else {\n throw HTTPError;\n }\n }\n }\n\n}\n\nexport default UserSettingsContinue;\n","import UserSettingsBase from './user_settings_base.js';\n\nexport interface MRU {\n isbn: string;\n link: string;\n title: string;\n}\n\nexport class UserSettingsMRU extends UserSettingsBase {\n async setMRU(\n {\n mru,\n externalUserId,\n timeout = 5000\n }:\n {\n mru: MRU,\n externalUserId?: string,\n timeout?: number\n }\n ): Promise<MRU[]> {\n\n const url = `${this.getUrlPrefix()}/mru`;\n const headers: HeadersInit = new Headers();\n\n if (externalUserId) {\n headers.set('external-user-id', externalUserId);\n }\n\n headers.set('Content-Type', 'application/json');\n return await this.postAsync({url, headers, body: JSON.stringify(mru), timeout}) as MRU[];\n }\n\n async clearMRU(\n {\n timeout = 5000\n }:\n {\n timeout?: number\n }\n ): Promise<void> {\n const url = `${this.getUrlPrefix()}/mru`;\n const headers: HeadersInit = new Headers();\n\n await this.deleteAsync({url, headers, timeout});\n return\n }\n\n async getMRU(\n {\n timeout = 5000\n }:\n {\n timeout?: number\n }\n ): Promise<MRU[]> {\n let url = `${this.getUrlPrefix()}/mru`;\n\n const headers: HeadersInit = new Headers();\n\n return await this.getAsync({url, headers, timeout}) as MRU[];\n }\n\n}\n\nexport default UserSettingsMRU;\n","import TaggingService from '../../tagging_service.js';\nimport {v4 as uuidv4} from 'uuid';\n\nexport interface FolderObject {\n created_at: number;\n}\n\nexport interface Folder extends FolderObject {\n name: string;\n color: string;\n uuid: string;\n parent?: string;\n}\n\nexport interface FolderContent extends FolderObject {\n type: string;\n identifier: string;\n folder_uuid: string;\n}\n\n/**\n * UserFolders is a service that allows users to create folders in their account. It's built on top of the Tagging service.\n * Folders are created with a name and an optional parent folder. If no parent folder is provided, the folder is created at the root level.\n * Folders are created with a unique UUID that can be used to reference the folder in future requests. The folder properties are stored as a base64 encoded JSON string.\n**/\nexport class UserFolders extends TaggingService {\n private readonly hasNoParent: string = '-';\n private identity?: string = undefined;\n\n async getIdentity() : Promise<string> {\n if (this.identity) {\n return this.identity;\n }\n\n if (this.bearerToken) {\n const tokenParts = this.bearerToken.split('.');\n const payload = Buffer.from(tokenParts[1], 'base64').toString();\n const payloadObject = JSON.parse(payload);\n // The identity is the keyword user, the user's authns and the ekeysuserid (user) concatenated with an underscore\n // This value is enforced by the Tagging service and this is the only identity\n // that the Service will accept when invoked with a user specific bearer token.\n return `user_${payloadObject.authns}_${payloadObject.user}`;\n }\n\n throw new Error('The UserFolders service must be invoked with a valid bearer token');\n }\n\n /**\n * Create a folder.\n * @param folder_name The name of the folder.\n * @param parent_folder_uuid The UUID of the parent folder. If no parent folder is provided, the folder is created at the root level.\n * @param color The color of the folder.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return Folder\n **/\n async createFolder(\n {\n folder_name,\n parent_folder_uuid,\n color,\n timeout = 3000\n }:\n {\n folder_name: string,\n color: string,\n parent_folder_uuid?: string,\n timeout?: number\n }\n ): Promise<Folder> {\n const folder_payload = JSON.stringify({\"folder\": folder_name, \"color\": color});\n const tag = await this.createTag(\n {\n tag: {\n identity: await this.getIdentity(),\n resource_type: 'myaccount_user_folder',\n resource_name: uuidv4(),\n tag_name: parent_folder_uuid ?? this.hasNoParent,\n tag_value: Buffer.from(folder_payload).toString('base64'),\n },\n timeout\n }\n );\n return {name: folder_name, uuid: tag['resource_name'], parent: parent_folder_uuid, created_at: tag['created_at']} as Folder;\n }\n\n /**\n * Update a folder. Only name and color can be changed.\n *\n * @param folder_uuid The UUID of the folder.\n * @param folder_name The new name of the folder.\n * @param color The new color of the folder.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return Folder\n **/\n async updateFolder(\n {\n folder_uuid,\n folder_name,\n color,\n timeout = 3000\n }:\n {\n folder_uuid: string,\n folder_name?: string,\n color?: string,\n timeout?: number\n }\n ): Promise<Folder> {\n const tags = await this.getTagsByResource(\n {\n identity: await this.getIdentity(),\n resource_type: 'myaccount_user_folder',\n resource_name: folder_uuid,\n timeout\n }\n );\n\n if (tags.length === 0) {\n throw new Error(`Folder with UUID ${folder_uuid} not found`);\n }\n\n const tag = tags[0];\n const folder_payload = JSON.parse(Buffer.from(tag['tag_value'], 'base64').toString());\n const new_folder_name = folder_name ?? folder_payload['folder'];\n const new_color = color ?? folder_payload['color'];\n\n const new_folder_payload = JSON.stringify({\"folder\": new_folder_name, \"color\": new_color});\n\n const updatedTag = await this.updateTag(\n {\n tag: {\n identity: await this.getIdentity(),\n resource_type: 'myaccount_user_folder',\n resource_name: folder_uuid,\n tag_name: tag['tag_name'],\n tag_value: Buffer.from(new_folder_payload).toString('base64'),\n },\n timeout\n }\n );\n\n const parent = tag['tag_name'] === this.hasNoParent ? undefined : tag['tag_name'];\n return {name: new_folder_name, uuid: folder_uuid, parent: parent, created_at: updatedTag['created_at']} as Folder;\n }\n\n /**\n * List all folders in the user's account.\n * \n * @param timeout The timeout for the request in milliseconds.\n *\n * @return Folder[]\n **/\n async listAllFolders(\n {\n timeout = 3000\n }:\n {\n timeout?: number\n }\n ): Promise<Folder[]> {\n const tags = await this.getTagsByResource(\n {\n identity: await this.getIdentity(),\n resource_type: 'myaccount_user_folder',\n timeout\n }\n );\n\n let folders = [];\n\n for (const tag of tags) {\n const folder_payload = JSON.parse(Buffer.from(tag['tag_value'], 'base64').toString());\n folders.push(\n {\n name: folder_payload['folder'],\n color: folder_payload['color'],\n uuid: tag['resource_name'],\n parent: tag['tag_name'] === this.hasNoParent ? undefined : tag['tag_name'],\n created_at: tag['created_at']\n } as Folder\n );\n }\n\n return folders;\n }\n\n /**\n * List the next level of folders in the user's account.\n *\n * @param parent_folder_uuid The UUID of the parent folder. If no parent folder is provided, the folder is created at the root level.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return Folder[]\n **/\n async listNextFolderLevel(\n {\n parent_folder_uuid,\n timeout = 3000\n }:\n {\n parent_folder_uuid?: string,\n timeout?: number\n }\n ): Promise<Folder[]> {\n let tags;\n if (!parent_folder_uuid) {\n parent_folder_uuid = this.hasNoParent;\n }\n\n tags = await this.getTagsByName(\n {\n identity: await this.getIdentity(),\n resource_type: 'myaccount_user_folder',\n tag_name: parent_folder_uuid,\n timeout\n }\n );\n\n let folders = [];\n\n for (const tag of tags) {\n const folder_payload = JSON.parse(Buffer.from(tag['tag_value'], 'base64').toString());\n folders.push(\n {\n name: folder_payload['folder'],\n color: folder_payload['color'],\n uuid: tag['resource_name'],\n parent: tag['tag_name'] === this.hasNoParent ? undefined : tag['tag_name'],\n created_at: tag['created_at']\n } as Folder\n );\n }\n\n return folders;\n }\n\n /**\n * List the content of a folder.\n *\n * @param folder_uuid The UUID of the folder.\n * @param timeout The timeout for the request in milliseconds.\n *\n* @return (Folder | FolderContent)[]\n **/\n async getFolderContent(\n {\n folder_uuid,\n timeout = 3000\n }:\n {\n folder_uuid: string,\n timeout?: number\n }\n ): Promise<(Folder|FolderContent)[]> {\n let tags = await this.getTagsByName(\n {\n identity: await this.getIdentity(),\n tag_name: folder_uuid,\n timeout\n }\n );\n\n let content = [];\n\n for (const tag of tags) {\n if (tag['resource_type'] === 'myaccount_user_folder') {\n const folder_payload = JSON.parse(Buffer.from(tag['tag_value'], 'base64').toString());\n content.push({\n name: folder_payload['folder'],\n color: folder_payload['color'],\n uuid: tag['resource_name'],\n parent: tag['tag_name'],\n created_at: tag['created_at']\n } as Folder)\n } else {\n content.push(\n {\n type: tag['resource_type'],\n identifier: tag['resource_name'],\n folder_uuid: tag['tag_name'],\n created_at: tag['created_at']\n } as FolderContent\n );\n }\n }\n\n return content;\n }\n\n /**\n * Add a book to a folder.\n *\n * @param folder_uuid The UUID of the folder.\n * @param isbn The ISBN of the book.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return FolderContent\n **/\n async addInternetbookToFolder(\n {\n folder_uuid,\n isbn,\n timeout = 3000\n }:\n {\n folder_uuid: string,\n isbn: string,\n timeout?: number\n }\n ): Promise<FolderContent> {\n return await this.addContentToFolder(\n {\n folder_uuid,\n resource_type: 'internetbook',\n resource_name: isbn,\n timeout\n },\n );\n }\n\n /**\n * Remove a book from a folder.\n *\n * @param folder_uuid The UUID of the folder.\n * @param isbn The ISBN of the book.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return void\n **/\n async removeInternetbookFromFolder(\n {\n folder_uuid,\n isbn,\n timeout = 3000\n }:\n {\n folder_uuid: string,\n isbn: string,\n timeout?: number\n }\n ): Promise<void> {\n await this.removeContentFromFolder(\n {\n folder_uuid,\n resource_type: 'internetbook',\n resource_name: isbn,\n timeout\n },\n );\n }\n\n /**\n * Create a new folder content element.\n *\n * @param folder_uuid The UUID of the folder.\n * @param resource_name The name of the resource.\n * @param resource_type The type of the resource.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return FolderContent\n **/\n async addContentToFolder(\n {\n folder_uuid,\n resource_type,\n resource_name,\n timeout = 3000\n }:\n {\n folder_uuid: string,\n resource_name: string,\n resource_type: string,\n timeout?: number\n }\n ): Promise<FolderContent> {\n const tag = await this.createTag(\n {\n tag: {\n identity: await this.getIdentity(),\n resource_type: resource_type,\n resource_name: resource_name,\n tag_name: folder_uuid,\n tag_value: 'MYACCOUNT_USER_FOLDER'\n },\n timeout\n }\n );\n return {type: resource_type, identifier: resource_name, folder_uuid, created_at: tag['created_at']} as FolderContent;\n }\n\n /**\n * Remove a folder content element.\n *\n * @param folder_uuid The UUID of the folder.\n * @param resource_name The name of the resource.\n * @param resource_type The type of the resource.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return void\n **/\n async removeContentFromFolder(\n {\n folder_uuid,\n resource_name,\n resource_type,\n timeout = 3000\n }:\n {\n folder_uuid: string,\n resource_name: string,\n resource_type: string,\n timeout?: number\n }\n ): Promise<void> {\n await this.deleteTag(\n {\n identity: await this.getIdentity(),\n resource_type: resource_type,\n resource_name: resource_name,\n tag_name: folder_uuid,\n timeout\n }\n );\n }\n\n /**\n * Delete a folder.\n *\n * @param folder_uuid The UUID of the folder.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return void\n **/\n async deleteFolder(\n {\n folder_uuid,\n timeout = 3000\n }:\n {\n folder_uuid: string,\n timeout?: number\n }\n ): Promise<void> {\n await this.deleteTag(\n {\n identity: await this.getIdentity(),\n resource_type: 'myaccount_user_folder',\n resource_name: folder_uuid,\n timeout\n }\n );\n }\n\n /**\n * Delete all folders. Note, this will not delete the content of the folders.\n *\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return void\n **/\n async deleteAllFolders(\n {\n timeout = 3000\n }:\n {\n timeout?: number\n }\n ): Promise<void> {\n await this.deleteTag(\n {\n identity: await this.getIdentity(),\n resource_type: 'myaccount_user_folder',\n timeout\n }\n );\n }\n}\n\nexport default UserFolders;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,YAAN,cAAwB,MAAM;AAAA,EAC5B;AAAA,EAEP,YAAY,SAAiB,UAAoB;AAC/C,UAAM;AACN,SAAK,UAAU;AACf,SAAK,WAAW;AAAA,EAClB;AACF;AAEO,IAAM,cA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 {"version":3,"sources":["../src/index.ts","../src/services/base_service.ts","../src/services/tagging_service.ts","../src/services/polly_service.ts","../src/services/cookie_consent_log.ts","../src/services/highlight_service.ts","../src/services/user_settings_base.ts","../src/services/user_settings_clientsettings.ts","../src/services/user_settings_bookmarks.ts","../src/services/user_settings_continue.ts","../src/services/user_settings_mru.ts","../src/services/highlevel/tagging/user_folders.ts"],"sourcesContent":["export * from 'services/tagging_service.js';\nexport * from 'services/polly_service.js';\nexport * from 'services/cookie_consent_log.js';\nexport * from 'services/highlight_service.js';\nexport * from 'services/user_settings_clientsettings.js';\nexport * from 'services/user_settings_bookmarks.js';\nexport * from 'services/user_settings_continue.js';\nexport * from 'services/user_settings_mru.js';\nexport * from 'services/highlevel/tagging/user_folders.js';\n","export class HTTPError extends Error {\n public response: Response;\n \n constructor(message: string, response: Response) {\n super();\n this.message = message;\n this.response = response;\n }\n}\n\nexport class BaseService {\n public bearerToken: string | undefined;\n public apiKey: string | undefined;\n public serviceUrl: string | undefined;\n public environment: string;\n public myAccountId: string;\n public baseDomain: string;\n\n constructor({\n bearerToken = undefined,\n apiKey = undefined,\n serviceUrl = undefined,\n environment = 'production',\n myAccountId = 'SYSTIMEMYACCOUNT',\n baseDomain = 'systime.dk',\n } : {\n bearerToken?: string,\n apiKey?: string,\n serviceUrl?: string,\n environment: string,\n myAccountId: string,\n baseDomain?: string\n }) {\n this.bearerToken = bearerToken;\n this.apiKey = apiKey;\n this.serviceUrl = serviceUrl;\n this.environment = environment;\n this.myAccountId = myAccountId;\n this.baseDomain = baseDomain;\n }\n\n protected discoverUrlPrefix(): string {\n throw new Error('Method not implemented.');\n }\n\n public getUrlPrefix(): string {\n // If the URL has been explicitly set, return it.\n if (this.serviceUrl) {\n return this.serviceUrl;\n }\n return this.discoverUrlPrefix()\n }\n\n public async addAuthHeaders(requestHeaders: Headers): Promise<Headers> {\n if (this.bearerToken) {\n requestHeaders.set('Authorization', `Bearer ${this.bearerToken}`);\n } else if (this.apiKey) {\n requestHeaders.set('x-api-key', this.apiKey);\n }\n return requestHeaders;\n }\n\n async getAsync(\n {\n url,\n headers,\n addAuthHeaders = true,\n timeout\n }:\n {\n url: URL | string,\n headers: Headers | undefined | null,\n addAuthHeaders?: boolean,\n timeout: number\n }\n ): Promise<Response> {\n const method = 'GET';\n return await this.callAsync({ url, body: null, method, headers, addAuthHeaders, timeout });\n }\n\n async putAsync(\n {\n url,\n headers,\n addAuthHeaders = true,\n body,\n timeout\n }:\n {\n url: URL | string,\n headers: Headers | undefined | null,\n addAuthHeaders?: boolean,\n body: string | null | undefined,\n timeout: number\n }\n ): Promise<Response> {\n const method = 'PUT';\n return await this.callAsync({ url, body, method, headers, addAuthHeaders, timeout });\n }\n\n async postAsync(\n {\n url,\n headers,\n addAuthHeaders = true,\n body,\n timeout\n }:\n {\n url: URL | string,\n headers: Headers | undefined | null,\n addAuthHeaders?: boolean,\n body: string | null | undefined,\n timeout: number\n }\n ): Promise<Response> {\n const method = 'POST';\n return await this.callAsync({ url, body, method, headers, addAuthHeaders, timeout });\n }\n\n async deleteAsync(\n {\n url,\n headers,\n addAuthHeaders = true,\n timeout\n }:\n {\n url: URL | string,\n headers: Headers | undefined | null,\n addAuthHeaders?: boolean,\n timeout: number\n }\n ): Promise<Response> {\n const method = 'DELETE';\n return await this.callAsync({ url, body: null, method, headers, addAuthHeaders, timeout });\n }\n\n async callAsync(\n {\n url,\n body,\n method,\n headers,\n timeout,\n addAuthHeaders\n }:\n {\n url: URL | string,\n body: string | null | undefined,\n method: string,\n headers: Headers | undefined | null,\n timeout: number,\n addAuthHeaders?: boolean,\n }\n ): Promise<Response> {\n if (!headers) {\n headers = new Headers();\n }\n\n if (addAuthHeaders) {\n headers = await this.addAuthHeaders(headers);\n }\n\n const response = await fetch(url, {\n method: method,\n body: body,\n headers: headers,\n signal: AbortSignal.timeout(timeout)\n });\n\n if (!response.ok) {\n\t\tthrow new HTTPError(`Got ${response.status} while calling ${response.url}`, response);\n }\n return response;\n }\n}\nexport default BaseService;\n","import BaseService from './base_service.js';\n\nexport interface Tag {\n identity: string;\n resource_type: string;\n resource_name: string;\n tag_name: string;\n tag_value: string;\n}\n\nexport interface TagOutput extends Tag {\n created_at: number;\n}\n\nexport class TaggingService extends BaseService {\n discoverUrlPrefix(): string {\n switch (this.environment) {\n case 'production':\n return `https://tagging.services.${this.baseDomain}`;\n case 'development':\n case 'local':\n return `https://staging-tagging.services.${this.baseDomain}`;\n default:\n throw new Error(`Unknown environment: ${this.environment}`);\n }\n };\n\n async getTagsByResource(\n {\n identity,\n resource_type,\n resource_name,\n tag_name,\n timeout = 3000\n }:\n {\n identity: string,\n tag_name?: string,\n resource_type?: string,\n resource_name?: string,\n timeout?: number\n }\n ): Promise<TagOutput[]> {\n const url = `${this.getUrlPrefix()}/tags/by_resource/${identity}${resource_type ? `/${resource_type}` : ''}${resource_name ? `/${resource_name}` : ''}${tag_name ? `/${tag_name}` : ''}`;\n\n const headers: HeadersInit = new Headers();\n const response = await this.getAsync({url, headers, timeout});\n return response.json();\n }\n\n async getTagsByName(\n {\n identity,\n resource_type,\n resource_name,\n tag_name,\n timeout = 3000\n }:\n {\n identity: string,\n tag_name: string,\n resource_type?: string,\n resource_name?: string,\n timeout?: number\n }\n ): Promise<TagOutput[]> {\n const url = `${this.getUrlPrefix()}/tags/by_tag_name/${identity}/${tag_name}${resource_type ? `/${resource_type}` : ''}${resource_name ? `/${resource_name}` : ''}`;\n\n const headers: HeadersInit = new Headers();\n const response = await this.getAsync({url, headers, timeout});\n return await response.json();\n }\n\n async createTag(\n {\n tag,\n timeout = 3000\n }:\n {\n tag: Tag,\n timeout?: number\n }\n ): Promise<TagOutput> {\n const url = `${this.getUrlPrefix()}/tags`;\n const headers: HeadersInit = new Headers();\n\n headers.append('Content-Type', \"application/json\");\n const response = await this.postAsync({url, headers, body: JSON.stringify(tag), timeout});\n return await response.json();\n }\n\n async updateTag(\n {\n tag,\n timeout = 3000\n }:\n {\n tag: Tag,\n timeout?: number\n }\n ): Promise<TagOutput> {\n const url = `${this.getUrlPrefix()}/tags`;\n const headers: HeadersInit = new Headers();\n\n headers.append('Content-Type', \"application/json\");\n const response = await this.putAsync({url, headers, body: JSON.stringify(tag), timeout});\n return await response.json();\n }\n\n async deleteTag(\n {\n identity,\n resource_type,\n resource_name,\n tag_name,\n timeout = 3000\n }:\n {\n identity: string,\n resource_type?: string,\n resource_name?: string,\n tag_name?: string,\n timeout?: number\n }\n ): Promise<void> {\n const url = `${this.getUrlPrefix()}/tags/${identity}${resource_type ? `/${resource_type}` : ''}${resource_name ? `/${resource_name}` : ''}${tag_name ? `/${tag_name}` : ''}`;\n\n const headers: HeadersInit = new Headers();\n const response = await this.deleteAsync({url, headers, timeout});\n await response.json();\n return\n }\n}\n\nexport default TaggingService;\n","import BaseService from './base_service.js';\n\nexport enum SSMLSpeechSpeeds {\n X_SLOW = 1,\n SLOW = 2,\n MEDIUM = 3,\n FAST = 4,\n X_FAST = 5,\n}\n\nexport type SpeechmarkEvent = {\n time: number;\n type?: string;\n value: string;\n start?: number;\n end?: number;\n}\n\nexport interface SynthesisResponse {\n mp3url: string;\n s3: string[];\n SpeechMarks?: SpeechmarkEvent[];\n}\n\nexport interface SynthesisRequest {\n text: string;\n includeSpeechMarks?: boolean;\n voice: number;\n speed?: SSMLSpeechSpeeds;\n}\n\nexport class PollyService extends BaseService {\n discoverUrlPrefix(): string {\n switch (this.environment) {\n case 'production':\n return `https://appear-polly.services.${this.baseDomain}`;\n case 'development':\n case 'local':\n return `https://staging-appear-polly.services.${this.baseDomain}`;\n default:\n throw new Error(`Unknown environment: ${this.environment}`);\n }\n };\n\n async synthesize(\n {\n body,\n timeout = 3000\n }:\n {\n body: SynthesisRequest,\n timeout?: number\n }\n ): Promise<SynthesisResponse> {\n const url = `${this.getUrlPrefix()}/synthesizeSpeech`;\n\n const headers: HeadersInit = new Headers();\n\n headers.append('Content-Type', \"application/json\");\n const response = await this.postAsync({url, headers, body: JSON.stringify(body), timeout});\n return response.json();\n }\n}\n\nexport default PollyService;\n","import BaseService from './base_service.js';\n\nexport interface CookieConsentRequest {\n consentState: CookieConsentState;\n consentUrl: string;\n timeStamp: number;\n uuid: string;\n}\n\nexport interface CookieConsentState {\n func: number;\n stat: number;\n uuid: string;\n version: number;\n}\n\nexport interface CookieConsentResponse {\n response: string\n}\n\nexport class CookieConsentLog extends BaseService {\n discoverUrlPrefix(): string {\n switch (this.environment) {\n case 'production':\n return `https://cookieconsentlog.services.${this.baseDomain}`;\n case 'development':\n case 'local':\n return `https://staging-cookieconsentlog.services.${this.baseDomain}`;\n default:\n throw new Error(`Unknown environment: ${this.environment}`);\n }\n };\n\n async logCookieConsent(\n {\n body,\n timeout = 3000\n }:\n {\n body: CookieConsentRequest,\n timeout?: number\n }\n ): Promise<string> {\n const url = `${this.getUrlPrefix()}/log`;\n\n const headers: HeadersInit = new Headers();\n\n headers.append('Content-Type', \"application/json\");\n const response = await this.postAsync({url, headers, body: JSON.stringify(body), addAuthHeaders: false, timeout});\n return response.text();\n }\n\n}\n\nexport default CookieConsentLog;\n","import BaseService from './base_service.js';\n\nexport enum HighlightResultType {\n 'highlight' = 'highlight',\n 'note' = 'note',\n}\n\nexport interface HighlightRanges {\n start: number|null;\n end: number|null;\n startOffset: number;\n endOffset: number;\n}\n\nexport interface Highlight extends HighlightUpdate {\n id: string;\n recreationObject?: object;\n ranges?: HighlightRanges[];\n createdTStamp?: number;\n lang?: string;\n}\n\nexport interface HighlightRequest {\n breadCrumb: string;\n pageTitle: string;\n externalUserId?: string;\n highlight: Highlight;\n}\n\nexport interface HighlightSearchRequest {\n searchQuery: string;\n resultType?: HighlightResultType;\n isbn?: string;\n maxResults?: number;\n vectorMinConfidence?: number;\n vectorHighConfidence?: number;\n fulltextMinScore?: number;\n}\n\nexport interface HiglightSearchMatch {\n rangeKey: number;\n confidence: number;\n texttype: HighlightResultType;\n isbn: string;\n pid: number;\n returnedItem: number;\n}\n\nexport interface HighlightSearchResponse {\n Items: HighlightResponse[];\n Matches: HiglightSearchMatch[];\n}\n\nexport interface HighlightResponse extends HighlightRequest {\n debugHostname: string\n uidIsbnPidMyAccountIdPartitionKey: string;\n timestampSortKey: number;\n timeToDie: number;\n pid: number;\n uid: string;\n myAccountid: string;\n commentText: string;\n breadCrumb: string;\n quote: string;\n}\n\nexport interface HighlightUpdate {\n hlcolor: string;\n quote: string;\n text: string;\n}\n\nexport interface HighlightUpdateRequest {\n highlight: HighlightUpdate;\n}\n\nexport interface HighlightCountResponse {\n type: HighlightResultType;\n isbn: string;\n count: number;\n}\n\nexport interface HighlightDeleteResult extends HighlightUpdateResponse {\n changed: number;\n}\n\nexport interface HighlightAddResult extends HighlightUpdateResponse {\n timestampSortKey: number;\n}\n\nexport interface HighlightUpdateResponse {\n status: string;\n}\n\nexport class HighlightService extends BaseService {\n discoverUrlPrefix(): string {\n switch (this.environment) {\n case 'production':\n return `https://highlights.services.${this.baseDomain}`;\n case 'development':\n case 'local':\n return `https://staging-highlights.services.${this.baseDomain}`;\n default:\n throw new Error(`Unknown environment: ${this.environment}`);\n }\n };\n\n async search(\n {\n search,\n timeout = 3000\n }:\n {\n search: HighlightSearchRequest,\n timeout?: number\n }\n ): Promise<HighlightSearchResponse> {\n const url = `${this.getUrlPrefix()}/v2/search`;\n\n const headers: HeadersInit = new Headers();\n headers.append('Content-Type', \"application/json\");\n const response = await this.postAsync({url, headers, body: JSON.stringify(search), timeout});\n return response.json();\n }\n\n async deleteHighlightOrNote(\n {\n isbn,\n pid,\n key,\n timeout = 3000\n }:\n {\n isbn: string,\n pid: number,\n key: number,\n timeout?: number\n }\n ): Promise<HighlightDeleteResult> {\n const url = `${this.getUrlPrefix()}/v2/isbn/${isbn}/pid/${pid}/key/${key}`;\n\n const headers: HeadersInit = new Headers();\n headers.append('Content-Type', \"application/json\");\n const response = await this.deleteAsync({url, headers, timeout});\n return response.json();\n }\n\n async getHighlightOrNote(\n {\n isbn,\n pid,\n timeout = 3000\n }:\n {\n isbn: string,\n pid?: number,\n timeout?: number\n }\n ): Promise<HighlightResponse[]> {\n let url = `${this.getUrlPrefix()}/v2/isbn/${isbn}`;\n if (pid) {\n url += `/pid/${pid}`;\n }\n\n const headers: HeadersInit = new Headers();\n\n const response = await this.getAsync({url, headers, timeout});\n return response.json();\n }\n\n async getHighlightOrNoteCounts(\n {\n noteType,\n timeout = 3000\n }:\n {\n noteType?: HighlightResultType,\n timeout?: number\n }\n ): Promise<HighlightCountResponse[]> {\n let url = `${this.getUrlPrefix()}/v2/count`;\n if (noteType) {\n url += `/${noteType}`;\n }\n\n const headers: HeadersInit = new Headers();\n\n const response = await this.getAsync({url, headers, timeout});\n return response.json();\n }\n\n async updateHighlightOrNote(\n {\n payload,\n isbn,\n pid,\n key,\n timeout = 5000\n }:\n {\n payload: HighlightUpdateRequest,\n isbn: string,\n pid: number,\n key: number,\n timeout?: number\n }\n ): Promise<HighlightUpdateResponse> {\n const url = `${this.getUrlPrefix()}/v2/isbn/${isbn}/pid/${pid}/key/${key}`;\n const headers: HeadersInit = new Headers();\n\n headers.set('Content-Type', 'application/json');\n const response = await this.putAsync({url, headers, body: JSON.stringify(payload), timeout});\n return response.json();\n }\n\n async addHighlightOrNote(\n {\n payload,\n isbn,\n pid,\n timeout = 5000\n }:\n {\n payload: HighlightRequest,\n isbn: string,\n pid: number,\n timeout?: number\n }\n ): Promise<HighlightAddResult> {\n const url = `${this.getUrlPrefix()}/v2/isbn/${isbn}/pid/${pid}`;\n const headers: HeadersInit = new Headers();\n\n headers.set('Content-Type', 'application/json');\n const response = await this.postAsync({url, headers, body: JSON.stringify(payload), timeout});\n return response.json();\n }\n}\n\nexport default HighlightService;\n","import BaseService from './base_service.js';\n\nexport class UserSettingsBase extends BaseService {\n discoverUrlPrefix(): string {\n switch (this.environment) {\n case 'production':\n return `https://user-settings-service.services.${this.baseDomain}`;\n case 'development':\n case 'local':\n return `https://staging-user-settings-service.services.${this.baseDomain}`;\n default:\n throw new Error(`Unknown environment: ${this.environment}`);\n }\n }\n}\n\nexport default UserSettingsBase;\n","import UserSettingsBase from './user_settings_base.js';\nimport {HTTPError} from './base_service.js'\n\nexport interface ClientSettings {\n readabilities?: Readability;\n darkMode?: boolean;\n displayMode?: string;\n enableKeyboardShortcuts?: boolean;\n showBookmarks?: boolean;\n showNoteHighlights?: boolean;\n featureGalleryVersion?: number;\n readAloudStore?: ReadAloudStore;\n leftDrawerWidth?: number;\n recentSearches?: string[];\n materialListImagesView?: string;\n frontPageSections?: FrontPageSection[];\n activePublicationFilters?: ActivePublicationFilters;\n cardsView?: string;\n cardsSorting?: string;\n foldersView?: string;\n foldersSorting?: string;\n onboardingPromptTime?: string;\n}\n\nexport interface ActivePublicationFilters {\n educations?: string[];\n displaySubjects?: string[];\n categoriesNames?: string[];\n categoriesLevels?: string[];\n publishers?: string[];\n}\n\nexport interface Readability {\n letterSpacing?: number;\n lineHeight?: number;\n textSize?: number;\n fontFamily?: fontFamily;\n}\n\nexport interface fontFamily {\n name?: string;\n defaultSize?: string;\n url?: string;\n}\n\nexport interface ReadAloudStore {\n currentVoiceSelection?: currentVoiceSelection;\n currentSpeedSelection?: currentSpeedSelection;\n}\n\nexport interface currentSpeedSelection {\n speed?: number;\n text?: string;\n}\n\nexport interface currentVoiceSelection {\n voice?: number;\n gender?: number;\n language?: number;\n}\n\nexport interface FrontPageSection {\n changeable?: boolean;\n code?: string;\n enabled?: boolean;\n name?: string;\n position?: number;\n}\n\nexport class UserSettingsClientSettings extends UserSettingsBase {\n async getSettings(\n {\n isbn,\n timeout = 5000\n }:\n {\n isbn: string,\n timeout?: number\n }\n ): Promise<ClientSettings> {\n const url = `${this.getUrlPrefix()}/clientsettings/isbn/${isbn}`;\n const headers: HeadersInit = new Headers();\n\n try {\n const response = await this.getAsync({url, headers, timeout});\n return response.json();\n } catch (Error) {\n if (Error instanceof HTTPError && Error.response.status === 404) {\n return {} as ClientSettings;\n } else {\n throw HTTPError;\n }\n }\n }\n\n async setSettings(\n {\n isbn,\n settings,\n timeout = 5000\n }: \n {\n isbn: string,\n settings: ClientSettings,\n timeout?: number\n }\n ): Promise<ClientSettings> {\n const url = `${this.getUrlPrefix()}/clientsettings/isbn/${isbn}`;\n const headers: HeadersInit = new Headers();\n\n headers.set('Content-Type', 'application/json');\n const response = await this.putAsync({url, headers, body: JSON.stringify(settings), timeout});\n return response.json();\n }\n\n async deleteSettings(\n {\n isbn,\n timeout = 5000\n }: \n {\n isbn: string,\n timeout?: number\n }\n ): Promise<void> {\n const url = `${this.getUrlPrefix()}/clientsettings/isbn/${isbn}`;\n const headers: HeadersInit = new Headers();\n\n await this.deleteAsync({url, headers, timeout});\n return;\n }\n}\n\nexport default UserSettingsClientSettings;\n","import UserSettingsBase from './user_settings_base.js';\n\nexport interface Bookmark extends BookmarkUpdate {\n createdTimeStamp: number;\n isbn?: string;\n}\n\nexport interface BookmarkUpdate {\n pageId: number;\n contentId: number;\n}\n\nexport class UserSettingsBookmarks extends UserSettingsBase {\n async setBookmark(\n {\n isbn,\n bookmark,\n externalUserId,\n timeout = 5000\n }:\n {\n isbn: string,\n bookmark: BookmarkUpdate,\n externalUserId?: string,\n timeout?: number\n }\n ): Promise<Bookmark> {\n const url = `${this.getUrlPrefix()}/bookmark/isbn/${isbn}`;\n const headers: HeadersInit = new Headers();\n\n if (externalUserId) {\n headers.set('external-user-id', externalUserId);\n }\n\n headers.set('Content-Type', 'application/json');\n const response = await this.putAsync({url, headers, body: JSON.stringify(bookmark), timeout});\n return response.json();\n }\n\n async deleteBookmark(\n {\n isbn,\n pageId,\n contentId,\n timeout = 5000\n }:\n {\n isbn: string,\n pageId: number,\n contentId: number,\n timeout?: number\n }\n ): Promise<void> {\n const url = `${this.getUrlPrefix()}/bookmark/isbn/${isbn}/page/${pageId}/content/${contentId}`;\n const headers: HeadersInit = new Headers();\n\n await this.deleteAsync({url, headers, timeout});\n return\n }\n\n async getBookmark(\n {\n isbn,\n pageId,\n timeout = 5000\n }:\n {\n isbn?: string,\n pageId?: number,\n timeout?: number\n }\n ): Promise<Bookmark[]> {\n if (!isbn && pageId) {\n throw new Error('The isbn parameter is required if pageId is provided.');\n }\n\n let url = `${this.getUrlPrefix()}/bookmark/`;\n if (isbn) {\n url += `isbn/${isbn}`;\n }\n\n if (pageId) {\n url += `/page/${pageId}`;\n }\n const headers: HeadersInit = new Headers();\n\n const response = await this.getAsync({url, headers, timeout});\n return response.json();\n }\n\n // Favourites are bookmarks that are ISBN specific, with a pageId of 0.\n async getFavourite(\n {\n timeout = 5000\n }:\n {\n timeout?: number\n }\n ): Promise<Bookmark[]> {\n let url = `${this.getUrlPrefix()}/bookmark/favourite`;\n\n const headers: HeadersInit = new Headers();\n\n const response = await this.getAsync({url, headers, timeout});\n return response.json();\n }\n}\n\nexport default UserSettingsBookmarks;\n","import UserSettingsBase from './user_settings_base.js';\nimport {HTTPError} from './base_service.js'\n\nexport interface Continue extends ContinueUpdate {\n createdTimeStamp?: number;\n}\n\nexport interface ContinueUpdate {\n pageId: number;\n}\n\nexport class UserSettingsContinue extends UserSettingsBase {\n async setContinue(\n {\n isbn,\n pageId,\n externalUserId,\n timeout = 5000\n }:\n {\n isbn: string,\n pageId: number,\n externalUserId?: string,\n timeout?: number\n }\n ): Promise<Continue> {\n\n const continueBody: ContinueUpdate = {\n pageId\n };\n const url = `${this.getUrlPrefix()}/continue/isbn/${isbn}`;\n const headers: HeadersInit = new Headers();\n\n if (externalUserId) {\n headers.set('external-user-id', externalUserId);\n }\n\n headers.set('Content-Type', 'application/json');\n const response = await this.putAsync({url, headers, body: JSON.stringify(continueBody), timeout});\n return response.json();\n\n }\n\n async deleteContinue(\n {\n isbn,\n timeout = 5000\n }:\n {\n isbn: string,\n timeout?: number\n }\n ): Promise<void> {\n const url = `${this.getUrlPrefix()}/continue/isbn/${isbn}`;\n const headers: HeadersInit = new Headers();\n\n await this.deleteAsync({url, headers, timeout});\n return\n }\n\n async getContinue(\n {\n isbn,\n timeout = 5000\n }:\n {\n isbn: string,\n timeout?: number\n }\n ): Promise<Continue> {\n let url = `${this.getUrlPrefix()}/continue/isbn/${isbn}`;\n\n const headers: HeadersInit = new Headers();\n\n try {\n const response = await this.getAsync({url, headers, timeout});\n return response.json();\n } catch (Error) {\n if (Error instanceof HTTPError && Error.response.status === 404) {\n return {} as Continue;\n } else {\n throw HTTPError;\n }\n }\n }\n\n}\n\nexport default UserSettingsContinue;\n","import UserSettingsBase from './user_settings_base.js';\n\nexport interface MRU {\n isbn: string;\n link: string;\n title: string;\n}\n\nexport class UserSettingsMRU extends UserSettingsBase {\n async setMRU(\n {\n mru,\n externalUserId,\n timeout = 5000\n }:\n {\n mru: MRU,\n externalUserId?: string,\n timeout?: number\n }\n ): Promise<MRU[]> {\n\n const url = `${this.getUrlPrefix()}/mru`;\n const headers: HeadersInit = new Headers();\n\n if (externalUserId) {\n headers.set('external-user-id', externalUserId);\n }\n\n headers.set('Content-Type', 'application/json');\n const response = await this.postAsync({url, headers, body: JSON.stringify(mru), timeout});\n return response.json();\n }\n\n async clearMRU(\n {\n timeout = 5000\n }:\n {\n timeout?: number\n }\n ): Promise<void> {\n const url = `${this.getUrlPrefix()}/mru`;\n const headers: HeadersInit = new Headers();\n\n await this.deleteAsync({url, headers, timeout});\n return;\n }\n\n async getMRU(\n {\n timeout = 5000\n }:\n {\n timeout?: number\n }\n ): Promise<MRU[]> {\n let url = `${this.getUrlPrefix()}/mru`;\n\n const headers: HeadersInit = new Headers();\n\n const response = await this.getAsync({url, headers, timeout});\n return response.json();\n }\n}\n\nexport default UserSettingsMRU;\n","import TaggingService from '../../tagging_service.js';\nimport {v4 as uuidv4} from 'uuid';\n\nexport interface FolderObject {\n created_at: number;\n}\n\nexport interface Folder extends FolderObject {\n name: string;\n color: string;\n uuid: string;\n parent?: string;\n}\n\nexport interface FolderContent extends FolderObject {\n type: string;\n identifier: string;\n folder_uuid: string;\n}\n\n/**\n * UserFolders is a service that allows users to create folders in their account. It's built on top of the Tagging service.\n * Folders are created with a name and an optional parent folder. If no parent folder is provided, the folder is created at the root level.\n * Folders are created with a unique UUID that can be used to reference the folder in future requests. The folder properties are stored as a base64 encoded JSON string.\n**/\nexport class UserFolders extends TaggingService {\n private readonly hasNoParent: string = '-';\n private identity?: string = undefined;\n\n async getIdentity() : Promise<string> {\n if (this.identity) {\n return this.identity;\n }\n\n if (this.bearerToken) {\n const tokenParts = this.bearerToken.split('.');\n const payload = Buffer.from(tokenParts[1], 'base64').toString();\n const payloadObject = JSON.parse(payload);\n // The identity is the keyword user, the user's authns and the ekeysuserid (user) concatenated with an underscore\n // This value is enforced by the Tagging service and this is the only identity\n // that the Service will accept when invoked with a user specific bearer token.\n return `user_${payloadObject.authns}_${payloadObject.user}`;\n }\n\n throw new Error('The UserFolders service must be invoked with a valid bearer token');\n }\n\n /**\n * Create a folder.\n * @param folder_name The name of the folder.\n * @param parent_folder_uuid The UUID of the parent folder. If no parent folder is provided, the folder is created at the root level.\n * @param color The color of the folder.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return Folder\n **/\n async createFolder(\n {\n folder_name,\n parent_folder_uuid,\n color,\n timeout = 3000\n }:\n {\n folder_name: string,\n color: string,\n parent_folder_uuid?: string,\n timeout?: number\n }\n ): Promise<Folder> {\n const folder_payload = JSON.stringify({\"folder\": folder_name, \"color\": color});\n const tag = await this.createTag(\n {\n tag: {\n identity: await this.getIdentity(),\n resource_type: 'myaccount_user_folder',\n resource_name: uuidv4(),\n tag_name: parent_folder_uuid ?? this.hasNoParent,\n tag_value: Buffer.from(folder_payload).toString('base64'),\n },\n timeout\n }\n );\n return {name: folder_name, uuid: tag['resource_name'], parent: parent_folder_uuid, created_at: tag['created_at']} as Folder;\n }\n\n /**\n * Update a folder. Only name and color can be changed.\n *\n * @param folder_uuid The UUID of the folder.\n * @param folder_name The new name of the folder.\n * @param color The new color of the folder.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return Folder\n **/\n async updateFolder(\n {\n folder_uuid,\n folder_name,\n color,\n timeout = 3000\n }:\n {\n folder_uuid: string,\n folder_name?: string,\n color?: string,\n timeout?: number\n }\n ): Promise<Folder> {\n const tags = await this.getTagsByResource(\n {\n identity: await this.getIdentity(),\n resource_type: 'myaccount_user_folder',\n resource_name: folder_uuid,\n timeout\n }\n );\n\n if (tags.length === 0) {\n throw new Error(`Folder with UUID ${folder_uuid} not found`);\n }\n\n const tag = tags[0];\n const folder_payload = JSON.parse(Buffer.from(tag['tag_value'], 'base64').toString());\n const new_folder_name = folder_name ?? folder_payload['folder'];\n const new_color = color ?? folder_payload['color'];\n\n const new_folder_payload = JSON.stringify({\"folder\": new_folder_name, \"color\": new_color});\n\n const updatedTag = await this.updateTag(\n {\n tag: {\n identity: await this.getIdentity(),\n resource_type: 'myaccount_user_folder',\n resource_name: folder_uuid,\n tag_name: tag['tag_name'],\n tag_value: Buffer.from(new_folder_payload).toString('base64'),\n },\n timeout\n }\n );\n\n const parent = tag['tag_name'] === this.hasNoParent ? undefined : tag['tag_name'];\n return {name: new_folder_name, uuid: folder_uuid, parent: parent, created_at: updatedTag['created_at']} as Folder;\n }\n\n /**\n * List all folders in the user's account.\n * \n * @param timeout The timeout for the request in milliseconds.\n *\n * @return Folder[]\n **/\n async listAllFolders(\n {\n timeout = 3000\n }:\n {\n timeout?: number\n }\n ): Promise<Folder[]> {\n const tags = await this.getTagsByResource(\n {\n identity: await this.getIdentity(),\n resource_type: 'myaccount_user_folder',\n timeout\n }\n );\n\n let folders = [];\n\n for (const tag of tags) {\n const folder_payload = JSON.parse(Buffer.from(tag['tag_value'], 'base64').toString());\n folders.push(\n {\n name: folder_payload['folder'],\n color: folder_payload['color'],\n uuid: tag['resource_name'],\n parent: tag['tag_name'] === this.hasNoParent ? undefined : tag['tag_name'],\n created_at: tag['created_at']\n } as Folder\n );\n }\n\n return folders;\n }\n\n /**\n * List the next level of folders in the user's account.\n *\n * @param parent_folder_uuid The UUID of the parent folder. If no parent folder is provided, the folder is created at the root level.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return Folder[]\n **/\n async listNextFolderLevel(\n {\n parent_folder_uuid,\n timeout = 3000\n }:\n {\n parent_folder_uuid?: string,\n timeout?: number\n }\n ): Promise<Folder[]> {\n let tags;\n if (!parent_folder_uuid) {\n parent_folder_uuid = this.hasNoParent;\n }\n\n tags = await this.getTagsByName(\n {\n identity: await this.getIdentity(),\n resource_type: 'myaccount_user_folder',\n tag_name: parent_folder_uuid,\n timeout\n }\n );\n\n let folders = [];\n\n for (const tag of tags) {\n const folder_payload = JSON.parse(Buffer.from(tag['tag_value'], 'base64').toString());\n folders.push(\n {\n name: folder_payload['folder'],\n color: folder_payload['color'],\n uuid: tag['resource_name'],\n parent: tag['tag_name'] === this.hasNoParent ? undefined : tag['tag_name'],\n created_at: tag['created_at']\n } as Folder\n );\n }\n\n return folders;\n }\n\n /**\n * List the content of a folder.\n *\n * @param folder_uuid The UUID of the folder.\n * @param timeout The timeout for the request in milliseconds.\n *\n* @return (Folder | FolderContent)[]\n **/\n async getFolderContent(\n {\n folder_uuid,\n timeout = 3000\n }:\n {\n folder_uuid: string,\n timeout?: number\n }\n ): Promise<(Folder|FolderContent)[]> {\n let tags = await this.getTagsByName(\n {\n identity: await this.getIdentity(),\n tag_name: folder_uuid,\n timeout\n }\n );\n\n let content = [];\n\n for (const tag of tags) {\n if (tag['resource_type'] === 'myaccount_user_folder') {\n const folder_payload = JSON.parse(Buffer.from(tag['tag_value'], 'base64').toString());\n content.push({\n name: folder_payload['folder'],\n color: folder_payload['color'],\n uuid: tag['resource_name'],\n parent: tag['tag_name'],\n created_at: tag['created_at']\n } as Folder)\n } else {\n content.push(\n {\n type: tag['resource_type'],\n identifier: tag['resource_name'],\n folder_uuid: tag['tag_name'],\n created_at: tag['created_at']\n } as FolderContent\n );\n }\n }\n\n return content;\n }\n\n /**\n * Add a book to a folder.\n *\n * @param folder_uuid The UUID of the folder.\n * @param isbn The ISBN of the book.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return FolderContent\n **/\n async addInternetbookToFolder(\n {\n folder_uuid,\n isbn,\n timeout = 3000\n }:\n {\n folder_uuid: string,\n isbn: string,\n timeout?: number\n }\n ): Promise<FolderContent> {\n return await this.addContentToFolder(\n {\n folder_uuid,\n resource_type: 'internetbook',\n resource_name: isbn,\n timeout\n },\n );\n }\n\n /**\n * Remove a book from a folder.\n *\n * @param folder_uuid The UUID of the folder.\n * @param isbn The ISBN of the book.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return void\n **/\n async removeInternetbookFromFolder(\n {\n folder_uuid,\n isbn,\n timeout = 3000\n }:\n {\n folder_uuid: string,\n isbn: string,\n timeout?: number\n }\n ): Promise<void> {\n await this.removeContentFromFolder(\n {\n folder_uuid,\n resource_type: 'internetbook',\n resource_name: isbn,\n timeout\n },\n );\n }\n\n /**\n * Create a new folder content element.\n *\n * @param folder_uuid The UUID of the folder.\n * @param resource_name The name of the resource.\n * @param resource_type The type of the resource.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return FolderContent\n **/\n async addContentToFolder(\n {\n folder_uuid,\n resource_type,\n resource_name,\n timeout = 3000\n }:\n {\n folder_uuid: string,\n resource_name: string,\n resource_type: string,\n timeout?: number\n }\n ): Promise<FolderContent> {\n const tag = await this.createTag(\n {\n tag: {\n identity: await this.getIdentity(),\n resource_type: resource_type,\n resource_name: resource_name,\n tag_name: folder_uuid,\n tag_value: 'MYACCOUNT_USER_FOLDER'\n },\n timeout\n }\n );\n return {type: resource_type, identifier: resource_name, folder_uuid, created_at: tag['created_at']} as FolderContent;\n }\n\n /**\n * Remove a folder content element.\n *\n * @param folder_uuid The UUID of the folder.\n * @param resource_name The name of the resource.\n * @param resource_type The type of the resource.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return void\n **/\n async removeContentFromFolder(\n {\n folder_uuid,\n resource_name,\n resource_type,\n timeout = 3000\n }:\n {\n folder_uuid: string,\n resource_name: string,\n resource_type: string,\n timeout?: number\n }\n ): Promise<void> {\n await this.deleteTag(\n {\n identity: await this.getIdentity(),\n resource_type: resource_type,\n resource_name: resource_name,\n tag_name: folder_uuid,\n timeout\n }\n );\n }\n\n /**\n * Delete a folder.\n *\n * @param folder_uuid The UUID of the folder.\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return void\n **/\n async deleteFolder(\n {\n folder_uuid,\n timeout = 3000\n }:\n {\n folder_uuid: string,\n timeout?: number\n }\n ): Promise<void> {\n await this.deleteTag(\n {\n identity: await this.getIdentity(),\n resource_type: 'myaccount_user_folder',\n resource_name: folder_uuid,\n timeout\n }\n );\n }\n\n /**\n * Delete all folders. Note, this will not delete the content of the folders.\n *\n * @param timeout The timeout for the request in milliseconds.\n *\n * @return void\n **/\n async deleteAllFolders(\n {\n timeout = 3000\n }:\n {\n timeout?: number\n }\n ): Promise<void> {\n await this.deleteTag(\n {\n identity: await this.getIdentity(),\n resource_type: 'myaccount_user_folder',\n timeout\n }\n );\n }\n}\n\nexport default UserFolders;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,YAAN,cAAwB,MAAM;AAAA,EAC5B;AAAA,EAEP,YAAY,SAAiB,UAAoB;AAC/C,UAAM;AACN,SAAK,UAAU;AACf,SAAK,WAAW;AAAA,EAClB;AACF;AAEO,IAAM,cAAN,MAAkB;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEP,YAAY;AAAA,IACV,cAAc;AAAA,IACd,SAAS;AAAA,IACT,aAAa;AAAA,IACb,cAAc;AAAA,IACd,cAAc;AAAA,IACd,aAAa;AAAA,EACf,GAOK;AACH,SAAK,cAAc;AACnB,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,cAAc;AACnB,SAAK,cAAc;AACnB,SAAK,aAAa;AAAA,EACpB;AAAA,EAEU,oBAA4B;AACpC,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC3C;AAAA,EAEO,eAAu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