stream-chat 9.38.0 → 9.39.0
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/cjs/index.browser.js +55 -1
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +55 -1
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +55 -1
- package/dist/esm/index.mjs.map +2 -2
- package/dist/types/client.d.ts +34 -1
- package/dist/types/types.d.ts +44 -1
- package/package.json +1 -1
- package/src/client.ts +63 -0
- package/src/types.ts +50 -1
|
@@ -15124,7 +15124,7 @@ var StreamChat = class _StreamChat {
|
|
|
15124
15124
|
if (this.userAgent) {
|
|
15125
15125
|
return this.userAgent;
|
|
15126
15126
|
}
|
|
15127
|
-
const version = "9.
|
|
15127
|
+
const version = "9.39.0";
|
|
15128
15128
|
const clientBundle = "browser-cjs";
|
|
15129
15129
|
let userAgentString = "";
|
|
15130
15130
|
if (this.sdkIdentifier) {
|
|
@@ -16399,6 +16399,60 @@ var StreamChat = class _StreamChat {
|
|
|
16399
16399
|
}
|
|
16400
16400
|
);
|
|
16401
16401
|
}
|
|
16402
|
+
/**
|
|
16403
|
+
* setRetentionPolicy - Creates or updates a retention policy for the app.
|
|
16404
|
+
* Server-side only.
|
|
16405
|
+
*
|
|
16406
|
+
* @param {string} policy The policy type ('old-messages' or 'inactive-channels')
|
|
16407
|
+
* @param {number} maxAgeHours Max age in hours (24-43800)
|
|
16408
|
+
* @returns {Promise<SetRetentionPolicyResponse>}
|
|
16409
|
+
*/
|
|
16410
|
+
async setRetentionPolicy(policy, maxAgeHours) {
|
|
16411
|
+
this.validateServerSideAuth();
|
|
16412
|
+
return await this.post(
|
|
16413
|
+
this.baseURL + "/retention_policy",
|
|
16414
|
+
{ policy, max_age_hours: maxAgeHours }
|
|
16415
|
+
);
|
|
16416
|
+
}
|
|
16417
|
+
/**
|
|
16418
|
+
* deleteRetentionPolicy - Deletes a retention policy for the app.
|
|
16419
|
+
* Server-side only.
|
|
16420
|
+
*
|
|
16421
|
+
* @param {string} policy The policy type ('old-messages' or 'inactive-channels')
|
|
16422
|
+
* @returns {Promise<DeleteRetentionPolicyResponse>}
|
|
16423
|
+
*/
|
|
16424
|
+
async deleteRetentionPolicy(policy) {
|
|
16425
|
+
this.validateServerSideAuth();
|
|
16426
|
+
return await this.post(
|
|
16427
|
+
this.baseURL + "/retention_policy/delete",
|
|
16428
|
+
{ policy }
|
|
16429
|
+
);
|
|
16430
|
+
}
|
|
16431
|
+
/**
|
|
16432
|
+
* getRetentionPolicy - Returns all retention policies configured for the app.
|
|
16433
|
+
* Server-side only.
|
|
16434
|
+
*
|
|
16435
|
+
* @returns {Promise<GetRetentionPolicyResponse>}
|
|
16436
|
+
*/
|
|
16437
|
+
async getRetentionPolicy() {
|
|
16438
|
+
this.validateServerSideAuth();
|
|
16439
|
+
return await this.get(this.baseURL + "/retention_policy");
|
|
16440
|
+
}
|
|
16441
|
+
/**
|
|
16442
|
+
* getRetentionPolicyRuns - Returns filtered and sorted retention cleanup run history.
|
|
16443
|
+
* Supports filter_conditions on 'policy' and 'date' fields.
|
|
16444
|
+
* Server-side only.
|
|
16445
|
+
*
|
|
16446
|
+
* @param {GetRetentionPolicyRunsOptions} options Filter, sort, and pagination options
|
|
16447
|
+
* @returns {Promise<GetRetentionPolicyRunsResponse>}
|
|
16448
|
+
*/
|
|
16449
|
+
async getRetentionPolicyRuns(options = {}) {
|
|
16450
|
+
this.validateServerSideAuth();
|
|
16451
|
+
return await this.post(
|
|
16452
|
+
this.baseURL + "/retention_policy/runs",
|
|
16453
|
+
options
|
|
16454
|
+
);
|
|
16455
|
+
}
|
|
16402
16456
|
};
|
|
16403
16457
|
|
|
16404
16458
|
// src/events.ts
|