abmp-npm 1.8.30 → 1.8.31

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.
@@ -149,7 +149,6 @@ async function updateContactInfo(contactId, updateInfoCallback, operationName) {
149
149
 
150
150
  try {
151
151
  const contact = await elevatedGetContact(contactId);
152
- console.log('contact from updateContactInfo', contact);
153
152
  const currentInfo = contact.info;
154
153
  const updatedInfo = updateInfoCallback(currentInfo);
155
154
 
@@ -257,6 +256,28 @@ const updateMemberContactInfo = async (id, data) => {
257
256
  await Promise.all(updatePromises);
258
257
  };
259
258
 
259
+ /**
260
+ * Checks URL uniqueness for a member
261
+ * @param {string} url - The URL to check
262
+ * @param {string} memberId - The member ID to exclude from the check
263
+ * @returns {Promise<Object>} Result object with isUnique boolean
264
+ */
265
+ async function checkUrlUniqueness(url, memberId) {
266
+ if (!url || !memberId) {
267
+ throw new Error('Missing required parameters: url and memberId are required');
268
+ }
269
+
270
+ try {
271
+ const trimmedUrl = url.trim();
272
+ const exists = await urlExists(trimmedUrl, memberId);
273
+
274
+ return { isUnique: !exists };
275
+ } catch (error) {
276
+ console.error('Error checking URL uniqueness:', error);
277
+ throw new Error(`Failed to check URL uniqueness: ${error.message}`);
278
+ }
279
+ }
280
+
260
281
  /**
261
282
  * Saves member registration data
262
283
  * @param {Object} data - Member data to save
@@ -304,5 +325,6 @@ module.exports = {
304
325
  findMemberByWixDataId,
305
326
  createContactAndMemberIfNew,
306
327
  validateMemberToken,
328
+ checkUrlUniqueness,
307
329
  saveRegistrationData,
308
330
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abmp-npm",
3
- "version": "1.8.30",
3
+ "version": "1.8.31",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",