@effect-gql/federation 0.1.0 → 1.0.0
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/README.md +100 -0
- package/index.cjs +618 -0
- package/index.cjs.map +1 -0
- package/index.d.cts +577 -0
- package/index.d.ts +577 -0
- package/index.js +570 -0
- package/index.js.map +1 -0
- package/package.json +14 -27
- package/dist/directives.d.ts +0 -136
- package/dist/directives.d.ts.map +0 -1
- package/dist/directives.js +0 -171
- package/dist/directives.js.map +0 -1
- package/dist/entities.d.ts +0 -31
- package/dist/entities.d.ts.map +0 -1
- package/dist/entities.js +0 -76
- package/dist/entities.js.map +0 -1
- package/dist/federated-builder.d.ts +0 -182
- package/dist/federated-builder.d.ts.map +0 -1
- package/dist/federated-builder.js +0 -442
- package/dist/federated-builder.js.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -40
- package/dist/index.js.map +0 -1
- package/dist/pipe-api.d.ts +0 -163
- package/dist/pipe-api.d.ts.map +0 -1
- package/dist/pipe-api.js +0 -127
- package/dist/pipe-api.js.map +0 -1
- package/dist/scalars.d.ts +0 -12
- package/dist/scalars.d.ts.map +0 -1
- package/dist/scalars.js +0 -59
- package/dist/scalars.js.map +0 -1
- package/dist/types.d.ts +0 -89
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -41
- package/dist/types.js.map +0 -1
- package/src/directives.ts +0 -170
- package/src/entities.ts +0 -90
- package/src/federated-builder.ts +0 -593
- package/src/index.ts +0 -47
- package/src/pipe-api.ts +0 -263
- package/src/scalars.ts +0 -59
- package/src/types.ts +0 -114
package/dist/index.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FieldSetScalar = exports.AnyScalar = exports.overrideField = exports.providesField = exports.requiresField = exports.externalField = exports.field = exports.inputType = exports.unionType = exports.enumType = exports.interfaceType = exports.objectType = exports.subscription = exports.mutation = exports.query = exports.entity = exports.override = exports.provides = exports.requires = exports.external = exports.tag = exports.interfaceObject = exports.inaccessible = exports.shareable = exports.key = exports.toDirectiveApplication = exports.FederatedSchemaBuilder = void 0;
|
|
4
|
-
// Core builder
|
|
5
|
-
var federated_builder_1 = require("./federated-builder");
|
|
6
|
-
Object.defineProperty(exports, "FederatedSchemaBuilder", { enumerable: true, get: function () { return federated_builder_1.FederatedSchemaBuilder; } });
|
|
7
|
-
var types_1 = require("./types");
|
|
8
|
-
Object.defineProperty(exports, "toDirectiveApplication", { enumerable: true, get: function () { return types_1.toDirectiveApplication; } });
|
|
9
|
-
// Directive factories
|
|
10
|
-
var directives_1 = require("./directives");
|
|
11
|
-
Object.defineProperty(exports, "key", { enumerable: true, get: function () { return directives_1.key; } });
|
|
12
|
-
Object.defineProperty(exports, "shareable", { enumerable: true, get: function () { return directives_1.shareable; } });
|
|
13
|
-
Object.defineProperty(exports, "inaccessible", { enumerable: true, get: function () { return directives_1.inaccessible; } });
|
|
14
|
-
Object.defineProperty(exports, "interfaceObject", { enumerable: true, get: function () { return directives_1.interfaceObject; } });
|
|
15
|
-
Object.defineProperty(exports, "tag", { enumerable: true, get: function () { return directives_1.tag; } });
|
|
16
|
-
Object.defineProperty(exports, "external", { enumerable: true, get: function () { return directives_1.external; } });
|
|
17
|
-
Object.defineProperty(exports, "requires", { enumerable: true, get: function () { return directives_1.requires; } });
|
|
18
|
-
Object.defineProperty(exports, "provides", { enumerable: true, get: function () { return directives_1.provides; } });
|
|
19
|
-
Object.defineProperty(exports, "override", { enumerable: true, get: function () { return directives_1.override; } });
|
|
20
|
-
// Pipe-able API
|
|
21
|
-
var pipe_api_1 = require("./pipe-api");
|
|
22
|
-
Object.defineProperty(exports, "entity", { enumerable: true, get: function () { return pipe_api_1.entity; } });
|
|
23
|
-
Object.defineProperty(exports, "query", { enumerable: true, get: function () { return pipe_api_1.query; } });
|
|
24
|
-
Object.defineProperty(exports, "mutation", { enumerable: true, get: function () { return pipe_api_1.mutation; } });
|
|
25
|
-
Object.defineProperty(exports, "subscription", { enumerable: true, get: function () { return pipe_api_1.subscription; } });
|
|
26
|
-
Object.defineProperty(exports, "objectType", { enumerable: true, get: function () { return pipe_api_1.objectType; } });
|
|
27
|
-
Object.defineProperty(exports, "interfaceType", { enumerable: true, get: function () { return pipe_api_1.interfaceType; } });
|
|
28
|
-
Object.defineProperty(exports, "enumType", { enumerable: true, get: function () { return pipe_api_1.enumType; } });
|
|
29
|
-
Object.defineProperty(exports, "unionType", { enumerable: true, get: function () { return pipe_api_1.unionType; } });
|
|
30
|
-
Object.defineProperty(exports, "inputType", { enumerable: true, get: function () { return pipe_api_1.inputType; } });
|
|
31
|
-
Object.defineProperty(exports, "field", { enumerable: true, get: function () { return pipe_api_1.field; } });
|
|
32
|
-
Object.defineProperty(exports, "externalField", { enumerable: true, get: function () { return pipe_api_1.externalField; } });
|
|
33
|
-
Object.defineProperty(exports, "requiresField", { enumerable: true, get: function () { return pipe_api_1.requiresField; } });
|
|
34
|
-
Object.defineProperty(exports, "providesField", { enumerable: true, get: function () { return pipe_api_1.providesField; } });
|
|
35
|
-
Object.defineProperty(exports, "overrideField", { enumerable: true, get: function () { return pipe_api_1.overrideField; } });
|
|
36
|
-
// Federation scalars (for advanced usage)
|
|
37
|
-
var scalars_1 = require("./scalars");
|
|
38
|
-
Object.defineProperty(exports, "AnyScalar", { enumerable: true, get: function () { return scalars_1.AnyScalar; } });
|
|
39
|
-
Object.defineProperty(exports, "FieldSetScalar", { enumerable: true, get: function () { return scalars_1.FieldSetScalar; } });
|
|
40
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,eAAe;AACf,yDAA4D;AAAnD,2HAAA,sBAAsB,OAAA;AAW/B,iCAAgD;AAAvC,+GAAA,sBAAsB,OAAA;AAE/B,sBAAsB;AACtB,2CAUqB;AATnB,iGAAA,GAAG,OAAA;AACH,uGAAA,SAAS,OAAA;AACT,0GAAA,YAAY,OAAA;AACZ,6GAAA,eAAe,OAAA;AACf,iGAAA,GAAG,OAAA;AACH,sGAAA,QAAQ,OAAA;AACR,sGAAA,QAAQ,OAAA;AACR,sGAAA,QAAQ,OAAA;AACR,sGAAA,QAAQ,OAAA;AAGV,gBAAgB;AAChB,uCAemB;AAdjB,kGAAA,MAAM,OAAA;AACN,iGAAA,KAAK,OAAA;AACL,oGAAA,QAAQ,OAAA;AACR,wGAAA,YAAY,OAAA;AACZ,sGAAA,UAAU,OAAA;AACV,yGAAA,aAAa,OAAA;AACb,oGAAA,QAAQ,OAAA;AACR,qGAAA,SAAS,OAAA;AACT,qGAAA,SAAS,OAAA;AACT,iGAAA,KAAK,OAAA;AACL,yGAAA,aAAa,OAAA;AACb,yGAAA,aAAa,OAAA;AACb,yGAAA,aAAa,OAAA;AACb,yGAAA,aAAa,OAAA;AAGf,0CAA0C;AAC1C,qCAAqD;AAA5C,oGAAA,SAAS,OAAA;AAAE,yGAAA,cAAc,OAAA"}
|
package/dist/pipe-api.d.ts
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import * as S from "effect/Schema";
|
|
3
|
-
import type { DirectiveApplication } from "@effect-gql/core";
|
|
4
|
-
import { FederatedSchemaBuilder } from "./federated-builder";
|
|
5
|
-
import type { EntityRegistration } from "./types";
|
|
6
|
-
/**
|
|
7
|
-
* Register an entity type with @key directive(s) and reference resolver.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* FederatedSchemaBuilder.empty.pipe(
|
|
12
|
-
* entity({
|
|
13
|
-
* name: "User",
|
|
14
|
-
* schema: UserSchema,
|
|
15
|
-
* keys: [key({ fields: "id" })],
|
|
16
|
-
* resolveReference: (ref) => UserService.findById(ref.id),
|
|
17
|
-
* }),
|
|
18
|
-
* )
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare const entity: <A, R>(config: EntityRegistration<A, R>) => <R2>(builder: FederatedSchemaBuilder<R2>) => FederatedSchemaBuilder<R | R2>;
|
|
22
|
-
/**
|
|
23
|
-
* Add a query field
|
|
24
|
-
*/
|
|
25
|
-
export declare const query: <A, E, R, Args = void>(name: string, config: {
|
|
26
|
-
type: S.Schema<A, any, any>;
|
|
27
|
-
args?: S.Schema<Args, any, any>;
|
|
28
|
-
description?: string;
|
|
29
|
-
directives?: readonly DirectiveApplication[];
|
|
30
|
-
resolve: (args: Args) => Effect.Effect<A, E, R>;
|
|
31
|
-
}) => <R2>(builder: FederatedSchemaBuilder<R2>) => FederatedSchemaBuilder<R | R2>;
|
|
32
|
-
/**
|
|
33
|
-
* Add a mutation field
|
|
34
|
-
*/
|
|
35
|
-
export declare const mutation: <A, E, R, Args = void>(name: string, config: {
|
|
36
|
-
type: S.Schema<A, any, any>;
|
|
37
|
-
args?: S.Schema<Args, any, any>;
|
|
38
|
-
description?: string;
|
|
39
|
-
directives?: readonly DirectiveApplication[];
|
|
40
|
-
resolve: (args: Args) => Effect.Effect<A, E, R>;
|
|
41
|
-
}) => <R2>(builder: FederatedSchemaBuilder<R2>) => FederatedSchemaBuilder<R | R2>;
|
|
42
|
-
/**
|
|
43
|
-
* Add a subscription field
|
|
44
|
-
*/
|
|
45
|
-
export declare const subscription: <A, E, R, Args = void>(name: string, config: {
|
|
46
|
-
type: S.Schema<A, any, any>;
|
|
47
|
-
args?: S.Schema<Args, any, any>;
|
|
48
|
-
description?: string;
|
|
49
|
-
directives?: readonly DirectiveApplication[];
|
|
50
|
-
subscribe: (args: Args) => Effect.Effect<import("effect").Stream.Stream<A, E, R>, E, R>;
|
|
51
|
-
resolve?: (value: A, args: Args) => Effect.Effect<A, E, R>;
|
|
52
|
-
}) => <R2>(builder: FederatedSchemaBuilder<R2>) => FederatedSchemaBuilder<R | R2>;
|
|
53
|
-
/**
|
|
54
|
-
* Register an object type (non-entity)
|
|
55
|
-
*/
|
|
56
|
-
export declare const objectType: <A>(config: {
|
|
57
|
-
name?: string;
|
|
58
|
-
schema: S.Schema<A, any, any>;
|
|
59
|
-
implements?: readonly string[];
|
|
60
|
-
directives?: readonly DirectiveApplication[];
|
|
61
|
-
}) => <R>(builder: FederatedSchemaBuilder<R>) => FederatedSchemaBuilder<R>;
|
|
62
|
-
/**
|
|
63
|
-
* Register an interface type
|
|
64
|
-
*/
|
|
65
|
-
export declare const interfaceType: (config: {
|
|
66
|
-
name?: string;
|
|
67
|
-
schema: S.Schema<any, any, any>;
|
|
68
|
-
resolveType?: (value: any) => string;
|
|
69
|
-
directives?: readonly DirectiveApplication[];
|
|
70
|
-
}) => <R>(builder: FederatedSchemaBuilder<R>) => FederatedSchemaBuilder<R>;
|
|
71
|
-
/**
|
|
72
|
-
* Register an enum type
|
|
73
|
-
*/
|
|
74
|
-
export declare const enumType: (config: {
|
|
75
|
-
name: string;
|
|
76
|
-
values: readonly string[];
|
|
77
|
-
description?: string;
|
|
78
|
-
directives?: readonly DirectiveApplication[];
|
|
79
|
-
}) => <R>(builder: FederatedSchemaBuilder<R>) => FederatedSchemaBuilder<R>;
|
|
80
|
-
/**
|
|
81
|
-
* Register a union type
|
|
82
|
-
*/
|
|
83
|
-
export declare const unionType: (config: {
|
|
84
|
-
name: string;
|
|
85
|
-
types: readonly string[];
|
|
86
|
-
resolveType?: (value: any) => string;
|
|
87
|
-
directives?: readonly DirectiveApplication[];
|
|
88
|
-
}) => <R>(builder: FederatedSchemaBuilder<R>) => FederatedSchemaBuilder<R>;
|
|
89
|
-
/**
|
|
90
|
-
* Register an input type
|
|
91
|
-
*/
|
|
92
|
-
export declare const inputType: (config: {
|
|
93
|
-
name?: string;
|
|
94
|
-
schema: S.Schema<any, any, any>;
|
|
95
|
-
description?: string;
|
|
96
|
-
directives?: readonly DirectiveApplication[];
|
|
97
|
-
}) => <R>(builder: FederatedSchemaBuilder<R>) => FederatedSchemaBuilder<R>;
|
|
98
|
-
/**
|
|
99
|
-
* Add a computed/relational field to an object type
|
|
100
|
-
*/
|
|
101
|
-
export declare const field: <Parent, A, E, R, Args = void>(typeName: string, fieldName: string, config: {
|
|
102
|
-
type: S.Schema<A, any, any>;
|
|
103
|
-
args?: S.Schema<Args, any, any>;
|
|
104
|
-
description?: string;
|
|
105
|
-
directives?: readonly DirectiveApplication[];
|
|
106
|
-
resolve: (parent: Parent, args: Args) => Effect.Effect<A, E, R>;
|
|
107
|
-
}) => <R2>(builder: FederatedSchemaBuilder<R2>) => FederatedSchemaBuilder<R | R2>;
|
|
108
|
-
/**
|
|
109
|
-
* Create a field configuration with @external directive
|
|
110
|
-
*/
|
|
111
|
-
export declare const externalField: <A>(config: {
|
|
112
|
-
type: S.Schema<A, any, any>;
|
|
113
|
-
description?: string;
|
|
114
|
-
}) => {
|
|
115
|
-
type: S.Schema<A, any, any>;
|
|
116
|
-
description?: string;
|
|
117
|
-
directives: readonly DirectiveApplication[];
|
|
118
|
-
resolve: (parent: any) => Effect.Effect<A, never, never>;
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* Create a field configuration with @requires directive
|
|
122
|
-
*/
|
|
123
|
-
export declare const requiresField: <A, E, R, Parent = any>(config: {
|
|
124
|
-
type: S.Schema<A, any, any>;
|
|
125
|
-
fields: string;
|
|
126
|
-
description?: string;
|
|
127
|
-
resolve: (parent: Parent) => Effect.Effect<A, E, R>;
|
|
128
|
-
}) => {
|
|
129
|
-
type: S.Schema<A, any, any>;
|
|
130
|
-
description?: string;
|
|
131
|
-
directives: readonly DirectiveApplication[];
|
|
132
|
-
resolve: (parent: Parent) => Effect.Effect<A, E, R>;
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* Create a field configuration with @provides directive
|
|
136
|
-
*/
|
|
137
|
-
export declare const providesField: <A, E, R, Parent = any>(config: {
|
|
138
|
-
type: S.Schema<A, any, any>;
|
|
139
|
-
fields: string;
|
|
140
|
-
description?: string;
|
|
141
|
-
resolve: (parent: Parent) => Effect.Effect<A, E, R>;
|
|
142
|
-
}) => {
|
|
143
|
-
type: S.Schema<A, any, any>;
|
|
144
|
-
description?: string;
|
|
145
|
-
directives: readonly DirectiveApplication[];
|
|
146
|
-
resolve: (parent: Parent) => Effect.Effect<A, E, R>;
|
|
147
|
-
};
|
|
148
|
-
/**
|
|
149
|
-
* Create a field configuration with @override directive
|
|
150
|
-
*/
|
|
151
|
-
export declare const overrideField: <A, E, R, Parent = any>(config: {
|
|
152
|
-
type: S.Schema<A, any, any>;
|
|
153
|
-
from: string;
|
|
154
|
-
label?: string;
|
|
155
|
-
description?: string;
|
|
156
|
-
resolve: (parent: Parent) => Effect.Effect<A, E, R>;
|
|
157
|
-
}) => {
|
|
158
|
-
type: S.Schema<A, any, any>;
|
|
159
|
-
description?: string;
|
|
160
|
-
directives: readonly DirectiveApplication[];
|
|
161
|
-
resolve: (parent: Parent) => Effect.Effect<A, E, R>;
|
|
162
|
-
};
|
|
163
|
-
//# sourceMappingURL=pipe-api.d.ts.map
|
package/dist/pipe-api.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipe-api.d.ts","sourceRoot":"","sources":["../src/pipe-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,KAAK,CAAC,MAAM,eAAe,CAAA;AAClC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAMjD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,MAAM,GAChB,CAAC,EAAE,CAAC,EAAE,QAAQ,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,MACtC,EAAE,EA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,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,SAAS,oBAAoB,EAAE,CAAA;IAC3C,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;CAMnD,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,GAAG,EAAE,QAAQ;IAC3D,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;CACpD,KAAG;IACF,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,SAAS,oBAAoB,EAAE,CAAA;IAC3C,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;CAcnD,CAAA"}
|
package/dist/pipe-api.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.overrideField = exports.providesField = exports.requiresField = exports.externalField = exports.field = exports.inputType = exports.unionType = exports.enumType = exports.interfaceType = exports.objectType = exports.subscription = exports.mutation = exports.query = exports.entity = void 0;
|
|
4
|
-
const effect_1 = require("effect");
|
|
5
|
-
// ============================================================================
|
|
6
|
-
// Entity Registration
|
|
7
|
-
// ============================================================================
|
|
8
|
-
/**
|
|
9
|
-
* Register an entity type with @key directive(s) and reference resolver.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* FederatedSchemaBuilder.empty.pipe(
|
|
14
|
-
* entity({
|
|
15
|
-
* name: "User",
|
|
16
|
-
* schema: UserSchema,
|
|
17
|
-
* keys: [key({ fields: "id" })],
|
|
18
|
-
* resolveReference: (ref) => UserService.findById(ref.id),
|
|
19
|
-
* }),
|
|
20
|
-
* )
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
const entity = (config) => (builder) => builder.entity(config);
|
|
24
|
-
exports.entity = entity;
|
|
25
|
-
// ============================================================================
|
|
26
|
-
// Query/Mutation/Subscription
|
|
27
|
-
// ============================================================================
|
|
28
|
-
/**
|
|
29
|
-
* Add a query field
|
|
30
|
-
*/
|
|
31
|
-
const query = (name, config) => (builder) => builder.query(name, config);
|
|
32
|
-
exports.query = query;
|
|
33
|
-
/**
|
|
34
|
-
* Add a mutation field
|
|
35
|
-
*/
|
|
36
|
-
const mutation = (name, config) => (builder) => builder.mutation(name, config);
|
|
37
|
-
exports.mutation = mutation;
|
|
38
|
-
/**
|
|
39
|
-
* Add a subscription field
|
|
40
|
-
*/
|
|
41
|
-
const subscription = (name, config) => (builder) => builder.subscription(name, config);
|
|
42
|
-
exports.subscription = subscription;
|
|
43
|
-
// ============================================================================
|
|
44
|
-
// Type Registration
|
|
45
|
-
// ============================================================================
|
|
46
|
-
/**
|
|
47
|
-
* Register an object type (non-entity)
|
|
48
|
-
*/
|
|
49
|
-
const objectType = (config) => (builder) => builder.objectType(config);
|
|
50
|
-
exports.objectType = objectType;
|
|
51
|
-
/**
|
|
52
|
-
* Register an interface type
|
|
53
|
-
*/
|
|
54
|
-
const interfaceType = (config) => (builder) => builder.interfaceType(config);
|
|
55
|
-
exports.interfaceType = interfaceType;
|
|
56
|
-
/**
|
|
57
|
-
* Register an enum type
|
|
58
|
-
*/
|
|
59
|
-
const enumType = (config) => (builder) => builder.enumType(config);
|
|
60
|
-
exports.enumType = enumType;
|
|
61
|
-
/**
|
|
62
|
-
* Register a union type
|
|
63
|
-
*/
|
|
64
|
-
const unionType = (config) => (builder) => builder.unionType(config);
|
|
65
|
-
exports.unionType = unionType;
|
|
66
|
-
/**
|
|
67
|
-
* Register an input type
|
|
68
|
-
*/
|
|
69
|
-
const inputType = (config) => (builder) => builder.inputType(config);
|
|
70
|
-
exports.inputType = inputType;
|
|
71
|
-
/**
|
|
72
|
-
* Add a computed/relational field to an object type
|
|
73
|
-
*/
|
|
74
|
-
const field = (typeName, fieldName, config) => (builder) => builder.field(typeName, fieldName, config);
|
|
75
|
-
exports.field = field;
|
|
76
|
-
// ============================================================================
|
|
77
|
-
// Field-Level Federation Directive Helpers
|
|
78
|
-
// ============================================================================
|
|
79
|
-
/**
|
|
80
|
-
* Create a field configuration with @external directive
|
|
81
|
-
*/
|
|
82
|
-
const externalField = (config) => ({
|
|
83
|
-
type: config.type,
|
|
84
|
-
description: config.description,
|
|
85
|
-
directives: [{ name: "external" }],
|
|
86
|
-
resolve: (parent) => effect_1.Effect.succeed(parent),
|
|
87
|
-
});
|
|
88
|
-
exports.externalField = externalField;
|
|
89
|
-
/**
|
|
90
|
-
* Create a field configuration with @requires directive
|
|
91
|
-
*/
|
|
92
|
-
const requiresField = (config) => ({
|
|
93
|
-
type: config.type,
|
|
94
|
-
description: config.description,
|
|
95
|
-
directives: [{ name: "requires", args: { fields: config.fields } }],
|
|
96
|
-
resolve: config.resolve,
|
|
97
|
-
});
|
|
98
|
-
exports.requiresField = requiresField;
|
|
99
|
-
/**
|
|
100
|
-
* Create a field configuration with @provides directive
|
|
101
|
-
*/
|
|
102
|
-
const providesField = (config) => ({
|
|
103
|
-
type: config.type,
|
|
104
|
-
description: config.description,
|
|
105
|
-
directives: [{ name: "provides", args: { fields: config.fields } }],
|
|
106
|
-
resolve: config.resolve,
|
|
107
|
-
});
|
|
108
|
-
exports.providesField = providesField;
|
|
109
|
-
/**
|
|
110
|
-
* Create a field configuration with @override directive
|
|
111
|
-
*/
|
|
112
|
-
const overrideField = (config) => ({
|
|
113
|
-
type: config.type,
|
|
114
|
-
description: config.description,
|
|
115
|
-
directives: [
|
|
116
|
-
{
|
|
117
|
-
name: "override",
|
|
118
|
-
args: {
|
|
119
|
-
from: config.from,
|
|
120
|
-
...(config.label !== undefined ? { label: config.label } : {}),
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
],
|
|
124
|
-
resolve: config.resolve,
|
|
125
|
-
});
|
|
126
|
-
exports.overrideField = overrideField;
|
|
127
|
-
//# sourceMappingURL=pipe-api.js.map
|
package/dist/pipe-api.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipe-api.js","sourceRoot":"","sources":["../src/pipe-api.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAM/B,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E;;;;;;;;;;;;;;GAcG;AACI,MAAM,MAAM,GACjB,CAAO,MAAgC,EAAE,EAAE,CAC3C,CAAK,OAAmC,EAAkC,EAAE,CAC1E,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AAHb,QAAA,MAAM,UAGO;AAE1B,+EAA+E;AAC/E,8BAA8B;AAC9B,+EAA+E;AAE/E;;GAEG;AACI,MAAM,KAAK,GAChB,CACE,IAAY,EACZ,MAMC,EACD,EAAE,CACJ,CAAK,OAAmC,EAAkC,EAAE,CAC1E,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;AAZlB,QAAA,KAAK,SAYa;AAE/B;;GAEG;AACI,MAAM,QAAQ,GACnB,CACE,IAAY,EACZ,MAMC,EACD,EAAE,CACJ,CAAK,OAAmC,EAAkC,EAAE,CAC1E,OAAO,CAAC,QAAQ,CAA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MAMpD,EAKC,EAAE,CAAC,CAAC;IACJ,IAAI,EAAE,MAAM,CAAC,IAAI;IACjB,WAAW,EAAE,MAAM,CAAC,WAAW;IAC/B,UAAU,EAAE;QACV;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,GAAG,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC/D;SACF;KACF;IACD,OAAO,EAAE,MAAM,CAAC,OAAO;CACxB,CAAC,CAAA;AAxBW,QAAA,aAAa,iBAwBxB"}
|
package/dist/scalars.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { GraphQLScalarType } from "@effect-gql/core";
|
|
2
|
-
/**
|
|
3
|
-
* The _Any scalar is used for entity representations in the _entities query.
|
|
4
|
-
* It accepts any JSON value representing an entity with __typename and key fields.
|
|
5
|
-
*/
|
|
6
|
-
export declare const AnyScalar: GraphQLScalarType<unknown, unknown>;
|
|
7
|
-
/**
|
|
8
|
-
* The _FieldSet scalar represents a selection of fields.
|
|
9
|
-
* It's used in directive arguments like @key(fields: "id") and @requires(fields: "weight").
|
|
10
|
-
*/
|
|
11
|
-
export declare const FieldSetScalar: GraphQLScalarType<unknown, unknown>;
|
|
12
|
-
//# sourceMappingURL=scalars.d.ts.map
|
package/dist/scalars.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scalars.d.ts","sourceRoot":"","sources":["../src/scalars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAwB,MAAM,kBAAkB,CAAA;AA8B1E;;;GAGG;AACH,eAAO,MAAM,SAAS,qCAOpB,CAAA;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,qCAWzB,CAAA"}
|
package/dist/scalars.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FieldSetScalar = exports.AnyScalar = void 0;
|
|
4
|
-
const core_1 = require("@effect-gql/core");
|
|
5
|
-
/**
|
|
6
|
-
* Parse a literal value from the AST to a JavaScript value
|
|
7
|
-
*/
|
|
8
|
-
function parseLiteralToValue(ast) {
|
|
9
|
-
switch (ast.kind) {
|
|
10
|
-
case core_1.Kind.STRING:
|
|
11
|
-
case core_1.Kind.BOOLEAN:
|
|
12
|
-
return ast.value;
|
|
13
|
-
case core_1.Kind.INT:
|
|
14
|
-
return parseInt(ast.value, 10);
|
|
15
|
-
case core_1.Kind.FLOAT:
|
|
16
|
-
return parseFloat(ast.value);
|
|
17
|
-
case core_1.Kind.NULL:
|
|
18
|
-
return null;
|
|
19
|
-
case core_1.Kind.LIST:
|
|
20
|
-
return ast.values.map(parseLiteralToValue);
|
|
21
|
-
case core_1.Kind.OBJECT: {
|
|
22
|
-
const obj = {};
|
|
23
|
-
for (const field of ast.fields) {
|
|
24
|
-
obj[field.name.value] = parseLiteralToValue(field.value);
|
|
25
|
-
}
|
|
26
|
-
return obj;
|
|
27
|
-
}
|
|
28
|
-
default:
|
|
29
|
-
return undefined;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* The _Any scalar is used for entity representations in the _entities query.
|
|
34
|
-
* It accepts any JSON value representing an entity with __typename and key fields.
|
|
35
|
-
*/
|
|
36
|
-
exports.AnyScalar = new core_1.GraphQLScalarType({
|
|
37
|
-
name: "_Any",
|
|
38
|
-
description: "The _Any scalar is used to pass representations of entities from external services.",
|
|
39
|
-
serialize: (value) => value,
|
|
40
|
-
parseValue: (value) => value,
|
|
41
|
-
parseLiteral: parseLiteralToValue,
|
|
42
|
-
});
|
|
43
|
-
/**
|
|
44
|
-
* The _FieldSet scalar represents a selection of fields.
|
|
45
|
-
* It's used in directive arguments like @key(fields: "id") and @requires(fields: "weight").
|
|
46
|
-
*/
|
|
47
|
-
exports.FieldSetScalar = new core_1.GraphQLScalarType({
|
|
48
|
-
name: "_FieldSet",
|
|
49
|
-
description: "A string representing a selection of fields.",
|
|
50
|
-
serialize: (value) => value,
|
|
51
|
-
parseValue: (value) => value,
|
|
52
|
-
parseLiteral: (ast) => {
|
|
53
|
-
if (ast.kind === core_1.Kind.STRING) {
|
|
54
|
-
return ast.value;
|
|
55
|
-
}
|
|
56
|
-
return undefined;
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
//# sourceMappingURL=scalars.js.map
|
package/dist/scalars.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scalars.js","sourceRoot":"","sources":["../src/scalars.ts"],"names":[],"mappings":";;;AAAA,2CAA0E;AAE1E;;GAEG;AACH,SAAS,mBAAmB,CAAC,GAAc;IACzC,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC;QACjB,KAAK,WAAI,CAAC,MAAM,CAAC;QACjB,KAAK,WAAI,CAAC,OAAO;YACf,OAAO,GAAG,CAAC,KAAK,CAAA;QAClB,KAAK,WAAI,CAAC,GAAG;YACX,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;QAChC,KAAK,WAAI,CAAC,KAAK;YACb,OAAO,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAC9B,KAAK,WAAI,CAAC,IAAI;YACZ,OAAO,IAAI,CAAA;QACb,KAAK,WAAI,CAAC,IAAI;YACZ,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;QAC5C,KAAK,WAAI,CAAC,MAAM,CAAC,CAAC,CAAC;YACjB,MAAM,GAAG,GAA4B,EAAE,CAAA;YACvC,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;gBAC/B,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YAC1D,CAAC;YACD,OAAO,GAAG,CAAA;QACZ,CAAC;QACD;YACE,OAAO,SAAS,CAAA;IACpB,CAAC;AACH,CAAC;AAED;;;GAGG;AACU,QAAA,SAAS,GAAG,IAAI,wBAAiB,CAAC;IAC7C,IAAI,EAAE,MAAM;IACZ,WAAW,EACT,qFAAqF;IACvF,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;IAC3B,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;IAC5B,YAAY,EAAE,mBAAmB;CAClC,CAAC,CAAA;AAEF;;;GAGG;AACU,QAAA,cAAc,GAAG,IAAI,wBAAiB,CAAC;IAClD,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,8CAA8C;IAC3D,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;IAC3B,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;IAC5B,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE;QACpB,IAAI,GAAG,CAAC,IAAI,KAAK,WAAI,CAAC,MAAM,EAAE,CAAC;YAC7B,OAAO,GAAG,CAAC,KAAK,CAAA;QAClB,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;CACF,CAAC,CAAA"}
|
package/dist/types.d.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import * as S from "effect/Schema";
|
|
3
|
-
/**
|
|
4
|
-
* Configuration for a @key directive
|
|
5
|
-
*/
|
|
6
|
-
export interface KeyDirective {
|
|
7
|
-
/** FieldSet selection string (e.g., "id" or "sku package") */
|
|
8
|
-
readonly fields: string;
|
|
9
|
-
/** Whether this key can be used to resolve the entity. Default: true */
|
|
10
|
-
readonly resolvable?: boolean;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* All Federation 2.x directive types
|
|
14
|
-
*/
|
|
15
|
-
export type FederationDirective = {
|
|
16
|
-
readonly _tag: "key";
|
|
17
|
-
readonly fields: string;
|
|
18
|
-
readonly resolvable?: boolean;
|
|
19
|
-
} | {
|
|
20
|
-
readonly _tag: "external";
|
|
21
|
-
} | {
|
|
22
|
-
readonly _tag: "requires";
|
|
23
|
-
readonly fields: string;
|
|
24
|
-
} | {
|
|
25
|
-
readonly _tag: "provides";
|
|
26
|
-
readonly fields: string;
|
|
27
|
-
} | {
|
|
28
|
-
readonly _tag: "shareable";
|
|
29
|
-
} | {
|
|
30
|
-
readonly _tag: "inaccessible";
|
|
31
|
-
} | {
|
|
32
|
-
readonly _tag: "override";
|
|
33
|
-
readonly from: string;
|
|
34
|
-
readonly label?: string;
|
|
35
|
-
} | {
|
|
36
|
-
readonly _tag: "interfaceObject";
|
|
37
|
-
} | {
|
|
38
|
-
readonly _tag: "tag";
|
|
39
|
-
readonly name: string;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Entity representation sent to _entities query
|
|
43
|
-
* Contains __typename plus the key fields
|
|
44
|
-
*/
|
|
45
|
-
export interface EntityRepresentation {
|
|
46
|
-
readonly __typename: string;
|
|
47
|
-
readonly [key: string]: unknown;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Configuration for registering an entity type
|
|
51
|
-
*/
|
|
52
|
-
export interface EntityRegistration<A, R = never> {
|
|
53
|
-
/** Type name */
|
|
54
|
-
readonly name: string;
|
|
55
|
-
/** Effect Schema for the entity type */
|
|
56
|
-
readonly schema: S.Schema<A, any, any>;
|
|
57
|
-
/** Key directive configurations (at least one required) */
|
|
58
|
-
readonly keys: readonly KeyDirective[];
|
|
59
|
-
/** Additional directives to apply to the type */
|
|
60
|
-
readonly directives?: readonly FederationDirective[];
|
|
61
|
-
/**
|
|
62
|
-
* Reference resolver - given key fields, return the full entity.
|
|
63
|
-
* The representation contains __typename plus all fields from any matching @key.
|
|
64
|
-
*/
|
|
65
|
-
readonly resolveReference: (representation: Partial<A> & {
|
|
66
|
-
__typename: string;
|
|
67
|
-
}) => Effect.Effect<A | null, any, R>;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Configuration for the FederatedSchemaBuilder
|
|
71
|
-
*/
|
|
72
|
-
export interface FederatedSchemaConfig {
|
|
73
|
-
/** Federation specification version (default: "2.3") */
|
|
74
|
-
readonly version?: string;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Result of building a federated schema
|
|
78
|
-
*/
|
|
79
|
-
export interface FederatedSchemaResult {
|
|
80
|
-
/** The GraphQL schema with Federation queries */
|
|
81
|
-
readonly schema: import("graphql").GraphQLSchema;
|
|
82
|
-
/** The Federation-compliant SDL with directive annotations */
|
|
83
|
-
readonly sdl: string;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Convert a FederationDirective to a DirectiveApplication
|
|
87
|
-
*/
|
|
88
|
-
export declare function toDirectiveApplication(directive: FederationDirective): import("@effect-gql/core").DirectiveApplication;
|
|
89
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,KAAK,CAAC,MAAM,eAAe,CAAA;AAElC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,wEAAwE;IACxE,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GACh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,QAAQ,CAAC,gBAAgB,EAAE,CACzB,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,KAChD,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,OAAO,SAAS,EAAE,aAAa,CAAA;IAChD,8DAA8D;IAC9D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,mBAAmB,GAC7B,OAAO,kBAAkB,EAAE,oBAAoB,CAiCjD"}
|
package/dist/types.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toDirectiveApplication = toDirectiveApplication;
|
|
4
|
-
/**
|
|
5
|
-
* Convert a FederationDirective to a DirectiveApplication
|
|
6
|
-
*/
|
|
7
|
-
function toDirectiveApplication(directive) {
|
|
8
|
-
switch (directive._tag) {
|
|
9
|
-
case "key":
|
|
10
|
-
return {
|
|
11
|
-
name: "key",
|
|
12
|
-
args: {
|
|
13
|
-
fields: directive.fields,
|
|
14
|
-
...(directive.resolvable !== undefined ? { resolvable: directive.resolvable } : {}),
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
case "external":
|
|
18
|
-
return { name: "external" };
|
|
19
|
-
case "requires":
|
|
20
|
-
return { name: "requires", args: { fields: directive.fields } };
|
|
21
|
-
case "provides":
|
|
22
|
-
return { name: "provides", args: { fields: directive.fields } };
|
|
23
|
-
case "shareable":
|
|
24
|
-
return { name: "shareable" };
|
|
25
|
-
case "inaccessible":
|
|
26
|
-
return { name: "inaccessible" };
|
|
27
|
-
case "override":
|
|
28
|
-
return {
|
|
29
|
-
name: "override",
|
|
30
|
-
args: {
|
|
31
|
-
from: directive.from,
|
|
32
|
-
...(directive.label !== undefined ? { label: directive.label } : {}),
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
case "interfaceObject":
|
|
36
|
-
return { name: "interfaceObject" };
|
|
37
|
-
case "tag":
|
|
38
|
-
return { name: "tag", args: { name: directive.name } };
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;AA8EA,wDAmCC;AAtCD;;GAEG;AACH,SAAgB,sBAAsB,CACpC,SAA8B;IAE9B,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,KAAK;YACR,OAAO;gBACL,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE;oBACJ,MAAM,EAAE,SAAS,CAAC,MAAM;oBACxB,GAAG,CAAC,SAAS,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBACpF;aACF,CAAA;QACH,KAAK,UAAU;YACb,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAA;QAC7B,KAAK,UAAU;YACb,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,EAAE,CAAA;QACjE,KAAK,UAAU;YACb,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,EAAE,CAAA;QACjE,KAAK,WAAW;YACd,OAAO,EA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