@roadmanjs/auth 0.0.8 → 0.0.13
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/client/gql/shared.d.ts +6 -0
- package/dist/client/gql/shared.js +15 -0
- package/dist/client/gql/shared.js.map +1 -0
- package/dist/client/gql/user.fragment.d.ts +30 -0
- package/dist/client/gql/user.fragment.js +44 -0
- package/dist/client/gql/user.fragment.js.map +1 -0
- package/dist/client/gql/user.mutation.d.ts +8 -0
- package/dist/client/gql/user.mutation.js +74 -0
- package/dist/client/gql/user.mutation.js.map +1 -0
- package/dist/client/gql/user.query.d.ts +3 -0
- package/dist/client/gql/user.query.js +41 -0
- package/dist/client/gql/user.query.js.map +1 -0
- package/dist/client/gql/user.subscription.d.ts +1 -0
- package/dist/client/gql/user.subscription.js +17 -0
- package/dist/client/gql/user.subscription.js.map +1 -0
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.js +18 -0
- package/dist/client/index.js.map +1 -0
- package/dist/script.d.ts +1 -0
- package/dist/script.js +23 -0
- package/dist/script.js.map +1 -0
- package/dist/user/User.model.d.ts +7 -5
- package/dist/user/User.model.js +52 -4
- package/dist/user/User.model.js.map +1 -1
- package/dist/user/User.resolver.auth.js +7 -2
- package/dist/user/User.resolver.auth.js.map +1 -1
- package/package.json +6 -5
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ResTypeFragment = void 0;
|
|
7
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
+
exports.ResTypeFragment = (0, graphql_tag_1.default) `
|
|
9
|
+
fragment ResTypeFragment on ResType {
|
|
10
|
+
success
|
|
11
|
+
message
|
|
12
|
+
data
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/client/gql/shared.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA8B;AAQjB,QAAA,eAAe,GAAG,IAAA,qBAAG,EAAA;;;;;;CAMjC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ResType } from './shared';
|
|
2
|
+
export interface UserType {
|
|
3
|
+
id: string;
|
|
4
|
+
username?: string;
|
|
5
|
+
fullname?: string;
|
|
6
|
+
firstname: string;
|
|
7
|
+
lastname: string;
|
|
8
|
+
email: string;
|
|
9
|
+
phone: string;
|
|
10
|
+
website?: string;
|
|
11
|
+
country?: string;
|
|
12
|
+
bio?: string;
|
|
13
|
+
address?: string;
|
|
14
|
+
state?: string;
|
|
15
|
+
city?: string;
|
|
16
|
+
zipcode?: string;
|
|
17
|
+
image?: string;
|
|
18
|
+
avatar?: string;
|
|
19
|
+
tokenVersion?: number;
|
|
20
|
+
balance: number;
|
|
21
|
+
currency: string;
|
|
22
|
+
}
|
|
23
|
+
export interface LoginResponseType extends ResType {
|
|
24
|
+
accessToken: string;
|
|
25
|
+
refreshToken: string;
|
|
26
|
+
user: UserType;
|
|
27
|
+
}
|
|
28
|
+
export declare const UserTypeFragment: import("graphql").DocumentNode;
|
|
29
|
+
export declare const LoginResponseTypeFragment: import("graphql").DocumentNode;
|
|
30
|
+
export default UserTypeFragment;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LoginResponseTypeFragment = exports.UserTypeFragment = void 0;
|
|
7
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
+
exports.UserTypeFragment = (0, graphql_tag_1.default) `
|
|
9
|
+
fragment UserTypeFragment on UserType {
|
|
10
|
+
id
|
|
11
|
+
username
|
|
12
|
+
fullname
|
|
13
|
+
firstname
|
|
14
|
+
lastname
|
|
15
|
+
email
|
|
16
|
+
phone
|
|
17
|
+
website
|
|
18
|
+
country
|
|
19
|
+
bio
|
|
20
|
+
address
|
|
21
|
+
state
|
|
22
|
+
city
|
|
23
|
+
zipcode
|
|
24
|
+
tokenVersion
|
|
25
|
+
avatar
|
|
26
|
+
balance
|
|
27
|
+
currency
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
exports.LoginResponseTypeFragment = (0, graphql_tag_1.default) `
|
|
31
|
+
fragment LoginResponseTypeFragment on LoginResponseType {
|
|
32
|
+
accessToken
|
|
33
|
+
refreshToken
|
|
34
|
+
user {
|
|
35
|
+
...UserTypeFragment
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
success
|
|
39
|
+
message
|
|
40
|
+
}
|
|
41
|
+
${exports.UserTypeFragment}
|
|
42
|
+
`;
|
|
43
|
+
exports.default = exports.UserTypeFragment;
|
|
44
|
+
//# sourceMappingURL=user.fragment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.fragment.js","sourceRoot":"","sources":["../../../src/client/gql/user.fragment.ts"],"names":[],"mappings":";;;;;;AACA,8DAA8B;AA8BjB,QAAA,gBAAgB,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;;;;;;;;CAqBlC,CAAC;AAEW,QAAA,yBAAyB,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;MAWtC,wBAAgB;CACrB,CAAC;AAEF,kBAAe,wBAAgB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const UPDATE_USER_WALLET: import("graphql").DocumentNode;
|
|
2
|
+
export declare const PHONE_LOGIN_MUTATION: import("graphql").DocumentNode;
|
|
3
|
+
export declare const LOGIN_MUTATION: import("graphql").DocumentNode;
|
|
4
|
+
export declare const REGISTER_MUTATION: import("graphql").DocumentNode;
|
|
5
|
+
export declare const ADD_USER_MUTATION: import("graphql").DocumentNode;
|
|
6
|
+
export declare const FORGOTPASSWORD_MUTATION: import("graphql").DocumentNode;
|
|
7
|
+
export declare const CHANGEPASSWORD_MUTATION: import("graphql").DocumentNode;
|
|
8
|
+
export declare const UPDATE_USER_PROFILE: import("graphql").DocumentNode;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.UPDATE_USER_PROFILE = exports.CHANGEPASSWORD_MUTATION = exports.FORGOTPASSWORD_MUTATION = exports.ADD_USER_MUTATION = exports.REGISTER_MUTATION = exports.LOGIN_MUTATION = exports.PHONE_LOGIN_MUTATION = exports.UPDATE_USER_WALLET = void 0;
|
|
7
|
+
const user_fragment_1 = require("./user.fragment");
|
|
8
|
+
const shared_1 = require("./shared");
|
|
9
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
10
|
+
exports.UPDATE_USER_WALLET = (0, graphql_tag_1.default) `
|
|
11
|
+
mutation UpdateUserWallet($userId: String!, $amount: Float!, $source: String) {
|
|
12
|
+
update: updateUserWallet(userId: $userId, amount: $amount, source: $source) {
|
|
13
|
+
success
|
|
14
|
+
message
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
exports.PHONE_LOGIN_MUTATION = (0, graphql_tag_1.default) `
|
|
19
|
+
mutation PhoneLogin($phone: String!, $firebaseToken: String!, $createNew: Boolean!) {
|
|
20
|
+
data: phoneLogin(phone: $phone, firebaseToken: $firebaseToken, createNew: $createNew) {
|
|
21
|
+
...LoginResponseTypeFragment
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
${user_fragment_1.LoginResponseTypeFragment}
|
|
25
|
+
`;
|
|
26
|
+
exports.LOGIN_MUTATION = (0, graphql_tag_1.default) `
|
|
27
|
+
mutation Login($password: String!, $email: String!) {
|
|
28
|
+
data: login(password: $password, email: $email) {
|
|
29
|
+
...LoginResponseTypeFragment
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
${user_fragment_1.LoginResponseTypeFragment}
|
|
33
|
+
`;
|
|
34
|
+
exports.REGISTER_MUTATION = (0, graphql_tag_1.default) `
|
|
35
|
+
mutation Register($user: RegisterArgs!) {
|
|
36
|
+
data: register(user: $user) {
|
|
37
|
+
...LoginResponseTypeFragment
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
${user_fragment_1.LoginResponseTypeFragment}
|
|
41
|
+
`;
|
|
42
|
+
exports.ADD_USER_MUTATION = (0, graphql_tag_1.default) `
|
|
43
|
+
mutation AddUser($user: CreateUserArgs!) {
|
|
44
|
+
data: addUser(user: $user) {
|
|
45
|
+
...ResTypeFragment
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
${shared_1.ResTypeFragment}
|
|
49
|
+
`;
|
|
50
|
+
exports.FORGOTPASSWORD_MUTATION = (0, graphql_tag_1.default) `
|
|
51
|
+
mutation ForgotPassword($user: ForgotPasswordArgs!) {
|
|
52
|
+
data: forgotPassword(user: $user) {
|
|
53
|
+
...LoginResponseTypeFragment
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
${user_fragment_1.LoginResponseTypeFragment}
|
|
57
|
+
`;
|
|
58
|
+
exports.CHANGEPASSWORD_MUTATION = (0, graphql_tag_1.default) `
|
|
59
|
+
mutation ChangePassword($user: ChangePasswordArgs!) {
|
|
60
|
+
data: changePassword(user: $user) {
|
|
61
|
+
...LoginResponseTypeFragment
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
${user_fragment_1.LoginResponseTypeFragment}
|
|
65
|
+
`;
|
|
66
|
+
exports.UPDATE_USER_PROFILE = (0, graphql_tag_1.default) `
|
|
67
|
+
mutation UpdateUserProfile($user: UserUpdate!) {
|
|
68
|
+
data: updateUserProfile(user: $user) {
|
|
69
|
+
...ResTypeFragment
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
${shared_1.ResTypeFragment}
|
|
73
|
+
`;
|
|
74
|
+
//# sourceMappingURL=user.mutation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.mutation.js","sourceRoot":"","sources":["../../../src/client/gql/user.mutation.ts"],"names":[],"mappings":";;;;;;AAAA,mDAA0D;AAC1D,qCAAyC;AACzC,8DAA8B;AAEjB,QAAA,kBAAkB,GAAG,IAAA,qBAAG,EAAA;;;;;;;CAOpC,CAAC;AAEW,QAAA,oBAAoB,GAAG,IAAA,qBAAG,EAAA;;;;;;MAMjC,yCAAyB;CAC9B,CAAC;AAEW,QAAA,cAAc,GAAG,IAAA,qBAAG,EAAA;;;;;;MAM3B,yCAAyB;CAC9B,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAA,qBAAG,EAAA;;;;;;MAM9B,yCAAyB;CAC9B,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAA,qBAAG,EAAA;;;;;;MAM9B,wBAAe;CACpB,CAAC;AAEW,QAAA,uBAAuB,GAAG,IAAA,qBAAG,EAAA;;;;;;MAMpC,yCAAyB;CAC9B,CAAC;AAEW,QAAA,uBAAuB,GAAG,IAAA,qBAAG,EAAA;;;;;;MAMpC,yCAAyB;CAC9B,CAAC;AAEW,QAAA,mBAAmB,GAAG,IAAA,qBAAG,EAAA;;;;;;MAMhC,wBAAe;CACpB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.GET_USER_PUBLIC = exports.GET_ME = exports.GET_ALL_USERS = void 0;
|
|
7
|
+
const user_fragment_1 = require("./user.fragment");
|
|
8
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
9
|
+
// export const GET_END_USER = gql`
|
|
10
|
+
// query GetEnduser($id: ID) {
|
|
11
|
+
// enduser(id: $id) {
|
|
12
|
+
// ...EnduserFragment
|
|
13
|
+
// }
|
|
14
|
+
// }
|
|
15
|
+
// ${EnduserFragment}
|
|
16
|
+
// `;
|
|
17
|
+
exports.GET_ALL_USERS = (0, graphql_tag_1.default) `
|
|
18
|
+
query GetAllUsers($search: String, $page: Float, $limit: Float) {
|
|
19
|
+
users(search: $search, page: $page, limit: $limit) {
|
|
20
|
+
...UserTypeFragment
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
${user_fragment_1.UserTypeFragment}
|
|
24
|
+
`;
|
|
25
|
+
exports.GET_ME = (0, graphql_tag_1.default) `
|
|
26
|
+
query GetMe {
|
|
27
|
+
me {
|
|
28
|
+
...UserTypeFragment
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
${user_fragment_1.UserTypeFragment}
|
|
32
|
+
`;
|
|
33
|
+
exports.GET_USER_PUBLIC = (0, graphql_tag_1.default) `
|
|
34
|
+
query GetUser($id: String!) {
|
|
35
|
+
data: getUser(id: $id) {
|
|
36
|
+
...UserTypeFragment
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
${user_fragment_1.UserTypeFragment}
|
|
40
|
+
`;
|
|
41
|
+
//# sourceMappingURL=user.query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.query.js","sourceRoot":"","sources":["../../../src/client/gql/user.query.ts"],"names":[],"mappings":";;;;;;AAAA,mDAAiD;AACjD,8DAA8B;AAE9B,mCAAmC;AACnC,gCAAgC;AAChC,yBAAyB;AACzB,2BAA2B;AAC3B,QAAQ;AACR,MAAM;AACN,uBAAuB;AACvB,KAAK;AAEQ,QAAA,aAAa,GAAG,IAAA,qBAAG,EAAA;;;;;;MAM1B,gCAAgB;CACrB,CAAC;AAEW,QAAA,MAAM,GAAG,IAAA,qBAAG,EAAA;;;;;;MAMnB,gCAAgB;CACrB,CAAC;AAEW,QAAA,eAAe,GAAG,IAAA,qBAAG,EAAA;;;;;;MAM5B,gCAAgB;CACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const USER_SUBSCRIPTION: import("graphql").DocumentNode;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.USER_SUBSCRIPTION = void 0;
|
|
7
|
+
const user_fragment_1 = require("./user.fragment");
|
|
8
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
9
|
+
exports.USER_SUBSCRIPTION = (0, graphql_tag_1.default) `
|
|
10
|
+
subscription SubUser($id: String) {
|
|
11
|
+
data: onUser(id: $id) {
|
|
12
|
+
...UserTypeFragment
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
${user_fragment_1.UserTypeFragment}
|
|
16
|
+
`;
|
|
17
|
+
//# sourceMappingURL=user.subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.subscription.js","sourceRoot":"","sources":["../../../src/client/gql/user.subscription.ts"],"names":[],"mappings":";;;;;;AAAA,mDAAiD;AACjD,8DAA8B;AAEjB,QAAA,iBAAiB,GAAG,IAAA,qBAAG,EAAA;;;;;;MAM9B,gCAAgB;CACrB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./gql/shared"), exports);
|
|
14
|
+
__exportStar(require("./gql/user.fragment"), exports);
|
|
15
|
+
__exportStar(require("./gql/user.mutation"), exports);
|
|
16
|
+
__exportStar(require("./gql/user.query"), exports);
|
|
17
|
+
__exportStar(require("./gql/user.subscription"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA6B;AAC7B,sDAAoC;AACpC,sDAAoC;AACpC,mDAAiC;AACjC,0DAAwC"}
|
package/dist/script.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/script.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("@roadmanjs/utils");
|
|
4
|
+
// Automatically run this
|
|
5
|
+
(async () => {
|
|
6
|
+
const args = [
|
|
7
|
+
{ cmd: 'rm', dir: 'dist-client' },
|
|
8
|
+
{ cmd: 'mkdir', dir: 'dist-client' },
|
|
9
|
+
{ cmd: 'cp', dir: 'dist/client/gql', newDir: 'dist-client' },
|
|
10
|
+
{ cmd: 'cp', dir: 'register', newDir: 'dist-client/register' },
|
|
11
|
+
{ cmd: 'cp', dir: 'docs', newDir: 'dist-client/docs' },
|
|
12
|
+
{ cmd: 'cp', dir: 'README.md', newDir: 'dist-client/README.md' },
|
|
13
|
+
{ cmd: 'cp', dir: 'dist/client/index.js', newDir: 'dist-client/index.js' },
|
|
14
|
+
{ cmd: 'cp', dir: 'dist/client/index.d.ts', newDir: 'dist-client/index.d.ts' },
|
|
15
|
+
{ cmd: 'cp', dir: 'dist/client/index.js.map', newDir: 'dist-client/index.js.map' },
|
|
16
|
+
];
|
|
17
|
+
(0, utils_1.buildDirs)(args);
|
|
18
|
+
await (0, utils_1.createClientPackageJson)({
|
|
19
|
+
name: '@roadmanjs/auth-client',
|
|
20
|
+
description: 'GraphQL client gql for @roadmanjs/auth',
|
|
21
|
+
});
|
|
22
|
+
})();
|
|
23
|
+
//# sourceMappingURL=script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script.js","sourceRoot":"","sources":["../src/script.ts"],"names":[],"mappings":";;AAAA,4CAA4E;AAE5E,yBAAyB;AACzB,CAAC,KAAK,IAAI,EAAE;IACR,MAAM,IAAI,GAAa;QACnB,EAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,aAAa,EAAC;QAC/B,EAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,EAAC;QAClC,EAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,EAAE,aAAa,EAAC;QAC1D,EAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,sBAAsB,EAAC;QAC5D,EAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAC;QACpD,EAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,uBAAuB,EAAC;QAC9D,EAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,sBAAsB,EAAE,MAAM,EAAE,sBAAsB,EAAC;QACxE,EAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,wBAAwB,EAAE,MAAM,EAAE,wBAAwB,EAAC;QAC5E,EAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,0BAA0B,EAAE,MAAM,EAAE,0BAA0B,EAAC;KACnF,CAAC;IAEF,IAAA,iBAAS,EAAC,IAAI,CAAC,CAAC;IAEhB,MAAM,IAAA,+BAAuB,EAAC;QAC1B,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,wCAAwC;KACxD,CAAC,CAAC;AACP,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -4,11 +4,6 @@ import { Model } from 'couchset';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare class UserType {
|
|
6
6
|
id?: string;
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated use ID instead
|
|
9
|
-
* tiny hack to work with @stoqey/client-graphql
|
|
10
|
-
*/
|
|
11
|
-
userId?: string;
|
|
12
7
|
email?: string;
|
|
13
8
|
username?: string;
|
|
14
9
|
fullname?: string;
|
|
@@ -17,6 +12,9 @@ export declare class UserType {
|
|
|
17
12
|
phone?: string;
|
|
18
13
|
website?: string;
|
|
19
14
|
address?: string;
|
|
15
|
+
city?: string;
|
|
16
|
+
state?: string;
|
|
17
|
+
zipcode?: string;
|
|
20
18
|
country?: string;
|
|
21
19
|
bio?: string;
|
|
22
20
|
avatar?: string;
|
|
@@ -28,6 +26,7 @@ export declare class UserType {
|
|
|
28
26
|
createdAt?: Date;
|
|
29
27
|
updatedAt?: Date;
|
|
30
28
|
}
|
|
29
|
+
export declare const allUserModelKeys: string[];
|
|
31
30
|
export declare class UserTypeInput {
|
|
32
31
|
id?: string;
|
|
33
32
|
email?: string;
|
|
@@ -39,6 +38,9 @@ export declare class UserTypeInput {
|
|
|
39
38
|
website?: string;
|
|
40
39
|
address?: string;
|
|
41
40
|
country?: string;
|
|
41
|
+
city?: string;
|
|
42
|
+
state?: string;
|
|
43
|
+
zipcode?: string;
|
|
42
44
|
bio?: string;
|
|
43
45
|
avatar?: string;
|
|
44
46
|
currency?: string;
|
package/dist/user/User.model.js
CHANGED
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.incrementRefreshToken = exports.UserModel = exports.ResType = exports.LoginResponseType = exports.userModelPublicSelectors = exports.UserTypeInput = exports.UserType = void 0;
|
|
9
|
+
exports.incrementRefreshToken = exports.UserModel = exports.ResType = exports.LoginResponseType = exports.userModelPublicSelectors = exports.UserTypeInput = exports.allUserModelKeys = exports.UserType = void 0;
|
|
10
10
|
const couchset_1 = require("couchset");
|
|
11
11
|
const lodash_1 = require("lodash");
|
|
12
12
|
const modelName = 'User';
|
|
@@ -14,13 +14,34 @@ const modelName = 'User';
|
|
|
14
14
|
* GraphQL Types start
|
|
15
15
|
*/
|
|
16
16
|
let UserType = class UserType {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.id = '';
|
|
19
|
+
this.email = '';
|
|
20
|
+
this.username = '';
|
|
21
|
+
this.fullname = '';
|
|
22
|
+
this.firstname = '';
|
|
23
|
+
this.lastname = '';
|
|
24
|
+
this.phone = '';
|
|
25
|
+
this.website = '';
|
|
26
|
+
this.address = '';
|
|
27
|
+
this.city = '';
|
|
28
|
+
this.state = '';
|
|
29
|
+
this.zipcode = '';
|
|
30
|
+
this.country = '';
|
|
31
|
+
this.bio = '';
|
|
32
|
+
this.avatar = '';
|
|
33
|
+
// Wallet here
|
|
34
|
+
this.currency = '';
|
|
35
|
+
this.balance = 0;
|
|
36
|
+
this.admin = false;
|
|
37
|
+
this.plans = [];
|
|
38
|
+
// Revoke accessToken
|
|
39
|
+
this.tokenVersion = 0;
|
|
40
|
+
}
|
|
17
41
|
};
|
|
18
42
|
__decorate([
|
|
19
43
|
(0, couchset_1.Field)(() => String, { nullable: true })
|
|
20
44
|
], UserType.prototype, "id", void 0);
|
|
21
|
-
__decorate([
|
|
22
|
-
(0, couchset_1.Field)(() => String, { nullable: true })
|
|
23
|
-
], UserType.prototype, "userId", void 0);
|
|
24
45
|
__decorate([
|
|
25
46
|
(0, couchset_1.Field)(() => String, { nullable: true })
|
|
26
47
|
], UserType.prototype, "email", void 0);
|
|
@@ -45,6 +66,15 @@ __decorate([
|
|
|
45
66
|
__decorate([
|
|
46
67
|
(0, couchset_1.Field)(() => String, { nullable: true })
|
|
47
68
|
], UserType.prototype, "address", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, couchset_1.Field)(() => String, { nullable: true })
|
|
71
|
+
], UserType.prototype, "city", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, couchset_1.Field)(() => String, { nullable: true })
|
|
74
|
+
], UserType.prototype, "state", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, couchset_1.Field)(() => String, { nullable: true })
|
|
77
|
+
], UserType.prototype, "zipcode", void 0);
|
|
48
78
|
__decorate([
|
|
49
79
|
(0, couchset_1.Field)(() => String, { nullable: true })
|
|
50
80
|
], UserType.prototype, "country", void 0);
|
|
@@ -79,7 +109,13 @@ UserType = __decorate([
|
|
|
79
109
|
(0, couchset_1.ObjectType)('UserType')
|
|
80
110
|
], UserType);
|
|
81
111
|
exports.UserType = UserType;
|
|
112
|
+
exports.allUserModelKeys = Object.getOwnPropertyNames(new UserType());
|
|
82
113
|
let UserTypeInput = class UserTypeInput {
|
|
114
|
+
constructor() {
|
|
115
|
+
this.city = '';
|
|
116
|
+
this.state = '';
|
|
117
|
+
this.zipcode = '';
|
|
118
|
+
}
|
|
83
119
|
};
|
|
84
120
|
__decorate([
|
|
85
121
|
(0, couchset_1.Field)(() => String, { nullable: true })
|
|
@@ -111,6 +147,15 @@ __decorate([
|
|
|
111
147
|
__decorate([
|
|
112
148
|
(0, couchset_1.Field)(() => String, { nullable: true })
|
|
113
149
|
], UserTypeInput.prototype, "country", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, couchset_1.Field)(() => String, { nullable: true })
|
|
152
|
+
], UserTypeInput.prototype, "city", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, couchset_1.Field)(() => String, { nullable: true })
|
|
155
|
+
], UserTypeInput.prototype, "state", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
(0, couchset_1.Field)(() => String, { nullable: true })
|
|
158
|
+
], UserTypeInput.prototype, "zipcode", void 0);
|
|
114
159
|
__decorate([
|
|
115
160
|
(0, couchset_1.Field)(() => String, { nullable: true })
|
|
116
161
|
], UserTypeInput.prototype, "bio", void 0);
|
|
@@ -152,6 +197,9 @@ exports.userModelPublicSelectors = [
|
|
|
152
197
|
'phone',
|
|
153
198
|
'website',
|
|
154
199
|
'address',
|
|
200
|
+
'city',
|
|
201
|
+
'state',
|
|
202
|
+
'zipcode',
|
|
155
203
|
'country',
|
|
156
204
|
'bio',
|
|
157
205
|
'avatar',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.model.js","sourceRoot":"","sources":["../../src/user/User.model.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAA6D;AAE7D,mCAA+B;AAE/B,MAAM,SAAS,GAAG,MAAM,CAAC;AACzB;;GAEG;AAGH,IAAa,QAAQ,GAArB,MAAa,QAAQ;
|
|
1
|
+
{"version":3,"file":"User.model.js","sourceRoot":"","sources":["../../src/user/User.model.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAA6D;AAE7D,mCAA+B;AAE/B,MAAM,SAAS,GAAG,MAAM,CAAC;AACzB;;GAEG;AAGH,IAAa,QAAQ,GAArB,MAAa,QAAQ;IAArB;QAEI,OAAE,GAAY,EAAE,CAAC;QAGjB,UAAK,GAAY,EAAE,CAAC;QAGpB,aAAQ,GAAY,EAAE,CAAC;QAGvB,aAAQ,GAAY,EAAE,CAAC;QAGvB,cAAS,GAAY,EAAE,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+20,21 @@ const logs_1 = require("@roadmanjs/logs");
|
|
|
20
20
|
const User_methods_1 = require("./User.methods");
|
|
21
21
|
const firebaseToken_1 = require("../middlewares/firebaseToken");
|
|
22
22
|
const auth_1 = require("./auth");
|
|
23
|
+
const _1 = require(".");
|
|
23
24
|
let UserAuthResolver = class UserAuthResolver {
|
|
24
25
|
async phoneLogin(phone, _firebaseToken, createNew, { res }) {
|
|
25
26
|
try {
|
|
26
27
|
const username = phone;
|
|
27
28
|
(0, logs_1.log)(`LOGIN: phone=${phone} _firebaseToken=${_firebaseToken}`);
|
|
28
29
|
const users = await User_model_1.UserModel.pagination({
|
|
29
|
-
select:
|
|
30
|
+
select: _1.allUserModelKeys,
|
|
30
31
|
where: {
|
|
31
32
|
$or: [{ email: { $eq: username } }, { phone: username }, { phone: `+1${username}` }],
|
|
32
33
|
},
|
|
33
34
|
});
|
|
34
35
|
(0, logs_1.log)(`users found are users=${users.length}`);
|
|
35
|
-
const
|
|
36
|
+
const foundUsers = users;
|
|
37
|
+
const firstUser = foundUsers[0];
|
|
36
38
|
if (!(0, isEmpty_1.default)(firstUser)) {
|
|
37
39
|
// user is found
|
|
38
40
|
const user = firstUser; // get first document
|
|
@@ -42,6 +44,9 @@ let UserAuthResolver = class UserAuthResolver {
|
|
|
42
44
|
return response;
|
|
43
45
|
}
|
|
44
46
|
else {
|
|
47
|
+
if (!createNew) {
|
|
48
|
+
throw new Error('Should not create new user');
|
|
49
|
+
}
|
|
45
50
|
// create new
|
|
46
51
|
const response = await (0, User_methods_1.createNewUser)({
|
|
47
52
|
email: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.resolver.auth.js","sourceRoot":"","sources":["../../src/user/User.resolver.auth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAAkF;AAClF,6DAAqC;AACrC,6CAA0D;AAC1D,0CAAoC;AAEpC,iDAA+D;AAC/D,gEAAiE;AACjE,iCAAwC;
|
|
1
|
+
{"version":3,"file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,EAAC,CAAC,CAAA;IACjD,WAAA,IAAA,cAAG,GAAE,CAAA;kDA4DT;AAnEQ,gBAAgB;IAD5B,IAAA,mBAAQ,GAAE;GACE,gBAAgB,CAoE5B;AApEY,4CAAgB;AAsE7B,kBAAe,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roadmanjs/auth",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": " An auth roadman using a UserType model in Couchbase and firebase-auth",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"private": false,
|
|
20
20
|
"scripts": {
|
|
21
21
|
"lint": "tslint \"src/**/*.ts\" --project tsconfig.json",
|
|
22
|
-
"build": "
|
|
22
|
+
"build": "rm -rf dist && ./node_modules/.bin/tsc --skipLibCheck && npm run client",
|
|
23
|
+
"client": "node dist/script.js",
|
|
23
24
|
"test": "mocha src/*test.ts --exit",
|
|
24
|
-
"prepublishOnly": "npm run build",
|
|
25
25
|
"eslint": "eslint ./src --fix --ext=ts"
|
|
26
26
|
},
|
|
27
27
|
"lint-staged": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@typescript-eslint/eslint-plugin": "^3.4.0",
|
|
47
47
|
"@typescript-eslint/parser": "^3.4.0",
|
|
48
48
|
"chai": "^4.2.0",
|
|
49
|
-
"eslint": "
|
|
49
|
+
"eslint": "7.32.0",
|
|
50
50
|
"eslint-config-prettier": "^6.11.0",
|
|
51
51
|
"eslint-loader": "^4.0.2",
|
|
52
52
|
"eslint-plugin-import": "^2.20.2",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"eslint-plugin-typescript": "^0.14.0",
|
|
57
57
|
"husky": "^4.2.5",
|
|
58
58
|
"lint-staged": "^10.1.7",
|
|
59
|
-
"mocha": "^
|
|
59
|
+
"mocha": "^9.2.0",
|
|
60
60
|
"prettier": "^2.0.5",
|
|
61
61
|
"rimraf": "^2.5.4",
|
|
62
62
|
"ts-node": "^9.1.1",
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"@roadmanjs/couchset": "^0.0.3",
|
|
75
75
|
"@roadmanjs/firebase-admin": "^0.0.4",
|
|
76
76
|
"@roadmanjs/logs": "^0.0.1",
|
|
77
|
+
"@roadmanjs/utils": "^0.0.3",
|
|
77
78
|
"jsonwebtoken": "^8.5.1"
|
|
78
79
|
}
|
|
79
80
|
}
|