@stream-io/node-sdk 0.7.57 → 0.7.59
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.cjs.js +54 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.mjs +54 -1
- package/dist/index.es.mjs.map +1 -1
- package/dist/src/gen/feeds/FeedsApi.d.ts +7 -1
- package/dist/src/gen/models/index.d.ts +59 -0
- package/package.json +1 -1
- package/src/gen/feeds/FeedsApi.ts +89 -0
- package/src/gen/model-decoders/decoders.ts +14 -0
- package/src/gen/models/index.ts +75 -0
package/dist/index.cjs.js
CHANGED
|
@@ -2257,6 +2257,18 @@ decoders.GetOrCreateFeedViewResponse = (input) => {
|
|
|
2257
2257
|
};
|
|
2258
2258
|
return decode(typeMappings, input);
|
|
2259
2259
|
};
|
|
2260
|
+
decoders.GetOrCreateFollowResponse = (input) => {
|
|
2261
|
+
const typeMappings = {
|
|
2262
|
+
follow: { type: 'FollowResponse', isSingle: true },
|
|
2263
|
+
};
|
|
2264
|
+
return decode(typeMappings, input);
|
|
2265
|
+
};
|
|
2266
|
+
decoders.GetOrCreateUnfollowResponse = (input) => {
|
|
2267
|
+
const typeMappings = {
|
|
2268
|
+
follow: { type: 'FollowResponse', isSingle: true },
|
|
2269
|
+
};
|
|
2270
|
+
return decode(typeMappings, input);
|
|
2271
|
+
};
|
|
2260
2272
|
decoders.GetPushTemplatesResponse = (input) => {
|
|
2261
2273
|
const typeMappings = {
|
|
2262
2274
|
templates: { type: 'PushTemplateResponse', isSingle: false },
|
|
@@ -8146,7 +8158,7 @@ class ApiClient {
|
|
|
8146
8158
|
const headers = {
|
|
8147
8159
|
Authorization: this.apiConfig.token,
|
|
8148
8160
|
'stream-auth-type': 'jwt',
|
|
8149
|
-
'X-Stream-Client': 'stream-node-' + "0.7.
|
|
8161
|
+
'X-Stream-Client': 'stream-node-' + "0.7.59",
|
|
8150
8162
|
'Accept-Encoding': 'gzip',
|
|
8151
8163
|
'x-client-request-id': clientRequestId,
|
|
8152
8164
|
};
|
|
@@ -9418,6 +9430,24 @@ class FeedsApi {
|
|
|
9418
9430
|
decoders.RejectFollowResponse?.(response.body);
|
|
9419
9431
|
return { ...response.body, metadata: response.metadata };
|
|
9420
9432
|
}
|
|
9433
|
+
async getOrCreateFollow(request) {
|
|
9434
|
+
const body = {
|
|
9435
|
+
source: request?.source,
|
|
9436
|
+
target: request?.target,
|
|
9437
|
+
activity_copy_limit: request?.activity_copy_limit,
|
|
9438
|
+
copy_custom_to_notification: request?.copy_custom_to_notification,
|
|
9439
|
+
create_notification_activity: request?.create_notification_activity,
|
|
9440
|
+
create_users: request?.create_users,
|
|
9441
|
+
enrich_own_fields: request?.enrich_own_fields,
|
|
9442
|
+
push_preference: request?.push_preference,
|
|
9443
|
+
skip_push: request?.skip_push,
|
|
9444
|
+
status: request?.status,
|
|
9445
|
+
custom: request?.custom,
|
|
9446
|
+
};
|
|
9447
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/feeds/follows/upsert', undefined, undefined, body, 'application/json');
|
|
9448
|
+
decoders.GetOrCreateFollowResponse?.(response.body);
|
|
9449
|
+
return { ...response.body, metadata: response.metadata };
|
|
9450
|
+
}
|
|
9421
9451
|
async unfollow(request) {
|
|
9422
9452
|
const queryParams = {
|
|
9423
9453
|
delete_notification_activity: request?.delete_notification_activity,
|
|
@@ -9521,6 +9551,18 @@ class FeedsApi {
|
|
|
9521
9551
|
decoders.UnfollowBatchResponse?.(response.body);
|
|
9522
9552
|
return { ...response.body, metadata: response.metadata };
|
|
9523
9553
|
}
|
|
9554
|
+
async getOrCreateUnfollow(request) {
|
|
9555
|
+
const body = {
|
|
9556
|
+
source: request?.source,
|
|
9557
|
+
target: request?.target,
|
|
9558
|
+
delete_notification_activity: request?.delete_notification_activity,
|
|
9559
|
+
enrich_own_fields: request?.enrich_own_fields,
|
|
9560
|
+
keep_history: request?.keep_history,
|
|
9561
|
+
};
|
|
9562
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/feeds/unfollow/upsert', undefined, undefined, body, 'application/json');
|
|
9563
|
+
decoders.GetOrCreateUnfollowResponse?.(response.body);
|
|
9564
|
+
return { ...response.body, metadata: response.metadata };
|
|
9565
|
+
}
|
|
9524
9566
|
async deleteFeedUserData(request) {
|
|
9525
9567
|
const pathParams = {
|
|
9526
9568
|
user_id: request?.user_id,
|
|
@@ -9540,6 +9582,17 @@ class FeedsApi {
|
|
|
9540
9582
|
decoders.ExportFeedUserDataResponse?.(response.body);
|
|
9541
9583
|
return { ...response.body, metadata: response.metadata };
|
|
9542
9584
|
}
|
|
9585
|
+
async getUserInterests(request) {
|
|
9586
|
+
const queryParams = {
|
|
9587
|
+
limit: request?.limit,
|
|
9588
|
+
};
|
|
9589
|
+
const pathParams = {
|
|
9590
|
+
user_id: request?.user_id,
|
|
9591
|
+
};
|
|
9592
|
+
const response = await this.apiClient.sendRequest('GET', '/api/v2/feeds/users/{user_id}/interests', pathParams, queryParams);
|
|
9593
|
+
decoders.GetUserInterestsResponse?.(response.body);
|
|
9594
|
+
return { ...response.body, metadata: response.metadata };
|
|
9595
|
+
}
|
|
9543
9596
|
}
|
|
9544
9597
|
|
|
9545
9598
|
class FeedApi {
|