@conduit-client/graphql-normalization 5.67.0-dev1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main/index.js +6 -0
- package/dist/main/index.js.map +1 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/v1/__tests__/aura-normalized-cache-control-base.spec.d.ts +1 -0
- package/dist/types/v1/__tests__/aura-normalized-cache-control-connection.spec.d.ts +1 -0
- package/dist/types/v1/__tests__/aura-normalized-cache-control-directives.spec.d.ts +1 -0
- package/dist/types/v1/__tests__/aura-normalized-cache-control-fragments.spec.d.ts +1 -0
- package/dist/types/v1/__tests__/aura-normalized-cache-control-unidentifiable.spec.d.ts +1 -0
- package/dist/types/v1/__tests__/aura-normalized-cache-control-union.spec.d.ts +1 -0
- package/dist/types/v1/__tests__/connection-query-params.spec.d.ts +1 -0
- package/dist/types/v1/__tests__/directives.spec.d.ts +1 -0
- package/dist/types/v1/__tests__/identifiable-repository-cache-key-alias.spec.d.ts +1 -0
- package/dist/types/v1/__tests__/identifiable-repository-normalize-no-mutate.spec.d.ts +1 -0
- package/dist/types/v1/__tests__/query-augmentation.spec.d.ts +1 -0
- package/dist/types/v1/__tests__/selection-equality.spec.d.ts +1 -0
- package/dist/types/v1/__tests__/test-utils.d.ts +721 -0
- package/dist/types/v1/__tests__/utils.spec.d.ts +1 -0
- package/dist/types/v1/__tests__/value-extraction.spec.d.ts +1 -0
- package/dist/types/v1/base-object-repository.d.ts +29 -0
- package/dist/types/v1/cursor-connection-graphql-type-repository.d.ts +51 -0
- package/dist/types/v1/directives.d.ts +5 -0
- package/dist/types/v1/errors.d.ts +7 -0
- package/dist/types/v1/field-defs.d.ts +40 -0
- package/dist/types/v1/identifiable-object-repository.d.ts +34 -0
- package/dist/types/v1/index.d.ts +11 -0
- package/dist/types/v1/json-schema.d.ts +2 -0
- package/dist/types/v1/repository.d.ts +8 -0
- package/dist/types/v1/type-registry.d.ts +2 -0
- package/dist/types/v1/types.d.ts +52 -0
- package/dist/types/v1/unidentifiable-object-repository.d.ts +11 -0
- package/dist/types/v1/union-interface-repositories.d.ts +38 -0
- package/dist/types/v1/utils.d.ts +21 -0
- package/dist/types/v1/value-extraction.d.ts +61 -0
- package/dist/v1/index.js +1638 -0
- package/dist/v1/index.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,721 @@
|
|
|
1
|
+
import { AuraNormalizedCacheControlCommand } from '@conduit-client/command-aura-normalized-cache-control/v1';
|
|
2
|
+
import { NamedCacheService } from '@conduit-client/service-cache/v1';
|
|
3
|
+
import { Result, SyncOrAsync } from '@conduit-client/utils';
|
|
4
|
+
import { NamedAuraNetworkService } from '@conduit-client/service-aura-network/v1';
|
|
5
|
+
import { CacheControlStrategyConfig, NamedCacheControllerService } from '@conduit-client/service-cache-control/v1';
|
|
6
|
+
import { NamedPubSubService } from '@conduit-client/service-pubsub/v1';
|
|
7
|
+
import { GraphQLData, GraphQLFragmentDefinitions, GraphQLInputExtension, GraphQLResponse, GraphQLVariables } from '../types';
|
|
8
|
+
import { DataOf, WriteInput } from '@conduit-client/type-normalization/v1';
|
|
9
|
+
import { GraphQLDocumentRootTypeRepository, IdentifiableGraphQLTypeRepository } from '../identifiable-object-repository';
|
|
10
|
+
import { SelectionNode } from '@conduit-client/onestore-graphql-parser/v1';
|
|
11
|
+
import { UnidentifiableGraphQLTypeRepository } from '../unidentifiable-object-repository';
|
|
12
|
+
import { CursorConnectionGraphQLTypeRepository, PaginatedResponse, ConnectionNormalizedData } from '../cursor-connection-graphql-type-repository';
|
|
13
|
+
import { BaseArrayFieldDef, BaseObjectFieldDef, BaseScalarFieldDef } from '../field-defs';
|
|
14
|
+
import { BaseInterfaceRepository, BaseUnionRepository } from '../union-interface-repositories';
|
|
15
|
+
export declare const namespace = "Test";
|
|
16
|
+
export type User = {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
email: string | null;
|
|
20
|
+
tags: string[];
|
|
21
|
+
scores: number[];
|
|
22
|
+
posts: Post[];
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
__typename: 'User';
|
|
26
|
+
};
|
|
27
|
+
export type Admin = {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
email: string | null;
|
|
31
|
+
tags: string[];
|
|
32
|
+
scores: number[];
|
|
33
|
+
posts: Post[];
|
|
34
|
+
createdAt: string;
|
|
35
|
+
updatedAt: string;
|
|
36
|
+
permissionLevel: number;
|
|
37
|
+
};
|
|
38
|
+
export type Post = {
|
|
39
|
+
id: string;
|
|
40
|
+
title: string;
|
|
41
|
+
content: string;
|
|
42
|
+
createdAt: string;
|
|
43
|
+
updatedAt: string;
|
|
44
|
+
__typename: 'Post';
|
|
45
|
+
};
|
|
46
|
+
export type SearchResult = User | Admin;
|
|
47
|
+
export type Character = {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
};
|
|
51
|
+
export type Human = Character & {
|
|
52
|
+
homePlanet: string;
|
|
53
|
+
lightsaberColor?: string;
|
|
54
|
+
};
|
|
55
|
+
export type Droid = Character & {
|
|
56
|
+
primaryFunction: string;
|
|
57
|
+
isR2D2: boolean;
|
|
58
|
+
};
|
|
59
|
+
export type NotificationSettings = {
|
|
60
|
+
email: boolean;
|
|
61
|
+
push: boolean;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
updatedAt: string;
|
|
64
|
+
};
|
|
65
|
+
export declare class NotificationSettingsRepository extends UnidentifiableGraphQLTypeRepository<NotificationSettings, NotificationSettings> {
|
|
66
|
+
namespace: string;
|
|
67
|
+
typeName: string;
|
|
68
|
+
implementedInterfaces: never[];
|
|
69
|
+
cacheControl: {
|
|
70
|
+
readonly type: "max-age";
|
|
71
|
+
readonly maxAge: 100;
|
|
72
|
+
readonly generatedTime: 0;
|
|
73
|
+
};
|
|
74
|
+
fields: {
|
|
75
|
+
email: BaseScalarFieldDef<NotificationSettings, NotificationSettings, Record<string, unknown>>;
|
|
76
|
+
push: BaseScalarFieldDef<NotificationSettings, NotificationSettings, Record<string, unknown>>;
|
|
77
|
+
createdAt: BaseScalarFieldDef<NotificationSettings, NotificationSettings, Record<string, unknown>>;
|
|
78
|
+
updatedAt: BaseScalarFieldDef<NotificationSettings, NotificationSettings, Record<string, unknown>>;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export type UserPreferences = {
|
|
82
|
+
language: string;
|
|
83
|
+
timezone: string;
|
|
84
|
+
createdAt: string;
|
|
85
|
+
updatedAt: string;
|
|
86
|
+
};
|
|
87
|
+
export declare class UserPreferencesRepository extends UnidentifiableGraphQLTypeRepository<UserPreferences, UserPreferences> {
|
|
88
|
+
namespace: string;
|
|
89
|
+
typeName: string;
|
|
90
|
+
implementedInterfaces: never[];
|
|
91
|
+
cacheControl: {
|
|
92
|
+
readonly type: "max-age";
|
|
93
|
+
readonly maxAge: 100;
|
|
94
|
+
readonly generatedTime: 0;
|
|
95
|
+
};
|
|
96
|
+
fields: {
|
|
97
|
+
language: BaseScalarFieldDef<UserPreferences, UserPreferences, Record<string, unknown>>;
|
|
98
|
+
timezone: BaseScalarFieldDef<UserPreferences, UserPreferences, Record<string, unknown>>;
|
|
99
|
+
createdAt: BaseScalarFieldDef<UserPreferences, UserPreferences, Record<string, unknown>>;
|
|
100
|
+
updatedAt: BaseScalarFieldDef<UserPreferences, UserPreferences, Record<string, unknown>>;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export type UserSettings = {
|
|
104
|
+
theme: 'light' | 'dark';
|
|
105
|
+
notifications: NotificationSettings;
|
|
106
|
+
preferences: UserPreferences;
|
|
107
|
+
createdAt: string;
|
|
108
|
+
updatedAt: string;
|
|
109
|
+
};
|
|
110
|
+
export declare class UserSettingsRepository extends UnidentifiableGraphQLTypeRepository<UserSettings, UserSettings> {
|
|
111
|
+
namespace: string;
|
|
112
|
+
typeName: string;
|
|
113
|
+
implementedInterfaces: never[];
|
|
114
|
+
cacheControl: {
|
|
115
|
+
readonly type: "max-age";
|
|
116
|
+
readonly maxAge: 100;
|
|
117
|
+
readonly generatedTime: 0;
|
|
118
|
+
};
|
|
119
|
+
get fields(): {
|
|
120
|
+
theme: BaseScalarFieldDef<UserSettings, UserSettings, Record<string, unknown>>;
|
|
121
|
+
notifications: BaseObjectFieldDef<NotificationSettings, NotificationSettings, Record<string, unknown>>;
|
|
122
|
+
preferences: BaseObjectFieldDef<UserPreferences, UserPreferences, Record<string, unknown>>;
|
|
123
|
+
createdAt: BaseScalarFieldDef<string, string, Record<string, unknown>>;
|
|
124
|
+
updatedAt: BaseScalarFieldDef<string, string, Record<string, unknown>>;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
export type AnalyticsMetrics = {
|
|
128
|
+
averageTimeOnSite: number;
|
|
129
|
+
bounceRate: number;
|
|
130
|
+
createdAt: string;
|
|
131
|
+
updatedAt: string;
|
|
132
|
+
};
|
|
133
|
+
export declare class AnalyticsMetricsRepository extends UnidentifiableGraphQLTypeRepository<AnalyticsMetrics, AnalyticsMetrics> {
|
|
134
|
+
namespace: string;
|
|
135
|
+
typeName: string;
|
|
136
|
+
implementedInterfaces: never[];
|
|
137
|
+
cacheControl: {
|
|
138
|
+
readonly type: "max-age";
|
|
139
|
+
readonly maxAge: 100;
|
|
140
|
+
readonly generatedTime: 0;
|
|
141
|
+
};
|
|
142
|
+
get fields(): {
|
|
143
|
+
averageTimeOnSite: BaseScalarFieldDef<AnalyticsMetrics, AnalyticsMetrics, Record<string, unknown>>;
|
|
144
|
+
bounceRate: BaseScalarFieldDef<AnalyticsMetrics, AnalyticsMetrics, Record<string, unknown>>;
|
|
145
|
+
createdAt: BaseScalarFieldDef<AnalyticsMetrics, AnalyticsMetrics, Record<string, unknown>>;
|
|
146
|
+
updatedAt: BaseScalarFieldDef<AnalyticsMetrics, AnalyticsMetrics, Record<string, unknown>>;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
export declare class SearchResultRepository extends BaseUnionRepository<SearchResult, SearchResult> {
|
|
150
|
+
namespace: string;
|
|
151
|
+
typeName: string;
|
|
152
|
+
get possibleTypes(): {
|
|
153
|
+
User: UserRepository;
|
|
154
|
+
Admin: AdminRepository;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
export declare class HumanRepository extends IdentifiableGraphQLTypeRepository<Human, any, {
|
|
158
|
+
id: string;
|
|
159
|
+
}> {
|
|
160
|
+
readonly namespace = "test";
|
|
161
|
+
readonly typeName = "Human";
|
|
162
|
+
implementedInterfaces: string[];
|
|
163
|
+
cacheControl: {
|
|
164
|
+
readonly type: "max-age";
|
|
165
|
+
readonly maxAge: 100;
|
|
166
|
+
readonly generatedTime: 0;
|
|
167
|
+
};
|
|
168
|
+
buildKeyParams(input: WriteInput<Human, GraphQLInputExtension>): {
|
|
169
|
+
id: string;
|
|
170
|
+
};
|
|
171
|
+
get fields(): {
|
|
172
|
+
__typename: BaseScalarFieldDef<Human, Human, Record<string, unknown>>;
|
|
173
|
+
id: BaseScalarFieldDef<Human, Human, Record<string, unknown>>;
|
|
174
|
+
name: BaseScalarFieldDef<Human, Human, Record<string, unknown>>;
|
|
175
|
+
homePlanet: BaseScalarFieldDef<Human, Human, Record<string, unknown>>;
|
|
176
|
+
lightsaberColor: BaseScalarFieldDef<Human, Human, Record<string, unknown>>;
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
export declare class DroidRepository extends IdentifiableGraphQLTypeRepository<Droid, any, {
|
|
180
|
+
id: string;
|
|
181
|
+
}> {
|
|
182
|
+
readonly namespace = "test";
|
|
183
|
+
readonly typeName = "Droid";
|
|
184
|
+
implementedInterfaces: string[];
|
|
185
|
+
cacheControl: {
|
|
186
|
+
readonly type: "max-age";
|
|
187
|
+
readonly maxAge: 100;
|
|
188
|
+
readonly generatedTime: 0;
|
|
189
|
+
};
|
|
190
|
+
buildKeyParams(input: WriteInput<Droid, GraphQLInputExtension>): {
|
|
191
|
+
id: string;
|
|
192
|
+
};
|
|
193
|
+
fields: {
|
|
194
|
+
__typename: BaseScalarFieldDef<Droid, Droid, Record<string, unknown>>;
|
|
195
|
+
id: BaseScalarFieldDef<Droid, Droid, Record<string, unknown>>;
|
|
196
|
+
name: BaseScalarFieldDef<Droid, Droid, Record<string, unknown>>;
|
|
197
|
+
primaryFunction: BaseScalarFieldDef<Droid, Droid, Record<string, unknown>>;
|
|
198
|
+
isR2D2: BaseScalarFieldDef<Droid, Droid, Record<string, unknown>>;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
declare class CharacterRepository extends BaseInterfaceRepository<Character, Character> {
|
|
202
|
+
namespace: string;
|
|
203
|
+
typeName: string;
|
|
204
|
+
implementedInterfaces: never[];
|
|
205
|
+
cacheControl: {
|
|
206
|
+
readonly type: "max-age";
|
|
207
|
+
readonly maxAge: 100;
|
|
208
|
+
};
|
|
209
|
+
get fields(): {
|
|
210
|
+
__typename: BaseScalarFieldDef<Character, Character, Record<string, unknown>>;
|
|
211
|
+
id: BaseScalarFieldDef<Character, Character, Record<string, unknown>>;
|
|
212
|
+
name: BaseScalarFieldDef<Character, Character, Record<string, unknown>>;
|
|
213
|
+
};
|
|
214
|
+
get possibleTypes(): {
|
|
215
|
+
Human: HumanRepository;
|
|
216
|
+
Droid: DroidRepository;
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
export type TimeRange = {
|
|
220
|
+
start: string;
|
|
221
|
+
end: string;
|
|
222
|
+
createdAt: string;
|
|
223
|
+
updatedAt: string;
|
|
224
|
+
};
|
|
225
|
+
export declare class TimeRangeRepository extends UnidentifiableGraphQLTypeRepository<TimeRange, TimeRange> {
|
|
226
|
+
namespace: string;
|
|
227
|
+
typeName: string;
|
|
228
|
+
implementedInterfaces: never[];
|
|
229
|
+
cacheControl: {
|
|
230
|
+
readonly type: "max-age";
|
|
231
|
+
readonly maxAge: 100;
|
|
232
|
+
readonly generatedTime: 0;
|
|
233
|
+
};
|
|
234
|
+
fields: {
|
|
235
|
+
start: BaseScalarFieldDef<TimeRange, TimeRange, Record<string, unknown>>;
|
|
236
|
+
end: BaseScalarFieldDef<TimeRange, TimeRange, Record<string, unknown>>;
|
|
237
|
+
createdAt: BaseScalarFieldDef<TimeRange, TimeRange, Record<string, unknown>>;
|
|
238
|
+
updatedAt: BaseScalarFieldDef<TimeRange, TimeRange, Record<string, unknown>>;
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
export type AnalyticsData = {
|
|
242
|
+
pageViews: number;
|
|
243
|
+
uniqueVisitors: number;
|
|
244
|
+
metrics: AnalyticsMetrics;
|
|
245
|
+
timeRange: TimeRange;
|
|
246
|
+
createdAt: string;
|
|
247
|
+
updatedAt: string;
|
|
248
|
+
};
|
|
249
|
+
export declare class AnalyticsDataRepository extends UnidentifiableGraphQLTypeRepository<AnalyticsData, AnalyticsData> {
|
|
250
|
+
namespace: string;
|
|
251
|
+
typeName: string;
|
|
252
|
+
implementedInterfaces: never[];
|
|
253
|
+
cacheControl: {
|
|
254
|
+
readonly type: "max-age";
|
|
255
|
+
readonly maxAge: 100;
|
|
256
|
+
readonly generatedTime: 0;
|
|
257
|
+
};
|
|
258
|
+
get fields(): {
|
|
259
|
+
pageViews: BaseScalarFieldDef<AnalyticsData, AnalyticsData, Record<string, unknown>>;
|
|
260
|
+
uniqueVisitors: BaseScalarFieldDef<AnalyticsData, AnalyticsData, Record<string, unknown>>;
|
|
261
|
+
metrics: BaseObjectFieldDef<AnalyticsMetrics, AnalyticsMetrics, Record<string, unknown>>;
|
|
262
|
+
timeRange: BaseObjectFieldDef<TimeRange, TimeRange, Record<string, unknown>>;
|
|
263
|
+
createdAt: BaseScalarFieldDef<AnalyticsData, AnalyticsData, Record<string, unknown>>;
|
|
264
|
+
updatedAt: BaseScalarFieldDef<AnalyticsData, AnalyticsData, Record<string, unknown>>;
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
export declare class TestGraphQLTypeRootRepository extends GraphQLDocumentRootTypeRepository<GraphQLData, GraphQLData> {
|
|
268
|
+
readonly namespace = "Test";
|
|
269
|
+
readonly typeName = "Root";
|
|
270
|
+
cacheControl: {
|
|
271
|
+
readonly type: "max-age";
|
|
272
|
+
readonly maxAge: 100;
|
|
273
|
+
readonly generatedTime: 0;
|
|
274
|
+
};
|
|
275
|
+
get fields(): {
|
|
276
|
+
user: BaseObjectFieldDef<Record<string, any>, Record<string, any>, Record<string, unknown>>;
|
|
277
|
+
settings: BaseObjectFieldDef<Record<string, any>, Record<string, any>, Record<string, unknown>>;
|
|
278
|
+
analytics: BaseObjectFieldDef<Record<string, any>, Record<string, any>, Record<string, unknown>>;
|
|
279
|
+
searchResult: BaseObjectFieldDef<SearchResult, SearchResult, Record<string, unknown>>;
|
|
280
|
+
character: BaseObjectFieldDef<Record<string, any>, Record<string, any>, Record<string, unknown>>;
|
|
281
|
+
friends: BaseObjectFieldDef<Record<string, any>, Record<string, any>, Record<string, unknown>>;
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
export declare class UserRepository extends IdentifiableGraphQLTypeRepository<User, any, {
|
|
285
|
+
id: string;
|
|
286
|
+
}> {
|
|
287
|
+
namespace: string;
|
|
288
|
+
typeName: string;
|
|
289
|
+
implementedInterfaces: never[];
|
|
290
|
+
cacheControl: {
|
|
291
|
+
readonly type: "max-age";
|
|
292
|
+
readonly maxAge: 100;
|
|
293
|
+
readonly generatedTime: 0;
|
|
294
|
+
};
|
|
295
|
+
buildKeyParams(input: WriteInput<User, GraphQLInputExtension>): {
|
|
296
|
+
id: string;
|
|
297
|
+
};
|
|
298
|
+
get fields(): {
|
|
299
|
+
id: BaseScalarFieldDef<User, User, Record<string, unknown>>;
|
|
300
|
+
name: BaseScalarFieldDef<User, User, Record<string, unknown>>;
|
|
301
|
+
email: BaseScalarFieldDef<User, User, Record<string, unknown>>;
|
|
302
|
+
tags: BaseArrayFieldDef<User, User, Record<string, unknown>>;
|
|
303
|
+
scores: BaseArrayFieldDef<User, User, Record<string, unknown>>;
|
|
304
|
+
posts: BaseArrayFieldDef<Post, Post, Record<string, unknown>>;
|
|
305
|
+
createdAt: BaseScalarFieldDef<User, User, Record<string, unknown>>;
|
|
306
|
+
updatedAt: BaseScalarFieldDef<User, User, Record<string, unknown>>;
|
|
307
|
+
__typename: BaseScalarFieldDef<User, User, Record<string, unknown>>;
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
export declare class AdminRepository extends IdentifiableGraphQLTypeRepository<User, any, {
|
|
311
|
+
id: string;
|
|
312
|
+
}> {
|
|
313
|
+
namespace: string;
|
|
314
|
+
typeName: string;
|
|
315
|
+
implementedInterfaces: never[];
|
|
316
|
+
cacheControl: {
|
|
317
|
+
readonly type: "max-age";
|
|
318
|
+
readonly maxAge: 100;
|
|
319
|
+
readonly generatedTime: 0;
|
|
320
|
+
};
|
|
321
|
+
buildKeyParams(input: WriteInput<User, GraphQLInputExtension>): {
|
|
322
|
+
id: string;
|
|
323
|
+
};
|
|
324
|
+
get fields(): {
|
|
325
|
+
id: BaseScalarFieldDef<User, User, Record<string, unknown>>;
|
|
326
|
+
name: BaseScalarFieldDef<User, User, Record<string, unknown>>;
|
|
327
|
+
email: BaseScalarFieldDef<User, User, Record<string, unknown>>;
|
|
328
|
+
tags: BaseArrayFieldDef<User, User, Record<string, unknown>>;
|
|
329
|
+
scores: BaseArrayFieldDef<User, User, Record<string, unknown>>;
|
|
330
|
+
posts: BaseArrayFieldDef<Post, Post, Record<string, unknown>>;
|
|
331
|
+
createdAt: BaseScalarFieldDef<User, User, Record<string, unknown>>;
|
|
332
|
+
updatedAt: BaseScalarFieldDef<User, User, Record<string, unknown>>;
|
|
333
|
+
permissionLevel: BaseScalarFieldDef<User, User, Record<string, unknown>>;
|
|
334
|
+
__typename: BaseScalarFieldDef<User, User, Record<string, unknown>>;
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
export declare class PostRepository extends IdentifiableGraphQLTypeRepository<Post, Post, {
|
|
338
|
+
id: string;
|
|
339
|
+
}> {
|
|
340
|
+
namespace: string;
|
|
341
|
+
typeName: string;
|
|
342
|
+
implementedInterfaces: never[];
|
|
343
|
+
cacheControl: {
|
|
344
|
+
readonly type: "max-age";
|
|
345
|
+
readonly maxAge: 100;
|
|
346
|
+
readonly generatedTime: 0;
|
|
347
|
+
};
|
|
348
|
+
fields: {
|
|
349
|
+
id: BaseScalarFieldDef<Post, Post, Record<string, unknown>>;
|
|
350
|
+
title: BaseScalarFieldDef<Post, Post, Record<string, unknown>>;
|
|
351
|
+
content: BaseScalarFieldDef<Post, Post, Record<string, unknown>>;
|
|
352
|
+
createdAt: BaseScalarFieldDef<Post, Post, Record<string, unknown>>;
|
|
353
|
+
updatedAt: BaseScalarFieldDef<Post, Post, Record<string, unknown>>;
|
|
354
|
+
__typename: BaseScalarFieldDef<Post, Post, Record<string, unknown>>;
|
|
355
|
+
};
|
|
356
|
+
buildKeyParams(input: WriteInput<Post, GraphQLInputExtension>): {
|
|
357
|
+
id: string;
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
export declare class TestAuraNormalizedCacheControlCommand extends AuraNormalizedCacheControlCommand<TestGraphQLTypeRootRepository, DataOf<TestGraphQLTypeRootRepository>, GraphQLResponse> {
|
|
361
|
+
endpoint: string;
|
|
362
|
+
config: {
|
|
363
|
+
query: string;
|
|
364
|
+
variables: Record<string, unknown>;
|
|
365
|
+
};
|
|
366
|
+
get auraParams(): {
|
|
367
|
+
query: string;
|
|
368
|
+
variables: Record<string, unknown>;
|
|
369
|
+
};
|
|
370
|
+
constructor(services: NamedCacheControllerService & NamedPubSubService & NamedAuraNetworkService);
|
|
371
|
+
buildResultType(): TestGraphQLTypeRootRepository;
|
|
372
|
+
buildQuery(): {
|
|
373
|
+
selections: SelectionNode[];
|
|
374
|
+
request: {
|
|
375
|
+
definitions: {
|
|
376
|
+
variables: GraphQLVariables;
|
|
377
|
+
fragments: GraphQLFragmentDefinitions;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
parentFieldSelection: import("@conduit-client/onestore-graphql-parser/v1").FieldNode | undefined;
|
|
381
|
+
type: string;
|
|
382
|
+
keyParams: null;
|
|
383
|
+
};
|
|
384
|
+
requestFromNetwork(): SyncOrAsync<Result<GraphQLResponse, Error>>;
|
|
385
|
+
handleCacheControllerResult(result: Result<void, Error>, requestRunner: any): PromiseLike<any>;
|
|
386
|
+
protected cacheControlStrategyConfig: CacheControlStrategyConfig;
|
|
387
|
+
buildWriteInput(data: GraphQLResponse): WriteInput<GraphQLData, GraphQLInputExtension>;
|
|
388
|
+
buildGraphQLExtension(): GraphQLInputExtension;
|
|
389
|
+
}
|
|
390
|
+
export declare const userProfileQuery = "\n query GetUserProfile($userId: ID!) {\n user(id: $userId) {\n id\n name\n email\n tags\n scores\n posts {\n id\n title\n content\n createdAt\n updatedAt\n }\n createdAt\n updatedAt\n ... on Node {\n __typename\n }\n }\n }\n";
|
|
391
|
+
export declare const variables: Record<string, unknown>;
|
|
392
|
+
export declare const settingsData: {
|
|
393
|
+
theme: string;
|
|
394
|
+
notifications: {
|
|
395
|
+
email: boolean;
|
|
396
|
+
push: boolean;
|
|
397
|
+
createdAt: string;
|
|
398
|
+
updatedAt: string;
|
|
399
|
+
};
|
|
400
|
+
preferences: {
|
|
401
|
+
language: string;
|
|
402
|
+
timezone: string;
|
|
403
|
+
createdAt: string;
|
|
404
|
+
updatedAt: string;
|
|
405
|
+
};
|
|
406
|
+
createdAt: string;
|
|
407
|
+
updatedAt: string;
|
|
408
|
+
};
|
|
409
|
+
export declare const analyticsData: {
|
|
410
|
+
pageViews: number;
|
|
411
|
+
uniqueVisitors: number;
|
|
412
|
+
metrics: {
|
|
413
|
+
averageTimeOnSite: number;
|
|
414
|
+
bounceRate: number;
|
|
415
|
+
createdAt: string;
|
|
416
|
+
updatedAt: string;
|
|
417
|
+
};
|
|
418
|
+
timeRange: {
|
|
419
|
+
start: string;
|
|
420
|
+
end: string;
|
|
421
|
+
createdAt: string;
|
|
422
|
+
updatedAt: string;
|
|
423
|
+
};
|
|
424
|
+
createdAt: string;
|
|
425
|
+
updatedAt: string;
|
|
426
|
+
};
|
|
427
|
+
export declare const postData: {
|
|
428
|
+
id: string;
|
|
429
|
+
title: string;
|
|
430
|
+
content: string;
|
|
431
|
+
createdAt: string;
|
|
432
|
+
updatedAt: string;
|
|
433
|
+
}[];
|
|
434
|
+
export declare const userData: {
|
|
435
|
+
id: string;
|
|
436
|
+
name: string;
|
|
437
|
+
email: null;
|
|
438
|
+
tags: string[];
|
|
439
|
+
scores: number[];
|
|
440
|
+
posts: {
|
|
441
|
+
id: string;
|
|
442
|
+
title: string;
|
|
443
|
+
content: string;
|
|
444
|
+
createdAt: string;
|
|
445
|
+
updatedAt: string;
|
|
446
|
+
}[];
|
|
447
|
+
createdAt: string;
|
|
448
|
+
updatedAt: string;
|
|
449
|
+
__typename: string;
|
|
450
|
+
};
|
|
451
|
+
export declare const userDataWithAliasedTypename: {
|
|
452
|
+
id: string;
|
|
453
|
+
name: string;
|
|
454
|
+
email: null;
|
|
455
|
+
tags: string[];
|
|
456
|
+
scores: number[];
|
|
457
|
+
posts: {
|
|
458
|
+
id: string;
|
|
459
|
+
title: string;
|
|
460
|
+
content: string;
|
|
461
|
+
createdAt: string;
|
|
462
|
+
updatedAt: string;
|
|
463
|
+
}[];
|
|
464
|
+
createdAt: string;
|
|
465
|
+
updatedAt: string;
|
|
466
|
+
discriminator: string;
|
|
467
|
+
};
|
|
468
|
+
export declare const humanData: {
|
|
469
|
+
id: string;
|
|
470
|
+
name: string;
|
|
471
|
+
homePlanet: string;
|
|
472
|
+
lightsaberColor: null;
|
|
473
|
+
__typename: string;
|
|
474
|
+
};
|
|
475
|
+
export declare const droidData: {
|
|
476
|
+
id: string;
|
|
477
|
+
name: string;
|
|
478
|
+
primaryFunction: string;
|
|
479
|
+
isR2D2: boolean;
|
|
480
|
+
__typename: string;
|
|
481
|
+
};
|
|
482
|
+
export declare const droidDataWithAliasedTypename: {
|
|
483
|
+
id: string;
|
|
484
|
+
name: string;
|
|
485
|
+
primaryFunction: string;
|
|
486
|
+
isR2D2: boolean;
|
|
487
|
+
type: string;
|
|
488
|
+
};
|
|
489
|
+
export declare const adminData: {
|
|
490
|
+
id: string;
|
|
491
|
+
name: string;
|
|
492
|
+
email: null;
|
|
493
|
+
tags: string[];
|
|
494
|
+
scores: number[];
|
|
495
|
+
posts: {
|
|
496
|
+
id: string;
|
|
497
|
+
title: string;
|
|
498
|
+
content: string;
|
|
499
|
+
createdAt: string;
|
|
500
|
+
updatedAt: string;
|
|
501
|
+
}[];
|
|
502
|
+
createdAt: string;
|
|
503
|
+
updatedAt: string;
|
|
504
|
+
permissionLevel: number;
|
|
505
|
+
__typename: string;
|
|
506
|
+
};
|
|
507
|
+
export declare const responseData: {
|
|
508
|
+
data: {
|
|
509
|
+
user: {
|
|
510
|
+
id: string;
|
|
511
|
+
name: string;
|
|
512
|
+
email: null;
|
|
513
|
+
tags: string[];
|
|
514
|
+
scores: number[];
|
|
515
|
+
posts: {
|
|
516
|
+
id: string;
|
|
517
|
+
title: string;
|
|
518
|
+
content: string;
|
|
519
|
+
createdAt: string;
|
|
520
|
+
updatedAt: string;
|
|
521
|
+
}[];
|
|
522
|
+
createdAt: string;
|
|
523
|
+
updatedAt: string;
|
|
524
|
+
__typename: string;
|
|
525
|
+
};
|
|
526
|
+
settings: {
|
|
527
|
+
theme: string;
|
|
528
|
+
notifications: {
|
|
529
|
+
email: boolean;
|
|
530
|
+
push: boolean;
|
|
531
|
+
createdAt: string;
|
|
532
|
+
updatedAt: string;
|
|
533
|
+
};
|
|
534
|
+
preferences: {
|
|
535
|
+
language: string;
|
|
536
|
+
timezone: string;
|
|
537
|
+
createdAt: string;
|
|
538
|
+
updatedAt: string;
|
|
539
|
+
};
|
|
540
|
+
createdAt: string;
|
|
541
|
+
updatedAt: string;
|
|
542
|
+
};
|
|
543
|
+
analytics: {
|
|
544
|
+
pageViews: number;
|
|
545
|
+
uniqueVisitors: number;
|
|
546
|
+
metrics: {
|
|
547
|
+
averageTimeOnSite: number;
|
|
548
|
+
bounceRate: number;
|
|
549
|
+
createdAt: string;
|
|
550
|
+
updatedAt: string;
|
|
551
|
+
};
|
|
552
|
+
timeRange: {
|
|
553
|
+
start: string;
|
|
554
|
+
end: string;
|
|
555
|
+
createdAt: string;
|
|
556
|
+
updatedAt: string;
|
|
557
|
+
};
|
|
558
|
+
createdAt: string;
|
|
559
|
+
updatedAt: string;
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
errors: never[];
|
|
563
|
+
};
|
|
564
|
+
export type TestServices = NamedCacheControllerService & NamedPubSubService & NamedAuraNetworkService & NamedCacheService;
|
|
565
|
+
export declare function buildTestServices(): TestServices;
|
|
566
|
+
/**
|
|
567
|
+
* Represents a GraphQL Edge type containing a cursor and node
|
|
568
|
+
*/
|
|
569
|
+
export type UserEdge = {
|
|
570
|
+
cursor: string;
|
|
571
|
+
node: User;
|
|
572
|
+
weight?: number | null;
|
|
573
|
+
};
|
|
574
|
+
/**
|
|
575
|
+
* Repository for UserEdge type - wraps the UserRepository for the node field
|
|
576
|
+
*/
|
|
577
|
+
export declare class UserEdgeRepository extends UnidentifiableGraphQLTypeRepository<UserEdge, UserEdge> {
|
|
578
|
+
namespace: string;
|
|
579
|
+
typeName: string;
|
|
580
|
+
implementedInterfaces: never[];
|
|
581
|
+
cacheControl: {
|
|
582
|
+
readonly type: "max-age";
|
|
583
|
+
readonly maxAge: 100;
|
|
584
|
+
readonly generatedTime: 0;
|
|
585
|
+
};
|
|
586
|
+
get fields(): {
|
|
587
|
+
cursor: BaseScalarFieldDef<UserEdge, UserEdge, Record<string, unknown>>;
|
|
588
|
+
node: BaseObjectFieldDef<User, any, Record<string, unknown>>;
|
|
589
|
+
weight: BaseScalarFieldDef<UserEdge, UserEdge, Record<string, unknown>>;
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Represents a GraphQL PageInfo type with pagination metadata
|
|
594
|
+
*/
|
|
595
|
+
export type PageInfo = {
|
|
596
|
+
hasNextPage: boolean;
|
|
597
|
+
hasPreviousPage: boolean;
|
|
598
|
+
startCursor?: string | null;
|
|
599
|
+
endCursor?: string | null;
|
|
600
|
+
};
|
|
601
|
+
/**
|
|
602
|
+
* Repository for PageInfo type - handles connection pagination metadata
|
|
603
|
+
*/
|
|
604
|
+
export declare class PageInfoRepository extends UnidentifiableGraphQLTypeRepository<PageInfo, PageInfo> {
|
|
605
|
+
namespace: string;
|
|
606
|
+
typeName: string;
|
|
607
|
+
implementedInterfaces: never[];
|
|
608
|
+
cacheControl: {
|
|
609
|
+
readonly type: "max-age";
|
|
610
|
+
readonly maxAge: 100;
|
|
611
|
+
readonly generatedTime: 0;
|
|
612
|
+
};
|
|
613
|
+
fields: {
|
|
614
|
+
hasNextPage: BaseScalarFieldDef<PageInfo, PageInfo, Record<string, unknown>>;
|
|
615
|
+
hasPreviousPage: BaseScalarFieldDef<PageInfo, PageInfo, Record<string, unknown>>;
|
|
616
|
+
startCursor: BaseScalarFieldDef<PageInfo, PageInfo, Record<string, unknown>>;
|
|
617
|
+
endCursor: BaseScalarFieldDef<PageInfo, PageInfo, Record<string, unknown>>;
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
export type FriendsConnection = {
|
|
621
|
+
edges: UserEdge[];
|
|
622
|
+
pageInfo: PageInfo;
|
|
623
|
+
totalCount: number;
|
|
624
|
+
};
|
|
625
|
+
export declare class FriendsConnectionRepository extends CursorConnectionGraphQLTypeRepository<PaginatedResponse, ConnectionNormalizedData, GraphQLInputExtension> {
|
|
626
|
+
implementedInterfaces: never[];
|
|
627
|
+
namespace: string;
|
|
628
|
+
typeName: string;
|
|
629
|
+
cacheControl: {
|
|
630
|
+
readonly type: "max-age";
|
|
631
|
+
readonly maxAge: 60;
|
|
632
|
+
};
|
|
633
|
+
defaultPageSize: number;
|
|
634
|
+
get fields(): {
|
|
635
|
+
edges: BaseArrayFieldDef<any, any, Record<string, unknown>>;
|
|
636
|
+
totalCount: BaseScalarFieldDef<any, any, Record<string, unknown>>;
|
|
637
|
+
pageInfo: BaseObjectFieldDef<any, any, Record<string, unknown>>;
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
export declare const TypeRepositoryRegistry: {
|
|
641
|
+
NotificationSettings: NotificationSettingsRepository;
|
|
642
|
+
UserPreferences: UserPreferencesRepository;
|
|
643
|
+
UserSettings: UserSettingsRepository;
|
|
644
|
+
AnalyticsMetrics: AnalyticsMetricsRepository;
|
|
645
|
+
SearchResult: SearchResultRepository;
|
|
646
|
+
Human: HumanRepository;
|
|
647
|
+
Droid: DroidRepository;
|
|
648
|
+
Character: CharacterRepository;
|
|
649
|
+
TimeRange: TimeRangeRepository;
|
|
650
|
+
AnalyticsData: AnalyticsDataRepository;
|
|
651
|
+
User: UserRepository;
|
|
652
|
+
Admin: AdminRepository;
|
|
653
|
+
Post: PostRepository;
|
|
654
|
+
UnionResult: SearchResultRepository;
|
|
655
|
+
UserEdge: UserEdgeRepository;
|
|
656
|
+
PageInfo: PageInfoRepository;
|
|
657
|
+
FriendsConnection: FriendsConnectionRepository;
|
|
658
|
+
};
|
|
659
|
+
/**
|
|
660
|
+
* Creates a mock User with default values, allowing specific overrides
|
|
661
|
+
*/
|
|
662
|
+
export declare function createMockUser(id: string, overrides?: Partial<User>): User;
|
|
663
|
+
/**
|
|
664
|
+
* Creates multiple mock users with sequential IDs
|
|
665
|
+
*/
|
|
666
|
+
export declare function createMockUsers(count: number, prefix?: string): User[];
|
|
667
|
+
/**
|
|
668
|
+
* Creates multiple mock users with a specific starting ID number (useful for pagination tests)
|
|
669
|
+
*/
|
|
670
|
+
export declare function createMockUsersWithOffset(count: number, startId: number, prefix?: string): User[];
|
|
671
|
+
/**
|
|
672
|
+
* Converts users to GraphQL edges with sequential cursors
|
|
673
|
+
*/
|
|
674
|
+
export declare function createEdgesFromUsers(users: User[], cursorPrefix?: string, cursorOffset?: number): Array<{
|
|
675
|
+
cursor: string;
|
|
676
|
+
node: User;
|
|
677
|
+
weight?: number | null;
|
|
678
|
+
}>;
|
|
679
|
+
/**
|
|
680
|
+
* Creates a complete friends connection response with sensible defaults
|
|
681
|
+
*/
|
|
682
|
+
export declare function createFriendsConnectionResponse(options: {
|
|
683
|
+
users: User[];
|
|
684
|
+
cursorPrefix?: string;
|
|
685
|
+
cursorOffset?: number;
|
|
686
|
+
totalCount?: number;
|
|
687
|
+
hasNextPage?: boolean;
|
|
688
|
+
hasPreviousPage?: boolean;
|
|
689
|
+
startCursor?: string;
|
|
690
|
+
endCursor?: string;
|
|
691
|
+
}): {
|
|
692
|
+
__typename: string;
|
|
693
|
+
totalCount: number;
|
|
694
|
+
edges: {
|
|
695
|
+
cursor: string;
|
|
696
|
+
node: User;
|
|
697
|
+
weight?: number | null;
|
|
698
|
+
}[];
|
|
699
|
+
pageInfo: {
|
|
700
|
+
hasNextPage: boolean;
|
|
701
|
+
hasPreviousPage: boolean;
|
|
702
|
+
startCursor: string | null;
|
|
703
|
+
endCursor: string | null;
|
|
704
|
+
};
|
|
705
|
+
};
|
|
706
|
+
/**
|
|
707
|
+
* Creates a mock network service that returns the specified friends connection data
|
|
708
|
+
*/
|
|
709
|
+
export declare function createMockNetworkService(responseData: any): () => Promise<{
|
|
710
|
+
getReturnValue: () => {
|
|
711
|
+
data: {
|
|
712
|
+
friends: any;
|
|
713
|
+
};
|
|
714
|
+
errors: never[];
|
|
715
|
+
};
|
|
716
|
+
}>;
|
|
717
|
+
/**
|
|
718
|
+
* Creates a network service that throws an error (for testing cache-only scenarios)
|
|
719
|
+
*/
|
|
720
|
+
export declare function createFailingNetworkService(): () => never;
|
|
721
|
+
export {};
|