Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@atlaskit/activity-provider

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atlaskit/activity-provider - npm Package Compare versions

Comparing version 2.3.1 to 2.3.2

6

CHANGELOG.md
# @atlaskit/activity-provider
## 2.3.2
### Patch Changes
- [`d3265f19be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d3265f19be) - Transpile packages using babel rather than tsc
## 2.3.1

@@ -4,0 +10,0 @@

267

dist/cjs/api/ActivityResource.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeGetRecentItemBody = void 0;
var tslib_1 = require("tslib");
var util_service_support_1 = require("@atlaskit/util-service-support");
var error_1 = require("./error");
exports.makeGetRecentItemBody = function (cloudId) { return ({
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.makeGetRecentItemBody = void 0;
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _utilServiceSupport = require("@atlaskit/util-service-support");
var _error = require("./error");
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var makeGetRecentItemBody = function makeGetRecentItemBody(cloudId) {
return {
query: "\n query editor_recentActivities($filter: [ActivitiesFilter!], $first: Int) {\n activities {\n myActivities {\n viewed(filters: $filter, first: $first) {\n nodes {\n timestamp,\n object {\n id,\n name,\n type,\n url,\n iconUrl,\n containers {\n name,\n }\n }\n }\n }\n }\n }\n }\n ",
variables: {
first: 200,
filter: [
{
type: 'AND',
arguments: {
cloudIds: [cloudId],
},
},
],
},
}); };
var ActivityResource = /** @class */ (function () {
function ActivityResource(url, cloudId, options) {
if (options === void 0) { options = {}; }
this.url = url;
this.cloudId = cloudId;
this.options = options;
first: 200,
filter: [{
type: 'AND',
arguments: {
cloudIds: [cloudId]
}
}]
}
ActivityResource.prototype.getRecentItems = function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var options, response, err_1;
var _this = this;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!this.recentPromise) {
options = tslib_1.__assign(tslib_1.__assign({ mode: 'cors', method: 'POST', cache: 'no-cache', credentials: 'same-origin', headers: {
'Content-Type': 'application/json',
}, redirect: 'follow', referrer: 'no-referrer' }, this.options), { body: JSON.stringify(exports.makeGetRecentItemBody(this.cloudId)) });
this.recentPromise = util_service_support_1.utils.requestService({ url: this.url }, { requestInit: options });
}
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, this.recentPromise];
case 2:
response = _a.sent();
return [2 /*return*/, response.data.activities.myActivities.viewed.nodes.map(function (node) { return ({
objectId: atob(node.object.id),
name: node.object.name,
container: _this.getContainerName(node.object.containers),
url: node.object.url,
iconUrl: node.object.iconUrl,
type: node.object.type,
viewedTimestamp: node.timestamp,
}); })];
case 3:
err_1 = _a.sent();
throw new error_1.ActivityError(err_1.reason, err_1.code);
case 4: return [2 /*return*/];
};
};
exports.makeGetRecentItemBody = makeGetRecentItemBody;
var ActivityResource = /*#__PURE__*/function () {
function ActivityResource(url, cloudId) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
(0, _classCallCheck2.default)(this, ActivityResource);
this.url = url;
this.cloudId = cloudId;
this.options = options;
}
(0, _createClass2.default)(ActivityResource, [{
key: "getRecentItems",
value: function () {
var _getRecentItems = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
var _this = this;
var options, response;
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
if (!this.recentPromise) {
options = _objectSpread(_objectSpread({
mode: 'cors',
method: 'POST',
cache: 'no-cache',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json'
},
redirect: 'follow',
referrer: 'no-referrer'
}, this.options), {}, {
body: JSON.stringify(makeGetRecentItemBody(this.cloudId))
});
this.recentPromise = _utilServiceSupport.utils.requestService({
url: this.url
}, {
requestInit: options
});
}
});
});
};
ActivityResource.prototype.searchRecent = function (query) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var items;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.getRecentItems()];
case 1:
items = _a.sent();
return [2 /*return*/, this.filterItems(items, query)];
}
});
});
};
_context.prev = 1;
_context.next = 4;
return this.recentPromise;
case 4:
response = _context.sent;
return _context.abrupt("return", response.data.activities.myActivities.viewed.nodes.map(function (node) {
return {
objectId: atob(node.object.id),
name: node.object.name,
container: _this.getContainerName(node.object.containers),
url: node.object.url,
iconUrl: node.object.iconUrl,
type: node.object.type,
viewedTimestamp: node.timestamp
};
}));
case 8:
_context.prev = 8;
_context.t0 = _context["catch"](1);
throw new _error.ActivityError(_context.t0.reason, _context.t0.code);
case 11:
case "end":
return _context.stop();
}
}
}, _callee, this, [[1, 8]]);
}));
function getRecentItems() {
return _getRecentItems.apply(this, arguments);
}
return getRecentItems;
}()
}, {
key: "searchRecent",
value: function () {
var _searchRecent = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(query) {
var items;
return _regenerator.default.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return this.getRecentItems();
case 2:
items = _context2.sent;
return _context2.abrupt("return", this.filterItems(items, query));
case 4:
case "end":
return _context2.stop();
}
}
}, _callee2, this);
}));
function searchRecent(_x) {
return _searchRecent.apply(this, arguments);
}
return searchRecent;
}()
/**
* It should return the closet container's name
*/
ActivityResource.prototype.getContainerName = function (containers) {
for (var i = containers.length - 1; i >= 0; --i) {
var containerName = containers[i].name;
if (containerName) {
return containerName;
}
}, {
key: "getContainerName",
value: function getContainerName(containers) {
for (var i = containers.length - 1; i >= 0; --i) {
var containerName = containers[i].name;
if (containerName) {
return containerName;
}
return '';
};
ActivityResource.prototype.filterItems = function (items, searchTerm) {
if (!searchTerm) {
return [];
}
return items.filter(function (item) {
return item.name.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1;
});
};
return ActivityResource;
}());
exports.default = ActivityResource;
//# sourceMappingURL=ActivityResource.js.map
}
return '';
}
}, {
key: "filterItems",
value: function filterItems(items, searchTerm) {
if (!searchTerm) {
return [];
}
return items.filter(function (item) {
return item.name.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1;
});
}
}]);
return ActivityResource;
}();
exports.default = ActivityResource;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ActivityError = void 0;
var tslib_1 = require("tslib");
var ActivityError = /** @class */ (function (_super) {
tslib_1.__extends(ActivityError, _super);
function ActivityError(message, status) {
var _this = _super.call(this, message) || this;
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
Object.setPrototypeOf(_this, ActivityError.prototype);
_this.status = status;
_this.name = _this.constructor.name;
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(_this, _this.constructor);
}
else {
_this.stack = new Error(message).stack;
}
return _this;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var ActivityError = /*#__PURE__*/function (_Error) {
(0, _inherits2.default)(ActivityError, _Error);
var _super = _createSuper(ActivityError);
function ActivityError(message, status) {
var _this;
(0, _classCallCheck2.default)(this, ActivityError);
_this = _super.call(this, message); // https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
Object.setPrototypeOf((0, _assertThisInitialized2.default)(_this), ActivityError.prototype);
_this.status = status;
_this.name = _this.constructor.name;
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace((0, _assertThisInitialized2.default)(_this), _this.constructor);
} else {
_this.stack = new Error(message).stack;
}
return ActivityError;
}(Error));
exports.ActivityError = ActivityError;
//# sourceMappingURL=error.js.map
return _this;
}
return ActivityError;
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
exports.ActivityError = ActivityError;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ActivityError = exports.ActivityResource = void 0;
var tslib_1 = require("tslib");
var ActivityResource_1 = tslib_1.__importDefault(require("./api/ActivityResource"));
exports.ActivityResource = ActivityResource_1.default;
var error_1 = require("./api/error");
Object.defineProperty(exports, "ActivityError", { enumerable: true, get: function () { return error_1.ActivityError; } });
//# sourceMappingURL=index.js.map
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "ActivityResource", {
enumerable: true,
get: function get() {
return _ActivityResource.default;
}
});
Object.defineProperty(exports, "ActivityError", {
enumerable: true,
get: function get() {
return _error.ActivityError;
}
});
var _ActivityResource = _interopRequireDefault(require("./api/ActivityResource"));
var _error = require("./api/error");

@@ -1,3 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map
"use strict";
{
"name": "@atlaskit/activity-provider",
"version": "2.3.1",
"version": "2.3.2",
"sideEffects": false
}
import { utils } from '@atlaskit/util-service-support';
import { ActivityError } from './error';
export const makeGetRecentItemBody = (cloudId) => ({
query: `
export const makeGetRecentItemBody = cloudId => ({
query: `
query editor_recentActivities($filter: [ActivitiesFilter!], $first: Int) {

@@ -27,78 +27,88 @@ activities {

`,
variables: {
first: 200,
filter: [
{
type: 'AND',
arguments: {
cloudIds: [cloudId],
},
},
],
},
variables: {
first: 200,
filter: [{
type: 'AND',
arguments: {
cloudIds: [cloudId]
}
}]
}
});
export default class ActivityResource {
constructor(url, cloudId, options = {}) {
this.url = url;
this.cloudId = cloudId;
this.options = options;
constructor(url, cloudId, options = {}) {
this.url = url;
this.cloudId = cloudId;
this.options = options;
}
async getRecentItems() {
if (!this.recentPromise) {
const options = {
mode: 'cors',
method: 'POST',
cache: 'no-cache',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json'
},
redirect: 'follow',
referrer: 'no-referrer',
...this.options,
body: JSON.stringify(makeGetRecentItemBody(this.cloudId))
};
this.recentPromise = utils.requestService({
url: this.url
}, {
requestInit: options
});
}
async getRecentItems() {
if (!this.recentPromise) {
const options = {
mode: 'cors',
method: 'POST',
cache: 'no-cache',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json',
},
redirect: 'follow',
referrer: 'no-referrer',
...this.options,
body: JSON.stringify(makeGetRecentItemBody(this.cloudId)),
};
this.recentPromise = utils.requestService({ url: this.url }, { requestInit: options });
}
try {
const response = await this.recentPromise;
return response.data.activities.myActivities.viewed.nodes.map(node => ({
objectId: atob(node.object.id),
name: node.object.name,
container: this.getContainerName(node.object.containers),
url: node.object.url,
iconUrl: node.object.iconUrl,
type: node.object.type,
viewedTimestamp: node.timestamp,
}));
}
catch (err) {
throw new ActivityError(err.reason, err.code);
}
try {
const response = await this.recentPromise;
return response.data.activities.myActivities.viewed.nodes.map(node => ({
objectId: atob(node.object.id),
name: node.object.name,
container: this.getContainerName(node.object.containers),
url: node.object.url,
iconUrl: node.object.iconUrl,
type: node.object.type,
viewedTimestamp: node.timestamp
}));
} catch (err) {
throw new ActivityError(err.reason, err.code);
}
async searchRecent(query) {
const items = await this.getRecentItems();
return this.filterItems(items, query);
}
async searchRecent(query) {
const items = await this.getRecentItems();
return this.filterItems(items, query);
}
/**
* It should return the closet container's name
*/
getContainerName(containers) {
for (let i = containers.length - 1; i >= 0; --i) {
const containerName = containers[i].name;
if (containerName) {
return containerName;
}
}
/**
* It should return the closet container's name
*/
getContainerName(containers) {
for (let i = containers.length - 1; i >= 0; --i) {
const containerName = containers[i].name;
if (containerName) {
return containerName;
}
}
return '';
return '';
}
filterItems(items, searchTerm) {
if (!searchTerm) {
return [];
}
filterItems(items, searchTerm) {
if (!searchTerm) {
return [];
}
return items.filter(item => {
return item.name.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1;
});
}
}
//# sourceMappingURL=ActivityResource.js.map
return items.filter(item => {
return item.name.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1;
});
}
}
export class ActivityError extends Error {
constructor(message, status) {
super(message);
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
Object.setPrototypeOf(this, ActivityError.prototype);
this.status = status;
this.name = this.constructor.name;
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, this.constructor);
}
else {
this.stack = new Error(message).stack;
}
constructor(message, status) {
super(message); // https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
Object.setPrototypeOf(this, ActivityError.prototype);
this.status = status;
this.name = this.constructor.name;
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = new Error(message).stack;
}
}
//# sourceMappingURL=error.js.map
}
}
import ActivityResource from './api/ActivityResource';
import { ActivityError } from './api/error';
export { ActivityResource, ActivityError };
//# sourceMappingURL=index.js.map
export { ActivityResource, ActivityError };
{
"name": "@atlaskit/activity-provider",
"version": "2.3.1",
"version": "2.3.2",
"sideEffects": false
}

