@salespark/mailerlite-api 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/README.md +208 -0
- package/dist/@types/debug.log +2 -0
- package/dist/@types/index.d.ts +275 -0
- package/dist/api/account.d.ts +7 -0
- package/dist/api/account.js +76 -0
- package/dist/api/batch.d.ts +5 -0
- package/dist/api/batch.js +55 -0
- package/dist/api/campaigns.d.ts +10 -0
- package/dist/api/campaigns.js +120 -0
- package/dist/api/fields.d.ts +8 -0
- package/dist/api/fields.js +83 -0
- package/dist/api/groups.d.ts +37 -0
- package/dist/api/groups.js +214 -0
- package/dist/api/segments.d.ts +7 -0
- package/dist/api/segments.js +82 -0
- package/dist/api/settings.d.ts +9 -0
- package/dist/api/settings.js +98 -0
- package/dist/api/stats.d.ts +5 -0
- package/dist/api/stats.js +53 -0
- package/dist/api/subscribers.d.ts +13 -0
- package/dist/api/subscribers.js +141 -0
- package/dist/api/timezones.d.ts +6 -0
- package/dist/api/timezones.js +67 -0
- package/dist/api/webhooks.d.ts +11 -0
- package/dist/api/webhooks.js +119 -0
- package/dist/client.d.ts +3 -0
- package/dist/client.js +88 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +34 -0
- package/package.json +61 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Options } from './@types';
|
|
2
|
+
export default function MailerLite(apiKey: string, options?: Options): {
|
|
3
|
+
getWebhooks(): Promise<any[]>;
|
|
4
|
+
getWebhooksCount(): Promise<number>;
|
|
5
|
+
getWebhooksRaw(): Promise<import("./@types").WebhooksResponse>;
|
|
6
|
+
getWebhook(webhookId: number): Promise<import("axios").AxiosResponse<any, any>>;
|
|
7
|
+
createWebhook(webhook: import("./@types").WebhookData): Promise<import("axios").AxiosResponse<any, any>>;
|
|
8
|
+
updateWebhook(webhookId: number, webhook: import("./@types").WebhookData): Promise<import("axios").AxiosResponse<any, any>>;
|
|
9
|
+
removeWebhook(webhookId: number): Promise<import("axios").AxiosResponse<any, any>>;
|
|
10
|
+
getTimezones(): Promise<import("./@types").Timezone>;
|
|
11
|
+
getTimezone(timezoneId: number): Promise<import("./@types").Timezone>;
|
|
12
|
+
getSubscribers(params?: import("./@types").SubscriberQuery): Promise<import("axios").AxiosResponse<any, any>>;
|
|
13
|
+
addSubscriber(subscriber: import("./@types").SubscriberData): Promise<import("axios").AxiosResponse<any, any>>;
|
|
14
|
+
getSubscriber(identifier: number | string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
15
|
+
updateSubscriber(identifier: number | string, subscriber: import("./@types").SubscriberDataUpdate): Promise<import("axios").AxiosResponse<any, any>>;
|
|
16
|
+
searchSubscribers(params?: import("./@types").SubscriberSearchQuery): Promise<import("axios").AxiosResponse<any, any>>;
|
|
17
|
+
getSubscriberActivity(identifier: number | string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
18
|
+
getSubscriberActivityByType(identifier: number | string, activityType: import("./@types").SubscriberActivityType): Promise<import("axios").AxiosResponse<any, any>>;
|
|
19
|
+
getSubscriberGroups(identifier: number | string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
20
|
+
removeSubscriber(identifier: number | string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
21
|
+
getStats(): Promise<import("./@types").Stats>;
|
|
22
|
+
getDoubleOptinStatus(): Promise<import("./@types").DoubleOptinStatus>;
|
|
23
|
+
hasEnabledDoubleOptin(): Promise<boolean>;
|
|
24
|
+
setDoubleOptin(isEnabled: boolean): Promise<import("./@types").DoubleOptinStatus>;
|
|
25
|
+
enableDoubleOptin(): Promise<import("./@types").DoubleOptinStatus>;
|
|
26
|
+
disableDoubleOptin(): Promise<import("./@types").DoubleOptinStatus>;
|
|
27
|
+
getSegments(params?: import("./@types").SegmentQuery): Promise<any[]>;
|
|
28
|
+
getSegmentsCount(params?: import("./@types").SegmentQuery): Promise<number>;
|
|
29
|
+
getSegmentsRaw(params?: import("./@types").SegmentQuery): Promise<import("./@types").SegmentsResponse>;
|
|
30
|
+
getGroups(params?: import("./@types").GroupQuery): Promise<import("./api/groups").MailerLiteGroup[]>;
|
|
31
|
+
searchGroups(groupName: import("./@types").GroupSearchQuery["group_name"]): Promise<import("./api/groups").MailerLiteGroup[]>;
|
|
32
|
+
getGroup(groupId: number): Promise<import("./api/groups").MailerLiteGroup>;
|
|
33
|
+
createGroup(group: import("./@types").GroupData): Promise<import("./api/groups").MailerLiteGroup>;
|
|
34
|
+
updateGroup(groupId: number, groupUpdate: import("./@types").GroupData): Promise<import("axios").AxiosResponse<any, any>>;
|
|
35
|
+
removeGroup(groupId: number): Promise<{
|
|
36
|
+
success: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
addSubscriberToGroup(groupId: number, subscriber: import("./@types").GroupSubscriberData): Promise<import("axios").AxiosResponse<any, any>>;
|
|
39
|
+
addSubscribersToGroup(groupId: number, subscribers: import("./@types").GroupSubscriberData[], importOptions?: import("./@types").GroupSubscriberFlags): Promise<import("axios").AxiosResponse<any, any>>;
|
|
40
|
+
getSubscribersGroupImport(groupId: number, importId: number): Promise<import("axios").AxiosResponse<any, any>>;
|
|
41
|
+
getGroupSubscriber(groupId: number, subscriberId: number): Promise<import("axios").AxiosResponse<any, any>>;
|
|
42
|
+
getGroupSubscribers(groupId: number, params?: import("./@types").SubscriberGroupQuery): Promise<import("axios").AxiosResponse<any, any>>;
|
|
43
|
+
getGroupSubscriberCount(groupId: number): Promise<number>;
|
|
44
|
+
getGroupSubscribersByType(groupId: number, subscriberType: import("./@types").SubscriberType, params?: import("./@types").GroupQuery): Promise<import("axios").AxiosResponse<any, any>>;
|
|
45
|
+
getGroupSubscribersCountByType(groupId: number, subscriberType: import("./@types").SubscriberType): Promise<number>;
|
|
46
|
+
removeGroupSubscriber(groupId: number, subscriberIdentifier: number | string): Promise<string>;
|
|
47
|
+
getFields(): Promise<import("axios").AxiosResponse<any, any>>;
|
|
48
|
+
createField(field: import("./@types").FieldData): Promise<import("axios").AxiosResponse<any, any>>;
|
|
49
|
+
updateField(fieldId: number, fieldUpdate: import("./@types").FieldUpdate): Promise<import("axios").AxiosResponse<any, any>>;
|
|
50
|
+
removeField(fieldId: number): Promise<import("axios").AxiosResponse<any, any>>;
|
|
51
|
+
actOnCampaign(campaignId: number, action: import("./@types").CampaignAction, data?: import("./@types").CampaignSendData): Promise<import("axios").AxiosResponse<any, any>>;
|
|
52
|
+
getCampaigns(status?: import("./@types").CampaignStatus, params?: import("./@types").CampaignQuery): Promise<import("axios").AxiosResponse<any, any>>;
|
|
53
|
+
getCampaignCount(status?: import("./@types").CampaignStatus): Promise<number>;
|
|
54
|
+
createCampaign(campaign: import("./@types").CampaignData): Promise<import("axios").AxiosResponse<any, any>>;
|
|
55
|
+
removeCampaign(campaignId: number): Promise<import("axios").AxiosResponse<any, any>>;
|
|
56
|
+
setCampaignContent(campaignId: number, content: import("./@types").CampaignContent): Promise<import("axios").AxiosResponse<any, any>>;
|
|
57
|
+
batch(requests: import("./@types").Batch[]): Promise<any[]>;
|
|
58
|
+
getAccountRaw(): Promise<import("./@types").AccountWrap>;
|
|
59
|
+
getAccount(): Promise<import("./@types").Account>;
|
|
60
|
+
getMe(): Promise<import("./@types").Account>;
|
|
61
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.default = MailerLite;
|
|
18
|
+
var client_1 = __importDefault(require("./client"));
|
|
19
|
+
var account_1 = __importDefault(require("./api/account"));
|
|
20
|
+
var batch_1 = __importDefault(require("./api/batch"));
|
|
21
|
+
var campaigns_1 = __importDefault(require("./api/campaigns"));
|
|
22
|
+
var fields_1 = __importDefault(require("./api/fields"));
|
|
23
|
+
var groups_1 = __importDefault(require("./api/groups"));
|
|
24
|
+
var segments_1 = __importDefault(require("./api/segments"));
|
|
25
|
+
var settings_1 = __importDefault(require("./api/settings"));
|
|
26
|
+
var stats_1 = __importDefault(require("./api/stats"));
|
|
27
|
+
var subscribers_1 = __importDefault(require("./api/subscribers"));
|
|
28
|
+
var timezones_1 = __importDefault(require("./api/timezones"));
|
|
29
|
+
var webhooks_1 = __importDefault(require("./api/webhooks"));
|
|
30
|
+
function MailerLite(apiKey, options) {
|
|
31
|
+
if (options === void 0) { options = {}; }
|
|
32
|
+
var client = (0, client_1.default)(apiKey, options);
|
|
33
|
+
return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (0, account_1.default)(client)), (0, batch_1.default)(client)), (0, campaigns_1.default)(client)), (0, fields_1.default)(client)), (0, groups_1.default)(client)), (0, segments_1.default)(client)), (0, settings_1.default)(client)), (0, stats_1.default)(client)), (0, subscribers_1.default)(client)), (0, timezones_1.default)(client)), (0, webhooks_1.default)(client));
|
|
34
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@salespark/mailerlite-api",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "npx jest --config jest.config.js",
|
|
8
|
+
"test:watch": "npx jest --config jest.config.js --watch",
|
|
9
|
+
"lint": "npx eslint ./src --ext .ts,.tsx",
|
|
10
|
+
"lint:fix": "npx eslint ./src --fix --ext .ts,.tsx",
|
|
11
|
+
"build": "tsc && cp -r src/@types dist",
|
|
12
|
+
"prepare": "npm run build"
|
|
13
|
+
},
|
|
14
|
+
"author": "SalesPark",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"axios": "^1.10.0",
|
|
18
|
+
"camelcase-keys": "^9.1.3",
|
|
19
|
+
"snakecase-keys": "^8.0.1"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/jest": "^30.0.0",
|
|
23
|
+
"@types/node": "^24.0.6",
|
|
24
|
+
"@typescript-eslint/eslint-plugin": "^8.35.0",
|
|
25
|
+
"@typescript-eslint/parser": "^8.35.0",
|
|
26
|
+
"eslint": "^9.30.0",
|
|
27
|
+
"eslint-config-standard": "^17.1.0",
|
|
28
|
+
"eslint-config-standard-with-typescript": "^43.0.1",
|
|
29
|
+
"eslint-plugin-import": "^2.24.2",
|
|
30
|
+
"eslint-plugin-node": "^11.1.0",
|
|
31
|
+
"eslint-plugin-promise": "^7.2.1",
|
|
32
|
+
"eslint-plugin-standard": "^5.0.0",
|
|
33
|
+
"husky": "^9.1.7",
|
|
34
|
+
"jest": "^30.0.3",
|
|
35
|
+
"jest-extended": "^6.0.0",
|
|
36
|
+
"ts-jest": "^29.4.0",
|
|
37
|
+
"typescript": "^5.3.3"
|
|
38
|
+
},
|
|
39
|
+
"husky": {
|
|
40
|
+
"hooks": {
|
|
41
|
+
"pre-commit": "npm test",
|
|
42
|
+
"pre-push": "npm test"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"directories": {
|
|
46
|
+
"test": "test"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://salespark.io",
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/FBlade/salespark-mailerlite-api.git"
|
|
52
|
+
},
|
|
53
|
+
"keywords": [
|
|
54
|
+
"mailerlite",
|
|
55
|
+
"node",
|
|
56
|
+
"api"
|
|
57
|
+
],
|
|
58
|
+
"files": [
|
|
59
|
+
"dist/**/*"
|
|
60
|
+
]
|
|
61
|
+
}
|