@proveanything/smartlinks 1.14.16 → 1.15.0
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/README.md +2 -1
- package/dist/api/authKit.d.ts +6 -0
- package/dist/api/authKit.js +18 -2
- package/dist/api/products.d.ts +20 -1
- package/dist/api/products.js +22 -2
- package/dist/docs/API_SUMMARY.md +25 -7
- package/dist/openapi.yaml +23 -37
- package/dist/types/authKit.d.ts +27 -0
- package/docs/API_SUMMARY.md +25 -7
- package/openapi.yaml +23 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,7 +123,8 @@ import { products } from '@proveanything/smartlinks'
|
|
|
123
123
|
|
|
124
124
|
await products.get(collectionId, productId, false)
|
|
125
125
|
await products.list(collectionId, false)
|
|
126
|
-
await products.query(collectionId, { query: { search: 'cabernet' } })
|
|
126
|
+
await products.query(collectionId, { query: { search: 'cabernet' } }) // public
|
|
127
|
+
await products.query(collectionId, { query: { search: 'cabernet' } }, true) // admin
|
|
127
128
|
```
|
|
128
129
|
|
|
129
130
|
Quick mapping:
|
package/dist/api/authKit.d.ts
CHANGED
|
@@ -96,6 +96,11 @@ export declare namespace authKit {
|
|
|
96
96
|
clientName?: string;
|
|
97
97
|
}): Promise<PasswordResetRequestResponse>;
|
|
98
98
|
function verifyResetToken(clientId: string, token: string): Promise<VerifyResetTokenResponse>;
|
|
99
|
+
/**
|
|
100
|
+
* Complete a password reset / invite acceptance. On invite acceptance under
|
|
101
|
+
* `verify-auto-login` the server returns a session — adopt it so the caller is logged
|
|
102
|
+
* straight in (plain resets return no token and leave the bearer untouched).
|
|
103
|
+
*/
|
|
99
104
|
function completePasswordReset(clientId: string, token: string, newPassword: string): Promise<PasswordResetCompleteResponse>;
|
|
100
105
|
function sendEmailVerification(clientId: string, data: {
|
|
101
106
|
userId: string;
|
|
@@ -103,6 +108,7 @@ export declare namespace authKit {
|
|
|
103
108
|
redirectUrl?: string;
|
|
104
109
|
clientName?: string;
|
|
105
110
|
}): Promise<EmailVerificationActionResponse>;
|
|
111
|
+
/** Verify an email token; under `verify-auto-login` the server returns a session — adopt it. */
|
|
106
112
|
function verifyEmail(clientId: string, token: string): Promise<EmailVerifyTokenResponse>;
|
|
107
113
|
function resendEmailVerification(clientId: string, data: {
|
|
108
114
|
userId: string;
|
package/dist/api/authKit.js
CHANGED
|
@@ -197,8 +197,18 @@ export var authKit;
|
|
|
197
197
|
return post(`/authkit/${encodeURIComponent(clientId)}/auth/verify-reset-token`, { token });
|
|
198
198
|
}
|
|
199
199
|
authKit.verifyResetToken = verifyResetToken;
|
|
200
|
+
/**
|
|
201
|
+
* Complete a password reset / invite acceptance. On invite acceptance under
|
|
202
|
+
* `verify-auto-login` the server returns a session — adopt it so the caller is logged
|
|
203
|
+
* straight in (plain resets return no token and leave the bearer untouched).
|
|
204
|
+
*/
|
|
200
205
|
async function completePasswordReset(clientId, token, newPassword) {
|
|
201
|
-
|
|
206
|
+
const res = await post(`/authkit/${encodeURIComponent(clientId)}/auth/complete-reset`, { token, newPassword });
|
|
207
|
+
if (res.token) {
|
|
208
|
+
setBearerToken(res.token);
|
|
209
|
+
invalidateCache();
|
|
210
|
+
}
|
|
211
|
+
return res;
|
|
202
212
|
}
|
|
203
213
|
authKit.completePasswordReset = completePasswordReset;
|
|
204
214
|
/* ===================================
|
|
@@ -208,8 +218,14 @@ export var authKit;
|
|
|
208
218
|
return post(`/authkit/${encodeURIComponent(clientId)}/auth/send-verification`, data);
|
|
209
219
|
}
|
|
210
220
|
authKit.sendEmailVerification = sendEmailVerification;
|
|
221
|
+
/** Verify an email token; under `verify-auto-login` the server returns a session — adopt it. */
|
|
211
222
|
async function verifyEmail(clientId, token) {
|
|
212
|
-
|
|
223
|
+
const res = await post(`/authkit/${encodeURIComponent(clientId)}/auth/verify-email`, { token });
|
|
224
|
+
if (res.token) {
|
|
225
|
+
setBearerToken(res.token);
|
|
226
|
+
invalidateCache();
|
|
227
|
+
}
|
|
228
|
+
return res;
|
|
213
229
|
}
|
|
214
230
|
authKit.verifyEmail = verifyEmail;
|
|
215
231
|
async function resendEmailVerification(clientId, data) {
|
package/dist/api/products.d.ts
CHANGED
|
@@ -5,7 +5,26 @@ export declare namespace products {
|
|
|
5
5
|
function create(collectionId: string, data: ProductCreateRequest): Promise<ProductResponse>;
|
|
6
6
|
function update(collectionId: string, productId: string, data: ProductUpdateRequest): Promise<ProductResponse>;
|
|
7
7
|
function remove(collectionId: string, productId: string): Promise<void>;
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Query products in a collection with filtering, sorting, and pagination.
|
|
10
|
+
*
|
|
11
|
+
* @param collectionId - Identifier of the parent collection
|
|
12
|
+
* @param body - Query parameters with filters, sorting, and pagination
|
|
13
|
+
* @param admin - When `true`, targets the `/admin` endpoint (requires an
|
|
14
|
+
* authenticated admin context). Defaults to `false`, which targets the
|
|
15
|
+
* `/public` endpoint — consistent with `get`, `list`, and `listAssets`.
|
|
16
|
+
* @returns Promise resolving to a ProductQueryResponse
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // Public query (default)
|
|
21
|
+
* await products.query(collectionId, { query: { search: 'cabernet' } })
|
|
22
|
+
*
|
|
23
|
+
* // Admin query (authenticated)
|
|
24
|
+
* await products.query(collectionId, { query: { search: 'cabernet' } }, true)
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
function query(collectionId: string, body: ProductQueryRequest, admin?: boolean): Promise<ProductQueryResponse>;
|
|
9
28
|
function clone(collectionId: string, productId: string, body?: Record<string, JsonValue>): Promise<ProductResponse>;
|
|
10
29
|
function listAssets(collectionId: string, productId: string, admin?: boolean): Promise<unknown>;
|
|
11
30
|
function createClaimWindow(collectionId: string, productId: string, body: Record<string, JsonValue>): Promise<unknown>;
|
package/dist/api/products.js
CHANGED
|
@@ -28,8 +28,28 @@ export var products;
|
|
|
28
28
|
return del(path);
|
|
29
29
|
}
|
|
30
30
|
products.remove = remove;
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Query products in a collection with filtering, sorting, and pagination.
|
|
33
|
+
*
|
|
34
|
+
* @param collectionId - Identifier of the parent collection
|
|
35
|
+
* @param body - Query parameters with filters, sorting, and pagination
|
|
36
|
+
* @param admin - When `true`, targets the `/admin` endpoint (requires an
|
|
37
|
+
* authenticated admin context). Defaults to `false`, which targets the
|
|
38
|
+
* `/public` endpoint — consistent with `get`, `list`, and `listAssets`.
|
|
39
|
+
* @returns Promise resolving to a ProductQueryResponse
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* // Public query (default)
|
|
44
|
+
* await products.query(collectionId, { query: { search: 'cabernet' } })
|
|
45
|
+
*
|
|
46
|
+
* // Admin query (authenticated)
|
|
47
|
+
* await products.query(collectionId, { query: { search: 'cabernet' } }, true)
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
async function query(collectionId, body, admin) {
|
|
51
|
+
const base = admin ? '/admin' : '/public';
|
|
52
|
+
const path = `${base}/collection/${encodeURIComponent(collectionId)}/products/query`;
|
|
33
53
|
return post(path, body);
|
|
34
54
|
}
|
|
35
55
|
products.query = query;
|
package/dist/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.15.0 | Generated: 2026-06-03T10:03:05.999Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -3053,6 +3053,13 @@ interface VerifyResetTokenResponse {
|
|
|
3053
3053
|
interface PasswordResetCompleteResponse {
|
|
3054
3054
|
success: boolean
|
|
3055
3055
|
message: string
|
|
3056
|
+
token?: string
|
|
3057
|
+
user?: AuthKitUser
|
|
3058
|
+
accountData?: Record<string, any> | null
|
|
3059
|
+
emailVerificationMode?: 'immediate' | 'verify-auto-login' | 'verify-manual-login'
|
|
3060
|
+
refreshToken?: string
|
|
3061
|
+
refreshTokenExpiresAt?: number
|
|
3062
|
+
expiresAt?: number
|
|
3056
3063
|
}
|
|
3057
3064
|
```
|
|
3058
3065
|
|
|
@@ -8371,19 +8378,19 @@ Upsert contact identity after lightweight verification (public).
|
|
|
8371
8378
|
Upsert contact identity after lightweight verification (public).
|
|
8372
8379
|
|
|
8373
8380
|
**completePasswordReset**(clientId: string, token: string, newPassword: string) → `Promise<PasswordResetCompleteResponse>`
|
|
8374
|
-
|
|
8381
|
+
Complete a password reset / invite acceptance. On invite acceptance under `verify-auto-login` the server returns a session — adopt it so the caller is logged straight in (plain resets return no token and leave the bearer untouched).
|
|
8375
8382
|
|
|
8376
8383
|
**sendEmailVerification**(clientId: string, data: { userId: string; email: string; redirectUrl?: string; clientName?: string }) → `Promise<EmailVerificationActionResponse>`
|
|
8377
|
-
|
|
8384
|
+
Complete a password reset / invite acceptance. On invite acceptance under `verify-auto-login` the server returns a session — adopt it so the caller is logged straight in (plain resets return no token and leave the bearer untouched).
|
|
8378
8385
|
|
|
8379
8386
|
**verifyEmail**(clientId: string, token: string) → `Promise<EmailVerifyTokenResponse>`
|
|
8380
|
-
|
|
8387
|
+
Verify an email token; under `verify-auto-login` the server returns a session — adopt it.
|
|
8381
8388
|
|
|
8382
8389
|
**resendEmailVerification**(clientId: string, data: { userId: string; email: string; redirectUrl?: string; clientName?: string }) → `Promise<EmailVerificationActionResponse>`
|
|
8383
|
-
|
|
8390
|
+
Verify an email token; under `verify-auto-login` the server returns a session — adopt it.
|
|
8384
8391
|
|
|
8385
8392
|
**getProfile**(clientId: string) → `Promise<UserProfile>`
|
|
8386
|
-
|
|
8393
|
+
Verify an email token; under `verify-auto-login` the server returns a session — adopt it.
|
|
8387
8394
|
|
|
8388
8395
|
**updateProfile**(clientId: string, data: ProfileUpdateData) → `Promise<UpdateProfileResponse>`
|
|
8389
8396
|
Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
|
|
@@ -9392,44 +9399,55 @@ Look up a serial number by code for a product (admin only).
|
|
|
9392
9399
|
productId: string) → `Promise<void>`
|
|
9393
9400
|
|
|
9394
9401
|
**query**(collectionId: string,
|
|
9395
|
-
body: ProductQueryRequest
|
|
9402
|
+
body: ProductQueryRequest,
|
|
9403
|
+
admin?: boolean) → `Promise<ProductQueryResponse>`
|
|
9404
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9396
9405
|
|
|
9397
9406
|
**clone**(collectionId: string,
|
|
9398
9407
|
productId: string,
|
|
9399
9408
|
body: Record<string, JsonValue> = {}) → `Promise<ProductResponse>`
|
|
9409
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9400
9410
|
|
|
9401
9411
|
**listAssets**(collectionId: string,
|
|
9402
9412
|
productId: string,
|
|
9403
9413
|
admin?: boolean) → `Promise<unknown>`
|
|
9414
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9404
9415
|
|
|
9405
9416
|
**createClaimWindow**(collectionId: string,
|
|
9406
9417
|
productId: string,
|
|
9407
9418
|
body: Record<string, JsonValue>) → `Promise<unknown>`
|
|
9419
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9408
9420
|
|
|
9409
9421
|
**updateClaimWindow**(collectionId: string,
|
|
9410
9422
|
productId: string,
|
|
9411
9423
|
claimId: string,
|
|
9412
9424
|
body: Record<string, JsonValue>) → `Promise<unknown>`
|
|
9425
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9413
9426
|
|
|
9414
9427
|
**refresh**(collectionId: string,
|
|
9415
9428
|
productId: string) → `Promise<ProductResponse>`
|
|
9429
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9416
9430
|
|
|
9417
9431
|
**getSN**(collectionId: string,
|
|
9418
9432
|
productId: string,
|
|
9419
9433
|
startIndex: number = 0,
|
|
9420
9434
|
count: number = 10) → `Promise<unknown>`
|
|
9435
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9421
9436
|
|
|
9422
9437
|
**lookupSN**(collectionId: string,
|
|
9423
9438
|
productId: string,
|
|
9424
9439
|
codeId: string) → `Promise<unknown>`
|
|
9440
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9425
9441
|
|
|
9426
9442
|
**publicLookupClaim**(collectionId: string,
|
|
9427
9443
|
productId: string,
|
|
9428
9444
|
claimId: string) → `Promise<unknown>`
|
|
9445
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9429
9446
|
|
|
9430
9447
|
**publicCreateClaim**(collectionId: string,
|
|
9431
9448
|
productId: string,
|
|
9432
9449
|
body: ProductClaimCreateRequestBody) → `Promise<unknown>`
|
|
9450
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9433
9451
|
|
|
9434
9452
|
### proof
|
|
9435
9453
|
|
package/dist/openapi.yaml
CHANGED
|
@@ -6639,39 +6639,6 @@ paths:
|
|
|
6639
6639
|
application/json:
|
|
6640
6640
|
schema:
|
|
6641
6641
|
$ref: "#/components/schemas/ProductCreateRequest"
|
|
6642
|
-
/admin/collection/{collectionId}/products/query:
|
|
6643
|
-
post:
|
|
6644
|
-
tags:
|
|
6645
|
-
- products
|
|
6646
|
-
summary: products.query
|
|
6647
|
-
operationId: products_query
|
|
6648
|
-
security:
|
|
6649
|
-
- bearerAuth: []
|
|
6650
|
-
parameters:
|
|
6651
|
-
- name: collectionId
|
|
6652
|
-
in: path
|
|
6653
|
-
required: true
|
|
6654
|
-
schema:
|
|
6655
|
-
type: string
|
|
6656
|
-
responses:
|
|
6657
|
-
200:
|
|
6658
|
-
description: Success
|
|
6659
|
-
content:
|
|
6660
|
-
application/json:
|
|
6661
|
-
schema:
|
|
6662
|
-
$ref: "#/components/schemas/ProductQueryResponse"
|
|
6663
|
-
400:
|
|
6664
|
-
description: Bad request
|
|
6665
|
-
401:
|
|
6666
|
-
description: Unauthorized
|
|
6667
|
-
404:
|
|
6668
|
-
description: Not found
|
|
6669
|
-
requestBody:
|
|
6670
|
-
required: true
|
|
6671
|
-
content:
|
|
6672
|
-
application/json:
|
|
6673
|
-
schema:
|
|
6674
|
-
$ref: "#/components/schemas/ProductQueryRequest"
|
|
6675
6642
|
/admin/collection/{collectionId}/products/{productId}:
|
|
6676
6643
|
put:
|
|
6677
6644
|
tags:
|
|
@@ -8071,7 +8038,7 @@ paths:
|
|
|
8071
8038
|
get:
|
|
8072
8039
|
tags:
|
|
8073
8040
|
- authKit
|
|
8074
|
-
summary:
|
|
8041
|
+
summary: "Verify an email token; under `verify-auto-login` the server returns a session — adopt it."
|
|
8075
8042
|
operationId: authKit_getProfile
|
|
8076
8043
|
security: []
|
|
8077
8044
|
parameters:
|
|
@@ -8213,7 +8180,7 @@ paths:
|
|
|
8213
8180
|
post:
|
|
8214
8181
|
tags:
|
|
8215
8182
|
- authKit
|
|
8216
|
-
summary:
|
|
8183
|
+
summary: Complete a password reset / invite acceptance.
|
|
8217
8184
|
operationId: authKit_completePasswordReset
|
|
8218
8185
|
security: []
|
|
8219
8186
|
parameters:
|
|
@@ -8579,7 +8546,7 @@ paths:
|
|
|
8579
8546
|
post:
|
|
8580
8547
|
tags:
|
|
8581
8548
|
- authKit
|
|
8582
|
-
summary:
|
|
8549
|
+
summary: Complete a password reset / invite acceptance.
|
|
8583
8550
|
operationId: authKit_sendEmailVerification
|
|
8584
8551
|
security: []
|
|
8585
8552
|
parameters:
|
|
@@ -8670,7 +8637,7 @@ paths:
|
|
|
8670
8637
|
post:
|
|
8671
8638
|
tags:
|
|
8672
8639
|
- authKit
|
|
8673
|
-
summary:
|
|
8640
|
+
summary: "Verify an email token; under `verify-auto-login` the server returns a session — adopt it."
|
|
8674
8641
|
operationId: authKit_verifyEmail
|
|
8675
8642
|
security: []
|
|
8676
8643
|
parameters:
|
|
@@ -18126,6 +18093,25 @@ components:
|
|
|
18126
18093
|
type: boolean
|
|
18127
18094
|
message:
|
|
18128
18095
|
type: string
|
|
18096
|
+
token:
|
|
18097
|
+
type: string
|
|
18098
|
+
user:
|
|
18099
|
+
$ref: "#/components/schemas/AuthKitUser"
|
|
18100
|
+
accountData:
|
|
18101
|
+
type: object
|
|
18102
|
+
additionalProperties: true
|
|
18103
|
+
emailVerificationMode:
|
|
18104
|
+
type: string
|
|
18105
|
+
enum:
|
|
18106
|
+
- immediate
|
|
18107
|
+
- verify-auto-login
|
|
18108
|
+
- verify-manual-login
|
|
18109
|
+
refreshToken:
|
|
18110
|
+
type: string
|
|
18111
|
+
refreshTokenExpiresAt:
|
|
18112
|
+
type: number
|
|
18113
|
+
expiresAt:
|
|
18114
|
+
type: number
|
|
18129
18115
|
required:
|
|
18130
18116
|
- success
|
|
18131
18117
|
- message
|
package/dist/types/authKit.d.ts
CHANGED
|
@@ -144,9 +144,36 @@ export interface VerifyResetTokenResponse {
|
|
|
144
144
|
expiresAt?: number;
|
|
145
145
|
message?: string;
|
|
146
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Response from {@link authKit.completePasswordReset}.
|
|
149
|
+
*
|
|
150
|
+
* For a **plain password reset**, or an invite accepted under `verify-manual-login`,
|
|
151
|
+
* the server returns only `success` + `message` and the user is sent to the login screen.
|
|
152
|
+
*
|
|
153
|
+
* For **invite acceptance under `verify-auto-login`** (the default), the server also
|
|
154
|
+
* completes email verification and returns a full session — `token`, `user`, and
|
|
155
|
+
* `accountData` — so the user can be logged straight in, mirroring
|
|
156
|
+
* {@link EmailVerifyTokenResponse}. The native-only fields are populated when the request
|
|
157
|
+
* opted in via `initializeApi({ platform: 'native' })` (the `X-Client-Platform: native`
|
|
158
|
+
* header). Every session field is therefore optional.
|
|
159
|
+
*/
|
|
147
160
|
export interface PasswordResetCompleteResponse {
|
|
148
161
|
success: boolean;
|
|
149
162
|
message: string;
|
|
163
|
+
/** Session token (a `SL.` bearer JWT). Present only on invite auto-login. Adopt it and skip the login screen. */
|
|
164
|
+
token?: string;
|
|
165
|
+
/** The authenticated user. Present only when a `token` is returned. `emailVerified` is `true` once completion verifies the invite. */
|
|
166
|
+
user?: AuthKitUser;
|
|
167
|
+
/** The `clients[clientId]` account-data slice, or `null`. Present only when a `token` is returned. */
|
|
168
|
+
accountData?: Record<string, any> | null;
|
|
169
|
+
/** Configured verification mode echoed back; auto-login only occurs for `verify-auto-login`. */
|
|
170
|
+
emailVerificationMode?: 'immediate' | 'verify-auto-login' | 'verify-manual-login';
|
|
171
|
+
/** Opaque, single-use refresh token. **Native clients only** — pairs with the short-lived `token`. */
|
|
172
|
+
refreshToken?: string;
|
|
173
|
+
/** Absolute expiry of the refresh-token family, in **ms since epoch**. Native only. */
|
|
174
|
+
refreshTokenExpiresAt?: number;
|
|
175
|
+
/** Access-token expiry, in **ms since epoch**. Native only. */
|
|
176
|
+
expiresAt?: number;
|
|
150
177
|
}
|
|
151
178
|
export interface EmailVerificationActionResponse {
|
|
152
179
|
success: boolean;
|
package/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.15.0 | Generated: 2026-06-03T10:03:05.999Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -3053,6 +3053,13 @@ interface VerifyResetTokenResponse {
|
|
|
3053
3053
|
interface PasswordResetCompleteResponse {
|
|
3054
3054
|
success: boolean
|
|
3055
3055
|
message: string
|
|
3056
|
+
token?: string
|
|
3057
|
+
user?: AuthKitUser
|
|
3058
|
+
accountData?: Record<string, any> | null
|
|
3059
|
+
emailVerificationMode?: 'immediate' | 'verify-auto-login' | 'verify-manual-login'
|
|
3060
|
+
refreshToken?: string
|
|
3061
|
+
refreshTokenExpiresAt?: number
|
|
3062
|
+
expiresAt?: number
|
|
3056
3063
|
}
|
|
3057
3064
|
```
|
|
3058
3065
|
|
|
@@ -8371,19 +8378,19 @@ Upsert contact identity after lightweight verification (public).
|
|
|
8371
8378
|
Upsert contact identity after lightweight verification (public).
|
|
8372
8379
|
|
|
8373
8380
|
**completePasswordReset**(clientId: string, token: string, newPassword: string) → `Promise<PasswordResetCompleteResponse>`
|
|
8374
|
-
|
|
8381
|
+
Complete a password reset / invite acceptance. On invite acceptance under `verify-auto-login` the server returns a session — adopt it so the caller is logged straight in (plain resets return no token and leave the bearer untouched).
|
|
8375
8382
|
|
|
8376
8383
|
**sendEmailVerification**(clientId: string, data: { userId: string; email: string; redirectUrl?: string; clientName?: string }) → `Promise<EmailVerificationActionResponse>`
|
|
8377
|
-
|
|
8384
|
+
Complete a password reset / invite acceptance. On invite acceptance under `verify-auto-login` the server returns a session — adopt it so the caller is logged straight in (plain resets return no token and leave the bearer untouched).
|
|
8378
8385
|
|
|
8379
8386
|
**verifyEmail**(clientId: string, token: string) → `Promise<EmailVerifyTokenResponse>`
|
|
8380
|
-
|
|
8387
|
+
Verify an email token; under `verify-auto-login` the server returns a session — adopt it.
|
|
8381
8388
|
|
|
8382
8389
|
**resendEmailVerification**(clientId: string, data: { userId: string; email: string; redirectUrl?: string; clientName?: string }) → `Promise<EmailVerificationActionResponse>`
|
|
8383
|
-
|
|
8390
|
+
Verify an email token; under `verify-auto-login` the server returns a session — adopt it.
|
|
8384
8391
|
|
|
8385
8392
|
**getProfile**(clientId: string) → `Promise<UserProfile>`
|
|
8386
|
-
|
|
8393
|
+
Verify an email token; under `verify-auto-login` the server returns a session — adopt it.
|
|
8387
8394
|
|
|
8388
8395
|
**updateProfile**(clientId: string, data: ProfileUpdateData) → `Promise<UpdateProfileResponse>`
|
|
8389
8396
|
Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
|
|
@@ -9392,44 +9399,55 @@ Look up a serial number by code for a product (admin only).
|
|
|
9392
9399
|
productId: string) → `Promise<void>`
|
|
9393
9400
|
|
|
9394
9401
|
**query**(collectionId: string,
|
|
9395
|
-
body: ProductQueryRequest
|
|
9402
|
+
body: ProductQueryRequest,
|
|
9403
|
+
admin?: boolean) → `Promise<ProductQueryResponse>`
|
|
9404
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9396
9405
|
|
|
9397
9406
|
**clone**(collectionId: string,
|
|
9398
9407
|
productId: string,
|
|
9399
9408
|
body: Record<string, JsonValue> = {}) → `Promise<ProductResponse>`
|
|
9409
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9400
9410
|
|
|
9401
9411
|
**listAssets**(collectionId: string,
|
|
9402
9412
|
productId: string,
|
|
9403
9413
|
admin?: boolean) → `Promise<unknown>`
|
|
9414
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9404
9415
|
|
|
9405
9416
|
**createClaimWindow**(collectionId: string,
|
|
9406
9417
|
productId: string,
|
|
9407
9418
|
body: Record<string, JsonValue>) → `Promise<unknown>`
|
|
9419
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9408
9420
|
|
|
9409
9421
|
**updateClaimWindow**(collectionId: string,
|
|
9410
9422
|
productId: string,
|
|
9411
9423
|
claimId: string,
|
|
9412
9424
|
body: Record<string, JsonValue>) → `Promise<unknown>`
|
|
9425
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9413
9426
|
|
|
9414
9427
|
**refresh**(collectionId: string,
|
|
9415
9428
|
productId: string) → `Promise<ProductResponse>`
|
|
9429
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9416
9430
|
|
|
9417
9431
|
**getSN**(collectionId: string,
|
|
9418
9432
|
productId: string,
|
|
9419
9433
|
startIndex: number = 0,
|
|
9420
9434
|
count: number = 10) → `Promise<unknown>`
|
|
9435
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9421
9436
|
|
|
9422
9437
|
**lookupSN**(collectionId: string,
|
|
9423
9438
|
productId: string,
|
|
9424
9439
|
codeId: string) → `Promise<unknown>`
|
|
9440
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9425
9441
|
|
|
9426
9442
|
**publicLookupClaim**(collectionId: string,
|
|
9427
9443
|
productId: string,
|
|
9428
9444
|
claimId: string) → `Promise<unknown>`
|
|
9445
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9429
9446
|
|
|
9430
9447
|
**publicCreateClaim**(collectionId: string,
|
|
9431
9448
|
productId: string,
|
|
9432
9449
|
body: ProductClaimCreateRequestBody) → `Promise<unknown>`
|
|
9450
|
+
Query products in a collection with filtering, sorting, and pagination. authenticated admin context). Defaults to `false`, which targets the `/public` endpoint — consistent with `get`, `list`, and `listAssets`. ```typescript // Public query (default) await products.query(collectionId, { query: { search: 'cabernet' } }) // Admin query (authenticated) await products.query(collectionId, { query: { search: 'cabernet' } }, true) ```
|
|
9433
9451
|
|
|
9434
9452
|
### proof
|
|
9435
9453
|
|
package/openapi.yaml
CHANGED
|
@@ -6639,39 +6639,6 @@ paths:
|
|
|
6639
6639
|
application/json:
|
|
6640
6640
|
schema:
|
|
6641
6641
|
$ref: "#/components/schemas/ProductCreateRequest"
|
|
6642
|
-
/admin/collection/{collectionId}/products/query:
|
|
6643
|
-
post:
|
|
6644
|
-
tags:
|
|
6645
|
-
- products
|
|
6646
|
-
summary: products.query
|
|
6647
|
-
operationId: products_query
|
|
6648
|
-
security:
|
|
6649
|
-
- bearerAuth: []
|
|
6650
|
-
parameters:
|
|
6651
|
-
- name: collectionId
|
|
6652
|
-
in: path
|
|
6653
|
-
required: true
|
|
6654
|
-
schema:
|
|
6655
|
-
type: string
|
|
6656
|
-
responses:
|
|
6657
|
-
200:
|
|
6658
|
-
description: Success
|
|
6659
|
-
content:
|
|
6660
|
-
application/json:
|
|
6661
|
-
schema:
|
|
6662
|
-
$ref: "#/components/schemas/ProductQueryResponse"
|
|
6663
|
-
400:
|
|
6664
|
-
description: Bad request
|
|
6665
|
-
401:
|
|
6666
|
-
description: Unauthorized
|
|
6667
|
-
404:
|
|
6668
|
-
description: Not found
|
|
6669
|
-
requestBody:
|
|
6670
|
-
required: true
|
|
6671
|
-
content:
|
|
6672
|
-
application/json:
|
|
6673
|
-
schema:
|
|
6674
|
-
$ref: "#/components/schemas/ProductQueryRequest"
|
|
6675
6642
|
/admin/collection/{collectionId}/products/{productId}:
|
|
6676
6643
|
put:
|
|
6677
6644
|
tags:
|
|
@@ -8071,7 +8038,7 @@ paths:
|
|
|
8071
8038
|
get:
|
|
8072
8039
|
tags:
|
|
8073
8040
|
- authKit
|
|
8074
|
-
summary:
|
|
8041
|
+
summary: "Verify an email token; under `verify-auto-login` the server returns a session — adopt it."
|
|
8075
8042
|
operationId: authKit_getProfile
|
|
8076
8043
|
security: []
|
|
8077
8044
|
parameters:
|
|
@@ -8213,7 +8180,7 @@ paths:
|
|
|
8213
8180
|
post:
|
|
8214
8181
|
tags:
|
|
8215
8182
|
- authKit
|
|
8216
|
-
summary:
|
|
8183
|
+
summary: Complete a password reset / invite acceptance.
|
|
8217
8184
|
operationId: authKit_completePasswordReset
|
|
8218
8185
|
security: []
|
|
8219
8186
|
parameters:
|
|
@@ -8579,7 +8546,7 @@ paths:
|
|
|
8579
8546
|
post:
|
|
8580
8547
|
tags:
|
|
8581
8548
|
- authKit
|
|
8582
|
-
summary:
|
|
8549
|
+
summary: Complete a password reset / invite acceptance.
|
|
8583
8550
|
operationId: authKit_sendEmailVerification
|
|
8584
8551
|
security: []
|
|
8585
8552
|
parameters:
|
|
@@ -8670,7 +8637,7 @@ paths:
|
|
|
8670
8637
|
post:
|
|
8671
8638
|
tags:
|
|
8672
8639
|
- authKit
|
|
8673
|
-
summary:
|
|
8640
|
+
summary: "Verify an email token; under `verify-auto-login` the server returns a session — adopt it."
|
|
8674
8641
|
operationId: authKit_verifyEmail
|
|
8675
8642
|
security: []
|
|
8676
8643
|
parameters:
|
|
@@ -18126,6 +18093,25 @@ components:
|
|
|
18126
18093
|
type: boolean
|
|
18127
18094
|
message:
|
|
18128
18095
|
type: string
|
|
18096
|
+
token:
|
|
18097
|
+
type: string
|
|
18098
|
+
user:
|
|
18099
|
+
$ref: "#/components/schemas/AuthKitUser"
|
|
18100
|
+
accountData:
|
|
18101
|
+
type: object
|
|
18102
|
+
additionalProperties: true
|
|
18103
|
+
emailVerificationMode:
|
|
18104
|
+
type: string
|
|
18105
|
+
enum:
|
|
18106
|
+
- immediate
|
|
18107
|
+
- verify-auto-login
|
|
18108
|
+
- verify-manual-login
|
|
18109
|
+
refreshToken:
|
|
18110
|
+
type: string
|
|
18111
|
+
refreshTokenExpiresAt:
|
|
18112
|
+
type: number
|
|
18113
|
+
expiresAt:
|
|
18114
|
+
type: number
|
|
18129
18115
|
required:
|
|
18130
18116
|
- success
|
|
18131
18117
|
- message
|