@proveanything/smartlinks 1.3.28 → 1.3.29

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,3 +1,4 @@
1
+ import { AppManifest } from "../types/appManifest";
1
2
  export type AppConfigOptions = {
2
3
  appId: string;
3
4
  collectionId?: string;
@@ -19,4 +20,30 @@ export declare namespace appConfiguration {
19
20
  function getDataItem(opts: AppConfigOptions): Promise<any>;
20
21
  function setDataItem(opts: AppConfigOptions): Promise<any>;
21
22
  function deleteDataItem(opts: AppConfigOptions): Promise<void>;
23
+ /**
24
+ * Fetches an app's manifest file through the proxy API.
25
+ * The manifest is cached on the server for 5 minutes.
26
+ *
27
+ * @param manifestUrl - The full URL to the manifest file (e.g., 'https://smartlinks.app/apps/my-app/v1.0.0/app.manifest.json')
28
+ * @param force - If true, bypasses cache and fetches fresh manifest
29
+ * @returns Promise resolving to the manifest object, or empty object if not found
30
+ * @throws ErrorResponse if the request fails
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * // Use with appsConfig
35
+ * const appsConfig = await Api.Collection.Public.getAppsConfig(collectionId);
36
+ * const app = appsConfig.apps[0];
37
+ * if (app.manifestUrl) {
38
+ * const manifest = await Api.AppConfiguration.getManifest(app.manifestUrl);
39
+ * if (manifest.widgets) {
40
+ * console.log('Available widgets:', manifest.widgets);
41
+ * }
42
+ * }
43
+ *
44
+ * // Force refresh
45
+ * const freshManifest = await Api.AppConfiguration.getManifest(app.manifestUrl, true);
46
+ * ```
47
+ */
48
+ function getManifest(manifestUrl: string, force?: boolean): Promise<AppManifest>;
22
49
  }
@@ -88,4 +88,37 @@ export var appConfiguration;
88
88
  return del(path);
89
89
  }
90
90
  appConfiguration.deleteDataItem = deleteDataItem;
91
+ /**
92
+ * Fetches an app's manifest file through the proxy API.
93
+ * The manifest is cached on the server for 5 minutes.
94
+ *
95
+ * @param manifestUrl - The full URL to the manifest file (e.g., 'https://smartlinks.app/apps/my-app/v1.0.0/app.manifest.json')
96
+ * @param force - If true, bypasses cache and fetches fresh manifest
97
+ * @returns Promise resolving to the manifest object, or empty object if not found
98
+ * @throws ErrorResponse if the request fails
99
+ *
100
+ * @example
101
+ * ```typescript
102
+ * // Use with appsConfig
103
+ * const appsConfig = await Api.Collection.Public.getAppsConfig(collectionId);
104
+ * const app = appsConfig.apps[0];
105
+ * if (app.manifestUrl) {
106
+ * const manifest = await Api.AppConfiguration.getManifest(app.manifestUrl);
107
+ * if (manifest.widgets) {
108
+ * console.log('Available widgets:', manifest.widgets);
109
+ * }
110
+ * }
111
+ *
112
+ * // Force refresh
113
+ * const freshManifest = await Api.AppConfiguration.getManifest(app.manifestUrl, true);
114
+ * ```
115
+ */
116
+ async function getManifest(manifestUrl, force) {
117
+ let path = `/public/app/manifest?url=${encodeURIComponent(manifestUrl)}`;
118
+ if (force) {
119
+ path += '&force=true';
120
+ }
121
+ return request(path);
122
+ }
123
+ appConfiguration.getManifest = getManifest;
91
124
  })(appConfiguration || (appConfiguration = {}));
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.3.28 | Generated: 2026-02-14T12:11:55.083Z
3
+ Version: 1.3.29 | Generated: 2026-02-14T14:15:49.096Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -791,6 +791,88 @@ interface AppConfigurationResponse {
791
791
  }
