1.10.5 • Published 2 years ago

linagora.esn.dav.import v1.10.5

Weekly downloads
56
License
AGPL-3.0
Repository
-
Last release
2 years ago

linagora.esn.dav.import

Common stuffs used by Contact and Calendar to import contacts/events from VCF/ICS files to Sabre DAV

Usage

Assume that you want to import contacts from vCard files:

Step 1: register vCard file handler

// in your backend
const davImport = dependencies('dav.import');

const vcardHandler = {
  contentType: 'text/vcard',

  /**
   * Parse lines in a chunk to DAV items
   * @param  {Array<String>} lines          - Lines to be read
   * @param  {Array<String>} remainingLines - Remaing lines from last chunk
   * @return {Object}                       - An object of:
   *                                          + items: DAV items read from lines
   *                                          + remainingLines: remaining lines of uncomplete DAV item
   */
  readLines(lines, remainingLines) {},

  /**
   * Import item to DAV server
   * @param  {String} item   - A single DAV item parsed from chunks
   * @param  {String} target - Address book or calendar path to import DAV item to
   * @param  {String} token  - To authenticate against DAV server
   * @return {Promise}       - Resolve on success
   */
  importItem(item, { target, token }) {},

  /**
   * Validate target path
   * @param  {Object} user      - The user object, can be used to check user's right on the target
   * @param  {String} target    - Address book or calendar path to import DAV items to
   * @return {Boolean|Promise}  - Return or resolve true if the target is valid
   */
  targetValidator(user, target) {}
};

davImport.lib.importer.addFileHandler(vcardHandler.contentType, vcardHandler);

Step 2: use Angular service to import file

var target = '/addressbooks/bookId/bookHome.json';

davImportService.importFromFile(file, target).then(function() {
  // import request submitted and will be process by job queue
});

Licence

Affero GPL v3

1.10.5

2 years ago

1.10.4

2 years ago

1.10.3

2 years ago

1.10.2

2 years ago

1.10.0

2 years ago

1.9.0-rc9

3 years ago

1.10.0-rc1

2 years ago

1.9.0-rc8

3 years ago

1.9.0-rc6

3 years ago

1.9.0-rc5

3 years ago

1.9.0-rc4

3 years ago

1.9.0-rc3

3 years ago

1.9.0-rc2

3 years ago

1.9.0-rc1

3 years ago

1.9.0-beta2

3 years ago

1.8.1-rc9

3 years ago

1.9.0-beta1

3 years ago

1.8.1-rc8

3 years ago

1.8.1-rc7

4 years ago

1.8.1-rc6

4 years ago

1.8.1-rc5

4 years ago

1.8.1-rc4

4 years ago

1.8.1-rc3

4 years ago

1.8.1-rc2

4 years ago

1.8.1-rc1

4 years ago

1.8.0

4 years ago

1.8.0-rc3

4 years ago

1.8.0-rc2

4 years ago

1.8.0-rc1

4 years ago

1.8.0-beta1

4 years ago

1.7.5

4 years ago

1.7.5-rc3

4 years ago

1.7.5-rc2

4 years ago

1.7.5-rc1

4 years ago

1.7.4

4 years ago

1.7.4-rc1

4 years ago

1.7.3

4 years ago

1.7.3-rc3

4 years ago

1.7.3-rc2

4 years ago

1.7.3-rc1

4 years ago

1.7.2

4 years ago

1.7.2-rc3

4 years ago

1.7.2-rc2

4 years ago

1.7.2-rc1

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.3

4 years ago

1.7.0-rc1

4 years ago

1.6.2

4 years ago

1.6.2-rc1

4 years ago

1.6.1

4 years ago

1.6.1-rc1

4 years ago

1.6.0

4 years ago

1.6.0-rc2

4 years ago

1.6.0-rc1

4 years ago

1.4.10

5 years ago

1.5.0

5 years ago

1.4.9

5 years ago

1.5.0-rc1

5 years ago

1.4.8

5 years ago

0.11.0

5 years ago

0.10.0

5 years ago

1.4.7

5 years ago

1.4.6

5 years ago

1.4.5

5 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.4.0-beta1

5 years ago

1.3.5

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.2

6 years ago

1.2.0

6 years ago

1.2.0-beta1

6 years ago

1.1.0

6 years ago

1.1.0-beta2

6 years ago

1.1.0-beta1

6 years ago