Skip to content

Commit f5f74f4

Browse files
authored
Use Improved TypeDoc (#79)
1 parent 961ce87 commit f5f74f4

14 files changed

+873
-616
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.1.3 - 2020-12-10
2+
- Update TypeDoc to `0.20.0-beta.26` and update our `typedoc.js` to improve documentation layout.
3+
- Move "fieldKey" modules to top-level so they better align with how they're actually exported.
4+
- Improve documentation for filters and their types. Done as part of an exercise to see how TypeDoc handled inline docs.
5+
- Fix issues [42014](https://www.labkey.org/home/Developer/issues/issues-details.view?issueId=42014) and [40724](https://www.labkey.org/home/Developer/issues/issues-details.view?issueId=40724) with improvements to `Domain` documentation.
6+
- Package updates.
7+
18
## 1.1.2 - 2020-12-09
29
- [41969](https://www.labkey.org/home/Developer/issues/issues-details.view?issueId=41969): Fix MultiRequest to return instance. Add unit tests.
310

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@labkey/api",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "JavaScript client API for LabKey Server",
55
"scripts": {
66
"build": "npm run build:dist && npm run build:docs",
@@ -38,21 +38,21 @@
3838
"registry": "https://artifactory.labkey.com/artifactory/api/npm/libs-client"
3939
},
4040
"devDependencies": {
41-
"@babel/core": "7.12.3",
42-
"@types/jest": "26.0.15",
43-
"@types/sinon": "9.0.8",
44-
"cross-env": "7.0.2",
41+
"@babel/core": "7.12.9",
42+
"@types/jest": "26.0.17",
43+
"@types/sinon": "9.0.9",
44+
"cross-env": "7.0.3",
4545
"gh-pages": "3.1.0",
46-
"jest": "26.6.1",
46+
"jest": "26.6.3",
4747
"jest-teamcity-reporter": "0.9.0",
4848
"rimraf": "3.0.2",
49-
"sinon": "9.2.0",
50-
"ts-jest": "26.4.2",
51-
"ts-loader": "8.0.7",
52-
"typedoc": "0.19.2",
53-
"typescript": "4.0.3",
54-
"webpack": "5.2.0",
55-
"webpack-cli": "4.1.0"
49+
"sinon": "9.2.1",
50+
"ts-jest": "26.4.4",
51+
"ts-loader": "8.0.11",
52+
"typedoc": "0.20.0-beta.26",
53+
"typescript": "4.1.2",
54+
"webpack": "5.10.0",
55+
"webpack-cli": "4.2.0"
5656
},
5757
"jest": {
5858
"globals": {

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ import * as Assay from './labkey/Assay';
3434
import * as Domain from './labkey/Domain';
3535
import * as Exp from './labkey/Exp';
3636
import * as Experiment from './labkey/Experiment';
37-
import { FieldKey } from './labkey/fieldKey/FieldKey';
37+
import { FieldKey } from './labkey/FieldKey';
3838
import * as Filter from './labkey/Filter';
3939
import * as List from './labkey/List';
4040
import { MultiRequest } from './labkey/MultiRequest';
4141
import * as Message from './labkey/Message';
4242
import * as ParticipantGroup from './labkey/ParticipantGroup';
4343
import * as Pipeline from './labkey/Pipeline';
4444
import * as Query from './labkey/Query';
45-
import { QueryKey } from './labkey/fieldKey/QueryKey';
45+
import { QueryKey } from './labkey/QueryKey';
4646
import * as Report from './labkey/Report';
47-
import { SchemaKey } from './labkey/fieldKey/SchemaKey';
47+
import { SchemaKey } from './labkey/SchemaKey';
4848
import * as Security from './labkey/Security';
4949
import * as Specimen from './labkey/Specimen';
5050
import * as Utils from './labkey/Utils';

src/labkey/Domain.ts

Lines changed: 69 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,39 @@ export interface DomainDesign {
4242
description?: string
4343
/**
4444
* 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)
5145
* - 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)
5547
* - 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)
5749
* - lookupContainer:</b> If this domain field is a lookup, this holds the container in which to look. (string)
5850
* - lookupSchema:</b> If this domain field is a lookup, this holds the schema in which to look. (string)
5951
* - 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)
6076
*/
61-
fields?: any[]
77+
fields?: any[] // TODO: Convert this into a type "DomainField[]"
6278
/**
6379
* An array of objects that each designate an index upon the domain. Each object has the following properties
6480
* - 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 {
89105
domainTemplate?: string
90106
/** When using a domain template, import initial data associated in the template. Defaults to true. */
91107
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+
*/
93117
kind?: string
94118
/** The name of a module that contains the domain template group. */
95119
module?: string
@@ -101,45 +125,51 @@ export interface CreateDomainOptions extends RequestCallbackOptions {
101125
/**
102126
* Create a new domain with the given kind, domainDesign, and options or
103127
* 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}.
107132
*
108133
* ```js
109134
* 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+
* },
124154
* });
125155
* ```
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):
127157
* ```js
128158
* 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,
133163
* });
134164
* ```
135165
* Import the initial data from the domain template of a previously created domain:
136166
* ```js
137167
* 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,
143173
* });
144174
* ```
145175
*/

src/labkey/fieldKey/FieldKey.ts renamed to src/labkey/FieldKey.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import { isString } from '../Utils'
17-
16+
import { isString } from './Utils'
1817
import { QueryKey } from './QueryKey'
1918

2019
export class FieldKey extends QueryKey {
File renamed without changes.

src/labkey/fieldKey/SchemaKey.ts renamed to src/labkey/SchemaKey.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import { isString } from '../Utils'
17-
16+
import { isString } from './Utils'
1817
import { QueryKey } from './QueryKey'
1918

2019
export class SchemaKey extends QueryKey {

src/labkey/constants.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,18 @@ export function setGlobalUser(user: UserWithPermissions): LabKey {
177177

178178
// The following will be removed in favor of a proper "global" initialization pattern. For now,
179179
// just throw an error if the world hasn't been setup (aka labkey.js wasn't loaded prior)
180+
/**
181+
* @hidden
182+
* @private
183+
*/
180184
class _Window extends Window {
181185
LABKEY: any
182186
}
187+
188+
/**
189+
* @hidden
190+
* @private
191+
*/
183192
declare const window: _Window;
184193

185194
if (!window.LABKEY) {

0 commit comments

Comments
 (0)