@bitbitpress/client 0.1.10 → 0.1.11
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/examples/basic-usage.d.ts.map +1 -1
- package/dist/examples/basic-usage.js +0 -8
- package/dist/examples/basic-usage.js.map +1 -1
- package/dist/generated/openapi.d.ts +110 -27
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/user/index.d.ts +11 -4
- package/dist/user/index.d.ts.map +1 -1
- package/dist/user/index.js +1 -0
- package/dist/user/index.js.map +1 -1
- package/dist/user/profile.d.ts +12 -2
- package/dist/user/profile.d.ts.map +1 -1
- package/dist/user/profile.js +22 -2
- package/dist/user/profile.js.map +1 -1
- package/dist/user/signal.d.ts +1 -1
- package/dist/user/signal.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic-usage.d.ts","sourceRoot":"","sources":["../../src/examples/basic-usage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,iBAAe,YAAY,
|
|
1
|
+
{"version":3,"file":"basic-usage.d.ts","sourceRoot":"","sources":["../../src/examples/basic-usage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,iBAAe,YAAY,kBA2B1B;AAGD,iBAAe,gBAAgB,kBAwC9B;AAGD,iBAAe,uBAAuB,kBAiCrC;AAGD,iBAAe,aAAa,kBAgC3B;AAGD,iBAAe,oBAAoB,kBA+BlC;AAED,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -21,7 +21,6 @@ async function basicExample() {
|
|
|
21
21
|
signals: [
|
|
22
22
|
{
|
|
23
23
|
signal: 'searched "best restaurants"',
|
|
24
|
-
type: 'active',
|
|
25
24
|
contentContext: {
|
|
26
25
|
contentId: 'article-123',
|
|
27
26
|
contentType: 'article',
|
|
@@ -117,19 +116,15 @@ async function signalExample() {
|
|
|
117
116
|
// Record multiple signals at once
|
|
118
117
|
await client.user.signal({
|
|
119
118
|
signals: [
|
|
120
|
-
// Active signal (explicit intent like click, search, subscribe)
|
|
121
119
|
{
|
|
122
120
|
signal: 'clicked "Warriors intend to keep Jimmy Butler despite season-ending injury"',
|
|
123
|
-
type: 'active',
|
|
124
121
|
contentContext: {
|
|
125
122
|
contentId: 'article-123',
|
|
126
123
|
contentType: 'article',
|
|
127
124
|
},
|
|
128
125
|
},
|
|
129
|
-
// Passive signal (implicit like read, scroll, dwell)
|
|
130
126
|
{
|
|
131
127
|
signal: 'read about NBA trades',
|
|
132
|
-
type: 'passive',
|
|
133
128
|
contentContext: {
|
|
134
129
|
contentId: 'article-456',
|
|
135
130
|
contentType: 'article',
|
|
@@ -138,7 +133,6 @@ async function signalExample() {
|
|
|
138
133
|
// Negative signal (e.g., dislike, unfollow) - use sparingly
|
|
139
134
|
{
|
|
140
135
|
signal: 'unfollowed topic "Politics"',
|
|
141
|
-
type: 'active',
|
|
142
136
|
negative: true,
|
|
143
137
|
},
|
|
144
138
|
],
|
|
@@ -156,7 +150,6 @@ async function batchedSignalExample() {
|
|
|
156
150
|
// Each promise resolves with the batch response
|
|
157
151
|
const response1 = await client.user.signalItem({
|
|
158
152
|
signal: 'clicked "Warriors intend to keep Jimmy Butler despite season-ending injury"',
|
|
159
|
-
type: 'active',
|
|
160
153
|
contentContext: {
|
|
161
154
|
contentId: 'article-123',
|
|
162
155
|
contentType: 'article',
|
|
@@ -164,7 +157,6 @@ async function batchedSignalExample() {
|
|
|
164
157
|
});
|
|
165
158
|
const response2 = await client.user.signalItem({
|
|
166
159
|
signal: 'read about NBA trades',
|
|
167
|
-
type: 'passive',
|
|
168
160
|
contentContext: {
|
|
169
161
|
contentId: 'article-456',
|
|
170
162
|
contentType: 'article',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic-usage.js","sourceRoot":"","sources":["../../src/examples/basic-usage.ts"],"names":[],"mapp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AE,6BAA6B;gBACrC,QAAQ,EAAE,IAAI;aACf;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,6CAA6C;AAC7C,KAAK,UAAU,oBAAoB;IACjC,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAAC;QACnC,OAAO,EAAE,mDAAmD;QAC5D,kBAAkB,EAAE,GAAG,EAAE,oCAAoC;KAC9D,CAAC,CAAC;IAEH,qBAAqB;IACrB,MAAM,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAC;IAE7D,wEAAwE;IACxE,gDAAgD;IAChD,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;QAC7C,MAAM,EAAE,6EAA6E;QACrF,cAAc,EAAE;YACd,SAAS,EAAE,aAAa;YACxB,WAAW,EAAE,SAAS;SACvB;KACF,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;QAC7C,MAAM,EAAE,uBAAuB;QAC/B,cAAc,EAAE;YACd,SAAS,EAAE,aAAa;YACxB,WAAW,EAAE,SAAS;SACvB;KACF,CAAC,CAAC;IAEH,2DAA2D;IAC3D,yDAAyD;IACzD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;AACxD,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -78,7 +78,7 @@ export interface paths {
|
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
|
-
/** @description Unauthorized errors */
|
|
81
|
+
/** @description Unauthorized token exchange errors */
|
|
82
82
|
401: {
|
|
83
83
|
headers: {
|
|
84
84
|
[name: string]: unknown;
|
|
@@ -86,10 +86,10 @@ export interface paths {
|
|
|
86
86
|
content: {
|
|
87
87
|
"application/json": {
|
|
88
88
|
/**
|
|
89
|
-
* @example Unauthorized:
|
|
89
|
+
* @example Unauthorized: Token validation failed
|
|
90
90
|
* @enum {string}
|
|
91
91
|
*/
|
|
92
|
-
error
|
|
92
|
+
error: "Unauthorized: Token validation failed" | "Unauthorized: Failed to create user" | "Unauthorized: Failed to authenticate with BitBitPress";
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
};
|
|
@@ -124,7 +124,7 @@ export interface paths {
|
|
|
124
124
|
};
|
|
125
125
|
/**
|
|
126
126
|
* Get User Profile
|
|
127
|
-
* @description **GET** `/
|
|
127
|
+
* @description **GET** `/v1/user/profile` Returns the user's profile, including interest tags.
|
|
128
128
|
*/
|
|
129
129
|
get: {
|
|
130
130
|
parameters: {
|
|
@@ -146,9 +146,11 @@ export interface paths {
|
|
|
146
146
|
content: {
|
|
147
147
|
"application/json": {
|
|
148
148
|
/** @example true */
|
|
149
|
-
success
|
|
150
|
-
/** @description User profile
|
|
151
|
-
data
|
|
149
|
+
success: boolean;
|
|
150
|
+
/** @description User profile */
|
|
151
|
+
data: {
|
|
152
|
+
/** @description User-picked interest tags */
|
|
153
|
+
interestTags: string[];
|
|
152
154
|
/**
|
|
153
155
|
* @description Suggested interest topics for the user
|
|
154
156
|
* @example [
|
|
@@ -157,7 +159,96 @@ export interface paths {
|
|
|
157
159
|
* "Business"
|
|
158
160
|
* ]
|
|
159
161
|
*/
|
|
160
|
-
|
|
162
|
+
suggestedInterestTags: string[];
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
/** @description Bad request - missing or invalid parameters */
|
|
168
|
+
400: {
|
|
169
|
+
headers: {
|
|
170
|
+
[name: string]: unknown;
|
|
171
|
+
};
|
|
172
|
+
content: {
|
|
173
|
+
"application/json": {
|
|
174
|
+
/** @example Bad request */
|
|
175
|
+
error?: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
/** @description Unauthorized errors */
|
|
180
|
+
401: {
|
|
181
|
+
headers: {
|
|
182
|
+
[name: string]: unknown;
|
|
183
|
+
};
|
|
184
|
+
content: {
|
|
185
|
+
"application/json": {
|
|
186
|
+
/**
|
|
187
|
+
* @example Unauthorized: No authentication token provided
|
|
188
|
+
* @enum {string}
|
|
189
|
+
*/
|
|
190
|
+
error?: "Unauthorized: No authentication token provided" | "Unauthorized: Token has expired" | "Unauthorized: Invalid token" | "Unauthorized: Authentication failed";
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
/** @description Internal server error */
|
|
195
|
+
500: {
|
|
196
|
+
headers: {
|
|
197
|
+
[name: string]: unknown;
|
|
198
|
+
};
|
|
199
|
+
content: {
|
|
200
|
+
"application/json": {
|
|
201
|
+
/** @example false */
|
|
202
|
+
success?: boolean;
|
|
203
|
+
/** @example Internal server error: An unknown error occurred */
|
|
204
|
+
error?: string;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Update User Profile
|
|
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
|
+
*/
|
|
214
|
+
put: {
|
|
215
|
+
parameters: {
|
|
216
|
+
query?: never;
|
|
217
|
+
header: {
|
|
218
|
+
/** @description Bearer token for authentication */
|
|
219
|
+
authorization: string;
|
|
220
|
+
};
|
|
221
|
+
path?: never;
|
|
222
|
+
cookie?: never;
|
|
223
|
+
};
|
|
224
|
+
requestBody: {
|
|
225
|
+
content: {
|
|
226
|
+
"application/json": {
|
|
227
|
+
/** @description Full replace: set the complete list of interest tags. */
|
|
228
|
+
interestTags?: string[];
|
|
229
|
+
/** @description Add these tags to the current list (ignored if interestTags is provided). */
|
|
230
|
+
addInterestTags?: string[];
|
|
231
|
+
/** @description Remove these tags from the current list (ignored if interestTags is provided). */
|
|
232
|
+
removeInterestTags?: string[];
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
responses: {
|
|
237
|
+
/** @description Successful response */
|
|
238
|
+
200: {
|
|
239
|
+
headers: {
|
|
240
|
+
[name: string]: unknown;
|
|
241
|
+
};
|
|
242
|
+
content: {
|
|
243
|
+
"application/json": {
|
|
244
|
+
/** @example true */
|
|
245
|
+
success: boolean;
|
|
246
|
+
/** @description Updated profile */
|
|
247
|
+
data: {
|
|
248
|
+
/** @description User-picked interest tags */
|
|
249
|
+
interestTags: string[];
|
|
250
|
+
/** @description Suggested interest topics for the user */
|
|
251
|
+
suggestedInterestTags: string[];
|
|
161
252
|
};
|
|
162
253
|
};
|
|
163
254
|
};
|
|
@@ -205,7 +296,6 @@ export interface paths {
|
|
|
205
296
|
};
|
|
206
297
|
};
|
|
207
298
|
};
|
|
208
|
-
put?: never;
|
|
209
299
|
post?: never;
|
|
210
300
|
delete?: never;
|
|
211
301
|
options?: never;
|
|
@@ -250,7 +340,7 @@ export interface paths {
|
|
|
250
340
|
path?: never;
|
|
251
341
|
cookie?: never;
|
|
252
342
|
};
|
|
253
|
-
requestBody
|
|
343
|
+
requestBody: {
|
|
254
344
|
content: {
|
|
255
345
|
"application/json": {
|
|
256
346
|
/** @description Maximum number of recommendations to return */
|
|
@@ -271,15 +361,15 @@ export interface paths {
|
|
|
271
361
|
content: {
|
|
272
362
|
"application/json": {
|
|
273
363
|
/** @example true */
|
|
274
|
-
success
|
|
364
|
+
success: boolean;
|
|
275
365
|
/** @description Recommended articles and pagination */
|
|
276
|
-
data
|
|
366
|
+
data: {
|
|
277
367
|
/** @description List of recommended articles */
|
|
278
|
-
items
|
|
368
|
+
items: {
|
|
279
369
|
/** @example BitBitPress's id */
|
|
280
|
-
assetId
|
|
370
|
+
assetId: string;
|
|
281
371
|
/** @example 0.95 */
|
|
282
|
-
score
|
|
372
|
+
score: number;
|
|
283
373
|
/** @description JSON string of requested asset fields (when `fields` provided in request) */
|
|
284
374
|
fields?: string;
|
|
285
375
|
}[];
|
|
@@ -380,8 +470,8 @@ export interface paths {
|
|
|
380
470
|
content: {
|
|
381
471
|
"application/json": {
|
|
382
472
|
/** @example true */
|
|
383
|
-
success
|
|
384
|
-
data
|
|
473
|
+
success: boolean;
|
|
474
|
+
data: Record<string, never>;
|
|
385
475
|
};
|
|
386
476
|
};
|
|
387
477
|
};
|
|
@@ -464,11 +554,6 @@ export interface paths {
|
|
|
464
554
|
signals: {
|
|
465
555
|
/** @description User action with the text associated with the interaction. (e.g. liked "Warriors intend to keep Jimmy Butler despite season-ending injury") */
|
|
466
556
|
signal: string;
|
|
467
|
-
/**
|
|
468
|
-
* @description `active` = explicit intent (click, search, subscribe). `passive` = implicit (read, scroll, dwell).
|
|
469
|
-
* @enum {string}
|
|
470
|
-
*/
|
|
471
|
-
type: "active" | "passive";
|
|
472
557
|
/** @description When true, indicates the signal is negative (e.g. dislike, unfollow). Use sparingly. Optional; defaults to false. */
|
|
473
558
|
negative?: boolean;
|
|
474
559
|
/** @description Optional context about the content that triggered this signal. */
|
|
@@ -482,8 +567,6 @@ export interface paths {
|
|
|
482
567
|
contentType: "article";
|
|
483
568
|
};
|
|
484
569
|
}[];
|
|
485
|
-
/** @description Whether the request should wait for the signals to be processed. False by default. Use sparingly. */
|
|
486
|
-
isSynchronous?: boolean;
|
|
487
570
|
};
|
|
488
571
|
};
|
|
489
572
|
};
|
|
@@ -499,14 +582,14 @@ export interface paths {
|
|
|
499
582
|
* @description Whether the request succeeded
|
|
500
583
|
* @example true
|
|
501
584
|
*/
|
|
502
|
-
success
|
|
585
|
+
success: boolean;
|
|
503
586
|
/** @description Response payload */
|
|
504
|
-
data
|
|
587
|
+
data: {
|
|
505
588
|
/**
|
|
506
589
|
* @description Whether the signals were recorded (false if no app user or no valid signals)
|
|
507
590
|
* @example true
|
|
508
591
|
*/
|
|
509
|
-
recorded
|
|
592
|
+
recorded: boolean;
|
|
510
593
|
};
|
|
511
594
|
};
|
|
512
595
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type * from './generated/openapi.js';
|
|
|
11
11
|
export type { UserMethods } from './user/index.js';
|
|
12
12
|
export type { Signal, SignalRequest, SignalResponse } from './user/signal.js';
|
|
13
13
|
export type { RecommendationsRequest, RecommendationsResponse } from './user/recommendations.js';
|
|
14
|
-
export type { ProfileResponse } from './user/profile.js';
|
|
14
|
+
export type { ProfileResponse, ProfileUpdateRequest } from './user/profile.js';
|
|
15
15
|
export type { ReportRequest, ReportResponse } from './user/report.js';
|
|
16
16
|
export type { TokenRequest, TokenResponse } from './user/token.js';
|
|
17
17
|
export type { BitBitPressSynthesizeRequest, RecommendationsRequestBody, SynthesizeInput, SynthesizeItem, SynthesizeItems, SynthesizeOutputSchema, SynthesizeRequest, } from './user/typeDefs.js';
|
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,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9E,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACjG,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
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,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,MAAM,mBAAmB,CAAC;AAC/E,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtE,YAAY,EAAE,YAAY,EAAE,aAAa,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"}
|
package/dist/user/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RequestConfig } from '../request.js';
|
|
2
2
|
import { type SynthesizeOnStreamingData } from './synthesize-batch-manager.js';
|
|
3
3
|
import { type RecommendationsRequest, type RecommendationsResponse } from './recommendations.js';
|
|
4
|
-
import { type ProfileResponse } from './profile.js';
|
|
4
|
+
import { type ProfileResponse, type ProfileUpdateRequest } from './profile.js';
|
|
5
5
|
import { type ReportRequest, type ReportResponse } from './report.js';
|
|
6
6
|
import { type Signal, type SignalRequest, type SignalResponse } from './signal.js';
|
|
7
7
|
import { type SynthesizeEvent, type SynthesizeItemResponse } from './synthesize.js';
|
|
@@ -26,11 +26,18 @@ export interface UserMethods {
|
|
|
26
26
|
*/
|
|
27
27
|
token(ssoToken: TokenRequest['ssoToken']): Promise<TokenResponse>;
|
|
28
28
|
/**
|
|
29
|
-
* Get user profile (
|
|
29
|
+
* Get user profile (interest tags and suggested topics).
|
|
30
30
|
*
|
|
31
|
-
* @returns Promise that resolves with profile data (
|
|
31
|
+
* @returns Promise that resolves with profile data (interestTags, suggestedInterestTags)
|
|
32
32
|
*/
|
|
33
33
|
profile(): Promise<NonNullable<ProfileResponse>>;
|
|
34
|
+
/**
|
|
35
|
+
* Update user profile (interest tags). Full replace via interestTags, or add/remove via addInterestTags/removeInterestTags.
|
|
36
|
+
*
|
|
37
|
+
* @param options - interestTags, addInterestTags, or removeInterestTags
|
|
38
|
+
* @returns Promise that resolves with updated profile data
|
|
39
|
+
*/
|
|
40
|
+
updateProfile(options: ProfileUpdateRequest): Promise<NonNullable<ProfileResponse>>;
|
|
34
41
|
/**
|
|
35
42
|
* Retrieve recommended articles for the authenticated user based on their interests.
|
|
36
43
|
*
|
|
@@ -48,7 +55,7 @@ export interface UserMethods {
|
|
|
48
55
|
/**
|
|
49
56
|
* Record user signals (e.g. clicked topic, read article) to inform profile and recommendations.
|
|
50
57
|
*
|
|
51
|
-
* @param options - signals array
|
|
58
|
+
* @param options - signals array (signal, optional negative, optional contentContext)
|
|
52
59
|
* @returns Promise that resolves with response data (recorded: boolean)
|
|
53
60
|
*/
|
|
54
61
|
signal(options: SignalRequest): Promise<NonNullable<SignalResponse>>;
|
package/dist/user/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/user/index.ts"],"names":[],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,CAAC,eAAe,CAAC,CAAC,CAAC;IAEjD;;;;;OAKG;IACH,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC;IAEpF;;;;;OAKG;IACH,eAAe,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAEjG;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC;IAErE;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC;IAErE;;;;;OAKG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC;IAEjE;;;;;;OAMG;IACH,UAAU,CACR,KAAK,EAAE,eAAe,EACtB,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;KAAE,GACrE,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC;IAE3C;;;;;;OAMG;IACH,cAAc,CACZ,IAAI,EAAE,cAAc,EACpB,eAAe,CAAC,EAAE,yBAAyB,GAC1C,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,aAAa,EACrB,sBAAsB,GAAE,MAAY,EACpC,kBAAkB,GAAE,MAAY,GAC/B,WAAW,CAwFb"}
|
package/dist/user/index.js
CHANGED
|
@@ -62,6 +62,7 @@ function createUserMethods(config, synthesizeBatchTimeout = 250, signalBatchTime
|
|
|
62
62
|
},
|
|
63
63
|
token: (ssoToken) => (0, token_js_1.exchangeToken)(config, ssoToken),
|
|
64
64
|
profile: () => getConfigWithToken().then(profile_js_1.getProfile),
|
|
65
|
+
updateProfile: (options) => getConfigWithToken().then((cfg) => (0, profile_js_1.putProfile)(cfg, options)),
|
|
65
66
|
recommendations: (options) => getConfigWithToken().then((cfg) => (0, recommendations_js_1.getRecommendations)(cfg, options)),
|
|
66
67
|
report: (options) => getConfigWithToken().then((cfg) => (0, report_js_1.reportBit)(cfg, options)),
|
|
67
68
|
signal: (options) => getConfigWithToken().then((cfg) => (0, signal_js_1.recordSignal)(cfg, options)),
|
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":";;AA8GA,8CA4FC;AAzMD,+EAAuG;AACvG,6DAI8B;AAC9B,6CAAuG;AACvG,2CAAiF;AACjF,2CAAiG;AACjG,uEAA+D;AAC/D,mDAAgG;AAChG,yCAAkF;AA+FlF;;GAEG;AACH,SAAgB,iBAAiB,CAC/B,MAAqB,EACrB,yBAAiC,GAAG,EACpC,qBAA6B,GAAG;IAEhC,kEAAkE;IAClE,IAAI,SAA6B,CAAC;IAClC,IAAI,YAAgC,CAAC;IACrC,IAAI,cAAkC,CAAC,CAAC,eAAe;IAEvD,8FAA8F;IAC9F,MAAM,qBAAqB,GAAG,KAAK,EAAE,QAAgB,EAAoB,EAAE;QACzE,IAAI,CAAC;YACH,MAAM,aAAa,GAAG,MAAM,IAAA,wBAAa,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YAC5D,MAAM,WAAW,GAAG,aAAa,EAAE,OAAO,IAAI,aAAa,EAAE,WAAW,CAAC;YACzE,IAAI,WAAW,EAAE,CAAC;gBAChB,SAAS,GAAG,WAAW,CAAC;gBACxB,MAAM,SAAS,GAAG,aAAa,EAAE,SAAS,CAAC;gBAC3C,cAAc;oBACZ,OA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
3
|
export type ProfileResponse = paths['/v1/user/profile']['get']['responses'][200]['content']['application/json']['data'];
|
|
4
|
+
export type ProfileUpdateRequest = paths['/v1/user/profile']['put']['requestBody']['content']['application/json'];
|
|
4
5
|
/**
|
|
5
|
-
* Get user profile information (
|
|
6
|
+
* Get user profile information (interest tags and suggested topics).
|
|
6
7
|
*
|
|
7
8
|
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
8
|
-
* @returns Promise that resolves with profile data (
|
|
9
|
+
* @returns Promise that resolves with profile data (interestTags, suggestedInterestTags per OpenAPI)
|
|
9
10
|
*/
|
|
10
11
|
export declare function getProfile(config: RequestConfig): Promise<NonNullable<ProfileResponse>>;
|
|
12
|
+
/**
|
|
13
|
+
* Update user profile (interest tags). Supports full replace via interestTags,
|
|
14
|
+
* or add/remove via addInterestTags and removeInterestTags.
|
|
15
|
+
*
|
|
16
|
+
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
17
|
+
* @param options - interestTags (full replace), addInterestTags, removeInterestTags
|
|
18
|
+
* @returns Promise that resolves with updated profile data
|
|
19
|
+
*/
|
|
20
|
+
export declare function putProfile(config: RequestConfig, options: ProfileUpdateRequest): Promise<NonNullable<ProfileResponse>>;
|
|
11
21
|
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/user/profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAInD,MAAM,MAAM,eAAe,GACzB,KAAK,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5F;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAWvC"}
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/user/profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAInD,MAAM,MAAM,eAAe,GACzB,KAAK,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5F,MAAM,MAAM,oBAAoB,GAC9B,KAAK,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAEjF;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAWvC;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAYvC"}
|
package/dist/user/profile.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getProfile = getProfile;
|
|
4
|
+
exports.putProfile = putProfile;
|
|
4
5
|
const request_js_1 = require("../request.js");
|
|
5
6
|
/**
|
|
6
|
-
* Get user profile information (
|
|
7
|
+
* Get user profile information (interest tags and suggested topics).
|
|
7
8
|
*
|
|
8
9
|
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
9
|
-
* @returns Promise that resolves with profile data (
|
|
10
|
+
* @returns Promise that resolves with profile data (interestTags, suggestedInterestTags per OpenAPI)
|
|
10
11
|
*/
|
|
11
12
|
async function getProfile(config) {
|
|
12
13
|
const response = await (0, request_js_1.makeRequest)(config, {
|
|
@@ -18,4 +19,23 @@ async function getProfile(config) {
|
|
|
18
19
|
}
|
|
19
20
|
return response;
|
|
20
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Update user profile (interest tags). Supports full replace via interestTags,
|
|
24
|
+
* or add/remove via addInterestTags and removeInterestTags.
|
|
25
|
+
*
|
|
26
|
+
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
27
|
+
* @param options - interestTags (full replace), addInterestTags, removeInterestTags
|
|
28
|
+
* @returns Promise that resolves with updated profile data
|
|
29
|
+
*/
|
|
30
|
+
async function putProfile(config, options) {
|
|
31
|
+
const response = await (0, request_js_1.makeRequest)(config, {
|
|
32
|
+
method: 'PUT',
|
|
33
|
+
path: '/v1/user/profile',
|
|
34
|
+
body: options,
|
|
35
|
+
});
|
|
36
|
+
if (!response) {
|
|
37
|
+
throw new Error('Failed to update profile: no data in response');
|
|
38
|
+
}
|
|
39
|
+
return response;
|
|
40
|
+
}
|
|
21
41
|
//# sourceMappingURL=profile.js.map
|
package/dist/user/profile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/user/profile.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/user/profile.ts"],"names":[],"mappings":";;AAiBA,gCAaC;AAUD,gCAeC;AArDD,8CAA4C;AAS5C;;;;;GAKG;AACI,KAAK,UAAU,UAAU,CAC9B,MAAqB;IAErB,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAW,EAAkB,MAAM,EAAE;QAC1D,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,kBAAkB;KACzB,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,UAAU,CAC9B,MAAqB,EACrB,OAA6B;IAE7B,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAW,EAAkB,MAAM,EAAE;QAC1D,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,OAAO;KACd,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/user/signal.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type Signal = SignalRequest['signals'][number];
|
|
|
7
7
|
* Record user signals (e.g. clicked topic, read article) to inform profile interests. Powers recommendations.
|
|
8
8
|
*
|
|
9
9
|
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
10
|
-
* @param options - signals array (signal text,
|
|
10
|
+
* @param options - signals array (signal text, optional negative, optional contentContext)
|
|
11
11
|
* @returns Promise that resolves with response data (recorded: boolean)
|
|
12
12
|
*/
|
|
13
13
|
export declare function recordSignal(config: RequestConfig, options: SignalRequest): Promise<NonNullable<SignalResponse>>;
|
package/dist/user/signal.js
CHANGED
|
@@ -6,7 +6,7 @@ const request_js_1 = require("../request.js");
|
|
|
6
6
|
* Record user signals (e.g. clicked topic, read article) to inform profile interests. Powers recommendations.
|
|
7
7
|
*
|
|
8
8
|
* @param config - Request configuration with base URL, timeout, fetch, and optional token
|
|
9
|
-
* @param options - signals array (signal text,
|
|
9
|
+
* @param options - signals array (signal text, optional negative, optional contentContext)
|
|
10
10
|
* @returns Promise that resolves with response data (recorded: boolean)
|
|
11
11
|
*/
|
|
12
12
|
async function recordSignal(config, options) {
|