@prezly/sdk 20.5.0 → 20.5.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 = "20.4.0";
7
+ const VERSION = "20.5.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 = "20.4.0";
1
+ const VERSION = "20.5.0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
3
3
  export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
@@ -15,7 +15,7 @@ function createClient(api) {
15
15
  } = options;
16
16
  const {
17
17
  tags
18
- } = await api.get(_routing.routing.contactsTagsUrl, {
18
+ } = await api.get(_routing.routing.contactTagsUrl, {
19
19
  query: {
20
20
  sort: _index.SortOrder.stringify(sortOrder)
21
21
  }
@@ -31,7 +31,7 @@ function createClient(api) {
31
31
  } = options;
32
32
  const {
33
33
  tags
34
- } = await api.post(_routing.routing.contactsTagsUrl, {
34
+ } = await api.post(_routing.routing.contactTagsUrl, {
35
35
  query: {
36
36
  sort: _index.SortOrder.stringify(sortOrder),
37
37
  query: _index.Query.stringify(query)
@@ -42,7 +42,7 @@ function createClient(api) {
42
42
  };
43
43
  }
44
44
  async function get(id) {
45
- const url = `${_routing.routing.contactsTagsUrl}/${id}`;
45
+ const url = `${_routing.routing.contactTagsUrl}/${id}`;
46
46
  const {
47
47
  tag
48
48
  } = await api.get(url);
@@ -51,7 +51,7 @@ function createClient(api) {
51
51
  async function create(payload, {
52
52
  force = false
53
53
  } = {}) {
54
- const data = await api.post(_routing.routing.contactsTagsUrl, {
54
+ const data = await api.post(_routing.routing.contactTagsUrl, {
55
55
  payload,
56
56
  query: {
57
57
  force: force || undefined // Convert `false` to `undefined`
@@ -65,7 +65,7 @@ function createClient(api) {
65
65
  async function update(id, payload, {
66
66
  force = false
67
67
  } = {}) {
68
- const url = `${_routing.routing.contactsTagsUrl}/${id}`;
68
+ const url = `${_routing.routing.contactTagsUrl}/${id}`;
69
69
  const data = await api.patch(url, {
70
70
  payload,
71
71
  query: {
@@ -81,7 +81,7 @@ function createClient(api) {
81
81
  name,
82
82
  tags
83
83
  }) {
84
- const url = `${_routing.routing.contactsTagsUrl}/merge`;
84
+ const url = `${_routing.routing.contactTagsUrl}/merge`;
85
85
  const data = await api.post(url, {
86
86
  payload: {
87
87
  name,
@@ -94,14 +94,14 @@ function createClient(api) {
94
94
  };
95
95
  }
96
96
  async function doDelete(id) {
97
- const url = `${_routing.routing.contactsTagsUrl}/${id}`;
97
+ const url = `${_routing.routing.contactTagsUrl}/${id}`;
98
98
  const data = await api.delete(url);
99
99
  return {
100
100
  deleted: data.deleted_tags_ids
101
101
  };
102
102
  }
103
103
  async function doDeleteMany(ids) {
104
- const data = await api.delete(_routing.routing.contactsTagsUrl, {
104
+ const data = await api.delete(_routing.routing.contactTagsUrl, {
105
105
  query: {
106
106
  id: ids
107
107
  }
@@ -111,7 +111,7 @@ function createClient(api) {
111
111
  };
112
112
  }
113
113
  async function doDeleteUnused() {
114
- const data = await api.delete(_routing.routing.contactsTagsUrl, {
114
+ const data = await api.delete(_routing.routing.contactTagsUrl, {
115
115
  query: {
116
116
  filter: 'unused'
117
117
  }
@@ -7,7 +7,7 @@ export function createClient(api) {
7
7
  } = options;
8
8
  const {
9
9
  tags
10
- } = await api.get(routing.contactsTagsUrl, {
10
+ } = await api.get(routing.contactTagsUrl, {
11
11
  query: {
12
12
  sort: SortOrder.stringify(sortOrder)
13
13
  }
@@ -23,7 +23,7 @@ export function createClient(api) {
23
23
  } = options;
24
24
  const {
25
25
  tags
26
- } = await api.post(routing.contactsTagsUrl, {
26
+ } = await api.post(routing.contactTagsUrl, {
27
27
  query: {
28
28
  sort: SortOrder.stringify(sortOrder),
29
29
  query: Query.stringify(query)
@@ -34,7 +34,7 @@ export function createClient(api) {
34
34
  };
35
35
  }
36
36
  async function get(id) {
37
- const url = `${routing.contactsTagsUrl}/${id}`;
37
+ const url = `${routing.contactTagsUrl}/${id}`;
38
38
  const {
39
39
  tag
40
40
  } = await api.get(url);
@@ -43,7 +43,7 @@ export function createClient(api) {
43
43
  async function create(payload, {
44
44
  force = false
45
45
  } = {}) {
46
- const data = await api.post(routing.contactsTagsUrl, {
46
+ const data = await api.post(routing.contactTagsUrl, {
47
47
  payload,
48
48
  query: {
49
49
  force: force || undefined // Convert `false` to `undefined`
@@ -57,7 +57,7 @@ export function createClient(api) {
57
57
  async function update(id, payload, {
58
58
  force = false
59
59
  } = {}) {
60
- const url = `${routing.contactsTagsUrl}/${id}`;
60
+ const url = `${routing.contactTagsUrl}/${id}`;
61
61
  const data = await api.patch(url, {
62
62
  payload,
63
63
  query: {
@@ -73,7 +73,7 @@ export function createClient(api) {
73
73
  name,
74
74
  tags
75
75
  }) {
76
- const url = `${routing.contactsTagsUrl}/merge`;
76
+ const url = `${routing.contactTagsUrl}/merge`;
77
77
  const data = await api.post(url, {
78
78
  payload: {
79
79
  name,
@@ -86,14 +86,14 @@ export function createClient(api) {
86
86
  };
87
87
  }
88
88
  async function doDelete(id) {
89
- const url = `${routing.contactsTagsUrl}/${id}`;
89
+ const url = `${routing.contactTagsUrl}/${id}`;
90
90
  const data = await api.delete(url);
91
91
  return {
92
92
  deleted: data.deleted_tags_ids
93
93
  };
94
94
  }
95
95
  async function doDeleteMany(ids) {
96
- const data = await api.delete(routing.contactsTagsUrl, {
96
+ const data = await api.delete(routing.contactTagsUrl, {
97
97
  query: {
98
98
  id: ids
99
99
  }
@@ -103,7 +103,7 @@ export function createClient(api) {
103
103
  };
104
104
  }
105
105
  async function doDeleteUnused() {
106
- const data = await api.delete(routing.contactsTagsUrl, {
106
+ const data = await api.delete(routing.contactTagsUrl, {
107
107
  query: {
108
108
  filter: 'unused'
109
109
  }
package/dist/routing.cjs CHANGED
@@ -11,7 +11,7 @@ const routing = exports.routing = {
11
11
  campaignRecipientsUrl: '/v2/campaigns/:campaign_id/recipients',
12
12
  contactsExportsUrl: '/v2/contacts/exports',
13
13
  contactsUrl: '/v2/contacts',
14
- contactsTagsUrl: '/v2/contacts-tags',
14
+ contactTagsUrl: '/v2/contact-tags',
15
15
  coverageUrl: '/v2/coverage',
16
16
  jobsUrl: '/v2/jobs',
17
17
  licenseUrl: '/v2/licenses',
package/dist/routing.d.ts CHANGED
@@ -5,7 +5,7 @@ export declare const routing: {
5
5
  campaignRecipientsUrl: string;
6
6
  contactsExportsUrl: string;
7
7
  contactsUrl: string;
8
- contactsTagsUrl: string;
8
+ contactTagsUrl: string;
9
9
  coverageUrl: string;
10
10
  jobsUrl: string;
11
11
  licenseUrl: string;
package/dist/routing.js CHANGED
@@ -5,7 +5,7 @@ export const routing = {
5
5
  campaignRecipientsUrl: '/v2/campaigns/:campaign_id/recipients',
6
6
  contactsExportsUrl: '/v2/contacts/exports',
7
7
  contactsUrl: '/v2/contacts',
8
- contactsTagsUrl: '/v2/contacts-tags',
8
+ contactTagsUrl: '/v2/contact-tags',
9
9
  coverageUrl: '/v2/coverage',
10
10
  jobsUrl: '/v2/jobs',
11
11
  licenseUrl: '/v2/licenses',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "20.5.0",
3
+ "version": "20.5.1",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",