@superoffice/webapi 12.0.342 → 12.2.2072

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/Carriers.d.ts +486 -5
  2. package/dist/cjs/Carriers.d.ts.map +1 -1
  3. package/dist/cjs/Converters.d.ts +21 -0
  4. package/dist/cjs/Converters.d.ts.map +1 -1
  5. package/dist/cjs/Converters.js +320 -4
  6. package/dist/cjs/Converters.js.map +1 -1
  7. package/dist/cjs/CustomObjectAgent.d.ts +137 -0
  8. package/dist/cjs/CustomObjectAgent.d.ts.map +1 -0
  9. package/dist/cjs/CustomObjectAgent.js +294 -0
  10. package/dist/cjs/CustomObjectAgent.js.map +1 -0
  11. package/dist/cjs/CustomerServiceAgent.d.ts +4 -3
  12. package/dist/cjs/CustomerServiceAgent.d.ts.map +1 -1
  13. package/dist/cjs/CustomerServiceAgent.js +3 -2
  14. package/dist/cjs/CustomerServiceAgent.js.map +1 -1
  15. package/dist/cjs/EMailAgent.d.ts +16 -0
  16. package/dist/cjs/EMailAgent.d.ts.map +1 -1
  17. package/dist/cjs/EMailAgent.js +48 -0
  18. package/dist/cjs/EMailAgent.js.map +1 -1
  19. package/dist/cjs/Enums.d.ts +92 -1
  20. package/dist/cjs/Enums.d.ts.map +1 -1
  21. package/dist/cjs/Enums.js +97 -2
  22. package/dist/cjs/Enums.js.map +1 -1
  23. package/dist/cjs/ListAgent.d.ts +7 -0
  24. package/dist/cjs/ListAgent.d.ts.map +1 -1
  25. package/dist/cjs/ListAgent.js +24 -0
  26. package/dist/cjs/ListAgent.js.map +1 -1
  27. package/dist/cjs/NewsFeedAgent.d.ts +141 -0
  28. package/dist/cjs/NewsFeedAgent.d.ts.map +1 -0
  29. package/dist/cjs/NewsFeedAgent.js +292 -0
  30. package/dist/cjs/NewsFeedAgent.js.map +1 -0
  31. package/dist/cjs/ProjectAgent.d.ts +3 -3
  32. package/dist/cjs/WebApi.d.ts +12 -0
  33. package/dist/cjs/WebApi.d.ts.map +1 -1
  34. package/dist/cjs/WebApi.js +19 -1
  35. package/dist/cjs/WebApi.js.map +1 -1
  36. package/dist/esm/Carriers.d.ts +486 -5
  37. package/dist/esm/Carriers.d.ts.map +1 -1
  38. package/dist/esm/Converters.d.ts +21 -0
  39. package/dist/esm/Converters.d.ts.map +1 -1
  40. package/dist/esm/Converters.js +294 -0
  41. package/dist/esm/Converters.js.map +1 -1
  42. package/dist/esm/CustomObjectAgent.d.ts +137 -0
  43. package/dist/esm/CustomObjectAgent.d.ts.map +1 -0
  44. package/dist/esm/CustomObjectAgent.js +289 -0
  45. package/dist/esm/CustomObjectAgent.js.map +1 -0
  46. package/dist/esm/CustomerServiceAgent.d.ts +4 -3
  47. package/dist/esm/CustomerServiceAgent.d.ts.map +1 -1
  48. package/dist/esm/CustomerServiceAgent.js +3 -2
  49. package/dist/esm/CustomerServiceAgent.js.map +1 -1
  50. package/dist/esm/EMailAgent.d.ts +16 -0
  51. package/dist/esm/EMailAgent.d.ts.map +1 -1
  52. package/dist/esm/EMailAgent.js +48 -0
  53. package/dist/esm/EMailAgent.js.map +1 -1
  54. package/dist/esm/Enums.d.ts +92 -1
  55. package/dist/esm/Enums.d.ts.map +1 -1
  56. package/dist/esm/Enums.js +96 -1
  57. package/dist/esm/Enums.js.map +1 -1
  58. package/dist/esm/ListAgent.d.ts +7 -0
  59. package/dist/esm/ListAgent.d.ts.map +1 -1
  60. package/dist/esm/ListAgent.js +24 -0
  61. package/dist/esm/ListAgent.js.map +1 -1
  62. package/dist/esm/NewsFeedAgent.d.ts +141 -0
  63. package/dist/esm/NewsFeedAgent.d.ts.map +1 -0
  64. package/dist/esm/NewsFeedAgent.js +287 -0
  65. package/dist/esm/NewsFeedAgent.js.map +1 -0
  66. package/dist/esm/ProjectAgent.d.ts +3 -3
  67. package/dist/esm/WebApi.d.ts +12 -0
  68. package/dist/esm/WebApi.d.ts.map +1 -1
  69. package/dist/esm/WebApi.js +18 -0
  70. package/dist/esm/WebApi.js.map +1 -1
  71. package/package.json +4 -4
  72. package/src/Carriers.ts +666 -5
  73. package/src/Converters.ts +354 -0
  74. package/src/CustomObjectAgent.ts +489 -0
  75. package/src/CustomerServiceAgent.ts +7 -5
  76. package/src/EMailAgent.ts +76 -0
  77. package/src/Enums.ts +100 -1
  78. package/src/ListAgent.ts +30 -0
  79. package/src/NewsFeedAgent.ts +481 -0
  80. package/src/ProjectAgent.ts +3 -3
  81. package/src/WebApi.ts +24 -0
