@bitbitpress/client 0.1.15 → 1.0.1
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/README.md +154 -0
- package/dist/generated/openapi.d.ts +397 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/user/index.d.ts +17 -0
- package/dist/user/index.d.ts.map +1 -1
- package/dist/user/index.js +3 -0
- package/dist/user/index.js.map +1 -1
- package/dist/user/interaction.d.ts +27 -0
- package/dist/user/interaction.d.ts.map +1 -0
- package/dist/user/interaction.js +44 -0
- package/dist/user/interaction.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,6 +51,8 @@ More details can also be found in your control room's API docs @ https://your-co
|
|
|
51
51
|
- [signalItem](#signalitem)
|
|
52
52
|
- [synthesizeItem](#synthesizeitem)
|
|
53
53
|
- [synthesize](#synthesize)
|
|
54
|
+
- [interactions](#interactions)
|
|
55
|
+
- [respondToInteraction](#respondtointeraction)
|
|
54
56
|
- [Data Methods](#data-methods)
|
|
55
57
|
- [assets](#assets)
|
|
56
58
|
- [Types](#types)
|
|
@@ -578,6 +580,98 @@ for await (const event of stream) {
|
|
|
578
580
|
|
|
579
581
|
---
|
|
580
582
|
|
|
583
|
+
#### interactions
|
|
584
|
+
|
|
585
|
+
Batch-resolve interaction state for items from a synthesis output. Returns aggregates and whether the current user has already responded to each.
|
|
586
|
+
|
|
587
|
+
```typescript
|
|
588
|
+
client.user.interactions(options: InteractionsRequest): Promise<InteractionsResponse>
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
##### Parameters
|
|
592
|
+
|
|
593
|
+
- `options.synthesisConfigKeyName` (required): Key name of the synthesis config these interactions belong to
|
|
594
|
+
- `options.interactions` (required): Array of interactions to resolve, each with:
|
|
595
|
+
- `type` (required): Interaction type — `"POLL"`
|
|
596
|
+
- `content` (required): Canonical JSON string of the interaction content (e.g. question + options for a POLL)
|
|
597
|
+
|
|
598
|
+
##### Returns
|
|
599
|
+
|
|
600
|
+
- `Promise<InteractionsResponse>`: Array of resolved interaction items, each with:
|
|
601
|
+
- `id: string`: Interaction ID
|
|
602
|
+
- `type: string`: Interaction type
|
|
603
|
+
- `content: string`: Canonical JSON string of the interaction content
|
|
604
|
+
- `hasResponded: boolean`: Whether the current user has already responded
|
|
605
|
+
- `aggregates: Record<string, unknown>`: Current aggregate data (e.g. vote counts)
|
|
606
|
+
|
|
607
|
+
##### Example
|
|
608
|
+
|
|
609
|
+
```typescript
|
|
610
|
+
const interactions = await client.user.interactions({
|
|
611
|
+
synthesisConfigKeyName: 'my-synthesis-config',
|
|
612
|
+
interactions: [
|
|
613
|
+
{
|
|
614
|
+
type: 'POLL',
|
|
615
|
+
content: JSON.stringify({ question: 'Which do you prefer?', options: [{ id: 'a', text: 'Option A' }, { id: 'b', text: 'Option B' }] }),
|
|
616
|
+
},
|
|
617
|
+
],
|
|
618
|
+
});
|
|
619
|
+
|
|
620
|
+
for (const item of interactions) {
|
|
621
|
+
console.log('Interaction ID:', item.id);
|
|
622
|
+
console.log('Has responded:', item.hasResponded);
|
|
623
|
+
console.log('Aggregates:', item.aggregates);
|
|
624
|
+
}
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
##### Throws
|
|
628
|
+
|
|
629
|
+
- `Error`: If the request fails or no data is returned
|
|
630
|
+
|
|
631
|
+
---
|
|
632
|
+
|
|
633
|
+
#### respondToInteraction
|
|
634
|
+
|
|
635
|
+
Submit or update a response to an interaction (e.g. a poll answer). Returns updated aggregates.
|
|
636
|
+
|
|
637
|
+
```typescript
|
|
638
|
+
client.user.respondToInteraction(
|
|
639
|
+
interactionId: string,
|
|
640
|
+
options: InteractionResponseRequest,
|
|
641
|
+
): Promise<InteractionResponseResponse>
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
##### Parameters
|
|
645
|
+
|
|
646
|
+
- `interactionId` (required): ID of the interaction to respond to (from `interactions()`)
|
|
647
|
+
- `options.type` (required): Interaction type — `"POLL"`
|
|
648
|
+
- `options.responseData` (required): Response data:
|
|
649
|
+
- `response` (required): Selected option ID
|
|
650
|
+
|
|
651
|
+
##### Returns
|
|
652
|
+
|
|
653
|
+
- `Promise<InteractionResponseResponse>`: Response containing:
|
|
654
|
+
- `aggregates: Record<string, unknown>`: Updated aggregate data after recording the response
|
|
655
|
+
- `appUserResponse: Record<string, unknown>`: The user's recorded response
|
|
656
|
+
|
|
657
|
+
##### Example
|
|
658
|
+
|
|
659
|
+
```typescript
|
|
660
|
+
const result = await client.user.respondToInteraction('interaction-id-123', {
|
|
661
|
+
type: 'POLL',
|
|
662
|
+
responseData: { response: 'option-a-id' },
|
|
663
|
+
});
|
|
664
|
+
|
|
665
|
+
console.log('Updated aggregates:', result.aggregates);
|
|
666
|
+
console.log('Recorded response:', result.appUserResponse);
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
##### Throws
|
|
670
|
+
|
|
671
|
+
- `Error`: If the request fails or no data is returned
|
|
672
|
+
|
|
673
|
+
---
|
|
674
|
+
|
|
581
675
|
### Data Methods
|
|
582
676
|
|
|
583
677
|
Data methods require authentication. Call `client.user.authenticate()` before using them.
|
|
@@ -830,3 +924,63 @@ interface SynthesizeOptions {
|
|
|
830
924
|
onStreamingData?: (index: number, data: unknown) => void;
|
|
831
925
|
}
|
|
832
926
|
```
|
|
927
|
+
|
|
928
|
+
#### InteractionsRequest
|
|
929
|
+
|
|
930
|
+
Request body for POST `/v1/user/interactions`.
|
|
931
|
+
|
|
932
|
+
```typescript
|
|
933
|
+
type InteractionsRequest = {
|
|
934
|
+
synthesisConfigKeyName: string;
|
|
935
|
+
interactions: Array<{
|
|
936
|
+
type: 'POLL';
|
|
937
|
+
content: string; // canonical JSON string of the interaction content
|
|
938
|
+
}>;
|
|
939
|
+
}
|
|
940
|
+
```
|
|
941
|
+
|
|
942
|
+
#### InteractionItem
|
|
943
|
+
|
|
944
|
+
A single resolved interaction item returned in `InteractionsResponse`.
|
|
945
|
+
|
|
946
|
+
```typescript
|
|
947
|
+
type InteractionItem = {
|
|
948
|
+
id: string;
|
|
949
|
+
type: string;
|
|
950
|
+
content: string;
|
|
951
|
+
hasResponded: boolean;
|
|
952
|
+
aggregates: Record<string, unknown>;
|
|
953
|
+
}
|
|
954
|
+
```
|
|
955
|
+
|
|
956
|
+
#### InteractionsResponse
|
|
957
|
+
|
|
958
|
+
Return type of `interactions`. Array of `InteractionItem`.
|
|
959
|
+
|
|
960
|
+
```typescript
|
|
961
|
+
type InteractionsResponse = InteractionItem[];
|
|
962
|
+
```
|
|
963
|
+
|
|
964
|
+
#### InteractionResponseRequest
|
|
965
|
+
|
|
966
|
+
Request body for POST `/v1/user/interactions/:interactionId/responses`.
|
|
967
|
+
|
|
968
|
+
```typescript
|
|
969
|
+
type InteractionResponseRequest = {
|
|
970
|
+
type: 'POLL';
|
|
971
|
+
responseData: {
|
|
972
|
+
response: string; // selected option id
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
```
|
|
976
|
+
|
|
977
|
+
#### InteractionResponseResponse
|
|
978
|
+
|
|
979
|
+
Return type of `respondToInteraction`.
|
|
980
|
+
|
|
981
|
+
```typescript
|
|
982
|
+
type InteractionResponseResponse = {
|
|
983
|
+
aggregates: Record<string, unknown>;
|
|
984
|
+
appUserResponse: Record<string, unknown>;
|
|
985
|
+
}
|
|
986
|
+
```
|
|
@@ -14,7 +14,7 @@ export interface paths {
|
|
|
14
14
|
get?: never;
|
|
15
15
|
put?: never;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Auth - Exchange Token
|
|
18
18
|
* @description **POST** `/v1/auth/token`
|
|
19
19
|
*
|
|
20
20
|
* Exchange a token from your SSO provider (OIDC) for a BitBitPress authentication token required to use other endpoints.
|
|
@@ -123,7 +123,7 @@ export interface paths {
|
|
|
123
123
|
cookie?: never;
|
|
124
124
|
};
|
|
125
125
|
/**
|
|
126
|
-
* Get User Profile
|
|
126
|
+
* Profile - Get User Profile
|
|
127
127
|
* @description **GET** `/v1/user/profile` Returns the user's profile, including interest tags.
|
|
128
128
|
*/
|
|
129
129
|
get: {
|
|
@@ -208,7 +208,7 @@ export interface paths {
|
|
|
208
208
|
};
|
|
209
209
|
};
|
|
210
210
|
/**
|
|
211
|
-
* Update User Profile
|
|
211
|
+
* Profile - Update User Profile
|
|
212
212
|
* @description **PUT** `/v1/user/profile` Updates the user's interest tags. Supports full replace via `interestTags`, or add/remove via `addInterestTags` and `removeInterestTags` arrays.
|
|
213
213
|
*/
|
|
214
214
|
put: {
|
|
@@ -313,7 +313,7 @@ export interface paths {
|
|
|
313
313
|
get?: never;
|
|
314
314
|
put?: never;
|
|
315
315
|
/**
|
|
316
|
-
*
|
|
316
|
+
* User - Get Recommendations
|
|
317
317
|
* @description **POST** `/v1/user/recommendations` Returns recommended articles for the authenticated user based on their interests.
|
|
318
318
|
*
|
|
319
319
|
* #### Available fields (`fields` in request body)
|
|
@@ -438,7 +438,7 @@ export interface paths {
|
|
|
438
438
|
get?: never;
|
|
439
439
|
put?: never;
|
|
440
440
|
/**
|
|
441
|
-
* Report
|
|
441
|
+
* User - Create Report
|
|
442
442
|
* @description **POST** `/v1/user/report` Creates a user-provided bit to be ingested into the system. This may include news or any other content that the user wants to share.
|
|
443
443
|
*/
|
|
444
444
|
post: {
|
|
@@ -534,7 +534,7 @@ export interface paths {
|
|
|
534
534
|
get?: never;
|
|
535
535
|
put?: never;
|
|
536
536
|
/**
|
|
537
|
-
* Record
|
|
537
|
+
* Profile - Record Signals
|
|
538
538
|
* @description **POST** `/v1/user/signal` Records user signals (e.g. clicked topic, read article) to inform profile interests. Signals power the user's recommendations.
|
|
539
539
|
*/
|
|
540
540
|
post: {
|
|
@@ -653,7 +653,7 @@ export interface paths {
|
|
|
653
653
|
get?: never;
|
|
654
654
|
put?: never;
|
|
655
655
|
/**
|
|
656
|
-
* Synthesize
|
|
656
|
+
* Synthesis - Synthesize Content
|
|
657
657
|
* @description **POST** `/v1/user/synthesize`
|
|
658
658
|
*
|
|
659
659
|
* Synthesize content items personalized to the user.
|
|
@@ -784,6 +784,240 @@ export interface paths {
|
|
|
784
784
|
patch?: never;
|
|
785
785
|
trace?: never;
|
|
786
786
|
};
|
|
787
|
+
"/v1/user/interactions": {
|
|
788
|
+
parameters: {
|
|
789
|
+
query?: never;
|
|
790
|
+
header?: never;
|
|
791
|
+
path?: never;
|
|
792
|
+
cookie?: never;
|
|
793
|
+
};
|
|
794
|
+
get?: never;
|
|
795
|
+
put?: never;
|
|
796
|
+
/**
|
|
797
|
+
* Synthesis - Get User Interactions
|
|
798
|
+
* @description **POST** `/v1/user/interactions`
|
|
799
|
+
*
|
|
800
|
+
* Batch-resolve interaction state for items from a synthesis output. Returns aggregates and whether the current user has already responded to each.
|
|
801
|
+
*/
|
|
802
|
+
post: {
|
|
803
|
+
parameters: {
|
|
804
|
+
query?: never;
|
|
805
|
+
header: {
|
|
806
|
+
authorization: string;
|
|
807
|
+
};
|
|
808
|
+
path?: never;
|
|
809
|
+
cookie?: never;
|
|
810
|
+
};
|
|
811
|
+
requestBody: {
|
|
812
|
+
content: {
|
|
813
|
+
"application/json": {
|
|
814
|
+
/** @description keyName of the synthesis config these interactions belong to. */
|
|
815
|
+
synthesisConfigKeyName: string;
|
|
816
|
+
/** @description Interactions to resolve, in order. */
|
|
817
|
+
interactions: {
|
|
818
|
+
/**
|
|
819
|
+
* @description Interaction type.
|
|
820
|
+
* @enum {string}
|
|
821
|
+
*/
|
|
822
|
+
type: "POLL";
|
|
823
|
+
/** @description Canonical JSON string of the interaction content (e.g. question + options for a POLL). */
|
|
824
|
+
content: string;
|
|
825
|
+
}[];
|
|
826
|
+
};
|
|
827
|
+
};
|
|
828
|
+
};
|
|
829
|
+
responses: {
|
|
830
|
+
/** @description Default Response */
|
|
831
|
+
200: {
|
|
832
|
+
headers: {
|
|
833
|
+
[name: string]: unknown;
|
|
834
|
+
};
|
|
835
|
+
content: {
|
|
836
|
+
"application/json": {
|
|
837
|
+
success: boolean;
|
|
838
|
+
data: {
|
|
839
|
+
id: string;
|
|
840
|
+
type: string;
|
|
841
|
+
content: string;
|
|
842
|
+
hasResponded: boolean;
|
|
843
|
+
aggregates: {
|
|
844
|
+
[key: string]: unknown;
|
|
845
|
+
};
|
|
846
|
+
}[];
|
|
847
|
+
};
|
|
848
|
+
};
|
|
849
|
+
};
|
|
850
|
+
/** @description Bad request - missing or invalid parameters */
|
|
851
|
+
400: {
|
|
852
|
+
headers: {
|
|
853
|
+
[name: string]: unknown;
|
|
854
|
+
};
|
|
855
|
+
content: {
|
|
856
|
+
"application/json": {
|
|
857
|
+
/** @example Bad request */
|
|
858
|
+
error?: string;
|
|
859
|
+
};
|
|
860
|
+
};
|
|
861
|
+
};
|
|
862
|
+
/** @description Unauthorized errors */
|
|
863
|
+
401: {
|
|
864
|
+
headers: {
|
|
865
|
+
[name: string]: unknown;
|
|
866
|
+
};
|
|
867
|
+
content: {
|
|
868
|
+
"application/json": {
|
|
869
|
+
/**
|
|
870
|
+
* @example Unauthorized: No authentication token provided
|
|
871
|
+
* @enum {string}
|
|
872
|
+
*/
|
|
873
|
+
error?: "Unauthorized: No authentication token provided" | "Unauthorized: Token has expired" | "Unauthorized: Invalid token" | "Unauthorized: Authentication failed";
|
|
874
|
+
};
|
|
875
|
+
};
|
|
876
|
+
};
|
|
877
|
+
/** @description Internal server error */
|
|
878
|
+
500: {
|
|
879
|
+
headers: {
|
|
880
|
+
[name: string]: unknown;
|
|
881
|
+
};
|
|
882
|
+
content: {
|
|
883
|
+
"application/json": {
|
|
884
|
+
/** @example false */
|
|
885
|
+
success?: boolean;
|
|
886
|
+
/** @example Internal server error: An unknown error occurred */
|
|
887
|
+
error?: string;
|
|
888
|
+
};
|
|
889
|
+
};
|
|
890
|
+
};
|
|
891
|
+
};
|
|
892
|
+
};
|
|
893
|
+
delete?: never;
|
|
894
|
+
options?: never;
|
|
895
|
+
head?: never;
|
|
896
|
+
patch?: never;
|
|
897
|
+
trace?: never;
|
|
898
|
+
};
|
|
899
|
+
"/v1/user/interactions/{interactionId}/responses": {
|
|
900
|
+
parameters: {
|
|
901
|
+
query?: never;
|
|
902
|
+
header?: never;
|
|
903
|
+
path?: never;
|
|
904
|
+
cookie?: never;
|
|
905
|
+
};
|
|
906
|
+
get?: never;
|
|
907
|
+
put?: never;
|
|
908
|
+
/**
|
|
909
|
+
* Synthesis - Create User Interaction Response
|
|
910
|
+
* @description **POST** `/v1/user/interactions/:interactionId/responses`
|
|
911
|
+
*
|
|
912
|
+
* Submit or update a response to an interaction. Returns updated aggregates.
|
|
913
|
+
*/
|
|
914
|
+
post: {
|
|
915
|
+
parameters: {
|
|
916
|
+
query?: never;
|
|
917
|
+
header: {
|
|
918
|
+
authorization: string;
|
|
919
|
+
};
|
|
920
|
+
path: {
|
|
921
|
+
interactionId: string;
|
|
922
|
+
};
|
|
923
|
+
cookie?: never;
|
|
924
|
+
};
|
|
925
|
+
requestBody: {
|
|
926
|
+
content: {
|
|
927
|
+
"application/json": {
|
|
928
|
+
/**
|
|
929
|
+
* @description Interaction type.
|
|
930
|
+
* @enum {string}
|
|
931
|
+
*/
|
|
932
|
+
type: "POLL";
|
|
933
|
+
/** @description For POLL: the selected option id. */
|
|
934
|
+
responseData: {
|
|
935
|
+
/** @description Selected option id. */
|
|
936
|
+
response: string;
|
|
937
|
+
};
|
|
938
|
+
};
|
|
939
|
+
};
|
|
940
|
+
};
|
|
941
|
+
responses: {
|
|
942
|
+
/** @description Default Response */
|
|
943
|
+
200: {
|
|
944
|
+
headers: {
|
|
945
|
+
[name: string]: unknown;
|
|
946
|
+
};
|
|
947
|
+
content: {
|
|
948
|
+
"application/json": {
|
|
949
|
+
success: boolean;
|
|
950
|
+
data: {
|
|
951
|
+
aggregates: {
|
|
952
|
+
[key: string]: unknown;
|
|
953
|
+
};
|
|
954
|
+
appUserResponse: {
|
|
955
|
+
[key: string]: unknown;
|
|
956
|
+
};
|
|
957
|
+
};
|
|
958
|
+
};
|
|
959
|
+
};
|
|
960
|
+
};
|
|
961
|
+
/** @description Bad request - missing or invalid parameters */
|
|
962
|
+
400: {
|
|
963
|
+
headers: {
|
|
964
|
+
[name: string]: unknown;
|
|
965
|
+
};
|
|
966
|
+
content: {
|
|
967
|
+
"application/json": {
|
|
968
|
+
/** @example Bad request */
|
|
969
|
+
error?: string;
|
|
970
|
+
};
|
|
971
|
+
};
|
|
972
|
+
};
|
|
973
|
+
/** @description Unauthorized errors */
|
|
974
|
+
401: {
|
|
975
|
+
headers: {
|
|
976
|
+
[name: string]: unknown;
|
|
977
|
+
};
|
|
978
|
+
content: {
|
|
979
|
+
"application/json": {
|
|
980
|
+
/**
|
|
981
|
+
* @example Unauthorized: No authentication token provided
|
|
982
|
+
* @enum {string}
|
|
983
|
+
*/
|
|
984
|
+
error?: "Unauthorized: No authentication token provided" | "Unauthorized: Token has expired" | "Unauthorized: Invalid token" | "Unauthorized: Authentication failed";
|
|
985
|
+
};
|
|
986
|
+
};
|
|
987
|
+
};
|
|
988
|
+
/** @description Default Response */
|
|
989
|
+
404: {
|
|
990
|
+
headers: {
|
|
991
|
+
[name: string]: unknown;
|
|
992
|
+
};
|
|
993
|
+
content: {
|
|
994
|
+
"application/json": {
|
|
995
|
+
error?: string;
|
|
996
|
+
};
|
|
997
|
+
};
|
|
998
|
+
};
|
|
999
|
+
/** @description Internal server error */
|
|
1000
|
+
500: {
|
|
1001
|
+
headers: {
|
|
1002
|
+
[name: string]: unknown;
|
|
1003
|
+
};
|
|
1004
|
+
content: {
|
|
1005
|
+
"application/json": {
|
|
1006
|
+
/** @example false */
|
|
1007
|
+
success?: boolean;
|
|
1008
|
+
/** @example Internal server error: An unknown error occurred */
|
|
1009
|
+
error?: string;
|
|
1010
|
+
};
|
|
1011
|
+
};
|
|
1012
|
+
};
|
|
1013
|
+
};
|
|
1014
|
+
};
|
|
1015
|
+
delete?: never;
|
|
1016
|
+
options?: never;
|
|
1017
|
+
head?: never;
|
|
1018
|
+
patch?: never;
|
|
1019
|
+
trace?: never;
|
|
1020
|
+
};
|
|
787
1021
|
"/v1/data/assets": {
|
|
788
1022
|
parameters: {
|
|
789
1023
|
query?: never;
|
|
@@ -794,7 +1028,7 @@ export interface paths {
|
|
|
794
1028
|
get?: never;
|
|
795
1029
|
put?: never;
|
|
796
1030
|
/**
|
|
797
|
-
*
|
|
1031
|
+
* Data - Get Assets
|
|
798
1032
|
* @description **POST** `/v1/data/assets` Fetches assets by IDs and returns requested fields.
|
|
799
1033
|
*
|
|
800
1034
|
* #### Request body
|
|
@@ -802,7 +1036,7 @@ export interface paths {
|
|
|
802
1036
|
* | Field | Type | Required | Description |
|
|
803
1037
|
* |-------|------|----------|-------------|
|
|
804
1038
|
* | `assetIds` | string[] | yes | List of asset IDs to fetch |
|
|
805
|
-
* | `assetFields` | string[] | yes | Fields to return (dot or bracket notation, e.g. tags[0], images[1].src). Allowed: title, tags, images, videos, publishedAt, externalId, externalData, and subfields. Empty array returns objects with only `assetId`. |
|
|
1039
|
+
* | `assetFields` | string[] | yes | Fields to return (dot or bracket notation, e.g. tags[0], images[1].src). Allowed: assetId, title, tags, images, videos, publishedAt, externalId, externalData, sourceUrl, dataSource.name, and subfields. Empty array returns objects with only `assetId`. `externalData`'s subfields are unique to your source data. |
|
|
806
1040
|
*/
|
|
807
1041
|
post: {
|
|
808
1042
|
parameters: {
|
|
@@ -819,7 +1053,7 @@ export interface paths {
|
|
|
819
1053
|
"application/json": {
|
|
820
1054
|
/** @description List of asset IDs to fetch */
|
|
821
1055
|
assetIds: string[];
|
|
822
|
-
/** @description Asset fields to return (dot or bracket notation). Allowed: title, tags, images, videos, publishedAt, externalId, externalData, and subfields. Empty array returns objects with only assetId. */
|
|
1056
|
+
/** @description Asset fields to return (dot or bracket notation). Allowed: assetId, title, tags, images, videos, publishedAt, externalId, externalData, assetType, sourceUrl, dataSource.name, and subfields. Empty array returns objects with only assetId. */
|
|
823
1057
|
assetFields: string[];
|
|
824
1058
|
};
|
|
825
1059
|
};
|
|
@@ -893,6 +1127,159 @@ export interface paths {
|
|
|
893
1127
|
patch?: never;
|
|
894
1128
|
trace?: never;
|
|
895
1129
|
};
|
|
1130
|
+
"/admin/v1/assets/upsert": {
|
|
1131
|
+
parameters: {
|
|
1132
|
+
query?: never;
|
|
1133
|
+
header?: never;
|
|
1134
|
+
path?: never;
|
|
1135
|
+
cookie?: never;
|
|
1136
|
+
};
|
|
1137
|
+
get?: never;
|
|
1138
|
+
put?: never;
|
|
1139
|
+
/**
|
|
1140
|
+
* Upsert Asset
|
|
1141
|
+
* @description **POST** `/admin/v1/assets/upsert` Creates or updates an asset in the system. If an asset with the same `externalId` already exists it will be updated; otherwise a new asset is created and queued for ingestion.
|
|
1142
|
+
*/
|
|
1143
|
+
post: {
|
|
1144
|
+
parameters: {
|
|
1145
|
+
query?: never;
|
|
1146
|
+
header?: never;
|
|
1147
|
+
path?: never;
|
|
1148
|
+
cookie?: never;
|
|
1149
|
+
};
|
|
1150
|
+
requestBody: {
|
|
1151
|
+
content: {
|
|
1152
|
+
"application/json": {
|
|
1153
|
+
/** @description Key name of the Admin API data source to associate this asset with */
|
|
1154
|
+
dataSourceKey: string;
|
|
1155
|
+
/** @description Unique identifier for the asset in your system */
|
|
1156
|
+
externalId: string;
|
|
1157
|
+
/** @description Title of the asset */
|
|
1158
|
+
title: string;
|
|
1159
|
+
/** @description Full text content of the asset */
|
|
1160
|
+
content: string;
|
|
1161
|
+
/**
|
|
1162
|
+
* @description Format of the content field. Defaults to text/plain.
|
|
1163
|
+
* @enum {string}
|
|
1164
|
+
*/
|
|
1165
|
+
mimeType?: "text/plain" | "text/markdown" | "text/html";
|
|
1166
|
+
/** @description Canonical URL of the original source */
|
|
1167
|
+
sourceUrl?: string;
|
|
1168
|
+
/** @description ISO 8601 publication timestamp */
|
|
1169
|
+
publishedAt?: string;
|
|
1170
|
+
/** @description Author or byline */
|
|
1171
|
+
byline?: string;
|
|
1172
|
+
/** @description List of tags or categories */
|
|
1173
|
+
tags?: string[];
|
|
1174
|
+
/** @description Images associated with the asset */
|
|
1175
|
+
images?: {
|
|
1176
|
+
/** @description Image URL */
|
|
1177
|
+
src: string;
|
|
1178
|
+
/** @description Alt text */
|
|
1179
|
+
alt?: string;
|
|
1180
|
+
/** @description External identifier for the image */
|
|
1181
|
+
externalId?: string;
|
|
1182
|
+
/** @description Image width in pixels */
|
|
1183
|
+
width?: number;
|
|
1184
|
+
/** @description Image height in pixels */
|
|
1185
|
+
height?: number;
|
|
1186
|
+
/** @description Photo credit or attribution */
|
|
1187
|
+
credit?: string;
|
|
1188
|
+
}[];
|
|
1189
|
+
/** @description Videos associated with the asset */
|
|
1190
|
+
videos?: {
|
|
1191
|
+
/** @description One or more video source URLs with MIME types */
|
|
1192
|
+
sources: {
|
|
1193
|
+
/** @description MIME type of the video source (e.g. video/mp4) */
|
|
1194
|
+
mimeType: string;
|
|
1195
|
+
/** @description Video source URL */
|
|
1196
|
+
src: string;
|
|
1197
|
+
}[];
|
|
1198
|
+
/** @description Alt text for the video */
|
|
1199
|
+
alt?: string;
|
|
1200
|
+
/** @description External identifier for the video */
|
|
1201
|
+
externalId?: string;
|
|
1202
|
+
/** @description Video credit or attribution */
|
|
1203
|
+
credit?: string;
|
|
1204
|
+
/** @description Poster image URL */
|
|
1205
|
+
posterUrl?: string;
|
|
1206
|
+
/** @description Video caption */
|
|
1207
|
+
caption?: string;
|
|
1208
|
+
/** @description Video width in pixels */
|
|
1209
|
+
width?: number;
|
|
1210
|
+
/** @description Video height in pixels */
|
|
1211
|
+
height?: number;
|
|
1212
|
+
}[];
|
|
1213
|
+
/** @description Arbitrary additional data to store with the asset */
|
|
1214
|
+
externalData?: {
|
|
1215
|
+
[key: string]: unknown;
|
|
1216
|
+
};
|
|
1217
|
+
};
|
|
1218
|
+
};
|
|
1219
|
+
};
|
|
1220
|
+
responses: {
|
|
1221
|
+
/** @description Successful response */
|
|
1222
|
+
200: {
|
|
1223
|
+
headers: {
|
|
1224
|
+
[name: string]: unknown;
|
|
1225
|
+
};
|
|
1226
|
+
content: {
|
|
1227
|
+
"application/json": {
|
|
1228
|
+
success: boolean;
|
|
1229
|
+
data: {
|
|
1230
|
+
/** @description Internal asset identifier */
|
|
1231
|
+
assetId: string;
|
|
1232
|
+
/** @description True if a new asset was created */
|
|
1233
|
+
created: boolean;
|
|
1234
|
+
/** @description True if the asset was queued for ingestion */
|
|
1235
|
+
queued: boolean;
|
|
1236
|
+
};
|
|
1237
|
+
};
|
|
1238
|
+
};
|
|
1239
|
+
};
|
|
1240
|
+
/** @description Bad request - missing or invalid parameters */
|
|
1241
|
+
400: {
|
|
1242
|
+
headers: {
|
|
1243
|
+
[name: string]: unknown;
|
|
1244
|
+
};
|
|
1245
|
+
content: {
|
|
1246
|
+
"application/json": {
|
|
1247
|
+
error?: string;
|
|
1248
|
+
};
|
|
1249
|
+
};
|
|
1250
|
+
};
|
|
1251
|
+
/** @description Unauthorized errors */
|
|
1252
|
+
401: {
|
|
1253
|
+
headers: {
|
|
1254
|
+
[name: string]: unknown;
|
|
1255
|
+
};
|
|
1256
|
+
content: {
|
|
1257
|
+
"application/json": {
|
|
1258
|
+
/** @enum {string} */
|
|
1259
|
+
error?: "Unauthorized: No API key provided" | "Unauthorized: Invalid or revoked API key";
|
|
1260
|
+
};
|
|
1261
|
+
};
|
|
1262
|
+
};
|
|
1263
|
+
/** @description Internal server error */
|
|
1264
|
+
500: {
|
|
1265
|
+
headers: {
|
|
1266
|
+
[name: string]: unknown;
|
|
1267
|
+
};
|
|
1268
|
+
content: {
|
|
1269
|
+
"application/json": {
|
|
1270
|
+
success?: boolean;
|
|
1271
|
+
error?: string;
|
|
1272
|
+
};
|
|
1273
|
+
};
|
|
1274
|
+
};
|
|
1275
|
+
};
|
|
1276
|
+
};
|
|
1277
|
+
delete?: never;
|
|
1278
|
+
options?: never;
|
|
1279
|
+
head?: never;
|
|
1280
|
+
patch?: never;
|
|
1281
|
+
trace?: never;
|
|
1282
|
+
};
|
|
896
1283
|
}
|
|
897
1284
|
export type webhooks = Record<string, never>;
|
|
898
1285
|
export interface components {
|
package/dist/index.d.ts
CHANGED
|
@@ -19,4 +19,5 @@ export type { TokenRequest, TokenResponse } from './user/token.js';
|
|
|
19
19
|
export type { BitBitPressSynthesizeRequest, RecommendationsRequestBody, SynthesizeInput, SynthesizeItem, SynthesizeItems, SynthesizeOutputSchema, SynthesizeRequest, } from './user/typeDefs.js';
|
|
20
20
|
export type { SynthesizeEvent, SynthesizeItemResponse, SynthesizeOptions } from './user/synthesize.js';
|
|
21
21
|
export type { SynthesizeOnStreamingData } from './user/synthesize-batch-manager.js';
|
|
22
|
+
export type { InteractionItem, InteractionResponseRequest, InteractionResponseResponse, InteractionsRequest, InteractionsResponse, } from './user/interaction.js';
|
|
22
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,WAAW,EACX,QAAQ,GACT,MAAM,cAAc,CAAC;AAGtB,mBAAmB,wBAAwB,CAAC;AAG5C,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9E,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACjG,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,M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EAAE,MAAM,iBAAiB,CAAC;AACnE,YAAY,EACV,4BAA4B,EAC5B,0BAA0B,EAC1B,eAAe,EACf,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACvG,YAAY,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,YAAY,EACV,eAAe,EACf,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC"}
|
package/dist/user/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { type Signal, type SignalRequest, type SignalResponse } from './signal.j
|
|
|
8
8
|
import { type SynthesizeEvent, type SynthesizeItemResponse } from './synthesize.js';
|
|
9
9
|
import { type TokenRequest, type TokenResponse } from './token.js';
|
|
10
10
|
import type { SynthesizeItem, SynthesizeItems } from './typeDefs.js';
|
|
11
|
+
import { type InteractionResponseRequest, type InteractionResponseResponse, type InteractionsRequest, type InteractionsResponse } from './interaction.js';
|
|
11
12
|
/**
|
|
12
13
|
* User-related API methods interface (aligned with OpenAPI spec paths).
|
|
13
14
|
*/
|
|
@@ -85,6 +86,22 @@ export interface UserMethods {
|
|
|
85
86
|
* @returns Promise that resolves with the synthesized data for that item's index
|
|
86
87
|
*/
|
|
87
88
|
synthesizeItem(item: SynthesizeItem, onStreamingData?: SynthesizeOnStreamingData): Promise<SynthesizeItemResponse>;
|
|
89
|
+
/**
|
|
90
|
+
* Batch-resolve interaction state for items from a synthesis output.
|
|
91
|
+
* Returns aggregates and whether the current user has already responded to each.
|
|
92
|
+
*
|
|
93
|
+
* @param options - synthesisConfigKeyName and interactions array (type + content)
|
|
94
|
+
* @returns Array of resolved interaction items (id, type, content, hasResponded, aggregates)
|
|
95
|
+
*/
|
|
96
|
+
interactions(options: InteractionsRequest): Promise<NonNullable<InteractionsResponse>>;
|
|
97
|
+
/**
|
|
98
|
+
* Submit or update a response to an interaction (e.g. a poll answer). Returns updated aggregates.
|
|
99
|
+
*
|
|
100
|
+
* @param interactionId - ID of the interaction to respond to
|
|
101
|
+
* @param options - type (e.g. 'POLL') and responseData (e.g. { response: 'optionId' })
|
|
102
|
+
* @returns Updated aggregates and the user's recorded response
|
|
103
|
+
*/
|
|
104
|
+
respondToInteraction(interactionId: string, options: InteractionResponseRequest): Promise<NonNullable<InteractionResponseResponse>>;
|
|
88
105
|
}
|
|
89
106
|
/**
|
|
90
107
|
* User-related API methods (uses shared auth store).
|
package/dist/user/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/user/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAA0B,KAAK,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AACvG,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA0B,KAAK,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACvG,OAAO,EAAa,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAgB,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAEjG,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAiB,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"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E,MAAY,EACpC,kBAAkB,GAAE,MAAY,GAC/B,WAAW,CAgDb"}
|
package/dist/user/index.js
CHANGED
|
@@ -9,6 +9,7 @@ const signal_js_1 = require("./signal.js");
|
|
|
9
9
|
const signal_batch_manager_js_1 = require("./signal-batch-manager.js");
|
|
10
10
|
const synthesize_js_1 = require("./synthesize.js");
|
|
11
11
|
const token_js_1 = require("./token.js");
|
|
12
|
+
const interaction_js_1 = require("./interaction.js");
|
|
12
13
|
/**
|
|
13
14
|
* User-related API methods (uses shared auth store).
|
|
14
15
|
*/
|
|
@@ -27,6 +28,8 @@ function createUserMethods(authStore, config, synthesizeBatchTimeout = 250, sign
|
|
|
27
28
|
signalItem: (signal) => signalBatchManager.addSignal(signal),
|
|
28
29
|
synthesize: (items, options) => getConfigWithToken().then((cfg) => (0, synthesize_js_1.synthesize)(cfg, items, options)),
|
|
29
30
|
synthesizeItem: (item, onStreamingData) => synthesizeBatchManager.addItem(item, onStreamingData),
|
|
31
|
+
interactions: (options) => getConfigWithToken().then((cfg) => (0, interaction_js_1.getInteractions)(cfg, options)),
|
|
32
|
+
respondToInteraction: (interactionId, options) => getConfigWithToken().then((cfg) => (0, interaction_js_1.respondToInteraction)(cfg, interactionId, options)),
|
|
30
33
|
};
|
|
31
34
|
}
|
|
32
35
|
//# sourceMappingURL=index.js.map
|
package/dist/user/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/user/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/user/index.ts"],"names":[],"mappings":";;AA6IA,8CAqDC;AAhMD,+EAAuG;AACvG,6DAI8B;AAC9B,6CAAuG;AACvG,2CAAiF;AACjF,2CAAiG;AACjG,uEAA+D;AAC/D,mDAAgG;AAChG,yCAAkF;AAElF,qDAQ0B;AAmH1B;;GAEG;AACH,SAAgB,iBAAiB,CAC/B,SAAoB,EACpB,MAAqB,EAC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EAAE,CACnE,kBAAkB,CAAC,SAAS,CAAC,MAAM,CAAC;QAEtC,UAAU,EAAE,CAAC,KAAsB,EAAE,OAAsE,EAAE,EAAE,CAC7G,kBAAkB,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,0BAAU,EAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAErE,cAAc,EAAE,CACd,IAAoB,EACpB,eAA2C,EACV,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC;QAE3F,YAAY,EAAE,CAAC,OAA4B,EAAE,EAAE,CAC7C,kBAAkB,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,gCAAe,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAEnE,oBAAoB,EAAE,CAAC,aAAqB,EAAE,OAAmC,EAAE,EAAE,CACnF,kBAAkB,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,qCAAoB,EAAC,GAAG,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;KACxF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { paths } from '../generated/openapi.js';
|
|
2
|
+
import type { RequestConfig } from '../request.js';
|
|
3
|
+
export type InteractionsRequest = paths['/v1/user/interactions']['post']['requestBody']['content']['application/json'];
|
|
4
|
+
export type InteractionsResponse = paths['/v1/user/interactions']['post']['responses'][200]['content']['application/json']['data'];
|
|
5
|
+
export type InteractionResponseRequest = paths['/v1/user/interactions/{interactionId}/responses']['post']['requestBody']['content']['application/json'];
|
|
6
|
+
export type InteractionResponseResponse = paths['/v1/user/interactions/{interactionId}/responses']['post']['responses'][200]['content']['application/json']['data'];
|
|
7
|
+
/** Single resolved interaction item (id, type, content, hasResponded, aggregates). */
|
|
8
|
+
export type InteractionItem = InteractionsResponse[number];
|
|
9
|
+
/**
|
|
10
|
+
* Batch-resolve interaction state for items from a synthesis output.
|
|
11
|
+
* Returns aggregates and whether the current user has already responded to each.
|
|
12
|
+
*
|
|
13
|
+
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
14
|
+
* @param options - synthesisConfigKeyName and interactions array (type + content)
|
|
15
|
+
* @returns Array of resolved interaction items (id, type, content, hasResponded, aggregates)
|
|
16
|
+
*/
|
|
17
|
+
export declare function getInteractions(config: RequestConfig, options: InteractionsRequest): Promise<NonNullable<InteractionsResponse>>;
|
|
18
|
+
/**
|
|
19
|
+
* Submit or update a response to an interaction (e.g. a poll answer). Returns updated aggregates.
|
|
20
|
+
*
|
|
21
|
+
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
22
|
+
* @param interactionId - ID of the interaction to respond to
|
|
23
|
+
* @param options - type (e.g. 'POLL') and responseData (e.g. { response: 'optionId' })
|
|
24
|
+
* @returns Updated aggregates and the user's recorded response
|
|
25
|
+
*/
|
|
26
|
+
export declare function respondToInteraction(config: RequestConfig, interactionId: string, options: InteractionResponseRequest): Promise<NonNullable<InteractionResponseResponse>>;
|
|
27
|
+
//# sourceMappingURL=interaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../src/user/interaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,MAAM,MAAM,mBAAmB,GAC7B,KAAK,CAAC,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACvF,MAAM,MAAM,oBAAoB,GAC9B,KAAK,CAAC,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElG,MAAM,MAAM,0BAA0B,GACpC,KAAK,CAAC,iDAAiD,CAAC,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACjH,MAAM,MAAM,2BAA2B,GACrC,KAAK,CAAC,iDAAiD,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5H,sFAAsF;AACtF,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAE3D;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC,CAY5C;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC,CAYnD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInteractions = getInteractions;
|
|
4
|
+
exports.respondToInteraction = respondToInteraction;
|
|
5
|
+
const request_js_1 = require("../request.js");
|
|
6
|
+
/**
|
|
7
|
+
* Batch-resolve interaction state for items from a synthesis output.
|
|
8
|
+
* Returns aggregates and whether the current user has already responded to each.
|
|
9
|
+
*
|
|
10
|
+
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
11
|
+
* @param options - synthesisConfigKeyName and interactions array (type + content)
|
|
12
|
+
* @returns Array of resolved interaction items (id, type, content, hasResponded, aggregates)
|
|
13
|
+
*/
|
|
14
|
+
async function getInteractions(config, options) {
|
|
15
|
+
const response = await (0, request_js_1.makeRequest)(config, {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
path: '/v1/user/interactions',
|
|
18
|
+
body: options,
|
|
19
|
+
});
|
|
20
|
+
if (!response) {
|
|
21
|
+
throw new Error('Failed to get interactions: no data in response');
|
|
22
|
+
}
|
|
23
|
+
return response;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Submit or update a response to an interaction (e.g. a poll answer). Returns updated aggregates.
|
|
27
|
+
*
|
|
28
|
+
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
29
|
+
* @param interactionId - ID of the interaction to respond to
|
|
30
|
+
* @param options - type (e.g. 'POLL') and responseData (e.g. { response: 'optionId' })
|
|
31
|
+
* @returns Updated aggregates and the user's recorded response
|
|
32
|
+
*/
|
|
33
|
+
async function respondToInteraction(config, interactionId, options) {
|
|
34
|
+
const response = await (0, request_js_1.makeRequest)(config, {
|
|
35
|
+
method: 'POST',
|
|
36
|
+
path: `/v1/user/interactions/${interactionId}/responses`,
|
|
37
|
+
body: options,
|
|
38
|
+
});
|
|
39
|
+
if (!response) {
|
|
40
|
+
throw new Error('Failed to respond to interaction: no data in response');
|
|
41
|
+
}
|
|
42
|
+
return response;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=interaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../src/user/interaction.ts"],"names":[],"mappings":";;AAyBA,0CAeC;AAUD,oDAgBC;AAhED,8CAA4C;AAe5C;;;;;;;GAOG;AACI,KAAK,UAAU,eAAe,CACnC,MAAqB,EACrB,OAA4B;IAE5B,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAW,EAAuB,MAAM,EAAE;QAC/D,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,uBAAuB;QAC7B,IAAI,EAAE,OAAO;KACd,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,oBAAoB,CACxC,MAAqB,EACrB,aAAqB,EACrB,OAAmC;IAEnC,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAW,EAA8B,MAAM,EAAE;QACtE,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,yBAAyB,aAAa,YAAY;QACxD,IAAI,EAAE,OAAO;KACd,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|