@prezly/sdk 23.7.4 → 23.9.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.
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DEFAULT_USER_AGENT = void 0;
7
- const VERSION = "23.7.3";
7
+ const VERSION = "23.8.0";
8
8
  const URL = 'https://github.com/prezly/javascript-sdk';
9
9
  const DEFAULT_USER_AGENT = exports.DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
@@ -1,3 +1,3 @@
1
- const VERSION = "23.7.3";
1
+ const VERSION = "23.8.0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
3
3
  export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
@@ -69,6 +69,19 @@ function createClient(api) {
69
69
  }
70
70
  });
71
71
  }
72
+ async function preview(provider, options) {
73
+ const {
74
+ input,
75
+ oldest
76
+ } = options;
77
+ return api.post(`${_routing.routing.coverageIntegrationsUrl}/preview`, {
78
+ payload: {
79
+ provider,
80
+ input,
81
+ oldest
82
+ }
83
+ });
84
+ }
72
85
  return {
73
86
  list,
74
87
  get,
@@ -77,6 +90,7 @@ function createClient(api) {
77
90
  activate,
78
91
  trigger,
79
92
  delete: doDelete,
80
- listRuns
93
+ listRuns,
94
+ preview
81
95
  };
82
96
  }
@@ -1,6 +1,7 @@
1
1
  import type { DeferredJobsApiClient } from '../../api';
2
+ import type { CoverageEntry } from '../../types';
2
3
  import { type CoverageIntegration } from '../../types';
3
- import type { CreateRequest, ListRunsOptions, ListRunsResponse, UpdateRequest } from './types';
4
+ import type { CreateRequest, ListRunsOptions, ListRunsResponse, PreviewResponse, UpdateRequest } from './types';
4
5
  type IntegrationId = CoverageIntegration['id'];
5
6
  export type Client = ReturnType<typeof createClient>;
6
7
  export declare function createClient(api: DeferredJobsApiClient): {
@@ -12,5 +13,9 @@ export declare function createClient(api: DeferredJobsApiClient): {
12
13
  trigger: (integrationId: IntegrationId) => Promise<void>;
13
14
  delete: (integrationId: IntegrationId) => Promise<void>;
14
15
  listRuns: (integrationId: IntegrationId, options?: ListRunsOptions) => Promise<ListRunsResponse>;
16
+ preview: (provider: CoverageEntry.Provider, options: {
17
+ input: CoverageIntegration["input"];
18
+ oldest?: boolean;
19
+ }) => Promise<PreviewResponse>;
15
20
  };
16
21
  export {};
@@ -63,6 +63,19 @@ export function createClient(api) {
63
63
  }
64
64
  });
65
65
  }
66
+ async function preview(provider, options) {
67
+ const {
68
+ input,
69
+ oldest
70
+ } = options;
71
+ return api.post(`${routing.coverageIntegrationsUrl}/preview`, {
72
+ payload: {
73
+ provider,
74
+ input,
75
+ oldest
76
+ }
77
+ });
78
+ }
66
79
  return {
67
80
  list,
68
81
  get,
@@ -71,6 +84,7 @@ export function createClient(api) {
71
84
  activate,
72
85
  trigger,
73
86
  delete: doDelete,
74
- listRuns
87
+ listRuns,
88
+ preview
75
89
  };
76
90
  }
@@ -27,3 +27,13 @@ export interface ListRunsResponse {
27
27
  pagination: Pagination;
28
28
  sort: string;
29
29
  }
