@prezly/sdk 21.7.2 → 21.9.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 = "21.7.0";
7
+ const VERSION = "21.8.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.7.0";
1
+ const VERSION = "21.8.0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
3
3
  export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
@@ -47,6 +47,12 @@ function createClient(api) {
47
47
  });
48
48
  return group;
49
49
  }
50
+ async function ungroupTags(payload) {
51
+ const url = _routing.routing.contactTagGroupsUrl;
52
+ return api.delete(`${url}/tags`, {
53
+ payload
54
+ });
55
+ }
50
56
  async function doDelete(groupId) {
51
57
  const url = _routing.routing.contactTagGroupsUrl;
52
58
  return api.delete(`${url}/${groupId}`);
@@ -57,6 +63,7 @@ function createClient(api) {
57
63
  create,
58
64
  update,
59
65
  addTags,
66
+ ungroupTags,
60
67
  delete: doDelete
61
68
  };
62
69
  }
@@ -1,6 +1,6 @@
1
1
  import type { DeferredJobsApiClient } from '../../api';
2
2
  import type { ContactTagGroup } from '../../types';
3
- import type { CreateRequest, UpdateRequest, AddTagsRequest } from './types';
3
+ import type { CreateRequest, UpdateRequest, AddTagsRequest, UngroupTagsRequest } from './types';
4
4
  type GroupId = ContactTagGroup['id'];
5
5
  export type Client = ReturnType<typeof createClient>;
6
6
  export declare function createClient(api: DeferredJobsApiClient): {
@@ -9,6 +9,7 @@ export declare function createClient(api: DeferredJobsApiClient): {
9
9
  create: (payload: CreateRequest) => Promise<ContactTagGroup>;
10
10
  update: (groupId: GroupId, payload: UpdateRequest) => Promise<ContactTagGroup>;
11
11
  addTags: (groupId: GroupId, payload: AddTagsRequest) => Promise<ContactTagGroup>;
12
+ ungroupTags: (payload: UngroupTagsRequest) => Promise<void>;
12
13
  delete: (groupId: GroupId) => Promise<void>;
13
14
  };
14
15
  export {};
@@ -41,6 +41,12 @@ export function createClient(api) {
41
41
  });
42
42
  return group;
43
43
  }
44
+ async function ungroupTags(payload) {
45
+ const url = routing.contactTagGroupsUrl;
46
+ return api.delete(`${url}/tags`, {
47
+ payload
48
+ });
49
+ }
44
50
  async function doDelete(groupId) {
45
51
  const url = routing.contactTagGroupsUrl;
46
52
  return api.delete(`${url}/${groupId}`);
@@ -51,6 +57,7 @@ export function createClient(api) {
51
57
  create,
52
58
  update,
53
59
  addTags,
60
+ ungroupTags,
54
61
  delete: doDelete
55
62
  };
56
63
  }
@@ -23,3 +23,6 @@ export interface UpdateRequest {
23
23
  export interface AddTagsRequest {
24
24
  tags: ContactTag['id'][];
25
25
  }
26
+ export interface UngroupTagsRequest {
27
+ tags: ContactTag['id'][];
28
+ }
@@ -1,5 +1,6 @@
1
1
  import type { UploadedImage } from '@prezly/uploads';
2
2
  import type { ContactDuplicateSuggestionRef } from './ContactDuplicateSuggestion';
3
+ import type { ContactTagRef } from './ContactTag';
3
4
  export interface ContactRef {
4
5
  id: number;
5
6
  contact_type: Contact.Type;
@@ -60,6 +61,7 @@ export interface Contact {
60
61
  organisations: ContactRef[];
61
62
  employees_number: number;
62
63
  tags: string[];
64
+ tag_entities: ContactTagRef[];
63
65
  has_enrichments: boolean;
64
66
  is_bounced: boolean;
65
67
  is_duplicated: boolean;
@@ -1,6 +1,11 @@
1
1
  import type { ContactTagGroupRef } from './ContactTagGroup';
2
2
  import type { UserRef } from './User';
3
3
  type Iso8601DateTime = string;
4
+ export interface ContactTagRef {
5
+ id: number;
6
+ name: string;
7
+ group: ContactTagGroupRef | null;
8
+ }
4
9
  export interface ContactTag {
5
10
  id: number;
6
11
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "21.7.2",
3
+ "version": "21.9.0",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",