nylas 6.10.0 → 7.0.0-beta.1

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 (197) hide show
  1. package/README.md +26 -14
  2. package/lib/cjs/apiClient.js +115 -0
  3. package/lib/cjs/config.js +32 -0
  4. package/lib/cjs/models/applicationDetails.js +2 -0
  5. package/lib/cjs/models/auth.js +2 -0
  6. package/lib/cjs/models/availability.js +11 -0
  7. package/lib/cjs/models/calendars.js +2 -0
  8. package/lib/cjs/models/error.js +53 -0
  9. package/lib/cjs/models/events.js +2 -0
  10. package/lib/cjs/models/grants.js +2 -0
  11. package/lib/cjs/models/listQueryParams.js +2 -0
  12. package/lib/cjs/models/redirectUri.js +2 -0
  13. package/lib/cjs/models/response.js +2 -0
  14. package/lib/cjs/models/webhooks.js +18 -0
  15. package/lib/cjs/nylas.js +34 -0
  16. package/lib/cjs/resources/applications.js +30 -0
  17. package/lib/cjs/resources/auth.js +153 -0
  18. package/lib/cjs/resources/calendars.js +78 -0
  19. package/lib/cjs/resources/events.js +69 -0
  20. package/lib/cjs/resources/grants.js +65 -0
  21. package/lib/cjs/resources/redirectUris.js +64 -0
  22. package/lib/cjs/resources/resource.js +111 -0
  23. package/lib/cjs/resources/webhooks.js +98 -0
  24. package/lib/cjs/utils.js +58 -0
  25. package/lib/esm/apiClient.js +112 -0
  26. package/lib/esm/config.js +29 -0
  27. package/lib/esm/models/applicationDetails.js +1 -0
  28. package/lib/esm/models/auth.js +1 -0
  29. package/lib/esm/models/availability.js +8 -0
  30. package/lib/esm/models/calendars.js +1 -0
  31. package/lib/esm/models/error.js +45 -0
  32. package/lib/esm/models/events.js +1 -0
  33. package/lib/esm/models/grants.js +1 -0
  34. package/lib/esm/models/listQueryParams.js +1 -0
  35. package/lib/esm/models/redirectUri.js +1 -0
  36. package/lib/esm/models/response.js +1 -0
  37. package/lib/esm/models/webhooks.js +15 -0
  38. package/lib/esm/nylas.js +31 -0
  39. package/lib/esm/resources/applications.js +26 -0
  40. package/lib/esm/resources/auth.js +149 -0
  41. package/lib/esm/resources/calendars.js +74 -0
  42. package/lib/esm/resources/events.js +65 -0
  43. package/lib/esm/resources/grants.js +61 -0
  44. package/lib/esm/resources/redirectUris.js +60 -0
  45. package/lib/esm/resources/resource.js +107 -0
  46. package/lib/esm/resources/webhooks.js +94 -0
  47. package/lib/esm/utils.js +53 -0
  48. package/lib/types/apiClient.d.ts +65 -0
  49. package/lib/types/config.d.ts +50 -0
  50. package/lib/types/models/applicationDetails.d.ts +93 -0
  51. package/lib/types/models/auth.d.ts +196 -0
  52. package/lib/types/models/availability.d.ts +159 -0
  53. package/lib/types/models/calendars.d.ts +121 -0
  54. package/lib/types/models/error.d.ts +104 -0
  55. package/lib/types/models/events.d.ts +494 -0
  56. package/lib/types/models/grants.d.ts +134 -0
  57. package/lib/types/models/listQueryParams.d.ts +4 -0
  58. package/lib/types/models/redirectUri.d.ts +71 -0
  59. package/lib/types/models/response.d.ts +40 -0
  60. package/lib/types/models/webhooks.d.ts +45 -0
  61. package/lib/types/nylas.d.ts +44 -0
  62. package/lib/types/resources/applications.d.ts +26 -0
  63. package/lib/types/resources/auth.d.ts +66 -0
  64. package/lib/types/resources/calendars.d.ts +97 -0
  65. package/lib/types/resources/events.d.ts +87 -0
  66. package/lib/types/resources/grants.d.ts +63 -0
  67. package/lib/types/resources/redirectUris.d.ts +63 -0
  68. package/lib/types/resources/resource.d.ts +55 -0
  69. package/lib/types/resources/webhooks.d.ts +79 -0
  70. package/lib/types/utils.d.ts +22 -0
  71. package/package.json +28 -39
  72. package/lib/config.d.ts +0 -52
  73. package/lib/config.js +0 -47
  74. package/lib/models/access-token.d.ts +0 -18
  75. package/lib/models/access-token.js +0 -56
  76. package/lib/models/account.d.ts +0 -27
  77. package/lib/models/account.js +0 -73
  78. package/lib/models/application-details.d.ts +0 -14
  79. package/lib/models/application-details.js +0 -47
  80. package/lib/models/attributes.d.ts +0 -151
  81. package/lib/models/attributes.js +0 -382
  82. package/lib/models/calendar-availability.d.ts +0 -76
  83. package/lib/models/calendar-availability.js +0 -121
  84. package/lib/models/calendar-restful-model-collection.d.ts +0 -17
  85. package/lib/models/calendar-restful-model-collection.js +0 -181
  86. package/lib/models/calendar.d.ts +0 -33
  87. package/lib/models/calendar.js +0 -97
  88. package/lib/models/component-restful-model-collection.d.ts +0 -9
  89. package/lib/models/component-restful-model-collection.js +0 -34
  90. package/lib/models/component.d.ts +0 -37
  91. package/lib/models/component.js +0 -91
  92. package/lib/models/connect.d.ts +0 -73
  93. package/lib/models/connect.js +0 -193
  94. package/lib/models/contact-restful-model-collection.d.ts +0 -9
  95. package/lib/models/contact-restful-model-collection.js +0 -60
  96. package/lib/models/contact.d.ts +0 -129
  97. package/lib/models/contact.js +0 -289
  98. package/lib/models/delta-collection.d.ts +0 -17
  99. package/lib/models/delta-collection.js +0 -139
  100. package/lib/models/delta-stream.d.ts +0 -32
  101. package/lib/models/delta-stream.js +0 -250
  102. package/lib/models/delta.d.ts +0 -28
  103. package/lib/models/delta.js +0 -88
  104. package/lib/models/deltas.d.ts +0 -17
  105. package/lib/models/deltas.js +0 -49
  106. package/lib/models/draft.d.ts +0 -27
  107. package/lib/models/draft.js +0 -156
  108. package/lib/models/email-participant.d.ts +0 -13
  109. package/lib/models/email-participant.js +0 -46
  110. package/lib/models/event-conferencing.d.ts +0 -34
  111. package/lib/models/event-conferencing.js +0 -71
  112. package/lib/models/event-notification.d.ts +0 -27
  113. package/lib/models/event-notification.js +0 -62
  114. package/lib/models/event-participant.d.ts +0 -19
  115. package/lib/models/event-participant.js +0 -56
  116. package/lib/models/event-reminder-method.d.ts +0 -18
  117. package/lib/models/event-reminder-method.js +0 -47
  118. package/lib/models/event.d.ts +0 -104
  119. package/lib/models/event.js +0 -308
  120. package/lib/models/file.d.ts +0 -29
  121. package/lib/models/file.js +0 -136
  122. package/lib/models/folder.d.ts +0 -21
  123. package/lib/models/folder.js +0 -69
  124. package/lib/models/free-busy.d.ts +0 -58
  125. package/lib/models/free-busy.js +0 -132
  126. package/lib/models/job-status-restful-model-collection.d.ts +0 -9
  127. package/lib/models/job-status-restful-model-collection.js +0 -38
  128. package/lib/models/job-status.d.ts +0 -24
  129. package/lib/models/job-status.js +0 -68
  130. package/lib/models/management-account.d.ts +0 -63
  131. package/lib/models/management-account.js +0 -187
  132. package/lib/models/management-model-collection.d.ts +0 -10
  133. package/lib/models/management-model-collection.js +0 -39
  134. package/lib/models/management-model.d.ts +0 -6
  135. package/lib/models/management-model.js +0 -29
  136. package/lib/models/message-restful-model-collection.d.ts +0 -26
  137. package/lib/models/message-restful-model-collection.js +0 -80
  138. package/lib/models/message.d.ts +0 -57
  139. package/lib/models/message.js +0 -173
  140. package/lib/models/model-collection.d.ts +0 -25
  141. package/lib/models/model-collection.js +0 -201
  142. package/lib/models/model.d.ts +0 -12
  143. package/lib/models/model.js +0 -64
  144. package/lib/models/neural-categorizer.d.ts +0 -28
  145. package/lib/models/neural-categorizer.js +0 -139
  146. package/lib/models/neural-clean-conversation.d.ts +0 -16
  147. package/lib/models/neural-clean-conversation.js +0 -114
  148. package/lib/models/neural-ocr.d.ts +0 -14
  149. package/lib/models/neural-ocr.js +0 -50
  150. package/lib/models/neural-sentiment-analysis.d.ts +0 -20
  151. package/lib/models/neural-sentiment-analysis.js +0 -56
  152. package/lib/models/neural-signature-contact.d.ts +0 -43
  153. package/lib/models/neural-signature-contact.js +0 -142
  154. package/lib/models/neural-signature-extraction.d.ts +0 -17
  155. package/lib/models/neural-signature-extraction.js +0 -54
  156. package/lib/models/neural.d.ts +0 -36
  157. package/lib/models/neural.js +0 -163
  158. package/lib/models/nylas-api-error.d.ts +0 -26
  159. package/lib/models/nylas-api-error.js +0 -62
  160. package/lib/models/outbox-job-status.d.ts +0 -20
  161. package/lib/models/outbox-job-status.js +0 -64
  162. package/lib/models/outbox-message.d.ts +0 -16
  163. package/lib/models/outbox-message.js +0 -54
  164. package/lib/models/outbox.d.ts +0 -35
  165. package/lib/models/outbox.js +0 -158
  166. package/lib/models/rate-limit-error.d.ts +0 -26
  167. package/lib/models/rate-limit-error.js +0 -47
  168. package/lib/models/resource.d.ts +0 -22
  169. package/lib/models/resource.js +0 -66
  170. package/lib/models/restful-model-collection.d.ts +0 -15
  171. package/lib/models/restful-model-collection.js +0 -169
  172. package/lib/models/restful-model-instance.d.ts +0 -9
  173. package/lib/models/restful-model-instance.js +0 -37
  174. package/lib/models/restful-model.d.ts +0 -36
  175. package/lib/models/restful-model.js +0 -146
  176. package/lib/models/scheduler-booking-request.d.ts +0 -64
  177. package/lib/models/scheduler-booking-request.js +0 -148
  178. package/lib/models/scheduler-restful-model-collection.d.ts +0 -26
  179. package/lib/models/scheduler-restful-model-collection.js +0 -133
  180. package/lib/models/scheduler-time-slot.d.ts +0 -20
  181. package/lib/models/scheduler-time-slot.js +0 -53
  182. package/lib/models/scheduler.d.ts +0 -226
  183. package/lib/models/scheduler.js +0 -446
  184. package/lib/models/thread.d.ts +0 -49
  185. package/lib/models/thread.js +0 -127
  186. package/lib/models/webhook-notification.d.ts +0 -133
  187. package/lib/models/webhook-notification.js +0 -314
  188. package/lib/models/webhook.d.ts +0 -50
  189. package/lib/models/webhook.js +0 -101
  190. package/lib/models/when.d.ts +0 -29
  191. package/lib/models/when.js +0 -76
  192. package/lib/nylas-connection.d.ts +0 -71
  193. package/lib/nylas-connection.js +0 -282
  194. package/lib/nylas.d.ts +0 -34
  195. package/lib/nylas.js +0 -199
  196. package/lib/services/tunnel.d.ts +0 -28
  197. package/lib/services/tunnel.js +0 -89
