@superoffice/webapi 11.7.727 → 11.9.1204

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 (163) hide show
  1. package/LICENSE.md +15 -15
  2. package/README.md +184 -184
  3. package/__tests__/Appointment63-notz.json +1925 -1925
  4. package/__tests__/Appointment63-utctz.json +1925 -1925
  5. package/__tests__/Appointment63.json +1925 -1925
  6. package/__tests__/AppointmentTzTest.ts +115 -115
  7. package/__tests__/AxiosNockTest.ts +28 -28
  8. package/__tests__/ContactDefault.json +699 -699
  9. package/__tests__/ContactEntity.json +272 -272
  10. package/__tests__/ContactRestTest.ts +144 -144
  11. package/__tests__/ContactTest.ts +395 -395
  12. package/__tests__/ConvertersTest.ts +97 -97
  13. package/__tests__/DocumentTest.ts +101 -101
  14. package/__tests__/Person210-notz.json +1932 -1932
  15. package/__tests__/Person210-utctz.json +1932 -1932
  16. package/__tests__/Person210.json +1932 -1932
  17. package/__tests__/PersonImageData.nock +22 -22
  18. package/__tests__/PersonTest.ts +41 -41
  19. package/__tests__/PersonTzTest.ts +113 -113
  20. package/__tests__/RecurrenceInfo.json +55 -55
  21. package/__tests__/ResponseCallbackTest.ts +23 -23
  22. package/__tests__/TableRights.json +441 -441
  23. package/__tests__/WebapiTest.ts +264 -264
  24. package/__tests__/Webhook.json +16 -16
  25. package/__tests__/WebhookTest.ts +209 -209
  26. package/dist/cjs/AIAgent.d.ts +62 -0
  27. package/dist/cjs/AIAgent.d.ts.map +1 -1
  28. package/dist/cjs/AIAgent.js +149 -0
  29. package/dist/cjs/AIAgent.js.map +1 -1
  30. package/dist/cjs/Carriers.d.ts +640 -14
  31. package/dist/cjs/Carriers.d.ts.map +1 -1
  32. package/dist/cjs/Converters.d.ts +24 -0
  33. package/dist/cjs/Converters.d.ts.map +1 -1
  34. package/dist/cjs/Converters.js +388 -17
  35. package/dist/cjs/Converters.js.map +1 -1
  36. package/dist/cjs/DiagnosticsAgent.d.ts +38 -0
  37. package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
  38. package/dist/cjs/DiagnosticsAgent.js +91 -0
  39. package/dist/cjs/DiagnosticsAgent.js.map +1 -1
  40. package/dist/cjs/Enums.d.ts +77 -1
  41. package/dist/cjs/Enums.d.ts.map +1 -1
  42. package/dist/cjs/Enums.js +83 -4
  43. package/dist/cjs/Enums.js.map +1 -1
  44. package/dist/cjs/ListAgent.d.ts +71 -6
  45. package/dist/cjs/ListAgent.d.ts.map +1 -1
  46. package/dist/cjs/ListAgent.js +157 -0
  47. package/dist/cjs/ListAgent.js.map +1 -1
  48. package/dist/cjs/MarketingAgent.d.ts +68 -0
  49. package/dist/cjs/MarketingAgent.d.ts.map +1 -1
  50. package/dist/cjs/MarketingAgent.js +157 -0
  51. package/dist/cjs/MarketingAgent.js.map +1 -1
  52. package/dist/cjs/TicketAgent.d.ts +23 -0
  53. package/dist/cjs/TicketAgent.d.ts.map +1 -1
  54. package/dist/cjs/TicketAgent.js +65 -0
  55. package/dist/cjs/TicketAgent.js.map +1 -1
  56. package/dist/esm/AIAgent.d.ts +62 -0
  57. package/dist/esm/AIAgent.d.ts.map +1 -1
  58. package/dist/esm/AIAgent.js +150 -1
  59. package/dist/esm/AIAgent.js.map +1 -1
  60. package/dist/esm/Carriers.d.ts +640 -14
  61. package/dist/esm/Carriers.d.ts.map +1 -1
  62. package/dist/esm/Converters.d.ts +24 -0
  63. package/dist/esm/Converters.d.ts.map +1 -1
  64. package/dist/esm/Converters.js +346 -0
  65. package/dist/esm/Converters.js.map +1 -1
  66. package/dist/esm/DiagnosticsAgent.d.ts +38 -0
  67. package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
  68. package/dist/esm/DiagnosticsAgent.js +91 -0
  69. package/dist/esm/DiagnosticsAgent.js.map +1 -1
  70. package/dist/esm/Enums.d.ts +77 -1
  71. package/dist/esm/Enums.d.ts.map +1 -1
  72. package/dist/esm/Enums.js +79 -0
  73. package/dist/esm/Enums.js.map +1 -1
  74. package/dist/esm/ListAgent.d.ts +71 -6
  75. package/dist/esm/ListAgent.d.ts.map +1 -1
  76. package/dist/esm/ListAgent.js +157 -0
  77. package/dist/esm/ListAgent.js.map +1 -1
  78. package/dist/esm/MarketingAgent.d.ts +68 -0
  79. package/dist/esm/MarketingAgent.d.ts.map +1 -1
  80. package/dist/esm/MarketingAgent.js +157 -0
  81. package/dist/esm/MarketingAgent.js.map +1 -1
  82. package/dist/esm/TicketAgent.d.ts +23 -0
  83. package/dist/esm/TicketAgent.d.ts.map +1 -1
  84. package/dist/esm/TicketAgent.js +65 -0
  85. package/dist/esm/TicketAgent.js.map +1 -1
  86. package/examples-js/hello.js +12 -12
  87. package/examples-ts/hello.ts +8 -8
  88. package/package.json +93 -93
  89. package/scripts/postbuild.js +22 -22
  90. package/scripts/setVersion.js +44 -44
  91. package/src/AIAgent.ts +2239 -1992
  92. package/src/AppointmentAgent.ts +6263 -6263
  93. package/src/AppointmentRestApi.ts +225 -225
  94. package/src/ArchiveAgent.ts +1950 -1950
  95. package/src/AssociateAgent.ts +422 -422
  96. package/src/AxiosCacheHandler.ts +74 -74
  97. package/src/BLOBAgent.ts +2100 -2100
  98. package/src/Base64.ts +285 -285
  99. package/src/BatchAgent.ts +910 -910
  100. package/src/BulkUpdateAgent.ts +504 -504
  101. package/src/CRMScriptAgent.ts +1390 -1390
  102. package/src/Carriers.ts +53121 -52274
  103. package/src/ChatAgent.ts +1422 -1422
  104. package/src/ConfigurationAgent.ts +2228 -2228
  105. package/src/ContactAgent.ts +1756 -1756
  106. package/src/ContactRestApi.ts +237 -237
  107. package/src/Converters.ts +23496 -23090
  108. package/src/CustomerServiceAgent.ts +1799 -1799
  109. package/src/DashAgent.ts +1674 -1674
  110. package/src/DatabaseAgent.ts +120 -120
  111. package/src/DatabaseTableAgent.ts +534 -534
  112. package/src/Day_js.ts +41 -41
  113. package/src/DiagnosticsAgent.ts +1384 -1240
  114. package/src/DocumentAgent.ts +5079 -5079
  115. package/src/DocumentMigrationAgent.ts +524 -524
  116. package/src/DocumentRestApi.ts +259 -259
  117. package/src/EMailAgent.ts +5328 -5328
  118. package/src/Enums.ts +6998 -6916
  119. package/src/ErpSyncAgent.ts +2658 -2658
  120. package/src/FavouriteAgent.ts +720 -720
  121. package/src/FindAgent.ts +2330 -2330
  122. package/src/ForeignSystemAgent.ts +1710 -1710
  123. package/src/FreeTextAgent.ts +372 -372
  124. package/src/ImportAgent.ts +304 -304
  125. package/src/LicenseAgent.ts +1230 -1230
  126. package/src/ListAgent.ts +11451 -11237
  127. package/src/MDOAgent.ts +748 -748
  128. package/src/MarketingAgent.ts +1146 -890
  129. package/src/MessagingAgent.ts +384 -384
  130. package/src/NavigatorAgent.ts +140 -140
  131. package/src/NumberAllocationAgent.ts +296 -296
  132. package/src/PersonAgent.ts +3287 -3287
  133. package/src/PersonRestApi.ts +241 -241
  134. package/src/PhoneListAgent.ts +458 -458
  135. package/src/PocketAgent.ts +780 -780
  136. package/src/PreferenceAgent.ts +1900 -1900
  137. package/src/PreviewsAgent.ts +116 -116
  138. package/src/ProjectAgent.ts +2391 -2391
  139. package/src/ProjectRestApi.ts +239 -239
  140. package/src/QuoteAgent.ts +5159 -5159
  141. package/src/RelationAgent.ts +220 -220
  142. package/src/ReportAgent.ts +154 -154
  143. package/src/ResourceAgent.ts +358 -358
  144. package/src/SaintAgent.ts +601 -601
  145. package/src/SaleAgent.ts +2034 -2034
  146. package/src/SaleRestApi.ts +233 -233
  147. package/src/SelectionAgent.ts +3195 -3195
  148. package/src/SentryAgent.ts +462 -462
  149. package/src/SoApiConstants.ts +8 -8
  150. package/src/TargetsAgent.ts +1104 -1104
  151. package/src/TicketAgent.ts +3708 -3638
  152. package/src/TimeZoneAgent.ts +528 -528
  153. package/src/TooltipsAgent.ts +116 -116
  154. package/src/UserAgent.ts +4856 -4856
  155. package/src/UserDefinedFieldInfoAgent.ts +1764 -1764
  156. package/src/ViewStateAgent.ts +858 -858
  157. package/src/WebApi.ts +872 -872
  158. package/src/WebApiBase.ts +565 -565
  159. package/src/WebhookAgent.ts +388 -388
  160. package/src/WorkflowAgent.ts +1338 -1338
  161. package/tsconfig.esm.json +8 -8
  162. package/tsconfig.jest.json +8 -8
  163. package/tsconfig.json +34 -34
