Skip to content

Commit

Permalink
resolved doc generation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
guyroyse committed Dec 8, 2022
1 parent 982b21e commit f60d40b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 24 deletions.
28 changes: 13 additions & 15 deletions lib/repository/repository.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { Schema } from "../schema"
import { Client, RedisHashData, RedisJsonData } from "../client"

import { Search, RawSearch } from '../search/search'

import { CreateIndexOptions } from "../client"
import { Client, CreateIndexOptions, RedisHashData, RedisJsonData } from "../client"
import { Entity, EntityData } from "../entity"
import { buildRediSearchIndex } from "../indexer"
import { Schema } from "../schema"
import { Search, RawSearch } from '../search'
import { fromRedisHash, fromRedisJson, toRedisHash, toRedisJson } from "../transformer"
import { Entity, EntityData } from "../entity"

/**
* A repository is the main interaction point for reading, writing, and
Expand Down Expand Up @@ -109,30 +106,30 @@ export class Repository {
}

/**
* Creates an empty {@link Entity} with a generated {@link Entity#entityId} property.
* Creates an empty {@link Entity} with a generated entityId property.
*
* @returns A newly created Entity.
*/
createEntity(): Entity

/**
* Creates an empty {@link Entity} with a provided {@link Entity#entityId} property.
* Creates an empty {@link Entity} with a provided entityId.
*
* @param id The provided entityId.
* @returns A newly created Entity.
*/
createEntity(id: string): Entity

/**
* Creates an {@link Entity} populated with provided data and a generated {@link Entity#entityId} property.
* Creates an {@link Entity} populated with provided data and a generated entityId property.
*
* @param entityData The provided entity data.
* @returns A newly created Entity.
*/
createEntity(entityData: EntityData): Entity

/**
* Creates an {@link Entity} populated with provided data and a provided {@link Entity#entityId} property.
* Creates an {@link Entity} populated with provided data and a provided entityId.
*
* @param id The provided entityId.
* @param entityData The provided entity data.
Expand All @@ -148,16 +145,16 @@ export class Repository {
}

/**
* Insert or update an {@link Entity} to Redis using its {@link Entity#entityId} property
* if present. If it's not, it generates one.
* Insert or update an {@link Entity} to Redis using its entityId property
* if present. If it's not, one is generated.
*
* @param entity The Entity to save.
* @returns The provided or generated entityId.
*/
async save(entity: Entity): Promise<string>

/**
* Insert or update the {@link Entity} to Redis using the provided {@link Entity#entityId}.
* Insert or update the {@link Entity} to Redis using the provided entityId.
*
* @param id The Entity to save.
* @param entity The Entity to save.
Expand All @@ -183,9 +180,10 @@ export class Repository {
async createAndSave(entityData: EntityData): Promise<Entity>

/**
* Creates and saves an {@link Entity} to the provided {@link Entity#entityId}. Equivalent
* Creates and saves an {@link Entity} to using the provided entityId. Equivalent
* of calling {@link Repository#createEntity} followed by {@link Repository#save}.
*
* @param id The entityId to save to.
* @param entityData The data to be saved.
* @returns The newly created and saved Entity.
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/schema/field.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AllFieldDefinition, FieldDefinition, FieldType } from "./definitions"

/**
* Describes a field in a {@link Schema).
* Describes a field in a {@link Schema}.
*/
export class Field {

Expand Down
10 changes: 5 additions & 5 deletions lib/schema/options.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** The type of data structure in Redis to map objects to. */
export type DataStructure = 'HASH' | 'JSON';

/** A function that generates random {@link Entity.entityId | Entity IDs}. */
/** A function that generates random entityIds. */
export type IdStrategy = () => string;

/** Valid values for how to use stop words for a given {@link Schema}. */
Expand Down Expand Up @@ -29,10 +29,10 @@ export type SchemaOptions = {
dataStructure?: DataStructure

/**
* A function that generates a random {@link Entity.entityId | Entity ID}. Defaults
* to a function that generates [ULIDs](https://github.com/ulid/spec). Combined with
* prefix to generate a Redis key. If prefix is `Foo` and idStratgey returns `12345`
* then the generated key would be `Foo:12345`.
* A function that generates a random entityId. Defaults to a function that generates
* [ULIDs](https://github.com/ulid/spec). Combined with prefix to generate a Redis key.
* If prefix is `Foo` and idStratgey returns `12345` then the generated key would be
* `Foo:12345`.
*/
idStrategy?: IdStrategy

Expand Down
3 changes: 1 addition & 2 deletions lib/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ export class Schema {

/**
* The configured usage of stop words, a string with the value of either `OFF`, `DEFAULT`,
* or `CUSTOM`. See {@link SchemaOptions.useStopWords} and {@link SchemaOptions.stopWords}
* for more details.
* or `CUSTOM`. See {@link SchemaOptions} for more details.
*/
get useStopWords(): StopWordOptions { return this._options?.useStopWords ?? 'DEFAULT' }

Expand Down
2 changes: 1 addition & 1 deletion lib/search/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ export abstract class AbstractSearch {
}

/**
* Alias for {@link Search.pageOrKeys}.
* Alias for {@link Search.pageOfKeys}.
*/
async returnPageOfKeys(offset: number, count: number): Promise<string[]> {
return await this.pageOfKeys(offset, count)
Expand Down

0 comments on commit f60d40b

Please sign in to comment.