@proveanything/smartlinks 1.0.37 → 1.0.38

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/API_SUMMARY.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.0.37 | Generated: 2025-09-17T14:45:53.635Z
3
+ Version: 1.0.38 | Generated: 2025-10-04T11:16:35.687Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -8,6 +8,7 @@ This is a concise summary of all available API functions and types.
8
8
 
9
9
  The Smartlinks SDK is organized into the following namespaces:
10
10
 
11
+ - **ai** - Functions for ai operations
11
12
  - **appConfiguration** - Application configuration and settings management
12
13
  - **appRecord** - Functions for appRecord operations
13
14
  - **asset** - File upload and asset management for collections, products, and proofs
@@ -202,7 +203,7 @@ interface ProductResponse {
202
203
  x512: string
203
204
  }
204
205
  }
205
- groupTags: {
206
+ tags: {
206
207
  [tagName: string]: boolean
207
208
  }
208
209
  data: {
@@ -238,6 +239,52 @@ interface ProofResponse {
238
239
 
239
240
  **VariantUpdateRequest** = `any`
240
241
 
242
+ ### ai
243
+
244
+ **AIGenerateContentRequest** (interface)
245
+ ```typescript
246
+ interface AIGenerateContentRequest {
247
+ contents: string | any
248
+ responseMimeType?: string
249
+ systemInstruction?: string
250
+ provider?: string
251
+ model?: string
252
+ [key: string]: any
253
+ }
254
+ ```
255
+
256
+ **AIGenerateImageRequest** (interface)
257
+ ```typescript
258
+ interface AIGenerateImageRequest {
259
+ prompt: string
260
+ provider?: string
261
+ model?: string
262
+ size?: string
263
+ [key: string]: any
264
+ }
265
+ ```
266
+
267
+ **AISearchPhotosRequest** (interface)
268
+ ```typescript
269
+ interface AISearchPhotosRequest {
270
+ query: string
271
+ per_page?: number
272
+ orientation?: 'landscape' | 'portrait' | 'squarish'
273
+ [key: string]: any
274
+ }
275
+ ```
276
+
277
+ **AISearchPhotosPhoto** (interface)
278
+ ```typescript
279
+ interface AISearchPhotosPhoto {
280
+ url: string
281
+ alt?: string
282
+ photographer?: string
283
+ photographerUrl?: string
284
+ [key: string]: any
285
+ }
286
+ ```
287
+
241
288
  **AppConfigOptions** = `{
242
289
  appId: string
243
290
  collectionId?: string
@@ -306,6 +353,50 @@ interface ProofResponse {
306
353
 
307
354
  ## API Functions
308
355
 
356
+ ### ai
357
+
358
+ **generateContent**(collectionId: string,
359
+ params: AIGenerateContentRequest,
360
+ admin: boolean = true) → `Promise<any>`
361
+ Generate text/content via AI (admin)
362
+
363
+ **generateImage**(collectionId: string, params: AIGenerateImageRequest) → `Promise<any>`
364
+ Generate an image via AI (admin)
365
+
366
+ **searchPhotos**(collectionId: string,
367
+ params: AISearchPhotosRequest) → `Promise<AISearchPhotosPhoto[]>`
368
+ Search stock photos or similar via AI (admin)
369
+
370
+ **uploadFile**(collectionId: string, params: any) → `Promise<any>`
371
+ Upload a file for AI usage (admin). Pass FormData for binary uploads.
372
+
373
+ **createCache**(collectionId: string, params: any) → `Promise<any>`
374
+ Create or warm a cache for AI (admin)
375
+
376
+ **postChat**(collectionId: string, params: any, admin: boolean = true) → `Promise<any>`
377
+ Post a chat message to the AI (admin or public)
378
+
379
+ **generateContent**(collectionId: string,
380
+ params: AIGenerateContentRequest,
381
+ admin: boolean = true) → `Promise<any>`
382
+ Generate text/content via AI (admin)
383
+
384
+ **generateImage**(collectionId: string, params: AIGenerateImageRequest) → `Promise<any>`
385
+ Generate an image via AI (admin)
386
+
387
+ **searchPhotos**(collectionId: string,
388
+ params: AISearchPhotosRequest) → `Promise<AISearchPhotosPhoto[]>`
389
+ Search stock photos or similar via AI (admin)
390
+
391
+ **uploadFile**(collectionId: string, params: any) → `Promise<any>`
392
+ Upload a file for AI usage (admin). Pass FormData for binary uploads.
393
+
394
+ **createCache**(collectionId: string, params: any) → `Promise<any>`
395
+ Create or warm a cache for AI (admin)
396
+
397
+ **postChat**(collectionId: string, params: any, admin: boolean = true) → `Promise<any>`
398
+ Post a chat message to the AI (admin or public)
399
+
309
400
  ### appConfiguration
310
401
 
311
402
  **getConfig**(opts: AppConfigOptions) → `Promise<any>`
@@ -0,0 +1,74 @@
1
+ export interface AIGenerateContentRequest {
2
+ /** The prompt or message contents sent to the AI */
3
+ contents: string | any;
4
+ /** Desired MIME type of the response payload (e.g. 'application/json', 'text/plain') */
5
+ responseMimeType?: string;
6
+ /** Optional system instruction or system prompt to steer the model */
7
+ systemInstruction?: string;
8
+ /** AI provider identifier (e.g. 'openai', 'google', 'anthropic') */
9
+ provider?: string;
10
+ /** The model name to use (e.g. 'gpt-4o', 'gemini-1.5-pro') */
11
+ model?: string;
12
+ /** Allow passing additional provider/model-specific options */
13
+ [key: string]: any;
14
+ }
15
+ export interface AIGenerateImageRequest {
16
+ /** Text prompt describing the desired image */
17
+ prompt: string;
18
+ /** AI provider identifier (e.g. 'openai', 'google', 'stability') */
19
+ provider?: string;
20
+ /** Optional model name to use for image generation */
21
+ model?: string;
22
+ /** Requested image size, e.g. '1024x1024' */
23
+ size?: string;
24
+ /** Additional provider/model-specific options */
25
+ [key: string]: any;
26
+ }
27
+ export interface AISearchPhotosRequest {
28
+ /** Search query keyword(s) */
29
+ query: string;
30
+ /** Number of results to return per page (e.g. 1) */
31
+ per_page?: number;
32
+ /** Desired orientation of photos */
33
+ orientation?: 'landscape' | 'portrait' | 'squarish';
34
+ /** Additional provider-specific options */
35
+ [key: string]: any;
36
+ }
37
+ export interface AISearchPhotosPhoto {
38
+ /** Direct image URL */
39
+ url: string;
40
+ /** Alt text/description for accessibility */
41
+ alt?: string;
42
+ /** Photographer display name */
43
+ photographer?: string;
44
+ /** Link to the photographer profile */
45
+ photographerUrl?: string;
46
+ /** Allow extra fields */
47
+ [key: string]: any;
48
+ }
49
+ export declare namespace ai {
50
+ /**
51
+ * Generate text/content via AI (admin)
52
+ */
53
+ function generateContent(collectionId: string, params: AIGenerateContentRequest, admin?: boolean): Promise<any>;
54
+ /**
55
+ * Generate an image via AI (admin)
56
+ */
57
+ function generateImage(collectionId: string, params: AIGenerateImageRequest): Promise<any>;
58
+ /**
59
+ * Search stock photos or similar via AI (admin)
60
+ */
61
+ function searchPhotos(collectionId: string, params: AISearchPhotosRequest): Promise<AISearchPhotosPhoto[]>;
62
+ /**
63
+ * Upload a file for AI usage (admin). Pass FormData for binary uploads.
64
+ */
65
+ function uploadFile(collectionId: string, params: any): Promise<any>;
66
+ /**
67
+ * Create or warm a cache for AI (admin)
68
+ */
69
+ function createCache(collectionId: string, params: any): Promise<any>;
70
+ /**
71
+ * Post a chat message to the AI (admin or public)
72
+ */
73
+ function postChat(collectionId: string, params: any, admin?: boolean): Promise<any>;
74
+ }
package/dist/api/ai.js ADDED
@@ -0,0 +1,56 @@
1
+ // src/api/ai.ts
2
+ // AI endpoints: public and admin helpers
3
+ import { post } from "../http";
4
+ export var ai;
5
+ (function (ai) {
6
+ /**
7
+ * Generate text/content via AI (admin)
8
+ */
9
+ async function generateContent(collectionId, params, admin = true) {
10
+ const base = admin ? '/admin' : '/public';
11
+ const path = `${base}/collection/${encodeURIComponent(collectionId)}/ai/generateContent`;
12
+ return post(path, params);
13
+ }
14
+ ai.generateContent = generateContent;
15
+ /**
16
+ * Generate an image via AI (admin)
17
+ */
18
+ async function generateImage(collectionId, params) {
19
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/ai/generateImage`;
20
+ return post(path, params);
21
+ }
22
+ ai.generateImage = generateImage;
23
+ /**
24
+ * Search stock photos or similar via AI (admin)
25
+ */
26
+ async function searchPhotos(collectionId, params) {
27
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/ai/searchPhotos`;
28
+ return post(path, params);
29
+ }
30
+ ai.searchPhotos = searchPhotos;
31
+ /**
32
+ * Upload a file for AI usage (admin). Pass FormData for binary uploads.
33
+ */
34
+ async function uploadFile(collectionId, params) {
35
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/ai/uploadFile`;
36
+ return post(path, params);
37
+ }
38
+ ai.uploadFile = uploadFile;
39
+ /**
40
+ * Create or warm a cache for AI (admin)
41
+ */
42
+ async function createCache(collectionId, params) {
43
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/ai/createCache`;
44
+ return post(path, params);
45
+ }
46
+ ai.createCache = createCache;
47
+ /**
48
+ * Post a chat message to the AI (admin or public)
49
+ */
50
+ async function postChat(collectionId, params, admin = true) {
51
+ const base = admin ? '/admin' : '/public';
52
+ const path = `${base}/collection/${encodeURIComponent(collectionId)}/ai/postChat`;
53
+ return post(path, params);
54
+ }
55
+ ai.postChat = postChat;
56
+ })(ai || (ai = {}));
@@ -11,3 +11,5 @@ export { claimSet } from "./claimSet";
11
11
  export { crate } from "./crate";
12
12
  export { batch } from "./batch";
13
13
  export { variant } from "./variant";
14
+ export { ai } from "./ai";
15
+ export type { AIGenerateContentRequest, AIGenerateImageRequest, AISearchPhotosRequest, AISearchPhotosPhoto } from "./ai";
package/dist/api/index.js CHANGED
@@ -13,3 +13,4 @@ export { claimSet } from "./claimSet";
13
13
  export { crate } from "./crate";
14
14
  export { batch } from "./batch";
15
15
  export { variant } from "./variant";
16
+ export { ai } from "./ai";
@@ -26,7 +26,7 @@ export interface ProductResponse {
26
26
  };
27
27
  };
28
28
  /** Flexible map of tags with true/false values */
29
- groupTags: {
29
+ tags: {
30
30
  [tagName: string]: boolean;
31
31
  };
32
32
  /** Flexible key/value data map */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.0.37",
3
+ "version": "1.0.38",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",