@proveanything/smartlinks 1.9.13 → 1.9.15
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/claimSet.d.ts +58 -70
- package/dist/api/claimSet.js +98 -110
- package/dist/api/config.d.ts +19 -0
- package/dist/api/config.js +27 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/docs/API_SUMMARY.md +162 -29
- package/dist/openapi.yaml +297 -95
- package/dist/types/claimSet.d.ts +42 -0
- package/dist/types/config.d.ts +132 -0
- package/dist/types/config.js +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/docs/API_SUMMARY.md +162 -29
- package/openapi.yaml +297 -95
- package/package.json +1 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/** Accepted input widget types for a FieldDefinition. */
|
|
2
|
+
export type FieldType = 'text' | 'email' | 'url' | 'textarea' | 'number' | 'select' | 'switch' | 'checkbox' | 'date' | 'json' | 'image-upload' | 'file-upload';
|
|
3
|
+
/** A label/value pair used when FieldDefinition.type === 'select'. */
|
|
4
|
+
export interface FieldOption {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A single entry in the platform field catalog.
|
|
10
|
+
* Fields are referenced by their `id` inside ProofTypeDefinition.groupFields / proofFields arrays.
|
|
11
|
+
*/
|
|
12
|
+
export interface FieldDefinition {
|
|
13
|
+
/** Unique identifier, kebab-case. Auto-generated from `label` if omitted on create. */
|
|
14
|
+
id: string;
|
|
15
|
+
/** Human-readable display label shown in forms. */
|
|
16
|
+
label: string;
|
|
17
|
+
/** Key used when storing the value on the product/proof document. Defaults to `id`. */
|
|
18
|
+
storageKey?: string;
|
|
19
|
+
/** Input widget type. */
|
|
20
|
+
type: FieldType;
|
|
21
|
+
/** Available choices — only relevant when type === 'select'. */
|
|
22
|
+
options?: FieldOption[];
|
|
23
|
+
/** Whether the field must be filled in. */
|
|
24
|
+
required?: boolean;
|
|
25
|
+
/** Column span (1–12) in a 12-column grid. */
|
|
26
|
+
col?: number;
|
|
27
|
+
/** Placeholder text shown inside the input. */
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
/** Descriptive hint shown below the input. */
|
|
30
|
+
help?: string;
|
|
31
|
+
/** Numeric minimum — only relevant when type === 'number'. */
|
|
32
|
+
min?: number;
|
|
33
|
+
/** Numeric maximum — only relevant when type === 'number'. */
|
|
34
|
+
max?: number;
|
|
35
|
+
/** Step increment — only relevant when type === 'number'. */
|
|
36
|
+
step?: number;
|
|
37
|
+
/** Number of visible rows — only relevant when type === 'textarea' or 'json'. */
|
|
38
|
+
rows?: number;
|
|
39
|
+
/** Auto-grow textarea height — only relevant when type === 'textarea'. */
|
|
40
|
+
autoGrow?: boolean;
|
|
41
|
+
/** Accept filter passed to the file input — only relevant when type === 'image-upload' or 'file-upload'. Examples: 'image/*', '.glb,.gltf,.fbx' */
|
|
42
|
+
accept?: string;
|
|
43
|
+
/** Whether the input has a clear (×) button (text/number fields). Default true. */
|
|
44
|
+
clearable?: boolean;
|
|
45
|
+
/** Disable this field regardless of model state. */
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Conditional visibility. If absent the field is always shown.
|
|
49
|
+
* Object form: `{ field: 'someKey', equals: 'someValue' }` — show when `model[field] === equals`.
|
|
50
|
+
*/
|
|
51
|
+
showIf?: {
|
|
52
|
+
field: string;
|
|
53
|
+
equals: unknown;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The base proof mechanism that items in a proof type use.
|
|
58
|
+
* Matches the `proofType` / `proofTypes` values stored on product documents.
|
|
59
|
+
*/
|
|
60
|
+
export type ProofMechanism = 'certificate' | 'ownable' | 'consumable' | 'timeline' | 'docent' | 'connected' | 'text' | 'image' | 'video';
|
|
61
|
+
/**
|
|
62
|
+
* A proof type defines a template for creating products.
|
|
63
|
+
* It specifies which fields to show, which apps are pre-installed,
|
|
64
|
+
* and how the portal should behave.
|
|
65
|
+
*/
|
|
66
|
+
export interface ProofTypeDefinition {
|
|
67
|
+
/** Unique identifier, kebab-case. Auto-generated from `name` if omitted on create. */
|
|
68
|
+
id: string;
|
|
69
|
+
/** Human-readable name shown in product-creation wizards. */
|
|
70
|
+
name: string;
|
|
71
|
+
/** Long description shown in the proof type picker UI. */
|
|
72
|
+
description?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Grouping used to organise proof types in the picker.
|
|
75
|
+
* Examples: 'basic', 'retail', 'ownable', 'consumable', 'attendance',
|
|
76
|
+
* 'qualification', 'creative', 'memories', 'safety', 'connected',
|
|
77
|
+
* 'smartdocent', 'tradable'
|
|
78
|
+
*/
|
|
79
|
+
category?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Whether this proof type is shown to users.
|
|
82
|
+
* Only types with `active === true` are returned to the public API
|
|
83
|
+
* when the platform admin has filtered by "Only Active".
|
|
84
|
+
*/
|
|
85
|
+
active?: boolean;
|
|
86
|
+
/** Whether this proof type produces a group of items (true) or a single item (false). */
|
|
87
|
+
group: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The underlying proof mechanisms that products of this type can use.
|
|
90
|
+
* Stored as `proofTypes` (plural) on the product document.
|
|
91
|
+
*/
|
|
92
|
+
proofTypes?: ProofMechanism[];
|
|
93
|
+
/** Legacy single-value equivalent of proofTypes. */
|
|
94
|
+
proofType?: ProofMechanism;
|
|
95
|
+
/**
|
|
96
|
+
* Field IDs (from the field catalog) shown when creating/editing the product group.
|
|
97
|
+
* Ordered — rendered in this sequence.
|
|
98
|
+
*/
|
|
99
|
+
groupFields?: string[];
|
|
100
|
+
/**
|
|
101
|
+
* Field IDs shown when creating/editing an individual proof item within the group.
|
|
102
|
+
* If absent, falls back to groupFields.
|
|
103
|
+
*/
|
|
104
|
+
proofFields?: string[];
|
|
105
|
+
/**
|
|
106
|
+
* Column definitions shown in the proof list view.
|
|
107
|
+
* Keys are field IDs; value true means show the column.
|
|
108
|
+
*/
|
|
109
|
+
listFields?: Record<string, boolean>;
|
|
110
|
+
/**
|
|
111
|
+
* App uniqueNames automatically installed (for free) when this proof type is selected.
|
|
112
|
+
*/
|
|
113
|
+
freeApps?: string[];
|
|
114
|
+
/**
|
|
115
|
+
* App uniqueNames shown as recommended paid add-ons for this proof type.
|
|
116
|
+
*/
|
|
117
|
+
apps?: string[];
|
|
118
|
+
/** Collection-level slug that this proof type is scoped to (legacy, rarely used). */
|
|
119
|
+
collection?: string;
|
|
120
|
+
/** Action name used by the legacy proof action pipeline. */
|
|
121
|
+
action?: string;
|
|
122
|
+
/** Whether items are soul-bound (non-transferable by default). */
|
|
123
|
+
bound?: 'soul';
|
|
124
|
+
/**
|
|
125
|
+
* UI translation overrides for this proof type.
|
|
126
|
+
* Keys are source English words; values are replacement strings.
|
|
127
|
+
* Example: `{ "Products": "Works" }`
|
|
128
|
+
*/
|
|
129
|
+
translations?: Record<string, string>;
|
|
130
|
+
/** Whether product tools (edit, duplicate, etc.) are hidden in the console UI. */
|
|
131
|
+
hideProductTools?: boolean;
|
|
132
|
+
}
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
package/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.15 | Generated: 2026-04-13T12:48:02.968Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -103,6 +103,7 @@ The Smartlinks SDK is organized into the following namespaces:
|
|
|
103
103
|
- **async** - Functions for async operations
|
|
104
104
|
- **attestation** - Functions for attestation operations
|
|
105
105
|
- **attestations** - Functions for attestations operations
|
|
106
|
+
- **config** - Functions for config operations
|
|
106
107
|
- **containers** - Functions for containers operations
|
|
107
108
|
- **facets** - Functions for facets operations
|
|
108
109
|
- **jobs** - Functions for jobs operations
|
|
@@ -2866,6 +2867,42 @@ interface CreateClaimSetTagRequest {
|
|
|
2866
2867
|
}
|
|
2867
2868
|
```
|
|
2868
2869
|
|
|
2870
|
+
**CreateClaimSetRequest** (interface)
|
|
2871
|
+
```typescript
|
|
2872
|
+
interface CreateClaimSetRequest {
|
|
2873
|
+
name: string
|
|
2874
|
+
claimMode: string
|
|
2875
|
+
allocationMode: string
|
|
2876
|
+
}
|
|
2877
|
+
```
|
|
2878
|
+
|
|
2879
|
+
**ImportClaimSetTagItem** (interface)
|
|
2880
|
+
```typescript
|
|
2881
|
+
interface ImportClaimSetTagItem {
|
|
2882
|
+
id: string
|
|
2883
|
+
tagId?: string
|
|
2884
|
+
index?: number
|
|
2885
|
+
}
|
|
2886
|
+
```
|
|
2887
|
+
|
|
2888
|
+
**ImportClaimSetTagsRequest** (interface)
|
|
2889
|
+
```typescript
|
|
2890
|
+
interface ImportClaimSetTagsRequest {
|
|
2891
|
+
tags: ImportClaimSetTagItem[]
|
|
2892
|
+
* Import mode:
|
|
2893
|
+
* - "upsert" (default) merges with existing tags
|
|
2894
|
+
* - "replace" wipes all existing tags first then writes the new set
|
|
2895
|
+
mode?: 'upsert' | 'replace'
|
|
2896
|
+
}
|
|
2897
|
+
```
|
|
2898
|
+
|
|
2899
|
+
**ImportClaimSetTagsResponse** (interface)
|
|
2900
|
+
```typescript
|
|
2901
|
+
interface ImportClaimSetTagsResponse {
|
|
2902
|
+
written: number
|
|
2903
|
+
}
|
|
2904
|
+
```
|
|
2905
|
+
|
|
2869
2906
|
**CreateClaimSetTagResponse** (interface)
|
|
2870
2907
|
```typescript
|
|
2871
2908
|
interface CreateClaimSetTagResponse {
|
|
@@ -3709,6 +3746,90 @@ export interface TransactionalSendError {
|
|
|
3709
3746
|
|
|
3710
3747
|
export type TransactionalSendResult =`
|
|
3711
3748
|
|
|
3749
|
+
### config
|
|
3750
|
+
|
|
3751
|
+
**FieldOption** (interface)
|
|
3752
|
+
```typescript
|
|
3753
|
+
interface FieldOption {
|
|
3754
|
+
label: string
|
|
3755
|
+
value: string
|
|
3756
|
+
}
|
|
3757
|
+
```
|
|
3758
|
+
|
|
3759
|
+
**FieldDefinition** (interface)
|
|
3760
|
+
```typescript
|
|
3761
|
+
interface FieldDefinition {
|
|
3762
|
+
id: string
|
|
3763
|
+
label: string
|
|
3764
|
+
storageKey?: string
|
|
3765
|
+
type: FieldType
|
|
3766
|
+
options?: FieldOption[]
|
|
3767
|
+
required?: boolean
|
|
3768
|
+
col?: number
|
|
3769
|
+
placeholder?: string
|
|
3770
|
+
help?: string
|
|
3771
|
+
min?: number
|
|
3772
|
+
max?: number
|
|
3773
|
+
step?: number
|
|
3774
|
+
rows?: number
|
|
3775
|
+
autoGrow?: boolean
|
|
3776
|
+
accept?: string
|
|
3777
|
+
clearable?: boolean
|
|
3778
|
+
disabled?: boolean
|
|
3779
|
+
* Conditional visibility. If absent the field is always shown.
|
|
3780
|
+
* Object form: `{ field: 'someKey', equals: 'someValue' }` — show when `model[field] === equals`.
|
|
3781
|
+
showIf?: { field: string; equals: unknown }
|
|
3782
|
+
}
|
|
3783
|
+
```
|
|
3784
|
+
|
|
3785
|
+
**ProofTypeDefinition** (interface)
|
|
3786
|
+
```typescript
|
|
3787
|
+
interface ProofTypeDefinition {
|
|
3788
|
+
id: string
|
|
3789
|
+
name: string
|
|
3790
|
+
description?: string
|
|
3791
|
+
* Grouping used to organise proof types in the picker.
|
|
3792
|
+
* Examples: 'basic', 'retail', 'ownable', 'consumable', 'attendance',
|
|
3793
|
+
* 'qualification', 'creative', 'memories', 'safety', 'connected',
|
|
3794
|
+
* 'smartdocent', 'tradable'
|
|
3795
|
+
category?: string
|
|
3796
|
+
* Whether this proof type is shown to users.
|
|
3797
|
+
* Only types with `active === true` are returned to the public API
|
|
3798
|
+
* when the platform admin has filtered by "Only Active".
|
|
3799
|
+
active?: boolean
|
|
3800
|
+
group: boolean
|
|
3801
|
+
* The underlying proof mechanisms that products of this type can use.
|
|
3802
|
+
* Stored as `proofTypes` (plural) on the product document.
|
|
3803
|
+
proofTypes?: ProofMechanism[]
|
|
3804
|
+
proofType?: ProofMechanism
|
|
3805
|
+
* Field IDs (from the field catalog) shown when creating/editing the product group.
|
|
3806
|
+
* Ordered — rendered in this sequence.
|
|
3807
|
+
groupFields?: string[]
|
|
3808
|
+
* Field IDs shown when creating/editing an individual proof item within the group.
|
|
3809
|
+
* If absent, falls back to groupFields.
|
|
3810
|
+
proofFields?: string[]
|
|
3811
|
+
* Column definitions shown in the proof list view.
|
|
3812
|
+
* Keys are field IDs; value true means show the column.
|
|
3813
|
+
listFields?: Record<string, boolean>
|
|
3814
|
+
* App uniqueNames automatically installed (for free) when this proof type is selected.
|
|
3815
|
+
freeApps?: string[]
|
|
3816
|
+
* App uniqueNames shown as recommended paid add-ons for this proof type.
|
|
3817
|
+
apps?: string[]
|
|
3818
|
+
collection?: string
|
|
3819
|
+
action?: string
|
|
3820
|
+
bound?: 'soul'
|
|
3821
|
+
* UI translation overrides for this proof type.
|
|
3822
|
+
* Keys are source English words; values are replacement strings.
|
|
3823
|
+
* Example: `{ "Products": "Works" }`
|
|
3824
|
+
translations?: Record<string, string>
|
|
3825
|
+
hideProductTools?: boolean
|
|
3826
|
+
}
|
|
3827
|
+
```
|
|
3828
|
+
|
|
3829
|
+
**FieldType** = ``
|
|
3830
|
+
|
|
3831
|
+
**ProofMechanism** = ``
|
|
3832
|
+
|
|
3712
3833
|
### contact
|
|
3713
3834
|
|
|
3714
3835
|
**Contact** (interface)
|
|
@@ -7425,20 +7546,39 @@ Create a Responses API request (streaming or non-streaming)
|
|
|
7425
7546
|
|
|
7426
7547
|
### claimSet
|
|
7427
7548
|
|
|
7428
|
-
**
|
|
7429
|
-
Get all claim sets for
|
|
7549
|
+
**getAll**(collectionId?: string) → `Promise<any[]>`
|
|
7550
|
+
Get all claim sets. When collectionId is provided, returns claim sets for that collection. When omitted, returns all claim sets owned by the authenticated user.
|
|
7430
7551
|
|
|
7431
|
-
**
|
|
7432
|
-
Get a specific claim set
|
|
7552
|
+
**get**(claimSetId: string, collectionId?: string) → `Promise<any>`
|
|
7553
|
+
Get a specific claim set by ID.
|
|
7433
7554
|
|
|
7434
|
-
**
|
|
7435
|
-
|
|
7555
|
+
**create**(params: CreateClaimSetRequest, collectionId?: string) → `Promise<any>`
|
|
7556
|
+
Create a new claim set. When collectionId is provided, creates it scoped to that collection. When omitted, creates a global user-owned claim set.
|
|
7436
7557
|
|
|
7437
|
-
**
|
|
7438
|
-
|
|
7558
|
+
**update**(claimSetId: string, params: any, collectionId?: string) → `Promise<any>`
|
|
7559
|
+
Update a claim set.
|
|
7560
|
+
|
|
7561
|
+
**remove**(claimSetId: string, collectionId?: string) → `Promise<any>`
|
|
7562
|
+
Delete (soft-delete) a claim set.
|
|
7563
|
+
|
|
7564
|
+
**getAllTags**(claimSetId: string, collectionId?: string) → `Promise<any>`
|
|
7565
|
+
Get all tags for a claim set (including data).
|
|
7439
7566
|
|
|
7440
|
-
**getAssignedTags**(
|
|
7441
|
-
Get assigned tags for a claim set.
|
|
7567
|
+
**getAssignedTags**(claimSetId: string, collectionId?: string) → `Promise<any>`
|
|
7568
|
+
Get assigned tags for a claim set — tags soft-assigned to a collection or product.
|
|
7569
|
+
|
|
7570
|
+
**createTag**(claimSetId: string,
|
|
7571
|
+
data: CreateClaimSetTagRequest,
|
|
7572
|
+
collectionId?: string) → `Promise<CreateClaimSetTagResponse>`
|
|
7573
|
+
Create a single tag inside a claim set.
|
|
7574
|
+
|
|
7575
|
+
**importTags**(claimSetId: string,
|
|
7576
|
+
data: ImportClaimSetTagsRequest,
|
|
7577
|
+
collectionId?: string) → `Promise<ImportClaimSetTagsResponse>`
|
|
7578
|
+
Bulk import tags into a claim set.
|
|
7579
|
+
|
|
7580
|
+
**getReport**(collectionId: string, claimSetId: string) → `Promise<any>`
|
|
7581
|
+
Get a report for a claim set (collection-scoped).
|
|
7442
7582
|
|
|
7443
7583
|
**getTagSummary**(collectionId: string) → `Promise<any>`
|
|
7444
7584
|
Get tag summary for a collection.
|
|
@@ -7446,29 +7586,14 @@ Get tag summary for a collection.
|
|
|
7446
7586
|
**tagQuery**(collectionId: string, data: any) → `Promise<any>`
|
|
7447
7587
|
Perform a tag query for a collection.
|
|
7448
7588
|
|
|
7449
|
-
**createForCollection**(collectionId: string, params: any) → `Promise<any>`
|
|
7450
|
-
Create a new claim set for a collection.
|
|
7451
|
-
|
|
7452
|
-
**updateForCollection**(collectionId: string, params: any) → `Promise<any>`
|
|
7453
|
-
Update a claim set for a collection.
|
|
7454
|
-
|
|
7455
7589
|
**makeClaim**(collectionId: string, params: any) → `Promise<any>`
|
|
7456
|
-
Make a claim
|
|
7590
|
+
Make a claim against a claim set (collection-scoped).
|
|
7457
7591
|
|
|
7458
7592
|
**assignClaims**(collectionId: string, data: AssignClaimsRequest) → `Promise<any>`
|
|
7459
|
-
Assign claims to
|
|
7593
|
+
Assign claims to codes or ranges within a collection.
|
|
7460
7594
|
|
|
7461
7595
|
**updateClaimData**(collectionId: string, data: UpdateClaimDataRequest) → `Promise<any>`
|
|
7462
|
-
Update claim data for a collection.
|
|
7463
|
-
|
|
7464
|
-
**createTag**(collectionId: string,
|
|
7465
|
-
claimSetId: string,
|
|
7466
|
-
data: CreateClaimSetTagRequest) → `Promise<CreateClaimSetTagResponse>`
|
|
7467
|
-
Create a single tag/code inside an existing claim set (collection admin). POST /admin/collection/:collectionId/claimSet/:claimSetId/createTag
|
|
7468
|
-
|
|
7469
|
-
**createTagPlatform**(claimSetId: string,
|
|
7470
|
-
data: CreateClaimSetTagRequest) → `Promise<CreateClaimSetTagResponse>`
|
|
7471
|
-
Create a single tag/code inside an existing claim set (platform; requires account.features.adminClaimSets). POST /platform/claimSet/:claimSetId/createTag
|
|
7596
|
+
Update claim data for a claim set (collection-scoped).
|
|
7472
7597
|
|
|
7473
7598
|
### collection
|
|
7474
7599
|
|
|
@@ -7597,6 +7722,14 @@ Logging: Append a single communication event. POST /admin/collection/:collection
|
|
|
7597
7722
|
body: LogBulkCommunicationEventsBody | ({ sourceId: string; ids: string[]; idField?: 'userId'|'contactId'; [k: string]: any }) → `void`
|
|
7598
7723
|
Logging: Append many communication events for a list of IDs. POST /admin/collection/:collectionId/comm/log/bulk
|
|
7599
7724
|
|
|
7725
|
+
### config
|
|
7726
|
+
|
|
7727
|
+
**getFields**() → `Promise<FieldDefinition[]>`
|
|
7728
|
+
Returns the full platform field catalog. Fields are used as building blocks for proof type templates — they define the input widgets shown when creating or editing products and proof items. **Endpoint:** `GET /api/v1/public/config/fields`
|
|
7729
|
+
|
|
7730
|
+
**getProofTypes**() → `Promise<ProofTypeDefinition[]>`
|
|
7731
|
+
Returns all proof type definitions. Proof types are templates that specify which fields to show, which apps are pre-installed, and how the portal behaves for a given product category. **Endpoint:** `GET /api/v1/public/config/proofTypes`
|
|
7732
|
+
|
|
7600
7733
|
### contact
|
|
7601
7734
|
|
|
7602
7735
|
**create**(collectionId: string, data: ContactCreateRequest) → `Promise<ContactResponse>`
|