@@ -42,23 +42,39 @@ export interface DomainDesign {
42
42
description ?: string
43
43
/**
44
44
* An array of objects that each describe a domain field. Each object has the following properties:
45
- * - propertyId : The unique ID of this field.
46
- * - propertyURI:</b> The URI of this field. (string)
47
- * - ontologyURI:</b> The URI of the ontology this field belongs to. (string)
48
- * - name:</b> The name of this field. (string)
49
- * - description:</b> The description of this field (may be blank). (string)
50
- * - rangeURI:</b> The URI for this field's range definition. (string)
51
45
* - conceptURI:</b> The URI of this field's concept. (string)
52
- * - label:</b> The friendly label for this field. (string)
53
- * - searchTerms:</b> The search terms for this field. (string)
54
- * - semanticType:</b> The semantic type of this field. (string)
46
+ * - description:</b> The description of this field (may be blank). (string)
55
47
* - format:</b> The format string defined for this field. (string)
56
- * - required :</b> Indicates whether this field is required to have a value (i.e. cannot be null). (boolean )
48
+ * - label :</b> The friendly label for this field. (string )
57
49
* - lookupContainer:</b> If this domain field is a lookup, this holds the container in which to look. (string)
58
50
* - lookupSchema:</b> If this domain field is a lookup, this holds the schema in which to look. (string)
59
51
* - lookupQuery:</b> if this domain field is a lookup, this holds the query in which to look. (string)
52
+ * - name:</b> The name of this field. (string)
53
+ * - propertyId : The unique ID of this field.
54
+ * - propertyURI:</b> The URI of this field. (string)
55
+ * - ontologyURI:</b> The URI of the ontology this field belongs to. (string)
56
+ * - rangeURI:</b> The URI for this field's range definition. Accepted values:
57
+ * - attachment
58
+ * - binary
59
+ * - boolean
60
+ * - date
61
+ * - dateTime
62
+ * - decimal
63
+ * - double
64
+ * - fileLink
65
+ * - float
66
+ * - int
67
+ * - long
68
+ * - multiLine
69
+ * - Resource
70
+ * - string
71
+ * - text-xml
72
+ * - time
73
+ * - required:</b> Indicates whether this field is required to have a value (i.e. cannot be null). (boolean)
74
+ * - searchTerms:</b> The search terms for this field. (string)
75
+ * - semanticType:</b> The semantic type of this field. (string)
60
76
*/
61
- fields ?: any [ ]
77
+ fields ?: any [ ] // TODO: Convert this into a type "DomainField[]"
62
78
/**
63
79
* An array of objects that each designate an index upon the domain. Each object has the following properties
64
80
* - columnNames : An array of strings, where each string is the name of a domain field that will be an index. (array).
@@ -89,7 +105,15 @@ export interface CreateDomainOptions extends RequestCallbackOptions {
89
105
domainTemplate ?: string
90
106
/** When using a domain template, import initial data associated in the template. Defaults to true. */
91
107
importData ?: boolean
92
- /** The domain kind to create. One of "IntList", "VarList", "SampleSet", or "DataClass". */
108
+ /**
109
+ * The domain kind to create. Currently supported:
110
+ * - DataClass
111
+ * - IntList
112
+ * - SampleSet
113
+ * - StudyDatasetDate
114
+ * - StudyDatasetVisit
115
+ * - VarList
116
+ */
93
117
kind ?: string
94
118
/** The name of a module that contains the domain template group. */
95
119
module ?: string
@@ -101,45 +125,51 @@ export interface CreateDomainOptions extends RequestCallbackOptions {
101
125
/**
102
126
* Create a new domain with the given kind, domainDesign, and options or
103
127
* specify a [domain template](https://www.labkey.org/Documentation/wiki-page.view?name=domainTemplates)
104
- * to use for the domain creation. Not all domain kinds can be created through this API.
105
- * Currently supported domain kinds are: "IntList", "VarList", "SampleSet", "DataClass",
106
- * "StudyDatasetDate", "StudyDatasetVisit".
128
+ * to use for the domain creation. Not all domain kinds can be created through this API. See {@link CreateDomainOptions.kind}
129
+ * for supported domain kinds.
130
+ *
131
+ * For each domain you can specify each field's metadata. The properties for field's can be found on {@link DomainDesign.fields}.
107
132
*
108
133
* ```js
109
134
* LABKEY.Domain.create({
110
- * kind: "IntList",
111
- * domainDesign: {
112
- * name: "LookupCodes",
113
- * description: "integer key list",
114
- * fields: [{
115
- * name: "id", rangeURI: "int"
116
- * },{
117
- * name: "code",
118
- * rangeURI: "string", scale: 4
119
- * }]
120
- * },
121
- * options: {
122
- * keyName: "id"
123
- * }
135
+ * kind: 'IntList',
136
+ * domainDesign: {
137
+ * name: 'LookupCodes',
138
+ * description: 'integer key list',
139
+ * fields: [{
140
+ * name: 'id',
141
+ * rangeURI: 'int',
142
+ * },{
143
+ * name: 'code',
144
+ * rangeURI: 'string',
145
+ * scale: 4,
146
+ * }]
147
+ * },
148
+ * // Domain kind specific options
149
+ * options: {
150
+ * // These options are specific to an 'IntList'
151
+ * keyName: 'id',
152
+ * keyType: 'Integer', // or 'AutoIncrementInteger'
153
+ * },
124
154
* });
125
155
* ```
126
- * Create domain from a [domain template](https://www.labkey.org/Documentation/wiki-page.view?name=domainTemplates)
156
+ * Create domain from a [domain template](https://www.labkey.org/Documentation/wiki-page.view?name=domainTemplates):
127
157
* ```js
128
158
* LABKEY.Domain.create({
129
- * module: " mymodule" ,
130
- * domainGroup: " codes" ,
131
- * domainTemplate: " LookupCodes" ,
132
- * importData: false
159
+ * module: ' mymodule' ,
160
+ * domainGroup: ' codes' ,
161
+ * domainTemplate: ' LookupCodes' ,
162
+ * importData: false,
133
163
* });
134
164
* ```
135
165
* Import the initial data from the domain template of a previously created domain:
136
166
* ```js
137
167
* LABKEY.Domain.create({
138
- * module: " mymodule" ,
139
- * domainGroup: " codes" ,
140
- * domainTemplate: " LookupCodes" ,
141
- * createDomain: false,
142
- * importData: true
168
+ * module: ' mymodule' ,
169
+ * domainGroup: ' codes' ,
170
+ * domainTemplate: ' LookupCodes' ,
171
+ * createDomain: false,
172
+ * importData: true,
143
173
* });
144
174
* ```
145
175
*/
0 commit comments