@prezly/sdk 15.9.0 → 15.10.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.
- package/dist/api/constants.cjs +1 -1
- package/dist/api/constants.js +1 -1
- package/dist/types/Contact.cjs +14 -0
- package/dist/types/Contact.d.ts +6 -2
- package/dist/types/Contact.js +14 -0
- package/dist/types/ContactDuplicateSuggestion.cjs +24 -1
- package/dist/types/ContactDuplicateSuggestion.d.ts +21 -5
- package/dist/types/ContactDuplicateSuggestion.js +25 -0
- package/dist/types/index.cjs +10 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/package.json +1 -1
package/dist/api/constants.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DEFAULT_USER_AGENT = void 0;
|
|
7
|
-
const VERSION = "15.
|
|
7
|
+
const VERSION = "15.10.0";
|
|
8
8
|
const URL = 'https://github.com/prezly/javascript-sdk';
|
|
9
9
|
const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
|
|
10
10
|
exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT;
|
package/dist/api/constants.js
CHANGED
package/dist/types/Contact.cjs
CHANGED
|
@@ -79,4 +79,18 @@ exports.Contact = Contact;
|
|
|
79
79
|
})(Type || (Type = {}));
|
|
80
80
|
_PhoneNumber.Type = Type;
|
|
81
81
|
})(PhoneNumber || (PhoneNumber = _Contact.PhoneNumber || (_Contact.PhoneNumber = {})));
|
|
82
|
+
function isPerson(arg) {
|
|
83
|
+
if (arg !== null && typeof arg === 'object') {
|
|
84
|
+
return arg.contact_type === Type.PERSON;
|
|
85
|
+
}
|
|
86
|
+
return arg === Type.PERSON;
|
|
87
|
+
}
|
|
88
|
+
_Contact.isPerson = isPerson;
|
|
89
|
+
function isOrganisation(arg) {
|
|
90
|
+
if (arg !== null && typeof arg === 'object') {
|
|
91
|
+
return arg.contact_type === Type.ORGANISATION;
|
|
92
|
+
}
|
|
93
|
+
return arg === Type.ORGANISATION;
|
|
94
|
+
}
|
|
95
|
+
_Contact.isOrganisation = isOrganisation;
|
|
82
96
|
})(Contact || (exports.Contact = Contact = {}));
|
package/dist/types/Contact.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UploadedImage } from '@prezly/uploads';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ContactDuplicateSuggestionRef } from './ContactDuplicateSuggestion';
|
|
3
3
|
export interface ContactRef {
|
|
4
4
|
id: number;
|
|
5
5
|
contact_type: Contact.Type;
|
|
@@ -65,7 +65,7 @@ export interface Contact {
|
|
|
65
65
|
is_unsubscribed: boolean;
|
|
66
66
|
is_unsubscribed_from_all_communications: boolean;
|
|
67
67
|
unsubscribed_newsrooms: string[];
|
|
68
|
-
duplicate_contacts:
|
|
68
|
+
duplicate_contacts: ContactDuplicateSuggestionRef[];
|
|
69
69
|
created_at: string | null;
|
|
70
70
|
modified_at: string | null;
|
|
71
71
|
stats: {
|
|
@@ -154,4 +154,8 @@ export declare namespace Contact {
|
|
|
154
154
|
CELLPHONE = "cell"
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
+
function isPerson(contact: Pick<Contact, 'contact_type'>): boolean;
|
|
158
|
+
function isPerson(type: Contact['contact_type']): boolean;
|
|
159
|
+
function isOrganisation(contact: Pick<Contact, 'contact_type'>): boolean;
|
|
160
|
+
function isOrganisation(type: Contact['contact_type']): boolean;
|
|
157
161
|
}
|
package/dist/types/Contact.js
CHANGED
|
@@ -72,4 +72,18 @@ export let Contact;
|
|
|
72
72
|
})(Type || (Type = {}));
|
|
73
73
|
_PhoneNumber.Type = Type;
|
|
74
74
|
})(PhoneNumber || (PhoneNumber = _Contact.PhoneNumber || (_Contact.PhoneNumber = {})));
|
|
75
|
+
function isPerson(arg) {
|
|
76
|
+
if (arg !== null && typeof arg === 'object') {
|
|
77
|
+
return arg.contact_type === Type.PERSON;
|
|
78
|
+
}
|
|
79
|
+
return arg === Type.PERSON;
|
|
80
|
+
}
|
|
81
|
+
_Contact.isPerson = isPerson;
|
|
82
|
+
function isOrganisation(arg) {
|
|
83
|
+
if (arg !== null && typeof arg === 'object') {
|
|
84
|
+
return arg.contact_type === Type.ORGANISATION;
|
|
85
|
+
}
|
|
86
|
+
return arg === Type.ORGANISATION;
|
|
87
|
+
}
|
|
88
|
+
_Contact.isOrganisation = isOrganisation;
|
|
75
89
|
})(Contact || (Contact = {}));
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ContactDuplicateSuggestion = void 0;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Value in range 0.0 ... 1.0.
|
|
9
|
+
*/let ContactDuplicateSuggestion;
|
|
8
10
|
exports.ContactDuplicateSuggestion = ContactDuplicateSuggestion;
|
|
9
11
|
(function (_ContactDuplicateSuggestion) {
|
|
10
12
|
let Status;
|
|
@@ -14,4 +16,25 @@ exports.ContactDuplicateSuggestion = ContactDuplicateSuggestion;
|
|
|
14
16
|
Status["DECLINED"] = "declined";
|
|
15
17
|
})(Status || (Status = {}));
|
|
16
18
|
_ContactDuplicateSuggestion.Status = Status;
|
|
19
|
+
function isUnseen(arg) {
|
|
20
|
+
if (arg !== null && typeof arg === 'object') {
|
|
21
|
+
return arg.status === Status.UNSEEN;
|
|
22
|
+
}
|
|
23
|
+
return arg === Status.UNSEEN;
|
|
24
|
+
}
|
|
25
|
+
_ContactDuplicateSuggestion.isUnseen = isUnseen;
|
|
26
|
+
function isAccepted(arg) {
|
|
27
|
+
if (arg !== null && typeof arg === 'object') {
|
|
28
|
+
return arg.status === Status.ACCEPTED;
|
|
29
|
+
}
|
|
30
|
+
return arg === Status.ACCEPTED;
|
|
31
|
+
}
|
|
32
|
+
_ContactDuplicateSuggestion.isAccepted = isAccepted;
|
|
33
|
+
function isDeclined(arg) {
|
|
34
|
+
if (arg !== null && typeof arg === 'object') {
|
|
35
|
+
return arg.status === Status.DECLINED;
|
|
36
|
+
}
|
|
37
|
+
return arg === Status.DECLINED;
|
|
38
|
+
}
|
|
39
|
+
_ContactDuplicateSuggestion.isDeclined = isDeclined;
|
|
17
40
|
})(ContactDuplicateSuggestion || (exports.ContactDuplicateSuggestion = ContactDuplicateSuggestion = {}));
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import type { ContactRef } from './Contact';
|
|
1
|
+
import type { Contact, ContactRef } from './Contact';
|
|
2
|
+
/**
|
|
3
|
+
* Value in range 0.0 ... 1.0.
|
|
4
|
+
*/
|
|
5
|
+
declare type Score = number;
|
|
2
6
|
export interface ContactDuplicateSuggestion {
|
|
7
|
+
contact: Contact;
|
|
8
|
+
score: Score;
|
|
9
|
+
status: ContactDuplicateSuggestion.Status;
|
|
10
|
+
links: {
|
|
11
|
+
merge_api: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ContactDuplicateSuggestionRef {
|
|
3
15
|
contact: ContactRef;
|
|
4
|
-
|
|
5
|
-
* Value in range 0.0 ... 1.0.
|
|
6
|
-
*/
|
|
7
|
-
score: number;
|
|
16
|
+
score: Score;
|
|
8
17
|
status: ContactDuplicateSuggestion.Status;
|
|
9
18
|
links: {
|
|
10
19
|
merge_api: string;
|
|
@@ -16,4 +25,11 @@ export declare namespace ContactDuplicateSuggestion {
|
|
|
16
25
|
ACCEPTED = "accepted",
|
|
17
26
|
DECLINED = "declined"
|
|
18
27
|
}
|
|
28
|
+
function isUnseen(suggestion: Pick<ContactDuplicateSuggestion, 'status'>): boolean;
|
|
29
|
+
function isUnseen(status: ContactDuplicateSuggestion['status']): boolean;
|
|
30
|
+
function isAccepted(suggestion: Pick<ContactDuplicateSuggestion, 'status'>): boolean;
|
|
31
|
+
function isAccepted(status: ContactDuplicateSuggestion['status']): boolean;
|
|
32
|
+
function isDeclined(suggestion: Pick<ContactDuplicateSuggestion, 'status'>): boolean;
|
|
33
|
+
function isDeclined(status: ContactDuplicateSuggestion['status']): boolean;
|
|
19
34
|
}
|
|
35
|
+
export {};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Value in range 0.0 ... 1.0.
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
export let ContactDuplicateSuggestion;
|
|
2
6
|
(function (_ContactDuplicateSuggestion) {
|
|
3
7
|
let Status;
|
|
@@ -7,4 +11,25 @@ export let ContactDuplicateSuggestion;
|
|
|
7
11
|
Status["DECLINED"] = "declined";
|
|
8
12
|
})(Status || (Status = {}));
|
|
9
13
|
_ContactDuplicateSuggestion.Status = Status;
|
|
14
|
+
function isUnseen(arg) {
|
|
15
|
+
if (arg !== null && typeof arg === 'object') {
|
|
16
|
+
return arg.status === Status.UNSEEN;
|
|
17
|
+
}
|
|
18
|
+
return arg === Status.UNSEEN;
|
|
19
|
+
}
|
|
20
|
+
_ContactDuplicateSuggestion.isUnseen = isUnseen;
|
|
21
|
+
function isAccepted(arg) {
|
|
22
|
+
if (arg !== null && typeof arg === 'object') {
|
|
23
|
+
return arg.status === Status.ACCEPTED;
|
|
24
|
+
}
|
|
25
|
+
return arg === Status.ACCEPTED;
|
|
26
|
+
}
|
|
27
|
+
_ContactDuplicateSuggestion.isAccepted = isAccepted;
|
|
28
|
+
function isDeclined(arg) {
|
|
29
|
+
if (arg !== null && typeof arg === 'object') {
|
|
30
|
+
return arg.status === Status.DECLINED;
|
|
31
|
+
}
|
|
32
|
+
return arg === Status.DECLINED;
|
|
33
|
+
}
|
|
34
|
+
_ContactDuplicateSuggestion.isDeclined = isDeclined;
|
|
10
35
|
})(ContactDuplicateSuggestion || (ContactDuplicateSuggestion = {}));
|
package/dist/types/index.cjs
CHANGED
|
@@ -53,6 +53,16 @@ Object.keys(_Contact).forEach(function (key) {
|
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
|
+
var _ContactDuplicateSuggestion = require("./ContactDuplicateSuggestion.cjs");
|
|
57
|
+
Object.keys(_ContactDuplicateSuggestion).forEach(function (key) {
|
|
58
|
+
if (key === "default" || key === "__esModule") return;
|
|
59
|
+
Object.defineProperty(exports, key, {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
get: function () {
|
|
62
|
+
return _ContactDuplicateSuggestion[key];
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
});
|
|
56
66
|
var _ContactsExport = require("./ContactsExport.cjs");
|
|
57
67
|
Object.keys(_ContactsExport).forEach(function (key) {
|
|
58
68
|
if (key === "default" || key === "__esModule") return;
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./BillingCycle.js";
|
|
|
4
4
|
export * from "./Campaign.js";
|
|
5
5
|
export * from "./Category.js";
|
|
6
6
|
export * from "./Contact.js";
|
|
7
|
+
export * from "./ContactDuplicateSuggestion.js";
|
|
7
8
|
export * from "./ContactsExport.js";
|
|
8
9
|
export * from "./ContactsScope.js";
|
|
9
10
|
export * from "./Country.js";
|