-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathkeys.ts
More file actions
85 lines (78 loc) · 1.98 KB
/
keys.ts
File metadata and controls
85 lines (78 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
type ALL = "*";
type GET = "get";
type CREATE = "create";
type UPDATE = "update";
type DELETE = "delete";
/**
* {@link https://www.meilisearch.com/docs/reference/api/keys#actions}
*
* @see `meilisearch_types::keys::Action`
*/
export type Action =
| ALL
| "search"
| `documents.${ALL | "add" | GET | DELETE}`
| `indexes.${ALL | CREATE | GET | UPDATE | DELETE | "swap"}`
| `tasks.${ALL | "cancel" | DELETE | GET}`
| `settings.${ALL | GET | UPDATE}`
| `stats.${GET}`
| `metrics.${GET}`
| `dumps.${CREATE}`
| `snapshots.${CREATE}`
| "version"
| `keys.${CREATE | GET | UPDATE | DELETE}`
| `experimental.${GET | UPDATE}`
| `network.${GET | UPDATE}`;
/**
* {@link https://www.meilisearch.com/docs/reference/api/keys#body}
*
* @see `meilisearch_types::keys::CreateApiKey`
*/
export type CreateApiKey = {
description?: string | null;
name?: string | null;
uid?: string;
actions: Action[];
indexes: string[];
expiresAt: string | null;
};
/**
* {@link https://www.meilisearch.com/docs/reference/api/keys#key-object}
*
* @see `meilisearch::routes::api_key::KeyView`
*/
export type KeyView = {
name: string | null;
description: string | null;
key: string;
uid: string;
actions: Action[];
indexes: string[];
expiresAt: string | null;
createdAt: string;
updatedAt: string;
};
/**
* {@link https://www.meilisearch.com/docs/reference/api/keys#query-parameters}
*
* @see `meilisearch::routes::api_key::ListApiKeys`
*/
export type ListApiKeys = {
offset?: number;
limit?: number;
};
/** @see `meilisearch::routes::PaginationView` */
export type PaginationView<T> = {
results: T[];
offset: number;
limit: number;
total: number;
};
/** {@link https://www.meilisearch.com/docs/reference/api/keys#response} */
export type KeyViewList = PaginationView<KeyView>;
/**
* {@link https://www.meilisearch.com/docs/reference/api/keys#body-1}
*
* @see `meilisearch_types::keys::PatchApiKey`
*/
export type PatchApiKey = Pick<CreateApiKey, "name" | "description">;