@superoffice/webapi 12.1.1412 → 12.2.2072

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/cjs/Carriers.d.ts +219 -4
  2. package/dist/cjs/Carriers.d.ts.map +1 -1
  3. package/dist/cjs/Converters.d.ts +6 -0
  4. package/dist/cjs/Converters.d.ts.map +1 -1
  5. package/dist/cjs/Converters.js +129 -1
  6. package/dist/cjs/Converters.js.map +1 -1
  7. package/dist/cjs/EMailAgent.d.ts +16 -0
  8. package/dist/cjs/EMailAgent.d.ts.map +1 -1
  9. package/dist/cjs/EMailAgent.js +48 -0
  10. package/dist/cjs/EMailAgent.js.map +1 -1
  11. package/dist/cjs/Enums.d.ts +71 -1
  12. package/dist/cjs/Enums.d.ts.map +1 -1
  13. package/dist/cjs/Enums.js +75 -2
  14. package/dist/cjs/Enums.js.map +1 -1
  15. package/dist/cjs/NewsFeedAgent.d.ts +141 -0
  16. package/dist/cjs/NewsFeedAgent.d.ts.map +1 -0
  17. package/dist/cjs/NewsFeedAgent.js +292 -0
  18. package/dist/cjs/NewsFeedAgent.js.map +1 -0
  19. package/dist/cjs/WebApi.d.ts +6 -0
  20. package/dist/cjs/WebApi.d.ts.map +1 -1
  21. package/dist/cjs/WebApi.js +10 -1
  22. package/dist/cjs/WebApi.js.map +1 -1
  23. package/dist/esm/Carriers.d.ts +219 -4
  24. package/dist/esm/Carriers.d.ts.map +1 -1
  25. package/dist/esm/Converters.d.ts +6 -0
  26. package/dist/esm/Converters.d.ts.map +1 -1
  27. package/dist/esm/Converters.js +122 -0
  28. package/dist/esm/Converters.js.map +1 -1
  29. package/dist/esm/EMailAgent.d.ts +16 -0
  30. package/dist/esm/EMailAgent.d.ts.map +1 -1
  31. package/dist/esm/EMailAgent.js +48 -0
  32. package/dist/esm/EMailAgent.js.map +1 -1
  33. package/dist/esm/Enums.d.ts +71 -1
  34. package/dist/esm/Enums.d.ts.map +1 -1
  35. package/dist/esm/Enums.js +74 -1
  36. package/dist/esm/Enums.js.map +1 -1
  37. package/dist/esm/NewsFeedAgent.d.ts +141 -0
  38. package/dist/esm/NewsFeedAgent.d.ts.map +1 -0
  39. package/dist/esm/NewsFeedAgent.js +287 -0
  40. package/dist/esm/NewsFeedAgent.js.map +1 -0
  41. package/dist/esm/WebApi.d.ts +6 -0
  42. package/dist/esm/WebApi.d.ts.map +1 -1
  43. package/dist/esm/WebApi.js +9 -0
  44. package/dist/esm/WebApi.js.map +1 -1
  45. package/package.json +4 -4
  46. package/src/Carriers.ts +287 -4
  47. package/src/Converters.ts +142 -0
  48. package/src/EMailAgent.ts +76 -0
  49. package/src/Enums.ts +77 -1
  50. package/src/NewsFeedAgent.ts +481 -0
  51. package/src/WebApi.ts +12 -0
package/src/Carriers.ts CHANGED
@@ -19929,7 +19929,7 @@ export interface ConsentPurpose extends Carrier {
19929
19929
  deleted?: boolean;
19930
19930
 
19931
19931
  /**
19932
- * Rank of this consent source
19932
+ * Rank order
19933
19933
  */
19934
19934
  rank?: number;
19935
19935
 
@@ -20027,7 +20027,7 @@ export interface ConsentSource extends Carrier {
20027
20027
  key?: string;
20028
20028
 
20029
20029
  /**
20030
- * The mail template to use when automatically sending emails to new persons created with this consent source.
20030
+ * The document template to be used for sending 'You have been added to our system, is this ok' emails when a new person is registered using this source
20031
20031
  */
20032
20032
  mailTemplateId?: number;
20033
20033
 
@@ -21470,12 +21470,12 @@ export interface LegalBase extends Carrier {
21470
21470
  name?: string;
21471
21471
 
21472
21472
  /**
21473
- * Tooltip for this consent source
21473
+ * Tooltip for this legal base
21474
21474
  */
21475
21475
  tooltip?: string;
21476
21476
 
21477
21477
  /**
21478
- * Rank of this consent source
21478
+ * Rank of this legal base
21479
21479
  */
21480
21480
  rank?: number;
21481
21481
 
@@ -31565,6 +31565,23 @@ export interface EMail_RelayMessageRequest {
31565
31565
 
31566
31566
  // Void response...
31567
31567
 
31568
+ /**
31569
+ * Get an inbox e-mail (by its EmailItemId) serialized as an Outlook-openable RFC822 (.eml) stream. Works for both IMAP and Graph/Exchange-Online mailboxes because it serializes the loaded entity instead of re-fetching the raw message by server id.
31570
+ * Returns Blob
31571
+ */
31572
+ export interface EMail_GetEMailAsEmlStreamRequest {
31573
+ /**
31574
+ * The EmailItemId of the e-mail to retrieve as stream
31575
+ */
31576
+ emailItemId: number;
31577
+ /**
31578
+ * Should attachments be included in the stream
31579
+ */
31580
+ includeAttachments: boolean;
31581
+ }
31582
+
31583
+ // response object: Blob
31584
+
31568
31585
  /**
31569
31586
  * Get en e-mail based on its primary key in the DB
31570
31587
  * Returns EMailEntity
@@ -54706,6 +54723,272 @@ export interface WorkflowWaitForAction extends Carrier {
54706
54723
 
54707
54724
 
54708
54725
 
54726
+ /**
54727
+ * News feed CTAs are created by agents or other services for display on the start page and other relevant places in the UI.
54728
+ */
54729
+ export interface NewsFeedCTA {
54730
+
54731
+
54732
+ /**
54733
+ * An identifier for the CTA, which will be sent back to the application when the user clicks the CTA button. E.g. 'approve_button/234', 'reject/53fw1', '5235faq143='. Where to route is determined by the ApplicationId on the NewsFeedItem
54734
+ */
54735
+ identifier?: string;
54736
+
54737
+ /**
54738
+ * The title of the CTA button. E.g. 'Approve', 'Reject', 'View details'. Multi-language string supported: 'US:"english";NO:"norsk"'.
54739
+ */
54740
+ title?: string;
54741
+
54742
+ /**
54743
+ * The type of the CTA, which determines how the CTA button renders. Primary/Secondary/Link
54744
+ */
54745
+ ctaType?: enums.CtaType;
54746
+
54747
+ /**
54748
+ * The flavor of the CTA, which determines the style the CTA button renders its type. Info/Warning/Error/Accept/Reject
54749
+ */
54750
+ ctaFlavor?: enums.CtaFlavor;
54751
+
54752
+ }
54753
+
54754
+
54755
+
54756
+
54757
+
54758
+
54759
+
54760
+ /**
54761
+ * News feed items are created by agents or other services for display on the start page and other relevant places in the UI.
54762
+ */
54763
+ export interface NewsFeedItem {
54764
+
54765
+
54766
+ /**
54767
+ * Primary key
54768
+ */
54769
+ newsFeedItemId?: number;
54770
+
54771
+ /**
54772
+ * Short, descriptive headline. Plain text title. Multi-language string supported: 'US:"english";NO:"norsk"'.
54773
+ */
54774
+ title?: string;
54775
+
54776
+ /**
54777
+ * Short, descriptive summary. Plain text summary. Multi-language string supported: 'US:"english";NO:"norsk"'.
54778
+ */
54779
+ summary?: string;
54780
+
54781
+ /**
54782
+ * Multi-language descriptions for the news feed item, where the key is an ISO 2 letter language code (e.g. 'en', 'no', 'de') and the value is the description in that language. Styling via pre-defined CSS classes. No SCRIPT or STYLE tags allowed. The 'current' value is set based on the Accept-Language/SO-Language header.
54783
+ */
54784
+ description?: StringDictionary;
54785
+
54786
+ /**
54787
+ * Call to action items for the news feed item. Each item contains a title, an identifier, a type and flavor.
54788
+ */
54789
+ actions?: NewsFeedCTA[];
54790
+
54791
+ /**
54792
+ * URL Link to an image associated with the news item.
54793
+ */
54794
+ imageLink?: string;
54795
+
54796
+ /**
54797
+ * URL Link to the source of the news item, or an SOProtocol link to a SuperOffice item
54798
+ */
54799
+ sourceLink?: string;
54800
+
54801
+ /**
54802
+ * Preview hint for the news item. e.g. `{contact_id=123}`
54803
+ */
54804
+ previewHint?: string;
54805
+
54806
+ /**
54807
+ * Name of the instance that published this item. e.g. `Pete the prospector`
54808
+ */
54809
+ fromName?: string;
54810
+
54811
+ /**
54812
+ * Type of the instance that published this item. e.g. `Prospector Agent`
54813
+ */
54814
+ fromCategoryName?: string;
54815
+
54816
+ /**
54817
+ * Importance of the news item. Low to High. Higher priority items may be shown more prominently in the feed.
54818
+ */
54819
+ priority?: enums.EMailPriority;
54820
+
54821
+ /**
54822
+ * Registered when
54823
+ */
54824
+ registered?: Date;
54825
+
54826
+ /**
54827
+ * Last updated when
54828
+ */
54829
+ updated?: Date;
54830
+
54831
+ /**
54832
+ * When the news item expires and should no longer be shown in feeds (UTC)
54833
+ */
54834
+ expiresAt?: Date;
54835
+
54836
+ /**
54837
+ * Indicates if the item is being handled by a CTA. (normal, processing, processed)
54838
+ */
54839
+ status?: enums.NewsFeedItemStatus;
54840
+
54841
+ /**
54842
+ * Set to true when the recipient user has read the news feed item.
54843
+ */
54844
+ isRead?: boolean;
54845
+
54846
+ /**
54847
+ * When the recipient user read the news feed item (UTC)
54848
+ */
54849
+ readAt?: Date;
54850
+
54851
+ /**
54852
+ * Company that is mentioned in the news feed item - null if not applicable
54853
+ */
54854
+ contact?: Contact;
54855
+
54856
+ /**
54857
+ * Person that is mentioned in the news feed item - null if not applicable
54858
+ */
54859
+ person?: Person;
54860
+
54861
+ /**
54862
+ * Project that is mentioned in the news feed item - null if not applicable
54863
+ */
54864
+ project?: Project;
54865
+
54866
+ /**
54867
+ * Sale that is mentioned in the news feed item - null if not applicable
54868
+ */
54869
+ sale?: Sale;
54870
+
54871
+ /**
54872
+ * The id of the application that registered this news item. Used to resolve where any CTA should be posted when clicked.
54873
+ */
54874
+ applicationId?: string;
54875
+
54876
+ }
54877
+
54878
+
54879
+
54880
+
54881
+
54882
+
54883
+ /**
54884
+ * Saves a new item to the newsfeed, publishing it to the specified users.
54885
+ * Returns NewsFeedItem
54886
+ */
54887
+ export interface NewsFeed_PostNewsFeedItemRequest {
54888
+ /**
54889
+ * The news feed item to post. NewsFeedItemId is ignored, as a new id will be generated when posting to the newsfeed.
54890
+ */
54891
+ newsFeedItem: NewsFeedItem;
54892
+ /**
54893
+ * List of associate ids that this news feed item is sent to.
54894
+ */
54895
+ toAssociateIds: number[];
54896
+ /**
54897
+ * List of group ids that this news feed item is sent to. This gets resolved to associate ids when posted.
54898
+ */
54899
+ toGroupIds: number[];
54900
+ /**
54901
+ * Indicates if this news feed item is sent to all users. Gets resolved into all users when posted.
54902
+ */
54903
+ toAll: boolean;
54904
+ }
54905
+
54906
+ // response object: NewsFeedItem
54907
+
54908
+ /**
54909
+ * Get an array of items from the newsfeed by id. If the current user cannot access a particular item, it will be excluded from the results.
54910
+ * Returns NewsFeedItem[]
54911
+ */
54912
+ export interface NewsFeed_GetNewsFeedItemsByIdRequest {
54913
+ /**
54914
+ * Ids of the news feed items to mark as seen for this user.
54915
+ */
54916
+ newsFeedItemIds: number[];
54917
+ }
54918
+
54919
+ // response object: NewsFeedItem[]
54920
+
54921
+ /**
54922
+ * Get a list of newsfeed items for a particular user between two dates. If the current user cannot access a particular item, it will be excluded from the results.
54923
+ * Returns NewsFeedItem[]
54924
+ */
54925
+ export interface NewsFeed_GetNewsItemsForUserRequest {
54926
+ /**
54927
+ * Id of the associate to fetch news feed items for. 0 = current user
54928
+ */
54929
+ associateId: number;
54930
+ /**
54931
+ * Start date for fetching news feed items.
54932
+ */
54933
+ fromDate: Date;
54934
+ /**
54935
+ * End date for fetching news feed items.
54936
+ */
54937
+ toDate: Date;
54938
+ /**
54939
+ * Maximum number of news feed items to return.
54940
+ */
54941
+ top: number;
54942
+ /**
54943
+ * Number of news feed items to skip for paging.
54944
+ */
54945
+ skip: number;
54946
+ }
54947
+
54948
+ // response object: NewsFeedItem[]
54949
+
54950
+ /**
54951
+ * Marks the news feed item as read, so it can be un-bolded in the current user's feed.
54952
+ */
54953
+ export interface NewsFeed_MarkAsReadRequest {
54954
+ /**
54955
+ * Id of the news feed item to mark as seen for this user.
54956
+ */
54957
+ newsFeedItemId: number;
54958
+ }
54959
+
54960
+ // Void response...
54961
+
54962
+ /**
54963
+ * Marks the news feed item as being handled, that CTA processing has started. i.e. other users should not start handling it also.
54964
+ * Returns boolean
54965
+ */
54966
+ export interface NewsFeed_StartHandlingRequest {
54967
+ /**
54968
+ * Id of the news feed item to mark as handled for all users.
54969
+ */
54970
+ newsFeedItemId: number;
54971
+ }
54972
+
54973
+ // response object: boolean
54974
+
54975
+ /**
54976
+ * Marks the news feed item as handled, so it can be removed from the feed.
54977
+ * Returns boolean
54978
+ */
54979
+ export interface NewsFeed_MarkAsHandledRequest {
54980
+ /**
54981
+ * Id of the news feed item to mark as handled for all users.
54982
+ */
54983
+ newsFeedItemId: number;
54984
+ }
54985
+
54986
+ // response object: boolean
54987
+
54988
+
54989
+
54990
+
54991
+
54709
54992
  // Misc
54710
54993
 
54711
54994
  export interface DSAParameters {
package/src/Converters.ts CHANGED
@@ -20668,6 +20668,97 @@ export function Create_WorkflowWaitForActionArrayArray_From(src:any) : carriers.
20668
20668
 
20669
20669
 
20670
20670
 
20671
+ export function Create_NewsFeedCTA_From(src:any) : carriers.NewsFeedCTA {
20672
+ if( src === null || src === undefined )
20673
+ return null;
20674
+ let res : any = { };
20675
+
20676
+ res.identifier= src.Identifier as string;
20677
+ res.title= src.Title as string;
20678
+ res.ctaType= enums.CtaType[src.CtaType];
20679
+ res.ctaFlavor= enums.CtaFlavor[src.CtaFlavor];
20680
+ return res as carriers.NewsFeedCTA;
20681
+ }
20682
+
20683
+ export function Create_NewsFeedCTAArray_From(src:any) : carriers.NewsFeedCTA[] {
20684
+ let res : carriers.NewsFeedCTA[] = [];
20685
+ if( Array.isArray(src) ) {
20686
+ for(let i in src) {
20687
+ res[i] = Create_NewsFeedCTA_From(src[i]);
20688
+ }
20689
+ }
20690
+ return res;
20691
+ }
20692
+
20693
+ export function Create_NewsFeedCTAArrayArray_From(src:any) : carriers.NewsFeedCTA[][] {
20694
+ let res : carriers.NewsFeedCTA[][] = [];
20695
+ if( Array.isArray(src) ) {
20696
+ for(let i in src) {
20697
+ res[i] = Create_NewsFeedCTAArray_From(src[i]);
20698
+ }
20699
+ }
20700
+ return res;
20701
+ }
20702
+
20703
+
20704
+
20705
+
20706
+ export function Create_NewsFeedItem_From(src:any) : carriers.NewsFeedItem {
20707
+ if( src === null || src === undefined )
20708
+ return null;
20709
+ let res : any = { };
20710
+
20711
+ res.newsFeedItemId= src.NewsFeedItemId as number;
20712
+ res.title= src.Title as string;
20713
+ res.summary= src.Summary as string;
20714
+ res.description= Create_StringDictionary_From(src.Description);
20715
+ res.actions= Create_NewsFeedCTAArray_From(src.Actions);
20716
+ res.imageLink= src.ImageLink as string;
20717
+ res.sourceLink= src.SourceLink as string;
20718
+ res.previewHint= src.PreviewHint as string;
20719
+ res.fromName= src.FromName as string;
20720
+ res.fromCategoryName= src.FromCategoryName as string;
20721
+ res.priority= enums.EMailPriority[src.Priority];
20722
+ res.registered= Create_Date_From(src.Registered);
20723
+ res.updated= Create_Date_From(src.Updated);
20724
+ res.expiresAt= Create_Date_From(src.ExpiresAt);
20725
+ res.status= enums.NewsFeedItemStatus[src.Status];
20726
+ res.isRead= src.IsRead as boolean;
20727
+ res.readAt= Create_Date_From(src.ReadAt);
20728
+ res.contact= Create_Contact_From(src.Contact);
20729
+ res.person= Create_Person_From(src.Person);
20730
+ res.project= Create_Project_From(src.Project);
20731
+ res.sale= Create_Sale_From(src.Sale);
20732
+ res.applicationId= src.ApplicationId as string;
20733
+ return res as carriers.NewsFeedItem;
20734
+ }
20735
+
20736
+ export function Create_NewsFeedItemArray_From(src:any) : carriers.NewsFeedItem[] {
20737
+ let res : carriers.NewsFeedItem[] = [];
20738
+ if( Array.isArray(src) ) {
20739
+ for(let i in src) {
20740
+ res[i] = Create_NewsFeedItem_From(src[i]);
20741
+ }
20742
+ }
20743
+ return res;
20744
+ }
20745
+
20746
+ export function Create_NewsFeedItemArrayArray_From(src:any) : carriers.NewsFeedItem[][] {
20747
+ let res : carriers.NewsFeedItem[][] = [];
20748
+ if( Array.isArray(src) ) {
20749
+ for(let i in src) {
20750
+ res[i] = Create_NewsFeedItemArray_From(src[i]);
20751
+ }
20752
+ }
20753
+ return res;
20754
+ }
20755
+
20756
+
20757
+
20758
+
20759
+
20760
+
20761
+
20671
20762
  // Misc
20672
20763
 
20673
20764
  function Create_DSAParameters_From(src:any) : carriers.DSAParameters {
@@ -23624,6 +23715,57 @@ function Create_FormFieldRestrictionType_From(src:any): enums.FormFieldRestricti
23624
23715
  }
23625
23716
 
23626
23717
 
23718
+ function Create_NewsFeedItemStatus_From(src:any): enums.NewsFeedItemStatus | enums.NewsFeedItemStatus[] {
23719
+ if (!src) return null;
23720
+
23721
+ if (Array.isArray(src)) {
23722
+ let result: enums.NewsFeedItemStatus[] = Array<enums.NewsFeedItemStatus>();
23723
+ for (const i in (src as enums.NewsFeedItemStatus[])) {
23724
+ let r = enums.NewsFeedItemStatus[src[i]] as enums.NewsFeedItemStatus;
23725
+ result.push(r);
23726
+ }
23727
+ return result;
23728
+ } else {
23729
+ let r = enums.NewsFeedItemStatus[src] as enums.NewsFeedItemStatus;
23730
+ return r;
23731
+ }
23732
+ }
23733
+
23734
+
23735
+ function Create_CtaType_From(src:any): enums.CtaType | enums.CtaType[] {
23736
+ if (!src) return null;
23737
+
23738
+ if (Array.isArray(src)) {
23739
+ let result: enums.CtaType[] = Array<enums.CtaType>();
23740
+ for (const i in (src as enums.CtaType[])) {
23741
+ let r = enums.CtaType[src[i]] as enums.CtaType;
23742
+ result.push(r);
23743
+ }
23744
+ return result;
23745
+ } else {
23746
+ let r = enums.CtaType[src] as enums.CtaType;
23747
+ return r;
23748
+ }
23749
+ }
23750
+
23751
+
23752
+ function Create_CtaFlavor_From(src:any): enums.CtaFlavor | enums.CtaFlavor[] {
23753
+ if (!src) return null;
23754
+
23755
+ if (Array.isArray(src)) {
23756
+ let result: enums.CtaFlavor[] = Array<enums.CtaFlavor>();
23757
+ for (const i in (src as enums.CtaFlavor[])) {
23758
+ let r = enums.CtaFlavor[src[i]] as enums.CtaFlavor;
23759
+ result.push(r);
23760
+ }
23761
+ return result;
23762
+ } else {
23763
+ let r = enums.CtaFlavor[src] as enums.CtaFlavor;
23764
+ return r;
23765
+ }
23766
+ }
23767
+
23768
+
23627
23769
  function Create_EventHandlerType_From(src:any): enums.EventHandlerType | enums.EventHandlerType[] {
23628
23770
  if (!src) return null;
23629
23771
 
package/src/EMailAgent.ts CHANGED
@@ -145,6 +145,8 @@ export interface IEMailAgent {
145
145
  deleteExtendedAsync(connectionInfoExtended: carriers.EMailConnectionInfoExtended, messageIds: string[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
146
146
  relayMessageAsync(request: carriers.EMail_RelayMessageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
147
147
  relayMessageAsync(connectionInfoExtended: carriers.EMailConnectionInfoExtended, rfc822: string, from: string, recipients: string[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
148
+ getEMailAsEmlStreamAsync(request: carriers.EMail_GetEMailAsEmlStreamRequest, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
149
+ getEMailAsEmlStreamAsync(emailItemId: number, includeAttachments: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
148
150
  getEMailAsync(request: carriers.EMail_GetEMailRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EMailEntity >;
149
151
  getEMailAsync(id: number, includeAttachments: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EMailEntity >;
150
152
  getUnsanitizedEMailAsync(request: carriers.EMail_GetUnsanitizedEMailRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EMailEntity >;
@@ -3476,6 +3478,80 @@ export class EMailAgent extends base.WebApiBase implements IEMailAgent {
3476
3478
  }
3477
3479
 
3478
3480
 
3481
+ private async _getEMailAsEmlStreamAsync(request: carriers.EMail_GetEMailAsEmlStreamRequest, options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string > {
3482
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options) || {};
3483
+ base.WebApiBase.SetPending(options);
3484
+ return new Promise< ArrayBuffer|string >(async (resolve, reject) => {
3485
+ try {
3486
+ if( ! options || options.returnBlobAs == base.ReturnBlobType.AsArrayBuffer ) {
3487
+ config.responseType = "arraybuffer";
3488
+ config.headers = config.headers || {};
3489
+ config.headers["Accept"] = "application/octet-stream";
3490
+ }
3491
+ config.baseURL = this._options.baseUrl;
3492
+ const response = await this._axios.post("GetEMailAsEmlStream", request , config);
3493
+ base.WebApiBase.SetCompleted(options, response);
3494
+ let res : ArrayBuffer | string = null;
3495
+ if( options && options.returnBlobAs != base.ReturnBlobType.AsArrayBuffer )
3496
+ {
3497
+ res = response.data as string;
3498
+ if( options.returnBlobAs == base.ReturnBlobType.AsString )
3499
+ {
3500
+ res = FromBase64ToString(res);
3501
+ }
3502
+ }
3503
+ else
3504
+ {
3505
+ res = response.data as ArrayBuffer;
3506
+ }
3507
+
3508
+ resolve(res);
3509
+ }
3510
+ catch( err ) {
3511
+ base.WebApiBase.HandleError(options, config, err);
3512
+ reject(err);
3513
+ }
3514
+ });
3515
+ }
3516
+
3517
+
3518
+
3519
+ /**
3520
+ * Get an inbox e-mail (by its EmailItemId) serialized as an Outlook-openable RFC822 (.eml) stream. Works for both IMAP and Graph/Exchange-Online mailboxes because it serializes the loaded entity instead of re-fetching the raw message by server id.
3521
+ * @param request - EmailItemId, IncludeAttachments
3522
+ * @returns Get an inbox e-mail (by its EmailItemId) serialized as an Outlook-openable RFC822 (.eml) stream
3523
+ */
3524
+ public async getEMailAsEmlStreamAsync(request: carriers.EMail_GetEMailAsEmlStreamRequest, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
3525
+
3526
+ /**
3527
+ * Get an inbox e-mail (by its EmailItemId) serialized as an Outlook-openable RFC822 (.eml) stream. Works for both IMAP and Graph/Exchange-Online mailboxes because it serializes the loaded entity instead of re-fetching the raw message by server id.
3528
+ * @param emailItemId - The EmailItemId of the e-mail to retrieve as stream
3529
+ * @param includeAttachments - Should attachments be included in the stream
3530
+ * @returns Get an inbox e-mail (by its EmailItemId) serialized as an Outlook-openable RFC822 (.eml) stream
3531
+ */
3532
+ public async getEMailAsEmlStreamAsync(emailItemId: number, includeAttachments: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
3533
+
3534
+ public async getEMailAsEmlStreamAsync(emailItemId:number|carriers.EMail_GetEMailAsEmlStreamRequest, includeAttachments?:boolean|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string > {
3535
+ let _request : carriers.EMail_GetEMailAsEmlStreamRequest = null;
3536
+ let _options : base.WebApiRequestOptions = null;
3537
+ const first : any = emailItemId;
3538
+ if( typeof( first ) === "object" && first && ( typeof(first.emailItemId)!='undefined' || typeof(first.includeAttachments)!='undefined' ) )
3539
+ {
3540
+ _request = emailItemId as carriers.EMail_GetEMailAsEmlStreamRequest;
3541
+ _options = includeAttachments as base.WebApiRequestOptions;
3542
+ }
3543
+ else
3544
+ {
3545
+ _request = {
3546
+ emailItemId: emailItemId as number,
3547
+ includeAttachments: includeAttachments as boolean,
3548
+ };
3549
+ _options = webapi_options;
3550
+ }
3551
+ return this._getEMailAsEmlStreamAsync( _request, _options );
3552
+ }
3553
+
3554
+
3479
3555
  private async _getEMailAsync(request: carriers.EMail_GetEMailRequest, options?:base.WebApiRequestOptions) : Promise< carriers.EMailEntity > {
3480
3556
  const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
3481
3557
  base.WebApiBase.SetPending(options);
package/src/Enums.ts CHANGED
@@ -2371,7 +2371,7 @@
2371
2371
 
2372
2372
  /**
2373
2373
  *
2374
- * This Enum is used by: email_item.priority
2374
+ * This Enum is used by: email_item.priority; NewsFeedItem.Priority
2375
2375
  */
2376
2376
  export enum EMailPriority {
2377
2377
  /**
@@ -5730,6 +5730,82 @@
5730
5730
  }
5731
5731
 
5732
5732
 
5733
+ /**
5734
+ * News feed item status - indicates if the item is being handled by a CTA
5735
+ * This Enum is used by: NewsFeedItem.Status
5736
+ */
5737
+ export enum NewsFeedItemStatus {
5738
+ /**
5739
+ * 0: Normal - nothing special has happened yet.
5740
+ */
5741
+ Normal = "Normal",
5742
+ /**
5743
+ * 1: Processing has started - the item is being handled by a CTA
5744
+ */
5745
+ Handling = "Handling",
5746
+ /**
5747
+ * 2: Handled - the item has been processed by a CTA
5748
+ */
5749
+ Handled = "Handled",
5750
+ }
5751
+
5752
+
5753
+ /**
5754
+ * News feed CTA type
5755
+ * This Enum is used by: NewsFeedItemCta.CtaType
5756
+ */
5757
+ export enum CtaType {
5758
+ /**
5759
+ * 0: Unknown - rendered as a link, maybe
5760
+ */
5761
+ Unknown = "Unknown",
5762
+ /**
5763
+ * 1: Rendered as a solid color button
5764
+ */
5765
+ Primary = "Primary",
5766
+ /**
5767
+ * 2: Rendered as an outline button
5768
+ */
5769
+ Secondary = "Secondary",
5770
+ /**
5771
+ * 3: Rendered as a blue underlined link
5772
+ */
5773
+ Link = "Link",
5774
+ }
5775
+
5776
+
5777
+ /**
5778
+ * News feed CTA flavor
5779
+ * This Enum is used by: NewsFeedItemCta.CtaFlavor
5780
+ */
5781
+ export enum CtaFlavor {
5782
+ /**
5783
+ * 0: Plain - no special style
5784
+ */
5785
+ Normal = "Normal",
5786
+ /**
5787
+ * 1: Blue info icon
5788
+ */
5789
+ Info = "Info",
5790
+ /**
5791
+ * 2: Yellow warning icon
5792
+ */
5793
+ Warning = "Warning",
5794
+ /**
5795
+ * 3: Red error icon
5796
+ */
5797
+ Error = "Error",
5798
+ /**
5799
+ * 4: Green check icon
5800
+ */
5801
+ Accept = "Accept",
5802
+ /**
5803
+ * 5: Red x icon
5804
+ */
5805
+ Reject = "Reject",
5806
+ }
5807
+
5808
+
5733
5809
  /**
5734
5810
  * CrmScript Event triggers - when CRMScript is run based on user or system actions.
5735
5811
  */