@ariary/notification 1.0.1 → 1.0.3
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/README.md +30 -47
- package/dist/index.d.mts +43 -15
- package/dist/index.d.ts +43 -15
- package/dist/index.js +83 -225
- package/dist/index.mjs +83 -208
- package/package.json +49 -68
- package/dist/client-BOI4a9h5.d.mts +0 -40
- package/dist/client-BOI4a9h5.d.ts +0 -40
- package/dist/notif-task/index.d.mts +0 -59
- package/dist/notif-task/index.d.ts +0 -59
- package/dist/notif-task/index.js +0 -88
- package/dist/notif-task/index.mjs +0 -61
- package/dist/sms/index.d.mts +0 -62
- package/dist/sms/index.d.ts +0 -62
- package/dist/sms/index.js +0 -64
- package/dist/sms/index.mjs +0 -37
package/dist/notif-task/index.js
DELETED
|
@@ -1,88 +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/notif-task/index.ts
|
|
21
|
-
var notif_task_exports = {};
|
|
22
|
-
__export(notif_task_exports, {
|
|
23
|
-
NotifTaskService: () => NotifTaskService
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(notif_task_exports);
|
|
26
|
-
|
|
27
|
-
// src/notif-task.ts
|
|
28
|
-
var NotifTaskService = class {
|
|
29
|
-
constructor(client) {
|
|
30
|
-
this.client = client;
|
|
31
|
-
}
|
|
32
|
-
async create(createNotifTaskDto) {
|
|
33
|
-
const response = await this.client.post(
|
|
34
|
-
"/api/notif-task",
|
|
35
|
-
createNotifTaskDto,
|
|
36
|
-
true
|
|
37
|
-
);
|
|
38
|
-
return response;
|
|
39
|
-
}
|
|
40
|
-
async findAll(projectId) {
|
|
41
|
-
const response = await this.client.get(
|
|
42
|
-
`/api/notif-task?projectId=${projectId}`,
|
|
43
|
-
true
|
|
44
|
-
);
|
|
45
|
-
return response;
|
|
46
|
-
}
|
|
47
|
-
async findOne(id) {
|
|
48
|
-
const response = await this.client.get(
|
|
49
|
-
`/api/notif-task/${id}`,
|
|
50
|
-
true
|
|
51
|
-
);
|
|
52
|
-
return response;
|
|
53
|
-
}
|
|
54
|
-
async update(id, updateNotifTaskDto) {
|
|
55
|
-
const response = await this.client.patch(
|
|
56
|
-
`/api/notif-task/${id}`,
|
|
57
|
-
updateNotifTaskDto,
|
|
58
|
-
true
|
|
59
|
-
);
|
|
60
|
-
return response;
|
|
61
|
-
}
|
|
62
|
-
async remove(id) {
|
|
63
|
-
const response = await this.client.delete(
|
|
64
|
-
`/api/notif-task/${id}`,
|
|
65
|
-
true
|
|
66
|
-
);
|
|
67
|
-
return response;
|
|
68
|
-
}
|
|
69
|
-
async getSmsDetails(id) {
|
|
70
|
-
const response = await this.client.get(
|
|
71
|
-
`/api/notif-task/${id}/sms-details`,
|
|
72
|
-
true
|
|
73
|
-
);
|
|
74
|
-
return response;
|
|
75
|
-
}
|
|
76
|
-
async retryFailedSms(id) {
|
|
77
|
-
const response = await this.client.post(
|
|
78
|
-
`/api/notif-task/${id}/retry-failed-sms`,
|
|
79
|
-
{},
|
|
80
|
-
true
|
|
81
|
-
);
|
|
82
|
-
return response;
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
86
|
-
0 && (module.exports = {
|
|
87
|
-
NotifTaskService
|
|
88
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// src/notif-task.ts
|
|
2
|
-
var NotifTaskService = class {
|
|
3
|
-
constructor(client) {
|
|
4
|
-
this.client = client;
|
|
5
|
-
}
|
|
6
|
-
async create(createNotifTaskDto) {
|
|
7
|
-
const response = await this.client.post(
|
|
8
|
-
"/api/notif-task",
|
|
9
|
-
createNotifTaskDto,
|
|
10
|
-
true
|
|
11
|
-
);
|
|
12
|
-
return response;
|
|
13
|
-
}
|
|
14
|
-
async findAll(projectId) {
|
|
15
|
-
const response = await this.client.get(
|
|
16
|
-
`/api/notif-task?projectId=${projectId}`,
|
|
17
|
-
true
|
|
18
|
-
);
|
|
19
|
-
return response;
|
|
20
|
-
}
|
|
21
|
-
async findOne(id) {
|
|
22
|
-
const response = await this.client.get(
|
|
23
|
-
`/api/notif-task/${id}`,
|
|
24
|
-
true
|
|
25
|
-
);
|
|
26
|
-
return response;
|
|
27
|
-
}
|
|
28
|
-
async update(id, updateNotifTaskDto) {
|
|
29
|
-
const response = await this.client.patch(
|
|
30
|
-
`/api/notif-task/${id}`,
|
|
31
|
-
updateNotifTaskDto,
|
|
32
|
-
true
|
|
33
|
-
);
|
|
34
|
-
return response;
|
|
35
|
-
}
|
|
36
|
-
async remove(id) {
|
|
37
|
-
const response = await this.client.delete(
|
|
38
|
-
`/api/notif-task/${id}`,
|
|
39
|
-
true
|
|
40
|
-
);
|
|
41
|
-
return response;
|
|
42
|
-
}
|
|
43
|
-
async getSmsDetails(id) {
|
|
44
|
-
const response = await this.client.get(
|
|
45
|
-
`/api/notif-task/${id}/sms-details`,
|
|
46
|
-
true
|
|
47
|
-
);
|
|
48
|
-
return response;
|
|
49
|
-
}
|
|
50
|
-
async retryFailedSms(id) {
|
|
51
|
-
const response = await this.client.post(
|
|
52
|
-
`/api/notif-task/${id}/retry-failed-sms`,
|
|
53
|
-
{},
|
|
54
|
-
true
|
|
55
|
-
);
|
|
56
|
-
return response;
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
export {
|
|
60
|
-
NotifTaskService
|
|
61
|
-
};
|
package/dist/sms/index.d.mts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { a as ApiClient } from '../client-BOI4a9h5.mjs';
|
|
2
|
-
|
|
3
|
-
interface CreateSmsDto {
|
|
4
|
-
message: string;
|
|
5
|
-
phone: string;
|
|
6
|
-
}
|
|
7
|
-
interface SendSmsDto {
|
|
8
|
-
message: string;
|
|
9
|
-
phones: string[];
|
|
10
|
-
}
|
|
11
|
-
interface BulkSmsDto {
|
|
12
|
-
messages: {
|
|
13
|
-
phones: string[];
|
|
14
|
-
message: string;
|
|
15
|
-
}[];
|
|
16
|
-
}
|
|
17
|
-
interface SendSmsResponseDto {
|
|
18
|
-
id: string;
|
|
19
|
-
message: string;
|
|
20
|
-
phone: string;
|
|
21
|
-
status: string;
|
|
22
|
-
createdAt: string;
|
|
23
|
-
}
|
|
24
|
-
interface ResponseSmsDto {
|
|
25
|
-
id: string;
|
|
26
|
-
message: string;
|
|
27
|
-
phone: string;
|
|
28
|
-
status: string;
|
|
29
|
-
createdAt: string;
|
|
30
|
-
updatedAt: string;
|
|
31
|
-
}
|
|
32
|
-
interface MultiSmsResponseDto {
|
|
33
|
-
status: string;
|
|
34
|
-
data: {
|
|
35
|
-
id: string;
|
|
36
|
-
message: string;
|
|
37
|
-
phone: string;
|
|
38
|
-
status: string;
|
|
39
|
-
}[];
|
|
40
|
-
}
|
|
41
|
-
interface BulkSmsResponseDto {
|
|
42
|
-
status: string;
|
|
43
|
-
data: {
|
|
44
|
-
id: string;
|
|
45
|
-
message: string;
|
|
46
|
-
phone: string;
|
|
47
|
-
status: string;
|
|
48
|
-
}[];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
declare class SmsService {
|
|
52
|
-
private client;
|
|
53
|
-
constructor(client: ApiClient);
|
|
54
|
-
notify(message: string, numbers: string | string[]): Promise<MultiSmsResponseDto>;
|
|
55
|
-
notifyBulk(messages: {
|
|
56
|
-
message: string;
|
|
57
|
-
numbers: string | string[];
|
|
58
|
-
}[]): Promise<BulkSmsResponseDto>;
|
|
59
|
-
getAll(): Promise<ResponseSmsDto[]>;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export { type BulkSmsDto, type BulkSmsResponseDto, type CreateSmsDto, type MultiSmsResponseDto, type ResponseSmsDto, type SendSmsDto, type SendSmsResponseDto, SmsService };
|
package/dist/sms/index.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { a as ApiClient } from '../client-BOI4a9h5.js';
|
|
2
|
-
|
|
3
|
-
interface CreateSmsDto {
|
|
4
|
-
message: string;
|
|
5
|
-
phone: string;
|
|
6
|
-
}
|
|
7
|
-
interface SendSmsDto {
|
|
8
|
-
message: string;
|
|
9
|
-
phones: string[];
|
|
10
|
-
}
|
|
11
|
-
interface BulkSmsDto {
|
|
12
|
-
messages: {
|
|
13
|
-
phones: string[];
|
|
14
|
-
message: string;
|
|
15
|
-
}[];
|
|
16
|
-
}
|
|
17
|
-
interface SendSmsResponseDto {
|
|
18
|
-
id: string;
|
|
19
|
-
message: string;
|
|
20
|
-
phone: string;
|
|
21
|
-
status: string;
|
|
22
|
-
createdAt: string;
|
|
23
|
-
}
|
|
24
|
-
interface ResponseSmsDto {
|
|
25
|
-
id: string;
|
|
26
|
-
message: string;
|
|
27
|
-
phone: string;
|
|
28
|
-
status: string;
|
|
29
|
-
createdAt: string;
|
|
30
|
-
updatedAt: string;
|
|
31
|
-
}
|
|
32
|
-
interface MultiSmsResponseDto {
|
|
33
|
-
status: string;
|
|
34
|
-
data: {
|
|
35
|
-
id: string;
|
|
36
|
-
message: string;
|
|
37
|
-
phone: string;
|
|
38
|
-
status: string;
|
|
39
|
-
}[];
|
|
40
|
-
}
|
|
41
|
-
interface BulkSmsResponseDto {
|
|
42
|
-
status: string;
|
|
43
|
-
data: {
|
|
44
|
-
id: string;
|
|
45
|
-
message: string;
|
|
46
|
-
phone: string;
|
|
47
|
-
status: string;
|
|
48
|
-
}[];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
declare class SmsService {
|
|
52
|
-
private client;
|
|
53
|
-
constructor(client: ApiClient);
|
|
54
|
-
notify(message: string, numbers: string | string[]): Promise<MultiSmsResponseDto>;
|
|
55
|
-
notifyBulk(messages: {
|
|
56
|
-
message: string;
|
|
57
|
-
numbers: string | string[];
|
|
58
|
-
}[]): Promise<BulkSmsResponseDto>;
|
|
59
|
-
getAll(): Promise<ResponseSmsDto[]>;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export { type BulkSmsDto, type BulkSmsResponseDto, type CreateSmsDto, type MultiSmsResponseDto, type ResponseSmsDto, type SendSmsDto, type SendSmsResponseDto, SmsService };
|
package/dist/sms/index.js
DELETED
|
@@ -1,64 +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/sms/index.ts
|
|
21
|
-
var sms_exports = {};
|
|
22
|
-
__export(sms_exports, {
|
|
23
|
-
SmsService: () => SmsService
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(sms_exports);
|
|
26
|
-
|
|
27
|
-
// src/sms.ts
|
|
28
|
-
var SmsService = class {
|
|
29
|
-
constructor(client) {
|
|
30
|
-
this.client = client;
|
|
31
|
-
}
|
|
32
|
-
async notify(message, numbers) {
|
|
33
|
-
const phones = Array.isArray(numbers) ? numbers : [numbers];
|
|
34
|
-
const response = await this.client.post(
|
|
35
|
-
"/api/sms/multi",
|
|
36
|
-
{ phones, message },
|
|
37
|
-
true
|
|
38
|
-
);
|
|
39
|
-
return response;
|
|
40
|
-
}
|
|
41
|
-
async notifyBulk(messages) {
|
|
42
|
-
const bulkMessages = messages.map((item) => ({
|
|
43
|
-
message: item.message,
|
|
44
|
-
phones: Array.isArray(item.numbers) ? item.numbers : [item.numbers]
|
|
45
|
-
}));
|
|
46
|
-
const response = await this.client.post(
|
|
47
|
-
"/api/sms/bulk",
|
|
48
|
-
{ messages: bulkMessages },
|
|
49
|
-
true
|
|
50
|
-
);
|
|
51
|
-
return response;
|
|
52
|
-
}
|
|
53
|
-
async getAll() {
|
|
54
|
-
const response = await this.client.get(
|
|
55
|
-
"/api/sms",
|
|
56
|
-
true
|
|
57
|
-
);
|
|
58
|
-
return response;
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
-
0 && (module.exports = {
|
|
63
|
-
SmsService
|
|
64
|
-
});
|
package/dist/sms/index.mjs
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// src/sms.ts
|
|
2
|
-
var SmsService = class {
|
|
3
|
-
constructor(client) {
|
|
4
|
-
this.client = client;
|
|
5
|
-
}
|
|
6
|
-
async notify(message, numbers) {
|
|
7
|
-
const phones = Array.isArray(numbers) ? numbers : [numbers];
|
|
8
|
-
const response = await this.client.post(
|
|
9
|
-
"/api/sms/multi",
|
|
10
|
-
{ phones, message },
|
|
11
|
-
true
|
|
12
|
-
);
|
|
13
|
-
return response;
|
|
14
|
-
}
|
|
15
|
-
async notifyBulk(messages) {
|
|
16
|
-
const bulkMessages = messages.map((item) => ({
|
|
17
|
-
message: item.message,
|
|
18
|
-
phones: Array.isArray(item.numbers) ? item.numbers : [item.numbers]
|
|
19
|
-
}));
|
|
20
|
-
const response = await this.client.post(
|
|
21
|
-
"/api/sms/bulk",
|
|
22
|
-
{ messages: bulkMessages },
|
|
23
|
-
true
|
|
24
|
-
);
|
|
25
|
-
return response;
|
|
26
|
-
}
|
|
27
|
-
async getAll() {
|
|
28
|
-
const response = await this.client.get(
|
|
29
|
-
"/api/sms",
|
|
30
|
-
true
|
|
31
|
-
);
|
|
32
|
-
return response;
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
SmsService
|
|
37
|
-
};
|