@prezly/sdk 24.1.1 → 25.1.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 = "24.1.0";
7
+ const VERSION = "25.0.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 = "24.1.0";
1
+ const VERSION = "25.0.0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
3
3
  export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
@@ -5,9 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.SignupPlan = exports.SignupCurrency = void 0;
7
7
  let SignupPlan = exports.SignupPlan = /*#__PURE__*/function (SignupPlan) {
8
- SignupPlan["STARTER"] = "starter";
9
- SignupPlan["CORE"] = "core";
10
- SignupPlan["PREMIUM"] = "premium";
8
+ SignupPlan["ESSENTIAL"] = "essential";
9
+ SignupPlan["STANDARD"] = "standard";
10
+ SignupPlan["AGENCY_ESSENTIAL"] = "agency_essential";
11
+ SignupPlan["AGENCY_STANDARD"] = "agency_standard";
11
12
  return SignupPlan;
12
13
  }({});
13
14
  let SignupCurrency = exports.SignupCurrency = /*#__PURE__*/function (SignupCurrency) {
@@ -1,8 +1,9 @@
1
1
  import type { BillingCycle } from '../../types/BillingCycle';
2
2
  export declare enum SignupPlan {
3
- STARTER = "starter",
4
- CORE = "core",
5
- PREMIUM = "premium"
3
+ ESSENTIAL = "essential",
4
+ STANDARD = "standard",
5
+ AGENCY_ESSENTIAL = "agency_essential",
6
+ AGENCY_STANDARD = "agency_standard"
6
7
  }
7
8
  export declare enum SignupCurrency {
8
9
  EUR = "eur",
@@ -1,7 +1,8 @@
1
1
  export let SignupPlan = /*#__PURE__*/function (SignupPlan) {
2
- SignupPlan["STARTER"] = "starter";
3
- SignupPlan["CORE"] = "core";
4
- SignupPlan["PREMIUM"] = "premium";
2
+ SignupPlan["ESSENTIAL"] = "essential";
3
+ SignupPlan["STANDARD"] = "standard";
4
+ SignupPlan["AGENCY_ESSENTIAL"] = "agency_essential";
5
+ SignupPlan["AGENCY_STANDARD"] = "agency_standard";
5
6
  return SignupPlan;
6
7
  }({});
7
8
  export let SignupCurrency = /*#__PURE__*/function (SignupCurrency) {
@@ -1,3 +1,4 @@
1
1
  "use strict";
2
2
 
3
- var _index = require("../../types/index.cjs");
3
+ var _index = require("../../types/index.cjs");
4
+ var Provider = _index.CoverageEntry.Provider;
@@ -1 +1,2 @@
1
- import { CoverageEntry } from "../../types/index.js";
1
+ import { CoverageEntry } from "../../types/index.js";
2
+ var Provider = CoverageEntry.Provider;
@@ -408,6 +408,16 @@ function createClient(api) {
408
408
  const url = `${_routing.routing.storiesUrl}/${id}`;
409
409
  await api.delete(url);
410
410
  }
411
+ async function bulkDelete(selector) {
412
+ const {
413
+ query
414
+ } = selector;
415
+ return api.delete(_routing.routing.storiesUrl, {
416
+ payload: {
417
+ query
418
+ }
419
+ });
420
+ }
411
421
  async function preview(id, options) {
412
422
  const url = `${_routing.routing.storiesUrl}/${id}/preview`;
413
423
  const {
@@ -440,6 +450,7 @@ function createClient(api) {
440
450
  pin,
441
451
  unpin,
442
452
  delete: doDelete,
453
+ bulkDelete,
443
454
  preview
444
455
  };
445
456
  }
@@ -1,5 +1,6 @@
1
+ import type { ProgressPromise } from '@prezly/progress-promise';
1
2
  import type { DeferredJobsApiClient } from '../../api';
2
- import type { ExtendedStory, Query, Story } from '../../types';
3
+ import type { ExtendedStory, Query, Story, StoriesBulkSelector } from '../../types';
3
4
  import type { AutosaveRequest, ChangeNewsroomSuccessResponse, ChangeNewsroomUnsafeResponse, CreateRequest, IncludeOptions, ListOptions, ListResponse, MoveRequest, PreviewResponse, PreviewOptions, PublishRequest, RevertRequest, ScheduleRequest, SearchOptions, TranslateRequest, UnpublishRequest, UnscheduleRequest, UpdateRequest } from './types';
4
5
  /**
5
6
  * `uuid` is the preferred way of targeting a Story. Numeric `id` is considered deprecated.
@@ -119,6 +120,9 @@ export declare function createClient(api: DeferredJobsApiClient): {
119
120
  formats?: Formats;
120
121
  }>) => Promise<ExtendedStory & InferExtraFields<Options>>;
121
122
  delete: (id: StoryId) => Promise<void>;
123
+ bulkDelete: (selector: StoriesBulkSelector) => ProgressPromise<{
124
+ records_deleted_number: number;
125
+ }>;
122
126
  preview: (id: StoryId, options?: PreviewOptions) => Promise<PreviewResponse>;
123
127
  };
124
128
  export {};
@@ -400,6 +400,16 @@ export function createClient(api) {
400
400
  const url = `${routing.storiesUrl}/${id}`;
401
401
  await api.delete(url);
402
402
  }
403
+ async function bulkDelete(selector) {
404
+ const {
405
+ query
406
+ } = selector;
407
+ return api.delete(routing.storiesUrl, {
408
+ payload: {
409
+ query
410
+ }
411
+ });
412
+ }
403
413
  async function preview(id, options) {
404
414
  const url = `${routing.storiesUrl}/${id}/preview`;
405
415
  const {
@@ -432,6 +442,7 @@ export function createClient(api) {
432
442
  pin,
433
443
  unpin,
434
444
  delete: doDelete,
445
+ bulkDelete,
435
446
  preview
436
447
  };
437
448
  }
@@ -62,4 +62,5 @@ var _Subscriptions = _interopRequireWildcard(require("./Subscriptions/index.cjs"
62
62
  exports.Subscriptions = _Subscriptions;
63
63
  var _NotificationSubscriptions = _interopRequireWildcard(require("./NotificationSubscriptions/index.cjs"));
64
64
  exports.NotificationSubscriptions = _NotificationSubscriptions;
65
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
65
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
66
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -8,9 +8,7 @@ let Newsroom = exports.Newsroom = void 0;
8
8
  (function (_Newsroom) {
9
9
  let Status = /*#__PURE__*/function (Status) {
10
10
  Status["ACTIVE"] = "active";
11
- // i.e. "Live"
12
11
  Status["INACTIVE"] = "inactive";
13
- // i.e. "Not live"
14
12
  Status["ARCHIVED"] = "archived";
15
13
  return Status;
16
14
  }({});
@@ -22,14 +20,8 @@ let Newsroom = exports.Newsroom = void 0;
22
20
  }({});
23
21
  _Newsroom.EmailBrandingMode = EmailBrandingMode;
24
22
  let TrackingPolicy = /*#__PURE__*/function (TrackingPolicy) {
25
- /**
26
- * @deprecated Please use `NORMAL` instead.
27
- */
28
23
  TrackingPolicy["DEFAULT"] = "default";
29
24
  TrackingPolicy["DISABLED"] = "disabled";
30
- /**
31
- * @deprecated Please use `STRICT` instead.
32
- */
33
25
  TrackingPolicy["CONSENT_TO_IDENTIFY"] = "consent-to-identify";
34
26
  TrackingPolicy["STRICT"] = "strict";
35
27
  TrackingPolicy["NORMAL"] = "normal";
@@ -2,9 +2,7 @@ export let Newsroom;
2
2
  (function (_Newsroom) {
3
3
  let Status = /*#__PURE__*/function (Status) {
4
4
  Status["ACTIVE"] = "active";
5
- // i.e. "Live"
6
5
  Status["INACTIVE"] = "inactive";
7
- // i.e. "Not live"
8
6
  Status["ARCHIVED"] = "archived";
9
7
  return Status;
10
8
  }({});
@@ -16,14 +14,8 @@ export let Newsroom;
16
14
  }({});
17
15
  _Newsroom.EmailBrandingMode = EmailBrandingMode;
18
16
  let TrackingPolicy = /*#__PURE__*/function (TrackingPolicy) {
19
- /**
20
- * @deprecated Please use `NORMAL` instead.
21
- */
22
17
  TrackingPolicy["DEFAULT"] = "default";
23
18
  TrackingPolicy["DISABLED"] = "disabled";
24
- /**
25
- * @deprecated Please use `STRICT` instead.
26
- */
27
19
  TrackingPolicy["CONSENT_TO_IDENTIFY"] = "consent-to-identify";
28
20
  TrackingPolicy["STRICT"] = "strict";
29
21
  TrackingPolicy["NORMAL"] = "normal";
@@ -27,12 +27,10 @@ let NewsroomTheme = exports.NewsroomTheme = void 0;
27
27
  Feature["TITLE_FORMATTING"] = "title_formatting";
28
28
  Feature["CTA_BUTTONS"] = "cta_buttons";
29
29
  Feature["VIDEO_LAYOUT"] = "video_layout";
30
- // DEV-7588
31
30
  Feature["EMBED_LAYOUT"] = "embed_layout";
32
- // DEV-11475
33
- Feature["STRICT_TRACKING_POLICY"] = "strict_tracking_policy"; // DEV-19123
31
+ Feature["STRICT_TRACKING_POLICY"] = "strict_tracking_policy";
34
32
  return Feature;
35
- }({});
33
+ }({}); // DEV-19123
36
34
  _NewsroomTheme.Feature = Feature;
37
35
  function isFeatureSupported(theme, feature) {
38
36
  return theme.features.includes(feature);
@@ -21,12 +21,10 @@ export let NewsroomTheme;
21
21
  Feature["TITLE_FORMATTING"] = "title_formatting";
22
22
  Feature["CTA_BUTTONS"] = "cta_buttons";
23
23
  Feature["VIDEO_LAYOUT"] = "video_layout";
24
- // DEV-7588
25
24
  Feature["EMBED_LAYOUT"] = "embed_layout";
26
- // DEV-11475
27
- Feature["STRICT_TRACKING_POLICY"] = "strict_tracking_policy"; // DEV-19123
25
+ Feature["STRICT_TRACKING_POLICY"] = "strict_tracking_policy";
28
26
  return Feature;
29
- }({});
27
+ }({}); // DEV-19123
30
28
  _NewsroomTheme.Feature = Feature;
31
29
  function isFeatureSupported(theme, feature) {
32
30
  return theme.features.includes(feature);
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,4 @@
1
+ import type { Query } from './common';
2
+ export interface StoriesBulkSelector {
3
+ query: Query;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -432,6 +432,17 @@ Object.keys(_SortOrder).forEach(function (key) {
432
432
  }
433
433
  });
434
434
  });
435
+ var _StoriesBulkSelector = require("./StoriesBulkSelector.cjs");
436
+ Object.keys(_StoriesBulkSelector).forEach(function (key) {
437
+ if (key === "default" || key === "__esModule") return;
438
+ if (key in exports && exports[key] === _StoriesBulkSelector[key]) return;
439
+ Object.defineProperty(exports, key, {
440
+ enumerable: true,
441
+ get: function () {
442
+ return _StoriesBulkSelector[key];
443
+ }
444
+ });
445
+ });
435
446
  var _Story = require("./Story.cjs");
436
447
  Object.keys(_Story).forEach(function (key) {
437
448
  if (key === "default" || key === "__esModule") return;
@@ -37,6 +37,7 @@ export * from './SenderAddress';
37
37
  export * from './SenderDomain';
38
38
  export * from './Snippet';
39
39
  export * from './SortOrder';
40
+ export * from './StoriesBulkSelector';
40
41
  export * from './Story';
41
42
  export * from './User';
42
43
  export * from './UserAccount';
@@ -38,6 +38,7 @@ export * from "./SenderAddress.js";
38
38
  export * from "./SenderDomain.js";
39
39
  export * from "./Snippet.js";
40
40
  export * from "./SortOrder.js";
41
+ export * from "./StoriesBulkSelector.js";
41
42
  export * from "./Story.js";
42
43
  export * from "./User.js";
43
44
  export * from "./UserAccount.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "24.1.1",
3
+ "version": "25.1.0",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",