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

@bscotch/blork-shared

Package Overview
Dependencies
Maintainers
0
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bscotch/blork-shared - npm Package Compare versions

Comparing version 0.26.2 to 0.27.0

dist/types.patch.d.ts

2

dist/client.d.ts

@@ -111,6 +111,6 @@ import { BaseError } from './errors.js';

updatedAt: Date;
templateId: string;
name: string;
description: string;
template: string;
templateId: string;
}>;

@@ -117,0 +117,0 @@ deleteTemplate(templateId: string): Promise<void>;

import uFuzzy from '@leeoniya/ufuzzy';
import { parseQuery } from './search.parse.js';
import { isAssignedToUser, listTaskPointers, taskIsComplete, taskIsNotBlocked, taskIsSnoozed, } from './tasks.js';
import { isAssignedToUser, isSnoozed, listTaskPointers, taskIsComplete, taskIsNotBlocked, } from './tasks.js';
import { rootTaskId } from './types.tasks.js';

@@ -236,3 +236,3 @@ import { findBestUserMatch } from './util.users.js';

else if (term === 'snooze') {
return taskIsSnoozed(task);
return isSnoozed(task);
}

@@ -239,0 +239,0 @@ else if (term === 'block') {

@@ -143,3 +143,5 @@ import { CommentData, TaskData, UserDataSafe } from './index.js';

export declare function anyTaskComplete(cache: Map<string, TaskData>, taskIds: string[]): boolean;
export declare function taskIsSnoozed(task: TaskData): boolean;
export declare function isSnoozed(snoozable: {
snoozed?: Date | null;
}): boolean;
export declare function commentIsBlocking(comment: CommentData): boolean;

@@ -178,2 +180,6 @@ export declare function commentIsBlockable(comment: CommentData): boolean;

doableTasks: TaskData[];
/**
* Comments assigned to the user that are not marked as done
* and are not snoozed for a later date.
*/
unresolvedComments: CommentData[];

@@ -180,0 +186,0 @@ /**

@@ -393,3 +393,3 @@ import { assert } from './errors.js';

assert(task, `Task ${taskId} not found`);
if (taskIsSnoozed(task))
if (isSnoozed(task))
return true;

@@ -423,3 +423,3 @@ // Recursively work backwards through parents until we find one that is snoozed

return false;
if (taskIsSnoozed(task))
if (isSnoozed(task))
return false;

@@ -449,3 +449,3 @@ if (task.comments?.some(commentIsBlocking))

assert(task, `Task ${taskId} not found`);
if (taskIsSnoozed(task))
if (isSnoozed(task))
return false;

@@ -467,4 +467,4 @@ if (task.starred || taskId === rootTaskId)

}
export function taskIsSnoozed(task) {
return !!task.snoozed && task.snoozed.getTime() > new Date().getTime();
export function isSnoozed(snoozable) {
return (!!snoozable.snoozed && snoozable.snoozed.getTime() > new Date().getTime());
}

@@ -619,3 +619,4 @@ export function commentIsBlocking(comment) {

for (const comment of task.comments || []) {
if (isAssignedToUser(comment, user.userId, users) &&
if (!isSnoozed(comment) &&
isAssignedToUser(comment, user.userId, users) &&
!isCompleteForUser(comment, users, user.userId)) {

@@ -622,0 +623,0 @@ userTasks.unresolvedComments.push(comment);

import { z } from 'zod';
import { PatchOwner, PatchSnooze } from './types.patch.js';
export type CommentData = z.infer<typeof commentSchema>;

@@ -9,2 +10,3 @@ export declare const commentSchema: z.ZodObject<{

assigned: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>>;
snoozed: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>>;
blocking: z.ZodOptional<z.ZodBoolean>;

@@ -21,2 +23,3 @@ createdAt: z.ZodDefault<z.ZodEffects<z.ZodDate, Date, unknown>>;

assigned?: Record<string, boolean> | null | undefined;
snoozed?: Date | null | undefined;
blocking?: boolean | undefined;

@@ -29,2 +32,3 @@ }, {

assigned?: Record<string, boolean> | null | undefined;
snoozed?: unknown;
blocking?: boolean | undefined;

@@ -34,3 +38,3 @@ createdAt?: unknown;

}>;
export type CommentPatchOwner = z.infer<typeof commentPatchOwnerSchema>;
export type CommentPatchOwner = PatchOwner;
export declare const commentPatchOwnerSchema: z.ZodObject<{

@@ -46,2 +50,13 @@ kind: z.ZodLiteral<"set-owners">;

}>;
export type CommentPatchSnooze = PatchSnooze;
export declare const commentPatchSnoozeSchema: z.ZodObject<{
kind: z.ZodLiteral<"set-snoozed">;
snooze: z.ZodEffects<z.ZodUnion<[z.ZodNull, z.ZodString]>, string | null, unknown>;
}, "strip", z.ZodTypeAny, {
kind: "set-snoozed";
snooze: string | null;
}, {
kind: "set-snoozed";
snooze?: unknown;
}>;
export type CommentPatchText = z.infer<typeof commentPatchTextSchema>;

@@ -100,2 +115,11 @@ export declare const commentPatchTextSchema: z.ZodObject<{

}>, z.ZodObject<{
kind: z.ZodLiteral<"set-snoozed">;
snooze: z.ZodEffects<z.ZodUnion<[z.ZodNull, z.ZodString]>, string | null, unknown>;
}, "strip", z.ZodTypeAny, {
kind: "set-snoozed";
snooze: string | null;
}, {
kind: "set-snoozed";
snooze?: unknown;
}>, z.ZodObject<{
kind: z.ZodLiteral<"set-done">;

@@ -102,0 +126,0 @@ done: z.ZodBoolean;

import { z } from 'zod';
import { dateSchema, stringSchema } from './types.lib.js';
import { patchOwnerSchema, patchSnoozeSchema, } from './types.patch.js';
import { isObjectWithField } from './util.guards.js';

@@ -14,2 +15,3 @@ export const commentSchema = z.object({

.nullable(),
snoozed: dateSchema.optional().nullable(),
blocking: z.boolean().optional(),

@@ -19,6 +21,4 @@ createdAt: dateSchema.default(() => new Date()),

});
export const commentPatchOwnerSchema = z.object({
kind: z.literal('set-owners'),
owners: z.array(stringSchema),
});
export const commentPatchOwnerSchema = patchOwnerSchema;
export const commentPatchSnoozeSchema = patchSnoozeSchema;
export const commentPatchTextSchema = z.object({

@@ -39,2 +39,3 @@ kind: z.literal('set-text'),

commentPatchTextSchema,
commentPatchSnoozeSchema,
commentPatchDoneSchema,

@@ -41,0 +42,0 @@ commentPatchBlockingSchema,

import { z } from 'zod';
import { PatchOwner, PatchSnooze } from './types.patch.js';
export declare const rootTaskId = "_";

@@ -45,4 +46,4 @@ /**

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -52,4 +53,4 @@ bytes: number;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -64,2 +65,3 @@ bytes: number;

assigned: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>>;
snoozed: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>>;
blocking: z.ZodOptional<z.ZodBoolean>;

@@ -76,2 +78,3 @@ createdAt: z.ZodDefault<z.ZodEffects<z.ZodDate, Date, unknown>>;

assigned?: Record<string, boolean> | null | undefined;
snoozed?: Date | null | undefined;
blocking?: boolean | undefined;

@@ -84,2 +87,3 @@ }, {

assigned?: Record<string, boolean> | null | undefined;
snoozed?: unknown;
blocking?: boolean | undefined;

@@ -97,2 +101,3 @@ createdAt?: unknown;

children: string[];
snoozed?: Date | null | undefined;
description?: string | null | undefined;

@@ -106,3 +111,2 @@ deletedAt?: Date | null | undefined;

tagged?: boolean | null | undefined;
snoozed?: Date | null | undefined;
nonowners?: string[] | null | undefined;

@@ -113,4 +117,4 @@ blockers?: string[] | undefined;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -127,2 +131,3 @@ bytes: number;

assigned?: Record<string, boolean> | null | undefined;
snoozed?: Date | null | undefined;
blocking?: boolean | undefined;

@@ -135,2 +140,3 @@ }[] | undefined;

parents: string[];
snoozed?: unknown;
createdAt?: unknown;

@@ -146,3 +152,2 @@ updatedAt?: unknown;

tagged?: boolean | null | undefined;
snoozed?: unknown;
nonowners?: string[] | null | undefined;

@@ -154,4 +159,4 @@ children?: string[] | undefined;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -166,2 +171,3 @@ bytes: number;

assigned?: Record<string, boolean> | null | undefined;
snoozed?: unknown;
blocking?: boolean | undefined;

@@ -179,2 +185,3 @@ createdAt?: unknown;

children: string[];
snoozed?: Date | null | undefined;
description?: string | null | undefined;

@@ -188,3 +195,2 @@ deletedAt?: Date | null | undefined;

tagged?: boolean | null | undefined;
snoozed?: Date | null | undefined;
nonowners?: string[] | null | undefined;

@@ -195,4 +201,4 @@ blockers?: string[] | undefined;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -209,2 +215,3 @@ bytes: number;

assigned?: Record<string, boolean> | null | undefined;
snoozed?: Date | null | undefined;
blocking?: boolean | undefined;

@@ -242,11 +249,11 @@ }[] | undefined;

}, "strip", z.ZodTypeAny, {
templateId?: string | undefined;
template?: string | undefined;
tasks?: TaskCreate[] | undefined;
template?: string | undefined;
templateId?: string | undefined;
substitutions?: Record<string, string> | undefined;
position?: number | undefined;
}, {
templateId?: string | undefined;
template?: string | undefined;
tasks?: TaskCreate[] | undefined;
template?: string | undefined;
templateId?: string | undefined;
substitutions?: Record<string, string> | undefined;

@@ -411,3 +418,3 @@ position?: number | undefined;

}>;
export type TaskPatchOwners = z.infer<typeof taskPatchNonownerSchema>;
export type TaskPatchOwners = PatchOwner;
export declare const taskPatchOwnersSchema: z.ZodObject<{

@@ -434,3 +441,3 @@ kind: z.ZodLiteral<"set-owners">;

}>;
export type TaskPatchSnooze = z.infer<typeof taskPatchSnoozeSchema>;
export type TaskPatchSnooze = PatchSnooze;
export declare const taskPatchSnoozeSchema: z.ZodObject<{

@@ -650,4 +657,4 @@ kind: z.ZodLiteral<"set-snoozed">;

}, "strip", z.ZodTypeAny, {
taskId: string;
at: Date;
taskId: string;
event: string;

@@ -670,4 +677,4 @@ clientId?: string | undefined;

}>, "strip", z.ZodTypeAny, {
taskId: string;
at: Date;
taskId: string;
event: "taskDeleted";

@@ -717,4 +724,4 @@ clientId?: string | undefined;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -724,4 +731,4 @@ bytes: number;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -736,2 +743,3 @@ bytes: number;

assigned: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>>;
snoozed: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>>;
blocking: z.ZodOptional<z.ZodBoolean>;

@@ -748,2 +756,3 @@ createdAt: z.ZodDefault<z.ZodEffects<z.ZodDate, Date, unknown>>;

assigned?: Record<string, boolean> | null | undefined;
snoozed?: Date | null | undefined;
blocking?: boolean | undefined;

@@ -756,2 +765,3 @@ }, {

assigned?: Record<string, boolean> | null | undefined;
snoozed?: unknown;
blocking?: boolean | undefined;

@@ -769,2 +779,3 @@ createdAt?: unknown;

children: string[];
snoozed?: Date | null | undefined;
description?: string | null | undefined;

@@ -778,3 +789,2 @@ deletedAt?: Date | null | undefined;

tagged?: boolean | null | undefined;
snoozed?: Date | null | undefined;
nonowners?: string[] | null | undefined;

@@ -785,4 +795,4 @@ blockers?: string[] | undefined;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -799,2 +809,3 @@ bytes: number;

assigned?: Record<string, boolean> | null | undefined;
snoozed?: Date | null | undefined;
blocking?: boolean | undefined;

@@ -807,2 +818,3 @@ }[] | undefined;

parents: string[];
snoozed?: unknown;
createdAt?: unknown;

@@ -818,3 +830,2 @@ updatedAt?: unknown;

tagged?: boolean | null | undefined;
snoozed?: unknown;
nonowners?: string[] | null | undefined;

@@ -826,4 +837,4 @@ children?: string[] | undefined;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -838,2 +849,3 @@ bytes: number;

assigned?: Record<string, boolean> | null | undefined;
snoozed?: unknown;
blocking?: boolean | undefined;

@@ -851,2 +863,3 @@ createdAt?: unknown;

children: string[];
snoozed?: Date | null | undefined;
description?: string | null | undefined;

@@ -860,3 +873,2 @@ deletedAt?: Date | null | undefined;

tagged?: boolean | null | undefined;
snoozed?: Date | null | undefined;
nonowners?: string[] | null | undefined;

@@ -867,4 +879,4 @@ blockers?: string[] | undefined;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -881,2 +893,3 @@ bytes: number;

assigned?: Record<string, boolean> | null | undefined;
snoozed?: Date | null | undefined;
blocking?: boolean | undefined;

@@ -886,4 +899,4 @@ }[] | undefined;

}>, "strip", z.ZodTypeAny, {
taskId: string;
at: Date;
taskId: string;
event: "taskCreated";

@@ -898,2 +911,3 @@ task: {

children: string[];
snoozed?: Date | null | undefined;
description?: string | null | undefined;

@@ -907,3 +921,2 @@ deletedAt?: Date | null | undefined;

tagged?: boolean | null | undefined;
snoozed?: Date | null | undefined;
nonowners?: string[] | null | undefined;

@@ -914,4 +927,4 @@ blockers?: string[] | undefined;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -928,2 +941,3 @@ bytes: number;

assigned?: Record<string, boolean> | null | undefined;
snoozed?: Date | null | undefined;
blocking?: boolean | undefined;

@@ -976,4 +990,4 @@ }[] | undefined;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -983,4 +997,4 @@ bytes: number;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -995,2 +1009,3 @@ bytes: number;

assigned: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>>;
snoozed: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodDate, Date, unknown>>>;
blocking: z.ZodOptional<z.ZodBoolean>;

@@ -1007,2 +1022,3 @@ createdAt: z.ZodDefault<z.ZodEffects<z.ZodDate, Date, unknown>>;

assigned?: Record<string, boolean> | null | undefined;
snoozed?: Date | null | undefined;
blocking?: boolean | undefined;

@@ -1015,2 +1031,3 @@ }, {

assigned?: Record<string, boolean> | null | undefined;
snoozed?: unknown;
blocking?: boolean | undefined;

@@ -1028,2 +1045,3 @@ createdAt?: unknown;

children: string[];
snoozed?: Date | null | undefined;
description?: string | null | undefined;

@@ -1037,3 +1055,2 @@ deletedAt?: Date | null | undefined;

tagged?: boolean | null | undefined;
snoozed?: Date | null | undefined;
nonowners?: string[] | null | undefined;

@@ -1044,4 +1061,4 @@ blockers?: string[] | undefined;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -1058,2 +1075,3 @@ bytes: number;

assigned?: Record<string, boolean> | null | undefined;
snoozed?: Date | null | undefined;
blocking?: boolean | undefined;

@@ -1066,2 +1084,3 @@ }[] | undefined;

parents: string[];
snoozed?: unknown;
createdAt?: unknown;

@@ -1077,3 +1096,2 @@ updatedAt?: unknown;

tagged?: boolean | null | undefined;
snoozed?: unknown;
nonowners?: string[] | null | undefined;

@@ -1085,4 +1103,4 @@ children?: string[] | undefined;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -1097,2 +1115,3 @@ bytes: number;

assigned?: Record<string, boolean> | null | undefined;
snoozed?: unknown;
blocking?: boolean | undefined;

@@ -1110,2 +1129,3 @@ createdAt?: unknown;

children: string[];
snoozed?: Date | null | undefined;
description?: string | null | undefined;

@@ -1119,3 +1139,2 @@ deletedAt?: Date | null | undefined;

tagged?: boolean | null | undefined;
snoozed?: Date | null | undefined;
nonowners?: string[] | null | undefined;

@@ -1126,4 +1145,4 @@ blockers?: string[] | undefined;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -1140,2 +1159,3 @@ bytes: number;

assigned?: Record<string, boolean> | null | undefined;
snoozed?: Date | null | undefined;
blocking?: boolean | undefined;

@@ -1145,4 +1165,4 @@ }[] | undefined;

}>, "strip", z.ZodTypeAny, {
taskId: string;
at: Date;
taskId: string;
event: "taskUpdated";

@@ -1157,2 +1177,3 @@ task: {

children: string[];
snoozed?: Date | null | undefined;
description?: string | null | undefined;

@@ -1166,3 +1187,2 @@ deletedAt?: Date | null | undefined;

tagged?: boolean | null | undefined;
snoozed?: Date | null | undefined;
nonowners?: string[] | null | undefined;

@@ -1173,4 +1193,4 @@ blockers?: string[] | undefined;

taskId: string;
name: string;
fileId: string;
name: string;
mimeType: string;

@@ -1187,2 +1207,3 @@ bytes: number;

assigned?: Record<string, boolean> | null | undefined;
snoozed?: Date | null | undefined;
blocking?: boolean | undefined;

@@ -1189,0 +1210,0 @@ }[] | undefined;

@@ -5,3 +5,4 @@ import { z } from 'zod';

import { dateSchema, stringSchema } from './types.lib.js';
import { dateIsoPattern, isObject, isObjectWithField } from './util.js';
import { patchOwnerSchema, patchSnoozeSchema, } from './types.patch.js';
import { isObject, isObjectWithField } from './util.js';
export const rootTaskId = '_';

@@ -164,6 +165,3 @@ /**

});
export const taskPatchOwnersSchema = z.object({
kind: z.literal('set-owners'),
owners: z.array(stringSchema),
});
export const taskPatchOwnersSchema = patchOwnerSchema;
export const taskPatchNonownerSchema = z.object({

@@ -173,14 +171,3 @@ kind: z.literal('set-nonowners'),

});
export const taskPatchSnoozeSchema = z.object({
kind: z.literal('set-snoozed'),
snooze: z.preprocess((input) => {
if (input instanceof Date) {
return input.toISOString();
}
else if (!input) {
return null;
}
return input;
}, z.union([z.null(), z.string().regex(dateIsoPattern)])),
});
export const taskPatchSnoozeSchema = patchSnoozeSchema;
export const taskPatchBlockSchema = z.object({

@@ -187,0 +174,0 @@ kind: z.literal('block'),

{
"name": "@bscotch/blork-shared",
"version": "0.26.2",
"version": "0.27.0",
"description": "Client and shared utilities for Blork projects.",

@@ -5,0 +5,0 @@ "keywords": [],

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