@prezly/sdk 21.21.2 → 21.22.1

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 = "21.21.1";
7
+ const VERSION = "21.22.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 = "21.21.1";
1
+ const VERSION = "21.22.0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
3
3
  export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
@@ -71,11 +71,16 @@ function createClient(api) {
71
71
  });
72
72
  return coverage[0] || null;
73
73
  }
74
- async function create(payload) {
74
+ async function create(payload, {
75
+ enrich = false
76
+ } = {}) {
75
77
  const {
76
78
  coverage
77
79
  } = await api.post(_routing.routing.coverageUrl, {
78
- payload
80
+ payload,
81
+ query: {
82
+ enrich: enrich || undefined
83
+ }
79
84
  });
80
85
  return coverage;
81
86
  }
@@ -1,7 +1,7 @@
1
1
  import type { ProgressPromise } from '@prezly/progress-promise';
2
2
  import type { DeferredJobsApiClient } from '../../api';
3
3
  import type { CoverageEntry, SelectionValue } from '../../types';
4
- import type { CreateRequest, ListOptions, ListResponse, Scope, SearchOptions, UpdateRequest } from './types';
4
+ import type { CreateOptions, CreateRequest, ListOptions, ListResponse, Scope, SearchOptions, UpdateRequest } from './types';
5
5
  type CoverageId = CoverageEntry['uuid'] | CoverageEntry['id'];
6
6
  export type Client = ReturnType<typeof createClient>;
7
7
  export declare function createClient(api: DeferredJobsApiClient): {
@@ -9,7 +9,7 @@ export declare function createClient(api: DeferredJobsApiClient): {
9
9
  search: (options?: SearchOptions, scope?: Scope) => Promise<ListResponse>;
10
10
  get: (id: CoverageId, includeDeleted?: boolean) => Promise<CoverageEntry>;
11
11
  getByExternalReferenceId: (externalReferenceId: string) => Promise<CoverageEntry | null>;
12
- create: (payload: CreateRequest) => Promise<CoverageEntry>;
12
+ create: (payload: CreateRequest, { enrich }?: CreateOptions) => Promise<CoverageEntry>;
13
13
  update: (id: CoverageId, payload: UpdateRequest) => Promise<CoverageEntry>;
14
14
  delete: (id: CoverageId) => Promise<void>;
15
15
  bulkDelete: (options: Partial<{
@@ -65,11 +65,16 @@ export function createClient(api) {
65
65
  });
66
66
  return coverage[0] || null;
67
67
  }
68
- async function create(payload) {
68
+ async function create(payload, {
69
+ enrich = false
70
+ } = {}) {
69
71
  const {
70
72
  coverage
71
73
  } = await api.post(routing.coverageUrl, {
72
- payload
74
+ payload,
75
+ query: {
76
+ enrich: enrich || undefined
77
+ }
73
78
  });
74
79
  return coverage;
75
80
  }
@@ -52,6 +52,9 @@ export interface UpdateRequest {
52
52
  export interface CreateRequest extends UpdateRequest {
53
53
  integration_run?: CoverageEntry['integration_run'];
54
54
  }
55
+ export interface CreateOptions {
56
+ enrich?: boolean;
57
+ }
55
58
  export interface ListOptions {
56
59
  includeDeleted?: boolean;
57
60
  limit?: number;
@@ -1 +1,12 @@
1
- "use strict";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CoverageIntegrationStatus = void 0;
7
+ let CoverageIntegrationStatus = exports.CoverageIntegrationStatus = /*#__PURE__*/function (CoverageIntegrationStatus) {
8
+ CoverageIntegrationStatus["ACTIVE"] = "active";
9
+ CoverageIntegrationStatus["PAUSED"] = "paused";
10
+ CoverageIntegrationStatus["TRIAL"] = "trial";
11
+ return CoverageIntegrationStatus;
12
+ }({});
@@ -3,6 +3,11 @@ import type { CoverageIntegrationRun } from './CoverageIntegrationRun';
3
3
  import type { NewsroomRef } from './Newsroom';
4
4
  import type { UserRef } from './User';
5
5
  type Iso8601DateTime = string;
6
+ export declare enum CoverageIntegrationStatus {
7
+ ACTIVE = "active",
8
+ PAUSED = "paused",
9
+ TRIAL = "trial"
10
+ }
6
11
  export interface CoverageIntegration {
7
12
  id: number;
8
13
  name: string;
@@ -17,5 +22,7 @@ export interface CoverageIntegration {
17
22
  created_at: Iso8601DateTime;
18
23
  stats_added: number;
19
24
  creator: UserRef | null;
25
+ status: CoverageIntegrationStatus;
26
+ trial_ends_at: Iso8601DateTime | null;
20
27
  }
21
28
  export {};
@@ -1 +1,6 @@
1
- export {};
1
+ export let CoverageIntegrationStatus = /*#__PURE__*/function (CoverageIntegrationStatus) {
2
+ CoverageIntegrationStatus["ACTIVE"] = "active";
3
+ CoverageIntegrationStatus["PAUSED"] = "paused";
4
+ CoverageIntegrationStatus["TRIAL"] = "trial";
5
+ return CoverageIntegrationStatus;
6
+ }({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "21.21.2",
3
+ "version": "21.22.1",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",