@proveanything/smartlinks 1.0.35 → 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
@@ -493,6 +495,14 @@ Requests an admin JWT for the current user and a specific collection Returns JWT
493
495
  **requestPublicJWT**(collectionId: string, productId: string, proofId: string) → `Promise<string>`
494
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
495
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
+
496
506
  **getAccount**() → `Promise<AccountInfoResponse>`
497
507
  Gets current account information for the logged in user. Returns user, owner, account, and location objects.
498
508
 
@@ -511,6 +521,14 @@ Requests an admin JWT for the current user and a specific collection Returns JWT
511
521
  **requestPublicJWT**(collectionId: string, productId: string, proofId: string) → `Promise<string>`
512
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
513
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
+
514
532
  **getAccount**() → `Promise<AccountInfoResponse>`
515
533
  Gets current account information for the logged in user. Returns user, owner, account, and location objects.
516
534
 
@@ -890,6 +908,11 @@ Create a proof for a product (admin only). POST /admin/collection/:collectionId/
890
908
  values: any) → `Promise<ProofResponse>`
891
909
  Update a proof for a product (admin only). PUT /admin/collection/:collectionId/product/:productId/proof/:proofId
892
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
+
893
916
  **getByUser**(collectionId: string,
894
917
  userId: string) → `Promise<ProofResponse[]>`
895
918
  Get proofs for a user in a collection (admin only). GET /admin/collection/:collectionId/proof/findByUser/:userId
@@ -928,6 +951,11 @@ Create a proof for a product (admin only). POST /admin/collection/:collectionId/
928
951
  values: any) → `Promise<ProofResponse>`
929
952
  Update a proof for a product (admin only). PUT /admin/collection/:collectionId/product/:productId/proof/:proofId
930
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
+
931
959
  **getByUser**(collectionId: string,
932
960
  userId: string) → `Promise<ProofResponse[]>`
933
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.0.35",
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",