@proveanything/smartlinks 1.16.1 → 1.16.3
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/dist/api/proof.d.ts +22 -1
- package/dist/api/proof.js +25 -0
- package/dist/docs/API_SUMMARY.md +63 -74
- package/dist/docs/proof-product-data-scoping.md +5 -2
- package/dist/openapi.yaml +101 -120
- package/dist/types/batch.d.ts +18 -7
- package/dist/types/proof.d.ts +26 -1
- package/dist/types/variant.d.ts +26 -5
- package/dist/utils/paths.js +3 -7
- package/docs/API_SUMMARY.md +63 -74
- package/docs/proof-product-data-scoping.md +5 -2
- package/openapi.yaml +101 -120
- package/package.json +1 -1
package/dist/api/proof.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProofResponse, ProofCreateRequest, ProofUpdateRequest, ProofClaimRequest, ProofGrant, CreateGrantOptions, RedeemGrantOptions, RedeemGrantResult, ProofTransfer, TransferProofOptions, TransferProofResult } from "../types/proof";
|
|
1
|
+
import { ProofResponse, ProofCreateRequest, ProofUpdateRequest, ProofValuesUpdateRequest, ProofClaimRequest, ProofGrant, CreateGrantOptions, RedeemGrantOptions, RedeemGrantResult, ProofTransfer, TransferProofOptions, TransferProofResult } from "../types/proof";
|
|
2
2
|
export declare namespace proof {
|
|
3
3
|
/**
|
|
4
4
|
* Retrieves a single Proof by Collection ID, Product ID, and Proof ID.
|
|
@@ -42,6 +42,27 @@ export declare namespace proof {
|
|
|
42
42
|
* Object zones deep-merge, so you can change one field without wiping the rest.
|
|
43
43
|
*/
|
|
44
44
|
function update(collectionId: string, productId: string, proofId: string, values: ProofUpdateRequest): Promise<ProofResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Owner self-service update of a proof's owner-writable data.
|
|
47
|
+
* PUT /public/collection/:collectionId/product/:productId/proof/:proofId/values
|
|
48
|
+
*
|
|
49
|
+
* The public counterpart to admin `update` — the current OWNER (or a collection
|
|
50
|
+
* admin) editing their own proof, no admin credentials required. Only owner-writable
|
|
51
|
+
* zones are honoured (see {@link ProofValuesUpdateRequest}):
|
|
52
|
+
* ```ts
|
|
53
|
+
* proof.updateValues(collectionId, productId, proofId, {
|
|
54
|
+
* colour: 'blue', // → proof.values.colour (public)
|
|
55
|
+
* owner: { warranty: '2y' }, // → proof.values.owner (owner-scoped)
|
|
56
|
+
* personal: { nickname: 'Bo' }, // → proof.values.personal[callerUid] (private, own slot only)
|
|
57
|
+
* })
|
|
58
|
+
* ```
|
|
59
|
+
* `personal` always targets the caller's OWN slot — you cannot write another
|
|
60
|
+
* user's personal data, even as an admin. Object zones deep-merge (owner/personal
|
|
61
|
+
* merge field-by-field), so you can change one field without wiping the rest.
|
|
62
|
+
* Business-only zones (`data`/`admin`/`private`) are not writable here — use the
|
|
63
|
+
* admin `update` for those.
|
|
64
|
+
*/
|
|
65
|
+
function updateValues(collectionId: string, productId: string, proofId: string, values: ProofValuesUpdateRequest): Promise<ProofResponse>;
|
|
45
66
|
/**
|
|
46
67
|
* Claim a proof for a product using a proof ID (serial number, NFC tag, etc.).
|
|
47
68
|
* PUT /public/collection/:collectionId/product/:productId/proof/:proofId/claim
|
package/dist/api/proof.js
CHANGED
|
@@ -64,6 +64,31 @@ export var proof;
|
|
|
64
64
|
return put(path, values);
|
|
65
65
|
}
|
|
66
66
|
proof.update = update;
|
|
67
|
+
/**
|
|
68
|
+
* Owner self-service update of a proof's owner-writable data.
|
|
69
|
+
* PUT /public/collection/:collectionId/product/:productId/proof/:proofId/values
|
|
70
|
+
*
|
|
71
|
+
* The public counterpart to admin `update` — the current OWNER (or a collection
|
|
72
|
+
* admin) editing their own proof, no admin credentials required. Only owner-writable
|
|
73
|
+
* zones are honoured (see {@link ProofValuesUpdateRequest}):
|
|
74
|
+
* ```ts
|
|
75
|
+
* proof.updateValues(collectionId, productId, proofId, {
|
|
76
|
+
* colour: 'blue', // → proof.values.colour (public)
|
|
77
|
+
* owner: { warranty: '2y' }, // → proof.values.owner (owner-scoped)
|
|
78
|
+
* personal: { nickname: 'Bo' }, // → proof.values.personal[callerUid] (private, own slot only)
|
|
79
|
+
* })
|
|
80
|
+
* ```
|
|
81
|
+
* `personal` always targets the caller's OWN slot — you cannot write another
|
|
82
|
+
* user's personal data, even as an admin. Object zones deep-merge (owner/personal
|
|
83
|
+
* merge field-by-field), so you can change one field without wiping the rest.
|
|
84
|
+
* Business-only zones (`data`/`admin`/`private`) are not writable here — use the
|
|
85
|
+
* admin `update` for those.
|
|
86
|
+
*/
|
|
87
|
+
async function updateValues(collectionId, productId, proofId, values) {
|
|
88
|
+
const path = `/public/collection/${encodeURIComponent(collectionId)}/product/${encodeURIComponent(productId)}/proof/${encodeURIComponent(proofId)}/values`;
|
|
89
|
+
return put(path, values);
|
|
90
|
+
}
|
|
91
|
+
proof.updateValues = updateValues;
|
|
67
92
|
/**
|
|
68
93
|
* Claim a proof for a product using a proof ID (serial number, NFC tag, etc.).
|
|
69
94
|
* PUT /public/collection/:collectionId/product/:productId/proof/:proofId/claim
|
package/dist/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.16.
|
|
3
|
+
Version: 1.16.3 | Generated: 2026-09-05T10:57:07.719Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -3058,63 +3058,6 @@ interface AccountInfoResponse {
|
|
|
3058
3058
|
|
|
3059
3059
|
### authKit
|
|
3060
3060
|
|
|
3061
|
-
**AuthTelemetryEvent** (interface)
|
|
3062
|
-
```typescript
|
|
3063
|
-
interface AuthTelemetryEvent {
|
|
3064
|
-
eventId: string
|
|
3065
|
-
correlationId: string
|
|
3066
|
-
clientId: string
|
|
3067
|
-
collectionId?: string
|
|
3068
|
-
type: AuthEventType
|
|
3069
|
-
flow: AuthFlow
|
|
3070
|
-
ts: string
|
|
3071
|
-
durationMs?: number
|
|
3072
|
-
outcome?: 'success' | 'error' | 'stalled' | 'abandoned'
|
|
3073
|
-
error?: {
|
|
3074
|
-
code?: string
|
|
3075
|
-
statusCode?: number
|
|
3076
|
-
message?: string
|
|
3077
|
-
name?: string
|
|
3078
|
-
stack?: string
|
|
3079
|
-
endpoint?: string
|
|
3080
|
-
}
|
|
3081
|
-
context: {
|
|
3082
|
-
sdkVersion: string
|
|
3083
|
-
authKitVersion: string
|
|
3084
|
-
mode: 'standalone' | 'embedded' | 'proxy' | 'native'
|
|
3085
|
-
route?: string
|
|
3086
|
-
deepLinkMode?: string
|
|
3087
|
-
userAgent: string
|
|
3088
|
-
platform?: string
|
|
3089
|
-
language?: string
|
|
3090
|
-
online: boolean
|
|
3091
|
-
viewport?: { w: number; h: number }
|
|
3092
|
-
darkMode?: boolean
|
|
3093
|
-
}
|
|
3094
|
-
subject?: { uid?: string; emailHash?: string }
|
|
3095
|
-
}
|
|
3096
|
-
```
|
|
3097
|
-
|
|
3098
|
-
**TelemetryIngestResponse** (interface)
|
|
3099
|
-
```typescript
|
|
3100
|
-
interface TelemetryIngestResponse {
|
|
3101
|
-
accepted: number
|
|
3102
|
-
rejected: number
|
|
3103
|
-
rejectedIds: string[]
|
|
3104
|
-
}
|
|
3105
|
-
```
|
|
3106
|
-
|
|
3107
|
-
**AuthKitTelemetryConfig** (interface)
|
|
3108
|
-
```typescript
|
|
3109
|
-
interface AuthKitTelemetryConfig {
|
|
3110
|
-
enabled?: boolean
|
|
3111
|
-
successSampleRate?: number
|
|
3112
|
-
captureJsErrors?: boolean
|
|
3113
|
-
stallThresholdMs?: number
|
|
3114
|
-
retentionDays?: number
|
|
3115
|
-
}
|
|
3116
|
-
```
|
|
3117
|
-
|
|
3118
3061
|
**AuthKitUser** (interface)
|
|
3119
3062
|
```typescript
|
|
3120
3063
|
interface AuthKitUser {
|
|
@@ -3578,10 +3521,6 @@ interface AuthKitLockoutPolicy {
|
|
|
3578
3521
|
}
|
|
3579
3522
|
```
|
|
3580
3523
|
|
|
3581
|
-
**AuthEventType** = ``
|
|
3582
|
-
|
|
3583
|
-
**AuthFlow** = ``
|
|
3584
|
-
|
|
3585
3524
|
**RefreshErrorCode** = ``
|
|
3586
3525
|
|
|
3587
3526
|
**AuthKitErrorCode** = ``
|
|
@@ -3610,20 +3549,25 @@ interface FirebaseTimestamp {
|
|
|
3610
3549
|
```typescript
|
|
3611
3550
|
interface BatchResponse {
|
|
3612
3551
|
id: string // Batch ID
|
|
3613
|
-
name?: string
|
|
3614
|
-
expiryDate?:
|
|
3615
|
-
productId?: string // Product ID
|
|
3552
|
+
name?: string | null // Batch name
|
|
3553
|
+
expiryDate?: string | null
|
|
3554
|
+
productId?: string // Product ID
|
|
3616
3555
|
collectionId?: string // Collection ID
|
|
3617
|
-
|
|
3556
|
+
createdAt?: string // ISO 8601
|
|
3557
|
+
updatedAt?: string // ISO 8601
|
|
3558
|
+
deleted?: boolean
|
|
3559
|
+
deletedAt?: string // ISO 8601
|
|
3560
|
+
admin?: Record<string, any>
|
|
3561
|
+
[key: string]: any // Additional (schemaless) batch fields
|
|
3618
3562
|
}
|
|
3619
3563
|
```
|
|
3620
3564
|
|
|
3621
3565
|
**BatchCreateRequest** (interface)
|
|
3622
3566
|
```typescript
|
|
3623
3567
|
interface BatchCreateRequest {
|
|
3624
|
-
id
|
|
3625
|
-
name?: string
|
|
3626
|
-
expiryDate?: FirebaseTimestamp | string
|
|
3568
|
+
id?: string
|
|
3569
|
+
name?: string
|
|
3570
|
+
expiryDate?: FirebaseTimestamp | string | Date
|
|
3627
3571
|
[key: string]: any // Additional batch fields
|
|
3628
3572
|
}
|
|
3629
3573
|
```
|
|
@@ -3631,8 +3575,8 @@ interface BatchCreateRequest {
|
|
|
3631
3575
|
**BatchUpdateRequest** (interface)
|
|
3632
3576
|
```typescript
|
|
3633
3577
|
interface BatchUpdateRequest {
|
|
3634
|
-
name?: string
|
|
3635
|
-
expiryDate?: FirebaseTimestamp | string
|
|
3578
|
+
name?: string
|
|
3579
|
+
expiryDate?: FirebaseTimestamp | string | Date
|
|
3636
3580
|
[key: string]: any // Additional batch fields
|
|
3637
3581
|
}
|
|
3638
3582
|
```
|
|
@@ -7494,6 +7438,9 @@ interface ProductFieldsConfig {
|
|
|
7494
7438
|
```typescript
|
|
7495
7439
|
interface ProofValues {
|
|
7496
7440
|
[key: string]: JsonValue | Record<string, JsonValue> | Record<string, Record<string, JsonValue>> | undefined
|
|
7441
|
+
* Owner-scoped: read/write by business + current owner; transfers with ownership.
|
|
7442
|
+
* Read exception: while the proof is `claimable`, this bag is also readable by everyone
|
|
7443
|
+
* (so a prospective claimer sees pre-set owner data); it reverts to owner-only once claimed.
|
|
7497
7444
|
owner?: Record<string, JsonValue>
|
|
7498
7445
|
personal?: Record<string, Record<string, JsonValue>>
|
|
7499
7446
|
}
|
|
@@ -7552,6 +7499,15 @@ interface ProofCreateRequest {
|
|
|
7552
7499
|
}
|
|
7553
7500
|
```
|
|
7554
7501
|
|
|
7502
|
+
**ProofValuesUpdateRequest** (interface)
|
|
7503
|
+
```typescript
|
|
7504
|
+
interface ProofValuesUpdateRequest {
|
|
7505
|
+
[key: string]: JsonValue | Record<string, JsonValue> | undefined
|
|
7506
|
+
owner?: Record<string, JsonValue>
|
|
7507
|
+
personal?: Record<string, JsonValue>
|
|
7508
|
+
}
|
|
7509
|
+
```
|
|
7510
|
+
|
|
7555
7511
|
**ProofFieldsConfig** (interface)
|
|
7556
7512
|
```typescript
|
|
7557
7513
|
interface ProofFieldsConfig {
|
|
@@ -8214,11 +8170,38 @@ interface TranslationUpdateRequest {
|
|
|
8214
8170
|
|
|
8215
8171
|
### variant
|
|
8216
8172
|
|
|
8217
|
-
**VariantResponse**
|
|
8173
|
+
**VariantResponse** (interface)
|
|
8174
|
+
```typescript
|
|
8175
|
+
interface VariantResponse {
|
|
8176
|
+
id: string
|
|
8177
|
+
name?: string | null
|
|
8178
|
+
productId?: string
|
|
8179
|
+
collectionId?: string
|
|
8180
|
+
createdAt?: string // ISO 8601
|
|
8181
|
+
updatedAt?: string // ISO 8601
|
|
8182
|
+
deleted?: boolean
|
|
8183
|
+
deletedAt?: string // ISO 8601
|
|
8184
|
+
admin?: Record<string, any>
|
|
8185
|
+
[key: string]: any // Additional (schemaless) variant fields
|
|
8186
|
+
}
|
|
8187
|
+
```
|
|
8218
8188
|
|
|
8219
|
-
**VariantCreateRequest**
|
|
8189
|
+
**VariantCreateRequest** (interface)
|
|
8190
|
+
```typescript
|
|
8191
|
+
interface VariantCreateRequest {
|
|
8192
|
+
id?: string
|
|
8193
|
+
name?: string
|
|
8194
|
+
[key: string]: any
|
|
8195
|
+
}
|
|
8196
|
+
```
|
|
8220
8197
|
|
|
8221
|
-
**VariantUpdateRequest**
|
|
8198
|
+
**VariantUpdateRequest** (interface)
|
|
8199
|
+
```typescript
|
|
8200
|
+
interface VariantUpdateRequest {
|
|
8201
|
+
name?: string
|
|
8202
|
+
[key: string]: any
|
|
8203
|
+
}
|
|
8204
|
+
```
|
|
8222
8205
|
|
|
8223
8206
|
### widgets
|
|
8224
8207
|
|
|
@@ -10370,6 +10353,12 @@ Create a proof for a product (admin only). POST /admin/collection/:collectionId/
|
|
|
10370
10353
|
values: ProofUpdateRequest) → `Promise<ProofResponse>`
|
|
10371
10354
|
Update a proof for a product (admin only). PUT /admin/collection/:collectionId/product/:productId/proof/:proofId Pass the fields to change **at the root**, keyed by zone (see {@link ProofWrite}): ```ts proof.update(collectionId, productId, proofId, { data: { serialNo: 1002 }, // → proof.data (admin-only writable) values: { colour: 'blue' }, // → proof.values }) ``` Object zones deep-merge, so you can change one field without wiping the rest.
|
|
10372
10355
|
|
|
10356
|
+
**updateValues**(collectionId: string,
|
|
10357
|
+
productId: string,
|
|
10358
|
+
proofId: string,
|
|
10359
|
+
values: ProofValuesUpdateRequest) → `Promise<ProofResponse>`
|
|
10360
|
+
Owner self-service update of a proof's owner-writable data. PUT /public/collection/:collectionId/product/:productId/proof/:proofId/values The public counterpart to admin `update` — the current OWNER (or a collection admin) editing their own proof, no admin credentials required. Only owner-writable zones are honoured (see {@link ProofValuesUpdateRequest}): ```ts proof.updateValues(collectionId, productId, proofId, { colour: 'blue', // → proof.values.colour (public) owner: { warranty: '2y' }, // → proof.values.owner (owner-scoped) personal: { nickname: 'Bo' }, // → proof.values.personal[callerUid] (private, own slot only) }) ``` `personal` always targets the caller's OWN slot — you cannot write another user's personal data, even as an admin. Object zones deep-merge (owner/personal merge field-by-field), so you can change one field without wiping the rest. Business-only zones (`data`/`admin`/`private`) are not writable here — use the admin `update` for those.
|
|
10361
|
+
|
|
10373
10362
|
**claim**(collectionId: string,
|
|
10374
10363
|
productId: string,
|
|
10375
10364
|
proofId: string,
|
|
@@ -37,7 +37,8 @@ proof.admin = { … } // BUSINESS-ONLY → read: business, write: b
|
|
|
37
37
|
proof.values = { // consumer bag — owner + business-writable
|
|
38
38
|
<anyKey>: …, // PUBLIC → read: everyone,
|
|
39
39
|
// write: business + current owner
|
|
40
|
-
owner: { … }, // OWNER-SCOPED → read: business + current owner
|
|
40
|
+
owner: { … }, // OWNER-SCOPED → read: business + current owner
|
|
41
|
+
// (also everyone while `claimable`, see below),
|
|
41
42
|
// write: business + current owner,
|
|
42
43
|
// transfers with ownership
|
|
43
44
|
personal: { // PER-USER → read/write: only the specific user,
|
|
@@ -75,10 +76,12 @@ The field-config editor and SDK write helpers MUST reject attempts to create top
|
|
|
75
76
|
| `proof.data.*` | ✅ | ✅ | ✅ | ✅ |
|
|
76
77
|
| `proof.admin.*` | ❌ | ❌ | ❌ | ✅ |
|
|
77
78
|
| `proof.values.<publicKey>` | ✅ | ✅ | ✅ | ✅ |
|
|
78
|
-
| `proof.values.owner.*` |
|
|
79
|
+
| `proof.values.owner.*` | ❌ † | ❌ † | ✅ | ✅ |
|
|
79
80
|
| `proof.values.personal[me].*` | ❌ | ✅ (own slot only) | ✅ (own slot) | ❌ (see note) |
|
|
80
81
|
| `proof.values.personal[other].*` | ❌ | ❌ | ❌ | ❌ (see note) |
|
|
81
82
|
|
|
83
|
+
> **† Claimable exception (`proof.values.owner.*`):** while a proof is **claimable** (`proof.claimable === true` *or* `proof.values.claimable === true`), its `owner` bag is returned to **everyone** — public/anonymous and authenticated non-owners included — so a prospective claimer can see pre-set owner data before claiming. Once the proof is claimed (`claimable` flips off) it reverts to owner-only (unless re-marked claimable). This is **read-only** exposure — write authority is unchanged (still owner + business). Implication: don't put anything in `values.owner` on a claimable proof that shouldn't be visible before it's claimed.
|
|
84
|
+
>
|
|
82
85
|
> **Note on `personal`:** the default rule is that `personal` slots are readable *only* by the user whose `userId` matches the slot key — not even business admins. If the platform ever needs an admin-visible variant, it should be a separate mechanism, not a relaxation of this rule.
|
|
83
86
|
|
|
84
87
|
## Who writes what (authority matrix)
|
package/dist/openapi.yaml
CHANGED
|
@@ -12643,6 +12643,48 @@ paths:
|
|
|
12643
12643
|
description: Unauthorized
|
|
12644
12644
|
404:
|
|
12645
12645
|
description: Not found
|
|
12646
|
+
/public/collection/{collectionId}/product/{productId}/proof/{proofId}/values:
|
|
12647
|
+
put:
|
|
12648
|
+
tags:
|
|
12649
|
+
- proof
|
|
12650
|
+
summary: proof.updateValues
|
|
12651
|
+
operationId: proof_updateValues
|
|
12652
|
+
security: []
|
|
12653
|
+
parameters:
|
|
12654
|
+
- name: collectionId
|
|
12655
|
+
in: path
|
|
12656
|
+
required: true
|
|
12657
|
+
schema:
|
|
12658
|
+
type: string
|
|
12659
|
+
- name: productId
|
|
12660
|
+
in: path
|
|
12661
|
+
required: true
|
|
12662
|
+
schema:
|
|
12663
|
+
type: string
|
|
12664
|
+
- name: proofId
|
|
12665
|
+
in: path
|
|
12666
|
+
required: true
|
|
12667
|
+
schema:
|
|
12668
|
+
type: string
|
|
12669
|
+
responses:
|
|
12670
|
+
200:
|
|
12671
|
+
description: Success
|
|
12672
|
+
content:
|
|
12673
|
+
application/json:
|
|
12674
|
+
schema:
|
|
12675
|
+
$ref: "#/components/schemas/ProofResponse"
|
|
12676
|
+
400:
|
|
12677
|
+
description: Bad request
|
|
12678
|
+
401:
|
|
12679
|
+
description: Unauthorized
|
|
12680
|
+
404:
|
|
12681
|
+
description: Not found
|
|
12682
|
+
requestBody:
|
|
12683
|
+
required: true
|
|
12684
|
+
content:
|
|
12685
|
+
application/json:
|
|
12686
|
+
schema:
|
|
12687
|
+
$ref: "#/components/schemas/ProofValuesUpdateRequest"
|
|
12646
12688
|
/public/collection/{collectionId}/products/{productId}/createClaim:
|
|
12647
12689
|
post:
|
|
12648
12690
|
tags:
|
|
@@ -19137,122 +19179,6 @@ components:
|
|
|
19137
19179
|
- auth_time
|
|
19138
19180
|
- iat
|
|
19139
19181
|
- features
|
|
19140
|
-
AuthTelemetryEvent:
|
|
19141
|
-
type: object
|
|
19142
|
-
properties:
|
|
19143
|
-
eventId:
|
|
19144
|
-
type: string
|
|
19145
|
-
correlationId:
|
|
19146
|
-
type: string
|
|
19147
|
-
clientId:
|
|
19148
|
-
type: string
|
|
19149
|
-
collectionId:
|
|
19150
|
-
type: string
|
|
19151
|
-
type:
|
|
19152
|
-
$ref: "#/components/schemas/AuthEventType"
|
|
19153
|
-
flow:
|
|
19154
|
-
$ref: "#/components/schemas/AuthFlow"
|
|
19155
|
-
ts:
|
|
19156
|
-
type: string
|
|
19157
|
-
durationMs:
|
|
19158
|
-
type: number
|
|
19159
|
-
outcome:
|
|
19160
|
-
type: string
|
|
19161
|
-
enum:
|
|
19162
|
-
- success
|
|
19163
|
-
- error
|
|
19164
|
-
- stalled
|
|
19165
|
-
- abandoned
|
|
19166
|
-
error:
|
|
19167
|
-
type: object
|
|
19168
|
-
additionalProperties: true
|
|
19169
|
-
code:
|
|
19170
|
-
type: string
|
|
19171
|
-
statusCode:
|
|
19172
|
-
type: number
|
|
19173
|
-
message:
|
|
19174
|
-
type: string
|
|
19175
|
-
name:
|
|
19176
|
-
type: string
|
|
19177
|
-
stack:
|
|
19178
|
-
type: string
|
|
19179
|
-
endpoint:
|
|
19180
|
-
type: string
|
|
19181
|
-
context:
|
|
19182
|
-
type: object
|
|
19183
|
-
additionalProperties: true
|
|
19184
|
-
sdkVersion:
|
|
19185
|
-
type: string
|
|
19186
|
-
authKitVersion:
|
|
19187
|
-
type: string
|
|
19188
|
-
mode:
|
|
19189
|
-
type: string
|
|
19190
|
-
enum:
|
|
19191
|
-
- standalone
|
|
19192
|
-
- embedded
|
|
19193
|
-
- proxy
|
|
19194
|
-
- native
|
|
19195
|
-
route:
|
|
19196
|
-
type: string
|
|
19197
|
-
deepLinkMode:
|
|
19198
|
-
type: string
|
|
19199
|
-
userAgent:
|
|
19200
|
-
type: string
|
|
19201
|
-
platform:
|
|
19202
|
-
type: string
|
|
19203
|
-
language:
|
|
19204
|
-
type: string
|
|
19205
|
-
online:
|
|
19206
|
-
type: boolean
|
|
19207
|
-
viewport:
|
|
19208
|
-
type: object
|
|
19209
|
-
additionalProperties: true
|
|
19210
|
-
darkMode:
|
|
19211
|
-
type: boolean
|
|
19212
|
-
subject:
|
|
19213
|
-
type: object
|
|
19214
|
-
additionalProperties: true
|
|
19215
|
-
required:
|
|
19216
|
-
- eventId
|
|
19217
|
-
- correlationId
|
|
19218
|
-
- clientId
|
|
19219
|
-
- type
|
|
19220
|
-
- flow
|
|
19221
|
-
- ts
|
|
19222
|
-
- context
|
|
19223
|
-
- sdkVersion
|
|
19224
|
-
- authKitVersion
|
|
19225
|
-
- mode
|
|
19226
|
-
- userAgent
|
|
19227
|
-
- online
|
|
19228
|
-
TelemetryIngestResponse:
|
|
19229
|
-
type: object
|
|
19230
|
-
properties:
|
|
19231
|
-
accepted:
|
|
19232
|
-
type: number
|
|
19233
|
-
rejected:
|
|
19234
|
-
type: number
|
|
19235
|
-
rejectedIds:
|
|
19236
|
-
type: array
|
|
19237
|
-
items:
|
|
19238
|
-
type: string
|
|
19239
|
-
required:
|
|
19240
|
-
- accepted
|
|
19241
|
-
- rejected
|
|
19242
|
-
- rejectedIds
|
|
19243
|
-
AuthKitTelemetryConfig:
|
|
19244
|
-
type: object
|
|
19245
|
-
properties:
|
|
19246
|
-
enabled:
|
|
19247
|
-
type: boolean
|
|
19248
|
-
successSampleRate:
|
|
19249
|
-
type: number
|
|
19250
|
-
captureJsErrors:
|
|
19251
|
-
type: boolean
|
|
19252
|
-
stallThresholdMs:
|
|
19253
|
-
type: number
|
|
19254
|
-
retentionDays:
|
|
19255
|
-
type: number
|
|
19256
19182
|
AuthKitUser:
|
|
19257
19183
|
type: object
|
|
19258
19184
|
properties:
|
|
@@ -19958,12 +19884,22 @@ components:
|
|
|
19958
19884
|
name:
|
|
19959
19885
|
type: string
|
|
19960
19886
|
expiryDate:
|
|
19961
|
-
type:
|
|
19962
|
-
additionalProperties: true
|
|
19887
|
+
type: string
|
|
19963
19888
|
productId:
|
|
19964
19889
|
type: string
|
|
19965
19890
|
collectionId:
|
|
19966
19891
|
type: string
|
|
19892
|
+
createdAt:
|
|
19893
|
+
type: string
|
|
19894
|
+
updatedAt:
|
|
19895
|
+
type: string
|
|
19896
|
+
deleted:
|
|
19897
|
+
type: boolean
|
|
19898
|
+
deletedAt:
|
|
19899
|
+
type: string
|
|
19900
|
+
admin:
|
|
19901
|
+
type: object
|
|
19902
|
+
additionalProperties: true
|
|
19967
19903
|
required:
|
|
19968
19904
|
- id
|
|
19969
19905
|
BatchCreateRequest:
|
|
@@ -19976,8 +19912,6 @@ components:
|
|
|
19976
19912
|
expiryDate:
|
|
19977
19913
|
type: object
|
|
19978
19914
|
additionalProperties: true
|
|
19979
|
-
required:
|
|
19980
|
-
- id
|
|
19981
19915
|
BatchUpdateRequest:
|
|
19982
19916
|
type: object
|
|
19983
19917
|
properties:
|
|
@@ -25772,6 +25706,17 @@ components:
|
|
|
25772
25706
|
type: object
|
|
25773
25707
|
additionalProperties:
|
|
25774
25708
|
$ref: "#/components/schemas/JsonValue"
|
|
25709
|
+
ProofValuesUpdateRequest:
|
|
25710
|
+
type: object
|
|
25711
|
+
properties:
|
|
25712
|
+
owner:
|
|
25713
|
+
type: object
|
|
25714
|
+
additionalProperties:
|
|
25715
|
+
$ref: "#/components/schemas/JsonValue"
|
|
25716
|
+
personal:
|
|
25717
|
+
type: object
|
|
25718
|
+
additionalProperties:
|
|
25719
|
+
$ref: "#/components/schemas/JsonValue"
|
|
25775
25720
|
ProofFieldsConfig:
|
|
25776
25721
|
type: object
|
|
25777
25722
|
properties:
|
|
@@ -26806,6 +26751,42 @@ components:
|
|
|
26806
26751
|
metadata:
|
|
26807
26752
|
type: object
|
|
26808
26753
|
additionalProperties: true
|
|
26754
|
+
VariantResponse:
|
|
26755
|
+
type: object
|
|
26756
|
+
properties:
|
|
26757
|
+
id:
|
|
26758
|
+
type: string
|
|
26759
|
+
name:
|
|
26760
|
+
type: string
|
|
26761
|
+
productId:
|
|
26762
|
+
type: string
|
|
26763
|
+
collectionId:
|
|
26764
|
+
type: string
|
|
26765
|
+
createdAt:
|
|
26766
|
+
type: string
|
|
26767
|
+
updatedAt:
|
|
26768
|
+
type: string
|
|
26769
|
+
deleted:
|
|
26770
|
+
type: boolean
|
|
26771
|
+
deletedAt:
|
|
26772
|
+
type: string
|
|
26773
|
+
admin:
|
|
26774
|
+
type: object
|
|
26775
|
+
additionalProperties: true
|
|
26776
|
+
required:
|
|
26777
|
+
- id
|
|
26778
|
+
VariantCreateRequest:
|
|
26779
|
+
type: object
|
|
26780
|
+
properties:
|
|
26781
|
+
id:
|
|
26782
|
+
type: string
|
|
26783
|
+
name:
|
|
26784
|
+
type: string
|
|
26785
|
+
VariantUpdateRequest:
|
|
26786
|
+
type: object
|
|
26787
|
+
properties:
|
|
26788
|
+
name:
|
|
26789
|
+
type: string
|
|
26809
26790
|
NavigationRequest:
|
|
26810
26791
|
type: object
|
|
26811
26792
|
properties:
|
package/dist/types/batch.d.ts
CHANGED
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @deprecated Batches moved to Postgres — dates now come back as ISO 8601 strings, never
|
|
3
|
+
* Firestore Timestamp objects. Kept only so request bodies can still pass a legacy value.
|
|
3
4
|
*/
|
|
4
5
|
export interface FirebaseTimestamp {
|
|
5
6
|
seconds: number;
|
|
6
7
|
nanoseconds?: number;
|
|
7
8
|
}
|
|
8
9
|
/**
|
|
9
|
-
* Represents a Batch object.
|
|
10
|
+
* Represents a Batch object. Dates are **ISO 8601 strings**.
|
|
10
11
|
*/
|
|
11
12
|
export interface BatchResponse {
|
|
12
13
|
id: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
|
|
14
|
+
name?: string | null;
|
|
15
|
+
/** ISO 8601 date-time (was a Firebase Timestamp; now normalised to a string). */
|
|
16
|
+
expiryDate?: string | null;
|
|
15
17
|
productId?: string;
|
|
16
18
|
collectionId?: string;
|
|
19
|
+
createdAt?: string;
|
|
20
|
+
updatedAt?: string;
|
|
21
|
+
/** Present only on soft-deleted batches. */
|
|
22
|
+
deleted?: boolean;
|
|
23
|
+
deletedAt?: string;
|
|
24
|
+
/** Admin-only zone (e.g. `lastSerialId`). Returned on admin reads only — never on public reads. */
|
|
25
|
+
admin?: Record<string, any>;
|
|
17
26
|
[key: string]: any;
|
|
18
27
|
}
|
|
19
28
|
/**
|
|
20
29
|
* Request payload for creating a new batch.
|
|
21
30
|
*/
|
|
22
31
|
export interface BatchCreateRequest {
|
|
23
|
-
id
|
|
32
|
+
/** @deprecated Ignored — the server generates the batch id. */
|
|
33
|
+
id?: string;
|
|
24
34
|
name?: string;
|
|
25
|
-
|
|
35
|
+
/** A `Date`, ISO 8601 string, or legacy Firebase Timestamp — all accepted. */
|
|
36
|
+
expiryDate?: FirebaseTimestamp | string | Date;
|
|
26
37
|
[key: string]: any;
|
|
27
38
|
}
|
|
28
39
|
/**
|
|
@@ -30,7 +41,7 @@ export interface BatchCreateRequest {
|
|
|
30
41
|
*/
|
|
31
42
|
export interface BatchUpdateRequest {
|
|
32
43
|
name?: string;
|
|
33
|
-
expiryDate?: FirebaseTimestamp | string;
|
|
44
|
+
expiryDate?: FirebaseTimestamp | string | Date;
|
|
34
45
|
[key: string]: any;
|
|
35
46
|
}
|
|
36
47
|
/**
|
package/dist/types/proof.d.ts
CHANGED
|
@@ -7,7 +7,11 @@ import { JsonValue, ScopedFieldDef } from './product';
|
|
|
7
7
|
*/
|
|
8
8
|
export interface ProofValues {
|
|
9
9
|
[key: string]: JsonValue | Record<string, JsonValue> | Record<string, Record<string, JsonValue>> | undefined;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Owner-scoped: read/write by business + current owner; transfers with ownership.
|
|
12
|
+
* Read exception: while the proof is `claimable`, this bag is also readable by everyone
|
|
13
|
+
* (so a prospective claimer sees pre-set owner data); it reverts to owner-only once claimed.
|
|
14
|
+
*/
|
|
11
15
|
owner?: Record<string, JsonValue>;
|
|
12
16
|
/** Per-user: read/write only by the matching userId; not visible to the next owner, not even business admins. */
|
|
13
17
|
personal?: Record<string, Record<string, JsonValue>>;
|
|
@@ -111,6 +115,27 @@ export interface ProofCreateRequest {
|
|
|
111
115
|
export type ProofUpdateRequest = Partial<ProofWrite> & {
|
|
112
116
|
proof?: ProofWrite;
|
|
113
117
|
};
|
|
118
|
+
/**
|
|
119
|
+
* Body for the owner self-service values write (`proof.updateValues`), the
|
|
120
|
+
* public counterpart to the admin `update`. The caller must be the current
|
|
121
|
+
* owner (or a collection admin). Only owner-writable zones are honoured:
|
|
122
|
+
*
|
|
123
|
+
* - flat keys → `proof.values.<key>` (public data)
|
|
124
|
+
* - `owner` → merged into `proof.values.owner` (owner-scoped)
|
|
125
|
+
* - `personal` → merged into `proof.values.personal[callerUid]` — the
|
|
126
|
+
* caller's OWN private slot only, never another user's
|
|
127
|
+
* (owner-only, non-transferring; not even admins can
|
|
128
|
+
* write someone else's slot)
|
|
129
|
+
*
|
|
130
|
+
* `private` / `proof` sub-keys are business-only and are ignored here.
|
|
131
|
+
*/
|
|
132
|
+
export interface ProofValuesUpdateRequest {
|
|
133
|
+
[key: string]: JsonValue | Record<string, JsonValue> | undefined;
|
|
134
|
+
/** Owner-scoped data, merged into `proof.values.owner`. */
|
|
135
|
+
owner?: Record<string, JsonValue>;
|
|
136
|
+
/** The caller's own private slot, merged into `proof.values.personal[callerUid]`. */
|
|
137
|
+
personal?: Record<string, JsonValue>;
|
|
138
|
+
}
|
|
114
139
|
export type ProofClaimRequest = Record<string, any>;
|
|
115
140
|
/**
|
|
116
141
|
* `'public'` (default, omitted) reads/writes `proof.values[key]`.
|
package/dist/types/variant.d.ts
CHANGED
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Represents a Variant object.
|
|
2
|
+
* Represents a Variant object. Dates are ISO 8601 strings (Postgres-backed).
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export interface VariantResponse {
|
|
5
|
+
id: string;
|
|
6
|
+
name?: string | null;
|
|
7
|
+
productId?: string;
|
|
8
|
+
collectionId?: string;
|
|
9
|
+
createdAt?: string;
|
|
10
|
+
updatedAt?: string;
|
|
11
|
+
/** Present only on soft-deleted variants. */
|
|
12
|
+
deleted?: boolean;
|
|
13
|
+
deletedAt?: string;
|
|
14
|
+
/** Admin-only zone (e.g. `lastSerialId`). Admin reads only — never on public reads. */
|
|
15
|
+
admin?: Record<string, any>;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
5
18
|
/**
|
|
6
19
|
* Request payload for creating a new variant.
|
|
7
20
|
*/
|
|
8
|
-
export
|
|
21
|
+
export interface VariantCreateRequest {
|
|
22
|
+
/** @deprecated Ignored — the server generates the variant id. (Use PUT with an id to choose one.) */
|
|
23
|
+
id?: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}
|
|
9
27
|
/**
|
|
10
|
-
* Request payload for updating
|
|
28
|
+
* Request payload for updating a variant. PUT with a new id creates it (upsert).
|
|
11
29
|
*/
|
|
12
|
-
export
|
|
30
|
+
export interface VariantUpdateRequest {
|
|
31
|
+
name?: string;
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}
|
package/dist/utils/paths.js
CHANGED
|
@@ -110,13 +110,9 @@ export function buildPortalPath(params) {
|
|
|
110
110
|
// Batch object - extract id and expiryDate
|
|
111
111
|
extractedBatchId = batch.id;
|
|
112
112
|
if (batch.expiryDate) {
|
|
113
|
-
//
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
expiryDate = batch.expiryDate;
|
|
119
|
-
}
|
|
113
|
+
// Now an ISO string, but stay defensive about a legacy Firebase Timestamp object.
|
|
114
|
+
const exp = batch.expiryDate;
|
|
115
|
+
expiryDate = (exp && typeof exp === 'object' && 'seconds' in exp) ? new Date(exp.seconds * 1000) : exp;
|
|
120
116
|
}
|
|
121
117
|
}
|
|
122
118
|
else if (batchId) {
|
package/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.16.
|
|
3
|
+
Version: 1.16.3 | Generated: 2026-09-05T10:57:07.719Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -3058,63 +3058,6 @@ interface AccountInfoResponse {
|
|
|
3058
3058
|
|
|
3059
3059
|
### authKit
|
|
3060
3060
|
|
|
3061
|
-
**AuthTelemetryEvent** (interface)
|
|
3062
|
-
```typescript
|
|
3063
|
-
interface AuthTelemetryEvent {
|
|
3064
|
-
eventId: string
|
|
3065
|
-
correlationId: string
|
|
3066
|
-
clientId: string
|
|
3067
|
-
collectionId?: string
|
|
3068
|
-
type: AuthEventType
|
|
3069
|
-
flow: AuthFlow
|
|
3070
|
-
ts: string
|
|
3071
|
-
durationMs?: number
|
|
3072
|
-
outcome?: 'success' | 'error' | 'stalled' | 'abandoned'
|
|
3073
|
-
error?: {
|
|
3074
|
-
code?: string
|
|
3075
|
-
statusCode?: number
|
|
3076
|
-
message?: string
|
|
3077
|
-
name?: string
|
|
3078
|
-
stack?: string
|
|
3079
|
-
endpoint?: string
|
|
3080
|
-
}
|
|
3081
|
-
context: {
|
|
3082
|
-
sdkVersion: string
|
|
3083
|
-
authKitVersion: string
|
|
3084
|
-
mode: 'standalone' | 'embedded' | 'proxy' | 'native'
|
|
3085
|
-
route?: string
|
|
3086
|
-
deepLinkMode?: string
|
|
3087
|
-
userAgent: string
|
|
3088
|
-
platform?: string
|
|
3089
|
-
language?: string
|
|
3090
|
-
online: boolean
|
|
3091
|
-
viewport?: { w: number; h: number }
|
|
3092
|
-
darkMode?: boolean
|
|
3093
|
-
}
|
|
3094
|
-
subject?: { uid?: string; emailHash?: string }
|
|
3095
|
-
}
|
|
3096
|
-
```
|
|
3097
|
-
|
|
3098
|
-
**TelemetryIngestResponse** (interface)
|
|
3099
|
-
```typescript
|
|
3100
|
-
interface TelemetryIngestResponse {
|
|
3101
|
-
accepted: number
|
|
3102
|
-
rejected: number
|
|
3103
|
-
rejectedIds: string[]
|
|
3104
|
-
}
|
|
3105
|
-
```
|
|
3106
|
-
|
|
3107
|
-
**AuthKitTelemetryConfig** (interface)
|
|
3108
|
-
```typescript
|
|
3109
|
-
interface AuthKitTelemetryConfig {
|
|
3110
|
-
enabled?: boolean
|
|
3111
|
-
successSampleRate?: number
|
|
3112
|
-
captureJsErrors?: boolean
|
|
3113
|
-
stallThresholdMs?: number
|
|
3114
|
-
retentionDays?: number
|
|
3115
|
-
}
|
|
3116
|
-
```
|
|
3117
|
-
|
|
3118
3061
|
**AuthKitUser** (interface)
|
|
3119
3062
|
```typescript
|
|
3120
3063
|
interface AuthKitUser {
|
|
@@ -3578,10 +3521,6 @@ interface AuthKitLockoutPolicy {
|
|
|
3578
3521
|
}
|
|
3579
3522
|
```
|
|
3580
3523
|
|
|
3581
|
-
**AuthEventType** = ``
|
|
3582
|
-
|
|
3583
|
-
**AuthFlow** = ``
|
|
3584
|
-
|
|
3585
3524
|
**RefreshErrorCode** = ``
|
|
3586
3525
|
|
|
3587
3526
|
**AuthKitErrorCode** = ``
|
|
@@ -3610,20 +3549,25 @@ interface FirebaseTimestamp {
|
|
|
3610
3549
|
```typescript
|
|
3611
3550
|
interface BatchResponse {
|
|
3612
3551
|
id: string // Batch ID
|
|
3613
|
-
name?: string
|
|
3614
|
-
expiryDate?:
|
|
3615
|
-
productId?: string // Product ID
|
|
3552
|
+
name?: string | null // Batch name
|
|
3553
|
+
expiryDate?: string | null
|
|
3554
|
+
productId?: string // Product ID
|
|
3616
3555
|
collectionId?: string // Collection ID
|
|
3617
|
-
|
|
3556
|
+
createdAt?: string // ISO 8601
|
|
3557
|
+
updatedAt?: string // ISO 8601
|
|
3558
|
+
deleted?: boolean
|
|
3559
|
+
deletedAt?: string // ISO 8601
|
|
3560
|
+
admin?: Record<string, any>
|
|
3561
|
+
[key: string]: any // Additional (schemaless) batch fields
|
|
3618
3562
|
}
|
|
3619
3563
|
```
|
|
3620
3564
|
|
|
3621
3565
|
**BatchCreateRequest** (interface)
|
|
3622
3566
|
```typescript
|
|
3623
3567
|
interface BatchCreateRequest {
|
|
3624
|
-
id
|
|
3625
|
-
name?: string
|
|
3626
|
-
expiryDate?: FirebaseTimestamp | string
|
|
3568
|
+
id?: string
|
|
3569
|
+
name?: string
|
|
3570
|
+
expiryDate?: FirebaseTimestamp | string | Date
|
|
3627
3571
|
[key: string]: any // Additional batch fields
|
|
3628
3572
|
}
|
|
3629
3573
|
```
|
|
@@ -3631,8 +3575,8 @@ interface BatchCreateRequest {
|
|
|
3631
3575
|
**BatchUpdateRequest** (interface)
|
|
3632
3576
|
```typescript
|
|
3633
3577
|
interface BatchUpdateRequest {
|
|
3634
|
-
name?: string
|
|
3635
|
-
expiryDate?: FirebaseTimestamp | string
|
|
3578
|
+
name?: string
|
|
3579
|
+
expiryDate?: FirebaseTimestamp | string | Date
|
|
3636
3580
|
[key: string]: any // Additional batch fields
|
|
3637
3581
|
}
|
|
3638
3582
|
```
|
|
@@ -7494,6 +7438,9 @@ interface ProductFieldsConfig {
|
|
|
7494
7438
|
```typescript
|
|
7495
7439
|
interface ProofValues {
|
|
7496
7440
|
[key: string]: JsonValue | Record<string, JsonValue> | Record<string, Record<string, JsonValue>> | undefined
|
|
7441
|
+
* Owner-scoped: read/write by business + current owner; transfers with ownership.
|
|
7442
|
+
* Read exception: while the proof is `claimable`, this bag is also readable by everyone
|
|
7443
|
+
* (so a prospective claimer sees pre-set owner data); it reverts to owner-only once claimed.
|
|
7497
7444
|
owner?: Record<string, JsonValue>
|
|
7498
7445
|
personal?: Record<string, Record<string, JsonValue>>
|
|
7499
7446
|
}
|
|
@@ -7552,6 +7499,15 @@ interface ProofCreateRequest {
|
|
|
7552
7499
|
}
|
|
7553
7500
|
```
|
|
7554
7501
|
|
|
7502
|
+
**ProofValuesUpdateRequest** (interface)
|
|
7503
|
+
```typescript
|
|
7504
|
+
interface ProofValuesUpdateRequest {
|
|
7505
|
+
[key: string]: JsonValue | Record<string, JsonValue> | undefined
|
|
7506
|
+
owner?: Record<string, JsonValue>
|
|
7507
|
+
personal?: Record<string, JsonValue>
|
|
7508
|
+
}
|
|
7509
|
+
```
|
|
7510
|
+
|
|
7555
7511
|
**ProofFieldsConfig** (interface)
|
|
7556
7512
|
```typescript
|
|
7557
7513
|
interface ProofFieldsConfig {
|
|
@@ -8214,11 +8170,38 @@ interface TranslationUpdateRequest {
|
|
|
8214
8170
|
|
|
8215
8171
|
### variant
|
|
8216
8172
|
|
|
8217
|
-
**VariantResponse**
|
|
8173
|
+
**VariantResponse** (interface)
|
|
8174
|
+
```typescript
|
|
8175
|
+
interface VariantResponse {
|
|
8176
|
+
id: string
|
|
8177
|
+
name?: string | null
|
|
8178
|
+
productId?: string
|
|
8179
|
+
collectionId?: string
|
|
8180
|
+
createdAt?: string // ISO 8601
|
|
8181
|
+
updatedAt?: string // ISO 8601
|
|
8182
|
+
deleted?: boolean
|
|
8183
|
+
deletedAt?: string // ISO 8601
|
|
8184
|
+
admin?: Record<string, any>
|
|
8185
|
+
[key: string]: any // Additional (schemaless) variant fields
|
|
8186
|
+
}
|
|
8187
|
+
```
|
|
8218
8188
|
|
|
8219
|
-
**VariantCreateRequest**
|
|
8189
|
+
**VariantCreateRequest** (interface)
|
|
8190
|
+
```typescript
|
|
8191
|
+
interface VariantCreateRequest {
|
|
8192
|
+
id?: string
|
|
8193
|
+
name?: string
|
|
8194
|
+
[key: string]: any
|
|
8195
|
+
}
|
|
8196
|
+
```
|
|
8220
8197
|
|
|
8221
|
-
**VariantUpdateRequest**
|
|
8198
|
+
**VariantUpdateRequest** (interface)
|
|
8199
|
+
```typescript
|
|
8200
|
+
interface VariantUpdateRequest {
|
|
8201
|
+
name?: string
|
|
8202
|
+
[key: string]: any
|
|
8203
|
+
}
|
|
8204
|
+
```
|
|
8222
8205
|
|
|
8223
8206
|
### widgets
|
|
8224
8207
|
|
|
@@ -10370,6 +10353,12 @@ Create a proof for a product (admin only). POST /admin/collection/:collectionId/
|
|
|
10370
10353
|
values: ProofUpdateRequest) → `Promise<ProofResponse>`
|
|
10371
10354
|
Update a proof for a product (admin only). PUT /admin/collection/:collectionId/product/:productId/proof/:proofId Pass the fields to change **at the root**, keyed by zone (see {@link ProofWrite}): ```ts proof.update(collectionId, productId, proofId, { data: { serialNo: 1002 }, // → proof.data (admin-only writable) values: { colour: 'blue' }, // → proof.values }) ``` Object zones deep-merge, so you can change one field without wiping the rest.
|
|
10372
10355
|
|
|
10356
|
+
**updateValues**(collectionId: string,
|
|
10357
|
+
productId: string,
|
|
10358
|
+
proofId: string,
|
|
10359
|
+
values: ProofValuesUpdateRequest) → `Promise<ProofResponse>`
|
|
10360
|
+
Owner self-service update of a proof's owner-writable data. PUT /public/collection/:collectionId/product/:productId/proof/:proofId/values The public counterpart to admin `update` — the current OWNER (or a collection admin) editing their own proof, no admin credentials required. Only owner-writable zones are honoured (see {@link ProofValuesUpdateRequest}): ```ts proof.updateValues(collectionId, productId, proofId, { colour: 'blue', // → proof.values.colour (public) owner: { warranty: '2y' }, // → proof.values.owner (owner-scoped) personal: { nickname: 'Bo' }, // → proof.values.personal[callerUid] (private, own slot only) }) ``` `personal` always targets the caller's OWN slot — you cannot write another user's personal data, even as an admin. Object zones deep-merge (owner/personal merge field-by-field), so you can change one field without wiping the rest. Business-only zones (`data`/`admin`/`private`) are not writable here — use the admin `update` for those.
|
|
10361
|
+
|
|
10373
10362
|
**claim**(collectionId: string,
|
|
10374
10363
|
productId: string,
|
|
10375
10364
|
proofId: string,
|
|
@@ -37,7 +37,8 @@ proof.admin = { … } // BUSINESS-ONLY → read: business, write: b
|
|
|
37
37
|
proof.values = { // consumer bag — owner + business-writable
|
|
38
38
|
<anyKey>: …, // PUBLIC → read: everyone,
|
|
39
39
|
// write: business + current owner
|
|
40
|
-
owner: { … }, // OWNER-SCOPED → read: business + current owner
|
|
40
|
+
owner: { … }, // OWNER-SCOPED → read: business + current owner
|
|
41
|
+
// (also everyone while `claimable`, see below),
|
|
41
42
|
// write: business + current owner,
|
|
42
43
|
// transfers with ownership
|
|
43
44
|
personal: { // PER-USER → read/write: only the specific user,
|
|
@@ -75,10 +76,12 @@ The field-config editor and SDK write helpers MUST reject attempts to create top
|
|
|
75
76
|
| `proof.data.*` | ✅ | ✅ | ✅ | ✅ |
|
|
76
77
|
| `proof.admin.*` | ❌ | ❌ | ❌ | ✅ |
|
|
77
78
|
| `proof.values.<publicKey>` | ✅ | ✅ | ✅ | ✅ |
|
|
78
|
-
| `proof.values.owner.*` |
|
|
79
|
+
| `proof.values.owner.*` | ❌ † | ❌ † | ✅ | ✅ |
|
|
79
80
|
| `proof.values.personal[me].*` | ❌ | ✅ (own slot only) | ✅ (own slot) | ❌ (see note) |
|
|
80
81
|
| `proof.values.personal[other].*` | ❌ | ❌ | ❌ | ❌ (see note) |
|
|
81
82
|
|
|
83
|
+
> **† Claimable exception (`proof.values.owner.*`):** while a proof is **claimable** (`proof.claimable === true` *or* `proof.values.claimable === true`), its `owner` bag is returned to **everyone** — public/anonymous and authenticated non-owners included — so a prospective claimer can see pre-set owner data before claiming. Once the proof is claimed (`claimable` flips off) it reverts to owner-only (unless re-marked claimable). This is **read-only** exposure — write authority is unchanged (still owner + business). Implication: don't put anything in `values.owner` on a claimable proof that shouldn't be visible before it's claimed.
|
|
84
|
+
>
|
|
82
85
|
> **Note on `personal`:** the default rule is that `personal` slots are readable *only* by the user whose `userId` matches the slot key — not even business admins. If the platform ever needs an admin-visible variant, it should be a separate mechanism, not a relaxation of this rule.
|
|
83
86
|
|
|
84
87
|
## Who writes what (authority matrix)
|
package/openapi.yaml
CHANGED
|
@@ -12643,6 +12643,48 @@ paths:
|
|
|
12643
12643
|
description: Unauthorized
|
|
12644
12644
|
404:
|
|
12645
12645
|
description: Not found
|
|
12646
|
+
/public/collection/{collectionId}/product/{productId}/proof/{proofId}/values:
|
|
12647
|
+
put:
|
|
12648
|
+
tags:
|
|
12649
|
+
- proof
|
|
12650
|
+
summary: proof.updateValues
|
|
12651
|
+
operationId: proof_updateValues
|
|
12652
|
+
security: []
|
|
12653
|
+
parameters:
|
|
12654
|
+
- name: collectionId
|
|
12655
|
+
in: path
|
|
12656
|
+
required: true
|
|
12657
|
+
schema:
|
|
12658
|
+
type: string
|
|
12659
|
+
- name: productId
|
|
12660
|
+
in: path
|
|
12661
|
+
required: true
|
|
12662
|
+
schema:
|
|
12663
|
+
type: string
|
|
12664
|
+
- name: proofId
|
|
12665
|
+
in: path
|
|
12666
|
+
required: true
|
|
12667
|
+
schema:
|
|
12668
|
+
type: string
|
|
12669
|
+
responses:
|
|
12670
|
+
200:
|
|
12671
|
+
description: Success
|
|
12672
|
+
content:
|
|
12673
|
+
application/json:
|
|
12674
|
+
schema:
|
|
12675
|
+
$ref: "#/components/schemas/ProofResponse"
|
|
12676
|
+
400:
|
|
12677
|
+
description: Bad request
|
|
12678
|
+
401:
|
|
12679
|
+
description: Unauthorized
|
|
12680
|
+
404:
|
|
12681
|
+
description: Not found
|
|
12682
|
+
requestBody:
|
|
12683
|
+
required: true
|
|
12684
|
+
content:
|
|
12685
|
+
application/json:
|
|
12686
|
+
schema:
|
|
12687
|
+
$ref: "#/components/schemas/ProofValuesUpdateRequest"
|
|
12646
12688
|
/public/collection/{collectionId}/products/{productId}/createClaim:
|
|
12647
12689
|
post:
|
|
12648
12690
|
tags:
|
|
@@ -19137,122 +19179,6 @@ components:
|
|
|
19137
19179
|
- auth_time
|
|
19138
19180
|
- iat
|
|
19139
19181
|
- features
|
|
19140
|
-
AuthTelemetryEvent:
|
|
19141
|
-
type: object
|
|
19142
|
-
properties:
|
|
19143
|
-
eventId:
|
|
19144
|
-
type: string
|
|
19145
|
-
correlationId:
|
|
19146
|
-
type: string
|
|
19147
|
-
clientId:
|
|
19148
|
-
type: string
|
|
19149
|
-
collectionId:
|
|
19150
|
-
type: string
|
|
19151
|
-
type:
|
|
19152
|
-
$ref: "#/components/schemas/AuthEventType"
|
|
19153
|
-
flow:
|
|
19154
|
-
$ref: "#/components/schemas/AuthFlow"
|
|
19155
|
-
ts:
|
|
19156
|
-
type: string
|
|
19157
|
-
durationMs:
|
|
19158
|
-
type: number
|
|
19159
|
-
outcome:
|
|
19160
|
-
type: string
|
|
19161
|
-
enum:
|
|
19162
|
-
- success
|
|
19163
|
-
- error
|
|
19164
|
-
- stalled
|
|
19165
|
-
- abandoned
|
|
19166
|
-
error:
|
|
19167
|
-
type: object
|
|
19168
|
-
additionalProperties: true
|
|
19169
|
-
code:
|
|
19170
|
-
type: string
|
|
19171
|
-
statusCode:
|
|
19172
|
-
type: number
|
|
19173
|
-
message:
|
|
19174
|
-
type: string
|
|
19175
|
-
name:
|
|
19176
|
-
type: string
|
|
19177
|
-
stack:
|
|
19178
|
-
type: string
|
|
19179
|
-
endpoint:
|
|
19180
|
-
type: string
|
|
19181
|
-
context:
|
|
19182
|
-
type: object
|
|
19183
|
-
additionalProperties: true
|
|
19184
|
-
sdkVersion:
|
|
19185
|
-
type: string
|
|
19186
|
-
authKitVersion:
|
|
19187
|
-
type: string
|
|
19188
|
-
mode:
|
|
19189
|
-
type: string
|
|
19190
|
-
enum:
|
|
19191
|
-
- standalone
|
|
19192
|
-
- embedded
|
|
19193
|
-
- proxy
|
|
19194
|
-
- native
|
|
19195
|
-
route:
|
|
19196
|
-
type: string
|
|
19197
|
-
deepLinkMode:
|
|
19198
|
-
type: string
|
|
19199
|
-
userAgent:
|
|
19200
|
-
type: string
|
|
19201
|
-
platform:
|
|
19202
|
-
type: string
|
|
19203
|
-
language:
|
|
19204
|
-
type: string
|
|
19205
|
-
online:
|
|
19206
|
-
type: boolean
|
|
19207
|
-
viewport:
|
|
19208
|
-
type: object
|
|
19209
|
-
additionalProperties: true
|
|
19210
|
-
darkMode:
|
|
19211
|
-
type: boolean
|
|
19212
|
-
subject:
|
|
19213
|
-
type: object
|
|
19214
|
-
additionalProperties: true
|
|
19215
|
-
required:
|
|
19216
|
-
- eventId
|
|
19217
|
-
- correlationId
|
|
19218
|
-
- clientId
|
|
19219
|
-
- type
|
|
19220
|
-
- flow
|
|
19221
|
-
- ts
|
|
19222
|
-
- context
|
|
19223
|
-
- sdkVersion
|
|
19224
|
-
- authKitVersion
|
|
19225
|
-
- mode
|
|
19226
|
-
- userAgent
|
|
19227
|
-
- online
|
|
19228
|
-
TelemetryIngestResponse:
|
|
19229
|
-
type: object
|
|
19230
|
-
properties:
|
|
19231
|
-
accepted:
|
|
19232
|
-
type: number
|
|
19233
|
-
rejected:
|
|
19234
|
-
type: number
|
|
19235
|
-
rejectedIds:
|
|
19236
|
-
type: array
|
|
19237
|
-
items:
|
|
19238
|
-
type: string
|
|
19239
|
-
required:
|
|
19240
|
-
- accepted
|
|
19241
|
-
- rejected
|
|
19242
|
-
- rejectedIds
|
|
19243
|
-
AuthKitTelemetryConfig:
|
|
19244
|
-
type: object
|
|
19245
|
-
properties:
|
|
19246
|
-
enabled:
|
|
19247
|
-
type: boolean
|
|
19248
|
-
successSampleRate:
|
|
19249
|
-
type: number
|
|
19250
|
-
captureJsErrors:
|
|
19251
|
-
type: boolean
|
|
19252
|
-
stallThresholdMs:
|
|
19253
|
-
type: number
|
|
19254
|
-
retentionDays:
|
|
19255
|
-
type: number
|
|
19256
19182
|
AuthKitUser:
|
|
19257
19183
|
type: object
|
|
19258
19184
|
properties:
|
|
@@ -19958,12 +19884,22 @@ components:
|
|
|
19958
19884
|
name:
|
|
19959
19885
|
type: string
|
|
19960
19886
|
expiryDate:
|
|
19961
|
-
type:
|
|
19962
|
-
additionalProperties: true
|
|
19887
|
+
type: string
|
|
19963
19888
|
productId:
|
|
19964
19889
|
type: string
|
|
19965
19890
|
collectionId:
|
|
19966
19891
|
type: string
|
|
19892
|
+
createdAt:
|
|
19893
|
+
type: string
|
|
19894
|
+
updatedAt:
|
|
19895
|
+
type: string
|
|
19896
|
+
deleted:
|
|
19897
|
+
type: boolean
|
|
19898
|
+
deletedAt:
|
|
19899
|
+
type: string
|
|
19900
|
+
admin:
|
|
19901
|
+
type: object
|
|
19902
|
+
additionalProperties: true
|
|
19967
19903
|
required:
|
|
19968
19904
|
- id
|
|
19969
19905
|
BatchCreateRequest:
|
|
@@ -19976,8 +19912,6 @@ components:
|
|
|
19976
19912
|
expiryDate:
|
|
19977
19913
|
type: object
|
|
19978
19914
|
additionalProperties: true
|
|
19979
|
-
required:
|
|
19980
|
-
- id
|
|
19981
19915
|
BatchUpdateRequest:
|
|
19982
19916
|
type: object
|
|
19983
19917
|
properties:
|
|
@@ -25772,6 +25706,17 @@ components:
|
|
|
25772
25706
|
type: object
|
|
25773
25707
|
additionalProperties:
|
|
25774
25708
|
$ref: "#/components/schemas/JsonValue"
|
|
25709
|
+
ProofValuesUpdateRequest:
|
|
25710
|
+
type: object
|
|
25711
|
+
properties:
|
|
25712
|
+
owner:
|
|
25713
|
+
type: object
|
|
25714
|
+
additionalProperties:
|
|
25715
|
+
$ref: "#/components/schemas/JsonValue"
|
|
25716
|
+
personal:
|
|
25717
|
+
type: object
|
|
25718
|
+
additionalProperties:
|
|
25719
|
+
$ref: "#/components/schemas/JsonValue"
|
|
25775
25720
|
ProofFieldsConfig:
|
|
25776
25721
|
type: object
|
|
25777
25722
|
properties:
|
|
@@ -26806,6 +26751,42 @@ components:
|
|
|
26806
26751
|
metadata:
|
|
26807
26752
|
type: object
|
|
26808
26753
|
additionalProperties: true
|
|
26754
|
+
VariantResponse:
|
|
26755
|
+
type: object
|
|
26756
|
+
properties:
|
|
26757
|
+
id:
|
|
26758
|
+
type: string
|
|
26759
|
+
name:
|
|
26760
|
+
type: string
|
|
26761
|
+
productId:
|
|
26762
|
+
type: string
|
|
26763
|
+
collectionId:
|
|
26764
|
+
type: string
|
|
26765
|
+
createdAt:
|
|
26766
|
+
type: string
|
|
26767
|
+
updatedAt:
|
|
26768
|
+
type: string
|
|
26769
|
+
deleted:
|
|
26770
|
+
type: boolean
|
|
26771
|
+
deletedAt:
|
|
26772
|
+
type: string
|
|
26773
|
+
admin:
|
|
26774
|
+
type: object
|
|
26775
|
+
additionalProperties: true
|
|
26776
|
+
required:
|
|
26777
|
+
- id
|
|
26778
|
+
VariantCreateRequest:
|
|
26779
|
+
type: object
|
|
26780
|
+
properties:
|
|
26781
|
+
id:
|
|
26782
|
+
type: string
|
|
26783
|
+
name:
|
|
26784
|
+
type: string
|
|
26785
|
+
VariantUpdateRequest:
|
|
26786
|
+
type: object
|
|
26787
|
+
properties:
|
|
26788
|
+
name:
|
|
26789
|
+
type: string
|
|
26809
26790
|
NavigationRequest:
|
|
26810
26791
|
type: object
|
|
26811
26792
|
properties:
|