@prezly/sdk 20.4.0 → 20.5.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.
package/dist/api/constants.cjs
CHANGED
|
@@ -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.
|
|
7
|
+
const VERSION = "20.4.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})`;
|
package/dist/api/constants.js
CHANGED
|
@@ -100,6 +100,16 @@ function createClient(api) {
|
|
|
100
100
|
deleted: data.deleted_tags_ids
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
+
async function doDeleteMany(ids) {
|
|
104
|
+
const data = await api.delete(_routing.routing.contactsTagsUrl, {
|
|
105
|
+
query: {
|
|
106
|
+
id: ids
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
return {
|
|
110
|
+
deleted: data.deleted_tags_ids
|
|
111
|
+
};
|
|
112
|
+
}
|
|
103
113
|
async function doDeleteUnused() {
|
|
104
114
|
const data = await api.delete(_routing.routing.contactsTagsUrl, {
|
|
105
115
|
query: {
|
|
@@ -118,6 +128,7 @@ function createClient(api) {
|
|
|
118
128
|
update,
|
|
119
129
|
merge,
|
|
120
130
|
delete: doDelete,
|
|
131
|
+
deleteMany: doDeleteMany,
|
|
121
132
|
deleteUnused: doDeleteUnused
|
|
122
133
|
};
|
|
123
134
|
}
|
|
@@ -12,6 +12,9 @@ export declare function createClient(api: DeferredJobsApiClient): {
|
|
|
12
12
|
delete: (id: ContactTag['id']) => Promise<{
|
|
13
13
|
deleted: number[];
|
|
14
14
|
}>;
|
|
15
|
+
deleteMany: (ids: ContactTag['id'][]) => Promise<{
|
|
16
|
+
deleted: number[];
|
|
17
|
+
}>;
|
|
15
18
|
deleteUnused: () => Promise<{
|
|
16
19
|
deleted: number[];
|
|
17
20
|
}>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { routing } from "../../routing.js";
|
|
2
|
-
import { Query } from "../../types/index.js";
|
|
3
|
-
import { SortOrder } from "../../types/index.js"; // Not putting these into the `./types` module to keep it local.
|
|
2
|
+
import { Query, SortOrder } from "../../types/index.js"; // Not putting these into the `./types` module to keep it local.
|
|
4
3
|
export function createClient(api) {
|
|
5
4
|
async function list(options = {}) {
|
|
6
5
|
const {
|
|
@@ -93,6 +92,16 @@ export function createClient(api) {
|
|
|
93
92
|
deleted: data.deleted_tags_ids
|
|
94
93
|
};
|
|
95
94
|
}
|
|
95
|
+
async function doDeleteMany(ids) {
|
|
96
|
+
const data = await api.delete(routing.contactsTagsUrl, {
|
|
97
|
+
query: {
|
|
98
|
+
id: ids
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return {
|
|
102
|
+
deleted: data.deleted_tags_ids
|
|
103
|
+
};
|
|
104
|
+
}
|
|
96
105
|
async function doDeleteUnused() {
|
|
97
106
|
const data = await api.delete(routing.contactsTagsUrl, {
|
|
98
107
|
query: {
|
|
@@ -111,6 +120,7 @@ export function createClient(api) {
|
|
|
111
120
|
update,
|
|
112
121
|
merge,
|
|
113
122
|
delete: doDelete,
|
|
123
|
+
deleteMany: doDeleteMany,
|
|
114
124
|
deleteUnused: doDeleteUnused
|
|
115
125
|
};
|
|
116
126
|
}
|