forked from node-apn/node-apn
-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.js
60 lines (47 loc) · 1.34 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const debug = require("debug")("apn");
const parse = require("./lib/credentials/parse")({
parsePkcs12: require("./lib/credentials/parsePkcs12"),
parsePemKey: require("./lib/credentials/parsePemKey"),
parsePemCert: require("./lib/credentials/parsePemCertificate"),
});
const prepareCredentials = require("./lib/credentials/prepare")({
load: require("./lib/credentials/load"),
parse,
validate: require("./lib/credentials/validate"),
logger: debug,
});
const config = require("./lib/config")({
debug,
prepareCredentials,
});
const tls = require("tls");
const framer = require("http2/lib/protocol/framer");
const compressor = require("http2/lib/protocol/compressor");
const protocol = {
Serializer: framer.Serializer,
Deserializer: framer.Deserializer,
Compressor: compressor.Compressor,
Decompressor: compressor.Decompressor,
Connection: require("http2/lib/protocol/connection").Connection,
};
const Endpoint = require("./lib/protocol/endpoint")({
tls,
protocol,
});
const EndpointManager = require("./lib/protocol/endpointManager")({
Endpoint,
});
const Client = require("./lib/client")({
config,
EndpointManager,
});
const Provider = require("./lib/provider")({
Client,
});
const Notification = require("./lib/notification");
const token = require("./lib/token");
module.exports = {
Provider,
Notification,
token,
};