@prezly/sdk 11.9.1 → 11.11.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.
Files changed (38) hide show
  1. package/dist/api/constants.cjs +1 -1
  2. package/dist/api/constants.js +1 -1
  3. package/dist/endpoints/CampaignRecipients/Client.cjs +2 -2
  4. package/dist/endpoints/CampaignRecipients/Client.js +3 -3
  5. package/dist/endpoints/CampaignRecipients/types.d.ts +2 -2
  6. package/dist/endpoints/Campaigns/Client.cjs +2 -2
  7. package/dist/endpoints/Campaigns/Client.js +3 -3
  8. package/dist/endpoints/Campaigns/types.d.ts +2 -2
  9. package/dist/endpoints/ContactsExports/Client.cjs +3 -2
  10. package/dist/endpoints/ContactsExports/Client.js +3 -2
  11. package/dist/endpoints/ContactsExports/types.d.ts +2 -2
  12. package/dist/endpoints/Coverage/Client.cjs +2 -2
  13. package/dist/endpoints/Coverage/Client.js +3 -3
  14. package/dist/endpoints/Coverage/types.d.ts +2 -2
  15. package/dist/endpoints/NewsroomCategories/Client.cjs +2 -1
  16. package/dist/endpoints/NewsroomCategories/Client.js +2 -1
  17. package/dist/endpoints/NewsroomCategories/types.d.ts +2 -1
  18. package/dist/endpoints/NewsroomGalleries/Client.cjs +2 -2
  19. package/dist/endpoints/NewsroomGalleries/Client.js +3 -3
  20. package/dist/endpoints/NewsroomGalleries/types.d.ts +2 -2
  21. package/dist/endpoints/NewsroomLanguages/Client.cjs +2 -1
  22. package/dist/endpoints/NewsroomLanguages/Client.js +2 -1
  23. package/dist/endpoints/NewsroomLanguages/types.d.ts +25 -3
  24. package/dist/endpoints/Newsrooms/Client.cjs +2 -2
  25. package/dist/endpoints/Newsrooms/Client.js +3 -3
  26. package/dist/endpoints/Newsrooms/types.d.ts +3 -2
  27. package/dist/endpoints/Stories/Client.cjs +3 -2
  28. package/dist/endpoints/Stories/Client.js +3 -2
  29. package/dist/endpoints/Stories/types.d.ts +2 -2
  30. package/dist/types/Newsroom.d.ts +1 -0
  31. package/dist/types/NewsroomCompanyInformation.d.ts +2 -9
  32. package/dist/types/SortOrder.cjs +131 -0
  33. package/dist/types/SortOrder.d.ts +22 -0
  34. package/dist/types/SortOrder.js +124 -0
  35. package/dist/types/index.cjs +10 -0
  36. package/dist/types/index.d.ts +1 -0
  37. package/dist/types/index.js +1 -0
  38. package/package.json +1 -1
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DEFAULT_USER_AGENT = void 0;
7
- const VERSION = "11.9.0";
7
+ const VERSION = "11.10.0";
8
8
  const URL = 'https://github.com/prezly/javascript-sdk';
9
9
  const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
10
10
  exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT;
@@ -1,3 +1,3 @@
1
- const VERSION = "11.9.0";
1
+ const VERSION = "11.10.0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
3
3
  export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
@@ -21,7 +21,7 @@ class Client {
21
21
  query: {
22
22
  limit,
23
23
  offset,
24
- sort: sortOrder
24
+ sort: _index.SortOrder.stringify(sortOrder)
25
25
  }
26
26
  });
27
27
  }
