@wix/auto_sdk_crm_contacts 1.0.388 → 1.0.390
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} +478 -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} +478 -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} +478 -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} +478 -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,153 @@ 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 Restaurants - all permissions
|
|
2055
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
2056
|
+
* @permissionScope Manage Contacts
|
|
2057
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
2058
|
+
* @permissionScope Set Up Automations
|
|
2059
|
+
* @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
|
|
2060
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
2061
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
2062
|
+
* @permissionId CONTACTS.VIEW
|
|
2063
|
+
* @webhook
|
|
2064
|
+
* @eventType wix.contacts.v4.contact_created
|
|
2065
|
+
* @serviceIdentifier com.wixpress.contacts.core.api.v4.ContactsServiceV4
|
|
2066
|
+
* @slug created
|
|
2067
|
+
*/
|
|
2068
|
+
declare function onContactCreated(handler: (event: ContactCreatedEnvelope) => void | Promise<void>): void;
|
|
1902
2069
|
interface ContactDeletedEnvelope {
|
|
1903
2070
|
metadata: EventMetadata;
|
|
1904
2071
|
}
|
|
2072
|
+
/**
|
|
2073
|
+
* Triggered when a contact is deleted.
|
|
2074
|
+
*
|
|
2075
|
+
* If a contact is deleted as part of a merge, the `originatedFrom` property is sent as `merge`.
|
|
2076
|
+
* Otherwise, `originatedFrom` isn't returned.
|
|
2077
|
+
* @permissionScope Manage Stores
|
|
2078
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
2079
|
+
* @permissionScope Manage Events
|
|
2080
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2081
|
+
* @permissionScope Manage Challenges
|
|
2082
|
+
* @permissionScopeId SCOPE.CHALLENGES.MANAGE
|
|
2083
|
+
* @permissionScope Read Contacts
|
|
2084
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
|
|
2085
|
+
* @permissionScope Read Members and Contacts - all read permissions
|
|
2086
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
|
|
2087
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
2088
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
2089
|
+
* @permissionScope Manage Contacts
|
|
2090
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
2091
|
+
* @permissionScope Set Up Automations
|
|
2092
|
+
* @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
|
|
2093
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
2094
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
2095
|
+
* @permissionId CONTACTS.VIEW
|
|
2096
|
+
* @webhook
|
|
2097
|
+
* @eventType wix.contacts.v4.contact_deleted
|
|
2098
|
+
* @serviceIdentifier com.wixpress.contacts.core.api.v4.ContactsServiceV4
|
|
2099
|
+
* @slug deleted
|
|
2100
|
+
*/
|
|
2101
|
+
declare function onContactDeleted(handler: (event: ContactDeletedEnvelope) => void | Promise<void>): void;
|
|
1905
2102
|
interface ContactMergedEnvelope {
|
|
1906
2103
|
data: ContactMerged;
|
|
1907
2104
|
metadata: EventMetadata;
|
|
1908
2105
|
}
|
|
2106
|
+
/**
|
|
2107
|
+
* Triggered when one or more source contacts are merged into a target contact.
|
|
2108
|
+
* @permissionScope Manage Stores
|
|
2109
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
2110
|
+
* @permissionScope Manage Events
|
|
2111
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2112
|
+
* @permissionScope Manage Challenges
|
|
2113
|
+
* @permissionScopeId SCOPE.CHALLENGES.MANAGE
|
|
2114
|
+
* @permissionScope Read Contacts
|
|
2115
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
|
|
2116
|
+
* @permissionScope Read Members and Contacts - all read permissions
|
|
2117
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
|
|
2118
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
2119
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
2120
|
+
* @permissionScope Manage Contacts
|
|
2121
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
2122
|
+
* @permissionScope Set Up Automations
|
|
2123
|
+
* @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
|
|
2124
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
2125
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
2126
|
+
* @permissionId CONTACTS.VIEW
|
|
2127
|
+
* @webhook
|
|
2128
|
+
* @eventType wix.contacts.v4.contact_merged
|
|
2129
|
+
* @serviceIdentifier com.wixpress.contacts.core.api.v4.ContactsServiceV4
|
|
2130
|
+
* @slug merged
|
|
2131
|
+
*/
|
|
2132
|
+
declare function onContactMerged(handler: (event: ContactMergedEnvelope) => void | Promise<void>): void;
|
|
1909
2133
|
interface ContactUpdatedEnvelope {
|
|
1910
2134
|
entity: Contact;
|
|
1911
2135
|
metadata: EventMetadata;
|
|
1912
2136
|
}
|
|
2137
|
+
/**
|
|
2138
|
+
* Triggered when a contact is updated.
|
|
2139
|
+
* @permissionScope Manage Stores
|
|
2140
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
2141
|
+
* @permissionScope Manage Events
|
|
2142
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
2143
|
+
* @permissionScope Manage Challenges
|
|
2144
|
+
* @permissionScopeId SCOPE.CHALLENGES.MANAGE
|
|
2145
|
+
* @permissionScope Read Contacts
|
|
2146
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.READ-CONTACTS
|
|
2147
|
+
* @permissionScope Read Members and Contacts - all read permissions
|
|
2148
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
|
|
2149
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
2150
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
2151
|
+
* @permissionScope Manage Contacts
|
|
2152
|
+
* @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACTS
|
|
2153
|
+
* @permissionScope Set Up Automations
|
|
2154
|
+
* @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
|
|
2155
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
2156
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
2157
|
+
* @permissionId CONTACTS.VIEW
|
|
2158
|
+
* @webhook
|
|
2159
|
+
* @eventType wix.contacts.v4.contact_updated
|
|
2160
|
+
* @serviceIdentifier com.wixpress.contacts.core.api.v4.ContactsServiceV4
|
|
2161
|
+
* @slug updated
|
|
2162
|
+
*/
|
|
2163
|
+
declare function onContactUpdated(handler: (event: ContactUpdatedEnvelope) => void | Promise<void>): void;
|
|
2164
|
+
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`;
|
|
2165
|
+
/**
|
|
2166
|
+
* Creates a new contact.
|
|
2167
|
+
*
|
|
2168
|
+
* The `info` object must include at least one of the following:
|
|
2169
|
+
* - Name
|
|
2170
|
+
* - Phone number
|
|
2171
|
+
* - Email address
|
|
2172
|
+
*
|
|
2173
|
+
* By default, if the call contains an email already in use by another contact,
|
|
2174
|
+
* the new contact won't be created. To override this behavior, set `allowDuplicates` to `true`.
|
|
2175
|
+
* @param info - Contact info.
|
|
2176
|
+
* @public
|
|
2177
|
+
* @requiredField info
|
|
2178
|
+
* @param options - Create contact options.
|
|
2179
|
+
* @permissionId CONTACTS.MODIFY
|
|
2180
|
+
* @applicableIdentity APP
|
|
2181
|
+
* @returns Contact.
|
|
2182
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.CreateContact
|
|
2183
|
+
*/
|
|
2184
|
+
declare function createContact(info: ContactInfo, options?: CreateContactOptions): Promise<NonNullablePaths<CreateContactResponse, {
|
|
2185
|
+
[P in ContactNonNullablePaths]: `contact.${P}`;
|
|
2186
|
+
}[ContactNonNullablePaths]> & {
|
|
2187
|
+
__applicationErrorsType?: CreateContactApplicationErrors;
|
|
2188
|
+
}>;
|
|
1913
2189
|
interface CreateContactOptions {
|
|
1914
2190
|
/**
|
|
1915
2191
|
* Controls whether the call will succeed
|
|
@@ -1925,6 +2201,41 @@ interface CreateContactOptions {
|
|
|
1925
2201
|
*/
|
|
1926
2202
|
allowDuplicates?: boolean;
|
|
1927
2203
|
}
|
|
2204
|
+
/**
|
|
2205
|
+
* Updates a contact.
|
|
2206
|
+
*
|
|
2207
|
+
* Each time the contact is updated,
|
|
2208
|
+
* `revision` increments by 1.
|
|
2209
|
+
* The existing `revision` must be included when updating the contact.
|
|
2210
|
+
* This ensures you're working with the latest contact information,
|
|
2211
|
+
* and it prevents unintended overwrites.
|
|
2212
|
+
*
|
|
2213
|
+
* You can't call Update Contact to update the `primaryEmail` of a contact who is also a member.
|
|
2214
|
+
* Instead, use the Members API to update the member's login email, which will also update the contact's primary email.
|
|
2215
|
+
*
|
|
2216
|
+
* 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.
|
|
2217
|
+
* @param contactId - ID of the contact to update.
|
|
2218
|
+
* @param info - Contact info.
|
|
2219
|
+
* @param revision - Revision number.
|
|
2220
|
+
* When updating, include the existing `revision`
|
|
2221
|
+
* to prevent conflicting updates.
|
|
2222
|
+
* @public
|
|
2223
|
+
* @requiredField contactId
|
|
2224
|
+
* @requiredField info
|
|
2225
|
+
* @requiredField revision
|
|
2226
|
+
* @param options - Contact update options.
|
|
2227
|
+
* @permissionId CONTACTS.MODIFY
|
|
2228
|
+
* @permissionId CONTACTS.MODIFY_MEMBERSHIP_STATUS
|
|
2229
|
+
* @permissionId CONTACTS.MODIFY_MEMBER_PRIMARY_EMAIL_PERMISSION
|
|
2230
|
+
* @applicableIdentity APP
|
|
2231
|
+
* @returns Updated contact.
|
|
2232
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.UpdateContact
|
|
2233
|
+
*/
|
|
2234
|
+
declare function updateContact(contactId: string, info: ContactInfo, revision: number, options?: UpdateContactOptions): Promise<NonNullablePaths<UpdateContactResponse, {
|
|
2235
|
+
[P in ContactNonNullablePaths]: `contact.${P}`;
|
|
2236
|
+
}[ContactNonNullablePaths]> & {
|
|
2237
|
+
__applicationErrorsType?: UpdateContactApplicationErrors;
|
|
2238
|
+
}>;
|
|
1928
2239
|
interface UpdateContactOptions {
|
|
1929
2240
|
/**
|
|
1930
2241
|
* Controls whether the call will succeed
|
|
@@ -1940,6 +2251,54 @@ interface UpdateContactOptions {
|
|
|
1940
2251
|
*/
|
|
1941
2252
|
allowDuplicates?: boolean;
|
|
1942
2253
|
}
|
|
2254
|
+
/**
|
|
2255
|
+
* Merges source contacts into a target contact.
|
|
2256
|
+
*
|
|
2257
|
+
* Merging contacts has the following effects on the target contact:
|
|
2258
|
+
*
|
|
2259
|
+
* - No target contact data is overwritten or deleted.
|
|
2260
|
+
* - Arrays (emails, phone numbers, addresses, and labels) from the source contacts are added to the target contact's arrays.
|
|
2261
|
+
* - If you merge more than one source contact, the 1st source contact specified is added first, then the 2nd, and so on.
|
|
2262
|
+
* - If there is duplicate information between the target contact and the source contact, the information isn't duplicated in the target contact's arrays.
|
|
2263
|
+
*
|
|
2264
|
+
* <blockquote class="important">
|
|
2265
|
+
*
|
|
2266
|
+
* __Important:__
|
|
2267
|
+
* Merges cannot be undone.
|
|
2268
|
+
* In REST, call Preview Merge Contacts to test before merging.
|
|
2269
|
+
*
|
|
2270
|
+
* </blockquote>
|
|
2271
|
+
*
|
|
2272
|
+
* When you merge contacts, source contacts are typically deleted.
|
|
2273
|
+
* However, if a source contact is a site member or a Wix user,
|
|
2274
|
+
* the merge will fail because site members and Wix users can't be deleted.
|
|
2275
|
+
* This means that site members and Wix users can only be specified as target contacts in a merge.
|
|
2276
|
+
*
|
|
2277
|
+
* After merging, calling Get Contact with a deleted source contact ID returns the target contact ID.
|
|
2278
|
+
* Specifying a deleted source contact ID is not supported on any other method.
|
|
2279
|
+
*
|
|
2280
|
+
* When contacts are merged:
|
|
2281
|
+
*
|
|
2282
|
+
* - The Contact Merged event is triggered.
|
|
2283
|
+
* - The Contact Updated event is triggered for the target contact. `originatedFrom` is set to `merge`.
|
|
2284
|
+
* - The Contact Deleted event is triggered for each source contact. `originatedFrom` is set to `merge`.
|
|
2285
|
+
* @param targetContactId - Target contact ID.
|
|
2286
|
+
* @param targetContactRevision - Target contact revision number, which increments by 1 each time the contact is updated.
|
|
2287
|
+
* To prevent conflicting changes,
|
|
2288
|
+
* the target contact's current `revision` must be specified.
|
|
2289
|
+
* @public
|
|
2290
|
+
* @requiredField targetContactId
|
|
2291
|
+
* @requiredField targetContactRevision
|
|
2292
|
+
* @param options - Merge contacts options.
|
|
2293
|
+
* @permissionId CONTACTS.MERGE
|
|
2294
|
+
* @applicableIdentity APP
|
|
2295
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.MergeContacts
|
|
2296
|
+
*/
|
|
2297
|
+
declare function mergeContacts(targetContactId: string, targetContactRevision: number, options?: MergeContactsOptions): Promise<NonNullablePaths<MergeContactsResponse, {
|
|
2298
|
+
[P in ContactNonNullablePaths]: `contact.${P}`;
|
|
2299
|
+
}[ContactNonNullablePaths]> & {
|
|
2300
|
+
__applicationErrorsType?: MergeContactsApplicationErrors;
|
|
2301
|
+
}>;
|
|
1943
2302
|
interface MergeContactsOptions {
|
|
1944
2303
|
/**
|
|
1945
2304
|
* IDs of up to 5 contacts to merge into the target contact.
|
|
@@ -1950,6 +2309,99 @@ interface MergeContactsOptions {
|
|
|
1950
2309
|
*/
|
|
1951
2310
|
sourceContactIds?: string[];
|
|
1952
2311
|
}
|
|
2312
|
+
/**
|
|
2313
|
+
* Deletes a contact.
|
|
2314
|
+
*
|
|
2315
|
+
* Deleting a contact permanently removes it from the contact list.
|
|
2316
|
+
* If a contact is also a site member or Wix user, or has a valid billing subscription,
|
|
2317
|
+
* the contact can't be deleted. The related site member or Wix user must first be deleted
|
|
2318
|
+
* and any valid billing subscriptions must be canceled, before the contact can be deleted.
|
|
2319
|
+
*
|
|
2320
|
+
* Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
|
|
2321
|
+
* Make sure to specify the contact ID when calling Delete Contact.
|
|
2322
|
+
* @param contactId - ID of the contact to delete.
|
|
2323
|
+
* @public
|
|
2324
|
+
* @requiredField contactId
|
|
2325
|
+
* @permissionId CONTACTS.MODIFY
|
|
2326
|
+
* @permissionId MEMBERS.MEMBER_DELETE
|
|
2327
|
+
* @applicableIdentity APP
|
|
2328
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.DeleteContact
|
|
2329
|
+
*/
|
|
2330
|
+
declare function deleteContact(contactId: string): Promise<void & {
|
|
2331
|
+
__applicationErrorsType?: DeleteContactApplicationErrors;
|
|
2332
|
+
}>;
|
|
2333
|
+
/**
|
|
2334
|
+
* Adds labels to a contact.
|
|
2335
|
+
*
|
|
2336
|
+
* Use the Labels API to create or retrieve labels.
|
|
2337
|
+
*
|
|
2338
|
+
* Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
|
|
2339
|
+
* Make sure to specify the contact ID when calling Label Contact.
|
|
2340
|
+
* @param contactId - ID of the contact to add labels to.
|
|
2341
|
+
* @param labelKeys - List of label keys to add to the contact.
|
|
2342
|
+
*
|
|
2343
|
+
* Label keys must exist to be added to the contact.
|
|
2344
|
+
* Use the Labels API to create or retrieve labels.
|
|
2345
|
+
* @public
|
|
2346
|
+
* @requiredField contactId
|
|
2347
|
+
* @requiredField labelKeys
|
|
2348
|
+
* @permissionId CONTACTS.MODIFY
|
|
2349
|
+
* @applicableIdentity APP
|
|
2350
|
+
* @returns Updated contact.
|
|
2351
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.LabelContact
|
|
2352
|
+
*/
|
|
2353
|
+
declare function labelContact(contactId: string, labelKeys: string[]): Promise<NonNullablePaths<LabelContactResponse, {
|
|
2354
|
+
[P in ContactNonNullablePaths]: `contact.${P}`;
|
|
2355
|
+
}[ContactNonNullablePaths]> & {
|
|
2356
|
+
__applicationErrorsType?: LabelContactApplicationErrors;
|
|
2357
|
+
}>;
|
|
2358
|
+
/**
|
|
2359
|
+
* Removes labels from a contact.
|
|
2360
|
+
*
|
|
2361
|
+
* If a label is no longer needed
|
|
2362
|
+
* and you want to remove it from all contacts,
|
|
2363
|
+
* you can delete by calling Delete Label from the Labels API.
|
|
2364
|
+
*
|
|
2365
|
+
* Members are typically linked to contacts, and while they share a relationship, the member ID and contact ID are distinct identifiers.
|
|
2366
|
+
* Make sure to specify the contact ID when calling Unlabel Contact.
|
|
2367
|
+
* @param contactId - ID of the contact to remove labels from.
|
|
2368
|
+
* @param labelKeys - List of label keys to remove from the contact.
|
|
2369
|
+
* @public
|
|
2370
|
+
* @requiredField contactId
|
|
2371
|
+
* @requiredField labelKeys
|
|
2372
|
+
* @permissionId CONTACTS.MODIFY
|
|
2373
|
+
* @applicableIdentity APP
|
|
2374
|
+
* @returns Updated contact.
|
|
2375
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.UnlabelContact
|
|
2376
|
+
*/
|
|
2377
|
+
declare function unlabelContact(contactId: string, labelKeys: string[]): Promise<NonNullablePaths<UnlabelContactResponse, {
|
|
2378
|
+
[P in ContactNonNullablePaths]: `contact.${P}`;
|
|
2379
|
+
}[ContactNonNullablePaths]> & {
|
|
2380
|
+
__applicationErrorsType?: UnlabelContactApplicationErrors;
|
|
2381
|
+
}>;
|
|
2382
|
+
/**
|
|
2383
|
+
* Creates a query to retrieve a list of contacts.
|
|
2384
|
+
*
|
|
2385
|
+
* The `queryContacts()` function builds a query to retrieve a list of contacts and returns a `ContactsQueryBuilder` object.
|
|
2386
|
+
*
|
|
2387
|
+
* The returned object contains the query definition, which is typically used to run the query using the `find()` function.
|
|
2388
|
+
*
|
|
2389
|
+
* 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.
|
|
2390
|
+
*
|
|
2391
|
+
* `queryContacts()` runs with these `ContactsQueryBuilder` defaults, which you can override:
|
|
2392
|
+
*
|
|
2393
|
+
* - `skip(0)`
|
|
2394
|
+
* - `limit(50)`
|
|
2395
|
+
* - `descending("_createdDate")`
|
|
2396
|
+
*
|
|
2397
|
+
* 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.
|
|
2398
|
+
* @public
|
|
2399
|
+
* @param options - Query contact options.
|
|
2400
|
+
* @permissionId CONTACTS.VIEW
|
|
2401
|
+
* @applicableIdentity APP
|
|
2402
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.QueryContacts
|
|
2403
|
+
*/
|
|
2404
|
+
declare function queryContacts(options?: QueryContactsOptions): ContactsQueryBuilder;
|
|
1953
2405
|
interface QueryContactsOptions {
|
|
1954
2406
|
}
|
|
1955
2407
|
interface QueryOffsetResult {
|
|
@@ -2016,6 +2468,31 @@ interface ContactsQueryBuilder {
|
|
|
2016
2468
|
skip: (skip: number) => ContactsQueryBuilder;
|
|
2017
2469
|
find: () => Promise<ContactsQueryResult>;
|
|
2018
2470
|
}
|
|
2471
|
+
/**
|
|
2472
|
+
* Retrieves a contact.
|
|
2473
|
+
*
|
|
2474
|
+
* #### Getting Merged Contacts
|
|
2475
|
+
*
|
|
2476
|
+
* When a source contact is merged
|
|
2477
|
+
* with a target contact, the source contact is deleted.
|
|
2478
|
+
* When calling Get Contact for a merged contact,
|
|
2479
|
+
* you can use the source or target contact ID.
|
|
2480
|
+
* In both bases, the target contact is returned.
|
|
2481
|
+
*
|
|
2482
|
+
* This is supported only when calling Get Contact on merged contacts.
|
|
2483
|
+
* Previously deleted source contact IDs can't be used for any other method.
|
|
2484
|
+
* @param _id - ID of the contact to retrieve.
|
|
2485
|
+
* @public
|
|
2486
|
+
* @requiredField _id
|
|
2487
|
+
* @param options - Get contact options.
|
|
2488
|
+
* @permissionId CONTACTS.VIEW
|
|
2489
|
+
* @applicableIdentity APP
|
|
2490
|
+
* @returns The requested contact.
|
|
2491
|
+
* @fqn com.wixpress.contacts.core.api.v4.ContactsServiceV4.GetContact
|
|
2492
|
+
*/
|
|
2493
|
+
declare function getContact(_id: string, options?: GetContactOptions): Promise<NonNullablePaths<Contact, ContactNonNullablePaths> & {
|
|
2494
|
+
__applicationErrorsType?: GetContactApplicationErrors;
|
|
2495
|
+
}>;
|
|
2019
2496
|
interface GetContactOptions {
|
|
2020
2497
|
/**
|
|
2021
2498
|
* List of projected fields to return.
|
|
@@ -2048,4 +2525,4 @@ interface GetContactOptions {
|
|
|
2048
2525
|
fieldsets?: ContactFieldSetWithLiterals[];
|
|
2049
2526
|
}
|
|
2050
2527
|
|
|
2051
|
-
export { type
|
|
2528
|
+
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 };
|