30
+ export interface PreviewEntry {
31
+ image: string | null;
32
+ link: string | null;
33
+ title: string;
34
+ username: string | null;
35
+ }
36
+ export interface PreviewResponse {
37
+ total: number;
38
+ entries: PreviewEntry[];
39
+ }
package/dist/routing.cjs CHANGED
@@ -14,7 +14,7 @@ const routing = exports.routing = {
14
14
  contactTagGroupsUrl: '/v2/contact-tag-groups',
15
15
  contactTagsUrl: '/v2/contact-tags',
16
16
  coverageUrl: '/v2/coverage',
17
- coverageIntegrationsUrl: '/v2/coverage-integrations',
17
+ coverageIntegrationsUrl: '/v2/coverage/integrations',
18
18
  jobsUrl: '/v2/jobs',
19
19
  licenseUrl: '/v2/licenses',
20
20
  licenseUnsubscribeUrl: '/v2/unsubscribe',
package/dist/routing.js CHANGED
@@ -8,7 +8,7 @@ export const routing = {
8
8
  contactTagGroupsUrl: '/v2/contact-tag-groups',
9
9
  contactTagsUrl: '/v2/contact-tags',
10
10
  coverageUrl: '/v2/coverage',
11
- coverageIntegrationsUrl: '/v2/coverage-integrations',
11
+ coverageIntegrationsUrl: '/v2/coverage/integrations',
12
12
  jobsUrl: '/v2/jobs',
13
13
  licenseUrl: '/v2/licenses',
14
14
  licenseUnsubscribeUrl: '/v2/unsubscribe',
@@ -101,6 +101,7 @@ export interface License extends LicenseRef {
101
101
  coverage_integration_rss_limit: number | null;
102
102
  coverage_integration_auxipress_limit: number | null;
103
103
  coverage_integration_opoint_limit: number | null;
104
+ coverage_integration_netfeedr_limit: number | null;
104
105
  }
105
106
  export declare namespace License {
106
107
  enum Type {
@@ -10,6 +10,7 @@ let AddonId = exports.AddonId = /*#__PURE__*/function (AddonId) {
10
10
  AddonId["COVERAGE_INTEGRATION_BELGA"] = "coverage_integration_belga";
11
11
  AddonId["COVERAGE_INTEGRATION_GOOGLE_ALERTS"] = "coverage_integration_google_alerts";
12
12
  AddonId["COVERAGE_INTEGRATION_OPOINT"] = "coverage_integration_opoint";
13
+ AddonId["COVERAGE_INTEGRATION_NETFEEDR"] = "coverage_integration_netfeedr";
13
14
  AddonId["COVERAGE_INTEGRATION_RSS"] = "coverage_integration_rss";
14
15
  AddonId["PREMIUM_USER"] = "premium_user";
15
16
  AddonId["SITE"] = "site";
@@ -42,6 +42,7 @@ export declare enum AddonId {
42
42
  COVERAGE_INTEGRATION_BELGA = "coverage_integration_belga",
43
43
  COVERAGE_INTEGRATION_GOOGLE_ALERTS = "coverage_integration_google_alerts",
44
44
  COVERAGE_INTEGRATION_OPOINT = "coverage_integration_opoint",
45
+ COVERAGE_INTEGRATION_NETFEEDR = "coverage_integration_netfeedr",
45
46
  COVERAGE_INTEGRATION_RSS = "coverage_integration_rss",
46
47
  PREMIUM_USER = "premium_user",
47
48
  SITE = "site",
@@ -4,6 +4,7 @@ export let AddonId = /*#__PURE__*/function (AddonId) {
4
4
  AddonId["COVERAGE_INTEGRATION_BELGA"] = "coverage_integration_belga";
5
5
  AddonId["COVERAGE_INTEGRATION_GOOGLE_ALERTS"] = "coverage_integration_google_alerts";
6
6
  AddonId["COVERAGE_INTEGRATION_OPOINT"] = "coverage_integration_opoint";
7
+ AddonId["COVERAGE_INTEGRATION_NETFEEDR"] = "coverage_integration_netfeedr";
7
8
  AddonId["COVERAGE_INTEGRATION_RSS"] = "coverage_integration_rss";
8
9
  AddonId["PREMIUM_USER"] = "premium_user";
9
10
  AddonId["SITE"] = "site";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "23.7.4",
3
+ "version": "23.9.0",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",