Socket
Socket
Sign inDemoInstall

@pasabi/api-rest-comments-tags-flags

Package Overview
Dependencies
Maintainers
7
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pasabi/api-rest-comments-tags-flags - npm Package Compare versions

Comparing version 0.9.15 to 0.9.16

4

dist/index.js

@@ -19,5 +19,5 @@ "use strict";

if (!options.datasource)
throw new Error("options.datasource not defined");
throw new Error("options.datasource not defined.");
if (!options.collections)
throw new Error("options.collections not defined");
throw new Error("options.collections not defined.");
const commentsApi = (0, comments_1.Comments)("/comments", options.datasource, options.collections);

@@ -24,0 +24,0 @@ router.use(commentsApi.routes(), commentsApi.allowedMethods());

@@ -262,2 +262,5 @@ "use strict";

const success = await commentsService.create(commentData);
// TODO - add auditing
// const record = await commentsService.getLatestEntireRecord();
// ctx.auditedActivity = { verb: "add-comment", objects: [record], target: {entityId, entityType} }; // actor / verb / object / target
ctx.payload = { success };

@@ -264,0 +267,0 @@ return next();

/// <reference types="koa" />
/// <reference types="koa__router" />
import Router from "@koa/router";
import Router, { RouterContext } from "@koa/router";
import { FlagData } from "../../services/flags";
export declare const Flags: (mount: string, datasourceName: string, collections: string[], addFlagCallback: (fd: FlagData) => void) => Router<import("koa").DefaultState, import("koa").DefaultContext>;
export declare const Flags: (mount: string, datasourceName: string, collections: string[], addFlagCallback: (fd: FlagData, ctx: RouterContext) => void) => Router<import("koa").DefaultState, import("koa").DefaultContext>;
//# sourceMappingURL=index.d.ts.map

@@ -51,4 +51,8 @@ "use strict";

const success = await flagsService.create(flag);
// TODO theoretically add a linter rule to check for auditedActivity in a post / put / patch / delete
// TODO - add auditing here
// ctx.auditedActivity = { verb: "add-flag", objects: [], target: {entityId, entityType}};
if (success == true) {
addFlagCallback(flag);
// should the callback add to the ctx.auditedActivity
addFlagCallback(flag, ctx);
}

@@ -55,0 +59,0 @@ ctx.payload = {

@@ -208,2 +208,4 @@ "use strict";

const result = await tagsService.replaceTagsForEntity(workspace, org, entityId, entityType, deduplicatedTags, ctx.state.auth.sub);
// TODO - add auditing here
// ctx.auditedActivity = { verb: "replace-tags", objects: ["?"], target: { entityId, entityType }};
ctx.payload = { success: result };

@@ -210,0 +212,0 @@ return next();

@@ -23,2 +23,3 @@ import { Collection, Db } from "mongodb";

findReasonsForType(entityType: string, org_id: string, workspace_id: string): Promise<import("bson").Document[]>;
reasonForId(id: string): Promise<import("bson").Document>;
create(flagIn: FlagData): Promise<boolean>;

@@ -25,0 +26,0 @@ findFlagsForEntity(entityType: string, entityId: string): Promise<import("bson").Document[]>;

@@ -30,2 +30,10 @@ "use strict";

}
async reasonForId(id) {
const query = await this.reasonsCollection.find({ _id: new mongodb_1.ObjectId(id) });
const reasons = await query.toArray();
console.log("reasonForId", reasons);
if (reasons.length > 0)
return reasons[0];
return null; // or maybe throw here, cos something has gone wrong if the system is requesting a reason that don't exist.
}
async create(flagIn) {

@@ -32,0 +40,0 @@ // TODO - check reason is valid

{
"name": "@pasabi/api-rest-comments-tags-flags",
"version": "0.9.15",
"version": "0.9.16",
"description": "Rest APIs for Comments, Tags and Flags",

@@ -46,3 +46,3 @@ "keywords": [

},
"gitHead": "7508392f2c958d4ff139d1eed36cfd6b43183ba1"
"gitHead": "84697f2375d64668fb012280811fa65d93be658a"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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