@superoffice/webapi 12.2.2072 → 12.3.2570

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/cjs/Carriers.d.ts +367 -20
  2. package/dist/cjs/Carriers.d.ts.map +1 -1
  3. package/dist/cjs/ConfigurationAgent.d.ts +17 -0
  4. package/dist/cjs/ConfigurationAgent.d.ts.map +1 -1
  5. package/dist/cjs/ConfigurationAgent.js +35 -0
  6. package/dist/cjs/ConfigurationAgent.js.map +1 -1
  7. package/dist/cjs/Converters.d.ts +24 -0
  8. package/dist/cjs/Converters.d.ts.map +1 -1
  9. package/dist/cjs/Converters.js +317 -32
  10. package/dist/cjs/Converters.js.map +1 -1
  11. package/dist/cjs/DiagnosticsAgent.d.ts +7 -0
  12. package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
  13. package/dist/cjs/DiagnosticsAgent.js +24 -0
  14. package/dist/cjs/DiagnosticsAgent.js.map +1 -1
  15. package/dist/cjs/Enums.d.ts +22 -0
  16. package/dist/cjs/Enums.d.ts.map +1 -1
  17. package/dist/cjs/Enums.js +25 -1
  18. package/dist/cjs/Enums.js.map +1 -1
  19. package/dist/cjs/ListAgent.d.ts +31 -0
  20. package/dist/cjs/ListAgent.d.ts.map +1 -1
  21. package/dist/cjs/ListAgent.js +87 -0
  22. package/dist/cjs/ListAgent.js.map +1 -1
  23. package/dist/cjs/MarketingAgent.d.ts +94 -16
  24. package/dist/cjs/MarketingAgent.d.ts.map +1 -1
  25. package/dist/cjs/MarketingAgent.js +222 -34
  26. package/dist/cjs/MarketingAgent.js.map +1 -1
  27. package/dist/cjs/ViewStateAgent.d.ts +34 -0
  28. package/dist/cjs/ViewStateAgent.d.ts.map +1 -1
  29. package/dist/cjs/ViewStateAgent.js +70 -0
  30. package/dist/cjs/ViewStateAgent.js.map +1 -1
  31. package/dist/esm/Carriers.d.ts +367 -20
  32. package/dist/esm/Carriers.d.ts.map +1 -1
  33. package/dist/esm/ConfigurationAgent.d.ts +17 -0
  34. package/dist/esm/ConfigurationAgent.d.ts.map +1 -1
  35. package/dist/esm/ConfigurationAgent.js +35 -0
  36. package/dist/esm/ConfigurationAgent.js.map +1 -1
  37. package/dist/esm/Converters.d.ts +24 -0
  38. package/dist/esm/Converters.d.ts.map +1 -1
  39. package/dist/esm/Converters.js +262 -1
  40. package/dist/esm/Converters.js.map +1 -1
  41. package/dist/esm/DiagnosticsAgent.d.ts +7 -0
  42. package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
  43. package/dist/esm/DiagnosticsAgent.js +24 -0
  44. package/dist/esm/DiagnosticsAgent.js.map +1 -1
  45. package/dist/esm/Enums.d.ts +22 -0
  46. package/dist/esm/Enums.d.ts.map +1 -1
  47. package/dist/esm/Enums.js +23 -0
  48. package/dist/esm/Enums.js.map +1 -1
  49. package/dist/esm/ListAgent.d.ts +31 -0
  50. package/dist/esm/ListAgent.d.ts.map +1 -1
  51. package/dist/esm/ListAgent.js +87 -0
  52. package/dist/esm/ListAgent.js.map +1 -1
  53. package/dist/esm/MarketingAgent.d.ts +94 -16
  54. package/dist/esm/MarketingAgent.d.ts.map +1 -1
  55. package/dist/esm/MarketingAgent.js +222 -34
  56. package/dist/esm/MarketingAgent.js.map +1 -1
  57. package/dist/esm/ViewStateAgent.d.ts +34 -0
  58. package/dist/esm/ViewStateAgent.d.ts.map +1 -1
  59. package/dist/esm/ViewStateAgent.js +70 -0
  60. package/dist/esm/ViewStateAgent.js.map +1 -1
  61. package/package.json +3 -3
  62. package/src/Carriers.ts +524 -24
  63. package/src/ConfigurationAgent.ts +60 -0
  64. package/src/Converters.ts +326 -1
  65. package/src/DiagnosticsAgent.ts +30 -0
  66. package/src/Enums.ts +24 -0
  67. package/src/ListAgent.ts +94 -0
  68. package/src/MarketingAgent.ts +324 -58
  69. package/src/ViewStateAgent.ts +120 -0
