New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@como/como-client

Package Overview
Dependencies
Maintainers
9
Versions
209
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@como/como-client - npm Package Compare versions

Comparing version 0.1.29 to 0.1.30

151

lib/como.js

@@ -616,27 +616,37 @@ 'use strict';

* To get the reloaded membership make sure to call como.getMembership();
* @param onlyAssetKeys - include assets list full data or only the asset keys
* @returns {Promise<void>}
*/
como.reloadMembership = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12() {
var _comoData11, env, locationId, api, membership;
como.reloadMembership = function () {
var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12() {
var onlyAssetKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
return _regenerator2.default.wrap(function _callee12$(_context12) {
while (1) {
switch (_context12.prev = _context12.next) {
case 0:
_comoData11 = comoData, env = _comoData11.env_params, locationId = _comoData11.locationId, api = _comoData11.api;
_context12.next = 3;
return api.getUserAtLocation(env.zapp_root, locationId);
var _comoData11, env, locationId, api, membership;
case 3:
membership = _context12.sent;
return _regenerator2.default.wrap(function _callee12$(_context12) {
while (1) {
switch (_context12.prev = _context12.next) {
case 0:
_comoData11 = comoData, env = _comoData11.env_params, locationId = _comoData11.locationId, api = _comoData11.api;
_context12.next = 3;
return api.getUserAtLocation(env.zapp_root, locationId, onlyAssetKeys);
comoData.membership = membership;
case 3:
membership = _context12.sent;
case 5:
case 'end':
return _context12.stop();
comoData.membership = membership;
case 5:
case 'end':
return _context12.stop();
}
}
}
}, _callee12, undefined);
}));
}, _callee12, undefined);
}));
return function () {
return _ref13.apply(this, arguments);
};
}();
/**

@@ -664,3 +674,3 @@ * Send an Open app request to update server.

return function (_x24) {
return function (_x25) {
return _ref14.apply(this, arguments);

@@ -694,3 +704,3 @@ };

return function (_x25, _x26) {
return function (_x26, _x27) {
return _ref15.apply(this, arguments);

@@ -742,3 +752,3 @@ };

return function (_x27) {
return function (_x28) {
return _ref16.apply(this, arguments);

@@ -905,3 +915,3 @@ };

return function (_x28) {
return function (_x29) {
return _ref21.apply(this, arguments);

@@ -939,3 +949,3 @@ };

return function (_x29) {
return function (_x30) {
return _ref22.apply(this, arguments);

@@ -1217,3 +1227,3 @@ };

return function (_x30) {
return function (_x31) {
return _ref26.apply(this, arguments);

@@ -1252,3 +1262,3 @@ };

return function (_x31) {
return function (_x32) {
return _ref27.apply(this, arguments);

@@ -1415,3 +1425,3 @@ };

return function (_x32) {
return function (_x33) {
return _ref31.apply(this, arguments);

@@ -1444,2 +1454,9 @@ };

/**
* @param {Integer} amount to charge
* @param {String} creditCardToken to charge from
* @param {String} itemName for submit purchase
* @param {String} itemNumber for submit purchase
* @param {String} membershipKey for user identification
*/
como.payInApp = function () {

@@ -1469,3 +1486,3 @@ var _ref33 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee32(amount, creditCardToken, itemName, itemNumber, membershipKey) {

return function (_x33, _x34, _x35, _x36, _x37) {
return function (_x34, _x35, _x36, _x37, _x38) {
return _ref33.apply(this, arguments);

@@ -1475,2 +1492,5 @@ };

/**
* @param {string} creditCardToken which card to delete
*/
como.deletePayment = function () {

@@ -1500,3 +1520,3 @@ var _ref34 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee33(creditCardToken) {

return function (_x38) {
return function (_x39) {
return _ref34.apply(this, arguments);

@@ -1530,8 +1550,38 @@ };

/**
* @param {String} receiver to share with
* @param {String} sender name
* @param {Integer} amount to share
* @param {String} type of wallet
*/
como.budgetTransfer = function () {
var _ref35 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee34(receiver, sender, amount, wallet) {
var _comoData41, api, locationId, env;
return _regenerator2.default.wrap(function _callee34$(_context34) {
while (1) {
switch (_context34.prev = _context34.next) {
case 0:
_comoData41 = comoData, api = _comoData41.api, locationId = _comoData41.locationId, env = _comoData41.env_params;
return _context34.abrupt('return', api.budgetTransfer(env.services_root, locationId, receiver, sender, amount, wallet));
case 2:
case 'end':
return _context34.stop();
}
}
}, _callee34, undefined);
}));
return function (_x40, _x41, _x42, _x43) {
return _ref35.apply(this, arguments);
};
}();
/**
* @param {string} claimId key of the credit claim to read the data for
*/
como.getCreditClaimData = function (claimId) {
var _comoData41 = comoData,
api = _comoData41.api,
env = _comoData41.env_params;
var _comoData42 = comoData,
api = _comoData42.api,
env = _comoData42.env_params;

@@ -1542,3 +1592,30 @@ return api.getCreditClaimData(env.services_root, claimId);

/**
* API call for claim generic action. To specify your trigger button, you need to associate it with a particular item, asset or tag.
* @param {String} claimCode to use for budget transfer claim
*/
como.budgetTransferClaim = function () {
var _ref36 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee35(claimCode) {
var _comoData43, api, locationId, env;
return _regenerator2.default.wrap(function _callee35$(_context35) {
while (1) {
switch (_context35.prev = _context35.next) {
case 0:
_comoData43 = comoData, api = _comoData43.api, locationId = _comoData43.locationId, env = _comoData43.env_params;
return _context35.abrupt('return', api.budgetTransferClaim(env.services_root, locationId, claimCode));
case 2:
case 'end':
return _context35.stop();
}
}
}, _callee35, undefined);
}));
return function (_x44) {
return _ref36.apply(this, arguments);
};
}();
/**
* API call for claim generic action. To specify your trigger button, you need to associate it with a particular item, asset or tag.
* @param {string} assetKey - asset to claim

@@ -1549,7 +1626,7 @@ * @param {string} itemId - item id to claim

como.claim = function (assetKey, itemId, tag) {
var _comoData42 = comoData,
env = _comoData42.env_params,
locationId = _comoData42.locationId,
api = _comoData42.api,
token = _comoData42.token;
var _comoData44 = comoData,
env = _comoData44.env_params,
locationId = _comoData44.locationId,
api = _comoData44.api,
token = _comoData44.token;

@@ -1556,0 +1633,0 @@ return api.claim(env.zapp_root, locationId, token, assetKey, itemId, tag);

@@ -1,13 +0,19 @@

"use strict";
'use strict';
var _regenerator = require("babel-runtime/regenerator");
var _regenerator = require('babel-runtime/regenerator');
var _regenerator2 = _interopRequireDefault(_regenerator);
var _asyncToGenerator2 = require("babel-runtime/helpers/asyncToGenerator");
var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');
var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
var _defineProperty2 = require('babel-runtime/helpers/defineProperty');
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var noCacheHeaders = { headers: (0, _defineProperty3.default)({ 'Cache-Control': 'no-cache' }, 'Cache-Control', 'no-store') };
exports.getForm = function (service) {

@@ -22,5 +28,5 @@ return function () {

case 0:
url = "/v1/form/" + type + "/" + locationId;
url = '/v1/form/' + type + '/' + locationId;
_context.next = 3;
return service.get(url);
return service.get(url, noCacheHeaders);

@@ -30,6 +36,6 @@ case 3:

data = _ref2.data;
return _context.abrupt("return", data);
return _context.abrupt('return', data);
case 6:
case "end":
case 'end':
return _context.stop();

@@ -56,5 +62,5 @@ }

case 0:
url = "/v1/config/" + type + "/" + locationId;
url = '/v1/config/' + type + '/' + locationId;
_context2.next = 3;
return service.get(url);
return service.get(url, noCacheHeaders);

@@ -64,6 +70,6 @@ case 3:

data = _ref4.data;
return _context2.abrupt("return", data);
return _context2.abrupt('return', data);
case 6:
case "end":
case 'end':
return _context2.stop();

@@ -90,5 +96,5 @@ }

case 0:
url = "/v1/resource/" + type + "/?tags=" + locationId + ",v1.0,GA";
url = '/v1/resource/' + type + '/?tags=' + locationId + ',v1.0,GA';
_context3.next = 3;
return service.get(url);
return service.get(url, noCacheHeaders);

@@ -98,6 +104,6 @@ case 3:

data = _ref6.data;
return _context3.abrupt("return", data);
return _context3.abrupt('return', data);
case 6:
case "end":
case 'end':
return _context3.stop();

@@ -104,0 +110,0 @@ }

@@ -11,2 +11,6 @@ 'use strict';

var _defineProperty2 = require('babel-runtime/helpers/defineProperty');
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -18,2 +22,4 @@

var noCacheHeaders = { headers: (0, _defineProperty3.default)({ 'Cache-Control': 'no-cache' }, 'Cache-Control', 'no-store') };
var buildResourceUrl = function buildResourceUrl(baseUrl, resourceId, namespace, version) {

@@ -66,3 +72,3 @@ return baseUrl + '/GetResource?namespace=' + namespace + '&resourceId=' + resourceId + '&version=' + version;

_context2.next = 3;
return service.post(url, { LocationID: locationId });
return service.post(url, { LocationID: locationId }, noCacheHeaders);

@@ -90,2 +96,4 @@ case 3:

var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(baseUrl, locationId) {
var onlyAssetKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var url, _ref4, data;

@@ -97,7 +105,7 @@

case 0:
url = baseUrl + '/alpha/api/GetUserAtLocation?MimeType=application/json&InputType=json';
url = baseUrl + '/alpha/api/GetUserAtLocation?MimeType=application/json&InputType=json&OnlyAssetKeys=' + onlyAssetKeys;
_context3.next = 3;
return service.post(url, {
LocationID: locationId
});
}, noCacheHeaders);

@@ -161,3 +169,3 @@ case 3:

return function (_x7, _x8) {
return function (_x8, _x9) {
return _ref5.apply(this, arguments);

@@ -197,3 +205,3 @@ };

return function (_x10, _x11, _x12) {
return function (_x11, _x12, _x13) {
return _ref7.apply(this, arguments);

@@ -232,3 +240,3 @@ };

return function (_x13, _x14) {
return function (_x14, _x15) {
return _ref9.apply(this, arguments);

@@ -267,3 +275,3 @@ };

return function (_x15, _x16) {
return function (_x16, _x17) {
return _ref11.apply(this, arguments);

@@ -303,3 +311,3 @@ };

return function (_x17, _x18, _x19, _x20) {
return function (_x18, _x19, _x20, _x21) {
return _ref13.apply(this, arguments);

@@ -327,3 +335,3 @@ };

_context9.next = 3;
return axios.get(url);
return axios.get(url, noCacheHeaders);

@@ -343,3 +351,3 @@ case 3:

return function (_x21, _x22, _x23, _x24) {
return function (_x22, _x23, _x24, _x25) {
return _ref15.apply(this, arguments);

@@ -376,3 +384,3 @@ };

return function (_x25, _x26, _x27) {
return function (_x26, _x27, _x28) {
return _ref17.apply(this, arguments);

@@ -408,3 +416,3 @@ };

return function (_x28, _x29, _x30, _x31) {
return function (_x29, _x30, _x31, _x32) {
return _ref19.apply(this, arguments);

@@ -439,3 +447,3 @@ };

return function (_x32, _x33, _x34, _x35, _x36) {
return function (_x33, _x34, _x35, _x36, _x37) {
return _ref20.apply(this, arguments);

@@ -476,3 +484,3 @@ };

return function (_x37, _x38, _x39, _x40) {
return function (_x38, _x39, _x40, _x41) {
return _ref21.apply(this, arguments);

@@ -509,3 +517,3 @@ };

return function (_x41, _x42, _x43) {
return function (_x42, _x43, _x44) {
return _ref23.apply(this, arguments);

@@ -543,3 +551,3 @@ };

return function (_x44, _x45, _x46, _x47) {
return function (_x45, _x46, _x47, _x48) {
return _ref25.apply(this, arguments);

@@ -576,3 +584,3 @@ };

return function (_x48, _x49, _x50) {
return function (_x49, _x50, _x51) {
return _ref26.apply(this, arguments);

@@ -607,3 +615,3 @@ };

return function (_x51, _x52, _x53, _x54) {
return function (_x52, _x53, _x54, _x55) {
return _ref28.apply(this, arguments);

@@ -635,3 +643,3 @@ };

return function (_x55, _x56, _x57, _x58) {
return function (_x56, _x57, _x58, _x59) {
return _ref29.apply(this, arguments);

@@ -663,3 +671,3 @@ };

return function (_x59, _x60) {
return function (_x60, _x61) {
return _ref30.apply(this, arguments);

@@ -705,3 +713,3 @@ };

return function (_x61, _x62, _x63, _x64, _x65, _x66, _x67, _x68) {
return function (_x62, _x63, _x64, _x65, _x66, _x67, _x68, _x69) {
return _ref31.apply(this, arguments);

@@ -736,3 +744,3 @@ };

return function (_x69, _x70, _x71, _x72) {
return function (_x70, _x71, _x72, _x73) {
return _ref32.apply(this, arguments);

@@ -769,3 +777,3 @@ };

return function (_x73, _x74, _x75, _x76, _x77) {
return function (_x74, _x75, _x76, _x77, _x78) {
return _ref33.apply(this, arguments);

@@ -802,3 +810,3 @@ };

return function (_x78, _x79, _x80) {
return function (_x79, _x80, _x81) {
return _ref34.apply(this, arguments);

@@ -809,6 +817,5 @@ };

exports.getCreditClaimData = function (service) {
exports.budgetTransfer = function (service) {
return function () {
var _ref35 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee24(baseUrl, claimId) {
var url, response;
var _ref35 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee24(baseUrl, locationId, receiver, sender, amount, wallet) {
return _regenerator2.default.wrap(function _callee24$(_context24) {

@@ -818,20 +825,80 @@ while (1) {

case 0:
return _context24.abrupt('return', service({
method: 'post',
url: baseUrl + '/budgetTransfer?locationId=' + locationId,
timeout: 5000, // Wait for 5 seconds
data: {
receiver: receiver,
sender: sender,
amount: amount,
wallet: wallet
}
}));
case 1:
case 'end':
return _context24.stop();
}
}
}, _callee24, undefined);
}));
return function (_x82, _x83, _x84, _x85, _x86, _x87) {
return _ref35.apply(this, arguments);
};
}();
};
exports.budgetTransferClaim = function (service) {
return function () {
var _ref36 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee25(baseUrl, locationId, claimCode) {
return _regenerator2.default.wrap(function _callee25$(_context25) {
while (1) {
switch (_context25.prev = _context25.next) {
case 0:
return _context25.abrupt('return', service({
method: 'post',
url: baseUrl + '/budgetTransfer/' + claimCode + '/claim?locationId=' + locationId,
timeout: 5000 // Wait for 5 seconds
}));
case 1:
case 'end':
return _context25.stop();
}
}
}, _callee25, undefined);
}));
return function (_x88, _x89, _x90) {
return _ref36.apply(this, arguments);
};
}();
};
exports.getCreditClaimData = function (service) {
return function () {
var _ref37 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee26(baseUrl, claimId) {
var url, response;
return _regenerator2.default.wrap(function _callee26$(_context26) {
while (1) {
switch (_context26.prev = _context26.next) {
case 0:
url = baseUrl + '/budgetTransfer/' + claimId;
_context24.next = 3;
_context26.next = 3;
return service.get(url);
case 3:
response = _context24.sent;
return _context24.abrupt('return', response);
response = _context26.sent;
return _context26.abrupt('return', response);
case 5:
case 'end':
return _context24.stop();
return _context26.stop();
}
}
}, _callee24, undefined);
}, _callee26, undefined);
}));
return function (_x81, _x82) {
return _ref35.apply(this, arguments);
return function (_x91, _x92) {
return _ref37.apply(this, arguments);
};

@@ -843,10 +910,10 @@ }();

return function () {
var _ref36 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee25(baseUrl, locationId, token, AssetKey, ItemID, Tag) {
var _ref38 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee27(baseUrl, locationId, token, AssetKey, ItemID, Tag) {
var url;
return _regenerator2.default.wrap(function _callee25$(_context25) {
return _regenerator2.default.wrap(function _callee27$(_context27) {
while (1) {
switch (_context25.prev = _context25.next) {
switch (_context27.prev = _context27.next) {
case 0:
url = baseUrl + '/alpha/api/Claim?Token=' + token + '&LocationID=' + locationId + '&InputType=JSON&MimeType=application/json';
return _context25.abrupt('return', service.post(url, {
return _context27.abrupt('return', service.post(url, {
Data: {

@@ -861,12 +928,12 @@ AssetKey: AssetKey,

case 'end':
return _context25.stop();
return _context27.stop();
}
}
}, _callee25, undefined);
}, _callee27, undefined);
}));
return function (_x83, _x84, _x85, _x86, _x87, _x88) {
return _ref36.apply(this, arguments);
return function (_x93, _x94, _x95, _x96, _x97, _x98) {
return _ref38.apply(this, arguments);
};
}();
};
{
"name": "@como/como-client",
"version": "0.1.29",
"version": "0.1.30",
"description": "Client module for Como's loaylty API",

@@ -51,2 +51,2 @@ "main": "src/como.js",

}
}
}

@@ -275,8 +275,10 @@ const moment = require('moment-timezone');

* To get the reloaded membership make sure to call como.getMembership();
* @param onlyAssetKeys - include assets list full data or only the asset keys
* @returns {Promise<void>}
*/
como.reloadMembership = async () => {
como.reloadMembership = async (onlyAssetKeys = false) => {
const {
env_params: env, locationId, api,
} = comoData;
const membership = await api.getUserAtLocation(env.zapp_root, locationId);
const membership = await api.getUserAtLocation(env.zapp_root, locationId, onlyAssetKeys);
comoData.membership = membership;

@@ -723,2 +725,9 @@ };

/**
* @param {Integer} amount to charge
* @param {String} creditCardToken to charge from
* @param {String} itemName for submit purchase
* @param {String} itemNumber for submit purchase
* @param {String} membershipKey for user identification
*/
como.payInApp = async (amount, creditCardToken, itemName, itemNumber, membershipKey) => {

@@ -732,2 +741,5 @@ const {

/**
* @param {string} creditCardToken which card to delete
*/
como.deletePayment = async creditCardToken => {

@@ -761,2 +773,15 @@ const {

/**
* @param {String} receiver to share with
* @param {String} sender name
* @param {Integer} amount to share
* @param {String} type of wallet
*/
como.budgetTransfer = async (receiver, sender, amount, wallet) => {
const {
api, locationId, env_params: env,
} = comoData;
return api.budgetTransfer(env.services_root, locationId, receiver, sender, amount, wallet);
};
/**
* @param {string} claimId key of the credit claim to read the data for

@@ -773,3 +798,13 @@ */

/**
* API call for claim generic action. To specify your trigger button, you need to associate it with a particular item, asset or tag.
* @param {String} claimCode to use for budget transfer claim
*/
como.budgetTransferClaim = async (claimCode) => {
const {
api, locationId, env_params: env,
} = comoData;
return api.budgetTransferClaim(env.services_root, locationId, claimCode);
};
/**
* API call for claim generic action. To specify your trigger button, you need to associate it with a particular item, asset or tag.
* @param {string} assetKey - asset to claim

@@ -786,3 +821,2 @@ * @param {string} itemId - item id to claim

module.exports = como;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc