@verdocs/js-sdk 1.1.13 → 1.1.17

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.
@@ -2,8 +2,8 @@ export interface IInitials {
2
2
  id?: string;
3
3
  profile_id: string;
4
4
  url: string;
5
- created_at?: Date;
6
- updated_at?: Date;
5
+ created_at?: string;
6
+ updated_at?: string;
7
7
  }
8
8
  /**
9
9
  * Create an initials block. In a typical signing workflow, the user is asked at the beginning of the process to "adopt"
@@ -8,9 +8,9 @@ export interface ITemplate {
8
8
  name: string;
9
9
  id?: string;
10
10
  profile_id?: string;
11
- created_at?: Date;
12
- updated_at?: Date;
13
- last_used_at?: Date;
11
+ created_at?: string;
12
+ updated_at?: string;
13
+ last_used_at?: string;
14
14
  token?: string;
15
15
  reminder_id?: string;
16
16
  reminder?: IReminder;
@@ -117,7 +117,7 @@ export interface ITag {
117
117
  export interface ITags {
118
118
  name: string;
119
119
  featured?: boolean;
120
- created_at?: Date;
120
+ created_at?: string;
121
121
  }
122
122
  export interface IStar {
123
123
  template_id: string;
@@ -141,8 +141,8 @@ export interface ITemplateAsset {
141
141
  name: string;
142
142
  page_numbers: number;
143
143
  id?: string;
144
- updated_at?: Date;
145
- created_at?: Date;
144
+ updated_at?: string;
145
+ created_at?: string;
146
146
  template_id: string;
147
147
  mime: string;
148
148
  thumbnail_url: string;
@@ -188,7 +188,7 @@ export interface IPage {
188
188
  }
189
189
  export interface IReminder {
190
190
  id?: string;
191
- created_at?: Date;
191
+ created_at?: string;
192
192
  is_on: boolean;
193
193
  setup_time: number;
194
194
  interval_time: number;
@@ -0,0 +1,12 @@
1
+ export interface FileWithData {
2
+ lastModified: number;
3
+ size: number;
4
+ type: string;
5
+ name: string;
6
+ data: string;
7
+ }
8
+ /**
9
+ * Given a File, extract the file's content as a base64 encoded data URL. The response will have a prefix that
10
+ * includes the MIME type of the file, e.g. "data:image/jpeg;base64,iVBORw0K......"
11
+ */
12
+ export declare const fileToDataUrl: (file: File) => Promise<FileWithData>;
package/Utils/Files.js ADDED
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Given a File, extract the file's content as a base64 encoded data URL. The response will have a prefix that
3
+ * includes the MIME type of the file, e.g. "data:image/jpeg;base64,iVBORw0K......"
4
+ */
5
+ export var fileToDataUrl = function (file) {
6
+ return new Promise(function (resolve, reject) {
7
+ var reader = new FileReader();
8
+ reader.onload = function () {
9
+ return resolve({
10
+ lastModified: file.lastModified,
11
+ size: file.size,
12
+ type: file.type,
13
+ name: file.name,
14
+ data: reader.result,
15
+ });
16
+ };
17
+ reader.onerror = reject;
18
+ if (file) {
19
+ reader.readAsDataURL(file);
20
+ }
21
+ else {
22
+ reject(new Error('Invalid file'));
23
+ }
24
+ });
25
+ };
package/Utils/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * as Colors from './Colors';
2
2
  export * as DateTime from './DateTime';
3
3
  export * as Fields from './Fields';
4
+ export * as Files from './Files';
4
5
  export * as Locales from './Locales';
5
6
  export * as Token from './Token';
package/Utils/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * as Colors from './Colors';
2
2
  export * as DateTime from './DateTime';
3
3
  export * as Fields from './Fields';
4
+ export * as Files from './Files';
4
5
  export * as Locales from './Locales';
5
6
  export * as Token from './Token';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/js-sdk",
3
- "version": "1.1.13",
3
+ "version": "1.1.17",
4
4
  "private": false,
5
5
  "homepage": "https://github.com/Verdocs/js-sdk",
6
6
  "description": "Verdocs JS SDK",