@proveanything/smartlinks 1.0.10 → 1.0.12

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.
@@ -0,0 +1,31 @@
1
+ type LoginResponse = {
2
+ id: string;
3
+ name: string;
4
+ email: string;
5
+ bearerToken: string;
6
+ account: Record<string, any>;
7
+ };
8
+ type VerifyTokenResponse = {
9
+ valid: boolean;
10
+ id?: string;
11
+ name?: string;
12
+ email?: string;
13
+ account?: Record<string, any>;
14
+ };
15
+ export declare namespace auth {
16
+ /**
17
+ * Login with email and password.
18
+ * Sets the bearerToken for subsequent API calls.
19
+ */
20
+ function login(email: string, password: string): Promise<LoginResponse>;
21
+ /**
22
+ * Logout (clears bearerToken for future API calls).
23
+ */
24
+ function logout(): void;
25
+ /**
26
+ * Verifies the current bearerToken (or a provided token).
27
+ * Returns user/account info if valid.
28
+ */
29
+ function verifyToken(token?: string): Promise<VerifyTokenResponse>;
30
+ }
31
+ export {};
@@ -0,0 +1,38 @@
1
+ import { post, setBearerToken, getApiHeaders } from "../http";
2
+ export var auth;
3
+ (function (auth) {
4
+ /**
5
+ * Login with email and password.
6
+ * Sets the bearerToken for subsequent API calls.
7
+ */
8
+ async function login(email, password) {
9
+ const res = await post("/public/auth/login", { email, password });
10
+ setBearerToken(res.bearerToken);
11
+ return res;
12
+ }
13
+ auth.login = login;
14
+ /**
15
+ * Logout (clears bearerToken for future API calls).
16
+ */
17
+ function logout() {
18
+ setBearerToken(undefined);
19
+ }
20
+ auth.logout = logout;
21
+ /**
22
+ * Verifies the current bearerToken (or a provided token).
23
+ * Returns user/account info if valid.
24
+ */
25
+ async function verifyToken(token) {
26
+ // Use the provided token, or the one from getApiHeaders
27
+ const headers = Object.assign({}, getApiHeaders());
28
+ if (token) {
29
+ headers["AUTHORIZATION"] = `Bearer ${token}`;
30
+ }
31
+ const result = await post("/public/auth/verify", {}, headers);
32
+ if (token && result.valid) {
33
+ setBearerToken(token);
34
+ }
35
+ return result;
36
+ }
37
+ auth.verifyToken = verifyToken;
38
+ })(auth || (auth = {}));
@@ -4,3 +4,4 @@ export { proof } from "./proof";
4
4
  export { appConfiguration } from "./appConfiguration";
5
5
  export { asset } from "./asset";
6
6
  export { attestation } from "./attestation";
7
+ export { auth } from "./auth";
package/dist/api/index.js CHANGED
@@ -6,3 +6,4 @@ export { proof } from "./proof";
6
6
  export { appConfiguration } from "./appConfiguration";
7
7
  export { asset } from "./asset";
8
8
  export { attestation } from "./attestation";
9
+ export { auth } from "./auth";
package/dist/http.d.ts CHANGED
@@ -10,6 +10,10 @@ export declare function initializeApi(options: {
10
10
  apiKey?: string;
11
11
  bearerToken?: string;
12
12
  }): void;
