@superoffice/webapi 12.3.2570 → 12.5.2909

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 (81) hide show
  1. package/dist/cjs/AIAgent.d.ts +4 -4
  2. package/dist/cjs/Carriers.d.ts +242 -16
  3. package/dist/cjs/Carriers.d.ts.map +1 -1
  4. package/dist/cjs/ConfigurationAgent.d.ts +7 -0
  5. package/dist/cjs/ConfigurationAgent.d.ts.map +1 -1
  6. package/dist/cjs/ConfigurationAgent.js +24 -0
  7. package/dist/cjs/ConfigurationAgent.js.map +1 -1
  8. package/dist/cjs/Converters.d.ts +6 -0
  9. package/dist/cjs/Converters.d.ts.map +1 -1
  10. package/dist/cjs/Converters.js +92 -8
  11. package/dist/cjs/Converters.js.map +1 -1
  12. package/dist/cjs/Enums.d.ts +12 -0
  13. package/dist/cjs/Enums.d.ts.map +1 -1
  14. package/dist/cjs/Enums.js +12 -0
  15. package/dist/cjs/Enums.js.map +1 -1
  16. package/dist/cjs/FreeTextAgent.d.ts +2 -2
  17. package/dist/cjs/ImportAgent.d.ts +5 -5
  18. package/dist/cjs/MarketingAgent.d.ts +15 -0
  19. package/dist/cjs/MarketingAgent.d.ts.map +1 -1
  20. package/dist/cjs/MarketingAgent.js +33 -0
  21. package/dist/cjs/MarketingAgent.js.map +1 -1
  22. package/dist/cjs/MentionAgent.d.ts +96 -0
  23. package/dist/cjs/MentionAgent.d.ts.map +1 -0
  24. package/dist/cjs/MentionAgent.js +203 -0
  25. package/dist/cjs/MentionAgent.js.map +1 -0
  26. package/dist/cjs/NewsFeedAgent.d.ts +45 -0
  27. package/dist/cjs/NewsFeedAgent.d.ts.map +1 -1
  28. package/dist/cjs/NewsFeedAgent.js +99 -0
  29. package/dist/cjs/NewsFeedAgent.js.map +1 -1
  30. package/dist/cjs/UserDefinedFieldInfoAgent.d.ts +2 -2
  31. package/dist/cjs/WebApi.d.ts +6 -0
  32. package/dist/cjs/WebApi.d.ts.map +1 -1
  33. package/dist/cjs/WebApi.js +11 -2
  34. package/dist/cjs/WebApi.js.map +1 -1
  35. package/dist/esm/AIAgent.d.ts +4 -4
  36. package/dist/esm/Carriers.d.ts +242 -16
  37. package/dist/esm/Carriers.d.ts.map +1 -1
  38. package/dist/esm/ConfigurationAgent.d.ts +7 -0
  39. package/dist/esm/ConfigurationAgent.d.ts.map +1 -1
  40. package/dist/esm/ConfigurationAgent.js +24 -0
  41. package/dist/esm/ConfigurationAgent.js.map +1 -1
  42. package/dist/esm/Converters.d.ts +6 -0
  43. package/dist/esm/Converters.d.ts.map +1 -1
  44. package/dist/esm/Converters.js +79 -1
  45. package/dist/esm/Converters.js.map +1 -1
  46. package/dist/esm/Enums.d.ts +12 -0
  47. package/dist/esm/Enums.d.ts.map +1 -1
  48. package/dist/esm/Enums.js +12 -0
  49. package/dist/esm/Enums.js.map +1 -1
  50. package/dist/esm/FreeTextAgent.d.ts +2 -2
  51. package/dist/esm/ImportAgent.d.ts +5 -5
  52. package/dist/esm/MarketingAgent.d.ts +15 -0
  53. package/dist/esm/MarketingAgent.d.ts.map +1 -1
  54. package/dist/esm/MarketingAgent.js +33 -0
  55. package/dist/esm/MarketingAgent.js.map +1 -1
  56. package/dist/esm/MentionAgent.d.ts +96 -0
  57. package/dist/esm/MentionAgent.d.ts.map +1 -0
  58. package/dist/esm/MentionAgent.js +198 -0
  59. package/dist/esm/MentionAgent.js.map +1 -0
  60. package/dist/esm/NewsFeedAgent.d.ts +45 -0
  61. package/dist/esm/NewsFeedAgent.d.ts.map +1 -1
  62. package/dist/esm/NewsFeedAgent.js +99 -0
  63. package/dist/esm/NewsFeedAgent.js.map +1 -1
  64. package/dist/esm/UserDefinedFieldInfoAgent.d.ts +2 -2
  65. package/dist/esm/WebApi.d.ts +6 -0
  66. package/dist/esm/WebApi.d.ts.map +1 -1
  67. package/dist/esm/WebApi.js +9 -0
  68. package/dist/esm/WebApi.js.map +1 -1
  69. package/package.json +4 -4
  70. package/src/AIAgent.ts +4 -4
  71. package/src/Carriers.ts +431 -2895
  72. package/src/ConfigurationAgent.ts +30 -0
  73. package/src/Converters.ts +95 -1200
  74. package/src/Enums.ts +12 -1
  75. package/src/FreeTextAgent.ts +2 -2
  76. package/src/ImportAgent.ts +5 -5
  77. package/src/MarketingAgent.ts +56 -0
  78. package/src/MentionAgent.ts +346 -0
  79. package/src/NewsFeedAgent.ts +168 -0
  80. package/src/UserDefinedFieldInfoAgent.ts +2 -2
  81. package/src/WebApi.ts +12 -0
