@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.
- package/LICENSE.md +15 -15
- package/README.md +184 -184
- package/__tests__/Appointment63-notz.json +1925 -1925
- package/__tests__/Appointment63-utctz.json +1925 -1925
- package/__tests__/Appointment63.json +1925 -1925
- package/__tests__/AppointmentTzTest.ts +115 -115
- package/__tests__/AxiosNockTest.ts +28 -28
- package/__tests__/ContactDefault.json +699 -699
- package/__tests__/ContactEntity.json +272 -272
- package/__tests__/ContactRestTest.ts +144 -144
- package/__tests__/ContactTest.ts +395 -395
- package/__tests__/ConvertersTest.ts +97 -97
- package/__tests__/DocumentTest.ts +101 -101
- package/__tests__/Person210-notz.json +1932 -1932
- package/__tests__/Person210-utctz.json +1932 -1932
- package/__tests__/Person210.json +1932 -1932
- package/__tests__/PersonImageData.nock +22 -22
- package/__tests__/PersonTest.ts +41 -41
- package/__tests__/PersonTzTest.ts +113 -113
- package/__tests__/RecurrenceInfo.json +55 -55
- package/__tests__/ResponseCallbackTest.ts +23 -23
- package/__tests__/TableRights.json +441 -441
- package/__tests__/WebapiTest.ts +264 -264
- package/__tests__/Webhook.json +16 -16
- package/__tests__/WebhookTest.ts +209 -209
- package/dist/cjs/AIAgent.d.ts +62 -0
- package/dist/cjs/AIAgent.d.ts.map +1 -1
- package/dist/cjs/AIAgent.js +149 -0
- package/dist/cjs/AIAgent.js.map +1 -1
- package/dist/cjs/Carriers.d.ts +640 -14
- package/dist/cjs/Carriers.d.ts.map +1 -1
- package/dist/cjs/Converters.d.ts +24 -0
- package/dist/cjs/Converters.d.ts.map +1 -1
- package/dist/cjs/Converters.js +388 -17
- package/dist/cjs/Converters.js.map +1 -1
- package/dist/cjs/DiagnosticsAgent.d.ts +38 -0
- package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
- package/dist/cjs/DiagnosticsAgent.js +91 -0
- package/dist/cjs/DiagnosticsAgent.js.map +1 -1
- package/dist/cjs/Enums.d.ts +77 -1
- package/dist/cjs/Enums.d.ts.map +1 -1
- package/dist/cjs/Enums.js +83 -4
- package/dist/cjs/Enums.js.map +1 -1
- package/dist/cjs/ListAgent.d.ts +71 -6
- package/dist/cjs/ListAgent.d.ts.map +1 -1
- package/dist/cjs/ListAgent.js +157 -0
- package/dist/cjs/ListAgent.js.map +1 -1
- package/dist/cjs/MarketingAgent.d.ts +68 -0
- package/dist/cjs/MarketingAgent.d.ts.map +1 -1
- package/dist/cjs/MarketingAgent.js +157 -0
- package/dist/cjs/MarketingAgent.js.map +1 -1
- package/dist/cjs/TicketAgent.d.ts +23 -0
- package/dist/cjs/TicketAgent.d.ts.map +1 -1
- package/dist/cjs/TicketAgent.js +65 -0
- package/dist/cjs/TicketAgent.js.map +1 -1
- package/dist/esm/AIAgent.d.ts +62 -0
- package/dist/esm/AIAgent.d.ts.map +1 -1
- package/dist/esm/AIAgent.js +150 -1
- package/dist/esm/AIAgent.js.map +1 -1
- package/dist/esm/Carriers.d.ts +640 -14
- package/dist/esm/Carriers.d.ts.map +1 -1
- package/dist/esm/Converters.d.ts +24 -0
- package/dist/esm/Converters.d.ts.map +1 -1
- package/dist/esm/Converters.js +346 -0
- package/dist/esm/Converters.js.map +1 -1
- package/dist/esm/DiagnosticsAgent.d.ts +38 -0
- package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
- package/dist/esm/DiagnosticsAgent.js +91 -0
- package/dist/esm/DiagnosticsAgent.js.map +1 -1
- package/dist/esm/Enums.d.ts +77 -1
- package/dist/esm/Enums.d.ts.map +1 -1
- package/dist/esm/Enums.js +79 -0
- package/dist/esm/Enums.js.map +1 -1
- package/dist/esm/ListAgent.d.ts +71 -6
- package/dist/esm/ListAgent.d.ts.map +1 -1
- package/dist/esm/ListAgent.js +157 -0
- package/dist/esm/ListAgent.js.map +1 -1
- package/dist/esm/MarketingAgent.d.ts +68 -0
- package/dist/esm/MarketingAgent.d.ts.map +1 -1
- package/dist/esm/MarketingAgent.js +157 -0
- package/dist/esm/MarketingAgent.js.map +1 -1
- package/dist/esm/TicketAgent.d.ts +23 -0
- package/dist/esm/TicketAgent.d.ts.map +1 -1
- package/dist/esm/TicketAgent.js +65 -0
- package/dist/esm/TicketAgent.js.map +1 -1
- package/examples-js/hello.js +12 -12
- package/examples-ts/hello.ts +8 -8
- package/package.json +93 -93
- package/scripts/postbuild.js +22 -22
- package/scripts/setVersion.js +44 -44
- package/src/AIAgent.ts +2239 -1992
- package/src/AppointmentAgent.ts +6263 -6263
- package/src/AppointmentRestApi.ts +225 -225
- package/src/ArchiveAgent.ts +1950 -1950
- package/src/AssociateAgent.ts +422 -422
- package/src/AxiosCacheHandler.ts +74 -74
- package/src/BLOBAgent.ts +2100 -2100
- package/src/Base64.ts +285 -285
- package/src/BatchAgent.ts +910 -910
- package/src/BulkUpdateAgent.ts +504 -504
- package/src/CRMScriptAgent.ts +1390 -1390
- package/src/Carriers.ts +53121 -52274
- package/src/ChatAgent.ts +1422 -1422
- package/src/ConfigurationAgent.ts +2228 -2228
- package/src/ContactAgent.ts +1756 -1756
- package/src/ContactRestApi.ts +237 -237
- package/src/Converters.ts +23496 -23090
- package/src/CustomerServiceAgent.ts +1799 -1799
- package/src/DashAgent.ts +1674 -1674
- package/src/DatabaseAgent.ts +120 -120
- package/src/DatabaseTableAgent.ts +534 -534
- package/src/Day_js.ts +41 -41
- package/src/DiagnosticsAgent.ts +1384 -1240
- package/src/DocumentAgent.ts +5079 -5079
- package/src/DocumentMigrationAgent.ts +524 -524
- package/src/DocumentRestApi.ts +259 -259
- package/src/EMailAgent.ts +5328 -5328
- package/src/Enums.ts +6998 -6916
- package/src/ErpSyncAgent.ts +2658 -2658
- package/src/FavouriteAgent.ts +720 -720
- package/src/FindAgent.ts +2330 -2330
- package/src/ForeignSystemAgent.ts +1710 -1710
- package/src/FreeTextAgent.ts +372 -372
- package/src/ImportAgent.ts +304 -304
- package/src/LicenseAgent.ts +1230 -1230
- package/src/ListAgent.ts +11451 -11237
- package/src/MDOAgent.ts +748 -748
- package/src/MarketingAgent.ts +1146 -890
- package/src/MessagingAgent.ts +384 -384
- package/src/NavigatorAgent.ts +140 -140
- package/src/NumberAllocationAgent.ts +296 -296
- package/src/PersonAgent.ts +3287 -3287
- package/src/PersonRestApi.ts +241 -241
- package/src/PhoneListAgent.ts +458 -458
- package/src/PocketAgent.ts +780 -780
- package/src/PreferenceAgent.ts +1900 -1900
- package/src/PreviewsAgent.ts +116 -116
- package/src/ProjectAgent.ts +2391 -2391
- package/src/ProjectRestApi.ts +239 -239
- package/src/QuoteAgent.ts +5159 -5159
- package/src/RelationAgent.ts +220 -220
- package/src/ReportAgent.ts +154 -154
- package/src/ResourceAgent.ts +358 -358
- package/src/SaintAgent.ts +601 -601
- package/src/SaleAgent.ts +2034 -2034
- package/src/SaleRestApi.ts +233 -233
- package/src/SelectionAgent.ts +3195 -3195
- package/src/SentryAgent.ts +462 -462
- package/src/SoApiConstants.ts +8 -8
- package/src/TargetsAgent.ts +1104 -1104
- package/src/TicketAgent.ts +3708 -3638
- package/src/TimeZoneAgent.ts +528 -528
- package/src/TooltipsAgent.ts +116 -116
- package/src/UserAgent.ts +4856 -4856
- package/src/UserDefinedFieldInfoAgent.ts +1764 -1764
- package/src/ViewStateAgent.ts +858 -858
- package/src/WebApi.ts +872 -872
- package/src/WebApiBase.ts +565 -565
- package/src/WebhookAgent.ts +388 -388
- package/src/WorkflowAgent.ts +1338 -1338
- package/tsconfig.esm.json +8 -8
- package/tsconfig.jest.json +8 -8
- package/tsconfig.json +34 -34
package/src/PreferenceAgent.ts
CHANGED
|
@@ -1,1900 +1,1900 @@
|
|
|
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/PreferenceAgent.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
|
-
* Preferences, user interface tab configuration
|
|
28
|
-
*/
|
|
29
|
-
export interface IPreferenceAgent {
|
|
30
|
-
createDefaultPreferenceAsync(): Promise< carriers.Preference >;
|
|
31
|
-
createDefaultPreferenceDescriptionAsync(): Promise< carriers.PreferenceDescription >;
|
|
32
|
-
savePreferenceDescriptionAsync(entity: carriers.PreferenceDescription) : Promise< carriers.PreferenceDescription >;
|
|
33
|
-
deletePreferenceDescriptionAsync(PreferenceDescriptionId: number) : Promise<void>;
|
|
34
|
-
createDefaultPreferenceDescriptionLineAsync(): Promise< carriers.PreferenceDescriptionLine >;
|
|
35
|
-
savePreferenceDescriptionLineAsync(entity: carriers.PreferenceDescriptionLine) : Promise< carriers.PreferenceDescriptionLine >;
|
|
36
|
-
deletePreferenceDescriptionLineAsync(PreferenceDescriptionLineId: number) : Promise<void>;
|
|
37
|
-
savePreferenceAsync(request: carriers.Preference_SavePreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
38
|
-
savePreferenceAsync(preference: carriers.Preference, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
39
|
-
saveTabOrderAsync(request: carriers.Preference_SaveTabOrderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
40
|
-
saveTabOrderAsync(tabOrder: carriers.TabOrder, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
41
|
-
getTabOrderAsync(request: carriers.Preference_GetTabOrderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder >;
|
|
42
|
-
getTabOrderAsync(tabName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder >;
|
|
43
|
-
getPreferenceAsync(request: carriers.Preference_GetPreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
44
|
-
getPreferenceAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
45
|
-
savePreferenceEntityAsync(request: carriers.Preference_SavePreferenceEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
46
|
-
savePreferenceEntityAsync(preference: carriers.Preference, removeLowerLevels: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
47
|
-
deletePreferenceAsync(request: carriers.Preference_DeletePreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
48
|
-
deletePreferenceAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
49
|
-
deletePreferencesAsync(request: carriers.Preference_DeletePreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
50
|
-
deletePreferencesAsync(ids: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
51
|
-
getPreferenceByNameAsync(request: carriers.Preference_GetPreferenceByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
52
|
-
getPreferenceByNameAsync(prefSection: string, prefKey: string, prefLevel: enums.PreferenceLevel, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
53
|
-
getPreferenceByNameAndIdAsync(request: carriers.Preference_GetPreferenceByNameAndIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
54
|
-
getPreferenceByNameAndIdAsync(prefSection: string, prefKey: string, prefLevel: enums.PreferenceLevel, ownerId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
55
|
-
getNetServicesStatusUrlAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
56
|
-
updateNetServicesStatusAsync(request: carriers.Preference_UpdateNetServicesStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
57
|
-
updateNetServicesStatusAsync(xmlOrJson: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
58
|
-
getXsrfPathsAsync(request: carriers.Preference_GetXsrfPathsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
|
|
59
|
-
getXsrfPathsAsync(hostname: string, webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
|
|
60
|
-
setXsrfPathsAsync(request: carriers.Preference_SetXsrfPathsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
61
|
-
setXsrfPathsAsync(hostname: string, paths: string[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
62
|
-
getPreferenceDescriptionAsync(preferenceDescriptionId: number) : Promise< carriers.PreferenceDescription >;
|
|
63
|
-
getFromSectionAndKeyAsync(request: carriers.Preference_GetFromSectionAndKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
64
|
-
getFromSectionAndKeyAsync(section: string, key: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
65
|
-
getAllAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] >;
|
|
66
|
-
getAllFromSectionAsync(request: carriers.Preference_GetAllFromSectionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] >;
|
|
67
|
-
getAllFromSectionAsync(section: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] >;
|
|
68
|
-
saveFromSectionAndKeyAsync(request: carriers.Preference_SaveFromSectionAndKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
69
|
-
saveFromSectionAndKeyAsync(section: string, key: string, preferenceDescription: carriers.PreferenceDescription, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
70
|
-
deleteFromSectionAndKeyAsync(request: carriers.Preference_DeleteFromSectionAndKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
71
|
-
deleteFromSectionAndKeyAsync(section: string, key: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
72
|
-
getPreferenceDescriptionLineAsync(preferenceDescriptionLineId: number) : Promise< carriers.PreferenceDescriptionLine >;
|
|
73
|
-
getPreferenceDescriptionLineFromIdAndValueAsync(request: carriers.Preference_GetPreferenceDescriptionLineFromIdAndValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine >;
|
|
74
|
-
getPreferenceDescriptionLineFromIdAndValueAsync(prefDescId: number, prefValue: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine >;
|
|
75
|
-
getPreferenceDescriptionLinesByPrefDescIdAsync(request: carriers.Preference_GetPreferenceDescriptionLinesByPrefDescIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
76
|
-
getPreferenceDescriptionLinesByPrefDescIdAsync(prefDescId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
77
|
-
savePreferenceDescriptionLinesAsync(request: carriers.Preference_SavePreferenceDescriptionLinesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
78
|
-
savePreferenceDescriptionLinesAsync(preferenceDescriptionLines: carriers.PreferenceDescriptionLine[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
79
|
-
deletePreferenceDescriptionLinesAsync(request: carriers.Preference_DeletePreferenceDescriptionLinesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
80
|
-
deletePreferenceDescriptionLinesAsync(prefDescLineIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
81
|
-
deletePrefDescLinesByPrefDescIdAsync(request: carriers.Preference_DeletePrefDescLinesByPrefDescIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
82
|
-
deletePrefDescLinesByPrefDescIdAsync(prefDescId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
83
|
-
deletePrefDescLinesByPrefDescIdsAsync(request: carriers.Preference_DeletePrefDescLinesByPrefDescIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
84
|
-
deletePrefDescLinesByPrefDescIdsAsync(prefDescIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
85
|
-
getPreferencesAsync(request: carriers.Preference_GetPreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
86
|
-
getPreferencesAsync(specifications: carriers.PreferenceSpec[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
87
|
-
savePreferencesAsync(request: carriers.Preference_SavePreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
88
|
-
savePreferencesAsync(preferences: carriers.Preference[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
89
|
-
getPreferencesWithDisplayValuesAsync(request: carriers.Preference_GetPreferencesWithDisplayValuesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
90
|
-
getPreferencesWithDisplayValuesAsync(specifications: carriers.PreferenceSpec[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
91
|
-
getTabOrdersAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder[] >;
|
|
92
|
-
saveTabOrdersAsync(request: carriers.Preference_SaveTabOrdersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
93
|
-
saveTabOrdersAsync(tabOrders: carriers.TabOrder[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
94
|
-
savePreferenceEntitiesAsync(request: carriers.Preference_SavePreferenceEntitiesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
95
|
-
savePreferenceEntitiesAsync(preferences: carriers.Preference[], removeLowerLevels: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
96
|
-
} // interface IPreferenceAgent
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Preferences, user interface tab configuration
|
|
103
|
-
*/
|
|
104
|
-
export class PreferenceAgent extends base.WebApiBase implements IPreferenceAgent {
|
|
105
|
-
constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
|
|
106
|
-
constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
|
|
107
|
-
constructor(baseUrl: string, resourceManager:any);
|
|
108
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
|
|
109
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
|
|
110
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
|
|
111
|
-
constructor(options: base.WebApiOptions);
|
|
112
|
-
|
|
113
|
-
constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
|
|
114
|
-
langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
|
|
115
|
-
langOrResourceOrRM?:string|base.ResourceParsing|any,
|
|
116
|
-
cultureCode?: string,
|
|
117
|
-
) {
|
|
118
|
-
const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
|
|
119
|
-
options.basePath = "v1/Agents/Preference/";
|
|
120
|
-
super(options);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Set default values into a new Preference.
|
|
127
|
-
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
128
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
129
|
-
* @returns A blank entity.
|
|
130
|
-
*/
|
|
131
|
-
public async createDefaultPreferenceAsync(options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
132
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
133
|
-
base.WebApiBase.SetPending(options);
|
|
134
|
-
return new Promise< carriers.Preference >(async (resolve, reject) => {
|
|
135
|
-
try {
|
|
136
|
-
const response = await this._axios.post("CreateDefaultPreference", null, config);
|
|
137
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
138
|
-
const res : carriers.Preference = converters.Create_Preference_From( response.data );
|
|
139
|
-
resolve(res);
|
|
140
|
-
}
|
|
141
|
-
catch( err ) {
|
|
142
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
143
|
-
reject(err);
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Set default values into a new PreferenceDescription.
|
|
150
|
-
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
151
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
152
|
-
* @returns A blank entity.
|
|
153
|
-
*/
|
|
154
|
-
public async createDefaultPreferenceDescriptionAsync(options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription > {
|
|
155
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
156
|
-
base.WebApiBase.SetPending(options);
|
|
157
|
-
return new Promise< carriers.PreferenceDescription >(async (resolve, reject) => {
|
|
158
|
-
try {
|
|
159
|
-
const response = await this._axios.post("CreateDefaultPreferenceDescription", null, config);
|
|
160
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
161
|
-
const res : carriers.PreferenceDescription = converters.Create_PreferenceDescription_From( response.data );
|
|
162
|
-
resolve(res);
|
|
163
|
-
}
|
|
164
|
-
catch( err ) {
|
|
165
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
166
|
-
reject(err);
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Replace the existing PreferenceDescription or creates a new PreferenceDescription if the id parameter is empty
|
|
172
|
-
* @param entity - The PreferenceDescription to be saved.
|
|
173
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
174
|
-
* @returns New or updated PreferenceDescription
|
|
175
|
-
*/
|
|
176
|
-
public async savePreferenceDescriptionAsync(entity: carriers.PreferenceDescription, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription > {
|
|
177
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
178
|
-
base.WebApiBase.SetPending(options);
|
|
179
|
-
return new Promise< carriers.PreferenceDescription >(async (resolve, reject) => {
|
|
180
|
-
try {
|
|
181
|
-
const response = await this._axios.post("SavePreferenceDescription", entity, config);
|
|
182
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
183
|
-
const res : carriers.PreferenceDescription = converters.Create_PreferenceDescription_From( response.data );
|
|
184
|
-
resolve(res);
|
|
185
|
-
}
|
|
186
|
-
catch( err ) {
|
|
187
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
188
|
-
reject(err);
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Deletes the PreferenceDescription
|
|
195
|
-
* @param PreferenceDescriptionId - The id of the PreferenceDescription to be deleted.
|
|
196
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
197
|
-
*/
|
|
198
|
-
public async deletePreferenceDescriptionAsync(PreferenceDescriptionId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
199
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
200
|
-
base.WebApiBase.SetPending(options);
|
|
201
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
202
|
-
try {
|
|
203
|
-
const response = await this._axios.post("DeletePreferenceDescription?PreferenceDescriptionId=" + PreferenceDescriptionId, null, config );
|
|
204
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
205
|
-
const res = response.data;
|
|
206
|
-
resolve(res);
|
|
207
|
-
}
|
|
208
|
-
catch( err ) {
|
|
209
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
210
|
-
reject(err);
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Set default values into a new PreferenceDescriptionLine.
|
|
217
|
-
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
218
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
219
|
-
* @returns A blank entity.
|
|
220
|
-
*/
|
|
221
|
-
public async createDefaultPreferenceDescriptionLineAsync(options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine > {
|
|
222
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
223
|
-
base.WebApiBase.SetPending(options);
|
|
224
|
-
return new Promise< carriers.PreferenceDescriptionLine >(async (resolve, reject) => {
|
|
225
|
-
try {
|
|
226
|
-
const response = await this._axios.post("CreateDefaultPreferenceDescriptionLine", null, config);
|
|
227
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
228
|
-
const res : carriers.PreferenceDescriptionLine = converters.Create_PreferenceDescriptionLine_From( response.data );
|
|
229
|
-
resolve(res);
|
|
230
|
-
}
|
|
231
|
-
catch( err ) {
|
|
232
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
233
|
-
reject(err);
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Replace the existing PreferenceDescriptionLine or creates a new PreferenceDescriptionLine if the id parameter is empty
|
|
239
|
-
* @param entity - The PreferenceDescriptionLine to be saved.
|
|
240
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
241
|
-
* @returns New or updated PreferenceDescriptionLine
|
|
242
|
-
*/
|
|
243
|
-
public async savePreferenceDescriptionLineAsync(entity: carriers.PreferenceDescriptionLine, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine > {
|
|
244
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
245
|
-
base.WebApiBase.SetPending(options);
|
|
246
|
-
return new Promise< carriers.PreferenceDescriptionLine >(async (resolve, reject) => {
|
|
247
|
-
try {
|
|
248
|
-
const response = await this._axios.post("SavePreferenceDescriptionLine", entity, config);
|
|
249
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
250
|
-
const res : carriers.PreferenceDescriptionLine = converters.Create_PreferenceDescriptionLine_From( response.data );
|
|
251
|
-
resolve(res);
|
|
252
|
-
}
|
|
253
|
-
catch( err ) {
|
|
254
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
255
|
-
reject(err);
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* Deletes the PreferenceDescriptionLine
|
|
262
|
-
* @param PreferenceDescriptionLineId - The id of the PreferenceDescriptionLine to be deleted.
|
|
263
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
264
|
-
*/
|
|
265
|
-
public async deletePreferenceDescriptionLineAsync(PreferenceDescriptionLineId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
266
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
267
|
-
base.WebApiBase.SetPending(options);
|
|
268
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
269
|
-
try {
|
|
270
|
-
const response = await this._axios.post("DeletePreferenceDescriptionLine?PreferenceDescriptionLineId=" + PreferenceDescriptionLineId, null, config );
|
|
271
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
272
|
-
const res = response.data;
|
|
273
|
-
resolve(res);
|
|
274
|
-
}
|
|
275
|
-
catch( err ) {
|
|
276
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
277
|
-
reject(err);
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
private async _savePreferenceAsync(request: carriers.Preference_SavePreferenceRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
283
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
284
|
-
base.WebApiBase.SetPending(options);
|
|
285
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
286
|
-
try {
|
|
287
|
-
config.baseURL = this._options.baseUrl;
|
|
288
|
-
const response = await this._axios.post("SavePreference", request , config);
|
|
289
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
290
|
-
const res = response.data;
|
|
291
|
-
resolve(res);
|
|
292
|
-
}
|
|
293
|
-
catch( err ) {
|
|
294
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
295
|
-
reject(err);
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* Save this preference
|
|
304
|
-
* @param request - Preference
|
|
305
|
-
* @returns This method has no return value
|
|
306
|
-
*/
|
|
307
|
-
public async savePreferenceAsync(request: carriers.Preference_SavePreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* Save this preference
|
|
311
|
-
* @param preference - Preference to be saved. All fields must be filled in, and the preference will be saved on the Associate level only. Setting for other levels is an administrative task and not available through this service.
|
|
312
|
-
* @returns This method has no return value
|
|
313
|
-
*/
|
|
314
|
-
public async savePreferenceAsync(preference: carriers.Preference, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
315
|
-
|
|
316
|
-
public async savePreferenceAsync(preference:carriers.Preference|carriers.Preference_SavePreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
317
|
-
let _request : carriers.Preference_SavePreferenceRequest = null;
|
|
318
|
-
let _options : base.WebApiRequestOptions = null;
|
|
319
|
-
const first : any = preference;
|
|
320
|
-
if( typeof( first ) === "object" && first && ( typeof(first.preference)!='undefined' ) )
|
|
321
|
-
{
|
|
322
|
-
_request = preference as carriers.Preference_SavePreferenceRequest;
|
|
323
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
324
|
-
}
|
|
325
|
-
else
|
|
326
|
-
{
|
|
327
|
-
_request = {
|
|
328
|
-
preference: preference as carriers.Preference,
|
|
329
|
-
};
|
|
330
|
-
_options = webapi_options;
|
|
331
|
-
}
|
|
332
|
-
return this._savePreferenceAsync( _request, _options );
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
private async _saveTabOrderAsync(request: carriers.Preference_SaveTabOrderRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
337
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
338
|
-
base.WebApiBase.SetPending(options);
|
|
339
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
340
|
-
try {
|
|
341
|
-
config.baseURL = this._options.baseUrl;
|
|
342
|
-
const response = await this._axios.post("SaveTabOrder", request , config);
|
|
343
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
344
|
-
const res = response.data;
|
|
345
|
-
resolve(res);
|
|
346
|
-
}
|
|
347
|
-
catch( err ) {
|
|
348
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
349
|
-
reject(err);
|
|
350
|
-
}
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* Saves the tab order. The order is saved pr. user.
|
|
358
|
-
* @param request - TabOrder
|
|
359
|
-
* @returns This method has no return value
|
|
360
|
-
*/
|
|
361
|
-
public async saveTabOrderAsync(request: carriers.Preference_SaveTabOrderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* Saves the tab order. The order is saved pr. user.
|
|
365
|
-
* @param tabOrder - Name of the tab control
|
|
366
|
-
* @returns This method has no return value
|
|
367
|
-
*/
|
|
368
|
-
public async saveTabOrderAsync(tabOrder: carriers.TabOrder, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
369
|
-
|
|
370
|
-
public async saveTabOrderAsync(tabOrder:carriers.TabOrder|carriers.Preference_SaveTabOrderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
371
|
-
let _request : carriers.Preference_SaveTabOrderRequest = null;
|
|
372
|
-
let _options : base.WebApiRequestOptions = null;
|
|
373
|
-
const first : any = tabOrder;
|
|
374
|
-
if( typeof( first ) === "object" && first && ( typeof(first.tabOrder)!='undefined' ) )
|
|
375
|
-
{
|
|
376
|
-
_request = tabOrder as carriers.Preference_SaveTabOrderRequest;
|
|
377
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
378
|
-
}
|
|
379
|
-
else
|
|
380
|
-
{
|
|
381
|
-
_request = {
|
|
382
|
-
tabOrder: tabOrder as carriers.TabOrder,
|
|
383
|
-
};
|
|
384
|
-
_options = webapi_options;
|
|
385
|
-
}
|
|
386
|
-
return this._saveTabOrderAsync( _request, _options );
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
private async _getTabOrderAsync(request: carriers.Preference_GetTabOrderRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder > {
|
|
391
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
392
|
-
base.WebApiBase.SetPending(options);
|
|
393
|
-
return new Promise< carriers.TabOrder >(async (resolve, reject) => {
|
|
394
|
-
try {
|
|
395
|
-
config.baseURL = this._options.baseUrl;
|
|
396
|
-
const response = await this._axios.post("GetTabOrder", request , config);
|
|
397
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
398
|
-
const res : carriers.TabOrder = converters.Create_TabOrder_From( response.data );
|
|
399
|
-
resolve(res);
|
|
400
|
-
}
|
|
401
|
-
catch( err ) {
|
|
402
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
403
|
-
reject(err);
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
/**
|
|
411
|
-
* Gets the tab order.
|
|
412
|
-
* @param request - TabName
|
|
413
|
-
* @returns Tab order. Array of strings. Each string represent a named tab.
|
|
414
|
-
*/
|
|
415
|
-
public async getTabOrderAsync(request: carriers.Preference_GetTabOrderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder >;
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* Gets the tab order.
|
|
419
|
-
* @param tabName - Name of the tab control
|
|
420
|
-
* @returns Tab order. Array of strings. Each string represent a named tab.
|
|
421
|
-
*/
|
|
422
|
-
public async getTabOrderAsync(tabName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder >;
|
|
423
|
-
|
|
424
|
-
public async getTabOrderAsync(tabName:string|carriers.Preference_GetTabOrderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder > {
|
|
425
|
-
let _request : carriers.Preference_GetTabOrderRequest = null;
|
|
426
|
-
let _options : base.WebApiRequestOptions = null;
|
|
427
|
-
const first : any = tabName;
|
|
428
|
-
if( typeof( first ) === "object" && first && ( typeof(first.tabName)!='undefined' ) )
|
|
429
|
-
{
|
|
430
|
-
_request = tabName as carriers.Preference_GetTabOrderRequest;
|
|
431
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
432
|
-
}
|
|
433
|
-
else
|
|
434
|
-
{
|
|
435
|
-
_request = {
|
|
436
|
-
tabName: tabName as string,
|
|
437
|
-
};
|
|
438
|
-
_options = webapi_options;
|
|
439
|
-
}
|
|
440
|
-
return this._getTabOrderAsync( _request, _options );
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
private async _getPreferenceAsync(request: carriers.Preference_GetPreferenceRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
445
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
446
|
-
base.WebApiBase.SetPending(options);
|
|
447
|
-
return new Promise< carriers.Preference >(async (resolve, reject) => {
|
|
448
|
-
try {
|
|
449
|
-
config.baseURL = this._options.baseUrl;
|
|
450
|
-
const response = await this._axios.post("GetPreference", request , config);
|
|
451
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
452
|
-
const res : carriers.Preference = converters.Create_Preference_From( response.data );
|
|
453
|
-
resolve(res);
|
|
454
|
-
}
|
|
455
|
-
catch( err ) {
|
|
456
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
457
|
-
reject(err);
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* Get a preference by id
|
|
466
|
-
* @param request - Id
|
|
467
|
-
* @returns The preference loaded
|
|
468
|
-
*/
|
|
469
|
-
public async getPreferenceAsync(request: carriers.Preference_GetPreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* Get a preference by id
|
|
473
|
-
* @param id - The id of the preference to load
|
|
474
|
-
* @returns The preference loaded
|
|
475
|
-
*/
|
|
476
|
-
public async getPreferenceAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
477
|
-
|
|
478
|
-
public async getPreferenceAsync(id:number|carriers.Preference_GetPreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
479
|
-
let _request : carriers.Preference_GetPreferenceRequest = null;
|
|
480
|
-
let _options : base.WebApiRequestOptions = null;
|
|
481
|
-
const first : any = id;
|
|
482
|
-
if( typeof( first ) === "object" && first && ( typeof(first.id)!='undefined' ) )
|
|
483
|
-
{
|
|
484
|
-
_request = id as carriers.Preference_GetPreferenceRequest;
|
|
485
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
486
|
-
}
|
|
487
|
-
else
|
|
488
|
-
{
|
|
489
|
-
_request = {
|
|
490
|
-
id: id as number,
|
|
491
|
-
};
|
|
492
|
-
_options = webapi_options;
|
|
493
|
-
}
|
|
494
|
-
return this._getPreferenceAsync( _request, _options );
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
private async _savePreferenceEntityAsync(request: carriers.Preference_SavePreferenceEntityRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
499
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
500
|
-
base.WebApiBase.SetPending(options);
|
|
501
|
-
return new Promise< carriers.Preference >(async (resolve, reject) => {
|
|
502
|
-
try {
|
|
503
|
-
config.baseURL = this._options.baseUrl;
|
|
504
|
-
const response = await this._axios.post("SavePreferenceEntity", request , config);
|
|
505
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
506
|
-
const res : carriers.Preference = converters.Create_Preference_From( response.data );
|
|
507
|
-
resolve(res);
|
|
508
|
-
}
|
|
509
|
-
catch( err ) {
|
|
510
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
511
|
-
reject(err);
|
|
512
|
-
}
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
/**
|
|
519
|
-
* Saves a complete preference object, on any level and any target. Preference administrator rights are required to use this
|
|
520
|
-
* @param request - Preference, RemoveLowerLevels
|
|
521
|
-
* @returns Returns the saved preference
|
|
522
|
-
*/
|
|
523
|
-
public async savePreferenceEntityAsync(request: carriers.Preference_SavePreferenceEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
524
|
-
|
|
525
|
-
/**
|
|
526
|
-
* Saves a complete preference object, on any level and any target. Preference administrator rights are required to use this
|
|
527
|
-
* @param preference - The preference object to be saved
|
|
528
|
-
* @param removeLowerLevels - If this is true, all user preferences on lower levels will be deleted
|
|
529
|
-
* @returns Returns the saved preference
|
|
530
|
-
*/
|
|
531
|
-
public async savePreferenceEntityAsync(preference: carriers.Preference, removeLowerLevels: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
532
|
-
|
|
533
|
-
public async savePreferenceEntityAsync(preference:carriers.Preference|carriers.Preference_SavePreferenceEntityRequest, removeLowerLevels?:boolean|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
534
|
-
let _request : carriers.Preference_SavePreferenceEntityRequest = null;
|
|
535
|
-
let _options : base.WebApiRequestOptions = null;
|
|
536
|
-
const first : any = preference;
|
|
537
|
-
if( typeof( first ) === "object" && first && ( typeof(first.preference)!='undefined' || typeof(first.removeLowerLevels)!='undefined' ) )
|
|
538
|
-
{
|
|
539
|
-
_request = preference as carriers.Preference_SavePreferenceEntityRequest;
|
|
540
|
-
_options = removeLowerLevels as base.WebApiRequestOptions;
|
|
541
|
-
}
|
|
542
|
-
else
|
|
543
|
-
{
|
|
544
|
-
_request = {
|
|
545
|
-
preference: preference as carriers.Preference,
|
|
546
|
-
removeLowerLevels: removeLowerLevels as boolean,
|
|
547
|
-
};
|
|
548
|
-
_options = webapi_options;
|
|
549
|
-
}
|
|
550
|
-
return this._savePreferenceEntityAsync( _request, _options );
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
private async _deletePreferenceAsync(request: carriers.Preference_DeletePreferenceRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
555
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
556
|
-
base.WebApiBase.SetPending(options);
|
|
557
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
558
|
-
try {
|
|
559
|
-
config.baseURL = this._options.baseUrl;
|
|
560
|
-
const response = await this._axios.post("DeletePreference", request , config);
|
|
561
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
562
|
-
const res = response.data;
|
|
563
|
-
resolve(res);
|
|
564
|
-
}
|
|
565
|
-
catch( err ) {
|
|
566
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
567
|
-
reject(err);
|
|
568
|
-
}
|
|
569
|
-
});
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
* Delete a preference by id
|
|
576
|
-
* @param request - Id
|
|
577
|
-
* @returns This method has no return value
|
|
578
|
-
*/
|
|
579
|
-
public async deletePreferenceAsync(request: carriers.Preference_DeletePreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
580
|
-
|
|
581
|
-
/**
|
|
582
|
-
* Delete a preference by id
|
|
583
|
-
* @param id - The id of the preference to delete
|
|
584
|
-
* @returns This method has no return value
|
|
585
|
-
*/
|
|
586
|
-
public async deletePreferenceAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
587
|
-
|
|
588
|
-
public async deletePreferenceAsync(id:number|carriers.Preference_DeletePreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
589
|
-
let _request : carriers.Preference_DeletePreferenceRequest = null;
|
|
590
|
-
let _options : base.WebApiRequestOptions = null;
|
|
591
|
-
const first : any = id;
|
|
592
|
-
if( typeof( first ) === "object" && first && ( typeof(first.id)!='undefined' ) )
|
|
593
|
-
{
|
|
594
|
-
_request = id as carriers.Preference_DeletePreferenceRequest;
|
|
595
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
596
|
-
}
|
|
597
|
-
else
|
|
598
|
-
{
|
|
599
|
-
_request = {
|
|
600
|
-
id: id as number,
|
|
601
|
-
};
|
|
602
|
-
_options = webapi_options;
|
|
603
|
-
}
|
|
604
|
-
return this._deletePreferenceAsync( _request, _options );
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
private async _deletePreferencesAsync(request: carriers.Preference_DeletePreferencesRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
609
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
610
|
-
base.WebApiBase.SetPending(options);
|
|
611
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
612
|
-
try {
|
|
613
|
-
config.baseURL = this._options.baseUrl;
|
|
614
|
-
const response = await this._axios.post("DeletePreferences", request , config);
|
|
615
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
616
|
-
const res = response.data;
|
|
617
|
-
resolve(res);
|
|
618
|
-
}
|
|
619
|
-
catch( err ) {
|
|
620
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
621
|
-
reject(err);
|
|
622
|
-
}
|
|
623
|
-
});
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
/**
|
|
629
|
-
* Delete some preferences by id
|
|
630
|
-
* @param request - Ids
|
|
631
|
-
* @returns This method has no return value
|
|
632
|
-
*/
|
|
633
|
-
public async deletePreferencesAsync(request: carriers.Preference_DeletePreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
634
|
-
|
|
635
|
-
/**
|
|
636
|
-
* Delete some preferences by id
|
|
637
|
-
* @param ids - The ids of the preference to delete
|
|
638
|
-
* @returns This method has no return value
|
|
639
|
-
*/
|
|
640
|
-
public async deletePreferencesAsync(ids: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
641
|
-
|
|
642
|
-
public async deletePreferencesAsync(ids:number[]|carriers.Preference_DeletePreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
643
|
-
let _request : carriers.Preference_DeletePreferencesRequest = null;
|
|
644
|
-
let _options : base.WebApiRequestOptions = null;
|
|
645
|
-
const first : any = ids;
|
|
646
|
-
if( typeof( first ) === "object" && first && ( typeof(first.ids)!='undefined' ) )
|
|
647
|
-
{
|
|
648
|
-
_request = ids as carriers.Preference_DeletePreferencesRequest;
|
|
649
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
650
|
-
}
|
|
651
|
-
else
|
|
652
|
-
{
|
|
653
|
-
_request = {
|
|
654
|
-
ids: ids as number[],
|
|
655
|
-
};
|
|
656
|
-
_options = webapi_options;
|
|
657
|
-
}
|
|
658
|
-
return this._deletePreferencesAsync( _request, _options );
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
private async _getPreferenceByNameAsync(request: carriers.Preference_GetPreferenceByNameRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
663
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
664
|
-
base.WebApiBase.SetPending(options);
|
|
665
|
-
return new Promise< carriers.Preference >(async (resolve, reject) => {
|
|
666
|
-
try {
|
|
667
|
-
config.baseURL = this._options.baseUrl;
|
|
668
|
-
const response = await this._axios.post("GetPreferenceByName", request , config);
|
|
669
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
670
|
-
const res : carriers.Preference = converters.Create_Preference_From( response.data );
|
|
671
|
-
resolve(res);
|
|
672
|
-
}
|
|
673
|
-
catch( err ) {
|
|
674
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
675
|
-
reject(err);
|
|
676
|
-
}
|
|
677
|
-
});
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
/**
|
|
683
|
-
* Get a preference by name
|
|
684
|
-
* @param request - PrefSection, PrefKey, PrefLevel
|
|
685
|
-
* @returns The preference. Note that id = 0 and value = null if preference not found in the database at the requested pref-level.
|
|
686
|
-
*/
|
|
687
|
-
public async getPreferenceByNameAsync(request: carriers.Preference_GetPreferenceByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
688
|
-
|
|
689
|
-
/**
|
|
690
|
-
* Get a preference by name
|
|
691
|
-
* @param prefSection - The preference section name. e.g. 'Functions'. See SuperOffice.CRM.UserPreferenceStrings for constants.
|
|
692
|
-
* @param prefKey - The preference key name. e.g. 'ShowTipsAtStart'. See SuperOffice.CRM.UserPreferenceStrings for constants.
|
|
693
|
-
* @param prefLevel - The preference level to read. Undefined (0) means to return the preference defined closest to the user.
|
|
694
|
-
* @returns The preference. Note that id = 0 and value = null if preference not found in the database at the requested pref-level.
|
|
695
|
-
*/
|
|
696
|
-
public async getPreferenceByNameAsync(prefSection: string, prefKey: string, prefLevel: enums.PreferenceLevel, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
697
|
-
|
|
698
|
-
public async getPreferenceByNameAsync(prefSection:string|carriers.Preference_GetPreferenceByNameRequest, prefKey?:string|base.WebApiRequestOptions, prefLevel?:enums.PreferenceLevel, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
699
|
-
let _request : carriers.Preference_GetPreferenceByNameRequest = null;
|
|
700
|
-
let _options : base.WebApiRequestOptions = null;
|
|
701
|
-
const first : any = prefSection;
|
|
702
|
-
if( typeof( first ) === "object" && first && ( typeof(first.prefSection)!='undefined' || typeof(first.prefKey)!='undefined' || typeof(first.prefLevel)!='undefined' ) )
|
|
703
|
-
{
|
|
704
|
-
_request = prefSection as carriers.Preference_GetPreferenceByNameRequest;
|
|
705
|
-
_options = prefKey as base.WebApiRequestOptions;
|
|
706
|
-
}
|
|
707
|
-
else
|
|
708
|
-
{
|
|
709
|
-
_request = {
|
|
710
|
-
prefSection: prefSection as string,
|
|
711
|
-
prefKey: prefKey as string,
|
|
712
|
-
prefLevel: prefLevel as enums.PreferenceLevel,
|
|
713
|
-
};
|
|
714
|
-
_options = webapi_options;
|
|
715
|
-
}
|
|
716
|
-
return this._getPreferenceByNameAsync( _request, _options );
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
private async _getPreferenceByNameAndIdAsync(request: carriers.Preference_GetPreferenceByNameAndIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
721
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
722
|
-
base.WebApiBase.SetPending(options);
|
|
723
|
-
return new Promise< carriers.Preference >(async (resolve, reject) => {
|
|
724
|
-
try {
|
|
725
|
-
config.baseURL = this._options.baseUrl;
|
|
726
|
-
const response = await this._axios.post("GetPreferenceByNameAndId", request , config);
|
|
727
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
728
|
-
const res : carriers.Preference = converters.Create_Preference_From( response.data );
|
|
729
|
-
resolve(res);
|
|
730
|
-
}
|
|
731
|
-
catch( err ) {
|
|
732
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
733
|
-
reject(err);
|
|
734
|
-
}
|
|
735
|
-
});
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
/**
|
|
741
|
-
* Get a preference by name and owner id.
|
|
742
|
-
* @param request - PrefSection, PrefKey, PrefLevel, OwnerId
|
|
743
|
-
* @returns The preference. Note that id = 0 and value = null if preference not found in the database at the requested pref-level.
|
|
744
|
-
*/
|
|
745
|
-
public async getPreferenceByNameAndIdAsync(request: carriers.Preference_GetPreferenceByNameAndIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
746
|
-
|
|
747
|
-
/**
|
|
748
|
-
* Get a preference by name and owner id.
|
|
749
|
-
* @param prefSection - The preference section name. e.g. 'Functions'. See SuperOffice.CRM.UserPreferenceStrings for constants.
|
|
750
|
-
* @param prefKey - The preference key name. e.g. 'ShowTipsAtStart'. See SuperOffice.CRM.UserPreferenceStrings for constants.
|
|
751
|
-
* @param prefLevel - The preference level to read. Undefined (0) means to return the preference defined closest to the user.
|
|
752
|
-
* @param ownerId - The preference owner id, individual or group.
|
|
753
|
-
* @returns The preference. Note that id = 0 and value = null if preference not found in the database at the requested pref-level.
|
|
754
|
-
*/
|
|
755
|
-
public async getPreferenceByNameAndIdAsync(prefSection: string, prefKey: string, prefLevel: enums.PreferenceLevel, ownerId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
756
|
-
|
|
757
|
-
public async getPreferenceByNameAndIdAsync(prefSection:string|carriers.Preference_GetPreferenceByNameAndIdRequest, prefKey?:string|base.WebApiRequestOptions, prefLevel?:enums.PreferenceLevel, ownerId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
758
|
-
let _request : carriers.Preference_GetPreferenceByNameAndIdRequest = null;
|
|
759
|
-
let _options : base.WebApiRequestOptions = null;
|
|
760
|
-
const first : any = prefSection;
|
|
761
|
-
if( typeof( first ) === "object" && first && ( typeof(first.prefSection)!='undefined' || typeof(first.prefKey)!='undefined' || typeof(first.prefLevel)!='undefined' || typeof(first.ownerId)!='undefined' ) )
|
|
762
|
-
{
|
|
763
|
-
_request = prefSection as carriers.Preference_GetPreferenceByNameAndIdRequest;
|
|
764
|
-
_options = prefKey as base.WebApiRequestOptions;
|
|
765
|
-
}
|
|
766
|
-
else
|
|
767
|
-
{
|
|
768
|
-
_request = {
|
|
769
|
-
prefSection: prefSection as string,
|
|
770
|
-
prefKey: prefKey as string,
|
|
771
|
-
prefLevel: prefLevel as enums.PreferenceLevel,
|
|
772
|
-
ownerId: ownerId as number,
|
|
773
|
-
};
|
|
774
|
-
_options = webapi_options;
|
|
775
|
-
}
|
|
776
|
-
return this._getPreferenceByNameAndIdAsync( _request, _options );
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
private async _getNetServicesStatusUrlAsync( options?:base.WebApiRequestOptions) : Promise< string > {
|
|
781
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
782
|
-
base.WebApiBase.SetPending(options);
|
|
783
|
-
return new Promise< string >(async (resolve, reject) => {
|
|
784
|
-
try {
|
|
785
|
-
config.baseURL = this._options.baseUrl;
|
|
786
|
-
const response = await this._axios.post("GetNetServicesStatusUrl", undefined , config);
|
|
787
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
788
|
-
const res : string = response.data as string;
|
|
789
|
-
resolve(res);
|
|
790
|
-
}
|
|
791
|
-
catch( err ) {
|
|
792
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
793
|
-
reject(err);
|
|
794
|
-
}
|
|
795
|
-
});
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
/**
|
|
800
|
-
* Returns URL to status service. e.g. 'https://help.superoffice.com/sodispatcher/v1/status' Returns NULL if status does not need to be checked yet.
|
|
801
|
-
* @returns NULL or URL of the status service that returns an XML or JSON block.
|
|
802
|
-
*/
|
|
803
|
-
public async getNetServicesStatusUrlAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string >
|
|
804
|
-
{
|
|
805
|
-
return this._getNetServicesStatusUrlAsync(webapi_options);
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
private async _updateNetServicesStatusAsync(request: carriers.Preference_UpdateNetServicesStatusRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
810
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
811
|
-
base.WebApiBase.SetPending(options);
|
|
812
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
813
|
-
try {
|
|
814
|
-
config.baseURL = this._options.baseUrl;
|
|
815
|
-
const response = await this._axios.post("UpdateNetServicesStatus", request , config);
|
|
816
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
817
|
-
const res = response.data;
|
|
818
|
-
resolve(res);
|
|
819
|
-
}
|
|
820
|
-
catch( err ) {
|
|
821
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
822
|
-
reject(err);
|
|
823
|
-
}
|
|
824
|
-
});
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
/**
|
|
830
|
-
* Update the NetServices preferences with values contained in the content from the Status URL
|
|
831
|
-
* @param request - XmlOrJson
|
|
832
|
-
* @returns This method has no return value
|
|
833
|
-
*/
|
|
834
|
-
public async updateNetServicesStatusAsync(request: carriers.Preference_UpdateNetServicesStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
835
|
-
|
|
836
|
-
/**
|
|
837
|
-
* Update the NetServices preferences with values contained in the content from the Status URL
|
|
838
|
-
* @param xmlOrJson - The text that was returned by getting the Status URL
|
|
839
|
-
* @returns This method has no return value
|
|
840
|
-
*/
|
|
841
|
-
public async updateNetServicesStatusAsync(xmlOrJson: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
842
|
-
|
|
843
|
-
public async updateNetServicesStatusAsync(xmlOrJson:string|carriers.Preference_UpdateNetServicesStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
844
|
-
let _request : carriers.Preference_UpdateNetServicesStatusRequest = null;
|
|
845
|
-
let _options : base.WebApiRequestOptions = null;
|
|
846
|
-
const first : any = xmlOrJson;
|
|
847
|
-
if( typeof( first ) === "object" && first && ( typeof(first.xmlOrJson)!='undefined' ) )
|
|
848
|
-
{
|
|
849
|
-
_request = xmlOrJson as carriers.Preference_UpdateNetServicesStatusRequest;
|
|
850
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
851
|
-
}
|
|
852
|
-
else
|
|
853
|
-
{
|
|
854
|
-
_request = {
|
|
855
|
-
xmlOrJson: xmlOrJson as string,
|
|
856
|
-
};
|
|
857
|
-
_options = webapi_options;
|
|
858
|
-
}
|
|
859
|
-
return this._updateNetServicesStatusAsync( _request, _options );
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
private async _getXsrfPathsAsync(request: carriers.Preference_GetXsrfPathsRequest, options?:base.WebApiRequestOptions) : Promise< string[] > {
|
|
864
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
865
|
-
base.WebApiBase.SetPending(options);
|
|
866
|
-
return new Promise< string[] >(async (resolve, reject) => {
|
|
867
|
-
try {
|
|
868
|
-
config.baseURL = this._options.baseUrl;
|
|
869
|
-
const response = await this._axios.post("GetXsrfPaths", request , config);
|
|
870
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
871
|
-
const res : string[] = response.data as string[];
|
|
872
|
-
resolve(res);
|
|
873
|
-
}
|
|
874
|
-
catch( err ) {
|
|
875
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
876
|
-
reject(err);
|
|
877
|
-
}
|
|
878
|
-
});
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
/**
|
|
884
|
-
* Returns paths that XSRF cookies should be set on
|
|
885
|
-
* @param request - Hostname
|
|
886
|
-
* @returns Paths that XSRF cookies should be set for: ['/cs', '/crm']
|
|
887
|
-
*/
|
|
888
|
-
public async getXsrfPathsAsync(request: carriers.Preference_GetXsrfPathsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
|
|
889
|
-
|
|
890
|
-
/**
|
|
891
|
-
* Returns paths that XSRF cookies should be set on
|
|
892
|
-
* @param hostname - The hostname that we are storing paths for.
|
|
893
|
-
* @returns Paths that XSRF cookies should be set for: ['/cs', '/crm']
|
|
894
|
-
*/
|
|
895
|
-
public async getXsrfPathsAsync(hostname: string, webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
|
|
896
|
-
|
|
897
|
-
public async getXsrfPathsAsync(hostname:string|carriers.Preference_GetXsrfPathsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string[] > {
|
|
898
|
-
let _request : carriers.Preference_GetXsrfPathsRequest = null;
|
|
899
|
-
let _options : base.WebApiRequestOptions = null;
|
|
900
|
-
const first : any = hostname;
|
|
901
|
-
if( typeof( first ) === "object" && first && ( typeof(first.hostname)!='undefined' ) )
|
|
902
|
-
{
|
|
903
|
-
_request = hostname as carriers.Preference_GetXsrfPathsRequest;
|
|
904
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
905
|
-
}
|
|
906
|
-
else
|
|
907
|
-
{
|
|
908
|
-
_request = {
|
|
909
|
-
hostname: hostname as string,
|
|
910
|
-
};
|
|
911
|
-
_options = webapi_options;
|
|
912
|
-
}
|
|
913
|
-
return this._getXsrfPathsAsync( _request, _options );
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
private async _setXsrfPathsAsync(request: carriers.Preference_SetXsrfPathsRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
918
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
919
|
-
base.WebApiBase.SetPending(options);
|
|
920
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
921
|
-
try {
|
|
922
|
-
config.baseURL = this._options.baseUrl;
|
|
923
|
-
const response = await this._axios.post("SetXsrfPaths", request , config);
|
|
924
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
925
|
-
const res = response.data;
|
|
926
|
-
resolve(res);
|
|
927
|
-
}
|
|
928
|
-
catch( err ) {
|
|
929
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
930
|
-
reject(err);
|
|
931
|
-
}
|
|
932
|
-
});
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
/**
|
|
938
|
-
* Update the paths that need XSRF cookies
|
|
939
|
-
* @param request - Hostname, Paths
|
|
940
|
-
* @returns This method has no return value
|
|
941
|
-
*/
|
|
942
|
-
public async setXsrfPathsAsync(request: carriers.Preference_SetXsrfPathsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
943
|
-
|
|
944
|
-
/**
|
|
945
|
-
* Update the paths that need XSRF cookies
|
|
946
|
-
* @param hostname - The hostname that we are storing paths for.
|
|
947
|
-
* @param paths - Paths that XSRF cookies should be set for: ['/cs', '/crm']
|
|
948
|
-
* @returns This method has no return value
|
|
949
|
-
*/
|
|
950
|
-
public async setXsrfPathsAsync(hostname: string, paths: string[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
951
|
-
|
|
952
|
-
public async setXsrfPathsAsync(hostname:string|carriers.Preference_SetXsrfPathsRequest, paths?:string[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
953
|
-
let _request : carriers.Preference_SetXsrfPathsRequest = null;
|
|
954
|
-
let _options : base.WebApiRequestOptions = null;
|
|
955
|
-
const first : any = hostname;
|
|
956
|
-
if( typeof( first ) === "object" && first && ( typeof(first.hostname)!='undefined' || typeof(first.paths)!='undefined' ) )
|
|
957
|
-
{
|
|
958
|
-
_request = hostname as carriers.Preference_SetXsrfPathsRequest;
|
|
959
|
-
_options = paths as base.WebApiRequestOptions;
|
|
960
|
-
}
|
|
961
|
-
else
|
|
962
|
-
{
|
|
963
|
-
_request = {
|
|
964
|
-
hostname: hostname as string,
|
|
965
|
-
paths: paths as string[],
|
|
966
|
-
};
|
|
967
|
-
_options = webapi_options;
|
|
968
|
-
}
|
|
969
|
-
return this._setXsrfPathsAsync( _request, _options );
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
/**
|
|
973
|
-
* Gets a PreferenceDescription object.
|
|
974
|
-
* @param preferenceDescriptionId - The primary key.
|
|
975
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
976
|
-
* @returns A single PreferenceDescription
|
|
977
|
-
*/
|
|
978
|
-
public async getPreferenceDescriptionAsync(preferenceDescriptionId: number, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription > {
|
|
979
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
980
|
-
base.WebApiBase.SetPending(options);
|
|
981
|
-
return new Promise< carriers.PreferenceDescription >(async (resolve, reject) => {
|
|
982
|
-
try {
|
|
983
|
-
const response = await this._axios.post("GetPreferenceDescription?preferenceDescriptionId=" + preferenceDescriptionId, null, config);
|
|
984
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
985
|
-
const res = converters.Create_PreferenceDescription_From( response.data );
|
|
986
|
-
resolve(res);
|
|
987
|
-
}
|
|
988
|
-
catch( err ) {
|
|
989
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
990
|
-
reject(err);
|
|
991
|
-
}
|
|
992
|
-
});
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
private async _getFromSectionAndKeyAsync(request: carriers.Preference_GetFromSectionAndKeyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription > {
|
|
997
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
998
|
-
base.WebApiBase.SetPending(options);
|
|
999
|
-
return new Promise< carriers.PreferenceDescription >(async (resolve, reject) => {
|
|
1000
|
-
try {
|
|
1001
|
-
config.baseURL = this._options.baseUrl;
|
|
1002
|
-
const response = await this._axios.post("GetFromSectionAndKey", request , config);
|
|
1003
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1004
|
-
const res : carriers.PreferenceDescription = converters.Create_PreferenceDescription_From( response.data );
|
|
1005
|
-
resolve(res);
|
|
1006
|
-
}
|
|
1007
|
-
catch( err ) {
|
|
1008
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1009
|
-
reject(err);
|
|
1010
|
-
}
|
|
1011
|
-
});
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
/**
|
|
1017
|
-
* Gets a PreferenceDescription based on the section and key
|
|
1018
|
-
* @param request - Section, Key
|
|
1019
|
-
* @returns A PreferenceDescription or null
|
|
1020
|
-
*/
|
|
1021
|
-
public async getFromSectionAndKeyAsync(request: carriers.Preference_GetFromSectionAndKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
1022
|
-
|
|
1023
|
-
/**
|
|
1024
|
-
* Gets a PreferenceDescription based on the section and key
|
|
1025
|
-
* @param section - The PreferenceDescription-section
|
|
1026
|
-
* @param key - The PreferenceDescription-key
|
|
1027
|
-
* @returns A PreferenceDescription or null
|
|
1028
|
-
*/
|
|
1029
|
-
public async getFromSectionAndKeyAsync(section: string, key: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
1030
|
-
|
|
1031
|
-
public async getFromSectionAndKeyAsync(section:string|carriers.Preference_GetFromSectionAndKeyRequest, key?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription > {
|
|
1032
|
-
let _request : carriers.Preference_GetFromSectionAndKeyRequest = null;
|
|
1033
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1034
|
-
const first : any = section;
|
|
1035
|
-
if( typeof( first ) === "object" && first && ( typeof(first.section)!='undefined' || typeof(first.key)!='undefined' ) )
|
|
1036
|
-
{
|
|
1037
|
-
_request = section as carriers.Preference_GetFromSectionAndKeyRequest;
|
|
1038
|
-
_options = key as base.WebApiRequestOptions;
|
|
1039
|
-
}
|
|
1040
|
-
else
|
|
1041
|
-
{
|
|
1042
|
-
_request = {
|
|
1043
|
-
section: section as string,
|
|
1044
|
-
key: key as string,
|
|
1045
|
-
};
|
|
1046
|
-
_options = webapi_options;
|
|
1047
|
-
}
|
|
1048
|
-
return this._getFromSectionAndKeyAsync( _request, _options );
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
private async _getAllAsync( options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] > {
|
|
1053
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1054
|
-
base.WebApiBase.SetPending(options);
|
|
1055
|
-
return new Promise< carriers.PreferenceDescription[] >(async (resolve, reject) => {
|
|
1056
|
-
try {
|
|
1057
|
-
config.baseURL = this._options.baseUrl;
|
|
1058
|
-
const response = await this._axios.post("GetAll", undefined , config);
|
|
1059
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1060
|
-
const res : carriers.PreferenceDescription[] = converters.Create_PreferenceDescriptionArray_From( response.data );
|
|
1061
|
-
resolve(res);
|
|
1062
|
-
}
|
|
1063
|
-
catch( err ) {
|
|
1064
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1065
|
-
reject(err);
|
|
1066
|
-
}
|
|
1067
|
-
});
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
/**
|
|
1072
|
-
* Gets a list of all PreferenceDescriptions in the system.
|
|
1073
|
-
* @returns All PreferenceDescriptions in the system
|
|
1074
|
-
*/
|
|
1075
|
-
public async getAllAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] >
|
|
1076
|
-
{
|
|
1077
|
-
return this._getAllAsync(webapi_options);
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
private async _getAllFromSectionAsync(request: carriers.Preference_GetAllFromSectionRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] > {
|
|
1082
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1083
|
-
base.WebApiBase.SetPending(options);
|
|
1084
|
-
return new Promise< carriers.PreferenceDescription[] >(async (resolve, reject) => {
|
|
1085
|
-
try {
|
|
1086
|
-
config.baseURL = this._options.baseUrl;
|
|
1087
|
-
const response = await this._axios.post("GetAllFromSection", request , config);
|
|
1088
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1089
|
-
const res : carriers.PreferenceDescription[] = converters.Create_PreferenceDescriptionArray_From( response.data );
|
|
1090
|
-
resolve(res);
|
|
1091
|
-
}
|
|
1092
|
-
catch( err ) {
|
|
1093
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1094
|
-
reject(err);
|
|
1095
|
-
}
|
|
1096
|
-
});
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
/**
|
|
1102
|
-
* Gets all PreferenceDescription-items in the specified section
|
|
1103
|
-
* @param request - Section
|
|
1104
|
-
* @returns All PreferenceDescriptions found.
|
|
1105
|
-
*/
|
|
1106
|
-
public async getAllFromSectionAsync(request: carriers.Preference_GetAllFromSectionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] >;
|
|
1107
|
-
|
|
1108
|
-
/**
|
|
1109
|
-
* Gets all PreferenceDescription-items in the specified section
|
|
1110
|
-
* @param section - The PreferenceDescription-section
|
|
1111
|
-
* @returns All PreferenceDescriptions found.
|
|
1112
|
-
*/
|
|
1113
|
-
public async getAllFromSectionAsync(section: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] >;
|
|
1114
|
-
|
|
1115
|
-
public async getAllFromSectionAsync(section:string|carriers.Preference_GetAllFromSectionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] > {
|
|
1116
|
-
let _request : carriers.Preference_GetAllFromSectionRequest = null;
|
|
1117
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1118
|
-
const first : any = section;
|
|
1119
|
-
if( typeof( first ) === "object" && first && ( typeof(first.section)!='undefined' ) )
|
|
1120
|
-
{
|
|
1121
|
-
_request = section as carriers.Preference_GetAllFromSectionRequest;
|
|
1122
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
1123
|
-
}
|
|
1124
|
-
else
|
|
1125
|
-
{
|
|
1126
|
-
_request = {
|
|
1127
|
-
section: section as string,
|
|
1128
|
-
};
|
|
1129
|
-
_options = webapi_options;
|
|
1130
|
-
}
|
|
1131
|
-
return this._getAllFromSectionAsync( _request, _options );
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
private async _saveFromSectionAndKeyAsync(request: carriers.Preference_SaveFromSectionAndKeyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription > {
|
|
1136
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1137
|
-
base.WebApiBase.SetPending(options);
|
|
1138
|
-
return new Promise< carriers.PreferenceDescription >(async (resolve, reject) => {
|
|
1139
|
-
try {
|
|
1140
|
-
config.baseURL = this._options.baseUrl;
|
|
1141
|
-
const response = await this._axios.post("SaveFromSectionAndKey", request , config);
|
|
1142
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1143
|
-
const res : carriers.PreferenceDescription = converters.Create_PreferenceDescription_From( response.data );
|
|
1144
|
-
resolve(res);
|
|
1145
|
-
}
|
|
1146
|
-
catch( err ) {
|
|
1147
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1148
|
-
reject(err);
|
|
1149
|
-
}
|
|
1150
|
-
});
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
/**
|
|
1156
|
-
* Update a PreferenceDescription based on the section and key
|
|
1157
|
-
* @param request - Section, Key, PreferenceDescription
|
|
1158
|
-
* @returns Saved PreferenceDescription
|
|
1159
|
-
*/
|
|
1160
|
-
public async saveFromSectionAndKeyAsync(request: carriers.Preference_SaveFromSectionAndKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
1161
|
-
|
|
1162
|
-
/**
|
|
1163
|
-
* Update a PreferenceDescription based on the section and key
|
|
1164
|
-
* @param section - The PreferenceDescription-section
|
|
1165
|
-
* @param key - The PreferenceDescription-key
|
|
1166
|
-
* @param preferenceDescription - The PreferenceDescription to save.
|
|
1167
|
-
* @returns Saved PreferenceDescription
|
|
1168
|
-
*/
|
|
1169
|
-
public async saveFromSectionAndKeyAsync(section: string, key: string, preferenceDescription: carriers.PreferenceDescription, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
1170
|
-
|
|
1171
|
-
public async saveFromSectionAndKeyAsync(section:string|carriers.Preference_SaveFromSectionAndKeyRequest, key?:string|base.WebApiRequestOptions, preferenceDescription?:carriers.PreferenceDescription, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription > {
|
|
1172
|
-
let _request : carriers.Preference_SaveFromSectionAndKeyRequest = null;
|
|
1173
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1174
|
-
const first : any = section;
|
|
1175
|
-
if( typeof( first ) === "object" && first && ( typeof(first.section)!='undefined' || typeof(first.key)!='undefined' || typeof(first.preferenceDescription)!='undefined' ) )
|
|
1176
|
-
{
|
|
1177
|
-
_request = section as carriers.Preference_SaveFromSectionAndKeyRequest;
|
|
1178
|
-
_options = key as base.WebApiRequestOptions;
|
|
1179
|
-
}
|
|
1180
|
-
else
|
|
1181
|
-
{
|
|
1182
|
-
_request = {
|
|
1183
|
-
section: section as string,
|
|
1184
|
-
key: key as string,
|
|
1185
|
-
preferenceDescription: preferenceDescription as carriers.PreferenceDescription,
|
|
1186
|
-
};
|
|
1187
|
-
_options = webapi_options;
|
|
1188
|
-
}
|
|
1189
|
-
return this._saveFromSectionAndKeyAsync( _request, _options );
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
private async _deleteFromSectionAndKeyAsync(request: carriers.Preference_DeleteFromSectionAndKeyRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1194
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1195
|
-
base.WebApiBase.SetPending(options);
|
|
1196
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
1197
|
-
try {
|
|
1198
|
-
config.baseURL = this._options.baseUrl;
|
|
1199
|
-
const response = await this._axios.post("DeleteFromSectionAndKey", request , config);
|
|
1200
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1201
|
-
const res = response.data;
|
|
1202
|
-
resolve(res);
|
|
1203
|
-
}
|
|
1204
|
-
catch( err ) {
|
|
1205
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1206
|
-
reject(err);
|
|
1207
|
-
}
|
|
1208
|
-
});
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
/**
|
|
1214
|
-
* Gets a PreferenceDescription based on the section and key
|
|
1215
|
-
* @param request - Section, Key
|
|
1216
|
-
* @returns This method has no return value
|
|
1217
|
-
*/
|
|
1218
|
-
public async deleteFromSectionAndKeyAsync(request: carriers.Preference_DeleteFromSectionAndKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1219
|
-
|
|
1220
|
-
/**
|
|
1221
|
-
* Gets a PreferenceDescription based on the section and key
|
|
1222
|
-
* @param section - The PreferenceDescription-section
|
|
1223
|
-
* @param key - The PreferenceDescription-key
|
|
1224
|
-
* @returns This method has no return value
|
|
1225
|
-
*/
|
|
1226
|
-
public async deleteFromSectionAndKeyAsync(section: string, key: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1227
|
-
|
|
1228
|
-
public async deleteFromSectionAndKeyAsync(section:string|carriers.Preference_DeleteFromSectionAndKeyRequest, key?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1229
|
-
let _request : carriers.Preference_DeleteFromSectionAndKeyRequest = null;
|
|
1230
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1231
|
-
const first : any = section;
|
|
1232
|
-
if( typeof( first ) === "object" && first && ( typeof(first.section)!='undefined' || typeof(first.key)!='undefined' ) )
|
|
1233
|
-
{
|
|
1234
|
-
_request = section as carriers.Preference_DeleteFromSectionAndKeyRequest;
|
|
1235
|
-
_options = key as base.WebApiRequestOptions;
|
|
1236
|
-
}
|
|
1237
|
-
else
|
|
1238
|
-
{
|
|
1239
|
-
_request = {
|
|
1240
|
-
section: section as string,
|
|
1241
|
-
key: key as string,
|
|
1242
|
-
};
|
|
1243
|
-
_options = webapi_options;
|
|
1244
|
-
}
|
|
1245
|
-
return this._deleteFromSectionAndKeyAsync( _request, _options );
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
/**
|
|
1249
|
-
* Gets a PreferenceDescriptionLine object.
|
|
1250
|
-
* @param preferenceDescriptionLineId - The primary key.
|
|
1251
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
1252
|
-
* @returns A single PreferenceDescriptionLine
|
|
1253
|
-
*/
|
|
1254
|
-
public async getPreferenceDescriptionLineAsync(preferenceDescriptionLineId: number, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine > {
|
|
1255
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1256
|
-
base.WebApiBase.SetPending(options);
|
|
1257
|
-
return new Promise< carriers.PreferenceDescriptionLine >(async (resolve, reject) => {
|
|
1258
|
-
try {
|
|
1259
|
-
const response = await this._axios.post("GetPreferenceDescriptionLine?preferenceDescriptionLineId=" + preferenceDescriptionLineId, null, config);
|
|
1260
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1261
|
-
const res = converters.Create_PreferenceDescriptionLine_From( response.data );
|
|
1262
|
-
resolve(res);
|
|
1263
|
-
}
|
|
1264
|
-
catch( err ) {
|
|
1265
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1266
|
-
reject(err);
|
|
1267
|
-
}
|
|
1268
|
-
});
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
private async _getPreferenceDescriptionLineFromIdAndValueAsync(request: carriers.Preference_GetPreferenceDescriptionLineFromIdAndValueRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine > {
|
|
1273
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1274
|
-
base.WebApiBase.SetPending(options);
|
|
1275
|
-
return new Promise< carriers.PreferenceDescriptionLine >(async (resolve, reject) => {
|
|
1276
|
-
try {
|
|
1277
|
-
config.baseURL = this._options.baseUrl;
|
|
1278
|
-
const response = await this._axios.post("GetPreferenceDescriptionLineFromIdAndValue", request , config);
|
|
1279
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1280
|
-
const res : carriers.PreferenceDescriptionLine = converters.Create_PreferenceDescriptionLine_From( response.data );
|
|
1281
|
-
resolve(res);
|
|
1282
|
-
}
|
|
1283
|
-
catch( err ) {
|
|
1284
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1285
|
-
reject(err);
|
|
1286
|
-
}
|
|
1287
|
-
});
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
/**
|
|
1293
|
-
* Get a preference description line from a prefDesc_id and a prefValue
|
|
1294
|
-
* @param request - PrefDescId, PrefValue
|
|
1295
|
-
* @returns The preference description line matching the id and the value
|
|
1296
|
-
*/
|
|
1297
|
-
public async getPreferenceDescriptionLineFromIdAndValueAsync(request: carriers.Preference_GetPreferenceDescriptionLineFromIdAndValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine >;
|
|
1298
|
-
|
|
1299
|
-
/**
|
|
1300
|
-
* Get a preference description line from a prefDesc_id and a prefValue
|
|
1301
|
-
* @param prefDescId - The id of the preference description this line is connected to
|
|
1302
|
-
* @param prefValue - The value of the description line to return
|
|
1303
|
-
* @returns The preference description line matching the id and the value
|
|
1304
|
-
*/
|
|
1305
|
-
public async getPreferenceDescriptionLineFromIdAndValueAsync(prefDescId: number, prefValue: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine >;
|
|
1306
|
-
|
|
1307
|
-
public async getPreferenceDescriptionLineFromIdAndValueAsync(prefDescId:number|carriers.Preference_GetPreferenceDescriptionLineFromIdAndValueRequest, prefValue?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine > {
|
|
1308
|
-
let _request : carriers.Preference_GetPreferenceDescriptionLineFromIdAndValueRequest = null;
|
|
1309
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1310
|
-
const first : any = prefDescId;
|
|
1311
|
-
if( typeof( first ) === "object" && first && ( typeof(first.prefDescId)!='undefined' || typeof(first.prefValue)!='undefined' ) )
|
|
1312
|
-
{
|
|
1313
|
-
_request = prefDescId as carriers.Preference_GetPreferenceDescriptionLineFromIdAndValueRequest;
|
|
1314
|
-
_options = prefValue as base.WebApiRequestOptions;
|
|
1315
|
-
}
|
|
1316
|
-
else
|
|
1317
|
-
{
|
|
1318
|
-
_request = {
|
|
1319
|
-
prefDescId: prefDescId as number,
|
|
1320
|
-
prefValue: prefValue as string,
|
|
1321
|
-
};
|
|
1322
|
-
_options = webapi_options;
|
|
1323
|
-
}
|
|
1324
|
-
return this._getPreferenceDescriptionLineFromIdAndValueAsync( _request, _options );
|
|
1325
|
-
}
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
private async _getPreferenceDescriptionLinesByPrefDescIdAsync(request: carriers.Preference_GetPreferenceDescriptionLinesByPrefDescIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] > {
|
|
1329
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1330
|
-
base.WebApiBase.SetPending(options);
|
|
1331
|
-
return new Promise< carriers.PreferenceDescriptionLine[] >(async (resolve, reject) => {
|
|
1332
|
-
try {
|
|
1333
|
-
config.baseURL = this._options.baseUrl;
|
|
1334
|
-
const response = await this._axios.post("GetPreferenceDescriptionLinesByPrefDescId", request , config);
|
|
1335
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1336
|
-
const res : carriers.PreferenceDescriptionLine[] = converters.Create_PreferenceDescriptionLineArray_From( response.data );
|
|
1337
|
-
resolve(res);
|
|
1338
|
-
}
|
|
1339
|
-
catch( err ) {
|
|
1340
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1341
|
-
reject(err);
|
|
1342
|
-
}
|
|
1343
|
-
});
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
/**
|
|
1349
|
-
* Get all preference description lines from a prefDesc_id
|
|
1350
|
-
* @param request - PrefDescId
|
|
1351
|
-
* @returns The preference description lines matching the id
|
|
1352
|
-
*/
|
|
1353
|
-
public async getPreferenceDescriptionLinesByPrefDescIdAsync(request: carriers.Preference_GetPreferenceDescriptionLinesByPrefDescIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
1354
|
-
|
|
1355
|
-
/**
|
|
1356
|
-
* Get all preference description lines from a prefDesc_id
|
|
1357
|
-
* @param prefDescId - The id of the preference description this line is connected to
|
|
1358
|
-
* @returns The preference description lines matching the id
|
|
1359
|
-
*/
|
|
1360
|
-
public async getPreferenceDescriptionLinesByPrefDescIdAsync(prefDescId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
1361
|
-
|
|
1362
|
-
public async getPreferenceDescriptionLinesByPrefDescIdAsync(prefDescId:number|carriers.Preference_GetPreferenceDescriptionLinesByPrefDescIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] > {
|
|
1363
|
-
let _request : carriers.Preference_GetPreferenceDescriptionLinesByPrefDescIdRequest = null;
|
|
1364
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1365
|
-
const first : any = prefDescId;
|
|
1366
|
-
if( typeof( first ) === "object" && first && ( typeof(first.prefDescId)!='undefined' ) )
|
|
1367
|
-
{
|
|
1368
|
-
_request = prefDescId as carriers.Preference_GetPreferenceDescriptionLinesByPrefDescIdRequest;
|
|
1369
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
1370
|
-
}
|
|
1371
|
-
else
|
|
1372
|
-
{
|
|
1373
|
-
_request = {
|
|
1374
|
-
prefDescId: prefDescId as number,
|
|
1375
|
-
};
|
|
1376
|
-
_options = webapi_options;
|
|
1377
|
-
}
|
|
1378
|
-
return this._getPreferenceDescriptionLinesByPrefDescIdAsync( _request, _options );
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
private async _savePreferenceDescriptionLinesAsync(request: carriers.Preference_SavePreferenceDescriptionLinesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] > {
|
|
1383
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1384
|
-
base.WebApiBase.SetPending(options);
|
|
1385
|
-
return new Promise< carriers.PreferenceDescriptionLine[] >(async (resolve, reject) => {
|
|
1386
|
-
try {
|
|
1387
|
-
config.baseURL = this._options.baseUrl;
|
|
1388
|
-
const response = await this._axios.post("SavePreferenceDescriptionLines", request , config);
|
|
1389
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1390
|
-
const res : carriers.PreferenceDescriptionLine[] = converters.Create_PreferenceDescriptionLineArray_From( response.data );
|
|
1391
|
-
resolve(res);
|
|
1392
|
-
}
|
|
1393
|
-
catch( err ) {
|
|
1394
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1395
|
-
reject(err);
|
|
1396
|
-
}
|
|
1397
|
-
});
|
|
1398
|
-
}
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
/**
|
|
1403
|
-
* Saves the PreferenceDescriptionLine array in the SuperOffice database
|
|
1404
|
-
* @param request - PreferenceDescriptionLines
|
|
1405
|
-
* @returns The updated PrefDesc lines (If the PreferenceDescriptionLine array was new, it returns with id's set.
|
|
1406
|
-
*/
|
|
1407
|
-
public async savePreferenceDescriptionLinesAsync(request: carriers.Preference_SavePreferenceDescriptionLinesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
1408
|
-
|
|
1409
|
-
/**
|
|
1410
|
-
* Saves the PreferenceDescriptionLine array in the SuperOffice database
|
|
1411
|
-
* @param preferenceDescriptionLines - The PreferenceDescriptionLine array to save.
|
|
1412
|
-
* @returns The updated PrefDesc lines (If the PreferenceDescriptionLine array was new, it returns with id's set.
|
|
1413
|
-
*/
|
|
1414
|
-
public async savePreferenceDescriptionLinesAsync(preferenceDescriptionLines: carriers.PreferenceDescriptionLine[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
1415
|
-
|
|
1416
|
-
public async savePreferenceDescriptionLinesAsync(preferenceDescriptionLines:carriers.PreferenceDescriptionLine[]|carriers.Preference_SavePreferenceDescriptionLinesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] > {
|
|
1417
|
-
let _request : carriers.Preference_SavePreferenceDescriptionLinesRequest = null;
|
|
1418
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1419
|
-
const first : any = preferenceDescriptionLines;
|
|
1420
|
-
if( typeof( first ) === "object" && first && ( typeof(first.preferenceDescriptionLines)!='undefined' ) )
|
|
1421
|
-
{
|
|
1422
|
-
_request = preferenceDescriptionLines as carriers.Preference_SavePreferenceDescriptionLinesRequest;
|
|
1423
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
1424
|
-
}
|
|
1425
|
-
else
|
|
1426
|
-
{
|
|
1427
|
-
_request = {
|
|
1428
|
-
preferenceDescriptionLines: preferenceDescriptionLines as carriers.PreferenceDescriptionLine[],
|
|
1429
|
-
};
|
|
1430
|
-
_options = webapi_options;
|
|
1431
|
-
}
|
|
1432
|
-
return this._savePreferenceDescriptionLinesAsync( _request, _options );
|
|
1433
|
-
}
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
private async _deletePreferenceDescriptionLinesAsync(request: carriers.Preference_DeletePreferenceDescriptionLinesRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1437
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1438
|
-
base.WebApiBase.SetPending(options);
|
|
1439
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
1440
|
-
try {
|
|
1441
|
-
config.baseURL = this._options.baseUrl;
|
|
1442
|
-
const response = await this._axios.post("DeletePreferenceDescriptionLines", request , config);
|
|
1443
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1444
|
-
const res = response.data;
|
|
1445
|
-
resolve(res);
|
|
1446
|
-
}
|
|
1447
|
-
catch( err ) {
|
|
1448
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1449
|
-
reject(err);
|
|
1450
|
-
}
|
|
1451
|
-
});
|
|
1452
|
-
}
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
/**
|
|
1457
|
-
* Delete the PrefDescLines in the SuperOffice database
|
|
1458
|
-
* @param request - PrefDescLineIds
|
|
1459
|
-
* @returns Nothing
|
|
1460
|
-
*/
|
|
1461
|
-
public async deletePreferenceDescriptionLinesAsync(request: carriers.Preference_DeletePreferenceDescriptionLinesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1462
|
-
|
|
1463
|
-
/**
|
|
1464
|
-
* Delete the PrefDescLines in the SuperOffice database
|
|
1465
|
-
* @param prefDescLineIds - Primary keys of the PrefDescLines to delete
|
|
1466
|
-
* @returns Nothing
|
|
1467
|
-
*/
|
|
1468
|
-
public async deletePreferenceDescriptionLinesAsync(prefDescLineIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1469
|
-
|
|
1470
|
-
public async deletePreferenceDescriptionLinesAsync(prefDescLineIds:number[]|carriers.Preference_DeletePreferenceDescriptionLinesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1471
|
-
let _request : carriers.Preference_DeletePreferenceDescriptionLinesRequest = null;
|
|
1472
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1473
|
-
const first : any = prefDescLineIds;
|
|
1474
|
-
if( typeof( first ) === "object" && first && ( typeof(first.prefDescLineIds)!='undefined' ) )
|
|
1475
|
-
{
|
|
1476
|
-
_request = prefDescLineIds as carriers.Preference_DeletePreferenceDescriptionLinesRequest;
|
|
1477
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
1478
|
-
}
|
|
1479
|
-
else
|
|
1480
|
-
{
|
|
1481
|
-
_request = {
|
|
1482
|
-
prefDescLineIds: prefDescLineIds as number[],
|
|
1483
|
-
};
|
|
1484
|
-
_options = webapi_options;
|
|
1485
|
-
}
|
|
1486
|
-
return this._deletePreferenceDescriptionLinesAsync( _request, _options );
|
|
1487
|
-
}
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
private async _deletePrefDescLinesByPrefDescIdAsync(request: carriers.Preference_DeletePrefDescLinesByPrefDescIdRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1491
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1492
|
-
base.WebApiBase.SetPending(options);
|
|
1493
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
1494
|
-
try {
|
|
1495
|
-
config.baseURL = this._options.baseUrl;
|
|
1496
|
-
const response = await this._axios.post("DeletePrefDescLinesByPrefDescId", request , config);
|
|
1497
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1498
|
-
const res = response.data;
|
|
1499
|
-
resolve(res);
|
|
1500
|
-
}
|
|
1501
|
-
catch( err ) {
|
|
1502
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1503
|
-
reject(err);
|
|
1504
|
-
}
|
|
1505
|
-
});
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
/**
|
|
1511
|
-
* Delete the PrefDescLines associated with Preference Description Id in the SuperOffice database
|
|
1512
|
-
* @param request - PrefDescId
|
|
1513
|
-
* @returns Nothing
|
|
1514
|
-
*/
|
|
1515
|
-
public async deletePrefDescLinesByPrefDescIdAsync(request: carriers.Preference_DeletePrefDescLinesByPrefDescIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1516
|
-
|
|
1517
|
-
/**
|
|
1518
|
-
* Delete the PrefDescLines associated with Preference Description Id in the SuperOffice database
|
|
1519
|
-
* @param prefDescId - Primary key of the Preference Description that contains PrefDescLines to delete
|
|
1520
|
-
* @returns Nothing
|
|
1521
|
-
*/
|
|
1522
|
-
public async deletePrefDescLinesByPrefDescIdAsync(prefDescId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1523
|
-
|
|
1524
|
-
public async deletePrefDescLinesByPrefDescIdAsync(prefDescId:number|carriers.Preference_DeletePrefDescLinesByPrefDescIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1525
|
-
let _request : carriers.Preference_DeletePrefDescLinesByPrefDescIdRequest = null;
|
|
1526
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1527
|
-
const first : any = prefDescId;
|
|
1528
|
-
if( typeof( first ) === "object" && first && ( typeof(first.prefDescId)!='undefined' ) )
|
|
1529
|
-
{
|
|
1530
|
-
_request = prefDescId as carriers.Preference_DeletePrefDescLinesByPrefDescIdRequest;
|
|
1531
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
1532
|
-
}
|
|
1533
|
-
else
|
|
1534
|
-
{
|
|
1535
|
-
_request = {
|
|
1536
|
-
prefDescId: prefDescId as number,
|
|
1537
|
-
};
|
|
1538
|
-
_options = webapi_options;
|
|
1539
|
-
}
|
|
1540
|
-
return this._deletePrefDescLinesByPrefDescIdAsync( _request, _options );
|
|
1541
|
-
}
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
private async _deletePrefDescLinesByPrefDescIdsAsync(request: carriers.Preference_DeletePrefDescLinesByPrefDescIdsRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1545
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1546
|
-
base.WebApiBase.SetPending(options);
|
|
1547
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
1548
|
-
try {
|
|
1549
|
-
config.baseURL = this._options.baseUrl;
|
|
1550
|
-
const response = await this._axios.post("DeletePrefDescLinesByPrefDescIds", request , config);
|
|
1551
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1552
|
-
const res = response.data;
|
|
1553
|
-
resolve(res);
|
|
1554
|
-
}
|
|
1555
|
-
catch( err ) {
|
|
1556
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1557
|
-
reject(err);
|
|
1558
|
-
}
|
|
1559
|
-
});
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
/**
|
|
1565
|
-
* Delete the PrefDescLines associated with Preference Description Ids in the SuperOffice database
|
|
1566
|
-
* @param request - PrefDescIds
|
|
1567
|
-
* @returns Nothing
|
|
1568
|
-
*/
|
|
1569
|
-
public async deletePrefDescLinesByPrefDescIdsAsync(request: carriers.Preference_DeletePrefDescLinesByPrefDescIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1570
|
-
|
|
1571
|
-
/**
|
|
1572
|
-
* Delete the PrefDescLines associated with Preference Description Ids in the SuperOffice database
|
|
1573
|
-
* @param prefDescIds - Primary keys of the Preference Descriptions that contains PrefDescLines to delete
|
|
1574
|
-
* @returns Nothing
|
|
1575
|
-
*/
|
|
1576
|
-
public async deletePrefDescLinesByPrefDescIdsAsync(prefDescIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1577
|
-
|
|
1578
|
-
public async deletePrefDescLinesByPrefDescIdsAsync(prefDescIds:number[]|carriers.Preference_DeletePrefDescLinesByPrefDescIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1579
|
-
let _request : carriers.Preference_DeletePrefDescLinesByPrefDescIdsRequest = null;
|
|
1580
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1581
|
-
const first : any = prefDescIds;
|
|
1582
|
-
if( typeof( first ) === "object" && first && ( typeof(first.prefDescIds)!='undefined' ) )
|
|
1583
|
-
{
|
|
1584
|
-
_request = prefDescIds as carriers.Preference_DeletePrefDescLinesByPrefDescIdsRequest;
|
|
1585
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
1586
|
-
}
|
|
1587
|
-
else
|
|
1588
|
-
{
|
|
1589
|
-
_request = {
|
|
1590
|
-
prefDescIds: prefDescIds as number[],
|
|
1591
|
-
};
|
|
1592
|
-
_options = webapi_options;
|
|
1593
|
-
}
|
|
1594
|
-
return this._deletePrefDescLinesByPrefDescIdsAsync( _request, _options );
|
|
1595
|
-
}
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
private async _getPreferencesAsync(request: carriers.Preference_GetPreferencesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] > {
|
|
1599
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1600
|
-
base.WebApiBase.SetPending(options);
|
|
1601
|
-
return new Promise< carriers.Preference[] >(async (resolve, reject) => {
|
|
1602
|
-
try {
|
|
1603
|
-
config.baseURL = this._options.baseUrl;
|
|
1604
|
-
const response = await this._axios.post("GetPreferences", request , config);
|
|
1605
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1606
|
-
const res : carriers.Preference[] = converters.Create_PreferenceArray_From( response.data );
|
|
1607
|
-
resolve(res);
|
|
1608
|
-
}
|
|
1609
|
-
catch( err ) {
|
|
1610
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1611
|
-
reject(err);
|
|
1612
|
-
}
|
|
1613
|
-
});
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
/**
|
|
1619
|
-
* Get one or more preferences based on a set of specifications.<br/>The prefDisplayvalue and prefDisplaytooltip are blank (faster processing relative to GetPreferencesWithDisplayValues)
|
|
1620
|
-
* @param request - Specifications
|
|
1621
|
-
* @returns Array of preference values for your given specification(s). More strictly: 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere.
|
|
1622
|
-
*/
|
|
1623
|
-
public async getPreferencesAsync(request: carriers.Preference_GetPreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
1624
|
-
|
|
1625
|
-
/**
|
|
1626
|
-
* Get one or more preferences based on a set of specifications.<br/>The prefDisplayvalue and prefDisplaytooltip are blank (faster processing relative to GetPreferencesWithDisplayValues)
|
|
1627
|
-
* @param specifications - Array of preference specifications. The key value may be * (asterisk), which means 'all keys within section'. Note that the semantics of this are more strictly 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere. You can also have askerisk as the section name. In that case the specification array must contain exactly one entry and the key must also be asterisk. This will return all known preferences in all sections for your associate. It might be a lot, tests have shown that a heavily used database can accumulate up to 500 preferences on a single associate. If the Sentry table/field right preferences have been used, the number could be a lot greater!
|
|
1628
|
-
* @returns Array of preference values for your given specification(s). More strictly: 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere.
|
|
1629
|
-
*/
|
|
1630
|
-
public async getPreferencesAsync(specifications: carriers.PreferenceSpec[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
1631
|
-
|
|
1632
|
-
public async getPreferencesAsync(specifications:carriers.PreferenceSpec[]|carriers.Preference_GetPreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] > {
|
|
1633
|
-
let _request : carriers.Preference_GetPreferencesRequest = null;
|
|
1634
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1635
|
-
const first : any = specifications;
|
|
1636
|
-
if( typeof( first ) === "object" && first && ( typeof(first.specifications)!='undefined' ) )
|
|
1637
|
-
{
|
|
1638
|
-
_request = specifications as carriers.Preference_GetPreferencesRequest;
|
|
1639
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
1640
|
-
}
|
|
1641
|
-
else
|
|
1642
|
-
{
|
|
1643
|
-
_request = {
|
|
1644
|
-
specifications: specifications as carriers.PreferenceSpec[],
|
|
1645
|
-
};
|
|
1646
|
-
_options = webapi_options;
|
|
1647
|
-
}
|
|
1648
|
-
return this._getPreferencesAsync( _request, _options );
|
|
1649
|
-
}
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
private async _savePreferencesAsync(request: carriers.Preference_SavePreferencesRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1653
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1654
|
-
base.WebApiBase.SetPending(options);
|
|
1655
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
1656
|
-
try {
|
|
1657
|
-
config.baseURL = this._options.baseUrl;
|
|
1658
|
-
const response = await this._axios.post("SavePreferences", request , config);
|
|
1659
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1660
|
-
const res = response.data;
|
|
1661
|
-
resolve(res);
|
|
1662
|
-
}
|
|
1663
|
-
catch( err ) {
|
|
1664
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1665
|
-
reject(err);
|
|
1666
|
-
}
|
|
1667
|
-
});
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
/**
|
|
1673
|
-
* Save this set of preferences. Note this method DOES NOT look at level/targetId - it only saves on behalf of the CURRENT USER.
|
|
1674
|
-
* @param request - Preferences
|
|
1675
|
-
* @returns
|
|
1676
|
-
*/
|
|
1677
|
-
public async savePreferencesAsync(request: carriers.Preference_SavePreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1678
|
-
|
|
1679
|
-
/**
|
|
1680
|
-
* Save this set of preferences. Note this method DOES NOT look at level/targetId - it only saves on behalf of the CURRENT USER.
|
|
1681
|
-
* @param preferences - Preferences to be saved. Note that all fields must be filled in, and the preference will be saved on the Associate level only! Setting for other levels is an administrative task and not available through this service.
|
|
1682
|
-
* @returns
|
|
1683
|
-
*/
|
|
1684
|
-
public async savePreferencesAsync(preferences: carriers.Preference[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1685
|
-
|
|
1686
|
-
public async savePreferencesAsync(preferences:carriers.Preference[]|carriers.Preference_SavePreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1687
|
-
let _request : carriers.Preference_SavePreferencesRequest = null;
|
|
1688
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1689
|
-
const first : any = preferences;
|
|
1690
|
-
if( typeof( first ) === "object" && first && ( typeof(first.preferences)!='undefined' ) )
|
|
1691
|
-
{
|
|
1692
|
-
_request = preferences as carriers.Preference_SavePreferencesRequest;
|
|
1693
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
1694
|
-
}
|
|
1695
|
-
else
|
|
1696
|
-
{
|
|
1697
|
-
_request = {
|
|
1698
|
-
preferences: preferences as carriers.Preference[],
|
|
1699
|
-
};
|
|
1700
|
-
_options = webapi_options;
|
|
1701
|
-
}
|
|
1702
|
-
return this._savePreferencesAsync( _request, _options );
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
private async _getPreferencesWithDisplayValuesAsync(request: carriers.Preference_GetPreferencesWithDisplayValuesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] > {
|
|
1707
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1708
|
-
base.WebApiBase.SetPending(options);
|
|
1709
|
-
return new Promise< carriers.Preference[] >(async (resolve, reject) => {
|
|
1710
|
-
try {
|
|
1711
|
-
config.baseURL = this._options.baseUrl;
|
|
1712
|
-
const response = await this._axios.post("GetPreferencesWithDisplayValues", request , config);
|
|
1713
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1714
|
-
const res : carriers.Preference[] = converters.Create_PreferenceArray_From( response.data );
|
|
1715
|
-
resolve(res);
|
|
1716
|
-
}
|
|
1717
|
-
catch( err ) {
|
|
1718
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1719
|
-
reject(err);
|
|
1720
|
-
}
|
|
1721
|
-
});
|
|
1722
|
-
}
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
/**
|
|
1727
|
-
* Get one or more preferences based on a set of specifications<br/>The PrefDisplayValue and PrefDisplaytooltip are populated, at some additional processing cost.
|
|
1728
|
-
* @param request - Specifications
|
|
1729
|
-
* @returns Array of preference values for your given specification(s). More strictly: 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere.<br/>The PrefDisplayValue and PrefDisplaytooltip are populated, at some additional processing cost.
|
|
1730
|
-
*/
|
|
1731
|
-
public async getPreferencesWithDisplayValuesAsync(request: carriers.Preference_GetPreferencesWithDisplayValuesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
1732
|
-
|
|
1733
|
-
/**
|
|
1734
|
-
* Get one or more preferences based on a set of specifications<br/>The PrefDisplayValue and PrefDisplaytooltip are populated, at some additional processing cost.
|
|
1735
|
-
* @param specifications - Array of preference specifications. The key value may be * (asterisk), which means 'all keys within section'. Note that the semantics of this are more strictly 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere. You can also have askerisk as the section name. In that case the specification array must contain exactly one entry and the key must also be asterisk. This will return all known preferences in all sections for your associate. It might be a lot, tests have shown that a heavily used database can accumulate up to 500 preferences on a single associate. If the Sentry table/field right preferences have been used, the number could be a lot greater!
|
|
1736
|
-
* @returns Array of preference values for your given specification(s). More strictly: 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere.<br/>The PrefDisplayValue and PrefDisplaytooltip are populated, at some additional processing cost.
|
|
1737
|
-
*/
|
|
1738
|
-
public async getPreferencesWithDisplayValuesAsync(specifications: carriers.PreferenceSpec[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
1739
|
-
|
|
1740
|
-
public async getPreferencesWithDisplayValuesAsync(specifications:carriers.PreferenceSpec[]|carriers.Preference_GetPreferencesWithDisplayValuesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] > {
|
|
1741
|
-
let _request : carriers.Preference_GetPreferencesWithDisplayValuesRequest = null;
|
|
1742
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1743
|
-
const first : any = specifications;
|
|
1744
|
-
if( typeof( first ) === "object" && first && ( typeof(first.specifications)!='undefined' ) )
|
|
1745
|
-
{
|
|
1746
|
-
_request = specifications as carriers.Preference_GetPreferencesWithDisplayValuesRequest;
|
|
1747
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
1748
|
-
}
|
|
1749
|
-
else
|
|
1750
|
-
{
|
|
1751
|
-
_request = {
|
|
1752
|
-
specifications: specifications as carriers.PreferenceSpec[],
|
|
1753
|
-
};
|
|
1754
|
-
_options = webapi_options;
|
|
1755
|
-
}
|
|
1756
|
-
return this._getPreferencesWithDisplayValuesAsync( _request, _options );
|
|
1757
|
-
}
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
private async _getTabOrdersAsync( options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder[] > {
|
|
1761
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1762
|
-
base.WebApiBase.SetPending(options);
|
|
1763
|
-
return new Promise< carriers.TabOrder[] >(async (resolve, reject) => {
|
|
1764
|
-
try {
|
|
1765
|
-
config.baseURL = this._options.baseUrl;
|
|
1766
|
-
const response = await this._axios.post("GetTabOrders", undefined , config);
|
|
1767
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1768
|
-
const res : carriers.TabOrder[] = converters.Create_TabOrderArray_From( response.data );
|
|
1769
|
-
resolve(res);
|
|
1770
|
-
}
|
|
1771
|
-
catch( err ) {
|
|
1772
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1773
|
-
reject(err);
|
|
1774
|
-
}
|
|
1775
|
-
});
|
|
1776
|
-
}
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
/**
|
|
1780
|
-
*
|
|
1781
|
-
* @returns
|
|
1782
|
-
*/
|
|
1783
|
-
public async getTabOrdersAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder[] >
|
|
1784
|
-
{
|
|
1785
|
-
return this._getTabOrdersAsync(webapi_options);
|
|
1786
|
-
}
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
private async _saveTabOrdersAsync(request: carriers.Preference_SaveTabOrdersRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1790
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1791
|
-
base.WebApiBase.SetPending(options);
|
|
1792
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
1793
|
-
try {
|
|
1794
|
-
config.baseURL = this._options.baseUrl;
|
|
1795
|
-
const response = await this._axios.post("SaveTabOrders", request , config);
|
|
1796
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1797
|
-
const res = response.data;
|
|
1798
|
-
resolve(res);
|
|
1799
|
-
}
|
|
1800
|
-
catch( err ) {
|
|
1801
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1802
|
-
reject(err);
|
|
1803
|
-
}
|
|
1804
|
-
});
|
|
1805
|
-
}
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
/**
|
|
1810
|
-
*
|
|
1811
|
-
* @param request - TabOrders
|
|
1812
|
-
* @returns
|
|
1813
|
-
*/
|
|
1814
|
-
public async saveTabOrdersAsync(request: carriers.Preference_SaveTabOrdersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1815
|
-
|
|
1816
|
-
/**
|
|
1817
|
-
*
|
|
1818
|
-
* @param tabOrders -
|
|
1819
|
-
* @returns
|
|
1820
|
-
*/
|
|
1821
|
-
public async saveTabOrdersAsync(tabOrders: carriers.TabOrder[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1822
|
-
|
|
1823
|
-
public async saveTabOrdersAsync(tabOrders:carriers.TabOrder[]|carriers.Preference_SaveTabOrdersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1824
|
-
let _request : carriers.Preference_SaveTabOrdersRequest = null;
|
|
1825
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1826
|
-
const first : any = tabOrders;
|
|
1827
|
-
if( typeof( first ) === "object" && first && ( typeof(first.tabOrders)!='undefined' ) )
|
|
1828
|
-
{
|
|
1829
|
-
_request = tabOrders as carriers.Preference_SaveTabOrdersRequest;
|
|
1830
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
1831
|
-
}
|
|
1832
|
-
else
|
|
1833
|
-
{
|
|
1834
|
-
_request = {
|
|
1835
|
-
tabOrders: tabOrders as carriers.TabOrder[],
|
|
1836
|
-
};
|
|
1837
|
-
_options = webapi_options;
|
|
1838
|
-
}
|
|
1839
|
-
return this._saveTabOrdersAsync( _request, _options );
|
|
1840
|
-
}
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
private async _savePreferenceEntitiesAsync(request: carriers.Preference_SavePreferenceEntitiesRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1844
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1845
|
-
base.WebApiBase.SetPending(options);
|
|
1846
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
1847
|
-
try {
|
|
1848
|
-
config.baseURL = this._options.baseUrl;
|
|
1849
|
-
const response = await this._axios.post("SavePreferenceEntities", request , config);
|
|
1850
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1851
|
-
const res = response.data;
|
|
1852
|
-
resolve(res);
|
|
1853
|
-
}
|
|
1854
|
-
catch( err ) {
|
|
1855
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1856
|
-
reject(err);
|
|
1857
|
-
}
|
|
1858
|
-
});
|
|
1859
|
-
}
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
/**
|
|
1864
|
-
* Save this set of preferences.
|
|
1865
|
-
* @param request - Preferences, RemoveLowerLevels
|
|
1866
|
-
* @returns
|
|
1867
|
-
*/
|
|
1868
|
-
public async savePreferenceEntitiesAsync(request: carriers.Preference_SavePreferenceEntitiesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1869
|
-
|
|
1870
|
-
/**
|
|
1871
|
-
* Save this set of preferences.
|
|
1872
|
-
* @param preferences - Preferences to be saved. Note that all fields must be filled in.
|
|
1873
|
-
* @param removeLowerLevels - If this is true, all user preferences on lower levels will be deleted
|
|
1874
|
-
* @returns
|
|
1875
|
-
*/
|
|
1876
|
-
public async savePreferenceEntitiesAsync(preferences: carriers.Preference[], removeLowerLevels: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1877
|
-
|
|
1878
|
-
public async savePreferenceEntitiesAsync(preferences:carriers.Preference[]|carriers.Preference_SavePreferenceEntitiesRequest, removeLowerLevels?:boolean|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1879
|
-
let _request : carriers.Preference_SavePreferenceEntitiesRequest = null;
|
|
1880
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1881
|
-
const first : any = preferences;
|
|
1882
|
-
if( typeof( first ) === "object" && first && ( typeof(first.preferences)!='undefined' || typeof(first.removeLowerLevels)!='undefined' ) )
|
|
1883
|
-
{
|
|
1884
|
-
_request = preferences as carriers.Preference_SavePreferenceEntitiesRequest;
|
|
1885
|
-
_options = removeLowerLevels as base.WebApiRequestOptions;
|
|
1886
|
-
}
|
|
1887
|
-
else
|
|
1888
|
-
{
|
|
1889
|
-
_request = {
|
|
1890
|
-
preferences: preferences as carriers.Preference[],
|
|
1891
|
-
removeLowerLevels: removeLowerLevels as boolean,
|
|
1892
|
-
};
|
|
1893
|
-
_options = webapi_options;
|
|
1894
|
-
}
|
|
1895
|
-
return this._savePreferenceEntitiesAsync( _request, _options );
|
|
1896
|
-
}
|
|
1897
|
-
|
|
1898
|
-
} // class v1PreferenceAgentController
|
|
1899
|
-
|
|
1900
|
-
|
|
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/PreferenceAgent.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
|
+
* Preferences, user interface tab configuration
|
|
28
|
+
*/
|
|
29
|
+
export interface IPreferenceAgent {
|
|
30
|
+
createDefaultPreferenceAsync(): Promise< carriers.Preference >;
|
|
31
|
+
createDefaultPreferenceDescriptionAsync(): Promise< carriers.PreferenceDescription >;
|
|
32
|
+
savePreferenceDescriptionAsync(entity: carriers.PreferenceDescription) : Promise< carriers.PreferenceDescription >;
|
|
33
|
+
deletePreferenceDescriptionAsync(PreferenceDescriptionId: number) : Promise<void>;
|
|
34
|
+
createDefaultPreferenceDescriptionLineAsync(): Promise< carriers.PreferenceDescriptionLine >;
|
|
35
|
+
savePreferenceDescriptionLineAsync(entity: carriers.PreferenceDescriptionLine) : Promise< carriers.PreferenceDescriptionLine >;
|
|
36
|
+
deletePreferenceDescriptionLineAsync(PreferenceDescriptionLineId: number) : Promise<void>;
|
|
37
|
+
savePreferenceAsync(request: carriers.Preference_SavePreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
38
|
+
savePreferenceAsync(preference: carriers.Preference, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
39
|
+
saveTabOrderAsync(request: carriers.Preference_SaveTabOrderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
40
|
+
saveTabOrderAsync(tabOrder: carriers.TabOrder, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
41
|
+
getTabOrderAsync(request: carriers.Preference_GetTabOrderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder >;
|
|
42
|
+
getTabOrderAsync(tabName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder >;
|
|
43
|
+
getPreferenceAsync(request: carriers.Preference_GetPreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
44
|
+
getPreferenceAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
45
|
+
savePreferenceEntityAsync(request: carriers.Preference_SavePreferenceEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
46
|
+
savePreferenceEntityAsync(preference: carriers.Preference, removeLowerLevels: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
47
|
+
deletePreferenceAsync(request: carriers.Preference_DeletePreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
48
|
+
deletePreferenceAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
49
|
+
deletePreferencesAsync(request: carriers.Preference_DeletePreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
50
|
+
deletePreferencesAsync(ids: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
51
|
+
getPreferenceByNameAsync(request: carriers.Preference_GetPreferenceByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
52
|
+
getPreferenceByNameAsync(prefSection: string, prefKey: string, prefLevel: enums.PreferenceLevel, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
53
|
+
getPreferenceByNameAndIdAsync(request: carriers.Preference_GetPreferenceByNameAndIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
54
|
+
getPreferenceByNameAndIdAsync(prefSection: string, prefKey: string, prefLevel: enums.PreferenceLevel, ownerId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
55
|
+
getNetServicesStatusUrlAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
56
|
+
updateNetServicesStatusAsync(request: carriers.Preference_UpdateNetServicesStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
57
|
+
updateNetServicesStatusAsync(xmlOrJson: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
58
|
+
getXsrfPathsAsync(request: carriers.Preference_GetXsrfPathsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
|
|
59
|
+
getXsrfPathsAsync(hostname: string, webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
|
|
60
|
+
setXsrfPathsAsync(request: carriers.Preference_SetXsrfPathsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
61
|
+
setXsrfPathsAsync(hostname: string, paths: string[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
62
|
+
getPreferenceDescriptionAsync(preferenceDescriptionId: number) : Promise< carriers.PreferenceDescription >;
|
|
63
|
+
getFromSectionAndKeyAsync(request: carriers.Preference_GetFromSectionAndKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
64
|
+
getFromSectionAndKeyAsync(section: string, key: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
65
|
+
getAllAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] >;
|
|
66
|
+
getAllFromSectionAsync(request: carriers.Preference_GetAllFromSectionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] >;
|
|
67
|
+
getAllFromSectionAsync(section: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] >;
|
|
68
|
+
saveFromSectionAndKeyAsync(request: carriers.Preference_SaveFromSectionAndKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
69
|
+
saveFromSectionAndKeyAsync(section: string, key: string, preferenceDescription: carriers.PreferenceDescription, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
70
|
+
deleteFromSectionAndKeyAsync(request: carriers.Preference_DeleteFromSectionAndKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
71
|
+
deleteFromSectionAndKeyAsync(section: string, key: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
72
|
+
getPreferenceDescriptionLineAsync(preferenceDescriptionLineId: number) : Promise< carriers.PreferenceDescriptionLine >;
|
|
73
|
+
getPreferenceDescriptionLineFromIdAndValueAsync(request: carriers.Preference_GetPreferenceDescriptionLineFromIdAndValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine >;
|
|
74
|
+
getPreferenceDescriptionLineFromIdAndValueAsync(prefDescId: number, prefValue: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine >;
|
|
75
|
+
getPreferenceDescriptionLinesByPrefDescIdAsync(request: carriers.Preference_GetPreferenceDescriptionLinesByPrefDescIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
76
|
+
getPreferenceDescriptionLinesByPrefDescIdAsync(prefDescId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
77
|
+
savePreferenceDescriptionLinesAsync(request: carriers.Preference_SavePreferenceDescriptionLinesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
78
|
+
savePreferenceDescriptionLinesAsync(preferenceDescriptionLines: carriers.PreferenceDescriptionLine[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
79
|
+
deletePreferenceDescriptionLinesAsync(request: carriers.Preference_DeletePreferenceDescriptionLinesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
80
|
+
deletePreferenceDescriptionLinesAsync(prefDescLineIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
81
|
+
deletePrefDescLinesByPrefDescIdAsync(request: carriers.Preference_DeletePrefDescLinesByPrefDescIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
82
|
+
deletePrefDescLinesByPrefDescIdAsync(prefDescId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
83
|
+
deletePrefDescLinesByPrefDescIdsAsync(request: carriers.Preference_DeletePrefDescLinesByPrefDescIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
84
|
+
deletePrefDescLinesByPrefDescIdsAsync(prefDescIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
85
|
+
getPreferencesAsync(request: carriers.Preference_GetPreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
86
|
+
getPreferencesAsync(specifications: carriers.PreferenceSpec[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
87
|
+
savePreferencesAsync(request: carriers.Preference_SavePreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
88
|
+
savePreferencesAsync(preferences: carriers.Preference[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
89
|
+
getPreferencesWithDisplayValuesAsync(request: carriers.Preference_GetPreferencesWithDisplayValuesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
90
|
+
getPreferencesWithDisplayValuesAsync(specifications: carriers.PreferenceSpec[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
91
|
+
getTabOrdersAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder[] >;
|
|
92
|
+
saveTabOrdersAsync(request: carriers.Preference_SaveTabOrdersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
93
|
+
saveTabOrdersAsync(tabOrders: carriers.TabOrder[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
94
|
+
savePreferenceEntitiesAsync(request: carriers.Preference_SavePreferenceEntitiesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
95
|
+
savePreferenceEntitiesAsync(preferences: carriers.Preference[], removeLowerLevels: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
96
|
+
} // interface IPreferenceAgent
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Preferences, user interface tab configuration
|
|
103
|
+
*/
|
|
104
|
+
export class PreferenceAgent extends base.WebApiBase implements IPreferenceAgent {
|
|
105
|
+
constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
|
|
106
|
+
constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
|
|
107
|
+
constructor(baseUrl: string, resourceManager:any);
|
|
108
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
|
|
109
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
|
|
110
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
|
|
111
|
+
constructor(options: base.WebApiOptions);
|
|
112
|
+
|
|
113
|
+
constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
|
|
114
|
+
langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
|
|
115
|
+
langOrResourceOrRM?:string|base.ResourceParsing|any,
|
|
116
|
+
cultureCode?: string,
|
|
117
|
+
) {
|
|
118
|
+
const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
|
|
119
|
+
options.basePath = "v1/Agents/Preference/";
|
|
120
|
+
super(options);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Set default values into a new Preference.
|
|
127
|
+
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
128
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
129
|
+
* @returns A blank entity.
|
|
130
|
+
*/
|
|
131
|
+
public async createDefaultPreferenceAsync(options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
132
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
133
|
+
base.WebApiBase.SetPending(options);
|
|
134
|
+
return new Promise< carriers.Preference >(async (resolve, reject) => {
|
|
135
|
+
try {
|
|
136
|
+
const response = await this._axios.post("CreateDefaultPreference", null, config);
|
|
137
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
138
|
+
const res : carriers.Preference = converters.Create_Preference_From( response.data );
|
|
139
|
+
resolve(res);
|
|
140
|
+
}
|
|
141
|
+
catch( err ) {
|
|
142
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
143
|
+
reject(err);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Set default values into a new PreferenceDescription.
|
|
150
|
+
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
151
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
152
|
+
* @returns A blank entity.
|
|
153
|
+
*/
|
|
154
|
+
public async createDefaultPreferenceDescriptionAsync(options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription > {
|
|
155
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
156
|
+
base.WebApiBase.SetPending(options);
|
|
157
|
+
return new Promise< carriers.PreferenceDescription >(async (resolve, reject) => {
|
|
158
|
+
try {
|
|
159
|
+
const response = await this._axios.post("CreateDefaultPreferenceDescription", null, config);
|
|
160
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
161
|
+
const res : carriers.PreferenceDescription = converters.Create_PreferenceDescription_From( response.data );
|
|
162
|
+
resolve(res);
|
|
163
|
+
}
|
|
164
|
+
catch( err ) {
|
|
165
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
166
|
+
reject(err);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Replace the existing PreferenceDescription or creates a new PreferenceDescription if the id parameter is empty
|
|
172
|
+
* @param entity - The PreferenceDescription to be saved.
|
|
173
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
174
|
+
* @returns New or updated PreferenceDescription
|
|
175
|
+
*/
|
|
176
|
+
public async savePreferenceDescriptionAsync(entity: carriers.PreferenceDescription, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription > {
|
|
177
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
178
|
+
base.WebApiBase.SetPending(options);
|
|
179
|
+
return new Promise< carriers.PreferenceDescription >(async (resolve, reject) => {
|
|
180
|
+
try {
|
|
181
|
+
const response = await this._axios.post("SavePreferenceDescription", entity, config);
|
|
182
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
183
|
+
const res : carriers.PreferenceDescription = converters.Create_PreferenceDescription_From( response.data );
|
|
184
|
+
resolve(res);
|
|
185
|
+
}
|
|
186
|
+
catch( err ) {
|
|
187
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
188
|
+
reject(err);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Deletes the PreferenceDescription
|
|
195
|
+
* @param PreferenceDescriptionId - The id of the PreferenceDescription to be deleted.
|
|
196
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
197
|
+
*/
|
|
198
|
+
public async deletePreferenceDescriptionAsync(PreferenceDescriptionId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
199
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
200
|
+
base.WebApiBase.SetPending(options);
|
|
201
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
202
|
+
try {
|
|
203
|
+
const response = await this._axios.post("DeletePreferenceDescription?PreferenceDescriptionId=" + PreferenceDescriptionId, null, config );
|
|
204
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
205
|
+
const res = response.data;
|
|
206
|
+
resolve(res);
|
|
207
|
+
}
|
|
208
|
+
catch( err ) {
|
|
209
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
210
|
+
reject(err);
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Set default values into a new PreferenceDescriptionLine.
|
|
217
|
+
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
218
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
219
|
+
* @returns A blank entity.
|
|
220
|
+
*/
|
|
221
|
+
public async createDefaultPreferenceDescriptionLineAsync(options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine > {
|
|
222
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
223
|
+
base.WebApiBase.SetPending(options);
|
|
224
|
+
return new Promise< carriers.PreferenceDescriptionLine >(async (resolve, reject) => {
|
|
225
|
+
try {
|
|
226
|
+
const response = await this._axios.post("CreateDefaultPreferenceDescriptionLine", null, config);
|
|
227
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
228
|
+
const res : carriers.PreferenceDescriptionLine = converters.Create_PreferenceDescriptionLine_From( response.data );
|
|
229
|
+
resolve(res);
|
|
230
|
+
}
|
|
231
|
+
catch( err ) {
|
|
232
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
233
|
+
reject(err);
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Replace the existing PreferenceDescriptionLine or creates a new PreferenceDescriptionLine if the id parameter is empty
|
|
239
|
+
* @param entity - The PreferenceDescriptionLine to be saved.
|
|
240
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
241
|
+
* @returns New or updated PreferenceDescriptionLine
|
|
242
|
+
*/
|
|
243
|
+
public async savePreferenceDescriptionLineAsync(entity: carriers.PreferenceDescriptionLine, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine > {
|
|
244
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
245
|
+
base.WebApiBase.SetPending(options);
|
|
246
|
+
return new Promise< carriers.PreferenceDescriptionLine >(async (resolve, reject) => {
|
|
247
|
+
try {
|
|
248
|
+
const response = await this._axios.post("SavePreferenceDescriptionLine", entity, config);
|
|
249
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
250
|
+
const res : carriers.PreferenceDescriptionLine = converters.Create_PreferenceDescriptionLine_From( response.data );
|
|
251
|
+
resolve(res);
|
|
252
|
+
}
|
|
253
|
+
catch( err ) {
|
|
254
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
255
|
+
reject(err);
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Deletes the PreferenceDescriptionLine
|
|
262
|
+
* @param PreferenceDescriptionLineId - The id of the PreferenceDescriptionLine to be deleted.
|
|
263
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
264
|
+
*/
|
|
265
|
+
public async deletePreferenceDescriptionLineAsync(PreferenceDescriptionLineId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
266
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
267
|
+
base.WebApiBase.SetPending(options);
|
|
268
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
269
|
+
try {
|
|
270
|
+
const response = await this._axios.post("DeletePreferenceDescriptionLine?PreferenceDescriptionLineId=" + PreferenceDescriptionLineId, null, config );
|
|
271
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
272
|
+
const res = response.data;
|
|
273
|
+
resolve(res);
|
|
274
|
+
}
|
|
275
|
+
catch( err ) {
|
|
276
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
277
|
+
reject(err);
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
private async _savePreferenceAsync(request: carriers.Preference_SavePreferenceRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
283
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
284
|
+
base.WebApiBase.SetPending(options);
|
|
285
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
286
|
+
try {
|
|
287
|
+
config.baseURL = this._options.baseUrl;
|
|
288
|
+
const response = await this._axios.post("SavePreference", request , config);
|
|
289
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
290
|
+
const res = response.data;
|
|
291
|
+
resolve(res);
|
|
292
|
+
}
|
|
293
|
+
catch( err ) {
|
|
294
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
295
|
+
reject(err);
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Save this preference
|
|
304
|
+
* @param request - Preference
|
|
305
|
+
* @returns This method has no return value
|
|
306
|
+
*/
|
|
307
|
+
public async savePreferenceAsync(request: carriers.Preference_SavePreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Save this preference
|
|
311
|
+
* @param preference - Preference to be saved. All fields must be filled in, and the preference will be saved on the Associate level only. Setting for other levels is an administrative task and not available through this service.
|
|
312
|
+
* @returns This method has no return value
|
|
313
|
+
*/
|
|
314
|
+
public async savePreferenceAsync(preference: carriers.Preference, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
315
|
+
|
|
316
|
+
public async savePreferenceAsync(preference:carriers.Preference|carriers.Preference_SavePreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
317
|
+
let _request : carriers.Preference_SavePreferenceRequest = null;
|
|
318
|
+
let _options : base.WebApiRequestOptions = null;
|
|
319
|
+
const first : any = preference;
|
|
320
|
+
if( typeof( first ) === "object" && first && ( typeof(first.preference)!='undefined' ) )
|
|
321
|
+
{
|
|
322
|
+
_request = preference as carriers.Preference_SavePreferenceRequest;
|
|
323
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
324
|
+
}
|
|
325
|
+
else
|
|
326
|
+
{
|
|
327
|
+
_request = {
|
|
328
|
+
preference: preference as carriers.Preference,
|
|
329
|
+
};
|
|
330
|
+
_options = webapi_options;
|
|
331
|
+
}
|
|
332
|
+
return this._savePreferenceAsync( _request, _options );
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
private async _saveTabOrderAsync(request: carriers.Preference_SaveTabOrderRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
337
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
338
|
+
base.WebApiBase.SetPending(options);
|
|
339
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
340
|
+
try {
|
|
341
|
+
config.baseURL = this._options.baseUrl;
|
|
342
|
+
const response = await this._axios.post("SaveTabOrder", request , config);
|
|
343
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
344
|
+
const res = response.data;
|
|
345
|
+
resolve(res);
|
|
346
|
+
}
|
|
347
|
+
catch( err ) {
|
|
348
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
349
|
+
reject(err);
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Saves the tab order. The order is saved pr. user.
|
|
358
|
+
* @param request - TabOrder
|
|
359
|
+
* @returns This method has no return value
|
|
360
|
+
*/
|
|
361
|
+
public async saveTabOrderAsync(request: carriers.Preference_SaveTabOrderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Saves the tab order. The order is saved pr. user.
|
|
365
|
+
* @param tabOrder - Name of the tab control
|
|
366
|
+
* @returns This method has no return value
|
|
367
|
+
*/
|
|
368
|
+
public async saveTabOrderAsync(tabOrder: carriers.TabOrder, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
369
|
+
|
|
370
|
+
public async saveTabOrderAsync(tabOrder:carriers.TabOrder|carriers.Preference_SaveTabOrderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
371
|
+
let _request : carriers.Preference_SaveTabOrderRequest = null;
|
|
372
|
+
let _options : base.WebApiRequestOptions = null;
|
|
373
|
+
const first : any = tabOrder;
|
|
374
|
+
if( typeof( first ) === "object" && first && ( typeof(first.tabOrder)!='undefined' ) )
|
|
375
|
+
{
|
|
376
|
+
_request = tabOrder as carriers.Preference_SaveTabOrderRequest;
|
|
377
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
378
|
+
}
|
|
379
|
+
else
|
|
380
|
+
{
|
|
381
|
+
_request = {
|
|
382
|
+
tabOrder: tabOrder as carriers.TabOrder,
|
|
383
|
+
};
|
|
384
|
+
_options = webapi_options;
|
|
385
|
+
}
|
|
386
|
+
return this._saveTabOrderAsync( _request, _options );
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
private async _getTabOrderAsync(request: carriers.Preference_GetTabOrderRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder > {
|
|
391
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
392
|
+
base.WebApiBase.SetPending(options);
|
|
393
|
+
return new Promise< carriers.TabOrder >(async (resolve, reject) => {
|
|
394
|
+
try {
|
|
395
|
+
config.baseURL = this._options.baseUrl;
|
|
396
|
+
const response = await this._axios.post("GetTabOrder", request , config);
|
|
397
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
398
|
+
const res : carriers.TabOrder = converters.Create_TabOrder_From( response.data );
|
|
399
|
+
resolve(res);
|
|
400
|
+
}
|
|
401
|
+
catch( err ) {
|
|
402
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
403
|
+
reject(err);
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Gets the tab order.
|
|
412
|
+
* @param request - TabName
|
|
413
|
+
* @returns Tab order. Array of strings. Each string represent a named tab.
|
|
414
|
+
*/
|
|
415
|
+
public async getTabOrderAsync(request: carriers.Preference_GetTabOrderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder >;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Gets the tab order.
|
|
419
|
+
* @param tabName - Name of the tab control
|
|
420
|
+
* @returns Tab order. Array of strings. Each string represent a named tab.
|
|
421
|
+
*/
|
|
422
|
+
public async getTabOrderAsync(tabName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder >;
|
|
423
|
+
|
|
424
|
+
public async getTabOrderAsync(tabName:string|carriers.Preference_GetTabOrderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder > {
|
|
425
|
+
let _request : carriers.Preference_GetTabOrderRequest = null;
|
|
426
|
+
let _options : base.WebApiRequestOptions = null;
|
|
427
|
+
const first : any = tabName;
|
|
428
|
+
if( typeof( first ) === "object" && first && ( typeof(first.tabName)!='undefined' ) )
|
|
429
|
+
{
|
|
430
|
+
_request = tabName as carriers.Preference_GetTabOrderRequest;
|
|
431
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
432
|
+
}
|
|
433
|
+
else
|
|
434
|
+
{
|
|
435
|
+
_request = {
|
|
436
|
+
tabName: tabName as string,
|
|
437
|
+
};
|
|
438
|
+
_options = webapi_options;
|
|
439
|
+
}
|
|
440
|
+
return this._getTabOrderAsync( _request, _options );
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
private async _getPreferenceAsync(request: carriers.Preference_GetPreferenceRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
445
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
446
|
+
base.WebApiBase.SetPending(options);
|
|
447
|
+
return new Promise< carriers.Preference >(async (resolve, reject) => {
|
|
448
|
+
try {
|
|
449
|
+
config.baseURL = this._options.baseUrl;
|
|
450
|
+
const response = await this._axios.post("GetPreference", request , config);
|
|
451
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
452
|
+
const res : carriers.Preference = converters.Create_Preference_From( response.data );
|
|
453
|
+
resolve(res);
|
|
454
|
+
}
|
|
455
|
+
catch( err ) {
|
|
456
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
457
|
+
reject(err);
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Get a preference by id
|
|
466
|
+
* @param request - Id
|
|
467
|
+
* @returns The preference loaded
|
|
468
|
+
*/
|
|
469
|
+
public async getPreferenceAsync(request: carriers.Preference_GetPreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Get a preference by id
|
|
473
|
+
* @param id - The id of the preference to load
|
|
474
|
+
* @returns The preference loaded
|
|
475
|
+
*/
|
|
476
|
+
public async getPreferenceAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
477
|
+
|
|
478
|
+
public async getPreferenceAsync(id:number|carriers.Preference_GetPreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
479
|
+
let _request : carriers.Preference_GetPreferenceRequest = null;
|
|
480
|
+
let _options : base.WebApiRequestOptions = null;
|
|
481
|
+
const first : any = id;
|
|
482
|
+
if( typeof( first ) === "object" && first && ( typeof(first.id)!='undefined' ) )
|
|
483
|
+
{
|
|
484
|
+
_request = id as carriers.Preference_GetPreferenceRequest;
|
|
485
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
486
|
+
}
|
|
487
|
+
else
|
|
488
|
+
{
|
|
489
|
+
_request = {
|
|
490
|
+
id: id as number,
|
|
491
|
+
};
|
|
492
|
+
_options = webapi_options;
|
|
493
|
+
}
|
|
494
|
+
return this._getPreferenceAsync( _request, _options );
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
private async _savePreferenceEntityAsync(request: carriers.Preference_SavePreferenceEntityRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
499
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
500
|
+
base.WebApiBase.SetPending(options);
|
|
501
|
+
return new Promise< carriers.Preference >(async (resolve, reject) => {
|
|
502
|
+
try {
|
|
503
|
+
config.baseURL = this._options.baseUrl;
|
|
504
|
+
const response = await this._axios.post("SavePreferenceEntity", request , config);
|
|
505
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
506
|
+
const res : carriers.Preference = converters.Create_Preference_From( response.data );
|
|
507
|
+
resolve(res);
|
|
508
|
+
}
|
|
509
|
+
catch( err ) {
|
|
510
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
511
|
+
reject(err);
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Saves a complete preference object, on any level and any target. Preference administrator rights are required to use this
|
|
520
|
+
* @param request - Preference, RemoveLowerLevels
|
|
521
|
+
* @returns Returns the saved preference
|
|
522
|
+
*/
|
|
523
|
+
public async savePreferenceEntityAsync(request: carriers.Preference_SavePreferenceEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Saves a complete preference object, on any level and any target. Preference administrator rights are required to use this
|
|
527
|
+
* @param preference - The preference object to be saved
|
|
528
|
+
* @param removeLowerLevels - If this is true, all user preferences on lower levels will be deleted
|
|
529
|
+
* @returns Returns the saved preference
|
|
530
|
+
*/
|
|
531
|
+
public async savePreferenceEntityAsync(preference: carriers.Preference, removeLowerLevels: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
532
|
+
|
|
533
|
+
public async savePreferenceEntityAsync(preference:carriers.Preference|carriers.Preference_SavePreferenceEntityRequest, removeLowerLevels?:boolean|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
534
|
+
let _request : carriers.Preference_SavePreferenceEntityRequest = null;
|
|
535
|
+
let _options : base.WebApiRequestOptions = null;
|
|
536
|
+
const first : any = preference;
|
|
537
|
+
if( typeof( first ) === "object" && first && ( typeof(first.preference)!='undefined' || typeof(first.removeLowerLevels)!='undefined' ) )
|
|
538
|
+
{
|
|
539
|
+
_request = preference as carriers.Preference_SavePreferenceEntityRequest;
|
|
540
|
+
_options = removeLowerLevels as base.WebApiRequestOptions;
|
|
541
|
+
}
|
|
542
|
+
else
|
|
543
|
+
{
|
|
544
|
+
_request = {
|
|
545
|
+
preference: preference as carriers.Preference,
|
|
546
|
+
removeLowerLevels: removeLowerLevels as boolean,
|
|
547
|
+
};
|
|
548
|
+
_options = webapi_options;
|
|
549
|
+
}
|
|
550
|
+
return this._savePreferenceEntityAsync( _request, _options );
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
private async _deletePreferenceAsync(request: carriers.Preference_DeletePreferenceRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
555
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
556
|
+
base.WebApiBase.SetPending(options);
|
|
557
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
558
|
+
try {
|
|
559
|
+
config.baseURL = this._options.baseUrl;
|
|
560
|
+
const response = await this._axios.post("DeletePreference", request , config);
|
|
561
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
562
|
+
const res = response.data;
|
|
563
|
+
resolve(res);
|
|
564
|
+
}
|
|
565
|
+
catch( err ) {
|
|
566
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
567
|
+
reject(err);
|
|
568
|
+
}
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Delete a preference by id
|
|
576
|
+
* @param request - Id
|
|
577
|
+
* @returns This method has no return value
|
|
578
|
+
*/
|
|
579
|
+
public async deletePreferenceAsync(request: carriers.Preference_DeletePreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Delete a preference by id
|
|
583
|
+
* @param id - The id of the preference to delete
|
|
584
|
+
* @returns This method has no return value
|
|
585
|
+
*/
|
|
586
|
+
public async deletePreferenceAsync(id: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
587
|
+
|
|
588
|
+
public async deletePreferenceAsync(id:number|carriers.Preference_DeletePreferenceRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
589
|
+
let _request : carriers.Preference_DeletePreferenceRequest = null;
|
|
590
|
+
let _options : base.WebApiRequestOptions = null;
|
|
591
|
+
const first : any = id;
|
|
592
|
+
if( typeof( first ) === "object" && first && ( typeof(first.id)!='undefined' ) )
|
|
593
|
+
{
|
|
594
|
+
_request = id as carriers.Preference_DeletePreferenceRequest;
|
|
595
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
596
|
+
}
|
|
597
|
+
else
|
|
598
|
+
{
|
|
599
|
+
_request = {
|
|
600
|
+
id: id as number,
|
|
601
|
+
};
|
|
602
|
+
_options = webapi_options;
|
|
603
|
+
}
|
|
604
|
+
return this._deletePreferenceAsync( _request, _options );
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
private async _deletePreferencesAsync(request: carriers.Preference_DeletePreferencesRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
609
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
610
|
+
base.WebApiBase.SetPending(options);
|
|
611
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
612
|
+
try {
|
|
613
|
+
config.baseURL = this._options.baseUrl;
|
|
614
|
+
const response = await this._axios.post("DeletePreferences", request , config);
|
|
615
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
616
|
+
const res = response.data;
|
|
617
|
+
resolve(res);
|
|
618
|
+
}
|
|
619
|
+
catch( err ) {
|
|
620
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
621
|
+
reject(err);
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Delete some preferences by id
|
|
630
|
+
* @param request - Ids
|
|
631
|
+
* @returns This method has no return value
|
|
632
|
+
*/
|
|
633
|
+
public async deletePreferencesAsync(request: carriers.Preference_DeletePreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* Delete some preferences by id
|
|
637
|
+
* @param ids - The ids of the preference to delete
|
|
638
|
+
* @returns This method has no return value
|
|
639
|
+
*/
|
|
640
|
+
public async deletePreferencesAsync(ids: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
641
|
+
|
|
642
|
+
public async deletePreferencesAsync(ids:number[]|carriers.Preference_DeletePreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
643
|
+
let _request : carriers.Preference_DeletePreferencesRequest = null;
|
|
644
|
+
let _options : base.WebApiRequestOptions = null;
|
|
645
|
+
const first : any = ids;
|
|
646
|
+
if( typeof( first ) === "object" && first && ( typeof(first.ids)!='undefined' ) )
|
|
647
|
+
{
|
|
648
|
+
_request = ids as carriers.Preference_DeletePreferencesRequest;
|
|
649
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
650
|
+
}
|
|
651
|
+
else
|
|
652
|
+
{
|
|
653
|
+
_request = {
|
|
654
|
+
ids: ids as number[],
|
|
655
|
+
};
|
|
656
|
+
_options = webapi_options;
|
|
657
|
+
}
|
|
658
|
+
return this._deletePreferencesAsync( _request, _options );
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
private async _getPreferenceByNameAsync(request: carriers.Preference_GetPreferenceByNameRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
663
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
664
|
+
base.WebApiBase.SetPending(options);
|
|
665
|
+
return new Promise< carriers.Preference >(async (resolve, reject) => {
|
|
666
|
+
try {
|
|
667
|
+
config.baseURL = this._options.baseUrl;
|
|
668
|
+
const response = await this._axios.post("GetPreferenceByName", request , config);
|
|
669
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
670
|
+
const res : carriers.Preference = converters.Create_Preference_From( response.data );
|
|
671
|
+
resolve(res);
|
|
672
|
+
}
|
|
673
|
+
catch( err ) {
|
|
674
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
675
|
+
reject(err);
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Get a preference by name
|
|
684
|
+
* @param request - PrefSection, PrefKey, PrefLevel
|
|
685
|
+
* @returns The preference. Note that id = 0 and value = null if preference not found in the database at the requested pref-level.
|
|
686
|
+
*/
|
|
687
|
+
public async getPreferenceByNameAsync(request: carriers.Preference_GetPreferenceByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Get a preference by name
|
|
691
|
+
* @param prefSection - The preference section name. e.g. 'Functions'. See SuperOffice.CRM.UserPreferenceStrings for constants.
|
|
692
|
+
* @param prefKey - The preference key name. e.g. 'ShowTipsAtStart'. See SuperOffice.CRM.UserPreferenceStrings for constants.
|
|
693
|
+
* @param prefLevel - The preference level to read. Undefined (0) means to return the preference defined closest to the user.
|
|
694
|
+
* @returns The preference. Note that id = 0 and value = null if preference not found in the database at the requested pref-level.
|
|
695
|
+
*/
|
|
696
|
+
public async getPreferenceByNameAsync(prefSection: string, prefKey: string, prefLevel: enums.PreferenceLevel, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
697
|
+
|
|
698
|
+
public async getPreferenceByNameAsync(prefSection:string|carriers.Preference_GetPreferenceByNameRequest, prefKey?:string|base.WebApiRequestOptions, prefLevel?:enums.PreferenceLevel, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
699
|
+
let _request : carriers.Preference_GetPreferenceByNameRequest = null;
|
|
700
|
+
let _options : base.WebApiRequestOptions = null;
|
|
701
|
+
const first : any = prefSection;
|
|
702
|
+
if( typeof( first ) === "object" && first && ( typeof(first.prefSection)!='undefined' || typeof(first.prefKey)!='undefined' || typeof(first.prefLevel)!='undefined' ) )
|
|
703
|
+
{
|
|
704
|
+
_request = prefSection as carriers.Preference_GetPreferenceByNameRequest;
|
|
705
|
+
_options = prefKey as base.WebApiRequestOptions;
|
|
706
|
+
}
|
|
707
|
+
else
|
|
708
|
+
{
|
|
709
|
+
_request = {
|
|
710
|
+
prefSection: prefSection as string,
|
|
711
|
+
prefKey: prefKey as string,
|
|
712
|
+
prefLevel: prefLevel as enums.PreferenceLevel,
|
|
713
|
+
};
|
|
714
|
+
_options = webapi_options;
|
|
715
|
+
}
|
|
716
|
+
return this._getPreferenceByNameAsync( _request, _options );
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
private async _getPreferenceByNameAndIdAsync(request: carriers.Preference_GetPreferenceByNameAndIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
721
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
722
|
+
base.WebApiBase.SetPending(options);
|
|
723
|
+
return new Promise< carriers.Preference >(async (resolve, reject) => {
|
|
724
|
+
try {
|
|
725
|
+
config.baseURL = this._options.baseUrl;
|
|
726
|
+
const response = await this._axios.post("GetPreferenceByNameAndId", request , config);
|
|
727
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
728
|
+
const res : carriers.Preference = converters.Create_Preference_From( response.data );
|
|
729
|
+
resolve(res);
|
|
730
|
+
}
|
|
731
|
+
catch( err ) {
|
|
732
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
733
|
+
reject(err);
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Get a preference by name and owner id.
|
|
742
|
+
* @param request - PrefSection, PrefKey, PrefLevel, OwnerId
|
|
743
|
+
* @returns The preference. Note that id = 0 and value = null if preference not found in the database at the requested pref-level.
|
|
744
|
+
*/
|
|
745
|
+
public async getPreferenceByNameAndIdAsync(request: carriers.Preference_GetPreferenceByNameAndIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* Get a preference by name and owner id.
|
|
749
|
+
* @param prefSection - The preference section name. e.g. 'Functions'. See SuperOffice.CRM.UserPreferenceStrings for constants.
|
|
750
|
+
* @param prefKey - The preference key name. e.g. 'ShowTipsAtStart'. See SuperOffice.CRM.UserPreferenceStrings for constants.
|
|
751
|
+
* @param prefLevel - The preference level to read. Undefined (0) means to return the preference defined closest to the user.
|
|
752
|
+
* @param ownerId - The preference owner id, individual or group.
|
|
753
|
+
* @returns The preference. Note that id = 0 and value = null if preference not found in the database at the requested pref-level.
|
|
754
|
+
*/
|
|
755
|
+
public async getPreferenceByNameAndIdAsync(prefSection: string, prefKey: string, prefLevel: enums.PreferenceLevel, ownerId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference >;
|
|
756
|
+
|
|
757
|
+
public async getPreferenceByNameAndIdAsync(prefSection:string|carriers.Preference_GetPreferenceByNameAndIdRequest, prefKey?:string|base.WebApiRequestOptions, prefLevel?:enums.PreferenceLevel, ownerId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference > {
|
|
758
|
+
let _request : carriers.Preference_GetPreferenceByNameAndIdRequest = null;
|
|
759
|
+
let _options : base.WebApiRequestOptions = null;
|
|
760
|
+
const first : any = prefSection;
|
|
761
|
+
if( typeof( first ) === "object" && first && ( typeof(first.prefSection)!='undefined' || typeof(first.prefKey)!='undefined' || typeof(first.prefLevel)!='undefined' || typeof(first.ownerId)!='undefined' ) )
|
|
762
|
+
{
|
|
763
|
+
_request = prefSection as carriers.Preference_GetPreferenceByNameAndIdRequest;
|
|
764
|
+
_options = prefKey as base.WebApiRequestOptions;
|
|
765
|
+
}
|
|
766
|
+
else
|
|
767
|
+
{
|
|
768
|
+
_request = {
|
|
769
|
+
prefSection: prefSection as string,
|
|
770
|
+
prefKey: prefKey as string,
|
|
771
|
+
prefLevel: prefLevel as enums.PreferenceLevel,
|
|
772
|
+
ownerId: ownerId as number,
|
|
773
|
+
};
|
|
774
|
+
_options = webapi_options;
|
|
775
|
+
}
|
|
776
|
+
return this._getPreferenceByNameAndIdAsync( _request, _options );
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
private async _getNetServicesStatusUrlAsync( options?:base.WebApiRequestOptions) : Promise< string > {
|
|
781
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
782
|
+
base.WebApiBase.SetPending(options);
|
|
783
|
+
return new Promise< string >(async (resolve, reject) => {
|
|
784
|
+
try {
|
|
785
|
+
config.baseURL = this._options.baseUrl;
|
|
786
|
+
const response = await this._axios.post("GetNetServicesStatusUrl", undefined , config);
|
|
787
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
788
|
+
const res : string = response.data as string;
|
|
789
|
+
resolve(res);
|
|
790
|
+
}
|
|
791
|
+
catch( err ) {
|
|
792
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
793
|
+
reject(err);
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Returns URL to status service. e.g. 'https://help.superoffice.com/sodispatcher/v1/status' Returns NULL if status does not need to be checked yet.
|
|
801
|
+
* @returns NULL or URL of the status service that returns an XML or JSON block.
|
|
802
|
+
*/
|
|
803
|
+
public async getNetServicesStatusUrlAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string >
|
|
804
|
+
{
|
|
805
|
+
return this._getNetServicesStatusUrlAsync(webapi_options);
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
private async _updateNetServicesStatusAsync(request: carriers.Preference_UpdateNetServicesStatusRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
810
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
811
|
+
base.WebApiBase.SetPending(options);
|
|
812
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
813
|
+
try {
|
|
814
|
+
config.baseURL = this._options.baseUrl;
|
|
815
|
+
const response = await this._axios.post("UpdateNetServicesStatus", request , config);
|
|
816
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
817
|
+
const res = response.data;
|
|
818
|
+
resolve(res);
|
|
819
|
+
}
|
|
820
|
+
catch( err ) {
|
|
821
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
822
|
+
reject(err);
|
|
823
|
+
}
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* Update the NetServices preferences with values contained in the content from the Status URL
|
|
831
|
+
* @param request - XmlOrJson
|
|
832
|
+
* @returns This method has no return value
|
|
833
|
+
*/
|
|
834
|
+
public async updateNetServicesStatusAsync(request: carriers.Preference_UpdateNetServicesStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* Update the NetServices preferences with values contained in the content from the Status URL
|
|
838
|
+
* @param xmlOrJson - The text that was returned by getting the Status URL
|
|
839
|
+
* @returns This method has no return value
|
|
840
|
+
*/
|
|
841
|
+
public async updateNetServicesStatusAsync(xmlOrJson: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
842
|
+
|
|
843
|
+
public async updateNetServicesStatusAsync(xmlOrJson:string|carriers.Preference_UpdateNetServicesStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
844
|
+
let _request : carriers.Preference_UpdateNetServicesStatusRequest = null;
|
|
845
|
+
let _options : base.WebApiRequestOptions = null;
|
|
846
|
+
const first : any = xmlOrJson;
|
|
847
|
+
if( typeof( first ) === "object" && first && ( typeof(first.xmlOrJson)!='undefined' ) )
|
|
848
|
+
{
|
|
849
|
+
_request = xmlOrJson as carriers.Preference_UpdateNetServicesStatusRequest;
|
|
850
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
851
|
+
}
|
|
852
|
+
else
|
|
853
|
+
{
|
|
854
|
+
_request = {
|
|
855
|
+
xmlOrJson: xmlOrJson as string,
|
|
856
|
+
};
|
|
857
|
+
_options = webapi_options;
|
|
858
|
+
}
|
|
859
|
+
return this._updateNetServicesStatusAsync( _request, _options );
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
private async _getXsrfPathsAsync(request: carriers.Preference_GetXsrfPathsRequest, options?:base.WebApiRequestOptions) : Promise< string[] > {
|
|
864
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
865
|
+
base.WebApiBase.SetPending(options);
|
|
866
|
+
return new Promise< string[] >(async (resolve, reject) => {
|
|
867
|
+
try {
|
|
868
|
+
config.baseURL = this._options.baseUrl;
|
|
869
|
+
const response = await this._axios.post("GetXsrfPaths", request , config);
|
|
870
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
871
|
+
const res : string[] = response.data as string[];
|
|
872
|
+
resolve(res);
|
|
873
|
+
}
|
|
874
|
+
catch( err ) {
|
|
875
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
876
|
+
reject(err);
|
|
877
|
+
}
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
/**
|
|
884
|
+
* Returns paths that XSRF cookies should be set on
|
|
885
|
+
* @param request - Hostname
|
|
886
|
+
* @returns Paths that XSRF cookies should be set for: ['/cs', '/crm']
|
|
887
|
+
*/
|
|
888
|
+
public async getXsrfPathsAsync(request: carriers.Preference_GetXsrfPathsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
|
|
889
|
+
|
|
890
|
+
/**
|
|
891
|
+
* Returns paths that XSRF cookies should be set on
|
|
892
|
+
* @param hostname - The hostname that we are storing paths for.
|
|
893
|
+
* @returns Paths that XSRF cookies should be set for: ['/cs', '/crm']
|
|
894
|
+
*/
|
|
895
|
+
public async getXsrfPathsAsync(hostname: string, webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
|
|
896
|
+
|
|
897
|
+
public async getXsrfPathsAsync(hostname:string|carriers.Preference_GetXsrfPathsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string[] > {
|
|
898
|
+
let _request : carriers.Preference_GetXsrfPathsRequest = null;
|
|
899
|
+
let _options : base.WebApiRequestOptions = null;
|
|
900
|
+
const first : any = hostname;
|
|
901
|
+
if( typeof( first ) === "object" && first && ( typeof(first.hostname)!='undefined' ) )
|
|
902
|
+
{
|
|
903
|
+
_request = hostname as carriers.Preference_GetXsrfPathsRequest;
|
|
904
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
905
|
+
}
|
|
906
|
+
else
|
|
907
|
+
{
|
|
908
|
+
_request = {
|
|
909
|
+
hostname: hostname as string,
|
|
910
|
+
};
|
|
911
|
+
_options = webapi_options;
|
|
912
|
+
}
|
|
913
|
+
return this._getXsrfPathsAsync( _request, _options );
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
private async _setXsrfPathsAsync(request: carriers.Preference_SetXsrfPathsRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
918
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
919
|
+
base.WebApiBase.SetPending(options);
|
|
920
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
921
|
+
try {
|
|
922
|
+
config.baseURL = this._options.baseUrl;
|
|
923
|
+
const response = await this._axios.post("SetXsrfPaths", request , config);
|
|
924
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
925
|
+
const res = response.data;
|
|
926
|
+
resolve(res);
|
|
927
|
+
}
|
|
928
|
+
catch( err ) {
|
|
929
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
930
|
+
reject(err);
|
|
931
|
+
}
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* Update the paths that need XSRF cookies
|
|
939
|
+
* @param request - Hostname, Paths
|
|
940
|
+
* @returns This method has no return value
|
|
941
|
+
*/
|
|
942
|
+
public async setXsrfPathsAsync(request: carriers.Preference_SetXsrfPathsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* Update the paths that need XSRF cookies
|
|
946
|
+
* @param hostname - The hostname that we are storing paths for.
|
|
947
|
+
* @param paths - Paths that XSRF cookies should be set for: ['/cs', '/crm']
|
|
948
|
+
* @returns This method has no return value
|
|
949
|
+
*/
|
|
950
|
+
public async setXsrfPathsAsync(hostname: string, paths: string[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
951
|
+
|
|
952
|
+
public async setXsrfPathsAsync(hostname:string|carriers.Preference_SetXsrfPathsRequest, paths?:string[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
953
|
+
let _request : carriers.Preference_SetXsrfPathsRequest = null;
|
|
954
|
+
let _options : base.WebApiRequestOptions = null;
|
|
955
|
+
const first : any = hostname;
|
|
956
|
+
if( typeof( first ) === "object" && first && ( typeof(first.hostname)!='undefined' || typeof(first.paths)!='undefined' ) )
|
|
957
|
+
{
|
|
958
|
+
_request = hostname as carriers.Preference_SetXsrfPathsRequest;
|
|
959
|
+
_options = paths as base.WebApiRequestOptions;
|
|
960
|
+
}
|
|
961
|
+
else
|
|
962
|
+
{
|
|
963
|
+
_request = {
|
|
964
|
+
hostname: hostname as string,
|
|
965
|
+
paths: paths as string[],
|
|
966
|
+
};
|
|
967
|
+
_options = webapi_options;
|
|
968
|
+
}
|
|
969
|
+
return this._setXsrfPathsAsync( _request, _options );
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* Gets a PreferenceDescription object.
|
|
974
|
+
* @param preferenceDescriptionId - The primary key.
|
|
975
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
976
|
+
* @returns A single PreferenceDescription
|
|
977
|
+
*/
|
|
978
|
+
public async getPreferenceDescriptionAsync(preferenceDescriptionId: number, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription > {
|
|
979
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
980
|
+
base.WebApiBase.SetPending(options);
|
|
981
|
+
return new Promise< carriers.PreferenceDescription >(async (resolve, reject) => {
|
|
982
|
+
try {
|
|
983
|
+
const response = await this._axios.post("GetPreferenceDescription?preferenceDescriptionId=" + preferenceDescriptionId, null, config);
|
|
984
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
985
|
+
const res = converters.Create_PreferenceDescription_From( response.data );
|
|
986
|
+
resolve(res);
|
|
987
|
+
}
|
|
988
|
+
catch( err ) {
|
|
989
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
990
|
+
reject(err);
|
|
991
|
+
}
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
private async _getFromSectionAndKeyAsync(request: carriers.Preference_GetFromSectionAndKeyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription > {
|
|
997
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
998
|
+
base.WebApiBase.SetPending(options);
|
|
999
|
+
return new Promise< carriers.PreferenceDescription >(async (resolve, reject) => {
|
|
1000
|
+
try {
|
|
1001
|
+
config.baseURL = this._options.baseUrl;
|
|
1002
|
+
const response = await this._axios.post("GetFromSectionAndKey", request , config);
|
|
1003
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1004
|
+
const res : carriers.PreferenceDescription = converters.Create_PreferenceDescription_From( response.data );
|
|
1005
|
+
resolve(res);
|
|
1006
|
+
}
|
|
1007
|
+
catch( err ) {
|
|
1008
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1009
|
+
reject(err);
|
|
1010
|
+
}
|
|
1011
|
+
});
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
|
|
1016
|
+
/**
|
|
1017
|
+
* Gets a PreferenceDescription based on the section and key
|
|
1018
|
+
* @param request - Section, Key
|
|
1019
|
+
* @returns A PreferenceDescription or null
|
|
1020
|
+
*/
|
|
1021
|
+
public async getFromSectionAndKeyAsync(request: carriers.Preference_GetFromSectionAndKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
1022
|
+
|
|
1023
|
+
/**
|
|
1024
|
+
* Gets a PreferenceDescription based on the section and key
|
|
1025
|
+
* @param section - The PreferenceDescription-section
|
|
1026
|
+
* @param key - The PreferenceDescription-key
|
|
1027
|
+
* @returns A PreferenceDescription or null
|
|
1028
|
+
*/
|
|
1029
|
+
public async getFromSectionAndKeyAsync(section: string, key: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
1030
|
+
|
|
1031
|
+
public async getFromSectionAndKeyAsync(section:string|carriers.Preference_GetFromSectionAndKeyRequest, key?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription > {
|
|
1032
|
+
let _request : carriers.Preference_GetFromSectionAndKeyRequest = null;
|
|
1033
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1034
|
+
const first : any = section;
|
|
1035
|
+
if( typeof( first ) === "object" && first && ( typeof(first.section)!='undefined' || typeof(first.key)!='undefined' ) )
|
|
1036
|
+
{
|
|
1037
|
+
_request = section as carriers.Preference_GetFromSectionAndKeyRequest;
|
|
1038
|
+
_options = key as base.WebApiRequestOptions;
|
|
1039
|
+
}
|
|
1040
|
+
else
|
|
1041
|
+
{
|
|
1042
|
+
_request = {
|
|
1043
|
+
section: section as string,
|
|
1044
|
+
key: key as string,
|
|
1045
|
+
};
|
|
1046
|
+
_options = webapi_options;
|
|
1047
|
+
}
|
|
1048
|
+
return this._getFromSectionAndKeyAsync( _request, _options );
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
|
|
1052
|
+
private async _getAllAsync( options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] > {
|
|
1053
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1054
|
+
base.WebApiBase.SetPending(options);
|
|
1055
|
+
return new Promise< carriers.PreferenceDescription[] >(async (resolve, reject) => {
|
|
1056
|
+
try {
|
|
1057
|
+
config.baseURL = this._options.baseUrl;
|
|
1058
|
+
const response = await this._axios.post("GetAll", undefined , config);
|
|
1059
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1060
|
+
const res : carriers.PreferenceDescription[] = converters.Create_PreferenceDescriptionArray_From( response.data );
|
|
1061
|
+
resolve(res);
|
|
1062
|
+
}
|
|
1063
|
+
catch( err ) {
|
|
1064
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1065
|
+
reject(err);
|
|
1066
|
+
}
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* Gets a list of all PreferenceDescriptions in the system.
|
|
1073
|
+
* @returns All PreferenceDescriptions in the system
|
|
1074
|
+
*/
|
|
1075
|
+
public async getAllAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] >
|
|
1076
|
+
{
|
|
1077
|
+
return this._getAllAsync(webapi_options);
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
private async _getAllFromSectionAsync(request: carriers.Preference_GetAllFromSectionRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] > {
|
|
1082
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1083
|
+
base.WebApiBase.SetPending(options);
|
|
1084
|
+
return new Promise< carriers.PreferenceDescription[] >(async (resolve, reject) => {
|
|
1085
|
+
try {
|
|
1086
|
+
config.baseURL = this._options.baseUrl;
|
|
1087
|
+
const response = await this._axios.post("GetAllFromSection", request , config);
|
|
1088
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1089
|
+
const res : carriers.PreferenceDescription[] = converters.Create_PreferenceDescriptionArray_From( response.data );
|
|
1090
|
+
resolve(res);
|
|
1091
|
+
}
|
|
1092
|
+
catch( err ) {
|
|
1093
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1094
|
+
reject(err);
|
|
1095
|
+
}
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* Gets all PreferenceDescription-items in the specified section
|
|
1103
|
+
* @param request - Section
|
|
1104
|
+
* @returns All PreferenceDescriptions found.
|
|
1105
|
+
*/
|
|
1106
|
+
public async getAllFromSectionAsync(request: carriers.Preference_GetAllFromSectionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] >;
|
|
1107
|
+
|
|
1108
|
+
/**
|
|
1109
|
+
* Gets all PreferenceDescription-items in the specified section
|
|
1110
|
+
* @param section - The PreferenceDescription-section
|
|
1111
|
+
* @returns All PreferenceDescriptions found.
|
|
1112
|
+
*/
|
|
1113
|
+
public async getAllFromSectionAsync(section: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] >;
|
|
1114
|
+
|
|
1115
|
+
public async getAllFromSectionAsync(section:string|carriers.Preference_GetAllFromSectionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription[] > {
|
|
1116
|
+
let _request : carriers.Preference_GetAllFromSectionRequest = null;
|
|
1117
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1118
|
+
const first : any = section;
|
|
1119
|
+
if( typeof( first ) === "object" && first && ( typeof(first.section)!='undefined' ) )
|
|
1120
|
+
{
|
|
1121
|
+
_request = section as carriers.Preference_GetAllFromSectionRequest;
|
|
1122
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1123
|
+
}
|
|
1124
|
+
else
|
|
1125
|
+
{
|
|
1126
|
+
_request = {
|
|
1127
|
+
section: section as string,
|
|
1128
|
+
};
|
|
1129
|
+
_options = webapi_options;
|
|
1130
|
+
}
|
|
1131
|
+
return this._getAllFromSectionAsync( _request, _options );
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
|
|
1135
|
+
private async _saveFromSectionAndKeyAsync(request: carriers.Preference_SaveFromSectionAndKeyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription > {
|
|
1136
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1137
|
+
base.WebApiBase.SetPending(options);
|
|
1138
|
+
return new Promise< carriers.PreferenceDescription >(async (resolve, reject) => {
|
|
1139
|
+
try {
|
|
1140
|
+
config.baseURL = this._options.baseUrl;
|
|
1141
|
+
const response = await this._axios.post("SaveFromSectionAndKey", request , config);
|
|
1142
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1143
|
+
const res : carriers.PreferenceDescription = converters.Create_PreferenceDescription_From( response.data );
|
|
1144
|
+
resolve(res);
|
|
1145
|
+
}
|
|
1146
|
+
catch( err ) {
|
|
1147
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1148
|
+
reject(err);
|
|
1149
|
+
}
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
|
|
1154
|
+
|
|
1155
|
+
/**
|
|
1156
|
+
* Update a PreferenceDescription based on the section and key
|
|
1157
|
+
* @param request - Section, Key, PreferenceDescription
|
|
1158
|
+
* @returns Saved PreferenceDescription
|
|
1159
|
+
*/
|
|
1160
|
+
public async saveFromSectionAndKeyAsync(request: carriers.Preference_SaveFromSectionAndKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
1161
|
+
|
|
1162
|
+
/**
|
|
1163
|
+
* Update a PreferenceDescription based on the section and key
|
|
1164
|
+
* @param section - The PreferenceDescription-section
|
|
1165
|
+
* @param key - The PreferenceDescription-key
|
|
1166
|
+
* @param preferenceDescription - The PreferenceDescription to save.
|
|
1167
|
+
* @returns Saved PreferenceDescription
|
|
1168
|
+
*/
|
|
1169
|
+
public async saveFromSectionAndKeyAsync(section: string, key: string, preferenceDescription: carriers.PreferenceDescription, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription >;
|
|
1170
|
+
|
|
1171
|
+
public async saveFromSectionAndKeyAsync(section:string|carriers.Preference_SaveFromSectionAndKeyRequest, key?:string|base.WebApiRequestOptions, preferenceDescription?:carriers.PreferenceDescription, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescription > {
|
|
1172
|
+
let _request : carriers.Preference_SaveFromSectionAndKeyRequest = null;
|
|
1173
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1174
|
+
const first : any = section;
|
|
1175
|
+
if( typeof( first ) === "object" && first && ( typeof(first.section)!='undefined' || typeof(first.key)!='undefined' || typeof(first.preferenceDescription)!='undefined' ) )
|
|
1176
|
+
{
|
|
1177
|
+
_request = section as carriers.Preference_SaveFromSectionAndKeyRequest;
|
|
1178
|
+
_options = key as base.WebApiRequestOptions;
|
|
1179
|
+
}
|
|
1180
|
+
else
|
|
1181
|
+
{
|
|
1182
|
+
_request = {
|
|
1183
|
+
section: section as string,
|
|
1184
|
+
key: key as string,
|
|
1185
|
+
preferenceDescription: preferenceDescription as carriers.PreferenceDescription,
|
|
1186
|
+
};
|
|
1187
|
+
_options = webapi_options;
|
|
1188
|
+
}
|
|
1189
|
+
return this._saveFromSectionAndKeyAsync( _request, _options );
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
|
|
1193
|
+
private async _deleteFromSectionAndKeyAsync(request: carriers.Preference_DeleteFromSectionAndKeyRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1194
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1195
|
+
base.WebApiBase.SetPending(options);
|
|
1196
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
1197
|
+
try {
|
|
1198
|
+
config.baseURL = this._options.baseUrl;
|
|
1199
|
+
const response = await this._axios.post("DeleteFromSectionAndKey", request , config);
|
|
1200
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1201
|
+
const res = response.data;
|
|
1202
|
+
resolve(res);
|
|
1203
|
+
}
|
|
1204
|
+
catch( err ) {
|
|
1205
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1206
|
+
reject(err);
|
|
1207
|
+
}
|
|
1208
|
+
});
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* Gets a PreferenceDescription based on the section and key
|
|
1215
|
+
* @param request - Section, Key
|
|
1216
|
+
* @returns This method has no return value
|
|
1217
|
+
*/
|
|
1218
|
+
public async deleteFromSectionAndKeyAsync(request: carriers.Preference_DeleteFromSectionAndKeyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* Gets a PreferenceDescription based on the section and key
|
|
1222
|
+
* @param section - The PreferenceDescription-section
|
|
1223
|
+
* @param key - The PreferenceDescription-key
|
|
1224
|
+
* @returns This method has no return value
|
|
1225
|
+
*/
|
|
1226
|
+
public async deleteFromSectionAndKeyAsync(section: string, key: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1227
|
+
|
|
1228
|
+
public async deleteFromSectionAndKeyAsync(section:string|carriers.Preference_DeleteFromSectionAndKeyRequest, key?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1229
|
+
let _request : carriers.Preference_DeleteFromSectionAndKeyRequest = null;
|
|
1230
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1231
|
+
const first : any = section;
|
|
1232
|
+
if( typeof( first ) === "object" && first && ( typeof(first.section)!='undefined' || typeof(first.key)!='undefined' ) )
|
|
1233
|
+
{
|
|
1234
|
+
_request = section as carriers.Preference_DeleteFromSectionAndKeyRequest;
|
|
1235
|
+
_options = key as base.WebApiRequestOptions;
|
|
1236
|
+
}
|
|
1237
|
+
else
|
|
1238
|
+
{
|
|
1239
|
+
_request = {
|
|
1240
|
+
section: section as string,
|
|
1241
|
+
key: key as string,
|
|
1242
|
+
};
|
|
1243
|
+
_options = webapi_options;
|
|
1244
|
+
}
|
|
1245
|
+
return this._deleteFromSectionAndKeyAsync( _request, _options );
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
/**
|
|
1249
|
+
* Gets a PreferenceDescriptionLine object.
|
|
1250
|
+
* @param preferenceDescriptionLineId - The primary key.
|
|
1251
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
1252
|
+
* @returns A single PreferenceDescriptionLine
|
|
1253
|
+
*/
|
|
1254
|
+
public async getPreferenceDescriptionLineAsync(preferenceDescriptionLineId: number, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine > {
|
|
1255
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1256
|
+
base.WebApiBase.SetPending(options);
|
|
1257
|
+
return new Promise< carriers.PreferenceDescriptionLine >(async (resolve, reject) => {
|
|
1258
|
+
try {
|
|
1259
|
+
const response = await this._axios.post("GetPreferenceDescriptionLine?preferenceDescriptionLineId=" + preferenceDescriptionLineId, null, config);
|
|
1260
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1261
|
+
const res = converters.Create_PreferenceDescriptionLine_From( response.data );
|
|
1262
|
+
resolve(res);
|
|
1263
|
+
}
|
|
1264
|
+
catch( err ) {
|
|
1265
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1266
|
+
reject(err);
|
|
1267
|
+
}
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
|
|
1272
|
+
private async _getPreferenceDescriptionLineFromIdAndValueAsync(request: carriers.Preference_GetPreferenceDescriptionLineFromIdAndValueRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine > {
|
|
1273
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1274
|
+
base.WebApiBase.SetPending(options);
|
|
1275
|
+
return new Promise< carriers.PreferenceDescriptionLine >(async (resolve, reject) => {
|
|
1276
|
+
try {
|
|
1277
|
+
config.baseURL = this._options.baseUrl;
|
|
1278
|
+
const response = await this._axios.post("GetPreferenceDescriptionLineFromIdAndValue", request , config);
|
|
1279
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1280
|
+
const res : carriers.PreferenceDescriptionLine = converters.Create_PreferenceDescriptionLine_From( response.data );
|
|
1281
|
+
resolve(res);
|
|
1282
|
+
}
|
|
1283
|
+
catch( err ) {
|
|
1284
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1285
|
+
reject(err);
|
|
1286
|
+
}
|
|
1287
|
+
});
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
|
|
1292
|
+
/**
|
|
1293
|
+
* Get a preference description line from a prefDesc_id and a prefValue
|
|
1294
|
+
* @param request - PrefDescId, PrefValue
|
|
1295
|
+
* @returns The preference description line matching the id and the value
|
|
1296
|
+
*/
|
|
1297
|
+
public async getPreferenceDescriptionLineFromIdAndValueAsync(request: carriers.Preference_GetPreferenceDescriptionLineFromIdAndValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine >;
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* Get a preference description line from a prefDesc_id and a prefValue
|
|
1301
|
+
* @param prefDescId - The id of the preference description this line is connected to
|
|
1302
|
+
* @param prefValue - The value of the description line to return
|
|
1303
|
+
* @returns The preference description line matching the id and the value
|
|
1304
|
+
*/
|
|
1305
|
+
public async getPreferenceDescriptionLineFromIdAndValueAsync(prefDescId: number, prefValue: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine >;
|
|
1306
|
+
|
|
1307
|
+
public async getPreferenceDescriptionLineFromIdAndValueAsync(prefDescId:number|carriers.Preference_GetPreferenceDescriptionLineFromIdAndValueRequest, prefValue?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine > {
|
|
1308
|
+
let _request : carriers.Preference_GetPreferenceDescriptionLineFromIdAndValueRequest = null;
|
|
1309
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1310
|
+
const first : any = prefDescId;
|
|
1311
|
+
if( typeof( first ) === "object" && first && ( typeof(first.prefDescId)!='undefined' || typeof(first.prefValue)!='undefined' ) )
|
|
1312
|
+
{
|
|
1313
|
+
_request = prefDescId as carriers.Preference_GetPreferenceDescriptionLineFromIdAndValueRequest;
|
|
1314
|
+
_options = prefValue as base.WebApiRequestOptions;
|
|
1315
|
+
}
|
|
1316
|
+
else
|
|
1317
|
+
{
|
|
1318
|
+
_request = {
|
|
1319
|
+
prefDescId: prefDescId as number,
|
|
1320
|
+
prefValue: prefValue as string,
|
|
1321
|
+
};
|
|
1322
|
+
_options = webapi_options;
|
|
1323
|
+
}
|
|
1324
|
+
return this._getPreferenceDescriptionLineFromIdAndValueAsync( _request, _options );
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
|
|
1328
|
+
private async _getPreferenceDescriptionLinesByPrefDescIdAsync(request: carriers.Preference_GetPreferenceDescriptionLinesByPrefDescIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] > {
|
|
1329
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1330
|
+
base.WebApiBase.SetPending(options);
|
|
1331
|
+
return new Promise< carriers.PreferenceDescriptionLine[] >(async (resolve, reject) => {
|
|
1332
|
+
try {
|
|
1333
|
+
config.baseURL = this._options.baseUrl;
|
|
1334
|
+
const response = await this._axios.post("GetPreferenceDescriptionLinesByPrefDescId", request , config);
|
|
1335
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1336
|
+
const res : carriers.PreferenceDescriptionLine[] = converters.Create_PreferenceDescriptionLineArray_From( response.data );
|
|
1337
|
+
resolve(res);
|
|
1338
|
+
}
|
|
1339
|
+
catch( err ) {
|
|
1340
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1341
|
+
reject(err);
|
|
1342
|
+
}
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
|
|
1347
|
+
|
|
1348
|
+
/**
|
|
1349
|
+
* Get all preference description lines from a prefDesc_id
|
|
1350
|
+
* @param request - PrefDescId
|
|
1351
|
+
* @returns The preference description lines matching the id
|
|
1352
|
+
*/
|
|
1353
|
+
public async getPreferenceDescriptionLinesByPrefDescIdAsync(request: carriers.Preference_GetPreferenceDescriptionLinesByPrefDescIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* Get all preference description lines from a prefDesc_id
|
|
1357
|
+
* @param prefDescId - The id of the preference description this line is connected to
|
|
1358
|
+
* @returns The preference description lines matching the id
|
|
1359
|
+
*/
|
|
1360
|
+
public async getPreferenceDescriptionLinesByPrefDescIdAsync(prefDescId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
1361
|
+
|
|
1362
|
+
public async getPreferenceDescriptionLinesByPrefDescIdAsync(prefDescId:number|carriers.Preference_GetPreferenceDescriptionLinesByPrefDescIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] > {
|
|
1363
|
+
let _request : carriers.Preference_GetPreferenceDescriptionLinesByPrefDescIdRequest = null;
|
|
1364
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1365
|
+
const first : any = prefDescId;
|
|
1366
|
+
if( typeof( first ) === "object" && first && ( typeof(first.prefDescId)!='undefined' ) )
|
|
1367
|
+
{
|
|
1368
|
+
_request = prefDescId as carriers.Preference_GetPreferenceDescriptionLinesByPrefDescIdRequest;
|
|
1369
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1370
|
+
}
|
|
1371
|
+
else
|
|
1372
|
+
{
|
|
1373
|
+
_request = {
|
|
1374
|
+
prefDescId: prefDescId as number,
|
|
1375
|
+
};
|
|
1376
|
+
_options = webapi_options;
|
|
1377
|
+
}
|
|
1378
|
+
return this._getPreferenceDescriptionLinesByPrefDescIdAsync( _request, _options );
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
private async _savePreferenceDescriptionLinesAsync(request: carriers.Preference_SavePreferenceDescriptionLinesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] > {
|
|
1383
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1384
|
+
base.WebApiBase.SetPending(options);
|
|
1385
|
+
return new Promise< carriers.PreferenceDescriptionLine[] >(async (resolve, reject) => {
|
|
1386
|
+
try {
|
|
1387
|
+
config.baseURL = this._options.baseUrl;
|
|
1388
|
+
const response = await this._axios.post("SavePreferenceDescriptionLines", request , config);
|
|
1389
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1390
|
+
const res : carriers.PreferenceDescriptionLine[] = converters.Create_PreferenceDescriptionLineArray_From( response.data );
|
|
1391
|
+
resolve(res);
|
|
1392
|
+
}
|
|
1393
|
+
catch( err ) {
|
|
1394
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1395
|
+
reject(err);
|
|
1396
|
+
}
|
|
1397
|
+
});
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
|
|
1401
|
+
|
|
1402
|
+
/**
|
|
1403
|
+
* Saves the PreferenceDescriptionLine array in the SuperOffice database
|
|
1404
|
+
* @param request - PreferenceDescriptionLines
|
|
1405
|
+
* @returns The updated PrefDesc lines (If the PreferenceDescriptionLine array was new, it returns with id's set.
|
|
1406
|
+
*/
|
|
1407
|
+
public async savePreferenceDescriptionLinesAsync(request: carriers.Preference_SavePreferenceDescriptionLinesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
1408
|
+
|
|
1409
|
+
/**
|
|
1410
|
+
* Saves the PreferenceDescriptionLine array in the SuperOffice database
|
|
1411
|
+
* @param preferenceDescriptionLines - The PreferenceDescriptionLine array to save.
|
|
1412
|
+
* @returns The updated PrefDesc lines (If the PreferenceDescriptionLine array was new, it returns with id's set.
|
|
1413
|
+
*/
|
|
1414
|
+
public async savePreferenceDescriptionLinesAsync(preferenceDescriptionLines: carriers.PreferenceDescriptionLine[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] >;
|
|
1415
|
+
|
|
1416
|
+
public async savePreferenceDescriptionLinesAsync(preferenceDescriptionLines:carriers.PreferenceDescriptionLine[]|carriers.Preference_SavePreferenceDescriptionLinesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreferenceDescriptionLine[] > {
|
|
1417
|
+
let _request : carriers.Preference_SavePreferenceDescriptionLinesRequest = null;
|
|
1418
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1419
|
+
const first : any = preferenceDescriptionLines;
|
|
1420
|
+
if( typeof( first ) === "object" && first && ( typeof(first.preferenceDescriptionLines)!='undefined' ) )
|
|
1421
|
+
{
|
|
1422
|
+
_request = preferenceDescriptionLines as carriers.Preference_SavePreferenceDescriptionLinesRequest;
|
|
1423
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1424
|
+
}
|
|
1425
|
+
else
|
|
1426
|
+
{
|
|
1427
|
+
_request = {
|
|
1428
|
+
preferenceDescriptionLines: preferenceDescriptionLines as carriers.PreferenceDescriptionLine[],
|
|
1429
|
+
};
|
|
1430
|
+
_options = webapi_options;
|
|
1431
|
+
}
|
|
1432
|
+
return this._savePreferenceDescriptionLinesAsync( _request, _options );
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
|
|
1436
|
+
private async _deletePreferenceDescriptionLinesAsync(request: carriers.Preference_DeletePreferenceDescriptionLinesRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1437
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1438
|
+
base.WebApiBase.SetPending(options);
|
|
1439
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
1440
|
+
try {
|
|
1441
|
+
config.baseURL = this._options.baseUrl;
|
|
1442
|
+
const response = await this._axios.post("DeletePreferenceDescriptionLines", request , config);
|
|
1443
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1444
|
+
const res = response.data;
|
|
1445
|
+
resolve(res);
|
|
1446
|
+
}
|
|
1447
|
+
catch( err ) {
|
|
1448
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1449
|
+
reject(err);
|
|
1450
|
+
}
|
|
1451
|
+
});
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
|
|
1455
|
+
|
|
1456
|
+
/**
|
|
1457
|
+
* Delete the PrefDescLines in the SuperOffice database
|
|
1458
|
+
* @param request - PrefDescLineIds
|
|
1459
|
+
* @returns Nothing
|
|
1460
|
+
*/
|
|
1461
|
+
public async deletePreferenceDescriptionLinesAsync(request: carriers.Preference_DeletePreferenceDescriptionLinesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1462
|
+
|
|
1463
|
+
/**
|
|
1464
|
+
* Delete the PrefDescLines in the SuperOffice database
|
|
1465
|
+
* @param prefDescLineIds - Primary keys of the PrefDescLines to delete
|
|
1466
|
+
* @returns Nothing
|
|
1467
|
+
*/
|
|
1468
|
+
public async deletePreferenceDescriptionLinesAsync(prefDescLineIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1469
|
+
|
|
1470
|
+
public async deletePreferenceDescriptionLinesAsync(prefDescLineIds:number[]|carriers.Preference_DeletePreferenceDescriptionLinesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1471
|
+
let _request : carriers.Preference_DeletePreferenceDescriptionLinesRequest = null;
|
|
1472
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1473
|
+
const first : any = prefDescLineIds;
|
|
1474
|
+
if( typeof( first ) === "object" && first && ( typeof(first.prefDescLineIds)!='undefined' ) )
|
|
1475
|
+
{
|
|
1476
|
+
_request = prefDescLineIds as carriers.Preference_DeletePreferenceDescriptionLinesRequest;
|
|
1477
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1478
|
+
}
|
|
1479
|
+
else
|
|
1480
|
+
{
|
|
1481
|
+
_request = {
|
|
1482
|
+
prefDescLineIds: prefDescLineIds as number[],
|
|
1483
|
+
};
|
|
1484
|
+
_options = webapi_options;
|
|
1485
|
+
}
|
|
1486
|
+
return this._deletePreferenceDescriptionLinesAsync( _request, _options );
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
private async _deletePrefDescLinesByPrefDescIdAsync(request: carriers.Preference_DeletePrefDescLinesByPrefDescIdRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1491
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1492
|
+
base.WebApiBase.SetPending(options);
|
|
1493
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
1494
|
+
try {
|
|
1495
|
+
config.baseURL = this._options.baseUrl;
|
|
1496
|
+
const response = await this._axios.post("DeletePrefDescLinesByPrefDescId", request , config);
|
|
1497
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1498
|
+
const res = response.data;
|
|
1499
|
+
resolve(res);
|
|
1500
|
+
}
|
|
1501
|
+
catch( err ) {
|
|
1502
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1503
|
+
reject(err);
|
|
1504
|
+
}
|
|
1505
|
+
});
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
|
|
1509
|
+
|
|
1510
|
+
/**
|
|
1511
|
+
* Delete the PrefDescLines associated with Preference Description Id in the SuperOffice database
|
|
1512
|
+
* @param request - PrefDescId
|
|
1513
|
+
* @returns Nothing
|
|
1514
|
+
*/
|
|
1515
|
+
public async deletePrefDescLinesByPrefDescIdAsync(request: carriers.Preference_DeletePrefDescLinesByPrefDescIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1516
|
+
|
|
1517
|
+
/**
|
|
1518
|
+
* Delete the PrefDescLines associated with Preference Description Id in the SuperOffice database
|
|
1519
|
+
* @param prefDescId - Primary key of the Preference Description that contains PrefDescLines to delete
|
|
1520
|
+
* @returns Nothing
|
|
1521
|
+
*/
|
|
1522
|
+
public async deletePrefDescLinesByPrefDescIdAsync(prefDescId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1523
|
+
|
|
1524
|
+
public async deletePrefDescLinesByPrefDescIdAsync(prefDescId:number|carriers.Preference_DeletePrefDescLinesByPrefDescIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1525
|
+
let _request : carriers.Preference_DeletePrefDescLinesByPrefDescIdRequest = null;
|
|
1526
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1527
|
+
const first : any = prefDescId;
|
|
1528
|
+
if( typeof( first ) === "object" && first && ( typeof(first.prefDescId)!='undefined' ) )
|
|
1529
|
+
{
|
|
1530
|
+
_request = prefDescId as carriers.Preference_DeletePrefDescLinesByPrefDescIdRequest;
|
|
1531
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1532
|
+
}
|
|
1533
|
+
else
|
|
1534
|
+
{
|
|
1535
|
+
_request = {
|
|
1536
|
+
prefDescId: prefDescId as number,
|
|
1537
|
+
};
|
|
1538
|
+
_options = webapi_options;
|
|
1539
|
+
}
|
|
1540
|
+
return this._deletePrefDescLinesByPrefDescIdAsync( _request, _options );
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
|
|
1544
|
+
private async _deletePrefDescLinesByPrefDescIdsAsync(request: carriers.Preference_DeletePrefDescLinesByPrefDescIdsRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1545
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1546
|
+
base.WebApiBase.SetPending(options);
|
|
1547
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
1548
|
+
try {
|
|
1549
|
+
config.baseURL = this._options.baseUrl;
|
|
1550
|
+
const response = await this._axios.post("DeletePrefDescLinesByPrefDescIds", request , config);
|
|
1551
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1552
|
+
const res = response.data;
|
|
1553
|
+
resolve(res);
|
|
1554
|
+
}
|
|
1555
|
+
catch( err ) {
|
|
1556
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1557
|
+
reject(err);
|
|
1558
|
+
}
|
|
1559
|
+
});
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
|
|
1563
|
+
|
|
1564
|
+
/**
|
|
1565
|
+
* Delete the PrefDescLines associated with Preference Description Ids in the SuperOffice database
|
|
1566
|
+
* @param request - PrefDescIds
|
|
1567
|
+
* @returns Nothing
|
|
1568
|
+
*/
|
|
1569
|
+
public async deletePrefDescLinesByPrefDescIdsAsync(request: carriers.Preference_DeletePrefDescLinesByPrefDescIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1570
|
+
|
|
1571
|
+
/**
|
|
1572
|
+
* Delete the PrefDescLines associated with Preference Description Ids in the SuperOffice database
|
|
1573
|
+
* @param prefDescIds - Primary keys of the Preference Descriptions that contains PrefDescLines to delete
|
|
1574
|
+
* @returns Nothing
|
|
1575
|
+
*/
|
|
1576
|
+
public async deletePrefDescLinesByPrefDescIdsAsync(prefDescIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1577
|
+
|
|
1578
|
+
public async deletePrefDescLinesByPrefDescIdsAsync(prefDescIds:number[]|carriers.Preference_DeletePrefDescLinesByPrefDescIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1579
|
+
let _request : carriers.Preference_DeletePrefDescLinesByPrefDescIdsRequest = null;
|
|
1580
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1581
|
+
const first : any = prefDescIds;
|
|
1582
|
+
if( typeof( first ) === "object" && first && ( typeof(first.prefDescIds)!='undefined' ) )
|
|
1583
|
+
{
|
|
1584
|
+
_request = prefDescIds as carriers.Preference_DeletePrefDescLinesByPrefDescIdsRequest;
|
|
1585
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1586
|
+
}
|
|
1587
|
+
else
|
|
1588
|
+
{
|
|
1589
|
+
_request = {
|
|
1590
|
+
prefDescIds: prefDescIds as number[],
|
|
1591
|
+
};
|
|
1592
|
+
_options = webapi_options;
|
|
1593
|
+
}
|
|
1594
|
+
return this._deletePrefDescLinesByPrefDescIdsAsync( _request, _options );
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
|
|
1598
|
+
private async _getPreferencesAsync(request: carriers.Preference_GetPreferencesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] > {
|
|
1599
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1600
|
+
base.WebApiBase.SetPending(options);
|
|
1601
|
+
return new Promise< carriers.Preference[] >(async (resolve, reject) => {
|
|
1602
|
+
try {
|
|
1603
|
+
config.baseURL = this._options.baseUrl;
|
|
1604
|
+
const response = await this._axios.post("GetPreferences", request , config);
|
|
1605
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1606
|
+
const res : carriers.Preference[] = converters.Create_PreferenceArray_From( response.data );
|
|
1607
|
+
resolve(res);
|
|
1608
|
+
}
|
|
1609
|
+
catch( err ) {
|
|
1610
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1611
|
+
reject(err);
|
|
1612
|
+
}
|
|
1613
|
+
});
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
|
|
1617
|
+
|
|
1618
|
+
/**
|
|
1619
|
+
* Get one or more preferences based on a set of specifications.<br/>The prefDisplayvalue and prefDisplaytooltip are blank (faster processing relative to GetPreferencesWithDisplayValues)
|
|
1620
|
+
* @param request - Specifications
|
|
1621
|
+
* @returns Array of preference values for your given specification(s). More strictly: 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere.
|
|
1622
|
+
*/
|
|
1623
|
+
public async getPreferencesAsync(request: carriers.Preference_GetPreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
1624
|
+
|
|
1625
|
+
/**
|
|
1626
|
+
* Get one or more preferences based on a set of specifications.<br/>The prefDisplayvalue and prefDisplaytooltip are blank (faster processing relative to GetPreferencesWithDisplayValues)
|
|
1627
|
+
* @param specifications - Array of preference specifications. The key value may be * (asterisk), which means 'all keys within section'. Note that the semantics of this are more strictly 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere. You can also have askerisk as the section name. In that case the specification array must contain exactly one entry and the key must also be asterisk. This will return all known preferences in all sections for your associate. It might be a lot, tests have shown that a heavily used database can accumulate up to 500 preferences on a single associate. If the Sentry table/field right preferences have been used, the number could be a lot greater!
|
|
1628
|
+
* @returns Array of preference values for your given specification(s). More strictly: 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere.
|
|
1629
|
+
*/
|
|
1630
|
+
public async getPreferencesAsync(specifications: carriers.PreferenceSpec[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
1631
|
+
|
|
1632
|
+
public async getPreferencesAsync(specifications:carriers.PreferenceSpec[]|carriers.Preference_GetPreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] > {
|
|
1633
|
+
let _request : carriers.Preference_GetPreferencesRequest = null;
|
|
1634
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1635
|
+
const first : any = specifications;
|
|
1636
|
+
if( typeof( first ) === "object" && first && ( typeof(first.specifications)!='undefined' ) )
|
|
1637
|
+
{
|
|
1638
|
+
_request = specifications as carriers.Preference_GetPreferencesRequest;
|
|
1639
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1640
|
+
}
|
|
1641
|
+
else
|
|
1642
|
+
{
|
|
1643
|
+
_request = {
|
|
1644
|
+
specifications: specifications as carriers.PreferenceSpec[],
|
|
1645
|
+
};
|
|
1646
|
+
_options = webapi_options;
|
|
1647
|
+
}
|
|
1648
|
+
return this._getPreferencesAsync( _request, _options );
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
|
|
1652
|
+
private async _savePreferencesAsync(request: carriers.Preference_SavePreferencesRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1653
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1654
|
+
base.WebApiBase.SetPending(options);
|
|
1655
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
1656
|
+
try {
|
|
1657
|
+
config.baseURL = this._options.baseUrl;
|
|
1658
|
+
const response = await this._axios.post("SavePreferences", request , config);
|
|
1659
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1660
|
+
const res = response.data;
|
|
1661
|
+
resolve(res);
|
|
1662
|
+
}
|
|
1663
|
+
catch( err ) {
|
|
1664
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1665
|
+
reject(err);
|
|
1666
|
+
}
|
|
1667
|
+
});
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
|
|
1671
|
+
|
|
1672
|
+
/**
|
|
1673
|
+
* Save this set of preferences. Note this method DOES NOT look at level/targetId - it only saves on behalf of the CURRENT USER.
|
|
1674
|
+
* @param request - Preferences
|
|
1675
|
+
* @returns
|
|
1676
|
+
*/
|
|
1677
|
+
public async savePreferencesAsync(request: carriers.Preference_SavePreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1678
|
+
|
|
1679
|
+
/**
|
|
1680
|
+
* Save this set of preferences. Note this method DOES NOT look at level/targetId - it only saves on behalf of the CURRENT USER.
|
|
1681
|
+
* @param preferences - Preferences to be saved. Note that all fields must be filled in, and the preference will be saved on the Associate level only! Setting for other levels is an administrative task and not available through this service.
|
|
1682
|
+
* @returns
|
|
1683
|
+
*/
|
|
1684
|
+
public async savePreferencesAsync(preferences: carriers.Preference[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1685
|
+
|
|
1686
|
+
public async savePreferencesAsync(preferences:carriers.Preference[]|carriers.Preference_SavePreferencesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1687
|
+
let _request : carriers.Preference_SavePreferencesRequest = null;
|
|
1688
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1689
|
+
const first : any = preferences;
|
|
1690
|
+
if( typeof( first ) === "object" && first && ( typeof(first.preferences)!='undefined' ) )
|
|
1691
|
+
{
|
|
1692
|
+
_request = preferences as carriers.Preference_SavePreferencesRequest;
|
|
1693
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1694
|
+
}
|
|
1695
|
+
else
|
|
1696
|
+
{
|
|
1697
|
+
_request = {
|
|
1698
|
+
preferences: preferences as carriers.Preference[],
|
|
1699
|
+
};
|
|
1700
|
+
_options = webapi_options;
|
|
1701
|
+
}
|
|
1702
|
+
return this._savePreferencesAsync( _request, _options );
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
|
|
1706
|
+
private async _getPreferencesWithDisplayValuesAsync(request: carriers.Preference_GetPreferencesWithDisplayValuesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] > {
|
|
1707
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1708
|
+
base.WebApiBase.SetPending(options);
|
|
1709
|
+
return new Promise< carriers.Preference[] >(async (resolve, reject) => {
|
|
1710
|
+
try {
|
|
1711
|
+
config.baseURL = this._options.baseUrl;
|
|
1712
|
+
const response = await this._axios.post("GetPreferencesWithDisplayValues", request , config);
|
|
1713
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1714
|
+
const res : carriers.Preference[] = converters.Create_PreferenceArray_From( response.data );
|
|
1715
|
+
resolve(res);
|
|
1716
|
+
}
|
|
1717
|
+
catch( err ) {
|
|
1718
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1719
|
+
reject(err);
|
|
1720
|
+
}
|
|
1721
|
+
});
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
|
|
1725
|
+
|
|
1726
|
+
/**
|
|
1727
|
+
* Get one or more preferences based on a set of specifications<br/>The PrefDisplayValue and PrefDisplaytooltip are populated, at some additional processing cost.
|
|
1728
|
+
* @param request - Specifications
|
|
1729
|
+
* @returns Array of preference values for your given specification(s). More strictly: 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere.<br/>The PrefDisplayValue and PrefDisplaytooltip are populated, at some additional processing cost.
|
|
1730
|
+
*/
|
|
1731
|
+
public async getPreferencesWithDisplayValuesAsync(request: carriers.Preference_GetPreferencesWithDisplayValuesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
1732
|
+
|
|
1733
|
+
/**
|
|
1734
|
+
* Get one or more preferences based on a set of specifications<br/>The PrefDisplayValue and PrefDisplaytooltip are populated, at some additional processing cost.
|
|
1735
|
+
* @param specifications - Array of preference specifications. The key value may be * (asterisk), which means 'all keys within section'. Note that the semantics of this are more strictly 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere. You can also have askerisk as the section name. In that case the specification array must contain exactly one entry and the key must also be asterisk. This will return all known preferences in all sections for your associate. It might be a lot, tests have shown that a heavily used database can accumulate up to 500 preferences on a single associate. If the Sentry table/field right preferences have been used, the number could be a lot greater!
|
|
1736
|
+
* @returns Array of preference values for your given specification(s). More strictly: 'all keys actually set at any accessible level for this associate'; you will NOT get entries for preferences that might exist, but have no set value anywhere.<br/>The PrefDisplayValue and PrefDisplaytooltip are populated, at some additional processing cost.
|
|
1737
|
+
*/
|
|
1738
|
+
public async getPreferencesWithDisplayValuesAsync(specifications: carriers.PreferenceSpec[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] >;
|
|
1739
|
+
|
|
1740
|
+
public async getPreferencesWithDisplayValuesAsync(specifications:carriers.PreferenceSpec[]|carriers.Preference_GetPreferencesWithDisplayValuesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Preference[] > {
|
|
1741
|
+
let _request : carriers.Preference_GetPreferencesWithDisplayValuesRequest = null;
|
|
1742
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1743
|
+
const first : any = specifications;
|
|
1744
|
+
if( typeof( first ) === "object" && first && ( typeof(first.specifications)!='undefined' ) )
|
|
1745
|
+
{
|
|
1746
|
+
_request = specifications as carriers.Preference_GetPreferencesWithDisplayValuesRequest;
|
|
1747
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1748
|
+
}
|
|
1749
|
+
else
|
|
1750
|
+
{
|
|
1751
|
+
_request = {
|
|
1752
|
+
specifications: specifications as carriers.PreferenceSpec[],
|
|
1753
|
+
};
|
|
1754
|
+
_options = webapi_options;
|
|
1755
|
+
}
|
|
1756
|
+
return this._getPreferencesWithDisplayValuesAsync( _request, _options );
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
|
|
1760
|
+
private async _getTabOrdersAsync( options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder[] > {
|
|
1761
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1762
|
+
base.WebApiBase.SetPending(options);
|
|
1763
|
+
return new Promise< carriers.TabOrder[] >(async (resolve, reject) => {
|
|
1764
|
+
try {
|
|
1765
|
+
config.baseURL = this._options.baseUrl;
|
|
1766
|
+
const response = await this._axios.post("GetTabOrders", undefined , config);
|
|
1767
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1768
|
+
const res : carriers.TabOrder[] = converters.Create_TabOrderArray_From( response.data );
|
|
1769
|
+
resolve(res);
|
|
1770
|
+
}
|
|
1771
|
+
catch( err ) {
|
|
1772
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1773
|
+
reject(err);
|
|
1774
|
+
}
|
|
1775
|
+
});
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
|
|
1779
|
+
/**
|
|
1780
|
+
*
|
|
1781
|
+
* @returns
|
|
1782
|
+
*/
|
|
1783
|
+
public async getTabOrdersAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TabOrder[] >
|
|
1784
|
+
{
|
|
1785
|
+
return this._getTabOrdersAsync(webapi_options);
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
|
|
1789
|
+
private async _saveTabOrdersAsync(request: carriers.Preference_SaveTabOrdersRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1790
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1791
|
+
base.WebApiBase.SetPending(options);
|
|
1792
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
1793
|
+
try {
|
|
1794
|
+
config.baseURL = this._options.baseUrl;
|
|
1795
|
+
const response = await this._axios.post("SaveTabOrders", request , config);
|
|
1796
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1797
|
+
const res = response.data;
|
|
1798
|
+
resolve(res);
|
|
1799
|
+
}
|
|
1800
|
+
catch( err ) {
|
|
1801
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1802
|
+
reject(err);
|
|
1803
|
+
}
|
|
1804
|
+
});
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
|
|
1808
|
+
|
|
1809
|
+
/**
|
|
1810
|
+
*
|
|
1811
|
+
* @param request - TabOrders
|
|
1812
|
+
* @returns
|
|
1813
|
+
*/
|
|
1814
|
+
public async saveTabOrdersAsync(request: carriers.Preference_SaveTabOrdersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1815
|
+
|
|
1816
|
+
/**
|
|
1817
|
+
*
|
|
1818
|
+
* @param tabOrders -
|
|
1819
|
+
* @returns
|
|
1820
|
+
*/
|
|
1821
|
+
public async saveTabOrdersAsync(tabOrders: carriers.TabOrder[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1822
|
+
|
|
1823
|
+
public async saveTabOrdersAsync(tabOrders:carriers.TabOrder[]|carriers.Preference_SaveTabOrdersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1824
|
+
let _request : carriers.Preference_SaveTabOrdersRequest = null;
|
|
1825
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1826
|
+
const first : any = tabOrders;
|
|
1827
|
+
if( typeof( first ) === "object" && first && ( typeof(first.tabOrders)!='undefined' ) )
|
|
1828
|
+
{
|
|
1829
|
+
_request = tabOrders as carriers.Preference_SaveTabOrdersRequest;
|
|
1830
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1831
|
+
}
|
|
1832
|
+
else
|
|
1833
|
+
{
|
|
1834
|
+
_request = {
|
|
1835
|
+
tabOrders: tabOrders as carriers.TabOrder[],
|
|
1836
|
+
};
|
|
1837
|
+
_options = webapi_options;
|
|
1838
|
+
}
|
|
1839
|
+
return this._saveTabOrdersAsync( _request, _options );
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
|
|
1843
|
+
private async _savePreferenceEntitiesAsync(request: carriers.Preference_SavePreferenceEntitiesRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1844
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1845
|
+
base.WebApiBase.SetPending(options);
|
|
1846
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
1847
|
+
try {
|
|
1848
|
+
config.baseURL = this._options.baseUrl;
|
|
1849
|
+
const response = await this._axios.post("SavePreferenceEntities", request , config);
|
|
1850
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1851
|
+
const res = response.data;
|
|
1852
|
+
resolve(res);
|
|
1853
|
+
}
|
|
1854
|
+
catch( err ) {
|
|
1855
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1856
|
+
reject(err);
|
|
1857
|
+
}
|
|
1858
|
+
});
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
|
|
1862
|
+
|
|
1863
|
+
/**
|
|
1864
|
+
* Save this set of preferences.
|
|
1865
|
+
* @param request - Preferences, RemoveLowerLevels
|
|
1866
|
+
* @returns
|
|
1867
|
+
*/
|
|
1868
|
+
public async savePreferenceEntitiesAsync(request: carriers.Preference_SavePreferenceEntitiesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1869
|
+
|
|
1870
|
+
/**
|
|
1871
|
+
* Save this set of preferences.
|
|
1872
|
+
* @param preferences - Preferences to be saved. Note that all fields must be filled in.
|
|
1873
|
+
* @param removeLowerLevels - If this is true, all user preferences on lower levels will be deleted
|
|
1874
|
+
* @returns
|
|
1875
|
+
*/
|
|
1876
|
+
public async savePreferenceEntitiesAsync(preferences: carriers.Preference[], removeLowerLevels: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1877
|
+
|
|
1878
|
+
public async savePreferenceEntitiesAsync(preferences:carriers.Preference[]|carriers.Preference_SavePreferenceEntitiesRequest, removeLowerLevels?:boolean|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1879
|
+
let _request : carriers.Preference_SavePreferenceEntitiesRequest = null;
|
|
1880
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1881
|
+
const first : any = preferences;
|
|
1882
|
+
if( typeof( first ) === "object" && first && ( typeof(first.preferences)!='undefined' || typeof(first.removeLowerLevels)!='undefined' ) )
|
|
1883
|
+
{
|
|
1884
|
+
_request = preferences as carriers.Preference_SavePreferenceEntitiesRequest;
|
|
1885
|
+
_options = removeLowerLevels as base.WebApiRequestOptions;
|
|
1886
|
+
}
|
|
1887
|
+
else
|
|
1888
|
+
{
|
|
1889
|
+
_request = {
|
|
1890
|
+
preferences: preferences as carriers.Preference[],
|
|
1891
|
+
removeLowerLevels: removeLowerLevels as boolean,
|
|
1892
|
+
};
|
|
1893
|
+
_options = webapi_options;
|
|
1894
|
+
}
|
|
1895
|
+
return this._savePreferenceEntitiesAsync( _request, _options );
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1898
|
+
} // class v1PreferenceAgentController
|
|
1899
|
+
|
|
1900
|
+
|