shred-api-client 1.12.1-rc.2 → 1.12.1-rc.3
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/dist/api/User.api.d.ts +2 -0
- package/dist/api/User.api.js +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/model/User.schema.d.ts +10 -0
- package/dist/model/User.schema.js +8 -0
- package/package.json +1 -1
package/dist/api/User.api.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ declare class UserAPI implements UserAPISchema {
|
|
|
6
6
|
private clientHTTP;
|
|
7
7
|
constructor(env: Environment);
|
|
8
8
|
deleteAccount(ctx: Context): Promise<boolean>;
|
|
9
|
+
createIntegrationToken(ctx: Context): Promise<string>;
|
|
10
|
+
getIntegrationToken(ctx: Context): Promise<string | null>;
|
|
9
11
|
sendValidationCode(email: string): Promise<boolean>;
|
|
10
12
|
changePassword(email: string, pass: string, passConfirm: string, code: number): Promise<boolean>;
|
|
11
13
|
changeEmail(ctx: Context, email: string, code: number): Promise<boolean>;
|
package/dist/api/User.api.js
CHANGED
|
@@ -15,6 +15,16 @@ class UserAPI {
|
|
|
15
15
|
const data = await this.clientHTTP.makeRequest(this.env, endpointData.uri, endpointData.method, null, ctx);
|
|
16
16
|
return data.success;
|
|
17
17
|
}
|
|
18
|
+
async createIntegrationToken(ctx) {
|
|
19
|
+
const endpointData = User_schema_1.UserEndpoints.CreateToken;
|
|
20
|
+
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}`, endpointData.method, null, ctx);
|
|
21
|
+
return data.token;
|
|
22
|
+
}
|
|
23
|
+
async getIntegrationToken(ctx) {
|
|
24
|
+
const endpointData = User_schema_1.UserEndpoints.GetIntegrationToken;
|
|
25
|
+
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}`, endpointData.method, null, ctx);
|
|
26
|
+
return data.token;
|
|
27
|
+
}
|
|
18
28
|
async sendValidationCode(email) {
|
|
19
29
|
const endpointData = User_schema_1.UserEndpoints.SendValidationCode;
|
|
20
30
|
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}?email=${email}`, endpointData.method);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { ShredAPI } from "./model/Api";
|
|
1
2
|
import { Role, System } from "./model/User.schema";
|
|
2
3
|
import { Status as ProjectStatus, Styles, CaptionStyle } from "./model/Project.schema";
|
|
3
4
|
import Exceptions from "./model/exceptions/";
|
|
4
5
|
export { Role, System, Exceptions, ProjectStatus, Styles, CaptionStyle };
|
|
6
|
+
export default ShredAPI;
|
|
5
7
|
export * from "./namespace";
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.CaptionStyle = exports.Styles = exports.ProjectStatus = exports.Exceptions = exports.System = exports.Role = void 0;
|
|
21
|
+
const Api_1 = require("./model/Api");
|
|
21
22
|
const User_schema_1 = require("./model/User.schema");
|
|
22
23
|
Object.defineProperty(exports, "Role", { enumerable: true, get: function () { return User_schema_1.Role; } });
|
|
23
24
|
Object.defineProperty(exports, "System", { enumerable: true, get: function () { return User_schema_1.System; } });
|
|
@@ -27,4 +28,5 @@ Object.defineProperty(exports, "Styles", { enumerable: true, get: function () {
|
|
|
27
28
|
Object.defineProperty(exports, "CaptionStyle", { enumerable: true, get: function () { return Project_schema_1.CaptionStyle; } });
|
|
28
29
|
const exceptions_1 = __importDefault(require("./model/exceptions/"));
|
|
29
30
|
exports.Exceptions = exceptions_1.default;
|
|
31
|
+
exports.default = Api_1.ShredAPI;
|
|
30
32
|
__exportStar(require("./namespace"), exports);
|
|
@@ -12,6 +12,8 @@ interface UserAPISchema {
|
|
|
12
12
|
setup: (context: Context) => Promise<boolean>;
|
|
13
13
|
getBindedUsers: (ctx: Context) => Promise<User[]>;
|
|
14
14
|
deleteAccount: (ctx: Context) => Promise<boolean>;
|
|
15
|
+
getIntegrationToken: (ctx: Context) => Promise<string | null>;
|
|
16
|
+
createIntegrationToken: (ctx: Context) => Promise<string>;
|
|
15
17
|
createUser: (email: string, name: string, password: string, passwordConfirmation: string, profession: string | null, invitationCode: string | null) => Promise<User>;
|
|
16
18
|
}
|
|
17
19
|
declare const UserEndpoints: {
|
|
@@ -39,6 +41,14 @@ declare const UserEndpoints: {
|
|
|
39
41
|
uri: string;
|
|
40
42
|
method: string;
|
|
41
43
|
};
|
|
44
|
+
GetIntegrationToken: {
|
|
45
|
+
uri: string;
|
|
46
|
+
method: string;
|
|
47
|
+
};
|
|
48
|
+
CreateToken: {
|
|
49
|
+
uri: string;
|
|
50
|
+
method: string;
|
|
51
|
+
};
|
|
42
52
|
ConfirmCode: {
|
|
43
53
|
uri: string;
|
|
44
54
|
method: string;
|
|
@@ -26,6 +26,14 @@ const UserEndpoints = {
|
|
|
26
26
|
uri: "/accounts/public/email/avaliable",
|
|
27
27
|
method: "GET",
|
|
28
28
|
},
|
|
29
|
+
GetIntegrationToken: {
|
|
30
|
+
uri: "/accounts/user/getToken/",
|
|
31
|
+
method: "GET",
|
|
32
|
+
},
|
|
33
|
+
CreateToken: {
|
|
34
|
+
uri: "/accounts/user/createToken/",
|
|
35
|
+
method: "POST",
|
|
36
|
+
},
|
|
29
37
|
ConfirmCode: {
|
|
30
38
|
uri: "/accounts/public/email/validate",
|
|
31
39
|
method: "POST",
|