@ludo.ninja/components 1.5.9 → 1.6.1
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/hooks/apollo/index.d.ts +2 -1
- package/dist/hooks/apollo/index.jsx +7 -1
- package/dist/hooks/searchFiltersConnector/index.d.ts +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/api/graphql/index.d.ts +0 -4
- package/dist/api/graphql/index.js +0 -7
- package/dist/api/index.d.ts +0 -1
- package/dist/api/index.js +0 -1
- package/dist/api/server-assets/mutations/useDislikeAsset/index.d.ts +0 -7
- package/dist/api/server-assets/mutations/useDislikeAsset/index.js +0 -79
- package/dist/api/server-assets/mutations/useLikeAsset/index.d.ts +0 -7
- package/dist/api/server-assets/mutations/useLikeAsset/index.js +0 -80
- package/dist/api/server-assets/queries/useFetchAssetByBlockchain/index.d.ts +0 -14
- package/dist/api/server-assets/queries/useFetchAssetByBlockchain/index.js +0 -84
- package/dist/api/server-assets/queries/useFetchAssets/index.d.ts +0 -7
- package/dist/api/server-assets/queries/useFetchAssets/index.js +0 -30
- package/dist/api/server-assets/queries/useFetchDynamicAssetLikes/index.d.ts +0 -8
- package/dist/api/server-assets/queries/useFetchDynamicAssetLikes/index.js +0 -35
- package/dist/api/server-assets/queries/useFetchDynamicAssetsLikes/index.d.ts +0 -7
- package/dist/api/server-assets/queries/useFetchDynamicAssetsLikes/index.js +0 -30
- package/dist/api/server-collection/mutations/useDislikeCollection/index.d.ts +0 -7
- package/dist/api/server-collection/mutations/useDislikeCollection/index.js +0 -78
- package/dist/api/server-collection/mutations/useLikeCollection/index.d.ts +0 -7
- package/dist/api/server-collection/mutations/useLikeCollection/index.js +0 -78
- package/dist/api/server-experiences/queries/useFetchMyExperienceWithLevel/index.d.ts +0 -2
- package/dist/api/server-experiences/queries/useFetchMyExperienceWithLevel/index.js +0 -91
- package/dist/api/server-experiences/queries/useFetchMyTasks/index.d.ts +0 -31
- package/dist/api/server-experiences/queries/useFetchMyTasks/index.js +0 -46
- package/dist/api/server-galleries/mutations/useAddAssetsToGallery/index.d.ts +0 -7
- package/dist/api/server-galleries/mutations/useAddAssetsToGallery/index.js +0 -82
- package/dist/api/server-galleries/mutations/useAddChangeGalleryBanner/index.d.ts +0 -4
- package/dist/api/server-galleries/mutations/useAddChangeGalleryBanner/index.js +0 -67
- package/dist/api/server-galleries/mutations/useAddCollectionsToGallery/index.d.ts +0 -7
- package/dist/api/server-galleries/mutations/useAddCollectionsToGallery/index.js +0 -81
- package/dist/api/server-galleries/mutations/useAddCreationsToGallery/index.d.ts +0 -7
- package/dist/api/server-galleries/mutations/useAddCreationsToGallery/index.js +0 -89
- package/dist/api/server-galleries/mutations/useCreateFavorites/index.d.ts +0 -6
- package/dist/api/server-galleries/mutations/useCreateFavorites/index.js +0 -70
- package/dist/api/server-galleries/mutations/useCreateGallery/index.d.ts +0 -6
- package/dist/api/server-galleries/mutations/useCreateGallery/index.js +0 -70
- package/dist/api/server-galleries/mutations/useDeleteGallery/index.d.ts +0 -8
- package/dist/api/server-galleries/mutations/useDeleteGallery/index.js +0 -87
- package/dist/api/server-galleries/mutations/useDeleteGalleryBanner/index.d.ts +0 -5
- package/dist/api/server-galleries/mutations/useDeleteGalleryBanner/index.js +0 -83
- package/dist/api/server-galleries/mutations/useEditGallery/index.d.ts +0 -5
- package/dist/api/server-galleries/mutations/useEditGallery/index.js +0 -62
- package/dist/api/server-galleries/mutations/useRemoveAssetFromGallery/index.d.ts +0 -7
- package/dist/api/server-galleries/mutations/useRemoveAssetFromGallery/index.js +0 -95
- package/dist/api/server-galleries/mutations/useRemoveCollectionFromGallery/index.d.ts +0 -7
- package/dist/api/server-galleries/mutations/useRemoveCollectionFromGallery/index.js +0 -90
- package/dist/api/server-galleries/queries/useFetchGallery/index.d.ts +0 -16
- package/dist/api/server-galleries/queries/useFetchGallery/index.js +0 -42
- package/dist/api/server-galleries/queries/useFetchGalleryAssets/index.d.ts +0 -18
- package/dist/api/server-galleries/queries/useFetchGalleryAssets/index.js +0 -115
- package/dist/api/server-galleries/queries/useFetchMyFavorites/index.d.ts +0 -10
- package/dist/api/server-galleries/queries/useFetchMyFavorites/index.js +0 -120
- package/dist/api/server-galleries/queries/useFetchMyGalleries/index.d.ts +0 -10
- package/dist/api/server-galleries/queries/useFetchMyGalleries/index.js +0 -123
- package/dist/api/server-galleries/queries/useFetchSubscribedGalleries/index.d.ts +0 -9
- package/dist/api/server-galleries/queries/useFetchSubscribedGalleries/index.js +0 -95
- package/dist/api/server-galleries/queries/useFetchUserFavorites/index.d.ts +0 -11
- package/dist/api/server-galleries/queries/useFetchUserFavorites/index.js +0 -130
- package/dist/api/server-identities/mutations/useAddWalletElrond/index.d.ts +0 -6
- package/dist/api/server-identities/mutations/useAddWalletElrond/index.js +0 -37
- package/dist/api/server-identities/mutations/useAddWalletFlow/index.d.ts +0 -5
- package/dist/api/server-identities/mutations/useAddWalletFlow/index.js +0 -78
- package/dist/api/server-identities/mutations/useAddWalletMetamask/index.d.ts +0 -12
- package/dist/api/server-identities/mutations/useAddWalletMetamask/index.js +0 -87
- package/dist/api/server-identities/mutations/useAddWalletSolana/index.d.ts +0 -5
- package/dist/api/server-identities/mutations/useAddWalletSolana/index.js +0 -82
- package/dist/api/server-identities/mutations/useAddWalletTezos/index.d.ts +0 -5
- package/dist/api/server-identities/mutations/useAddWalletTezos/index.js +0 -78
- package/dist/api/server-identities/mutations/useFollowProfile/index.d.ts +0 -7
- package/dist/api/server-identities/mutations/useFollowProfile/index.js +0 -40
- package/dist/api/server-identities/mutations/useGenerateNewInviteCodes/index.d.ts +0 -7
- package/dist/api/server-identities/mutations/useGenerateNewInviteCodes/index.js +0 -78
- package/dist/api/server-identities/mutations/useInviteCode/index.d.ts +0 -9
- package/dist/api/server-identities/mutations/useInviteCode/index.js +0 -76
- package/dist/api/server-identities/mutations/useRemoveWallet/index.d.ts +0 -8
- package/dist/api/server-identities/mutations/useRemoveWallet/index.js +0 -44
- package/dist/api/server-identities/mutations/useRevokeToken/index.d.ts +0 -4
- package/dist/api/server-identities/mutations/useRevokeToken/index.js +0 -66
- package/dist/api/server-identities/mutations/useSaveEmailOfJoiner/index.js +0 -76
- package/dist/api/server-identities/mutations/useUnfollowProfile/index.d.ts +0 -7
- package/dist/api/server-identities/mutations/useUnfollowProfile/index.js +0 -39
- package/dist/api/server-identities/queries/useFetchProfile/index.d.ts +0 -16
- package/dist/api/server-identities/queries/useFetchProfile/index.js +0 -79
- package/dist/api/server-identities/queries/useFetchUserWallets/index.js +0 -19
- package/dist/api/server-identities/queries/useGetMyInviteCodes/index.d.ts +0 -8
- package/dist/api/server-identities/queries/useGetMyInviteCodes/index.js +0 -36
- package/dist/api/server-medias/mutations/useDeleteUserpic/index.d.ts +0 -6
- package/dist/api/server-medias/mutations/useDeleteUserpic/index.js +0 -19
- package/dist/api/server-medias/mutations/useUploadUserpic/index.d.ts +0 -4
- package/dist/api/server-medias/mutations/useUploadUserpic/index.js +0 -69
- package/dist/api/server-medias/queries/useFetchUserPic/index.js +0 -37
- package/dist/api/server-opportunities/mutations/useDislikeOpportunity.d.ts +0 -4
- package/dist/api/server-opportunities/mutations/useDislikeOpportunity.js +0 -71
- package/dist/api/server-opportunities/mutations/useLikeOpportunity.d.ts +0 -4
- package/dist/api/server-opportunities/mutations/useLikeOpportunity.js +0 -71
- package/dist/api/server-opportunities/mutations/useOpenOpportunity/index.d.ts +0 -5
- package/dist/api/server-opportunities/mutations/useOpenOpportunity/index.js +0 -72
- package/dist/api/server-opportunities/queries/useGetOpportunities.d.ts +0 -4
- package/dist/api/server-opportunities/queries/useGetOpportunities.js +0 -22
- package/dist/api/server-preferences/mutations/useSaveUserExpectations/index.d.ts +0 -4
- package/dist/api/server-preferences/mutations/useSaveUserExpectations/index.jsx +0 -86
- package/dist/api/server-preferences/mutations/useSaveUserInterests/index.d.ts +0 -4
- package/dist/api/server-preferences/mutations/useSaveUserInterests/index.js +0 -86
- package/dist/api/server-preferences/queries/fetchSearchResultSelections/index.js +0 -28
- package/dist/api/server-preferences/queries/fetchSearchResultSelections/queryData.d.ts +0 -14
- package/dist/api/server-preferences/queries/fetchSearchResultSelections/queryData.js +0 -87
- package/dist/api/server-preferences/queries/useFetchExpectations/index.js +0 -19
- package/dist/api/server-preferences/queries/useFetchInterests/index.js +0 -19
- package/dist/api/server-preferences/queries/useFetchSearchResultTimeSelection/index.d.ts +0 -12
- package/dist/api/server-preferences/queries/useFetchSearchResultTimeSelection/index.js +0 -36
- package/dist/api/server-preferences/queries/useFetchUserInterests/index.d.ts +0 -7
- package/dist/api/server-preferences/queries/useFetchUserInterests/index.js +0 -20
- package/dist/api/server-preferences/queries/useSearchResultBlockchainSelections/index.d.ts +0 -13
- package/dist/api/server-preferences/queries/useSearchResultBlockchainSelections/index.js +0 -37
- package/dist/api/server-preferences/queries/useSearchResultCategorySelections/index.d.ts +0 -13
- package/dist/api/server-preferences/queries/useSearchResultCategorySelections/index.js +0 -37
- package/dist/api/server-preferences/queries/useSearchResultStatusSelections/index.d.ts +0 -14
- package/dist/api/server-preferences/queries/useSearchResultStatusSelections/index.js +0 -38
- package/dist/api/server-preferences/queries/useSearchResultTypeSelections/index.d.ts +0 -13
- package/dist/api/server-preferences/queries/useSearchResultTypeSelections/index.js +0 -42
- package/dist/api/server-search/queries/useFetchAllCreations/index.js +0 -171
- package/dist/api/server-search/queries/useFetchAssetsCount/index.d.ts +0 -7
- package/dist/api/server-search/queries/useFetchAssetsCount/index.js +0 -31
- package/dist/api/server-search/queries/useFetchCollection/index.d.ts +0 -19
- package/dist/api/server-search/queries/useFetchCollection/index.js +0 -55
- package/dist/api/server-search/queries/useFetchCollections/index.d.ts +0 -23
- package/dist/api/server-search/queries/useFetchCollections/index.js +0 -176
- package/dist/api/server-search/queries/useFetchDynamicCollectionData/index.d.ts +0 -13
- package/dist/api/server-search/queries/useFetchDynamicCollectionData/index.js +0 -195
- package/dist/api/server-search/queries/useFetchFindAllTopEntitiesByName/index.js +0 -54
- package/dist/api/server-search/queries/useFetchNetWorth/index.d.ts +0 -7
- package/dist/api/server-search/queries/useFetchNetWorth/index.js +0 -22
- package/dist/api/server-search/queries/useFindCreations/index.js +0 -184
- package/dist/api/server-search/queries/useFindProfilesByName/index.js +0 -58
- package/dist/api/server-search/queries/useFindShowcaseItems/index.d.ts +0 -2
- package/dist/api/server-search/queries/useFindShowcaseItems/index.js +0 -40
- package/dist/api/server-search/queries/useFindUserCreations/index.js +0 -168
- package/dist/api/server-search/queries/useFindUserShowcaseItems/index.d.ts +0 -2
- package/dist/api/server-search/queries/useFindUserShowcaseItems/index.js +0 -38
- package/dist/api/subscriptions/SubscriberInviteNotification.d.ts +0 -2
- package/dist/api/subscriptions/SubscriberInviteNotification.jsx +0 -40
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { useMutation } from '@apollo/client';
|
|
13
|
-
import { hosts, identitySchema as schema } from '@ludo.ninja/api';
|
|
14
|
-
import { alertError, alertSuccess, } from '@ludo.ninja/ui/build/system/Alert/data';
|
|
15
|
-
import { useUiStore } from '@/store/ui';
|
|
16
|
-
var useAddWalletElrond = function () {
|
|
17
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
18
|
-
var _a = useMutation(schema.AddWalletElrondDocument, {
|
|
19
|
-
context: {
|
|
20
|
-
uri: hosts.identityHost,
|
|
21
|
-
},
|
|
22
|
-
onCompleted: function () {
|
|
23
|
-
openAlert(__assign(__assign({}, alertSuccess), { caption: 'MultiversX wallet successfully added !', text: '' }));
|
|
24
|
-
},
|
|
25
|
-
onError: function (err) {
|
|
26
|
-
openAlert(__assign(__assign({}, alertError), { caption: err.message, text: '' }));
|
|
27
|
-
},
|
|
28
|
-
}), mutate = _a[0], error = _a[1].error;
|
|
29
|
-
return { addWalletElrond: addWalletElrond, error: error };
|
|
30
|
-
function addWalletElrond(_a) {
|
|
31
|
-
var signature = _a.signature, address = _a.address;
|
|
32
|
-
return mutate({
|
|
33
|
-
variables: { signature: signature, address: address },
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
export default useAddWalletElrond;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import { useMutation } from '@apollo/client';
|
|
49
|
-
import { hosts, identitySchema as schema } from '@ludo.ninja/api';
|
|
50
|
-
import { alertError, alertSuccess, } from '@ludo.ninja/ui/build/system/Alert/data';
|
|
51
|
-
import { useUiStore } from '@/store/ui';
|
|
52
|
-
var useAddWalletFlow = function () {
|
|
53
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
54
|
-
var mutate = useMutation(schema.AddWalletFlowDocument, {
|
|
55
|
-
context: {
|
|
56
|
-
uri: hosts.identityHost,
|
|
57
|
-
},
|
|
58
|
-
onCompleted: function () {
|
|
59
|
-
openAlert(__assign(__assign({}, alertSuccess), { caption: 'Flow wallet successfully added !', text: '' }));
|
|
60
|
-
},
|
|
61
|
-
onError: function (err) {
|
|
62
|
-
openAlert(__assign(__assign({}, alertError), { caption: err.message, text: '' }));
|
|
63
|
-
},
|
|
64
|
-
})[0];
|
|
65
|
-
return { addWalletFlow: addWalletFlow };
|
|
66
|
-
function addWalletFlow(_a) {
|
|
67
|
-
var signature = _a.signature, address = _a.address;
|
|
68
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
-
return __generator(this, function (_b) {
|
|
70
|
-
mutate({
|
|
71
|
-
variables: { signature: signature, address: address },
|
|
72
|
-
});
|
|
73
|
-
return [2 /*return*/];
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
export default useAddWalletFlow;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { identitySchema as schema } from '@ludo.ninja/api';
|
|
2
|
-
declare const useAddWalletMetamask: () => {
|
|
3
|
-
addWalletMetamask: ({ signature, address, chainId, }: schema.IAddWalletMetamaskMutationVariables) => Promise<{
|
|
4
|
-
userId: any;
|
|
5
|
-
wallets: any;
|
|
6
|
-
authToken: any;
|
|
7
|
-
refreshToken: any;
|
|
8
|
-
newUser: any;
|
|
9
|
-
}>;
|
|
10
|
-
error: import("@apollo/client").ApolloError;
|
|
11
|
-
};
|
|
12
|
-
export default useAddWalletMetamask;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import { useMutation } from '@apollo/client';
|
|
49
|
-
import { hosts, identitySchema as schema } from '@ludo.ninja/api';
|
|
50
|
-
import { alertError, alertSuccess, } from '@ludo.ninja/ui/build/system/Alert/data';
|
|
51
|
-
import { useUiStore } from '@/store/ui';
|
|
52
|
-
var useAddWalletMetamask = function () {
|
|
53
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
54
|
-
var _a = useMutation(schema.AddWalletMetamaskDocument, {
|
|
55
|
-
context: {
|
|
56
|
-
uri: hosts.identityHost,
|
|
57
|
-
},
|
|
58
|
-
onCompleted: function () {
|
|
59
|
-
openAlert(__assign(__assign({}, alertSuccess), { caption: 'Metamask wallet successfully added !', text: '' }));
|
|
60
|
-
},
|
|
61
|
-
onError: function (err) {
|
|
62
|
-
openAlert(__assign(__assign({}, alertError), { caption: err.message, text: '' }));
|
|
63
|
-
},
|
|
64
|
-
}), mutate = _a[0], error = _a[1].error;
|
|
65
|
-
return { addWalletMetamask: addWalletMetamask, error: error };
|
|
66
|
-
function addWalletMetamask(_a) {
|
|
67
|
-
var signature = _a.signature, address = _a.address, chainId = _a.chainId;
|
|
68
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
-
var data, _b, userId, wallets, authToken, refreshToken, newUser;
|
|
70
|
-
return __generator(this, function (_c) {
|
|
71
|
-
switch (_c.label) {
|
|
72
|
-
case 0: return [4 /*yield*/, mutate({
|
|
73
|
-
variables: { signature: signature, address: address, chainId: chainId },
|
|
74
|
-
})];
|
|
75
|
-
case 1:
|
|
76
|
-
data = (_c.sent()).data;
|
|
77
|
-
if (data) {
|
|
78
|
-
_b = data.signInMetamask, userId = _b.userId, wallets = _b.wallets, authToken = _b.authToken, refreshToken = _b.refreshToken, newUser = _b.newUser;
|
|
79
|
-
return [2 /*return*/, { userId: userId, wallets: wallets, authToken: authToken, refreshToken: refreshToken, newUser: newUser }];
|
|
80
|
-
}
|
|
81
|
-
return [2 /*return*/];
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
export default useAddWalletMetamask;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import { useMutation } from '@apollo/client';
|
|
49
|
-
import { hosts, identitySchema as schema } from '@ludo.ninja/api';
|
|
50
|
-
import { alertError, alertSuccess, } from '@ludo.ninja/ui/build/system/Alert/data';
|
|
51
|
-
import { useUiStore } from '@/store/ui';
|
|
52
|
-
var useAddWalletSolana = function () {
|
|
53
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
54
|
-
var mutate = useMutation(schema.AddWalletSolanaDocument, {
|
|
55
|
-
context: {
|
|
56
|
-
uri: hosts.identityHost,
|
|
57
|
-
},
|
|
58
|
-
onCompleted: function () {
|
|
59
|
-
openAlert(__assign(__assign({}, alertSuccess), { caption: 'Solana wallet successfully added !', text: '' }));
|
|
60
|
-
},
|
|
61
|
-
onError: function (err) {
|
|
62
|
-
openAlert(__assign(__assign({}, alertError), { caption: err.message, text: '' }));
|
|
63
|
-
},
|
|
64
|
-
})[0];
|
|
65
|
-
return { addWalletSolana: addWalletSolana };
|
|
66
|
-
function addWalletSolana(_a) {
|
|
67
|
-
var signature = _a.signature, pubkey = _a.pubkey;
|
|
68
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
-
return __generator(this, function (_b) {
|
|
70
|
-
switch (_b.label) {
|
|
71
|
-
case 0: return [4 /*yield*/, mutate({
|
|
72
|
-
variables: { signature: signature, pubkey: pubkey },
|
|
73
|
-
})];
|
|
74
|
-
case 1:
|
|
75
|
-
_b.sent();
|
|
76
|
-
return [2 /*return*/];
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
export default useAddWalletSolana;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import { useMutation } from '@apollo/client';
|
|
49
|
-
import { hosts, identitySchema as schema } from '@ludo.ninja/api';
|
|
50
|
-
import { alertError, alertSuccess, } from '@ludo.ninja/ui/build/system/Alert/data';
|
|
51
|
-
import { useUiStore } from '@/store/ui';
|
|
52
|
-
var useAddWalletTezos = function () {
|
|
53
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
54
|
-
var mutate = useMutation(schema.AddWalletTezosDocument, {
|
|
55
|
-
context: {
|
|
56
|
-
uri: hosts.identityHost,
|
|
57
|
-
},
|
|
58
|
-
onCompleted: function () {
|
|
59
|
-
openAlert(__assign(__assign({}, alertSuccess), { caption: 'Tezos wallet successfully added !', text: '' }));
|
|
60
|
-
},
|
|
61
|
-
onError: function (err) {
|
|
62
|
-
openAlert(__assign(__assign({}, alertError), { caption: err.message, text: '' }));
|
|
63
|
-
},
|
|
64
|
-
})[0];
|
|
65
|
-
return { addWalletTezos: addWalletTezos };
|
|
66
|
-
function addWalletTezos(_a) {
|
|
67
|
-
var signature = _a.signature, pubkey = _a.pubkey;
|
|
68
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
-
return __generator(this, function (_b) {
|
|
70
|
-
mutate({
|
|
71
|
-
variables: { signature: signature, pubkey: pubkey },
|
|
72
|
-
});
|
|
73
|
-
return [2 /*return*/];
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
export default useAddWalletTezos;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare const useFollowProfile: (followingUserId: string) => {
|
|
2
|
-
followProfile: (options?: import("@apollo/client").MutationFunctionOptions<any, import("@apollo/client").OperationVariables, {
|
|
3
|
-
uri: string;
|
|
4
|
-
}, import("@apollo/client").ApolloCache<any>>) => Promise<import("@apollo/client").FetchResult<any>>;
|
|
5
|
-
isFollowedProfile: boolean;
|
|
6
|
-
};
|
|
7
|
-
export default useFollowProfile;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import { useState } from 'react';
|
|
6
|
-
import { gql, useMutation } from '@apollo/client';
|
|
7
|
-
import { hosts } from '@ludo.ninja/api';
|
|
8
|
-
import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
|
|
9
|
-
import { useUiStore } from '@/store/ui';
|
|
10
|
-
var FOLLOW_PROFILE_MUTATION = gql(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n mutation FollowProfile($followingUserId: ID!) {\n followProfile(followingUserId: $followingUserId)\n }\n"], ["\n mutation FollowProfile($followingUserId: ID!) {\n followProfile(followingUserId: $followingUserId)\n }\n"])));
|
|
11
|
-
var useFollowProfile = function (followingUserId) {
|
|
12
|
-
var _a = useState(false), isFollowedProfile = _a[0], setIsFollowed = _a[1];
|
|
13
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
14
|
-
var followProfile = useMutation(FOLLOW_PROFILE_MUTATION, {
|
|
15
|
-
variables: { followingUserId: followingUserId },
|
|
16
|
-
context: {
|
|
17
|
-
uri: hosts.identityHost,
|
|
18
|
-
},
|
|
19
|
-
fetchPolicy: 'no-cache',
|
|
20
|
-
onCompleted: function (_a) {
|
|
21
|
-
var followProfile = _a.followProfile;
|
|
22
|
-
setIsFollowed(followProfile);
|
|
23
|
-
openAlert({
|
|
24
|
-
type: alertVariants.success,
|
|
25
|
-
caption: 'You successfully subscribed!',
|
|
26
|
-
text: '',
|
|
27
|
-
});
|
|
28
|
-
},
|
|
29
|
-
onError: function (err) {
|
|
30
|
-
setIsFollowed(false);
|
|
31
|
-
openAlert({
|
|
32
|
-
type: alertVariants.error,
|
|
33
|
-
caption: err.message,
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
})[0];
|
|
37
|
-
return { followProfile: followProfile, isFollowedProfile: isFollowedProfile };
|
|
38
|
-
};
|
|
39
|
-
export default useFollowProfile;
|
|
40
|
-
var templateObject_1;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { identitySchema as schema } from '@ludo.ninja/api';
|
|
2
|
-
declare const useGenerateNewInviteCodes: () => {
|
|
3
|
-
generateNewInviteCodes: ({ codesNum, }: schema.IMutationGenerateNewInviteCodesArgs) => Promise<void>;
|
|
4
|
-
generatedCodes: schema.IUserInviteCode[];
|
|
5
|
-
error: import("@apollo/client").ApolloError;
|
|
6
|
-
};
|
|
7
|
-
export default useGenerateNewInviteCodes;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { useState } from 'react';
|
|
38
|
-
import { useMutation } from '@apollo/client';
|
|
39
|
-
import { hosts, identitySchema as schema } from '@ludo.ninja/api';
|
|
40
|
-
var useGenerateNewInviteCodes = function () {
|
|
41
|
-
var _a = useState(null), generatedCodes = _a[0], setGeneratedCodes = _a[1];
|
|
42
|
-
var _b = useMutation(schema.GenerateNewInviteCodesDocument, {
|
|
43
|
-
context: {
|
|
44
|
-
uri: hosts.identityHost,
|
|
45
|
-
},
|
|
46
|
-
onCompleted: function (_a) {
|
|
47
|
-
var generateNewInviteCodes = _a.generateNewInviteCodes;
|
|
48
|
-
setGeneratedCodes(generateNewInviteCodes);
|
|
49
|
-
},
|
|
50
|
-
onError: function () {
|
|
51
|
-
setGeneratedCodes(null);
|
|
52
|
-
},
|
|
53
|
-
}), mutate = _b[0], error = _b[1].error;
|
|
54
|
-
return { generateNewInviteCodes: generateNewInviteCodes, generatedCodes: generatedCodes, error: error };
|
|
55
|
-
function generateNewInviteCodes(_a) {
|
|
56
|
-
var codesNum = _a.codesNum;
|
|
57
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
58
|
-
var err_1;
|
|
59
|
-
return __generator(this, function (_b) {
|
|
60
|
-
switch (_b.label) {
|
|
61
|
-
case 0:
|
|
62
|
-
_b.trys.push([0, 2, , 3]);
|
|
63
|
-
return [4 /*yield*/, mutate({
|
|
64
|
-
variables: { codesNum: codesNum },
|
|
65
|
-
})];
|
|
66
|
-
case 1:
|
|
67
|
-
_b.sent();
|
|
68
|
-
return [3 /*break*/, 3];
|
|
69
|
-
case 2:
|
|
70
|
-
err_1 = _b.sent();
|
|
71
|
-
throw new Error(err_1);
|
|
72
|
-
case 3: return [2 /*return*/];
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
export default useGenerateNewInviteCodes;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ApolloError } from '@apollo/client';
|
|
2
|
-
import { identitySchema } from '@ludo.ninja/api';
|
|
3
|
-
type UseInviteCodeReturnType = {
|
|
4
|
-
activateInviteCode: ({ inviteCode, }: identitySchema.IUseInviteCodeMutationVariables) => Promise<any>;
|
|
5
|
-
error: ApolloError;
|
|
6
|
-
loading: boolean;
|
|
7
|
-
};
|
|
8
|
-
declare const useInviteCode: () => UseInviteCodeReturnType;
|
|
9
|
-
export default useInviteCode;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import { hosts, identitySchema } from '@ludo.ninja/api';
|
|
49
|
-
import { alertError, alertSuccess, } from '@ludo.ninja/ui/build/system/Alert/data';
|
|
50
|
-
import { useUiStore } from '@/store/ui';
|
|
51
|
-
var useInviteCode = function () {
|
|
52
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
53
|
-
var _a = identitySchema.useUseInviteCodeMutation({
|
|
54
|
-
context: {
|
|
55
|
-
uri: hosts.identityHost,
|
|
56
|
-
},
|
|
57
|
-
onCompleted: function () {
|
|
58
|
-
openAlert(__assign(__assign({}, alertSuccess), { caption: 'Success!', text: 'Invite code applied' }));
|
|
59
|
-
},
|
|
60
|
-
onError: function (err) {
|
|
61
|
-
openAlert(__assign(__assign({}, alertError), { caption: err.message, text: '' }));
|
|
62
|
-
},
|
|
63
|
-
}), mutate = _a[0], _b = _a[1], error = _b.error, loading = _b.loading;
|
|
64
|
-
return { activateInviteCode: activateInviteCode, error: error, loading: loading };
|
|
65
|
-
function activateInviteCode(_a) {
|
|
66
|
-
var inviteCode = _a.inviteCode;
|
|
67
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
-
return __generator(this, function (_b) {
|
|
69
|
-
return [2 /*return*/, mutate({
|
|
70
|
-
variables: { inviteCode: inviteCode },
|
|
71
|
-
})];
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
export default useInviteCode;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ApolloError } from '@apollo/client';
|
|
2
|
-
import { identitySchema as schema } from '@ludo.ninja/api';
|
|
3
|
-
type UseRemoveWalletReturnType = {
|
|
4
|
-
removeWallet: ({ blockchain, address, chainId, }: schema.IMutationRemoveWalletArgs) => Promise<any>;
|
|
5
|
-
error: ApolloError;
|
|
6
|
-
};
|
|
7
|
-
declare const useRemoveWallet: ({ userId, }: schema.IQueryFetchUserWalletsArgs) => UseRemoveWalletReturnType;
|
|
8
|
-
export default useRemoveWallet;
|