Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions dist/constants.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
declare const Constants: {
GCM_SEND_ENDPOINT: string;
GCM_SEND_ENDPATH: string;
GCM_SEND_URI: string;
BACKOFF_INITIAL_DELAY: number;
MAX_BACKOFF_DELAY: number;
SOCKET_TIMEOUT: number;
/** DEPRECATED **/
/** @deprecated */
TOKEN_MESSAGE_ID: string;
TOKEN_CANONICAL_REG_ID: string;
TOKEN_ERROR: string;
JSON_REGISTRATION_IDS: string;
JSON_PAYLOAD: string;
JSON_NOTIFICATION: string;
JSON_SUCCESS: string;
JSON_FAILURE: string;
JSON_CANONICAL_IDS: string;
JSON_MULTICAST_ID: string;
JSON_RESULTS: string;
JSON_ERROR: string;
JSON_MESSAGE_ID: string;
UTF8: string;
ERROR_QUOTA_EXCEEDED: string;
ERROR_DEVICE_QUOTA_EXCEEDED: string;
ERROR_MISSING_REGISTRATION: string;
ERROR_INVALID_REGISTRATION: string;
ERROR_MISMATCH_SENDER_ID: string;
ERROR_NOT_REGISTERED: string;
ERROR_MESSAGE_TOO_BIG: string;
ERROR_MISSING_COLLAPSE_KEY: string;
ERROR_UNAVAILABLE: string;
ERROR_INTERNAL_SERVER_ERROR: string;
};
export = Constants;
36 changes: 36 additions & 0 deletions dist/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"use strict";
var Constants = {
GCM_SEND_ENDPOINT: 'fcm.googleapis.com',
GCM_SEND_ENDPATH: '/fcm/send',
GCM_SEND_URI: 'https://fcm.googleapis.com/fcm/send',
BACKOFF_INITIAL_DELAY: 1000,
MAX_BACKOFF_DELAY: 1024000,
SOCKET_TIMEOUT: 180000,
/** DEPRECATED **/
/** @deprecated */
TOKEN_MESSAGE_ID: 'id',
TOKEN_CANONICAL_REG_ID: 'registration_id',
TOKEN_ERROR: 'Error',
JSON_REGISTRATION_IDS: 'registration_ids',
JSON_PAYLOAD: 'data',
JSON_NOTIFICATION: 'notification',
JSON_SUCCESS: 'success',
JSON_FAILURE: 'failure',
JSON_CANONICAL_IDS: 'canonical_ids',
JSON_MULTICAST_ID: 'multicast_id',
JSON_RESULTS: 'results',
JSON_ERROR: 'error',
JSON_MESSAGE_ID: 'message_id',
UTF8: 'UTF-8',
ERROR_QUOTA_EXCEEDED: 'QuotaExceeded',
ERROR_DEVICE_QUOTA_EXCEEDED: 'DeviceQuotaExceeded',
ERROR_MISSING_REGISTRATION: 'MissingRegistration',
ERROR_INVALID_REGISTRATION: 'InvalidRegistration',
ERROR_MISMATCH_SENDER_ID: 'MismatchSenderId',
ERROR_NOT_REGISTERED: 'NotRegistered',
ERROR_MESSAGE_TOO_BIG: 'MessageTooBig',
ERROR_MISSING_COLLAPSE_KEY: 'MissingCollapseKey',
ERROR_UNAVAILABLE: 'Unavailable',
ERROR_INTERNAL_SERVER_ERROR: 'InternalServerError'
};
module.exports = Constants;
10 changes: 10 additions & 0 deletions dist/main.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*!
* node-gcm
* Copyright(c) 2013 Marcus Farkas <[email protected]>
* MIT Licensed
*/
export { default as Constants } from './constants';
export { default as Message } from './message';
export { default as Result } from './result';
export { default as MulticastResult } from './multicastresult';
export { default as Sender } from './sender';
25 changes: 25 additions & 0 deletions dist/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"use strict";
/*!
* node-gcm
* Copyright(c) 2013 Marcus Farkas <[email protected]>
* MIT Licensed
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
exports.__esModule = true;
exports.Sender = exports.MulticastResult = exports.Result = exports.Message = exports.Constants = void 0;
var constants_1 = require("./constants");
__createBinding(exports, constants_1, "default", "Constants");
var message_1 = require("./message");
__createBinding(exports, message_1, "default", "Message");
var result_1 = require("./result");
__createBinding(exports, result_1, "default", "Result");
var multicastresult_1 = require("./multicastresult");
__createBinding(exports, multicastresult_1, "default", "MulticastResult");
var sender_1 = require("./sender");
__createBinding(exports, sender_1, "default", "Sender");
56 changes: 56 additions & 0 deletions dist/message-options.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* This module defines all the arguments that may be passed to a message.
*
* Each argument may contain a field `__argName`, if the name of the field
* should be different when sent to the server.
*
* The argument may also contain a field `__argType`, if the given
* argument must be of that type. The types are the strings resulting from
* calling `typeof <arg>` where `<arg>` is the argument.
*
* Other than that, the arguments are expected to follow the indicated
* structure.
*/
declare const MessageOptions: {
collapseKey: {
__argName: string;
__argType: string;
};
priority: {
__argType: string;
};
contentAvailable: {
__argName: string;
__argType: string;
};
mutableContent: {
__argName: string;
__argType: string;
};
delayWhileIdle: {
__argName: string;
__argType: string;
};
timeToLive: {
__argName: string;
__argType: string;
};
restrictedPackageName: {
__argName: string;
__argType: string;
};
dryRun: {
__argName: string;
__argType: string;
};
data: {
__argType: string;
};
notification: {
__argType: string;
};
fcm_options: {
__argType: string;
};
};
export = MessageOptions;
45 changes: 22 additions & 23 deletions lib/message-options.js → dist/message-options.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
/**
* This module defines all the arguments that may be passed to a message.
*
Expand All @@ -11,48 +12,46 @@
* Other than that, the arguments are expected to follow the indicated
* structure.
*/

module.exports = {
var MessageOptions = {
collapseKey: {
__argName: "collapse_key",
__argType: "string"
__argName: 'collapse_key',
__argType: 'string'
},
priority: {
__argType: "string"
__argType: 'string'
},
contentAvailable: {
__argName: "content_available",
__argType: "boolean"
__argName: 'content_available',
__argType: 'boolean'
},
mutableContent: {
__argName: "mutable_content",
__argType: "boolean"
__argName: 'mutable_content',
__argType: 'boolean'
},
delayWhileIdle: {
__argName: "delay_while_idle",
__argType: "boolean"
delayWhileIdle: {
__argName: 'delay_while_idle',
__argType: 'boolean'
},
timeToLive: {
__argName: "time_to_live",
__argType: "number"
__argName: 'time_to_live',
__argType: 'number'
},
restrictedPackageName: {
__argName: "restricted_package_name",
__argType: "string"
__argName: 'restricted_package_name',
__argType: 'string'
},
dryRun: {
__argName: "dry_run",
__argType: "boolean"
__argName: 'dry_run',
__argType: 'boolean'
},
data: {
__argType: "object"
__argType: 'object'
},
notification: {
__argType: "object"
//TODO: There are a lot of very specific arguments that could
// be indicated here.
__argType: 'object'
},
fcm_options: {
__argType: "object"
__argType: 'object'
}
};
module.exports = MessageOptions;
Loading