@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.
- package/LICENSE +32 -0
- package/README.md +33 -0
- package/dist/constants/mail-http-config.d.ts +11 -0
- package/dist/constants/mail-http-config.js +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/microsoft/constants/graph-mail-body-type.d.ts +4 -0
- package/dist/microsoft/constants/graph-mail-body-type.js +8 -0
- package/dist/microsoft/constants/graph-mail-config.d.ts +42 -0
- package/dist/microsoft/constants/graph-mail-config.js +80 -0
- package/dist/microsoft/constants/graph-mail-error-messages.d.ts +2 -0
- package/dist/microsoft/constants/graph-mail-error-messages.js +12 -0
- package/dist/microsoft/constants/graph-mail-error-reason.d.ts +7 -0
- package/dist/microsoft/constants/graph-mail-error-reason.js +11 -0
- package/dist/microsoft/constants/graph-mail-folder.d.ts +4 -0
- package/dist/microsoft/constants/graph-mail-folder.js +8 -0
- package/dist/microsoft/constants/index.d.ts +5 -0
- package/dist/microsoft/constants/index.js +21 -0
- package/dist/microsoft/index.d.ts +3 -0
- package/dist/microsoft/index.js +10 -0
- package/dist/microsoft/models/graph-access-token-data.d.ts +4 -0
- package/dist/microsoft/models/graph-access-token-data.js +2 -0
- package/dist/microsoft/models/graph-collection-response.d.ts +5 -0
- package/dist/microsoft/models/graph-collection-response.js +2 -0
- package/dist/microsoft/models/graph-credentials.d.ts +6 -0
- package/dist/microsoft/models/graph-credentials.js +2 -0
- package/dist/microsoft/models/graph-error-detail-data.d.ts +4 -0
- package/dist/microsoft/models/graph-error-detail-data.js +2 -0
- package/dist/microsoft/models/graph-error-response.d.ts +4 -0
- package/dist/microsoft/models/graph-error-response.js +2 -0
- package/dist/microsoft/models/graph-mail-attachment-data.d.ts +8 -0
- package/dist/microsoft/models/graph-mail-attachment-data.js +2 -0
- package/dist/microsoft/models/graph-mail-body-data.d.ts +5 -0
- package/dist/microsoft/models/graph-mail-body-data.js +2 -0
- package/dist/microsoft/models/graph-mail-categories-request.d.ts +3 -0
- package/dist/microsoft/models/graph-mail-categories-request.js +2 -0
- package/dist/microsoft/models/graph-mail-connection.d.ts +4 -0
- package/dist/microsoft/models/graph-mail-connection.js +2 -0
- package/dist/microsoft/models/graph-mail-delta-data.d.ts +6 -0
- package/dist/microsoft/models/graph-mail-delta-data.js +2 -0
- package/dist/microsoft/models/graph-mail-delta-options.d.ts +4 -0
- package/dist/microsoft/models/graph-mail-delta-options.js +2 -0
- package/dist/microsoft/models/graph-mail-delta-page-data.d.ts +7 -0
- package/dist/microsoft/models/graph-mail-delta-page-data.js +2 -0
- package/dist/microsoft/models/graph-mail-draft-data.d.ts +11 -0
- package/dist/microsoft/models/graph-mail-draft-data.js +2 -0
- package/dist/microsoft/models/graph-mail-error-data.d.ts +7 -0
- package/dist/microsoft/models/graph-mail-error-data.js +2 -0
- package/dist/microsoft/models/graph-mail-header-data.d.ts +4 -0
- package/dist/microsoft/models/graph-mail-header-data.js +2 -0
- package/dist/microsoft/models/graph-mail-message-data.d.ts +25 -0
- package/dist/microsoft/models/graph-mail-message-data.js +2 -0
- package/dist/microsoft/models/graph-mail-outgoing-message-data.d.ts +11 -0
- package/dist/microsoft/models/graph-mail-outgoing-message-data.js +2 -0
- package/dist/microsoft/models/graph-mail-recipient-data.d.ts +4 -0
- package/dist/microsoft/models/graph-mail-recipient-data.js +2 -0
- package/dist/microsoft/models/graph-mail-removed-data.d.ts +3 -0
- package/dist/microsoft/models/graph-mail-removed-data.js +2 -0
- package/dist/microsoft/models/graph-mail-reply-data.d.ts +9 -0
- package/dist/microsoft/models/graph-mail-reply-data.js +2 -0
- package/dist/microsoft/models/graph-mail-reply-request.d.ts +4 -0
- package/dist/microsoft/models/graph-mail-reply-request.js +2 -0
- package/dist/microsoft/models/graph-mail-send-request.d.ts +5 -0
- package/dist/microsoft/models/graph-mail-send-request.js +2 -0
- package/dist/microsoft/models/graph-request-data.d.ts +7 -0
- package/dist/microsoft/models/graph-request-data.js +2 -0
- package/dist/microsoft/models/graph-token-response.d.ts +5 -0
- package/dist/microsoft/models/graph-token-response.js +2 -0
- package/dist/microsoft/models/index.d.ts +24 -0
- package/dist/microsoft/models/index.js +2 -0
- package/dist/microsoft/services/graph-mail-error-service.d.ts +13 -0
- package/dist/microsoft/services/graph-mail-error-service.js +153 -0
- package/dist/microsoft/services/graph-mail-service.d.ts +32 -0
- package/dist/microsoft/services/graph-mail-service.js +352 -0
- package/dist/microsoft/services/graph-request-service.d.ts +11 -0
- package/dist/microsoft/services/graph-request-service.js +206 -0
- package/dist/microsoft/services/graph-token-service.d.ts +10 -0
- package/dist/microsoft/services/graph-token-service.js +137 -0
- package/dist/microsoft/services/index.d.ts +4 -0
- package/dist/microsoft/services/index.js +20 -0
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.js +2 -0
- package/dist/models/mail-address-data.d.ts +4 -0
- package/dist/models/mail-address-data.js +2 -0
- package/dist/models/mail-attachment-content-data.d.ts +4 -0
- package/dist/models/mail-attachment-content-data.js +2 -0
- package/dist/models/mail-attachment-data.d.ts +7 -0
- package/dist/models/mail-attachment-data.js +2 -0
- package/dist/models/mail-query-parameter.d.ts +4 -0
- package/dist/models/mail-query-parameter.js +2 -0
- package/dist/models/mail-sent-data.d.ts +5 -0
- package/dist/models/mail-sent-data.js +2 -0
- package/dist/resend/constants/index.d.ts +2 -0
- package/dist/resend/constants/index.js +18 -0
- package/dist/resend/constants/resend-mail-config.d.ts +24 -0
- package/dist/resend/constants/resend-mail-config.js +27 -0
- package/dist/resend/constants/resend-webhook-config.d.ts +16 -0
- package/dist/resend/constants/resend-webhook-config.js +19 -0
- package/dist/resend/index.d.ts +2 -0
- package/dist/resend/index.js +7 -0
- package/dist/resend/models/index.d.ts +15 -0
- package/dist/resend/models/index.js +2 -0
- package/dist/resend/models/resend-attachment-row.d.ts +9 -0
- package/dist/resend/models/resend-attachment-row.js +2 -0
- package/dist/resend/models/resend-authentication-data.d.ts +5 -0
- package/dist/resend/models/resend-authentication-data.js +2 -0
- package/dist/resend/models/resend-connection.d.ts +5 -0
- package/dist/resend/models/resend-connection.js +2 -0
- package/dist/resend/models/resend-error-response.d.ts +5 -0
- package/dist/resend/models/resend-error-response.js +2 -0
- package/dist/resend/models/resend-list-response.d.ts +3 -0
- package/dist/resend/models/resend-list-response.js +2 -0
- package/dist/resend/models/resend-mail-error-data.d.ts +4 -0
- package/dist/resend/models/resend-mail-error-data.js +2 -0
- package/dist/resend/models/resend-received-attachment-data.d.ts +4 -0
- package/dist/resend/models/resend-received-attachment-data.js +2 -0
- package/dist/resend/models/resend-received-email-data.d.ts +20 -0
- package/dist/resend/models/resend-received-email-data.js +2 -0
- package/dist/resend/models/resend-received-email-row.d.ts +21 -0
- package/dist/resend/models/resend-received-email-row.js +2 -0
- package/dist/resend/models/resend-send-attachment-data.d.ts +6 -0
- package/dist/resend/models/resend-send-attachment-data.js +2 -0
- package/dist/resend/models/resend-send-attachment-request.d.ts +6 -0
- package/dist/resend/models/resend-send-attachment-request.js +2 -0
- package/dist/resend/models/resend-send-data.d.ts +15 -0
- package/dist/resend/models/resend-send-data.js +2 -0
- package/dist/resend/models/resend-send-request.d.ts +13 -0
- package/dist/resend/models/resend-send-request.js +2 -0
- package/dist/resend/models/resend-send-response.d.ts +3 -0
- package/dist/resend/models/resend-send-response.js +2 -0
- package/dist/resend/models/resend-webhook-headers.d.ts +1 -0
- package/dist/resend/models/resend-webhook-headers.js +2 -0
- package/dist/resend/services/index.d.ts +3 -0
- package/dist/resend/services/index.js +19 -0
- package/dist/resend/services/resend-mail-error-service.d.ts +7 -0
- package/dist/resend/services/resend-mail-error-service.js +79 -0
- package/dist/resend/services/resend-mail-service.d.ts +22 -0
- package/dist/resend/services/resend-mail-service.js +322 -0
- package/dist/resend/services/resend-webhook-service.d.ts +10 -0
- package/dist/resend/services/resend-webhook-service.js +139 -0
- package/dist/services/mail-fetch-failure-service.d.ts +3 -0
- package/dist/services/mail-fetch-failure-service.js +49 -0
- package/dist/services/mail-url-service.d.ts +5 -0
- package/dist/services/mail-url-service.js +27 -0
- package/package.json +88 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ResendWebhookService = void 0;
|
|
40
|
+
var ps_utilities_1 = require("@pallasoft/ps-utilities");
|
|
41
|
+
var resend_webhook_config_1 = require("../constants/resend-webhook-config");
|
|
42
|
+
var ResendWebhookService = /** @class */ (function () {
|
|
43
|
+
function ResendWebhookService() {
|
|
44
|
+
}
|
|
45
|
+
ResendWebhookService.verify = function (secret, body, headers) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
+
var id, timestamp, signatures, key, content, checks;
|
|
48
|
+
var _this = this;
|
|
49
|
+
return __generator(this, function (_a) {
|
|
50
|
+
switch (_a.label) {
|
|
51
|
+
case 0:
|
|
52
|
+
id = this._header(headers, resend_webhook_config_1.ResendWebhookConfig.idHeaders);
|
|
53
|
+
timestamp = this._header(headers, resend_webhook_config_1.ResendWebhookConfig.timestampHeaders);
|
|
54
|
+
signatures = this._header(headers, resend_webhook_config_1.ResendWebhookConfig.signatureHeaders);
|
|
55
|
+
if (secret === '' || id === null || timestamp === null || signatures === null)
|
|
56
|
+
return [2 /*return*/, false];
|
|
57
|
+
if (!this._isFresh(timestamp))
|
|
58
|
+
return [2 /*return*/, false];
|
|
59
|
+
return [4 /*yield*/, this._key(secret)];
|
|
60
|
+
case 1:
|
|
61
|
+
key = _a.sent();
|
|
62
|
+
if (key === null)
|
|
63
|
+
return [2 /*return*/, false];
|
|
64
|
+
content = this._textEncoder.encode([id, timestamp, body].join(resend_webhook_config_1.ResendWebhookConfig.signedContentSeparator));
|
|
65
|
+
checks = signatures
|
|
66
|
+
.split(resend_webhook_config_1.ResendWebhookConfig.signatureListSeparator)
|
|
67
|
+
.map(function (entry) { return entry.split(resend_webhook_config_1.ResendWebhookConfig.signatureVersionSeparator); })
|
|
68
|
+
.filter(function (_a) {
|
|
69
|
+
var version = _a[0], signature = _a[1];
|
|
70
|
+
return version === resend_webhook_config_1.ResendWebhookConfig.signatureVersion && typeof signature === 'string';
|
|
71
|
+
})
|
|
72
|
+
.map(function (_a) {
|
|
73
|
+
var signature = _a[1];
|
|
74
|
+
return _this._matches(key, signature, content);
|
|
75
|
+
});
|
|
76
|
+
return [4 /*yield*/, Promise.all(checks)];
|
|
77
|
+
case 2: return [2 /*return*/, (_a.sent()).some(function (matches) { return matches; })];
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
ResendWebhookService._isFresh = function (timestamp) {
|
|
83
|
+
return (resend_webhook_config_1.ResendWebhookConfig.timestampPattern.test(timestamp) &&
|
|
84
|
+
Math.abs(ps_utilities_1.Common.DateService.nowUnixSeconds() - Number(timestamp)) <=
|
|
85
|
+
resend_webhook_config_1.ResendWebhookConfig.toleranceSeconds);
|
|
86
|
+
};
|
|
87
|
+
ResendWebhookService._key = function (secret) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
89
|
+
var _a;
|
|
90
|
+
return __generator(this, function (_b) {
|
|
91
|
+
switch (_b.label) {
|
|
92
|
+
case 0:
|
|
93
|
+
_b.trys.push([0, 2, , 3]);
|
|
94
|
+
return [4 /*yield*/, crypto.subtle.importKey(resend_webhook_config_1.ResendWebhookConfig.keyFormat, ps_utilities_1.Common.Base64Service.decode(secret.startsWith(resend_webhook_config_1.ResendWebhookConfig.secretPrefix)
|
|
95
|
+
? secret.slice(resend_webhook_config_1.ResendWebhookConfig.secretPrefix.length)
|
|
96
|
+
: secret), { name: resend_webhook_config_1.ResendWebhookConfig.hmacAlgorithm, hash: resend_webhook_config_1.ResendWebhookConfig.hmacHash }, false, [resend_webhook_config_1.ResendWebhookConfig.keyUsage])];
|
|
97
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
98
|
+
case 2:
|
|
99
|
+
_a = _b.sent();
|
|
100
|
+
return [2 /*return*/, null];
|
|
101
|
+
case 3: return [2 /*return*/];
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
ResendWebhookService._matches = function (key, signature, content) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
108
|
+
var _a;
|
|
109
|
+
return __generator(this, function (_b) {
|
|
110
|
+
switch (_b.label) {
|
|
111
|
+
case 0:
|
|
112
|
+
_b.trys.push([0, 2, , 3]);
|
|
113
|
+
return [4 /*yield*/, crypto.subtle.verify(resend_webhook_config_1.ResendWebhookConfig.hmacAlgorithm, key, ps_utilities_1.Common.Base64Service.decode(signature), content)];
|
|
114
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
115
|
+
case 2:
|
|
116
|
+
_a = _b.sent();
|
|
117
|
+
return [2 /*return*/, false];
|
|
118
|
+
case 3: return [2 /*return*/];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
ResendWebhookService._header = function (headers, names) {
|
|
124
|
+
for (var _i = 0, names_1 = names; _i < names_1.length; _i++) {
|
|
125
|
+
var name_1 = names_1[_i];
|
|
126
|
+
var value = headers instanceof Headers ? headers.get(name_1) : this._recordHeader(headers, name_1);
|
|
127
|
+
if (typeof value === 'string' && value.trim() !== '')
|
|
128
|
+
return value.trim();
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
};
|
|
132
|
+
ResendWebhookService._recordHeader = function (headers, name) {
|
|
133
|
+
var key = Object.keys(headers).find(function (candidate) { return candidate.toLowerCase() === name; });
|
|
134
|
+
return key === undefined ? null : headers[key];
|
|
135
|
+
};
|
|
136
|
+
ResendWebhookService._textEncoder = new TextEncoder();
|
|
137
|
+
return ResendWebhookService;
|
|
138
|
+
}());
|
|
139
|
+
exports.ResendWebhookService = ResendWebhookService;
|
|
@@ -0,0 +1,49 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.MailFetchFailureService = void 0;
|
|
37
|
+
var Attributes = __importStar(require("@pallasoft/ps-attributes"));
|
|
38
|
+
var mail_http_config_1 = require("../constants/mail-http-config");
|
|
39
|
+
var MailFetchFailureService = /** @class */ (function () {
|
|
40
|
+
function MailFetchFailureService() {
|
|
41
|
+
}
|
|
42
|
+
MailFetchFailureService.status = function (error) {
|
|
43
|
+
return error instanceof Error && error.name === mail_http_config_1.MailHttpConfig.timeoutErrorName
|
|
44
|
+
? Attributes.Common.Response.ErrorCodes.GatewayTimeout
|
|
45
|
+
: Attributes.Common.Response.ErrorCodes.BadGateway;
|
|
46
|
+
};
|
|
47
|
+
return MailFetchFailureService;
|
|
48
|
+
}());
|
|
49
|
+
exports.MailFetchFailureService = MailFetchFailureService;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MailUrlService = void 0;
|
|
4
|
+
var mail_http_config_1 = require("../constants/mail-http-config");
|
|
5
|
+
var MailUrlService = /** @class */ (function () {
|
|
6
|
+
function MailUrlService() {
|
|
7
|
+
}
|
|
8
|
+
MailUrlService.path = function () {
|
|
9
|
+
var segments = [];
|
|
10
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
11
|
+
segments[_i] = arguments[_i];
|
|
12
|
+
}
|
|
13
|
+
return segments.join(mail_http_config_1.MailHttpConfig.pathSeparator);
|
|
14
|
+
};
|
|
15
|
+
MailUrlService.withQuery = function (path, parameters) {
|
|
16
|
+
return "".concat(path).concat(mail_http_config_1.MailHttpConfig.queryStart).concat(parameters
|
|
17
|
+
.map(function (parameter) {
|
|
18
|
+
return [
|
|
19
|
+
parameter.key,
|
|
20
|
+
encodeURIComponent(parameter.value).replace(mail_http_config_1.MailHttpConfig.encodedListSeparator, mail_http_config_1.MailHttpConfig.listSeparator),
|
|
21
|
+
].join(mail_http_config_1.MailHttpConfig.queryAssign);
|
|
22
|
+
})
|
|
23
|
+
.join(mail_http_config_1.MailHttpConfig.queryJoin));
|
|
24
|
+
};
|
|
25
|
+
return MailUrlService;
|
|
26
|
+
}());
|
|
27
|
+
exports.MailUrlService = MailUrlService;
|
package/package.json
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pallasoft/ps-mail",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./microsoft": {
|
|
13
|
+
"types": "./dist/microsoft/index.d.ts",
|
|
14
|
+
"default": "./dist/microsoft/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./resend": {
|
|
17
|
+
"types": "./dist/resend/index.d.ts",
|
|
18
|
+
"default": "./dist/resend/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"typesVersions": {
|
|
23
|
+
"*": {
|
|
24
|
+
"microsoft": [
|
|
25
|
+
"./dist/microsoft/index.d.ts"
|
|
26
|
+
],
|
|
27
|
+
"resend": [
|
|
28
|
+
"./dist/resend/index.d.ts"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/pallasoft/ps-mail.git"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"/dist"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"husky:prepare": "npx husky",
|
|
41
|
+
"build": "tsc",
|
|
42
|
+
"setup:graphify": "sh scripts/graphify-setup.sh",
|
|
43
|
+
"update:graphify": "sh scripts/graphify-update.sh",
|
|
44
|
+
"lint": "npm run lint:eslint",
|
|
45
|
+
"lint:fix": "npm run lint:eslint:fix",
|
|
46
|
+
"format:check": "npx prettier --check --ignore-unknown \"src/**/*.{js,ts,json,md}\"",
|
|
47
|
+
"format:prettier": "npx prettier --write \"**/*.{js,ts,json,md}\"",
|
|
48
|
+
"lint:eslint": "npx eslint \"**/*.{js,ts}\"",
|
|
49
|
+
"lint:eslint:fix": "npx eslint --fix \"**/*.{js,ts}\"",
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"release": "semantic-release"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@commitlint/cli": "^20.1.0",
|
|
55
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
56
|
+
"@eslint/compat": "^2.0.0",
|
|
57
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
|
|
58
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
59
|
+
"@semantic-release/commit-analyzer": "^13.0.0",
|
|
60
|
+
"@semantic-release/git": "^10.0.1",
|
|
61
|
+
"@semantic-release/github": "^11.0.1",
|
|
62
|
+
"@semantic-release/npm": "^12.0.0",
|
|
63
|
+
"@semantic-release/release-notes-generator": "^14.0.1",
|
|
64
|
+
"@typescript-eslint/eslint-plugin": "^8.48.0",
|
|
65
|
+
"@typescript-eslint/parser": "^8.48.0",
|
|
66
|
+
"commitlint": "^20.1.0",
|
|
67
|
+
"conventional-changelog-conventionalcommits": "^7.0.2",
|
|
68
|
+
"eslint": "^9.39.1",
|
|
69
|
+
"eslint-config-prettier": "^10.1.8",
|
|
70
|
+
"eslint-plugin-import": "^2.32.0",
|
|
71
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
72
|
+
"husky": "^9.1.7",
|
|
73
|
+
"lint-staged": "^16.2.7",
|
|
74
|
+
"prettier": "^3.6.2",
|
|
75
|
+
"semantic-release": "^24.2.0",
|
|
76
|
+
"ts-node": "^10.9.2",
|
|
77
|
+
"typescript": "^5.9.3",
|
|
78
|
+
"vitest": "^5.0.0"
|
|
79
|
+
},
|
|
80
|
+
"dependencies": {
|
|
81
|
+
"@pallasoft/ps-attributes": "^1.3.0",
|
|
82
|
+
"@pallasoft/ps-utilities": "^2.16.0"
|
|
83
|
+
},
|
|
84
|
+
"publishConfig": {
|
|
85
|
+
"access": "public",
|
|
86
|
+
"registry": "https://registry.npmjs.org/"
|
|
87
|
+
}
|
|
88
|
+
}
|