792
792
  ```
793
793
 
794
+ ### appManifest
795
+
796
+ **AppManifest** (interface)
797
+ ```typescript
798
+ interface AppManifest {
799
+ $schema?: string;
800
+ meta?: {
801
+ name: string;
802
+ description?: string;
803
+ version: string;
804
+ platformRevision?: string;
805
+ appId: string;
806
+ };
807
+ widgets?: Array<{
808
+ name: string;
809
+ description?: string;
810
+ sizes?: string[];
811
+ props?: {
812
+ required?: string[];
813
+ optional?: string[];
814
+ };
815
+ }>;
816
+ setup?: {
817
+ description?: string;
818
+ questions?: Array<{
819
+ id: string;
820
+ prompt: string;
821
+ type: string;
822
+ default?: any;
823
+ required?: boolean;
824
+ }>;
825
+ configSchema?: Record<string, any>;
826
+ saveWith?: {
827
+ method: string;
828
+ scope: string;
829
+ admin?: boolean;
830
+ };
831
+ contentHints?: Record<string, {
832
+ aiGenerate?: boolean;
833
+ prompt?: string;
834
+ }>;
835
+ };
836
+ import?: {
837
+ description?: string;
838
+ scope?: string;
839
+ fields?: Array<{
840
+ name: string;
841
+ type: string;
842
+ required?: boolean;
843
+ default?: any;
844
+ description?: string;
845
+ }>;
846
+ csvExample?: string;
847
+ saveWith?: {
848
+ method: string;
849
+ scope: string;
850
+ admin?: boolean;
851
+ note?: string;
852
+ };
853
+ };
854
+ tunable?: {
855
+ description?: string;
856
+ fields?: Array<{
857
+ name: string;
858
+ description?: string;
859
+ type: string;
860
+ }>;
861
+ };
862
+ metrics?: {
863
+ interactions?: Array<{
864
+ id: string;
865
+ description?: string;
866
+ }>;
867
+ kpis?: Array<{
868
+ name: string;
869
+ compute?: string;
870
+ }>;
871
+ };
872
+ [key: string]: any; // Allow additional custom fields
873
+ }
874
+ ```
875
+
794
876
  ### asset
795
877
 
796
878
  **Asset** (interface)
@@ -1394,6 +1476,7 @@ interface AppConfig {
1394
1476
  ownersOnly?: boolean
1395
1477
  hidden?: boolean
1396
1478
  publicIframeUrl?: string
1479
+ manifestUrl?: string
1397
1480
  supportsDeepLinks?: boolean;
1398
1481
  usage: {
1399
1482
  collection: boolean; // use at the collecton level
@@ -3824,6 +3907,9 @@ Post a chat message to the AI (admin or public)
3824
3907
 
3825
3908
  **deleteDataItem**(opts: AppConfigOptions) → `Promise<void>`
3826
3909
 
3910
+ **getManifest**(manifestUrl: string, force?: boolean) → `Promise<AppManifest>`
3911
+ Fetches an app's manifest file through the proxy API. The manifest is cached on the server for 5 minutes. ```typescript // Use with appsConfig const appsConfig = await Api.Collection.Public.getAppsConfig(collectionId); const app = appsConfig.apps[0]; if (app.manifestUrl) { const manifest = await Api.AppConfiguration.getManifest(app.manifestUrl); if (manifest.widgets) { console.log('Available widgets:', manifest.widgets); } } // Force refresh const freshManifest = await Api.AppConfiguration.getManifest(app.manifestUrl, true); ```
3912
+
3827
3913
  ### appRecord
3828
3914
 
3829
3915
  **get**(collectionId: string, appId: string) → `Promise<any>`
