@roadmanjs/auth-client 0.0.14 → 0.0.15
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/gql/shared.d.ts +6 -0
- package/gql/shared.js +15 -0
- package/gql/shared.js.map +1 -0
- package/gql/user.fragment.d.ts +30 -0
- package/gql/user.fragment.js +44 -0
- package/gql/user.fragment.js.map +1 -0
- package/gql/user.mutation.d.ts +8 -0
- package/gql/user.mutation.js +74 -0
- package/gql/user.mutation.js.map +1 -0
- package/gql/user.query.d.ts +3 -0
- package/gql/user.query.js +41 -0
- package/gql/user.query.js.map +1 -0
- package/gql/user.subscription.d.ts +1 -0
- package/gql/user.subscription.js +17 -0
- package/gql/user.subscription.js.map +1 -0
- package/package.json +1 -1
package/gql/shared.d.ts
ADDED
package/gql/shared.js
ADDED
|
@@ -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"}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@roadmanjs/auth-client","version":"0.0.
|
|
1
|
+
{"name":"@roadmanjs/auth-client","version":"0.0.15","description":"GraphQL client gql for @roadmanjs/auth","main":"index.js","types":"index.d.ts","files":["docs/","/gql","register/","LICENSE"],"author":{"name":"Ceddy Muhoza","email":"ceddymuhoza@gmail.com","url":"https://ceddy.org"},"license":"MIT","private":false,"scripts":{},"lint-staged":{"*.{ts,tsx}":["npm run eslint"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"devDependencies":{},"peerDependencies":{},"dependencies":{"graphql-tag":"^2.12.5"}}
|