@proveanything/smartlinks 1.4.1 → 1.4.2

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.4.1 | Generated: 2026-02-20T19:32:34.980Z
3
+ Version: 1.4.2 | Generated: 2026-02-20T21:56:06.588Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -821,6 +821,41 @@ interface AppConfigurationResponse {
821
821
 
822
822
  ### appManifest
823
823
 
824
+ **AppBundle** (interface)
825
+ ```typescript
826
+ interface AppBundle {
827
+ js: string | null;
828
+ css: string | null;
829
+ source?: string;
830
+ styles?: string;
831
+ }
832
+ ```
833
+
834
+ **AppWidgetDefinition** (interface)
835
+ ```typescript
836
+ interface AppWidgetDefinition {
837
+ name: string;
838
+ description?: string;
839
+ sizes?: Array<'compact' | 'standard' | 'large' | string>;
840
+ props?: {
841
+ required?: string[];
842
+ optional?: string[];
843
+ };
844
+ }
845
+ ```
846
+
847
+ **AppContainerDefinition** (interface)
848
+ ```typescript
849
+ interface AppContainerDefinition {
850
+ name: string;
851
+ description?: string;
852
+ props?: {
853
+ required?: string[];
854
+ optional?: string[];
855
+ };
856
+ }
857
+ ```
858
+
824
859
  **AppManifest** (interface)
825
860
  ```typescript
826
861
  interface AppManifest {
@@ -832,15 +867,8 @@ interface AppManifest {
832
867
  platformRevision?: string;
833
868
  appId: string;
834
869
  };
835
- widgets?: Array<{
836
- name: string;
837
- description?: string;
838
- sizes?: string[];
839
- props?: {
840
- required?: string[];
841
- optional?: string[];
842
- };
843
- }>;
870
+ widgets?: AppWidgetDefinition[];
871
+ containers?: AppContainerDefinition[];
844
872
  setup?: {
845
873
  description?: string;
846
874
  questions?: Array<{
@@ -849,12 +877,14 @@ interface AppManifest {
849
877
  type: string;
850
878
  default?: any;
851
879
  required?: boolean;
880
+ options?: Array<{ value: string; label: string }>;
852
881
  }>;
853
882
  configSchema?: Record<string, any>;
854
883
  saveWith?: {
855
884
  method: string;
856
- scope: string;
885
+ scope: 'collection' | 'product' | string;
857
886
  admin?: boolean;
887
+ note?: string;
858
888
  };
859
889
  contentHints?: Record<string, {
860
890
  aiGenerate?: boolean;
@@ -885,44 +915,38 @@ interface AppManifest {
885
915
  name: string;
886
916
  description?: string;
887
917
  type: string;
918
+ options?: string[];
888
919
  }>;
889
920
  };
890
921
  metrics?: {
891
- interactions?: Array<{
892
- id: string;
893
- description?: string;
894
- }>;
895
- kpis?: Array<{
896
- name: string;
897
- compute?: string;
898
- }>;
922
+ interactions?: Array<{ id: string; description?: string }>;
923
+ kpis?: Array<{ name: string; compute?: string }>;
899
924
  };
900
- [key: string]: any; // Allow additional custom fields
925
+ [key: string]: any;
901
926
  }
902
927
  ```
903
928
 
904
- **CollectionWidget** (interface)
929
+ **CollectionAppWidget** (interface)
905
930
  ```typescript
906
- interface CollectionWidget {
931
+ interface CollectionAppWidget {
907
932
  appId: string;
908
- manifestUrl: string;
909
933
  manifest: AppManifest;
910
- bundleSource: string;
911
- bundleCss?: string; // Optional CSS file
934
+ widget: AppBundle;
935
+ container: AppBundle | null;
912
936
  }
913
937
  ```
914
938
 
915
939
  **CollectionWidgetsResponse** (interface)
916
940
  ```typescript
917
941
  interface CollectionWidgetsResponse {
918
- apps: CollectionWidget[];
942
+ apps: CollectionAppWidget[];
919
943
  }
920
944
  ```
921
945
 
922
946
  **GetCollectionWidgetsOptions** (interface)
923
947
  ```typescript
924
948
  interface GetCollectionWidgetsOptions {
925
- force?: boolean; // Bypass cache and fetch fresh data
949
+ force?: boolean;
926
950
  }
927
951
  ```
928
952
 
@@ -1,6 +1,54 @@
1
1
  /**
2
- * SmartLinks App Manifest structure
3
- * Defines the configuration, widgets, setup, import, and metrics for a microapp
2
+ * A bundle (widget or container) as returned by the collection widgets endpoint.
3
+ *
4
+ * The server currently returns URLs only. In future it may also inline the file
5
+ * contents when bundles are small or frequently accessed. Clients should check
6
+ * for inline content first and fall back to loading the URL.
7
+ *
8
+ * if (bundle.source) {
9
+ * // inline JS — create a Blob URL or inject directly
10
+ * } else if (bundle.js) {
11
+ * // load from URL
12
+ * }
13
+ */
14
+ export interface AppBundle {
15
+ /** URL to the JavaScript file — load if `source` is absent */
16
+ js: string | null;
17
+ /** URL to the CSS file — load if `styles` is absent */
18
+ css: string | null;
19
+ /** Inlined JavaScript source (present when server bundles it inline) */
20
+ source?: string;
21
+ /** Inlined CSS styles (present when server bundles it inline) */
22
+ styles?: string;
23
+ }
24
+ /**
25
+ * A single widget defined in the manifest.
26
+ * Presence of the `widgets` array means a widget bundle exists for this app.
27
+ */
28
+ export interface AppWidgetDefinition {
29
+ name: string;
30
+ description?: string;
31
+ sizes?: Array<'compact' | 'standard' | 'large' | string>;
32
+ props?: {
33
+ required?: string[];
34
+ optional?: string[];
35
+ };
36
+ }
37
+ /**
38
+ * A single container defined in the manifest.
39
+ * Presence of the `containers` array means a container bundle exists for this app.
40
+ * Containers are full-page / embedded components (larger than widgets, no iframe needed).
41
+ */
42
+ export interface AppContainerDefinition {
43
+ name: string;
44
+ description?: string;
45
+ props?: {
46
+ required?: string[];
47
+ optional?: string[];
48
+ };
49
+ }
50
+ /**
51
+ * SmartLinks App Manifest — the app.manifest.json structure.
4
52
  */
5
53
  export interface AppManifest {
6
54
  $schema?: string;
@@ -11,15 +59,10 @@ export interface AppManifest {
11
59
  platformRevision?: string;
12
60
  appId: string;
13
61
  };
14
- widgets?: Array<{
15
- name: string;
16
- description?: string;
17
- sizes?: string[];
18
- props?: {
19
- required?: string[];
20
- optional?: string[];
21
- };
22
- }>;
62
+ /** Presence means a widget bundle (widgets.umd.js / widgets.css) exists */
63
+ widgets?: AppWidgetDefinition[];
64
+ /** Presence means a container bundle (containers.umd.js / containers.css) exists */
65
+ containers?: AppContainerDefinition[];
23
66
  setup?: {
24
67
  description?: string;
25
68
  questions?: Array<{
@@ -28,12 +71,17 @@ export interface AppManifest {
28
71
  type: string;
29
72
  default?: any;
30
73
  required?: boolean;
74
+ options?: Array<{
75
+ value: string;
76
+ label: string;
77
+ }>;
31
78
  }>;
32
79
  configSchema?: Record<string, any>;
33
80
  saveWith?: {
34
81
  method: string;
35
- scope: string;
82
+ scope: 'collection' | 'product' | string;
36
83
  admin?: boolean;
84
+ note?: string;
37
85
  };
38
86
  contentHints?: Record<string, {
39
87
  aiGenerate?: boolean;
@@ -64,6 +112,7 @@ export interface AppManifest {
64
112
  name: string;
65
113
  description?: string;
66
114
  type: string;
115
+ options?: string[];
67
116
  }>;
68
117
  };
69
118
  metrics?: {
@@ -79,24 +128,26 @@ export interface AppManifest {
79
128
  [key: string]: any;
80
129
  }
81
130
  /**
82
- * Single app widget data with manifest and bundle files
131
+ * One app entry in the collection widgets response.
83
132
  */
84
- export interface CollectionWidget {
133
+ export interface CollectionAppWidget {
85
134
  appId: string;
86
- manifestUrl: string;
87
135
  manifest: AppManifest;
88
- bundleSource: string;
89
- bundleCss?: string;
136
+ /** Widget bundle — always present (apps without widgets are excluded from the response) */
137
+ widget: AppBundle;
138
+ /** Container bundle — null when the app has no containers */
139
+ container: AppBundle | null;
90
140
  }
91
141
  /**
92
- * Response from collection widgets endpoint
142
+ * Response from GET /api/v1/public/collection/:collectionId/widgets
93
143
  */
94
144
  export interface CollectionWidgetsResponse {
95
- apps: CollectionWidget[];
145
+ apps: CollectionAppWidget[];
96
146
  }
97
147
  /**
98
148
  * Options for fetching collection widgets
99
149
  */
100
150
  export interface GetCollectionWidgetsOptions {
151
+ /** Bypass server cache and fetch fresh manifests */
101
152
  force?: boolean;
102
153
  }
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.4.1 | Generated: 2026-02-20T19:32:34.980Z
3
+ Version: 1.4.2 | Generated: 2026-02-20T21:56:06.588Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -821,6 +821,41 @@ interface AppConfigurationResponse {
821
821
 
822
822
  ### appManifest
823
823
 
824
+ **AppBundle** (interface)
825
+ ```typescript
826
+ interface AppBundle {
827
+ js: string | null;
828
+ css: string | null;
829
+ source?: string;
830
+ styles?: string;
831
+ }
832
+ ```
833
+
834
+ **AppWidgetDefinition** (interface)
835
+ ```typescript
836
+ interface AppWidgetDefinition {
837
+ name: string;
838
+ description?: string;
839
+ sizes?: Array<'compact' | 'standard' | 'large' | string>;
840
+ props?: {
841
+ required?: string[];
842
+ optional?: string[];
843
+ };
844
+ }
845
+ ```
846
+
847
+ **AppContainerDefinition** (interface)
848
+ ```typescript
849
+ interface AppContainerDefinition {
850
+ name: string;
851
+ description?: string;
852
+ props?: {
853
+ required?: string[];
854
+ optional?: string[];
855
+ };
856
+ }
857
+ ```
858
+
824
859
  **AppManifest** (interface)
825
860
  ```typescript
826
861
  interface AppManifest {
@@ -832,15 +867,8 @@ interface AppManifest {
832
867
  platformRevision?: string;
833
868
  appId: string;
834
869
  };
835
- widgets?: Array<{
836
- name: string;
837
- description?: string;
838
- sizes?: string[];
839
- props?: {
840
- required?: string[];
841
- optional?: string[];
842
- };
843
- }>;
870
+ widgets?: AppWidgetDefinition[];
871
+ containers?: AppContainerDefinition[];
844
872
  setup?: {
845
873
  description?: string;
846
874
  questions?: Array<{
@@ -849,12 +877,14 @@ interface AppManifest {
849
877
  type: string;
850
878
  default?: any;
851
879
  required?: boolean;
880
+ options?: Array<{ value: string; label: string }>;
852
881
  }>;
853
882
  configSchema?: Record<string, any>;
854
883
  saveWith?: {
855
884
  method: string;
856
- scope: string;
885
+ scope: 'collection' | 'product' | string;
857
886
  admin?: boolean;
887
+ note?: string;
858
888
  };
859
889
  contentHints?: Record<string, {
860
890
  aiGenerate?: boolean;
@@ -885,44 +915,38 @@ interface AppManifest {
885
915
  name: string;
886
916
  description?: string;
887
917
  type: string;
918
+ options?: string[];
888
919
  }>;
889
920
  };
890
921
  metrics?: {
891
- interactions?: Array<{
892
- id: string;
893
- description?: string;
894
- }>;
895
- kpis?: Array<{
896
- name: string;
897
- compute?: string;
898
- }>;
922
+ interactions?: Array<{ id: string; description?: string }>;
923
+ kpis?: Array<{ name: string; compute?: string }>;
899
924
  };
900
- [key: string]: any; // Allow additional custom fields
925
+ [key: string]: any;
901
926
  }
902
927
  ```
903
928
 
904
- **CollectionWidget** (interface)
929
+ **CollectionAppWidget** (interface)
905
930
  ```typescript
906
- interface CollectionWidget {
931
+ interface CollectionAppWidget {
907
932
  appId: string;
908
- manifestUrl: string;
909
933
  manifest: AppManifest;
910
- bundleSource: string;
911
- bundleCss?: string; // Optional CSS file
934
+ widget: AppBundle;
935
+ container: AppBundle | null;
912
936
  }
913
937
  ```
914
938
 
915
939
  **CollectionWidgetsResponse** (interface)
916
940
  ```typescript
917
941
  interface CollectionWidgetsResponse {
918
- apps: CollectionWidget[];
942
+ apps: CollectionAppWidget[];
919
943
  }
920
944
  ```
921
945
 
922
946
  **GetCollectionWidgetsOptions** (interface)
923
947
  ```typescript
924
948
  interface GetCollectionWidgetsOptions {
925
- force?: boolean; // Bypass cache and fetch fresh data
949
+ force?: boolean;
926
950
  }
927
951
  ```
928
952
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",