@pallasoft/ps-mail 1.0.0

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 (145) hide show
  1. package/LICENSE +32 -0
  2. package/README.md +33 -0
  3. package/dist/constants/mail-http-config.d.ts +11 -0
  4. package/dist/constants/mail-http-config.js +14 -0
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.js +2 -0
  7. package/dist/microsoft/constants/graph-mail-body-type.d.ts +4 -0
  8. package/dist/microsoft/constants/graph-mail-body-type.js +8 -0
  9. package/dist/microsoft/constants/graph-mail-config.d.ts +42 -0
  10. package/dist/microsoft/constants/graph-mail-config.js +80 -0
  11. package/dist/microsoft/constants/graph-mail-error-messages.d.ts +2 -0
  12. package/dist/microsoft/constants/graph-mail-error-messages.js +12 -0
  13. package/dist/microsoft/constants/graph-mail-error-reason.d.ts +7 -0
  14. package/dist/microsoft/constants/graph-mail-error-reason.js +11 -0
  15. package/dist/microsoft/constants/graph-mail-folder.d.ts +4 -0
  16. package/dist/microsoft/constants/graph-mail-folder.js +8 -0
  17. package/dist/microsoft/constants/index.d.ts +5 -0
  18. package/dist/microsoft/constants/index.js +21 -0
  19. package/dist/microsoft/index.d.ts +3 -0
  20. package/dist/microsoft/index.js +10 -0
  21. package/dist/microsoft/models/graph-access-token-data.d.ts +4 -0
  22. package/dist/microsoft/models/graph-access-token-data.js +2 -0
  23. package/dist/microsoft/models/graph-collection-response.d.ts +5 -0
  24. package/dist/microsoft/models/graph-collection-response.js +2 -0
  25. package/dist/microsoft/models/graph-credentials.d.ts +6 -0
  26. package/dist/microsoft/models/graph-credentials.js +2 -0
  27. package/dist/microsoft/models/graph-error-detail-data.d.ts +4 -0
  28. package/dist/microsoft/models/graph-error-detail-data.js +2 -0
  29. package/dist/microsoft/models/graph-error-response.d.ts +4 -0
  30. package/dist/microsoft/models/graph-error-response.js +2 -0
  31. package/dist/microsoft/models/graph-mail-attachment-data.d.ts +8 -0
  32. package/dist/microsoft/models/graph-mail-attachment-data.js +2 -0
  33. package/dist/microsoft/models/graph-mail-body-data.d.ts +5 -0
  34. package/dist/microsoft/models/graph-mail-body-data.js +2 -0
  35. package/dist/microsoft/models/graph-mail-categories-request.d.ts +3 -0
  36. package/dist/microsoft/models/graph-mail-categories-request.js +2 -0
  37. package/dist/microsoft/models/graph-mail-connection.d.ts +4 -0
  38. package/dist/microsoft/models/graph-mail-connection.js +2 -0
  39. package/dist/microsoft/models/graph-mail-delta-data.d.ts +6 -0
  40. package/dist/microsoft/models/graph-mail-delta-data.js +2 -0
  41. package/dist/microsoft/models/graph-mail-delta-options.d.ts +4 -0
  42. package/dist/microsoft/models/graph-mail-delta-options.js +2 -0
  43. package/dist/microsoft/models/graph-mail-delta-page-data.d.ts +7 -0
  44. package/dist/microsoft/models/graph-mail-delta-page-data.js +2 -0
  45. package/dist/microsoft/models/graph-mail-draft-data.d.ts +11 -0
  46. package/dist/microsoft/models/graph-mail-draft-data.js +2 -0
  47. package/dist/microsoft/models/graph-mail-error-data.d.ts +7 -0
  48. package/dist/microsoft/models/graph-mail-error-data.js +2 -0
  49. package/dist/microsoft/models/graph-mail-header-data.d.ts +4 -0
  50. package/dist/microsoft/models/graph-mail-header-data.js +2 -0
  51. package/dist/microsoft/models/graph-mail-message-data.d.ts +25 -0
  52. package/dist/microsoft/models/graph-mail-message-data.js +2 -0
  53. package/dist/microsoft/models/graph-mail-outgoing-message-data.d.ts +11 -0
  54. package/dist/microsoft/models/graph-mail-outgoing-message-data.js +2 -0
  55. package/dist/microsoft/models/graph-mail-recipient-data.d.ts +4 -0
  56. package/dist/microsoft/models/graph-mail-recipient-data.js +2 -0
  57. package/dist/microsoft/models/graph-mail-removed-data.d.ts +3 -0
  58. package/dist/microsoft/models/graph-mail-removed-data.js +2 -0
  59. package/dist/microsoft/models/graph-mail-reply-data.d.ts +9 -0
  60. package/dist/microsoft/models/graph-mail-reply-data.js +2 -0
  61. package/dist/microsoft/models/graph-mail-reply-request.d.ts +4 -0
  62. package/dist/microsoft/models/graph-mail-reply-request.js +2 -0
  63. package/dist/microsoft/models/graph-mail-send-request.d.ts +5 -0
  64. package/dist/microsoft/models/graph-mail-send-request.js +2 -0
  65. package/dist/microsoft/models/graph-request-data.d.ts +7 -0
  66. package/dist/microsoft/models/graph-request-data.js +2 -0
  67. package/dist/microsoft/models/graph-token-response.d.ts +5 -0
  68. package/dist/microsoft/models/graph-token-response.js +2 -0
  69. package/dist/microsoft/models/index.d.ts +24 -0
  70. package/dist/microsoft/models/index.js +2 -0
  71. package/dist/microsoft/services/graph-mail-error-service.d.ts +13 -0
  72. package/dist/microsoft/services/graph-mail-error-service.js +153 -0
  73. package/dist/microsoft/services/graph-mail-service.d.ts +32 -0
  74. package/dist/microsoft/services/graph-mail-service.js +352 -0
  75. package/dist/microsoft/services/graph-request-service.d.ts +11 -0
  76. package/dist/microsoft/services/graph-request-service.js +206 -0
  77. package/dist/microsoft/services/graph-token-service.d.ts +10 -0
  78. package/dist/microsoft/services/graph-token-service.js +137 -0
  79. package/dist/microsoft/services/index.d.ts +4 -0
  80. package/dist/microsoft/services/index.js +20 -0
  81. package/dist/models/index.d.ts +5 -0
  82. package/dist/models/index.js +2 -0
  83. package/dist/models/mail-address-data.d.ts +4 -0
  84. package/dist/models/mail-address-data.js +2 -0
  85. package/dist/models/mail-attachment-content-data.d.ts +4 -0
  86. package/dist/models/mail-attachment-content-data.js +2 -0
  87. package/dist/models/mail-attachment-data.d.ts +7 -0
  88. package/dist/models/mail-attachment-data.js +2 -0
  89. package/dist/models/mail-query-parameter.d.ts +4 -0
  90. package/dist/models/mail-query-parameter.js +2 -0
  91. package/dist/models/mail-sent-data.d.ts +5 -0
  92. package/dist/models/mail-sent-data.js +2 -0
  93. package/dist/resend/constants/index.d.ts +2 -0
  94. package/dist/resend/constants/index.js +18 -0
  95. package/dist/resend/constants/resend-mail-config.d.ts +24 -0
  96. package/dist/resend/constants/resend-mail-config.js +27 -0
  97. package/dist/resend/constants/resend-webhook-config.d.ts +16 -0
  98. package/dist/resend/constants/resend-webhook-config.js +19 -0
  99. package/dist/resend/index.d.ts +2 -0
  100. package/dist/resend/index.js +7 -0
  101. package/dist/resend/models/index.d.ts +15 -0
  102. package/dist/resend/models/index.js +2 -0
  103. package/dist/resend/models/resend-attachment-row.d.ts +9 -0
  104. package/dist/resend/models/resend-attachment-row.js +2 -0
  105. package/dist/resend/models/resend-authentication-data.d.ts +5 -0
  106. package/dist/resend/models/resend-authentication-data.js +2 -0
  107. package/dist/resend/models/resend-connection.d.ts +5 -0
  108. package/dist/resend/models/resend-connection.js +2 -0
  109. package/dist/resend/models/resend-error-response.d.ts +5 -0
  110. package/dist/resend/models/resend-error-response.js +2 -0
  111. package/dist/resend/models/resend-list-response.d.ts +3 -0
  112. package/dist/resend/models/resend-list-response.js +2 -0
  113. package/dist/resend/models/resend-mail-error-data.d.ts +4 -0
  114. package/dist/resend/models/resend-mail-error-data.js +2 -0
  115. package/dist/resend/models/resend-received-attachment-data.d.ts +4 -0
  116. package/dist/resend/models/resend-received-attachment-data.js +2 -0
  117. package/dist/resend/models/resend-received-email-data.d.ts +20 -0
  118. package/dist/resend/models/resend-received-email-data.js +2 -0
  119. package/dist/resend/models/resend-received-email-row.d.ts +21 -0
  120. package/dist/resend/models/resend-received-email-row.js +2 -0
  121. package/dist/resend/models/resend-send-attachment-data.d.ts +6 -0
  122. package/dist/resend/models/resend-send-attachment-data.js +2 -0
  123. package/dist/resend/models/resend-send-attachment-request.d.ts +6 -0
  124. package/dist/resend/models/resend-send-attachment-request.js +2 -0
  125. package/dist/resend/models/resend-send-data.d.ts +15 -0
  126. package/dist/resend/models/resend-send-data.js +2 -0
  127. package/dist/resend/models/resend-send-request.d.ts +13 -0
  128. package/dist/resend/models/resend-send-request.js +2 -0
  129. package/dist/resend/models/resend-send-response.d.ts +3 -0
  130. package/dist/resend/models/resend-send-response.js +2 -0
  131. package/dist/resend/models/resend-webhook-headers.d.ts +1 -0
  132. package/dist/resend/models/resend-webhook-headers.js +2 -0
  133. package/dist/resend/services/index.d.ts +3 -0
  134. package/dist/resend/services/index.js +19 -0
  135. package/dist/resend/services/resend-mail-error-service.d.ts +7 -0
  136. package/dist/resend/services/resend-mail-error-service.js +79 -0
  137. package/dist/resend/services/resend-mail-service.d.ts +22 -0
  138. package/dist/resend/services/resend-mail-service.js +322 -0
  139. package/dist/resend/services/resend-webhook-service.d.ts +10 -0
  140. package/dist/resend/services/resend-webhook-service.js +139 -0
  141. package/dist/services/mail-fetch-failure-service.d.ts +3 -0
  142. package/dist/services/mail-fetch-failure-service.js +49 -0
  143. package/dist/services/mail-url-service.d.ts +5 -0
  144. package/dist/services/mail-url-service.js +27 -0
  145. package/package.json +88 -0
