@proveanything/smartlinks 1.15.6 → 1.15.8

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,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.15.6 | Generated: 2026-07-19T08:21:33.985Z
3
+ Version: 1.15.8 | Generated: 2026-07-19T09:55:23.623Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -1447,7 +1447,6 @@ interface AppConfigSettings {
1447
1447
  addOns?: string[]
1448
1448
  requestedBasePlanId?: string
1449
1449
  itemRecordMode?: 'registered' | 'owned' | null
1450
- virtualItemsEnabled?: boolean
1451
1450
  system?: SystemBlock
1452
1451
  }
1453
1452
  ```
@@ -3698,8 +3697,6 @@ interface Collection {
3698
3697
  secondaryColor?: string
3699
3698
  portalUrl?: string // URL for the collection's portal (if applicable)
3700
3699
  allowAutoGenerateClaims?: boolean
3701
- variants: boolean // does this collection support variants?
3702
- batches: boolean // does this collection support batches?
3703
3700
  defaultAuthKitId: string // default auth kit for this collection, used for auth
3704
3701
  }
3705
3702
  ```
@@ -36,7 +36,6 @@ export interface AppConfigSettings {
36
36
 
37
37
  /** How the account handles individual physical items. */
38
38
  itemRecordMode?: 'registered' | 'owned' | null;
39
- virtualItemsEnabled?: boolean;
40
39
 
41
40
  // ── SYSTEM-OWNED, PUBLIC (reconcile writes; client read-only) ─────
42
41
  /** Resolved entitlement truth. Read this to gate features. */
@@ -245,6 +244,25 @@ Always resolve flags through `appConfiguration.isFeatureEnabled(collectionId, fl
245
244
  if you already have a `system` block from elsewhere — never read
246
245
  `cfg.system.features[flag]` directly.
247
246
 
247
+ #### 4.4.1 Common feature flags
248
+
249
+ `features` is an open map — any microapp can define its own key — but
250
+ these are the major, cross-cutting flags most integrations will care
251
+ about:
252
+
253
+ | Flag | Gates |
254
+ | -------------- | ---------------------------------------------------------------------- |
255
+ | `analytics` | Analytics surfaces (dashboards, reporting, event exploration). |
256
+ | `crm` | Customer interaction / CRM — contact records, broadcasts, segments. Sub-features hang off the `crm.*` dotted prefix, e.g. `crm.broadcasts`, `crm.segments`. |
257
+ | `hub` | The Hub module. |
258
+ | `portal` | QR code scan portals. |
259
+ | `virtualItems` | Virtual items — algorithmic per-item IDs with no persistent row (battery serials, scan-to-collect points, bulk QR sheets). Replaces the old root-level `virtualItemsEnabled` boolean, which has been removed (§8) — resolve this like any other feature flag, not as a separate config key. Independent of `itemRecordMode`. |
260
+ | `batches` | Batch support. Used to be the `Collection.batches` boolean; that field has been removed — this flag is now the only source of truth. |
261
+ | `variants` | Variant support. Used to be the `Collection.variants` boolean; that field has been removed — this flag is now the only source of truth. |
262
+
263
+ Same resolution rule as any flag (§4.4) — don't read these off
264
+ `cfg.system.features` directly, always go through `isFeatureEnabled()`.
265
+
248
266
  ### 4.5 `meters`
249
267
 
250
268
  Map keyed by add-on key. Apps reporting usage should call the
@@ -407,18 +425,14 @@ with a stale local copy.
407
425
  Clients MUST NOT write directly to `system` or `systemPrivate`.
408
426
  `entitlements-reconcile` merges user-owned fields through untouched.
409
427
 
410
- ## 8. Item handling (`itemRecordMode`, `virtualItemsEnabled`)
428
+ ## 8. Item handling (`itemRecordMode`)
411
429
 
412
- Two **independent** root-level, user-owned keys describing how the
413
- account treats individual physical items. Reconcile never touches
414
- them.
430
+ A root-level, user-owned key describing how the account treats
431
+ individual physical items. Reconcile never touches it.
415
432
 
416
- Three axes (do NOT conflate):
433
+ Two axes (do NOT conflate):
417
434
 
418
- 1. **Virtual items** — `virtualItemsEnabled: boolean`. Algorithmic
419
- IDs, no per-item row. Battery serials, scan-to-collect points,
420
- bulk QR sheets. Can be on with `itemRecordMode` off.
421
- 2. **Item records** — `itemRecordMode`. Materialise a persistent row
435
+ 1. **Item records** — `itemRecordMode`. Materialise a persistent row
422
436
  per physical item. `null` / missing = **disabled** (no separate
423
437
  `"none"` enum — reads collapse to `mode === "off"` via the
424
438
  `useItemRecordMode()` hook).
@@ -426,7 +440,15 @@ Three axes (do NOT conflate):
426
440
  provenance without a customer relationship.
427
441
  - `"owned"` — tag row + owner + interaction history. Requires
428
442
  `basePlanId >= "engage"`. Enables claim / transfer / CRM.
429
- 3. **CRM** — downstream consequence of `owned`; not a peer flag.
443
+ 2. **CRM** — downstream consequence of `owned`; not a peer flag.
444
+
445
+ **Virtual items are not part of this key.** Algorithmic IDs with no
446
+ per-item row (battery serials, scan-to-collect points, bulk QR sheets)
447
+ used to be a separate root-level `virtualItemsEnabled: boolean` — that
448
+ field has been removed. Virtual items are now gated by the `virtualItems`
449
+ feature flag under `system.features` (§4.4.1), same as every other
450
+ feature — resolve it with `isFeatureEnabled(collectionId, 'virtualItems')`.
451
+ It's independent of `itemRecordMode` and can be on with item records off.
430
452
 
431
453
  **Billing:** the usage ledger stamps `tier` at event time from
432
454
  `itemRecordMode`. Writes with `mode === null` MUST be rejected. Mode
@@ -447,46 +469,3 @@ CRM visibility), not just a capability flag.
447
469
  features yet.
448
470
  - `systemOverrides` (old root-level key) → `systemPrivate.overrides`.
449
471
  One-off backfill moves the block and re-runs reconcile.
450
-
451
- ## 10. Change log
452
-
453
- - **2026-07-17**: Initial contract published; `appConfig.system` becomes
454
- canonical entitlements source of truth. `entitlements` group deprecated.
455
- - **2026-07-17**: Added `systemOverrides` for additive comps; reconcile
456
- records `system.appliedOverrides`.
457
- - **2026-07-18**: Renamed `systemOverrides` → `systemPrivate.overrides`
458
- and formalised the three-tier access model (user / system /
459
- systemPrivate). API strips `systemPrivate` for non-admin readers.
460
- Added `system.accountType` derived from
461
- `systemPrivate.overrides.accountType`. Added top-of-doc TypeScript
462
- definition.
463
- - **2026-07-18**: Added SDK helpers `appConfiguration.getAppConfig()`
464
- (typed + cached), `isFeatureEnabled()` (async, cache-backed feature
465
- gate), and `isFeatureEnabledSync()` (cache-only, for callers that can't
466
- await). Renamed the exported TypeScript type to `AppConfigSettings`
467
- to avoid a name collision with the existing per-module `AppConfig`
468
- type in `src/types/collection.ts`.
469
- - **2026-07-18**: `/public/collection/:id/app/config` (`collection.getAppsConfig()`)
470
- now returns the `appConfig` entitlements data (`system`, `addOns`,
471
- `requestedBasePlanId`, `itemRecordMode`, `virtualItemsEnabled`) merged
472
- alongside its existing app-catalog `apps[]`. `appConfiguration.getAppConfig()`
473
- was repointed at this endpoint (dropping its `admin` option — this endpoint
474
- is public-only); the settings-group endpoint (`appConfiguration.getConfig({ appId: 'appConfig' })`)
475
- is still the only way to reach `systemPrivate`. See §3.1 for why the two
476
- endpoints' `apps[]` fields are shaped differently and shouldn't be conflated.
477
- - **2026-07-18**: `system.features` changed from "only truthy flags appear"
478
- to explicit `Record<string, boolean>` overrides. Added the `accountType`
479
- default rule (§4.4): enterprise accounts default every flag to on unless
480
- explicitly `false`; standard accounts default off unless explicitly `true`.
481
- Added `appConfiguration.resolveFeature(system, flag)` — the pure resolver
482
- behind `isFeatureEnabled()`/`isFeatureEnabledSync()`, exposed only for the
483
- rare case of already holding a `system` block from somewhere other than
484
- `getAppConfig()`. There is no separate admin feature-check path — `system`
485
- is public data on every read, so admin surfaces should call
486
- `isFeatureEnabled()` like everything else. Reading `cfg.system.features[flag]`
487
- directly is no longer correct for enterprise accounts — always resolve
488
- through one of these three.
489
- - **2026-07-19**: Corrected flag naming convention (§4.4): flags are
490
- camelCase (e.g. `customDomain`), not snake_case, and may use a dotted
491
- grouping prefix for a topic/module (e.g. `crm.broadcasts`). Updated all
492
- examples in this doc accordingly.
package/dist/openapi.yaml CHANGED
@@ -15719,8 +15719,6 @@ components:
15719
15719
  enum:
15720
15720
  - registered
15721
15721
  - owned
15722
- virtualItemsEnabled:
15723
- type: boolean
15724
15722
  system:
15725
15723
  $ref: "#/components/schemas/SystemBlock"
15726
15724
  required:
@@ -19309,10 +19307,6 @@ components:
19309
19307
  type: string
19310
19308
  allowAutoGenerateClaims:
19311
19309
  type: boolean
19312
- variants:
19313
- type: boolean
19314
- batches:
19315
- type: boolean
19316
19310
  defaultAuthKitId:
19317
19311
  type: string
19318
19312
  required:
@@ -19328,8 +19322,6 @@ components:
19328
19322
  - supported
19329
19323
  - roles
19330
19324
  - shortId
19331
- - variants
19332
- - batches
19333
19325
  - defaultAuthKitId
19334
19326
  HubAvailabilityResponse:
19335
19327
  type: object
@@ -112,7 +112,6 @@ export interface AppConfigSettings {
112
112
  requestedBasePlanId?: string;
113
113
  /** How the account handles individual physical items. */
114
114
  itemRecordMode?: 'registered' | 'owned' | null;
115
- virtualItemsEnabled?: boolean;
116
115
  /** Resolved entitlement truth. Read this to gate features. */
117
116
  system?: SystemBlock;
118
117
  }
@@ -57,8 +57,6 @@ export interface Collection {
57
57
  portalUrl?: string;
58
58
  /** Allow users to claim products without providing a proof ID (auto-generates serial on-demand) */
59
59
  allowAutoGenerateClaims?: boolean;
60
- variants: boolean;
61
- batches: boolean;
62
60
  defaultAuthKitId: string;
63
61
  }
64
62
  export type CollectionResponse = Collection;
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.15.6 | Generated: 2026-07-19T08:21:33.985Z
3
+ Version: 1.15.8 | Generated: 2026-07-19T09:55:23.623Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -1447,7 +1447,6 @@ interface AppConfigSettings {
1447
1447
  addOns?: string[]
1448
1448
  requestedBasePlanId?: string
1449
1449
  itemRecordMode?: 'registered' | 'owned' | null
1450
- virtualItemsEnabled?: boolean
1451
1450
  system?: SystemBlock
1452
1451
  }
1453
1452
  ```
@@ -3698,8 +3697,6 @@ interface Collection {
3698
3697
  secondaryColor?: string
3699
3698
  portalUrl?: string // URL for the collection's portal (if applicable)
3700
3699
  allowAutoGenerateClaims?: boolean
3701
- variants: boolean // does this collection support variants?
3702
- batches: boolean // does this collection support batches?
3703
3700
  defaultAuthKitId: string // default auth kit for this collection, used for auth
3704
3701
  }
3705
3702
  ```
package/docs/appConfig.md CHANGED
@@ -36,7 +36,6 @@ export interface AppConfigSettings {
36
36
 
37
37
  /** How the account handles individual physical items. */
38
38
  itemRecordMode?: 'registered' | 'owned' | null;
39
- virtualItemsEnabled?: boolean;
40
39
 
41
40
  // ── SYSTEM-OWNED, PUBLIC (reconcile writes; client read-only) ─────
42
41
  /** Resolved entitlement truth. Read this to gate features. */
@@ -245,6 +244,25 @@ Always resolve flags through `appConfiguration.isFeatureEnabled(collectionId, fl
245
244
  if you already have a `system` block from elsewhere — never read
246
245
  `cfg.system.features[flag]` directly.
247
246
 
247
+ #### 4.4.1 Common feature flags
248
+
249
+ `features` is an open map — any microapp can define its own key — but
250
+ these are the major, cross-cutting flags most integrations will care
251
+ about:
252
+
253
+ | Flag | Gates |
254
+ | -------------- | ---------------------------------------------------------------------- |
255
+ | `analytics` | Analytics surfaces (dashboards, reporting, event exploration). |
256
+ | `crm` | Customer interaction / CRM — contact records, broadcasts, segments. Sub-features hang off the `crm.*` dotted prefix, e.g. `crm.broadcasts`, `crm.segments`. |
257
+ | `hub` | The Hub module. |
258
+ | `portal` | QR code scan portals. |
259
+ | `virtualItems` | Virtual items — algorithmic per-item IDs with no persistent row (battery serials, scan-to-collect points, bulk QR sheets). Replaces the old root-level `virtualItemsEnabled` boolean, which has been removed (§8) — resolve this like any other feature flag, not as a separate config key. Independent of `itemRecordMode`. |
260
+ | `batches` | Batch support. Used to be the `Collection.batches` boolean; that field has been removed — this flag is now the only source of truth. |
261
+ | `variants` | Variant support. Used to be the `Collection.variants` boolean; that field has been removed — this flag is now the only source of truth. |
262
+
263
+ Same resolution rule as any flag (§4.4) — don't read these off
264
+ `cfg.system.features` directly, always go through `isFeatureEnabled()`.
265
+
248
266
  ### 4.5 `meters`
249
267
 
250
268
  Map keyed by add-on key. Apps reporting usage should call the
@@ -407,18 +425,14 @@ with a stale local copy.
407
425
  Clients MUST NOT write directly to `system` or `systemPrivate`.
408
426
  `entitlements-reconcile` merges user-owned fields through untouched.
409
427
 
410
- ## 8. Item handling (`itemRecordMode`, `virtualItemsEnabled`)
428
+ ## 8. Item handling (`itemRecordMode`)
411
429
 
412
- Two **independent** root-level, user-owned keys describing how the
413
- account treats individual physical items. Reconcile never touches
414
- them.
430
+ A root-level, user-owned key describing how the account treats
431
+ individual physical items. Reconcile never touches it.
415
432
 
416
- Three axes (do NOT conflate):
433
+ Two axes (do NOT conflate):
417
434
 
418
- 1. **Virtual items** — `virtualItemsEnabled: boolean`. Algorithmic
419
- IDs, no per-item row. Battery serials, scan-to-collect points,
420
- bulk QR sheets. Can be on with `itemRecordMode` off.
421
- 2. **Item records** — `itemRecordMode`. Materialise a persistent row
435
+ 1. **Item records** — `itemRecordMode`. Materialise a persistent row
422
436
  per physical item. `null` / missing = **disabled** (no separate
423
437
  `"none"` enum — reads collapse to `mode === "off"` via the
424
438
  `useItemRecordMode()` hook).
@@ -426,7 +440,15 @@ Three axes (do NOT conflate):
426
440
  provenance without a customer relationship.
427
441
  - `"owned"` — tag row + owner + interaction history. Requires
428
442
  `basePlanId >= "engage"`. Enables claim / transfer / CRM.
429
- 3. **CRM** — downstream consequence of `owned`; not a peer flag.
443
+ 2. **CRM** — downstream consequence of `owned`; not a peer flag.
444
+
445
+ **Virtual items are not part of this key.** Algorithmic IDs with no
446
+ per-item row (battery serials, scan-to-collect points, bulk QR sheets)
447
+ used to be a separate root-level `virtualItemsEnabled: boolean` — that
448
+ field has been removed. Virtual items are now gated by the `virtualItems`
449
+ feature flag under `system.features` (§4.4.1), same as every other
450
+ feature — resolve it with `isFeatureEnabled(collectionId, 'virtualItems')`.
451
+ It's independent of `itemRecordMode` and can be on with item records off.
430
452
 
431
453
  **Billing:** the usage ledger stamps `tier` at event time from
432
454
  `itemRecordMode`. Writes with `mode === null` MUST be rejected. Mode
@@ -447,46 +469,3 @@ CRM visibility), not just a capability flag.
447
469
  features yet.
448
470
  - `systemOverrides` (old root-level key) → `systemPrivate.overrides`.
449
471
  One-off backfill moves the block and re-runs reconcile.
450
-
451
- ## 10. Change log
452
-
453
- - **2026-07-17**: Initial contract published; `appConfig.system` becomes
454
- canonical entitlements source of truth. `entitlements` group deprecated.
455
- - **2026-07-17**: Added `systemOverrides` for additive comps; reconcile
456
- records `system.appliedOverrides`.
457
- - **2026-07-18**: Renamed `systemOverrides` → `systemPrivate.overrides`
458
- and formalised the three-tier access model (user / system /
459
- systemPrivate). API strips `systemPrivate` for non-admin readers.
460
- Added `system.accountType` derived from
461
- `systemPrivate.overrides.accountType`. Added top-of-doc TypeScript
462
- definition.
463
- - **2026-07-18**: Added SDK helpers `appConfiguration.getAppConfig()`
464
- (typed + cached), `isFeatureEnabled()` (async, cache-backed feature
465
- gate), and `isFeatureEnabledSync()` (cache-only, for callers that can't
466
- await). Renamed the exported TypeScript type to `AppConfigSettings`
467
- to avoid a name collision with the existing per-module `AppConfig`
468
- type in `src/types/collection.ts`.
469
- - **2026-07-18**: `/public/collection/:id/app/config` (`collection.getAppsConfig()`)
470
- now returns the `appConfig` entitlements data (`system`, `addOns`,
471
- `requestedBasePlanId`, `itemRecordMode`, `virtualItemsEnabled`) merged
472
- alongside its existing app-catalog `apps[]`. `appConfiguration.getAppConfig()`
473
- was repointed at this endpoint (dropping its `admin` option — this endpoint
474
- is public-only); the settings-group endpoint (`appConfiguration.getConfig({ appId: 'appConfig' })`)
475
- is still the only way to reach `systemPrivate`. See §3.1 for why the two
476
- endpoints' `apps[]` fields are shaped differently and shouldn't be conflated.
477
- - **2026-07-18**: `system.features` changed from "only truthy flags appear"
478
- to explicit `Record<string, boolean>` overrides. Added the `accountType`
479
- default rule (§4.4): enterprise accounts default every flag to on unless
480
- explicitly `false`; standard accounts default off unless explicitly `true`.
481
- Added `appConfiguration.resolveFeature(system, flag)` — the pure resolver
482
- behind `isFeatureEnabled()`/`isFeatureEnabledSync()`, exposed only for the
483
- rare case of already holding a `system` block from somewhere other than
484
- `getAppConfig()`. There is no separate admin feature-check path — `system`
485
- is public data on every read, so admin surfaces should call
486
- `isFeatureEnabled()` like everything else. Reading `cfg.system.features[flag]`
487
- directly is no longer correct for enterprise accounts — always resolve
488
- through one of these three.
489
- - **2026-07-19**: Corrected flag naming convention (§4.4): flags are
490
- camelCase (e.g. `customDomain`), not snake_case, and may use a dotted
491
- grouping prefix for a topic/module (e.g. `crm.broadcasts`). Updated all
492
- examples in this doc accordingly.
package/openapi.yaml CHANGED
@@ -15719,8 +15719,6 @@ components:
15719
15719
  enum:
15720
15720
  - registered
15721
15721
  - owned
15722
- virtualItemsEnabled:
15723
- type: boolean
15724
15722
  system:
15725
15723
  $ref: "#/components/schemas/SystemBlock"
15726
15724
  required:
@@ -19309,10 +19307,6 @@ components:
19309
19307
  type: string
19310
19308
  allowAutoGenerateClaims:
19311
19309
  type: boolean
19312
- variants:
19313
- type: boolean
19314
- batches:
19315
- type: boolean
19316
19310
  defaultAuthKitId:
19317
19311
  type: string
19318
19312
  required:
@@ -19328,8 +19322,6 @@ components:
19328
19322
  - supported
19329
19323
  - roles
19330
19324
  - shortId
19331
- - variants
19332
- - batches
19333
19325
  - defaultAuthKitId
19334
19326
  HubAvailabilityResponse:
19335
19327
  type: object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.15.6",
3
+ "version": "1.15.8",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",