package/src/Enums.ts CHANGED
@@ -2371,7 +2371,7 @@
2371
2371
 
2372
2372
  /**
2373
2373
  *
2374
- * This Enum is used by: email_item.priority
2374
+ * This Enum is used by: email_item.priority; NewsFeedItem.Priority
2375
2375
  */
2376
2376
  export enum EMailPriority {
2377
2377
  /**
@@ -5730,6 +5730,82 @@
5730
5730
  }
5731
5731
 
5732
5732
 
5733
+ /**
5734
+ * News feed item status - indicates if the item is being handled by a CTA
5735
+ * This Enum is used by: NewsFeedItem.Status
5736
+ */
5737
+ export enum NewsFeedItemStatus {
5738
+ /**
5739
+ * 0: Normal - nothing special has happened yet.
5740
+ */
5741
+ Normal = "Normal",
5742
+ /**
5743
+ * 1: Processing has started - the item is being handled by a CTA
5744
+ */
5745
+ Handling = "Handling",
5746
+ /**
5747
+ * 2: Handled - the item has been processed by a CTA
5748
+ */
5749
+ Handled = "Handled",
5750
+ }
5751
+
5752
+
5753
+ /**
5754
+ * News feed CTA type
5755
+ * This Enum is used by: NewsFeedItemCta.CtaType
5756
+ */
5757
+ export enum CtaType {
5758
+ /**
5759
+ * 0: Unknown - rendered as a link, maybe
5760
+ */
5761
+ Unknown = "Unknown",
5762
+ /**
5763
+ * 1: Rendered as a solid color button
5764
+ */
5765
+ Primary = "Primary",
5766
+ /**
5767
+ * 2: Rendered as an outline button
5768
+ */
5769
+ Secondary = "Secondary",
5770
+ /**
5771
+ * 3: Rendered as a blue underlined link
5772
+ */
5773
+ Link = "Link",
5774
+ }
5775
+
5776
+
5777
+ /**
5778
+ * News feed CTA flavor
5779
+ * This Enum is used by: NewsFeedItemCta.CtaFlavor
5780
+ */
5781
+ export enum CtaFlavor {
5782
+ /**
5783
+ * 0: Plain - no special style
5784
+ */
5785
+ Normal = "Normal",
5786
+ /**
5787
+ * 1: Blue info icon
5788
+ */
5789
+ Info = "Info",
5790
+ /**
5791
+ * 2: Yellow warning icon
5792
+ */
5793
+ Warning = "Warning",
5794
+ /**
5795
+ * 3: Red error icon
5796
+ */
5797
+ Error = "Error",
5798
+ /**
5799
+ * 4: Green check icon
5800
+ */
5801
+ Accept = "Accept",
5802
+ /**
5803
+ * 5: Red x icon
5804
+ */
5805
+ Reject = "Reject",
5806
+ }
5807
+
5808
+
5733
5809
  /**
5734
5810
  * CrmScript Event triggers - when CRMScript is run based on user or system actions.
5735
5811
  */
@@ -6641,6 +6717,29 @@
6641
6717
  }
6642
6718
 
6643
6719
 
