@stream-io/node-sdk 0.1.8 → 0.1.10

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.
Files changed (67) hide show
  1. package/dist/index.cjs.js +326 -72
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.es.js +326 -72
  4. package/dist/index.es.js.map +1 -1
  5. package/dist/src/StreamCall.d.ts +2 -2
  6. package/dist/src/StreamClient.d.ts +3 -3
  7. package/dist/src/StreamVideoClient.d.ts +7 -1
  8. package/dist/src/gen/chat/apis/ChannelTypesApi.d.ts +1 -1
  9. package/dist/src/gen/chat/apis/ChannelsApi.d.ts +1 -1
  10. package/dist/src/gen/chat/apis/CustomCommandsApi.d.ts +1 -1
  11. package/dist/src/gen/chat/apis/DefaultApi.d.ts +1 -1
  12. package/dist/src/gen/chat/apis/DevicesApi.d.ts +1 -1
  13. package/dist/src/gen/chat/apis/EventsApi.d.ts +1 -1
  14. package/dist/src/gen/chat/apis/FilesApi.d.ts +1 -1
  15. package/dist/src/gen/chat/apis/GDPRApi.d.ts +1 -1
  16. package/dist/src/gen/chat/apis/ImportsApi.d.ts +1 -1
  17. package/dist/src/gen/chat/apis/MessagesApi.d.ts +1 -1
  18. package/dist/src/gen/chat/apis/ModerationApi.d.ts +1 -1
  19. package/dist/src/gen/chat/apis/PermissionsV2Api.d.ts +1 -1
  20. package/dist/src/gen/chat/apis/PushApi.d.ts +1 -1
  21. package/dist/src/gen/chat/apis/ReactionsApi.d.ts +1 -1
  22. package/dist/src/gen/chat/apis/ServerSideApi.d.ts +1 -1
  23. package/dist/src/gen/chat/apis/SettingsApi.d.ts +1 -1
  24. package/dist/src/gen/chat/apis/TasksApi.d.ts +1 -1
  25. package/dist/src/gen/chat/apis/TestingApi.d.ts +1 -1
  26. package/dist/src/gen/chat/apis/UsersApi.d.ts +1 -1
  27. package/dist/src/gen/chat/models/index.d.ts +50 -0
  28. package/dist/src/gen/chat/runtime.d.ts +1 -1
  29. package/dist/src/gen/video/apis/DefaultApi.d.ts +4 -3
  30. package/dist/src/gen/video/apis/ServerSideApi.d.ts +30 -3
  31. package/dist/src/gen/video/apis/SettingsApi.d.ts +54 -0
  32. package/dist/src/gen/video/apis/index.d.ts +1 -0
  33. package/dist/src/gen/video/models/index.d.ts +425 -1450
  34. package/dist/src/gen/video/runtime.d.ts +2 -2
  35. package/package.json +1 -1
  36. package/src/StreamCall.ts +7 -7
  37. package/src/StreamClient.ts +21 -2
  38. package/src/StreamVideoClient.ts +38 -5
  39. package/src/gen/chat/apis/ChannelTypesApi.ts +1 -1
  40. package/src/gen/chat/apis/ChannelsApi.ts +1 -1
  41. package/src/gen/chat/apis/CustomCommandsApi.ts +1 -1
  42. package/src/gen/chat/apis/DefaultApi.ts +1 -1
  43. package/src/gen/chat/apis/DevicesApi.ts +1 -1
  44. package/src/gen/chat/apis/EventsApi.ts +1 -1
  45. package/src/gen/chat/apis/FilesApi.ts +3 -3
  46. package/src/gen/chat/apis/GDPRApi.ts +1 -1
  47. package/src/gen/chat/apis/ImportsApi.ts +1 -1
  48. package/src/gen/chat/apis/MessagesApi.ts +1 -1
  49. package/src/gen/chat/apis/ModerationApi.ts +1 -1
  50. package/src/gen/chat/apis/PermissionsV2Api.ts +1 -1
  51. package/src/gen/chat/apis/PushApi.ts +1 -1
  52. package/src/gen/chat/apis/ReactionsApi.ts +1 -1
  53. package/src/gen/chat/apis/ServerSideApi.ts +1 -1
  54. package/src/gen/chat/apis/SettingsApi.ts +1 -1
  55. package/src/gen/chat/apis/TasksApi.ts +1 -1
  56. package/src/gen/chat/apis/TestingApi.ts +1 -1
  57. package/src/gen/chat/apis/UsersApi.ts +1 -1
  58. package/src/gen/chat/apis/index.ts +8 -8
  59. package/src/gen/chat/models/index.ts +50 -0
  60. package/src/gen/chat/runtime.ts +1 -1
  61. package/src/gen/video/.openapi-generator/FILES +1 -0
  62. package/src/gen/video/apis/DefaultApi.ts +39 -30
  63. package/src/gen/video/apis/ServerSideApi.ts +114 -7
  64. package/src/gen/video/apis/SettingsApi.ts +169 -0
  65. package/src/gen/video/apis/index.ts +1 -0
  66. package/src/gen/video/models/index.ts +428 -1353
  67. package/src/gen/video/runtime.ts +3 -3
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Stream Video API
2
+ * Stream API
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: v92.5.0
5
+ * The version of the OpenAPI document: v98.0.2-ingress-test.3
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/node-sdk",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
package/src/StreamCall.ts CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  VideoUpdateCallMembersRequest,
14
14
  VideoUpdateUserPermissionsRequest,
