@diagc/core 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/deployment.d.ts +16 -0
- package/dist/deployment.js +32 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DiagramNode } from './types.js';
|
|
2
|
+
/** The notation id a plane (or the model) declares to be drawn as a deployment
|
|
3
|
+
* diagram: where software runs, and the networks and zones around it. */
|
|
4
|
+
export declare const DEPLOY_NOTATION: "deployment";
|
|
5
|
+
/** Zones: containers whose boundary IS the information — what a box sits inside
|
|
6
|
+
* (a private subnet, an availability zone) says how it is reached and what it
|
|
7
|
+
* fails with. Outermost first, which is also the order they usually nest in. */
|
|
8
|
+
export declare const DEPLOY_ZONE_TYPES: readonly ["deploy-environment", "deploy-region", "deploy-zone", "deploy-network", "deploy-subnet-public", "deploy-subnet-private", "deploy-cluster", "deploy-host"];
|
|
9
|
+
/** What runs, stores or routes inside the zones. `deploy-host` is a zone too:
|
|
10
|
+
* a machine with its workloads drawn inside, or a leaf when they are not. */
|
|
11
|
+
export declare const DEPLOY_NODE_TYPES: readonly ["deploy-service", "deploy-database", "deploy-queue", "deploy-storage", "deploy-load-balancer", "deploy-gateway", "deploy-firewall", "deploy-internet"];
|
|
12
|
+
export type DeployZoneType = (typeof DEPLOY_ZONE_TYPES)[number];
|
|
13
|
+
export type DeployNodeType = (typeof DEPLOY_NODE_TYPES)[number];
|
|
14
|
+
export declare const DEPLOY_TYPES: ReadonlySet<string>;
|
|
15
|
+
export declare const isDeploymentNode: (n: DiagramNode) => boolean;
|
|
16
|
+
export declare const isDeployZone: (n: DiagramNode) => boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** The notation id a plane (or the model) declares to be drawn as a deployment
|
|
2
|
+
* diagram: where software runs, and the networks and zones around it. */
|
|
3
|
+
export const DEPLOY_NOTATION = 'deployment';
|
|
4
|
+
/** Zones: containers whose boundary IS the information — what a box sits inside
|
|
5
|
+
* (a private subnet, an availability zone) says how it is reached and what it
|
|
6
|
+
* fails with. Outermost first, which is also the order they usually nest in. */
|
|
7
|
+
export const DEPLOY_ZONE_TYPES = [
|
|
8
|
+
'deploy-environment',
|
|
9
|
+
'deploy-region',
|
|
10
|
+
'deploy-zone',
|
|
11
|
+
'deploy-network',
|
|
12
|
+
'deploy-subnet-public',
|
|
13
|
+
'deploy-subnet-private',
|
|
14
|
+
'deploy-cluster',
|
|
15
|
+
'deploy-host',
|
|
16
|
+
];
|
|
17
|
+
/** What runs, stores or routes inside the zones. `deploy-host` is a zone too:
|
|
18
|
+
* a machine with its workloads drawn inside, or a leaf when they are not. */
|
|
19
|
+
export const DEPLOY_NODE_TYPES = [
|
|
20
|
+
'deploy-service',
|
|
21
|
+
'deploy-database',
|
|
22
|
+
'deploy-queue',
|
|
23
|
+
'deploy-storage',
|
|
24
|
+
'deploy-load-balancer',
|
|
25
|
+
'deploy-gateway',
|
|
26
|
+
'deploy-firewall',
|
|
27
|
+
'deploy-internet',
|
|
28
|
+
];
|
|
29
|
+
export const DEPLOY_TYPES = new Set([...DEPLOY_ZONE_TYPES, ...DEPLOY_NODE_TYPES]);
|
|
30
|
+
const ZONES = new Set(DEPLOY_ZONE_TYPES);
|
|
31
|
+
export const isDeploymentNode = (n) => n.type !== undefined && DEPLOY_TYPES.has(n.type);
|
|
32
|
+
export const isDeployZone = (n) => n.type !== undefined && ZONES.has(n.type);
|
package/dist/index.d.ts
CHANGED
|
@@ -25,4 +25,5 @@ export { GIT_KINDS, GIT_NOTATION, GIT_STAGE_TYPE, gapOf, gitGraph, isGitKind, la
|
|
|
25
25
|
export { SECOND_ORDER_NOTATION, SO_CONSEQUENCE_TYPES, SO_DECISION_TYPE, SO_LEADS_TO_KIND, consequenceOrders, consequenceTypeOf, isSecondOrderNode, valenceOf, type ConsequenceOrders, type Valence, } from './second-order.js';
|
|
26
26
|
export { FB_CATEGORY_TYPE, FB_CAUSE_OF_KIND, FB_CAUSE_TYPE, FB_EFFECT_TYPE, FISHBONE_NOTATION, FISHBONE_PRESET_NAMES, FISHBONE_PRESETS, FISHBONE_TYPES, fishboneParents, fishboneTree, isFishboneNode, presetId, type FishboneCategory, type FishboneCause, type FishbonePreset, type FishboneTree, } from './fishbone.js';
|
|
27
27
|
export { TM_NOTATION, TM_ENTITY_TYPE, TM_PROCESS_TYPE, TM_STORE_TYPE, TM_BOUNDARY_TYPE, TM_FLOW_KIND, TM_TYPES, STRIDE_NAMES, NEW_THREAT_TITLE, isThreatModelNode, isOpen, strideFor, boundaryOf, boundaryName, crossings, crossingLabel, threatRegister, threatSummary, threatTargetKey, threatsOf, nextThreatId, nextThreatStatus, allNotesOpen, type ThreatTarget, type Crossing, type ThreatRow, } from './threat-model.js';
|
|
28
|
+
export { DEPLOY_NOTATION, DEPLOY_ZONE_TYPES, DEPLOY_NODE_TYPES, DEPLOY_TYPES, isDeploymentNode, isDeployZone, type DeployZoneType, type DeployNodeType, } from './deployment.js';
|
|
28
29
|
export { PLAN_NOTATION, PLAN_ZONE_TYPE, PLAN_EVENT_TYPE, PLAN_PERSON_TYPE, PLAN_TEAM_TYPE, PLAN_ACTOR_TYPES, PLAN_TYPES, PLAN_ROLES, isPlanZone, isPlanEvent, isPlanActor, isPlanRole, dayOf, isoOf, spanOf, atOf, rolesOf, planGraph, planSubtree, type PlanRole, type PlanSpan, type PlanRoles, type PlanGraph, type PlanChildren, } from './plan.js';
|
package/dist/index.js
CHANGED
|
@@ -45,4 +45,5 @@ export { GIT_KINDS, GIT_NOTATION, GIT_STAGE_TYPE, gapOf, gitGraph, isGitKind, la
|
|
|
45
45
|
export { SECOND_ORDER_NOTATION, SO_CONSEQUENCE_TYPES, SO_DECISION_TYPE, SO_LEADS_TO_KIND, consequenceOrders, consequenceTypeOf, isSecondOrderNode, valenceOf, } from './second-order.js';
|
|
46
46
|
export { FB_CATEGORY_TYPE, FB_CAUSE_OF_KIND, FB_CAUSE_TYPE, FB_EFFECT_TYPE, FISHBONE_NOTATION, FISHBONE_PRESET_NAMES, FISHBONE_PRESETS, FISHBONE_TYPES, fishboneParents, fishboneTree, isFishboneNode, presetId, } from './fishbone.js';
|
|
47
47
|
export { TM_NOTATION, TM_ENTITY_TYPE, TM_PROCESS_TYPE, TM_STORE_TYPE, TM_BOUNDARY_TYPE, TM_FLOW_KIND, TM_TYPES, STRIDE_NAMES, NEW_THREAT_TITLE, isThreatModelNode, isOpen, strideFor, boundaryOf, boundaryName, crossings, crossingLabel, threatRegister, threatSummary, threatTargetKey, threatsOf, nextThreatId, nextThreatStatus, allNotesOpen, } from './threat-model.js';
|
|
48
|
+
export { DEPLOY_NOTATION, DEPLOY_ZONE_TYPES, DEPLOY_NODE_TYPES, DEPLOY_TYPES, isDeploymentNode, isDeployZone, } from './deployment.js';
|
|
48
49
|
export { PLAN_NOTATION, PLAN_ZONE_TYPE, PLAN_EVENT_TYPE, PLAN_PERSON_TYPE, PLAN_TEAM_TYPE, PLAN_ACTOR_TYPES, PLAN_TYPES, PLAN_ROLES, isPlanZone, isPlanEvent, isPlanActor, isPlanRole, dayOf, isoOf, spanOf, atOf, rolesOf, planGraph, planSubtree, } from './plan.js';
|
package/dist/types.d.ts
CHANGED
|
@@ -418,6 +418,6 @@ export interface Drawings {
|
|
|
418
418
|
}
|
|
419
419
|
/** Pen width when a stroke names none. In core so editor and renderer cannot drift. */
|
|
420
420
|
export declare const DEFAULT_STROKE_WIDTH = 3;
|
|
421
|
-
export declare const BUILTIN_NOTATIONS: readonly ["causal-loop", "git-graph", "c4", "second-order", "fishbone", "threat-model", "plan"];
|
|
421
|
+
export declare const BUILTIN_NOTATIONS: readonly ["causal-loop", "git-graph", "c4", "second-order", "fishbone", "threat-model", "plan", "deployment"];
|
|
422
422
|
export type NotationId = (typeof BUILTIN_NOTATIONS)[number];
|
|
423
423
|
export type Polarity = '+' | '-';
|
package/dist/types.js
CHANGED
|
@@ -26,4 +26,4 @@ export const LEGEND_SECTIONS = ['layers', 'kinds', 'types', 'marks'];
|
|
|
26
26
|
export const LEGEND_POSITIONS = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];
|
|
27
27
|
/** Pen width when a stroke names none. In core so editor and renderer cannot drift. */
|
|
28
28
|
export const DEFAULT_STROKE_WIDTH = 3;
|
|
29
|
-
export const BUILTIN_NOTATIONS = ['causal-loop', 'git-graph', 'c4', 'second-order', 'fishbone', 'threat-model', 'plan'];
|
|
29
|
+
export const BUILTIN_NOTATIONS = ['causal-loop', 'git-graph', 'c4', 'second-order', 'fishbone', 'threat-model', 'plan', 'deployment'];
|