Skip to content

Commit

Permalink
Document the collection mapping, for future us
Browse files Browse the repository at this point in the history
  • Loading branch information
anandaroop authored and jonallured committed Sep 6, 2019
1 parent e90f9b4 commit a074047
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/commands/identify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default class Identify extends Command {

static args = [{ name: "id" }]

static collectionsToCheck = [
static collectionsToCheck: CollectionMapping[] = [
{ name: "Artist", endpoint: "artist" },
{ name: "Artwork", endpoint: "artwork" },
{ name: "Partner", endpoint: "partner" },
Expand Down Expand Up @@ -39,3 +39,11 @@ export default class Identify extends Command {
}
}
}

interface CollectionMapping {
/** Name of the Gravity resource */
name: string

/** The name of the collection as it appears in the GET endpoint for the resource, i.e. /api/v1/<endpoint>/:id */
endpoint: string
}
3 changes: 2 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"trailing-comma": false,
"variable-name": [true, "ban-keywords", "allow-leading-underscore"],
"jsdoc-format": false,
"radix": false
"radix": false,
"no-single-line-block-comment": false
}
}

0 comments on commit a074047

Please sign in to comment.