@@ -37,7 +37,7 @@ class Client {
37
37
  return this.apiClient.get(url, {
38
38
  query: {
39
39
  query: _index.Query.stringify(query),
40
- sort: sortOrder,
40
+ sort: _index.SortOrder.stringify(sortOrder),
41
41
  limit,
42
42
  offset
43
43
  }
@@ -1,5 +1,5 @@
1
1
  import { routing } from "../../routing.js";
2
- import { Query } from "../../types/index.js";
2
+ import { Query, SortOrder } from "../../types/index.js";
3
3
  export class Client {
4
4
  constructor(apiClient) {
5
5
  this.apiClient = apiClient;
@@ -15,7 +15,7 @@ export class Client {
15
15
  query: {
16
16
  limit,
17
17
  offset,
18
- sort: sortOrder
18
+ sort: SortOrder.stringify(sortOrder)
19
19
  }
20
20
  });
21
21
  }
@@ -31,7 +31,7 @@ export class Client {
31
31
  return this.apiClient.get(url, {
32
32
  query: {
33
33
  query: Query.stringify(query),
34
- sort: sortOrder,
34
+ sort: SortOrder.stringify(sortOrder),
35
35
  limit,
36
36
  offset
37
37
  }
@@ -1,8 +1,8 @@
1
- import type { EmailRecipient, Pagination, Query } from '../../types';
1
+ import type { EmailRecipient, Pagination, Query, SortOrder } from '../../types';
2
2
  export interface ListOptions {
3
3
  limit?: number;
4
4
  offset?: number;
5
- sortOrder?: string;
5
+ sortOrder?: SortOrder | string;
6
6
  }
7
7
  export interface SearchOptions extends ListOptions {
8
8
  query?: Query;
@@ -23,7 +23,7 @@ class Client {
23
23
  limit,
24
24
  offset,
25
25
  query: _index.Query.stringify(query),
26
- sort: sortOrder
26
+ sort: _index.SortOrder.stringify(sortOrder)
27
27
  }
28
28
  });
29
29
  }
@@ -39,7 +39,7 @@ class Client {
39
39
  limit,
40
40
  offset,
41
41
  query,
42
- sort: sortOrder
42
+ sort: _index.SortOrder.stringify(sortOrder)
43
43
  }
44
44
  });
45
45
  }
@@ -1,5 +1,5 @@
1
1
  import { routing } from "../../routing.js";
2
- import { Query } from "../../types/index.js";
2
+ import { Query, SortOrder } from "../../types/index.js";
3
3
  import { toIso8601 } from "../../utils.js";
4
4
  export class Client {
5
5
  constructor(apiClient) {
@@ -17,7 +17,7 @@ export class Client {
17
17
  limit,
18
18
  offset,
19
19
  query: Query.stringify(query),
20
- sort: sortOrder
20
+ sort: SortOrder.stringify(sortOrder)
21
21
  }
22
22
  });
23
23
  }
@@ -33,7 +33,7 @@ export class Client {
33
33
  limit,
34
34
  offset,
35
35
  query,
36
- sort: sortOrder
36
+ sort: SortOrder.stringify(sortOrder)
37
37
  }
38
38
  });
39
39
  }
@@ -1,4 +1,4 @@
1
- import type { Campaign, Pagination, Query, SenderAddress, Story, Warning } from '../../types';
1
+ import type { Campaign, Pagination, Query, SenderAddress, SortOrder, Story, Warning } from '../../types';
2
2
  export interface CreateRequest {
3
3
  subject?: Campaign['subject'];
4
4
  sender?: SenderAddress['id'];
@@ -31,7 +31,7 @@ export interface CampaignResponse {
31
31
  export interface ListOptions {
32
32
  limit?: number;
33
33
  offset?: number;
34
- sortOrder?: string;
34
+ sortOrder?: SortOrder | string;
35
35
  }
36
36
  export interface SearchOptions extends ListOptions {
37
37
  query?: Query;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Client = void 0;
7
7
  var _routing = require("../../routing.cjs");
8
+ var _index = require("../../types/index.cjs");
8
9
  class Client {
9
10
  constructor(apiClient) {
10
11
  this.apiClient = apiClient;
@@ -23,7 +24,7 @@ class Client {
23
24
  query: {
24
25
  limit,
25
26
  offset,
26
- sort: sortOrder
27
+ sort: _index.SortOrder.stringify(sortOrder)
27
28
  }
28
29
  });
29
30
  }
@@ -44,7 +45,7 @@ class Client {
44
45
  limit,
45
46
  offset,
46
47
  query,
47
- sort: sortOrder
48
+ sort: _index.SortOrder.stringify(sortOrder)
48
49
  }
49
50
  });
50
51
  }
@@ -1,4 +1,5 @@
1
1
  import { routing } from "../../routing.js";
2
+ import { SortOrder } from "../../types/index.js";
2
3
  export class Client {
3
4
  constructor(apiClient) {
4
5
  this.apiClient = apiClient;
@@ -17,7 +18,7 @@ export class Client {
17
18
  query: {
18
19
  limit,
19
20
  offset,
20
- sort: sortOrder
21
+ sort: SortOrder.stringify(sortOrder)
21
22
  }
22
23
  });
23
24
  }
@@ -38,7 +39,7 @@ export class Client {
38
39
  limit,
39
40
  offset,
40
41
  query,
41
- sort: sortOrder
42
+ sort: SortOrder.stringify(sortOrder)
42
43
  }
43
44
  });
44
45
  }