6720
+ /**
6721
+ * Describes access level to get FAQs
6722
+ */
6723
+ export enum KbAccessLevel {
6724
+ /**
6725
+ * 1: Private
6726
+ */
6727
+ Private = "Private",
6728
+ /**
6729
+ * 2: Accessible to internal users
6730
+ */
6731
+ Internal = "Internal",
6732
+ /**
6733
+ * 3: Accessible to registered customers
6734
+ */
6735
+ PublicAuthenticated = "PublicAuthenticated",
6736
+ /**
6737
+ * 4: Accessible to everyone
6738
+ */
6739
+ Public = "Public",
6740
+ }
6741
+
6742
+
6644
6743
  /**
6645
6744
  * Value for field 'badge' in table 'ej_message'. Defines the initial source of a message.
6646
6745
  * This Enum is used by: ej_message.badge
package/src/ListAgent.ts CHANGED
@@ -421,6 +421,7 @@ export interface IListAgent {
421
421
  setTicketRelationDefinitionSortOrderAsync(ticketRelationDefId: number, sortOrder: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
422
422
  validateTicketRelationDefinitionAsync(request: carriers.List_ValidateTicketRelationDefinitionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketRelationDefinitionResult[] >;
423
423
  validateTicketRelationDefinitionAsync(ticketRelationDefinitionId: number, sourceTicketTypeIds: number[], destinationTicketTypeIds: number[], relationType: enums.TicketRelationType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketRelationDefinitionResult[] >;
424
+ getAllTicketRelationDefinitionEntitiesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketRelationDefinitionEntity[] >;
424
425
  getTicketStatusEntityAsync(ticketStatusEntityId: number) : Promise< carriers.TicketStatusEntity >;
425
426
  globalChangeTicketStatusAsync(request: carriers.List_GlobalChangeTicketStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
426
427
  globalChangeTicketStatusAsync(fromTicketStatusId: number, toTicketStatusId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
@@ -10860,6 +10861,35 @@ export class ListAgent extends base.WebApiBase implements IListAgent {
10860
10861
  return this._validateTicketRelationDefinitionAsync( _request, _options );
10861
10862
  }
10862
10863
 
10864
+
10865
+ private async _getAllTicketRelationDefinitionEntitiesAsync( options?:base.WebApiRequestOptions) : Promise< carriers.TicketRelationDefinitionEntity[] > {
10866
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
10867
+ base.WebApiBase.SetPending(options);
10868
+ return new Promise< carriers.TicketRelationDefinitionEntity[] >(async (resolve, reject) => {
10869
+ try {
10870
+ config.baseURL = this._options.baseUrl;
10871
+ const response = await this._axios.post("GetAllTicketRelationDefinitionEntities", undefined , config);
10872
+ base.WebApiBase.SetCompleted(options, response);
10873
+ const res : carriers.TicketRelationDefinitionEntity[] = converters.Create_TicketRelationDefinitionEntityArray_From( response.data );
10874
+ resolve(res);
10875
+ }
10876
+ catch( err ) {
10877
+ base.WebApiBase.HandleError(options, config, err);
10878
+ reject(err);
10879
+ }
10880
+ });
10881
+ }
10882
+
10883
+
10884
+ /**
10885
+ * Returns all non-built-in ticket relation definitions, including their source and destination ticket type associations.
10886
+ * @returns An array of all non-built-in ticket relation definition entities
10887
+ */
10888
+ public async getAllTicketRelationDefinitionEntitiesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketRelationDefinitionEntity[] >
10889
+ {
10890
+ return this._getAllTicketRelationDefinitionEntitiesAsync(webapi_options);
10891
+ }
10892
+
10863
10893
  /**
10864
10894
  * Gets a TicketStatusEntity object.
10865
10895
  * @param ticketStatusEntityId - The primary key.
@@ -0,0 +1,481 @@
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/NewsFeedAgent.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
+ * Posting and reading Newsfeed items, marking them as read or as handled.
28
+ */
29
+ export interface INewsFeedAgent {
30
+ createDefaultNewsFeedItemAsync(): Promise< carriers.NewsFeedItem >;
31
+ deleteNewsFeedItemAsync(NewsFeedItemId: number) : Promise<void>;
32
+ getNewsFeedItemAsync(newsFeedItemId: number) : Promise< carriers.NewsFeedItem >;
33
+ postNewsFeedItemAsync(request: carriers.NewsFeed_PostNewsFeedItemRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem >;
34
+ postNewsFeedItemAsync(newsFeedItem: carriers.NewsFeedItem, toAssociateIds: number[], toGroupIds: number[], toAll: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem >;
35
+ getNewsFeedItemsByIdAsync(request: carriers.NewsFeed_GetNewsFeedItemsByIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem[] >;
36
+ getNewsFeedItemsByIdAsync(newsFeedItemIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem[] >;
37
+ getNewsItemsForUserAsync(request: carriers.NewsFeed_GetNewsItemsForUserRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem[] >;
38
+ getNewsItemsForUserAsync(associateId: number, fromDate: Date, toDate: Date, top: number, skip: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem[] >;
39
+ markAsReadAsync(request: carriers.NewsFeed_MarkAsReadRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
40
+ markAsReadAsync(newsFeedItemId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
41
+ startHandlingAsync(request: carriers.NewsFeed_StartHandlingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
42
+ startHandlingAsync(newsFeedItemId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
43
+ markAsHandledAsync(request: carriers.NewsFeed_MarkAsHandledRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
44
+ markAsHandledAsync(newsFeedItemId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
45
+ } // interface INewsFeedAgent
46
+
47
+
48
+
49
+
50
+ /**
51
+ * Posting and reading Newsfeed items, marking them as read or as handled.
52
+ */
53
+ export class NewsFeedAgent extends base.WebApiBase implements INewsFeedAgent {
54
+ constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
55
+ constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
56
+ constructor(baseUrl: string, resourceManager:any);
57
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
58
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
59
+ constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
60
+ constructor(options: base.WebApiOptions);
61
+
62
+ constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
63
+ langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
64
+ langOrResourceOrRM?:string|base.ResourceParsing|any,
65
+ cultureCode?: string,
66
+ ) {
67
+ const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
68
+ options.basePath = "v1/Agents/NewsFeed/";
69
+ super(options);
70
+ }
71
+
72
+
73
+
74
+ /**
75
+ * Set default values into a new NewsFeedItem.
76
+ * NetServer calculates default values on the entity, which is required when creating/storing a new instance
77
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
78
+ * @returns A blank entity.
79
+ */
80
+ public async createDefaultNewsFeedItemAsync(options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem > {
81
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
82
+ base.WebApiBase.SetPending(options);
83
+ return new Promise< carriers.NewsFeedItem >(async (resolve, reject) => {
84
+ try {
85
+ const response = await this._axios.post("CreateDefaultNewsFeedItem", null, config);
86
+ base.WebApiBase.SetCompleted(options, response);
87
+ const res : carriers.NewsFeedItem = converters.Create_NewsFeedItem_From( response.data );
88
+ resolve(res);
89
+ }
90
+ catch( err ) {
91
+ base.WebApiBase.HandleError(options, config, err);
92
+ reject(err);
93
+ }
94
+ });
95
+ }
96
+
97
+ /**
98
+ * Deletes the NewsFeedItem
99
+ * @param NewsFeedItemId - The id of the NewsFeedItem to be deleted.
100
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
101
+ */
102
+ public async deleteNewsFeedItemAsync(NewsFeedItemId: number, options?:base.WebApiRequestOptions) : Promise< void > {
103
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
104
+ base.WebApiBase.SetPending(options);
105
+ return new Promise< void >(async (resolve, reject) => {
106
+ try {
107
+ const response = await this._axios.post("DeleteNewsFeedItem?NewsFeedItemId=" + NewsFeedItemId, null, config );
108
+ base.WebApiBase.SetCompleted(options, response);
109
+ const res = response.data;
110
+ resolve(res);
111
+ }
112
+ catch( err ) {
113
+ base.WebApiBase.HandleError(options, config, err);
114
+ reject(err);
115
+ }
116
+ });
117
+ }
118
+ /**
119
+ * Gets a NewsFeedItem object.
120
+ * @param newsFeedItemId - The primary key.
121
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
122
+ * @returns A single NewsFeedItem
123
+ */
124
+ public async getNewsFeedItemAsync(newsFeedItemId: number, options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem > {
125
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
126
+ base.WebApiBase.SetPending(options);
127
+ return new Promise< carriers.NewsFeedItem >(async (resolve, reject) => {
128
+ try {
129
+ const response = await this._axios.post("GetNewsFeedItem?newsFeedItemId=" + newsFeedItemId, null, config);
130
+ base.WebApiBase.SetCompleted(options, response);
131
+ const res = converters.Create_NewsFeedItem_From( response.data );
132
+ resolve(res);
133
+ }
134
+ catch( err ) {
135
+ base.WebApiBase.HandleError(options, config, err);
136
+ reject(err);
137
+ }
138
+ });
139
+ }
140
+
141
+
142
+ private async _postNewsFeedItemAsync(request: carriers.NewsFeed_PostNewsFeedItemRequest, options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem > {
143
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
144
+ base.WebApiBase.SetPending(options);
145
+ return new Promise< carriers.NewsFeedItem >(async (resolve, reject) => {
146
+ try {
147
+ config.baseURL = this._options.baseUrl;
148
+ const response = await this._axios.post("PostNewsFeedItem", request , config);
149
+ base.WebApiBase.SetCompleted(options, response);
150
+ const res : carriers.NewsFeedItem = converters.Create_NewsFeedItem_From( response.data );
151
+ resolve(res);
152
+ }
153
+ catch( err ) {
154
+ base.WebApiBase.HandleError(options, config, err);
155
+ reject(err);
156
+ }
157
+ });
158
+ }
159
+
160
+
161
+
162
+ /**
163
+ * Saves a new item to the newsfeed, publishing it to the specified users.
164
+ * @param request - NewsFeedItem, ToAssociateIds, ToGroupIds, ToAll
165
+ * @returns The news feed item that was posted, including its new id.
166
+ */
167
+ public async postNewsFeedItemAsync(request: carriers.NewsFeed_PostNewsFeedItemRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem >;
168
+
169
+ /**
170
+ * Saves a new item to the newsfeed, publishing it to the specified users.
171
+ * @param newsFeedItem - The news feed item to post. NewsFeedItemId is ignored, as a new id will be generated when posting to the newsfeed.
172
+ * @param toAssociateIds - List of associate ids that this news feed item is sent to.
173
+ * @param toGroupIds - List of group ids that this news feed item is sent to. This gets resolved to associate ids when posted.
174
+ * @param toAll - Indicates if this news feed item is sent to all users. Gets resolved into all users when posted.
175
+ * @returns The news feed item that was posted, including its new id.
176
+ */
177
+ public async postNewsFeedItemAsync(newsFeedItem: carriers.NewsFeedItem, toAssociateIds: number[], toGroupIds: number[], toAll: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem >;
178
+
179
+ public async postNewsFeedItemAsync(newsFeedItem:carriers.NewsFeedItem|carriers.NewsFeed_PostNewsFeedItemRequest, toAssociateIds?:number[]|base.WebApiRequestOptions, toGroupIds?:number[], toAll?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem > {
180
+ let _request : carriers.NewsFeed_PostNewsFeedItemRequest = null;
181
+ let _options : base.WebApiRequestOptions = null;
182
+ const first : any = newsFeedItem;
183
+ if( typeof( first ) === "object" && first && ( typeof(first.newsFeedItem)!='undefined' || typeof(first.toAssociateIds)!='undefined' || typeof(first.toGroupIds)!='undefined' || typeof(first.toAll)!='undefined' ) )
184
+ {
185
+ _request = newsFeedItem as carriers.NewsFeed_PostNewsFeedItemRequest;
186
+ _options = toAssociateIds as base.WebApiRequestOptions;
187
+ }
188
+ else
189
+ {
190
+ _request = {
191
+ newsFeedItem: newsFeedItem as carriers.NewsFeedItem,
192
+ toAssociateIds: toAssociateIds as number[],
193
+ toGroupIds: toGroupIds as number[],
194
+ toAll: toAll as boolean,
195
+ };
196
+ _options = webapi_options;
197
+ }
198
+ return this._postNewsFeedItemAsync( _request, _options );
199
+ }
200
+
201
+
202
+ private async _getNewsFeedItemsByIdAsync(request: carriers.NewsFeed_GetNewsFeedItemsByIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem[] > {
203
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
204
+ base.WebApiBase.SetPending(options);
205
+ return new Promise< carriers.NewsFeedItem[] >(async (resolve, reject) => {
206
+ try {
207
+ config.baseURL = this._options.baseUrl;
208
+ const response = await this._axios.post("GetNewsFeedItemsById", request , config);
209
+ base.WebApiBase.SetCompleted(options, response);
210
+ const res : carriers.NewsFeedItem[] = converters.Create_NewsFeedItemArray_From( response.data );
211
+ resolve(res);
212
+ }
213
+ catch( err ) {
214
+ base.WebApiBase.HandleError(options, config, err);
215
+ reject(err);
216
+ }
217
+ });
218
+ }
219
+
220
+
221
+
222
+ /**
223
+ * Get an array of items from the newsfeed by id. If the current user cannot access a particular item, it will be excluded from the results.
224
+ * @param request - NewsFeedItemIds
225
+ * @returns The news feed items that was posted, or null if not found/not accessible by the user.
226
+ */
227
+ public async getNewsFeedItemsByIdAsync(request: carriers.NewsFeed_GetNewsFeedItemsByIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem[] >;
228
+
229
+ /**
230
+ * Get an array of items from the newsfeed by id. If the current user cannot access a particular item, it will be excluded from the results.
231
+ * @param newsFeedItemIds - Ids of the news feed items to mark as seen for this user.
232
+ * @returns The news feed items that was posted, or null if not found/not accessible by the user.
233
+ */
234
+ public async getNewsFeedItemsByIdAsync(newsFeedItemIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem[] >;
235
+
236
+ public async getNewsFeedItemsByIdAsync(newsFeedItemIds:number[]|carriers.NewsFeed_GetNewsFeedItemsByIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem[] > {
237
+ let _request : carriers.NewsFeed_GetNewsFeedItemsByIdRequest = null;
238
+ let _options : base.WebApiRequestOptions = null;
239
+ const first : any = newsFeedItemIds;
240
+ if( typeof( first ) === "object" && first && ( typeof(first.newsFeedItemIds)!='undefined' ) )
241
+ {
242
+ _request = newsFeedItemIds as carriers.NewsFeed_GetNewsFeedItemsByIdRequest;
243
+ _options = webapi_options as base.WebApiRequestOptions;
244
+ }
245
+ else
246
+ {
247
+ _request = {
248
+ newsFeedItemIds: newsFeedItemIds as number[],
249
+ };
250
+ _options = webapi_options;
251
+ }
252
+ return this._getNewsFeedItemsByIdAsync( _request, _options );
253
+ }
254
+
255
+
256
+ private async _getNewsItemsForUserAsync(request: carriers.NewsFeed_GetNewsItemsForUserRequest, options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem[] > {
257
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
258
+ base.WebApiBase.SetPending(options);
259
+ return new Promise< carriers.NewsFeedItem[] >(async (resolve, reject) => {
260
+ try {
261
+ config.baseURL = this._options.baseUrl;
262
+ const response = await this._axios.post("GetNewsItemsForUser", request , config);
263
+ base.WebApiBase.SetCompleted(options, response);
264
+ const res : carriers.NewsFeedItem[] = converters.Create_NewsFeedItemArray_From( response.data );
265
+ resolve(res);
266
+ }
267
+ catch( err ) {
268
+ base.WebApiBase.HandleError(options, config, err);
269
+ reject(err);
270
+ }
271
+ });
272
+ }
273
+
274
+
275
+
276
+ /**
277
+ * Get a list of newsfeed items for a particular user between two dates. If the current user cannot access a particular item, it will be excluded from the results.
278
+ * @param request - AssociateId, FromDate, ToDate, Top, Skip
279
+ * @returns The news feed items that was posted, or null if not found/not accessible by the user.
280
+ */
281
+ public async getNewsItemsForUserAsync(request: carriers.NewsFeed_GetNewsItemsForUserRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem[] >;
282
+
283
+ /**
284
+ * Get a list of newsfeed items for a particular user between two dates. If the current user cannot access a particular item, it will be excluded from the results.
285
+ * @param associateId - Id of the associate to fetch news feed items for. 0 = current user
286
+ * @param fromDate - Start date for fetching news feed items.
287
+ * @param toDate - End date for fetching news feed items.
288
+ * @param top - Maximum number of news feed items to return.
289
+ * @param skip - Number of news feed items to skip for paging.
290
+ * @returns The news feed items that was posted, or null if not found/not accessible by the user.
291
+ */
292
+ public async getNewsItemsForUserAsync(associateId: number, fromDate: Date, toDate: Date, top: number, skip: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem[] >;
293
+
294
+ public async getNewsItemsForUserAsync(associateId:number|carriers.NewsFeed_GetNewsItemsForUserRequest, fromDate?:Date|base.WebApiRequestOptions, toDate?:Date, top?:number, skip?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NewsFeedItem[] > {
295
+ let _request : carriers.NewsFeed_GetNewsItemsForUserRequest = null;
296
+ let _options : base.WebApiRequestOptions = null;
297
+ const first : any = associateId;
298
+ if( typeof( first ) === "object" && first && ( typeof(first.associateId)!='undefined' || typeof(first.fromDate)!='undefined' || typeof(first.toDate)!='undefined' || typeof(first.top)!='undefined' || typeof(first.skip)!='undefined' ) )
299
+ {
300
+ _request = associateId as carriers.NewsFeed_GetNewsItemsForUserRequest;
301
+ _options = fromDate as base.WebApiRequestOptions;
302
+ }
303
+ else
304
+ {
305
+ _request = {
306
+ associateId: associateId as number,
307
+ fromDate: fromDate as Date,
308
+ toDate: toDate as Date,
309
+ top: top as number,
310
+ skip: skip as number,
311
+ };
312
+ _options = webapi_options;
313
+ }
314
+ return this._getNewsItemsForUserAsync( _request, _options );
315
+ }
316
+
317
+
318
+ private async _markAsReadAsync(request: carriers.NewsFeed_MarkAsReadRequest, options?:base.WebApiRequestOptions) : Promise< void > {
319
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
320
+ base.WebApiBase.SetPending(options);
321
+ return new Promise< void >(async (resolve, reject) => {
322
+ try {
323
+ config.baseURL = this._options.baseUrl;
324
+ const response = await this._axios.post("MarkAsRead", request , config);
325
+ base.WebApiBase.SetCompleted(options, response);
326
+ const res = response.data;
327
+ resolve(res);
328
+ }
329
+ catch( err ) {
330
+ base.WebApiBase.HandleError(options, config, err);
331
+ reject(err);
332
+ }
333
+ });
334
+ }
335
+
336
+
337
+
338
+ /**
339
+ * Marks the news feed item as read, so it can be un-bolded in the current user&apos;s feed.
340
+ * @param request - NewsFeedItemId
341
+ * @returns This method has no return value
342
+ */
343
+ public async markAsReadAsync(request: carriers.NewsFeed_MarkAsReadRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
344
+
345
+ /**
346
+ * Marks the news feed item as read, so it can be un-bolded in the current user&apos;s feed.
347
+ * @param newsFeedItemId - Id of the news feed item to mark as seen for this user.
348
+ * @returns This method has no return value
349
+ */
350
+ public async markAsReadAsync(newsFeedItemId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
351
+
352
+ public async markAsReadAsync(newsFeedItemId:number|carriers.NewsFeed_MarkAsReadRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
353
+ let _request : carriers.NewsFeed_MarkAsReadRequest = null;
354
+ let _options : base.WebApiRequestOptions = null;
355
+ const first : any = newsFeedItemId;
356
+ if( typeof( first ) === "object" && first && ( typeof(first.newsFeedItemId)!='undefined' ) )
357
+ {
358
+ _request = newsFeedItemId as carriers.NewsFeed_MarkAsReadRequest;
359
+ _options = webapi_options as base.WebApiRequestOptions;
360
+ }
361
+ else
362
+ {
363
+ _request = {
364
+ newsFeedItemId: newsFeedItemId as number,
365
+ };
366
+ _options = webapi_options;
367
+ }
368
+ return this._markAsReadAsync( _request, _options );
369
+ }
370
+
371
+
372
+ private async _startHandlingAsync(request: carriers.NewsFeed_StartHandlingRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
373
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
374
+ base.WebApiBase.SetPending(options);
375
+ return new Promise< boolean >(async (resolve, reject) => {
376
+ try {
377
+ config.baseURL = this._options.baseUrl;
378
+ const response = await this._axios.post("StartHandling", request , config);
379
+ base.WebApiBase.SetCompleted(options, response);
380
+ const res : boolean = response.data as boolean;
381
+ resolve(res);
382
+ }
383
+ catch( err ) {
384
+ base.WebApiBase.HandleError(options, config, err);
385
+ reject(err);
386
+ }
387
+ });
388
+ }
389
+
390
+
391
+
392
+ /**
393
+ * Marks the news feed item as being handled, that CTA processing has started. i.e. other users should not start handling it also.
394
+ * @param request - NewsFeedItemId
395
+ * @returns Indicates if the news feed item was successfully marked as being handled. False if it was already being handled or was handled.
396
+ */
397
+ public async startHandlingAsync(request: carriers.NewsFeed_StartHandlingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
398
+
399
+ /**
400
+ * Marks the news feed item as being handled, that CTA processing has started. i.e. other users should not start handling it also.
401
+ * @param newsFeedItemId - Id of the news feed item to mark as handled for all users.
402
+ * @returns Indicates if the news feed item was successfully marked as being handled. False if it was already being handled or was handled.
403
+ */
404
+ public async startHandlingAsync(newsFeedItemId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
405
+
406
+ public async startHandlingAsync(newsFeedItemId:number|carriers.NewsFeed_StartHandlingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
407
+ let _request : carriers.NewsFeed_StartHandlingRequest = null;
408
+ let _options : base.WebApiRequestOptions = null;
409
+ const first : any = newsFeedItemId;
410
+ if( typeof( first ) === "object" && first && ( typeof(first.newsFeedItemId)!='undefined' ) )
411
+ {
412
+ _request = newsFeedItemId as carriers.NewsFeed_StartHandlingRequest;
413
+ _options = webapi_options as base.WebApiRequestOptions;
414
+ }
415
+ else
416
+ {
417
+ _request = {
418
+ newsFeedItemId: newsFeedItemId as number,
419
+ };
420
+ _options = webapi_options;
421
+ }
422
+ return this._startHandlingAsync( _request, _options );
423
+ }
424
+
425
+
426
+ private async _markAsHandledAsync(request: carriers.NewsFeed_MarkAsHandledRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
427
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
428
+ base.WebApiBase.SetPending(options);
429
+ return new Promise< boolean >(async (resolve, reject) => {
430
+ try {
431
+ config.baseURL = this._options.baseUrl;
432
+ const response = await this._axios.post("MarkAsHandled", request , config);
433
+ base.WebApiBase.SetCompleted(options, response);
434
+ const res : boolean = response.data as boolean;
435
+ resolve(res);
436
+ }
437
+ catch( err ) {
438
+ base.WebApiBase.HandleError(options, config, err);
439
+ reject(err);
440
+ }
441
+ });
442
+ }
443
+
444
+
445
+
446
+ /**
447
+ * Marks the news feed item as handled, so it can be removed from the feed.
448
+ * @param request - NewsFeedItemId
449
+ * @returns Indicates if the news feed item was successfully marked as handled. False if it was already handled.
450
+ */
451
+ public async markAsHandledAsync(request: carriers.NewsFeed_MarkAsHandledRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
452
+
453
+ /**
454
+ * Marks the news feed item as handled, so it can be removed from the feed.
455
+ * @param newsFeedItemId - Id of the news feed item to mark as handled for all users.
456
+ * @returns Indicates if the news feed item was successfully marked as handled. False if it was already handled.
457
+ */
458
+ public async markAsHandledAsync(newsFeedItemId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
459
+
460
+ public async markAsHandledAsync(newsFeedItemId:number|carriers.NewsFeed_MarkAsHandledRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
461
+ let _request : carriers.NewsFeed_MarkAsHandledRequest = null;
462
+ let _options : base.WebApiRequestOptions = null;
463
+ const first : any = newsFeedItemId;
464
+ if( typeof( first ) === "object" && first && ( typeof(first.newsFeedItemId)!='undefined' ) )
465
+ {
466
+ _request = newsFeedItemId as carriers.NewsFeed_MarkAsHandledRequest;
467
+ _options = webapi_options as base.WebApiRequestOptions;
468
+ }
469
+ else
470
+ {
471
+ _request = {
472
+ newsFeedItemId: newsFeedItemId as number,
473
+ };
474
+ _options = webapi_options;
475
+ }
476
+ return this._markAsHandledAsync( _request, _options );
477
+ }
478
+
479
+ } // class v1NewsFeedAgentController
480
+
481
+
@@ -545,14 +545,14 @@ export class ProjectAgent extends base.WebApiBase implements IProjectAgent {
545
545
  /**
546
546
  * Returns the project image that is displayed in the CRM application.
547
547
  * @param request - ProjectId
548
- * @returns The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.)
548
+ * @returns The project image.
549
549
  */
550
550
  public async getProjectImageAsync(request: carriers.Project_GetProjectImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
551
551
 
552
552
  /**
553
553
  * Returns the project image that is displayed in the CRM application.
554
554
  * @param projectId - The project id of the project the image belongs to.
555
- * @returns The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.)
555
+ * @returns The project image.
556
556
  */
557
557
  public async getProjectImageAsync(projectId: number, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
558
558
 
@@ -606,7 +606,7 @@ export class ProjectAgent extends base.WebApiBase implements IProjectAgent {
606
606
  /**
607
607
  * Stores the project image that is displayed in the CRM application.
608
608
  * @param projectId - The project id of the project the image belongs to.
609
- * @param image - The image that is stored on the project (System.Drawing.Image)
609
+ * @param image - The project image.
610
610
  * @returns
611
611
  */
612
612
  public async setProjectImageAsync(projectId: number, image: ArrayBuffer|string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;