@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,237 +1,237 @@
1
- // <auto-generated>
2
- // SuperOffice Code Generator
3
- // modelling\templates\servicestswebapi\tswebapirestentities.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: ContactRestApi.ts
13
- //
14
- //----------------------------------------------------------------------------
15
- // Copyright (C) SuperOffice AS
16
- //----------------------------------------------------------------------------
17
-
18
- import { AxiosRequestConfig, AxiosError } 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
- * The Contact Service. The service implements all services working with the Contact object
28
- * Contact (company) data services.
29
- *
30
- * `api/v1/Contact`
31
- */
32
- export interface IContactRestApi {
33
-
34
- getDefaultAsync(options?:base.WebApiGetRequestOptions): Promise< carriers.ContactEntity >;
35
- postAsync(entity: carriers.ContactEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ContactEntity >;
36
- putByIdAsync(id:number, entity: carriers.ContactEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ContactEntity >;
37
- patchByIdAsync(id:number, entity: base.WebApiPatchOperation[] | carriers.ContactEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ContactEntity >;
38
- deleteByIdAsync(ContactEntityId: number, options?:base.WebApiPutRequestOptions) : Promise<void>;
39
- getByIdAsync(ContactEntityId: number, options?:base.WebApiGetRequestOptions) : Promise< carriers.ContactEntity >;
40
- // GET DuplicateRules Async( ) = getDuplicateRules
41
-
42
- // PUT DuplicateRules Async( rules ) = setDuplicateRulesStatus
43
-
44
- // POST {sourceContactId}/MergeTo/{destinationContactId} Async( sourceContactId destinationContactId mergeIdenticalPersons replaceEmptyFieldsOnDestination ) = merge
45
-
46
- // GET Duplicates/{name} Async( name department ) = getNameDepartmentDuplicates
47
-
48
- // GET DuplicateDomains/{domain} Async( domain ) = getDomainDuplicates
49
-
50
- // GET {contactId}/Summary Async( contactId limit ) = getContactSummary
51
-
52
- // POST Validate Async( contactEntity ) = validateContactEntity
53
-
54
-
55
- } // interface IContactRestApi
56
-
57
-
58
-
59
-
60
- /**
61
- * The Contact Service. The service implements all services working with the Contact object
62
- * Contact (company) data services.
63
- *
64
- * `api/v1/Contact`
65
- */
66
- export class ContactRestApi extends base.WebApiBase implements IContactRestApi {
67
- constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
68
- constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
69
- constructor(baseUrl: string, resourceManager:any);
70
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
71
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
72
- constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
73
- constructor(options: base.WebApiOptions);
74
-
75
- constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
76
- langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
77
- langOrResourceOrRM?:string|base.ResourceParsing|any,
78
- cultureCode?: string,
79
- ) {
80
- const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
81
- options.basePath = "v1/Contact/";
82
- super(options);
83
- }
84
-
85
-
86
- /**
87
- * `GET /api/v1/Contact/default`
88
- * Set default values into a new ContactEntity.
89
- * NetServer calculates default values on the entity, which is required when creating/storing a new instance
90
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
91
- * @returns A blank entity.
92
- */
93
- public async getDefaultAsync(options?:base.WebApiGetRequestOptions): Promise< carriers.ContactEntity > {
94
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
95
- base.WebApiBase.SetPending(options);
96
- return new Promise< carriers.ContactEntity >(async (resolve, reject) => {
97
- try {
98
- const response = await this._axios.get("default", config);
99
- base.WebApiBase.SetCompleted(options, response);
100
- const res : carriers.ContactEntity = converters.Create_ContactEntity_From( response.data );
101
- resolve(res);
102
- }
103
- catch( err ) {
104
- base.WebApiBase.HandleError(options, config, err);
105
- reject(err);
106
- }
107
- });
108
- }
109
-
110
-
111
- /**
112
- * `POST /api/v1/Contact/`
113
- * Creates a new ContactEntity
114
- * @param newContact - The ContactEntity to be saved.
115
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
116
- * @returns New ContactEntity
117
- */
118
- public async postAsync(newContact: carriers.ContactEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ContactEntity > {
119
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
120
- base.WebApiBase.SetPending(options);
121
- return new Promise< carriers.ContactEntity >(async (resolve, reject) => {
122
- try {
123
- const response = await this._axios.post("", newContact, config);
124
- base.WebApiBase.SetCompleted(options, response);
125
- const res : carriers.ContactEntity = converters.Create_ContactEntity_From( response.data );
126
- resolve(res);
127
- }
128
- catch( err ) {
129
- base.WebApiBase.HandleError(options, config, err);
130
- reject(err);
131
- }
132
- });
133
- }
134
-
135
-
136
- /**
137
- * `PUT /api/v1/Contact/123`
138
- * Replace the existing ContactEntity
139
- * @param contact - The ContactEntity to be saved.
140
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
141
- * @returns The updated ContactEntity
142
- */
143
- public async putByIdAsync(id:number, contact: carriers.ContactEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ContactEntity > {
144
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
145
- base.WebApiBase.SetPending(options);
146
- return new Promise< carriers.ContactEntity >(async (resolve, reject) => {
147
- try {
148
- const response = await this._axios.put(id.toString(), contact, config);
149
- base.WebApiBase.SetCompleted(options, response);
150
- let res : carriers.ContactEntity = null;
151
- if( response.status != 304 )
152
- res = converters.Create_ContactEntity_From( response.data );
153
- resolve(res);
154
- }
155
- catch( err ) {
156
- base.WebApiBase.HandleError(options, config, err);
157
- reject(err);
158
- }
159
- });
160
- }
161
-
162
- /**
163
- * `PATCH /api/v1/Contact/123`
164
- * Updates an existing ContactEntity
165
- * @param contact - The partial ContactEntity containing updated values, or an array of RFC6902 PATCH operations.
166
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
167
- * @returns The updated ContactEntity
168
- */
169
- public async patchByIdAsync(id:number, contact: base.WebApiPatchOperation[] | carriers.ContactEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ContactEntity > {
170
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
171
- base.WebApiBase.SetPending(options);
172
- return new Promise< carriers.ContactEntity >(async (resolve, reject) => {
173
- try {
174
- const response = await this._axios.patch(id.toString(), contact, config);
175
- base.WebApiBase.SetCompleted(options, response);
176
- let res : carriers.ContactEntity = null;
177
- if( response.status != 304 )
178
- res = converters.Create_ContactEntity_From( response.data );
179
- resolve(res);
180
- }
181
- catch( err ) {
182
- base.WebApiBase.HandleError(options, config, err);
183
- reject(err);
184
- }
185
- });
186
- }
187
- /**
188
- * `DELETE /api/v1/Contact/123`
189
- * Deletes the ContactEntity
190
- * @param contactId - The id of the ContactEntity to be deleted.
191
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
192
- */
193
- public async deleteByIdAsync(contactId: number, options?:base.WebApiPutRequestOptions) : Promise<void> {
194
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
195
- base.WebApiBase.SetPending(options);
196
- return new Promise< void >(async (resolve, reject) => {
197
- try {
198
- const response = await this._axios.delete( contactId.toString(), config );
199
- base.WebApiBase.SetCompleted(options, response);
200
- const res = response.data;
201
- resolve(res);
202
- }
203
- catch( err ) {
204
- base.WebApiBase.HandleError(options, config, err);
205
- reject(err);
206
- }
207
- });
208
- }
209
- /**
210
- * `GET /api/v1/Contact/123`
211
- * Get an existing ContactEntity
212
- * @param contactId - The ContactEntity to be get.
213
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
214
- * @returns The ContactEntity
215
- */
216
- public async getByIdAsync( contactId: number, options?:base.WebApiGetRequestOptions) : Promise< carriers.ContactEntity > {
217
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
218
- base.WebApiBase.SetPending(options);
219
- return new Promise< carriers.ContactEntity >(async (resolve, reject) => {
220
- try {
221
- const response = await this._axios.get( contactId.toString(), config);
222
- base.WebApiBase.SetCompleted(options, response);
223
- let res : carriers.ContactEntity = null;
224
- if( response.status != 304 )
225
- res = converters.Create_ContactEntity_From( response.data );
226
- resolve(res);
227
- }
228
- catch( err ) {
229
- base.WebApiBase.HandleError(options, config, err);
230
- reject(err);
231
- }
232
- });
233
- }
234
-
235
-
236
- } // class ContactRestApi
237
-
1
+ // <auto-generated>
2
+ // SuperOffice Code Generator
3
+ // modelling\templates\servicestswebapi\tswebapirestentities.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: ContactRestApi.ts
13
+ //
14
+ //----------------------------------------------------------------------------
15
+ // Copyright (C) SuperOffice AS
16
+ //----------------------------------------------------------------------------
17
+
18
+ import { AxiosRequestConfig, AxiosError } 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
+ * The Contact Service. The service implements all services working with the Contact object
28
+ * Contact (company) data services.
29
+ *
30
+ * `api/v1/Contact`
31
+ */
32
+ export interface IContactRestApi {
33
+
34
+ getDefaultAsync(options?:base.WebApiGetRequestOptions): Promise< carriers.ContactEntity >;
35
+ postAsync(entity: carriers.ContactEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ContactEntity >;
36
+ putByIdAsync(id:number, entity: carriers.ContactEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ContactEntity >;
37
+ patchByIdAsync(id:number, entity: base.WebApiPatchOperation[] | carriers.ContactEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ContactEntity >;
38
+ deleteByIdAsync(ContactEntityId: number, options?:base.WebApiPutRequestOptions) : Promise<void>;
39
+ getByIdAsync(ContactEntityId: number, options?:base.WebApiGetRequestOptions) : Promise< carriers.ContactEntity >;
40
+ // GET DuplicateRules Async( ) = getDuplicateRules
41
+
42
+ // PUT DuplicateRules Async( rules ) = setDuplicateRulesStatus
43
+
44
+ // POST {sourceContactId}/MergeTo/{destinationContactId} Async( sourceContactId destinationContactId mergeIdenticalPersons replaceEmptyFieldsOnDestination ) = merge
45
+
46
+ // GET Duplicates/{name} Async( name department ) = getNameDepartmentDuplicates
47
+
48
+ // GET DuplicateDomains/{domain} Async( domain ) = getDomainDuplicates
49
+
50
+ // GET {contactId}/Summary Async( contactId limit ) = getContactSummary
51
+
52
+ // POST Validate Async( contactEntity ) = validateContactEntity
53
+
54
+
55
+ } // interface IContactRestApi
56
+
57
+
58
+
59
+
60
+ /**
61
+ * The Contact Service. The service implements all services working with the Contact object
62
+ * Contact (company) data services.
63
+ *
64
+ * `api/v1/Contact`
65
+ */
66
+ export class ContactRestApi extends base.WebApiBase implements IContactRestApi {
67
+ constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
68
+ constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
69
+ constructor(baseUrl: string, resourceManager:any);
70
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
71
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
72
+ constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
73
+ constructor(options: base.WebApiOptions);
74
+
75
+ constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
76
+ langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
77
+ langOrResourceOrRM?:string|base.ResourceParsing|any,
78
+ cultureCode?: string,
79
+ ) {
80
+ const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
81
+ options.basePath = "v1/Contact/";
82
+ super(options);
83
+ }
84
+
85
+
86
+ /**
87
+ * `GET /api/v1/Contact/default`
88
+ * Set default values into a new ContactEntity.
89
+ * NetServer calculates default values on the entity, which is required when creating/storing a new instance
90
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
91
+ * @returns A blank entity.
92
+ */
93
+ public async getDefaultAsync(options?:base.WebApiGetRequestOptions): Promise< carriers.ContactEntity > {
94
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
95
+ base.WebApiBase.SetPending(options);
96
+ return new Promise< carriers.ContactEntity >(async (resolve, reject) => {
97
+ try {
98
+ const response = await this._axios.get("default", config);
99
+ base.WebApiBase.SetCompleted(options, response);
100
+ const res : carriers.ContactEntity = converters.Create_ContactEntity_From( response.data );
101
+ resolve(res);
102
+ }
103
+ catch( err ) {
104
+ base.WebApiBase.HandleError(options, config, err);
105
+ reject(err);
106
+ }
107
+ });
108
+ }
109
+
110
+
111
+ /**
112
+ * `POST /api/v1/Contact/`
113
+ * Creates a new ContactEntity
114
+ * @param newContact - The ContactEntity to be saved.
115
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
116
+ * @returns New ContactEntity
117
+ */
118
+ public async postAsync(newContact: carriers.ContactEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ContactEntity > {
119
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
120
+ base.WebApiBase.SetPending(options);
121
+ return new Promise< carriers.ContactEntity >(async (resolve, reject) => {
122
+ try {
123
+ const response = await this._axios.post("", newContact, config);
124
+ base.WebApiBase.SetCompleted(options, response);
125
+ const res : carriers.ContactEntity = converters.Create_ContactEntity_From( response.data );
126
+ resolve(res);
127
+ }
128
+ catch( err ) {
129
+ base.WebApiBase.HandleError(options, config, err);
130
+ reject(err);
131
+ }
132
+ });
133
+ }
134
+
135
+
136
+ /**
137
+ * `PUT /api/v1/Contact/123`
138
+ * Replace the existing ContactEntity
139
+ * @param contact - The ContactEntity to be saved.
140
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
141
+ * @returns The updated ContactEntity
142
+ */
143
+ public async putByIdAsync(id:number, contact: carriers.ContactEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ContactEntity > {
144
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
145
+ base.WebApiBase.SetPending(options);
146
+ return new Promise< carriers.ContactEntity >(async (resolve, reject) => {
147
+ try {
148
+ const response = await this._axios.put(id.toString(), contact, config);
149
+ base.WebApiBase.SetCompleted(options, response);
150
+ let res : carriers.ContactEntity = null;
151
+ if( response.status != 304 )
152
+ res = converters.Create_ContactEntity_From( response.data );
153
+ resolve(res);
154
+ }
155
+ catch( err ) {
156
+ base.WebApiBase.HandleError(options, config, err);
157
+ reject(err);
158
+ }
159
+ });
160
+ }
161
+
162
+ /**
163
+ * `PATCH /api/v1/Contact/123`
164
+ * Updates an existing ContactEntity
165
+ * @param contact - The partial ContactEntity containing updated values, or an array of RFC6902 PATCH operations.
166
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
167
+ * @returns The updated ContactEntity
168
+ */
169
+ public async patchByIdAsync(id:number, contact: base.WebApiPatchOperation[] | carriers.ContactEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ContactEntity > {
170
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
171
+ base.WebApiBase.SetPending(options);
172
+ return new Promise< carriers.ContactEntity >(async (resolve, reject) => {
173
+ try {
174
+ const response = await this._axios.patch(id.toString(), contact, config);
175
+ base.WebApiBase.SetCompleted(options, response);
176
+ let res : carriers.ContactEntity = null;
177
+ if( response.status != 304 )
178
+ res = converters.Create_ContactEntity_From( response.data );
179
+ resolve(res);
180
+ }
181
+ catch( err ) {
182
+ base.WebApiBase.HandleError(options, config, err);
183
+ reject(err);
184
+ }
185
+ });
186
+ }
187
+ /**
188
+ * `DELETE /api/v1/Contact/123`
189
+ * Deletes the ContactEntity
190
+ * @param contactId - The id of the ContactEntity to be deleted.
191
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
192
+ */
193
+ public async deleteByIdAsync(contactId: number, options?:base.WebApiPutRequestOptions) : Promise<void> {
194
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
195
+ base.WebApiBase.SetPending(options);
196
+ return new Promise< void >(async (resolve, reject) => {
197
+ try {
198
+ const response = await this._axios.delete( contactId.toString(), config );
199
+ base.WebApiBase.SetCompleted(options, response);
200
+ const res = response.data;
201
+ resolve(res);
202
+ }
203
+ catch( err ) {
204
+ base.WebApiBase.HandleError(options, config, err);
205
+ reject(err);
206
+ }
207
+ });
208
+ }
209
+ /**
210
+ * `GET /api/v1/Contact/123`
211
+ * Get an existing ContactEntity
212
+ * @param contactId - The ContactEntity to be get.
213
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
214
+ * @returns The ContactEntity
215
+ */
216
+ public async getByIdAsync( contactId: number, options?:base.WebApiGetRequestOptions) : Promise< carriers.ContactEntity > {
217
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
218
+ base.WebApiBase.SetPending(options);
219
+ return new Promise< carriers.ContactEntity >(async (resolve, reject) => {
220
+ try {
221
+ const response = await this._axios.get( contactId.toString(), config);
222
+ base.WebApiBase.SetCompleted(options, response);
223
+ let res : carriers.ContactEntity = null;
224
+ if( response.status != 304 )
225
+ res = converters.Create_ContactEntity_From( response.data );
226
+ resolve(res);
227
+ }
228
+ catch( err ) {
229
+ base.WebApiBase.HandleError(options, config, err);
230
+ reject(err);
231
+ }
232
+ });
233
+ }
234
+
235
+
236
+ } // class ContactRestApi
237
+