Skip to content

Commit 5d1fbda

Browse files
committed
docs: write docs for alias API
1 parent 4cb3720 commit 5d1fbda

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

src/alias/index.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,52 @@ import { WeaviateAlias, WeaviateAliasResponse } from '../openapi/types.js';
33
import { Alias, CreateAliasInput, UpdateAliasInput } from './types.js';
44

55
export interface Aliases {
6+
/**
7+
* Create alias for a collection.
8+
*
9+
* The collection must exist prior to aliasing it.
10+
* One alias cannot be created for multiple collections simultaneously.
11+
*
12+
* @param {string} [opt.collection] Original collection name.
13+
* @param {string} [opt.alias] Alias for collection.
14+
* @returns {Promise<void>} Awaitable promise.
15+
* */
616
create: (opt: CreateAliasInput) => Promise<void>;
17+
18+
/**
19+
* List all aliases defined in the schema.
20+
*
21+
* @param {string | undefined} collection Get all aliases defined for this collection.
22+
* @returns {Promise<Alias[] | undefined>} An array of aliases.
23+
*/
724
listAll: (collection?: string) => Promise<Alias[] | undefined>;
25+
26+
/**
27+
* Get information about an alias.
28+
*
29+
* @param {string} alias Alias to fetch.
30+
* @return {Promise<Alias>} Alias definition.
31+
*/
832
get: (alias: string) => Promise<Alias>;
33+
34+
/**
35+
* Replace target collection the alias points to.
36+
*
37+
* To change the alias that points to the collection,
38+
* delete the alias and create a new one.
39+
*
40+
* @param {string} [opt.alias] Alias to update.
41+
* @param {string} [opt.collection] New collection the alias should point to.
42+
* @return {Promise<void>} Awaitable promise.
43+
*/
944
update: (opt: UpdateAliasInput) => Promise<void>;
45+
46+
/**
47+
* Delete a collection alias.
48+
*
49+
* @param {string} alias Alias definition to delete.
50+
* @return {Promise<void>} Awaitable promise.
51+
*/
1052
delete: (alias: string) => Promise<void>;
1153
}
1254

src/roles/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,8 @@ export const permissions = {
154154
/**
155155
* Create a set of permissions specific to Weaviate's collection aliasing functionality.
156156
*
157-
* For all collections, provide the `collection` argument as `'*'`.
158-
*
159-
* @param {string | string[]} [args.alias] Aliases to create permissions for.
160-
* @returns {BackupsPermission[]} The permissions for the specified collections.
157+
* @param {string | string[]} [args.alias] Aliases that will be associated with these permissions.
158+
* @returns {AliasPermission[]} The permissions for the specified aliases.
161159
*/
162160
aliases: (args: {
163161
alias: string | string[];

0 commit comments

Comments
 (0)