@@ -1,97 +0,171 @@

import { __assign, __awaiter, __generator } from "tslib";
import _regeneratorRuntime from "@babel/runtime/regenerator";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
import { utils } from '@atlaskit/util-service-support';
import { ActivityError } from './error';
export var makeGetRecentItemBody = function (cloudId) { return ({
export var makeGetRecentItemBody = function makeGetRecentItemBody(cloudId) {
return {
query: "\n query editor_recentActivities($filter: [ActivitiesFilter!], $first: Int) {\n activities {\n myActivities {\n viewed(filters: $filter, first: $first) {\n nodes {\n timestamp,\n object {\n id,\n name,\n type,\n url,\n iconUrl,\n containers {\n name,\n }\n }\n }\n }\n }\n }\n }\n ",
variables: {
first: 200,
filter: [
{
type: 'AND',
arguments: {
cloudIds: [cloudId],
},
},
],
},
}); };
var ActivityResource = /** @class */ (function () {
function ActivityResource(url, cloudId, options) {
if (options === void 0) { options = {}; }
this.url = url;
this.cloudId = cloudId;
this.options = options;
first: 200,
filter: [{
type: 'AND',
arguments: {
cloudIds: [cloudId]
}
}]
}
ActivityResource.prototype.getRecentItems = function () {
return __awaiter(this, void 0, void 0, function () {
var options, response, err_1;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!this.recentPromise) {
options = __assign(__assign({ mode: 'cors', method: 'POST', cache: 'no-cache', credentials: 'same-origin', headers: {
'Content-Type': 'application/json',
}, redirect: 'follow', referrer: 'no-referrer' }, this.options), { body: JSON.stringify(makeGetRecentItemBody(this.cloudId)) });
this.recentPromise = utils.requestService({ url: this.url }, { requestInit: options });
}
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, this.recentPromise];
case 2:
response = _a.sent();
return [2 /*return*/, response.data.activities.myActivities.viewed.nodes.map(function (node) { return ({
objectId: atob(node.object.id),
name: node.object.name,
container: _this.getContainerName(node.object.containers),
url: node.object.url,
iconUrl: node.object.iconUrl,
type: node.object.type,
viewedTimestamp: node.timestamp,
}); })];
case 3:
err_1 = _a.sent();
throw new ActivityError(err_1.reason, err_1.code);
case 4: return [2 /*return*/];
};
};
var ActivityResource = /*#__PURE__*/function () {
function ActivityResource(url, cloudId) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
_classCallCheck(this, ActivityResource);
this.url = url;
this.cloudId = cloudId;
this.options = options;
}
_createClass(ActivityResource, [{
key: "getRecentItems",
value: function () {
var _getRecentItems = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
var _this = this;
var options, response;
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
if (!this.recentPromise) {
options = _objectSpread(_objectSpread({
mode: 'cors',
method: 'POST',
cache: 'no-cache',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json'
},
redirect: 'follow',
referrer: 'no-referrer'
}, this.options), {}, {
body: JSON.stringify(makeGetRecentItemBody(this.cloudId))
});
this.recentPromise = utils.requestService({
url: this.url
}, {
requestInit: options
});
}
});
});
};
ActivityResource.prototype.searchRecent = function (query) {
return __awaiter(this, void 0, void 0, function () {
var items;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.getRecentItems()];
case 1:
items = _a.sent();
return [2 /*return*/, this.filterItems(items, query)];
}
});
});
};
_context.prev = 1;
_context.next = 4;
return this.recentPromise;
case 4:
response = _context.sent;
return _context.abrupt("return", response.data.activities.myActivities.viewed.nodes.map(function (node) {
return {
objectId: atob(node.object.id),
name: node.object.name,
container: _this.getContainerName(node.object.containers),
url: node.object.url,
iconUrl: node.object.iconUrl,
type: node.object.type,
viewedTimestamp: node.timestamp
};
}));
case 8:
_context.prev = 8;
_context.t0 = _context["catch"](1);
throw new ActivityError(_context.t0.reason, _context.t0.code);
case 11:
case "end":
return _context.stop();
}
}
}, _callee, this, [[1, 8]]);
}));
function getRecentItems() {
return _getRecentItems.apply(this, arguments);
}
return getRecentItems;
}()
}, {
key: "searchRecent",
value: function () {
var _searchRecent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(query) {
var items;
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return this.getRecentItems();
case 2:
items = _context2.sent;
return _context2.abrupt("return", this.filterItems(items, query));
case 4:
case "end":
return _context2.stop();
}
}
}, _callee2, this);
}));
function searchRecent(_x) {
return _searchRecent.apply(this, arguments);
}
return searchRecent;
}()
/**
* It should return the closet container's name
*/
ActivityResource.prototype.getContainerName = function (containers) {
for (var i = containers.length - 1; i >= 0; --i) {
var containerName = containers[i].name;
if (containerName) {
return containerName;
}
}, {
key: "getContainerName",
value: function getContainerName(containers) {
for (var i = containers.length - 1; i >= 0; --i) {
var containerName = containers[i].name;
if (containerName) {
return containerName;
}
return '';
};
ActivityResource.prototype.filterItems = function (items, searchTerm) {
if (!searchTerm) {
return [];
}
return items.filter(function (item) {
return item.name.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1;
});
};
return ActivityResource;
}());
export default ActivityResource;
//# sourceMappingURL=ActivityResource.js.map
}
return '';
}
}, {
key: "filterItems",
value: function filterItems(items, searchTerm) {
if (!searchTerm) {
return [];
}
return items.filter(function (item) {
return item.name.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1;
});
}
}]);
return ActivityResource;
}();
export { ActivityResource as default };

