@superoffice/webapi 12.4.1514 → 12.6.1407
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/AIAgent.d.ts +4 -4
- package/dist/cjs/Carriers.d.ts +625 -19
- package/dist/cjs/Carriers.d.ts.map +1 -1
- package/dist/cjs/ConfigurationAgent.d.ts +38 -0
- package/dist/cjs/ConfigurationAgent.d.ts.map +1 -1
- package/dist/cjs/ConfigurationAgent.js +91 -0
- package/dist/cjs/ConfigurationAgent.js.map +1 -1
- package/dist/cjs/Converters.d.ts +27 -0
- package/dist/cjs/Converters.d.ts.map +1 -1
- package/dist/cjs/Converters.js +414 -26
- package/dist/cjs/Converters.js.map +1 -1
- package/dist/cjs/DiagnosticsAgent.d.ts +5 -5
- package/dist/cjs/DiagnosticsAgent.js +5 -5
- package/dist/cjs/Enums.d.ts +121 -3
- package/dist/cjs/Enums.d.ts.map +1 -1
- package/dist/cjs/Enums.js +128 -6
- package/dist/cjs/Enums.js.map +1 -1
- package/dist/cjs/FreeTextAgent.d.ts +2 -2
- package/dist/cjs/ImportAgent.d.ts +5 -5
- package/dist/cjs/ListAgent.d.ts +31 -0
- package/dist/cjs/ListAgent.d.ts.map +1 -1
- package/dist/cjs/ListAgent.js +67 -0
- package/dist/cjs/ListAgent.js.map +1 -1
- package/dist/cjs/MentionAgent.d.ts +96 -0
- package/dist/cjs/MentionAgent.d.ts.map +1 -0
- package/dist/cjs/MentionAgent.js +203 -0
- package/dist/cjs/MentionAgent.js.map +1 -0
- package/dist/cjs/NewsFeedAgent.d.ts +45 -0
- package/dist/cjs/NewsFeedAgent.d.ts.map +1 -1
- package/dist/cjs/NewsFeedAgent.js +99 -0
- package/dist/cjs/NewsFeedAgent.js.map +1 -1
- package/dist/cjs/ProjectAgent.d.ts +48 -0
- package/dist/cjs/ProjectAgent.d.ts.map +1 -1
- package/dist/cjs/ProjectAgent.js +102 -0
- package/dist/cjs/ProjectAgent.js.map +1 -1
- package/dist/cjs/ProjectRestApi.d.ts.map +1 -1
- package/dist/cjs/ProjectRestApi.js.map +1 -1
- package/dist/cjs/SaleAgent.d.ts +79 -0
- package/dist/cjs/SaleAgent.d.ts.map +1 -1
- package/dist/cjs/SaleAgent.js +169 -0
- package/dist/cjs/SaleAgent.js.map +1 -1
- package/dist/cjs/SaleRestApi.d.ts.map +1 -1
- package/dist/cjs/SaleRestApi.js.map +1 -1
- package/dist/cjs/WebApi.d.ts +6 -0
- package/dist/cjs/WebApi.d.ts.map +1 -1
- package/dist/cjs/WebApi.js +11 -2
- package/dist/cjs/WebApi.js.map +1 -1
- package/dist/esm/AIAgent.d.ts +4 -4
- package/dist/esm/Carriers.d.ts +625 -19
- package/dist/esm/Carriers.d.ts.map +1 -1
- package/dist/esm/ConfigurationAgent.d.ts +38 -0
- package/dist/esm/ConfigurationAgent.d.ts.map +1 -1
- package/dist/esm/ConfigurationAgent.js +91 -0
- package/dist/esm/ConfigurationAgent.js.map +1 -1
- package/dist/esm/Converters.d.ts +27 -0
- package/dist/esm/Converters.d.ts.map +1 -1
- package/dist/esm/Converters.js +360 -0
- package/dist/esm/Converters.js.map +1 -1
- package/dist/esm/DiagnosticsAgent.d.ts +5 -5
- package/dist/esm/DiagnosticsAgent.js +5 -5
- package/dist/esm/Enums.d.ts +121 -3
- package/dist/esm/Enums.d.ts.map +1 -1
- package/dist/esm/Enums.js +123 -1
- package/dist/esm/Enums.js.map +1 -1
- package/dist/esm/FreeTextAgent.d.ts +2 -2
- package/dist/esm/ImportAgent.d.ts +5 -5
- package/dist/esm/ListAgent.d.ts +31 -0
- package/dist/esm/ListAgent.d.ts.map +1 -1
- package/dist/esm/ListAgent.js +67 -0
- package/dist/esm/ListAgent.js.map +1 -1
- package/dist/esm/MentionAgent.d.ts +96 -0
- package/dist/esm/MentionAgent.d.ts.map +1 -0
- package/dist/esm/MentionAgent.js +198 -0
- package/dist/esm/MentionAgent.js.map +1 -0
- package/dist/esm/NewsFeedAgent.d.ts +45 -0
- package/dist/esm/NewsFeedAgent.d.ts.map +1 -1
- package/dist/esm/NewsFeedAgent.js +99 -0
- package/dist/esm/NewsFeedAgent.js.map +1 -1
- package/dist/esm/ProjectAgent.d.ts +48 -0
- package/dist/esm/ProjectAgent.d.ts.map +1 -1
- package/dist/esm/ProjectAgent.js +102 -0
- package/dist/esm/ProjectAgent.js.map +1 -1
- package/dist/esm/ProjectRestApi.d.ts.map +1 -1
- package/dist/esm/ProjectRestApi.js.map +1 -1
- package/dist/esm/SaleAgent.d.ts +79 -0
- package/dist/esm/SaleAgent.d.ts.map +1 -1
- package/dist/esm/SaleAgent.js +169 -0
- package/dist/esm/SaleAgent.js.map +1 -1
- package/dist/esm/SaleRestApi.d.ts.map +1 -1
- package/dist/esm/SaleRestApi.js.map +1 -1
- package/dist/esm/WebApi.d.ts +6 -0
- package/dist/esm/WebApi.d.ts.map +1 -1
- package/dist/esm/WebApi.js +9 -0
- package/dist/esm/WebApi.js.map +1 -1
- package/package.json +4 -4
- package/src/AIAgent.ts +4 -4
- package/src/Carriers.ts +821 -19
- package/src/ConfigurationAgent.ts +144 -0
- package/src/Converters.ts +418 -0
- package/src/DiagnosticsAgent.ts +5 -5
- package/src/Enums.ts +127 -1
- package/src/FreeTextAgent.ts +2 -2
- package/src/ImportAgent.ts +5 -5
- package/src/ListAgent.ts +114 -0
- package/src/MentionAgent.ts +346 -0
- package/src/NewsFeedAgent.ts +168 -0
- package/src/ProjectAgent.ts +174 -0
- package/src/ProjectRestApi.ts +2 -0
- package/src/SaleAgent.ts +288 -0
- package/src/SaleRestApi.ts +2 -0
- package/src/WebApi.ts +12 -0
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
// <auto-generated>
|
|
2
|
+
// SuperOffice Code Generator
|
|
3
|
+
// modelling\templates\servicestswebapi\tswebapiagents.tt
|
|
4
|
+
// </auto-generated>
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/* tslint:disable */
|
|
8
|
+
//----------------------------------------------------------------------------
|
|
9
|
+
// G E N E R A T E D F I L E ! D O N O T E D I T !
|
|
10
|
+
//----------------------------------------------------------------------------
|
|
11
|
+
//
|
|
12
|
+
// File: WebApi/MentionAgent.ts
|
|
13
|
+
//
|
|
14
|
+
//----------------------------------------------------------------------------
|
|
15
|
+
// Copyright (C) SuperOffice AS
|
|
16
|
+
//----------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
import { AxiosRequestConfig } from 'axios';
|
|
19
|
+
import { Duration } from 'dayjs/plugin/duration';
|
|
20
|
+
import * as enums from './Enums';
|
|
21
|
+
import * as base from './WebApiBase';
|
|
22
|
+
import * as carriers from './Carriers';
|
|
23
|
+
import * as converters from './Converters';
|
|
24
|
+
import { FromBase64ToString, ToBase64 } from './Base64';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Agent used for getting, marking read, and deleting @-mentions
|
|
28
|
+
*/
|
|
29
|
+
export interface IMentionAgent {
|
|
30
|
+
getMyMentionsAsync(request: carriers.Mention_GetMyMentionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Mention[] >;
|
|
31
|
+
getMyMentionsAsync(unreadOnly: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Mention[] >;
|
|
32
|
+
getMyMentionsUnreadCountAsync(webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
33
|
+
getMentionsCreatedByMeAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Mention[] >;
|
|
34
|
+
markMentionsAsReadAsync(request: carriers.Mention_MarkMentionsAsReadRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
35
|
+
markMentionsAsReadAsync(mentionIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
36
|
+
deleteMentionsAsync(request: carriers.Mention_DeleteMentionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
37
|
+
deleteMentionsAsync(mentionIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
38
|
+
updateMentionSnippetsAsync(request: carriers.Mention_UpdateMentionSnippetsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
39
|
+
updateMentionSnippetsAsync(messageId: number, mentionedAssociateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
40
|
+
} // interface IMentionAgent
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Agent used for getting, marking read, and deleting @-mentions
|
|
47
|
+
*/
|
|
48
|
+
export class MentionAgent extends base.WebApiBase implements IMentionAgent {
|
|
49
|
+
constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
|
|
50
|
+
constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
|
|
51
|
+
constructor(baseUrl: string, resourceManager:any);
|
|
52
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
|
|
53
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
|
|
54
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
|
|
55
|
+
constructor(options: base.WebApiOptions);
|
|
56
|
+
|
|
57
|
+
constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
|
|
58
|
+
langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
|
|
59
|
+
langOrResourceOrRM?:string|base.ResourceParsing|any,
|
|
60
|
+
cultureCode?: string,
|
|
61
|
+
) {
|
|
62
|
+
const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
|
|
63
|
+
options.basePath = "v1/Agents/Mention/";
|
|
64
|
+
super(options);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
private async _getMyMentionsAsync(request: carriers.Mention_GetMyMentionsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Mention[] > {
|
|
70
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
71
|
+
base.WebApiBase.SetPending(options);
|
|
72
|
+
return new Promise< carriers.Mention[] >(async (resolve, reject) => {
|
|
73
|
+
try {
|
|
74
|
+
config.baseURL = this._options.baseUrl;
|
|
75
|
+
const response = await this._axios.post("GetMyMentions", request , config);
|
|
76
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
77
|
+
const res : carriers.Mention[] = converters.Create_MentionArray_From( response.data );
|
|
78
|
+
resolve(res);
|
|
79
|
+
}
|
|
80
|
+
catch( err ) {
|
|
81
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
82
|
+
reject(err);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Get the current associate's @-mentions
|
|
91
|
+
* @param request - UnreadOnly
|
|
92
|
+
* @returns The current associate's mentions, most-recent-first
|
|
93
|
+
*/
|
|
94
|
+
public async getMyMentionsAsync(request: carriers.Mention_GetMyMentionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Mention[] >;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Get the current associate's @-mentions
|
|
98
|
+
* @param unreadOnly - When true, only unread mentions are returned
|
|
99
|
+
* @returns The current associate's mentions, most-recent-first
|
|
100
|
+
*/
|
|
101
|
+
public async getMyMentionsAsync(unreadOnly: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Mention[] >;
|
|
102
|
+
|
|
103
|
+
public async getMyMentionsAsync(unreadOnly:boolean|carriers.Mention_GetMyMentionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Mention[] > {
|
|
104
|
+
let _request : carriers.Mention_GetMyMentionsRequest = null;
|
|
105
|
+
let _options : base.WebApiRequestOptions = null;
|
|
106
|
+
const first : any = unreadOnly;
|
|
107
|
+
if( typeof( first ) === "object" && first && ( typeof(first.unreadOnly)!='undefined' ) )
|
|
108
|
+
{
|
|
109
|
+
_request = unreadOnly as carriers.Mention_GetMyMentionsRequest;
|
|
110
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
111
|
+
}
|
|
112
|
+
else
|
|
113
|
+
{
|
|
114
|
+
_request = {
|
|
115
|
+
unreadOnly: unreadOnly as boolean,
|
|
116
|
+
};
|
|
117
|
+
_options = webapi_options;
|
|
118
|
+
}
|
|
119
|
+
return this._getMyMentionsAsync( _request, _options );
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
private async _getMyMentionsUnreadCountAsync( options?:base.WebApiRequestOptions) : Promise< number > {
|
|
124
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
125
|
+
base.WebApiBase.SetPending(options);
|
|
126
|
+
return new Promise< number >(async (resolve, reject) => {
|
|
127
|
+
try {
|
|
128
|
+
config.baseURL = this._options.baseUrl;
|
|
129
|
+
const response = await this._axios.post("GetMyMentionsUnreadCount", undefined , config);
|
|
130
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
131
|
+
const res : number = response.data as number;
|
|
132
|
+
resolve(res);
|
|
133
|
+
}
|
|
134
|
+
catch( err ) {
|
|
135
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
136
|
+
reject(err);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Get the current associate's unread @-mention count
|
|
144
|
+
* @returns The current associate's unread mention count
|
|
145
|
+
*/
|
|
146
|
+
public async getMyMentionsUnreadCountAsync(webapi_options?:base.WebApiRequestOptions) : Promise< number >
|
|
147
|
+
{
|
|
148
|
+
return this._getMyMentionsUnreadCountAsync(webapi_options);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
private async _getMentionsCreatedByMeAsync( options?:base.WebApiRequestOptions) : Promise< carriers.Mention[] > {
|
|
153
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
154
|
+
base.WebApiBase.SetPending(options);
|
|
155
|
+
return new Promise< carriers.Mention[] >(async (resolve, reject) => {
|
|
156
|
+
try {
|
|
157
|
+
config.baseURL = this._options.baseUrl;
|
|
158
|
+
const response = await this._axios.post("GetMentionsCreatedByMe", undefined , config);
|
|
159
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
160
|
+
const res : carriers.Mention[] = converters.Create_MentionArray_From( response.data );
|
|
161
|
+
resolve(res);
|
|
162
|
+
}
|
|
163
|
+
catch( err ) {
|
|
164
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
165
|
+
reject(err);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Get the @-mentions the current associate created (tagged someone else)
|
|
173
|
+
* @returns The current associate's created mentions, most-recent-first
|
|
174
|
+
*/
|
|
175
|
+
public async getMentionsCreatedByMeAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Mention[] >
|
|
176
|
+
{
|
|
177
|
+
return this._getMentionsCreatedByMeAsync(webapi_options);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
private async _markMentionsAsReadAsync(request: carriers.Mention_MarkMentionsAsReadRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
182
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
183
|
+
base.WebApiBase.SetPending(options);
|
|
184
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
185
|
+
try {
|
|
186
|
+
config.baseURL = this._options.baseUrl;
|
|
187
|
+
const response = await this._axios.post("MarkMentionsAsRead", request , config);
|
|
188
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
189
|
+
const res = response.data;
|
|
190
|
+
resolve(res);
|
|
191
|
+
}
|
|
192
|
+
catch( err ) {
|
|
193
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
194
|
+
reject(err);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Mark mentions as read
|
|
203
|
+
* @param request - MentionIds
|
|
204
|
+
* @returns This method has no return value
|
|
205
|
+
*/
|
|
206
|
+
public async markMentionsAsReadAsync(request: carriers.Mention_MarkMentionsAsReadRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Mark mentions as read
|
|
210
|
+
* @param mentionIds - Ids of the mentions to mark read
|
|
211
|
+
* @returns This method has no return value
|
|
212
|
+
*/
|
|
213
|
+
public async markMentionsAsReadAsync(mentionIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
214
|
+
|
|
215
|
+
public async markMentionsAsReadAsync(mentionIds:number[]|carriers.Mention_MarkMentionsAsReadRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
216
|
+
let _request : carriers.Mention_MarkMentionsAsReadRequest = null;
|
|
217
|
+
let _options : base.WebApiRequestOptions = null;
|
|
218
|
+
const first : any = mentionIds;
|
|
219
|
+
if( typeof( first ) === "object" && first && ( typeof(first.mentionIds)!='undefined' ) )
|
|
220
|
+
{
|
|
221
|
+
_request = mentionIds as carriers.Mention_MarkMentionsAsReadRequest;
|
|
222
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
223
|
+
}
|
|
224
|
+
else
|
|
225
|
+
{
|
|
226
|
+
_request = {
|
|
227
|
+
mentionIds: mentionIds as number[],
|
|
228
|
+
};
|
|
229
|
+
_options = webapi_options;
|
|
230
|
+
}
|
|
231
|
+
return this._markMentionsAsReadAsync( _request, _options );
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
private async _deleteMentionsAsync(request: carriers.Mention_DeleteMentionsRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
236
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
237
|
+
base.WebApiBase.SetPending(options);
|
|
238
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
239
|
+
try {
|
|
240
|
+
config.baseURL = this._options.baseUrl;
|
|
241
|
+
const response = await this._axios.post("DeleteMentions", request , config);
|
|
242
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
243
|
+
const res = response.data;
|
|
244
|
+
resolve(res);
|
|
245
|
+
}
|
|
246
|
+
catch( err ) {
|
|
247
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
248
|
+
reject(err);
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Delete mentions by id
|
|
257
|
+
* @param request - MentionIds
|
|
258
|
+
* @returns This method has no return value
|
|
259
|
+
*/
|
|
260
|
+
public async deleteMentionsAsync(request: carriers.Mention_DeleteMentionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Delete mentions by id
|
|
264
|
+
* @param mentionIds - Ids of mention rows to delete
|
|
265
|
+
* @returns This method has no return value
|
|
266
|
+
*/
|
|
267
|
+
public async deleteMentionsAsync(mentionIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
268
|
+
|
|
269
|
+
public async deleteMentionsAsync(mentionIds:number[]|carriers.Mention_DeleteMentionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
270
|
+
let _request : carriers.Mention_DeleteMentionsRequest = null;
|
|
271
|
+
let _options : base.WebApiRequestOptions = null;
|
|
272
|
+
const first : any = mentionIds;
|
|
273
|
+
if( typeof( first ) === "object" && first && ( typeof(first.mentionIds)!='undefined' ) )
|
|
274
|
+
{
|
|
275
|
+
_request = mentionIds as carriers.Mention_DeleteMentionsRequest;
|
|
276
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
277
|
+
}
|
|
278
|
+
else
|
|
279
|
+
{
|
|
280
|
+
_request = {
|
|
281
|
+
mentionIds: mentionIds as number[],
|
|
282
|
+
};
|
|
283
|
+
_options = webapi_options;
|
|
284
|
+
}
|
|
285
|
+
return this._deleteMentionsAsync( _request, _options );
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
private async _updateMentionSnippetsAsync(request: carriers.Mention_UpdateMentionSnippetsRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
290
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
291
|
+
base.WebApiBase.SetPending(options);
|
|
292
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
293
|
+
try {
|
|
294
|
+
config.baseURL = this._options.baseUrl;
|
|
295
|
+
const response = await this._axios.post("UpdateMentionSnippets", request , config);
|
|
296
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
297
|
+
const res = response.data;
|
|
298
|
+
resolve(res);
|
|
299
|
+
}
|
|
300
|
+
catch( err ) {
|
|
301
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
302
|
+
reject(err);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Insert-missing and refresh-existing mention rows for a saved message
|
|
311
|
+
* @param request - MessageId, MentionedAssociateIds
|
|
312
|
+
* @returns This method has no return value
|
|
313
|
+
*/
|
|
314
|
+
public async updateMentionSnippetsAsync(request: carriers.Mention_UpdateMentionSnippetsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Insert-missing and refresh-existing mention rows for a saved message
|
|
318
|
+
* @param messageId - The message the mentions belong to
|
|
319
|
+
* @param mentionedAssociateIds - The colleagues mentioned in the message's current content
|
|
320
|
+
* @returns This method has no return value
|
|
321
|
+
*/
|
|
322
|
+
public async updateMentionSnippetsAsync(messageId: number, mentionedAssociateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
323
|
+
|
|
324
|
+
public async updateMentionSnippetsAsync(messageId:number|carriers.Mention_UpdateMentionSnippetsRequest, mentionedAssociateIds?:number[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
325
|
+
let _request : carriers.Mention_UpdateMentionSnippetsRequest = null;
|
|
326
|
+
let _options : base.WebApiRequestOptions = null;
|
|
327
|
+
const first : any = messageId;
|
|
328
|
+
if( typeof( first ) === "object" && first && ( typeof(first.messageId)!='undefined' || typeof(first.mentionedAssociateIds)!='undefined' ) )
|
|
329
|
+
{
|
|
330
|
+
_request = messageId as carriers.Mention_UpdateMentionSnippetsRequest;
|
|
331
|
+
_options = mentionedAssociateIds as base.WebApiRequestOptions;
|
|
332
|
+
}
|
|
333
|
+
else
|
|
334
|
+
{
|
|
335
|
+
_request = {
|
|
336
|
+
messageId: messageId as number,
|
|
337
|
+
mentionedAssociateIds: mentionedAssociateIds as number[],
|
|
338
|
+
};
|
|
339
|
+
_options = webapi_options;
|
|
340
|
+
}
|
|
341
|
+
return this._updateMentionSnippetsAsync( _request, _options );
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
} // class v1MentionAgentController
|
|
345
|
+
|
|
346
|
+
|
package/src/NewsFeedAgent.ts
CHANGED
|
@@ -42,6 +42,12 @@ export interface INewsFeedAgent {
|
|
|
42
42
|
startHandlingAsync(newsFeedItemId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
43
43
|
markAsHandledAsync(request: carriers.NewsFeed_MarkAsHandledRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
44
44
|
markAsHandledAsync(newsFeedItemId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
45
|
+
deleteNewsFeedItemsByIdAsync(request: carriers.NewsFeed_DeleteNewsFeedItemsByIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
46
|
+
deleteNewsFeedItemsByIdAsync(newsFeedItemIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
47
|
+
deleteNewsFeedItemsByIdentifierAsync(request: carriers.NewsFeed_DeleteNewsFeedItemsByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
48
|
+
deleteNewsFeedItemsByIdentifierAsync(fromIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
49
|
+
deleteNewsFeedItemsByCategoryIdentifierAsync(request: carriers.NewsFeed_DeleteNewsFeedItemsByCategoryIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
50
|
+
deleteNewsFeedItemsByCategoryIdentifierAsync(fromCategoryIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
45
51
|
} // interface INewsFeedAgent
|
|
46
52
|
|
|
47
53
|
|
|
@@ -476,6 +482,168 @@ export class NewsFeedAgent extends base.WebApiBase implements INewsFeedAgent {
|
|
|
476
482
|
return this._markAsHandledAsync( _request, _options );
|
|
477
483
|
}
|
|
478
484
|
|
|
485
|
+
|
|
486
|
+
private async _deleteNewsFeedItemsByIdAsync(request: carriers.NewsFeed_DeleteNewsFeedItemsByIdRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
487
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
488
|
+
base.WebApiBase.SetPending(options);
|
|
489
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
490
|
+
try {
|
|
491
|
+
config.baseURL = this._options.baseUrl;
|
|
492
|
+
const response = await this._axios.post("DeleteNewsFeedItemsById", request , config);
|
|
493
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
494
|
+
const res = response.data;
|
|
495
|
+
resolve(res);
|
|
496
|
+
}
|
|
497
|
+
catch( err ) {
|
|
498
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
499
|
+
reject(err);
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Deletes an array of items from the newsfeed by id. If the current user cannot access a particular item, the call fails, unless the user is an administrator. Deleting an item removes it from all users.
|
|
508
|
+
* @param request - NewsFeedItemIds
|
|
509
|
+
* @returns This method has no return value
|
|
510
|
+
*/
|
|
511
|
+
public async deleteNewsFeedItemsByIdAsync(request: carriers.NewsFeed_DeleteNewsFeedItemsByIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Deletes an array of items from the newsfeed by id. If the current user cannot access a particular item, the call fails, unless the user is an administrator. Deleting an item removes it from all users.
|
|
515
|
+
* @param newsFeedItemIds - Ids of the news feed items to remove.
|
|
516
|
+
* @returns This method has no return value
|
|
517
|
+
*/
|
|
518
|
+
public async deleteNewsFeedItemsByIdAsync(newsFeedItemIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
519
|
+
|
|
520
|
+
public async deleteNewsFeedItemsByIdAsync(newsFeedItemIds:number[]|carriers.NewsFeed_DeleteNewsFeedItemsByIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
521
|
+
let _request : carriers.NewsFeed_DeleteNewsFeedItemsByIdRequest = null;
|
|
522
|
+
let _options : base.WebApiRequestOptions = null;
|
|
523
|
+
const first : any = newsFeedItemIds;
|
|
524
|
+
if( typeof( first ) === "object" && first && ( typeof(first.newsFeedItemIds)!='undefined' ) )
|
|
525
|
+
{
|
|
526
|
+
_request = newsFeedItemIds as carriers.NewsFeed_DeleteNewsFeedItemsByIdRequest;
|
|
527
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
528
|
+
}
|
|
529
|
+
else
|
|
530
|
+
{
|
|
531
|
+
_request = {
|
|
532
|
+
newsFeedItemIds: newsFeedItemIds as number[],
|
|
533
|
+
};
|
|
534
|
+
_options = webapi_options;
|
|
535
|
+
}
|
|
536
|
+
return this._deleteNewsFeedItemsByIdAsync( _request, _options );
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
private async _deleteNewsFeedItemsByIdentifierAsync(request: carriers.NewsFeed_DeleteNewsFeedItemsByIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
541
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
542
|
+
base.WebApiBase.SetPending(options);
|
|
543
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
544
|
+
try {
|
|
545
|
+
config.baseURL = this._options.baseUrl;
|
|
546
|
+
const response = await this._axios.post("DeleteNewsFeedItemsByIdentifier", request , config);
|
|
547
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
548
|
+
const res = response.data;
|
|
549
|
+
resolve(res);
|
|
550
|
+
}
|
|
551
|
+
catch( err ) {
|
|
552
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
553
|
+
reject(err);
|
|
554
|
+
}
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* Deletes items from the newsfeed by FromIdentifier. Requires the user be an administrator. Deleting an item removes it from all users.
|
|
562
|
+
* @param request - FromIdentifier
|
|
563
|
+
* @returns This method has no return value
|
|
564
|
+
*/
|
|
565
|
+
public async deleteNewsFeedItemsByIdentifierAsync(request: carriers.NewsFeed_DeleteNewsFeedItemsByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Deletes items from the newsfeed by FromIdentifier. Requires the user be an administrator. Deleting an item removes it from all users.
|
|
569
|
+
* @param fromIdentifier - FromIdentifier value to remove from the feed.
|
|
570
|
+
* @returns This method has no return value
|
|
571
|
+
*/
|
|
572
|
+
public async deleteNewsFeedItemsByIdentifierAsync(fromIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
573
|
+
|
|
574
|
+
public async deleteNewsFeedItemsByIdentifierAsync(fromIdentifier:string|carriers.NewsFeed_DeleteNewsFeedItemsByIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
575
|
+
let _request : carriers.NewsFeed_DeleteNewsFeedItemsByIdentifierRequest = null;
|
|
576
|
+
let _options : base.WebApiRequestOptions = null;
|
|
577
|
+
const first : any = fromIdentifier;
|
|
578
|
+
if( typeof( first ) === "object" && first && ( typeof(first.fromIdentifier)!='undefined' ) )
|
|
579
|
+
{
|
|
580
|
+
_request = fromIdentifier as carriers.NewsFeed_DeleteNewsFeedItemsByIdentifierRequest;
|
|
581
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
582
|
+
}
|
|
583
|
+
else
|
|
584
|
+
{
|
|
585
|
+
_request = {
|
|
586
|
+
fromIdentifier: fromIdentifier as string,
|
|
587
|
+
};
|
|
588
|
+
_options = webapi_options;
|
|
589
|
+
}
|
|
590
|
+
return this._deleteNewsFeedItemsByIdentifierAsync( _request, _options );
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
private async _deleteNewsFeedItemsByCategoryIdentifierAsync(request: carriers.NewsFeed_DeleteNewsFeedItemsByCategoryIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
595
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
596
|
+
base.WebApiBase.SetPending(options);
|
|
597
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
598
|
+
try {
|
|
599
|
+
config.baseURL = this._options.baseUrl;
|
|
600
|
+
const response = await this._axios.post("DeleteNewsFeedItemsByCategoryIdentifier", request , config);
|
|
601
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
602
|
+
const res = response.data;
|
|
603
|
+
resolve(res);
|
|
604
|
+
}
|
|
605
|
+
catch( err ) {
|
|
606
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
607
|
+
reject(err);
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* Deletes items from the newsfeed by FromCategoryIdentifier. Requires the user be an administrator. Deleting an item removes it from all users.
|
|
616
|
+
* @param request - FromCategoryIdentifier
|
|
617
|
+
* @returns This method has no return value
|
|
618
|
+
*/
|
|
619
|
+
public async deleteNewsFeedItemsByCategoryIdentifierAsync(request: carriers.NewsFeed_DeleteNewsFeedItemsByCategoryIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* Deletes items from the newsfeed by FromCategoryIdentifier. Requires the user be an administrator. Deleting an item removes it from all users.
|
|
623
|
+
* @param fromCategoryIdentifier - FromCategoryIdentifier value to remove from the feed.
|
|
624
|
+
* @returns This method has no return value
|
|
625
|
+
*/
|
|
626
|
+
public async deleteNewsFeedItemsByCategoryIdentifierAsync(fromCategoryIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
627
|
+
|
|
628
|
+
public async deleteNewsFeedItemsByCategoryIdentifierAsync(fromCategoryIdentifier:string|carriers.NewsFeed_DeleteNewsFeedItemsByCategoryIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
629
|
+
let _request : carriers.NewsFeed_DeleteNewsFeedItemsByCategoryIdentifierRequest = null;
|
|
630
|
+
let _options : base.WebApiRequestOptions = null;
|
|
631
|
+
const first : any = fromCategoryIdentifier;
|
|
632
|
+
if( typeof( first ) === "object" && first && ( typeof(first.fromCategoryIdentifier)!='undefined' ) )
|
|
633
|
+
{
|
|
634
|
+
_request = fromCategoryIdentifier as carriers.NewsFeed_DeleteNewsFeedItemsByCategoryIdentifierRequest;
|
|
635
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
636
|
+
}
|
|
637
|
+
else
|
|
638
|
+
{
|
|
639
|
+
_request = {
|
|
640
|
+
fromCategoryIdentifier: fromCategoryIdentifier as string,
|
|
641
|
+
};
|
|
642
|
+
_options = webapi_options;
|
|
643
|
+
}
|
|
644
|
+
return this._deleteNewsFeedItemsByCategoryIdentifierAsync( _request, _options );
|
|
645
|
+
}
|
|
646
|
+
|
|
479
647
|
} // class v1NewsFeedAgentController
|
|
480
648
|
|
|
481
649
|
|