forked from node-apn/node-apn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
53 lines (41 loc) · 1.1 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
const debug = require("debug")("apn");
const credentials = require("./lib/credentials")({
logger: debug
});
const config = require("./lib/config")({
logger: debug,
prepareCertificate: credentials.certificate,
prepareToken: credentials.token,
prepareCA: credentials.ca,
});
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,
};