@@ -1,139 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- var __assign = (this && this.__assign) || function () {
16
- __assign = Object.assign || function(t) {
17
- for (var s, i = 1, n = arguments.length; i < n; i++) {
18
- s = arguments[i];
19
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
20
- t[p] = s[p];
21
- }
22
- return t;
23
- };
24
- return __assign.apply(this, arguments);
25
- };
26
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
27
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28
- return new (P || (P = Promise))(function (resolve, reject) {
29
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
30
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
- step((generator = generator.apply(thisArg, _arguments || [])).next());
33
- });
34
- };
35
- var __generator = (this && this.__generator) || function (thisArg, body) {
36
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
37
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
38
- function verb(n) { return function (v) { return step([n, v]); }; }
39
- function step(op) {
40
- if (f) throw new TypeError("Generator is already executing.");
41
- while (_) try {
42
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
43
- if (y = 0, t) op = [op[0] & 2, t.value];
44
- switch (op[0]) {
45
- case 0: case 1: t = op; break;
46
- case 4: _.label++; return { value: op[1], done: false };
47
- case 5: _.label++; y = op[1]; op = [0]; continue;
48
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
49
- default:
50
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
51
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
52
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
53
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
54
- if (t[2]) _.ops.pop();
55
- _.trys.pop(); continue;
56
- }
57
- op = body.call(thisArg, _);
58
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
59
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
60
- }
61
- };
62
- var __importDefault = (this && this.__importDefault) || function (mod) {
63
- return (mod && mod.__esModule) ? mod : { "default": mod };
64
- };
65
- Object.defineProperty(exports, "__esModule", { value: true });
66
- var attributes_1 = __importDefault(require("./attributes"));
67
- var message_1 = __importDefault(require("./message"));
68
- var model_1 = __importDefault(require("./model"));
69
- var Categorize = /** @class */ (function (_super) {
70
- __extends(Categorize, _super);
71
- function Categorize(props) {
72
- var _this = _super.call(this) || this;
73
- _this.category = '';
74
- _this.categorizedAt = new Date();
75
- _this.modelVersion = '';
76
- _this.subcategories = [];
77
- _this.initAttributes(props);
78
- return _this;
79
- }
80
- Categorize.attributes = {
81
- category: attributes_1.default.String({
82
- modelKey: 'category',
83
- }),
84
- categorizedAt: attributes_1.default.DateTime({
85
- modelKey: 'categorizedAt',
86
- jsonKey: 'categorized_at',
87
- }),
88
- modelVersion: attributes_1.default.String({
89
- modelKey: 'modelVersion',
90
- jsonKey: 'model_version',
91
- }),
92
- subcategories: attributes_1.default.StringList({
93
- modelKey: 'subcategories',
94
- }),
95
- };
96
- return Categorize;
97
- }(model_1.default));
98
- exports.Categorize = Categorize;
99
- var NeuralCategorizer = /** @class */ (function (_super) {
100
- __extends(NeuralCategorizer, _super);
101
- function NeuralCategorizer(connection, props) {
102
- var _this = _super.call(this, connection, props) || this;
103
- _this.categorizer = new Categorize();
104
- _this.initAttributes(props);
105
- return _this;
106
- }
107
- NeuralCategorizer.prototype.reCategorize = function (category) {
108
- var _this = this;
109
- return this.connection
110
- .request({
111
- method: 'POST',
112
- path: '/neural/categorize/feedback',
113
- body: { message_id: this.id, category: category },
114
- headers: {
115
- 'Content-Type': 'application/json',
116
- },
117
- })
118
- .then(function (json) { return __awaiter(_this, void 0, void 0, function () {
119
- var categorizeResponse;
120
- return __generator(this, function (_a) {
121
- switch (_a.label) {
122
- case 0: return [4 /*yield*/, this.connection.neural.categorize([
123
- json['message_id'],
124
- ])];
125
- case 1:
126
- categorizeResponse = _a.sent();
127
- return [2 /*return*/, categorizeResponse[0]];
128
- }
129
- });
130
- }); });
131
- };
132
- NeuralCategorizer.collectionName = 'categorizer';
133
- NeuralCategorizer.attributes = __assign(__assign({}, message_1.default.attributes), { categorizer: attributes_1.default.Object({
134
- modelKey: 'categorizer',
135
- itemClass: Categorize,
136
- }) });
137
- return NeuralCategorizer;
138
- }(message_1.default));
139
- exports.default = NeuralCategorizer;
@@ -1,16 +0,0 @@
1
- import Message, { MessageProperties } from './message';
2
- import { Attribute } from './attributes';
3
- import File from './file';
4
- import NylasConnection from '../nylas-connection';
5
- export declare type NeuralCleanConversationProperties = MessageProperties & {
6
- conversation: string;
7
- modelVersion: string;
8
- };
9
- export default class NeuralCleanConversation extends Message implements NeuralCleanConversationProperties {
10
- conversation: string;
11
- modelVersion: string;
12
- static collectionName: string;
13
- static attributes: Record<string, Attribute>;
14
- constructor(connection: NylasConnection, props?: NeuralCleanConversationProperties);
15
- extractImages(): Promise<File[]>;
16
- }
@@ -1,114 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- var __assign = (this && this.__assign) || function () {
16
- __assign = Object.assign || function(t) {
17
- for (var s, i = 1, n = arguments.length; i < n; i++) {
18
- s = arguments[i];
19
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
20
- t[p] = s[p];
21
- }
22
- return t;
23
- };
24
- return __assign.apply(this, arguments);
25
- };
26
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
27
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28
- return new (P || (P = Promise))(function (resolve, reject) {
29
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
30
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
- step((generator = generator.apply(thisArg, _arguments || [])).next());
33
- });
34
- };
35
- var __generator = (this && this.__generator) || function (thisArg, body) {
36
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
37
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
38
- function verb(n) { return function (v) { return step([n, v]); }; }
39
- function step(op) {
40
- if (f) throw new TypeError("Generator is already executing.");
41
- while (_) try {
42
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
43
- if (y = 0, t) op = [op[0] & 2, t.value];
44
- switch (op[0]) {
45
- case 0: case 1: t = op; break;
46
- case 4: _.label++; return { value: op[1], done: false };
47
- case 5: _.label++; y = op[1]; op = [0]; continue;
48
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
49
- default:
50
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
51
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
52
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
53
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
54
- if (t[2]) _.ops.pop();
55
- _.trys.pop(); continue;
56
- }
57
- op = body.call(thisArg, _);
58
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
59
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
60
- }
61
- };
62
- var __importDefault = (this && this.__importDefault) || function (mod) {
63
- return (mod && mod.__esModule) ? mod : { "default": mod };
64
- };
65
- Object.defineProperty(exports, "__esModule", { value: true });
66
- var message_1 = __importDefault(require("./message"));
67
- var attributes_1 = __importDefault(require("./attributes"));
68
- var IMAGE_REGEX = /[(']cid:(.)*[)']/g;
69
- var NeuralCleanConversation = /** @class */ (function (_super) {
70
- __extends(NeuralCleanConversation, _super);
71
- function NeuralCleanConversation(connection, props) {
72
- var _this = _super.call(this, connection, props) || this;
73
- _this.conversation = '';
74
- _this.modelVersion = '';
75
- _this.initAttributes(props);
76
- return _this;
77
- }
78
- NeuralCleanConversation.prototype.extractImages = function () {
79
- var _this = this;
80
- var f = [];
81
- if (this.conversation) {
82
- var fileIds = this.conversation.match(IMAGE_REGEX);
83
- if (fileIds) {
84
- // After applying the regex, if there are IDs found they would be
85
- // in the form of => 'cid:xxxx' (including apostrophes), so we discard
86
- // everything before and after the file ID (denoted as xxxx above)
87
- fileIds.forEach(function (id) { return __awaiter(_this, void 0, void 0, function () {
88
- var parsedId, file;
89
- return __generator(this, function (_a) {
90
- switch (_a.label) {
91
- case 0:
92
- parsedId = id.substring(5, id.length - 1);
93
- return [4 /*yield*/, this.connection.files.find(parsedId)];
94
- case 1:
95
- file = _a.sent();
96
- f.push(file);
97
- return [2 /*return*/];
98
- }
99
- });
100
- }); });
101
- }
102
- }
103
- return Promise.resolve(f);
104
- };
105
- NeuralCleanConversation.collectionName = 'conversation';
106
- NeuralCleanConversation.attributes = __assign(__assign({}, message_1.default.attributes), { conversation: attributes_1.default.String({
107
- modelKey: 'conversation',
108
- }), modelVersion: attributes_1.default.String({
109
- modelKey: 'modelVersion',
110
- jsonKey: 'model_version',
111
- }) });
112
- return NeuralCleanConversation;
113
- }(message_1.default));
114
- exports.default = NeuralCleanConversation;
@@ -1,14 +0,0 @@
1
- import { Attribute } from './attributes';
2
- import File, { FileProperties } from './file';
3
- import NylasConnection from '../nylas-connection';
4
- export declare type NeuralOcrProperties = FileProperties & {
5
- ocr: string[];
6
- processedPages: number;
7
- };
8
- export default class NeuralOcr extends File implements NeuralOcrProperties {
9
- ocr: string[];
10
- processedPages: number;
11
- static collectionName: string;
12
- static attributes: Record<string, Attribute>;
13
- constructor(connection: NylasConnection, props?: NeuralOcrProperties);
14
- }
@@ -1,50 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- var __assign = (this && this.__assign) || function () {
16
- __assign = Object.assign || function(t) {
17
- for (var s, i = 1, n = arguments.length; i < n; i++) {
18
- s = arguments[i];
19
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
20
- t[p] = s[p];
21
- }
22
- return t;
23
- };
24
- return __assign.apply(this, arguments);
25
- };
26
- var __importDefault = (this && this.__importDefault) || function (mod) {
27
- return (mod && mod.__esModule) ? mod : { "default": mod };
28
- };
29
- Object.defineProperty(exports, "__esModule", { value: true });
30
- var attributes_1 = __importDefault(require("./attributes"));
31
- var file_1 = __importDefault(require("./file"));
32
- var NeuralOcr = /** @class */ (function (_super) {
33
- __extends(NeuralOcr, _super);
34
- function NeuralOcr(connection, props) {
35
- var _this = _super.call(this, connection, props) || this;
36
- _this.ocr = [];
37
- _this.processedPages = 0;
38
- _this.initAttributes(props);
39
- return _this;
40
- }
41
- NeuralOcr.collectionName = 'ocr';
42
- NeuralOcr.attributes = __assign(__assign({}, file_1.default.attributes), { ocr: attributes_1.default.StringList({
43
- modelKey: 'ocr',
44
- }), processedPages: attributes_1.default.Number({
45
- modelKey: 'processedPages',
46
- jsonKey: 'processed_pages',
47
- }) });
48
- return NeuralOcr;
49
- }(file_1.default));
50
- exports.default = NeuralOcr;
@@ -1,20 +0,0 @@
1
- import { Attribute } from './attributes';
2
- import RestfulModel from './restful-model';
3
- import NylasConnection from '../nylas-connection';
4
- export declare type NeuralSentimentAnalysisProperties = {
5
- accountId: string;
6
- sentiment: string;
7
- sentimentScore: number;
8
- processedLength: number;
9
- text: string;
10
- };
11
- export default class NeuralSentimentAnalysis extends RestfulModel implements NeuralSentimentAnalysisProperties {
12
- accountId: string;
13
- sentiment: string;
14
- sentimentScore: number;
15
- processedLength: number;
16
- text: string;
17
- static collectionName: string;
18
- static attributes: Record<string, Attribute>;
19
- constructor(connection: NylasConnection, props?: NeuralSentimentAnalysisProperties);
20
- }
@@ -1,56 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- var __importDefault = (this && this.__importDefault) || function (mod) {
16
- return (mod && mod.__esModule) ? mod : { "default": mod };
17
- };
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- var attributes_1 = __importDefault(require("./attributes"));
20
- var restful_model_1 = __importDefault(require("./restful-model"));
21
- var NeuralSentimentAnalysis = /** @class */ (function (_super) {
22
- __extends(NeuralSentimentAnalysis, _super);
23
- function NeuralSentimentAnalysis(connection, props) {
24
- var _this = _super.call(this, connection, props) || this;
25
- _this.accountId = '';
26
- _this.sentiment = '';
27
- _this.sentimentScore = 0;
28
- _this.processedLength = 0;
29
- _this.text = '';
30
- _this.initAttributes(props);
31
- return _this;
32
- }
33
- NeuralSentimentAnalysis.collectionName = 'sentiment';
34
- NeuralSentimentAnalysis.attributes = {
35
- accountId: attributes_1.default.String({
36
- modelKey: 'accountId',
37
- jsonKey: 'account_id',
38
- }),
39
- sentiment: attributes_1.default.String({
40
- modelKey: 'sentiment',
41
- }),
42
- sentimentScore: attributes_1.default.Number({
43
- modelKey: 'sentimentScore',
44
- jsonKey: 'sentiment_score',
45
- }),
46
- processedLength: attributes_1.default.Number({
47
- modelKey: 'processedLength',
48
- jsonKey: 'processed_length',
49
- }),
50
- text: attributes_1.default.String({
51
- modelKey: 'text',
52
- }),
53
- };
54
- return NeuralSentimentAnalysis;
55
- }(restful_model_1.default));
56
- exports.default = NeuralSentimentAnalysis;
@@ -1,43 +0,0 @@
1
- import { Attribute } from './attributes';
2
- import Contact from './contact';
3
- import Model from './model';
4
- import NylasConnection from '../nylas-connection';
5
- declare type LinkProperties = {
6
- description?: string;
7
- url?: string;
8
- };
9
- declare class Link extends Model implements LinkProperties {
10
- description: string;
11
- url: string;
12
- static attributes: Record<string, Attribute>;
13
- constructor(props?: LinkProperties);
14
- }
15
- declare type NameProperties = {
16
- firstName?: string;
17
- lastName?: string;
18
- };
19
- declare class Name extends Model implements NameProperties {
20
- firstName: string;
21
- lastName: string;
22
- static attributes: Record<string, Attribute>;
23
- constructor(props?: NameProperties);
24
- }
25
- export declare type NeuralSignatureContactProperties = {
26
- jobTitles?: string[];
27
- links?: Link[];
28
- phoneNumbers?: string[];
29
- emails?: string[];
30
- names?: Name[];
31
- };
32
- export default class NeuralSignatureContact extends Model implements NeuralSignatureContactProperties {
33
- jobTitles?: string[];
34
- links?: Link[];
35
- phoneNumbers?: string[];
36
- emails?: string[];
37
- names?: Name[];
38
- static attributes: Record<string, Attribute>;
39
- constructor(props?: NeuralSignatureContactProperties);
40
- toJSON(): Record<string, unknown>;
41
- toContactObject(connection: NylasConnection): Contact;
42
- }
43
- export {};
@@ -1,142 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- var __importDefault = (this && this.__importDefault) || function (mod) {
16
- return (mod && mod.__esModule) ? mod : { "default": mod };
17
- };
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
22
- result["default"] = mod;
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- var attributes_1 = __importDefault(require("./attributes"));
27
- var contact_1 = __importStar(require("./contact"));
28
- var model_1 = __importDefault(require("./model"));
29
- var Link = /** @class */ (function (_super) {
30
- __extends(Link, _super);
31
- function Link(props) {
32
- var _this = _super.call(this) || this;
33
- _this.description = '';
34
- _this.url = '';
35
- _this.initAttributes(props);
36
- return _this;
37
- }
38
- Link.attributes = {
39
- description: attributes_1.default.String({
40
- modelKey: 'description',
41
- }),
42
- url: attributes_1.default.String({
43
- modelKey: 'url',
44
- }),
45
- };
46
- return Link;
47
- }(model_1.default));
48
- var Name = /** @class */ (function (_super) {
49
- __extends(Name, _super);
50
- function Name(props) {
51
- var _this = _super.call(this) || this;
52
- _this.firstName = '';
53
- _this.lastName = '';
54
- _this.initAttributes(props);
55
- return _this;
56
- }
57
- Name.attributes = {
58
- firstName: attributes_1.default.String({
59
- modelKey: 'firstName',
60
- jsonKey: 'first_name',
61
- }),
62
- lastName: attributes_1.default.String({
63
- modelKey: 'lastName',
64
- jsonKey: 'last_name',
65
- }),
66
- };
67
- return Name;
68
- }(model_1.default));
69
- var NeuralSignatureContact = /** @class */ (function (_super) {
70
- __extends(NeuralSignatureContact, _super);
71
- function NeuralSignatureContact(props) {
72
- var _this = _super.call(this) || this;
73
- _this.initAttributes(props);
74
- return _this;
75
- }
76
- NeuralSignatureContact.prototype.toJSON = function () {
77
- return {
78
- job_titles: this.jobTitles,
79
- links: this.links,
80
- phone_numbers: this.phoneNumbers,
81
- emails: this.emails,
82
- names: this.names ? this.names.map(function (name) { return name.toJSON(); }) : this.names,
83
- };
84
- };
85
- NeuralSignatureContact.prototype.toContactObject = function (connection) {
86
- var contact = new contact_1.default(connection);
87
- if (this.names) {
88
- contact.givenName = this.names[0].firstName;
89
- contact.surname = this.names[0].lastName;
90
- }
91
- if (this.jobTitles) {
92
- contact.jobTitle = this.jobTitles[0];
93
- }
94
- if (this.emails) {
95
- var contactEmails_1 = [];
96
- this.emails.forEach(function (email) {
97
- return contactEmails_1.push(new contact_1.EmailAddress({ type: 'personal', email: email }));
98
- });
99
- contact.emailAddresses = contactEmails_1;
100
- }
101
- if (this.phoneNumbers) {
102
- var contactNumbers_1 = [];
103
- this.phoneNumbers.forEach(function (number) {
104
- return contactNumbers_1.push(new contact_1.PhoneNumber({ type: 'mobile', number: number }));
105
- });
106
- contact.phoneNumbers = contactNumbers_1;
107
- }
108
- if (this.links) {
109
- var webPages_1 = [];
110
- this.links.forEach(function (link) {
111
- if (link['url']) {
112
- webPages_1.push(new contact_1.WebPage({ type: 'homepage', url: link['url'] }));
113
- }
114
- });
115
- contact.webPages = webPages_1;
116
- }
117
- return contact;
118
- };
119
- NeuralSignatureContact.attributes = {
120
- jobTitles: attributes_1.default.StringList({
121
- modelKey: 'jobTitles',
122
- jsonKey: 'job_titles',
123
- }),
124
- links: attributes_1.default.Collection({
125
- modelKey: 'links',
126
- itemClass: Link,
127
- }),
128
- phoneNumbers: attributes_1.default.StringList({
129
- modelKey: 'phoneNumbers',
130
- jsonKey: 'phone_numbers',
131
- }),
132
- emails: attributes_1.default.StringList({
133
- modelKey: 'emails',
134
- }),
135
- names: attributes_1.default.Collection({
136
- modelKey: 'names',
137
- itemClass: Name,
138
- }),
139
- };
140
- return NeuralSignatureContact;
141
- }(model_1.default));
142
- exports.default = NeuralSignatureContact;
@@ -1,17 +0,0 @@
1
- import NeuralSignatureContact from './neural-signature-contact';
2
- import { Attribute } from './attributes';
3
- import Message, { MessageProperties } from './message';
4
- import NylasConnection from '../nylas-connection';
5
- export declare type NeuralSignatureExtractionProperties = MessageProperties & {
6
- signature: string;
7
- modelVersion: string;
8
- contacts?: NeuralSignatureContact;
9
- };
10
- export default class NeuralSignatureExtraction extends Message implements NeuralSignatureExtractionProperties {
11
- signature: string;
12
- modelVersion: string;
13
- contacts?: NeuralSignatureContact;
14
- static collectionName: string;
15
- static attributes: Record<string, Attribute>;
16
- constructor(connection: NylasConnection, props?: NeuralSignatureExtractionProperties);
17
- }
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- var __assign = (this && this.__assign) || function () {
16
- __assign = Object.assign || function(t) {
17
- for (var s, i = 1, n = arguments.length; i < n; i++) {
18
- s = arguments[i];
19
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
20
- t[p] = s[p];
21
- }
22
- return t;
23
- };
24
- return __assign.apply(this, arguments);
25
- };
26
- var __importDefault = (this && this.__importDefault) || function (mod) {
27
- return (mod && mod.__esModule) ? mod : { "default": mod };
28
- };
29
- Object.defineProperty(exports, "__esModule", { value: true });
30
- var neural_signature_contact_1 = __importDefault(require("./neural-signature-contact"));
31
- var attributes_1 = __importDefault(require("./attributes"));
32
- var message_1 = __importDefault(require("./message"));
33
- var NeuralSignatureExtraction = /** @class */ (function (_super) {
34
- __extends(NeuralSignatureExtraction, _super);
35
- function NeuralSignatureExtraction(connection, props) {
36
- var _this = _super.call(this, connection, props) || this;
37
- _this.signature = '';
38
- _this.modelVersion = '';
39
- _this.initAttributes(props);
40
- return _this;
41
- }
42
- NeuralSignatureExtraction.collectionName = 'signature';
43
- NeuralSignatureExtraction.attributes = __assign(__assign({}, message_1.default.attributes), { signature: attributes_1.default.String({
44
- modelKey: 'signature',
45
- }), modelVersion: attributes_1.default.String({
46
- modelKey: 'modelVersion',
47
- jsonKey: 'model_version',
48
- }), contacts: attributes_1.default.Object({
49
- modelKey: 'contacts',
50
- itemClass: neural_signature_contact_1.default,
51
- }) });
52
- return NeuralSignatureExtraction;
53
- }(message_1.default));
54
- exports.default = NeuralSignatureExtraction;