@@ -0,0 +1,80 @@
1
+ /**
2
+ * SmartLinks App Manifest structure
3
+ * Defines the configuration, widgets, setup, import, and metrics for a microapp
4
+ */
5
+ export interface AppManifest {
6
+ $schema?: string;
7
+ meta?: {
8
+ name: string;
9
+ description?: string;
10
+ version: string;
11
+ platformRevision?: string;
12
+ appId: string;
13
+ };
14
+ widgets?: Array<{
15
+ name: string;
16
+ description?: string;
17
+ sizes?: string[];
18
+ props?: {
19
+ required?: string[];
20
+ optional?: string[];
21
+ };
22
+ }>;
23
+ setup?: {
24
+ description?: string;
25
+ questions?: Array<{
26
+ id: string;
27
+ prompt: string;
28
+ type: string;
29
+ default?: any;
30
+ required?: boolean;
31
+ }>;
32
+ configSchema?: Record<string, any>;
33
+ saveWith?: {
34
+ method: string;
35
+ scope: string;
36
+ admin?: boolean;
37
+ };
38
+ contentHints?: Record<string, {
39
+ aiGenerate?: boolean;
40
+ prompt?: string;
41
+ }>;
42
+ };
43
+ import?: {
44
+ description?: string;
45
+ scope?: string;
46
+ fields?: Array<{
47
+ name: string;
48
+ type: string;
49
+ required?: boolean;
50
+ default?: any;
51
+ description?: string;
52
+ }>;
53
+ csvExample?: string;
54
+ saveWith?: {
55
+ method: string;
56
+ scope: string;
57
+ admin?: boolean;
58
+ note?: string;
59
+ };
60
+ };
61
+ tunable?: {
62
+ description?: string;
63
+ fields?: Array<{
64
+ name: string;
65
+ description?: string;
66
+ type: string;
67
+ }>;
68
+ };
69
+ metrics?: {
70
+ interactions?: Array<{
71
+ id: string;
72
+ description?: string;
73
+ }>;
74
+ kpis?: Array<{
75
+ name: string;
76
+ compute?: string;
77
+ }>;
78
+ };
79
+ [key: string]: any;
80
+ }
@@ -0,0 +1,2 @@
1
+ // src/types/appManifest.ts
2
+ export {};
@@ -91,6 +91,8 @@ export interface AppConfig {
91
91
  hidden?: boolean;
92
92
  /** Universal iframe URL for external embedding */
93
93
  publicIframeUrl?: string;
94
+ /** Where to get the app manifest for AI and widget definitions */
95
+ manifestUrl?: string;
94
96
  /** supports multiple pages / deep links into the app */
95
97
  supportsDeepLinks?: boolean;
96
98
  /** App component configuration */
@@ -27,3 +27,4 @@ export * from "./order";
27
27
  export * from "./crate";
28
28
  export * from "./iframeResponder";
29
29
  export * from "./ai";
30
+ export * from "./appManifest";
@@ -29,3 +29,4 @@ export * from "./order";
29
29
  export * from "./crate";
30
30
  export * from "./iframeResponder";
31
31
  export * from "./ai";
32
+ export * from "./appManifest";
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.3.28 | Generated: 2026-02-14T12:11:55.083Z
3
+ Version: 1.3.29 | Generated: 2026-02-14T14:15:49.096Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -791,6 +791,88 @@ interface AppConfigurationResponse {
791
791
  }
792
792
  ```
793
793
 
794
+ ### appManifest
795
+
796
+ **AppManifest** (interface)
797
+ ```typescript
798
+ interface AppManifest {
799
+ $schema?: string;
800
+ meta?: {
801
+ name: string;
802
+ description?: string;
803
+ version: string;
804
+ platformRevision?: string;
805
+ appId: string;
806
+ };
807
+ widgets?: Array<{
808
+ name: string;
809
+ description?: string;
810
+ sizes?: string[];
811
+ props?: {
812
+ required?: string[];
813
+ optional?: string[];
814
+ };
815
+ }>;
816
+ setup?: {
817
+ description?: string;
818
+ questions?: Array<{
819
+ id: string;
820
+ prompt: string;
821
+ type: string;
822
+ default?: any;
823
+ required?: boolean;
824
+ }>;
825
+ configSchema?: Record<string, any>;
826
+ saveWith?: {
827
+ method: string;
828
+ scope: string;
829
+ admin?: boolean;
830
+ };
831
+ contentHints?: Record<string, {
832
+ aiGenerate?: boolean;
833
+ prompt?: string;
834
+ }>;
835
+ };
836
+ import?: {
837
+ description?: string;
838
+ scope?: string;
839
+ fields?: Array<{
840
+ name: string;
841
+ type: string;
842
+ required?: boolean;
843
+ default?: any;
844
+ description?: string;
845
+ }>;
846
+ csvExample?: string;
847
+ saveWith?: {
848
+ method: string;
849
+ scope: string;
850
+ admin?: boolean;
851
+ note?: string;
852
+ };
853
+ };
854
+ tunable?: {
855
+ description?: string;
856
+ fields?: Array<{
857
+ name: string;
858
+ description?: string;
859
+ type: string;
860
+ }>;
861
+ };
862
+ metrics?: {
863
+ interactions?: Array<{
864
+ id: string;
865
+ description?: string;
866
+ }>;
867
+ kpis?: Array<{
868
+ name: string;
869
+ compute?: string;
870
+ }>;
871
+ };
872
+ [key: string]: any; // Allow additional custom fields
873
+ }
874
+ ```
875
+
794
876
  ### asset
795
877
 
796
878
  **Asset** (interface)
@@ -1394,6 +1476,7 @@ interface AppConfig {
1394
1476
  ownersOnly?: boolean
1395
1477
  hidden?: boolean
1396
1478
  publicIframeUrl?: string
1479
+ manifestUrl?: string
1397
1480
  supportsDeepLinks?: boolean;
1398
1481
  usage: {
1399
1482
  collection: boolean; // use at the collecton level
@@ -3824,6 +3907,9 @@ Post a chat message to the AI (admin or public)
3824
3907
 
3825
3908
  **deleteDataItem**(opts: AppConfigOptions) → `Promise<void>`
3826
3909
 
3910
+ **getManifest**(manifestUrl: string, force?: boolean) → `Promise<AppManifest>`
3911
+ Fetches an app's manifest file through the proxy API. The manifest is cached on the server for 5 minutes. ```typescript // Use with appsConfig const appsConfig = await Api.Collection.Public.getAppsConfig(collectionId); const app = appsConfig.apps[0]; if (app.manifestUrl) { const manifest = await Api.AppConfiguration.getManifest(app.manifestUrl); if (manifest.widgets) { console.log('Available widgets:', manifest.widgets); } } // Force refresh const freshManifest = await Api.AppConfiguration.getManifest(app.manifestUrl, true); ```
3912
+
3827
3913
  ### appRecord
3828
3914
 
3829
3915
  **get**(collectionId: string, appId: string) → `Promise<any>`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.3.28",
3
+ "version": "1.3.29",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",