Skip to content

Commit 7090739

Browse files
Add setSupertype docs to nodejs thing types (#598)
## Usage and product changes We add missing documentation for the `setSupertype` concept API in the NodeJS Driver.
1 parent 2ae33a5 commit 7090739

File tree

6 files changed

+67
-8
lines changed

6 files changed

+67
-8
lines changed

nodejs/api/concept/type/AttributeType.ts

+13
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,19 @@ export interface AttributeType extends ThingType {
9696

9797
/** @inheritdoc */
9898
getSupertype(transaction: TypeDBTransaction): Promise<AttributeType>;
99+
100+
/**
101+
* Sets the supplied <code>AttributeType</code> as the supertype of the current <code>AttributeType</code>.
102+
*
103+
* ### Examples
104+
*
105+
* ```ts
106+
* attributeType.setSupertype(transaction, superAttributeType).resolve();
107+
* ```
108+
*
109+
* @param transaction The current transaction
110+
* @param superAttributeType The <code>AttributeType</code> to set as the supertype of this <code>AttributeType</code>
111+
*/
99112
setSupertype(transaction: TypeDBTransaction, type: AttributeType): Promise<void>;
100113

101114
/** @inheritdoc */

nodejs/api/concept/type/EntityType.ts

+13
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@ export interface EntityType extends ThingType {
3333

3434
/** @inheritDoc */
3535
getSupertype(transaction: TypeDBTransaction): Promise<EntityType>;
36+
37+
/**
38+
* Sets the supplied <code>EntityType</code> as the supertype of the current <code>EntityType</code>.
39+
*
40+
* ### Examples
41+
*
42+
* ```ts
43+
* entityType.setSupertype(transaction, superEntityType).resolve();
44+
* ```
45+
*
46+
* @param transaction The current transaction
47+
* @param superEntityType The <code>EntityType</code> to set as the supertype of this <code>EntityType</code>
48+
*/
3649
setSupertype(transaction: TypeDBTransaction, superEntityType: EntityType): Promise<void>;
3750

3851
/** @inheritDoc */

nodejs/api/concept/type/RelationType.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,19 @@ export interface RelationType extends ThingType {
4444

4545
/** @inheritDoc */
4646
getSupertype(transaction: TypeDBTransaction): Promise<RelationType | null>;
47-
/** @inheritDoc */
47+
48+
/**
49+
* Sets the supplied <code>RelationType</code> as the supertype of the current <code>RelationType</code>.
50+
*
51+
* ### Examples
52+
*
53+
* ```ts
54+
* relationType.setSupertype(transaction, superRelationType).resolve();
55+
* ```
56+
*
57+
* @param transaction The current transaction
58+
* @param superRelationType The <code>RelationType</code> to set as the supertype of this <code>RelationType</code>
59+
*/
4860
setSupertype(transaction: TypeDBTransaction, type: RelationType): Promise<void>;
4961

5062
/** @inheritDoc */

nodejs/docs/schema/AttributeType.adoc

+9-2
Original file line numberDiff line numberDiff line change
@@ -1989,22 +1989,29 @@ attributeType.setRegex(transaction, regex)
19891989
setSupertype(transaction, type): Promise<void>
19901990
----
19911991
1992-
1992+
Sets the supplied ``AttributeType`` as the supertype of the current ``AttributeType``.
19931993
19941994
[caption=""]
19951995
.Input parameters
19961996
[cols="~,~,~"]
19971997
[options="header"]
19981998
|===
19991999
|Name |Description |Type
2000-
a| `transaction` a| a| `TypeDBTransaction`
2000+
a| `transaction` a| The current transaction a| `TypeDBTransaction`
20012001
a| `type` a| a| `AttributeType`
20022002
|===
20032003
20042004
[caption=""]
20052005
.Returns
20062006
`Promise<void>`
20072007
2008+
[caption=""]
2009+
.Code examples
2010+
[source,nodejs]
2011+
----
2012+
attributeType.setSupertype(transaction, superAttributeType).resolve();
2013+
----
2014+
20082015
[#_AttributeType_unsetAbstract__transaction_TypeDBTransaction]
20092016
==== unsetAbstract
20102017

nodejs/docs/schema/EntityType.adoc

+10-3
Original file line numberDiff line numberDiff line change
@@ -1425,22 +1425,29 @@ thingType.setPlays(transaction, role) thingType.setPlays(transaction, role, over
14251425
setSupertype(transaction, superEntityType): Promise<void>
14261426
----
14271427
1428-
1428+
Sets the supplied ``EntityType`` as the supertype of the current ``EntityType``.
14291429
14301430
[caption=""]
14311431
.Input parameters
14321432
[cols="~,~,~"]
14331433
[options="header"]
14341434
|===
14351435
|Name |Description |Type
1436-
a| `transaction` a| a| `TypeDBTransaction`
1437-
a| `superEntityType` a| a| `EntityType`
1436+
a| `transaction` a| The current transaction a| `TypeDBTransaction`
1437+
a| `superEntityType` a| The ``EntityType`` to set as the supertype of this ``EntityType`` a| `EntityType`
14381438
|===
14391439
14401440
[caption=""]
14411441
.Returns
14421442
`Promise<void>`
14431443
1444+
[caption=""]
1445+
.Code examples
1446+
[source,nodejs]
1447+
----
1448+
entityType.setSupertype(transaction, superEntityType).resolve();
1449+
----
1450+
14441451
[#_EntityType_unsetAbstract__transaction_TypeDBTransaction]
14451452
==== unsetAbstract
14461453

nodejs/docs/schema/RelationType.adoc

+9-2
Original file line numberDiff line numberDiff line change
@@ -1573,22 +1573,29 @@ relationType.setRelates(transaction, roleLabel) relationType.setRelates(transact
15731573
setSupertype(transaction, type): Promise<void>
15741574
----
15751575
1576-
1576+
Sets the supplied ``RelationType`` as the supertype of the current ``RelationType``.
15771577
15781578
[caption=""]
15791579
.Input parameters
15801580
[cols="~,~,~"]
15811581
[options="header"]
15821582
|===
15831583
|Name |Description |Type
1584-
a| `transaction` a| a| `TypeDBTransaction`
1584+
a| `transaction` a| The current transaction a| `TypeDBTransaction`
15851585
a| `type` a| a| `RelationType`
15861586
|===
15871587
15881588
[caption=""]
15891589
.Returns
15901590
`Promise<void>`
15911591
1592+
[caption=""]
1593+
.Code examples
1594+
[source,nodejs]
1595+
----
1596+
relationType.setSupertype(transaction, superRelationType).resolve();
1597+
----
1598+
15921599
[#_RelationType_unsetAbstract__transaction_TypeDBTransaction]
15931600
==== unsetAbstract
15941601

0 commit comments

Comments
 (0)