15
15
  VideoQueryMembersRequest,
16
+ VideoStartRecordingRequest,
16
17
  } from './gen/video';
17
18
  import { OmitTypeId } from './types';
18
19
 
@@ -26,11 +27,7 @@ export class StreamCall {
26
27
  private readonly id: string,
27
28
  ) {
28
29
  this.baseRequest = { id: this.id, type: this.type };
29
- const configuration = this.streamClient.getConfiguration({
30
- basePath:
31
- this.streamClient.options.basePath ??
32
- 'https://video.stream-io-api.com/video',
33
- });
30
+ const configuration = this.streamClient.getConfiguration('video');
34
31
  this.apiClient = new DefaultApi(configuration);
35
32
  }
36
33
 
@@ -97,8 +94,11 @@ export class StreamCall {
97
94
  return this.apiClient.startHLSBroadcasting({ ...this.baseRequest });
98
95
  };
99
96
 
100
- startRecording = () => {
101
- return this.apiClient.startRecording({ ...this.baseRequest });
97
+ startRecording = (request?: VideoStartRecordingRequest) => {
98
+ return this.apiClient.startRecording({
99
+ ...this.baseRequest,
100
+ videoStartRecordingRequest: request ?? {},
101
+ });
102
102
  };
103
103
 
104
104
  startTranscription = () => {
@@ -57,6 +57,7 @@ import {
57
57
  } from './gen/video';
58
58
  import { v4 as uuidv4 } from 'uuid';
59
59
  import { JWTServerToken, JWTUserToken } from './utils/create-token';
60
+ import crypto from 'crypto';
60
61
 
61
62
  export interface StreamClientOptions {
62
63
  timeout?: number;
@@ -428,7 +429,21 @@ export class StreamClient {
428
429
  return this.tasksApi.getTask(request);
429
430
  };
430
431
 
431
- getConfiguration = (options?: { basePath?: string }) => {
432
+ verifyWebhook = (requestBody: string | Buffer, xSignature: string) => {
433
+ const key = Buffer.from(this.secret, 'utf8');
434
+ const hash = crypto
435
+ .createHmac('sha256', key)
436
+ .update(requestBody)
437
+ .digest('hex');
438
+
439
+ try {
440
+ return crypto.timingSafeEqual(Buffer.from(hash), Buffer.from(xSignature));
441
+ } catch (err) {
442
+ return false;
443
+ }
444
+ };
445
+
446
+ getConfiguration = (product: 'chat' | 'video' = 'chat') => {
432
447
  return new Configuration({
433
448
  apiKey: (name: string) => {
434
449
  const mapping: Record<string, string> = {
@@ -439,7 +454,11 @@ export class StreamClient {
439
454
 
440
455
  return mapping[name];
441
456
  },
442
- basePath: options?.basePath ?? this.options.basePath,
457
+ basePath:
458
+ this.options.basePath ??
459
+ (product === 'chat'
460
+ ? 'https://chat.stream-io-api.com'
461
+ : 'https://video.stream-io-api.com'),
443
462
  headers: {
444
463
  'X-Stream-Client': 'stream-node-' + process.env.PKG_VERSION,
445
464
  },
@@ -1,26 +1,29 @@
1
1
  import { StreamCall } from './StreamCall';
2
2
  import { StreamClient } from './StreamClient';
3
3
  import {
4
+ CheckExternalStorageRequest,
4
5
  DefaultApi,
5
6
  DeleteCallTypeRequest,
7
+ DeleteExternalStorageRequest,
6
8
  GetCallTypeRequest,
7
9
  ServerSideApi,
10
+ SettingsApi,
8
11
  VideoCreateCallTypeRequest,
12
+ VideoCreateExternalStorageRequest,
9
13
  VideoQueryCallsRequest,
10
14
  VideoUpdateCallTypeRequest,
15
+ VideoUpdateExternalStorageRequest,
11
16
  } from './gen/video';
12
17
 
13
18
  export class StreamVideoClient {
14
19
  private readonly apiClient: DefaultApi;
15
20
  private readonly videoServerSideApiClient: ServerSideApi;
21
+ private readonly settingsApi: SettingsApi;
16
22
 
17
23
  constructor(private readonly streamClient: StreamClient) {
18
- const configuration = this.streamClient.getConfiguration({
19
- basePath:
20
- this.streamClient.options.basePath ??
21
- 'https://video.stream-io-api.com/video',
22
- });
24
+ const configuration = this.streamClient.getConfiguration('video');
23
25
  this.apiClient = new DefaultApi(configuration);
26
+ this.settingsApi = new SettingsApi(configuration);
24
27
  this.videoServerSideApiClient = new ServerSideApi(configuration);
25
28
  }
26
29
 
@@ -61,4 +64,34 @@ export class StreamVideoClient {
61
64
  videoUpdateCallTypeRequest,
62
65
  });
63
66
  };
67
+
68
+ listExternalStorages = () => {
69
+ return this.settingsApi.listExternalStorage();
70
+ };
71
+
72
+ createExternalStorage = (
73
+ videoCreateExternalStorageRequest: VideoCreateExternalStorageRequest,
74
+ ) => {
75
+ return this.settingsApi.createExternalStorage({
76
+ videoCreateExternalStorageRequest,
77
+ });
78
+ };
79
+
80
+ deleteExternalStorage = (request: DeleteExternalStorageRequest) => {
81
+ return this.settingsApi.deleteExternalStorage(request);
82
+ };
83
+
84
+ updateExternalStorage = (
85
+ name: string,
86
+ videoUpdateExternalStorageRequest: VideoUpdateExternalStorageRequest,
87
+ ) => {
88
+ return this.videoServerSideApiClient.updateExternalStorage({
89
+ name,
90
+ videoUpdateExternalStorageRequest,
91
+ });
92
+ };
93
+
94
+ checkExternalStorage = (request: CheckExternalStorageRequest) => {
95
+ return this.videoServerSideApiClient.checkExternalStorage(request);
96
+ };
64
97
  }
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -18,10 +18,10 @@ import type {
18
18
  APIError,
19
19
  FileDeleteResponse,
20
20
  FileUploadResponse,
21
- //@ts-expect-error
21
+ // @ts-expect-error
22
22
  ImageSizeRequest,
23
23
  ImageUploadResponse,
24
- //@ts-expect-error
24
+ // @ts-expect-error
25
25
  OnlyUserIDRequest,
26
26
  } from '../models';
27
27
 
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -7,23 +7,23 @@ export * from './DefaultApi';
7
7
  export * from './DevicesApi';
8
8
  export * from './EventsApi';
9
9
  export * from './FilesApi';
10
- //@ts-expect-error
10
+ // @ts-expect-error
11
11
  export * from './GDPRApi';
12
12
  export * from './ImportsApi';
13
- //@ts-expect-error
13
+ // @ts-expect-error
14
14
  export * from './MessagesApi';
15
- //@ts-expect-error
15
+ // @ts-expect-error
16
16
  export * from './ModerationApi';
17
17
  export * from './PermissionsV2Api';
18
- //@ts-expect-error
18
+ // @ts-expect-error
19
19
  export * from './PushApi';
20
- //@ts-expect-error
20
+ // @ts-expect-error
21
21
  export * from './ReactionsApi';
22
22
  export * from './ServerSideApi';
23
- //@ts-expect-error
23
+ // @ts-expect-error
24
24
  export * from './SettingsApi';
25
25
  export * from './TasksApi';
26
- //@ts-expect-error
26
+ // @ts-expect-error
27
27
  export * from './TestingApi';
28
- //@ts-expect-error
28
+ // @ts-expect-error
29
29
  export * from './UsersApi';
@@ -379,6 +379,12 @@ export interface App {
379
379
  * @memberof App
380
380
  */
381
381
  custom_action_handler_url: string;
382
+ /**
383
+ *
384
+ * @type {DataDogInfo}
385
+ * @memberof App
386
+ */
387
+ datadog_info?: DataDogInfo;
382
388
  /**
383
389
  *
384
390
  * @type {boolean}
@@ -4931,6 +4937,44 @@ export interface CreateRoleResponse {
4931
4937
  */
4932
4938
  role: Role;
4933
4939
  }
4940
+ /**
4941
+ *
4942
+ * @export
4943
+ * @interface DataDogInfo
4944
+ */
4945
+ export interface DataDogInfo {
4946
+ /**
4947
+ *
4948
+ * @type {string}
4949
+ * @memberof DataDogInfo
4950
+ */
4951
+ api_key: string;
4952
+ /**
4953
+ *
4954
+ * @type {string}
4955
+ * @memberof DataDogInfo
4956
+ */
4957
+ site: string;
4958
+ }
4959
+ /**
4960
+ *
4961
+ * @export
4962
+ * @interface DataDogInfoRequest
4963
+ */
4964
+ export interface DataDogInfoRequest {
4965
+ /**
4966
+ *
4967
+ * @type {string}
4968
+ * @memberof DataDogInfoRequest
4969
+ */
4970
+ api_key?: string;
4971
+ /**
4972
+ *
4973
+ * @type {string}
4974
+ * @memberof DataDogInfoRequest
4975
+ */
4976
+ site?: string;
4977
+ }
4934
4978
  /**
4935
4979
  *
4936
4980
  * @export
@@ -13446,6 +13490,12 @@ export interface UpdateAppRequest {
13446
13490
  * @memberof UpdateAppRequest
13447
13491
  */
13448
13492
  custom_action_handler_url?: string;
13493
+ /**
13494
+ *
13495
+ * @type {DataDogInfoRequest}
13496
+ * @memberof UpdateAppRequest
13497
+ */
13498
+ datadog_info?: DataDogInfoRequest;
13449
13499
  /**
13450
13500
  *
13451
13501
  * @type {boolean}
@@ -4,7 +4,7 @@
4
4
  * Stream Chat API
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: v92.5.0
7
+ * The version of the OpenAPI document: v92.7.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -1,6 +1,7 @@
1
1
  .openapi-generator-ignore
2
2
  apis/DefaultApi.ts
3
3
  apis/ServerSideApi.ts
4
+ apis/SettingsApi.ts
4
5
  apis/index.ts
5
6
  index.ts
6
7
  models/index.ts