@@ -1,8 +1,8 @@
1
- import type { ContactsExport, ContactsScope, Pagination, Query } from '../../types';
1
+ import type { ContactsExport, ContactsScope, Pagination, Query, SortOrder } from '../../types';
2
2
  export interface ListOptions {
3
3
  limit?: number;
4
4
  offset?: number;
5
- sortOrder?: string;
5
+ sortOrder?: SortOrder | string;
6
6
  }
7
7
  export interface SearchOptions extends ListOptions {
8
8
  query?: Query;
@@ -24,7 +24,7 @@ class Client {
24
24
  include_deleted: includeDeleted ? 'on' : undefined,
25
25
  limit,
26
26
  offset,
27
- sort: sortOrder
27
+ sort: _index.SortOrder.stringify(sortOrder)
28
28
  }
29
29
  });
30
30
  }
@@ -45,7 +45,7 @@ class Client {
45
45
  query: _index.Query.stringify(query),
46
46
  limit,
47
47
  offset,
48
- sort: sortOrder
48
+ sort: _index.SortOrder.stringify(sortOrder)
49
49
  }
50
50
  });
51
51
  }
@@ -1,5 +1,5 @@
1
1
  import { routing } from "../../routing.js";
2
- import { Query } from "../../types/index.js";
2
+ import { Query, SortOrder } from "../../types/index.js";
3
3
  export class Client {
4
4
  constructor(apiClient) {
5
5
  this.apiClient = apiClient;
@@ -18,7 +18,7 @@ export class Client {
18
18
  include_deleted: includeDeleted ? 'on' : undefined,
19
19
  limit,
20
20
  offset,
21
- sort: sortOrder
21
+ sort: SortOrder.stringify(sortOrder)
22
22
  }
23
23
  });
24
24
  }
@@ -39,7 +39,7 @@ export class Client {
39
39
  query: Query.stringify(query),
40
40
  limit,
41
41
  offset,
42
- sort: sortOrder
42
+ sort: SortOrder.stringify(sortOrder)
43
43
  }
44
44
  });
45
45
  }
@@ -1,4 +1,4 @@
1
- import type { CultureRef, CountryRef, Contact, CoverageEntry, NewsroomRef, OEmbedInfo, Pagination, Story, Query } from '../../types';
1
+ import type { CultureRef, CountryRef, Contact, CoverageEntry, NewsroomRef, OEmbedInfo, Pagination, Story, Query, SortOrder } from '../../types';
2
2
  export declare type Scope = {
3
3
  story: Story['id'];
4
4
  } | null;
@@ -53,7 +53,7 @@ export interface ListOptions {
53
53
  includeDeleted?: boolean;
54
54
  limit?: number;
55
55
  offset?: number;
56
- sortOrder?: string;
56
+ sortOrder?: SortOrder | string;
57
57
  }