package/LICENSE ADDED
@@ -0,0 +1,32 @@
1
+ Pallasoft Proprietary License
2
+
3
+ Version 1.0, 23-Jan-2024
4
+
5
+ 1. Grant of License:
6
+ Pallasoft grants you a non-exclusive, non-transferable, revocable license to use the software, solely for internal business purposes.
7
+
8
+ 2. Restrictions:
9
+ You may not:
10
+ a. Distribute or sublicense the software to third parties.
11
+ b. Reverse engineer, decompile, or disassemble the software.
12
+ c. Remove or alter any proprietary notices or labels on the software.
13
+
14
+ 3. Ownership:
15
+ Pallasoft retains all right, title, and interest in and to the software, including all intellectual property rights.
16
+
17
+ 4. Confidentiality:
18
+ You agree to keep the software confidential and not disclose it to third parties.
19
+
20
+ 5. Support and Updates:
21
+ This license does not entitle you to support or updates. Pallasoft may, at its discretion, provide support and updates.
22
+
23
+ 6. Termination:
24
+ This license is effective until terminated. Pallasoft may terminate the license at any time if you breach any terms. Upon termination, you must cease using the software.
25
+
26
+ 7. Governing Law:
27
+ This license is governed by the Canadian Laws. Any disputes arising out of this license shall be resolved in the courts of Canada.
28
+
29
+ 8. Contact Information:
30
+ For inquiries regarding this license, contact operations@pallasoft.com.
31
+
32
+ [End of License]
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # @pallasoft/ps-mail
2
+
3
+ Shared Pallasoft mail provider clients, one entry point per provider.
4
+
5
+ ## Microsoft Graph (`@pallasoft/ps-mail/microsoft`)
6
+
7
+ Works with one shared mailbox through an Entra app registration (client credentials, application
8
+ permissions `Mail.ReadWrite` and `Mail.Send`).
9
+
10
+ - `GraphMailService.deltaPage` / `GraphMailService.delta` read Inbox or Sent Items changes and
11
+ return the next delta link to store.
12
+ - `GraphMailService.getMessage`, `listAttachments` and `downloadAttachment` read a message.
13
+ - `GraphMailService.sendMail`, `createAndSend` and `reply` send mail from the mailbox; `reply` stays
14
+ in the conversation.
15
+ - `GraphMailService.setCategories` tags a message for people working in Outlook.
16
+ - `GraphMailErrorService.isSyncStateExpired(error)` tells the caller to drop its delta link and
17
+ resync. Throttling (429/503 with `Retry-After`) and an expired token (401) are retried inside.
18
+
19
+ ## Resend (`@pallasoft/ps-mail/resend`)
20
+
21
+ - `ResendMailService.send` sends an email and returns its id.
22
+ - `ResendMailService.listReceived`, `getReceived`, `listReceivedAttachments` and
23
+ `downloadAttachment` read received emails.
24
+ - `ResendWebhookService.verify` checks a Svix-signed webhook (id, timestamp and signature headers,
25
+ five minute tolerance, Web Crypto verification).
26
+
27
+ ## Scripts
28
+
29
+ - `npm run build` compiles the package into `dist`.
30
+ - `npm test` runs the unit tests.
31
+ - `npm run lint` runs ESLint using the shared package baseline.
32
+ - `npm run format:check` checks Prettier formatting.
33
+ - `npm run release` publishes through semantic-release.
@@ -0,0 +1,11 @@
1
+ export declare const MailHttpConfig: {
2
+ readonly encodedListSeparator: RegExp;
3
+ readonly goneStatus: 410;
4
+ readonly listSeparator: ",";
5
+ readonly millisecondsPerSecond: 1000;
6
+ readonly pathSeparator: "/";
7
+ readonly queryAssign: "=";
8
+ readonly queryJoin: "&";
9
+ readonly queryStart: "?";
10
+ readonly timeoutErrorName: "TimeoutError";
11
+ };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MailHttpConfig = void 0;
4
+ exports.MailHttpConfig = {
5
+ encodedListSeparator: /%2C/g,
6
+ goneStatus: 410,
7
+ listSeparator: ',',
8
+ millisecondsPerSecond: 1000,
9
+ pathSeparator: '/',
10
+ queryAssign: '=',
11
+ queryJoin: '&',
12
+ queryStart: '?',
13
+ timeoutErrorName: 'TimeoutError',
14
+ };
@@ -0,0 +1 @@
1
+ export type { MailAddressData, MailAttachmentContentData, MailAttachmentData, MailSentData, } from './models';
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export declare enum GraphMailBodyType {
2
+ Html = "html",
3
+ Text = "text"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GraphMailBodyType = void 0;
4
+ var GraphMailBodyType;
5
+ (function (GraphMailBodyType) {
6
+ GraphMailBodyType["Html"] = "html";
7
+ GraphMailBodyType["Text"] = "text";
8
+ })(GraphMailBodyType || (exports.GraphMailBodyType = GraphMailBodyType = {}));
@@ -0,0 +1,42 @@
1
+ export declare const GraphMailConfig: {
2
+ readonly graphBaseUrl: "https://graph.microsoft.com/v1.0";
3
+ readonly loginBaseUrl: "https://login.microsoftonline.com";
4
+ readonly tokenPath: "oauth2/v2.0/token";
5
+ readonly tokenScope: "https://graph.microsoft.com/.default";
6
+ readonly tokenGrantType: "client_credentials";
7
+ readonly tokenRefreshSkewSeconds: 300;
8
+ readonly tokenKeySeparator: ":";
9
+ readonly paths: {
10
+ readonly attachments: "attachments";
11
+ readonly createReply: "createReply";
12
+ readonly delta: "messages/delta";
13
+ readonly mailFolders: "mailFolders";
14
+ readonly messages: "messages";
15
+ readonly send: "send";
16
+ readonly sendMail: "sendMail";
17
+ readonly users: "users";
18
+ readonly value: "$value";
19
+ };
20
+ readonly query: {
21
+ readonly filter: "$filter";
22
+ readonly select: "$select";
23
+ readonly receivedSinceFilter: "receivedDateTime ge ";
24
+ };
25
+ readonly prefer: {
26
+ readonly immutableIds: "IdType=\"ImmutableId\"";
27
+ readonly maxPageSize: "odata.maxpagesize=";
28
+ readonly textBody: "outlook.body-content-type=\"text\"";
29
+ };
30
+ readonly preferSeparator: ", ";
31
+ readonly deltaPageSize: 50;
32
+ readonly deltaFields: readonly ["id", "conversationId", "internetMessageId", "subject", "from", "sender", "toRecipients", "ccRecipients", "replyTo", "receivedDateTime", "sentDateTime", "hasAttachments", "isDraft", "categories", "bodyPreview"];
33
+ readonly messageFields: readonly ["id", "conversationId", "internetMessageId", "subject", "from", "sender", "toRecipients", "ccRecipients", "replyTo", "receivedDateTime", "sentDateTime", "hasAttachments", "isDraft", "categories", "bodyPreview", "body", "uniqueBody", "internetMessageHeaders"];
34
+ readonly attachmentFields: readonly ["id", "name", "contentType", "size", "isInline"];
35
+ readonly syncResetErrorCodes: readonly ["syncstatenotfound", "syncstateinvalid", "resyncrequired"];
36
+ readonly retry: {
37
+ readonly fallbackSeconds: 2;
38
+ readonly maxRetries: 3;
39
+ readonly maxWaitSeconds: 30;
40
+ };
41
+ readonly saveToSentItems: true;
42
+ };
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GraphMailConfig = void 0;
4
+ exports.GraphMailConfig = {
5
+ graphBaseUrl: 'https://graph.microsoft.com/v1.0',
6
+ loginBaseUrl: 'https://login.microsoftonline.com',
7
+ tokenPath: 'oauth2/v2.0/token',
8
+ tokenScope: 'https://graph.microsoft.com/.default',
9
+ tokenGrantType: 'client_credentials',
10
+ tokenRefreshSkewSeconds: 300,
11
+ tokenKeySeparator: ':',
12
+ paths: {
13
+ attachments: 'attachments',
14
+ createReply: 'createReply',
15
+ delta: 'messages/delta',
16
+ mailFolders: 'mailFolders',
17
+ messages: 'messages',
18
+ send: 'send',
19
+ sendMail: 'sendMail',
20
+ users: 'users',
21
+ value: '$value',
22
+ },
23
+ query: {
24
+ filter: '$filter',
25
+ select: '$select',
26
+ receivedSinceFilter: 'receivedDateTime ge ',
27
+ },
28
+ prefer: {
29
+ immutableIds: 'IdType="ImmutableId"',
30
+ maxPageSize: 'odata.maxpagesize=',
31
+ textBody: 'outlook.body-content-type="text"',
32
+ },
33
+ preferSeparator: ', ',
34
+ deltaPageSize: 50,
35
+ deltaFields: [
36
+ 'id',
37
+ 'conversationId',
38
+ 'internetMessageId',
39
+ 'subject',
40
+ 'from',
41
+ 'sender',
42
+ 'toRecipients',
43
+ 'ccRecipients',
44
+ 'replyTo',
45
+ 'receivedDateTime',
46
+ 'sentDateTime',
47
+ 'hasAttachments',
48
+ 'isDraft',
49
+ 'categories',
50
+ 'bodyPreview',
51
+ ],
52
+ messageFields: [
53
+ 'id',
54
+ 'conversationId',
55
+ 'internetMessageId',
56
+ 'subject',
57
+ 'from',
58
+ 'sender',
59
+ 'toRecipients',
60
+ 'ccRecipients',
61
+ 'replyTo',
62
+ 'receivedDateTime',
63
+ 'sentDateTime',
64
+ 'hasAttachments',
65
+ 'isDraft',
66
+ 'categories',
67
+ 'bodyPreview',
68
+ 'body',
69
+ 'uniqueBody',
70
+ 'internetMessageHeaders',
71
+ ],
72
+ attachmentFields: ['id', 'name', 'contentType', 'size', 'isInline'],
73
+ syncResetErrorCodes: ['syncstatenotfound', 'syncstateinvalid', 'resyncrequired'],
74
+ retry: {
75
+ fallbackSeconds: 2,
76
+ maxRetries: 3,
77
+ maxWaitSeconds: 30,
78
+ },
79
+ saveToSentItems: true,
80
+ };
@@ -0,0 +1,2 @@
1
+ import { GraphMailErrorReason } from './graph-mail-error-reason';
2
+ export declare const GraphMailErrorMessages: Record<GraphMailErrorReason, string>;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.GraphMailErrorMessages = void 0;
5
+ var graph_mail_error_reason_1 = require("./graph-mail-error-reason");
6
+ exports.GraphMailErrorMessages = (_a = {},
7
+ _a[graph_mail_error_reason_1.GraphMailErrorReason.Failed] = 'Microsoft Graph request failed or could not be reached',
8
+ _a[graph_mail_error_reason_1.GraphMailErrorReason.NotFound] = 'Microsoft Graph item not found',
9
+ _a[graph_mail_error_reason_1.GraphMailErrorReason.SyncStateExpired] = 'Microsoft Graph delta link expired, resync needed',
10
+ _a[graph_mail_error_reason_1.GraphMailErrorReason.Throttled] = 'Microsoft Graph is throttling requests',
11
+ _a[graph_mail_error_reason_1.GraphMailErrorReason.Unauthorized] = 'Microsoft Graph refused the app credentials',
12
+ _a);
@@ -0,0 +1,7 @@
1
+ export declare enum GraphMailErrorReason {
2
+ Failed = "failed",
3
+ NotFound = "not-found",
4
+ SyncStateExpired = "sync-state-expired",
5
+ Throttled = "throttled",
6
+ Unauthorized = "unauthorized"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GraphMailErrorReason = void 0;
4
+ var GraphMailErrorReason;
5
+ (function (GraphMailErrorReason) {
6
+ GraphMailErrorReason["Failed"] = "failed";
7
+ GraphMailErrorReason["NotFound"] = "not-found";
8
+ GraphMailErrorReason["SyncStateExpired"] = "sync-state-expired";
9
+ GraphMailErrorReason["Throttled"] = "throttled";
10
+ GraphMailErrorReason["Unauthorized"] = "unauthorized";
11
+ })(GraphMailErrorReason || (exports.GraphMailErrorReason = GraphMailErrorReason = {}));
@@ -0,0 +1,4 @@
1
+ export declare enum GraphMailFolder {
2
+ Inbox = "inbox",
3
+ SentItems = "sentitems"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GraphMailFolder = void 0;
4
+ var GraphMailFolder;
5
+ (function (GraphMailFolder) {
6
+ GraphMailFolder["Inbox"] = "inbox";
7
+ GraphMailFolder["SentItems"] = "sentitems";
8
+ })(GraphMailFolder || (exports.GraphMailFolder = GraphMailFolder = {}));
@@ -0,0 +1,5 @@
1
+ export * from './graph-mail-body-type';
2
+ export * from './graph-mail-config';
3
+ export * from './graph-mail-error-messages';
4
+ export * from './graph-mail-error-reason';
5
+ export * from './graph-mail-folder';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./graph-mail-body-type"), exports);
18
+ __exportStar(require("./graph-mail-config"), exports);
19
+ __exportStar(require("./graph-mail-error-messages"), exports);
20
+ __exportStar(require("./graph-mail-error-reason"), exports);
21
+ __exportStar(require("./graph-mail-folder"), exports);
@@ -0,0 +1,3 @@
1
+ export { GraphMailBodyType, GraphMailErrorReason, GraphMailFolder } from './constants';
2
+ export { GraphMailErrorService, GraphMailService } from './services';
3
+ export type { GraphCredentials, GraphMailBodyData, GraphMailConnection, GraphMailDeltaData, GraphMailDeltaOptions, GraphMailDeltaPageData, GraphMailDraftData, GraphMailErrorData, GraphMailHeaderData, GraphMailMessageData, GraphMailRecipientData, GraphMailRemovedData, GraphMailReplyData, } from './models';
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GraphMailService = exports.GraphMailErrorService = exports.GraphMailFolder = exports.GraphMailErrorReason = exports.GraphMailBodyType = void 0;
4
+ var constants_1 = require("./constants");
5
+ Object.defineProperty(exports, "GraphMailBodyType", { enumerable: true, get: function () { return constants_1.GraphMailBodyType; } });
6
+ Object.defineProperty(exports, "GraphMailErrorReason", { enumerable: true, get: function () { return constants_1.GraphMailErrorReason; } });
7
+ Object.defineProperty(exports, "GraphMailFolder", { enumerable: true, get: function () { return constants_1.GraphMailFolder; } });
8
+ var services_1 = require("./services");
9
+ Object.defineProperty(exports, "GraphMailErrorService", { enumerable: true, get: function () { return services_1.GraphMailErrorService; } });
10
+ Object.defineProperty(exports, "GraphMailService", { enumerable: true, get: function () { return services_1.GraphMailService; } });
@@ -0,0 +1,4 @@
1
+ export interface GraphAccessTokenData {
2
+ value: string;
3
+ expiresAt: number;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export interface GraphCollectionResponse<Item> {
2
+ 'value': Item[];
3
+ '@odata.nextLink'?: string;
4
+ '@odata.deltaLink'?: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export interface GraphCredentials {
2
+ tenantId: string;
3
+ clientId: string;
4
+ clientSecret: string;
5
+ timeoutMs?: number;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface GraphErrorDetailData {
2
+ code?: string;
3
+ message?: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type { GraphErrorDetailData } from './graph-error-detail-data';
2
+ export interface GraphErrorResponse {
3
+ error?: GraphErrorDetailData;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export interface GraphMailAttachmentData {
2
+ 'id': string;
3
+ 'name': string;
4
+ 'contentType': string;
5
+ 'size': number;
6
+ 'isInline': boolean;
7
+ '@odata.type'?: string;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import type { GraphMailBodyType } from '../constants/graph-mail-body-type';
2
+ export interface GraphMailBodyData {
3
+ contentType: GraphMailBodyType;
4
+ content: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export interface GraphMailCategoriesRequest {
2
+ categories: string[];
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type { GraphCredentials } from './graph-credentials';
2
+ export interface GraphMailConnection extends GraphCredentials {
3
+ mailbox: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import type { GraphMailMessageData } from './graph-mail-message-data';
2
+ export interface GraphMailDeltaData {
3
+ messages: GraphMailMessageData[];
4
+ removedIds: string[];
5
+ deltaLink: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface GraphMailDeltaOptions {
2
+ receivedSince?: string;
3
+ pageSize?: number;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import type { GraphMailMessageData } from './graph-mail-message-data';
2
+ export interface GraphMailDeltaPageData {
3
+ messages: GraphMailMessageData[];
4
+ removedIds: string[];
5
+ nextLink: string | null;
6
+ deltaLink: string | null;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import type { MailAddressData } from '../../models/mail-address-data';
2
+ import type { GraphMailBodyData } from './graph-mail-body-data';
3
+ import type { GraphMailHeaderData } from './graph-mail-header-data';
4
+ export interface GraphMailDraftData {
5
+ subject: string;
6
+ body: GraphMailBodyData;
7
+ to: MailAddressData[];
8
+ cc?: MailAddressData[];
9
+ replyTo?: MailAddressData[];
10
+ headers?: GraphMailHeaderData[];
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import type { CodedErrorData } from '@pallasoft/ps-utilities';
2
+ import type { GraphMailErrorReason } from '../constants/graph-mail-error-reason';
3
+ export interface GraphMailErrorData extends CodedErrorData {
4
+ reason: GraphMailErrorReason;
5
+ graphCode: string | null;
6
+ retryAfterSeconds: number | null;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface GraphMailHeaderData {
2
+ name: string;
3
+ value: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,25 @@
1
+ import type { GraphMailBodyData } from './graph-mail-body-data';
2
+ import type { GraphMailHeaderData } from './graph-mail-header-data';
3
+ import type { GraphMailRecipientData } from './graph-mail-recipient-data';
4
+ import type { GraphMailRemovedData } from './graph-mail-removed-data';
5
+ export interface GraphMailMessageData {
6
+ 'id': string;
7
+ 'conversationId'?: string;
8
+ 'internetMessageId'?: string;
9
+ 'subject'?: string;
10
+ 'from'?: GraphMailRecipientData;
11
+ 'sender'?: GraphMailRecipientData;
12
+ 'toRecipients'?: GraphMailRecipientData[];
13
+ 'ccRecipients'?: GraphMailRecipientData[];
14
+ 'replyTo'?: GraphMailRecipientData[];
15
+ 'receivedDateTime'?: string;
16
+ 'sentDateTime'?: string;
17
+ 'hasAttachments'?: boolean;
18
+ 'isDraft'?: boolean;
19
+ 'categories'?: string[];
20
+ 'bodyPreview'?: string;
21
+ 'body'?: GraphMailBodyData;
22
+ 'uniqueBody'?: GraphMailBodyData;
23
+ 'internetMessageHeaders'?: GraphMailHeaderData[];
24
+ '@removed'?: GraphMailRemovedData;
25
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import type { GraphMailBodyData } from './graph-mail-body-data';
2
+ import type { GraphMailHeaderData } from './graph-mail-header-data';
3
+ import type { GraphMailRecipientData } from './graph-mail-recipient-data';
4
+ export interface GraphMailOutgoingMessageData {
5
+ subject?: string;
6
+ body?: GraphMailBodyData;
7
+ toRecipients?: GraphMailRecipientData[];
8
+ ccRecipients?: GraphMailRecipientData[];
9
+ replyTo?: GraphMailRecipientData[];
10
+ internetMessageHeaders?: GraphMailHeaderData[];
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type { MailAddressData } from '../../models/mail-address-data';
2
+ export interface GraphMailRecipientData {
3
+ emailAddress: MailAddressData;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export interface GraphMailRemovedData {
2
+ reason?: string;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import type { MailAddressData } from '../../models/mail-address-data';
2
+ import type { GraphMailBodyData } from './graph-mail-body-data';
3
+ export interface GraphMailReplyData {
4
+ body: GraphMailBodyData;
5
+ subject?: string;
6
+ to?: MailAddressData[];
7
+ cc?: MailAddressData[];
8
+ replyTo?: MailAddressData[];
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type { GraphMailOutgoingMessageData } from './graph-mail-outgoing-message-data';
2
+ export interface GraphMailReplyRequest {
3
+ message: GraphMailOutgoingMessageData;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import type { GraphMailOutgoingMessageData } from './graph-mail-outgoing-message-data';
2
+ export interface GraphMailSendRequest {
3
+ message: GraphMailOutgoingMessageData;
4
+ saveToSentItems: boolean;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });