Skip to content

Commit 968ee98

Browse files
Merge pull request #9 from aspose-email-cloud/develop
Develop
2 parents dd906fe + 2818a58 commit 968ee98

File tree

83 files changed

+10737
-2118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+10737
-2118
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules
22
package-lock.json
33
dist
44
.vscode
5-
.idea
5+
.idea
6+
.nyc_output

README.md

Lines changed: 43 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,49 @@
1-
# Aspose.Email Cloud SDK for Node.Js [![npm](https://img.shields.io/npm/v/@asposecloud/aspose-email-cloud)](https://www.npmjs.com/package/@asposecloud/aspose-email-cloud) [![License](https://img.shields.io/github/license/aspose-email-cloud/aspose-email-cloud-node)](https://www.npmjs.com/package/@asposecloud/aspose-email-cloud) [![node](https://img.shields.io/node/v/@asposecloud/aspose-email-cloud)](https://www.npmjs.com/package/@asposecloud/aspose-email-cloud) [![types](https://img.shields.io/npm/types/@asposecloud/aspose-email-cloud)](https://www.npmjs.com/package/@asposecloud/aspose-email-cloud) ![tests](https://github.com/aspose-email-cloud/aspose-email-cloud-node/workflows/tests/badge.svg)
1+
# Aspose.Email Cloud SDK for Node.Js
2+
3+
[![npm](https://img.shields.io/npm/v/@asposecloud/aspose-email-cloud)](https://www.npmjs.com/package/@asposecloud/aspose-email-cloud) [![License](https://img.shields.io/github/license/aspose-email-cloud/aspose-email-cloud-node)](https://www.npmjs.com/package/@asposecloud/aspose-email-cloud) [![node](https://img.shields.io/node/v/@asposecloud/aspose-email-cloud)](https://www.npmjs.com/package/@asposecloud/aspose-email-cloud) [![types](https://img.shields.io/npm/types/@asposecloud/aspose-email-cloud)](https://www.npmjs.com/package/@asposecloud/aspose-email-cloud) ![tests](https://github.com/aspose-email-cloud/aspose-email-cloud-node/workflows/tests/badge.svg)
4+
25
This repository contains Aspose.Email Cloud SDK for Node.Js source code. This SDK allows you to work with Aspose.Email Cloud REST APIs in your Node.Js applications quickly and easily, with zero initial cost.
36

47
[Aspose.Email Cloud home](https://products.aspose.cloud/email/family "Aspose.Email Cloud")
58
[API Reference](https://apireference.aspose.cloud/email/)
69

710
# Key features
8-
911
Aspose.Email Cloud is a REST API for creating email applications that work with standard email file formats. This SDK:
1012
- Lets developers manipulate different emails’ formats such as Outlook MSG, EML, VCard, and iCalendar files
11-
- Has a built-in email client
12-
- Supports AI functionalities:
13+
- Lets developers manipulate different emails' formats such as Outlook MSG, EML, VCard, and iCalendar files
14+
- Supports AI functions:
1315
- The Business card recognition
1416
- The Name API for parsing and handling personal names
15-
17+
- Has a built-in email client. This client provides:
18+
- Unified REST API for different email protocols: IMAP, POP3, SMTP, EWS, WebDav
19+
- Virtual multi-account
20+
- Message threads (POP3 accounts are also supported)
21+
- Email configuration discovery
22+
- Disposable email address detection
23+
24+
## New features in version 20.7
25+
- New MAPI message files API with models:
26+
- `MapiMessageDto` - represents the Microsoft Outlook message.
27+
- `MapiCalendarDto` - represents the Microsoft Outlook calendar object.
28+
- `MapiContactDto` - represents the Microsoft Outlook contact information.
29+
- Improved Recurrence pattern support for CalendarDto.
30+
31+
See [Release notes](https://docs.aspose.cloud/display/emailcloud/Aspose.Email+Cloud+20.7+Release+Notes)
1632
## How to use the SDK?
1733
The complete source code is available in the GIT repository.
18-
Use [SDK tutorials](https://docs.aspose.cloud/display/emailcloud/SDK+Tutorials), [reference documentation](https://github.com/aspose-email-cloud/aspose-email-cloud-node/blob/master/doc/README.md) and [examples from this document](#usage-examples)
34+
35+
Use [SDK tutorials](https://docs.aspose.cloud/display/emailcloud/SDK+Tutorials):
36+
- [SDK setup](https://docs.aspose.cloud/display/emailcloud/SDK+setup) - installation, account setup, first API calls
37+
- [Business Cards Recognition API](https://docs.aspose.cloud/display/emailcloud/Business+Cards+Recognition+API) - convert captured business cards and name card images, into a vCard format
38+
- [Working with Name API](https://docs.aspose.cloud/display/emailcloud/Working+with+Name+API) - format, genderize, compare, parse, autocomplete names
39+
- [Email Message Files](https://docs.aspose.cloud/display/emailcloud/Email+Message+Files) - Convert EML to MSG and back, edit EML files, etc.
40+
- [Quick Start With iCalendar API](https://docs.aspose.cloud/display/emailcloud/Quick+Start+With+iCalendar+API) - Crate and edit iCalendar files
41+
- [Quick Start With VCard API](https://docs.aspose.cloud/display/emailcloud/Quick+Start+With+VCard+API) - Create and edit VCard files, business card recognition
42+
- [Quick Start With Email Client](https://docs.aspose.cloud/display/emailcloud/Quick+Start+With+Email+Client) - Setup builtin email client, search/fetch/send/move/delete messages
43+
- [Email Client Threads](https://docs.aspose.cloud/display/emailcloud/Email+Client+Threads) - Fetch/Move/Delete email message threads using builtin email client
44+
- [File converters](https://docs.aspose.cloud/display/emailcloud/Convert+Email%2C+Calendar+and+Contact+Files)
45+
46+
SDK reference documentation is available in [this README](doc/README.md)
1947

2048
### Prerequisites
2149
To use this SDK, you need an App SID and an App Key; they can be looked up at [Aspose Cloud Dashboard](https://dashboard.aspose.cloud/#/apps) (it requires free registration in Aspose Cloud for this).
@@ -26,6 +54,8 @@ From the command line:
2654

2755
npm install @asposecloud/aspose-email-cloud --save
2856

57+
See more details about SDK installation in this tutorial: [SDK setup](https://docs.aspose.cloud/display/emailcloud/SDK+setup)
58+
2959
### Usage examples
3060
To use the API, you should create an EmailApi object:
3161
```typescript
@@ -35,142 +65,18 @@ var api = new EmailApi(appSid, appKey);
3565
```
3666

3767
#### Business cards recognition API
38-
See examples below:
39-
40-
<details open>
41-
<summary>Parse business card images to VCard contact files</summary>
42-
43-
```typescript
44-
var folder = 'some/folder/on/storage';
45-
var storage = 'First Storage'; //Your storage name
46-
var imageData = fs.readFileSync('some/business/card/image/file/on/disk');
47-
var storageFileName = 'someFileName.png'; //Supports different image formats: PNG, JPEG, BMP, TIFF, GIF, etc.
48-
// Upload business card image to storage
49-
await api.uploadFile(new requests.UploadFileRequest(folder + '/' + storageFileName, imageData, storage));
50-
var outFolder = 'some/other/folder/on/storage'; //Business card recognition results will be saved here
51-
await api.createFolder(new requests.CreateFolderRequest(outFolder, storage));
52-
// Call business card recognition action
53-
var result = await api.aiBcrParseStorage(
54-
new requests.AiBcrParseStorageRequest(new models.AiBcrParseStorageRq(
55-
null,
56-
[new models.AiBcrImageStorageFile( //We can process multiple images in one request
57-
true, //the image contains only one business card (you can upload image with multiple cards on it)
58-
new models.StorageFileLocation(storage, folder, storageFileName))],
59-
new models.StorageFolderLocation(storage, outFolder))));
60-
// Get file name from recognition result
61-
var contactFile = result.body.value[0]; //result.body.value can contain multiple files, if we sent multicard images or multiple images
62-
// You can download the VCard file, which produced by the recognition method ...
63-
var contactBinary = await api.downloadFile(new requests.DownloadFileRequest(
64-
contactFile.folderPath + '/' + contactFile.fileName, storage));
65-
// ... and print it to console
66-
console.log(contactBinary.body.toString());
67-
// Also, you can get VCard object properties’ list using Contact API
68-
var contactProperties = await api.getContactProperties(new requests.GetContactPropertiesRequest(
69-
'vcard', contactFile.fileName, contactFile.folderPath, contactFile.storage));
70-
//All VCard’s properties are available as a list. Complex properties are represented as hierarchical structures.
71-
//Let's print all primitive properties’ values:
72-
contactProperties.body.internalProperties
73-
.filter(property => property.type == 'PrimitiveObject')
74-
.map(property => property as models.PrimitiveObject)
75-
.forEach(property =>
76-
console.log('Property name:' + property.name + ' value:' + property.value));
77-
```
78-
</details>
79-
80-
<details>
81-
<summary>Parse images directly, without the using of a storage</summary>
82-
83-
```typescript
84-
//Read image from file and convert it to Base64 string
85-
var imageData = fs.readFileSync('some/business/card/image/file/on/disk').toString('base64');
86-
var result = await api.aiBcrParse(new requests.AiBcrParseRequest(
87-
new models.AiBcrBase64Rq(undefined, [new models.AiBcrBase64Image(true, imageData)])));
88-
//Result contains all recognized VCard objects (only the one in our case)
89-
var contactProperties = result.body.value[0];
90-
//VCard object is available as a list of properties, without any external calls:
91-
contactProperties.internalProperties
92-
.filter(property => property.type == 'PrimitiveObject')
93-
.map(property => property as models.PrimitiveObject)
94-
.forEach(property =>
95-
console.log('Property name:' + property.name + ' value:' + property.value));
96-
```
97-
</details>
98-
99-
#### Name API
100-
See examples below:
101-
<details open>
102-
<summary>Detect a person's gender by name</summary>
103-
104-
```typescript
105-
var result = await api.aiNameGenderize(new requests.AiNameGenderizeRequest('John Cane'));
106-
//the result contains a list of hypothesis about a person's gender.
107-
//all hypothesis include score, so you can use the most scored version, which will be the first in a list:
108-
console.log(result.body.value[0].gender); //prints 'Male'
109-
```
110-
</details>
11168

112-
<details>
113-
<summary>Format person's name using defined format</summary>
69+
Use `AiBcrParseModel` method to parse business card image to VCard DTO:
11470

11571
```typescript
116-
var result = await api.aiNameFormat(new requests.AiNameFormatRequest(
117-
'Mr. John Michael Cane', undefined, undefined, undefined, undefined, '%t%L%f%m'));
118-
console.log(result.body.name); //prints 'Mr. Cane J. M.'
72+
var imageData = fs.readFileSync("/tmp/alex.png").toString('base64');
73+
var result = await api.aiBcrParseModel(new requests.AiBcrParseModelRequest(
74+
new models.AiBcrBase64Rq(
75+
undefined, [new models.AiBcrBase64Image(true, imageData)])));
76+
var contact = result.body.value[0];
11977
```
120-
</details>
121-
122-
<details>
123-
<summary>Compare the names to find out if they belong to the same person or not</summary>
12478

125-
```typescript
126-
var first = 'John Michael Cane';
127-
var second = 'Cane J.';
128-
var result = await api.aiNameMatch(new requests.AiNameMatchRequest(
129-
first, second));
130-
console.log(result.body.similarity > 0.5); //prints 'true', names look similar
131-
```
132-
</details>
133-
134-
<details>
135-
<summary>Expand a person's name into a list of possible alternatives</summary>
136-
137-
```typescript
138-
var result = await api.aiNameExpand(new requests.AiNameExpandRequest(
139-
'Smith Bobby'));
140-
var names = result.body.names
141-
.map(weighted => weighted.name)
142-
.forEach(name => console.log(name)); //prints 'Mr. Smith', 'B. Smith', etc.
143-
```
144-
</details>
145-
146-
<details>
147-
<summary>Get k most probable names for given starting characters</summary>
148-
149-
```typescript
150-
var prefix = 'Dav';
151-
var result = await api.aiNameComplete(new requests.AiNameCompleteRequest(
152-
prefix));
153-
var names = result.body.names
154-
.map(weighted => prefix + weighted.name)
155-
.forEach(name => console.log(name)); //prints 'David', 'Dave', 'Davis', etc.
156-
```
157-
</details>
158-
159-
<details>
160-
<summary>Parse out a person's name from an email address.</summary>
161-
162-
```typescript
163-
var result = await api.aiNameParseEmailAddress(new requests.AiNameParseEmailAddressRequest(
164-
'john-cane@gmail.com'));
165-
var extractedValues = result.body.value
166-
.map(extracted => extracted.name)
167-
.reduce((accumulator, value) => accumulator.concat(value));
168-
var givenName = extractedValues.find(extracted => extracted.category == 'GivenName');
169-
var surname = extractedValues.find(extracted => extracted.category == 'Surname');
170-
console.log(givenName.value); // 'John'
171-
console.log(surname.value); // 'Cane'
172-
```
173-
</details>
79+
See more details [here](https://docs.aspose.cloud/display/emailcloud/Parse+Image+To+VCard+File) and [here](https://docs.aspose.cloud/display/emailcloud/Business+Cards+Recognition+API)
17480

17581
# Licensing
17682
All Aspose.Email Cloud SDKs, helper scripts and templates are licensed under [MIT License](LICENSE).

doc/AiBcrImageStorageFile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**file** | **any** | Image location | [optional] [default to undefined]
7+
**file** | [**StorageFileLocation**](StorageFileLocation.md) | Image location | [optional] [default to undefined]
88

99
Parent class: [AiBcrImage](AiBcrImage.md)
1010

doc/AiBcrParseStorageRq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**outFolder** | **any** | Parse output folder location on storage | [default to undefined]
7+
**outFolder** | [**StorageFolderLocation**](StorageFolderLocation.md) | Parse output folder location on storage | [default to undefined]
88

99
Parent class: [AiBcrStorageImageRq](AiBcrStorageImageRq.md)
1010

doc/AppendEmailBaseRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**emailFile** | **any** | Email document file location in storage | [default to undefined]
7+
**emailFile** | [**StorageFileLocation**](StorageFileLocation.md) | Email document file location in storage | [default to undefined]
88

99
Parent class: [AppendEmailAccountBaseRequest](AppendEmailAccountBaseRequest.md)
1010

doc/AppendEmailModelRq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**message** | **any** | Email document | [default to undefined]
7+
**message** | [**EmailDto**](EmailDto.md) | Email document | [default to undefined]
88

99
Parent class: [AppendEmailAccountBaseRequest](AppendEmailAccountBaseRequest.md)
1010

doc/CalendarDto.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Name | Type | Description | Notes
1717
**microsoftIntendedStatus** | **string** | Specifies the INTENDED status. Enum, available values: NotDefined, Free, Tentative, Busy, Oof | [default to undefined]
1818
**optionalAttendees** | [**Array&lt;MailAddress&gt;**](MailAddress.md) | Optional attendees. | [optional] [default to undefined]
1919
**organizer** | [**MailAddress**](MailAddress.md) | Event organizer. | [default to undefined]
20-
**recurrenceString** | **string** | String representation of recurrence pattern (See iCalendar RFC, \"Recurrence rule\" section). For example: For daily recurrence: \"FREQ=DAILY;COUNT=10;WKST=MO\" For monthly recurrence: \"BYSETPOS=1;BYDAY=MO,TU,WE,TH,FR;FREQ=MONTHLY;INTERVAL=10;WKST=MO\" For yearly recurrence: \"BYMONTHDAY=30;BYMONTH=1;FREQ=YEARLY;WKST=MO\" | [optional] [default to undefined]
20+
**recurrenceString** | **string** | Deprecated, use 'Recurrence' property. String representation of recurrence pattern (See iCalendar RFC, \"Recurrence rule\" section). For example: For daily recurrence: \"FREQ=DAILY;COUNT=10;WKST=MO\" For monthly recurrence: \"BYSETPOS=1;BYDAY=MO,TU,WE,TH,FR;FREQ=MONTHLY;INTERVAL=10;WKST=MO\" For yearly recurrence: \"BYMONTHDAY=30;BYMONTH=1;FREQ=YEARLY;WKST=MO\" | [optional] [default to undefined]
21+
**recurrence** | [**RecurrencePatternDto**](RecurrencePatternDto.md) | Recurrence pattern | [optional] [default to undefined]
2122
**reminders** | [**Array&lt;CalendarReminder&gt;**](CalendarReminder.md) | Reminders. | [optional] [default to undefined]
2223
**sequenceId** | **string** | The sequence id. Read only. | [optional] [default to undefined]
2324
**startDate** | **Date** | Start date. | [default to undefined]

doc/ContactPhoto.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**photoImageFormat** | **string** | MapiContact photo image format. Enum, available values: Undefined, Jpeg, Gif, Wmf, Bmp, Tiff | [default to undefined]
88
**base64Data** | **string** | Photo serialized as base64 string. | [optional] [default to undefined]
9+
**discriminator** | **string** | | [default to undefined]
910

1011

1112

doc/DailyRecurrencePatternDto.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
# DailyRecurrencePatternDto
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
8+
Parent class: [RecurrencePatternDto](RecurrencePatternDto.md)
9+
10+
[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)

0 commit comments

Comments
 (0)