58
58
  export interface SearchOptions extends ListOptions {
59
59
  query?: Query;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Client = void 0;
7
7
  var _routing = require("../../routing.cjs");
8
+ var _index = require("../../types/index.cjs");
8
9
  class Client {
9
10
  constructor(apiClient) {
10
11
  this.apiClient = apiClient;
@@ -17,7 +18,7 @@ class Client {
17
18
  categories
18
19
  } = await this.apiClient.get(url, {
19
20
  query: {
20
- sort: sortOrder
21
+ sort: _index.SortOrder.stringify(sortOrder)
21
22
  }
22
23
  });
23
24
  return categories;
@@ -1,4 +1,5 @@
1
1
  import { routing } from "../../routing.js";
2
+ import { SortOrder } from "../../types/index.js";
2
3
  export class Client {
3
4
  constructor(apiClient) {
4
5
  this.apiClient = apiClient;
@@ -11,7 +12,7 @@ export class Client {
11
12
  categories
12
13
  } = await this.apiClient.get(url, {
13
14
  query: {
14
- sort: sortOrder
15
+ sort: SortOrder.stringify(sortOrder)
15
16
  }
16
17
  });
17
18
  return categories;
@@ -1,3 +1,4 @@
1
+ import type { SortOrder } from '../../types';
1
2
  export interface ListOptions {
2
3
  /**
3
4
  * Supported sort columns:
@@ -6,7 +7,7 @@ export interface ListOptions {
6
7
  * - `display_description`
7
8
  * - `stories_number`
8
9
  */
9
- sortOrder?: string;
10
+ sortOrder?: SortOrder | string;
10
11
  }
11
12
  export interface CreateRequest {
12
13
  i18n: {
@@ -24,7 +24,7 @@ class Client {
24
24
  const url = _routing.routing.newsroomGalleriesUrl.replace(':newsroom_id', String(newsroomId));
25
25
  return this.apiClient.get(url, {
26
26
  query: {
27
- sort: sortOrder,
27
+ sort: _index.SortOrder.stringify(sortOrder),
28
28
  limit: limit,
29
29
  offset: offset
30
30
  }
@@ -44,7 +44,7 @@ class Client {
44
44
  query: {
45
45
  scope: _index.Query.stringify(scope),
46
46
  query: _index.Query.stringify(query),
47
- sort: sortOrder,
47
+ sort: _index.SortOrder.stringify(sortOrder),
48
48
  limit: limit,
49
49
  offset: offset
50
50
  }
@@ -1,5 +1,5 @@
1
1
  import { routing } from "../../routing.js";
2
- import { Query } from "../../types/index.js";
2
+ import { Query, SortOrder } from "../../types/index.js";
3
3
  export class Client {
4
4
  constructor(apiClient) {
5
5
  this.apiClient = apiClient;
@@ -18,7 +18,7 @@ export class Client {
18
18
  const url = routing.newsroomGalleriesUrl.replace(':newsroom_id', String(newsroomId));
19
19
  return this.apiClient.get(url, {
20
20
  query: {
21
- sort: sortOrder,
21
+ sort: SortOrder.stringify(sortOrder),
22
22
  limit: limit,
23
23
  offset: offset
24
24
  }
@@ -38,7 +38,7 @@ export class Client {
38
38
  query: {
39
39
  scope: Query.stringify(scope),
40
40
  query: Query.stringify(query),
41
- sort: sortOrder,
41
+ sort: SortOrder.stringify(sortOrder),
42
42
  limit: limit,
43
43
  offset: offset
44
44
  }
@@ -1,8 +1,8 @@
1
- import type { NewsroomGallery, Pagination, Query } from '../../types';
1
+ import type { NewsroomGallery, Pagination, Query, SortOrder } from '../../types';
2
2
  export interface ListOptions {
3
3
  limit?: number;
4
4
  offset?: number;
5
- sortOrder?: string;
5
+ sortOrder?: SortOrder | string;
6
6
  }
7
7
  export interface SearchOptions extends ListOptions {
8
8
  scope?: Query;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Client = void 0;
7
7
  var _routing = require("../../routing.cjs");
8
+ var _index = require("../../types/index.cjs");
8
9
  var _lib = require("./lib.cjs");
9
10
  class Client {
10
11
  constructor(apiClient) {
@@ -16,7 +17,7 @@ class Client {
16
17
  const url = _routing.routing.newsroomLanguagesUrl.replace(':newsroom_id', String(newsroomId));
17
18
  return this.apiClient.get(url, {
18
19
  query: {
19
- sort: sortOrder
20
+ sort: _index.SortOrder.stringify(sortOrder)
20
21
  }
21
22
  });
22
23
  }
@@ -1,4 +1,5 @@
1
1
  import { routing } from "../../routing.js";
2
+ import { SortOrder } from "../../types/index.js";
2
3
  import { isUnsafeNewsroomUpdateErrorResponse } from "./lib.js";
3
4
  export class Client {
4
5
  constructor(apiClient) {
@@ -10,7 +11,7 @@ export class Client {
10
11
  const url = routing.newsroomLanguagesUrl.replace(':newsroom_id', String(newsroomId));
11
12
  return this.apiClient.get(url, {
12
13
  query: {
13
- sort: sortOrder
14
+ sort: SortOrder.stringify(sortOrder)
14
15
  }
15
16
  });
16
17
  }
@@ -1,6 +1,6 @@
1
- import type { CultureRef, NewsroomCompanyInformation, NewsroomLanguageSettings } from '../../types';
1
+ import type { CultureRef, NewsroomLanguageSettings, SortOrder } from '../../types';
2
2
  export interface ListOptions {
3
- sortOrder?: string;
3
+ sortOrder?: SortOrder | string;
4
4
  }
5
5
  export interface ListResponse {
6
6
  languages: NewsroomLanguageSettings[];
@@ -9,7 +9,29 @@ export interface ListResponse {
9
9
  export interface SettingsUpdateRequest {
10
10
  is_default?: true;
11
11
  code?: CultureRef['code'];
12
- company_information?: Partial<NewsroomCompanyInformation>;
12
+ company_information?: {
13
+ name?: string;
14
+ about?: string;
15
+ about_plaintext?: string;
16
+ email?: string | null;
17
+ website?: string | null;
18
+ phone?: string | null;
19
+ address?: string | null;
20
+ twitter?: string | null;
21
+ facebook?: string | null;
22
+ linkedin?: string | null;
23
+ pinterest?: string | null;
24
+ youtube?: string | null;
25
+ instagram?: string | null;
26
+ tiktok?: string | null;
27
+ email_disclaimer?: string;
28
+ cookie_statement?: string;
29
+ subscribe_disclaimer?: string;
30
+ seo_settings?: {
31
+ meta_title?: string | null;
32
+ meta_description?: string | null;
33
+ };
34
+ };
13
35
  }
14
36
  export interface UnsafeUpdateErrorResponse {
15
37
  status: 'error';
@@ -21,7 +21,7 @@ class Client {
21
21
  limit,
22
22
  offset,
23
23
  search,
24
- sort: sortOrder
24
+ sort: _index.SortOrder.stringify(sortOrder)
25
25
  }
26
26
  });
27
27
  }
@@ -40,7 +40,7 @@ class Client {
40
40
  limit,
41
41
  offset,
42
42
  search,
43
- sort: sortOrder
43
+ sort: _index.SortOrder.stringify(sortOrder)
44
44
  }
45
45
  });
46
46
  }
@@ -1,5 +1,5 @@
1
1
  import { routing } from "../../routing.js";
2
- import { Query } from "../../types/index.js";
2
+ import { Query, SortOrder } from "../../types/index.js";
3
3
  export class Client {
4
4
  constructor(apiClient) {
5
5
  this.apiClient = apiClient;
@@ -15,7 +15,7 @@ export class Client {
15
15
  limit,
16
16
  offset,
17
17
  search,
18
- sort: sortOrder
18
+ sort: SortOrder.stringify(sortOrder)
19
19
  }
20
20
  });
21
21
  }
@@ -34,7 +34,7 @@ export class Client {
34
34
  limit,
35
35
  offset,
36
36
  search,
37
- sort: sortOrder
37
+ sort: SortOrder.stringify(sortOrder)
38
38
  }
39
39
  });
40
40
  }
@@ -1,4 +1,4 @@
1
- import type { CultureRef, Newsroom, Pagination, Query } from '../../types';
1
+ import type { CultureRef, Newsroom, Pagination, Query, SortOrder } from '../../types';
2
2
  export interface ListOptions {
3
3
  limit?: number;
4
4
  offset?: number;
@@ -6,7 +6,7 @@ export interface ListOptions {
6
6
  * Text search keyword.
7
7
  */
8
8
  search?: string;
9
- sortOrder?: string;
9
+ sortOrder?: SortOrder | string;
10
10
  }
11
11
  export interface SearchOptions extends ListOptions {
12
12
  /**
@@ -64,6 +64,7 @@ export interface UpdateRequest {
64
64
  * Uploadcare Image JSON
65
65
  */
66
66
  icon?: string;
67
+ google_search_console_key?: string | null;
67
68
  google_analytics_id?: string | null;
68
69
  segment_analytics_id?: string | null;
69
70
  /**
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.Client = void 0;
7
7
  var _index = require("../../http/index.cjs");
8
8
  var _routing = require("../../routing.cjs");
9
+ var _index2 = require("../../types/index.cjs");
9
10
  class Client {
10
11
  constructor(apiClient) {
11
12
  this.apiClient = apiClient;
@@ -21,7 +22,7 @@ class Client {
21
22
  query: {
22
23
  limit,
23
24
  offset,
24
- sort: sortOrder,
25
+ sort: _index2.SortOrder.stringify(sortOrder),
25
26
  include: include ? include.join(',') : undefined
26
27
  }
27
28
  });
@@ -39,7 +40,7 @@ class Client {
39
40
  query,
40
41
  limit,
41
42
  offset,
42
- sort: sortOrder,
43
+ sort: _index2.SortOrder.stringify(sortOrder),
43
44
  include: include ? include.join(',') : undefined
44
45
  }
45
46
  });
@@ -1,5 +1,6 @@
1
1
  import { ApiError, HttpCodes } from "../../http/index.js";
2
2
  import { routing } from "../../routing.js";
3
+ import { SortOrder } from "../../types/index.js";
3
4
  export class Client {
4
5
  constructor(apiClient) {
5
6
  this.apiClient = apiClient;
@@ -15,7 +16,7 @@ export class Client {
15
16
  query: {
16
17
  limit,
17
18
  offset,
18
- sort: sortOrder,
19
+ sort: SortOrder.stringify(sortOrder),
19
20
  include: include ? include.join(',') : undefined
20
21
  }
21
22
  });
@@ -33,7 +34,7 @@ export class Client {
33
34
  query,
34
35
  limit,
35
36
  offset,
36
- sort: sortOrder,
37
+ sort: SortOrder.stringify(sortOrder),
37
38
  include: include ? include.join(',') : undefined
38
39
  }
39
40
  });
@@ -1,4 +1,4 @@
1
- import type { Category, CategoryRef, CultureRef, ExtendedStory, Newsroom, NewsroomContactRef, Pagination, Query, Story } from '../../types';
1
+ import type { Category, CategoryRef, CultureRef, ExtendedStory, Newsroom, NewsroomContactRef, Pagination, Query, SortOrder, Story } from '../../types';
2
2
  /**
3
3
  * Uploadcare image JSON string.
4
4
  */
@@ -50,7 +50,7 @@ export interface IncludeOptions<Include extends readonly (keyof Story.ExtraField
50
50
  export interface ListOptions<Include extends readonly (keyof Story.ExtraFields)[]> {
51
51
  limit?: number;
52
52
  offset?: number;
53
- sortOrder?: string;
53
+ sortOrder?: SortOrder | string;
54
54
  include?: Include;
55
55
  }
56
56
  export interface SearchOptions<Include extends readonly (keyof Story.ExtraFields)[]> extends ListOptions<Include> {
@@ -90,6 +90,7 @@ export interface Newsroom extends NewsroomRef {
90
90
  };
91
91
  ga_tracking_id: string | null;
92
92
  segment_analytics_id: string | null;
93
+ google_search_console_key: string | null;
93
94
  is_subscription_form_enabled: boolean;
94
95
  is_white_labeled: boolean;
95
96
  is_plausible_enabled: boolean;
@@ -1,3 +1,4 @@
1
+ import type { SEOSettings } from './SEOSettings';
1
2
  export interface NewsroomCompanyInformation {
2
3
  name: string;
3
4
  about: string;
@@ -13,16 +14,8 @@ export interface NewsroomCompanyInformation {
13
14
  youtube: string | null;
14
15
  instagram: string | null;
15
16
  tiktok: string | null;
16
- /**
17
- * Only admins are allowed to update this field.
18
- */
19
17
  email_disclaimer: string;
20
- /**
21
- * Only admins are allowed to update this field.
22
- */
23
18
  cookie_statement: string;
24
- /**
25
- * Only admins are allowed to update this field.
26
- */
27
19
  subscribe_disclaimer: string;
20
+ seo_settings: SEOSettings;
28
21
  }
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SortOrder = void 0;
7
+ let SortOrder;
8
+ exports.SortOrder = SortOrder;
9
+ (function (_SortOrder) {
10
+ let Direction;
11
+ (function (Direction) {
12
+ Direction["ASC"] = "asc";
13
+ Direction["DESC"] = "desc";
14
+ })(Direction || (Direction = {}));
15
+ _SortOrder.Direction = Direction;
16
+ function empty() {
17
+ return {
18
+ columns: []
19
+ };
20
+ }
21
+ _SortOrder.empty = empty;
22
+ function isEmpty(sortOrder) {
23
+ if (typeof sortOrder === 'undefined') {
24
+ return true;
25
+ }
26
+ return toObject(sortOrder).columns.length === 0;
27
+ }
28
+ _SortOrder.isEmpty = isEmpty;
29
+ function asc(column) {
30
+ validateColumnName(column);
31
+ return {
32
+ columns: [{
33
+ name: column,
34
+ direction: Direction.ASC
35
+ }]
36
+ };
37
+ }
38
+ _SortOrder.asc = asc;
39
+ function desc(column) {
40
+ validateColumnName(column);
41
+ return {
42
+ columns: [{
43
+ name: column,
44
+ direction: Direction.DESC
45
+ }]
46
+ };
47
+ }
48
+ _SortOrder.desc = desc;
49
+ function parse(sortOrder) {
50
+ if (typeof sortOrder === 'undefined') {
51
+ return undefined;
52
+ }
53
+ const columns = sortOrder.split(',').map(parseColumn);
54
+ return {
55
+ columns
56
+ };
57
+ }
58
+ _SortOrder.parse = parse;
59
+ function stringify(sortOrder) {
60
+ if (typeof sortOrder === 'undefined') {
61
+ return undefined;
62
+ }
63
+ if (typeof sortOrder === 'string') {
64
+ return sortOrder;
65
+ }
66
+ if (isEmpty(sortOrder)) {
67
+ return undefined;
68
+ }
69
+ return toString(sortOrder);
70
+ }
71
+ _SortOrder.stringify = stringify;
72
+ function combine(sortOrder, another) {
73
+ if (typeof sortOrder === 'string' && typeof another === 'string') {
74
+ const combined = stringify(combine(toObject(sortOrder), toObject(another)));
75
+ if (typeof combined === 'undefined') {
76
+ throw new Error('stringify() cannot return undefined. This should never happen.');
77
+ }
78
+ return combined;
79
+ }
80
+ if (typeof sortOrder === 'object' && typeof another === 'object') {
81
+ return {
82
+ columns: [...sortOrder.columns, ...toObject(another).columns]
83
+ };
84
+ }
85
+ throw new Error('Both arguments of combine() should be of the same type.');
86
+ }
87
+ _SortOrder.combine = combine;
88
+ })(SortOrder || (exports.SortOrder = SortOrder = {}));
89
+ function toObject(sortOrder) {
90
+ return typeof sortOrder === 'string' ? SortOrder.parse(sortOrder) : sortOrder;
91
+ }
92
+ function parseColumn(column) {
93
+ if (column.startsWith('+')) {
94
+ const [, name] = column.split('+');
95
+ validateColumnName(name);
96
+ return {
97
+ name,
98
+ direction: SortOrder.Direction.ASC
99
+ };
100
+ }
101
+ if (column.startsWith('-')) {
102
+ const [, name] = column.split('-');
103
+ validateColumnName(name);
104
+ return {
105
+ name,
106
+ direction: SortOrder.Direction.DESC
107
+ };
108
+ }
109
+ validateColumnName(column);
110
+ return {
111
+ name: column,
112
+ direction: SortOrder.Direction.ASC
113
+ };
114
+ }
115
+ function toString(arg) {
116
+ if (arg === SortOrder.Direction.ASC) {
117
+ return '+';
118
+ }
119
+ if (arg === SortOrder.Direction.DESC) {
120
+ return '-';
121
+ }
122
+ if ('columns' in arg) {
123
+ return arg.columns.map(toString).join(',');
124
+ }
125
+ return `${toString(arg.direction)}${arg.name}`;
126
+ }
127
+ function validateColumnName(name) {
128
+ if (name.length === 0) {
129
+ throw new Error(`Invalid sort column name: '${name}'.`);
130
+ }
131
+ }
@@ -0,0 +1,22 @@
1
+ export interface SortOrder {
2
+ columns: SortOrder.Column[];
3
+ }
4
+ export declare namespace SortOrder {
5
+ enum Direction {
6
+ ASC = "asc",
7
+ DESC = "desc"
8
+ }
9
+ interface Column {
10
+ name: string;
11
+ direction: Direction;
12
+ }
13
+ function empty(): SortOrder;
14
+ function isEmpty(sortOrder: SortOrder | string | undefined): boolean;
15
+ function asc(column: string): SortOrder;
16
+ function desc(column: string): SortOrder;
17
+ function parse(sortOrder: string): SortOrder;
18
+ function parse(sortOrder: string | undefined): SortOrder | undefined;
19
+ function stringify(sortOrder: SortOrder | string | undefined): string | undefined;
20
+ function combine(sortOrder: string, append: string): string;
21
+ function combine(sortOrder: SortOrder, append: SortOrder): SortOrder;
22
+ }
@@ -0,0 +1,124 @@
1
+ export let SortOrder;
2
+ (function (_SortOrder) {
3
+ let Direction;
4
+ (function (Direction) {
5
+ Direction["ASC"] = "asc";
6
+ Direction["DESC"] = "desc";
7
+ })(Direction || (Direction = {}));
8
+ _SortOrder.Direction = Direction;
9
+ function empty() {
10
+ return {
11
+ columns: []
12
+ };
13
+ }
14
+ _SortOrder.empty = empty;
15
+ function isEmpty(sortOrder) {
16
+ if (typeof sortOrder === 'undefined') {
17
+ return true;
18
+ }
19
+ return toObject(sortOrder).columns.length === 0;
20
+ }
21
+ _SortOrder.isEmpty = isEmpty;
22
+ function asc(column) {
23
+ validateColumnName(column);
24
+ return {
25
+ columns: [{
26
+ name: column,
27
+ direction: Direction.ASC
28
+ }]
29
+ };
30
+ }
31
+ _SortOrder.asc = asc;
32
+ function desc(column) {
33
+ validateColumnName(column);
34
+ return {
35
+ columns: [{
36
+ name: column,
37
+ direction: Direction.DESC
38
+ }]
39
+ };
40
+ }
41
+ _SortOrder.desc = desc;
42
+ function parse(sortOrder) {
43
+ if (typeof sortOrder === 'undefined') {
44
+ return undefined;
45
+ }
46
+ const columns = sortOrder.split(',').map(parseColumn);
47
+ return {
48
+ columns
49
+ };
50
+ }
51
+ _SortOrder.parse = parse;
52
+ function stringify(sortOrder) {
53
+ if (typeof sortOrder === 'undefined') {
54
+ return undefined;
55
+ }
56
+ if (typeof sortOrder === 'string') {
57
+ return sortOrder;
58
+ }
59
+ if (isEmpty(sortOrder)) {
60
+ return undefined;
61
+ }
62
+ return toString(sortOrder);
63
+ }
64
+ _SortOrder.stringify = stringify;
65
+ function combine(sortOrder, another) {
66
+ if (typeof sortOrder === 'string' && typeof another === 'string') {
67
+ const combined = stringify(combine(toObject(sortOrder), toObject(another)));
68
+ if (typeof combined === 'undefined') {
69
+ throw new Error('stringify() cannot return undefined. This should never happen.');
70
+ }
71
+ return combined;
72
+ }
73
+ if (typeof sortOrder === 'object' && typeof another === 'object') {
74
+ return {
75
+ columns: [...sortOrder.columns, ...toObject(another).columns]
76
+ };
77
+ }
78
+ throw new Error('Both arguments of combine() should be of the same type.');
79
+ }
80
+ _SortOrder.combine = combine;
81
+ })(SortOrder || (SortOrder = {}));
82
+ function toObject(sortOrder) {
83
+ return typeof sortOrder === 'string' ? SortOrder.parse(sortOrder) : sortOrder;
84
+ }
85
+ function parseColumn(column) {
86
+ if (column.startsWith('+')) {
87
+ const [, name] = column.split('+');
88
+ validateColumnName(name);
89
+ return {
90
+ name,
91
+ direction: SortOrder.Direction.ASC
92
+ };
93
+ }
94
+ if (column.startsWith('-')) {
95
+ const [, name] = column.split('-');
96
+ validateColumnName(name);
97
+ return {
98
+ name,
99
+ direction: SortOrder.Direction.DESC
100
+ };
101
+ }
102
+ validateColumnName(column);
103
+ return {
104
+ name: column,
105
+ direction: SortOrder.Direction.ASC
106
+ };
107
+ }
108
+ function toString(arg) {
109
+ if (arg === SortOrder.Direction.ASC) {
110
+ return '+';
111
+ }
112
+ if (arg === SortOrder.Direction.DESC) {
113
+ return '-';
114
+ }
115
+ if ('columns' in arg) {
116
+ return arg.columns.map(toString).join(',');
117
+ }
118
+ return `${toString(arg.direction)}${arg.name}`;
119
+ }
120
+ function validateColumnName(name) {
121
+ if (name.length === 0) {
122
+ throw new Error(`Invalid sort column name: '${name}'.`);
123
+ }
124
+ }
@@ -283,6 +283,16 @@ Object.keys(_Snippet).forEach(function (key) {
283
283
  }
284
284
  });
285
285
  });
286
+ var _SortOrder = require("./SortOrder.cjs");
287
+ Object.keys(_SortOrder).forEach(function (key) {
288
+ if (key === "default" || key === "__esModule") return;
289
+ Object.defineProperty(exports, key, {
290
+ enumerable: true,
291
+ get: function () {
292
+ return _SortOrder[key];
293
+ }
294
+ });
295
+ });
286
296
  var _Story = require("./Story.cjs");
287
297
  Object.keys(_Story).forEach(function (key) {
288
298
  if (key === "default" || key === "__esModule") return;
@@ -26,6 +26,7 @@ export * from './PrivacyRequest';
26
26
  export * from './SenderAddress';
27
27
  export * from './SenderDomain';
28
28
  export * from './Snippet';
29
+ export * from './SortOrder';
29
30
  export * from './Story';
30
31
  export * from './User';
31
32
  export * from './UserAccount';
@@ -27,6 +27,7 @@ export * from "./PrivacyRequest.js";
27
27
  export * from "./SenderAddress.js";
28
28
  export * from "./SenderDomain.js";
29
29
  export * from "./Snippet.js";
30
+ export * from "./SortOrder.js";
30
31
  export * from "./Story.js";
31
32
  export * from "./User.js";
32
33
  export * from "./UserAccount.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "11.9.1",
3
+ "version": "11.11.0",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",