@wix/auto_sdk_crm_contacts 1.0.388 → 1.0.389
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/build/cjs/index.d.ts +23 -9
- package/build/cjs/index.js +1 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/{contacts-v4-contact-contacts.universal-B8Y8hXy8.d.ts → index.typings.d.ts} +470 -1
- package/build/cjs/index.typings.js +1126 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +2 -1
- package/build/es/index.d.mts +23 -9
- package/build/es/index.mjs +1 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/{contacts-v4-contact-contacts.universal-B8Y8hXy8.d.mts → index.typings.d.mts} +470 -1
- package/build/es/index.typings.mjs +1073 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +2 -1
- package/build/internal/cjs/index.d.ts +23 -9
- package/build/internal/cjs/index.js +1 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/{contacts-v4-contact-contacts.universal-GFgRnaQp.d.ts → index.typings.d.ts} +470 -1
- package/build/internal/cjs/index.typings.js +1126 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +2 -1
- package/build/internal/es/index.d.mts +23 -9
- package/build/internal/es/index.mjs +1 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/{contacts-v4-contact-contacts.universal-GFgRnaQp.d.mts → index.typings.d.mts} +470 -1
- package/build/internal/es/index.typings.mjs +1073 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +2 -1
- package/package.json +2 -2
package/build/es/{contacts-v4-contact-contacts.universal-B8Y8hXy8.d.mts → index.typings.d.mts}
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
1
3
|
interface Contact {
|
|
2
4
|
/**
|
|
3
5
|
* Contact ID.
|
|
@@ -488,6 +490,8 @@ declare enum SubdivisionType {
|
|
|
488
490
|
/** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
489
491
|
COUNTRY = "COUNTRY"
|
|
490
492
|
}
|
|
493
|
+
/** @enumType */
|
|
494
|
+
type SubdivisionTypeWithLiterals = SubdivisionType | 'UNKNOWN_SUBDIVISION_TYPE' | 'ADMINISTRATIVE_AREA_LEVEL_1' | 'ADMINISTRATIVE_AREA_LEVEL_2' | 'ADMINISTRATIVE_AREA_LEVEL_3' | 'ADMINISTRATIVE_AREA_LEVEL_4' | 'ADMINISTRATIVE_AREA_LEVEL_5' | 'COUNTRY';
|
|
491
495
|
interface AssigneesWrapper {
|
|
492
496
|
/**
|
|
493
497
|
* List of site contributor user IDs.
|
|
@@ -539,6 +543,8 @@ declare enum ImageProvider {
|
|
|
539
543
|
/** Stored in wix media platform, Must be uploaded by using `GeneratePictureUploadUrl` */
|
|
540
544
|
WIX_MEDIA = "WIX_MEDIA"
|
|
541
545
|
}
|
|
546
|
+
/** @enumType */
|
|
547
|
+
type ImageProviderWithLiterals = ImageProvider | 'UNKNOWN' | 'EXTERNAL' | 'WIX_MEDIA';
|
|
542
548
|
interface SegmentsWrapper {
|
|
543
549
|
/**
|
|
544
550
|
* List of Contact segment IDs
|
|
@@ -641,6 +647,8 @@ declare enum PhoneDeliverabilityStatus {
|
|
|
641
647
|
/** No status reported. */
|
|
642
648
|
NOT_SET = "NOT_SET"
|
|
643
649
|
}
|
|
650
|
+
/** @enumType */
|
|
651
|
+
type PhoneDeliverabilityStatusWithLiterals = PhoneDeliverabilityStatus | 'NO_PHONE_DELIVERABILITY_STATUS' | 'NOT_SET';
|
|
644
652
|
interface MemberInfo {
|
|
645
653
|
/**
|
|
646
654
|
* Member ID
|
|
@@ -1851,6 +1859,138 @@ declare enum WebhookIdentityType {
|
|
|
1851
1859
|
}
|
|
1852
1860
|
/** @enumType */
|
|
1853
1861
|
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
1862
|
+
type CreateContactApplicationErrors = {
|
|
1863
|
+
code?: 'DUPLICATE_CONTACT_EXISTS';
|
|
1864
|
+
description?: string;
|
|
1865
|
+
data?: DuplicateContactExists;
|
|
1866
|
+
} | {
|
|
1867
|
+
code?: 'INSUFFICIENT_CONTACT_DATA';
|
|
1868
|
+
description?: string;
|
|
1869
|
+
data?: Record<string, any>;
|
|
1870
|
+
} | {
|
|
1871
|
+
code?: 'CONTACT_ID_ALREADY_EXISTS';
|
|
1872
|
+
description?: string;
|
|
1873
|
+
data?: Record<string, any>;
|
|
1874
|
+
} | {
|
|
1875
|
+
code?: 'CANNOT_HAVE_MULTIPLE_PRIMARY_INFO';
|
|
1876
|
+
description?: string;
|
|
1877
|
+
data?: Record<string, any>;
|
|
1878
|
+
} | {
|
|
1879
|
+
code?: 'INVALID_EXTENDED_FIELD_VALUE';
|
|
1880
|
+
description?: string;
|
|
1881
|
+
data?: Record<string, any>;
|
|
1882
|
+
};
|
|
1883
|
+
type UpdateContactApplicationErrors = {
|
|
1884
|
+
code?: 'DUPLICATE_CONTACT_EXISTS';
|
|
1885
|
+
description?: string;
|
|
1886
|
+
data?: DuplicateContactExists;
|
|
1887
|
+
} | {
|
|
1888
|
+
code?: 'CONTACT_ALREADY_CHANGED';
|
|
1889
|
+
description?: string;
|
|
1890
|
+
data?: Record<string, any>;
|
|
1891
|
+
} | {
|
|
1892
|
+
code?: 'INSUFFICIENT_CONTACT_DATA';
|
|
1893
|
+
description?: string;
|
|
1894
|
+
data?: Record<string, any>;
|
|
1895
|
+
} | {
|
|
1896
|
+
code?: 'CONTACT_NOT_FOUND';
|
|
1897
|
+
description?: string;
|
|
1898
|
+
data?: Record<string, any>;
|
|
1899
|
+
} | {
|
|
1900
|
+
code?: 'INSUFFICIENT_UPDATE_CONTACT_DATA';
|
|
1901
|
+
description?: string;
|
|
1902
|
+
data?: Record<string, any>;
|
|
1903
|
+
} | {
|
|
1904
|
+
code?: 'CANNOT_HAVE_MULTIPLE_PRIMARY_INFO';
|
|
1905
|
+
description?: string;
|
|
1906
|
+
data?: Record<string, any>;
|
|
1907
|
+
} | {
|
|
1908
|
+
code?: 'INVALID_EXTENDED_FIELD_VALUE';
|
|
1909
|
+
description?: string;
|
|
1910
|
+
data?: Record<string, any>;
|
|
1911
|
+
} | {
|
|
1912
|
+
code?: 'CANNOT_UPDATE_MEMBER_EMAIL';
|
|
1913
|
+
description?: string;
|
|
1914
|
+
data?: Record<string, any>;
|
|
1915
|
+
};
|
|
1916
|
+
type MergeContactsApplicationErrors = {
|
|
1917
|
+
code?: 'CONTACT_NOT_FOUND';
|
|
1918
|
+
description?: string;
|
|
1919
|
+
data?: Record<string, any>;
|
|
1920
|
+
} | {
|
|
1921
|
+
code?: 'FAILED_PRECONDITION';
|
|
1922
|
+
description?: string;
|
|
1923
|
+
data?: Record<string, any>;
|
|
1924
|
+
} | {
|
|
1925
|
+
code?: 'ILLEGAL_MERGE';
|
|
1926
|
+
description?: string;
|
|
1927
|
+
data?: Record<string, any>;
|
|
1928
|
+
};
|
|
1929
|
+
type DeleteContactApplicationErrors = {
|
|
1930
|
+
code?: 'CANNOT_DELETE_MEMBER';
|
|
1931
|
+
description?: string;
|
|
1932
|
+
data?: Record<string, any>;
|
|
1933
|
+
} | {
|
|
1934
|
+
code?: 'CANNOT_DELETE_CONTACT_WITH_BILLING_SUBSCRIPTION';
|
|
1935
|
+
description?: string;
|
|
1936
|
+
data?: Record<string, any>;
|
|
1937
|
+
} | {
|
|
1938
|
+
code?: 'CANNOT_DELETE_MEMBER_OWNER_OR_CONTRIBUTOR';
|
|
1939
|
+
description?: string;
|
|
1940
|
+
data?: Record<string, any>;
|
|
1941
|
+
} | {
|
|
1942
|
+
code?: 'FAILED_DELETE_CONTACT_AFTER_MEMBER_DELETION';
|
|
1943
|
+
description?: string;
|
|
1944
|
+
data?: Record<string, any>;
|
|
1945
|
+
};
|
|
1946
|
+
type LabelContactApplicationErrors = {
|
|
1947
|
+
code?: 'CONTACT_NOT_FOUND';
|
|
1948
|
+
description?: string;
|
|
1949
|
+
data?: Record<string, any>;
|
|
1950
|
+
};
|
|
1951
|
+
type UnlabelContactApplicationErrors = {
|
|
1952
|
+
code?: 'CONTACT_NOT_FOUND';
|
|
1953
|
+
description?: string;
|
|
1954
|
+
data?: Record<string, any>;
|
|
1955
|
+
};
|
|
1956
|
+
type QueryContactsApplicationErrors = {
|
|
1957
|
+
code?: 'UNSUPPORTED_SORT_FIELD';
|
|
1958
|
+
description?: string;
|
|
1959
|
+
data?: Record<string, any>;
|
|
1960
|
+
} | {
|
|
1961
|
+
code?: 'ILLEGAL_LIMIT';
|
|
1962
|
+
description?: string;
|
|
1963
|
+
data?: Record<string, any>;
|
|
1964
|
+
} | {
|
|
1965
|
+
code?: 'MALFORMED_FILTER';
|
|
1966
|
+
description?: string;
|
|
1967
|
+
data?: Record<string, any>;
|
|
1968
|
+
} | {
|
|
1969
|
+
code?: 'UNSUPPORTED_FILTER';
|
|
1970
|
+
description?: string;
|
|
1971
|
+
data?: Record<string, any>;
|
|
1972
|
+
} | {
|
|
1973
|
+
code?: 'UNSUPPORTED_FILTER_FIELD_UNKNOWN';
|
|
1974
|
+
description?: string;
|
|
1975
|
+
data?: Record<string, any>;
|
|
1976
|
+
} | {
|
|
1977
|
+
code?: 'UNSUPPORTED_FILTER_OPERATOR';
|
|
1978
|
+
description?: string;
|
|
1979
|
+
data?: Record<string, any>;
|
|
1980
|
+
} | {
|
|
1981
|
+
code?: 'UNSUPPORTED_FILTER_VALUE';
|
|
1982
|
+
description?: string;
|
|
1983
|
+
data?: Record<string, any>;
|
|
1984
|
+
} | {
|
|
1985
|
+
code?: 'UNSUPPORTED_FILTER_VALUE_TYPE';
|
|
1986
|
+
description?: string;
|
|
1987
|
+
data?: Record<string, any>;
|
|
1988
|
+
};
|
|
1989
|
+
type GetContactApplicationErrors = {
|
|
1990
|
+
code?: 'CONTACT_NOT_FOUND';
|
|
1991
|
+
description?: string;
|
|
1992
|
+
data?: Record<string, any>;
|
|
1993
|
+
};
|
|
1854
1994
|
interface BaseEventMetadata {
|
|
1855
1995
|
/**
|
|
1856
1996
|
* App instance ID.
|
|
@@ -1899,17 +2039,145 @@ interface ContactCreatedEnvelope {
|
|
|
1899
2039
|
entity: Contact;
|
|
1900
2040
|
metadata: EventMetadata;
|
|
1901
2041
|
}
|
|
2042
|
+
/**
|
|
2043
|
+
* Triggered when a contact is created.
|
|
2044
|
+
* @permissionScope Manage Stores
|
|
2045
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
2046
|
+
* @permissionScope Manage Events
|
|
2047
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2048
|
+
* @permissionScope Manage Challenges
|
|
2049
|
+
* @permissionScopeId SCOPE.CHALLENGES.MANAGE
|
|
2050
|
+
* @permissionScope Read Contacts
|
|
2051
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
|
|
2052
|
+
* @permissionScope Read Members and Contacts - all read permissions
|
|
2053
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
|
|
2054
|
+
* @permissionScope Manage Contacts
|
|
2055
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
2056
|
+
* @permissionScope Set Up Automations
|
|
2057
|
+
* @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
|
|
2058
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
2059
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
2060
|
+
* @permissionId CONTACTS.VIEW
|
|
2061
|
+
* @webhook
|
|
2062
|
+
* @eventType wix.contacts.v4.contact_created
|
|
2063
|
+
* @serviceIdentifier com.wixpress.contacts.core.api.v4.ContactsServiceV4
|
|
2064
|
+
* @slug created
|
|
2065
|
+
*/
|
|
2066
|
+
declare function onContactCreated(handler: (event: ContactCreatedEnvelope) => void | Promise<void>): void;
|
|
1902
2067
|
interface ContactDeletedEnvelope {
|
|
1903
2068
|
metadata: EventMetadata;
|
|
1904
2069
|
}
|
|
2070
|
+
/**
|
|
2071
|
+
* Triggered when a contact is deleted.
|
|
2072
|
+
*
|
|
2073
|
+
* If a contact is deleted as part of a merge, the `originatedFrom` property is sent as `merge`.
|
|
2074
|
+
* Otherwise, `originatedFrom` isn't returned.
|
|
2075
|
+
* @permissionScope Manage Stores
|
|
2076
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
2077
|
+
* @permissionScope Manage Events
|
|
2078
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2079
|
+
* @permissionScope Manage Challenges
|
|
2080
|
+
* @permissionScopeId SCOPE.CHALLENGES.MANAGE
|
|
2081
|
+
* @permissionScope Read Contacts
|
|
2082
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
|
|
2083
|
+
* @permissionScope Read Members and Contacts - all read permissions
|
|
2084
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
|
|
2085
|
+
* @permissionScope Manage Contacts
|
|
2086
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
2087
|
+
* @permissionScope Set Up Automations
|
|
2088
|
+
* @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
|
|
2089
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
2090
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
2091
|
+
* @permissionId CONTACTS.VIEW
|
|
2092
|
+
* @webhook
|
|
2093
|
+
* @eventType wix.contacts.v4.contact_deleted
|
|
2094
|
+
* @serviceIdentifier com.wixpress.contacts.core.api.v4.ContactsServiceV4
|
|
2095
|
+
* @slug deleted
|
|
2096
|
+
*/
|
|
2097
|
+
declare function onContactDeleted(handler: (event: ContactDeletedEnvelope) => void | Promise<void>): void;
|
|
1905
2098
|
interface ContactMergedEnvelope {
|
|
1906
2099
|
data: ContactMerged;
|
|
1907
2100
|
metadata: EventMetadata;
|
|
1908
2101
|
}
|
|
2102
|
+
/**
|
|
2103
|
+
* Triggered when one or more source contacts are merged into a target contact.
|
|
2104
|
+
* @permissionScope Manage Stores
|
|
2105
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
2106
|
+
* @permissionScope Manage Events
|
|
2107
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2108
|
+
* @permissionScope Manage Challenges
|
|
2109
|
+
* @permissionScopeId SCOPE.CHALLENGES.MANAGE
|
|
2110
|
+
* @permissionScope Read Contacts
|
|
2111
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
|
|
2112
|
+
* @permissionScope Read Members and Contacts - all read permissions
|
|
2113
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
|
|
2114
|
+
* @permissionScope Manage Contacts
|
|
2115
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
2116
|
+
* @permissionScope Set Up Automations
|
|
2117
|
+
* @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
|
|
2118
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
2119
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
2120
|
+
* @permissionId CONTACTS.VIEW
|
|
2121
|
+
* @webhook
|
|
2122
|
+
* @eventType wix.contacts.v4.contact_merged
|
|
2123
|
+
* @serviceIdentifier com.wixpress.contacts.core.api.v4.ContactsServiceV4
|
|
2124
|
+
* @slug merged
|
|
2125
|
+
*/
|
|
2126
|
+
declare function onContactMerged(handler: (event: ContactMergedEnvelope) => void | Promise<void>): void;
|
|
1909
2127
|
interface ContactUpdatedEnvelope {
|
|
1910
2128
|
entity: Contact;
|
|
1911
2129
|
metadata: EventMetadata;
|
|
1912
2130
|
}
|
|
2131
|
+
/**
|
|
2132
|
+
* Triggered when a contact is updated.
|
|
2133
|
+
* @permissionScope Manage Stores
|
|
2134
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
2135
|
+
* @permissionScope Manage Events
|
|
2136
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2137
|
+
* @permissionScope Manage Challenges
|
|
2138
|
+
* @permissionScopeId SCOPE.CHALLENGES.MANAGE
|
|
2139
|
+
* @permissionScope Read Contacts
|
|
2140
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
|
|
2141
|
+
* @permissionScope Read Members and Contacts - all read permissions
|
|
2142
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
|
|
2143
|
+
* @permissionScope Manage Contacts
|
|
2144
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
2145
|
+
* @permissionScope Set Up Automations
|
|
2146
|
+
* @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
|
|
2147
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
2148
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
2149
|
+
* @permissionId CONTACTS.VIEW
|
|
2150
|
+
* @webhook
|
|
2151
|
+
* @eventType wix.contacts.v4.contact_updated
|
|
2152
|
+
* @serviceIdentifier com.wixpress.contacts.core.api.v4.ContactsServiceV4
|
|
2153
|
+
* @slug updated
|
|
2154
|
+
*/
|
|
2155
|
+
declare function onContactUpdated(handler: (event: ContactUpdatedEnvelope) => void | Promise<void>): void;
|
|
2156
|
+
type ContactNonNullablePaths = `_id` | `revision` | `source.sourceType` | `lastActivity.activityType` | `info.emails.items` | `info.emails.items.${number}.tag` | `info.emails.items.${number}.email` | `info.phones.items` | `info.phones.items.${number}.tag` | `info.phones.items.${number}.phone` | `info.addresses.items` | `info.addresses.items.${number}.tag` | `info.addresses.items.${number}.address.streetAddress.number` | `info.addresses.items.${number}.address.streetAddress.name` | `info.labelKeys.items` | `primaryEmail.subscriptionStatus` | `primaryEmail.deliverabilityStatus` | `primaryPhone.subscriptionStatus`;
|
|
2157
|
+
/**
|
|
2158
|
+
* Creates a new contact.
|
|
2159
|
+
*
|
|
2160
|
+
* The `info` object must include at least one of the following:
|
|
2161
|
+
* - Name
|
|
2162
|
+
* - Phone number
|
|
2163
|
+
* - Email address
|
|
2164
|
+
*
|
|
2165
|
+
* By default, if the call contains an email already in use by another contact,
|
|
2166
|
+
* the new contact won't be created. To override this behavior, set `allowDuplicates` to `true`.
|
|
2167
|
+
* @param info - Contact info.
|
|
2168
|
+
* @public
|
|
2169
|
+
* @requiredField info
|
|
2170
|
+
* @param options - Create contact options.
|
|
2171
|
+
* @permissionId CONTACTS.MODIFY
|
|
2172
|
+
* @applicableIdentity APP
|
|
2173
|
+
* @returns Contact.
|
|
2174
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.CreateContact
|
|
2175
|
+
*/
|
|
2176
|
+
declare function createContact(info: ContactInfo, options?: CreateContactOptions): Promise<NonNullablePaths<CreateContactResponse, {
|
|
2177
|
+
[P in ContactNonNullablePaths]: `contact.${P}`;
|
|
2178
|
+
}[ContactNonNullablePaths]> & {
|
|
2179
|
+
__applicationErrorsType?: CreateContactApplicationErrors;
|
|
2180
|
+
}>;
|
|
1913
2181
|
interface CreateContactOptions {
|
|
1914
2182
|
/**
|
|
1915
2183
|
* Controls whether the call will succeed
|
|
@@ -1925,6 +2193,41 @@ interface CreateContactOptions {
|
|
|
1925
2193
|
*/
|
|
1926
2194
|
allowDuplicates?: boolean;
|
|
1927
2195
|
}
|
|
2196
|
+
/**
|
|
2197
|
+
* Updates a contact.
|
|
2198
|
+
*
|
|
2199
|
+
* Each time the contact is updated,
|
|
2200
|
+
* `revision` increments by 1.
|
|
2201
|
+
* The existing `revision` must be included when updating the contact.
|
|
2202
|
+
* This ensures you're working with the latest contact information,
|
|
2203
|
+
* and it prevents unintended overwrites.
|
|
2204
|
+
*
|
|
2205
|
+
* You can't call Update Contact to update the `primaryEmail` of a contact who is also a member.
|
|
2206
|
+
* Instead, use the Members API to update the member's login email, which will also update the contact's primary email.
|
|
2207
|
+
*
|
|
2208
|
+
* Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers. Make sure to specify the contact ID when calling Update Contact.
|
|
2209
|
+
* @param contactId - ID of the contact to update.
|
|
2210
|
+
* @param info - Contact info.
|
|
2211
|
+
* @param revision - Revision number.
|
|
2212
|
+
* When updating, include the existing `revision`
|
|
2213
|
+
* to prevent conflicting updates.
|
|
2214
|
+
* @public
|
|
2215
|
+
* @requiredField contactId
|
|
2216
|
+
* @requiredField info
|
|
2217
|
+
* @requiredField revision
|
|
2218
|
+
* @param options - Contact update options.
|
|
2219
|
+
* @permissionId CONTACTS.MODIFY
|
|
2220
|
+
* @permissionId CONTACTS.MODIFY_MEMBERSHIP_STATUS
|
|
2221
|
+
* @permissionId CONTACTS.MODIFY_MEMBER_PRIMARY_EMAIL_PERMISSION
|
|
2222
|
+
* @applicableIdentity APP
|
|
2223
|
+
* @returns Updated contact.
|
|
2224
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.UpdateContact
|
|
2225
|
+
*/
|
|
2226
|
+
declare function updateContact(contactId: string, info: ContactInfo, revision: number, options?: UpdateContactOptions): Promise<NonNullablePaths<UpdateContactResponse, {
|
|
2227
|
+
[P in ContactNonNullablePaths]: `contact.${P}`;
|
|
2228
|
+
}[ContactNonNullablePaths]> & {
|
|
2229
|
+
__applicationErrorsType?: UpdateContactApplicationErrors;
|
|
2230
|
+
}>;
|
|
1928
2231
|
interface UpdateContactOptions {
|
|
1929
2232
|
/**
|
|
1930
2233
|
* Controls whether the call will succeed
|
|
@@ -1940,6 +2243,54 @@ interface UpdateContactOptions {
|
|
|
1940
2243
|
*/
|
|
1941
2244
|
allowDuplicates?: boolean;
|
|
1942
2245
|
}
|
|
2246
|
+
/**
|
|
2247
|
+
* Merges source contacts into a target contact.
|
|
2248
|
+
*
|
|
2249
|
+
* Merging contacts has the following effects on the target contact:
|
|
2250
|
+
*
|
|
2251
|
+
* - No target contact data is overwritten or deleted.
|
|
2252
|
+
* - Arrays (emails, phone numbers, addresses, and labels) from the source contacts are added to the target contact's arrays.
|
|
2253
|
+
* - If you merge more than one source contact, the 1st source contact specified is added first, then the 2nd, and so on.
|
|
2254
|
+
* - If there is duplicate information between the target contact and the source contact, the information isn't duplicated in the target contact's arrays.
|
|
2255
|
+
*
|
|
2256
|
+
* <blockquote class="important">
|
|
2257
|
+
*
|
|
2258
|
+
* __Important:__
|
|
2259
|
+
* Merges cannot be undone.
|
|
2260
|
+
* In REST, call Preview Merge Contacts to test before merging.
|
|
2261
|
+
*
|
|
2262
|
+
* </blockquote>
|
|
2263
|
+
*
|
|
2264
|
+
* When you merge contacts, source contacts are typically deleted.
|
|
2265
|
+
* However, if a source contact is a site member or a Wix user,
|
|
2266
|
+
* the merge will fail because site members and Wix users can't be deleted.
|
|
2267
|
+
* This means that site members and Wix users can only be specified as target contacts in a merge.
|
|
2268
|
+
*
|
|
2269
|
+
* After merging, calling Get Contact with a deleted source contact ID returns the target contact ID.
|
|
2270
|
+
* Specifying a deleted source contact ID is not supported on any other method.
|
|
2271
|
+
*
|
|
2272
|
+
* When contacts are merged:
|
|
2273
|
+
*
|
|
2274
|
+
* - The Contact Merged event is triggered.
|
|
2275
|
+
* - The Contact Updated event is triggered for the target contact. `originatedFrom` is set to `merge`.
|
|
2276
|
+
* - The Contact Deleted event is triggered for each source contact. `originatedFrom` is set to `merge`.
|
|
2277
|
+
* @param targetContactId - Target contact ID.
|
|
2278
|
+
* @param targetContactRevision - Target contact revision number, which increments by 1 each time the contact is updated.
|
|
2279
|
+
* To prevent conflicting changes,
|
|
2280
|
+
* the target contact's current `revision` must be specified.
|
|
2281
|
+
* @public
|
|
2282
|
+
* @requiredField targetContactId
|
|
2283
|
+
* @requiredField targetContactRevision
|
|
2284
|
+
* @param options - Merge contacts options.
|
|
2285
|
+
* @permissionId CONTACTS.MERGE
|
|
2286
|
+
* @applicableIdentity APP
|
|
2287
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.MergeContacts
|
|
2288
|
+
*/
|
|
2289
|
+
declare function mergeContacts(targetContactId: string, targetContactRevision: number, options?: MergeContactsOptions): Promise<NonNullablePaths<MergeContactsResponse, {
|
|
2290
|
+
[P in ContactNonNullablePaths]: `contact.${P}`;
|
|
2291
|
+
}[ContactNonNullablePaths]> & {
|
|
2292
|
+
__applicationErrorsType?: MergeContactsApplicationErrors;
|
|
2293
|
+
}>;
|
|
1943
2294
|
interface MergeContactsOptions {
|
|
1944
2295
|
/**
|
|
1945
2296
|
* IDs of up to 5 contacts to merge into the target contact.
|
|
@@ -1950,6 +2301,99 @@ interface MergeContactsOptions {
|
|
|
1950
2301
|
*/
|
|
1951
2302
|
sourceContactIds?: string[];
|
|
1952
2303
|
}
|
|
2304
|
+
/**
|
|
2305
|
+
* Deletes a contact.
|
|
2306
|
+
*
|
|
2307
|
+
* Deleting a contact permanently removes it from the contact list.
|
|
2308
|
+
* If a contact is also a site member or Wix user, or has a valid billing subscription,
|
|
2309
|
+
* the contact can't be deleted. The related site member or Wix user must first be deleted
|
|
2310
|
+
* and any valid billing subscriptions must be canceled, before the contact can be deleted.
|
|
2311
|
+
*
|
|
2312
|
+
* Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
|
|
2313
|
+
* Make sure to specify the contact ID when calling Delete Contact.
|
|
2314
|
+
* @param contactId - ID of the contact to delete.
|
|
2315
|
+
* @public
|
|
2316
|
+
* @requiredField contactId
|
|
2317
|
+
* @permissionId CONTACTS.MODIFY
|
|
2318
|
+
* @permissionId MEMBERS.MEMBER_DELETE
|
|
2319
|
+
* @applicableIdentity APP
|
|
2320
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.DeleteContact
|
|
2321
|
+
*/
|
|
2322
|
+
declare function deleteContact(contactId: string): Promise<void & {
|
|
2323
|
+
__applicationErrorsType?: DeleteContactApplicationErrors;
|
|
2324
|
+
}>;
|
|
2325
|
+
/**
|
|
2326
|
+
* Adds labels to a contact.
|
|
2327
|
+
*
|
|
2328
|
+
* Use the Labels API to create or retrieve labels.
|
|
2329
|
+
*
|
|
2330
|
+
* Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
|
|
2331
|
+
* Make sure to specify the contact ID when calling Label Contact.
|
|
2332
|
+
* @param contactId - ID of the contact to add labels to.
|
|
2333
|
+
* @param labelKeys - List of label keys to add to the contact.
|
|
2334
|
+
*
|
|
2335
|
+
* Label keys must exist to be added to the contact.
|
|
2336
|
+
* Use the Labels API to create or retrieve labels.
|
|
2337
|
+
* @public
|
|
2338
|
+
* @requiredField contactId
|
|
2339
|
+
* @requiredField labelKeys
|
|
2340
|
+
* @permissionId CONTACTS.MODIFY
|
|
2341
|
+
* @applicableIdentity APP
|
|
2342
|
+
* @returns Updated contact.
|
|
2343
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.LabelContact
|
|
2344
|
+
*/
|
|
2345
|
+
declare function labelContact(contactId: string, labelKeys: string[]): Promise<NonNullablePaths<LabelContactResponse, {
|
|
2346
|
+
[P in ContactNonNullablePaths]: `contact.${P}`;
|
|
2347
|
+
}[ContactNonNullablePaths]> & {
|
|
2348
|
+
__applicationErrorsType?: LabelContactApplicationErrors;
|
|
2349
|
+
}>;
|
|
2350
|
+
/**
|
|
2351
|
+
* Removes labels from a contact.
|
|
2352
|
+
*
|
|
2353
|
+
* If a label is no longer needed
|
|
2354
|
+
* and you want to remove it from all contacts,
|
|
2355
|
+
* you can delete by calling Delete Label from the Labels API.
|
|
2356
|
+
*
|
|
2357
|
+
* Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
|
|
2358
|
+
* Make sure to specify the contact ID when calling Unlabel Contact.
|
|
2359
|
+
* @param contactId - ID of the contact to remove labels from.
|
|
2360
|
+
* @param labelKeys - List of label keys to remove from the contact.
|
|
2361
|
+
* @public
|
|
2362
|
+
* @requiredField contactId
|
|
2363
|
+
* @requiredField labelKeys
|
|
2364
|
+
* @permissionId CONTACTS.MODIFY
|
|
2365
|
+
* @applicableIdentity APP
|
|
2366
|
+
* @returns Updated contact.
|
|
2367
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.UnlabelContact
|
|
2368
|
+
*/
|
|
2369
|
+
declare function unlabelContact(contactId: string, labelKeys: string[]): Promise<NonNullablePaths<UnlabelContactResponse, {
|
|
2370
|
+
[P in ContactNonNullablePaths]: `contact.${P}`;
|
|
2371
|
+
}[ContactNonNullablePaths]> & {
|
|
2372
|
+
__applicationErrorsType?: UnlabelContactApplicationErrors;
|
|
2373
|
+
}>;
|
|
2374
|
+
/**
|
|
2375
|
+
* Creates a query to retrieve a list of contacts.
|
|
2376
|
+
*
|
|
2377
|
+
* The `queryContacts()` function builds a query to retrieve a list of contacts and returns a `ContactsQueryBuilder` object.
|
|
2378
|
+
*
|
|
2379
|
+
* The returned object contains the query definition, which is typically used to run the query using the `find()` function.
|
|
2380
|
+
*
|
|
2381
|
+
* You can refine the query by chaining `ContactsQueryBuilder` functions onto the query. `ContactsQueryBuilder` functions enable you to sort, filter, and control the results `queryContacts()` returns.
|
|
2382
|
+
*
|
|
2383
|
+
* `queryContacts()` runs with these `ContactsQueryBuilder` defaults, which you can override:
|
|
2384
|
+
*
|
|
2385
|
+
* - `skip(0)`
|
|
2386
|
+
* - `limit(50)`
|
|
2387
|
+
* - `descending("_createdDate")`
|
|
2388
|
+
*
|
|
2389
|
+
* The functions that are chained to `queryContacts()` are applied in the order they are called. For example, if you apply `ascending('info.company')` and then `descending('info.name.last')`, the results are sorted first by the company name, and then, if there are multiple results with the same company, the items are sorted by last name.
|
|
2390
|
+
* @public
|
|
2391
|
+
* @param options - Query contact options.
|
|
2392
|
+
* @permissionId CONTACTS.VIEW
|
|
2393
|
+
* @applicableIdentity APP
|
|
2394
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.QueryContacts
|
|
2395
|
+
*/
|
|
2396
|
+
declare function queryContacts(options?: QueryContactsOptions): ContactsQueryBuilder;
|
|
1953
2397
|
interface QueryContactsOptions {
|
|
1954
2398
|
}
|
|
1955
2399
|
interface QueryOffsetResult {
|
|
@@ -2016,6 +2460,31 @@ interface ContactsQueryBuilder {
|
|
|
2016
2460
|
skip: (skip: number) => ContactsQueryBuilder;
|
|
2017
2461
|
find: () => Promise<ContactsQueryResult>;
|
|
2018
2462
|
}
|
|
2463
|
+
/**
|
|
2464
|
+
* Retrieves a contact.
|
|
2465
|
+
*
|
|
2466
|
+
* #### Getting Merged Contacts
|
|
2467
|
+
*
|
|
2468
|
+
* When a source contact is merged
|
|
2469
|
+
* with a target contact, the source contact is deleted.
|
|
2470
|
+
* When calling Get Contact for a merged contact,
|
|
2471
|
+
* you can use the source or target contact ID.
|
|
2472
|
+
* In both bases, the target contact is returned.
|
|
2473
|
+
*
|
|
2474
|
+
* This is supported only when calling Get Contact on merged contacts.
|
|
2475
|
+
* Previously deleted source contact IDs can't be used for any other method.
|
|
2476
|
+
* @param _id - ID of the contact to retrieve.
|
|
2477
|
+
* @public
|
|
2478
|
+
* @requiredField _id
|
|
2479
|
+
* @param options - Get contact options.
|
|
2480
|
+
* @permissionId CONTACTS.VIEW
|
|
2481
|
+
* @applicableIdentity APP
|
|
2482
|
+
* @returns The requested contact.
|
|
2483
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.GetContact
|
|
2484
|
+
*/
|
|
2485
|
+
declare function getContact(_id: string, options?: GetContactOptions): Promise<NonNullablePaths<Contact, ContactNonNullablePaths> & {
|
|
2486
|
+
__applicationErrorsType?: GetContactApplicationErrors;
|
|
2487
|
+
}>;
|
|
2019
2488
|
interface GetContactOptions {
|
|
2020
2489
|
/**
|
|
2021
2490
|
* List of projected fields to return.
|
|
@@ -2048,4 +2517,4 @@ interface GetContactOptions {
|
|
|
2048
2517
|
fieldsets?: ContactFieldSetWithLiterals[];
|
|
2049
2518
|
}
|
|
2050
2519
|
|
|
2051
|
-
export { type
|
|
2520
|
+
export { Action, type ActionEvent, type ActionWithLiterals, type ActivityIcon, type Address, type AddressLocation, type AddressStreetOneOf, AddressTag, type AddressTagWithLiterals, type ApplicationError, type AssigneesWrapper, type BaseEventMetadata, type BulkActionMetadata, type BulkAddSegmentToContactsRequest, type BulkAddSegmentToContactsResponse, type BulkDeleteContactsRequest, type BulkDeleteContactsResponse, type BulkLabelAndUnlabelContactsRequest, type BulkLabelAndUnlabelContactsResponse, type BulkRemoveSegmentFromContactsRequest, type BulkRemoveSegmentFromContactsResponse, type BulkUpdateContactsRequest, type BulkUpdateContactsResponse, type BulkUpsertContactsRequest, type BulkUpsertContactsResponse, type BulkUpsertContactsResponseMetadata, type Contact, type ContactActivity, ContactActivityType, type ContactActivityTypeWithLiterals, type ContactAddedToSegment, type ContactAddress, type ContactAddressesWrapper, type ContactChanged, type ContactCreatedEnvelope, type ContactDeletedEnvelope, type ContactEmail, type ContactEmailSubscriptionUpdated, type ContactEmailsWrapper, ContactFieldSet, type ContactFieldSetWithLiterals, type ContactInfo, type ContactMerged, type ContactMergedEnvelope, type ContactName, type ContactPhone, type ContactPhoneSubscriptionUpdated, type ContactPhonesWrapper, type ContactPicture, type ContactPrimaryInfoUpdated, type ContactRemovedFromSegment, type ContactSource, ContactSourceType, type ContactSourceTypeWithLiterals, type ContactSubmitted, type ContactUpdatedEnvelope, type ContactsFacet, ContactsFacetType, type ContactsFacetTypeWithLiterals, type ContactsQueryBuilder, type ContactsQueryResult, type CountContactsRequest, type CountContactsResponse, type CreateContactApplicationErrors, type CreateContactOptions, type CreateContactRequest, type CreateContactResponse, type CursorPaging, type CursorPagingMetadata, type Cursors, type DeleteContactApplicationErrors, type DeleteContactRequest, type DeleteContactResponse, type DomainEvent, type DomainEventBodyOneOf, type DuplicateContactExists, EmailDeliverabilityStatus, type EmailDeliverabilityStatusWithLiterals, EmailTag, type EmailTagWithLiterals, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type Error, type EventMetadata, type ExtendedFieldsWrapper, type GeneratePictureUploadUrlRequest, type GeneratePictureUploadUrlResponse, type GetContactApplicationErrors, type GetContactOptions, type GetContactRequest, type GetContactResponse, GetContactResponseType, type GetContactResponseTypeWithLiterals, type GroupInfo, type IdentificationData, type IdentificationDataIdOneOf, ImageProvider, type ImageProviderWithLiterals, type Item, type ItemMetadata, type LabelAndUnlabelContactRequest, type LabelAndUnlabelContactResponse, type LabelContactApplicationErrors, type LabelContactRequest, type LabelContactResponse, type LabelsWrapper, type LastActivityUpdate, type ListContactIdsBySegmentRequest, type ListContactIdsBySegmentResponse, type ListContactsRequest, type ListContactsResponse, type ListFacetsRequest, type ListFacetsResponse, type LocationsWrapper, type MemberInfo, MemberStatus, type MemberStatusWithLiterals, type MergeContactsApplicationErrors, type MergeContactsOptions, type MergeContactsRequest, type MergeContactsResponse, type MessageEnvelope, type Metadata, Mode, type ModeWithLiterals, type Paging, type PagingMetadata, PhoneDeliverabilityStatus, type PhoneDeliverabilityStatusWithLiterals, PhoneTag, type PhoneTagWithLiterals, type PreviewMergeContactsRequest, type PreviewMergeContactsResponse, type PrimaryContactInfo, type PrimaryEmail, type PrimaryPhone, type PrimarySubscriptionStatus, PrivacyStatus, type PrivacyStatusWithLiterals, type ProfileInfo, type Query, type QueryContactsApplicationErrors, type QueryContactsOptions, type QueryContactsRequest, type QueryContactsResponse, type QueryFacetsRequest, type QueryFacetsResponse, type RestoreInfo, Role, type RoleWithLiterals, type Search, type SearchContactsRequest, type SearchContactsResponse, type SearchDetails, type SearchPagingMethodOneOf, type SegmentsWrapper, type SessionInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type StreetAddress, type Subdivision, SubdivisionType, type SubdivisionTypeWithLiterals, SubmitOperation, type SubmitOperationWithLiterals, SubscriptionStatus, type SubscriptionStatusWithLiterals, type SyncSubmitContactRequest, type SyncSubmitContactResponse, type UnlabelContactApplicationErrors, type UnlabelContactRequest, type UnlabelContactResponse, type UpdateContactApplicationErrors, type UpdateContactOptions, type UpdateContactRequest, type UpdateContactResponse, type UpsertContactRequest, type UpsertContactResponse, UpsertContactResponseAction, type UpsertContactResponseActionWithLiterals, type UserInfo, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createContact, deleteContact, getContact, labelContact, mergeContacts, onContactCreated, onContactDeleted, onContactMerged, onContactUpdated, queryContacts, unlabelContact, updateContact };
|