@stream-io/node-sdk 0.7.49 → 0.7.50
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 +92 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.mjs +92 -1
- package/dist/index.es.mjs.map +1 -1
- package/dist/src/gen/chat/ChatApi.d.ts +5 -1
- package/dist/src/gen/common/CommonApi.d.ts +5 -1
- package/dist/src/gen/models/index.d.ts +183 -15
- package/dist/src/gen/moderation/ModerationApi.d.ts +3 -1
- package/package.json +1 -1
- package/src/gen/chat/ChatApi.ts +93 -0
- package/src/gen/common/CommonApi.ts +70 -0
- package/src/gen/model-decoders/decoders.ts +11 -0
- package/src/gen/models/index.ts +230 -16
- package/src/gen/moderation/ModerationApi.ts +58 -0
package/dist/index.es.mjs
CHANGED
|
@@ -1920,6 +1920,13 @@ decoders.GetDraftResponse = (input) => {
|
|
|
1920
1920
|
};
|
|
1921
1921
|
return decode(typeMappings, input);
|
|
1922
1922
|
};
|
|
1923
|
+
decoders.GetExternalStorageResponse = (input) => {
|
|
1924
|
+
const typeMappings = {
|
|
1925
|
+
created_at: { type: 'DatetimeType', isSingle: true },
|
|
1926
|
+
updated_at: { type: 'DatetimeType', isSingle: true },
|
|
1927
|
+
};
|
|
1928
|
+
return decode(typeMappings, input);
|
|
1929
|
+
};
|
|
1923
1930
|
decoders.GetFeedGroupResponse = (input) => {
|
|
1924
1931
|
const typeMappings = {
|
|
1925
1932
|
feed_group: { type: 'FeedGroupResponse', isSingle: true },
|
|
@@ -3167,6 +3174,7 @@ decoders.ReviewQueueItemResponse = (input) => {
|
|
|
3167
3174
|
bans: { type: 'BanInfoResponse', isSingle: false },
|
|
3168
3175
|
flags: { type: 'ModerationFlagResponse', isSingle: false },
|
|
3169
3176
|
completed_at: { type: 'DatetimeType', isSingle: true },
|
|
3177
|
+
escalated_at: { type: 'DatetimeType', isSingle: true },
|
|
3170
3178
|
reviewed_at: { type: 'DatetimeType', isSingle: true },
|
|
3171
3179
|
appeal: { type: 'AppealItemResponse', isSingle: true },
|
|
3172
3180
|
assigned_to: { type: 'UserResponse', isSingle: true },
|
|
@@ -4258,6 +4266,30 @@ class CommonApi {
|
|
|
4258
4266
|
decoders.CreateImportV2TaskResponse?.(response.body);
|
|
4259
4267
|
return { ...response.body, metadata: response.metadata };
|
|
4260
4268
|
}
|
|
4269
|
+
async deleteImporterExternalStorage() {
|
|
4270
|
+
const response = await this.apiClient.sendRequest('DELETE', '/api/v2/imports/v2/external-storage', undefined, undefined);
|
|
4271
|
+
decoders.DeleteExternalStorageResponse?.(response.body);
|
|
4272
|
+
return { ...response.body, metadata: response.metadata };
|
|
4273
|
+
}
|
|
4274
|
+
async getImporterExternalStorage() {
|
|
4275
|
+
const response = await this.apiClient.sendRequest('GET', '/api/v2/imports/v2/external-storage', undefined, undefined);
|
|
4276
|
+
decoders.GetExternalStorageResponse?.(response.body);
|
|
4277
|
+
return { ...response.body, metadata: response.metadata };
|
|
4278
|
+
}
|
|
4279
|
+
async upsertImporterExternalStorage(request) {
|
|
4280
|
+
const body = {
|
|
4281
|
+
type: request?.type,
|
|
4282
|
+
aws_s3: request?.aws_s3,
|
|
4283
|
+
};
|
|
4284
|
+
const response = await this.apiClient.sendRequest('PUT', '/api/v2/imports/v2/external-storage', undefined, undefined, body, 'application/json');
|
|
4285
|
+
decoders.UpsertExternalStorageResponse?.(response.body);
|
|
4286
|
+
return { ...response.body, metadata: response.metadata };
|
|
4287
|
+
}
|
|
4288
|
+
async validateImporterExternalStorage() {
|
|
4289
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/imports/v2/external-storage/validate', undefined, undefined);
|
|
4290
|
+
decoders.ValidateExternalStorageResponse?.(response.body);
|
|
4291
|
+
return { ...response.body, metadata: response.metadata };
|
|
4292
|
+
}
|
|
4261
4293
|
async deleteImportV2Task(request) {
|
|
4262
4294
|
const pathParams = {
|
|
4263
4295
|
id: request?.id,
|
|
@@ -4668,6 +4700,7 @@ class CommonApi {
|
|
|
4668
4700
|
};
|
|
4669
4701
|
const body = {
|
|
4670
4702
|
member_ids: request?.member_ids,
|
|
4703
|
+
as_admin: request?.as_admin,
|
|
4671
4704
|
team_id: request?.team_id,
|
|
4672
4705
|
};
|
|
4673
4706
|
const response = await this.apiClient.sendRequest('POST', '/api/v2/usergroups/{id}/members', pathParams, undefined, body, 'application/json');
|
|
@@ -6914,6 +6947,40 @@ class ChatApi {
|
|
|
6914
6947
|
decoders.QueryRemindersResponse?.(response.body);
|
|
6915
6948
|
return { ...response.body, metadata: response.metadata };
|
|
6916
6949
|
}
|
|
6950
|
+
async getRetentionPolicy() {
|
|
6951
|
+
const response = await this.apiClient.sendRequest('GET', '/api/v2/chat/retention_policy', undefined, undefined);
|
|
6952
|
+
decoders.GetRetentionPolicyResponse?.(response.body);
|
|
6953
|
+
return { ...response.body, metadata: response.metadata };
|
|
6954
|
+
}
|
|
6955
|
+
async setRetentionPolicy(request) {
|
|
6956
|
+
const body = {
|
|
6957
|
+
max_age_hours: request?.max_age_hours,
|
|
6958
|
+
policy: request?.policy,
|
|
6959
|
+
};
|
|
6960
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/chat/retention_policy', undefined, undefined, body, 'application/json');
|
|
6961
|
+
decoders.SetRetentionPolicyResponse?.(response.body);
|
|
6962
|
+
return { ...response.body, metadata: response.metadata };
|
|
6963
|
+
}
|
|
6964
|
+
async deleteRetentionPolicy(request) {
|
|
6965
|
+
const body = {
|
|
6966
|
+
policy: request?.policy,
|
|
6967
|
+
};
|
|
6968
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/chat/retention_policy/delete', undefined, undefined, body, 'application/json');
|
|
6969
|
+
decoders.DeleteRetentionPolicyResponse?.(response.body);
|
|
6970
|
+
return { ...response.body, metadata: response.metadata };
|
|
6971
|
+
}
|
|
6972
|
+
async getRetentionPolicyRuns(request) {
|
|
6973
|
+
const body = {
|
|
6974
|
+
limit: request?.limit,
|
|
6975
|
+
next: request?.next,
|
|
6976
|
+
prev: request?.prev,
|
|
6977
|
+
sort: request?.sort,
|
|
6978
|
+
filter_conditions: request?.filter_conditions,
|
|
6979
|
+
};
|
|
6980
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/chat/retention_policy/runs', undefined, undefined, body, 'application/json');
|
|
6981
|
+
decoders.GetRetentionPolicyRunsResponse?.(response.body);
|
|
6982
|
+
return { ...response.body, metadata: response.metadata };
|
|
6983
|
+
}
|
|
6917
6984
|
async search(request) {
|
|
6918
6985
|
const queryParams = {
|
|
6919
6986
|
payload: request?.payload,
|
|
@@ -7307,6 +7374,19 @@ class ModerationApi {
|
|
|
7307
7374
|
constructor(apiClient) {
|
|
7308
7375
|
this.apiClient = apiClient;
|
|
7309
7376
|
}
|
|
7377
|
+
async insertActionLog(request) {
|
|
7378
|
+
const body = {
|
|
7379
|
+
action_type: request?.action_type,
|
|
7380
|
+
entity_creator_id: request?.entity_creator_id,
|
|
7381
|
+
entity_id: request?.entity_id,
|
|
7382
|
+
entity_type: request?.entity_type,
|
|
7383
|
+
reason: request?.reason,
|
|
7384
|
+
custom: request?.custom,
|
|
7385
|
+
};
|
|
7386
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/moderation/action_logs', undefined, undefined, body, 'application/json');
|
|
7387
|
+
decoders.InsertActionLogResponse?.(response.body);
|
|
7388
|
+
return { ...response.body, metadata: response.metadata };
|
|
7389
|
+
}
|
|
7310
7390
|
async appeal(request) {
|
|
7311
7391
|
const body = {
|
|
7312
7392
|
appeal_reason: request?.appeal_reason,
|
|
@@ -7373,6 +7453,7 @@ class ModerationApi {
|
|
|
7373
7453
|
entity_type: request?.entity_type,
|
|
7374
7454
|
config_key: request?.config_key,
|
|
7375
7455
|
config_team: request?.config_team,
|
|
7456
|
+
content_published_at: request?.content_published_at,
|
|
7376
7457
|
test_mode: request?.test_mode,
|
|
7377
7458
|
user_id: request?.user_id,
|
|
7378
7459
|
config: request?.config,
|
|
@@ -7502,6 +7583,15 @@ class ModerationApi {
|
|
|
7502
7583
|
decoders.FlagResponse?.(response.body);
|
|
7503
7584
|
return { ...response.body, metadata: response.metadata };
|
|
7504
7585
|
}
|
|
7586
|
+
async getFlagCount(request) {
|
|
7587
|
+
const body = {
|
|
7588
|
+
entity_creator_id: request?.entity_creator_id,
|
|
7589
|
+
entity_type: request?.entity_type,
|
|
7590
|
+
};
|
|
7591
|
+
const response = await this.apiClient.sendRequest('POST', '/api/v2/moderation/flag_count', undefined, undefined, body, 'application/json');
|
|
7592
|
+
decoders.GetFlagCountResponse?.(response.body);
|
|
7593
|
+
return { ...response.body, metadata: response.metadata };
|
|
7594
|
+
}
|
|
7505
7595
|
async queryModerationFlags(request) {
|
|
7506
7596
|
const body = {
|
|
7507
7597
|
limit: request?.limit,
|
|
@@ -7622,6 +7712,7 @@ class ModerationApi {
|
|
|
7622
7712
|
delete_message: request?.delete_message,
|
|
7623
7713
|
delete_reaction: request?.delete_reaction,
|
|
7624
7714
|
delete_user: request?.delete_user,
|
|
7715
|
+
escalate: request?.escalate,
|
|
7625
7716
|
flag: request?.flag,
|
|
7626
7717
|
mark_reviewed: request?.mark_reviewed,
|
|
7627
7718
|
reject_appeal: request?.reject_appeal,
|
|
@@ -7711,7 +7802,7 @@ class ApiClient {
|
|
|
7711
7802
|
const headers = {
|
|
7712
7803
|
Authorization: this.apiConfig.token,
|
|
7713
7804
|
'stream-auth-type': 'jwt',
|
|
7714
|
-
'X-Stream-Client': 'stream-node-' + "0.7.
|
|
7805
|
+
'X-Stream-Client': 'stream-node-' + "0.7.50",
|
|
7715
7806
|
'Accept-Encoding': 'gzip',
|
|
7716
7807
|
'x-client-request-id': clientRequestId,
|
|
7717
7808
|
};
|