@bitbitpress/client 1.1.4 → 1.2.3

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 CHANGED
@@ -47,8 +47,6 @@ More details can also be found in your control room's API docs @ https://your-co
47
47
  - [updateProfile](#updateprofile)
48
48
  - [recommendations](#recommendations)
49
49
  - [report](#report)
50
- - [createSubmission](#createsubmission)
51
- - [submissions](#submissions)
52
50
  - [submit](#submit)
53
51
  - [submissionState](#submissionstate)
54
52
  - [submissionFeed](#submissionfeed)
@@ -175,7 +173,7 @@ console.log('Access token:', tokenResponse.accessToken);
175
173
 
176
174
  #### profile
177
175
 
178
- Get user profile information, including interest tags, suggested topics, job title, and company.
176
+ Get user profile information, including interest tags, suggested topics, and custom attributes.
179
177
 
180
178
  ```typescript
181
179
  client.user.profile(): Promise<ProfileResponse>
@@ -186,8 +184,7 @@ client.user.profile(): Promise<ProfileResponse>
186
184
  - `Promise<ProfileResponse>`: Response containing:
187
185
  - `interestTags: string[]`: User-picked interest tags
188
186
  - `suggestedInterestTags: string[]`: Suggested interest topics for the user
189
- - `jobTitle?: string`: User's job title
190
- - `company?: string`: User's company or organization
187
+ - `customAttributes?: Record<string, unknown>`: Customer-defined profile attributes (shape governed by the deployment's active app-user profile schema)
191
188
 
192
189
  ##### Example
193
190
 
@@ -195,8 +192,7 @@ client.user.profile(): Promise<ProfileResponse>
195
192
  const profile = await client.user.profile();
196
193
  console.log('Interest tags:', profile.interestTags);
197
194
  console.log('Suggested topics:', profile.suggestedInterestTags);
198
- console.log('Job title:', profile.jobTitle);
199
- console.log('Company:', profile.company);
195
+ console.log('Custom attributes:', profile.customAttributes);
200
196
  ```
201
197
 
202
198
  ##### Throws
@@ -207,7 +203,7 @@ console.log('Company:', profile.company);
207
203
 
208
204
  #### updateProfile
209
205
 
210
- Update user profile. Supports full interest tag replace via `interestTags`, add/remove via `addInterestTags` and `removeInterestTags`, and `jobTitle` / `company` updates. Pass an empty string to clear `jobTitle` or `company`.
206
+ Update user profile. Supports full interest tag replace via `interestTags`, add/remove via `addInterestTags` and `removeInterestTags`, and `customAttributes` (validated against the deployment's active app-user profile schema).
211
207
 
212
208
  ```typescript
213
209
  client.user.updateProfile(options: ProfileUpdateRequest): Promise<ProfileResponse>
@@ -218,8 +214,7 @@ client.user.updateProfile(options: ProfileUpdateRequest): Promise<ProfileRespons
218
214
  - `options.interestTags` (optional): Full replace — set the complete list of interest tags
219
215
  - `options.addInterestTags` (optional): Add these tags (ignored if `interestTags` is provided)
220
216
  - `options.removeInterestTags` (optional): Remove these tags (ignored if `interestTags` is provided)
221
- - `options.jobTitle` (optional): Set the user's job title; pass `''` to clear
222
- - `options.company` (optional): Set the user's company or organization; pass `''` to clear
217
+ - `options.customAttributes` (optional): Customer-defined profile attributes; validated against the deployment's active app-user profile schema before persisting
223
218
 
224
219
  ##### Returns
225
220
 
@@ -230,8 +225,7 @@ client.user.updateProfile(options: ProfileUpdateRequest): Promise<ProfileRespons
230
225
  ```typescript
231
226
  await client.user.updateProfile({
232
227
  interestTags: ['Technology', 'Science'],
233
- jobTitle: 'Editor',
234
- company: 'Daily Planet',
228
+ customAttributes: { jobTitle: 'Editor', company: 'Daily Planet' },
235
229
  });
236
230
  // Or add/remove:
237
231
  await client.user.updateProfile({
@@ -347,90 +341,6 @@ await client.user.report({
347
341
 
348
342
  ---
349
343
 
350
- #### createSubmission
351
-
352
- Create a structured user submission and optional presigned file upload URLs.
353
-
354
- ```typescript
355
- client.user.createSubmission(options: CreateUserSubmissionRequest): Promise<CreateUserSubmissionResponse>
356
- ```
357
-
358
- ##### Parameters
359
-
360
- - `options.keyName` (required): User submission schema key name
361
- - `options.data` (required): Structured submission data
362
- - `options.files` (optional): File descriptors for presigned uploads, each with `field`, `contentType`, and optional `fileName`
363
-
364
- ##### Returns
365
-
366
- - `Promise<CreateUserSubmissionResponse>`: Created submission and any presigned upload URLs
367
-
368
- ##### Example
369
-
370
- ```typescript
371
- const result = await client.user.createSubmission({
372
- keyName: 'reader-tip',
373
- data: {
374
- title: 'Transit delay',
375
- description: 'The downtown train is delayed.',
376
- },
377
- files: [
378
- {
379
- field: 'photo',
380
- contentType: 'image/jpeg',
381
- fileName: 'platform.jpg',
382
- },
383
- ],
384
- });
385
-
386
- console.log('Submission:', result.submission);
387
- console.log('Upload URLs:', result.uploads);
388
- ```
389
-
390
- ##### Throws
391
-
392
- - `Error`: If the request fails or no data is returned
393
-
394
- ---
395
-
396
- #### submissions
397
-
398
- List live submissions for a user submission schema.
399
-
400
- ```typescript
401
- client.user.submissions(
402
- keyName: string,
403
- options?: ListUserSubmissionsRequest,
404
- ): Promise<ListUserSubmissionsResponse>
405
- ```
406
-
407
- ##### Parameters
408
-
409
- - `keyName` (required): User submission schema key name
410
- - `options.first` (optional): Maximum number of submissions to return
411
- - `options.after` (optional): Cursor from the previous response
412
-
413
- ##### Returns
414
-
415
- - `Promise<ListUserSubmissionsResponse>`: Response containing `items` and a nullable `cursor`
416
-
417
- ##### Example
418
-
419
- ```typescript
420
- const result = await client.user.submissions('reader-tip', {
421
- first: 20,
422
- });
423
-
424
- console.log('Submissions:', result.items);
425
- console.log('Next cursor:', result.cursor);
426
- ```
427
-
428
- ##### Throws
429
-
430
- - `Error`: If the request fails or no data is returned
431
-
432
- ---
433
-
434
344
  #### submit
435
345
 
436
346
  Submit content (a poll vote or a contest entry) tied to a synthesis output. One submission per user per piece — re-submitting overwrites the prior one. Get `synthesisOutputId` from the synthesize response (`result.synthesisOutputId`).
@@ -937,8 +847,7 @@ type RecommendationsRequest = {
937
847
  type ProfileResponse = {
938
848
  interestTags: string[];
939
849
  suggestedInterestTags: string[];
940
- jobTitle?: string;
941
- company?: string;
850
+ customAttributes?: Record<string, unknown>;
942
851
  }
943
852
  ```
944
853
 
@@ -949,8 +858,7 @@ type ProfileUpdateRequest = {
949
858
  interestTags?: string[]; // Full replace: set the complete list
950
859
  addInterestTags?: string[]; // Add tags (ignored if interestTags is provided)
951
860
  removeInterestTags?: string[]; // Remove tags (ignored if interestTags is provided)
952
- jobTitle?: string; // Pass empty string to clear
953
- company?: string; // Pass empty string to clear
861
+ customAttributes?: Record<string, unknown>; // Validated against the deployment's profile schema
954
862
  }
955
863
  ```
956
864
 
@@ -982,58 +890,6 @@ type ReportRequest = {
982
890
  type ReportResponse = unknown;
983
891
  ```
984
892
 
985
- #### CreateUserSubmissionRequest
986
-
987
- ```typescript
988
- type CreateUserSubmissionRequest = {
989
- keyName: string;
990
- data: Record<string, unknown>;
991
- files?: Array<{
992
- field: string;
993
- contentType: string;
994
- fileName?: string;
995
- }>;
996
- }
997
- ```
998
-
999
- #### CreateUserSubmissionResponse
1000
-
1001
- ```typescript
1002
- type CreateUserSubmissionResponse = {
1003
- submission: {
1004
- id: string;
1005
- userSubmissionSchemaId: string;
1006
- userId: string;
1007
- state: string;
1008
- createdAt: string;
1009
- updatedAt?: string;
1010
- } & Record<string, unknown>;
1011
- uploads: Array<{
1012
- field: string;
1013
- s3Key: string;
1014
- uploadUrl: string;
1015
- }>;
1016
- }
1017
- ```
1018
-
1019
- #### ListUserSubmissionsRequest
1020
-
1021
- ```typescript
1022
- type ListUserSubmissionsRequest = {
1023
- first?: number;
1024
- after?: string;
1025
- }
1026
- ```
1027
-
1028
- #### ListUserSubmissionsResponse
1029
-
1030
- ```typescript
1031
- type ListUserSubmissionsResponse = {
1032
- cursor: string | null;
1033
- items: Array<Record<string, unknown>>;
1034
- }
1035
- ```
1036
-
1037
893
  #### SignalRequest
1038
894
 
1039
895
  ```typescript