@moxb/meteor
Advanced tools
Comparing version 0.3.28 to 0.3.31
@@ -79,2 +79,15 @@ /// <reference types="meteor" /> | ||
*/ | ||
export declare function registerMeteorMethod<Input, Output>(method: MeteorMethodDefinition<Input, Output>): MeteorMethodControl<Input, Output>; | ||
export declare function registerMeteorMethod<Input, Output>( | ||
/** | ||
* The definition of the method | ||
*/ | ||
method: MeteorMethodDefinition<Input, Output>, | ||
/** | ||
* Optionally, provide an instance of Meteor to use. | ||
* | ||
* This can be necessary in situations when the global singleton Meteor object is not available in the global | ||
* namespace, because it has been hidden my some collision avoidance mechanism. | ||
* | ||
* Specifically, this is the case when this NPM module is imported from within a Meteor package. | ||
*/ | ||
meteorInstance?: typeof Meteor): MeteorMethodControl<Input, Output>; |
@@ -42,9 +42,30 @@ "use strict"; | ||
*/ | ||
function registerMeteorMethod(method) { | ||
function registerMeteorMethod( | ||
/** | ||
* The definition of the method | ||
*/ | ||
method, | ||
/** | ||
* Optionally, provide an instance of Meteor to use. | ||
* | ||
* This can be necessary in situations when the global singleton Meteor object is not available in the global | ||
* namespace, because it has been hidden my some collision avoidance mechanism. | ||
* | ||
* Specifically, this is the case when this NPM module is imported from within a Meteor package. | ||
*/ | ||
meteorInstance) { | ||
var _a; | ||
var name = method.name, debug = method.debug, execute = method.execute, serverOnly = method.serverOnly, unblock = method.unblock, auth = method.auth; | ||
// Try to use the supplied Meteor instance, | ||
// without even looking at the global Meteor object first, | ||
// in order to avoid the "Meteor is undefined" JS error. | ||
var myMeteor = meteorInstance; | ||
if (!myMeteor) { | ||
// Only use the global Meteor object if no instance was provided | ||
myMeteor = Meteor; | ||
} | ||
var logger = (0, moxb_1.getDebugLogger)('Method ' + name, debug); | ||
if (Meteor.isServer || !serverOnly) { | ||
if (myMeteor.isServer || !serverOnly) { | ||
logger.log('Publishing Meteor method', name); | ||
Meteor.methods((_a = {}, | ||
myMeteor.methods((_a = {}, | ||
_a[name] = function (input) { | ||
@@ -100,2 +121,2 @@ // console.log('***Gonna check out if', name, 'is running in a simulation', this); | ||
exports.registerMeteorMethod = registerMeteorMethod; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWV0ZW9yTWV0aG9kLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL01ldGVvck1ldGhvZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw2QkFBa0M7QUFDbEMsMkNBQTBEO0FBQzFELG1DQUE0QztBQW1GNUM7O0dBRUc7QUFDSCxTQUFTLFlBQVksQ0FBQyxDQUFRO0lBQzFCLElBQUssQ0FBUyxDQUFDLFNBQVMsS0FBSyxjQUFjLEVBQUU7UUFDekMsT0FBUSxDQUF5QixDQUFDO0tBQ3JDO0lBQ0QsSUFBTSxLQUFLLEdBQUksQ0FBUyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUUsQ0FBUyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLFFBQVEsRUFBRSxDQUFDO0lBQ2pFLElBQU0sT0FBTyxHQUFHLENBQUMsQ0FBQyxPQUFPLENBQUM7SUFDMUIsSUFBTSxPQUFPLEdBQUksQ0FBUyxDQUFDLE9BQU8sSUFBSSxDQUFDLENBQUMsS0FBSyxJQUFJLEVBQUUsQ0FBQztJQUNwRCxPQUFPLElBQUksTUFBTSxDQUFDLEtBQUssQ0FBQyxLQUFLLEVBQUUsT0FBTyxFQUFFLE9BQU8sQ0FBQyxDQUFDO0FBQ3JELENBQUM7QUFFRDs7R0FFRztBQUNILHdEQUF3RDtBQUN4RCxTQUFnQixhQUFhLENBQXdDLENBQUk7SUFDckUsT0FBTyxDQUFDO1FBQUMsY0FBYzthQUFkLFVBQWMsRUFBZCxxQkFBYyxFQUFkLElBQWM7WUFBZCx5QkFBYzs7UUFDbkIsSUFBSTtZQUNBLHlDQUF5QztZQUN6QyxPQUFPLENBQUMsQ0FBQyxLQUFLLENBQUMsU0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QUksRUFBRSxVQUFDLElBQVcsRUFBRSxRQUFpQztZQUNqRCxPQUFPLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxDQUFDO1lBQ2xCLElBQUEsdUJBQVUsRUFBQyxJQUFJLEVBQUUsSUFBSSxFQUFFLFVBQUMsS0FBVyxFQUFFLE1BQVk7Z0JBQzdDLE9BQU8sQ0FBQyxHQUFHLENBQUMsS0FBSyxDQUFDLENBQUM7Z0JBQ25CLElBQUksUUFBUSxFQUFFO29CQUNWLFFBQVEsQ0FBQyxLQUFLLEVBQUUsTUFBTSxDQUFDLENBQUM7aUJBQzNCO1lBQ0wsQ0FBQyxDQUFDLENBQUM7UUFDUCxDQUFDO1FBQ0QsV0FBVyxFQUFFLFVBQUMsSUFBVztZQUNyQixPQUFBLElBQUksT0FBTyxDQUFTLFVBQUMsT0FBTyxFQUFFLE1BQU07Z0JBQ2hDLE9BQU8sQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLENBQUM7Z0JBQ2xCLElBQUEsdUJBQVUsRUFBQyxJQUFJLEVBQUUsSUFBSSxFQUFFLFVBQUMsS0FBVSxFQUFFLE1BQWM7b0JBQzlDLE9BQU8sQ0FBQyxHQUFHLENBQUMsS0FBSyxDQUFDLENBQUM7b0JBQ25CLElBQUksS0FBSyxFQUFFO3dCQUNQLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQztxQkFDakI7eUJBQU07d0JBQ0gsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDO3FCQUNuQjtnQkFDTCxDQUFDLENBQUMsQ0FBQztZQUNQLENBQUMsQ0FBQztRQVZGLENBVUU7S0FDVCxDQUFDO0FBQ04sQ0FBQztBQWhGRCxvREFnRkMifQ== |
{ | ||
"name": "@moxb/meteor", | ||
"version": "0.3.28", | ||
"version": "0.3.31", | ||
"description": "MobX meteor binding", | ||
@@ -63,3 +63,3 @@ "scripts": { | ||
}, | ||
"gitHead": "aa33cde821e024418253af988282f199dd7f3c74" | ||
"gitHead": "6fad50d6cbc081ce64edce48e5d7441627526a9a" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
242266
3762