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

@blockprotocol/graph

Package Overview
Dependencies
Maintainers
8
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blockprotocol/graph - npm Package Compare versions

Comparing version 0.1.0-canary-20230210130343 to 0.1.0-canary-20230213183355

2

dist/stdlib.d.ts

@@ -5,3 +5,3 @@ /**

export { compareBounds } from "./stdlib/bound.js";
export { intervalContainsInterval, intervalContainsTimestamp, intervalForTimestamp, intervalIntersectionWithInterval, intervalIsAdjacentToInterval, intervalIsStrictlyAfterInterval, intervalIsStrictlyBeforeInterval, intervalMergeWithInterval, intervalOverlapsInterval, intervalUnionWithInterval, unionOfIntervals, } from "./stdlib/interval.js";
export { intervalCompareWithInterval, intervalContainsInterval, intervalContainsTimestamp, intervalForTimestamp, intervalIntersectionWithInterval, intervalIsAdjacentToInterval, intervalIsStrictlyAfterInterval, intervalIsStrictlyBeforeInterval, intervalMergeWithInterval, intervalOverlapsInterval, intervalUnionWithInterval, sortIntervals, unionOfIntervals, } from "./stdlib/interval.js";
export { buildSubgraph } from "./stdlib/subgraph/builder.js";

@@ -8,0 +8,0 @@ export { getPropertyTypesReferencedByEntityType } from "./stdlib/subgraph/edge/entity-type.js";

@@ -5,3 +5,3 @@ /**

export { compareBounds } from "./stdlib/bound.js";
export { intervalContainsInterval, intervalContainsTimestamp, intervalForTimestamp, intervalIntersectionWithInterval, intervalIsAdjacentToInterval, intervalIsStrictlyAfterInterval, intervalIsStrictlyBeforeInterval, intervalMergeWithInterval, intervalOverlapsInterval, intervalUnionWithInterval, unionOfIntervals, } from "./stdlib/interval.js";
export { intervalCompareWithInterval, intervalContainsInterval, intervalContainsTimestamp, intervalForTimestamp, intervalIntersectionWithInterval, intervalIsAdjacentToInterval, intervalIsStrictlyAfterInterval, intervalIsStrictlyBeforeInterval, intervalMergeWithInterval, intervalOverlapsInterval, intervalUnionWithInterval, sortIntervals, unionOfIntervals, } from "./stdlib/interval.js";
export { buildSubgraph } from "./stdlib/subgraph/builder.js";

@@ -8,0 +8,0 @@ export { getPropertyTypesReferencedByEntityType } from "./stdlib/subgraph/edge/entity-type.js";

import { BoundedTimeInterval, LimitedTemporalBound, TemporalBound, TimeInterval, Timestamp } from "../types/temporal-versioning.js";
/**
* Standard comparison function that returns whether `IntervalA` is before the `IntervalB`. Where "before"
* is defined by first comparing the start bounds, and if those are equal, then the end bounds are compared.
*
* @param {TimeInterval} intervalA
* @param {TimeInterval} intervalB
*/
export declare const intervalCompareWithInterval: (intervalA: TimeInterval, intervalB: TimeInterval) => number;
/**
* Sorts a given collection of {@link TimeInterval} in place, sorted first from earliest to latest start bounds, and
* then earliest to latest end bounds.
*
* @param {TimeInterval[]} intervals
*/
export declare const sortIntervals: (intervals: TimeInterval[]) => void;
/**
* Creates a {@link BoundedTimeInterval} that represents the instant of time identified by the given {@link Timestamp}.

@@ -4,0 +19,0 @@ *

import { boundIsAdjacentToBound, compareBounds } from "./bound.js";
/**
* Standard comparison function that returns whether `IntervalA` is before the `IntervalB`. Where "before"
* is defined by first comparing the start bounds, and if those are equal, then the end bounds are compared.
*
* @param {TimeInterval} intervalA
* @param {TimeInterval} intervalB
*/
export const intervalCompareWithInterval = (intervalA, intervalB) => {
const startComparison = compareBounds(intervalA.start, intervalB.start, "start", "start");
return startComparison !== 0
? startComparison
: compareBounds(intervalA.end, intervalB.end, "end", "end");
};
/**
* Sorts a given collection of {@link TimeInterval} in place, sorted first from earliest to latest start bounds, and
* then earliest to latest end bounds.
*
* @param {TimeInterval[]} intervals
*/
export const sortIntervals = (intervals) => {
intervals.sort(intervalCompareWithInterval);
};
/**
* Creates a {@link BoundedTimeInterval} that represents the instant of time identified by the given {@link Timestamp}.

@@ -211,8 +233,3 @@ *

*/
intervals.sort((intervalA, intervalB) => {
const startComparison = compareBounds(intervalA.start, intervalB.start, "start", "start");
return startComparison !== 0
? startComparison
: compareBounds(intervalA.end, intervalB.end, "end", "end");
});
sortIntervals(intervals);
return intervals.reduce((union, currentInterval) => {

@@ -219,0 +236,0 @@ if (union.length === 0) {

import { Entity, EntityId, LinkEntityAndRightEntity } from "../../../types/entity.js";
import { Subgraph } from "../../../types/subgraph.js";
import { TimeInterval, Timestamp } from "../../../types/temporal-versioning.js";
import { TimeInterval } from "../../../types/temporal-versioning.js";
/**

@@ -65,3 +65,3 @@ * Get all outgoing link entities from a given {@link Entity}.

/**
* For a given moment in time, get all outgoing link {@link Entity} revisions, and their "target" {@link Entity}
* For a given {@link TimeInterval}, get all outgoing link {@link Entity} revisions, and their "target" {@link Entity}
* revisions (by default this is the "right entity"), from a given {@link Entity}.

@@ -71,6 +71,6 @@ *

* @param {EntityId} entityId - The ID of the source entity to search for outgoing links from
* @param {Date | Timestamp} [timestamp] - An optional `Date` or an ISO-formatted datetime string of the moment to
* search for. If the parameter is omitted then results will default to only returning results that are active in
* the latest instant of time in the {@link Subgraph}
* @param {TimeInterval} [interval] - An optional {@link TimeInterval} to constrain the period of time to search across.
* If the parameter is omitted then results will default to only returning results that are active in the latest instant
* of time in the {@link Subgraph}
*/
export declare const getOutgoingLinkAndTargetEntities: <Temporal extends boolean, LinkAndRightEntities extends LinkEntityAndRightEntity<Temporal>[] = LinkEntityAndRightEntity<Temporal>[]>(subgraph: Subgraph<Temporal, import("../../../types/subgraph.js").SubgraphRootType<Temporal>>, entityId: EntityId, timestamp?: (Temporal extends true ? string | Date : undefined) | undefined) => LinkAndRightEntities;
export declare const getOutgoingLinkAndTargetEntities: <Temporal extends boolean, LinkAndRightEntities extends LinkEntityAndRightEntity<Temporal>[] = LinkEntityAndRightEntity<Temporal>[]>(subgraph: Subgraph<Temporal, import("../../../types/subgraph.js").SubgraphRootType<Temporal>>, entityId: EntityId, interval?: (Temporal extends true ? TimeInterval<import("../../../types/temporal-versioning.js").TemporalBound, import("../../../types/temporal-versioning.js").TemporalBound> : undefined) | undefined) => LinkAndRightEntities;

@@ -6,9 +6,2 @@ import { typedEntries } from "../../../shared.js";

import { getLatestInstantIntervalForSubgraph } from "../temporal-axes.js";
const convertTimeToTimestampWithDefault = (timestamp) => {
return timestamp === undefined
? new Date().toISOString()
: typeof timestamp === "string"
? timestamp
: timestamp.toISOString();
};
const getUniqueEntitiesFilter = () => {

@@ -223,3 +216,3 @@ const set = new Set();

/**
* For a given moment in time, get all outgoing link {@link Entity} revisions, and their "target" {@link Entity}
* For a given {@link TimeInterval}, get all outgoing link {@link Entity} revisions, and their "target" {@link Entity}
* revisions (by default this is the "right entity"), from a given {@link Entity}.

@@ -229,10 +222,8 @@ *

* @param {EntityId} entityId - The ID of the source entity to search for outgoing links from
* @param {Date | Timestamp} [timestamp] - An optional `Date` or an ISO-formatted datetime string of the moment to
* search for. If the parameter is omitted then results will default to only returning results that are active in
* the latest instant of time in the {@link Subgraph}
* @param {TimeInterval} [interval] - An optional {@link TimeInterval} to constrain the period of time to search across.
* If the parameter is omitted then results will default to only returning results that are active in the latest instant
* of time in the {@link Subgraph}
*/
export const getOutgoingLinkAndTargetEntities = (subgraph, entityId, timestamp) => {
const searchInterval = timestamp !== undefined
? intervalForTimestamp(convertTimeToTimestampWithDefault(timestamp))
: getLatestInstantIntervalForSubgraph(subgraph);
export const getOutgoingLinkAndTargetEntities = (subgraph, entityId, interval) => {
const searchInterval = interval ?? getLatestInstantIntervalForSubgraph(subgraph);
if (isTemporalSubgraph(subgraph)) {

@@ -239,0 +230,0 @@ const outgoingLinkEntities = getOutgoingLinksForEntity(subgraph, entityId, searchInterval);

import { OntologyTypeRecordId } from "../ontology.js";
export interface OntologyElementMetadata {
recordId: OntologyTypeRecordId;
ownedById: string;
}
{
"name": "@blockprotocol/graph",
"version": "0.1.0-canary-20230210130343",
"version": "0.1.0-canary-20230213183355",
"description": "Implementation of the Block Protocol Graph service specification for blocks and embedding applications",

@@ -75,4 +75,4 @@ "keywords": [

"dependencies": {
"@blockprotocol/core": "0.0.14-canary-20230210130343",
"@blockprotocol/type-system": "0.0.4-canary-20230210130343",
"@blockprotocol/core": "0.0.14-canary-20230213183355",
"@blockprotocol/type-system": "0.0.4-canary-20230213183355",
"ajv": "^8.11.2",

@@ -79,0 +79,0 @@ "ajv-formats": "^2.1.1",

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