@@ -1,462 +1,462 @@
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/SentryAgent.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
- * Data and function right queries
28
- */
29
- export interface ISentryAgent {
30
- getNewTableRightAsync(request: carriers.Sentry_GetNewTableRightRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
31
- getNewTableRightAsync(tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
32
- getTableRightByOwnershipAsync(request: carriers.Sentry_GetTableRightByOwnershipRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
33
- getTableRightByOwnershipAsync(tableName: string, contactGroupId: number, contactAssociateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
34
- getFunctionRightsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
35
- hasFunctionRightAsync(request: carriers.Sentry_HasFunctionRightRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
36
- hasFunctionRightAsync(functionRight: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
37
- canCreateAppointmentInAssociateDiariesAsync(request: carriers.Sentry_CanCreateAppointmentInAssociateDiariesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
38
- canCreateAppointmentInAssociateDiariesAsync(associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
39
- canCreateAppointmentInEachAssociatesDiaryAsync(request: carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
40
- canCreateAppointmentInEachAssociatesDiaryAsync(associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
41
- canCreateAppointmentInAllDiariesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
42
- getTableRightByContactOwnershipAsync(request: carriers.Sentry_GetTableRightByContactOwnershipRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
43
- getTableRightByContactOwnershipAsync(tableName: string, contactId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
44
- } // interface ISentryAgent
45
-
46
-
47
-
48
-
49
- /**
50
- * Data and function right queries
51
- */
52
- export class SentryAgent extends base.WebApiBase implements ISentryAgent {
53
- constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
54
- constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
55
- constructor(baseUrl: string, resourceManager:any);
56
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
57
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
58
- constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
59
- constructor(options: base.WebApiOptions);
60
-
61
- constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
62
- langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
63
- langOrResourceOrRM?:string|base.ResourceParsing|any,
64
- cultureCode?: string,
65
- ) {
66
- const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
67
- options.basePath = "v1/Agents/Sentry/";
68
- super(options);
69
- }
70
-
71
-
72
-
73
- private async _getNewTableRightAsync(request: carriers.Sentry_GetNewTableRightRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TableRight > {
74
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
75
- base.WebApiBase.SetPending(options);
76
- return new Promise< carriers.TableRight >(async (resolve, reject) => {
77
- try {
78
- config.baseURL = this._options.baseUrl;
79
- const response = await this._axios.post("GetNewTableRight", request , config);
80
- base.WebApiBase.SetCompleted(options, response);
81
- const res : carriers.TableRight = converters.Create_TableRight_From( response.data );
82
- resolve(res);
83
- }
84
- catch( err ) {
85
- base.WebApiBase.HandleError(options, config, err);
86
- reject(err);
87
- }
88
- });
89
- }
90
-
91
-
92
-
93
- /**
94
- * Returns a TableRight for a new row based on tableName parameter.
95
- * @param request - TableName
96
- * @returns The TableRight
97
- */
98
- public async getNewTableRightAsync(request: carriers.Sentry_GetNewTableRightRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
99
-
100
- /**
101
- * Returns a TableRight for a new row based on tableName parameter.
102
- * @param tableName - Name of the table to get the TableRights from
103
- * @returns The TableRight
104
- */
105
- public async getNewTableRightAsync(tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
106
-
107
- public async getNewTableRightAsync(tableName:string|carriers.Sentry_GetNewTableRightRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight > {
108
- let _request : carriers.Sentry_GetNewTableRightRequest = null;
109
- let _options : base.WebApiRequestOptions = null;
110
- const first : any = tableName;
111
- if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' ) )
112
- {
113
- _request = tableName as carriers.Sentry_GetNewTableRightRequest;
114
- _options = webapi_options as base.WebApiRequestOptions;
115
- }
116
- else
117
- {
118
- _request = {
119
- tableName: tableName as string,
120
- };
121
- _options = webapi_options;
122
- }
123
- return this._getNewTableRightAsync( _request, _options );
124
- }
125
-
126
-
127
- private async _getTableRightByOwnershipAsync(request: carriers.Sentry_GetTableRightByOwnershipRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TableRight > {
128
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
129
- base.WebApiBase.SetPending(options);
130
- return new Promise< carriers.TableRight >(async (resolve, reject) => {
131
- try {
132
- config.baseURL = this._options.baseUrl;
133
- const response = await this._axios.post("GetTableRightByOwnership", request , config);
134
- base.WebApiBase.SetCompleted(options, response);
135
- const res : carriers.TableRight = converters.Create_TableRight_From( response.data );
136
- resolve(res);
137
- }
138
- catch( err ) {
139
- base.WebApiBase.HandleError(options, config, err);
140
- reject(err);
141
- }
142
- });
143
- }
144
-
145
-
146
-
147
- /**
148
- * Return the TableRight from the relationship between the current user and the given user and group.
149
- * @param request - TableName, ContactGroupId, ContactAssociateId
150
- * @returns The TableRight
151
- */
152
- public async getTableRightByOwnershipAsync(request: carriers.Sentry_GetTableRightByOwnershipRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
153
-
154
- /**
155
- * Return the TableRight from the relationship between the current user and the given user and group.
156
- * @param tableName - Name of the table to get the TableRights from.
157
- * @param contactGroupId - The user-group that the associate id is part of.
158
- * @param contactAssociateId - The associate id of the owner of the record
159
- * @returns The TableRight
160
- */
161
- public async getTableRightByOwnershipAsync(tableName: string, contactGroupId: number, contactAssociateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
162
-
163
- public async getTableRightByOwnershipAsync(tableName:string|carriers.Sentry_GetTableRightByOwnershipRequest, contactGroupId?:number|base.WebApiRequestOptions, contactAssociateId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight > {
164
- let _request : carriers.Sentry_GetTableRightByOwnershipRequest = null;
165
- let _options : base.WebApiRequestOptions = null;
166
- const first : any = tableName;
167
- if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' || typeof(first.contactGroupId)!='undefined' || typeof(first.contactAssociateId)!='undefined' ) )
168
- {
169
- _request = tableName as carriers.Sentry_GetTableRightByOwnershipRequest;
170
- _options = contactGroupId as base.WebApiRequestOptions;
171
- }
172
- else
173
- {
174
- _request = {
175
- tableName: tableName as string,
176
- contactGroupId: contactGroupId as number,
177
- contactAssociateId: contactAssociateId as number,
178
- };
179
- _options = webapi_options;
180
- }
181
- return this._getTableRightByOwnershipAsync( _request, _options );
182
- }
183
-
184
-
185
- private async _getFunctionRightsAsync( options?:base.WebApiRequestOptions) : Promise< string[] > {
186
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
187
- base.WebApiBase.SetPending(options);
188
- return new Promise< string[] >(async (resolve, reject) => {
189
- try {
190
- config.baseURL = this._options.baseUrl;
191
- const response = await this._axios.post("GetFunctionRights", undefined , config);
192
- base.WebApiBase.SetCompleted(options, response);
193
- const res : string[] = response.data as string[];
194
- resolve(res);
195
- }
196
- catch( err ) {
197
- base.WebApiBase.HandleError(options, config, err);
198
- reject(err);
199
- }
200
- });
201
- }
202
-
203
-
204
- /**
205
- * Get a string array of all functions rights for the role of the current associate.
206
- * @returns String array with the technical names of assigned function rights
207
- */
208
- public async getFunctionRightsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >
209
- {
210
- return this._getFunctionRightsAsync(webapi_options);
211
- }
212
-
213
-
214
- private async _hasFunctionRightAsync(request: carriers.Sentry_HasFunctionRightRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
215
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
216
- base.WebApiBase.SetPending(options);
217
- return new Promise< boolean >(async (resolve, reject) => {
218
- try {
219
- config.baseURL = this._options.baseUrl;
220
- const response = await this._axios.post("HasFunctionRight", request , config);
221
- base.WebApiBase.SetCompleted(options, response);
222
- const res : boolean = response.data as boolean;
223
- resolve(res);
224
- }
225
- catch( err ) {
226
- base.WebApiBase.HandleError(options, config, err);
227
- reject(err);
228
- }
229
- });
230
- }
231
-
232
-
233
-
234
- /**
235
- * Get a boolean value indicating if the current user has the functional right.
236
- * @param request - FunctionRight
237
- * @returns
238
- */
239
- public async hasFunctionRightAsync(request: carriers.Sentry_HasFunctionRightRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
240
-
241
- /**
242
- * Get a boolean value indicating if the current user has the functional right.
243
- * @param functionRight - Function right to check.
244
- * @returns
245
- */
246
- public async hasFunctionRightAsync(functionRight: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
247
-
248
- public async hasFunctionRightAsync(functionRight:string|carriers.Sentry_HasFunctionRightRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
249
- let _request : carriers.Sentry_HasFunctionRightRequest = null;
250
- let _options : base.WebApiRequestOptions = null;
251
- const first : any = functionRight;
252
- if( typeof( first ) === "object" && first && ( typeof(first.functionRight)!='undefined' ) )
253
- {
254
- _request = functionRight as carriers.Sentry_HasFunctionRightRequest;
255
- _options = webapi_options as base.WebApiRequestOptions;
256
- }
257
- else
258
- {
259
- _request = {
260
- functionRight: functionRight as string,
261
- };
262
- _options = webapi_options;
263
- }
264
- return this._hasFunctionRightAsync( _request, _options );
265
- }
266
-
267
-
268
- private async _canCreateAppointmentInAssociateDiariesAsync(request: carriers.Sentry_CanCreateAppointmentInAssociateDiariesRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
269
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
270
- base.WebApiBase.SetPending(options);
271
- return new Promise< boolean >(async (resolve, reject) => {
272
- try {
273
- config.baseURL = this._options.baseUrl;
274
- const response = await this._axios.post("CanCreateAppointmentInAssociateDiaries", request , config);
275
- base.WebApiBase.SetCompleted(options, response);
276
- const res : boolean = response.data as boolean;
277
- resolve(res);
278
- }
279
- catch( err ) {
280
- base.WebApiBase.HandleError(options, config, err);
281
- reject(err);
282
- }
283
- });
284
- }
285
-
286
-
287
-
288
- /**
289
- * CanCreateAppointmentInAssociateDiaries will check if the current associate can create appointments in diaries belonging to the associates listed in associateIds. CanCreateAppointmentInAssociateDiaries will only check against associates that are diary owners. If none of the associates listed in the associateIds parameter is a diary owner, the method will return true.
290
- * @param request - AssociateIds
291
- * @returns Returns true if the current associate can create appointments in the diary of all the other associates, otherwise false.
292
- */
293
- public async canCreateAppointmentInAssociateDiariesAsync(request: carriers.Sentry_CanCreateAppointmentInAssociateDiariesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
294
-
295
- /**
296
- * CanCreateAppointmentInAssociateDiaries will check if the current associate can create appointments in diaries belonging to the associates listed in associateIds. CanCreateAppointmentInAssociateDiaries will only check against associates that are diary owners. If none of the associates listed in the associateIds parameter is a diary owner, the method will return true.
297
- * @param associateIds - Array of associate ids to check.
298
- * @returns Returns true if the current associate can create appointments in the diary of all the other associates, otherwise false.
299
- */
300
- public async canCreateAppointmentInAssociateDiariesAsync(associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
301
-
302
- public async canCreateAppointmentInAssociateDiariesAsync(associateIds:number[]|carriers.Sentry_CanCreateAppointmentInAssociateDiariesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
303
- let _request : carriers.Sentry_CanCreateAppointmentInAssociateDiariesRequest = null;
304
- let _options : base.WebApiRequestOptions = null;
305
- const first : any = associateIds;
306
- if( typeof( first ) === "object" && first && ( typeof(first.associateIds)!='undefined' ) )
307
- {
308
- _request = associateIds as carriers.Sentry_CanCreateAppointmentInAssociateDiariesRequest;
309
- _options = webapi_options as base.WebApiRequestOptions;
310
- }
311
- else
312
- {
313
- _request = {
314
- associateIds: associateIds as number[],
315
- };
316
- _options = webapi_options;
317
- }
318
- return this._canCreateAppointmentInAssociateDiariesAsync( _request, _options );
319
- }
320
-
321
-
322
- private async _canCreateAppointmentInEachAssociatesDiaryAsync(request: carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest, options?:base.WebApiRequestOptions) : Promise< boolean[] > {
323
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
324
- base.WebApiBase.SetPending(options);
325
- return new Promise< boolean[] >(async (resolve, reject) => {
326
- try {
327
- config.baseURL = this._options.baseUrl;
328
- const response = await this._axios.post("CanCreateAppointmentInEachAssociatesDiary", request , config);
329
- base.WebApiBase.SetCompleted(options, response);
330
- const res : boolean[] = response.data as boolean[];
331
- resolve(res);
332
- }
333
- catch( err ) {
334
- base.WebApiBase.HandleError(options, config, err);
335
- reject(err);
336
- }
337
- });
338
- }
339
-
340
-
341
-
342
- /**
343
- * CanCreateAppointmentInEachAssociateDiary will check if the current associate can create appointments in diaries belonging to the associates listed in associateIds. CanCreateAppointmentInEachAssociateDiary will only check against associates that are diary owners. If none of the associates listed in the associateIds parameter is a diary owner, the method will return true.
344
- * @param request - AssociateIds
345
- * @returns Returns true if for each given associate if the current associate can create appointments in that diary, otherwise false.
346
- */
347
- public async canCreateAppointmentInEachAssociatesDiaryAsync(request: carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
348
-
349
- /**
350
- * CanCreateAppointmentInEachAssociateDiary will check if the current associate can create appointments in diaries belonging to the associates listed in associateIds. CanCreateAppointmentInEachAssociateDiary will only check against associates that are diary owners. If none of the associates listed in the associateIds parameter is a diary owner, the method will return true.
351
- * @param associateIds - Array of associate ids to check.
352
- * @returns Returns true if for each given associate if the current associate can create appointments in that diary, otherwise false.
353
- */
354
- public async canCreateAppointmentInEachAssociatesDiaryAsync(associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
355
-
356
- public async canCreateAppointmentInEachAssociatesDiaryAsync(associateIds:number[]|carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] > {
357
- let _request : carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest = null;
358
- let _options : base.WebApiRequestOptions = null;
359
- const first : any = associateIds;
360
- if( typeof( first ) === "object" && first && ( typeof(first.associateIds)!='undefined' ) )
361
- {
362
- _request = associateIds as carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest;
363
- _options = webapi_options as base.WebApiRequestOptions;
364
- }
365
- else
366
- {
367
- _request = {
368
- associateIds: associateIds as number[],
369
- };
370
- _options = webapi_options;
371
- }
372
- return this._canCreateAppointmentInEachAssociatesDiaryAsync( _request, _options );
373
- }
374
-
375
-
376
- private async _canCreateAppointmentInAllDiariesAsync( options?:base.WebApiRequestOptions) : Promise< boolean > {
377
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
378
- base.WebApiBase.SetPending(options);
379
- return new Promise< boolean >(async (resolve, reject) => {
380
- try {
381
- config.baseURL = this._options.baseUrl;
382
- const response = await this._axios.post("CanCreateAppointmentInAllDiaries", undefined , config);
383
- base.WebApiBase.SetCompleted(options, response);
384
- const res : boolean = response.data as boolean;
385
- resolve(res);
386
- }
387
- catch( err ) {
388
- base.WebApiBase.HandleError(options, config, err);
389
- reject(err);
390
- }
391
- });
392
- }
393
-
394
-
395
- /**
396
- * CanCreateAppointmentInAllDiaries will check if the current associate can create appointments in diaries belonging all other associates. CanCreateAppointmentInAssociateDiaries will only check against associates that are diary owners.
397
- * @returns Returns true if the current associate can create appointments in the diary of all the other associates, otherwise false.
398
- */
399
- public async canCreateAppointmentInAllDiariesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >
400
- {
401
- return this._canCreateAppointmentInAllDiariesAsync(webapi_options);
402
- }
403
-
404
-
405
- private async _getTableRightByContactOwnershipAsync(request: carriers.Sentry_GetTableRightByContactOwnershipRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TableRight > {
406
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
407
- base.WebApiBase.SetPending(options);
408
- return new Promise< carriers.TableRight >(async (resolve, reject) => {
409
- try {
410
- config.baseURL = this._options.baseUrl;
411
- const response = await this._axios.post("GetTableRightByContactOwnership", request , config);
412
- base.WebApiBase.SetCompleted(options, response);
413
- const res : carriers.TableRight = converters.Create_TableRight_From( response.data );
414
- resolve(res);
415
- }
416
- catch( err ) {
417
- base.WebApiBase.HandleError(options, config, err);
418
- reject(err);
419
- }
420
- });
421
- }
422
-
423
-
424
-
425
- /**
426
- * Return the TableRight from the relationship between the current user and the given user and group.
427
- * @param request - TableName, ContactId
428
- * @returns The TableRight
429
- */
430
- public async getTableRightByContactOwnershipAsync(request: carriers.Sentry_GetTableRightByContactOwnershipRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
431
-
432
- /**
433
- * Return the TableRight from the relationship between the current user and the given user and group.
434
- * @param tableName - Name of the table to get the TableRights from.
435
- * @param contactId - The owner contact.
436
- * @returns The TableRight
437
- */
438
- public async getTableRightByContactOwnershipAsync(tableName: string, contactId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
439
-
440
- public async getTableRightByContactOwnershipAsync(tableName:string|carriers.Sentry_GetTableRightByContactOwnershipRequest, contactId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight > {
441
- let _request : carriers.Sentry_GetTableRightByContactOwnershipRequest = null;
442
- let _options : base.WebApiRequestOptions = null;
443
- const first : any = tableName;
444
- if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' || typeof(first.contactId)!='undefined' ) )
445
- {
446
- _request = tableName as carriers.Sentry_GetTableRightByContactOwnershipRequest;
447
- _options = contactId as base.WebApiRequestOptions;
448
- }
449
- else
450
- {
451
- _request = {
452
- tableName: tableName as string,
453
- contactId: contactId as number,
454
- };
455
- _options = webapi_options;
456
- }
457
- return this._getTableRightByContactOwnershipAsync( _request, _options );
458
- }
459
-
460
- } // class v1SentryAgentController
461
-
462
-
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/SentryAgent.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
+ * Data and function right queries
28
+ */
29
+ export interface ISentryAgent {
30
+ getNewTableRightAsync(request: carriers.Sentry_GetNewTableRightRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
31
+ getNewTableRightAsync(tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
32
+ getTableRightByOwnershipAsync(request: carriers.Sentry_GetTableRightByOwnershipRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
33
+ getTableRightByOwnershipAsync(tableName: string, contactGroupId: number, contactAssociateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
34
+ getFunctionRightsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
35
+ hasFunctionRightAsync(request: carriers.Sentry_HasFunctionRightRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
36
+ hasFunctionRightAsync(functionRight: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
37
+ canCreateAppointmentInAssociateDiariesAsync(request: carriers.Sentry_CanCreateAppointmentInAssociateDiariesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
38
+ canCreateAppointmentInAssociateDiariesAsync(associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
39
+ canCreateAppointmentInEachAssociatesDiaryAsync(request: carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
40
+ canCreateAppointmentInEachAssociatesDiaryAsync(associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
41
+ canCreateAppointmentInAllDiariesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
42
+ getTableRightByContactOwnershipAsync(request: carriers.Sentry_GetTableRightByContactOwnershipRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
43
+ getTableRightByContactOwnershipAsync(tableName: string, contactId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
44
+ } // interface ISentryAgent
45
+
46
+
47
+
48
+
49
+ /**
50
+ * Data and function right queries
51
+ */
52
+ export class SentryAgent extends base.WebApiBase implements ISentryAgent {
53
+ constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
54
+ constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
55
+ constructor(baseUrl: string, resourceManager:any);
56
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
57
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
58
+ constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
59
+ constructor(options: base.WebApiOptions);
60
+
61
+ constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
62
+ langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
63
+ langOrResourceOrRM?:string|base.ResourceParsing|any,
64
+ cultureCode?: string,
65
+ ) {
66
+ const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
67
+ options.basePath = "v1/Agents/Sentry/";
68
+ super(options);
69
+ }
70
+
71
+
72
+
73
+ private async _getNewTableRightAsync(request: carriers.Sentry_GetNewTableRightRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TableRight > {
74
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
75
+ base.WebApiBase.SetPending(options);
76
+ return new Promise< carriers.TableRight >(async (resolve, reject) => {
77
+ try {
78
+ config.baseURL = this._options.baseUrl;
79
+ const response = await this._axios.post("GetNewTableRight", request , config);
80
+ base.WebApiBase.SetCompleted(options, response);
81
+ const res : carriers.TableRight = converters.Create_TableRight_From( response.data );
82
+ resolve(res);
83
+ }
84
+ catch( err ) {
85
+ base.WebApiBase.HandleError(options, config, err);
86
+ reject(err);
87
+ }
88
+ });
89
+ }
90
+
91
+
92
+
93
+ /**
94
+ * Returns a TableRight for a new row based on tableName parameter.
95
+ * @param request - TableName
96
+ * @returns The TableRight
97
+ */
98
+ public async getNewTableRightAsync(request: carriers.Sentry_GetNewTableRightRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
99
+
100
+ /**
101
+ * Returns a TableRight for a new row based on tableName parameter.
102
+ * @param tableName - Name of the table to get the TableRights from
103
+ * @returns The TableRight
104
+ */
105
+ public async getNewTableRightAsync(tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
106
+
107
+ public async getNewTableRightAsync(tableName:string|carriers.Sentry_GetNewTableRightRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight > {
108
+ let _request : carriers.Sentry_GetNewTableRightRequest = null;
109
+ let _options : base.WebApiRequestOptions = null;
110
+ const first : any = tableName;
111
+ if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' ) )
112
+ {
113
+ _request = tableName as carriers.Sentry_GetNewTableRightRequest;
114
+ _options = webapi_options as base.WebApiRequestOptions;
115
+ }
116
+ else
117
+ {
118
+ _request = {
119
+ tableName: tableName as string,
120
+ };
121
+ _options = webapi_options;
122
+ }
123
+ return this._getNewTableRightAsync( _request, _options );
124
+ }
125
+
126
+
127
+ private async _getTableRightByOwnershipAsync(request: carriers.Sentry_GetTableRightByOwnershipRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TableRight > {
128
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
129
+ base.WebApiBase.SetPending(options);
130
+ return new Promise< carriers.TableRight >(async (resolve, reject) => {
131
+ try {
132
+ config.baseURL = this._options.baseUrl;
133
+ const response = await this._axios.post("GetTableRightByOwnership", request , config);
134
+ base.WebApiBase.SetCompleted(options, response);
135
+ const res : carriers.TableRight = converters.Create_TableRight_From( response.data );
136
+ resolve(res);
137
+ }
138
+ catch( err ) {
139
+ base.WebApiBase.HandleError(options, config, err);
140
+ reject(err);
141
+ }
142
+ });
143
+ }
144
+
145
+
146
+
147
+ /**
148
+ * Return the TableRight from the relationship between the current user and the given user and group.
149
+ * @param request - TableName, ContactGroupId, ContactAssociateId
150
+ * @returns The TableRight
151
+ */
152
+ public async getTableRightByOwnershipAsync(request: carriers.Sentry_GetTableRightByOwnershipRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
153
+
154
+ /**
155
+ * Return the TableRight from the relationship between the current user and the given user and group.
156
+ * @param tableName - Name of the table to get the TableRights from.
157
+ * @param contactGroupId - The user-group that the associate id is part of.
158
+ * @param contactAssociateId - The associate id of the owner of the record
159
+ * @returns The TableRight
160
+ */
161
+ public async getTableRightByOwnershipAsync(tableName: string, contactGroupId: number, contactAssociateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
162
+
163
+ public async getTableRightByOwnershipAsync(tableName:string|carriers.Sentry_GetTableRightByOwnershipRequest, contactGroupId?:number|base.WebApiRequestOptions, contactAssociateId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight > {
164
+ let _request : carriers.Sentry_GetTableRightByOwnershipRequest = null;
165
+ let _options : base.WebApiRequestOptions = null;
166
+ const first : any = tableName;
167
+ if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' || typeof(first.contactGroupId)!='undefined' || typeof(first.contactAssociateId)!='undefined' ) )
168
+ {
169
+ _request = tableName as carriers.Sentry_GetTableRightByOwnershipRequest;
170
+ _options = contactGroupId as base.WebApiRequestOptions;
171
+ }
172
+ else
173
+ {
174
+ _request = {
175
+ tableName: tableName as string,
176
+ contactGroupId: contactGroupId as number,
177
+ contactAssociateId: contactAssociateId as number,
178
+ };
179
+ _options = webapi_options;
180
+ }
181
+ return this._getTableRightByOwnershipAsync( _request, _options );
182
+ }
183
+
184
+
185
+ private async _getFunctionRightsAsync( options?:base.WebApiRequestOptions) : Promise< string[] > {
186
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
187
+ base.WebApiBase.SetPending(options);
188
+ return new Promise< string[] >(async (resolve, reject) => {
189
+ try {
190
+ config.baseURL = this._options.baseUrl;
191
+ const response = await this._axios.post("GetFunctionRights", undefined , config);
192
+ base.WebApiBase.SetCompleted(options, response);
193
+ const res : string[] = response.data as string[];
194
+ resolve(res);
195
+ }
196
+ catch( err ) {
197
+ base.WebApiBase.HandleError(options, config, err);
198
+ reject(err);
199
+ }
200
+ });
201
+ }
202
+
203
+
204
+ /**
205
+ * Get a string array of all functions rights for the role of the current associate.
206
+ * @returns String array with the technical names of assigned function rights
207
+ */
208
+ public async getFunctionRightsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >
209
+ {
210
+ return this._getFunctionRightsAsync(webapi_options);
211
+ }
212
+
213
+
214
+ private async _hasFunctionRightAsync(request: carriers.Sentry_HasFunctionRightRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
215
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
216
+ base.WebApiBase.SetPending(options);
217
+ return new Promise< boolean >(async (resolve, reject) => {
218
+ try {
219
+ config.baseURL = this._options.baseUrl;
220
+ const response = await this._axios.post("HasFunctionRight", request , config);
221
+ base.WebApiBase.SetCompleted(options, response);
222
+ const res : boolean = response.data as boolean;
223
+ resolve(res);
224
+ }
225
+ catch( err ) {
226
+ base.WebApiBase.HandleError(options, config, err);
227
+ reject(err);
228
+ }
229
+ });
230
+ }
231
+
232
+
233
+
234
+ /**
235
+ * Get a boolean value indicating if the current user has the functional right.
236
+ * @param request - FunctionRight
237
+ * @returns
238
+ */
239
+ public async hasFunctionRightAsync(request: carriers.Sentry_HasFunctionRightRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
240
+
241
+ /**
242
+ * Get a boolean value indicating if the current user has the functional right.
243
+ * @param functionRight - Function right to check.
244
+ * @returns
245
+ */
246
+ public async hasFunctionRightAsync(functionRight: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
247
+
248
+ public async hasFunctionRightAsync(functionRight:string|carriers.Sentry_HasFunctionRightRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
249
+ let _request : carriers.Sentry_HasFunctionRightRequest = null;
250
+ let _options : base.WebApiRequestOptions = null;
251
+ const first : any = functionRight;
252
+ if( typeof( first ) === "object" && first && ( typeof(first.functionRight)!='undefined' ) )
253
+ {
254
+ _request = functionRight as carriers.Sentry_HasFunctionRightRequest;
255
+ _options = webapi_options as base.WebApiRequestOptions;
256
+ }
257
+ else
258
+ {
259
+ _request = {
260
+ functionRight: functionRight as string,
261
+ };
262
+ _options = webapi_options;
263
+ }
264
+ return this._hasFunctionRightAsync( _request, _options );
265
+ }
266
+
267
+
268
+ private async _canCreateAppointmentInAssociateDiariesAsync(request: carriers.Sentry_CanCreateAppointmentInAssociateDiariesRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
269
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
270
+ base.WebApiBase.SetPending(options);
271
+ return new Promise< boolean >(async (resolve, reject) => {
272
+ try {
273
+ config.baseURL = this._options.baseUrl;
274
+ const response = await this._axios.post("CanCreateAppointmentInAssociateDiaries", request , config);
275
+ base.WebApiBase.SetCompleted(options, response);
276
+ const res : boolean = response.data as boolean;
277
+ resolve(res);
278
+ }
279
+ catch( err ) {
280
+ base.WebApiBase.HandleError(options, config, err);
281
+ reject(err);
282
+ }
283
+ });
284
+ }
285
+
286
+
287
+
288
+ /**
289
+ * CanCreateAppointmentInAssociateDiaries will check if the current associate can create appointments in diaries belonging to the associates listed in associateIds. CanCreateAppointmentInAssociateDiaries will only check against associates that are diary owners. If none of the associates listed in the associateIds parameter is a diary owner, the method will return true.
290
+ * @param request - AssociateIds
291
+ * @returns Returns true if the current associate can create appointments in the diary of all the other associates, otherwise false.
292
+ */
293
+ public async canCreateAppointmentInAssociateDiariesAsync(request: carriers.Sentry_CanCreateAppointmentInAssociateDiariesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
294
+
295
+ /**
296
+ * CanCreateAppointmentInAssociateDiaries will check if the current associate can create appointments in diaries belonging to the associates listed in associateIds. CanCreateAppointmentInAssociateDiaries will only check against associates that are diary owners. If none of the associates listed in the associateIds parameter is a diary owner, the method will return true.
297
+ * @param associateIds - Array of associate ids to check.
298
+ * @returns Returns true if the current associate can create appointments in the diary of all the other associates, otherwise false.
299
+ */
300
+ public async canCreateAppointmentInAssociateDiariesAsync(associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
301
+
302
+ public async canCreateAppointmentInAssociateDiariesAsync(associateIds:number[]|carriers.Sentry_CanCreateAppointmentInAssociateDiariesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
303
+ let _request : carriers.Sentry_CanCreateAppointmentInAssociateDiariesRequest = null;
304
+ let _options : base.WebApiRequestOptions = null;
305
+ const first : any = associateIds;
306
+ if( typeof( first ) === "object" && first && ( typeof(first.associateIds)!='undefined' ) )
307
+ {
308
+ _request = associateIds as carriers.Sentry_CanCreateAppointmentInAssociateDiariesRequest;
309
+ _options = webapi_options as base.WebApiRequestOptions;
310
+ }
311
+ else
312
+ {
313
+ _request = {
314
+ associateIds: associateIds as number[],
315
+ };
316
+ _options = webapi_options;
317
+ }
318
+ return this._canCreateAppointmentInAssociateDiariesAsync( _request, _options );
319
+ }
320
+
321
+
322
+ private async _canCreateAppointmentInEachAssociatesDiaryAsync(request: carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest, options?:base.WebApiRequestOptions) : Promise< boolean[] > {
323
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
324
+ base.WebApiBase.SetPending(options);
325
+ return new Promise< boolean[] >(async (resolve, reject) => {
326
+ try {
327
+ config.baseURL = this._options.baseUrl;
328
+ const response = await this._axios.post("CanCreateAppointmentInEachAssociatesDiary", request , config);
329
+ base.WebApiBase.SetCompleted(options, response);
330
+ const res : boolean[] = response.data as boolean[];
331
+ resolve(res);
332
+ }
333
+ catch( err ) {
334
+ base.WebApiBase.HandleError(options, config, err);
335
+ reject(err);
336
+ }
337
+ });
338
+ }
339
+
340
+
341
+
342
+ /**
343
+ * CanCreateAppointmentInEachAssociateDiary will check if the current associate can create appointments in diaries belonging to the associates listed in associateIds. CanCreateAppointmentInEachAssociateDiary will only check against associates that are diary owners. If none of the associates listed in the associateIds parameter is a diary owner, the method will return true.
344
+ * @param request - AssociateIds
345
+ * @returns Returns true if for each given associate if the current associate can create appointments in that diary, otherwise false.
346
+ */
347
+ public async canCreateAppointmentInEachAssociatesDiaryAsync(request: carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
348
+
349
+ /**
350
+ * CanCreateAppointmentInEachAssociateDiary will check if the current associate can create appointments in diaries belonging to the associates listed in associateIds. CanCreateAppointmentInEachAssociateDiary will only check against associates that are diary owners. If none of the associates listed in the associateIds parameter is a diary owner, the method will return true.
351
+ * @param associateIds - Array of associate ids to check.
352
+ * @returns Returns true if for each given associate if the current associate can create appointments in that diary, otherwise false.
353
+ */
354
+ public async canCreateAppointmentInEachAssociatesDiaryAsync(associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
355
+
356
+ public async canCreateAppointmentInEachAssociatesDiaryAsync(associateIds:number[]|carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] > {
357
+ let _request : carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest = null;
358
+ let _options : base.WebApiRequestOptions = null;
359
+ const first : any = associateIds;
360
+ if( typeof( first ) === "object" && first && ( typeof(first.associateIds)!='undefined' ) )
361
+ {
362
+ _request = associateIds as carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest;
363
+ _options = webapi_options as base.WebApiRequestOptions;
364
+ }
365
+ else
366
+ {
367
+ _request = {
368
+ associateIds: associateIds as number[],
369
+ };
370
+ _options = webapi_options;
371
+ }
372
+ return this._canCreateAppointmentInEachAssociatesDiaryAsync( _request, _options );
373
+ }
374
+
375
+
376
+ private async _canCreateAppointmentInAllDiariesAsync( options?:base.WebApiRequestOptions) : Promise< boolean > {
377
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
378
+ base.WebApiBase.SetPending(options);
379
+ return new Promise< boolean >(async (resolve, reject) => {
380
+ try {
381
+ config.baseURL = this._options.baseUrl;
382
+ const response = await this._axios.post("CanCreateAppointmentInAllDiaries", undefined , config);
383
+ base.WebApiBase.SetCompleted(options, response);
384
+ const res : boolean = response.data as boolean;
385
+ resolve(res);
386
+ }
387
+ catch( err ) {
388
+ base.WebApiBase.HandleError(options, config, err);
389
+ reject(err);
390
+ }
391
+ });
392
+ }
393
+
394
+
395
+ /**
396
+ * CanCreateAppointmentInAllDiaries will check if the current associate can create appointments in diaries belonging all other associates. CanCreateAppointmentInAssociateDiaries will only check against associates that are diary owners.
397
+ * @returns Returns true if the current associate can create appointments in the diary of all the other associates, otherwise false.
398
+ */
399
+ public async canCreateAppointmentInAllDiariesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >
400
+ {
401
+ return this._canCreateAppointmentInAllDiariesAsync(webapi_options);
402
+ }
403
+
404
+
405
+ private async _getTableRightByContactOwnershipAsync(request: carriers.Sentry_GetTableRightByContactOwnershipRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TableRight > {
406
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
407
+ base.WebApiBase.SetPending(options);
408
+ return new Promise< carriers.TableRight >(async (resolve, reject) => {
409
+ try {
410
+ config.baseURL = this._options.baseUrl;
411
+ const response = await this._axios.post("GetTableRightByContactOwnership", request , config);
412
+ base.WebApiBase.SetCompleted(options, response);
413
+ const res : carriers.TableRight = converters.Create_TableRight_From( response.data );
414
+ resolve(res);
415
+ }
416
+ catch( err ) {
417
+ base.WebApiBase.HandleError(options, config, err);
418
+ reject(err);
419
+ }
420
+ });
421
+ }
422
+
423
+
424
+
425
+ /**
426
+ * Return the TableRight from the relationship between the current user and the given user and group.
427
+ * @param request - TableName, ContactId
428
+ * @returns The TableRight
429
+ */
430
+ public async getTableRightByContactOwnershipAsync(request: carriers.Sentry_GetTableRightByContactOwnershipRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
431
+
432
+ /**
433
+ * Return the TableRight from the relationship between the current user and the given user and group.
434
+ * @param tableName - Name of the table to get the TableRights from.
435
+ * @param contactId - The owner contact.
436
+ * @returns The TableRight
437
+ */
438
+ public async getTableRightByContactOwnershipAsync(tableName: string, contactId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
439
+
440
+ public async getTableRightByContactOwnershipAsync(tableName:string|carriers.Sentry_GetTableRightByContactOwnershipRequest, contactId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight > {
441
+ let _request : carriers.Sentry_GetTableRightByContactOwnershipRequest = null;
442
+ let _options : base.WebApiRequestOptions = null;
443
+ const first : any = tableName;
444
+ if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' || typeof(first.contactId)!='undefined' ) )
445
+ {
446
+ _request = tableName as carriers.Sentry_GetTableRightByContactOwnershipRequest;
447
+ _options = contactId as base.WebApiRequestOptions;
448
+ }
449
+ else
450
+ {
451
+ _request = {
452
+ tableName: tableName as string,
453
+ contactId: contactId as number,
454
+ };
455
+ _options = webapi_options;
456
+ }
457
+ return this._getTableRightByContactOwnershipAsync( _request, _options );
458
+ }
459
+
460
+ } // class v1SentryAgentController
461
+
462
+