@prezly/sdk 22.1.0 → 22.3.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 = "22.0.0";
7
+ const VERSION = "22.2.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 = "22.0.0";
1
+ const VERSION = "22.2.0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
3
3
  export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
@@ -39,6 +39,13 @@ function createClient(api) {
39
39
  });
40
40
  return integration;
41
41
  }
42
+ async function activate(integrationId) {
43
+ const url = _routing.routing.coverageIntegrationsUrl;
44
+ const {
45
+ integration
46
+ } = await api.post(`${url}/${integrationId}/activate`);
47
+ return integration;
48
+ }
42
49
  async function trigger(integrationId) {
43
50
  const url = _routing.routing.coverageIntegrationsUrl;
44
51
  return api.post(`${url}/${integrationId}/trigger`);
@@ -67,6 +74,7 @@ function createClient(api) {
67
74
  get,
68
75
  create,
69
76
  update,
77
+ activate,
70
78
  trigger,
71
79
  delete: doDelete,
72
80
  listRuns
@@ -8,6 +8,7 @@ export declare function createClient(api: DeferredJobsApiClient): {
8
8
  get: (integrationId: IntegrationId) => Promise<CoverageIntegration>;
9
9
  create: (payload: CreateRequest) => Promise<CoverageIntegration>;
10
10
  update: (integrationId: IntegrationId, payload: UpdateRequest) => Promise<CoverageIntegration>;
11
+ activate: (integrationId: IntegrationId) => Promise<CoverageIntegration>;
11
12
  trigger: (integrationId: IntegrationId) => Promise<void>;
12
13
  delete: (integrationId: IntegrationId) => Promise<void>;
13
14
  listRuns: (integrationId: IntegrationId, options?: ListRunsOptions) => Promise<ListRunsResponse>;
@@ -33,6 +33,13 @@ export function createClient(api) {
33
33
  });
34
34
  return integration;
35
35
  }
36
+ async function activate(integrationId) {
37
+ const url = routing.coverageIntegrationsUrl;
38
+ const {
39
+ integration
40
+ } = await api.post(`${url}/${integrationId}/activate`);
41
+ return integration;
42
+ }
36
43
  async function trigger(integrationId) {
37
44
  const url = routing.coverageIntegrationsUrl;
38
45
  return api.post(`${url}/${integrationId}/trigger`);
@@ -61,6 +68,7 @@ export function createClient(api) {
61
68
  get,
62
69
  create,
63
70
  update,
71
+ activate,
64
72
  trigger,
65
73
  delete: doDelete,
66
74
  listRuns
@@ -1,7 +1,7 @@
1
1
  import { CoverageEntry, type CoverageIntegrationRun, type Newsroom, type Pagination, type SortOrder } from '../../types';
2
2
  import Provider = CoverageEntry.Provider;
3
3
  export interface CreateRequest {
4
- newsroom: Newsroom['id'] | Newsroom['uuid'];
4
+ newsroom?: Newsroom['id'] | Newsroom['uuid'] | null;
5
5
  provider: Provider;
6
6
  input: string;
7
7
  name: string;
@@ -10,6 +10,7 @@ export interface CreateRequest {
10
10
  skip_organisation?: boolean;
11
11
  }
12
12
  export interface UpdateRequest {
13
+ newsroom?: Newsroom['id'] | Newsroom['uuid'] | null;
13
14
  input?: string;
14
15
  name?: string;
15
16
  description?: string;
@@ -23,9 +23,10 @@ let CoverageEntry = exports.CoverageEntry = void 0;
23
23
  Provider["GOOGLE_ALERTS"] = "google_alerts";
24
24
  Provider["KANTAR"] = "kantar";
25
25
  Provider["KNEWIN"] = "knewin";
26
+ Provider["MANUAL"] = "manual";
26
27
  Provider["MEDIAWEB"] = "mediaweb";
27
28
  Provider["MELTWATER"] = "meltwater";
28
- Provider["MANUAL"] = "manual";
29
+ Provider["OPOINT"] = "opoint";
29
30
  return Provider;
30
31
  }({});
31
32
  _CoverageEntry.Provider = Provider;
@@ -70,9 +70,10 @@ export declare namespace CoverageEntry {
70
70
  GOOGLE_ALERTS = "google_alerts",
71
71
  KANTAR = "kantar",
72
72
  KNEWIN = "knewin",
73
+ MANUAL = "manual",
73
74
  MEDIAWEB = "mediaweb",
74
75
  MELTWATER = "meltwater",
75
- MANUAL = "manual"
76
+ OPOINT = "opoint"
76
77
  }
77
78
  enum Sentiment {
78
79
  POSITIVE = "positive",
@@ -17,9 +17,10 @@ export let CoverageEntry;
17
17
  Provider["GOOGLE_ALERTS"] = "google_alerts";
18
18
  Provider["KANTAR"] = "kantar";
19
19
  Provider["KNEWIN"] = "knewin";
20
+ Provider["MANUAL"] = "manual";
20
21
  Provider["MEDIAWEB"] = "mediaweb";
21
22
  Provider["MELTWATER"] = "meltwater";
22
- Provider["MANUAL"] = "manual";
23
+ Provider["OPOINT"] = "opoint";
23
24
  return Provider;
24
25
  }({});
25
26
  _CoverageEntry.Provider = Provider;
@@ -7,7 +7,7 @@ export interface CoverageIntegration {
7
7
  id: number;
8
8
  name: string;
9
9
  description: string | null;
10
- newsroom: NewsroomRef;
10
+ newsroom: NewsroomRef | null;
11
11
  provider: CoverageEntry.Provider;
12
12
  input: string;
13
13
  skip_author: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "22.1.0",
3
+ "version": "22.3.0",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",