Skip to content

Use Improved TypeDoc #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.1.3 - 2020-12-10
- Update TypeDoc to `0.20.0-beta.26` and update our `typedoc.js` to improve documentation layout.
- Move "fieldKey" modules to top-level so they better align with how they're actually exported.
- Improve documentation for filters and their types. Done as part of an exercise to see how TypeDoc handled inline docs.
- 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.
- Package updates.

## 1.1.2 - 2020-12-09
- [41969](https://www.labkey.org/home/Developer/issues/issues-details.view?issueId=41969): Fix MultiRequest to return instance. Add unit tests.

Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@labkey/api",
"version": "1.1.2",
"version": "1.1.3",
"description": "JavaScript client API for LabKey Server",
"scripts": {
"build": "npm run build:dist && npm run build:docs",
Expand Down Expand Up @@ -38,21 +38,21 @@
"registry": "https://artifactory.labkey.com/artifactory/api/npm/libs-client"
},
"devDependencies": {
"@babel/core": "7.12.3",
"@types/jest": "26.0.15",
"@types/sinon": "9.0.8",
"cross-env": "7.0.2",
"@babel/core": "7.12.9",
"@types/jest": "26.0.17",
"@types/sinon": "9.0.9",
"cross-env": "7.0.3",
"gh-pages": "3.1.0",
"jest": "26.6.1",
"jest": "26.6.3",
"jest-teamcity-reporter": "0.9.0",
"rimraf": "3.0.2",
"sinon": "9.2.0",
"ts-jest": "26.4.2",
"ts-loader": "8.0.7",
"typedoc": "0.19.2",
"typescript": "4.0.3",
"webpack": "5.2.0",
"webpack-cli": "4.1.0"
"sinon": "9.2.1",
"ts-jest": "26.4.4",
"ts-loader": "8.0.11",
"typedoc": "0.20.0-beta.26",
"typescript": "4.1.2",
"webpack": "5.10.0",
"webpack-cli": "4.2.0"
},
"jest": {
"globals": {
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ import * as Assay from './labkey/Assay';
import * as Domain from './labkey/Domain';
import * as Exp from './labkey/Exp';
import * as Experiment from './labkey/Experiment';
import { FieldKey } from './labkey/fieldKey/FieldKey';
import { FieldKey } from './labkey/FieldKey';
import * as Filter from './labkey/Filter';
import * as List from './labkey/List';
import { MultiRequest } from './labkey/MultiRequest';
import * as Message from './labkey/Message';
import * as ParticipantGroup from './labkey/ParticipantGroup';
import * as Pipeline from './labkey/Pipeline';
import * as Query from './labkey/Query';
import { QueryKey } from './labkey/fieldKey/QueryKey';
import { QueryKey } from './labkey/QueryKey';
import * as Report from './labkey/Report';
import { SchemaKey } from './labkey/fieldKey/SchemaKey';
import { SchemaKey } from './labkey/SchemaKey';
import * as Security from './labkey/Security';
import * as Specimen from './labkey/Specimen';
import * as Utils from './labkey/Utils';
Expand Down
108 changes: 69 additions & 39 deletions src/labkey/Domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,39 @@ export interface DomainDesign {
description?: string
/**
* An array of objects that each describe a domain field. Each object has the following properties:
* - propertyId : The unique ID of this field.
* - propertyURI:</b> The URI of this field. (string)
* - ontologyURI:</b> The URI of the ontology this field belongs to. (string)
* - name:</b> The name of this field. (string)
* - description:</b> The description of this field (may be blank). (string)
* - rangeURI:</b> The URI for this field's range definition. (string)
* - conceptURI:</b> The URI of this field's concept. (string)
* - label:</b> The friendly label for this field. (string)
* - searchTerms:</b> The search terms for this field. (string)
* - semanticType:</b> The semantic type of this field. (string)
* - description:</b> The description of this field (may be blank). (string)
* - format:</b> The format string defined for this field. (string)
* - required:</b> Indicates whether this field is required to have a value (i.e. cannot be null). (boolean)
* - label:</b> The friendly label for this field. (string)
* - lookupContainer:</b> If this domain field is a lookup, this holds the container in which to look. (string)
* - lookupSchema:</b> If this domain field is a lookup, this holds the schema in which to look. (string)
* - lookupQuery:</b> if this domain field is a lookup, this holds the query in which to look. (string)
* - name:</b> The name of this field. (string)
* - propertyId : The unique ID of this field.
* - propertyURI:</b> The URI of this field. (string)
* - ontologyURI:</b> The URI of the ontology this field belongs to. (string)
* - rangeURI:</b> The URI for this field's range definition. Accepted values:
* - attachment
* - binary
* - boolean
* - date
* - dateTime
* - decimal
* - double
* - fileLink
* - float
* - int
* - long
* - multiLine
* - Resource
* - string
* - text-xml
* - time
* - required:</b> Indicates whether this field is required to have a value (i.e. cannot be null). (boolean)
* - searchTerms:</b> The search terms for this field. (string)
* - semanticType:</b> The semantic type of this field. (string)
*/
fields?: any[]
fields?: any[] // TODO: Convert this into a type "DomainField[]"
/**
* An array of objects that each designate an index upon the domain. Each object has the following properties
* - columnNames : An array of strings, where each string is the name of a domain field that will be an index. (array).
Expand Down Expand Up @@ -89,7 +105,15 @@ export interface CreateDomainOptions extends RequestCallbackOptions {
domainTemplate?: string
/** When using a domain template, import initial data associated in the template. Defaults to true. */
importData?: boolean
/** The domain kind to create. One of "IntList", "VarList", "SampleSet", or "DataClass". */
/**
* The domain kind to create. Currently supported:
* - DataClass
* - IntList
* - SampleSet
* - StudyDatasetDate
* - StudyDatasetVisit
* - VarList
*/
kind?: string
/** The name of a module that contains the domain template group. */
module?: string
Expand All @@ -101,45 +125,51 @@ export interface CreateDomainOptions extends RequestCallbackOptions {
/**
* Create a new domain with the given kind, domainDesign, and options or
* specify a [domain template](https://www.labkey.org/Documentation/wiki-page.view?name=domainTemplates)
* to use for the domain creation. Not all domain kinds can be created through this API.
* Currently supported domain kinds are: "IntList", "VarList", "SampleSet", "DataClass",
* "StudyDatasetDate", "StudyDatasetVisit".
* to use for the domain creation. Not all domain kinds can be created through this API. See {@link CreateDomainOptions.kind}
* for supported domain kinds.
*
* For each domain you can specify each field's metadata. The properties for field's can be found on {@link DomainDesign.fields}.
*
* ```js
* LABKEY.Domain.create({
* kind: "IntList",
* domainDesign: {
* name: "LookupCodes",
* description: "integer key list",
* fields: [{
* name: "id", rangeURI: "int"
* },{
* name: "code",
* rangeURI: "string", scale: 4
* }]
* },
* options: {
* keyName: "id"
* }
* kind: 'IntList',
* domainDesign: {
* name: 'LookupCodes',
* description: 'integer key list',
* fields: [{
* name: 'id',
* rangeURI: 'int',
* },{
* name: 'code',
* rangeURI: 'string',
* scale: 4,
* }]
* },
* // Domain kind specific options
* options: {
* // These options are specific to an 'IntList'
* keyName: 'id',
* keyType: 'Integer', // or 'AutoIncrementInteger'
* },
* });
* ```
* Create domain from a [domain template](https://www.labkey.org/Documentation/wiki-page.view?name=domainTemplates)
* Create domain from a [domain template](https://www.labkey.org/Documentation/wiki-page.view?name=domainTemplates):
* ```js
* LABKEY.Domain.create({
* module: "mymodule",
* domainGroup: "codes",
* domainTemplate: "LookupCodes",
* importData: false
* module: 'mymodule',
* domainGroup: 'codes',
* domainTemplate: 'LookupCodes',
* importData: false,
* });
* ```
* Import the initial data from the domain template of a previously created domain:
* ```js
* LABKEY.Domain.create({
* module: "mymodule",
* domainGroup: "codes",
* domainTemplate: "LookupCodes",
* createDomain: false,
* importData: true
* module: 'mymodule',
* domainGroup: 'codes',
* domainTemplate: 'LookupCodes',
* createDomain: false,
* importData: true,
* });
* ```
*/
Expand Down
3 changes: 1 addition & 2 deletions src/labkey/fieldKey/FieldKey.ts → src/labkey/FieldKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { isString } from '../Utils'

import { isString } from './Utils'
import { QueryKey } from './QueryKey'

export class FieldKey extends QueryKey {
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions src/labkey/fieldKey/SchemaKey.ts → src/labkey/SchemaKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { isString } from '../Utils'

import { isString } from './Utils'
import { QueryKey } from './QueryKey'

export class SchemaKey extends QueryKey {
Expand Down
9 changes: 9 additions & 0 deletions src/labkey/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,18 @@ export function setGlobalUser(user: UserWithPermissions): LabKey {

// The following will be removed in favor of a proper "global" initialization pattern. For now,
// just throw an error if the world hasn't been setup (aka labkey.js wasn't loaded prior)
/**
* @hidden
* @private
*/
class _Window extends Window {
LABKEY: any
}

/**
* @hidden
* @private
*/
declare const window: _Window;

if (!window.LABKEY) {
Expand Down
Loading