@proveanything/smartlinks 1.15.0 → 1.15.1
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/collection.d.ts +57 -1
- package/dist/api/collection.js +78 -0
- package/dist/docs/API_SUMMARY.md +28 -1
- package/dist/http.js +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/openapi.yaml +145 -0
- package/dist/types/collection.d.ts +19 -0
- package/docs/API_SUMMARY.md +28 -1
- package/openapi.yaml +145 -0
- package/package.json +1 -1
package/dist/api/collection.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CollectionResponse, CollectionCreateRequest, CollectionUpdateRequest, AppsConfigResponse } from "../types/collection";
|
|
1
|
+
import { CollectionResponse, CollectionCreateRequest, CollectionUpdateRequest, AppsConfigResponse, DomainTarget, HubAvailabilityResponse } from "../types/collection";
|
|
2
2
|
export declare namespace collection {
|
|
3
3
|
/**
|
|
4
4
|
* Retrieves a single Collection by its ID.
|
|
@@ -21,6 +21,62 @@ export declare namespace collection {
|
|
|
21
21
|
* @returns Promise resolving to a CollectionResponse object
|
|
22
22
|
*/
|
|
23
23
|
function getShortId(shortId: string): Promise<CollectionResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Resolve the collection for the current Hub domain (public endpoint).
|
|
26
|
+
*
|
|
27
|
+
* The server derives the requesting domain from the request headers
|
|
28
|
+
* (`X-Source-Domain` / `X-Forwarded-Host` / `Host`), so no identifier is
|
|
29
|
+
* passed — this is the call a Hub frontend makes on load to find out which
|
|
30
|
+
* collection it is serving, whether it's reached via `{brand}.mysmartlinks.app`
|
|
31
|
+
* or a bring-your-own custom domain (e.g. `hub.acme.com`).
|
|
32
|
+
*
|
|
33
|
+
* @returns Promise resolving to the CollectionResponse mapped to the domain
|
|
34
|
+
* @throws ErrorResponse (404) if no collection is mapped to the domain
|
|
35
|
+
*/
|
|
36
|
+
function getByHub(): Promise<CollectionResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Check whether a Hub subdomain name is available to claim (admin only).
|
|
39
|
+
* @param collectionId – Identifier of the collection making the request
|
|
40
|
+
* @param name – Proposed subdomain prefix (lowercase letters, numbers, hyphens; max 63 chars)
|
|
41
|
+
* @returns Promise resolving to { available, domain }
|
|
42
|
+
* @throws ErrorResponse (400) if the name fails validation or is reserved
|
|
43
|
+
*/
|
|
44
|
+
function checkHubAvailability(collectionId: string, name: string): Promise<HubAvailabilityResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Claim or rename the Hub subdomain for a collection (admin only).
|
|
47
|
+
*
|
|
48
|
+
* Maps `{hubName}.mysmartlinks.app` to the collection. If the collection
|
|
49
|
+
* already had a different hub name, the previous subdomain is released
|
|
50
|
+
* automatically.
|
|
51
|
+
*
|
|
52
|
+
* @param collectionId – Identifier of the collection
|
|
53
|
+
* @param hubName – The subdomain prefix to claim (e.g. "acme")
|
|
54
|
+
* @returns Promise resolving to the updated CollectionResponse (with hubName set)
|
|
55
|
+
* @throws ErrorResponse (400) on invalid/reserved name, (409) if already taken by another collection
|
|
56
|
+
*/
|
|
57
|
+
function claimHub(collectionId: string, hubName: string): Promise<CollectionResponse>;
|
|
58
|
+
/**
|
|
59
|
+
* Register a custom domain for a collection and provision its managed
|
|
60
|
+
* certificate (admin only).
|
|
61
|
+
*
|
|
62
|
+
* @param collectionId – Identifier of the collection
|
|
63
|
+
* @param domain – The fully-qualified domain to register (e.g. "hub.acme.com")
|
|
64
|
+
* @param target – Which load balancer / certificate map to use. Defaults to
|
|
65
|
+
* `"smartlinks"` (the id.smartlinks.app load balancer). Pass `"hub"` to
|
|
66
|
+
* register a bring-your-own Hub domain.
|
|
67
|
+
* @returns Promise resolving when registration has been initiated
|
|
68
|
+
* @throws ErrorResponse if the request fails
|
|
69
|
+
*/
|
|
70
|
+
function registerDomain(collectionId: string, domain: string, target?: DomainTarget): Promise<any>;
|
|
71
|
+
/**
|
|
72
|
+
* Get the managed-certificate status for a collection's custom domain (admin only).
|
|
73
|
+
* @param collectionId – Identifier of the collection
|
|
74
|
+
* @param target – Which domain to check: `"smartlinks"` (default, uses `redirectUrl`)
|
|
75
|
+
* or `"hub"` (uses `hubCustomDomain`)
|
|
76
|
+
* @returns Promise resolving to the certificate details
|
|
77
|
+
* @throws ErrorResponse (404) if the relevant domain is not set
|
|
78
|
+
*/
|
|
79
|
+
function getDomainStatus(collectionId: string, target?: DomainTarget): Promise<any>;
|
|
24
80
|
/**
|
|
25
81
|
* Retrieve a specific settings group for a collection.
|
|
26
82
|
* Public reads return the public view of the settings group. If the stored payload contains
|
package/dist/api/collection.js
CHANGED
|
@@ -37,6 +37,84 @@ export var collection;
|
|
|
37
37
|
return request(path);
|
|
38
38
|
}
|
|
39
39
|
collection.getShortId = getShortId;
|
|
40
|
+
/**
|
|
41
|
+
* Resolve the collection for the current Hub domain (public endpoint).
|
|
42
|
+
*
|
|
43
|
+
* The server derives the requesting domain from the request headers
|
|
44
|
+
* (`X-Source-Domain` / `X-Forwarded-Host` / `Host`), so no identifier is
|
|
45
|
+
* passed — this is the call a Hub frontend makes on load to find out which
|
|
46
|
+
* collection it is serving, whether it's reached via `{brand}.mysmartlinks.app`
|
|
47
|
+
* or a bring-your-own custom domain (e.g. `hub.acme.com`).
|
|
48
|
+
*
|
|
49
|
+
* @returns Promise resolving to the CollectionResponse mapped to the domain
|
|
50
|
+
* @throws ErrorResponse (404) if no collection is mapped to the domain
|
|
51
|
+
*/
|
|
52
|
+
async function getByHub() {
|
|
53
|
+
const path = `/public/collection/getByHub`;
|
|
54
|
+
return request(path);
|
|
55
|
+
}
|
|
56
|
+
collection.getByHub = getByHub;
|
|
57
|
+
/**
|
|
58
|
+
* Check whether a Hub subdomain name is available to claim (admin only).
|
|
59
|
+
* @param collectionId – Identifier of the collection making the request
|
|
60
|
+
* @param name – Proposed subdomain prefix (lowercase letters, numbers, hyphens; max 63 chars)
|
|
61
|
+
* @returns Promise resolving to { available, domain }
|
|
62
|
+
* @throws ErrorResponse (400) if the name fails validation or is reserved
|
|
63
|
+
*/
|
|
64
|
+
async function checkHubAvailability(collectionId, name) {
|
|
65
|
+
const queryParams = new URLSearchParams({ name });
|
|
66
|
+
const path = `/admin/collection/${encodeURIComponent(collectionId)}/hub/available?${queryParams}`;
|
|
67
|
+
return request(path);
|
|
68
|
+
}
|
|
69
|
+
collection.checkHubAvailability = checkHubAvailability;
|
|
70
|
+
/**
|
|
71
|
+
* Claim or rename the Hub subdomain for a collection (admin only).
|
|
72
|
+
*
|
|
73
|
+
* Maps `{hubName}.mysmartlinks.app` to the collection. If the collection
|
|
74
|
+
* already had a different hub name, the previous subdomain is released
|
|
75
|
+
* automatically.
|
|
76
|
+
*
|
|
77
|
+
* @param collectionId – Identifier of the collection
|
|
78
|
+
* @param hubName – The subdomain prefix to claim (e.g. "acme")
|
|
79
|
+
* @returns Promise resolving to the updated CollectionResponse (with hubName set)
|
|
80
|
+
* @throws ErrorResponse (400) on invalid/reserved name, (409) if already taken by another collection
|
|
81
|
+
*/
|
|
82
|
+
async function claimHub(collectionId, hubName) {
|
|
83
|
+
const path = `/admin/collection/${encodeURIComponent(collectionId)}/hub`;
|
|
84
|
+
return post(path, { hubName });
|
|
85
|
+
}
|
|
86
|
+
collection.claimHub = claimHub;
|
|
87
|
+
/**
|
|
88
|
+
* Register a custom domain for a collection and provision its managed
|
|
89
|
+
* certificate (admin only).
|
|
90
|
+
*
|
|
91
|
+
* @param collectionId – Identifier of the collection
|
|
92
|
+
* @param domain – The fully-qualified domain to register (e.g. "hub.acme.com")
|
|
93
|
+
* @param target – Which load balancer / certificate map to use. Defaults to
|
|
94
|
+
* `"smartlinks"` (the id.smartlinks.app load balancer). Pass `"hub"` to
|
|
95
|
+
* register a bring-your-own Hub domain.
|
|
96
|
+
* @returns Promise resolving when registration has been initiated
|
|
97
|
+
* @throws ErrorResponse if the request fails
|
|
98
|
+
*/
|
|
99
|
+
async function registerDomain(collectionId, domain, target = "smartlinks") {
|
|
100
|
+
const path = `/admin/collection/${encodeURIComponent(collectionId)}/domain`;
|
|
101
|
+
return post(path, { domain, target });
|
|
102
|
+
}
|
|
103
|
+
collection.registerDomain = registerDomain;
|
|
104
|
+
/**
|
|
105
|
+
* Get the managed-certificate status for a collection's custom domain (admin only).
|
|
106
|
+
* @param collectionId – Identifier of the collection
|
|
107
|
+
* @param target – Which domain to check: `"smartlinks"` (default, uses `redirectUrl`)
|
|
108
|
+
* or `"hub"` (uses `hubCustomDomain`)
|
|
109
|
+
* @returns Promise resolving to the certificate details
|
|
110
|
+
* @throws ErrorResponse (404) if the relevant domain is not set
|
|
111
|
+
*/
|
|
112
|
+
async function getDomainStatus(collectionId, target = "smartlinks") {
|
|
113
|
+
const queryParams = new URLSearchParams({ target });
|
|
114
|
+
const path = `/admin/collection/${encodeURIComponent(collectionId)}/domain?${queryParams}`;
|
|
115
|
+
return request(path);
|
|
116
|
+
}
|
|
117
|
+
collection.getDomainStatus = getDomainStatus;
|
|
40
118
|
/**
|
|
41
119
|
* Retrieve a specific settings group for a collection.
|
|
42
120
|
* Public reads return the public view of the settings group. If the stored payload contains
|
package/dist/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.15.
|
|
3
|
+
Version: 1.15.1 | Generated: 2026-06-13T08:46:42.914Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -3606,6 +3606,8 @@ interface Collection {
|
|
|
3606
3606
|
} // User roles mapping with user IDs as keys and role names as values
|
|
3607
3607
|
groupTags?: string[] // Array of group tag names
|
|
3608
3608
|
redirectUrl?: string // Whether the collection has a custom domain
|
|
3609
|
+
hubName?: string
|
|
3610
|
+
hubCustomDomain?: string
|
|
3609
3611
|
shortId: string, // The shortId of this collection
|
|
3610
3612
|
dark?: boolean // if dark mode is enabled for this collection
|
|
3611
3613
|
primaryColor?: string
|
|
@@ -3618,6 +3620,14 @@ interface Collection {
|
|
|
3618
3620
|
}
|
|
3619
3621
|
```
|
|
3620
3622
|
|
|
3623
|
+
**HubAvailabilityResponse** (interface)
|
|
3624
|
+
```typescript
|
|
3625
|
+
interface HubAvailabilityResponse {
|
|
3626
|
+
available: boolean
|
|
3627
|
+
domain: string
|
|
3628
|
+
}
|
|
3629
|
+
```
|
|
3630
|
+
|
|
3621
3631
|
**AppConfig** (interface)
|
|
3622
3632
|
```typescript
|
|
3623
3633
|
interface AppConfig {
|
|
@@ -3657,6 +3667,8 @@ interface AppsConfigResponse {
|
|
|
3657
3667
|
|
|
3658
3668
|
**CollectionUpdateRequest** = `Partial<Omit<Collection, 'id' | 'shortId'>>`
|
|
3659
3669
|
|
|
3670
|
+
**DomainTarget** = `"smartlinks" | "hub"`
|
|
3671
|
+
|
|
3660
3672
|
### common
|
|
3661
3673
|
|
|
3662
3674
|
**IdField** = `'userId' | 'contactId'`
|
|
@@ -8604,6 +8616,21 @@ Retrieves all Collections.
|
|
|
8604
8616
|
**getShortId**(shortId: string) → `Promise<CollectionResponse>`
|
|
8605
8617
|
Retrieve a collection by its shortId (public endpoint).
|
|
8606
8618
|
|
|
8619
|
+
**getByHub**() → `Promise<CollectionResponse>`
|
|
8620
|
+
Resolve the collection for the current Hub domain (public endpoint). The server derives the requesting domain from the request headers (`X-Source-Domain` / `X-Forwarded-Host` / `Host`), so no identifier is passed — this is the call a Hub frontend makes on load to find out which collection it is serving, whether it's reached via `{brand}.mysmartlinks.app` or a bring-your-own custom domain (e.g. `hub.acme.com`).
|
|
8621
|
+
|
|
8622
|
+
**checkHubAvailability**(collectionId: string, name: string) → `Promise<HubAvailabilityResponse>`
|
|
8623
|
+
Check whether a Hub subdomain name is available to claim (admin only).
|
|
8624
|
+
|
|
8625
|
+
**claimHub**(collectionId: string, hubName: string) → `Promise<CollectionResponse>`
|
|
8626
|
+
Claim or rename the Hub subdomain for a collection (admin only). Maps `{hubName}.mysmartlinks.app` to the collection. If the collection already had a different hub name, the previous subdomain is released automatically.
|
|
8627
|
+
|
|
8628
|
+
**registerDomain**(collectionId: string, domain: string, target: DomainTarget = "smartlinks") → `Promise<any>`
|
|
8629
|
+
Register a custom domain for a collection and provision its managed certificate (admin only). `"smartlinks"` (the id.smartlinks.app load balancer). Pass `"hub"` to register a bring-your-own Hub domain.
|
|
8630
|
+
|
|
8631
|
+
**getDomainStatus**(collectionId: string, target: DomainTarget = "smartlinks") → `Promise<any>`
|
|
8632
|
+
Get the managed-certificate status for a collection's custom domain (admin only). or `"hub"` (uses `hubCustomDomain`)
|
|
8633
|
+
|
|
8607
8634
|
**getSettings**(collectionId: string, settingGroup: string, admin?: boolean) → `Promise<any>`
|
|
8608
8635
|
Retrieve a specific settings group for a collection. Public reads return the public view of the settings group. If the stored payload contains a top-level `admin` object, that block is omitted from public responses and included when `admin === true`.
|
|
8609
8636
|
|
package/dist/http.js
CHANGED
|
@@ -91,7 +91,9 @@ const CACHE_TTL_RULES = [
|
|
|
91
91
|
// Sub-resources that change frequently — short TTLs, listed first
|
|
92
92
|
{ pattern: /\/proof\/[^/]*(\?.*)?$/i, ttlMs: 30000 },
|
|
93
93
|
{ pattern: /\/attestation\/[^/]*(\?.*)?$/i, ttlMs: 2 * 60000 },
|
|
94
|
-
// Slow-changing top-level resources — long TTLs, matched only when path ends at the ID
|
|
94
|
+
// Slow-changing top-level resources — long TTLs, matched only when path ends at the ID.
|
|
95
|
+
// getByHub maps a stable Hub domain → collection and matches the /collection rule below,
|
|
96
|
+
// so it inherits the same 1h caching as a collection detail.
|
|
95
97
|
{ pattern: /\/products?\/[^/]*(\?.*)?$/i, ttlMs: 60 * 60000 },
|
|
96
98
|
{ pattern: /\/variant\/[^/]*(\?.*)?$/i, ttlMs: 60 * 60000 },
|
|
97
99
|
{ pattern: /\/collection\/[^/]*(\?.*)?$/i, ttlMs: 60 * 60000 }, // 1 hour
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type { AppConfigOptions } from "./api/appConfiguration";
|
|
|
16
16
|
export type { AdditionalGtin, ISODateString, JsonPrimitive, JsonValue, ProductCreateRequest, ProductClaimCreateInput, ProductClaimCreateRequestBody, ProductClaimLookupInput, ProductFacetMap, ProductFacetValue, ProductImageUrlInput, ProductKey, ProductQueryRequest, ProductQueryResponse, ProductUpdateRequest, Product, ProductWriteInput, PublicProduct, } from "./types/product";
|
|
17
17
|
export type { TranslationLookupMode, TranslationContentType, TranslationQuality, TranslationItemStatus, TranslationContextValue, TranslationContext, TranslationLookupRequestBase, TranslationLookupSingleRequest, TranslationLookupBatchRequest, TranslationLookupRequest, TranslationLookupItem, TranslationLookupResponse, ResolvedTranslationItem, ResolvedTranslationResponse, TranslationHashOptions, TranslationResolveOptions, TranslationRecord, TranslationListParams, TranslationListResponse, TranslationUpdateRequest, } from "./types/translations";
|
|
18
18
|
export type { FacetBucket, FacetDefinition, FacetDefinitionWriteInput, FacetGetParams, FacetListParams, FacetListResponse, FacetQueryRequest, FacetQueryResponse, FacetValue, FacetValueDefinition, FacetValueGetParams, FacetValueListParams, FacetValueListResponse, FacetValueResponse, FacetValueWriteInput, PublicFacetListParams, } from "./types/facets";
|
|
19
|
-
export type { Collection, CollectionResponse, CollectionCreateRequest, CollectionUpdateRequest, } from "./types/collection";
|
|
19
|
+
export type { Collection, CollectionResponse, CollectionCreateRequest, CollectionUpdateRequest, DomainTarget, HubAvailabilityResponse, } from "./types/collection";
|
|
20
20
|
export type { Proof, ProofResponse, ProofCreateRequest, ProofUpdateRequest, ProofClaimRequest, } from "./types/proof";
|
|
21
21
|
export type { QrShortCodeLookupResponse, } from "./types/qr";
|
|
22
22
|
export type { ReverseTagLookupParams, ReverseTagLookupResponse, } from "./types/tags";
|
package/dist/openapi.yaml
CHANGED
|
@@ -3337,6 +3337,63 @@ paths:
|
|
|
3337
3337
|
description: Unauthorized
|
|
3338
3338
|
404:
|
|
3339
3339
|
description: Not found
|
|
3340
|
+
/admin/collection/{collectionId}/domain:
|
|
3341
|
+
get:
|
|
3342
|
+
tags:
|
|
3343
|
+
- collection
|
|
3344
|
+
summary: "Get the managed-certificate status for a collection's custom domain (admin only)."
|
|
3345
|
+
operationId: collection_getDomainStatus
|
|
3346
|
+
security:
|
|
3347
|
+
- bearerAuth: []
|
|
3348
|
+
parameters:
|
|
3349
|
+
- name: collectionId
|
|
3350
|
+
in: path
|
|
3351
|
+
required: true
|
|
3352
|
+
schema:
|
|
3353
|
+
type: string
|
|
3354
|
+
responses:
|
|
3355
|
+
200:
|
|
3356
|
+
description: Success
|
|
3357
|
+
content:
|
|
3358
|
+
application/json:
|
|
3359
|
+
schema: {}
|
|
3360
|
+
400:
|
|
3361
|
+
description: Bad request
|
|
3362
|
+
401:
|
|
3363
|
+
description: Unauthorized
|
|
3364
|
+
404:
|
|
3365
|
+
description: Not found
|
|
3366
|
+
post:
|
|
3367
|
+
tags:
|
|
3368
|
+
- collection
|
|
3369
|
+
summary: Register a custom domain for a collection and provision its managed certificate (admin only).
|
|
3370
|
+
operationId: collection_registerDomain
|
|
3371
|
+
security:
|
|
3372
|
+
- bearerAuth: []
|
|
3373
|
+
parameters:
|
|
3374
|
+
- name: collectionId
|
|
3375
|
+
in: path
|
|
3376
|
+
required: true
|
|
3377
|
+
schema:
|
|
3378
|
+
type: string
|
|
3379
|
+
responses:
|
|
3380
|
+
200:
|
|
3381
|
+
description: Success
|
|
3382
|
+
content:
|
|
3383
|
+
application/json:
|
|
3384
|
+
schema: {}
|
|
3385
|
+
400:
|
|
3386
|
+
description: Bad request
|
|
3387
|
+
401:
|
|
3388
|
+
description: Unauthorized
|
|
3389
|
+
404:
|
|
3390
|
+
description: Not found
|
|
3391
|
+
requestBody:
|
|
3392
|
+
required: true
|
|
3393
|
+
content:
|
|
3394
|
+
application/json:
|
|
3395
|
+
schema:
|
|
3396
|
+
$ref: "#/components/schemas/DomainTarget"
|
|
3340
3397
|
/admin/collection/{collectionId}/facets:
|
|
3341
3398
|
get:
|
|
3342
3399
|
tags:
|
|
@@ -3871,6 +3928,60 @@ paths:
|
|
|
3871
3928
|
description: Unauthorized
|
|
3872
3929
|
404:
|
|
3873
3930
|
description: Not found
|
|
3931
|
+
/admin/collection/{collectionId}/hub:
|
|
3932
|
+
post:
|
|
3933
|
+
tags:
|
|
3934
|
+
- collection
|
|
3935
|
+
summary: Claim or rename the Hub subdomain for a collection (admin only).
|
|
3936
|
+
operationId: collection_claimHub
|
|
3937
|
+
security:
|
|
3938
|
+
- bearerAuth: []
|
|
3939
|
+
parameters:
|
|
3940
|
+
- name: collectionId
|
|
3941
|
+
in: path
|
|
3942
|
+
required: true
|
|
3943
|
+
schema:
|
|
3944
|
+
type: string
|
|
3945
|
+
responses:
|
|
3946
|
+
200:
|
|
3947
|
+
description: Success
|
|
3948
|
+
content:
|
|
3949
|
+
application/json:
|
|
3950
|
+
schema:
|
|
3951
|
+
$ref: "#/components/schemas/CollectionResponse"
|
|
3952
|
+
400:
|
|
3953
|
+
description: Bad request
|
|
3954
|
+
401:
|
|
3955
|
+
description: Unauthorized
|
|
3956
|
+
404:
|
|
3957
|
+
description: Not found
|
|
3958
|
+
/admin/collection/{collectionId}/hub/available:
|
|
3959
|
+
get:
|
|
3960
|
+
tags:
|
|
3961
|
+
- collection
|
|
3962
|
+
summary: Check whether a Hub subdomain name is available to claim (admin only).
|
|
3963
|
+
operationId: collection_checkHubAvailability
|
|
3964
|
+
security:
|
|
3965
|
+
- bearerAuth: []
|
|
3966
|
+
parameters:
|
|
3967
|
+
- name: collectionId
|
|
3968
|
+
in: path
|
|
3969
|
+
required: true
|
|
3970
|
+
schema:
|
|
3971
|
+
type: string
|
|
3972
|
+
responses:
|
|
3973
|
+
200:
|
|
3974
|
+
description: Success
|
|
3975
|
+
content:
|
|
3976
|
+
application/json:
|
|
3977
|
+
schema:
|
|
3978
|
+
$ref: "#/components/schemas/HubAvailabilityResponse"
|
|
3979
|
+
400:
|
|
3980
|
+
description: Bad request
|
|
3981
|
+
401:
|
|
3982
|
+
description: Unauthorized
|
|
3983
|
+
404:
|
|
3984
|
+
description: Not found
|
|
3874
3985
|
/admin/collection/{collectionId}/interactions:
|
|
3875
3986
|
get:
|
|
3876
3987
|
tags:
|
|
@@ -9205,6 +9316,26 @@ paths:
|
|
|
9205
9316
|
application/json:
|
|
9206
9317
|
schema:
|
|
9207
9318
|
$ref: "#/components/schemas/RequestUploadTokenOptions"
|
|
9319
|
+
/public/collection/getByHub:
|
|
9320
|
+
get:
|
|
9321
|
+
tags:
|
|
9322
|
+
- collection
|
|
9323
|
+
summary: Resolve the collection for the current Hub domain (public endpoint).
|
|
9324
|
+
operationId: collection_getByHub
|
|
9325
|
+
security: []
|
|
9326
|
+
responses:
|
|
9327
|
+
200:
|
|
9328
|
+
description: Success
|
|
9329
|
+
content:
|
|
9330
|
+
application/json:
|
|
9331
|
+
schema:
|
|
9332
|
+
$ref: "#/components/schemas/CollectionResponse"
|
|
9333
|
+
400:
|
|
9334
|
+
description: Bad request
|
|
9335
|
+
401:
|
|
9336
|
+
description: Unauthorized
|
|
9337
|
+
404:
|
|
9338
|
+
description: Not found
|
|
9208
9339
|
/public/collection/getShortId/{shortId}:
|
|
9209
9340
|
get:
|
|
9210
9341
|
tags:
|
|
@@ -18908,6 +19039,10 @@ components:
|
|
|
18908
19039
|
type: string
|
|
18909
19040
|
redirectUrl:
|
|
18910
19041
|
type: string
|
|
19042
|
+
hubName:
|
|
19043
|
+
type: string
|
|
19044
|
+
hubCustomDomain:
|
|
19045
|
+
type: string
|
|
18911
19046
|
shortId:
|
|
18912
19047
|
type: string
|
|
18913
19048
|
dark:
|
|
@@ -18942,6 +19077,16 @@ components:
|
|
|
18942
19077
|
- variants
|
|
18943
19078
|
- batches
|
|
18944
19079
|
- defaultAuthKitId
|
|
19080
|
+
HubAvailabilityResponse:
|
|
19081
|
+
type: object
|
|
19082
|
+
properties:
|
|
19083
|
+
available:
|
|
19084
|
+
type: boolean
|
|
19085
|
+
domain:
|
|
19086
|
+
type: string
|
|
19087
|
+
required:
|
|
19088
|
+
- available
|
|
19089
|
+
- domain
|
|
18945
19090
|
AppConfig:
|
|
18946
19091
|
type: object
|
|
18947
19092
|
properties:
|
|
@@ -41,6 +41,10 @@ export interface Collection {
|
|
|
41
41
|
groupTags?: string[];
|
|
42
42
|
/** Whether the collection has a custom domain */
|
|
43
43
|
redirectUrl?: string;
|
|
44
|
+
/** The claimed Hub subdomain prefix (e.g. "acme" → acme.mysmartlinks.app) */
|
|
45
|
+
hubName?: string;
|
|
46
|
+
/** The collection's bring-your-own custom Hub domain (e.g. "hub.acme.com") */
|
|
47
|
+
hubCustomDomain?: string;
|
|
44
48
|
/** The shortId of this collection */
|
|
45
49
|
shortId: string;
|
|
46
50
|
/** if dark mode is enabled for this collection */
|
|
@@ -59,6 +63,21 @@ export interface Collection {
|
|
|
59
63
|
export type CollectionResponse = Collection;
|
|
60
64
|
export type CollectionCreateRequest = Omit<Collection, 'id' | 'shortId'>;
|
|
61
65
|
export type CollectionUpdateRequest = Partial<Omit<Collection, 'id' | 'shortId'>>;
|
|
66
|
+
/**
|
|
67
|
+
* Which load balancer / certificate map a custom domain registration targets.
|
|
68
|
+
* - `"smartlinks"` (default): the id.smartlinks.app load balancer (legacy behaviour)
|
|
69
|
+
* - `"hub"`: the SmartLinks Hub load balancer
|
|
70
|
+
*/
|
|
71
|
+
export type DomainTarget = "smartlinks" | "hub";
|
|
72
|
+
/**
|
|
73
|
+
* Response from checking whether a Hub subdomain name is available.
|
|
74
|
+
*/
|
|
75
|
+
export interface HubAvailabilityResponse {
|
|
76
|
+
/** Whether the name can be claimed by this collection */
|
|
77
|
+
available: boolean;
|
|
78
|
+
/** The full domain that was checked (e.g. "acme.mysmartlinks.app") */
|
|
79
|
+
domain: string;
|
|
80
|
+
}
|
|
62
81
|
/**
|
|
63
82
|
* Configuration for an app module within a collection.
|
|
64
83
|
*/
|
package/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.15.
|
|
3
|
+
Version: 1.15.1 | Generated: 2026-06-13T08:46:42.914Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -3606,6 +3606,8 @@ interface Collection {
|
|
|
3606
3606
|
} // User roles mapping with user IDs as keys and role names as values
|
|
3607
3607
|
groupTags?: string[] // Array of group tag names
|
|
3608
3608
|
redirectUrl?: string // Whether the collection has a custom domain
|
|
3609
|
+
hubName?: string
|
|
3610
|
+
hubCustomDomain?: string
|
|
3609
3611
|
shortId: string, // The shortId of this collection
|
|
3610
3612
|
dark?: boolean // if dark mode is enabled for this collection
|
|
3611
3613
|
primaryColor?: string
|
|
@@ -3618,6 +3620,14 @@ interface Collection {
|
|
|
3618
3620
|
}
|
|
3619
3621
|
```
|
|
3620
3622
|
|
|
3623
|
+
**HubAvailabilityResponse** (interface)
|
|
3624
|
+
```typescript
|
|
3625
|
+
interface HubAvailabilityResponse {
|
|
3626
|
+
available: boolean
|
|
3627
|
+
domain: string
|
|
3628
|
+
}
|
|
3629
|
+
```
|
|
3630
|
+
|
|
3621
3631
|
**AppConfig** (interface)
|
|
3622
3632
|
```typescript
|
|
3623
3633
|
interface AppConfig {
|
|
@@ -3657,6 +3667,8 @@ interface AppsConfigResponse {
|
|
|
3657
3667
|
|
|
3658
3668
|
**CollectionUpdateRequest** = `Partial<Omit<Collection, 'id' | 'shortId'>>`
|
|
3659
3669
|
|
|
3670
|
+
**DomainTarget** = `"smartlinks" | "hub"`
|
|
3671
|
+
|
|
3660
3672
|
### common
|
|
3661
3673
|
|
|
3662
3674
|
**IdField** = `'userId' | 'contactId'`
|
|
@@ -8604,6 +8616,21 @@ Retrieves all Collections.
|
|
|
8604
8616
|
**getShortId**(shortId: string) → `Promise<CollectionResponse>`
|
|
8605
8617
|
Retrieve a collection by its shortId (public endpoint).
|
|
8606
8618
|
|
|
8619
|
+
**getByHub**() → `Promise<CollectionResponse>`
|
|
8620
|
+
Resolve the collection for the current Hub domain (public endpoint). The server derives the requesting domain from the request headers (`X-Source-Domain` / `X-Forwarded-Host` / `Host`), so no identifier is passed — this is the call a Hub frontend makes on load to find out which collection it is serving, whether it's reached via `{brand}.mysmartlinks.app` or a bring-your-own custom domain (e.g. `hub.acme.com`).
|
|
8621
|
+
|
|
8622
|
+
**checkHubAvailability**(collectionId: string, name: string) → `Promise<HubAvailabilityResponse>`
|
|
8623
|
+
Check whether a Hub subdomain name is available to claim (admin only).
|
|
8624
|
+
|
|
8625
|
+
**claimHub**(collectionId: string, hubName: string) → `Promise<CollectionResponse>`
|
|
8626
|
+
Claim or rename the Hub subdomain for a collection (admin only). Maps `{hubName}.mysmartlinks.app` to the collection. If the collection already had a different hub name, the previous subdomain is released automatically.
|
|
8627
|
+
|
|
8628
|
+
**registerDomain**(collectionId: string, domain: string, target: DomainTarget = "smartlinks") → `Promise<any>`
|
|
8629
|
+
Register a custom domain for a collection and provision its managed certificate (admin only). `"smartlinks"` (the id.smartlinks.app load balancer). Pass `"hub"` to register a bring-your-own Hub domain.
|
|
8630
|
+
|
|
8631
|
+
**getDomainStatus**(collectionId: string, target: DomainTarget = "smartlinks") → `Promise<any>`
|
|
8632
|
+
Get the managed-certificate status for a collection's custom domain (admin only). or `"hub"` (uses `hubCustomDomain`)
|
|
8633
|
+
|
|
8607
8634
|
**getSettings**(collectionId: string, settingGroup: string, admin?: boolean) → `Promise<any>`
|
|
8608
8635
|
Retrieve a specific settings group for a collection. Public reads return the public view of the settings group. If the stored payload contains a top-level `admin` object, that block is omitted from public responses and included when `admin === true`.
|
|
8609
8636
|
|
package/openapi.yaml
CHANGED
|
@@ -3337,6 +3337,63 @@ paths:
|
|
|
3337
3337
|
description: Unauthorized
|
|
3338
3338
|
404:
|
|
3339
3339
|
description: Not found
|
|
3340
|
+
/admin/collection/{collectionId}/domain:
|
|
3341
|
+
get:
|
|
3342
|
+
tags:
|
|
3343
|
+
- collection
|
|
3344
|
+
summary: "Get the managed-certificate status for a collection's custom domain (admin only)."
|
|
3345
|
+
operationId: collection_getDomainStatus
|
|
3346
|
+
security:
|
|
3347
|
+
- bearerAuth: []
|
|
3348
|
+
parameters:
|
|
3349
|
+
- name: collectionId
|
|
3350
|
+
in: path
|
|
3351
|
+
required: true
|
|
3352
|
+
schema:
|
|
3353
|
+
type: string
|
|
3354
|
+
responses:
|
|
3355
|
+
200:
|
|
3356
|
+
description: Success
|
|
3357
|
+
content:
|
|
3358
|
+
application/json:
|
|
3359
|
+
schema: {}
|
|
3360
|
+
400:
|
|
3361
|
+
description: Bad request
|
|
3362
|
+
401:
|
|
3363
|
+
description: Unauthorized
|
|
3364
|
+
404:
|
|
3365
|
+
description: Not found
|
|
3366
|
+
post:
|
|
3367
|
+
tags:
|
|
3368
|
+
- collection
|
|
3369
|
+
summary: Register a custom domain for a collection and provision its managed certificate (admin only).
|
|
3370
|
+
operationId: collection_registerDomain
|
|
3371
|
+
security:
|
|
3372
|
+
- bearerAuth: []
|
|
3373
|
+
parameters:
|
|
3374
|
+
- name: collectionId
|
|
3375
|
+
in: path
|
|
3376
|
+
required: true
|
|
3377
|
+
schema:
|
|
3378
|
+
type: string
|
|
3379
|
+
responses:
|
|
3380
|
+
200:
|
|
3381
|
+
description: Success
|
|
3382
|
+
content:
|
|
3383
|
+
application/json:
|
|
3384
|
+
schema: {}
|
|
3385
|
+
400:
|
|
3386
|
+
description: Bad request
|
|
3387
|
+
401:
|
|
3388
|
+
description: Unauthorized
|
|
3389
|
+
404:
|
|
3390
|
+
description: Not found
|
|
3391
|
+
requestBody:
|
|
3392
|
+
required: true
|
|
3393
|
+
content:
|
|
3394
|
+
application/json:
|
|
3395
|
+
schema:
|
|
3396
|
+
$ref: "#/components/schemas/DomainTarget"
|
|
3340
3397
|
/admin/collection/{collectionId}/facets:
|
|
3341
3398
|
get:
|
|
3342
3399
|
tags:
|
|
@@ -3871,6 +3928,60 @@ paths:
|
|
|
3871
3928
|
description: Unauthorized
|
|
3872
3929
|
404:
|
|
3873
3930
|
description: Not found
|
|
3931
|
+
/admin/collection/{collectionId}/hub:
|
|
3932
|
+
post:
|
|
3933
|
+
tags:
|
|
3934
|
+
- collection
|
|
3935
|
+
summary: Claim or rename the Hub subdomain for a collection (admin only).
|
|
3936
|
+
operationId: collection_claimHub
|
|
3937
|
+
security:
|
|
3938
|
+
- bearerAuth: []
|
|
3939
|
+
parameters:
|
|
3940
|
+
- name: collectionId
|
|
3941
|
+
in: path
|
|
3942
|
+
required: true
|
|
3943
|
+
schema:
|
|
3944
|
+
type: string
|
|
3945
|
+
responses:
|
|
3946
|
+
200:
|
|
3947
|
+
description: Success
|
|
3948
|
+
content:
|
|
3949
|
+
application/json:
|
|
3950
|
+
schema:
|
|
3951
|
+
$ref: "#/components/schemas/CollectionResponse"
|
|
3952
|
+
400:
|
|
3953
|
+
description: Bad request
|
|
3954
|
+
401:
|
|
3955
|
+
description: Unauthorized
|
|
3956
|
+
404:
|
|
3957
|
+
description: Not found
|
|
3958
|
+
/admin/collection/{collectionId}/hub/available:
|
|
3959
|
+
get:
|
|
3960
|
+
tags:
|
|
3961
|
+
- collection
|
|
3962
|
+
summary: Check whether a Hub subdomain name is available to claim (admin only).
|
|
3963
|
+
operationId: collection_checkHubAvailability
|
|
3964
|
+
security:
|
|
3965
|
+
- bearerAuth: []
|
|
3966
|
+
parameters:
|
|
3967
|
+
- name: collectionId
|
|
3968
|
+
in: path
|
|
3969
|
+
required: true
|
|
3970
|
+
schema:
|
|
3971
|
+
type: string
|
|
3972
|
+
responses:
|
|
3973
|
+
200:
|
|
3974
|
+
description: Success
|
|
3975
|
+
content:
|
|
3976
|
+
application/json:
|
|
3977
|
+
schema:
|
|
3978
|
+
$ref: "#/components/schemas/HubAvailabilityResponse"
|
|
3979
|
+
400:
|
|
3980
|
+
description: Bad request
|
|
3981
|
+
401:
|
|
3982
|
+
description: Unauthorized
|
|
3983
|
+
404:
|
|
3984
|
+
description: Not found
|
|
3874
3985
|
/admin/collection/{collectionId}/interactions:
|
|
3875
3986
|
get:
|
|
3876
3987
|
tags:
|
|
@@ -9205,6 +9316,26 @@ paths:
|
|
|
9205
9316
|
application/json:
|
|
9206
9317
|
schema:
|
|
9207
9318
|
$ref: "#/components/schemas/RequestUploadTokenOptions"
|
|
9319
|
+
/public/collection/getByHub:
|
|
9320
|
+
get:
|
|
9321
|
+
tags:
|
|
9322
|
+
- collection
|
|
9323
|
+
summary: Resolve the collection for the current Hub domain (public endpoint).
|
|
9324
|
+
operationId: collection_getByHub
|
|
9325
|
+
security: []
|
|
9326
|
+
responses:
|
|
9327
|
+
200:
|
|
9328
|
+
description: Success
|
|
9329
|
+
content:
|
|
9330
|
+
application/json:
|
|
9331
|
+
schema:
|
|
9332
|
+
$ref: "#/components/schemas/CollectionResponse"
|
|
9333
|
+
400:
|
|
9334
|
+
description: Bad request
|
|
9335
|
+
401:
|
|
9336
|
+
description: Unauthorized
|
|
9337
|
+
404:
|
|
9338
|
+
description: Not found
|
|
9208
9339
|
/public/collection/getShortId/{shortId}:
|
|
9209
9340
|
get:
|
|
9210
9341
|
tags:
|
|
@@ -18908,6 +19039,10 @@ components:
|
|
|
18908
19039
|
type: string
|
|
18909
19040
|
redirectUrl:
|
|
18910
19041
|
type: string
|
|
19042
|
+
hubName:
|
|
19043
|
+
type: string
|
|
19044
|
+
hubCustomDomain:
|
|
19045
|
+
type: string
|
|
18911
19046
|
shortId:
|
|
18912
19047
|
type: string
|
|
18913
19048
|
dark:
|
|
@@ -18942,6 +19077,16 @@ components:
|
|
|
18942
19077
|
- variants
|
|
18943
19078
|
- batches
|
|
18944
19079
|
- defaultAuthKitId
|
|
19080
|
+
HubAvailabilityResponse:
|
|
19081
|
+
type: object
|
|
19082
|
+
properties:
|
|
19083
|
+
available:
|
|
19084
|
+
type: boolean
|
|
19085
|
+
domain:
|
|
19086
|
+
type: string
|
|
19087
|
+
required:
|
|
19088
|
+
- available
|
|
19089
|
+
- domain
|
|
18945
19090
|
AppConfig:
|
|
18946
19091
|
type: object
|
|
18947
19092
|
properties:
|