Skip to content

Commit ab6ece8

Browse files
committed
expose the rest of config params to TS
1 parent 78e1d03 commit ab6ece8

File tree

2 files changed

+46
-10
lines changed

2 files changed

+46
-10
lines changed

doc/provider.markdown

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,34 @@ Options:
1313

1414
- `key` {Buffer|String} The filename of the connection key to load from disk, or a Buffer/String containing the key data. (Defaults to: `key.pem`)
1515

16-
- `ca` An array of trusted certificates. Each element should contain either a filename to load, or a Buffer/String (in PEM format) to be used directly. If this is omitted several well known "root" CAs will be used. - You may need to use this as some environments don't include the CA used by Apple (entrust_2048).
16+
- `ca` An array of trusted certificates. Each element should contain either a filename to load, or a Buffer/String (in PEM format) to be used directly. If this is omitted several well known "root" CAs will be used. - You may need to use this as some environments don't include the CA used by Apple (entrust_2048)
1717

18-
- `pfx` {Buffer|String} File path for private key, certificate and CA certs in PFX or PKCS12 format, or a Buffer containing the PFX data. If supplied will always be used instead of certificate and key above.
18+
- `pfx` {Buffer|String} File path for private key, certificate and CA certs in PFX or PKCS12 format, or a Buffer containing the PFX data. If supplied will always be used instead of certificate and key above
1919

2020
- `passphrase` {String} The passphrase for the connection key, if required
2121

2222
- `production` {Boolean} Specifies which environment to connect to: Production (if true) or Sandbox - The hostname will be set automatically. (Defaults to NODE_ENV == "production", i.e. false unless the NODE_ENV environment variable is set accordingly)
2323

2424
- `rejectUnauthorized` {Boolean} Reject Unauthorized property to be passed through to tls.connect() (Defaults to `true`)
2525

26+
- `address` {String} The address of the APNs server to send notifications to. If not provided, will connect to standard APNs server
27+
28+
- `port` {Number} The port of the APNs server to send notifications to. (Defaults to 443)
29+
30+
- `manageChannelsAddress` {String} The address of the APNs channel management server to send notifications to. If not provided, will connect to standard APNs channel management server
31+
32+
- `manageChannelsPort` {Number} The port of the APNs channel management server to send notifications to. If not provided, will connect to standard APNs channel management port
33+
34+
- `proxy` {host: String, port: Number|String} Connect through an HTTP proxy when sending notifications
35+
36+
- `manageChannelsProxy` {host: String, port: Number|String} Connect through an HTTP proxy when managing channels
37+
38+
- `rejectUnauthorized` {Boolean} Reject Unauthorized property to be passed through to tls.connect() (Defaults to `true`)
39+
2640
- `connectionRetryLimit` {Number} The maximum number of connection failures that will be tolerated before `apn.Provider` will "give up". [See below.](#connection-retry-limit) (Defaults to: 3)
2741

42+
- `heartBeat` {Number} The delay interval in ms that apn will ping APNs servers. (Defaults to: 60000)
43+
2844
- `requestTimeout` {Number} The maximum time in ms that apn will wait for a response to a request. (Defaults to: 5000)
2945

3046
#### Provider Certificates vs. Authentication Tokens

index.d.ts

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ export interface ProviderOptions {
3131
*/
3232
key?: string|Buffer;
3333
/**
34-
* An array of trusted certificates. Each element should contain either a filename to load, or a Buffer/String (in PEM format) to be used directly. If this is omitted several well known "root" CAs will be used. - You may need to use this as some environments don't include the CA used by Apple (entrust_2048).
34+
* An array of trusted certificates. Each element should contain either a filename to load, or a Buffer/String (in PEM format) to be used directly. If this is omitted several well known "root" CAs will be used. - You may need to use this as some environments don't include the CA used by Apple (entrust_2048)
3535
*/
3636
ca?: (string|Buffer)[];
3737
/**
38-
* File path for private key, certificate and CA certs in PFX or PKCS12 format, or a Buffer containing the PFX data. If supplied will always be used instead of certificate and key above.
38+
* File path for private key, certificate and CA certs in PFX or PKCS12 format, or a Buffer containing the PFX data. If supplied will always be used instead of certificate and key above
3939
*/
4040
pfx?: string|Buffer;
4141
/**
@@ -47,17 +47,21 @@ export interface ProviderOptions {
4747
*/
4848
production?: boolean;
4949
/**
50-
* Reject Unauthorized property to be passed through to tls.connect() (Defaults to `true`)
50+
* The address of the APNs server to send notifications to. If not provided, will connect to standard APNs server
5151
*/
52-
rejectUnauthorized?: boolean;
52+
address?: string;
5353
/**
54-
* The maximum number of connection failures that will be tolerated before `apn` will "terminate". (Defaults to: 3)
54+
* The port of the APNs server to send notifications to. (Defaults to 443)
5555
*/
56-
connectionRetryLimit?: number;
56+
port?: number;
5757
/**
58-
* The maximum time in ms that apn will wait for a response to a request. (Defaults to: 5000)
58+
* The address of the APNs channel management server to send notifications to. If not provided, will connect to standard APNs channel management server
5959
*/
60-
requestTimeout?: number;
60+
manageChannelsAddress?: string;
61+
/**
62+
* The port of the APNs channel management server to send notifications to. If not provided, will connect to standard APNs channel management port
63+
*/
64+
manageChannelsPort?: number;
6165
/**
6266
* Connect through an HTTP proxy when sending notifications
6367
*/
@@ -66,6 +70,22 @@ export interface ProviderOptions {
6670
* Connect through an HTTP proxy when managing channels
6771
*/
6872
manageChannelsProxy?: { host: string, port: number|string }
73+
/**
74+
* Reject Unauthorized property to be passed through to tls.connect() (Defaults to `true`)
75+
*/
76+
rejectUnauthorized?: boolean;
77+
/**
78+
* The maximum number of connection failures that will be tolerated before `apn` will "terminate". (Defaults to: 3)
79+
*/
80+
connectionRetryLimit?: number;
81+
/**
82+
* The delay interval in ms that apn will ping APNs servers. (Defaults to: 60000)
83+
*/
84+
heartBeat?: number;
85+
/**
86+
* The maximum time in ms that apn will wait for a response to a request. (Defaults to: 5000)
87+
*/
88+
requestTimeout?: number;
6989
}
7090

7191
export interface MultiProviderOptions extends ProviderOptions {

0 commit comments

Comments
 (0)