@proveanything/smartlinks 1.8.5 → 1.8.6
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 +22 -5
- package/dist/api/appConfiguration.js +21 -4
- package/dist/docs/API_SUMMARY.md +250 -257
- package/dist/docs/app-data-storage.md +56 -10
- package/dist/docs/overview.md +3 -0
- package/docs/API_SUMMARY.md +250 -257
- package/docs/app-data-storage.md +56 -10
- package/docs/overview.md +3 -0
- package/package.json +1 -1
|
@@ -21,7 +21,7 @@ export type AppConfigOptions = {
|
|
|
21
21
|
admin?: boolean;
|
|
22
22
|
/** Configuration object for setConfig */
|
|
23
23
|
config?: any;
|
|
24
|
-
/** Data object for setDataItem */
|
|
24
|
+
/** Data object for setDataItem. Best for small keyed scoped documents rather than richer app domain objects. */
|
|
25
25
|
data?: any;
|
|
26
26
|
};
|
|
27
27
|
/**
|
|
@@ -262,7 +262,13 @@ export declare namespace appConfiguration {
|
|
|
262
262
|
*/
|
|
263
263
|
function deleteConfig(opts: AppConfigOptions): Promise<void>;
|
|
264
264
|
/**
|
|
265
|
-
|
|
265
|
+
* Get all keyed data items for an app within a scope.
|
|
266
|
+
* Best for a small set of standalone documents such as FAQs, menus, lookup tables,
|
|
267
|
+
* or content fragments where the caller typically knows the item IDs.
|
|
268
|
+
*
|
|
269
|
+
* If you are modelling richer app entities that need filtering, lifecycle fields,
|
|
270
|
+
* visibility, ownership, or relationships, prefer `app.records`, `app.cases`,
|
|
271
|
+
* or `app.threads` instead.
|
|
266
272
|
*
|
|
267
273
|
* @param opts - Options including appId and scope (collectionId, productId, etc.)
|
|
268
274
|
* @returns Array of data items
|
|
@@ -278,7 +284,11 @@ export declare namespace appConfiguration {
|
|
|
278
284
|
*/
|
|
279
285
|
function getData(opts: AppConfigOptions): Promise<any[]>;
|
|
280
286
|
/**
|
|
281
|
-
|
|
287
|
+
* Get a single keyed data item by ID within a scope.
|
|
288
|
+
* This is ideal when you already know the exact ID of a simple scoped document.
|
|
289
|
+
*
|
|
290
|
+
* For richer domain objects that users browse or query, prefer `app.records`,
|
|
291
|
+
* `app.cases`, or `app.threads`.
|
|
282
292
|
*
|
|
283
293
|
* @param opts - Options including appId, scope, and itemId
|
|
284
294
|
* @returns The data item
|
|
@@ -295,8 +305,15 @@ export declare namespace appConfiguration {
|
|
|
295
305
|
*/
|
|
296
306
|
function getDataItem(opts: AppConfigOptions): Promise<any>;
|
|
297
307
|
/**
|
|
298
|
-
|
|
308
|
+
* Set/create a keyed data item within a scope.
|
|
299
309
|
* Requires admin authentication.
|
|
310
|
+
*
|
|
311
|
+
* Use this for simple scoped documents attached to a collection/product/variant/batch,
|
|
312
|
+
* especially when you want a small number of items with stable IDs.
|
|
313
|
+
*
|
|
314
|
+
* Do not treat this as the default write path for every app-owned entity. If the data
|
|
315
|
+
* starts behaving like a real object with lifecycle, filtering, visibility, ownership,
|
|
316
|
+
* history, or relationships, prefer `app.records`, `app.cases`, or `app.threads`.
|
|
300
317
|
*
|
|
301
318
|
* @param opts - Options including appId, scope, and data
|
|
302
319
|
* @returns The saved data item
|
|
@@ -314,7 +331,7 @@ export declare namespace appConfiguration {
|
|
|
314
331
|
*/
|
|
315
332
|
function setDataItem(opts: AppConfigOptions): Promise<any>;
|
|
316
333
|
/**
|
|
317
|
-
|
|
334
|
+
* Delete a keyed data item by ID within a scope.
|
|
318
335
|
* Requires admin authentication.
|
|
319
336
|
*
|
|
320
337
|
* @param opts - Options including appId, scope, and itemId
|
|
@@ -351,7 +351,13 @@ export var appConfiguration;
|
|
|
351
351
|
}
|
|
352
352
|
appConfiguration.deleteConfig = deleteConfig;
|
|
353
353
|
/**
|
|
354
|
-
|
|
354
|
+
* Get all keyed data items for an app within a scope.
|
|
355
|
+
* Best for a small set of standalone documents such as FAQs, menus, lookup tables,
|
|
356
|
+
* or content fragments where the caller typically knows the item IDs.
|
|
357
|
+
*
|
|
358
|
+
* If you are modelling richer app entities that need filtering, lifecycle fields,
|
|
359
|
+
* visibility, ownership, or relationships, prefer `app.records`, `app.cases`,
|
|
360
|
+
* or `app.threads` instead.
|
|
355
361
|
*
|
|
356
362
|
* @param opts - Options including appId and scope (collectionId, productId, etc.)
|
|
357
363
|
* @returns Array of data items
|
|
@@ -371,7 +377,11 @@ export var appConfiguration;
|
|
|
371
377
|
}
|
|
372
378
|
appConfiguration.getData = getData;
|
|
373
379
|
/**
|
|
374
|
-
|
|
380
|
+
* Get a single keyed data item by ID within a scope.
|
|
381
|
+
* This is ideal when you already know the exact ID of a simple scoped document.
|
|
382
|
+
*
|
|
383
|
+
* For richer domain objects that users browse or query, prefer `app.records`,
|
|
384
|
+
* `app.cases`, or `app.threads`.
|
|
375
385
|
*
|
|
376
386
|
* @param opts - Options including appId, scope, and itemId
|
|
377
387
|
* @returns The data item
|
|
@@ -394,8 +404,15 @@ export var appConfiguration;
|
|
|
394
404
|
}
|
|
395
405
|
appConfiguration.getDataItem = getDataItem;
|
|
396
406
|
/**
|
|
397
|
-
|
|
407
|
+
* Set/create a keyed data item within a scope.
|
|
398
408
|
* Requires admin authentication.
|
|
409
|
+
*
|
|
410
|
+
* Use this for simple scoped documents attached to a collection/product/variant/batch,
|
|
411
|
+
* especially when you want a small number of items with stable IDs.
|
|
412
|
+
*
|
|
413
|
+
* Do not treat this as the default write path for every app-owned entity. If the data
|
|
414
|
+
* starts behaving like a real object with lifecycle, filtering, visibility, ownership,
|
|
415
|
+
* history, or relationships, prefer `app.records`, `app.cases`, or `app.threads`.
|
|
399
416
|
*
|
|
400
417
|
* @param opts - Options including appId, scope, and data
|
|
401
418
|
* @returns The saved data item
|
|
@@ -417,7 +434,7 @@ export var appConfiguration;
|
|
|
417
434
|
}
|
|
418
435
|
appConfiguration.setDataItem = setDataItem;
|
|
419
436
|
/**
|
|
420
|
-
|
|
437
|
+
* Delete a keyed data item by ID within a scope.
|
|
421
438
|
* Requires admin authentication.
|
|
422
439
|
*
|
|
423
440
|
* @param opts - Options including appId, scope, and itemId
|