@ludo.ninja/api 2.2.9 → 2.3.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/build/config/index.js +7 -7
- package/build/cookies/index.js +3 -4
- package/build/graphql_tools/__generated__/schema.d.ts +156 -3
- package/build/graphql_tools/__generated__/schema.js +70 -6
- package/package.json +1 -1
- package/src/config/index.ts +7 -7
- package/src/cookies/index.ts +3 -4
- package/src/graphql_tools/__generated__/schema.ts +209 -3
- package/tsconfig.tsbuildinfo +1 -1
package/build/config/index.js
CHANGED
|
@@ -18,7 +18,7 @@ const graphql_ws_1 = require("graphql-ws");
|
|
|
18
18
|
const index_1 = require("../index");
|
|
19
19
|
let isRefreshing = false;
|
|
20
20
|
let pendingRequests = [];
|
|
21
|
-
let mainDomain = "";
|
|
21
|
+
// let mainDomain = "";
|
|
22
22
|
const resolvePendingRequests = () => {
|
|
23
23
|
pendingRequests.map((callback) => callback());
|
|
24
24
|
pendingRequests = [];
|
|
@@ -42,7 +42,7 @@ const errorLink = (0, error_1.onError)(({ graphQLErrors, networkError, operation
|
|
|
42
42
|
})
|
|
43
43
|
.then(({ data: { refreshToken: { tokenAuth, tokenRefresh }, }, }) => {
|
|
44
44
|
console.log(tokenAuth, "newAuthToken");
|
|
45
|
-
(0, cookies_1.refreshCookies)(tokenAuth, tokenRefresh
|
|
45
|
+
(0, cookies_1.refreshCookies)(tokenAuth, tokenRefresh /*, mainDomain */);
|
|
46
46
|
resolvePendingRequests();
|
|
47
47
|
return true;
|
|
48
48
|
})
|
|
@@ -51,7 +51,7 @@ const errorLink = (0, error_1.onError)(({ graphQLErrors, networkError, operation
|
|
|
51
51
|
context: { uri: index_1.hosts.authHost },
|
|
52
52
|
mutation: index_1.schema.RevokeTokenDocument,
|
|
53
53
|
});
|
|
54
|
-
(0, cookies_1.destroyCookies)(mainDomain);
|
|
54
|
+
(0, cookies_1.destroyCookies)( /*, mainDomain */);
|
|
55
55
|
pendingRequests = [];
|
|
56
56
|
window.location.replace("/");
|
|
57
57
|
return false;
|
|
@@ -85,7 +85,7 @@ const errorLink = (0, error_1.onError)(({ graphQLErrors, networkError, operation
|
|
|
85
85
|
mutation: index_1.schema.RefreshTokenDocument,
|
|
86
86
|
})
|
|
87
87
|
.then(({ data: { refreshToken: { tokenAuth, tokenRefresh }, }, }) => {
|
|
88
|
-
(0, cookies_1.refreshCookies)(tokenAuth, tokenRefresh
|
|
88
|
+
(0, cookies_1.refreshCookies)(tokenAuth, tokenRefresh /*, mainDomain */);
|
|
89
89
|
resolvePendingRequests();
|
|
90
90
|
return true;
|
|
91
91
|
})
|
|
@@ -94,7 +94,7 @@ const errorLink = (0, error_1.onError)(({ graphQLErrors, networkError, operation
|
|
|
94
94
|
context: { uri: index_1.hosts.authHost },
|
|
95
95
|
mutation: index_1.schema.RevokeTokenDocument,
|
|
96
96
|
});
|
|
97
|
-
(0, cookies_1.destroyCookies)(mainDomain);
|
|
97
|
+
(0, cookies_1.destroyCookies)( /*, mainDomain */);
|
|
98
98
|
pendingRequests = [];
|
|
99
99
|
window.location.replace("/");
|
|
100
100
|
return false;
|
|
@@ -156,9 +156,9 @@ function createApolloClient() {
|
|
|
156
156
|
}),
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
|
-
function initializeApollo(initialState = null, domain
|
|
159
|
+
function initializeApollo(initialState = null, domain) {
|
|
160
160
|
const _apolloClient = apolloClient ?? createApolloClient();
|
|
161
|
-
mainDomain = domain;
|
|
161
|
+
// mainDomain = domain;
|
|
162
162
|
// If your page has Next.js data fetching methods that use Apollo Client, the initial state
|
|
163
163
|
// gets hydrated here
|
|
164
164
|
if (initialState) {
|
package/build/cookies/index.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCookies = exports.destroyCookies = exports.refreshCookies = exports.assignCookies = void 0;
|
|
4
4
|
const nookies_1 = require("nookies");
|
|
5
|
-
const assignCookies = (userId, wallets, authToken, refreshToken, newUser, inviteCode, domain
|
|
6
|
-
console.log(domain, "domain");
|
|
5
|
+
const assignCookies = (userId, wallets, authToken, refreshToken, newUser, inviteCode, domain) => {
|
|
7
6
|
if (userId)
|
|
8
7
|
(0, nookies_1.setCookie)(null, "userId", userId, { maxAge: 2629800000, path: "/", domain });
|
|
9
8
|
if (wallets)
|
|
@@ -43,7 +42,7 @@ const assignCookies = (userId, wallets, authToken, refreshToken, newUser, invite
|
|
|
43
42
|
});
|
|
44
43
|
};
|
|
45
44
|
exports.assignCookies = assignCookies;
|
|
46
|
-
const refreshCookies = (authToken, refreshToken, domain
|
|
45
|
+
const refreshCookies = (authToken, refreshToken, domain) => {
|
|
47
46
|
if (authToken)
|
|
48
47
|
(0, nookies_1.setCookie)(null, "authToken", authToken, {
|
|
49
48
|
maxAge: 2629800000,
|
|
@@ -82,7 +81,7 @@ const getCookies = (ctx) => {
|
|
|
82
81
|
};
|
|
83
82
|
};
|
|
84
83
|
exports.getCookies = getCookies;
|
|
85
|
-
const destroyCookies = (domain
|
|
84
|
+
const destroyCookies = (domain) => {
|
|
86
85
|
(0, nookies_1.destroyCookie)(null, "userId", { path: "/", domain });
|
|
87
86
|
(0, nookies_1.destroyCookie)(null, "wallets", { path: "/", domain });
|
|
88
87
|
(0, nookies_1.destroyCookie)(null, "authToken", { path: "/", domain });
|
|
@@ -21,11 +21,33 @@ export type Scalars = {
|
|
|
21
21
|
Long: any;
|
|
22
22
|
Upload: any;
|
|
23
23
|
};
|
|
24
|
+
export type IActiveInvite = {
|
|
25
|
+
inviteCode?: Maybe<Scalars['String']>;
|
|
26
|
+
createdAt?: Maybe<Scalars['Long']>;
|
|
27
|
+
};
|
|
24
28
|
export type IAddress = {
|
|
25
29
|
creators?: Maybe<Array<Maybe<IWallet>>>;
|
|
26
30
|
owners?: Maybe<Array<Maybe<IWallet>>>;
|
|
27
31
|
associateAddresses?: Maybe<Array<Maybe<IWallet>>>;
|
|
28
32
|
};
|
|
33
|
+
export type IAdminInvite = {
|
|
34
|
+
userId: Scalars['String'];
|
|
35
|
+
wallet?: Maybe<IWallet>;
|
|
36
|
+
activeInvites?: Maybe<Array<IActiveInvite>>;
|
|
37
|
+
referredUsers?: Maybe<Array<Scalars['String']>>;
|
|
38
|
+
userXpLevel?: Maybe<Scalars['Int']>;
|
|
39
|
+
};
|
|
40
|
+
export type IAdminXp = {
|
|
41
|
+
userId: Scalars['ID'];
|
|
42
|
+
mainWallet?: Maybe<IWallet>;
|
|
43
|
+
userXpLevel?: Maybe<Scalars['Int']>;
|
|
44
|
+
userXpPoints?: Maybe<Scalars['Int']>;
|
|
45
|
+
referredUsers?: Maybe<Array<Scalars['ID']>>;
|
|
46
|
+
referredUsersNum?: Maybe<Scalars['Int']>;
|
|
47
|
+
joinedOpportunityIds?: Maybe<Array<Scalars['String']>>;
|
|
48
|
+
connectedWalletsNum?: Maybe<Scalars['Int']>;
|
|
49
|
+
suggestedOpportunityIds?: Maybe<Array<Scalars['String']>>;
|
|
50
|
+
};
|
|
29
51
|
export type IAsset = {
|
|
30
52
|
address?: Maybe<Scalars['String']>;
|
|
31
53
|
assetId: Scalars['String'];
|
|
@@ -594,6 +616,22 @@ export type IInterest = {
|
|
|
594
616
|
name: Scalars['String'];
|
|
595
617
|
imageUrl: Scalars['String'];
|
|
596
618
|
};
|
|
619
|
+
export type IInvitesFilterInput = {
|
|
620
|
+
userIdTerm?: Maybe<Scalars['String']>;
|
|
621
|
+
mainWalletTerm?: Maybe<Scalars['String']>;
|
|
622
|
+
userXpLevelTerm?: Maybe<Scalars['String']>;
|
|
623
|
+
activeInviteTerm?: Maybe<Scalars['String']>;
|
|
624
|
+
referredUserTerm?: Maybe<Scalars['String']>;
|
|
625
|
+
};
|
|
626
|
+
export type IInvitesPage = {
|
|
627
|
+
invites: Array<IAdminInvite>;
|
|
628
|
+
nextPage?: Maybe<IPage>;
|
|
629
|
+
};
|
|
630
|
+
export type IInvitesSortInput = {
|
|
631
|
+
sortByXpLevel: ISort;
|
|
632
|
+
sortByActiveInvites: ISort;
|
|
633
|
+
sortByReferredUsers: ISort;
|
|
634
|
+
};
|
|
597
635
|
export type ILogin = {
|
|
598
636
|
userId?: Maybe<Scalars['ID']>;
|
|
599
637
|
loggedTime?: Maybe<Scalars['Long']>;
|
|
@@ -645,6 +683,8 @@ export type IMutation = {
|
|
|
645
683
|
addCollectionsToGalleryV2: Scalars['Boolean'];
|
|
646
684
|
addCreationsToGallery: Scalars['Boolean'];
|
|
647
685
|
addCreationsToGalleryV2: Scalars['Boolean'];
|
|
686
|
+
addInviteCodes: Scalars['Boolean'];
|
|
687
|
+
addSuggestedOpportunity: Scalars['Boolean'];
|
|
648
688
|
addWalletBitcoin: Scalars['Boolean'];
|
|
649
689
|
addWalletElrond: Scalars['Boolean'];
|
|
650
690
|
addWalletFlow: Scalars['Boolean'];
|
|
@@ -660,6 +700,7 @@ export type IMutation = {
|
|
|
660
700
|
approveUsers: Scalars['Boolean'];
|
|
661
701
|
blockUser: Scalars['Boolean'];
|
|
662
702
|
blockUsers: Scalars['Boolean'];
|
|
703
|
+
changeXpPoints: Scalars['Boolean'];
|
|
663
704
|
createFavoriteListV2: Scalars['ID'];
|
|
664
705
|
createFavorites: Scalars['ID'];
|
|
665
706
|
createGallery: Scalars['ID'];
|
|
@@ -695,6 +736,8 @@ export type IMutation = {
|
|
|
695
736
|
removeCollectionFromGalleryV2: Scalars['Boolean'];
|
|
696
737
|
removeCreationFromGallery: Scalars['Boolean'];
|
|
697
738
|
removeCreationFromGalleryV2: Scalars['Boolean'];
|
|
739
|
+
removeInviteCode: Scalars['Boolean'];
|
|
740
|
+
removeSuggestedOpportunity: Scalars['Boolean'];
|
|
698
741
|
removeWallet: Scalars['Boolean'];
|
|
699
742
|
reportAsset: Scalars['Boolean'];
|
|
700
743
|
reportGallery: Scalars['Boolean'];
|
|
@@ -757,6 +800,14 @@ export type IMutationAddCreationsToGalleryV2Args = {
|
|
|
757
800
|
galleryId: Scalars['ID'];
|
|
758
801
|
creationIds: Array<Scalars['String']>;
|
|
759
802
|
};
|
|
803
|
+
export type IMutationAddInviteCodesArgs = {
|
|
804
|
+
userId: Scalars['String'];
|
|
805
|
+
codesNum: Scalars['Int'];
|
|
806
|
+
};
|
|
807
|
+
export type IMutationAddSuggestedOpportunityArgs = {
|
|
808
|
+
userId: Scalars['ID'];
|
|
809
|
+
opportunityId: Scalars['String'];
|
|
810
|
+
};
|
|
760
811
|
export type IMutationAddWalletBitcoinArgs = {
|
|
761
812
|
signature: Scalars['String'];
|
|
762
813
|
address: Scalars['String'];
|
|
@@ -815,6 +866,10 @@ export type IMutationBlockUserArgs = {
|
|
|
815
866
|
export type IMutationBlockUsersArgs = {
|
|
816
867
|
input: Array<Maybe<IUpdateUserModeration>>;
|
|
817
868
|
};
|
|
869
|
+
export type IMutationChangeXpPointsArgs = {
|
|
870
|
+
userId: Scalars['ID'];
|
|
871
|
+
pointsDiff: Scalars['Int'];
|
|
872
|
+
};
|
|
818
873
|
export type IMutationCreateFavoriteListV2Args = {
|
|
819
874
|
name: Scalars['String'];
|
|
820
875
|
description?: Maybe<Scalars['String']>;
|
|
@@ -944,6 +999,13 @@ export type IMutationRemoveCreationFromGalleryV2Args = {
|
|
|
944
999
|
galleryId: Scalars['ID'];
|
|
945
1000
|
creationId: Scalars['String'];
|
|
946
1001
|
};
|
|
1002
|
+
export type IMutationRemoveInviteCodeArgs = {
|
|
1003
|
+
inviteCode: Scalars['String'];
|
|
1004
|
+
};
|
|
1005
|
+
export type IMutationRemoveSuggestedOpportunityArgs = {
|
|
1006
|
+
userId: Scalars['ID'];
|
|
1007
|
+
opportunityId: Scalars['String'];
|
|
1008
|
+
};
|
|
947
1009
|
export type IMutationRemoveWalletArgs = {
|
|
948
1010
|
blockchain: Scalars['String'];
|
|
949
1011
|
address: Scalars['String'];
|
|
@@ -1141,14 +1203,16 @@ export type IOpportunityPage = {
|
|
|
1141
1203
|
similarOpportunities?: Maybe<Array<Maybe<IOpportunity>>>;
|
|
1142
1204
|
};
|
|
1143
1205
|
export type IPage = {
|
|
1144
|
-
|
|
1206
|
+
elements?: Maybe<Scalars['Long']>;
|
|
1207
|
+
lastNum?: Maybe<Scalars['Int']>;
|
|
1145
1208
|
num?: Maybe<Scalars['Int']>;
|
|
1146
1209
|
size?: Maybe<Scalars['Int']>;
|
|
1147
|
-
|
|
1210
|
+
token?: Maybe<Scalars['String']>;
|
|
1148
1211
|
};
|
|
1149
1212
|
export type IPageInput = {
|
|
1213
|
+
num: Scalars['Int'];
|
|
1214
|
+
size: Scalars['Int'];
|
|
1150
1215
|
token?: Maybe<Scalars['String']>;
|
|
1151
|
-
size?: Maybe<Scalars['Int']>;
|
|
1152
1216
|
};
|
|
1153
1217
|
export type IProfile = {
|
|
1154
1218
|
about?: Maybe<Scalars['String']>;
|
|
@@ -1178,6 +1242,8 @@ export type IProfilePage = {
|
|
|
1178
1242
|
results?: Maybe<Scalars['Long']>;
|
|
1179
1243
|
};
|
|
1180
1244
|
export type IQuery = {
|
|
1245
|
+
fetchAdminInvitesPage: IInvitesPage;
|
|
1246
|
+
fetchAdminXpPage: IXpPage;
|
|
1181
1247
|
fetchAllAssets: IAssetsPage;
|
|
1182
1248
|
fetchAllBannerAssets: IBannerAssetsPage;
|
|
1183
1249
|
fetchAllCreations: ICreationsPage;
|
|
@@ -1313,6 +1379,16 @@ export type IQuery = {
|
|
|
1313
1379
|
isValidAuthToken: Scalars['Boolean'];
|
|
1314
1380
|
setMainWallet: Scalars['Boolean'];
|
|
1315
1381
|
};
|
|
1382
|
+
export type IQueryFetchAdminInvitesPageArgs = {
|
|
1383
|
+
filter: IInvitesFilterInput;
|
|
1384
|
+
sort: IInvitesSortInput;
|
|
1385
|
+
page: IPageInput;
|
|
1386
|
+
};
|
|
1387
|
+
export type IQueryFetchAdminXpPageArgs = {
|
|
1388
|
+
filter: IXpFilterInput;
|
|
1389
|
+
sort: IXpSortInput;
|
|
1390
|
+
page: IPageInput;
|
|
1391
|
+
};
|
|
1316
1392
|
export type IQueryFetchAllAssetsArgs = {
|
|
1317
1393
|
pageSize: Scalars['Int'];
|
|
1318
1394
|
pageToken?: Maybe<Scalars['String']>;
|
|
@@ -1754,6 +1830,14 @@ export type ISocial = {
|
|
|
1754
1830
|
instagram?: Maybe<Scalars['String']>;
|
|
1755
1831
|
website?: Maybe<Scalars['String']>;
|
|
1756
1832
|
};
|
|
1833
|
+
export type ISort = {
|
|
1834
|
+
enabled: Scalars['Boolean'];
|
|
1835
|
+
direction?: Maybe<ISortDirection>;
|
|
1836
|
+
};
|
|
1837
|
+
export declare enum ISortDirection {
|
|
1838
|
+
Asc = "ASC",
|
|
1839
|
+
Desc = "DESC"
|
|
1840
|
+
}
|
|
1757
1841
|
export type ISubscription = {
|
|
1758
1842
|
onMyExperienceUpdated: IUserXp;
|
|
1759
1843
|
onMyExperienceIncremented: IUserXpIncrement;
|
|
@@ -1944,6 +2028,43 @@ export type IWallet = {
|
|
|
1944
2028
|
userId: Scalars['ID'];
|
|
1945
2029
|
walletName: Scalars['String'];
|
|
1946
2030
|
};
|
|
2031
|
+
export type IXpFilterInput = {
|
|
2032
|
+
userIdTerm?: Maybe<Scalars['String']>;
|
|
2033
|
+
mainWalletTerm?: Maybe<Scalars['String']>;
|
|
2034
|
+
userXpLevelTerm?: Maybe<Scalars['String']>;
|
|
2035
|
+
userXpPointsTerm?: Maybe<Scalars['String']>;
|
|
2036
|
+
invitedUserTerm?: Maybe<Scalars['String']>;
|
|
2037
|
+
referredUsersNumTerm?: Maybe<Scalars['String']>;
|
|
2038
|
+
joinedOpportunityTerm?: Maybe<Scalars['String']>;
|
|
2039
|
+
connectedWalletsNumTerm?: Maybe<Scalars['String']>;
|
|
2040
|
+
suggestedOpportunityTerm?: Maybe<Scalars['String']>;
|
|
2041
|
+
};
|
|
2042
|
+
export type IXpPage = {
|
|
2043
|
+
xps: Array<IAdminXp>;
|
|
2044
|
+
nextPage?: Maybe<IPage>;
|
|
2045
|
+
};
|
|
2046
|
+
export type IXpSortInput = {
|
|
2047
|
+
sortByXpLevel: ISort;
|
|
2048
|
+
sortByXpPoints: ISort;
|
|
2049
|
+
sortByInvitedUsers: ISort;
|
|
2050
|
+
sortByReferredUsersNum: ISort;
|
|
2051
|
+
sortByJoinedOpportunities: ISort;
|
|
2052
|
+
sortByConnectedWalletsNum: ISort;
|
|
2053
|
+
sortBySuggestedOpportunities: ISort;
|
|
2054
|
+
};
|
|
2055
|
+
export type IFetchAdminXpPageQueryVariables = Exact<{
|
|
2056
|
+
filter: IXpFilterInput;
|
|
2057
|
+
sort: IXpSortInput;
|
|
2058
|
+
page: IPageInput;
|
|
2059
|
+
}>;
|
|
2060
|
+
export type IFetchAdminXpPageQuery = {
|
|
2061
|
+
fetchAdminXpPage: {
|
|
2062
|
+
xps: Array<(Pick<IAdminXp, 'userId' | 'userXpLevel' | 'userXpPoints' | 'referredUsers' | 'referredUsersNum' | 'joinedOpportunityIds' | 'connectedWalletsNum' | 'suggestedOpportunityIds'> & {
|
|
2063
|
+
mainWallet?: Maybe<Pick<IWallet, 'address' | 'blockchain' | 'chainId' | 'mainWallet' | 'name' | 'url' | 'userId' | 'walletName'>>;
|
|
2064
|
+
})>;
|
|
2065
|
+
nextPage?: Maybe<Pick<IPage, 'elements' | 'lastNum' | 'num' | 'size' | 'token'>>;
|
|
2066
|
+
};
|
|
2067
|
+
};
|
|
1947
2068
|
export type IDislikeAssetMutationVariables = Exact<{
|
|
1948
2069
|
assetId: Scalars['String'];
|
|
1949
2070
|
}>;
|
|
@@ -2725,6 +2846,38 @@ export type IFindUserShowcaseItemsQuery = {
|
|
|
2725
2846
|
showcaseItems: Array<Maybe<Pick<IShowcaseItem, 'itemType' | 'itemId' | 'blockchain' | 'name' | 'media' | 'mediaPreview' | 'mimeType' | 'sizeRatio' | 'fileSize' | 'likes' | 'visible' | 'blurred' | 'creatorsAddresses'>>>;
|
|
2726
2847
|
});
|
|
2727
2848
|
};
|
|
2849
|
+
export declare const FetchAdminXpPageDocument: Apollo.DocumentNode;
|
|
2850
|
+
/**
|
|
2851
|
+
* __useFetchAdminXpPageQuery__
|
|
2852
|
+
*
|
|
2853
|
+
* To run a query within a React component, call `useFetchAdminXpPageQuery` and pass it any options that fit your needs.
|
|
2854
|
+
* When your component renders, `useFetchAdminXpPageQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
2855
|
+
* you can use to render your UI.
|
|
2856
|
+
*
|
|
2857
|
+
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
2858
|
+
*
|
|
2859
|
+
* @example
|
|
2860
|
+
* const { data, loading, error } = useFetchAdminXpPageQuery({
|
|
2861
|
+
* variables: {
|
|
2862
|
+
* filter: // value for 'filter'
|
|
2863
|
+
* sort: // value for 'sort'
|
|
2864
|
+
* page: // value for 'page'
|
|
2865
|
+
* },
|
|
2866
|
+
* });
|
|
2867
|
+
*/
|
|
2868
|
+
export declare function useFetchAdminXpPageQuery(baseOptions: Apollo.QueryHookOptions<IFetchAdminXpPageQuery, IFetchAdminXpPageQueryVariables>): Apollo.QueryResult<IFetchAdminXpPageQuery, Exact<{
|
|
2869
|
+
filter: IXpFilterInput;
|
|
2870
|
+
sort: IXpSortInput;
|
|
2871
|
+
page: IPageInput;
|
|
2872
|
+
}>>;
|
|
2873
|
+
export declare function useFetchAdminXpPageLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<IFetchAdminXpPageQuery, IFetchAdminXpPageQueryVariables>): Apollo.LazyQueryResultTuple<IFetchAdminXpPageQuery, Exact<{
|
|
2874
|
+
filter: IXpFilterInput;
|
|
2875
|
+
sort: IXpSortInput;
|
|
2876
|
+
page: IPageInput;
|
|
2877
|
+
}>>;
|
|
2878
|
+
export type FetchAdminXpPageQueryHookResult = ReturnType<typeof useFetchAdminXpPageQuery>;
|
|
2879
|
+
export type FetchAdminXpPageLazyQueryHookResult = ReturnType<typeof useFetchAdminXpPageLazyQuery>;
|
|
2880
|
+
export type FetchAdminXpPageQueryResult = Apollo.QueryResult<IFetchAdminXpPageQuery, IFetchAdminXpPageQueryVariables>;
|
|
2728
2881
|
export declare const DislikeAssetDocument: Apollo.DocumentNode;
|
|
2729
2882
|
export type IDislikeAssetMutationFn = Apollo.MutationFunction<IDislikeAssetMutation, IDislikeAssetMutationVariables>;
|
|
2730
2883
|
/**
|
|
@@ -23,15 +23,79 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
31
|
-
exports.useFindUserShowcaseItemsLazyQuery = void 0;
|
|
26
|
+
exports.useFetchMyTasksQuery = exports.FetchMyTasksDocument = exports.useFetchMyExperienceV2LazyQuery = exports.useFetchMyExperienceV2Query = exports.FetchMyExperienceV2Document = exports.useFetchDynamicCollectionsDataLazyQuery = exports.useFetchDynamicCollectionsDataQuery = exports.FetchDynamicCollectionsDataDocument = exports.useFetchDynamicCollectionDataLazyQuery = exports.useFetchDynamicCollectionDataQuery = exports.FetchDynamicCollectionDataDocument = exports.useFetchCollectionsByIdsLazyQuery = exports.useFetchCollectionsByIdsQuery = exports.FetchCollectionsByIdsDocument = exports.useFetchCollectionsLazyQuery = exports.useFetchCollectionsQuery = exports.FetchCollectionsDocument = exports.useFetchCollectionLazyQuery = exports.useFetchCollectionQuery = exports.FetchCollectionDocument = exports.useLikeCollectionMutation = exports.LikeCollectionDocument = exports.useDislikeCollectionMutation = exports.DislikeCollectionDocument = exports.useFetchLikedLazyQuery = exports.useFetchLikedQuery = exports.FetchLikedDocument = exports.useFetchDynamicAssetsLikesLazyQuery = exports.useFetchDynamicAssetsLikesQuery = exports.FetchDynamicAssetsLikesDocument = exports.useFetchDynamicAssetLikesLazyQuery = exports.useFetchDynamicAssetLikesQuery = exports.FetchDynamicAssetLikesDocument = exports.useFetchAssetsLazyQuery = exports.useFetchAssetsQuery = exports.FetchAssetsDocument = exports.useFetchAssetByBlockchainLazyQuery = exports.useFetchAssetByBlockchainQuery = exports.FetchAssetByBlockchainDocument = exports.useFetchAssetLazyQuery = exports.useFetchAssetQuery = exports.FetchAssetDocument = exports.useLikeAssetMutation = exports.LikeAssetDocument = exports.useDislikeAssetMutation = exports.DislikeAssetDocument = exports.useFetchAdminXpPageLazyQuery = exports.useFetchAdminXpPageQuery = exports.FetchAdminXpPageDocument = exports.ISortDirection = void 0;
|
|
27
|
+
exports.useRemoveCreationFromGalleryV2Mutation = exports.RemoveCreationFromGalleryV2Document = exports.useRemoveCreationFromGalleryMutation = exports.RemoveCreationFromGalleryDocument = exports.useRemoveCollectionFromGalleryV2Mutation = exports.RemoveCollectionFromGalleryV2Document = exports.useRemoveCollectionFromGalleryMutation = exports.RemoveCollectionFromGalleryDocument = exports.useRemoveAssetFromGalleryV2Mutation = exports.RemoveAssetFromGalleryV2Document = exports.useRemoveAssetFromGalleryMutation = exports.RemoveAssetFromGalleryDocument = exports.useEditGalleryMutation = exports.EditGalleryDocument = exports.useDeleteGalleryBannerMutation = exports.DeleteGalleryBannerDocument = exports.useDeleteGalleryMutation = exports.DeleteGalleryDocument = exports.useCreateGalleryV2Mutation = exports.CreateGalleryV2Document = exports.useCreateGalleryMutation = exports.CreateGalleryDocument = exports.useCreateFavoritesMutation = exports.CreateFavoritesDocument = exports.useCreateFavoriteListV2Mutation = exports.CreateFavoriteListV2Document = exports.useAddCreationsToGalleryV2Mutation = exports.AddCreationsToGalleryV2Document = exports.useAddCreationsToGalleryMutation = exports.AddCreationsToGalleryDocument = exports.useAddCollectionsToGalleryV2Mutation = exports.AddCollectionsToGalleryV2Document = exports.useAddCollectionsToGalleryMutation = exports.AddCollectionsToGalleryDocument = exports.useUploadGalleryBannerMutation = exports.UploadGalleryBannerDocument = exports.useAddAssetsToGalleryV2Mutation = exports.AddAssetsToGalleryV2Document = exports.useAddAssetsToGalleryMutation = exports.AddAssetsToGalleryDocument = exports.useFetchNftDataLazyQuery = exports.useFetchNftDataQuery = exports.FetchNftDataDocument = exports.useOnMyExperienceUpdatedSubscription = exports.OnMyExperienceUpdatedDocument = exports.useOnMyExperienceIncrementedSubscription = exports.OnMyExperienceIncrementedDocument = exports.useOnInviteCodeUsedSubscription = exports.OnInviteCodeUsedDocument = exports.useFetchMyTasksLazyQuery = void 0;
|
|
28
|
+
exports.useRemoveWalletMutation = exports.RemoveWalletDocument = exports.useRefreshTokenMutation = exports.RefreshTokenDocument = exports.useUseInviteCodeMutation = exports.UseInviteCodeDocument = exports.useGenerateNewInviteCodesMutation = exports.GenerateNewInviteCodesDocument = exports.useCreateNonceMutation = exports.CreateNonceDocument = exports.useAddWalletTezosMutation = exports.AddWalletTezosDocument = exports.useAddWalletSolanaMutation = exports.AddWalletSolanaDocument = exports.useAddWalletMetamaskMutation = exports.AddWalletMetamaskDocument = exports.useAddWalletFlowMutation = exports.AddWalletFlowDocument = exports.useAddWalletElrondMutation = exports.AddWalletElrondDocument = exports.useFetchUserGalleriesV2LazyQuery = exports.useFetchUserGalleriesV2Query = exports.FetchUserGalleriesV2Document = exports.useFetchUserGalleriesLazyQuery = exports.useFetchUserGalleriesQuery = exports.FetchUserGalleriesDocument = exports.useFetchUserFavoritesV2LazyQuery = exports.useFetchUserFavoritesV2Query = exports.FetchUserFavoritesV2Document = exports.useFetchUserFavoritesLazyQuery = exports.useFetchUserFavoritesQuery = exports.FetchUserFavoritesDocument = exports.useFetchMyGalleriesV2LazyQuery = exports.useFetchMyGalleriesV2Query = exports.FetchMyGalleriesV2Document = exports.useFetchMyFavoritesV2LazyQuery = exports.useFetchMyFavoritesV2Query = exports.FetchMyFavoritesV2Document = exports.useFetchMyFavoritesLazyQuery = exports.useFetchMyFavoritesQuery = exports.FetchMyFavoritesDocument = exports.useFetchGalleryV2LazyQuery = exports.useFetchGalleryV2Query = exports.FetchGalleryV2Document = exports.useFetchGalleryCreationsLazyQuery = exports.useFetchGalleryCreationsQuery = exports.FetchGalleryCreationsDocument = exports.useFetchGalleryLazyQuery = exports.useFetchGalleryQuery = exports.FetchGalleryDocument = void 0;
|
|
29
|
+
exports.useFetchSearchResultTimeSelectionsQuery = exports.FetchSearchResultTimeSelectionsDocument = exports.useFetchSearchResultSelectionsLazyQuery = exports.useFetchSearchResultSelectionsQuery = exports.FetchSearchResultSelectionsDocument = exports.useFetchInterestsLazyQuery = exports.useFetchInterestsQuery = exports.FetchInterestsDocument = exports.useFetchExpectationsLazyQuery = exports.useFetchExpectationsQuery = exports.FetchExpectationsDocument = exports.useSaveUserInterestsMutation = exports.SaveUserInterestsDocument = exports.useSaveUserExpectationsMutation = exports.SaveUserExpectationsDocument = exports.useFetchOpportunitiesLazyQuery = exports.useFetchOpportunitiesQuery = exports.FetchOpportunitiesDocument = exports.useOpenOpportunityMutation = exports.OpenOpportunityDocument = exports.useCreateOpportunityMutation = exports.CreateOpportunityDocument = exports.useFetchUserpicLazyQuery = exports.useFetchUserpicQuery = exports.FetchUserpicDocument = exports.useGetMyInviteCodesLazyQuery = exports.useGetMyInviteCodesQuery = exports.GetMyInviteCodesDocument = exports.useFetchUserWalletsLazyQuery = exports.useFetchUserWalletsQuery = exports.FetchUserWalletsDocument = exports.useFetchProfileLazyQuery = exports.useFetchProfileQuery = exports.FetchProfileDocument = exports.useUpdateProfileMutation = exports.UpdateProfileDocument = exports.useSignInTezosMutation = exports.SignInTezosDocument = exports.useSignInSolanaMutation = exports.SignInSolanaDocument = exports.useSignInMetamaskMutation = exports.SignInMetamaskDocument = exports.useSignInFlowMutation = exports.SignInFlowDocument = exports.useSignInElrondMutation = exports.SignInElrondDocument = exports.useSetMainWalletMutation = exports.SetMainWalletDocument = exports.useRevokeTokenMutation = exports.RevokeTokenDocument = void 0;
|
|
30
|
+
exports.FindUserCreationsDocument = exports.useFindShowcaseItemsLazyQuery = exports.useFindShowcaseItemsQuery = exports.FindShowcaseItemsDocument = exports.useFindSetsLazyQuery = exports.useFindSetsQuery = exports.FindSetsDocument = exports.useFindProfilesByNameLazyQuery = exports.useFindProfilesByNameQuery = exports.FindProfilesByNameDocument = exports.useFindCreationsLazyQuery = exports.useFindCreationsQuery = exports.FindCreationsDocument = exports.useFetchUserPortfolioLazyQuery = exports.useFetchUserPortfolioQuery = exports.FetchUserPortfolioDocument = exports.useFindAllTopEntitiesByNameLazyQuery = exports.useFindAllTopEntitiesByNameQuery = exports.FindAllTopEntitiesByNameDocument = exports.useFetchCreationsByTypeLazyQuery = exports.useFetchCreationsByTypeQuery = exports.FetchCreationsByTypeDocument = exports.useFindCollectionsLazyQuery = exports.useFindCollectionsQuery = exports.FindCollectionsDocument = exports.useFetchAssetsCountLazyQuery = exports.useFetchAssetsCountQuery = exports.FetchAssetsCountDocument = exports.useFetchAllCreationsLazyQuery = exports.useFetchAllCreationsQuery = exports.FetchAllCreationsDocument = exports.useFetchSetsSearchResultTypeSelectionsLazyQuery = exports.useFetchSetsSearchResultTypeSelectionsQuery = exports.FetchSetsSearchResultTypeSelectionsDocument = exports.useFetchSearchResultStatusSelectionsLazyQuery = exports.useFetchSearchResultStatusSelectionsQuery = exports.FetchSearchResultStatusSelectionsDocument = exports.useFetchSearchResultCategorySelectionsLazyQuery = exports.useFetchSearchResultCategorySelectionsQuery = exports.FetchSearchResultCategorySelectionsDocument = exports.useFetchSearchResultBlockchainSelectionsLazyQuery = exports.useFetchSearchResultBlockchainSelectionsQuery = exports.FetchSearchResultBlockchainSelectionsDocument = exports.useFetchUserInterestsLazyQuery = exports.useFetchUserInterestsQuery = exports.FetchUserInterestsDocument = exports.useFetchUserExpectationsLazyQuery = exports.useFetchUserExpectationsQuery = exports.FetchUserExpectationsDocument = exports.useFetchSearchResultTimeSelectionsLazyQuery = void 0;
|
|
31
|
+
exports.useFindUserShowcaseItemsLazyQuery = exports.useFindUserShowcaseItemsQuery = exports.FindUserShowcaseItemsDocument = exports.useFindUserCreationsLazyQuery = exports.useFindUserCreationsQuery = void 0;
|
|
32
32
|
/* eslint-disable */
|
|
33
33
|
const client_1 = require("@apollo/client");
|
|
34
34
|
const Apollo = __importStar(require("@apollo/client"));
|
|
35
|
+
var ISortDirection;
|
|
36
|
+
(function (ISortDirection) {
|
|
37
|
+
ISortDirection["Asc"] = "ASC";
|
|
38
|
+
ISortDirection["Desc"] = "DESC";
|
|
39
|
+
})(ISortDirection || (exports.ISortDirection = ISortDirection = {}));
|
|
40
|
+
exports.FetchAdminXpPageDocument = (0, client_1.gql) `
|
|
41
|
+
query FetchAdminXpPage($filter: XpFilterInput!, $sort: XpSortInput!, $page: PageInput!) {
|
|
42
|
+
fetchAdminXpPage(filter: $filter, sort: $sort, page: $page) {
|
|
43
|
+
xps {
|
|
44
|
+
userId
|
|
45
|
+
mainWallet {
|
|
46
|
+
address
|
|
47
|
+
blockchain
|
|
48
|
+
chainId
|
|
49
|
+
mainWallet
|
|
50
|
+
name
|
|
51
|
+
url
|
|
52
|
+
userId
|
|
53
|
+
walletName
|
|
54
|
+
}
|
|
55
|
+
userXpLevel
|
|
56
|
+
userXpPoints
|
|
57
|
+
referredUsers
|
|
58
|
+
referredUsersNum
|
|
59
|
+
joinedOpportunityIds
|
|
60
|
+
connectedWalletsNum
|
|
61
|
+
suggestedOpportunityIds
|
|
62
|
+
}
|
|
63
|
+
nextPage {
|
|
64
|
+
elements
|
|
65
|
+
lastNum
|
|
66
|
+
num
|
|
67
|
+
size
|
|
68
|
+
token
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
/**
|
|
74
|
+
* __useFetchAdminXpPageQuery__
|
|
75
|
+
*
|
|
76
|
+
* To run a query within a React component, call `useFetchAdminXpPageQuery` and pass it any options that fit your needs.
|
|
77
|
+
* When your component renders, `useFetchAdminXpPageQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
78
|
+
* you can use to render your UI.
|
|
79
|
+
*
|
|
80
|
+
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* const { data, loading, error } = useFetchAdminXpPageQuery({
|
|
84
|
+
* variables: {
|
|
85
|
+
* filter: // value for 'filter'
|
|
86
|
+
* sort: // value for 'sort'
|
|
87
|
+
* page: // value for 'page'
|
|
88
|
+
* },
|
|
89
|
+
* });
|
|
90
|
+
*/
|
|
91
|
+
function useFetchAdminXpPageQuery(baseOptions) {
|
|
92
|
+
return Apollo.useQuery(exports.FetchAdminXpPageDocument, baseOptions);
|
|
93
|
+
}
|
|
94
|
+
exports.useFetchAdminXpPageQuery = useFetchAdminXpPageQuery;
|
|
95
|
+
function useFetchAdminXpPageLazyQuery(baseOptions) {
|
|
96
|
+
return Apollo.useLazyQuery(exports.FetchAdminXpPageDocument, baseOptions);
|
|
97
|
+
}
|
|
98
|
+
exports.useFetchAdminXpPageLazyQuery = useFetchAdminXpPageLazyQuery;
|
|
35
99
|
exports.DislikeAssetDocument = (0, client_1.gql) `
|
|
36
100
|
mutation DislikeAsset($assetId: String!) {
|
|
37
101
|
dislikeAsset(assetId: $assetId)
|
package/package.json
CHANGED
package/src/config/index.ts
CHANGED
|
@@ -21,7 +21,7 @@ import { hosts, schema } from "../index";
|
|
|
21
21
|
|
|
22
22
|
let isRefreshing = false;
|
|
23
23
|
let pendingRequests: never[] = [];
|
|
24
|
-
let mainDomain = "";
|
|
24
|
+
// let mainDomain = "";
|
|
25
25
|
|
|
26
26
|
const resolvePendingRequests = () => {
|
|
27
27
|
pendingRequests.map((callback: any) => callback());
|
|
@@ -58,7 +58,7 @@ const errorLink = onError(({ graphQLErrors, networkError, operation, forward })
|
|
|
58
58
|
},
|
|
59
59
|
}) => {
|
|
60
60
|
console.log(tokenAuth, "newAuthToken");
|
|
61
|
-
refreshCookies(tokenAuth, tokenRefresh
|
|
61
|
+
refreshCookies(tokenAuth, tokenRefresh /*, mainDomain */);
|
|
62
62
|
resolvePendingRequests();
|
|
63
63
|
return true;
|
|
64
64
|
},
|
|
@@ -69,7 +69,7 @@ const errorLink = onError(({ graphQLErrors, networkError, operation, forward })
|
|
|
69
69
|
mutation: schema.RevokeTokenDocument,
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
destroyCookies(mainDomain);
|
|
72
|
+
destroyCookies(/*, mainDomain */);
|
|
73
73
|
pendingRequests = [];
|
|
74
74
|
window.location.replace("/");
|
|
75
75
|
return false;
|
|
@@ -113,7 +113,7 @@ const errorLink = onError(({ graphQLErrors, networkError, operation, forward })
|
|
|
113
113
|
refreshToken: { tokenAuth, tokenRefresh },
|
|
114
114
|
},
|
|
115
115
|
}) => {
|
|
116
|
-
refreshCookies(tokenAuth, tokenRefresh
|
|
116
|
+
refreshCookies(tokenAuth, tokenRefresh/*, mainDomain */);
|
|
117
117
|
resolvePendingRequests();
|
|
118
118
|
return true;
|
|
119
119
|
},
|
|
@@ -124,7 +124,7 @@ const errorLink = onError(({ graphQLErrors, networkError, operation, forward })
|
|
|
124
124
|
mutation: schema.RevokeTokenDocument,
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
destroyCookies(mainDomain);
|
|
127
|
+
destroyCookies(/*, mainDomain */);
|
|
128
128
|
pendingRequests = [];
|
|
129
129
|
window.location.replace("/");
|
|
130
130
|
return false;
|
|
@@ -205,9 +205,9 @@ function createApolloClient() {
|
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
export function initializeApollo(initialState = null, domain
|
|
208
|
+
export function initializeApollo(initialState = null, domain?: string) {
|
|
209
209
|
const _apolloClient = apolloClient ?? createApolloClient();
|
|
210
|
-
mainDomain = domain;
|
|
210
|
+
// mainDomain = domain;
|
|
211
211
|
|
|
212
212
|
// If your page has Next.js data fetching methods that use Apollo Client, the initial state
|
|
213
213
|
// gets hydrated here
|
package/src/cookies/index.ts
CHANGED
|
@@ -9,9 +9,8 @@ const assignCookies = (
|
|
|
9
9
|
refreshToken: string,
|
|
10
10
|
newUser: string,
|
|
11
11
|
inviteCode: string,
|
|
12
|
-
domain
|
|
12
|
+
domain?: string,
|
|
13
13
|
) => {
|
|
14
|
-
console.log(domain, "domain");
|
|
15
14
|
if (userId) setCookie(null, "userId", userId, { maxAge: 2629800000, path: "/", domain });
|
|
16
15
|
if (wallets)
|
|
17
16
|
setCookie(null, "wallets", wallets.join(), {
|
|
@@ -50,7 +49,7 @@ const assignCookies = (
|
|
|
50
49
|
});
|
|
51
50
|
};
|
|
52
51
|
|
|
53
|
-
const refreshCookies = (authToken: string, refreshToken: string, domain
|
|
52
|
+
const refreshCookies = (authToken: string, refreshToken: string, domain?: string) => {
|
|
54
53
|
if (authToken)
|
|
55
54
|
setCookie(null, "authToken", authToken, {
|
|
56
55
|
maxAge: 2629800000,
|
|
@@ -95,7 +94,7 @@ const getCookies = (ctx?: Pick<next.NextPageContext, 'req'> | {
|
|
|
95
94
|
};
|
|
96
95
|
};
|
|
97
96
|
|
|
98
|
-
const destroyCookies = (domain
|
|
97
|
+
const destroyCookies = (domain?: string) => {
|
|
99
98
|
destroyCookie(null, "userId", { path: "/", domain });
|
|
100
99
|
destroyCookie(null, "wallets", { path: "/", domain });
|
|
101
100
|
destroyCookie(null, "authToken", { path: "/", domain });
|