@istar-ts/core 0.15.0-beta.8 → 0.15.0-beta.9
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/index.cjs +44 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +44 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -233,7 +233,8 @@ function addElementKind(table, declaration) {
|
|
|
233
233
|
pistarType: type,
|
|
234
234
|
...table.extension !== void 0 ? { extension: table.extension } : {},
|
|
235
235
|
...declaration.shape ? { shape: declaration.shape } : {},
|
|
236
|
-
...declaration.textBox ? { textBox: declaration.textBox } : {}
|
|
236
|
+
...declaration.textBox ? { textBox: declaration.textBox } : {},
|
|
237
|
+
...declaration.description !== void 0 ? { description: declaration.description } : {}
|
|
237
238
|
};
|
|
238
239
|
table.elements.set(kind, definition);
|
|
239
240
|
table.elementsByType.set(type, kind);
|
|
@@ -274,7 +275,8 @@ function addLinkKind(table, declaration) {
|
|
|
274
275
|
...declaration.check ? { check: declaration.check } : {},
|
|
275
276
|
pistarType: type,
|
|
276
277
|
...table.extension !== void 0 ? { extension: table.extension } : {},
|
|
277
|
-
...declaration.line ? { line: declaration.line } : {}
|
|
278
|
+
...declaration.line ? { line: declaration.line } : {},
|
|
279
|
+
...declaration.description !== void 0 ? { description: declaration.description } : {}
|
|
278
280
|
};
|
|
279
281
|
if (declaration.arity !== "n") {
|
|
280
282
|
table.links.set(kind, definition);
|
|
@@ -325,7 +327,8 @@ function addHubKinds(table, base, parts, hubSize) {
|
|
|
325
327
|
...owner,
|
|
326
328
|
shape: HUB_SHAPE,
|
|
327
329
|
role: "hub",
|
|
328
|
-
of: base.kind
|
|
330
|
+
of: base.kind,
|
|
331
|
+
description: `The point where ${base.label}'s sources join on their way to its target, drawn as a small circle; not an intentional element in its own right.`
|
|
329
332
|
});
|
|
330
333
|
table.elementsByType.set(`${base.pistarType}Hub`, parts.hub);
|
|
331
334
|
const common = {
|
|
@@ -347,7 +350,8 @@ function addHubKinds(table, base, parts, hubSize) {
|
|
|
347
350
|
unique: "kind"
|
|
348
351
|
},
|
|
349
352
|
pistarType: `${base.pistarType}Start`,
|
|
350
|
-
role: "leg"
|
|
353
|
+
role: "leg",
|
|
354
|
+
description: `One source's leg of a ${base.label} link, drawn from the source to the shared hub.`
|
|
351
355
|
});
|
|
352
356
|
table.linksByType.set(`${base.pistarType}Start`, parts.leg);
|
|
353
357
|
claim(parts.end, `${base.pistarType}End`, "link");
|
|
@@ -365,7 +369,8 @@ function addHubKinds(table, base, parts, hubSize) {
|
|
|
365
369
|
},
|
|
366
370
|
pistarType: `${base.pistarType}End`,
|
|
367
371
|
...base.line ? { line: base.line } : {},
|
|
368
|
-
role: "end"
|
|
372
|
+
role: "end",
|
|
373
|
+
description: `The ${base.label} link's hub-to-target leg, carrying the link's own meaning.`
|
|
369
374
|
});
|
|
370
375
|
table.linksByType.set(`${base.pistarType}End`, parts.end);
|
|
371
376
|
}
|
|
@@ -413,12 +418,40 @@ const ISTAR_LINK_LABELS = {
|
|
|
413
418
|
"istar.QualificationLink": "Qualification",
|
|
414
419
|
"istar.ContributionLink": "Contribution"
|
|
415
420
|
};
|
|
421
|
+
/**
|
|
422
|
+
* Base descriptions of iStar 2.0's kinds, written in our own words from the **iStar 2.0 Language
|
|
423
|
+
* Guide** (Dalpiaz, Franch & Horkoff, arXiv:1605.07767, 2016, CC BY 4.0): actors and intentional
|
|
424
|
+
* elements (§§2 and 4), actor links (§3), dependencies (§5) and intentional-element links (§6).
|
|
425
|
+
*/
|
|
426
|
+
const ISTAR_ELEMENT_DESCRIPTIONS = {
|
|
427
|
+
"istar.Actor": "An intentional, autonomous entity that has strategic goals and exercises know-how to pursue them, alone or with other actors (iStar 2.0 Language Guide §2). Use plain Actor when neither Agent nor Role fits better.",
|
|
428
|
+
"istar.Agent": "An actor with a concrete, physical manifestation — a specific person, organisation or software system (iStar 2.0 Language Guide §2). Use it instead of Role for a named, identifiable participant rather than an abstract part anyone could play.",
|
|
429
|
+
"istar.Role": "An abstract characterisation of an actor's behaviour within some context, independent of who plays it (iStar 2.0 Language Guide §2). Use it instead of Agent when several concrete actors could fill the same part.",
|
|
430
|
+
"istar.Goal": "A state of affairs an actor wants achieved, with a clear-cut criterion for whether it is met (iStar 2.0 Language Guide §4). Unlike a Quality, a Goal is either achieved or not; unlike a Task, it says what to achieve, not how.",
|
|
431
|
+
"istar.Quality": "An attribute an actor wants some degree of, with no binary success criterion — it is satisficed rather than achieved outright (iStar 2.0 Language Guide §4). Use it instead of Goal for non-functional concerns (e.g. performance, usability) that admit degrees.",
|
|
432
|
+
"istar.Task": "A course of action an actor wants carried out, usually to achieve a Goal, satisfice a Quality, or produce or consume a Resource (iStar 2.0 Language Guide §4). Unlike a Goal, it specifies how, not just what.",
|
|
433
|
+
"istar.Resource": "A physical or informational entity an actor needs available to perform a Task (iStar 2.0 Language Guide §4). Its mere availability, not its satisfaction, is what matters — it has no intentional content of its own."
|
|
434
|
+
};
|
|
435
|
+
/**
|
|
436
|
+
* Base descriptions of iStar 2.0's link kinds (see `ISTAR_ELEMENT_DESCRIPTIONS` for the source).
|
|
437
|
+
*/
|
|
438
|
+
const ISTAR_LINK_DESCRIPTIONS = {
|
|
439
|
+
"istar.IsALink": "Generalisation/specialisation between two actors of the same category — two Roles, or two general Actors (iStar 2.0 Language Guide §3): the specific actor inherits the general one's properties.",
|
|
440
|
+
"istar.ParticipatesInLink": "Any association between two actors other than generalisation/specialisation, e.g. an Agent playing a Role (iStar 2.0 Language Guide §3). Unlike Is-A, it places no restriction on the actors' categories.",
|
|
441
|
+
"istar.DependencyLink": "A social relationship in which a depender actor relies on a dependee actor for a dependum (a Goal, Quality, Task or Resource) it cannot, or prefers not to, provide for itself (iStar 2.0 Language Guide §5).",
|
|
442
|
+
"istar.AndRefinementLink": "Decomposes an intentional element into sub-elements that must *all* be satisfied for the parent to be satisfied (iStar 2.0 Language Guide §6.1). Contrast with Or-Refinement, where any one alternative suffices.",
|
|
443
|
+
"istar.OrRefinementLink": "Decomposes an intentional element into alternative sub-elements, any *one* of which satisfies the parent (iStar 2.0 Language Guide §6.1). Contrast with And-Refinement, which needs every child.",
|
|
444
|
+
"istar.NeededByLink": "Links a Task to the Resource it requires in order to be performed (iStar 2.0 Language Guide §6.2).",
|
|
445
|
+
"istar.QualificationLink": "Links a Quality to the Goal, Task or Resource it qualifies, expressing a desired attribute of that element's achievement, execution or provision (iStar 2.0 Language Guide §6.4).",
|
|
446
|
+
"istar.ContributionLink": "Expresses how satisfying one intentional element affects another, with a strength from 'make' (sufficient positive evidence) through 'help' (partial positive) and 'hurt' (partial negative) to 'break' (sufficient negative evidence) (iStar 2.0 Language Guide §6.3). Unlike a Refinement, it is a weaker, quantifiable influence rather than a decomposition."
|
|
447
|
+
};
|
|
416
448
|
function istarLinks(kinds, category) {
|
|
417
449
|
return kinds.map((kind) => ({
|
|
418
450
|
kind,
|
|
419
451
|
category,
|
|
420
452
|
label: ISTAR_LINK_LABELS[kind],
|
|
421
|
-
info: LINK_KIND_INFO[kind]
|
|
453
|
+
info: LINK_KIND_INFO[kind],
|
|
454
|
+
description: ISTAR_LINK_DESCRIPTIONS[kind]
|
|
422
455
|
}));
|
|
423
456
|
}
|
|
424
457
|
/** iStar 2.0's declaration, built from the constants in `metamodel.ts`. */
|
|
@@ -428,12 +461,14 @@ const ISTAR_2_0_DECLARATION = {
|
|
|
428
461
|
elements: [...ACTOR_KINDS.map((kind) => ({
|
|
429
462
|
kind,
|
|
430
463
|
category: "actor",
|
|
431
|
-
size: DEFAULT_ELEMENT_SIZE[kind]
|
|
464
|
+
size: DEFAULT_ELEMENT_SIZE[kind],
|
|
465
|
+
description: ISTAR_ELEMENT_DESCRIPTIONS[kind]
|
|
432
466
|
})), ...NODE_KINDS.map((kind) => ({
|
|
433
467
|
kind,
|
|
434
468
|
category: "node",
|
|
435
469
|
size: DEFAULT_ELEMENT_SIZE[kind],
|
|
436
|
-
info: NODE_KIND_INFO[kind]
|
|
470
|
+
info: NODE_KIND_INFO[kind],
|
|
471
|
+
description: ISTAR_ELEMENT_DESCRIPTIONS[kind]
|
|
437
472
|
}))],
|
|
438
473
|
links: [
|
|
439
474
|
...istarLinks(ACTOR_LINK_KINDS, "actor"),
|
|
@@ -1399,6 +1434,7 @@ function validateFileMetamodel(value, path = FILE_METAMODEL_KEY) {
|
|
|
1399
1434
|
optionalString(entry, "label", at);
|
|
1400
1435
|
optionalString(entry, "behavesLike", at);
|
|
1401
1436
|
optionalString(entry, "pistarType", at);
|
|
1437
|
+
optionalString(entry, "description", at);
|
|
1402
1438
|
if (kind === "element") {
|
|
1403
1439
|
if (entry.category !== void 0 && entry.category !== "node" && entry.category !== "actor") fail(`${at}.category`, "must be \"node\" or \"actor\"");
|
|
1404
1440
|
checkSize(entry.size, `${at}.size`);
|