@proveanything/smartlinks 1.0.34 → 1.0.37

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,5 +1,7 @@
1
1
  # Smartlinks API Summary
2
2
 
3
+ Version: 1.0.37 | Generated: 2025-09-17T14:45:53.635Z
4
+
3
5
  This is a concise summary of all available API functions and types.
4
6
 
5
7
  ## API Namespaces
@@ -190,6 +192,8 @@ interface ProductResponse {
190
192
  name: string
191
193
  collectionId: string
192
194
  description: string
195
+ gtin?: string
196
+ type?: string
193
197
  heroImage: {
194
198
  url: string
195
199
  thumbnails: {
@@ -491,6 +495,14 @@ Requests an admin JWT for the current user and a specific collection Returns JWT
491
495
  **requestPublicJWT**(collectionId: string, productId: string, proofId: string) → `Promise<string>`
492
496
  Requests a JWT for the current user and a specific collection/product/proof Validates if the user has access to the resource, and returns a JWT
493
497
 
498
+ **getUserToken**(opts?: {
499
+ email?: string
500
+ collectionId?: string
501
+ userId?: string
502
+ expiry?: string
503
+ }) → `Promise<`
504
+ Admin: Get a user bearer token (impersonation/automation). POST /admin/auth/userToken All fields are optional; at least one identifier should be provided.
505
+
494
506
  **getAccount**() → `Promise<AccountInfoResponse>`
495
507
  Gets current account information for the logged in user. Returns user, owner, account, and location objects.
496
508
 
@@ -509,6 +521,14 @@ Requests an admin JWT for the current user and a specific collection Returns JWT
509
521
  **requestPublicJWT**(collectionId: string, productId: string, proofId: string) → `Promise<string>`
510
522
  Requests a JWT for the current user and a specific collection/product/proof Validates if the user has access to the resource, and returns a JWT
511
523
 
524
+ **getUserToken**(opts?: {
525
+ email?: string
526
+ collectionId?: string
527
+ userId?: string
528
+ expiry?: string
529
+ }) → `Promise<`
530
+ Admin: Get a user bearer token (impersonation/automation). POST /admin/auth/userToken All fields are optional; at least one identifier should be provided.
531
+
512
532
  **getAccount**() → `Promise<AccountInfoResponse>`
513
533
  Gets current account information for the logged in user. Returns user, owner, account, and location objects.
514
534
 
@@ -888,6 +908,11 @@ Create a proof for a product (admin only). POST /admin/collection/:collectionId/
888
908
  values: any) → `Promise<ProofResponse>`
889
909
  Update a proof for a product (admin only). PUT /admin/collection/:collectionId/product/:productId/proof/:proofId
890
910
 
911
+ **remove**(collectionId: string,
912
+ productId: string,
913
+ proofId: string) → `Promise<void>`
914
+ Delete a proof for a product (admin only). DELETE /admin/collection/:collectionId/product/:productId/proof/:proofId
915
+
891
916
  **getByUser**(collectionId: string,
892
917
  userId: string) → `Promise<ProofResponse[]>`
893
918
  Get proofs for a user in a collection (admin only). GET /admin/collection/:collectionId/proof/findByUser/:userId
@@ -926,6 +951,11 @@ Create a proof for a product (admin only). POST /admin/collection/:collectionId/
926
951
  values: any) → `Promise<ProofResponse>`
927
952
  Update a proof for a product (admin only). PUT /admin/collection/:collectionId/product/:productId/proof/:proofId
928
953
 
954
+ **remove**(collectionId: string,
955
+ productId: string,
956
+ proofId: string) → `Promise<void>`
957
+ Delete a proof for a product (admin only). DELETE /admin/collection/:collectionId/product/:productId/proof/:proofId
958
+
929
959
  **getByUser**(collectionId: string,
930
960
  userId: string) → `Promise<ProofResponse[]>`
931
961
  Get proofs for a user in a collection (admin only). GET /admin/collection/:collectionId/proof/findByUser/:userId
@@ -70,6 +70,19 @@ export declare namespace auth {
70
70
  * Validates if the user has access to the resource, and returns a JWT
71
71
  */
72
72
  function requestPublicJWT(collectionId: string, productId: string, proofId: string): Promise<string>;
73
+ /**
74
+ * Admin: Get a user bearer token (impersonation/automation).
75
+ * POST /admin/auth/userToken
76
+ * All fields are optional; at least one identifier should be provided.
77
+ */
78
+ function getUserToken(opts?: {
79
+ email?: string;
80
+ collectionId?: string;
81
+ userId?: string;
82
+ expiry?: string;
83
+ }): Promise<{
84
+ bearerToken: string;
85
+ }>;
73
86
  /**
74
87
  * Gets current account information for the logged in user.
75
88
  * Returns user, owner, account, and location objects.
package/dist/api/auth.js CHANGED
@@ -60,6 +60,16 @@ export var auth;
60
60
  return post("/public/auth/requestJWT", { collectionId, productId, proofId });
61
61
  }
62
62
  auth.requestPublicJWT = requestPublicJWT;
63
+ /**
64
+ * Admin: Get a user bearer token (impersonation/automation).
65
+ * POST /admin/auth/userToken
66
+ * All fields are optional; at least one identifier should be provided.
67
+ */
68
+ async function getUserToken(opts) {
69
+ const body = opts !== null && opts !== void 0 ? opts : {};
70
+ return post("/admin/auth/getUserToken", body);
71
+ }
72
+ auth.getUserToken = getUserToken;
63
73
  /**
64
74
  * Gets current account information for the logged in user.
65
75
  * Returns user, owner, account, and location objects.
@@ -19,6 +19,11 @@ export declare namespace proof {
19
19
  * PUT /admin/collection/:collectionId/product/:productId/proof/:proofId
20
20
  */
21
21
  function update(collectionId: string, productId: string, proofId: string, values: any): Promise<ProofResponse>;
22
+ /**
23
+ * Delete a proof for a product (admin only).
24
+ * DELETE /admin/collection/:collectionId/product/:productId/proof/:proofId
25
+ */
26
+ function remove(collectionId: string, productId: string, proofId: string): Promise<void>;
22
27
  /**
23
28
  * Get proofs for a user in a collection (admin only).
24
29
  * GET /admin/collection/:collectionId/proof/findByUser/:userId
package/dist/api/proof.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/api/proof.ts
2
- import { request, post, put } from "../http";
2
+ import { request, post, put, del } from "../http";
3
3
  export var proof;
4
4
  (function (proof) {
5
5
  /**
@@ -39,6 +39,15 @@ export var proof;
39
39
  return put(path, values);
40
40
  }
41
41
  proof.update = update;
42
+ /**
43
+ * Delete a proof for a product (admin only).
44
+ * DELETE /admin/collection/:collectionId/product/:productId/proof/:proofId
45
+ */
46
+ async function remove(collectionId, productId, proofId) {
47
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/product/${encodeURIComponent(productId)}/proof/${encodeURIComponent(proofId)}`;
48
+ return del(path);
49
+ }
50
+ proof.remove = remove;
42
51
  /**
43
52
  * Get proofs for a user in a collection (admin only).
44
53
  * GET /admin/collection/:collectionId/proof/findByUser/:userId
@@ -10,6 +10,10 @@ export interface ProductResponse {
10
10
  collectionId: string;
11
11
  /** Detailed description of the product */
12
12
  description: string;
13
+ /** A product GTIN (Global Trade Item Number) */
14
+ gtin?: string;
15
+ /** An optional product type from the standard smartlinks types */
16
+ type?: string;
13
17
  /** Hero image asset object */
14
18
  heroImage: {
15
19
  /** URL to the asset */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.0.34",
3
+ "version": "1.0.37",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",