@vulog/aima-notifier 1.2.30 → 1.2.31
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/dist/index.cjs +16 -0
- package/dist/index.d.cts +15 -0
- package/dist/index.d.mts +9 -8
- package/dist/index.mjs +12 -17
- package/package.json +20 -7
- package/src/index.ts +2 -1
- package/{tsup.config.ts → tsdown.config.ts} +1 -1
- package/dist/index.d.ts +0 -14
- package/dist/index.js +0 -47
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
//#region src/sendEmail.ts
|
|
4
|
+
const sendEmailParamSchema = zod.z.object({
|
|
5
|
+
bodyData: zod.z.record(zod.z.string(), zod.z.any()),
|
|
6
|
+
lang: zod.z.string(),
|
|
7
|
+
to: zod.z.array(zod.z.string().email()),
|
|
8
|
+
type: zod.z.string()
|
|
9
|
+
});
|
|
10
|
+
const sendEmail = async (client, data) => {
|
|
11
|
+
const resultData = sendEmailParamSchema.safeParse(data);
|
|
12
|
+
if (!resultData.success) throw new TypeError("Invalid data", { cause: resultData.error.issues });
|
|
13
|
+
await client.post(`/boapi/proxy/notifier/fleets/${client.clientOptions.fleetId}/email/send`, resultData.data);
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.sendEmail = sendEmail;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Client } from "@vulog/aima-client";
|
|
2
|
+
|
|
3
|
+
//#region src/sendEmail.d.ts
|
|
4
|
+
type SendEmailData = {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
type SendEmailParam = {
|
|
8
|
+
bodyData: SendEmailData;
|
|
9
|
+
lang: string;
|
|
10
|
+
to: string[];
|
|
11
|
+
type: string;
|
|
12
|
+
};
|
|
13
|
+
declare const sendEmail: (client: Client, data: SendEmailParam) => Promise<void>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { type SendEmailData, type SendEmailParam, sendEmail };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { Client } from
|
|
1
|
+
import { Client } from "@vulog/aima-client";
|
|
2
2
|
|
|
3
|
+
//#region src/sendEmail.d.ts
|
|
3
4
|
type SendEmailData = {
|
|
4
|
-
|
|
5
|
+
[key: string]: any;
|
|
5
6
|
};
|
|
6
7
|
type SendEmailParam = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
bodyData: SendEmailData;
|
|
9
|
+
lang: string;
|
|
10
|
+
to: string[];
|
|
11
|
+
type: string;
|
|
11
12
|
};
|
|
12
13
|
declare const sendEmail: (client: Client, data: SendEmailParam) => Promise<void>;
|
|
13
|
-
|
|
14
|
-
export { type SendEmailData, type SendEmailParam, sendEmail };
|
|
14
|
+
//#endregion
|
|
15
|
+
export { type SendEmailData, type SendEmailParam, sendEmail };
|
package/dist/index.mjs
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
// src/sendEmail.ts
|
|
2
1
|
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
//#region src/sendEmail.ts
|
|
3
|
+
const sendEmailParamSchema = z.object({
|
|
4
|
+
bodyData: z.record(z.string(), z.any()),
|
|
5
|
+
lang: z.string(),
|
|
6
|
+
to: z.array(z.string().email()),
|
|
7
|
+
type: z.string()
|
|
8
8
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
cause: resultData.error.issues
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
await client.post(`/boapi/proxy/notifier/fleets/${client.clientOptions.fleetId}/email/send`, resultData.data);
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
sendEmail
|
|
9
|
+
const sendEmail = async (client, data) => {
|
|
10
|
+
const resultData = sendEmailParamSchema.safeParse(data);
|
|
11
|
+
if (!resultData.success) throw new TypeError("Invalid data", { cause: resultData.error.issues });
|
|
12
|
+
await client.post(`/boapi/proxy/notifier/fleets/${client.clientOptions.fleetId}/email/send`, resultData.data);
|
|
20
13
|
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { sendEmail };
|
package/package.json
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulog/aima-notifier",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.2.31",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
5
6
|
"module": "dist/index.mjs",
|
|
6
|
-
"types": "dist/index.d.
|
|
7
|
+
"types": "dist/index.d.cts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./dist/index.d.mts",
|
|
12
|
+
"default": "./dist/index.mjs"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./dist/index.d.cts",
|
|
16
|
+
"default": "./dist/index.cjs"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
7
20
|
"scripts": {
|
|
8
|
-
"build": "
|
|
9
|
-
"dev": "
|
|
21
|
+
"build": "tsdown",
|
|
22
|
+
"dev": "tsdown --watch",
|
|
10
23
|
"test": "vitest run",
|
|
11
24
|
"test:watch": "vitest",
|
|
12
25
|
"lint": "eslint src/**/* --ext .ts"
|
|
@@ -19,8 +32,8 @@
|
|
|
19
32
|
"author": "Vulog",
|
|
20
33
|
"license": "MIT",
|
|
21
34
|
"dependencies": {
|
|
22
|
-
"@vulog/aima-client": "1.2.
|
|
23
|
-
"@vulog/aima-core": "1.2.
|
|
35
|
+
"@vulog/aima-client": "1.2.31",
|
|
36
|
+
"@vulog/aima-core": "1.2.31"
|
|
24
37
|
},
|
|
25
38
|
"peerDependencies": {
|
|
26
39
|
"zod": "^3.25.76"
|
package/src/index.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { SendEmailData, SendEmailParam
|
|
1
|
+
export type { SendEmailData, SendEmailParam } from './sendEmail';
|
|
2
|
+
export { sendEmail } from './sendEmail';
|
package/dist/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Client } from '@vulog/aima-client';
|
|
2
|
-
|
|
3
|
-
type SendEmailData = {
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
};
|
|
6
|
-
type SendEmailParam = {
|
|
7
|
-
bodyData: SendEmailData;
|
|
8
|
-
lang: string;
|
|
9
|
-
to: string[];
|
|
10
|
-
type: string;
|
|
11
|
-
};
|
|
12
|
-
declare const sendEmail: (client: Client, data: SendEmailParam) => Promise<void>;
|
|
13
|
-
|
|
14
|
-
export { type SendEmailData, type SendEmailParam, sendEmail };
|
package/dist/index.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
sendEmail: () => sendEmail
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(index_exports);
|
|
26
|
-
|
|
27
|
-
// src/sendEmail.ts
|
|
28
|
-
var import_zod = require("zod");
|
|
29
|
-
var sendEmailParamSchema = import_zod.z.object({
|
|
30
|
-
bodyData: import_zod.z.record(import_zod.z.string(), import_zod.z.any()),
|
|
31
|
-
lang: import_zod.z.string(),
|
|
32
|
-
to: import_zod.z.array(import_zod.z.string().email()),
|
|
33
|
-
type: import_zod.z.string()
|
|
34
|
-
});
|
|
35
|
-
var sendEmail = async (client, data) => {
|
|
36
|
-
const resultData = sendEmailParamSchema.safeParse(data);
|
|
37
|
-
if (!resultData.success) {
|
|
38
|
-
throw new TypeError("Invalid data", {
|
|
39
|
-
cause: resultData.error.issues
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
await client.post(`/boapi/proxy/notifier/fleets/${client.clientOptions.fleetId}/email/send`, resultData.data);
|
|
43
|
-
};
|
|
44
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
-
0 && (module.exports = {
|
|
46
|
-
sendEmail
|
|
47
|
-
});
|
|
File without changes
|