@proveanything/smartlinks 1.1.2 → 1.1.4

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.2 | Generated: 2025-12-18T22:42:25.982Z
3
+ Version: 1.1.4 | Generated: 2025-12-21T18:19:46.355Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -39,6 +39,7 @@ The Smartlinks SDK is organized into the following namespaces:
39
39
  - **nfc** - Claim and validate NFC tags; perform tag lookups.
40
40
  - **proof** - Create, update, claim, and list product proofs (digital certificates).
41
41
  - **claimSet** - Manage claim sets and tag assignments; queries, reports, and updates.
42
+ - **qr** - Lookup short codes to resolve collection/product/proof context.
42
43
 
43
44
  — AI & Utilities —
44
45
  - **ai** - Generate content and images, search photos, chat, upload files, and cache.
@@ -344,22 +345,15 @@ interface AttestationUpdateRequest {
344
345
 
345
346
  ### auth
346
347
 
347
- **UserAccountRegistrationRequest** (type)
348
+ **UserAccountRegistrationRequest** (interface)
348
349
  ```typescript
349
- type UserAccountRegistrationRequest = {
350
- /** User's display name */
350
+ interface UserAccountRegistrationRequest {
351
351
  name: string
352
- /** Optional user email */
353
352
  email?: string
354
- /** Optional user phone number */
355
353
  phone?: string
356
- /** Optional password for email login */
357
354
  password?: string
358
- /** Send confirmation email after registration */
359
355
  sendAccountConfirmation?: boolean
360
- /** Optional collection context for registration */
361
356
  collectionId?: string,
362
- /** Desired token type returned */
363
357
  tokenType?: 'bearer' | 'firebase'
364
358
  }
365
359
  ```
@@ -609,9 +603,9 @@ interface AssignClaimsRequest {
609
603
 
610
604
  ### collection
611
605
 
612
- **CollectionResponse** (interface)
606
+ **Collection** (interface)
613
607
  ```typescript
614
- interface CollectionResponse {
608
+ interface Collection {
615
609
  id: string
616
610
  title: string
617
611
  description: string
@@ -652,6 +646,12 @@ interface CollectionResponse {
652
646
  }
653
647
  ```
654
648
 
649
+ **CollectionResponse** = `Collection`
650
+
651
+ **CollectionCreateRequest** = `Omit<Collection, 'id' | 'shortId'>`
652
+
653
+ **CollectionUpdateRequest** = `Partial<Omit<Collection, 'id' | 'shortId'>>`
654
+
655
655
  ### common
656
656
 
657
657
  **IdField** = `'userId' | 'contactId'`
@@ -1063,9 +1063,9 @@ interface NfcClaimTagRequest {
1063
1063
 
1064
1064
  ### product
1065
1065
 
1066
- **ProductResponse** (interface)
1066
+ **Product** (interface)
1067
1067
  ```typescript
1068
- interface ProductResponse {
1068
+ interface Product {
1069
1069
  id: string
1070
1070
  name: string
1071
1071
  collectionId: string
@@ -1089,15 +1089,17 @@ interface ProductResponse {
1089
1089
  }
1090
1090
  ```
1091
1091
 
1092
- **ProductCreateRequest** = `Omit<ProductResponse, 'id' | 'collectionId'>`
1092
+ **ProductResponse** = `Product`
1093
+
1094
+ **ProductCreateRequest** = `Omit<Product, 'id' | 'collectionId'>`
1093
1095
 
1094
- **ProductUpdateRequest** = `Partial<Omit<ProductResponse, 'id' | 'collectionId'>>`
1096
+ **ProductUpdateRequest** = `Partial<Omit<Product, 'id' | 'collectionId'>>`
1095
1097
 
1096
1098
  ### proof
1097
1099
 
1098
- **ProofResponse** (interface)
1100
+ **Proof** (interface)
1099
1101
  ```typescript
1100
- interface ProofResponse {
1102
+ interface Proof {
1101
1103
  collectionId: string
1102
1104
  createdAt: string
1103
1105
  id: string
@@ -1110,6 +1112,33 @@ interface ProofResponse {
1110
1112
  }
1111
1113
  ```
1112
1114
 
1115
+ **ProofCreateRequest** (interface)
1116
+ ```typescript
1117
+ interface ProofCreateRequest {
1118
+ values: Record<string, any>
1119
+ claimable?: boolean
1120
+ transient?: boolean
1121
+ }
1122
+ ```
1123
+
1124
+ **ProofResponse** = `Proof`
1125
+
1126
+ **ProofUpdateRequest** = `Partial<ProofCreateRequest>`
1127
+
1128
+ **ProofClaimRequest** = `Record<string, any>`
1129
+
1130
+ ### qr
1131
+
1132
+ **QrShortCodeLookupResponse** (interface)
1133
+ ```typescript
1134
+ interface QrShortCodeLookupResponse {
1135
+ collectionId?: string
1136
+ productId?: string
1137
+ proofId?: string
1138
+ code: string
1139
+ }
1140
+ ```
1141
+
1113
1142
  ### segments
1114
1143
 
1115
1144
  **SegmentRecord** (interface)
@@ -1699,10 +1728,10 @@ Retrieve a specific settings group for a collection (public endpoint).
1699
1728
  **updateSettings**(collectionId: string, settingGroup: string, settings: any) → `Promise<any>`
1700
1729
  Update a specific settings group for a collection (admin endpoint).
1701
1730
 
1702
- **create**(data: any) → `Promise<CollectionResponse>`
1731
+ **create**(data: CollectionCreateRequest) → `Promise<CollectionResponse>`
1703
1732
  Create a new collection (admin only).
1704
1733
 
1705
- **update**(collectionId: string, data: any) → `Promise<CollectionResponse>`
1734
+ **update**(collectionId: string, data: CollectionUpdateRequest) → `Promise<CollectionResponse>`
1706
1735
  Update a collection (admin only).
1707
1736
 
1708
1737
  **remove**(collectionId: string) → `Promise<void>`
@@ -1890,19 +1919,19 @@ List all Proofs for a Collection.
1890
1919
 
1891
1920
  **create**(collectionId: string,
1892
1921
  productId: string,
1893
- values: any) → `Promise<ProofResponse>`
1922
+ values: ProofCreateRequest) → `Promise<ProofResponse>`
1894
1923
  Create a proof for a product (admin only). POST /admin/collection/:collectionId/product/:productId/proof
1895
1924
 
1896
1925
  **update**(collectionId: string,
1897
1926
  productId: string,
1898
1927
  proofId: string,
1899
- values: any) → `Promise<ProofResponse>`
1928
+ values: ProofUpdateRequest) → `Promise<ProofResponse>`
1900
1929
  Update a proof for a product (admin only). PUT /admin/collection/:collectionId/product/:productId/proof/:proofId
1901
1930
 
1902
1931
  **claim**(collectionId: string,
1903
1932
  productId: string,
1904
1933
  proofId: string,
1905
- values: any) → `Promise<ProofResponse>`
1934
+ values: ProofClaimRequest) → `Promise<ProofResponse>`
1906
1935
  Claim a proof for a product. PUT /public/collection/:collectionId/product/:productId/proof/:proofId
