@floristcloud/api-lib 1.1.0 → 1.2.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/build/commands/auth/index.js +1 -0
- package/build/commands/auth/login-user.command.js +0 -1
- package/build/commands/auth/mobile-login-user.command.js +22 -0
- package/build/commands/auth/reset-password-by-security-code.command.js +5 -2
- package/build/commands/session/create-ws-ticket.command.js +11 -0
- package/build/commands/session/index.js +5 -1
- package/build/commands/session/validate-ws-ticket-s2s.query.js +12 -0
- package/commands/auth/index.ts +1 -0
- package/commands/auth/login-user.command.ts +0 -1
- package/commands/auth/mobile-login-user.command.ts +24 -0
- package/commands/auth/reset-password-by-security-code.command.ts +5 -2
- package/commands/session/create-ws-ticket.command.ts +10 -0
- package/commands/session/index.ts +2 -0
- package/commands/session/validate-ws-ticket-s2s.query.ts +12 -0
- package/package.json +5 -3
|
@@ -21,3 +21,4 @@ __exportStar(require("./login-user.command"), exports);
|
|
|
21
21
|
__exportStar(require("./reset-password-by-token.command"), exports);
|
|
22
22
|
__exportStar(require("./restore-password-by-security-code.command"), exports);
|
|
23
23
|
__exportStar(require("./reset-password-by-security-code.command"), exports);
|
|
24
|
+
__exportStar(require("./mobile-login-user.command"), exports);
|
|
@@ -9,7 +9,6 @@ const LoginUserRequestSchema = zod_1.z.object({
|
|
|
9
9
|
isRemember: zod_1.z.coerce.boolean(),
|
|
10
10
|
});
|
|
11
11
|
const LoginUserResponseSchema = zod_1.z.object({
|
|
12
|
-
accessToken: zod_1.z.string(),
|
|
13
12
|
user: zod_1.z.object({
|
|
14
13
|
uuid: zod_1.z.uuid(),
|
|
15
14
|
email: zod_1.z.email().nullable(),
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MobileLoginUserContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const MobileLoginUserRequestSchema = zod_1.z.object({
|
|
6
|
+
email: zod_1.z.email().toLowerCase().optional(),
|
|
7
|
+
phone: zod_1.z.string().optional(),
|
|
8
|
+
password: zod_1.z.string(),
|
|
9
|
+
});
|
|
10
|
+
const MobileLoginUserResponseSchema = zod_1.z.object({
|
|
11
|
+
sessionToken: zod_1.z.string(),
|
|
12
|
+
user: zod_1.z.object({
|
|
13
|
+
uuid: zod_1.z.uuid(),
|
|
14
|
+
email: zod_1.z.email().nullable(),
|
|
15
|
+
phone: zod_1.z.string().nullable(),
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
var MobileLoginUserContractCommand;
|
|
19
|
+
(function (MobileLoginUserContractCommand) {
|
|
20
|
+
MobileLoginUserContractCommand.RequestSchema = MobileLoginUserRequestSchema;
|
|
21
|
+
MobileLoginUserContractCommand.ResponseSchema = MobileLoginUserResponseSchema;
|
|
22
|
+
})(MobileLoginUserContractCommand || (exports.MobileLoginUserContractCommand = MobileLoginUserContractCommand = {}));
|
|
@@ -9,9 +9,12 @@ exports.ResetPasswordBySecurityCodeRequestSchema = zod_1.z.object({
|
|
|
9
9
|
password: zod_1.z.string().min(6),
|
|
10
10
|
});
|
|
11
11
|
exports.ResetPasswordBySecurityCodeResponseSchema = zod_1.z.object({
|
|
12
|
-
message: zod_1.z.string().optional(),
|
|
13
12
|
data: zod_1.z.object({
|
|
14
|
-
|
|
13
|
+
user: zod_1.z.object({
|
|
14
|
+
uuid: zod_1.z.string(),
|
|
15
|
+
email: zod_1.z.string().nullable(),
|
|
16
|
+
phone: zod_1.z.string().nullable(),
|
|
17
|
+
}),
|
|
15
18
|
}),
|
|
16
19
|
});
|
|
17
20
|
var ResetPasswordBySecurityCodeContractCommand;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateWsTicketContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const CreateWsTicketResponseSchema = zod_1.z.object({
|
|
6
|
+
ticket: zod_1.z.string(),
|
|
7
|
+
});
|
|
8
|
+
var CreateWsTicketContractCommand;
|
|
9
|
+
(function (CreateWsTicketContractCommand) {
|
|
10
|
+
CreateWsTicketContractCommand.ResponseSchema = CreateWsTicketResponseSchema;
|
|
11
|
+
})(CreateWsTicketContractCommand || (exports.CreateWsTicketContractCommand = CreateWsTicketContractCommand = {}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValidateSessionS2SContractQuery = exports.GetActiveSessionsContractQuery = exports.SessionRevokeAllContractCommand = exports.SessionLogoutContractCommand = void 0;
|
|
3
|
+
exports.ValidateWsTicketS2SContractQuery = exports.CreateWsTicketContractCommand = exports.ValidateSessionS2SContractQuery = exports.GetActiveSessionsContractQuery = exports.SessionRevokeAllContractCommand = exports.SessionLogoutContractCommand = void 0;
|
|
4
4
|
var session_logout_command_1 = require("./session-logout.command");
|
|
5
5
|
Object.defineProperty(exports, "SessionLogoutContractCommand", { enumerable: true, get: function () { return session_logout_command_1.SessionLogoutContractCommand; } });
|
|
6
6
|
var session_revoke_all_command_1 = require("./session-revoke-all.command");
|
|
@@ -9,3 +9,7 @@ var get_active_sessions_query_1 = require("./get-active-sessions.query");
|
|
|
9
9
|
Object.defineProperty(exports, "GetActiveSessionsContractQuery", { enumerable: true, get: function () { return get_active_sessions_query_1.GetActiveSessionsContractQuery; } });
|
|
10
10
|
var validate_session_s2s_query_1 = require("./validate-session-s2s.query");
|
|
11
11
|
Object.defineProperty(exports, "ValidateSessionS2SContractQuery", { enumerable: true, get: function () { return validate_session_s2s_query_1.ValidateSessionS2SContractQuery; } });
|
|
12
|
+
var create_ws_ticket_command_1 = require("./create-ws-ticket.command");
|
|
13
|
+
Object.defineProperty(exports, "CreateWsTicketContractCommand", { enumerable: true, get: function () { return create_ws_ticket_command_1.CreateWsTicketContractCommand; } });
|
|
14
|
+
var validate_ws_ticket_s2s_query_1 = require("./validate-ws-ticket-s2s.query");
|
|
15
|
+
Object.defineProperty(exports, "ValidateWsTicketS2SContractQuery", { enumerable: true, get: function () { return validate_ws_ticket_s2s_query_1.ValidateWsTicketS2SContractQuery; } });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ValidateWsTicketS2SContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const ValidateWsTicketS2SRequestSchema = zod_1.z.object({
|
|
6
|
+
ticket: zod_1.z.string(),
|
|
7
|
+
});
|
|
8
|
+
var ValidateWsTicketS2SContractQuery;
|
|
9
|
+
(function (ValidateWsTicketS2SContractQuery) {
|
|
10
|
+
ValidateWsTicketS2SContractQuery.RequestSchema = ValidateWsTicketS2SRequestSchema;
|
|
11
|
+
// Response is the same as ValidateSessionS2SContractQuery.Response
|
|
12
|
+
})(ValidateWsTicketS2SContractQuery || (exports.ValidateWsTicketS2SContractQuery = ValidateWsTicketS2SContractQuery = {}));
|
package/commands/auth/index.ts
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const MobileLoginUserRequestSchema = z.object({
|
|
4
|
+
email: z.email().toLowerCase().optional(),
|
|
5
|
+
phone: z.string().optional(),
|
|
6
|
+
password: z.string(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const MobileLoginUserResponseSchema = z.object({
|
|
10
|
+
sessionToken: z.string(),
|
|
11
|
+
user: z.object({
|
|
12
|
+
uuid: z.uuid(),
|
|
13
|
+
email: z.email().nullable(),
|
|
14
|
+
phone: z.string().nullable(),
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export namespace MobileLoginUserContractCommand {
|
|
19
|
+
export const RequestSchema = MobileLoginUserRequestSchema;
|
|
20
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
21
|
+
|
|
22
|
+
export const ResponseSchema = MobileLoginUserResponseSchema;
|
|
23
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
24
|
+
}
|
|
@@ -8,9 +8,12 @@ export const ResetPasswordBySecurityCodeRequestSchema = z.object({
|
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
export const ResetPasswordBySecurityCodeResponseSchema = z.object({
|
|
11
|
-
message: z.string().optional(),
|
|
12
11
|
data: z.object({
|
|
13
|
-
|
|
12
|
+
user: z.object({
|
|
13
|
+
uuid: z.string(),
|
|
14
|
+
email: z.string().nullable(),
|
|
15
|
+
phone: z.string().nullable(),
|
|
16
|
+
}),
|
|
14
17
|
}),
|
|
15
18
|
});
|
|
16
19
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const CreateWsTicketResponseSchema = z.object({
|
|
4
|
+
ticket: z.string(),
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export namespace CreateWsTicketContractCommand {
|
|
8
|
+
export const ResponseSchema = CreateWsTicketResponseSchema;
|
|
9
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
10
|
+
}
|
|
@@ -2,3 +2,5 @@ export { SessionLogoutContractCommand } from './session-logout.command';
|
|
|
2
2
|
export { SessionRevokeAllContractCommand } from './session-revoke-all.command';
|
|
3
3
|
export { GetActiveSessionsContractQuery } from './get-active-sessions.query';
|
|
4
4
|
export { ValidateSessionS2SContractQuery } from './validate-session-s2s.query';
|
|
5
|
+
export { CreateWsTicketContractCommand } from './create-ws-ticket.command';
|
|
6
|
+
export { ValidateWsTicketS2SContractQuery } from './validate-ws-ticket-s2s.query';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const ValidateWsTicketS2SRequestSchema = z.object({
|
|
4
|
+
ticket: z.string(),
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export namespace ValidateWsTicketS2SContractQuery {
|
|
8
|
+
export const RequestSchema = ValidateWsTicketS2SRequestSchema;
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
// Response is the same as ValidateSessionS2SContractQuery.Response
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@floristcloud/api-lib",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "",
|
|
5
|
-
"
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"main": "./build/index.js"
|
|
7
|
+
},
|
|
6
8
|
"scripts": {
|
|
7
9
|
"prepublish": "rm -rf build && tsc",
|
|
8
|
-
"build": "tsc",
|
|
10
|
+
"build": "rm -rf build && tsc",
|
|
9
11
|
"clean": "rm -rf build node_modules"
|
|
10
12
|
},
|
|
11
13
|
"keywords": [],
|