@@ -53,8 +53,12 @@ export interface IViewStateAgent {
53
53
  saveCurrentsAsync(currents: carriers.History[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
54
54
  getHistoriesByNamesAndIdsAsync(request: carriers.ViewState_GetHistoriesByNamesAndIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
55
55
  getHistoriesByNamesAndIdsAsync(requests: carriers.HistoryRequest[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
56
+ upsertRecentNavigationAsync(request: carriers.ViewState_UpsertRecentNavigationRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
57
+ upsertRecentNavigationAsync(client: string, elements: carriers.NavigationElement[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
56
58
  publishAndRetrieveUiEventsAsync(request: carriers.ViewState_PublishAndRetrieveUiEventsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] >;
57
59
  publishAndRetrieveUiEventsAsync(latestKnownEventId: number, publishEvents: carriers.UiEvent[], metrics: carriers.MetricPair[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] >;
60
+ publishAndSyncUiEventsAsync(request: carriers.ViewState_PublishAndSyncUiEventsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiSyncResult >;
61
+ publishAndSyncUiEventsAsync(latestKnownEventId: number, publishEvents: carriers.UiEvent[], metrics: carriers.MetricPair[], ticketVersions: carriers.TicketVersionInfo[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiSyncResult >;
58
62
  } // interface IViewStateAgent
59
63
 
60
64
 
@@ -796,6 +800,62 @@ export class ViewStateAgent extends base.WebApiBase implements IViewStateAgent {
796
800
  }
797
801
 
798
802
 
803
+ private async _upsertRecentNavigationAsync(request: carriers.ViewState_UpsertRecentNavigationRequest, options?:base.WebApiRequestOptions) : Promise< void > {
804
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
805
+ base.WebApiBase.SetPending(options);
806
+ return new Promise< void >(async (resolve, reject) => {
807
+ try {
808
+ config.baseURL = this._options.baseUrl;
809
+ const response = await this._axios.post("UpsertRecentNavigation", request , config);
810
+ base.WebApiBase.SetCompleted(options, response);
811
+ const res = response.data;
812
+ resolve(res);
813
+ }
814
+ catch( err ) {
815
+ base.WebApiBase.HandleError(options, config, err);
816
+ reject(err);
817
+ }
818
+ });
819
+ }
820
+
821
+
822
+
823
+ /**
824
+ * Upsert Recent navigation entries for the logged-in associate and the given client. The entries are ranked so that the first element in the array becomes the most recent. The list is capped by the RecentNavigationLimit preference; the oldest entries beyond the cap are removed.
825
+ * @param request - Client, Elements
826
+ * @returns This method has no return value
827
+ */
828
+ public async upsertRecentNavigationAsync(request: carriers.ViewState_UpsertRecentNavigationRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
829
+
830
+ /**
831
+ * Upsert Recent navigation entries for the logged-in associate and the given client. The entries are ranked so that the first element in the array becomes the most recent. The list is capped by the RecentNavigationLimit preference; the oldest entries beyond the cap are removed.
832
+ * @param client - The client the entries belong to, e.g. Crm, Admin or Mobile
833
+ * @param elements - The navigation entries to upsert. The first element becomes the most recent; duplicate keys are collapsed keeping the first occurrence.
834
+ * @returns This method has no return value
835
+ */
836
+ public async upsertRecentNavigationAsync(client: string, elements: carriers.NavigationElement[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
837
+
838
+ public async upsertRecentNavigationAsync(client:string|carriers.ViewState_UpsertRecentNavigationRequest, elements?:carriers.NavigationElement[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
839
+ let _request : carriers.ViewState_UpsertRecentNavigationRequest = null;
840
+ let _options : base.WebApiRequestOptions = null;
841
+ const first : any = client;
842
+ if( typeof( first ) === "object" && first && ( typeof(first.client)!='undefined' || typeof(first.elements)!='undefined' ) )
843
+ {
844
+ _request = client as carriers.ViewState_UpsertRecentNavigationRequest;
845
+ _options = elements as base.WebApiRequestOptions;
846
+ }
847
+ else
848
+ {
849
+ _request = {
850
+ client: client as string,
851
+ elements: elements as carriers.NavigationElement[],
852
+ };
853
+ _options = webapi_options;
854
+ }
855
+ return this._upsertRecentNavigationAsync( _request, _options );
856
+ }
857
+
858
+
799
859
  private async _publishAndRetrieveUiEventsAsync(request: carriers.ViewState_PublishAndRetrieveUiEventsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] > {
800
860
  const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
801
861
  base.WebApiBase.SetPending(options);
@@ -853,6 +913,66 @@ export class ViewStateAgent extends base.WebApiBase implements IViewStateAgent {
853
913
  return this._publishAndRetrieveUiEventsAsync( _request, _options );
854
914
  }
855
915
 
916
+
917
+ private async _publishAndSyncUiEventsAsync(request: carriers.ViewState_PublishAndSyncUiEventsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiSyncResult > {
918
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
919
+ base.WebApiBase.SetPending(options);
920
+ return new Promise< carriers.LiveUiSyncResult >(async (resolve, reject) => {
921
+ try {
922
+ config.baseURL = this._options.baseUrl;
923
+ const response = await this._axios.post("PublishAndSyncUiEvents", request , config);
924
+ base.WebApiBase.SetCompleted(options, response);
925
+ const res : carriers.LiveUiSyncResult = converters.Create_LiveUiSyncResult_From( 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
+ * Publish zero or more events and return any new events since the given event id, exactly like PublishAndRetrieveUiEvents — and additionally answer, for each ticket version the client supplies, whether that ticket has changed since (and by whom). Requested tickets the user cannot see are omitted from the answer
939
+ * @param request - LatestKnownEventId, PublishEvents, Metrics, TicketVersions
940
+ * @returns New events since the given event id, plus the sync state of the requested tickets
941
+ */
942
+ public async publishAndSyncUiEventsAsync(request: carriers.ViewState_PublishAndSyncUiEventsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiSyncResult >;
943
+
944
+ /**
945
+ * Publish zero or more events and return any new events since the given event id, exactly like PublishAndRetrieveUiEvents — and additionally answer, for each ticket version the client supplies, whether that ticket has changed since (and by whom). Requested tickets the user cannot see are omitted from the answer
946
+ * @param latestKnownEventId - The last event ID that this client knows about. The return value will be any events occurring /after/ that point, numbered by the server. Clients need to keep track themselves of this number between calls
947
+ * @param publishEvents - Array of events to publish. This can be empty if the client only wants to retrieve information
948
+ * @param metrics - Optional statistical and performance metrics collected by the frontend. Can be null or empty. Metrics are sum-accumulated and reported once a minute; please do not report the same logical event twice
949
+ * @param ticketVersions - The tickets the client is showing, each with the last-changed value of the client's loaded copy (DateTime.MinValue or omitted = no copy; the current value is then returned without a staleness verdict). At most 500 entries after removing duplicates
950
+ * @returns New events since the given event id, plus the sync state of the requested tickets
951
+ */
952
+ public async publishAndSyncUiEventsAsync(latestKnownEventId: number, publishEvents: carriers.UiEvent[], metrics: carriers.MetricPair[], ticketVersions: carriers.TicketVersionInfo[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiSyncResult >;
953
+
954
+ public async publishAndSyncUiEventsAsync(latestKnownEventId:number|carriers.ViewState_PublishAndSyncUiEventsRequest, publishEvents?:carriers.UiEvent[]|base.WebApiRequestOptions, metrics?:carriers.MetricPair[], ticketVersions?:carriers.TicketVersionInfo[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiSyncResult > {
955
+ let _request : carriers.ViewState_PublishAndSyncUiEventsRequest = null;
956
+ let _options : base.WebApiRequestOptions = null;
957
+ const first : any = latestKnownEventId;
958
+ if( typeof( first ) === "object" && first && ( typeof(first.latestKnownEventId)!='undefined' || typeof(first.publishEvents)!='undefined' || typeof(first.metrics)!='undefined' || typeof(first.ticketVersions)!='undefined' ) )
959
+ {
960
+ _request = latestKnownEventId as carriers.ViewState_PublishAndSyncUiEventsRequest;
961
+ _options = publishEvents as base.WebApiRequestOptions;
962
+ }
963
+ else
964
+ {
965
+ _request = {
966
+ latestKnownEventId: latestKnownEventId as number,
967
+ publishEvents: publishEvents as carriers.UiEvent[],
968
+ metrics: metrics as carriers.MetricPair[],
969
+ ticketVersions: ticketVersions as carriers.TicketVersionInfo[],
970
+ };
971
+ _options = webapi_options;
972
+ }
973
+ return this._publishAndSyncUiEventsAsync( _request, _options );
974
+ }
975
+
856
976
  } // class v1ViewStateAgentController
857
977
 
858
978