pushy 3.0.4 → 4.0.1

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.
Files changed (2) hide show
  1. package/index.d.ts +48 -0
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -137,6 +137,7 @@ declare module 'pushy' {
137
137
  failed: Array<string>;
138
138
  };
139
139
  }
140
+
140
141
  interface NotificationStatus {
141
142
  /** The creation date of the push notification (unix timestamp). */
142
143
  date: number;
@@ -214,6 +215,26 @@ declare module 'pushy' {
214
215
  subscriptions: Array<string>;
215
216
  }
216
217
 
218
+ /**
219
+ * Options for extra request library parameters.
220
+ */
221
+ interface ExtraRequestOptions {
222
+ /**
223
+ * Custom headers for the request, represented as key-value pairs.
224
+ */
225
+ headers?: Record<string, string>;
226
+
227
+ /**
228
+ * Timeout for the request in milliseconds.
229
+ */
230
+ timeout?: number;
231
+
232
+ /**
233
+ * Allow any additional options to be specified.
234
+ */
235
+ [key: string]: any;
236
+ }
237
+
217
238
  interface DevicePresenceInfo {
218
239
  /** The device token linked to this presence object. */
219
240
  id: string;
@@ -254,6 +275,12 @@ declare module 'pushy' {
254
275
  }
255
276
 
256
277
  export default class Pushy {
278
+ /**
279
+ * Constructor
280
+ * @see {@link https://pushy.me/docs/api}
281
+ *
282
+ * @param apiKey Pushy Secret API Key, available in the Pushy Dashboard (Click your app -> API Authentication tab).
283
+ */
257
284
  constructor(apiKey: string);
258
285
 
259
286
  /**
@@ -357,5 +384,26 @@ declare module 'pushy' {
357
384
  topic: string,
358
385
  callback?: (error: Error | null, subscribers: TopicSuscribers) => void
359
386
  ): Promise<TopicSuscribers>;
387
+
388
+ /**
389
+ * Set extra request library options to customize requests sent to the Pushy API.
390
+ *
391
+ * @param options An object containing additional request options.
392
+ */
393
+ setExtraRequestOptions(options: ExtraRequestOptions): void;
394
+
395
+ /**
396
+ * Set the Pushy Enterprise API endpoint hostname.
397
+ *
398
+ * @param endpoint The Pushy Enterprise API endpoint along with protocol (no trailing slash).
399
+ */
400
+ setEnterpriseConfig(endpoint: string): void;
401
+
402
+ /**
403
+ * Get the API endpoint being used by the Pushy instance.
404
+ *
405
+ * @returns The API endpoint URL as a string.
406
+ */
407
+ getApiEndpoint(): string;
360
408
  }
361
409
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pushy",
3
- "version": "3.0.4",
3
+ "version": "4.0.1",
4
4
  "description": "The official Node.js package for sending push notifications with Pushy.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,6 +17,6 @@
17
17
  },
18
18
  "homepage": "https://github.com/pushy/pushy-node#readme",
19
19
  "dependencies": {
20
- "axios": "^0.28.0"
20
+ "axios": "^1.7.3"
21
21
  }
22
22
  }