starta.apiclient 1.112.12462 → 1.112.12488

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.
@@ -3,7 +3,7 @@ export default class Chats {
3
3
  private _requestRunner;
4
4
  constructor(requestRunner: StartaRequestRunner);
5
5
  index(login: any, withSystemChats?: boolean): Promise<import("../types").StartaResponse>;
6
- getNumberOfUnreadMessages(login: any, withSystemChats?: boolean): Promise<import("../types").StartaResponse>;
6
+ getNumberOfUnreadMessages(login: any): Promise<import("../types").StartaResponse>;
7
7
  getThreads(login: any, loginWith: any): Promise<import("../types").StartaResponse>;
8
8
  setThreadTitle(login: any, loginWith: any, threadId: any, title: any): Promise<import("../types").StartaResponse>;
9
9
  removeThread(login: any, loginWith: any, threadId: any): Promise<import("../types").StartaResponse>;
@@ -11,10 +11,10 @@ export default class Chats {
11
11
  threadId?: string;
12
12
  olderThenTimestamp?: string;
13
13
  }): Promise<import("../types").StartaResponse>;
14
- setLastSeenMessageTime(login: any, loginWith: any, { threadId, time }: {
15
- threadId?: string;
14
+ setLastSeenMessageTime(login: any, loginWith: any, { time }: {
16
15
  time: string;
17
16
  }): Promise<import("../types").StartaResponse>;
17
+ setThreadLastSeenMessageTime(login: any, loginWith: any, threadId: any, time: any): Promise<import("../types").StartaResponse>;
18
18
  addMessage(login: any, loginWith: any, { threadId, message: { text, imageIds }, context, }: {
19
19
  threadId?: 'new' | string;
20
20
  message: {
@@ -16,11 +16,9 @@ class Chats {
16
16
  },
17
17
  });
18
18
  }
19
- getNumberOfUnreadMessages(login, withSystemChats = false) {
19
+ getNumberOfUnreadMessages(login) {
20
20
  return this._requestRunner.performRequest({
21
- url: `accounts/${login}/chats/number-of-unread-messages${(0, _helpers_1.buildQuery)({
22
- withSystemChats,
23
- })}`,
21
+ url: `accounts/${login}/chats/number-of-unread-messages`,
24
22
  method: 'GET',
25
23
  config: {
26
24
  rewriteBaseUrl: (url) => {
@@ -77,13 +75,12 @@ class Chats {
77
75
  },
78
76
  });
79
77
  }
80
- setLastSeenMessageTime(login, loginWith, { threadId, time }) {
78
+ setLastSeenMessageTime(login, loginWith, { time }) {
81
79
  return this._requestRunner.performRequest({
82
80
  url: `accounts/${login}/chats/${loginWith}/lastSeenMessageTime`,
83
81
  method: 'PUT',
84
82
  body: {
85
83
  time,
86
- threadId,
87
84
  },
88
85
  config: {
89
86
  rewriteBaseUrl: (url) => {
@@ -92,6 +89,18 @@ class Chats {
92
89
  },
93
90
  });
94
91
  }
92
+ setThreadLastSeenMessageTime(login, loginWith, threadId, time) {
93
+ return this._requestRunner.performRequest({
94
+ url: `accounts/${login}/chats/${loginWith}/threads/${threadId}/lastSeenMessageTime`,
95
+ method: 'PUT',
96
+ body: { time },
97
+ config: {
98
+ rewriteBaseUrl: (url) => {
99
+ return url.replace('/api', '/comm/api');
100
+ },
101
+ },
102
+ });
103
+ }
95
104
  addMessage(login, loginWith, { threadId, message: { text, imageIds }, context, }) {
96
105
  return this._requestRunner.performRequest({
97
106
  url: `accounts/${login}/chats/${loginWith}/messages`,
@@ -12,6 +12,7 @@ export default class Worklogs {
12
12
  skip?: number;
13
13
  limit?: number;
14
14
  }): Promise<import("../../types").StartaResponse>;
15
+ get(organizationLogin: any, worklogid: any): Promise<import("../../types").StartaResponse>;
15
16
  add(organizationLogin: any, { memberId, worklogName, start, end, type, unpaid, }: {
16
17
  memberId?: string;
17
18
  worklogName?: string;
@@ -20,6 +20,12 @@ class Worklogs {
20
20
  method: 'GET',
21
21
  });
22
22
  }
23
+ get(organizationLogin, worklogid) {
24
+ return this._requestRunner.performRequest({
25
+ url: `accounts/${organizationLogin}/worklogs/${worklogid}`,
26
+ method: 'GET',
27
+ });
28
+ }
23
29
  add(organizationLogin, { memberId, worklogName, start, end, type, unpaid, }) {
24
30
  return this._requestRunner.performRequest({
25
31
  url: `accounts/${organizationLogin}/worklogs`,
@@ -30,9 +30,10 @@ export default class EmailConfirmations {
30
30
  notifyAboutBirthdayOfCustomers(): Promise<import("../types").StartaResponse>;
31
31
  assignTrialCouponsForOrganizations(): Promise<import("../types").StartaResponse>;
32
32
  sendDailyReportEmails(organizationLogin?: string, daysShift?: number): Promise<import("../types").StartaResponse>;
33
- sendNewFeatureNotificationToChats({ featureId, ticketId, text, organizationLogin, }: {
33
+ sendNewFeatureNotificationToChats({ featureId, ticketId, title, text, organizationLogin, }: {
34
34
  featureId: string;
35
35
  ticketId: string;
36
+ title: string;
36
37
  text: string;
37
38
  organizationLogin?: string;
38
39
  }): Promise<import("../types").StartaResponse>;
@@ -103,13 +103,14 @@ class EmailConfirmations {
103
103
  },
104
104
  });
105
105
  }
106
- sendNewFeatureNotificationToChats({ featureId, ticketId, text, organizationLogin, }) {
106
+ sendNewFeatureNotificationToChats({ featureId, ticketId, title, text, organizationLogin, }) {
107
107
  return this._requestRunner.performRequest({
108
108
  url: `system/send-new-feature-notification-to-chats`,
109
109
  method: 'POST',
110
110
  body: {
111
111
  featureId,
112
112
  ticketId,
113
+ title,
113
114
  text,
114
115
  organizationLogin,
115
116
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starta.apiclient",
3
- "version": "1.112.12462",
3
+ "version": "1.112.12488",
4
4
  "main": "./lib/index.js",
5
5
  "description": "Wrapper for starta.one api",
6
6
  "author": "Collaboracia OÜ",