priori-chat-sdk 1.0.26 → 1.0.27

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/index.d.mts CHANGED
@@ -8,6 +8,10 @@ type ApiAttribute = {
8
8
  */
9
9
  value: string;
10
10
  };
11
+ /**
12
+ * Image sending behaviour enum for client configuration
13
+ */
14
+ type ApiImageSendingBehaviour = "disabled" | "low" | "moderate" | "high" | "aggressive";
11
15
  type ApiModerationCategory = "underage_site_use" | "sexual_minors" | "beastiality" | "sexual_violence" | "prompt_injection";
12
16
  type ApiModerationInfo = {
13
17
  category: ApiModerationCategory;
@@ -18,6 +22,10 @@ type ApiModerationInfo = {
18
22
  severity: ApiModerationSeverity;
19
23
  };
20
24
  type ApiModerationSeverity = "Low" | "Medium" | "High" | "Critical";
25
+ /**
26
+ * Bot orientation — controls gender identity, pronouns, and attraction in the system prompt.
27
+ */
28
+ type ApiOrientation = "straight_female" | "lesbian_female" | "gay_man" | "straight_man" | "trans_mtf" | "trans_ftm" | "bisexual";
21
29
  /**
22
30
  * Represents an API key info (without the actual key)
23
31
  */
@@ -37,10 +45,6 @@ type Bot = {
37
45
  * Freeform text description
38
46
  */
39
47
  freeform: string;
40
- /**
41
- * Whether the bot is gay
42
- */
43
- gay: boolean;
44
48
  /**
45
49
  * Unique identifier for the bot
46
50
  */
@@ -49,6 +53,7 @@ type Bot = {
49
53
  * Name of the bot
50
54
  */
51
55
  name: string;
56
+ orientation: ApiOrientation;
52
57
  };
53
58
  type Chatter = {
54
59
  /**
@@ -65,6 +70,7 @@ type Chatter = {
65
70
  */
66
71
  type ClientConfig = {
67
72
  chat_images_enabled?: boolean | null;
73
+ image_sending_behaviour?: ApiImageSendingBehaviour | null;
68
74
  language?: Language | null;
69
75
  max_delay?: number | null;
70
76
  min_delay?: number | null;
@@ -148,14 +154,11 @@ type CreateBotRequestBody = {
148
154
  * Freeform text description
149
155
  */
150
156
  freeform?: string | null;
151
- /**
152
- * Whether the bot is gay
153
- */
154
- gay?: boolean | null;
155
157
  /**
156
158
  * Name of the bot
157
159
  */
158
160
  name: string;
161
+ orientation?: ApiOrientation | null;
159
162
  };
160
163
  type CreateBotResponse = {
161
164
  bot: Bot;
@@ -176,6 +179,32 @@ type CreateChatterResponse = {
176
179
  type CreateConversationResponse = {
177
180
  conversation: Conversation$1;
178
181
  };
182
+ type CreateConversionRequestBody = {
183
+ /**
184
+ * Amount of the conversion, can be negative for refunds. Value in cents.
185
+ */
186
+ amount?: number | null;
187
+ /**
188
+ * Optional bot ID to attribute the conversion to a specific bot
189
+ */
190
+ bot_id?: string | null;
191
+ /**
192
+ * Optional conversation ID to attribute the conversion to a specific conversation
193
+ */
194
+ conversation_id?: string | null;
195
+ /**
196
+ * Optional metadata to attach to the conversion, can be any JSON object
197
+ */
198
+ metadata?: unknown;
199
+ /**
200
+ * Optional unix timestamp (seconds) of when the conversion happened. Defaults to current time.
201
+ */
202
+ timestamp?: number | null;
203
+ /**
204
+ * User ID of the user who made the conversion. Should be the same as 'user_id' used in /messages
205
+ */
206
+ user_id: string;
207
+ };
179
208
  type DeactivateApiKeyResponse = {
180
209
  /**
181
210
  * Success message
@@ -190,10 +219,15 @@ type DeleteContentResponse = {
190
219
  };
191
220
  type GenerateResponseSyncRequest = {
192
221
  batch_size?: number;
222
+ /**
223
+ * Grammar degradation multiplier (0.0 = no degradation, 1.0 = full). Omit to disable.
224
+ */
225
+ degrade_grammar_factor?: number | null;
193
226
  /**
194
227
  * Optional list of messages to use instead of the conversation's stored message history.
195
228
  */
196
229
  override_messages?: Array<Message$1> | null;
230
+ vault_image_behaviour?: VaultImageBehaviour | null;
197
231
  };
198
232
  type GenerateResponseSyncResponse = {
199
233
  candidates: Array<ResponseCandidate>;
@@ -248,6 +282,9 @@ type GetMemoriesResponse = {
248
282
  */
249
283
  user_memories: Array<MemoryResponse>;
250
284
  };
285
+ type GetPlatformResponse = {
286
+ platform: Platform;
287
+ };
251
288
  type GetUserResponse = {
252
289
  user: User;
253
290
  };
@@ -265,10 +302,7 @@ type ImageItem = {
265
302
  */
266
303
  url: string;
267
304
  };
268
- /**
269
- * Language enum for client configuration
270
- */
271
- type Language = "en" | "es" | "fr" | "de" | "pt" | "it" | "ja" | "ko" | "zh" | "ru";
305
+ type Language = "en" | "de" | "ru" | "ar" | "es" | "nl" | "uk" | "fr" | "it";
272
306
  type ListApiKeysResponse = {
273
307
  /**
274
308
  * List of API keys for the client
@@ -328,6 +362,12 @@ type ListConversationsResponse = {
328
362
  */
329
363
  conversations: Array<ConversationHeader>;
330
364
  };
365
+ type ListPlatformsResponse = {
366
+ /**
367
+ * List of all platforms accessible to the current client
368
+ */
369
+ platforms: Array<Platform>;
370
+ };
331
371
  type MediaTypeFilter = "image" | "video";
332
372
  type MemoryResponse = {
333
373
  /**
@@ -360,6 +400,20 @@ type Message$1 = {
360
400
  */
361
401
  text: string;
362
402
  };
403
+ type Platform = {
404
+ /**
405
+ * Platform-specific instructions injected into the system prompt before bot-specific instructions. Used to customize AI behavior for platform-specific norms and guidelines.
406
+ */
407
+ custom_instruction?: string | null;
408
+ /**
409
+ * Unique identifier for the platform
410
+ */
411
+ id: string;
412
+ /**
413
+ * Name of the platform (immutable, case-sensitive, must be unique per client)
414
+ */
415
+ name: string;
416
+ };
363
417
  type ResponseCandidate = {
364
418
  messages: Array<Message$1>;
365
419
  };
@@ -409,10 +463,6 @@ type UpdateBotRequest = {
409
463
  * Freeform text description
410
464
  */
411
465
  freeform?: string | null;
412
- /**
413
- * Whether the bot is gay
414
- */
415
- gay?: boolean | null;
416
466
  /**
417
467
  * Optional list of images to set for this bot.
418
468
  * When provided, all existing bot images are replaced with these.
@@ -422,6 +472,7 @@ type UpdateBotRequest = {
422
472
  * Name of the bot
423
473
  */
424
474
  name?: string | null;
475
+ orientation?: ApiOrientation | null;
425
476
  };
426
477
  type UpdateBotResponse = {
427
478
  bot: Bot;
@@ -431,6 +482,7 @@ type UpdateBotResponse = {
431
482
  */
432
483
  type UpdateClientConfigRequest = {
433
484
  chat_images_enabled?: boolean | null;
485
+ image_sending_behaviour?: ApiImageSendingBehaviour | null;
434
486
  language?: Language | null;
435
487
  max_delay?: number | null;
436
488
  min_delay?: number | null;
@@ -443,6 +495,18 @@ type UpdateClientConfigRequest = {
443
495
  type UpdateClientConfigResponse = {
444
496
  config: ClientConfig;
445
497
  };
498
+ type UpdatePlatformRequestBody = {
499
+ /**
500
+ * Platform-specific instructions to inject into the system prompt before bot-specific instructions
501
+ */
502
+ custom_instruction?: string | null;
503
+ };
504
+ type UpdatePlatformResponse = {
505
+ /**
506
+ * Whether the update was successful
507
+ */
508
+ success: boolean;
509
+ };
446
510
  type UpdateUserRequest = {
447
511
  /**
448
512
  * List of user attributes
@@ -503,6 +567,7 @@ type User = {
503
567
  */
504
568
  username: string;
505
569
  };
570
+ type VaultImageBehaviour = "force" | "never";
506
571
  type CreateApiKeyData = {
507
572
  body: CreateApiKeyRequest;
508
573
  path?: never;
@@ -669,6 +734,14 @@ type ListConversationsData = {
669
734
  * Filter by moderation category (repeatable). Values: underage_site_use, sexual_minors, beastiality, sexual_violence, prompt_injection
670
735
  */
671
736
  categories?: Array<string> | null;
737
+ /**
738
+ * Maximum number of conversations to return (default: 1000)
739
+ */
740
+ limit?: number | null;
741
+ /**
742
+ * Number of conversations to skip before returning results (default: 0)
743
+ */
744
+ offset?: number | null;
672
745
  };
673
746
  url: "/api/conversations";
674
747
  };
@@ -695,6 +768,13 @@ type UpdateUserData = {
695
768
  url: "/api/users/{user_id}";
696
769
  };
697
770
 
771
+ interface GetPlatformOptions {
772
+ platform_id: string;
773
+ }
774
+ interface UpdatePlatformOptions extends UpdatePlatformRequestBody {
775
+ platform_id: string;
776
+ }
777
+
698
778
  /**
699
779
  * Options for listing conversations
700
780
  */
@@ -1378,6 +1458,63 @@ declare class PrioriChat {
1378
1458
  * ```
1379
1459
  */
1380
1460
  deactivateChatter(options: DeactivateChatterData["path"]): Promise<void>;
1461
+ /**
1462
+ * Lists all platforms accessible to the current client
1463
+ * @example
1464
+ * ```ts
1465
+ * const client = new PrioriChat("your-api-key");
1466
+ *
1467
+ * const result = await client.listPlatforms();
1468
+ * console.log(`Found ${result.platforms.length} platforms`);
1469
+ * ```
1470
+ */
1471
+ listPlatforms(): Promise<ListPlatformsResponse>;
1472
+ /**
1473
+ * Retrieves a specific platform by ID
1474
+ * @example
1475
+ * ```ts
1476
+ * const client = new PrioriChat("your-api-key");
1477
+ *
1478
+ * const result = await client.getPlatform({
1479
+ * platform_id: "12345678-1234-1234-1234-123456789012"
1480
+ * });
1481
+ *
1482
+ * console.log(`Platform name: ${result.platform.name}`);
1483
+ * ```
1484
+ */
1485
+ getPlatform(options: GetPlatformOptions): Promise<GetPlatformResponse>;
1486
+ /**
1487
+ * Updates an existing platform
1488
+ * @example
1489
+ * ```ts
1490
+ * const client = new PrioriChat("your-api-key");
1491
+ *
1492
+ * const result = await client.updatePlatform({
1493
+ * platform_id: "12345678-1234-1234-1234-123456789012",
1494
+ * custom_instruction: "Be warm and helpful"
1495
+ * });
1496
+ *
1497
+ * console.log(`Updated platform successfully`);
1498
+ * ```
1499
+ */
1500
+ updatePlatform(options: UpdatePlatformOptions): Promise<UpdatePlatformResponse>;
1501
+ /**
1502
+ * Creates a conversion record for tracking revenue or events
1503
+ * @example
1504
+ * ```ts
1505
+ * const client = new PrioriChat("your-api-key");
1506
+ *
1507
+ * await client.createConversion({
1508
+ * user_id: "user-123",
1509
+ * bot_id: "12345678-1234-1234-1234-123456789012",
1510
+ * amount: 4999, // Value in cents
1511
+ * timestamp: Math.floor(Date.now() / 1000)
1512
+ * });
1513
+ *
1514
+ * console.log("Conversion recorded");
1515
+ * ```
1516
+ */
1517
+ createConversion(options: CreateConversionRequestBody): Promise<void>;
1381
1518
  }
1382
1519
 
1383
- export { type ApiAttribute, ApiError, type ApiKeyInfo, type ApiModerationCategory, type ApiModerationInfo, type ApiModerationSeverity, type AttachedMedia, type Bot, type Chatter, type ClientConfig, type Content, Conversation, type ConversationCallbacks, type ConversationHeader, type ConversationOptions, type Conversation$1 as ConversationType, type ConversationWithId, type ConversationWithUserBot, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBotRequestBody, type CreateBotResponse, type CreateChatterRequestBody, type CreateChatterResponse, type CreateConversationOptions, type CreateConversationResponse, type DeactivateApiKeyData, type DeactivateApiKeyResponse, type DeactivateChatterData, type DeleteContentResponse, type GenerateResponseOptions, type GenerateResponseSyncRequest, type GenerateResponseSyncResponse, type GetBotResponse, type GetChatterData, type GetChatterResponse, type GetClientConfigResponse, type GetConversationOptions, type GetConversationResponse, type GetMemoriesResponse, type GetUserData, type GetUserResponse, type Language, type ListApiKeysResponse, type ListBotsResponse, type ListChattersResponse, type ListContentQuery, type ListContentResponse, type ListConversationsOptions, type ListConversationsResponse, type MediaTypeFilter, type MemoryResponse, type Message, PrioriChat, type ResponseCandidate, type SearchedMessage, type Summary, type UpdateBotRequest, type UpdateBotResponse, type UpdateClientConfigRequest, type UpdateClientConfigResponse, type UpdateUserData, type UpdateUserRequest, type UpdateUserResponse, type UploadContentRequest, type UploadContentResponse, type User };
1520
+ export { type ApiAttribute, ApiError, type ApiKeyInfo, type ApiModerationCategory, type ApiModerationInfo, type ApiModerationSeverity, type AttachedMedia, type Bot, type Chatter, type ClientConfig, type Content, Conversation, type ConversationCallbacks, type ConversationHeader, type ConversationOptions, type Conversation$1 as ConversationType, type ConversationWithId, type ConversationWithUserBot, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBotRequestBody, type CreateBotResponse, type CreateChatterRequestBody, type CreateChatterResponse, type CreateConversationOptions, type CreateConversationResponse, type CreateConversionRequestBody, type DeactivateApiKeyData, type DeactivateApiKeyResponse, type DeactivateChatterData, type DeleteContentResponse, type GenerateResponseOptions, type GenerateResponseSyncRequest, type GenerateResponseSyncResponse, type GetBotResponse, type GetChatterData, type GetChatterResponse, type GetClientConfigResponse, type GetConversationOptions, type GetConversationResponse, type GetMemoriesResponse, type GetPlatformResponse, type GetUserData, type GetUserResponse, type Language, type ListApiKeysResponse, type ListBotsResponse, type ListChattersResponse, type ListContentQuery, type ListContentResponse, type ListConversationsOptions, type ListConversationsResponse, type ListPlatformsResponse, type MediaTypeFilter, type MemoryResponse, type Message, type Platform, PrioriChat, type ResponseCandidate, type SearchedMessage, type Summary, type UpdateBotRequest, type UpdateBotResponse, type UpdateClientConfigRequest, type UpdateClientConfigResponse, type UpdatePlatformRequestBody, type UpdatePlatformResponse, type UpdateUserData, type UpdateUserRequest, type UpdateUserResponse, type UploadContentRequest, type UploadContentResponse, type User };
package/dist/index.d.ts CHANGED
@@ -8,6 +8,10 @@ type ApiAttribute = {
8
8
  */
9
9
  value: string;
10
10
  };
11
+ /**
12
+ * Image sending behaviour enum for client configuration
13
+ */
14
+ type ApiImageSendingBehaviour = "disabled" | "low" | "moderate" | "high" | "aggressive";
11
15
  type ApiModerationCategory = "underage_site_use" | "sexual_minors" | "beastiality" | "sexual_violence" | "prompt_injection";
12
16
  type ApiModerationInfo = {
13
17
  category: ApiModerationCategory;
@@ -18,6 +22,10 @@ type ApiModerationInfo = {
18
22
  severity: ApiModerationSeverity;
19
23
  };
20
24
  type ApiModerationSeverity = "Low" | "Medium" | "High" | "Critical";
25
+ /**
26
+ * Bot orientation — controls gender identity, pronouns, and attraction in the system prompt.
27
+ */
28
+ type ApiOrientation = "straight_female" | "lesbian_female" | "gay_man" | "straight_man" | "trans_mtf" | "trans_ftm" | "bisexual";
21
29
  /**
22
30
  * Represents an API key info (without the actual key)
23
31
  */
@@ -37,10 +45,6 @@ type Bot = {
37
45
  * Freeform text description
38
46
  */
39
47
  freeform: string;
40
- /**
41
- * Whether the bot is gay
42
- */
43
- gay: boolean;
44
48
  /**
45
49
  * Unique identifier for the bot
46
50
  */
@@ -49,6 +53,7 @@ type Bot = {
49
53
  * Name of the bot
50
54
  */
51
55
  name: string;
56
+ orientation: ApiOrientation;
52
57
  };
53
58
  type Chatter = {
54
59
  /**
@@ -65,6 +70,7 @@ type Chatter = {
65
70
  */
66
71
  type ClientConfig = {
67
72
  chat_images_enabled?: boolean | null;
73
+ image_sending_behaviour?: ApiImageSendingBehaviour | null;
68
74
  language?: Language | null;
69
75
  max_delay?: number | null;
70
76
  min_delay?: number | null;
@@ -148,14 +154,11 @@ type CreateBotRequestBody = {
148
154
  * Freeform text description
149
155
  */
150
156
  freeform?: string | null;
151
- /**
152
- * Whether the bot is gay
153
- */
154
- gay?: boolean | null;
155
157
  /**
156
158
  * Name of the bot
157
159
  */
158
160
  name: string;
161
+ orientation?: ApiOrientation | null;
159
162
  };
160
163
  type CreateBotResponse = {
161
164
  bot: Bot;
@@ -176,6 +179,32 @@ type CreateChatterResponse = {
176
179
  type CreateConversationResponse = {
177
180
  conversation: Conversation$1;
178
181
  };
182
+ type CreateConversionRequestBody = {
183
+ /**
184
+ * Amount of the conversion, can be negative for refunds. Value in cents.
185
+ */
186
+ amount?: number | null;
187
+ /**
188
+ * Optional bot ID to attribute the conversion to a specific bot
189
+ */
190
+ bot_id?: string | null;
191
+ /**
192
+ * Optional conversation ID to attribute the conversion to a specific conversation
193
+ */
194
+ conversation_id?: string | null;
195
+ /**
196
+ * Optional metadata to attach to the conversion, can be any JSON object
197
+ */
198
+ metadata?: unknown;
199
+ /**
200
+ * Optional unix timestamp (seconds) of when the conversion happened. Defaults to current time.
201
+ */
202
+ timestamp?: number | null;
203
+ /**
204
+ * User ID of the user who made the conversion. Should be the same as 'user_id' used in /messages
205
+ */
206
+ user_id: string;
207
+ };
179
208
  type DeactivateApiKeyResponse = {
180
209
  /**
181
210
  * Success message
@@ -190,10 +219,15 @@ type DeleteContentResponse = {
190
219
  };
191
220
  type GenerateResponseSyncRequest = {
192
221
  batch_size?: number;
222
+ /**
223
+ * Grammar degradation multiplier (0.0 = no degradation, 1.0 = full). Omit to disable.
224
+ */
225
+ degrade_grammar_factor?: number | null;
193
226
  /**
194
227
  * Optional list of messages to use instead of the conversation's stored message history.
195
228
  */
196
229
  override_messages?: Array<Message$1> | null;
230
+ vault_image_behaviour?: VaultImageBehaviour | null;
197
231
  };
198
232
  type GenerateResponseSyncResponse = {
199
233
  candidates: Array<ResponseCandidate>;
@@ -248,6 +282,9 @@ type GetMemoriesResponse = {
248
282
  */
249
283
  user_memories: Array<MemoryResponse>;
250
284
  };
285
+ type GetPlatformResponse = {
286
+ platform: Platform;
287
+ };
251
288
  type GetUserResponse = {
252
289
  user: User;
253
290
  };
@@ -265,10 +302,7 @@ type ImageItem = {
265
302
  */
266
303
  url: string;
267
304
  };
268
- /**
269
- * Language enum for client configuration
270
- */
271
- type Language = "en" | "es" | "fr" | "de" | "pt" | "it" | "ja" | "ko" | "zh" | "ru";
305
+ type Language = "en" | "de" | "ru" | "ar" | "es" | "nl" | "uk" | "fr" | "it";
272
306
  type ListApiKeysResponse = {
273
307
  /**
274
308
  * List of API keys for the client
@@ -328,6 +362,12 @@ type ListConversationsResponse = {
328
362
  */
329
363
  conversations: Array<ConversationHeader>;
330
364
  };
365
+ type ListPlatformsResponse = {
366
+ /**
367
+ * List of all platforms accessible to the current client
368
+ */
369
+ platforms: Array<Platform>;
370
+ };
331
371
  type MediaTypeFilter = "image" | "video";
332
372
  type MemoryResponse = {
333
373
  /**
@@ -360,6 +400,20 @@ type Message$1 = {
360
400
  */
361
401
  text: string;
362
402
  };
403
+ type Platform = {
404
+ /**
405
+ * Platform-specific instructions injected into the system prompt before bot-specific instructions. Used to customize AI behavior for platform-specific norms and guidelines.
406
+ */
407
+ custom_instruction?: string | null;
408
+ /**
409
+ * Unique identifier for the platform
410
+ */
411
+ id: string;
412
+ /**
413
+ * Name of the platform (immutable, case-sensitive, must be unique per client)
414
+ */
415
+ name: string;
416
+ };
363
417
  type ResponseCandidate = {
364
418
  messages: Array<Message$1>;
365
419
  };
@@ -409,10 +463,6 @@ type UpdateBotRequest = {
409
463
  * Freeform text description
410
464
  */
411
465
  freeform?: string | null;
412
- /**
413
- * Whether the bot is gay
414
- */
415
- gay?: boolean | null;
416
466
  /**
417
467
  * Optional list of images to set for this bot.
418
468
  * When provided, all existing bot images are replaced with these.
@@ -422,6 +472,7 @@ type UpdateBotRequest = {
422
472
  * Name of the bot
423
473
  */
424
474
  name?: string | null;
475
+ orientation?: ApiOrientation | null;
425
476
  };
426
477
  type UpdateBotResponse = {
427
478
  bot: Bot;
@@ -431,6 +482,7 @@ type UpdateBotResponse = {
431
482
  */
432
483
  type UpdateClientConfigRequest = {
433
484
  chat_images_enabled?: boolean | null;
485
+ image_sending_behaviour?: ApiImageSendingBehaviour | null;
434
486
  language?: Language | null;
435
487
  max_delay?: number | null;
436
488
  min_delay?: number | null;
@@ -443,6 +495,18 @@ type UpdateClientConfigRequest = {
443
495
  type UpdateClientConfigResponse = {
444
496
  config: ClientConfig;
445
497
  };
498
+ type UpdatePlatformRequestBody = {
499
+ /**
500
+ * Platform-specific instructions to inject into the system prompt before bot-specific instructions
501
+ */
502
+ custom_instruction?: string | null;
503
+ };
504
+ type UpdatePlatformResponse = {
505
+ /**
506
+ * Whether the update was successful
507
+ */
508
+ success: boolean;
509
+ };
446
510
  type UpdateUserRequest = {
447
511
  /**
448
512
  * List of user attributes
@@ -503,6 +567,7 @@ type User = {
503
567
  */
504
568
  username: string;
505
569
  };
570
+ type VaultImageBehaviour = "force" | "never";
506
571
  type CreateApiKeyData = {
507
572
  body: CreateApiKeyRequest;
508
573
  path?: never;
@@ -669,6 +734,14 @@ type ListConversationsData = {
669
734
  * Filter by moderation category (repeatable). Values: underage_site_use, sexual_minors, beastiality, sexual_violence, prompt_injection
670
735
  */
671
736
  categories?: Array<string> | null;
737
+ /**
738
+ * Maximum number of conversations to return (default: 1000)
739
+ */
740
+ limit?: number | null;
741
+ /**
742
+ * Number of conversations to skip before returning results (default: 0)
743
+ */
744
+ offset?: number | null;
672
745
  };
673
746
  url: "/api/conversations";
674
747
  };
@@ -695,6 +768,13 @@ type UpdateUserData = {
695
768
  url: "/api/users/{user_id}";
696
769
  };
697
770
 
771
+ interface GetPlatformOptions {
772
+ platform_id: string;
773
+ }
774
+ interface UpdatePlatformOptions extends UpdatePlatformRequestBody {
775
+ platform_id: string;
776
+ }
777
+
698
778
  /**
699
779
  * Options for listing conversations
700
780
  */
@@ -1378,6 +1458,63 @@ declare class PrioriChat {
1378
1458
  * ```
1379
1459
  */
1380
1460
  deactivateChatter(options: DeactivateChatterData["path"]): Promise<void>;
1461
+ /**
1462
+ * Lists all platforms accessible to the current client
1463
+ * @example
1464
+ * ```ts
1465
+ * const client = new PrioriChat("your-api-key");
1466
+ *
1467
+ * const result = await client.listPlatforms();
1468
+ * console.log(`Found ${result.platforms.length} platforms`);
1469
+ * ```
1470
+ */
1471
+ listPlatforms(): Promise<ListPlatformsResponse>;
1472
+ /**
1473
+ * Retrieves a specific platform by ID
1474
+ * @example
1475
+ * ```ts
1476
+ * const client = new PrioriChat("your-api-key");
1477
+ *
1478
+ * const result = await client.getPlatform({
1479
+ * platform_id: "12345678-1234-1234-1234-123456789012"
1480
+ * });
1481
+ *
1482
+ * console.log(`Platform name: ${result.platform.name}`);
1483
+ * ```
1484
+ */
1485
+ getPlatform(options: GetPlatformOptions): Promise<GetPlatformResponse>;
1486
+ /**
1487
+ * Updates an existing platform
1488
+ * @example
1489
+ * ```ts
1490
+ * const client = new PrioriChat("your-api-key");
1491
+ *
1492
+ * const result = await client.updatePlatform({
1493
+ * platform_id: "12345678-1234-1234-1234-123456789012",
1494
+ * custom_instruction: "Be warm and helpful"
1495
+ * });
1496
+ *
1497
+ * console.log(`Updated platform successfully`);
1498
+ * ```
1499
+ */
1500
+ updatePlatform(options: UpdatePlatformOptions): Promise<UpdatePlatformResponse>;
1501
+ /**
1502
+ * Creates a conversion record for tracking revenue or events
1503
+ * @example
1504
+ * ```ts
1505
+ * const client = new PrioriChat("your-api-key");
1506
+ *
1507
+ * await client.createConversion({
1508
+ * user_id: "user-123",
1509
+ * bot_id: "12345678-1234-1234-1234-123456789012",
1510
+ * amount: 4999, // Value in cents
1511
+ * timestamp: Math.floor(Date.now() / 1000)
1512
+ * });
1513
+ *
1514
+ * console.log("Conversion recorded");
1515
+ * ```
1516
+ */
1517
+ createConversion(options: CreateConversionRequestBody): Promise<void>;
1381
1518
  }
1382
1519
 
1383
- export { type ApiAttribute, ApiError, type ApiKeyInfo, type ApiModerationCategory, type ApiModerationInfo, type ApiModerationSeverity, type AttachedMedia, type Bot, type Chatter, type ClientConfig, type Content, Conversation, type ConversationCallbacks, type ConversationHeader, type ConversationOptions, type Conversation$1 as ConversationType, type ConversationWithId, type ConversationWithUserBot, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBotRequestBody, type CreateBotResponse, type CreateChatterRequestBody, type CreateChatterResponse, type CreateConversationOptions, type CreateConversationResponse, type DeactivateApiKeyData, type DeactivateApiKeyResponse, type DeactivateChatterData, type DeleteContentResponse, type GenerateResponseOptions, type GenerateResponseSyncRequest, type GenerateResponseSyncResponse, type GetBotResponse, type GetChatterData, type GetChatterResponse, type GetClientConfigResponse, type GetConversationOptions, type GetConversationResponse, type GetMemoriesResponse, type GetUserData, type GetUserResponse, type Language, type ListApiKeysResponse, type ListBotsResponse, type ListChattersResponse, type ListContentQuery, type ListContentResponse, type ListConversationsOptions, type ListConversationsResponse, type MediaTypeFilter, type MemoryResponse, type Message, PrioriChat, type ResponseCandidate, type SearchedMessage, type Summary, type UpdateBotRequest, type UpdateBotResponse, type UpdateClientConfigRequest, type UpdateClientConfigResponse, type UpdateUserData, type UpdateUserRequest, type UpdateUserResponse, type UploadContentRequest, type UploadContentResponse, type User };
1520
+ export { type ApiAttribute, ApiError, type ApiKeyInfo, type ApiModerationCategory, type ApiModerationInfo, type ApiModerationSeverity, type AttachedMedia, type Bot, type Chatter, type ClientConfig, type Content, Conversation, type ConversationCallbacks, type ConversationHeader, type ConversationOptions, type Conversation$1 as ConversationType, type ConversationWithId, type ConversationWithUserBot, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateBotRequestBody, type CreateBotResponse, type CreateChatterRequestBody, type CreateChatterResponse, type CreateConversationOptions, type CreateConversationResponse, type CreateConversionRequestBody, type DeactivateApiKeyData, type DeactivateApiKeyResponse, type DeactivateChatterData, type DeleteContentResponse, type GenerateResponseOptions, type GenerateResponseSyncRequest, type GenerateResponseSyncResponse, type GetBotResponse, type GetChatterData, type GetChatterResponse, type GetClientConfigResponse, type GetConversationOptions, type GetConversationResponse, type GetMemoriesResponse, type GetPlatformResponse, type GetUserData, type GetUserResponse, type Language, type ListApiKeysResponse, type ListBotsResponse, type ListChattersResponse, type ListContentQuery, type ListContentResponse, type ListConversationsOptions, type ListConversationsResponse, type ListPlatformsResponse, type MediaTypeFilter, type MemoryResponse, type Message, type Platform, PrioriChat, type ResponseCandidate, type SearchedMessage, type Summary, type UpdateBotRequest, type UpdateBotResponse, type UpdateClientConfigRequest, type UpdateClientConfigResponse, type UpdatePlatformRequestBody, type UpdatePlatformResponse, type UpdateUserData, type UpdateUserRequest, type UpdateUserResponse, type UploadContentRequest, type UploadContentResponse, type User };
package/dist/index.js CHANGED
@@ -701,6 +701,41 @@ var sendMessage = (options) => {
701
701
  }
702
702
  });
703
703
  };
704
+ var createConversion = (options) => {
705
+ return (options.client ?? client).post({
706
+ url: "/api/conversion",
707
+ ...options,
708
+ headers: {
709
+ "Content-Type": "application/json",
710
+ ...options.headers
711
+ }
712
+ });
713
+ };
714
+ var listPlatforms = (options) => {
715
+ return (options?.client ?? client).get({
716
+ responseType: "json",
717
+ url: "/api/platforms",
718
+ ...options
719
+ });
720
+ };
721
+ var getPlatform = (options) => {
722
+ return (options.client ?? client).get({
723
+ responseType: "json",
724
+ url: "/api/platforms/{platform_id}",
725
+ ...options
726
+ });
727
+ };
728
+ var updatePlatform = (options) => {
729
+ return (options.client ?? client).patch({
730
+ responseType: "json",
731
+ url: "/api/platforms/{platform_id}",
732
+ ...options,
733
+ headers: {
734
+ "Content-Type": "application/json",
735
+ ...options.headers
736
+ }
737
+ });
738
+ };
704
739
  var getUser = (options) => {
705
740
  return (options.client ?? client).get({
706
741
  responseType: "json",
@@ -866,6 +901,29 @@ async function deactivateChatterImpl(options) {
866
901
  });
867
902
  }
868
903
 
904
+ // src/methods/platforms.ts
905
+ async function listPlatformsImpl() {
906
+ const result = await listPlatforms({});
907
+ return result.data;
908
+ }
909
+ async function getPlatformImpl(options) {
910
+ const result = await getPlatform({ path: options });
911
+ return result.data;
912
+ }
913
+ async function updatePlatformImpl(options) {
914
+ const { platform_id, ...body } = options;
915
+ const result = await updatePlatform({
916
+ path: { platform_id },
917
+ body
918
+ });
919
+ return result.data;
920
+ }
921
+
922
+ // src/methods/conversions.ts
923
+ async function createConversionImpl(options) {
924
+ await createConversion({ body: options });
925
+ }
926
+
869
927
  // src/conversation.ts
870
928
  var Conversation = class _Conversation {
871
929
  constructor(client2, options, callbacks = {}) {
@@ -1650,6 +1708,71 @@ var PrioriChat = class {
1650
1708
  async deactivateChatter(options) {
1651
1709
  return deactivateChatterImpl.call(this, options);
1652
1710
  }
1711
+ /**
1712
+ * Lists all platforms accessible to the current client
1713
+ * @example
1714
+ * ```ts
1715
+ * const client = new PrioriChat("your-api-key");
1716
+ *
1717
+ * const result = await client.listPlatforms();
1718
+ * console.log(`Found ${result.platforms.length} platforms`);
1719
+ * ```
1720
+ */
1721
+ async listPlatforms() {
1722
+ return listPlatformsImpl.call(this);
1723
+ }
1724
+ /**
1725
+ * Retrieves a specific platform by ID
1726
+ * @example
1727
+ * ```ts
1728
+ * const client = new PrioriChat("your-api-key");
1729
+ *
1730
+ * const result = await client.getPlatform({
1731
+ * platform_id: "12345678-1234-1234-1234-123456789012"
1732
+ * });
1733
+ *
1734
+ * console.log(`Platform name: ${result.platform.name}`);
1735
+ * ```
1736
+ */
1737
+ async getPlatform(options) {
1738
+ return getPlatformImpl.call(this, options);
1739
+ }
1740
+ /**
1741
+ * Updates an existing platform
1742
+ * @example
1743
+ * ```ts
1744
+ * const client = new PrioriChat("your-api-key");
1745
+ *
1746
+ * const result = await client.updatePlatform({
1747
+ * platform_id: "12345678-1234-1234-1234-123456789012",
1748
+ * custom_instruction: "Be warm and helpful"
1749
+ * });
1750
+ *
1751
+ * console.log(`Updated platform successfully`);
1752
+ * ```
1753
+ */
1754
+ async updatePlatform(options) {
1755
+ return updatePlatformImpl.call(this, options);
1756
+ }
1757
+ /**
1758
+ * Creates a conversion record for tracking revenue or events
1759
+ * @example
1760
+ * ```ts
1761
+ * const client = new PrioriChat("your-api-key");
1762
+ *
1763
+ * await client.createConversion({
1764
+ * user_id: "user-123",
1765
+ * bot_id: "12345678-1234-1234-1234-123456789012",
1766
+ * amount: 4999, // Value in cents
1767
+ * timestamp: Math.floor(Date.now() / 1000)
1768
+ * });
1769
+ *
1770
+ * console.log("Conversion recorded");
1771
+ * ```
1772
+ */
1773
+ async createConversion(options) {
1774
+ return createConversionImpl.call(this, options);
1775
+ }
1653
1776
  };
1654
1777
  // Annotate the CommonJS export names for ESM import in node:
1655
1778
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -665,6 +665,41 @@ var sendMessage = (options) => {
665
665
  }
666
666
  });
667
667
  };
668
+ var createConversion = (options) => {
669
+ return (options.client ?? client).post({
670
+ url: "/api/conversion",
671
+ ...options,
672
+ headers: {
673
+ "Content-Type": "application/json",
674
+ ...options.headers
675
+ }
676
+ });
677
+ };
678
+ var listPlatforms = (options) => {
679
+ return (options?.client ?? client).get({
680
+ responseType: "json",
681
+ url: "/api/platforms",
682
+ ...options
683
+ });
684
+ };
685
+ var getPlatform = (options) => {
686
+ return (options.client ?? client).get({
687
+ responseType: "json",
688
+ url: "/api/platforms/{platform_id}",
689
+ ...options
690
+ });
691
+ };
692
+ var updatePlatform = (options) => {
693
+ return (options.client ?? client).patch({
694
+ responseType: "json",
695
+ url: "/api/platforms/{platform_id}",
696
+ ...options,
697
+ headers: {
698
+ "Content-Type": "application/json",
699
+ ...options.headers
700
+ }
701
+ });
702
+ };
668
703
  var getUser = (options) => {
669
704
  return (options.client ?? client).get({
670
705
  responseType: "json",
@@ -830,6 +865,29 @@ async function deactivateChatterImpl(options) {
830
865
  });
831
866
  }
832
867
 
868
+ // src/methods/platforms.ts
869
+ async function listPlatformsImpl() {
870
+ const result = await listPlatforms({});
871
+ return result.data;
872
+ }
873
+ async function getPlatformImpl(options) {
874
+ const result = await getPlatform({ path: options });
875
+ return result.data;
876
+ }
877
+ async function updatePlatformImpl(options) {
878
+ const { platform_id, ...body } = options;
879
+ const result = await updatePlatform({
880
+ path: { platform_id },
881
+ body
882
+ });
883
+ return result.data;
884
+ }
885
+
886
+ // src/methods/conversions.ts
887
+ async function createConversionImpl(options) {
888
+ await createConversion({ body: options });
889
+ }
890
+
833
891
  // src/conversation.ts
834
892
  var Conversation = class _Conversation {
835
893
  constructor(client2, options, callbacks = {}) {
@@ -1614,6 +1672,71 @@ var PrioriChat = class {
1614
1672
  async deactivateChatter(options) {
1615
1673
  return deactivateChatterImpl.call(this, options);
1616
1674
  }
1675
+ /**
1676
+ * Lists all platforms accessible to the current client
1677
+ * @example
1678
+ * ```ts
1679
+ * const client = new PrioriChat("your-api-key");
1680
+ *
1681
+ * const result = await client.listPlatforms();
1682
+ * console.log(`Found ${result.platforms.length} platforms`);
1683
+ * ```
1684
+ */
1685
+ async listPlatforms() {
1686
+ return listPlatformsImpl.call(this);
1687
+ }
1688
+ /**
1689
+ * Retrieves a specific platform by ID
1690
+ * @example
1691
+ * ```ts
1692
+ * const client = new PrioriChat("your-api-key");
1693
+ *
1694
+ * const result = await client.getPlatform({
1695
+ * platform_id: "12345678-1234-1234-1234-123456789012"
1696
+ * });
1697
+ *
1698
+ * console.log(`Platform name: ${result.platform.name}`);
1699
+ * ```
1700
+ */
1701
+ async getPlatform(options) {
1702
+ return getPlatformImpl.call(this, options);
1703
+ }
1704
+ /**
1705
+ * Updates an existing platform
1706
+ * @example
1707
+ * ```ts
1708
+ * const client = new PrioriChat("your-api-key");
1709
+ *
1710
+ * const result = await client.updatePlatform({
1711
+ * platform_id: "12345678-1234-1234-1234-123456789012",
1712
+ * custom_instruction: "Be warm and helpful"
1713
+ * });
1714
+ *
1715
+ * console.log(`Updated platform successfully`);
1716
+ * ```
1717
+ */
1718
+ async updatePlatform(options) {
1719
+ return updatePlatformImpl.call(this, options);
1720
+ }
1721
+ /**
1722
+ * Creates a conversion record for tracking revenue or events
1723
+ * @example
1724
+ * ```ts
1725
+ * const client = new PrioriChat("your-api-key");
1726
+ *
1727
+ * await client.createConversion({
1728
+ * user_id: "user-123",
1729
+ * bot_id: "12345678-1234-1234-1234-123456789012",
1730
+ * amount: 4999, // Value in cents
1731
+ * timestamp: Math.floor(Date.now() / 1000)
1732
+ * });
1733
+ *
1734
+ * console.log("Conversion recorded");
1735
+ * ```
1736
+ */
1737
+ async createConversion(options) {
1738
+ return createConversionImpl.call(this, options);
1739
+ }
1617
1740
  };
1618
1741
  export {
1619
1742
  ApiError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "priori-chat-sdk",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "TypeScript SDK for Priori Chat API",
5
5
  "main": "src/index.ts",
6
6
  "module": "dist/index.mjs",
package/src/index.ts CHANGED
@@ -68,4 +68,10 @@ export type {
68
68
  GetChatterData,
69
69
  ListChattersResponse,
70
70
  DeactivateChatterData,
71
+ Platform,
72
+ ListPlatformsResponse,
73
+ GetPlatformResponse,
74
+ UpdatePlatformRequestBody,
75
+ UpdatePlatformResponse,
76
+ CreateConversionRequestBody,
71
77
  } from "./client/types.gen";