1907
1936
 
1908
1937
  **remove**(collectionId: string,
@@ -1928,6 +1957,11 @@ Find proofs for a product (admin only). POST /admin/collection/:collectionId/pro
1928
1957
  batchId: string) → `Promise<ProofResponse[]>`
1929
1958
  Get proofs for a batch (admin only). GET /admin/collection/:collectionId/product/:productId/batch/:batchId/proof
1930
1959
 
1960
+ ### qr
1961
+
1962
+ **lookupShortCode**(shortId: string, code: string) → `Promise<QrShortCodeLookupResponse>`
1963
+ Resolve a short code to related resource identifiers. GET /public/lookupShortCode/:shortId/:code
1964
+
1931
1965
  ### segments
1932
1966
 
1933
1967
  **create**(collectionId: string,
@@ -1,4 +1,4 @@
1
- import { CollectionResponse } from "../types/collection";
1
+ import { CollectionResponse, CollectionCreateRequest, CollectionUpdateRequest } from "../types/collection";
2
2
  export declare namespace collection {
3
3
  /**
4
4
  * Retrieves a single Collection by its ID.
@@ -42,7 +42,7 @@ export declare namespace collection {
42
42
  * @returns Promise resolving to a CollectionResponse object
43
43
  * @throws ErrorResponse if the request fails
44
44
  */
45
- function create(data: any): Promise<CollectionResponse>;
45
+ function create(data: CollectionCreateRequest): Promise<CollectionResponse>;
46
46
  /**
47
47
  * Update a collection (admin only).
48
48
  * @param collectionId – Identifier of the collection
@@ -50,7 +50,7 @@ export declare namespace collection {
50
50
  * @returns Promise resolving to a CollectionResponse object
51
51
  * @throws ErrorResponse if the request fails
52
52
  */
53
- function update(collectionId: string, data: any): Promise<CollectionResponse>;
53
+ function update(collectionId: string, data: CollectionUpdateRequest): Promise<CollectionResponse>;
54
54
  /**
55
55
  * Delete a collection (admin only).
56
56
  * @param collectionId – Identifier of the collection
@@ -20,4 +20,5 @@ export { actions } from "./actions";
20
20
  export { broadcasts } from "./broadcasts";
21
21
  export { segments } from "./segments";
22
22
  export { journeys } from "./journeys";
23
+ export { qr } from "./qr";
23
24
  export type { AIGenerateContentRequest, AIGenerateImageRequest, AISearchPhotosRequest, AISearchPhotosPhoto } from "./ai";
package/dist/api/index.js CHANGED
@@ -22,3 +22,4 @@ export { actions } from "./actions";
22
22
  export { broadcasts } from "./broadcasts";
23
23
  export { segments } from "./segments";
24
24
  export { journeys } from "./journeys";
25
+ export { qr } from "./qr";
@@ -1,4 +1,4 @@
1
- import { ProofResponse } from "../types/proof";
1
+ import { ProofResponse, ProofCreateRequest, ProofUpdateRequest, ProofClaimRequest } from "../types/proof";
2
2
  export declare namespace proof {
3
3
  /**
4
4
  * Retrieves a single Proof by Collection ID, Product ID, and Proof ID.
@@ -13,17 +13,17 @@ export declare namespace proof {
13
13
  * Create a proof for a product (admin only).
14
14
  * POST /admin/collection/:collectionId/product/:productId/proof
15
15
  */
16
- function create(collectionId: string, productId: string, values: any): Promise<ProofResponse>;
16
+ function create(collectionId: string, productId: string, values: ProofCreateRequest): Promise<ProofResponse>;
17
17
  /**
18
18
  * Update a proof for a product (admin only).
19
19
  * PUT /admin/collection/:collectionId/product/:productId/proof/:proofId
20
20
  */
21
- function update(collectionId: string, productId: string, proofId: string, values: any): Promise<ProofResponse>;
21
+ function update(collectionId: string, productId: string, proofId: string, values: ProofUpdateRequest): Promise<ProofResponse>;
22
22
  /**
23
23
  * Claim a proof for a product.
24
24
  * PUT /public/collection/:collectionId/product/:productId/proof/:proofId
25
25
  */
26
- function claim(collectionId: string, productId: string, proofId: string, values: any): Promise<ProofResponse>;
26
+ function claim(collectionId: string, productId: string, proofId: string, values: ProofClaimRequest): Promise<ProofResponse>;
27
27
  /**
28
28
  * Delete a proof for a product (admin only).
29
29
  * DELETE /admin/collection/:collectionId/product/:productId/proof/:proofId
@@ -0,0 +1,15 @@
1
+ import type { QrShortCodeLookupResponse } from "../types/qr";
2
+ /**
3
+ * QR namespace for public short code lookups.
4
+ */
5
+ export declare namespace qr {
6
+ /**
7
+ * Resolve a short code to related resource identifiers.
8
+ * GET /public/lookupShortCode/:shortId/:code
9
+ *
10
+ * @param shortId - The short code identifier namespace
11
+ * @param code - The actual code to look up
12
+ * @returns Mapping with optional `collectionId`, `productId`, `proofId` and the `code`
13
+ */
14
+ function lookupShortCode(shortId: string, code: string): Promise<QrShortCodeLookupResponse>;
15
+ }
package/dist/api/qr.js ADDED
@@ -0,0 +1,22 @@
1
+ // src/api/qr.ts
2
+ // QR / Short code lookup API
3
+ import { request } from "../http";
4
+ /**
5
+ * QR namespace for public short code lookups.
6
+ */
7
+ export var qr;
8
+ (function (qr) {
9
+ /**
10
+ * Resolve a short code to related resource identifiers.
11
+ * GET /public/lookupShortCode/:shortId/:code
12
+ *
13
+ * @param shortId - The short code identifier namespace
14
+ * @param code - The actual code to look up
15
+ * @returns Mapping with optional `collectionId`, `productId`, `proofId` and the `code`
16
+ */
17
+ async function lookupShortCode(shortId, code) {
18
+ const path = `/public/lookupShortCode/${encodeURIComponent(shortId)}/${encodeURIComponent(code)}`;
19
+ return request(path);
20
+ }
21
+ qr.lookupShortCode = lookupShortCode;
22
+ })(qr || (qr = {}));
package/dist/index.d.ts CHANGED
@@ -4,9 +4,12 @@ export * from "./types";
4
4
  export { iframe } from "./iframe";
5
5
  export type { LoginResponse, VerifyTokenResponse, AccountInfoResponse, } from "./api/auth";
6
6
  export type { UserAccountRegistrationRequest, } from "./types/auth";
7
- export type { SendNotificationRequest, SendNotificationResponse, NotificationSubjectTarget, NotificationTemplate, PushNotificationTemplate, EmailNotificationTemplate, WalletUpdateTemplate, } from "./types/comms";
7
+ export type { SendNotificationRequest, SendNotificationResponse, NotificationSubjectTarget, NotificationTemplate, PushNotificationTemplate, EmailNotificationTemplate, WalletUpdateTemplate, CommunicationEvent, CommsQueryByUser, CommsRecipientIdsQuery, CommsRecipientsWithoutActionQuery, CommsRecipientsWithActionQuery, RecipientId, RecipientWithOutcome, LogCommunicationEventBody, LogBulkCommunicationEventsBody, AppendResult, AppendBulkResult, } from "./types/comms";
8
8
  export type { AttestationResponse, AttestationCreateRequest, AttestationUpdateRequest, } from "./types/attestation";
9
9
  export type { BatchResponse, BatchCreateRequest, BatchUpdateRequest, } from "./types/batch";
10
10
  export type { VariantResponse, VariantCreateRequest, VariantUpdateRequest, } from "./types/variant";
11
11
  export type { AppConfigOptions } from "./api/appConfiguration";
12
- export type { ProductCreateRequest, ProductUpdateRequest, } from "./types/product";
12
+ export type { ProductCreateRequest, ProductUpdateRequest, Product, } from "./types/product";
13
+ export type { Collection, CollectionResponse, CollectionCreateRequest, CollectionUpdateRequest, } from "./types/collection";
14
+ export type { Proof, ProofResponse, ProofCreateRequest, ProofUpdateRequest, ProofClaimRequest, } from "./types/proof";
15
+ export type { QrShortCodeLookupResponse, } from "./types/qr";
@@ -1,4 +1,4 @@
1
- export type UserAccountRegistrationRequest = {
1
+ export interface UserAccountRegistrationRequest {
2
2
  /** User's display name */
3
3
  name: string;
4
4
  /** Optional user email */
@@ -13,4 +13,4 @@ export type UserAccountRegistrationRequest = {
13
13
  collectionId?: string;
14
14
  /** Desired token type returned */
15
15
  tokenType?: 'bearer' | 'firebase';
16
- };
16
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Represents a Collection object.
3
3
  */
4
- export interface CollectionResponse {
4
+ export interface Collection {
5
5
  /** Unique identifier for the collection */
6
6
  id: string;
7
7
  /** Human-readable title of the collection */
@@ -63,3 +63,6 @@ export interface CollectionResponse {
63
63
  /** if dark mode is enabled for this collection */
64
64
  dark?: boolean;
65
65
  }
66
+ export type CollectionResponse = Collection;
67
+ export type CollectionCreateRequest = Omit<Collection, 'id' | 'shortId'>;
68
+ export type CollectionUpdateRequest = Partial<Omit<Collection, 'id' | 'shortId'>>;
@@ -16,3 +16,4 @@ export * from "./broadcasts";
16
16
  export * from "./segments";
17
17
  export * from "./common";
18
18
  export * from "./journeys";
19
+ export * from "./qr";
@@ -18,3 +18,4 @@ export * from "./broadcasts";
18
18
  export * from "./segments";
19
19
  export * from "./common";
20
20
  export * from "./journeys";
21
+ export * from "./qr";
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Represents a Product Item object.
2
+ * Product domain model.
3
3
  */
4
- export interface ProductResponse {
4
+ export interface Product {
5
5
  /** Unique identifier for the product */
6
6
  id: string;
7
7
  /** Name of the product */
@@ -34,5 +34,6 @@ export interface ProductResponse {
34
34
  [key: string]: any;
35
35
  };
36
36
  }
37
- export type ProductCreateRequest = Omit<ProductResponse, 'id' | 'collectionId'>;
38
- export type ProductUpdateRequest = Partial<Omit<ProductResponse, 'id' | 'collectionId'>>;
37
+ export type ProductResponse = Product;
38
+ export type ProductCreateRequest = Omit<Product, 'id' | 'collectionId'>;
39
+ export type ProductUpdateRequest = Partial<Omit<Product, 'id' | 'collectionId'>>;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Represents a Proof object.
3
3
  */
4
- export interface ProofResponse {
4
+ export interface Proof {
5
5
  /** Unique identifier for the collection */
6
6
  collectionId: string;
7
7
  /** Creation timestamp */
@@ -21,3 +21,11 @@ export interface ProofResponse {
21
21
  /** Arbitrary key-value pairs for proof values */
22
22
  values: Record<string, any>;
23
23
  }
24
+ export type ProofResponse = Proof;
25
+ export interface ProofCreateRequest {
26
+ values: Record<string, any>;
27
+ claimable?: boolean;
28
+ transient?: boolean;
29
+ }
30
+ export type ProofUpdateRequest = Partial<ProofCreateRequest>;
31
+ export type ProofClaimRequest = Record<string, any>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Response for public short code lookup.
3
+ * Resolves the short code to related resource identifiers.
4
+ */
5
+ export interface QrShortCodeLookupResponse {
6
+ /** The collection ID, if applicable */
7
+ collectionId?: string;
8
+ /** The product ID, if applicable */
9
+ productId?: string;
10
+ /** The proof ID, if applicable */
11
+ proofId?: string;
12
+ /** The resolved code string */
13
+ code: string;
14
+ }
@@ -0,0 +1,2 @@
1
+ // src/types/qr.ts
2
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",