@@ -1,21 +0,38 @@

import { __extends } from "tslib";
var ActivityError = /** @class */ (function (_super) {
__extends(ActivityError, _super);
function ActivityError(message, status) {
var _this = _super.call(this, message) || this;
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
Object.setPrototypeOf(_this, ActivityError.prototype);
_this.status = status;
_this.name = _this.constructor.name;
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(_this, _this.constructor);
}
else {
_this.stack = new Error(message).stack;
}
return _this;
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
import _inherits from "@babel/runtime/helpers/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper";
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
export var ActivityError = /*#__PURE__*/function (_Error) {
_inherits(ActivityError, _Error);
var _super = _createSuper(ActivityError);
function ActivityError(message, status) {
var _this;
_classCallCheck(this, ActivityError);
_this = _super.call(this, message); // https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
Object.setPrototypeOf(_assertThisInitialized(_this), ActivityError.prototype);
_this.status = status;
_this.name = _this.constructor.name;
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(_assertThisInitialized(_this), _this.constructor);
} else {
_this.stack = new Error(message).stack;
}
return ActivityError;
}(Error));
export { ActivityError };
//# sourceMappingURL=error.js.map
return _this;
}
return ActivityError;
}( /*#__PURE__*/_wrapNativeSuper(Error));
import ActivityResource from './api/ActivityResource';
import { ActivityError } from './api/error';
export { ActivityResource, ActivityError };
//# sourceMappingURL=index.js.map
export { ActivityResource, ActivityError };
{
"name": "@atlaskit/activity-provider",
"version": "2.3.1",
"version": "2.3.2",
"sideEffects": false
}
{
"name": "@atlaskit/activity-provider",
"version": "2.3.1",
"version": "2.3.2",
"description": "A provider to support recent activities in editor",

@@ -23,3 +23,4 @@ "publishConfig": {

"dependencies": {
"@atlaskit/util-service-support": "^6.0.0"
"@atlaskit/util-service-support": "^6.0.0",
"@babel/runtime": "^7.0.0"
},

@@ -26,0 +27,0 @@ "devDependencies": {

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