@proveanything/smartlinks 1.1.6 → 1.1.8

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/API_SUMMARY.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.1.6 | Generated: 2025-12-23T16:56:04.230Z
3
+ Version: 1.1.8 | Generated: 2025-12-23T17:18:29.420Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -921,6 +921,35 @@ interface ContactListResponse {
921
921
  }
922
922
  ```
923
923
 
924
+ **PublicContactUpsertRequest** (interface)
925
+ ```typescript
926
+ interface PublicContactUpsertRequest {
927
+ email?: string
928
+ phone?: string
929
+ userId?: string
930
+ firstName?: string
931
+ lastName?: string
932
+ displayName?: string
933
+ company?: string
934
+ tags?: string[]
935
+ source?: string
936
+ notes?: string
937
+ avatarUrl?: string
938
+ locale?: string
939
+ timezone?: string
940
+ externalIds?: Record<string, any>
941
+ customFields?: ContactCustomFields
942
+ }
943
+ ```
944
+
945
+ **PublicContactUpsertResponse** (interface)
946
+ ```typescript
947
+ interface PublicContactUpsertResponse {
948
+ ok: boolean
949
+ contactId: string
950
+ }
951
+ ```
952
+
924
953
  **ContactCustomFields** = `Record<string, any>`
925
954
 
926
955
  ### error
@@ -1807,6 +1836,9 @@ Logging: Append many communication events for a list of IDs. POST /admin/collect
1807
1836
  **upsert**(collectionId: string,
1808
1837
  data: ContactCreateRequest) → `Promise<ContactResponse>`
1809
1838
 
1839
+ **publicUpsert**(collectionId: string,
1840
+ data: PublicContactUpsertRequest) → `Promise<PublicContactUpsertResponse>`
1841
+
1810
1842
  **erase**(collectionId: string, contactId: string, body?: any) → `Promise<ContactResponse>`
1811
1843
 
1812
1844
  ### crate
@@ -1,4 +1,4 @@
1
- import { ContactResponse, ContactCreateRequest, ContactUpdateRequest, ContactListResponse } from "../types";
1
+ import { ContactResponse, ContactCreateRequest, ContactUpdateRequest, ContactListResponse, PublicContactUpsertRequest, PublicContactUpsertResponse } from "../types";
2
2
  export declare namespace contact {
3
3
  function create(collectionId: string, data: ContactCreateRequest): Promise<ContactResponse>;
4
4
  function list(collectionId: string, params?: {
@@ -16,5 +16,6 @@ export declare namespace contact {
16
16
  phone?: string;
17
17
  }): Promise<ContactResponse>;
18
18
  function upsert(collectionId: string, data: ContactCreateRequest): Promise<ContactResponse>;
19
+ function publicUpsert(collectionId: string, data: PublicContactUpsertRequest): Promise<PublicContactUpsertResponse>;
19
20
  function erase(collectionId: string, contactId: string, body?: any): Promise<ContactResponse>;
20
21
  }
@@ -53,6 +53,12 @@ export var contact;
53
53
  return post(path, data);
54
54
  }
55
55
  contact.upsert = upsert;
56
+ // Public contact upsert (privacy-safe): returns only ok + contactId
57
+ async function publicUpsert(collectionId, data) {
58
+ const path = `/public/collection/${encodeURIComponent(collectionId)}/contact`;
59
+ return post(path, data);
60
+ }
61
+ contact.publicUpsert = publicUpsert;
56
62
  async function erase(collectionId, contactId, body) {
57
63
  const path = `/admin/collection/${encodeURIComponent(collectionId)}/contacts/${encodeURIComponent(contactId)}/erase`;
58
64
  return post(path, body || {});
@@ -39,3 +39,24 @@ export interface ContactListResponse {
39
39
  limit: number;
40
40
  offset: number;
41
41
  }
42
+ export interface PublicContactUpsertRequest {
43
+ email?: string;
44
+ phone?: string;
45
+ userId?: string;
46
+ firstName?: string;
47
+ lastName?: string;
48
+ displayName?: string;
49
+ company?: string;
50
+ tags?: string[];
51
+ source?: string;
52
+ notes?: string;
53
+ avatarUrl?: string;
54
+ locale?: string;
55
+ timezone?: string;
56
+ externalIds?: Record<string, any>;
57
+ customFields?: ContactCustomFields;
58
+ }
59
+ export interface PublicContactUpsertResponse {
60
+ ok: boolean;
61
+ contactId: string;
62
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",