@ludo.ninja/api 2.4.5 → 2.4.7
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/cookies/index.d.ts +1 -1
- package/build/cookies/index.js +2 -2
- package/build/graphql_tools/__generated__/schema.d.ts +46 -0
- package/build/graphql_tools/__generated__/schema.js +59 -6
- package/package.json +1 -1
- package/src/cookies/index.ts +14 -12
- package/src/graphql_tools/__generated__/schema.ts +67 -0
- package/tsconfig.tsbuildinfo +1 -1
package/build/cookies/index.d.ts
CHANGED
package/build/cookies/index.js
CHANGED
|
@@ -6,7 +6,7 @@ const assignCookies = (userId, wallets, authToken, refreshToken, newUser, invite
|
|
|
6
6
|
if (userId)
|
|
7
7
|
(0, nookies_1.setCookie)(null, "userId", userId, { maxAge: 2629800000, path: "/", domain });
|
|
8
8
|
if (wallets)
|
|
9
|
-
(0, nookies_1.setCookie)(null, "wallets",
|
|
9
|
+
(0, nookies_1.setCookie)(null, "wallets", encodeURIComponent(JSON.stringify(wallets)), {
|
|
10
10
|
maxAge: 2629800000,
|
|
11
11
|
path: "/",
|
|
12
12
|
domain,
|
|
@@ -66,7 +66,7 @@ const getCookies = (ctx) => {
|
|
|
66
66
|
authToken,
|
|
67
67
|
refreshToken,
|
|
68
68
|
userId,
|
|
69
|
-
wallets,
|
|
69
|
+
wallets: JSON.parse(decodeURIComponent(wallets)),
|
|
70
70
|
newUser,
|
|
71
71
|
inviteCode,
|
|
72
72
|
};
|
|
@@ -2177,6 +2177,20 @@ export type IRemoveInviteCodeMutationVariables = Exact<{
|
|
|
2177
2177
|
inviteCode: Scalars['String'];
|
|
2178
2178
|
}>;
|
|
2179
2179
|
export type IRemoveInviteCodeMutation = Pick<IMutation, 'removeInviteCode'>;
|
|
2180
|
+
export type IFetchAdminInvitesPageQueryVariables = Exact<{
|
|
2181
|
+
filter: IInvitesFilterInput;
|
|
2182
|
+
sort: IInvitesSortInput;
|
|
2183
|
+
page: IAdminPageInput;
|
|
2184
|
+
}>;
|
|
2185
|
+
export type IFetchAdminInvitesPageQuery = {
|
|
2186
|
+
fetchAdminInvitesPage: {
|
|
2187
|
+
invites: Array<(Pick<IAdminInvite, 'userId' | 'referredUsers' | 'userXpLevel'> & {
|
|
2188
|
+
wallet?: Maybe<Pick<IWallet, 'address' | 'blockchain' | 'chainId'>>;
|
|
2189
|
+
activeInvites?: Maybe<Array<Pick<IActiveInvite, 'inviteCode' | 'createdAt'>>>;
|
|
2190
|
+
})>;
|
|
2191
|
+
nextPage?: Maybe<Pick<IAdminPage, 'num' | 'lastNum' | 'size' | 'elements' | 'token'>>;
|
|
2192
|
+
};
|
|
2193
|
+
};
|
|
2180
2194
|
export type IFetchAdminXpPageQueryVariables = Exact<{
|
|
2181
2195
|
filter: IXpFilterInput;
|
|
2182
2196
|
sort: IXpSortInput;
|
|
@@ -3104,6 +3118,38 @@ export declare function useRemoveInviteCodeMutation(baseOptions?: Apollo.Mutatio
|
|
|
3104
3118
|
export type RemoveInviteCodeMutationHookResult = ReturnType<typeof useRemoveInviteCodeMutation>;
|
|
3105
3119
|
export type RemoveInviteCodeMutationResult = Apollo.MutationResult<IRemoveInviteCodeMutation>;
|
|
3106
3120
|
export type RemoveInviteCodeMutationOptions = Apollo.BaseMutationOptions<IRemoveInviteCodeMutation, IRemoveInviteCodeMutationVariables>;
|
|
3121
|
+
export declare const FetchAdminInvitesPageDocument: Apollo.DocumentNode;
|
|
3122
|
+
/**
|
|
3123
|
+
* __useFetchAdminInvitesPageQuery__
|
|
3124
|
+
*
|
|
3125
|
+
* To run a query within a React component, call `useFetchAdminInvitesPageQuery` and pass it any options that fit your needs.
|
|
3126
|
+
* When your component renders, `useFetchAdminInvitesPageQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
3127
|
+
* you can use to render your UI.
|
|
3128
|
+
*
|
|
3129
|
+
* @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;
|
|
3130
|
+
*
|
|
3131
|
+
* @example
|
|
3132
|
+
* const { data, loading, error } = useFetchAdminInvitesPageQuery({
|
|
3133
|
+
* variables: {
|
|
3134
|
+
* filter: // value for 'filter'
|
|
3135
|
+
* sort: // value for 'sort'
|
|
3136
|
+
* page: // value for 'page'
|
|
3137
|
+
* },
|
|
3138
|
+
* });
|
|
3139
|
+
*/
|
|
3140
|
+
export declare function useFetchAdminInvitesPageQuery(baseOptions: Apollo.QueryHookOptions<IFetchAdminInvitesPageQuery, IFetchAdminInvitesPageQueryVariables>): Apollo.QueryResult<IFetchAdminInvitesPageQuery, Exact<{
|
|
3141
|
+
filter: IInvitesFilterInput;
|
|
3142
|
+
sort: IInvitesSortInput;
|
|
3143
|
+
page: IAdminPageInput;
|
|
3144
|
+
}>>;
|
|
3145
|
+
export declare function useFetchAdminInvitesPageLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<IFetchAdminInvitesPageQuery, IFetchAdminInvitesPageQueryVariables>): Apollo.LazyQueryResultTuple<IFetchAdminInvitesPageQuery, Exact<{
|
|
3146
|
+
filter: IInvitesFilterInput;
|
|
3147
|
+
sort: IInvitesSortInput;
|
|
3148
|
+
page: IAdminPageInput;
|
|
3149
|
+
}>>;
|
|
3150
|
+
export type FetchAdminInvitesPageQueryHookResult = ReturnType<typeof useFetchAdminInvitesPageQuery>;
|
|
3151
|
+
export type FetchAdminInvitesPageLazyQueryHookResult = ReturnType<typeof useFetchAdminInvitesPageLazyQuery>;
|
|
3152
|
+
export type FetchAdminInvitesPageQueryResult = Apollo.QueryResult<IFetchAdminInvitesPageQuery, IFetchAdminInvitesPageQueryVariables>;
|
|
3107
3153
|
export declare const FetchAdminXpPageDocument: Apollo.DocumentNode;
|
|
3108
3154
|
/**
|
|
3109
3155
|
* __useFetchAdminXpPageQuery__
|
|
@@ -23,12 +23,12 @@ 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 = exports.useFindUserShowcaseItemsQuery = exports.FindUserShowcaseItemsDocument = exports.useFindUserCreationsLazyQuery = exports.useFindUserCreationsQuery = 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 = void 0;
|
|
26
|
+
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.useFetchAdminInvitesPageLazyQuery = exports.useFetchAdminInvitesPageQuery = exports.FetchAdminInvitesPageDocument = exports.useRemoveInviteCodeMutation = exports.RemoveInviteCodeDocument = exports.useAddInviteCodesMutation = exports.AddInviteCodesDocument = exports.useChangeXpPointsMutation = exports.ChangeXpPointsDocument = exports.ISortDirection = void 0;
|
|
27
|
+
exports.useAddCollectionsToGalleryV2Mutation = exports.AddCollectionsToGalleryV2Document = exports.useAddCollectionsToGalleryMutation = exports.AddCollectionsToGalleryDocument = exports.useUploadGalleryBannerMutation = exports.UploadGalleryBannerDocument = exports.useAddAssetsToGalleryV2Mutation = exports.AddAssetsToGalleryV2Document = exports.useAddAssetsToGalleryMutation = exports.AddAssetsToGalleryDocument = exports.useFetchNftRanksLazyQuery = exports.useFetchNftRanksQuery = exports.FetchNftRanksDocument = exports.useFetchNftDataLazyQuery = exports.useFetchNftDataQuery = exports.FetchNftDataDocument = exports.useFetchExtensionOpportunitiesV2LazyQuery = exports.useFetchExtensionOpportunitiesV2Query = exports.FetchExtensionOpportunitiesV2Document = exports.useFetchExtensionCategoriesLazyQuery = exports.useFetchExtensionCategoriesQuery = exports.FetchExtensionCategoriesDocument = exports.useFetchExtensionBrandsLazyQuery = exports.useFetchExtensionBrandsQuery = exports.FetchExtensionBrandsDocument = exports.useFetchCollectionRanksLazyQuery = exports.useFetchCollectionRanksQuery = exports.FetchCollectionRanksDocument = exports.useVisitPageV2Mutation = exports.VisitPageV2Document = exports.useOpenOpportunityV2Mutation = exports.OpenOpportunityV2Document = exports.useHideOpportunityV2Mutation = exports.HideOpportunityV2Document = exports.useOnMyExperienceUpdatedSubscription = exports.OnMyExperienceUpdatedDocument = exports.useOnMyExperienceIncrementedSubscription = exports.OnMyExperienceIncrementedDocument = exports.useOnInviteCodeUsedSubscription = exports.OnInviteCodeUsedDocument = exports.useFetchMyTasksLazyQuery = exports.useFetchMyTasksQuery = exports.FetchMyTasksDocument = exports.useFetchMyExperienceV2LazyQuery = exports.useFetchMyExperienceV2Query = exports.FetchMyExperienceV2Document = exports.useFetchDynamicCollectionsDataLazyQuery = exports.useFetchDynamicCollectionsDataQuery = exports.FetchDynamicCollectionsDataDocument = exports.useFetchDynamicCollectionDataLazyQuery = void 0;
|
|
28
|
+
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 = 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 = void 0;
|
|
29
|
+
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 = 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 = void 0;
|
|
30
|
+
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 = 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 = void 0;
|
|
31
|
+
exports.useFindUserShowcaseItemsLazyQuery = exports.useFindUserShowcaseItemsQuery = exports.FindUserShowcaseItemsDocument = exports.useFindUserCreationsLazyQuery = exports.useFindUserCreationsQuery = 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 = void 0;
|
|
32
32
|
/* eslint-disable */
|
|
33
33
|
const client_1 = require("@apollo/client");
|
|
34
34
|
const Apollo = __importStar(require("@apollo/client"));
|
|
@@ -117,6 +117,59 @@ function useRemoveInviteCodeMutation(baseOptions) {
|
|
|
117
117
|
return Apollo.useMutation(exports.RemoveInviteCodeDocument, baseOptions);
|
|
118
118
|
}
|
|
119
119
|
exports.useRemoveInviteCodeMutation = useRemoveInviteCodeMutation;
|
|
120
|
+
exports.FetchAdminInvitesPageDocument = (0, client_1.gql) `
|
|
121
|
+
query fetchAdminInvitesPage($filter: InvitesFilterInput!, $sort: InvitesSortInput!, $page: AdminPageInput!) {
|
|
122
|
+
fetchAdminInvitesPage(filter: $filter, sort: $sort, page: $page) {
|
|
123
|
+
invites {
|
|
124
|
+
userId
|
|
125
|
+
wallet {
|
|
126
|
+
address
|
|
127
|
+
blockchain
|
|
128
|
+
chainId
|
|
129
|
+
}
|
|
130
|
+
activeInvites {
|
|
131
|
+
inviteCode
|
|
132
|
+
createdAt
|
|
133
|
+
}
|
|
134
|
+
referredUsers
|
|
135
|
+
userXpLevel
|
|
136
|
+
}
|
|
137
|
+
nextPage {
|
|
138
|
+
num
|
|
139
|
+
lastNum
|
|
140
|
+
size
|
|
141
|
+
elements
|
|
142
|
+
token
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
`;
|
|
147
|
+
/**
|
|
148
|
+
* __useFetchAdminInvitesPageQuery__
|
|
149
|
+
*
|
|
150
|
+
* To run a query within a React component, call `useFetchAdminInvitesPageQuery` and pass it any options that fit your needs.
|
|
151
|
+
* When your component renders, `useFetchAdminInvitesPageQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
152
|
+
* you can use to render your UI.
|
|
153
|
+
*
|
|
154
|
+
* @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;
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* const { data, loading, error } = useFetchAdminInvitesPageQuery({
|
|
158
|
+
* variables: {
|
|
159
|
+
* filter: // value for 'filter'
|
|
160
|
+
* sort: // value for 'sort'
|
|
161
|
+
* page: // value for 'page'
|
|
162
|
+
* },
|
|
163
|
+
* });
|
|
164
|
+
*/
|
|
165
|
+
function useFetchAdminInvitesPageQuery(baseOptions) {
|
|
166
|
+
return Apollo.useQuery(exports.FetchAdminInvitesPageDocument, baseOptions);
|
|
167
|
+
}
|
|
168
|
+
exports.useFetchAdminInvitesPageQuery = useFetchAdminInvitesPageQuery;
|
|
169
|
+
function useFetchAdminInvitesPageLazyQuery(baseOptions) {
|
|
170
|
+
return Apollo.useLazyQuery(exports.FetchAdminInvitesPageDocument, baseOptions);
|
|
171
|
+
}
|
|
172
|
+
exports.useFetchAdminInvitesPageLazyQuery = useFetchAdminInvitesPageLazyQuery;
|
|
120
173
|
exports.FetchAdminXpPageDocument = (0, client_1.gql) `
|
|
121
174
|
query FetchAdminXpPage($filter: XpFilterInput!, $sort: XpSortInput!, $page: AdminPageInput!) {
|
|
122
175
|
fetchAdminXpPage(filter: $filter, sort: $sort, page: $page) {
|
package/package.json
CHANGED
package/src/cookies/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {destroyCookie, parseCookies, setCookie} from "nookies";
|
|
2
2
|
import * as express from "express";
|
|
3
3
|
import * as next from 'next';
|
|
4
4
|
|
|
@@ -11,9 +11,11 @@ const assignCookies = (
|
|
|
11
11
|
inviteCode: string,
|
|
12
12
|
domain?: string,
|
|
13
13
|
) => {
|
|
14
|
-
if (userId) setCookie(null, "userId", userId, {
|
|
14
|
+
if (userId) setCookie(null, "userId", userId, {maxAge: 2629800000, path: "/", domain});
|
|
15
15
|
if (wallets)
|
|
16
|
-
setCookie(null, "wallets",
|
|
16
|
+
setCookie(null, "wallets", encodeURIComponent(
|
|
17
|
+
JSON.stringify(wallets)
|
|
18
|
+
), {
|
|
17
19
|
maxAge: 2629800000,
|
|
18
20
|
path: "/",
|
|
19
21
|
domain,
|
|
@@ -71,14 +73,14 @@ const getCookies = (ctx?: Pick<next.NextPageContext, 'req'> | {
|
|
|
71
73
|
} | {
|
|
72
74
|
req: express.Request;
|
|
73
75
|
} | null | undefined) => {
|
|
74
|
-
const {
|
|
76
|
+
const {authToken, refreshToken, userId, wallets, newUser, inviteCode} = parseCookies(ctx);
|
|
75
77
|
|
|
76
78
|
if (authToken && refreshToken && userId && wallets && newUser && inviteCode) {
|
|
77
79
|
return {
|
|
78
80
|
authToken,
|
|
79
81
|
refreshToken,
|
|
80
82
|
userId,
|
|
81
|
-
wallets,
|
|
83
|
+
wallets: JSON.parse(decodeURIComponent(wallets)),
|
|
82
84
|
newUser,
|
|
83
85
|
inviteCode,
|
|
84
86
|
};
|
|
@@ -95,12 +97,12 @@ const getCookies = (ctx?: Pick<next.NextPageContext, 'req'> | {
|
|
|
95
97
|
};
|
|
96
98
|
|
|
97
99
|
const destroyCookies = (domain?: string) => {
|
|
98
|
-
destroyCookie(null, "userId", {
|
|
99
|
-
destroyCookie(null, "wallets", {
|
|
100
|
-
destroyCookie(null, "authToken", {
|
|
101
|
-
destroyCookie(null, "refreshToken", {
|
|
102
|
-
destroyCookie(null, "newUser", {
|
|
103
|
-
destroyCookie(null, "inviteCode", {
|
|
100
|
+
destroyCookie(null, "userId", {path: "/", domain});
|
|
101
|
+
destroyCookie(null, "wallets", {path: "/", domain});
|
|
102
|
+
destroyCookie(null, "authToken", {path: "/", domain});
|
|
103
|
+
destroyCookie(null, "refreshToken", {path: "/", domain});
|
|
104
|
+
destroyCookie(null, "newUser", {path: "/", domain});
|
|
105
|
+
destroyCookie(null, "inviteCode", {path: "/", domain});
|
|
104
106
|
};
|
|
105
107
|
|
|
106
|
-
export {
|
|
108
|
+
export {assignCookies, refreshCookies, destroyCookies, getCookies};
|
|
@@ -2703,6 +2703,18 @@ export type IRemoveInviteCodeMutationVariables = Exact<{
|
|
|
2703
2703
|
|
|
2704
2704
|
export type IRemoveInviteCodeMutation = Pick<IMutation, 'removeInviteCode'>;
|
|
2705
2705
|
|
|
2706
|
+
export type IFetchAdminInvitesPageQueryVariables = Exact<{
|
|
2707
|
+
filter: IInvitesFilterInput;
|
|
2708
|
+
sort: IInvitesSortInput;
|
|
2709
|
+
page: IAdminPageInput;
|
|
2710
|
+
}>;
|
|
2711
|
+
|
|
2712
|
+
|
|
2713
|
+
export type IFetchAdminInvitesPageQuery = { fetchAdminInvitesPage: { invites: Array<(
|
|
2714
|
+
Pick<IAdminInvite, 'userId' | 'referredUsers' | 'userXpLevel'>
|
|
2715
|
+
& { wallet?: Maybe<Pick<IWallet, 'address' | 'blockchain' | 'chainId'>>, activeInvites?: Maybe<Array<Pick<IActiveInvite, 'inviteCode' | 'createdAt'>>> }
|
|
2716
|
+
)>, nextPage?: Maybe<Pick<IAdminPage, 'num' | 'lastNum' | 'size' | 'elements' | 'token'>> } };
|
|
2717
|
+
|
|
2706
2718
|
export type IFetchAdminXpPageQueryVariables = Exact<{
|
|
2707
2719
|
filter: IXpFilterInput;
|
|
2708
2720
|
sort: IXpSortInput;
|
|
@@ -3772,6 +3784,61 @@ export function useRemoveInviteCodeMutation(baseOptions?: Apollo.MutationHookOpt
|
|
|
3772
3784
|
export type RemoveInviteCodeMutationHookResult = ReturnType<typeof useRemoveInviteCodeMutation>;
|
|
3773
3785
|
export type RemoveInviteCodeMutationResult = Apollo.MutationResult<IRemoveInviteCodeMutation>;
|
|
3774
3786
|
export type RemoveInviteCodeMutationOptions = Apollo.BaseMutationOptions<IRemoveInviteCodeMutation, IRemoveInviteCodeMutationVariables>;
|
|
3787
|
+
export const FetchAdminInvitesPageDocument = gql`
|
|
3788
|
+
query fetchAdminInvitesPage($filter: InvitesFilterInput!, $sort: InvitesSortInput!, $page: AdminPageInput!) {
|
|
3789
|
+
fetchAdminInvitesPage(filter: $filter, sort: $sort, page: $page) {
|
|
3790
|
+
invites {
|
|
3791
|
+
userId
|
|
3792
|
+
wallet {
|
|
3793
|
+
address
|
|
3794
|
+
blockchain
|
|
3795
|
+
chainId
|
|
3796
|
+
}
|
|
3797
|
+
activeInvites {
|
|
3798
|
+
inviteCode
|
|
3799
|
+
createdAt
|
|
3800
|
+
}
|
|
3801
|
+
referredUsers
|
|
3802
|
+
userXpLevel
|
|
3803
|
+
}
|
|
3804
|
+
nextPage {
|
|
3805
|
+
num
|
|
3806
|
+
lastNum
|
|
3807
|
+
size
|
|
3808
|
+
elements
|
|
3809
|
+
token
|
|
3810
|
+
}
|
|
3811
|
+
}
|
|
3812
|
+
}
|
|
3813
|
+
`;
|
|
3814
|
+
|
|
3815
|
+
/**
|
|
3816
|
+
* __useFetchAdminInvitesPageQuery__
|
|
3817
|
+
*
|
|
3818
|
+
* To run a query within a React component, call `useFetchAdminInvitesPageQuery` and pass it any options that fit your needs.
|
|
3819
|
+
* When your component renders, `useFetchAdminInvitesPageQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
3820
|
+
* you can use to render your UI.
|
|
3821
|
+
*
|
|
3822
|
+
* @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;
|
|
3823
|
+
*
|
|
3824
|
+
* @example
|
|
3825
|
+
* const { data, loading, error } = useFetchAdminInvitesPageQuery({
|
|
3826
|
+
* variables: {
|
|
3827
|
+
* filter: // value for 'filter'
|
|
3828
|
+
* sort: // value for 'sort'
|
|
3829
|
+
* page: // value for 'page'
|
|
3830
|
+
* },
|
|
3831
|
+
* });
|
|
3832
|
+
*/
|
|
3833
|
+
export function useFetchAdminInvitesPageQuery(baseOptions: Apollo.QueryHookOptions<IFetchAdminInvitesPageQuery, IFetchAdminInvitesPageQueryVariables>) {
|
|
3834
|
+
return Apollo.useQuery<IFetchAdminInvitesPageQuery, IFetchAdminInvitesPageQueryVariables>(FetchAdminInvitesPageDocument, baseOptions);
|
|
3835
|
+
}
|
|
3836
|
+
export function useFetchAdminInvitesPageLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<IFetchAdminInvitesPageQuery, IFetchAdminInvitesPageQueryVariables>) {
|
|
3837
|
+
return Apollo.useLazyQuery<IFetchAdminInvitesPageQuery, IFetchAdminInvitesPageQueryVariables>(FetchAdminInvitesPageDocument, baseOptions);
|
|
3838
|
+
}
|
|
3839
|
+
export type FetchAdminInvitesPageQueryHookResult = ReturnType<typeof useFetchAdminInvitesPageQuery>;
|
|
3840
|
+
export type FetchAdminInvitesPageLazyQueryHookResult = ReturnType<typeof useFetchAdminInvitesPageLazyQuery>;
|
|
3841
|
+
export type FetchAdminInvitesPageQueryResult = Apollo.QueryResult<IFetchAdminInvitesPageQuery, IFetchAdminInvitesPageQueryVariables>;
|
|
3775
3842
|
export const FetchAdminXpPageDocument = gql`
|
|
3776
3843
|
query FetchAdminXpPage($filter: XpFilterInput!, $sort: XpSortInput!, $page: AdminPageInput!) {
|
|
3777
3844
|
fetchAdminXpPage(filter: $filter, sort: $sort, page: $page) {
|