@proveanything/smartlinks 1.8.5 → 1.8.7
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/appConfiguration.d.ts +41 -10
- package/dist/api/appConfiguration.js +31 -7
- package/dist/api/collection.d.ts +8 -1
- package/dist/api/collection.js +8 -1
- package/dist/docs/API_SUMMARY.md +273 -263
- package/dist/docs/ai-guide-template.md +21 -0
- package/dist/docs/app-data-storage.md +99 -10
- package/dist/docs/overview.md +32 -0
- package/dist/openapi.yaml +3 -3
- package/docs/API_SUMMARY.md +273 -263
- package/docs/ai-guide-template.md +21 -0
- package/docs/app-data-storage.md +99 -10
- package/docs/overview.md +32 -0
- package/openapi.yaml +3 -3
- package/package.json +1 -1
|
@@ -17,11 +17,18 @@ export type AppConfigOptions = {
|
|
|
17
17
|
batchId?: string;
|
|
18
18
|
/** Item ID - required for getDataItem/deleteDataItem */
|
|
19
19
|
itemId?: string;
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Use admin endpoints instead of public.
|
|
22
|
+
* This selects which endpoint is called; it does not by itself make root-level config fields private.
|
|
23
|
+
*/
|
|
21
24
|
admin?: boolean;
|
|
22
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Configuration object for setConfig.
|
|
27
|
+
* For admin-only values in app config, store them under a top-level `admin` object.
|
|
28
|
+
* Public reads return the root config but omit `config.admin`.
|
|
29
|
+
*/
|
|
23
30
|
config?: any;
|
|
24
|
-
/** Data object for setDataItem */
|
|
31
|
+
/** Data object for setDataItem. Best for small keyed scoped documents rather than richer app domain objects. */
|
|
25
32
|
data?: any;
|
|
26
33
|
};
|
|
27
34
|
/**
|
|
@@ -152,6 +159,8 @@ export declare namespace userAppData {
|
|
|
152
159
|
/**
|
|
153
160
|
* Collection/Product-scoped app configuration.
|
|
154
161
|
* This is admin-managed configuration that applies to all users within the scope.
|
|
162
|
+
* Root-level config fields are typically part of the public view; if you need admin-only
|
|
163
|
+
* values, store them under a top-level `admin` object so public reads can omit them.
|
|
155
164
|
*
|
|
156
165
|
* @example
|
|
157
166
|
* ```typescript
|
|
@@ -180,7 +189,10 @@ export declare namespace userAppData {
|
|
|
180
189
|
*/
|
|
181
190
|
export declare namespace appConfiguration {
|
|
182
191
|
/**
|
|
183
|
-
|
|
192
|
+
* Get app configuration for a collection/product scope.
|
|
193
|
+
* Public reads return the public view of the config. If the stored config contains a
|
|
194
|
+
* top-level `admin` object, that block is omitted from public responses and included
|
|
195
|
+
* when `opts.admin === true`.
|
|
184
196
|
*
|
|
185
197
|
* @param opts - Configuration options including appId and scope (collectionId, productId, etc.)
|
|
186
198
|
* @returns The configuration object
|
|
@@ -228,8 +240,10 @@ export declare namespace appConfiguration {
|
|
|
228
240
|
*/
|
|
229
241
|
function listWidgetInstances(opts: Omit<GetWidgetInstanceOptions, 'widgetId'>): Promise<WidgetInstanceSummary[]>;
|
|
230
242
|
/**
|
|
231
|
-
|
|
232
|
-
|
|
243
|
+
* Set app configuration for a collection/product scope.
|
|
244
|
+
* Requires admin authentication.
|
|
245
|
+
* Writing through the admin endpoint does not make every root-level field private.
|
|
246
|
+
* Use `config.admin` for confidential values that should only be returned on admin reads.
|
|
233
247
|
*
|
|
234
248
|
* @param opts - Configuration options including appId, scope, and config data
|
|
235
249
|
* @returns The saved configuration
|
|
@@ -262,7 +276,13 @@ export declare namespace appConfiguration {
|
|
|
262
276
|
*/
|
|
263
277
|
function deleteConfig(opts: AppConfigOptions): Promise<void>;
|
|
264
278
|
/**
|
|
265
|
-
|
|
279
|
+
* Get all keyed data items for an app within a scope.
|
|
280
|
+
* Best for a small set of standalone documents such as FAQs, menus, lookup tables,
|
|
281
|
+
* or content fragments where the caller typically knows the item IDs.
|
|
282
|
+
*
|
|
283
|
+
* If you are modelling richer app entities that need filtering, lifecycle fields,
|
|
284
|
+
* visibility, ownership, or relationships, prefer `app.records`, `app.cases`,
|
|
285
|
+
* or `app.threads` instead.
|
|
266
286
|
*
|
|
267
287
|
* @param opts - Options including appId and scope (collectionId, productId, etc.)
|
|
268
288
|
* @returns Array of data items
|
|
@@ -278,7 +298,11 @@ export declare namespace appConfiguration {
|
|
|
278
298
|
*/
|
|
279
299
|
function getData(opts: AppConfigOptions): Promise<any[]>;
|
|
280
300
|
/**
|
|
281
|
-
|
|
301
|
+
* Get a single keyed data item by ID within a scope.
|
|
302
|
+
* This is ideal when you already know the exact ID of a simple scoped document.
|
|
303
|
+
*
|
|
304
|
+
* For richer domain objects that users browse or query, prefer `app.records`,
|
|
305
|
+
* `app.cases`, or `app.threads`.
|
|
282
306
|
*
|
|
283
307
|
* @param opts - Options including appId, scope, and itemId
|
|
284
308
|
* @returns The data item
|
|
@@ -295,8 +319,15 @@ export declare namespace appConfiguration {
|
|
|
295
319
|
*/
|
|
296
320
|
function getDataItem(opts: AppConfigOptions): Promise<any>;
|
|
297
321
|
/**
|
|
298
|
-
|
|
322
|
+
* Set/create a keyed data item within a scope.
|
|
299
323
|
* Requires admin authentication.
|
|
324
|
+
*
|
|
325
|
+
* Use this for simple scoped documents attached to a collection/product/variant/batch,
|
|
326
|
+
* especially when you want a small number of items with stable IDs.
|
|
327
|
+
*
|
|
328
|
+
* Do not treat this as the default write path for every app-owned entity. If the data
|
|
329
|
+
* starts behaving like a real object with lifecycle, filtering, visibility, ownership,
|
|
330
|
+
* history, or relationships, prefer `app.records`, `app.cases`, or `app.threads`.
|
|
300
331
|
*
|
|
301
332
|
* @param opts - Options including appId, scope, and data
|
|
302
333
|
* @returns The saved data item
|
|
@@ -314,7 +345,7 @@ export declare namespace appConfiguration {
|
|
|
314
345
|
*/
|
|
315
346
|
function setDataItem(opts: AppConfigOptions): Promise<any>;
|
|
316
347
|
/**
|
|
317
|
-
|
|
348
|
+
* Delete a keyed data item by ID within a scope.
|
|
318
349
|
* Requires admin authentication.
|
|
319
350
|
*
|
|
320
351
|
* @param opts - Options including appId, scope, and itemId
|
|
@@ -200,6 +200,8 @@ export var userAppData;
|
|
|
200
200
|
/**
|
|
201
201
|
* Collection/Product-scoped app configuration.
|
|
202
202
|
* This is admin-managed configuration that applies to all users within the scope.
|
|
203
|
+
* Root-level config fields are typically part of the public view; if you need admin-only
|
|
204
|
+
* values, store them under a top-level `admin` object so public reads can omit them.
|
|
203
205
|
*
|
|
204
206
|
* @example
|
|
205
207
|
* ```typescript
|
|
@@ -229,7 +231,10 @@ export var userAppData;
|
|
|
229
231
|
export var appConfiguration;
|
|
230
232
|
(function (appConfiguration) {
|
|
231
233
|
/**
|
|
232
|
-
|
|
234
|
+
* Get app configuration for a collection/product scope.
|
|
235
|
+
* Public reads return the public view of the config. If the stored config contains a
|
|
236
|
+
* top-level `admin` object, that block is omitted from public responses and included
|
|
237
|
+
* when `opts.admin === true`.
|
|
233
238
|
*
|
|
234
239
|
* @param opts - Configuration options including appId and scope (collectionId, productId, etc.)
|
|
235
240
|
* @returns The configuration object
|
|
@@ -309,8 +314,10 @@ export var appConfiguration;
|
|
|
309
314
|
}
|
|
310
315
|
appConfiguration.listWidgetInstances = listWidgetInstances;
|
|
311
316
|
/**
|
|
312
|
-
|
|
313
|
-
|
|
317
|
+
* Set app configuration for a collection/product scope.
|
|
318
|
+
* Requires admin authentication.
|
|
319
|
+
* Writing through the admin endpoint does not make every root-level field private.
|
|
320
|
+
* Use `config.admin` for confidential values that should only be returned on admin reads.
|
|
314
321
|
*
|
|
315
322
|
* @param opts - Configuration options including appId, scope, and config data
|
|
316
323
|
* @returns The saved configuration
|
|
@@ -351,7 +358,13 @@ export var appConfiguration;
|
|
|
351
358
|
}
|
|
352
359
|
appConfiguration.deleteConfig = deleteConfig;
|
|
353
360
|
/**
|
|
354
|
-
|
|
361
|
+
* Get all keyed data items for an app within a scope.
|
|
362
|
+
* Best for a small set of standalone documents such as FAQs, menus, lookup tables,
|
|
363
|
+
* or content fragments where the caller typically knows the item IDs.
|
|
364
|
+
*
|
|
365
|
+
* If you are modelling richer app entities that need filtering, lifecycle fields,
|
|
366
|
+
* visibility, ownership, or relationships, prefer `app.records`, `app.cases`,
|
|
367
|
+
* or `app.threads` instead.
|
|
355
368
|
*
|
|
356
369
|
* @param opts - Options including appId and scope (collectionId, productId, etc.)
|
|
357
370
|
* @returns Array of data items
|
|
@@ -371,7 +384,11 @@ export var appConfiguration;
|
|
|
371
384
|
}
|
|
372
385
|
appConfiguration.getData = getData;
|
|
373
386
|
/**
|
|
374
|
-
|
|
387
|
+
* Get a single keyed data item by ID within a scope.
|
|
388
|
+
* This is ideal when you already know the exact ID of a simple scoped document.
|
|
389
|
+
*
|
|
390
|
+
* For richer domain objects that users browse or query, prefer `app.records`,
|
|
391
|
+
* `app.cases`, or `app.threads`.
|
|
375
392
|
*
|
|
376
393
|
* @param opts - Options including appId, scope, and itemId
|
|
377
394
|
* @returns The data item
|
|
@@ -394,8 +411,15 @@ export var appConfiguration;
|
|
|
394
411
|
}
|
|
395
412
|
appConfiguration.getDataItem = getDataItem;
|
|
396
413
|
/**
|
|
397
|
-
|
|
414
|
+
* Set/create a keyed data item within a scope.
|
|
398
415
|
* Requires admin authentication.
|
|
416
|
+
*
|
|
417
|
+
* Use this for simple scoped documents attached to a collection/product/variant/batch,
|
|
418
|
+
* especially when you want a small number of items with stable IDs.
|
|
419
|
+
*
|
|
420
|
+
* Do not treat this as the default write path for every app-owned entity. If the data
|
|
421
|
+
* starts behaving like a real object with lifecycle, filtering, visibility, ownership,
|
|
422
|
+
* history, or relationships, prefer `app.records`, `app.cases`, or `app.threads`.
|
|
399
423
|
*
|
|
400
424
|
* @param opts - Options including appId, scope, and data
|
|
401
425
|
* @returns The saved data item
|
|
@@ -417,7 +441,7 @@ export var appConfiguration;
|
|
|
417
441
|
}
|
|
418
442
|
appConfiguration.setDataItem = setDataItem;
|
|
419
443
|
/**
|
|
420
|
-
|
|
444
|
+
* Delete a keyed data item by ID within a scope.
|
|
421
445
|
* Requires admin authentication.
|
|
422
446
|
*
|
|
423
447
|
* @param opts - Options including appId, scope, and itemId
|
package/dist/api/collection.d.ts
CHANGED
|
@@ -22,9 +22,13 @@ export declare namespace collection {
|
|
|
22
22
|
*/
|
|
23
23
|
function getShortId(shortId: string): Promise<CollectionResponse>;
|
|
24
24
|
/**
|
|
25
|
-
* Retrieve a specific settings group for a collection
|
|
25
|
+
* Retrieve a specific settings group for a collection.
|
|
26
|
+
* Public reads return the public view of the settings group. If the stored payload contains
|
|
27
|
+
* a top-level `admin` object, that block is omitted from public responses and included when
|
|
28
|
+
* `admin === true`.
|
|
26
29
|
* @param collectionId – Identifier of the collection
|
|
27
30
|
* @param settingGroup – The settings group name
|
|
31
|
+
* @param admin – If true, use the admin endpoint and include the admin-only settings block
|
|
28
32
|
* @returns Promise resolving to the settings object
|
|
29
33
|
*/
|
|
30
34
|
function getSettings(collectionId: string, settingGroup: string, admin?: boolean): Promise<any>;
|
|
@@ -37,6 +41,9 @@ export declare namespace collection {
|
|
|
37
41
|
function getAppsConfig(collectionId: string): Promise<AppsConfigResponse>;
|
|
38
42
|
/**
|
|
39
43
|
* Update a specific settings group for a collection (admin endpoint).
|
|
44
|
+
* This writes through the admin endpoint, but root-level fields are still part of the public
|
|
45
|
+
* settings payload. Put confidential values under `settings.admin` if they should only be
|
|
46
|
+
* returned on admin reads.
|
|
40
47
|
* @param collectionId – Identifier of the collection
|
|
41
48
|
* @param settingGroup – The settings group name
|
|
42
49
|
* @param settings – The settings payload to persist
|
package/dist/api/collection.js
CHANGED
|
@@ -38,9 +38,13 @@ export var collection;
|
|
|
38
38
|
}
|
|
39
39
|
collection.getShortId = getShortId;
|
|
40
40
|
/**
|
|
41
|
-
* Retrieve a specific settings group for a collection
|
|
41
|
+
* Retrieve a specific settings group for a collection.
|
|
42
|
+
* Public reads return the public view of the settings group. If the stored payload contains
|
|
43
|
+
* a top-level `admin` object, that block is omitted from public responses and included when
|
|
44
|
+
* `admin === true`.
|
|
42
45
|
* @param collectionId – Identifier of the collection
|
|
43
46
|
* @param settingGroup – The settings group name
|
|
47
|
+
* @param admin – If true, use the admin endpoint and include the admin-only settings block
|
|
44
48
|
* @returns Promise resolving to the settings object
|
|
45
49
|
*/
|
|
46
50
|
async function getSettings(collectionId, settingGroup, admin) {
|
|
@@ -62,6 +66,9 @@ export var collection;
|
|
|
62
66
|
collection.getAppsConfig = getAppsConfig;
|
|
63
67
|
/**
|
|
64
68
|
* Update a specific settings group for a collection (admin endpoint).
|
|
69
|
+
* This writes through the admin endpoint, but root-level fields are still part of the public
|
|
70
|
+
* settings payload. Put confidential values under `settings.admin` if they should only be
|
|
71
|
+
* returned on admin reads.
|
|
65
72
|
* @param collectionId – Identifier of the collection
|
|
66
73
|
* @param settingGroup – The settings group name
|
|
67
74
|
* @param settings – The settings payload to persist
|