package/src/Enums.ts CHANGED
@@ -3916,6 +3916,14 @@
3916
3916
  * 32: A hint flag used to indicate that some fields may not be updateable, even though the user has update access to the row.
3917
3917
  */
3918
3918
  RestrictedUpdate = 32,
3919
+ /**
3920
+ * 34: Update or RestrictedUpdate
3921
+ */
3922
+ URU = 34,
3923
+ /**
3924
+ * 38: Update/RestrictedUpdate or Insert
3925
+ */
3926
+ WRITE = 38,
3919
3927
  /**
3920
3928
  * 64: Unused value only present for serializatrion purposes
3921
3929
  */
@@ -6925,6 +6933,10 @@
6925
6933
  * This Enum consists of flag values that can be combined.
6926
6934
  */
6927
6935
  export enum EjScriptVerb {
6936
+ /**
6937
+ * 0: All verbs allowed
6938
+ */
6939
+ BlockNone = 0,
6928
6940
  /**
6929
6941
  * 1: Block GET access
6930
6942
  */
@@ -7255,4 +7267,3 @@
7255
7267
  */
7256
7268
  Large = "Large",
7257
7269
  }
7258
-
@@ -279,14 +279,14 @@ export class FreeTextAgent extends base.WebApiBase implements IFreeTextAgent {
279
279
 
280
280
 
281
281
  /**
282
- * Wipe and regenerate the freetext index by scanning the database (freetext search will be unavailable while this operation runs
282
+ * Regenerate the freetext index by scanning the database. Freetext search may be unavailable while this operation runs, for instance when the index is built from scratch.
283
283
  * @param request - RunAsBatch
284
284
  * @returns Information about the batch task, if batch execution was requested. Otherwise null
285
285
  */
286
286
  public async regenerateIndexAsync(request: carriers.FreeText_RegenerateIndexRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BatchTaskInfo >;
287
287
 
288
288
  /**
289
- * Wipe and regenerate the freetext index by scanning the database (freetext search will be unavailable while this operation runs
289
+ * Regenerate the freetext index by scanning the database. Freetext search may be unavailable while this operation runs, for instance when the index is built from scratch.
290
290
  * @param runAsBatch - If true, then execute the regeneration as a Batch Task; the service call will return immediately. Otherwise wait until the task completes, may cause a timeout if called as a Web Service
291
291
  * @returns Information about the batch task, if batch execution was requested. Otherwise null
292
292
  */
@@ -94,9 +94,9 @@ export class ImportAgent extends base.WebApiBase implements IImportAgent {
94
94
  /**
95
95
  * Preview the import
96
96
  * @param importLines - The rows that will be manipulated and according to Import rules
97
- * @param columnDefinition - An array of the columndefinitions, like firstname, lastname, ...
97
+ * @param columnDefinition - An array of the columndefinitions, like person.firstname, person.lastname, ... - see ImportColumnDef for names
98
98
  * @param culture - The current culture used in the import. Used to match language specific strings
99
- * @param context - Optional context for the import.
99
+ * @param context - Optional context for the import. (sourcedFrom=yyy&fileName=xxx&pricelistId=123)
100
100
  * @returns An array of the the rows that can be imported, manipulated according to Import rules given
101
101
  */
102
102
  public async previewImportAsync(importLines: carriers.ImportLine[], columnDefinition: string[], culture: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine[] >;
@@ -153,11 +153,11 @@ export class ImportAgent extends base.WebApiBase implements IImportAgent {
153
153
 
154
154
  /**
155
155
  * Do the actual import
156
- * @param importLines - The rows that will be imported
157
- * @param columnDefinition - An array of the columndefinitions, like firstname, lastname, ...
156
+ * @param importLines - The rows that will be imported - only selected rows are saved.
157
+ * @param columnDefinition - An array of the columndefinitions, like person.firstname, person.lastname, ... - see ImportColumnDef for names
158
158
  * @param createSelection - true if a selection of the imported entities shall be made
159
159
  * @param culture - The current culture used in the import. Used to match language specific strings
160
- * @param context - Optional context for the import.
160
+ * @param context - Optional context for the import. (sourcedFrom=yyy&fileName=xxx&pricelistId=123)
161
161
  * @returns First part: the id of the selection created after the import, 0 if no selection is created. Second part: The number of rows actually imported
162
162
  */
163
163
  public async saveImportAsync(importLines: carriers.ImportLine[], columnDefinition: string[], createSelection: boolean, culture: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
@@ -66,6 +66,8 @@ export interface IMarketingAgent {
66
66
  renameMailingByMessageIdAsync(messageId: number, name: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
67
67
  reloadAndSendMailingAsync(request: carriers.Marketing_ReloadAndSendMailingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
68
68
  reloadAndSendMailingAsync(mailingId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
69
+ stopMailingAsync(request: carriers.Marketing_StopMailingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
70
+ stopMailingAsync(mailingId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
69
71
  calculateMailingStatisticsAsync(request: carriers.Marketing_CalculateMailingStatisticsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
70
72
  calculateMailingStatisticsAsync(shipmentId: number, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
71
73
  getFormSubmissionsCountAsync(request: carriers.Marketing_GetFormSubmissionsCountRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
@@ -1092,6 +1094,60 @@ export class MarketingAgent extends base.WebApiBase implements IMarketingAgent {
1092
1094
  }
1093
1095
 
1094
1096
 
1097
+ private async _stopMailingAsync(request: carriers.Marketing_StopMailingRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
1098
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1099
+ base.WebApiBase.SetPending(options);
1100
+ return new Promise< boolean >(async (resolve, reject) => {
1101
+ try {
1102
+ config.baseURL = this._options.baseUrl;
1103
+ const response = await this._axios.post("StopMailing", request , config);
1104
+ base.WebApiBase.SetCompleted(options, response);
1105
+ const res : boolean = response.data as boolean;
1106
+ resolve(res);
1107
+ }
1108
+ catch( err ) {
1109
+ base.WebApiBase.HandleError(options, config, err);
1110
+ reject(err);
1111
+ }
1112
+ });
1113
+ }
1114
+
1115
+
1116
+
1117
+ /**
1118
+ * Stop a mailing that is queued or currently sending, leaving it in status Canceled
1119
+ * @param request - MailingId
1120
+ * @returns Did the operation succeed?
1121
+ */
1122
+ public async stopMailingAsync(request: carriers.Marketing_StopMailingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
1123
+
1124
+ /**
1125
+ * Stop a mailing that is queued or currently sending, leaving it in status Canceled
1126
+ * @param mailingId - Mailing id
1127
+ * @returns Did the operation succeed?
1128
+ */
1129
+ public async stopMailingAsync(mailingId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
1130
+
1131
+ public async stopMailingAsync(mailingId:number|carriers.Marketing_StopMailingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
1132
+ let _request : carriers.Marketing_StopMailingRequest = null;
1133
+ let _options : base.WebApiRequestOptions = null;
1134
+ const first : any = mailingId;
1135
+ if( typeof( first ) === "object" && first && ( typeof(first.mailingId)!='undefined' ) )
1136
+ {
1137
+ _request = mailingId as carriers.Marketing_StopMailingRequest;
1138
+ _options = webapi_options as base.WebApiRequestOptions;
1139
+ }
1140
+ else
1141
+ {
1142
+ _request = {
1143
+ mailingId: mailingId as number,
1144
+ };
1145
+ _options = webapi_options;
1146
+ }
1147
+ return this._stopMailingAsync( _request, _options );
1148
+ }
1149
+
1150
+
1095
1151
  private async _calculateMailingStatisticsAsync(request: carriers.Marketing_CalculateMailingStatisticsRequest, options?:base.WebApiRequestOptions) : Promise< number > {
1096
1152
  const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1097
1153
  base.WebApiBase.SetPending(options);
@@ -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&apos;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&apos;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&apos;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
+
@@ -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