@ludo.ninja/api 2.8.75 → 2.8.77

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.
@@ -0,0 +1,162 @@
1
+ import { GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql';
2
+ import * as Apollo from '@apollo/client';
3
+ export type Maybe<T> = T | null;
4
+ export type Exact<T extends {
5
+ [key: string]: unknown;
6
+ }> = {
7
+ [K in keyof T]: T[K];
8
+ };
9
+ export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
10
+ [SubKey in K]?: Maybe<T[SubKey]>;
11
+ };
12
+ export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
13
+ [SubKey in K]: Maybe<T[SubKey]>;
14
+ };
15
+ export type RequireFields<T, K extends keyof T> = Omit<T, K> & {
16
+ [P in K]-?: NonNullable<T[P]>;
17
+ };
18
+ /** All built-in and custom scalars, mapped to their actual values */
19
+ export type Scalars = {
20
+ ID: string;
21
+ String: string;
22
+ Boolean: boolean;
23
+ Int: number;
24
+ Float: number;
25
+ /** A 64-bit signed integer */
26
+ Long: any;
27
+ };
28
+ export type IMutation = {
29
+ setDummy: Scalars['String'];
30
+ };
31
+ export type INotification = {
32
+ notificationType?: Maybe<Scalars['String']>;
33
+ createdAt?: Maybe<Scalars['Long']>;
34
+ name?: Maybe<Scalars['String']>;
35
+ description?: Maybe<Scalars['String']>;
36
+ media?: Maybe<Scalars['String']>;
37
+ link?: Maybe<Scalars['String']>;
38
+ };
39
+ export type IQuery = {
40
+ getDummy: Scalars['String'];
41
+ };
42
+ export type ISubscription = {
43
+ onDummy: Scalars['String'];
44
+ onNotification: INotification;
45
+ };
46
+ export type ISubscriptionOnNotificationArgs = {
47
+ authToken: Scalars['String'];
48
+ };
49
+ export type ResolverTypeWrapper<T> = Promise<T> | T;
50
+ export type ResolverWithResolve<TResult, TParent, TContext, TArgs> = {
51
+ resolve: ResolverFn<TResult, TParent, TContext, TArgs>;
52
+ };
53
+ export type Resolver<TResult, TParent = {}, TContext = {}, TArgs = {}> = ResolverFn<TResult, TParent, TContext, TArgs> | ResolverWithResolve<TResult, TParent, TContext, TArgs>;
54
+ export type ResolverFn<TResult, TParent, TContext, TArgs> = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => Promise<TResult> | TResult;
55
+ export type SubscriptionSubscribeFn<TResult, TParent, TContext, TArgs> = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => AsyncIterable<TResult> | Promise<AsyncIterable<TResult>>;
56
+ export type SubscriptionResolveFn<TResult, TParent, TContext, TArgs> = (parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TResult | Promise<TResult>;
57
+ export interface SubscriptionSubscriberObject<TResult, TKey extends string, TParent, TContext, TArgs> {
58
+ subscribe: SubscriptionSubscribeFn<{
59
+ [key in TKey]: TResult;
60
+ }, TParent, TContext, TArgs>;
61
+ resolve?: SubscriptionResolveFn<TResult, {
62
+ [key in TKey]: TResult;
63
+ }, TContext, TArgs>;
64
+ }
65
+ export interface SubscriptionResolverObject<TResult, TParent, TContext, TArgs> {
66
+ subscribe: SubscriptionSubscribeFn<any, TParent, TContext, TArgs>;
67
+ resolve: SubscriptionResolveFn<TResult, any, TContext, TArgs>;
68
+ }
69
+ export type SubscriptionObject<TResult, TKey extends string, TParent, TContext, TArgs> = SubscriptionSubscriberObject<TResult, TKey, TParent, TContext, TArgs> | SubscriptionResolverObject<TResult, TParent, TContext, TArgs>;
70
+ export type SubscriptionResolver<TResult, TKey extends string, TParent = {}, TContext = {}, TArgs = {}> = ((...args: any[]) => SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>) | SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>;
71
+ export type TypeResolveFn<TTypes, TParent = {}, TContext = {}> = (parent: TParent, context: TContext, info: GraphQLResolveInfo) => Maybe<TTypes> | Promise<Maybe<TTypes>>;
72
+ export type IsTypeOfResolverFn<T = {}, TContext = {}> = (obj: T, context: TContext, info: GraphQLResolveInfo) => boolean | Promise<boolean>;
73
+ export type NextResolverFn<T> = () => Promise<T>;
74
+ export type DirectiveResolverFn<TResult = {}, TParent = {}, TContext = {}, TArgs = {}> = (next: NextResolverFn<TResult>, parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TResult | Promise<TResult>;
75
+ /** Mapping between all available schema types and the resolvers types */
76
+ export type IResolversTypes = {
77
+ Long: ResolverTypeWrapper<Scalars['Long']>;
78
+ Mutation: ResolverTypeWrapper<{}>;
79
+ String: ResolverTypeWrapper<Scalars['String']>;
80
+ Notification: ResolverTypeWrapper<INotification>;
81
+ Query: ResolverTypeWrapper<{}>;
82
+ Subscription: ResolverTypeWrapper<{}>;
83
+ Boolean: ResolverTypeWrapper<Scalars['Boolean']>;
84
+ };
85
+ /** Mapping between all available schema types and the resolvers parents */
86
+ export type IResolversParentTypes = {
87
+ Long: Scalars['Long'];
88
+ Mutation: {};
89
+ String: Scalars['String'];
90
+ Notification: INotification;
91
+ Query: {};
92
+ Subscription: {};
93
+ Boolean: Scalars['Boolean'];
94
+ };
95
+ export type IOneOfDirectiveArgs = {};
96
+ export type IOneOfDirectiveResolver<Result, Parent, ContextType = any, Args = IOneOfDirectiveArgs> = DirectiveResolverFn<Result, Parent, ContextType, Args>;
97
+ export interface ILongScalarConfig extends GraphQLScalarTypeConfig<IResolversTypes['Long'], any> {
98
+ name: 'Long';
99
+ }
100
+ export type IMutationResolvers<ContextType = any, ParentType extends IResolversParentTypes['Mutation'] = IResolversParentTypes['Mutation']> = {
101
+ setDummy?: Resolver<IResolversTypes['String'], ParentType, ContextType>;
102
+ };
103
+ export type INotificationResolvers<ContextType = any, ParentType extends IResolversParentTypes['Notification'] = IResolversParentTypes['Notification']> = {
104
+ notificationType?: Resolver<Maybe<IResolversTypes['String']>, ParentType, ContextType>;
105
+ createdAt?: Resolver<Maybe<IResolversTypes['Long']>, ParentType, ContextType>;
106
+ name?: Resolver<Maybe<IResolversTypes['String']>, ParentType, ContextType>;
107
+ description?: Resolver<Maybe<IResolversTypes['String']>, ParentType, ContextType>;
108
+ media?: Resolver<Maybe<IResolversTypes['String']>, ParentType, ContextType>;
109
+ link?: Resolver<Maybe<IResolversTypes['String']>, ParentType, ContextType>;
110
+ __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
111
+ };
112
+ export type IQueryResolvers<ContextType = any, ParentType extends IResolversParentTypes['Query'] = IResolversParentTypes['Query']> = {
113
+ getDummy?: Resolver<IResolversTypes['String'], ParentType, ContextType>;
114
+ };
115
+ export type ISubscriptionResolvers<ContextType = any, ParentType extends IResolversParentTypes['Subscription'] = IResolversParentTypes['Subscription']> = {
116
+ onDummy?: SubscriptionResolver<IResolversTypes['String'], "onDummy", ParentType, ContextType>;
117
+ onNotification?: SubscriptionResolver<IResolversTypes['Notification'], "onNotification", ParentType, ContextType, RequireFields<ISubscriptionOnNotificationArgs, 'authToken'>>;
118
+ };
119
+ export type IResolvers<ContextType = any> = {
120
+ Long?: GraphQLScalarType;
121
+ Mutation?: IMutationResolvers<ContextType>;
122
+ Notification?: INotificationResolvers<ContextType>;
123
+ Query?: IQueryResolvers<ContextType>;
124
+ Subscription?: ISubscriptionResolvers<ContextType>;
125
+ };
126
+ export type IDirectiveResolvers<ContextType = any> = {
127
+ oneOf?: IOneOfDirectiveResolver<any, any, ContextType>;
128
+ };
129
+ export type IOnNotificationSubscriptionVariables = Exact<{
130
+ authToken: Scalars['String'];
131
+ }>;
132
+ export type IOnNotificationSubscription = {
133
+ onNotification: Pick<INotification, 'notificationType' | 'createdAt' | 'name' | 'description' | 'media' | 'link'>;
134
+ };
135
+ export declare const OnNotificationDocument: Apollo.DocumentNode;
136
+ /**
137
+ * __useOnNotificationSubscription__
138
+ *
139
+ * To run a query within a React component, call `useOnNotificationSubscription` and pass it any options that fit your needs.
140
+ * When your component renders, `useOnNotificationSubscription` returns an object from Apollo Client that contains loading, error, and data properties
141
+ * you can use to render your UI.
142
+ *
143
+ * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
144
+ *
145
+ * @example
146
+ * const { data, loading, error } = useOnNotificationSubscription({
147
+ * variables: {
148
+ * authToken: // value for 'authToken'
149
+ * },
150
+ * });
151
+ */
152
+ export declare function useOnNotificationSubscription(baseOptions: Apollo.SubscriptionHookOptions<IOnNotificationSubscription, IOnNotificationSubscriptionVariables>): {
153
+ restart(): void;
154
+ loading: boolean;
155
+ data?: IOnNotificationSubscription | undefined;
156
+ error?: Apollo.ApolloError | undefined;
157
+ variables?: Exact<{
158
+ authToken: string;
159
+ }> | undefined;
160
+ };
161
+ export type OnNotificationSubscriptionHookResult = ReturnType<typeof useOnNotificationSubscription>;
162
+ export type OnNotificationSubscriptionResult = Apollo.SubscriptionResult<IOnNotificationSubscription>;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.useOnNotificationSubscription = exports.OnNotificationDocument = void 0;
27
+ const client_1 = require("@apollo/client");
28
+ const Apollo = __importStar(require("@apollo/client"));
29
+ exports.OnNotificationDocument = (0, client_1.gql) `
30
+ subscription OnNotification($authToken: String!) {
31
+ onNotification(authToken: $authToken) {
32
+ notificationType
33
+ createdAt
34
+ name
35
+ description
36
+ media
37
+ link
38
+ }
39
+ }
40
+ `;
41
+ /**
42
+ * __useOnNotificationSubscription__
43
+ *
44
+ * To run a query within a React component, call `useOnNotificationSubscription` and pass it any options that fit your needs.
45
+ * When your component renders, `useOnNotificationSubscription` returns an object from Apollo Client that contains loading, error, and data properties
46
+ * you can use to render your UI.
47
+ *
48
+ * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
49
+ *
50
+ * @example
51
+ * const { data, loading, error } = useOnNotificationSubscription({
52
+ * variables: {
53
+ * authToken: // value for 'authToken'
54
+ * },
55
+ * });
56
+ */
57
+ function useOnNotificationSubscription(baseOptions) {
58
+ return Apollo.useSubscription(exports.OnNotificationDocument, baseOptions);
59
+ }
60
+ exports.useOnNotificationSubscription = useOnNotificationSubscription;
@@ -18,7 +18,9 @@ export declare const preferencesHostSSR = "https://ssr-preferences.ludo.ninja:80
18
18
  export declare const searchHostSSR = "https://ssr-search.ludo.ninja:8091/graphql";
19
19
  export declare const serverPreferencesHost = "http://server-preferences.istio.svc.k8s.local:8090/graphql";
20
20
  export declare const eventsHost = "wss://events.ludo.ninja:8090/subscriptions";
21
+ export declare const experiencesSubscriptionHost = "wss://experiences.ludo.ninja:8090/subscriptions";
21
22
  export declare const notificationsSubscriptionHost = "wss://notifications.ludo.ninja:8090/subscriptions";
23
+ export declare const notificationsHost = "'https://notifications.ludo.ninja:8090/graphql'";
22
24
  export declare const opportunitiesHost = "https://opportunities.ludo.ninja:8090/graphql";
23
25
  export declare const extensionHost = "https://chrome.ludo.ninja:8092/graphql";
24
26
  export declare const experiencesHost = "https://experiences.ludo.ninja:8090/graphql";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tapHost = exports.formsHost = exports.serverExperiencesHost = exports.experiencesHost = exports.extensionHost = exports.opportunitiesHost = exports.notificationsSubscriptionHost = exports.eventsHost = exports.serverPreferencesHost = exports.searchHostSSR = exports.preferencesHostSSR = exports.preferencesHost = exports.serverSearchHost = exports.serverShowCaseHost = exports.searchHost = exports.serverImagesHost = exports.mediasHost = exports.serverGalleriesHost = exports.galleriesHost = exports.serverIdentityHost = exports.serverCollectionsHost = exports.serverAssetsHost = exports.adminHost = exports.collectionsHost = exports.assetsHost = exports.identityHost = exports.authHost = void 0;
3
+ exports.tapHost = exports.formsHost = exports.serverExperiencesHost = exports.experiencesHost = exports.extensionHost = exports.opportunitiesHost = exports.notificationsHost = exports.notificationsSubscriptionHost = exports.experiencesSubscriptionHost = exports.eventsHost = exports.serverPreferencesHost = exports.searchHostSSR = exports.preferencesHostSSR = exports.preferencesHost = exports.serverSearchHost = exports.serverShowCaseHost = exports.searchHost = exports.serverImagesHost = exports.mediasHost = exports.serverGalleriesHost = exports.galleriesHost = exports.serverIdentityHost = exports.serverCollectionsHost = exports.serverAssetsHost = exports.adminHost = exports.collectionsHost = exports.assetsHost = exports.identityHost = exports.authHost = void 0;
4
4
  exports.authHost = "https://auth.ludo.ninja:8080/graphql";
5
5
  exports.identityHost = "https://identities.ludo.ninja:8090/graphql";
6
6
  exports.assetsHost = "https://assets.ludo.ninja:8090/graphql";
@@ -21,7 +21,9 @@ exports.preferencesHostSSR = "https://ssr-preferences.ludo.ninja:8091/graphql";
21
21
  exports.searchHostSSR = "https://ssr-search.ludo.ninja:8091/graphql";
22
22
  exports.serverPreferencesHost = "http://server-preferences.istio.svc.k8s.local:8090/graphql";
23
23
  exports.eventsHost = `wss://events.ludo.ninja:8090/subscriptions`;
24
+ exports.experiencesSubscriptionHost = "wss://experiences.ludo.ninja:8090/subscriptions";
24
25
  exports.notificationsSubscriptionHost = "wss://notifications.ludo.ninja:8090/subscriptions";
26
+ exports.notificationsHost = "'https://notifications.ludo.ninja:8090/graphql'";
25
27
  exports.opportunitiesHost = "https://opportunities.ludo.ninja:8090/graphql";
26
28
  exports.extensionHost = "https://chrome.ludo.ninja:8092/graphql";
27
29
  exports.experiencesHost = "https://experiences.ludo.ninja:8090/graphql";
package/build/index.d.ts CHANGED
@@ -15,7 +15,20 @@ import * as preferencesSchema from "./graphql_tools/__generated__/preferencesHos
15
15
  import * as searchSchema from "./graphql_tools/__generated__/searchHost/schema";
16
16
  import * as formsSchema from "./graphql_tools/__generated__/formsHost/schema";
17
17
  import * as tapsSchema from "./graphql_tools/__generated__/tapHost/schema";
18
+ import * as notificationsSchema from "./graphql_tools/__generated__/notificationsHost/schema";
18
19
  declare const schema: {
20
+ useOnNotificationSubscription(baseOptions: import("@apollo/client").SubscriptionHookOptions<notificationsSchema.IOnNotificationSubscription, notificationsSchema.Exact<{
21
+ authToken: string;
22
+ }>>): {
23
+ restart(): void;
24
+ loading: boolean;
25
+ data?: notificationsSchema.IOnNotificationSubscription | undefined;
26
+ error?: import("@apollo/client").ApolloError | undefined;
27
+ variables?: notificationsSchema.Exact<{
28
+ authToken: string;
29
+ }> | undefined;
30
+ };
31
+ OnNotificationDocument: import("graphql").DocumentNode;
19
32
  useClaimFarmingRewardMutation(baseOptions?: import("@apollo/client").MutationHookOptions<tapsSchema.IClaimFarmingRewardMutation, tapsSchema.Exact<{
20
33
  [key: string]: never;
21
34
  }>, import("@apollo/client").DefaultContext, import("@apollo/client").ApolloCache<any>> | undefined): import("@apollo/client").MutationTuple<tapsSchema.IClaimFarmingRewardMutation, tapsSchema.Exact<{
@@ -1677,4 +1690,4 @@ declare const schema: {
1677
1690
  FetchAdminXpPageDocument: import("graphql").DocumentNode;
1678
1691
  FetchBlockchainsDocument: import("graphql").DocumentNode;
1679
1692
  };
1680
- export { hosts, schema, graphqlConfig, authCookies, adminSchema, assetSchema, authSchema, collectionsSchema, experiencesSchema, extensionSchema, galleriesSchema, identitySchema, mediasSchema, opportunitiesSchema, preferencesSchema, searchSchema, formsSchema, tapsSchema };
1693
+ export { hosts, schema, graphqlConfig, authCookies, adminSchema, assetSchema, authSchema, collectionsSchema, experiencesSchema, extensionSchema, galleriesSchema, identitySchema, mediasSchema, opportunitiesSchema, preferencesSchema, searchSchema, formsSchema, tapsSchema, notificationsSchema, };
package/build/index.js CHANGED
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.tapsSchema = exports.formsSchema = exports.searchSchema = exports.preferencesSchema = exports.opportunitiesSchema = exports.mediasSchema = exports.identitySchema = exports.galleriesSchema = exports.extensionSchema = exports.experiencesSchema = exports.collectionsSchema = exports.authSchema = exports.assetSchema = exports.adminSchema = exports.authCookies = exports.graphqlConfig = exports.schema = exports.hosts = void 0;
26
+ exports.notificationsSchema = exports.tapsSchema = exports.formsSchema = exports.searchSchema = exports.preferencesSchema = exports.opportunitiesSchema = exports.mediasSchema = exports.identitySchema = exports.galleriesSchema = exports.extensionSchema = exports.experiencesSchema = exports.collectionsSchema = exports.authSchema = exports.assetSchema = exports.adminSchema = exports.authCookies = exports.graphqlConfig = exports.schema = exports.hosts = void 0;
27
27
  const hosts = __importStar(require("./hosts"));
28
28
  exports.hosts = hosts;
29
29
  const graphqlConfig = __importStar(require("./config"));
@@ -58,6 +58,8 @@ const formsSchema = __importStar(require("./graphql_tools/__generated__/formsHos
58
58
  exports.formsSchema = formsSchema;
59
59
  const tapsSchema = __importStar(require("./graphql_tools/__generated__/tapHost/schema"));
60
60
  exports.tapsSchema = tapsSchema;
61
+ const notificationsSchema = __importStar(require("./graphql_tools/__generated__/notificationsHost/schema"));
62
+ exports.notificationsSchema = notificationsSchema;
61
63
  const schema = {
62
64
  ...adminSchema,
63
65
  ...assetSchema,
@@ -72,6 +74,7 @@ const schema = {
72
74
  ...preferencesSchema,
73
75
  ...searchSchema,
74
76
  ...formsSchema,
75
- ...tapsSchema
77
+ ...tapsSchema,
78
+ ...notificationsSchema,
76
79
  };
77
80
  exports.schema = schema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/api",
3
- "version": "2.8.75",
3
+ "version": "2.8.77",
4
4
  "main": "./build/index.js",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -0,0 +1,223 @@
1
+ /* eslint-disable */
2
+ import { GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql';
3
+ import { gql } from '@apollo/client';
4
+ import * as Apollo from '@apollo/client';
5
+ export type Maybe<T> = T | null;
6
+ export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
7
+ export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
8
+ export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
9
+ export type RequireFields<T, K extends keyof T> = Omit<T, K> & { [P in K]-?: NonNullable<T[P]> };
10
+ /** All built-in and custom scalars, mapped to their actual values */
11
+ export type Scalars = {
12
+ ID: string;
13
+ String: string;
14
+ Boolean: boolean;
15
+ Int: number;
16
+ Float: number;
17
+ /** A 64-bit signed integer */
18
+ Long: any;
19
+ };
20
+
21
+
22
+
23
+ export type IMutation = {
24
+ setDummy: Scalars['String'];
25
+ };
26
+
27
+ export type INotification = {
28
+ notificationType?: Maybe<Scalars['String']>;
29
+ createdAt?: Maybe<Scalars['Long']>;
30
+ name?: Maybe<Scalars['String']>;
31
+ description?: Maybe<Scalars['String']>;
32
+ media?: Maybe<Scalars['String']>;
33
+ link?: Maybe<Scalars['String']>;
34
+ };
35
+
36
+ export type IQuery = {
37
+ getDummy: Scalars['String'];
38
+ };
39
+
40
+ export type ISubscription = {
41
+ onDummy: Scalars['String'];
42
+ onNotification: INotification;
43
+ };
44
+
45
+
46
+ export type ISubscriptionOnNotificationArgs = {
47
+ authToken: Scalars['String'];
48
+ };
49
+
50
+
51
+
52
+ export type ResolverTypeWrapper<T> = Promise<T> | T;
53
+
54
+
55
+ export type ResolverWithResolve<TResult, TParent, TContext, TArgs> = {
56
+ resolve: ResolverFn<TResult, TParent, TContext, TArgs>;
57
+ };
58
+ export type Resolver<TResult, TParent = {}, TContext = {}, TArgs = {}> = ResolverFn<TResult, TParent, TContext, TArgs> | ResolverWithResolve<TResult, TParent, TContext, TArgs>;
59
+
60
+ export type ResolverFn<TResult, TParent, TContext, TArgs> = (
61
+ parent: TParent,
62
+ args: TArgs,
63
+ context: TContext,
64
+ info: GraphQLResolveInfo
65
+ ) => Promise<TResult> | TResult;
66
+
67
+ export type SubscriptionSubscribeFn<TResult, TParent, TContext, TArgs> = (
68
+ parent: TParent,
69
+ args: TArgs,
70
+ context: TContext,
71
+ info: GraphQLResolveInfo
72
+ ) => AsyncIterable<TResult> | Promise<AsyncIterable<TResult>>;
73
+
74
+ export type SubscriptionResolveFn<TResult, TParent, TContext, TArgs> = (
75
+ parent: TParent,
76
+ args: TArgs,
77
+ context: TContext,
78
+ info: GraphQLResolveInfo
79
+ ) => TResult | Promise<TResult>;
80
+
81
+ export interface SubscriptionSubscriberObject<TResult, TKey extends string, TParent, TContext, TArgs> {
82
+ subscribe: SubscriptionSubscribeFn<{ [key in TKey]: TResult }, TParent, TContext, TArgs>;
83
+ resolve?: SubscriptionResolveFn<TResult, { [key in TKey]: TResult }, TContext, TArgs>;
84
+ }
85
+
86
+ export interface SubscriptionResolverObject<TResult, TParent, TContext, TArgs> {
87
+ subscribe: SubscriptionSubscribeFn<any, TParent, TContext, TArgs>;
88
+ resolve: SubscriptionResolveFn<TResult, any, TContext, TArgs>;
89
+ }
90
+
91
+ export type SubscriptionObject<TResult, TKey extends string, TParent, TContext, TArgs> =
92
+ | SubscriptionSubscriberObject<TResult, TKey, TParent, TContext, TArgs>
93
+ | SubscriptionResolverObject<TResult, TParent, TContext, TArgs>;
94
+
95
+ export type SubscriptionResolver<TResult, TKey extends string, TParent = {}, TContext = {}, TArgs = {}> =
96
+ | ((...args: any[]) => SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>)
97
+ | SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>;
98
+
99
+ export type TypeResolveFn<TTypes, TParent = {}, TContext = {}> = (
100
+ parent: TParent,
101
+ context: TContext,
102
+ info: GraphQLResolveInfo
103
+ ) => Maybe<TTypes> | Promise<Maybe<TTypes>>;
104
+
105
+ export type IsTypeOfResolverFn<T = {}, TContext = {}> = (obj: T, context: TContext, info: GraphQLResolveInfo) => boolean | Promise<boolean>;
106
+
107
+ export type NextResolverFn<T> = () => Promise<T>;
108
+
109
+ export type DirectiveResolverFn<TResult = {}, TParent = {}, TContext = {}, TArgs = {}> = (
110
+ next: NextResolverFn<TResult>,
111
+ parent: TParent,
112
+ args: TArgs,
113
+ context: TContext,
114
+ info: GraphQLResolveInfo
115
+ ) => TResult | Promise<TResult>;
116
+
117
+ /** Mapping between all available schema types and the resolvers types */
118
+ export type IResolversTypes = {
119
+ Long: ResolverTypeWrapper<Scalars['Long']>;
120
+ Mutation: ResolverTypeWrapper<{}>;
121
+ String: ResolverTypeWrapper<Scalars['String']>;
122
+ Notification: ResolverTypeWrapper<INotification>;
123
+ Query: ResolverTypeWrapper<{}>;
124
+ Subscription: ResolverTypeWrapper<{}>;
125
+ Boolean: ResolverTypeWrapper<Scalars['Boolean']>;
126
+ };
127
+
128
+ /** Mapping between all available schema types and the resolvers parents */
129
+ export type IResolversParentTypes = {
130
+ Long: Scalars['Long'];
131
+ Mutation: {};
132
+ String: Scalars['String'];
133
+ Notification: INotification;
134
+ Query: {};
135
+ Subscription: {};
136
+ Boolean: Scalars['Boolean'];
137
+ };
138
+
139
+ export type IOneOfDirectiveArgs = { };
140
+
141
+ export type IOneOfDirectiveResolver<Result, Parent, ContextType = any, Args = IOneOfDirectiveArgs> = DirectiveResolverFn<Result, Parent, ContextType, Args>;
142
+
143
+ export interface ILongScalarConfig extends GraphQLScalarTypeConfig<IResolversTypes['Long'], any> {
144
+ name: 'Long';
145
+ }
146
+
147
+ export type IMutationResolvers<ContextType = any, ParentType extends IResolversParentTypes['Mutation'] = IResolversParentTypes['Mutation']> = {
148
+ setDummy?: Resolver<IResolversTypes['String'], ParentType, ContextType>;
149
+ };
150
+
151
+ export type INotificationResolvers<ContextType = any, ParentType extends IResolversParentTypes['Notification'] = IResolversParentTypes['Notification']> = {
152
+ notificationType?: Resolver<Maybe<IResolversTypes['String']>, ParentType, ContextType>;
153
+ createdAt?: Resolver<Maybe<IResolversTypes['Long']>, ParentType, ContextType>;
154
+ name?: Resolver<Maybe<IResolversTypes['String']>, ParentType, ContextType>;
155
+ description?: Resolver<Maybe<IResolversTypes['String']>, ParentType, ContextType>;
156
+ media?: Resolver<Maybe<IResolversTypes['String']>, ParentType, ContextType>;
157
+ link?: Resolver<Maybe<IResolversTypes['String']>, ParentType, ContextType>;
158
+ __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
159
+ };
160
+
161
+ export type IQueryResolvers<ContextType = any, ParentType extends IResolversParentTypes['Query'] = IResolversParentTypes['Query']> = {
162
+ getDummy?: Resolver<IResolversTypes['String'], ParentType, ContextType>;
163
+ };
164
+
165
+ export type ISubscriptionResolvers<ContextType = any, ParentType extends IResolversParentTypes['Subscription'] = IResolversParentTypes['Subscription']> = {
166
+ onDummy?: SubscriptionResolver<IResolversTypes['String'], "onDummy", ParentType, ContextType>;
167
+ onNotification?: SubscriptionResolver<IResolversTypes['Notification'], "onNotification", ParentType, ContextType, RequireFields<ISubscriptionOnNotificationArgs, 'authToken'>>;
168
+ };
169
+
170
+ export type IResolvers<ContextType = any> = {
171
+ Long?: GraphQLScalarType;
172
+ Mutation?: IMutationResolvers<ContextType>;
173
+ Notification?: INotificationResolvers<ContextType>;
174
+ Query?: IQueryResolvers<ContextType>;
175
+ Subscription?: ISubscriptionResolvers<ContextType>;
176
+ };
177
+
178
+ export type IDirectiveResolvers<ContextType = any> = {
179
+ oneOf?: IOneOfDirectiveResolver<any, any, ContextType>;
180
+ };
181
+
182
+ export type IOnNotificationSubscriptionVariables = Exact<{
183
+ authToken: Scalars['String'];
184
+ }>;
185
+
186
+
187
+ export type IOnNotificationSubscription = { onNotification: Pick<INotification, 'notificationType' | 'createdAt' | 'name' | 'description' | 'media' | 'link'> };
188
+
189
+
190
+ export const OnNotificationDocument = gql`
191
+ subscription OnNotification($authToken: String!) {
192
+ onNotification(authToken: $authToken) {
193
+ notificationType
194
+ createdAt
195
+ name
196
+ description
197
+ media
198
+ link
199
+ }
200
+ }
201
+ `;
202
+
203
+ /**
204
+ * __useOnNotificationSubscription__
205
+ *
206
+ * To run a query within a React component, call `useOnNotificationSubscription` and pass it any options that fit your needs.
207
+ * When your component renders, `useOnNotificationSubscription` returns an object from Apollo Client that contains loading, error, and data properties
208
+ * you can use to render your UI.
209
+ *
210
+ * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
211
+ *
212
+ * @example
213
+ * const { data, loading, error } = useOnNotificationSubscription({
214
+ * variables: {
215
+ * authToken: // value for 'authToken'
216
+ * },
217
+ * });
218
+ */
219
+ export function useOnNotificationSubscription(baseOptions: Apollo.SubscriptionHookOptions<IOnNotificationSubscription, IOnNotificationSubscriptionVariables>) {
220
+ return Apollo.useSubscription<IOnNotificationSubscription, IOnNotificationSubscriptionVariables>(OnNotificationDocument, baseOptions);
221
+ }
222
+ export type OnNotificationSubscriptionHookResult = ReturnType<typeof useOnNotificationSubscription>;
223
+ export type OnNotificationSubscriptionResult = Apollo.SubscriptionResult<IOnNotificationSubscription>;
@@ -38,7 +38,10 @@ export const serverPreferencesHost = "http://server-preferences.istio.svc.k8s.lo
38
38
 
39
39
  export const eventsHost = `wss://events.ludo.ninja:8090/subscriptions`;
40
40
 
41
+ export const experiencesSubscriptionHost = "wss://experiences.ludo.ninja:8090/subscriptions";
42
+
41
43
  export const notificationsSubscriptionHost = "wss://notifications.ludo.ninja:8090/subscriptions";
44
+ export const notificationsHost = "'https://notifications.ludo.ninja:8090/graphql'";
42
45
 
43
46
  export const opportunitiesHost = "https://opportunities.ludo.ninja:8090/graphql";
44
47
 
package/src/index.ts CHANGED
@@ -15,6 +15,7 @@ import * as preferencesSchema from "./graphql_tools/__generated__/preferencesHos
15
15
  import * as searchSchema from "./graphql_tools/__generated__/searchHost/schema";
16
16
  import * as formsSchema from "./graphql_tools/__generated__/formsHost/schema";
17
17
  import * as tapsSchema from "./graphql_tools/__generated__/tapHost/schema";
18
+ import * as notificationsSchema from "./graphql_tools/__generated__/notificationsHost/schema";
18
19
 
19
20
  const schema = {
20
21
  ...adminSchema,
@@ -30,8 +31,9 @@ const schema = {
30
31
  ...preferencesSchema,
31
32
  ...searchSchema,
32
33
  ...formsSchema,
33
- ...tapsSchema
34
- }
34
+ ...tapsSchema,
35
+ ...notificationsSchema,
36
+ };
35
37
 
36
38
  export {
37
39
  hosts,
@@ -51,5 +53,6 @@ export {
51
53
  preferencesSchema,
52
54
  searchSchema,
53
55
  formsSchema,
54
- tapsSchema
56
+ tapsSchema,
57
+ notificationsSchema,
55
58
  };