13
+ /**
14
+ * Allows setting the bearerToken at runtime (e.g. after login/logout).
15
+ */
16
+ export declare function setBearerToken(token: string | undefined): void;
13
17
  /**
14
18
  * Internal helper that performs a GET request to \`\${baseURL}\${path}\`,
15
19
  * injecting headers for apiKey or bearerToken if present.
package/dist/http.js CHANGED
@@ -17,6 +17,12 @@ export function initializeApi(options) {
17
17
  apiKey = options.apiKey;
18
18
  bearerToken = options.bearerToken;
19
19
  }
20
+ /**
21
+ * Allows setting the bearerToken at runtime (e.g. after login/logout).
22
+ */
23
+ export function setBearerToken(token) {
24
+ bearerToken = token;
25
+ }
20
26
  /**
21
27
  * Internal helper that performs a GET request to \`\${baseURL}\${path}\`,
22
28
  * injecting headers for apiKey or bearerToken if present.
@@ -1,14 +1,15 @@
1
1
  export interface AttestationResponse {
2
2
  id: string;
3
- proofId: string;
4
3
  createdAt: string;
5
4
  updatedAt: string;
6
- type: string;
7
- data: Record<string, any>;
5
+ public: Record<string, any>;
6
+ private: Record<string, any>;
7
+ proof: Record<string, any>;
8
8
  }
9
9
  export interface AttestationCreateRequest {
10
- type: string;
11
- data: Record<string, any>;
10
+ public: Record<string, any>;
11
+ private: Record<string, any>;
12
+ proof: Record<string, any>;
12
13
  }
13
14
  export interface AttestationUpdateRequest {
14
15
  type?: string;
@@ -1 +1 @@
1
- window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAACp2VMW/DIBCF/wuz1UhVmsFbFLVz1TXqYOEjQSUcBVxVrfLfKzdxDJgcTlbz/PHO9+68/WUevj2rWWPMBrWQu842XqJmFTON37OaHbDtFLhFqnjY+4NiFfuQumX1smJ8L1VrQbN6e8HuwI8k0Wnev5lh7cDHvNXy+H6sRnvOhaSLp/7xXCMvaDeoFPC4vsDVPy1VTnxVCfTVYtvxfJ0B8Sybg0MxA4aCQCnp5tY7kZaxxYpj3SwgVXOoImCdUdi06zgqKSsQ0YnzHpy/Ngvj4az0cQuNh6ypgHRS0QEpMXKDFH/uEqHXEAgLB/wqlnJSkb1qZ3yRk4rsE89EfGgTv5Lp25ZVQCmtKZMOxuDE5CbhNhsD4r4OD29nu5uUEI5iUEA6ezfbR3G/eRRl6+vkr/IGzqB2Qcqk9mBFw8EtronjGx6fVuEF/dagqaGCQo3rluRNZRT02Vq0JC9SUKjz6iZhiaaAQ1GCjQoKJbX0slHyB9ZG5tISCchN9tlBPnDno2na/gC9ajKAMQkAAA=="
1
+ window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAACp2VzW7DIBCE34Wz1UhVmoNvUdSeq16jHiwMNiphXX6qqlXevXJix0DIQno1w+dZmF32v8Syb0tq0gzDDhQXndONFaBIRYbG9qQmB2idZGYVKx56e5CkIh9CtaReV4T2QraaKVLvL9iO2YXEnaLjzgSrYzbkbdbH92O12DPGJ108jZ9LjbyA3oGUjIb1ea5OtFh55auKoK8aWkfTdXrESVaCA14AA46gpDCl9V5J89hsxaGuCIjV7KsQmBskNO02jErM8kR44qxlxt7qhWWxKH1Us8aypCmPdFbhAckxUo0UHneOMGoQhGYH+MqWclahd9UWnMhZhd+Ts33igpzti25GQifSzTESTqvYeUIHLn2i03ZweMxookPnIuiNlrxv1nqU3JQd4r6enQypRr7Pxoz4X0Dn3clwRiX4k8QrIB4dd9sH/n/zwPPWt9Gj+MbMAMp4TSKUZZo3lJn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pGy/lUcuqMrD1lOkwfVSK6Htf/9QxxAAEyctH3e/tU08AVlSa6P/kF0Wj+IBv0APdRLxhMPabxp/RD6uW6XbrpoVPPbtNNyhcSPtrb+o64YHeTDLYD6BXR0sdFlXsuuGojcUPgILEUJUpDcBtVEoDiCNSy57Sa6t0CC3koOR/PiFBABo6M4/P7t1QN+BZa95kb29joVuME9jkvz/gwJrFjgZzm5+mEEEAN8dbM8dQPaNKQt12gCEGgxR7fxam3O0JFLvvEkd2Zw2tQdyngiwBmPIxt8yLM7mAvNnQtuHwyAIQT7mOIW8P0DSuAHZpfxio9mQZZAznJrvnnxC7oJGqO5zTq82WhRBNNkOAq3zzVAbQCe4t38tzoPl0sSSEoOQ3iqB4YUDJvlwPvXKK3qQFcMh+72MgS4gW3AkEvpNRHX9OpO6cWJ9eb18/N/Uc64WrIrAAA=";
@@ -118,7 +118,7 @@
118
118
  "typeArguments": [
119
119
  {
120
120
  "type": "reference",
121
- "target": 126,
121
+ "target": 133,
122
122
  "name": "AppConfigurationResponse",
123
123
  "package": "@proveanything/smartlinks"
124
124
  }
@@ -216,7 +216,7 @@
216
216
  "typeArguments": [
217
217
  {
218
218
  "type": "reference",
219
- "target": 133,
219
+ "target": 140,
220
220
  "name": "AssetResponse",
221
221
  "package": "@proveanything/smartlinks"
222
222
  }
@@ -300,7 +300,7 @@
300
300
  "typeArguments": [
301
301
  {
302
302
  "type": "reference",
303
- "target": 133,
303
+ "target": 140,
304
304
  "name": "AssetResponse",
305
305
  "package": "@proveanything/smartlinks"
306
306
  }
@@ -395,7 +395,7 @@
395
395
  "typeArguments": [
396
396
  {
397
397
  "type": "reference",
398
- "target": 133,
398
+ "target": 140,
399
399
  "name": "AssetResponse",
400
400
  "package": "@proveanything/smartlinks"
401
401
  }
@@ -459,7 +459,7 @@
459
459
  "type": "array",
460
460
  "elementType": {
461
461
  "type": "reference",
462
- "target": 133,
462
+ "target": 140,
463
463
  "name": "AssetResponse",
464
464
  "package": "@proveanything/smartlinks"
465
465
  }
@@ -535,7 +535,7 @@
535
535
  "type": "array",
536
536
  "elementType": {
537
537
  "type": "reference",
538
- "target": 133,
538
+ "target": 140,
539
539
  "name": "AssetResponse",
540
540
  "package": "@proveanything/smartlinks"
541
541
  }
@@ -635,7 +635,7 @@
635
635
  "type": "array",
636
636
  "elementType": {
637
637
  "type": "reference",
638
- "target": 133,
638
+ "target": 140,
639
639
  "name": "AssetResponse",
640
640
  "package": "@proveanything/smartlinks"
641
641
  }
@@ -892,7 +892,7 @@
892
892
  "typeArguments": [
893
893
  {
894
894
  "type": "reference",
895
- "target": 133,
895
+ "target": 140,
896
896
  "name": "AssetResponse",
897
897
  "package": "@proveanything/smartlinks"
898
898
  }
@@ -1494,6 +1494,155 @@
1494
1494
  }
1495
1495
  ]
1496
1496
  },
1497
+ {
1498
+ "id": 108,
1499
+ "name": "auth",
1500
+ "variant": "declaration",
1501
+ "kind": 4,
1502
+ "flags": {},
1503
+ "children": [
1504
+ {
1505
+ "id": 109,
1506
+ "name": "login",
1507
+ "variant": "declaration",
1508
+ "kind": 64,
1509
+ "flags": {},
1510
+ "sources": [
1511
+ {
1512
+ "fileName": "api/auth.ts",
1513
+ "line": 16,
1514
+ "character": 24
1515
+ }
1516
+ ],
1517
+ "signatures": [
1518
+ {
1519
+ "id": 110,
1520
+ "name": "login",
1521
+ "variant": "signature",
1522
+ "kind": 4096,
1523
+ "flags": {},
1524
+ "comment": {
1525
+ "summary": [
1526
+ {
1527
+ "kind": "text",
1528
+ "text": "Login with email and password.\r\nSets the bearerToken for subsequent API calls."
1529
+ }
1530
+ ]
1531
+ },
1532
+ "sources": [
1533
+ {
1534
+ "fileName": "api/auth.ts",
1535
+ "line": 16,
1536
+ "character": 24
1537
+ }
1538
+ ],
1539
+ "parameters": [
1540
+ {
1541
+ "id": 111,
1542
+ "name": "email",
1543
+ "variant": "param",
1544
+ "kind": 32768,
1545
+ "flags": {},
1546
+ "type": {
1547
+ "type": "intrinsic",
1548
+ "name": "string"
1549
+ }
1550
+ },
1551
+ {
1552
+ "id": 112,
1553
+ "name": "password",
1554
+ "variant": "param",
1555
+ "kind": 32768,
1556
+ "flags": {},
1557
+ "type": {
1558
+ "type": "intrinsic",
1559
+ "name": "string"
1560
+ }
1561
+ }
1562
+ ],
1563
+ "type": {
1564
+ "type": "reference",
1565
+ "target": {
1566
+ "sourceFileName": "node_modules/typescript/lib/lib.es5.d.ts",
1567
+ "qualifiedName": "Promise"
1568
+ },
1569
+ "typeArguments": [
1570
+ {
1571
+ "type": "reference",
1572
+ "target": {
1573
+ "sourceFileName": "src/api/auth.ts",
1574
+ "qualifiedName": "LoginResponse"
1575
+ },
1576
+ "name": "LoginResponse",
1577
+ "package": "@proveanything/smartlinks"
1578
+ }
1579
+ ],
1580
+ "name": "Promise",
1581
+ "package": "typescript"
1582
+ }
1583
+ }
1584
+ ]
1585
+ },
1586
+ {
1587
+ "id": 113,
1588
+ "name": "logout",
1589
+ "variant": "declaration",
1590
+ "kind": 64,
1591
+ "flags": {},
1592
+ "sources": [
1593
+ {
1594
+ "fileName": "api/auth.ts",
1595
+ "line": 25,
1596
+ "character": 18
1597
+ }
1598
+ ],
1599
+ "signatures": [
1600
+ {
1601
+ "id": 114,
1602
+ "name": "logout",
1603
+ "variant": "signature",
1604
+ "kind": 4096,
1605
+ "flags": {},
1606
+ "comment": {
1607
+ "summary": [
1608
+ {
1609
+ "kind": "text",
1610
+ "text": "Logout (clears bearerToken for future API calls)."
1611
+ }
1612
+ ]
1613
+ },
1614
+ "sources": [
1615
+ {
1616
+ "fileName": "api/auth.ts",
1617
+ "line": 25,
1618
+ "character": 18
1619
+ }
1620
+ ],
1621
+ "type": {
1622
+ "type": "intrinsic",
1623
+ "name": "void"
1624
+ }
1625
+ }
1626
+ ]
1627
+ }
1628
+ ],
1629
+ "groups": [
1630
+ {
1631
+ "title": "Functions",
1632
+ "children": [
1633
+ 109,
1634
+ 113
1635
+ ]
1636
+ }
1637
+ ],
1638
+ "sources": [
1639
+ {
1640
+ "fileName": "api/auth.ts",
1641
+ "line": 11,
1642
+ "character": 17
1643
+ }
1644
+ ]
1645
+ },
1497
1646
  {
1498
1647
  "id": 12,
1499
1648
  "name": "collection",
@@ -1588,7 +1737,7 @@
1588
1737
  "typeArguments": [
1589
1738
  {
1590
1739
  "type": "reference",
1591
- "target": 108,
1740
+ "target": 115,
1592
1741
  "name": "CollectionResponse",
1593
1742
  "package": "@proveanything/smartlinks"
1594
1743
  }
@@ -1730,7 +1879,7 @@
1730
1879
  "typeArguments": [
1731
1880
  {
1732
1881
  "type": "reference",
1733
- "target": 113,
1882
+ "target": 120,
1734
1883
  "name": "ProductResponse",
1735
1884
  "package": "@proveanything/smartlinks"
1736
1885
  }
@@ -1830,7 +1979,7 @@
1830
1979
  "type": "array",
1831
1980
  "elementType": {
1832
1981
  "type": "reference",
1833
- "target": 113,
1982
+ "target": 120,
1834
1983
  "name": "ProductResponse",
1835
1984
  "package": "@proveanything/smartlinks"
1836
1985
  }
@@ -1974,7 +2123,7 @@
1974
2123
  "typeArguments": [
1975
2124
  {
1976
2125
  "type": "reference",
1977
- "target": 118,
2126
+ "target": 125,
1978
2127
  "name": "ProofResponse",
1979
2128
  "package": "@proveanything/smartlinks"
1980
2129
  }
@@ -2046,7 +2195,7 @@
2046
2195
  "type": "array",
2047
2196
  "elementType": {
2048
2197
  "type": "reference",
2049
- "target": 118,
2198
+ "target": 125,
2050
2199
  "name": "ProofResponse",
2051
2200
  "package": "@proveanything/smartlinks"
2052
2201
  }
@@ -2078,7 +2227,7 @@
2078
2227
  ]
2079
2228
  },
2080
2229
  {
2081
- "id": 126,
2230
+ "id": 133,
2082
2231
  "name": "AppConfigurationResponse",
2083
2232
  "variant": "declaration",
2084
2233
  "kind": 256,
@@ -2093,7 +2242,7 @@
2093
2242
  },
2094
2243
  "children": [
2095
2244
  {
2096
- "id": 127,
2245
+ "id": 134,
2097
2246
  "name": "id",
2098
2247
  "variant": "declaration",
2099
2248
  "kind": 1024,
@@ -2120,7 +2269,7 @@
2120
2269
  }
2121
2270
  },
2122
2271
  {
2123
- "id": 128,
2272
+ "id": 135,
2124
2273
  "name": "name",
2125
2274
  "variant": "declaration",
2126
2275
  "kind": 1024,
@@ -2147,7 +2296,7 @@
2147
2296
  }
2148
2297
  },
2149
2298
  {
2150
- "id": 129,
2299
+ "id": 136,
2151
2300
  "name": "settings",
2152
2301
  "variant": "declaration",
2153
2302
  "kind": 1024,
@@ -2195,9 +2344,9 @@
2195
2344
  {
2196
2345
  "title": "Properties",
2197
2346
  "children": [
2198
- 127,
2199
- 128,
2200
- 129
2347
+ 134,
2348
+ 135,
2349
+ 136
2201
2350
  ]
2202
2351
  }
2203
2352
  ],
@@ -2211,7 +2360,7 @@
2211
2360
  ]
2212
2361
  },
2213
2362
  {
2214
- "id": 133,
2363
+ "id": 140,
2215
2364
  "name": "AssetResponse",
2216
2365
  "variant": "declaration",
2217
2366
  "kind": 256,
@@ -2226,7 +2375,7 @@
2226
2375
  },
2227
2376
  "children": [
2228
2377
  {
2229
- "id": 134,
2378
+ "id": 141,
2230
2379
  "name": "id",
2231
2380
  "variant": "declaration",
2232
2381
  "kind": 1024,
@@ -2245,7 +2394,7 @@
2245
2394
  }
2246
2395
  },
2247
2396
  {
2248
- "id": 135,
2397
+ "id": 142,
2249
2398
  "name": "name",
2250
2399
  "variant": "declaration",
2251
2400
  "kind": 1024,
@@ -2264,7 +2413,7 @@
2264
2413
  }
2265
2414
  },
2266
2415
  {
2267
- "id": 136,
2416
+ "id": 143,
2268
2417
  "name": "url",
2269
2418
  "variant": "declaration",
2270
2419
  "kind": 1024,
@@ -2287,9 +2436,9 @@
2287
2436
  {
2288
2437
  "title": "Properties",
2289
2438
  "children": [
2290
- 134,
2291
- 135,
2292
- 136
2439
+ 141,
2440
+ 142,
2441
+ 143
2293
2442
  ]
2294
2443
  }
2295
2444
  ],
@@ -2303,7 +2452,7 @@
2303
2452
  ]
2304
2453
  },
2305
2454
  {
2306
- "id": 108,
2455
+ "id": 115,
2307
2456
  "name": "CollectionResponse",
2308
2457
  "variant": "declaration",
2309
2458
  "kind": 256,
@@ -2318,7 +2467,7 @@
2318
2467
  },
2319
2468
  "children": [
2320
2469
  {
2321
- "id": 109,
2470
+ "id": 116,
2322
2471
  "name": "id",
2323
2472
  "variant": "declaration",
2324
2473
  "kind": 1024,
@@ -2345,7 +2494,7 @@
2345
2494
  }
2346
2495
  },
2347
2496
  {
2348
- "id": 112,
2497
+ "id": 119,
2349
2498
  "name": "logoImage",
2350
2499
  "variant": "declaration",
2351
2500
  "kind": 1024,
@@ -2372,7 +2521,7 @@
2372
2521
  }
2373
2522
  },
2374
2523
  {
2375
- "id": 110,
2524
+ "id": 117,
2376
2525
  "name": "name",
2377
2526
  "variant": "declaration",
2378
2527
  "kind": 1024,
@@ -2399,7 +2548,7 @@
2399
2548
  }
2400
2549
  },
2401
2550
  {
2402
- "id": 111,
2551
+ "id": 118,
2403
2552
  "name": "title",
2404
2553
  "variant": "declaration",
2405
2554
  "kind": 1024,
@@ -2430,10 +2579,10 @@
2430
2579
  {
2431
2580
  "title": "Properties",
2432
2581
  "children": [
2433
- 109,
2434
- 112,
2435
- 110,
2436
- 111
2582
+ 116,
2583
+ 119,
2584
+ 117,
2585
+ 118
2437
2586
  ]
2438
2587
  }
2439
2588
  ],
@@ -2447,7 +2596,7 @@
2447
2596
  ]
2448
2597
  },
2449
2598
  {
2450
- "id": 130,
2599
+ "id": 137,
2451
2600
  "name": "ErrorResponse",
2452
2601
  "variant": "declaration",
2453
2602
  "kind": 256,
@@ -2462,7 +2611,7 @@
2462
2611
  },
2463
2612
  "children": [
2464
2613
  {
2465
- "id": 131,
2614
+ "id": 138,
2466
2615
  "name": "code",
2467
2616
  "variant": "declaration",
2468
2617
  "kind": 1024,
@@ -2489,7 +2638,7 @@
2489
2638
  }
2490
2639
  },
2491
2640
  {
2492
- "id": 132,
2641
+ "id": 139,
2493
2642
  "name": "message",
2494
2643
  "variant": "declaration",
2495
2644
  "kind": 1024,
@@ -2520,8 +2669,8 @@
2520
2669
  {
2521
2670
  "title": "Properties",
2522
2671
  "children": [
2523
- 131,
2524
- 132
2672
+ 138,
2673
+ 139
2525
2674
  ]
2526
2675
  }
2527
2676
  ],
@@ -2535,7 +2684,7 @@
2535
2684
  ]
2536
2685
  },
2537
2686
  {
2538
- "id": 113,
2687
+ "id": 120,
2539
2688
  "name": "ProductResponse",
2540
2689
  "variant": "declaration",
2541
2690
  "kind": 256,
@@ -2550,7 +2699,7 @@
2550
2699
  },
2551
2700
  "children": [
2552
2701
  {
2553
- "id": 116,
2702
+ "id": 123,
2554
2703
  "name": "description",
2555
2704
  "variant": "declaration",
2556
2705
  "kind": 1024,
@@ -2577,7 +2726,7 @@
2577
2726
  }
2578
2727
  },
2579
2728
  {
2580
- "id": 117,
2729
+ "id": 124,
2581
2730
  "name": "heroImage",
2582
2731
  "variant": "declaration",
2583
2732
  "kind": 1024,
@@ -2604,7 +2753,7 @@
2604
2753
  }
2605
2754
  },
2606
2755
  {
2607
- "id": 114,
2756
+ "id": 121,
2608
2757
  "name": "id",
2609
2758
  "variant": "declaration",
2610
2759
  "kind": 1024,
@@ -2631,7 +2780,7 @@
2631
2780
  }
2632
2781
  },
2633
2782
  {
2634
- "id": 115,
2783
+ "id": 122,
2635
2784
  "name": "name",
2636
2785
  "variant": "declaration",
2637
2786
  "kind": 1024,
@@ -2662,10 +2811,10 @@
2662
2811
  {
2663
2812
  "title": "Properties",
2664
2813
  "children": [
2665
- 116,
2666
- 117,
2667
- 114,
2668
- 115
2814
+ 123,
2815
+ 124,
2816
+ 121,
2817
+ 122
2669
2818
  ]
2670
2819
  }
2671
2820
  ],
@@ -2679,7 +2828,7 @@
2679
2828
  ]
2680
2829
  },
2681
2830
  {
2682
- "id": 118,
2831
+ "id": 125,
2683
2832
  "name": "ProofResponse",
2684
2833
  "variant": "declaration",
2685
2834
  "kind": 256,
@@ -2694,7 +2843,7 @@
2694
2843
  },
2695
2844
  "children": [
2696
2845
  {
2697
- "id": 119,
2846
+ "id": 126,
2698
2847
  "name": "collectionId",
2699
2848
  "variant": "declaration",
2700
2849
  "kind": 1024,
@@ -2721,7 +2870,7 @@
2721
2870
  }
2722
2871
  },
2723
2872
  {
2724
- "id": 120,
2873
+ "id": 127,
2725
2874
  "name": "createdAt",
2726
2875
  "variant": "declaration",
2727
2876
  "kind": 1024,
@@ -2748,7 +2897,7 @@
2748
2897
  }
2749
2898
  },
2750
2899
  {
2751
- "id": 121,
2900
+ "id": 128,
2752
2901
  "name": "id",
2753
2902
  "variant": "declaration",
2754
2903
  "kind": 1024,
@@ -2775,7 +2924,7 @@
2775
2924
  }
2776
2925
  },
2777
2926
  {
2778
- "id": 122,
2927
+ "id": 129,
2779
2928
  "name": "productId",
2780
2929
  "variant": "declaration",
2781
2930
  "kind": 1024,
@@ -2802,7 +2951,7 @@
2802
2951
  }
2803
2952
  },
2804
2953
  {
2805
- "id": 123,
2954
+ "id": 130,
2806
2955
  "name": "tokenId",
2807
2956
  "variant": "declaration",
2808
2957
  "kind": 1024,
@@ -2829,7 +2978,7 @@
2829
2978
  }
2830
2979
  },
2831
2980
  {
2832
- "id": 124,
2981
+ "id": 131,
2833
2982
  "name": "userId",
2834
2983
  "variant": "declaration",
2835
2984
  "kind": 1024,
@@ -2856,7 +3005,7 @@
2856
3005
  }
2857
3006
  },
2858
3007
  {
2859
- "id": 125,
3008
+ "id": 132,
2860
3009
  "name": "values",
2861
3010
  "variant": "declaration",
2862
3011
  "kind": 1024,
@@ -2902,13 +3051,13 @@
2902
3051
  {
2903
3052
  "title": "Properties",
2904
3053
  "children": [
2905
- 119,
2906
- 120,
2907
- 121,
2908
- 122,
2909
- 123,
2910
- 124,
2911
- 125
3054
+ 126,
3055
+ 127,
3056
+ 128,
3057
+ 129,
3058
+ 130,
3059
+ 131,
3060
+ 132
2912
3061
  ]
2913
3062
  }
2914
3063
  ],
@@ -3098,9 +3247,9 @@
3098
3247
  "sources": [
3099
3248
  {
3100
3249
  "fileName": "http.ts",
3101
- "line": 32,
3250
+ "line": 39,
3102
3251
  "character": 22,
3103
- "url": "https://github.com/Prove-Anything/smartlinks/blob/0d6eafe653ce3bf1805419336959a85b5439616c/src/http.ts#L32"
3252
+ "url": "https://github.com/Prove-Anything/smartlinks/blob/0d6eafe653ce3bf1805419336959a85b5439616c/src/http.ts#L39"
3104
3253
  }
3105
3254
  ],
3106
3255
  "signatures": [
@@ -3121,9 +3270,9 @@
3121
3270
  "sources": [
3122
3271
  {
3123
3272
  "fileName": "http.ts",
3124
- "line": 32,
3273
+ "line": 39,
3125
3274
  "character": 22,
3126
- "url": "https://github.com/Prove-Anything/smartlinks/blob/0d6eafe653ce3bf1805419336959a85b5439616c/src/http.ts#L32"
3275
+ "url": "https://github.com/Prove-Anything/smartlinks/blob/0d6eafe653ce3bf1805419336959a85b5439616c/src/http.ts#L39"
3127
3276
  }
3128
3277
  ],
3129
3278
  "typeParameter": [
@@ -3177,6 +3326,7 @@
3177
3326
  32,
3178
3327
  37,
3179
3328
  77,
3329
+ 108,
3180
3330
  12,
3181
3331
  16,
3182
3332
  24
@@ -3185,12 +3335,12 @@
3185
3335
  {
3186
3336
  "title": "Interfaces",
3187
3337
  "children": [
3188
- 126,
3189
3338
  133,
3190
- 108,
3191
- 130,
3192
- 113,
3193
- 118
3339
+ 140,
3340
+ 115,
3341
+ 137,
3342
+ 120,
3343
+ 125
3194
3344
  ]
3195
3345
  },
3196
3346
  {
@@ -4122,118 +4272,146 @@
4122
4272
  "qualifiedName": "attestationId"
4123
4273
  },
4124
4274
  "108": {
4275
+ "sourceFileName": "src/api/auth.ts",
4276
+ "qualifiedName": "auth"
4277
+ },
4278
+ "109": {
4279
+ "sourceFileName": "src/api/auth.ts",
4280
+ "qualifiedName": "auth.login"
4281
+ },
4282
+ "110": {
4283
+ "sourceFileName": "src/api/auth.ts",
4284
+ "qualifiedName": "auth.login"
4285
+ },
4286
+ "111": {
4287
+ "sourceFileName": "src/api/auth.ts",
4288
+ "qualifiedName": "email"
4289
+ },
4290
+ "112": {
4291
+ "sourceFileName": "src/api/auth.ts",
4292
+ "qualifiedName": "password"
4293
+ },
4294
+ "113": {
4295
+ "sourceFileName": "src/api/auth.ts",
4296
+ "qualifiedName": "auth.logout"
4297
+ },
4298
+ "114": {
4299
+ "sourceFileName": "src/api/auth.ts",
4300
+ "qualifiedName": "auth.logout"
4301
+ },
4302
+ "115": {
4125
4303
  "sourceFileName": "src/types/collection.ts",
4126
4304
  "qualifiedName": "CollectionResponse"
4127
4305
  },
4128
- "109": {
4306
+ "116": {
4129
4307
  "sourceFileName": "src/types/collection.ts",
4130
4308
  "qualifiedName": "CollectionResponse.id"
4131
4309
  },
4132
- "110": {
4310
+ "117": {
4133
4311
  "sourceFileName": "src/types/collection.ts",
4134
4312
  "qualifiedName": "CollectionResponse.name"
4135
4313
  },
4136
- "111": {
4314
+ "118": {
4137
4315
  "sourceFileName": "src/types/collection.ts",
4138
4316
  "qualifiedName": "CollectionResponse.title"
4139
4317
  },
4140
- "112": {
4318
+ "119": {
4141
4319
  "sourceFileName": "src/types/collection.ts",
4142
4320
  "qualifiedName": "CollectionResponse.logoImage"
4143
4321
  },
4144
- "113": {
4322
+ "120": {
4145
4323
  "sourceFileName": "src/types/product.ts",
4146
4324
  "qualifiedName": "ProductResponse"
4147
4325
  },
4148
- "114": {
4326
+ "121": {
4149
4327
  "sourceFileName": "src/types/product.ts",
4150
4328
  "qualifiedName": "ProductResponse.id"
4151
4329
  },
4152
- "115": {
4330
+ "122": {
4153
4331
  "sourceFileName": "src/types/product.ts",
4154
4332
  "qualifiedName": "ProductResponse.name"
4155
4333
  },
4156
- "116": {
4334
+ "123": {
4157
4335
  "sourceFileName": "src/types/product.ts",
4158
4336
  "qualifiedName": "ProductResponse.description"
4159
4337
  },
4160
- "117": {
4338
+ "124": {
4161
4339
  "sourceFileName": "src/types/product.ts",
4162
4340
  "qualifiedName": "ProductResponse.heroImage"
4163
4341
  },
4164
- "118": {
4342
+ "125": {
4165
4343
  "sourceFileName": "src/types/proof.ts",
4166
4344
  "qualifiedName": "ProofResponse"
4167
4345
  },
4168
- "119": {
4346
+ "126": {
4169
4347
  "sourceFileName": "src/types/proof.ts",
4170
4348
  "qualifiedName": "ProofResponse.collectionId"
4171
4349
  },
4172
- "120": {
4350
+ "127": {
4173
4351
  "sourceFileName": "src/types/proof.ts",
4174
4352
  "qualifiedName": "ProofResponse.createdAt"
4175
4353
  },
4176
- "121": {
4354
+ "128": {
4177
4355
  "sourceFileName": "src/types/proof.ts",
4178
4356
  "qualifiedName": "ProofResponse.id"
4179
4357
  },
4180
- "122": {
4358
+ "129": {
4181
4359
  "sourceFileName": "src/types/proof.ts",
4182
4360
  "qualifiedName": "ProofResponse.productId"
4183
4361
  },
4184
- "123": {
4362
+ "130": {
4185
4363
  "sourceFileName": "src/types/proof.ts",
4186
4364
  "qualifiedName": "ProofResponse.tokenId"
4187
4365
  },
4188
- "124": {
4366
+ "131": {
4189
4367
  "sourceFileName": "src/types/proof.ts",
4190
4368
  "qualifiedName": "ProofResponse.userId"
4191
4369
  },
4192
- "125": {
4370
+ "132": {
4193
4371
  "sourceFileName": "src/types/proof.ts",
4194
4372
  "qualifiedName": "ProofResponse.values"
4195
4373
  },
4196
- "126": {
4374
+ "133": {
4197
4375
  "sourceFileName": "src/types/appConfiguration.ts",
4198
4376
  "qualifiedName": "AppConfigurationResponse"
4199
4377
  },
4200
- "127": {
4378
+ "134": {
4201
4379
  "sourceFileName": "src/types/appConfiguration.ts",
4202
4380
  "qualifiedName": "AppConfigurationResponse.id"
4203
4381
  },
4204
- "128": {
4382
+ "135": {
4205
4383
  "sourceFileName": "src/types/appConfiguration.ts",
4206
4384
  "qualifiedName": "AppConfigurationResponse.name"
4207
4385
  },
4208
- "129": {
4386
+ "136": {
4209
4387
  "sourceFileName": "src/types/appConfiguration.ts",
4210
4388
  "qualifiedName": "AppConfigurationResponse.settings"
4211
4389
  },
4212
- "130": {
4390
+ "137": {
4213
4391
  "sourceFileName": "src/types/error.ts",
4214
4392
  "qualifiedName": "ErrorResponse"
4215
4393
  },
4216
- "131": {
4394
+ "138": {
4217
4395
  "sourceFileName": "src/types/error.ts",
4218
4396
  "qualifiedName": "ErrorResponse.code"
4219
4397
  },
4220
- "132": {
4398
+ "139": {
4221
4399
  "sourceFileName": "src/types/error.ts",
4222
4400
  "qualifiedName": "ErrorResponse.message"
4223
4401
  },
4224
- "133": {
4402
+ "140": {
4225
4403
  "sourceFileName": "src/types/asset.ts",
4226
4404
  "qualifiedName": "AssetResponse"
4227
4405
  },
4228
- "134": {
4406
+ "141": {
4229
4407
  "sourceFileName": "src/types/asset.ts",
4230
4408
  "qualifiedName": "AssetResponse.id"
4231
4409
  },
4232
- "135": {
4410
+ "142": {
4233
4411
  "sourceFileName": "src/types/asset.ts",
4234
4412
  "qualifiedName": "AssetResponse.name"
4235
4413
  },
4236
- "136": {
4414
+ "143": {
4237
4415
  "sourceFileName": "src/types/asset.ts",
4238
4416
  "qualifiedName": "AssetResponse.url"
4239
4417
  }
@@ -0,0 +1,3 @@
1
+ <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>login | @proveanything/smartlinks</title><meta name="description" content="Documentation for @proveanything/smartlinks"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@proveanything/smartlinks</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@proveanything/smartlinks</a></li><li><a href="../modules/auth.html">auth</a></li><li><a href="auth.login.html">login</a></li></ul><h1>Function login</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="login" class="tsd-anchor"></a><span class="tsd-kind-call-signature">login</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">email</span>, <span class="tsd-kind-parameter">password</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">LoginResponse</span><span class="tsd-signature-symbol">&gt;</span><a href="#login" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Login with email and password.
2
+ Sets the bearerToken for subsequent API calls.</p>
3
+ </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">email</span>: <span class="tsd-signature-type">string</span></span></li><li><span><span class="tsd-kind-parameter">password</span>: <span class="tsd-signature-type">string</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">LoginResponse</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in api/auth.ts:16</li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@proveanything/smartlinks</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
@@ -0,0 +1,2 @@
1
+ <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>logout | @proveanything/smartlinks</title><meta name="description" content="Documentation for @proveanything/smartlinks"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@proveanything/smartlinks</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@proveanything/smartlinks</a></li><li><a href="../modules/auth.html">auth</a></li><li><a href="auth.logout.html">logout</a></li></ul><h1>Function logout</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="logout" class="tsd-anchor"></a><span class="tsd-kind-call-signature">logout</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#logout" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Logout (clears bearerToken for future API calls).</p>
2
+ </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in api/auth.ts:25</li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@proveanything/smartlinks</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
@@ -1,4 +1,4 @@
1
1
  <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>request | @proveanything/smartlinks</title><meta name="description" content="Documentation for @proveanything/smartlinks"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@proveanything/smartlinks</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@proveanything/smartlinks</a></li><li><a href="request.html">request</a></li></ul><h1>Function request</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="request" class="tsd-anchor"></a><span class="tsd-kind-call-signature">request</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="request.html#request.T">T</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">path</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="request.html#request.T">T</a><span class="tsd-signature-symbol">&gt;</span><a href="#request" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Internal helper that performs a GET request to <code>\${baseURL}\${path}</code>,
2
2
  injecting headers for apiKey or bearerToken if present.
3
3
  Returns the parsed JSON as T, or throws an Error.</p>
4
- </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="request.T" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">path</span>: <span class="tsd-signature-type">string</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="request.html#request.T">T</a><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/Prove-Anything/smartlinks/blob/0d6eafe653ce3bf1805419336959a85b5439616c/src/http.ts#L32">http.ts:32</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@proveanything/smartlinks</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
4
+ </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="request.T" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">path</span>: <span class="tsd-signature-type">string</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="request.html#request.T">T</a><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/Prove-Anything/smartlinks/blob/0d6eafe653ce3bf1805419336959a85b5439616c/src/http.ts#L39">http.ts:39</a></li></ul></aside></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@proveanything/smartlinks</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
@@ -0,0 +1,3 @@
1
+ <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>auth | @proveanything/smartlinks</title><meta name="description" content="Documentation for @proveanything/smartlinks"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@proveanything/smartlinks</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@proveanything/smartlinks</a></li><li><a href="auth.html">auth</a></li></ul><h1>Namespace auth</h1></div><aside class="tsd-sources"><ul><li>Defined in api/auth.ts:11</li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><h3 class="tsd-index-heading uppercase">Index</h3><section class="tsd-index-section"><h3 class="tsd-index-heading">Functions</h3><div class="tsd-index-list"><a href="../functions/auth.login.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg><span>login</span></a>
2
+ <a href="../functions/auth.logout.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg><span>logout</span></a>
3
+ </div></section></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@proveanything/smartlinks</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
package/docs/modules.html CHANGED
@@ -1,6 +1,7 @@
1
1
  <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@proveanything/smartlinks</title><meta name="description" content="Documentation for @proveanything/smartlinks"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">@proveanything/smartlinks</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h2>@proveanything/smartlinks</h2></div><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><h3 class="tsd-index-heading uppercase">Index</h3><section class="tsd-index-section"><h3 class="tsd-index-heading">Namespaces</h3><div class="tsd-index-list"><a href="modules/appConfiguration.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-4"></use></svg><span>app<wbr/>Configuration</span></a>
2
2
  <a href="modules/asset.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-4"></use></svg><span>asset</span></a>
3
3
  <a href="modules/attestation.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-4"></use></svg><span>attestation</span></a>
4
+ <a href="modules/auth.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-4"></use></svg><span>auth</span></a>
4
5
  <a href="modules/collection.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-4"></use></svg><span>collection</span></a>
5
6
  <a href="modules/product.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-4"></use></svg><span>product</span></a>
6
7
  <a href="modules/proof.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-4"></use></svg><span>proof</span></a>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,53 @@
1
+ import { post, setBearerToken, getApiHeaders } from "../http"
2
+
3
+ type LoginResponse = {
4
+ id: string
5
+ name: string
6
+ email: string
7
+ bearerToken: string
8
+ account: Record<string, any>
9
+ }
10
+
11
+ type VerifyTokenResponse = {
12
+ valid: boolean
13
+ id?: string
14
+ name?: string
15
+ email?: string
16
+ account?: Record<string, any>
17
+ }
18
+
19
+ export namespace auth {
20
+ /**
21
+ * Login with email and password.
22
+ * Sets the bearerToken for subsequent API calls.
23
+ */
24
+ export async function login(email: string, password: string): Promise<LoginResponse> {
25
+ const res = await post<LoginResponse>("/public/auth/login", { email, password })
26
+ setBearerToken(res.bearerToken)
27
+ return res
28
+ }
29
+
30
+ /**
31
+ * Logout (clears bearerToken for future API calls).
32
+ */
33
+ export function logout(): void {
34
+ setBearerToken(undefined)
35
+ }
36
+
37
+ /**
38
+ * Verifies the current bearerToken (or a provided token).
39
+ * Returns user/account info if valid.
40
+ */
41
+ export async function verifyToken(token?: string): Promise<VerifyTokenResponse> {
42
+ // Use the provided token, or the one from getApiHeaders
43
+ const headers = { ...getApiHeaders() }
44
+ if (token) {
45
+ headers["AUTHORIZATION"] = `Bearer ${token}`
46
+ }
47
+ const result = await post<VerifyTokenResponse>("/public/auth/verify", {}, headers)
48
+ if (token && result.valid) {
49
+ setBearerToken(token)
50
+ }
51
+ return result
52
+ }
53
+ }
package/src/api/index.ts CHANGED
@@ -6,3 +6,4 @@ export { proof } from "./proof"
6
6
  export { appConfiguration } from "./appConfiguration"
7
7
  export { asset } from "./asset"
8
8
  export { attestation } from "./attestation"
9
+ export { auth } from "./auth"
package/src/http.ts CHANGED
@@ -24,6 +24,13 @@ export function initializeApi(options: {
24
24
  bearerToken = options.bearerToken
25
25
  }
26
26
 
27
+ /**
28
+ * Allows setting the bearerToken at runtime (e.g. after login/logout).
29
+ */
30
+ export function setBearerToken(token: string | undefined) {
31
+ bearerToken = token
32
+ }
33
+
27
34
  /**
28
35
  * Internal helper that performs a GET request to \`\${baseURL}\${path}\`,
29
36
  * injecting headers for apiKey or bearerToken if present.