kuzzle 2.19.11 → 2.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export * from './lib/core/shared/sdk/embeddedSdk';
5
5
  export * from './lib/api/request';
6
6
  export * from './lib/kerror/errors';
7
7
  export * from './lib/util/mutex';
8
- export * from './lib/util/inflector';
8
+ export * from './lib/util/Inflector';
9
9
  export { NameGenerator } from './lib/util/name-generator';
10
10
  export * from 'kuzzle-sdk';
11
11
  export * from './lib/core/shared/KoncordeWrapper';
package/index.js CHANGED
@@ -22,7 +22,7 @@ __exportStar(require("./lib/core/shared/sdk/embeddedSdk"), exports);
22
22
  __exportStar(require("./lib/api/request"), exports);
23
23
  __exportStar(require("./lib/kerror/errors"), exports);
24
24
  __exportStar(require("./lib/util/mutex"), exports);
25
- __exportStar(require("./lib/util/inflector"), exports);
25
+ __exportStar(require("./lib/util/Inflector"), exports);
26
26
  var name_generator_1 = require("./lib/util/name-generator");
27
27
  Object.defineProperty(exports, "NameGenerator", { enumerable: true, get: function () { return name_generator_1.NameGenerator; } });
28
28
  __exportStar(require("kuzzle-sdk"), exports);
@@ -0,0 +1,164 @@
1
+ import { KuzzleRequest } from "../request";
2
+ import { NativeController } from "./baseController";
3
+ export declare class AuthController extends NativeController {
4
+ private anonymousId;
5
+ /**
6
+ * @param {Kuzzle} kuzzle
7
+ * @constructor
8
+ */
9
+ constructor();
10
+ /**
11
+ * Controller initialization: we need the anonymous user identifier for the
12
+ * "isAuthenticated" assertion
13
+ *
14
+ * @returns {Promise}
15
+ */
16
+ init(): Promise<void>;
17
+ createToken(request: KuzzleRequest): Promise<{
18
+ expiresAt: number;
19
+ singleUse: boolean;
20
+ token: string;
21
+ ttl: number;
22
+ }>;
23
+ /**
24
+ * Checks if an API action can be executed by the current user
25
+ */
26
+ checkRights(request: any): Promise<{
27
+ allowed: any;
28
+ }>;
29
+ /**
30
+ * Creates a new API key for the user
31
+ * @param {KuzzleRequest} request
32
+ */
33
+ createApiKey(request: any): Promise<any>;
34
+ /**
35
+ * Search in the user API keys
36
+ */
37
+ searchApiKeys(request: any): Promise<{
38
+ hits: any;
39
+ total: any;
40
+ }>;
41
+ /**
42
+ * Deletes an API key
43
+ */
44
+ deleteApiKey(request: any): Promise<{
45
+ _id: any;
46
+ }>;
47
+ /**
48
+ * Logs the current user out
49
+ *
50
+ * @param {KuzzleRequest} request
51
+ * @returns {Promise<object>}
52
+ */
53
+ logout(request: any): Promise<{
54
+ acknowledged: boolean;
55
+ }>;
56
+ _sendToken(token: any, request: any): Promise<{
57
+ _id: any;
58
+ expiresAt: any;
59
+ ttl: any;
60
+ jwt?: undefined;
61
+ } | {
62
+ _id: any;
63
+ expiresAt: any;
64
+ jwt: any;
65
+ ttl: any;
66
+ }>;
67
+ /**
68
+ * Attempts a login with request informations against the provided strategy;
69
+ * local is used if strategy is not provided.
70
+ *
71
+ * @param {KuzzleRequest} request
72
+ * @returns {Promise<Token>}
73
+ */
74
+ login(request: any): Promise<any>;
75
+ /**
76
+ * Returns the user identified by the given jwt token
77
+ *
78
+ * @param {KuzzleRequest} request
79
+ * @returns {Promise<Object>}
80
+ */
81
+ getCurrentUser(request: any): any;
82
+ /**
83
+ * Returns the rights of the user identified by the given jwt token
84
+ *
85
+ * @param {KuzzleRequest} request
86
+ * @returns {Promise<object>}
87
+ */
88
+ getMyRights(request: any): any;
89
+ /**
90
+ * Checks the validity of a token.
91
+ *
92
+ * @param {KuzzleRequest} request
93
+ * @returns {Promise<object>}
94
+ */
95
+ checkToken(request: any): Promise<{
96
+ expiresAt: any;
97
+ kuid: any;
98
+ valid: boolean;
99
+ state?: undefined;
100
+ } | {
101
+ state: any;
102
+ valid: boolean;
103
+ expiresAt?: undefined;
104
+ kuid?: undefined;
105
+ }>;
106
+ /**
107
+ * Updates the current user if it is not anonymous
108
+ *
109
+ * @param {KuzzleRequest} request
110
+ * @returns {Promise<object>}
111
+ */
112
+ updateSelf(request: any): Promise<any>;
113
+ /**
114
+ * List authentication strategies
115
+ *
116
+ * @returns {Promise.<string[]>}
117
+ */
118
+ getStrategies(): any;
119
+ /**
120
+ * @param {KuzzleRequest} request
121
+ * @returns {Promise.<Object>}
122
+ */
123
+ createMyCredentials(request: any): any;
124
+ /**
125
+ * @param {KuzzleRequest} request
126
+ * @returns {Promise.<Object>}
127
+ */
128
+ updateMyCredentials(request: any): any;
129
+ /**
130
+ * @param {KuzzleRequest} request
131
+ * @returns {Promise.<Object>}
132
+ */
133
+ credentialsExist(request: any): any;
134
+ /**
135
+ * @param {KuzzleRequest} request
136
+ * @returns {Promise.<Object>}
137
+ */
138
+ validateMyCredentials(request: any): any;
139
+ /**
140
+ * @param {KuzzleRequest} request
141
+ * @returns {Promise.<Object>}
142
+ */
143
+ deleteMyCredentials(request: any): any;
144
+ /**
145
+ * @param {KuzzleRequest} request
146
+ * @returns {Promise.<Object>}
147
+ */
148
+ getMyCredentials(request: any): any;
149
+ /**
150
+ * @param {KuzzleRequest} request
151
+ */
152
+ refreshToken(request: any): Promise<{
153
+ _id: any;
154
+ expiresAt: any;
155
+ ttl: any;
156
+ jwt?: undefined;
157
+ } | {
158
+ _id: any;
159
+ expiresAt: any;
160
+ jwt: any;
161
+ ttl: any;
162
+ }>;
163
+ assertIsAuthenticated(request: any): void;
164
+ }