@proveanything/smartlinks 2.1.15 → 2.1.16

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.
@@ -1,4 +1,4 @@
1
- import { ClaimSetScope, ClaimSetRange, CreateClaimSetRangeRequest, UpdateClaimSetRangeRequest, ClaimSetRangeTagsPage, ClaimSetRangeTag, ClaimSetRangeNextTag, ImportClaimSetRangeUidsRequest, ImportClaimSetRangeUidsResponse, AssignClaimSetRangeRequest, AssignClaimSetRangeResponse, ClaimSetRangeFile, UpdateClaimDataRequest, AssignClaimsRequest, CreateClaimSetTagRequest, CreateClaimSetTagResponse, CreateClaimSetRequest, ImportClaimSetTagsRequest, ImportClaimSetTagsResponse } from "../types/index.js";
1
+ import { ClaimSetScope, ClaimSetRange, CreateClaimSetRangeRequest, UpdateClaimSetRangeRequest, ClaimSetRangeTagsPage, ClaimSetRangeTag, ClaimSetRangeNextTag, ImportClaimSetRangeUidsRequest, ImportClaimSetRangeUidsResponse, AssignClaimSetRangeRequest, AddClaimSetRangeMemberRequest, AddClaimSetRangeMemberResponse, CloseClaimSetRangeResponse, AssignClaimSetRangeResponse, ClaimSetRangeFile, UpdateClaimDataRequest, AssignClaimsRequest, CreateClaimSetTagRequest, CreateClaimSetTagResponse, CreateClaimSetRequest, ImportClaimSetTagsRequest, ImportClaimSetTagsResponse } from "../types/index.js";
2
2
  export declare namespace claimSet {
3
3
  /**
4
4
  * Get all claim sets.
@@ -106,6 +106,14 @@ export declare namespace claimSet {
106
106
  function update(scope: ClaimSetScope, claimSetId: string, rangeId: string, params: UpdateClaimSetRangeRequest): Promise<ClaimSetRange>;
107
107
  /** Finish minting a range that was interrupted. */
108
108
  function resume(scope: ClaimSetScope, claimSetId: string, rangeId: string): Promise<ClaimSetRange>;
109
+ /** Close an open range: it becomes a range with the quantity it reached (removed if nothing was minted). */
110
+ function close(scope: ClaimSetScope, claimSetId: string, rangeId: string): Promise<CloseClaimSetRangeResponse>;
111
+ /** Put an existing tag of the set into a group (by code or chip UID), assigning it if a collection is given. */
112
+ function addMember(scope: ClaimSetScope, claimSetId: string, groupId: string, params: AddClaimSetRangeMemberRequest): Promise<AddClaimSetRangeMemberResponse>;
113
+ /** Take a tag out of a group. Its assignment is left as it is. */
114
+ function removeMember(scope: ClaimSetScope, claimSetId: string, groupId: string, code: string): Promise<{
115
+ range: ClaimSetRange;
116
+ }>;
109
117
  /** The range's tags in index order, a page at a time (keys: owners/admins only). */
110
118
  function tags(scope: ClaimSetScope, claimSetId: string, rangeId: string, options?: {
111
119
  from?: number;
@@ -190,6 +190,21 @@ export var claimSet;
190
190
  return post(`${rangesBase(scope, claimSetId)}/${encodeURIComponent(rangeId)}/resume`, {});
191
191
  }
192
192
  ranges.resume = resume;
193
+ /** Close an open range: it becomes a range with the quantity it reached (removed if nothing was minted). */
194
+ async function close(scope, claimSetId, rangeId) {
195
+ return post(`${rangesBase(scope, claimSetId)}/${encodeURIComponent(rangeId)}/close`, {});
196
+ }
197
+ ranges.close = close;
198
+ /** Put an existing tag of the set into a group (by code or chip UID), assigning it if a collection is given. */
199
+ async function addMember(scope, claimSetId, groupId, params) {
200
+ return post(`${rangesBase(scope, claimSetId)}/${encodeURIComponent(groupId)}/members`, params);
201
+ }
202
+ ranges.addMember = addMember;
203
+ /** Take a tag out of a group. Its assignment is left as it is. */
204
+ async function removeMember(scope, claimSetId, groupId, code) {
205
+ return del(`${rangesBase(scope, claimSetId)}/${encodeURIComponent(groupId)}/members/${encodeURIComponent(code)}`);
206
+ }
207
+ ranges.removeMember = removeMember;
193
208
  /** The range's tags in index order, a page at a time (keys: owners/admins only). */
194
209
  async function tags(scope, claimSetId, rangeId, options = {}) {
195
210
  const q = new URLSearchParams();
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 2.1.15 | Generated: 2026-11-09T15:17:42.472Z
3
+ Version: 2.1.16 | Generated: 2026-11-10T17:19:48.505Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -5775,10 +5775,11 @@ interface ClaimSetRange {
5775
5775
  id: string
5776
5776
  claimSetId: string
5777
5777
  namespace: string
5778
+ kind: ClaimSetRangeKind
5778
5779
  name: string
5779
5780
  notes: string | null
5780
- startIndex: number
5781
- endIndex: number
5781
+ startIndex: number | null
5782
+ endIndex: number | null
5782
5783
  quantity: number
5783
5784
  tagType: ClaimSetTagType
5784
5785
  fulfilment: 'printer' | 'sidekick'
@@ -5801,8 +5802,9 @@ interface ClaimSetRange {
5801
5802
  **CreateClaimSetRangeRequest** (interface)
5802
5803
  ```typescript
5803
5804
  interface CreateClaimSetRangeRequest {
5805
+ kind?: ClaimSetRangeKind
5804
5806
  name: string
5805
- quantity: number
5807
+ quantity?: number
5806
5808
  intendedCollectionId?: string
5807
5809
  intendedProductId?: string
5808
5810
  intendedBatchId?: string
@@ -5837,6 +5839,8 @@ interface ClaimSetRangeTag {
5837
5839
  productId: string | null
5838
5840
  batchId: string | null
5839
5841
  proofId: string | null
5842
+ rangeId: string | null
5843
+ groupId: string | null
5840
5844
  programmedAt: string | null
5841
5845
  scans: number
5842
5846
  }
@@ -5850,6 +5854,29 @@ interface ClaimSetRangeTagsPage {
5850
5854
  }
5851
5855
  ```
5852
5856
 
5857
+ **AddClaimSetRangeMemberRequest** (interface)
5858
+ ```typescript
5859
+ interface AddClaimSetRangeMemberRequest {
5860
+ code?: string
5861
+ uid?: string
5862
+ collectionId?: string
5863
+ productId?: string
5864
+ batchId?: string
5865
+ data?: Record<string, unknown>
5866
+ clear?: boolean
5867
+ }
5868
+ ```
5869
+
5870
+ **AddClaimSetRangeMemberResponse** (interface)
5871
+ ```typescript
5872
+ interface AddClaimSetRangeMemberResponse {
5873
+ tag: ClaimSetRangeTag
5874
+ range: ClaimSetRange
5875
+ assigned: { changed: number; skipped: Array<{ code: string; index: number | null; reason: 'other_range' | 'has_proof' | 'assigned_elsewhere'; collectionId?: string }> }
5876
+ movedFrom: string | null
5877
+ }
5878
+ ```
5879
+
5853
5880
  **ImportClaimSetRangeUidsRequest** (interface)
5854
5881
  ```typescript
5855
5882
  interface ImportClaimSetRangeUidsRequest {
@@ -5958,7 +5985,11 @@ type ClaimSetScope = { collectionId: string }
5958
5985
 
5959
5986
  **ClaimSetTagType** = `'ntag424' | 'ntag21x' | 'qr'`
5960
5987
 
5961
- **ClaimSetRangeStatus** = `'minting' | 'minted' | 'sent' | 'received' | 'assigned'`
5988
+ **ClaimSetRangeKind** = `'range' | 'open' | 'group'`
5989
+
5990
+ **ClaimSetRangeStatus** = `'minting' | 'minted' | 'sent' | 'received' | 'assigned' | 'open' | 'group'`
5991
+
5992
+ **CloseClaimSetRangeResponse** = `ClaimSetRange | { id: string`
5962
5993
 
5963
5994
  **ClaimSetImportResult** = ``
5964
5995
 
@@ -12464,6 +12495,15 @@ Name, notes, order details, or a stage move (sent to the printer, received).
12464
12495
  **resume**(scope: ClaimSetScope, claimSetId: string, rangeId: string) → `Promise<ClaimSetRange>`
12465
12496
  Finish minting a range that was interrupted.
12466
12497
 
12498
+ **close**(scope: ClaimSetScope, claimSetId: string, rangeId: string) → `Promise<CloseClaimSetRangeResponse>`
12499
+ Close an open range: it becomes a range with the quantity it reached (removed if nothing was minted).
12500
+
12501
+ **addMember**(scope: ClaimSetScope, claimSetId: string, groupId: string, params: AddClaimSetRangeMemberRequest) → `Promise<AddClaimSetRangeMemberResponse>`
12502
+ Put an existing tag of the set into a group (by code or chip UID), assigning it if a collection is given.
12503
+
12504
+ **removeMember**(scope: ClaimSetScope, claimSetId: string, groupId: string, code: string) → `Promise<`
12505
+ Take a tag out of a group. Its assignment is left as it is.
12506
+
12467
12507
  **tags**(scope: ClaimSetScope, claimSetId: string, rangeId: string,
12468
12508
  options: { from?: number; limit?: number; keys?: boolean } = {}) → `Promise<ClaimSetRangeTagsPage>`
12469
12509
  The range's tags in index order, a page at a time (keys: owners/admins only).
@@ -55,6 +55,27 @@ tag without a chip, with its URL and key; write it, then `ranges.recordTag(scope
55
55
 
56
56
  To find where a chip or code went, `partner.lookupTags(partner.id, { uid })` or `{ code }` searches every set the partner owns and returns each hit's set, tag and range, never a key.
57
57
 
58
+ ## Open ranges and groups
59
+
60
+ A range's count is fixed when it is minted. Two phone-side jobs don't know their count in advance, so a range
61
+ has a `kind`:
62
+
63
+ - **`open`**: blank tags programmed on Sidekick one at a time. `ranges.create(scope, set.id, { kind: 'open', name })`
64
+ reserves only a start index; each `ranges.next()` hands back a free minted code or mints one more, so
65
+ `quantity`/`endIndex` grow as tags are written (`remaining` is null). One open range per set, and nothing can
66
+ be minted behind it (`409 RANGE_OPEN`) until `ranges.close(scope, set.id, range.id)` turns it into an ordinary
67
+ range (an open range that minted nothing is removed instead).
68
+ - **`group`**: tags that already exist, added by tapping, assigned by hand, and moved together later. Assigners may
69
+ make one: `ranges.create(scope, set.id, { kind: 'group', name, intendedCollectionId? })`. Each tap goes through
70
+ `ranges.addMember(scope, set.id, group.id, { code | uid, collectionId, productId? })`, which stamps the tag with
71
+ the group and assigns it with the single-tag rules; `assigned.skipped` says when a tag was left alone (claimed,
72
+ or in a collection you don't administer). `ranges.assign(scope, set.id, group.id, { collectionId })` moves every
73
+ member in one go; `ranges.removeMember` takes one out. Groups have no printer file, instructions, import or
74
+ `next` (`400 NOT_A_RANGE`). Its tags must be codes of the group's set; a chip that is a code elsewhere is
75
+ `409 OTHER_SET`.
76
+
77
+ Status reads `open` or `group` for these (and `assigned` once every member of a group is assigned).
78
+
58
79
  ## The printer file
59
80
 
60
81
  One row per tag, in index order. The manufacturer fills in `UID` and sends the same file back; rows are
package/dist/openapi.yaml CHANGED
@@ -14952,6 +14952,38 @@ paths:
14952
14952
  description: Unauthorized
14953
14953
  404:
14954
14954
  description: Not found
14955
+ /{groupId}/members:
14956
+ post:
14957
+ tags:
14958
+ - ranges
14959
+ summary: Put an existing tag of the set into a group (by code or chip UID), assigning it if a collection is given.
14960
+ operationId: ranges_addMember
14961
+ security: []
14962
+ parameters:
14963
+ - name: groupId
14964
+ in: path
14965
+ required: true
14966
+ schema:
14967
+ type: string
14968
+ responses:
14969
+ 200:
14970
+ description: Success
14971
+ content:
14972
+ application/json:
14973
+ schema:
14974
+ $ref: "#/components/schemas/AddClaimSetRangeMemberResponse"
14975
+ 400:
14976
+ description: Bad request
14977
+ 401:
14978
+ description: Unauthorized
14979
+ 404:
14980
+ description: Not found
14981
+ requestBody:
14982
+ required: true
14983
+ content:
14984
+ application/json:
14985
+ schema:
14986
+ $ref: "#/components/schemas/AddClaimSetRangeMemberRequest"
14955
14987
  /{rangeId}:
14956
14988
  get:
14957
14989
  tags:
@@ -15041,6 +15073,38 @@ paths:
15041
15073
  application/json:
15042
15074
  schema:
15043
15075
  $ref: "#/components/schemas/AssignClaimSetRangeRequest"
15076
+ /{rangeId}/close:
15077
+ post:
15078
+ tags:
15079
+ - ranges
15080
+ summary: "Close an open range: it becomes a range with the quantity it reached (removed if nothing was minted)."
15081
+ operationId: ranges_close
15082
+ security: []
15083
+ parameters:
15084
+ - name: rangeId
15085
+ in: path
15086
+ required: true
15087
+ schema:
15088
+ type: string
15089
+ responses:
15090
+ 200:
15091
+ description: Success
15092
+ content:
15093
+ application/json:
15094
+ schema:
15095
+ $ref: "#/components/schemas/CloseClaimSetRangeResponse"
15096
+ 400:
15097
+ description: Bad request
15098
+ 401:
15099
+ description: Unauthorized
15100
+ 404:
15101
+ description: Not found
15102
+ requestBody:
15103
+ required: true
15104
+ content:
15105
+ application/json:
15106
+ schema:
15107
+ $ref: "#/components/schemas/ClaimSetScope"
15044
15108
  /{rangeId}/export:
15045
15109
  get:
15046
15110
  tags:
@@ -25919,6 +25983,8 @@ components:
25919
25983
  type: string
25920
25984
  namespace:
25921
25985
  type: string
25986
+ kind:
25987
+ $ref: "#/components/schemas/ClaimSetRangeKind"
25922
25988
  name:
25923
25989
  type: string
25924
25990
  notes:
@@ -25972,6 +26038,7 @@ components:
25972
26038
  - id
25973
26039
  - claimSetId
25974
26040
  - namespace
26041
+ - kind
25975
26042
  - name
25976
26043
  - notes
25977
26044
  - startIndex
@@ -25995,6 +26062,8 @@ components:
25995
26062
  CreateClaimSetRangeRequest:
25996
26063
  type: object
25997
26064
  properties:
26065
+ kind:
26066
+ $ref: "#/components/schemas/ClaimSetRangeKind"
25998
26067
  name:
25999
26068
  type: string
26000
26069
  quantity:
@@ -26018,7 +26087,6 @@ components:
26018
26087
  type: string
26019
26088
  required:
26020
26089
  - name
26021
- - quantity
26022
26090
  UpdateClaimSetRangeRequest:
26023
26091
  type: object
26024
26092
  properties:
@@ -26062,6 +26130,10 @@ components:
26062
26130
  type: string
26063
26131
  proofId:
26064
26132
  type: string
26133
+ rangeId:
26134
+ type: string
26135
+ groupId:
26136
+ type: string
26065
26137
  programmedAt:
26066
26138
  type: string
26067
26139
  scans:
@@ -26075,6 +26147,8 @@ components:
26075
26147
  - productId
26076
26148
  - batchId
26077
26149
  - proofId
26150
+ - rangeId
26151
+ - groupId
26078
26152
  - programmedAt
26079
26153
  - scans
26080
26154
  ClaimSetRangeTagsPage:
@@ -26103,6 +26177,41 @@ components:
26103
26177
  required:
26104
26178
  - url
26105
26179
  - remaining
26180
+ AddClaimSetRangeMemberRequest:
26181
+ type: object
26182
+ properties:
26183
+ code:
26184
+ type: string
26185
+ uid:
26186
+ type: string
26187
+ collectionId:
26188
+ type: string
26189
+ productId:
26190
+ type: string
26191
+ batchId:
26192
+ type: string
26193
+ data:
26194
+ type: object
26195
+ additionalProperties: true
26196
+ clear:
26197
+ type: boolean
26198
+ AddClaimSetRangeMemberResponse:
26199
+ type: object
26200
+ properties:
26201
+ tag:
26202
+ $ref: "#/components/schemas/ClaimSetRangeTag"
26203
+ range:
26204
+ $ref: "#/components/schemas/ClaimSetRange"
26205
+ assigned:
26206
+ type: object
26207
+ additionalProperties: true
26208
+ movedFrom:
26209
+ type: string
26210
+ required:
26211
+ - tag
26212
+ - range
26213
+ - assigned
26214
+ - movedFrom
26106
26215
  ImportClaimSetRangeUidsRequest:
26107
26216
  type: object
26108
26217
  properties:
@@ -26303,6 +26412,12 @@ components:
26303
26412
  - ntag424
26304
26413
  - ntag21x
26305
26414
  - qr
26415
+ ClaimSetRangeKind:
26416
+ type: string
26417
+ enum:
26418
+ - range
26419
+ - open
26420
+ - group
26306
26421
  ClaimSetRangeStatus:
26307
26422
  type: string
26308
26423
  enum:
@@ -26311,6 +26426,11 @@ components:
26311
26426
  - sent
26312
26427
  - received
26313
26428
  - assigned
26429
+ - open
26430
+ - group
26431
+ CloseClaimSetRangeResponse:
26432
+ type: object
26433
+ additionalProperties: true
26314
26434
  ClaimSetImportResult:
26315
26435
  type: string
26316
26436
  enum:
@@ -129,21 +129,32 @@ export type ClaimSetScope = {
129
129
  partnerId: string;
130
130
  };
131
131
  export type ClaimSetTagType = 'ntag424' | 'ntag21x' | 'qr';
132
- export type ClaimSetRangeStatus = 'minting' | 'minted' | 'sent' | 'received' | 'assigned';
132
+ /**
133
+ * range: a contiguous block of indexes minted up front. open: grows one index per tag programmed on a phone
134
+ * (count unknown in advance), closed into a range later. group: existing tags added by tapping, assigned by
135
+ * hand and moved together; no indexes.
136
+ */
137
+ export type ClaimSetRangeKind = 'range' | 'open' | 'group';
138
+ export type ClaimSetRangeStatus = 'minting' | 'minted' | 'sent' | 'received' | 'assigned' | 'open' | 'group';
133
139
  export interface ClaimSetRange {
134
140
  id: string;
135
141
  claimSetId: string;
136
142
  namespace: string;
143
+ kind: ClaimSetRangeKind;
137
144
  name: string;
138
145
  notes: string | null;
139
- startIndex: number;
140
- endIndex: number;
146
+ /** null for a group */
147
+ startIndex: number | null;
148
+ /** open: the highest index minted so far (null until the first); group: null */
149
+ endIndex: number | null;
150
+ /** range: the block; open: minted so far; group: its members */
141
151
  quantity: number;
142
152
  tagType: ClaimSetTagType;
153
+ /** open ranges and groups are always 'sidekick' */
143
154
  fulfilment: 'printer' | 'sidekick';
144
- /** The stored step: minting | minted | sent | received */
155
+ /** The stored step: minting | minted | sent | received (always 'minted' for open ranges and groups) */
145
156
  stage: 'minting' | 'minted' | 'sent' | 'received';
146
- /** What to show: the stage, or 'assigned' once every tag is assigned */
157
+ /** What to show: the stage, 'open', 'group', or 'assigned' once every tag is assigned */
147
158
  status: ClaimSetRangeStatus;
148
159
  intendedCollectionId: string | null;
149
160
  intendedProductId: string | null;
@@ -162,9 +173,11 @@ export interface ClaimSetRange {
162
173
  updatedAt: string;
163
174
  }
164
175
  export interface CreateClaimSetRangeRequest {
176
+ /** Default 'range'. Owners and admins make ranges and open ranges; assigners may make groups too. */
177
+ kind?: ClaimSetRangeKind;
165
178
  name: string;
166
- /** 1 to 10,000 */
167
- quantity: number;
179
+ /** 1 to 10,000 (a range); ignored for open ranges and groups */
180
+ quantity?: number;
168
181
  /** Pre-assign every tag at mint time (you must administer the collection) */
169
182
  intendedCollectionId?: string;
170
183
  intendedProductId?: string;
@@ -194,6 +207,10 @@ export interface ClaimSetRangeTag {
194
207
  productId: string | null;
195
208
  batchId: string | null;
196
209
  proofId: string | null;
210
+ /** The range it was minted into, if any */
211
+ rangeId: string | null;
212
+ /** The group it was added to, if any */
213
+ groupId: string | null;
197
214
  programmedAt: string | null;
198
215
  scans: number;
199
216
  }
@@ -207,8 +224,42 @@ export interface ClaimSetRangeNextTag extends ClaimSetRangeTag {
207
224
  url: string;
208
225
  piccOffset?: number;
209
226
  mirrorOffset?: number;
210
- remaining: number;
227
+ /** Tags still without a chip; null for an open range (it grows as you go) */
228
+ remaining: number | null;
229
+ }
230
+ /** Add an existing tag of the set to a group, and (with a collection, or clear) assign it as you go. */
231
+ export interface AddClaimSetRangeMemberRequest {
232
+ /** The tag's code, printed or bare… */
233
+ code?: string;
234
+ /** …or its chip UID (14 hex) */
235
+ uid?: string;
236
+ collectionId?: string;
237
+ productId?: string;
238
+ batchId?: string;
239
+ data?: Record<string, unknown>;
240
+ clear?: boolean;
211
241
  }
242
+ export interface AddClaimSetRangeMemberResponse {
243
+ tag: ClaimSetRangeTag;
244
+ range: ClaimSetRange;
245
+ /** The assignment, with the same skips as assign (has_proof, assigned_elsewhere) */
246
+ assigned: {
247
+ changed: number;
248
+ skipped: Array<{
249
+ code: string;
250
+ index: number | null;
251
+ reason: 'other_range' | 'has_proof' | 'assigned_elsewhere';
252
+ collectionId?: string;
253
+ }>;
254
+ };
255
+ /** The group the tag was taken from, if it was in another one */
256
+ movedFrom: string | null;
257
+ }
258
+ /** Closing an open range: the range it became, or that it was removed because nothing was minted. */
259
+ export type CloseClaimSetRangeResponse = ClaimSetRange | {
260
+ id: string;
261
+ deleted: true;
262
+ };
212
263
  export type ClaimSetImportResult = 'ok' | 'unchanged' | 'unknown_code' | 'duplicate_row' | 'index_mismatch' | 'no_uid' | 'bad_uid' | 'duplicate_uid' | 'uid_in_use' | 'uid_conflict';
213
264
  export interface ImportClaimSetRangeUidsRequest {
214
265
  /** The manufacturer's file as CSV text (the file we sent, with UID filled in) */
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 2.1.15 | Generated: 2026-11-09T15:17:42.472Z
3
+ Version: 2.1.16 | Generated: 2026-11-10T17:19:48.505Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -5775,10 +5775,11 @@ interface ClaimSetRange {
5775
5775
  id: string
5776
5776
  claimSetId: string
5777
5777
  namespace: string
5778
+ kind: ClaimSetRangeKind
5778
5779
  name: string
5779
5780
  notes: string | null
5780
- startIndex: number
5781
- endIndex: number
5781
+ startIndex: number | null
5782
+ endIndex: number | null
5782
5783
  quantity: number
5783
5784
  tagType: ClaimSetTagType
5784
5785
  fulfilment: 'printer' | 'sidekick'
@@ -5801,8 +5802,9 @@ interface ClaimSetRange {
5801
5802
  **CreateClaimSetRangeRequest** (interface)
5802
5803
  ```typescript
5803
5804
  interface CreateClaimSetRangeRequest {
5805
+ kind?: ClaimSetRangeKind
5804
5806
  name: string
5805
- quantity: number
5807
+ quantity?: number
5806
5808
  intendedCollectionId?: string
5807
5809
  intendedProductId?: string
5808
5810
  intendedBatchId?: string
@@ -5837,6 +5839,8 @@ interface ClaimSetRangeTag {
5837
5839
  productId: string | null
5838
5840
  batchId: string | null
5839
5841
  proofId: string | null
5842
+ rangeId: string | null
5843
+ groupId: string | null
5840
5844
  programmedAt: string | null
5841
5845
  scans: number
5842
5846
  }
@@ -5850,6 +5854,29 @@ interface ClaimSetRangeTagsPage {
5850
5854
  }
5851
5855
  ```
5852
5856
 
5857
+ **AddClaimSetRangeMemberRequest** (interface)
5858
+ ```typescript
5859
+ interface AddClaimSetRangeMemberRequest {
5860
+ code?: string
5861
+ uid?: string
5862
+ collectionId?: string
5863
+ productId?: string
5864
+ batchId?: string
5865
+ data?: Record<string, unknown>
5866
+ clear?: boolean
5867
+ }
5868
+ ```
5869
+
5870
+ **AddClaimSetRangeMemberResponse** (interface)
5871
+ ```typescript
5872
+ interface AddClaimSetRangeMemberResponse {
5873
+ tag: ClaimSetRangeTag
5874
+ range: ClaimSetRange
5875
+ assigned: { changed: number; skipped: Array<{ code: string; index: number | null; reason: 'other_range' | 'has_proof' | 'assigned_elsewhere'; collectionId?: string }> }
5876
+ movedFrom: string | null
5877
+ }
5878
+ ```
5879
+
5853
5880
  **ImportClaimSetRangeUidsRequest** (interface)
5854
5881
  ```typescript
5855
5882
  interface ImportClaimSetRangeUidsRequest {
@@ -5958,7 +5985,11 @@ type ClaimSetScope = { collectionId: string }
5958
5985
 
5959
5986
  **ClaimSetTagType** = `'ntag424' | 'ntag21x' | 'qr'`
5960
5987
 
5961
- **ClaimSetRangeStatus** = `'minting' | 'minted' | 'sent' | 'received' | 'assigned'`
5988
+ **ClaimSetRangeKind** = `'range' | 'open' | 'group'`
5989
+
5990
+ **ClaimSetRangeStatus** = `'minting' | 'minted' | 'sent' | 'received' | 'assigned' | 'open' | 'group'`
5991
+
5992
+ **CloseClaimSetRangeResponse** = `ClaimSetRange | { id: string`
5962
5993
 
5963
5994
  **ClaimSetImportResult** = ``
5964
5995
 
@@ -12464,6 +12495,15 @@ Name, notes, order details, or a stage move (sent to the printer, received).
12464
12495
  **resume**(scope: ClaimSetScope, claimSetId: string, rangeId: string) → `Promise<ClaimSetRange>`
12465
12496
  Finish minting a range that was interrupted.
12466
12497
 
12498
+ **close**(scope: ClaimSetScope, claimSetId: string, rangeId: string) → `Promise<CloseClaimSetRangeResponse>`
12499
+ Close an open range: it becomes a range with the quantity it reached (removed if nothing was minted).
12500
+
12501
+ **addMember**(scope: ClaimSetScope, claimSetId: string, groupId: string, params: AddClaimSetRangeMemberRequest) → `Promise<AddClaimSetRangeMemberResponse>`
12502
+ Put an existing tag of the set into a group (by code or chip UID), assigning it if a collection is given.
12503
+
12504
+ **removeMember**(scope: ClaimSetScope, claimSetId: string, groupId: string, code: string) → `Promise<`
12505
+ Take a tag out of a group. Its assignment is left as it is.
12506
+
12467
12507
  **tags**(scope: ClaimSetScope, claimSetId: string, rangeId: string,
12468
12508
  options: { from?: number; limit?: number; keys?: boolean } = {}) → `Promise<ClaimSetRangeTagsPage>`
12469
12509
  The range's tags in index order, a page at a time (keys: owners/admins only).
@@ -55,6 +55,27 @@ tag without a chip, with its URL and key; write it, then `ranges.recordTag(scope
55
55
 
56
56
  To find where a chip or code went, `partner.lookupTags(partner.id, { uid })` or `{ code }` searches every set the partner owns and returns each hit's set, tag and range, never a key.
57
57
 
58
+ ## Open ranges and groups
59
+
60
+ A range's count is fixed when it is minted. Two phone-side jobs don't know their count in advance, so a range
61
+ has a `kind`:
62
+
63
+ - **`open`**: blank tags programmed on Sidekick one at a time. `ranges.create(scope, set.id, { kind: 'open', name })`
64
+ reserves only a start index; each `ranges.next()` hands back a free minted code or mints one more, so
65
+ `quantity`/`endIndex` grow as tags are written (`remaining` is null). One open range per set, and nothing can
66
+ be minted behind it (`409 RANGE_OPEN`) until `ranges.close(scope, set.id, range.id)` turns it into an ordinary
67
+ range (an open range that minted nothing is removed instead).
68
+ - **`group`**: tags that already exist, added by tapping, assigned by hand, and moved together later. Assigners may
69
+ make one: `ranges.create(scope, set.id, { kind: 'group', name, intendedCollectionId? })`. Each tap goes through
70
+ `ranges.addMember(scope, set.id, group.id, { code | uid, collectionId, productId? })`, which stamps the tag with
71
+ the group and assigns it with the single-tag rules; `assigned.skipped` says when a tag was left alone (claimed,
72
+ or in a collection you don't administer). `ranges.assign(scope, set.id, group.id, { collectionId })` moves every
73
+ member in one go; `ranges.removeMember` takes one out. Groups have no printer file, instructions, import or
74
+ `next` (`400 NOT_A_RANGE`). Its tags must be codes of the group's set; a chip that is a code elsewhere is
75
+ `409 OTHER_SET`.
76
+
77
+ Status reads `open` or `group` for these (and `assigned` once every member of a group is assigned).
78
+
58
79
  ## The printer file
59
80
 
60
81
  One row per tag, in index order. The manufacturer fills in `UID` and sends the same file back; rows are
package/openapi.yaml CHANGED
@@ -14952,6 +14952,38 @@ paths:
14952
14952
  description: Unauthorized
14953
14953
  404:
14954
14954
  description: Not found
14955
+ /{groupId}/members:
14956
+ post:
14957
+ tags:
14958
+ - ranges
14959
+ summary: Put an existing tag of the set into a group (by code or chip UID), assigning it if a collection is given.
14960
+ operationId: ranges_addMember
14961
+ security: []
14962
+ parameters:
14963
+ - name: groupId
14964
+ in: path
14965
+ required: true
14966
+ schema:
14967
+ type: string
14968
+ responses:
14969
+ 200:
14970
+ description: Success
14971
+ content:
14972
+ application/json:
14973
+ schema:
14974
+ $ref: "#/components/schemas/AddClaimSetRangeMemberResponse"
14975
+ 400:
14976
+ description: Bad request
14977
+ 401:
14978
+ description: Unauthorized
14979
+ 404:
14980
+ description: Not found
14981
+ requestBody:
14982
+ required: true
14983
+ content:
14984
+ application/json:
14985
+ schema:
14986
+ $ref: "#/components/schemas/AddClaimSetRangeMemberRequest"
14955
14987
  /{rangeId}:
14956
14988
  get:
14957
14989
  tags:
@@ -15041,6 +15073,38 @@ paths:
15041
15073
  application/json:
15042
15074
  schema:
15043
15075
  $ref: "#/components/schemas/AssignClaimSetRangeRequest"
15076
+ /{rangeId}/close:
15077
+ post:
15078
+ tags:
15079
+ - ranges
15080
+ summary: "Close an open range: it becomes a range with the quantity it reached (removed if nothing was minted)."
15081
+ operationId: ranges_close
15082
+ security: []
15083
+ parameters:
15084
+ - name: rangeId
15085
+ in: path
15086
+ required: true
15087
+ schema:
15088
+ type: string
15089
+ responses:
15090
+ 200:
15091
+ description: Success
15092
+ content:
15093
+ application/json:
15094
+ schema:
15095
+ $ref: "#/components/schemas/CloseClaimSetRangeResponse"
15096
+ 400:
15097
+ description: Bad request
15098
+ 401:
15099
+ description: Unauthorized
15100
+ 404:
15101
+ description: Not found
15102
+ requestBody:
15103
+ required: true
15104
+ content:
15105
+ application/json:
15106
+ schema:
15107
+ $ref: "#/components/schemas/ClaimSetScope"
15044
15108
  /{rangeId}/export:
15045
15109
  get:
15046
15110
  tags:
@@ -25919,6 +25983,8 @@ components:
25919
25983
  type: string
25920
25984
  namespace:
25921
25985
  type: string
25986
+ kind:
25987
+ $ref: "#/components/schemas/ClaimSetRangeKind"
25922
25988
  name:
25923
25989
  type: string
25924
25990
  notes:
@@ -25972,6 +26038,7 @@ components:
25972
26038
  - id
25973
26039
  - claimSetId
25974
26040
  - namespace
26041
+ - kind
25975
26042
  - name
25976
26043
  - notes
25977
26044
  - startIndex
@@ -25995,6 +26062,8 @@ components:
25995
26062
  CreateClaimSetRangeRequest:
25996
26063
  type: object
25997
26064
  properties:
26065
+ kind:
26066
+ $ref: "#/components/schemas/ClaimSetRangeKind"
25998
26067
  name:
25999
26068
  type: string
26000
26069
  quantity:
@@ -26018,7 +26087,6 @@ components:
26018
26087
  type: string
26019
26088
  required:
26020
26089
  - name
26021
- - quantity
26022
26090
  UpdateClaimSetRangeRequest:
26023
26091
  type: object
26024
26092
  properties:
@@ -26062,6 +26130,10 @@ components:
26062
26130
  type: string
26063
26131
  proofId:
26064
26132
  type: string
26133
+ rangeId:
26134
+ type: string
26135
+ groupId:
26136
+ type: string
26065
26137
  programmedAt:
26066
26138
  type: string
26067
26139
  scans:
@@ -26075,6 +26147,8 @@ components:
26075
26147
  - productId
26076
26148
  - batchId
26077
26149
  - proofId
26150
+ - rangeId
26151
+ - groupId
26078
26152
  - programmedAt
26079
26153
  - scans
26080
26154
  ClaimSetRangeTagsPage:
@@ -26103,6 +26177,41 @@ components:
26103
26177
  required:
26104
26178
  - url
26105
26179
  - remaining
26180
+ AddClaimSetRangeMemberRequest:
26181
+ type: object
26182
+ properties:
26183
+ code:
26184
+ type: string
26185
+ uid:
26186
+ type: string
26187
+ collectionId:
26188
+ type: string
26189
+ productId:
26190
+ type: string
26191
+ batchId:
26192
+ type: string
26193
+ data:
26194
+ type: object
26195
+ additionalProperties: true
26196
+ clear:
26197
+ type: boolean
26198
+ AddClaimSetRangeMemberResponse:
26199
+ type: object
26200
+ properties:
26201
+ tag:
26202
+ $ref: "#/components/schemas/ClaimSetRangeTag"
26203
+ range:
26204
+ $ref: "#/components/schemas/ClaimSetRange"
26205
+ assigned:
26206
+ type: object
26207
+ additionalProperties: true
26208
+ movedFrom:
26209
+ type: string
26210
+ required:
26211
+ - tag
26212
+ - range
26213
+ - assigned
26214
+ - movedFrom
26106
26215
  ImportClaimSetRangeUidsRequest:
26107
26216
  type: object
26108
26217
  properties:
@@ -26303,6 +26412,12 @@ components:
26303
26412
  - ntag424
26304
26413
  - ntag21x
26305
26414
  - qr
26415
+ ClaimSetRangeKind:
26416
+ type: string
26417
+ enum:
26418
+ - range
26419
+ - open
26420
+ - group
26306
26421
  ClaimSetRangeStatus:
26307
26422
  type: string
26308
26423
  enum:
@@ -26311,6 +26426,11 @@ components:
26311
26426
  - sent
26312
26427
  - received
26313
26428
  - assigned
26429
+ - open
26430
+ - group
26431
+ CloseClaimSetRangeResponse:
26432
+ type: object
26433
+ additionalProperties: true
26314
26434
  ClaimSetImportResult:
26315
26435
  type: string
26316
26436
  enum:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "2.1.15",
3
+ "version": "2.1.16",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",