@contello/client 3.4.0 → 3.5.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/dist/index.d.cts CHANGED
@@ -1,290 +1,4 @@
1
- import "undici";
2
- import { ReadableStream as ReadableStream$1 } from "node:stream/web";
3
- //#region src/http.d.ts
4
- type HttpAgentOptions = {
5
- pipelining?: number | undefined;
6
- allowH2?: boolean | undefined;
7
- maxConcurrentStreams?: number | undefined;
8
- keepAliveTimeout?: number | undefined;
9
- };
10
- type DownloadResult = {
11
- mimeType: string;
12
- size: number;
13
- bytes(): Promise<Uint8Array>;
14
- stream(): ReadableStream<Uint8Array>;
15
- };
16
- type ProxyResult = {
17
- status: number;
18
- headers: Headers;
19
- stream(): ReadableStream<Uint8Array>;
20
- };
21
- type SitemapProxyOptions = {
22
- /** chunk source as received from the query string; core decides whether the source/page pair is valid */
23
- source?: string | undefined;
24
- /** chunk page as received from the query string */
25
- page?: string | undefined;
26
- /** the incoming request's Accept-Encoding, so stored gzip bytes pass through untouched */
27
- acceptEncoding?: string | undefined;
28
- /** the incoming request's If-None-Match, so core can answer 304 */
29
- ifNoneMatch?: string | undefined;
30
- };
31
- //#endregion
32
- //#region src/introspection.d.ts
33
- type ResourceAction = 'READ' | 'CREATE' | 'UPDATE' | 'DELETE';
34
- type ResourcePermissions = {
35
- resourceType: 'ENTITY' | 'ASSET' | 'ROUTE' | 'I18N_MESSAGE_COLLECTION' | 'MODELLING' | 'EXTENSION' | (string & {});
36
- scope: string | null;
37
- actions: ResourceAction[];
38
- };
39
- type IntrospectedUser = {
40
- id: string;
41
- username: string;
42
- firstName: string;
43
- lastName: string;
44
- email: string;
45
- };
46
- type TokenIntrospection = {
47
- active: false;
48
- } | {
49
- active: true;
50
- audience: string;
51
- expiresAt: Date;
52
- user: IntrospectedUser;
53
- permissions: ResourcePermissions[];
54
- };
55
- type TokenIntrospectorOptions = {
56
- audiences: string[];
57
- maxAgeMs?: number | undefined;
58
- maxEntries?: number | undefined;
59
- };
60
- type TokenIntrospector = {
61
- introspect: (token: string) => Promise<TokenIntrospection>;
62
- };
63
- export declare function createTokenIntrospector(introspect: (token: string) => Promise<TokenIntrospection>, options: TokenIntrospectorOptions): TokenIntrospector;
64
- //#endregion
65
- //#region src/types.d.ts
66
- type OperationKind = 'query' | 'mutation' | 'subscription';
67
- type OperationDef<TResult = unknown, TVariables = Record<string, unknown>, TKind extends OperationKind = OperationKind> = {
68
- document: string;
69
- kind: TKind;
70
- /** phantom type — exists only at the type level */
71
- __result?: TResult | undefined;
72
- /** phantom type — exists only at the type level */
73
- __variables?: TVariables | undefined;
74
- };
75
- type OperationMap = Record<string, OperationDef>;
76
- type InferResult<T extends OperationDef> = NonNullable<T['__result']>;
77
- type InferVariables<T extends OperationDef> = NonNullable<T['__variables']>;
78
- type RpcMethod<T extends OperationDef> = T['kind'] extends 'subscription' ? InferVariables<T> extends Record<string, never> ? () => AsyncIterable<InferResult<T>> : (variables: InferVariables<T>) => AsyncIterable<InferResult<T>> : InferVariables<T> extends Record<string, never> ? () => Promise<InferResult<T>> : (variables: InferVariables<T>) => Promise<InferResult<T>>;
79
- type Rpc<T extends OperationMap> = { [K in keyof T]: RpcMethod<T[K]>; };
80
- /**
81
- * Discriminator for how a SourceDef binds to a Subscription field:
82
- * - `entity` — a Contello entity model collection (`categoriesBatch` etc.), accepts optional `{ ids }` filter
83
- * - `singleton` — a single Contello entity (`config` etc.), no args
84
- * - `route` — built-in: `contelloRoutesBatch`, optional `{ ids, paths }` filter
85
- * - `asset` — built-in: `contelloAssetsBatch`, optional `{ ids }` filter
86
- * - `i18nMessage` — built-in: `contelloI18nMessagesBatch`, requires `{ collection }` and optional `{ ids }` filter
87
- */
88
- type SourceCardinality = 'entity' | 'singleton' | 'route' | 'asset' | 'i18nMessage';
89
- /**
90
- * One argument of a write mutation and what fills it. Entity mutations take a single input
91
- * object; the built-ins vary — `createContelloRoute` takes `route:`, `deleteContelloRoute`
92
- * takes a bare `id:`.
93
- */
94
- type SourceMutationArgument = {
95
- /** the GQL argument name — `request`, `route`, `id` */
96
- name: string;
97
- /** the rendered GQL type, including nullability — `CreateCategoryRequestInput!`, `String` */
98
- type: string;
99
- /** `input` takes the caller's input, `id` the id passed to a delete */
100
- from: 'input' | 'id';
101
- /**
102
- * the single field of a one-field envelope argument (`CreateCategoryRequestInput { entity }`).
103
- * When set, the accessor takes the inner input and the runtime nests it under this key.
104
- */
105
- envelope?: string | undefined;
106
- };
107
- /**
108
- * What a write mutation answers with:
109
- * - `entity` — the entity itself, selected through the source's fragment
110
- * - `idObject` — an object carrying `id` (`ContelloEntityDeleteResponse`)
111
- * - `idScalar` — a bare id (`deleteContelloRoute: String!`)
112
- */
113
- type SourceMutationResult = 'entity' | 'idObject' | 'idScalar';
114
- /**
115
- * How one write operation of a source binds to a Mutation field. Emitted by the generator
116
- * from introspection — the runtime never derives field or argument names by string munging.
117
- */
118
- type SourceMutationBinding = {
119
- /** the mutation field — `createCategory` */
120
- field: string;
121
- arguments: SourceMutationArgument[];
122
- result: SourceMutationResult;
123
- };
124
- /** Mutation bindings of a source. Absent operations are simply missing (singletons have no `create`). */
125
- type SourceMutations = {
126
- create?: SourceMutationBinding | undefined;
127
- update?: SourceMutationBinding | undefined;
128
- delete?: SourceMutationBinding | undefined;
129
- };
130
- /**
131
- * Phantom shape carrying the input types of a source's write operations. A key is present
132
- * only when the schema exposes the matching mutation, so `client.sources.x.create` exists
133
- * exactly when `createX` does.
134
- */
135
- type SourceWrites = {
136
- create?: unknown;
137
- update?: unknown;
138
- delete?: unknown;
139
- };
140
- type SourceDef<TModel extends string = string, TCardinality extends SourceCardinality = SourceCardinality, TResult = unknown, TWrites = unknown> = {
141
- /** the GQL fragment text — bundled with transitive deps if any */
142
- document: string;
143
- /** the fragment name to spread inside the source subscription — e.g. `Category` */
144
- fragment: string;
145
- /** the subscription field this fragment is bound to — `categoriesBatch`, `config`, etc */
146
- subscription: string;
147
- /** write bindings — present only for sources whose model exposes entity mutations */
148
- mutations?: SourceMutations | undefined;
149
- __model: TModel;
150
- __cardinality: TCardinality;
151
- /** phantom type — exists only at the type level */
152
- __result?: TResult | undefined;
153
- /** phantom type — exists only at the type level */
154
- __writes?: TWrites | undefined;
155
- };
156
- type SourceMap = Record<string, SourceDef>;
157
- /**
158
- * The bundle emitted by `contello-client generate`. Pass to `createContelloClient({ schema })`
159
- * (and to `createStore`, `createContello`). Each layer reads what it needs:
160
- * - client uses `operations` (for `client.rpc.*`) and `sources` (for `client.sources.*`).
161
- * - store uses `models` (for the dependency resolver) on top of what client uses.
162
- */
163
- type Schema<TOps extends OperationMap = OperationMap, TSources extends SourceMap = SourceMap, TModels extends string = string> = {
164
- operations: TOps;
165
- sources: TSources;
166
- models: Record<TModels, string>;
167
- };
168
- type SourceFetcherFor<S> = S extends SourceDef<string, 'singleton', infer R> ? () => Promise<R> : S extends SourceDef<string, 'entity', infer R> ? (vars?: {
169
- ids?: string[];
170
- }) => Promise<R[]> : S extends SourceDef<string, 'route', infer R> ? (vars?: {
171
- ids?: string[] | undefined;
172
- paths?: string[] | undefined;
173
- } | undefined) => Promise<R[]> : S extends SourceDef<string, 'asset', infer R> ? (vars?: {
174
- ids?: string[] | undefined;
175
- } | undefined) => Promise<R[]> : S extends SourceDef<string, 'i18nMessage', infer R> ? (vars: {
176
- collection: string;
177
- ids?: string[] | undefined;
178
- }) => Promise<R[]> : never;
179
- /** Extracts the phantom write-input shape of a SourceDef. */
180
- type WritesOf<S> = S extends SourceDef<string, SourceCardinality, any, infer W> ? W : unknown;
181
- /** Extracts the phantom result shape of a SourceDef — what its fragment selects. */
182
- type ResultOf<S> = S extends SourceDef<string, SourceCardinality, infer R, any> ? R : unknown;
183
- /**
184
- * Per-source write accessors. Each method exists only when the generator found the matching
185
- * mutation. A `create`/`update` selects the source's own fragment, so it answers with the entity
186
- * in exactly the shape `fetch` yields; a `delete` answers with the id it removed. Nothing is
187
- * cached here — that is the job of the collection that owns the source in `@contello/store`.
188
- */
189
- type SourceWritersFor<S> = (WritesOf<S> extends {
190
- create: infer TCreate;
191
- } ? {
192
- create: (input: TCreate) => Promise<ResultOf<S>>;
193
- } : Record<never, never>) & (WritesOf<S> extends {
194
- update: infer TUpdate;
195
- } ? {
196
- update: (input: TUpdate) => Promise<ResultOf<S>>;
197
- } : Record<never, never>) & (WritesOf<S> extends {
198
- delete: infer TDelete;
199
- } ? {
200
- delete: (input: TDelete) => Promise<string>;
201
- } : Record<never, never>);
202
- /** Per-source runtime accessor: `client.sources.category.fetch()` → `Promise<CategoryFragment[]>` etc. */
203
- type SourceAccessors<TSources extends SourceMap> = { [K in keyof TSources]: {
204
- fetch: SourceFetcherFor<TSources[K]>;
205
- } & SourceWritersFor<TSources[K]>; };
206
- //#endregion
207
- //#region src/upload.d.ts
208
- type UploadMetadata = {
209
- name: string;
210
- mimeType?: string | undefined;
211
- size?: number | undefined;
212
- annotations?: {
213
- key: string;
214
- value: string;
215
- }[] | undefined;
216
- collectionRefs?: string[] | undefined;
217
- /**
218
- * `deleteIfNotUsed` lets the server delete the asset once nothing references it.
219
- * @default 'retain'
220
- */
221
- retentionPolicy?: 'retain' | 'deleteIfNotUsed' | undefined;
222
- };
223
- type UploadData = Uint8Array | ReadableStream$1<Uint8Array> | ReadableStream<Uint8Array>;
224
- type UploadOptions = {
225
- chunkSize?: number | undefined;
226
- abort?: AbortSignal | undefined;
227
- };
228
- //#endregion
229
- //#region src/client.d.ts
230
- type ConnectionContext = {
231
- connectionId: string;
232
- websocketUrl: string;
233
- };
234
- type ConnectionEvents = {
235
- onConnected?: ((context: ConnectionContext) => void) | undefined;
236
- onConnecting?: ((context: ConnectionContext) => void) | undefined;
237
- onClosed?: ((context: ConnectionContext) => void) | undefined;
238
- onError?: ((context: ConnectionContext, error: unknown) => void) | undefined;
239
- };
240
- type ContelloClientOptions<TSchema extends Schema | undefined = undefined> = {
241
- url: string;
242
- project: string;
243
- token: string;
244
- schema?: TSchema | undefined;
245
- connections?: number | undefined;
246
- http?: HttpAgentOptions | undefined;
247
- onConnected?: (() => void) | undefined;
248
- onReconnecting?: (() => void) | undefined;
249
- onError?: ((error: unknown) => void) | undefined;
250
- connectionEvents?: ConnectionEvents | undefined;
251
- };
252
- export declare class ContelloClient<TSchema extends Schema | undefined = undefined> {
253
- private _pool;
254
- private _rpc;
255
- private _sources;
256
- private _url;
257
- private _project;
258
- private _token;
259
- private _agent;
260
- constructor(options: ContelloClientOptions<TSchema>);
261
- get rpc(): TSchema extends Schema<infer TOps, any, any> ? Rpc<TOps> : never;
262
- get sources(): TSchema extends Schema<any, infer TSources, any> ? SourceAccessors<TSources> : never;
263
- init(): Promise<void>;
264
- destroy(): Promise<void>;
265
- ping(): Promise<void>;
266
- /**
267
- * What a temporary token the Contello ui handed to an extension page stands for in the project of
268
- * this client: the user and the user's effective permissions, or inactive. The client's
269
- * application needs read access to the project. See `createTokenIntrospector` for the caching
270
- * wrapper a backend puts in front of its requests.
271
- */
272
- introspectToken(token: string): Promise<TokenIntrospection>;
273
- /**
274
- * Open a subscription on the websocket. Each `[Symbol.asyncIterator]()` call (the implicit one
275
- * from `for await`, or via `rxjs.from(this)`) starts a fresh server subscription and tears it
276
- * down when the iterator is returned (`break`, error, or explicit stop).
277
- */
278
- subscribe<TData>(query: string, variables?: Record<string, unknown> | undefined): AsyncIterable<TData>;
279
- download(fileId: string): Promise<DownloadResult>;
280
- proxyHls(path: string, signal?: AbortSignal | undefined): Promise<ProxyResult>;
281
- proxySitemap(sitemapId: string, options: SitemapProxyOptions, signal?: AbortSignal | undefined): Promise<ProxyResult>;
282
- upload(data: UploadData, meta: UploadMetadata, options?: UploadOptions | undefined): Promise<string>;
283
- execute<TData>(query: string, variables?: Record<string, unknown> | undefined): Promise<TData>;
284
- }
285
- export declare function createContelloClient<TSchema extends Schema | undefined = undefined>(options: ContelloClientOptions<TSchema>): ContelloClient<TSchema>;
286
- //#endregion
287
- //#region src/scalars.d.ts
1
+ import { A as DownloadResult, C as IntrospectedUser, D as TokenIntrospector, E as TokenIntrospection, M as ProxyResult, N as SitemapProxyOptions, O as TokenIntrospectorOptions, S as SourceWrites, T as ResourcePermissions, _ as SourceMap, a as createContelloClient, b as SourceMutationResult, c as UploadOptions, d as OperationMap, f as Rpc, g as SourceDef, h as SourceCardinality, i as ContelloClientOptions, j as HttpAgentOptions, k as createTokenIntrospector, l as OperationDef, m as SourceAccessors, n as ConnectionEvents, o as UploadData, p as Schema, r as ContelloClient, s as UploadMetadata, t as ConnectionContext, u as OperationKind, v as SourceMutationArgument, w as ResourceAction, x as SourceMutations, y as SourceMutationBinding } from "./client-AMuKG0mv.cjs";
288
2
  type LocalDateTime = {
289
3
  year: number;
290
4
  month: number;
@@ -298,11 +12,7 @@ type LocalDate = {
298
12
  month: number;
299
13
  day: number;
300
14
  };
301
- //#endregion
302
- //#region src/source-subscription.d.ts
303
15
  export declare function createSourceSubscription(source: SourceDef): string;
304
- //#endregion
305
- //#region src/source-mutation.d.ts
306
16
  type SourceMutationKind = keyof SourceMutations;
307
17
  /** What a write takes: the caller's input, and the id for a delete. */
308
18
  type SourceMutationValues = {
@@ -320,8 +30,6 @@ export declare function createSourceMutation(source: SourceDef, kind: SourceMuta
320
30
  export declare function createSourceMutationVariables(binding: SourceMutationBinding, values: SourceMutationValues): Record<string, unknown>;
321
31
  /** Pulls the id out of whatever shape the mutation answered with. */
322
32
  export declare function readSourceMutationId(binding: SourceMutationBinding, result: unknown): string;
323
- //#endregion
324
- //#region src/built-in-mutations.d.ts
325
33
  /**
326
34
  * Write bindings for the built-in sources. Unlike entity mutations these are not derived — their
327
35
  * field and argument names are fixed parts of every Contello schema — but the generator still
@@ -335,6 +43,5 @@ export declare function readSourceMutationId(binding: SourceMutationBinding, res
335
43
  * Assets have no `create` — an asset comes into being through `client.upload()`, not a mutation.
336
44
  */
337
45
  export declare const BUILT_IN_MUTATIONS: Partial<Record<SourceCardinality, SourceMutations>>;
338
- //#endregion
339
- export type { ConnectionContext, ConnectionEvents, ContelloClientOptions, DownloadResult, HttpAgentOptions, IntrospectedUser, LocalDate, LocalDateTime, OperationDef, OperationKind, OperationMap, ProxyResult, ResourceAction, ResourcePermissions, Rpc, Schema, SitemapProxyOptions, SourceAccessors, SourceCardinality, SourceDef, SourceMap, SourceMutationArgument, SourceMutationBinding, SourceMutationKind, SourceMutationResult, SourceMutationValues, SourceMutations, SourceWrites, TokenIntrospection, TokenIntrospector, TokenIntrospectorOptions, UploadData, UploadMetadata, UploadOptions };
46
+ export { type ConnectionContext, type ConnectionEvents, ContelloClient, type ContelloClientOptions, type DownloadResult, type HttpAgentOptions, type IntrospectedUser, type LocalDate, type LocalDateTime, type OperationDef, type OperationKind, type OperationMap, type ProxyResult, type ResourceAction, type ResourcePermissions, type Rpc, type Schema, type SitemapProxyOptions, type SourceAccessors, type SourceCardinality, type SourceDef, type SourceMap, type SourceMutationArgument, type SourceMutationBinding, type SourceMutationKind, type SourceMutationResult, type SourceMutationValues, type SourceMutations, type SourceWrites, type TokenIntrospection, type TokenIntrospector, type TokenIntrospectorOptions, type UploadData, type UploadMetadata, type UploadOptions, createContelloClient, createTokenIntrospector };
340
47
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["NodeReadableStream"],"sources":["../src/http.ts","../src/introspection.ts","../src/types.ts","../src/upload.ts","../src/client.ts","../src/scalars.ts","../src/source-subscription.ts","../src/source-mutation.ts","../src/built-in-mutations.ts"],"mappings":";;;KAkCY;EACV;EACA;EACA;EACA;;KAcU;EACV;EACA;EACA,SAAS,QAAQ;EACjB,UAAU,eAAe;;KAiCf;EACV;EACA,SAAS;EACT,UAAU,eAAe;;KAqBf;;EAEV;;EAEA;;EAEA;;EAEA;;;;KCjHU;KAKA;EACV;EACA;EACA,SAAS;;KAGC;EACV;EACA;EACA;EACA;EACA;;KAKU;EACN;;EAEF;EAEA;EACA,WAAW;EACX,MAAM;EACN,aAAa;;KAgCL;EAGV;EAGA;EAEA;;KAGU;EACV,aAAa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wBAS1E,qBAAqB,gBAAgB,gCACnD,SAAS,sBAAsB,WAC9B,eAAe;;;KCrUN;EACV;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;EACA;;;;wBCcc,yBAAyB,QAAQ;;;KCvBrC,2BAA2B;;KAG3B;EACV;EACA;;;wBAwBc,qBAAqB,QAAQ,WAAW,MAAM;;;;;;;wBA+B9C,8BACd,SAAS,uBACT,QAAQ,uBACP;;wBAYa,qBAAqB,SAAS,uBAAuB;;;;;;;;;;;;;;;qBChExD,oBAAoB,QAAQ,OAAO,mBAAmB"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/scalars.ts","../src/source-subscription.ts","../src/source-mutation.ts","../src/built-in-mutations.ts"],"mappings":";KAAY;EACV;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;EACA;;wBCcc,yBAAyB,QAAQ;KCvBrC,2BAA2B;;KAG3B;EACV;EACA;;;wBAwBc,qBAAqB,QAAQ,WAAW,MAAM;;;;;;;wBA+B9C,8BACd,SAAS,uBACT,QAAQ,uBACP;;wBAYa,qBAAqB,SAAS,uBAAuB;;;;;;;;;;;;;qBChExD,oBAAoB,QAAQ,OAAO,mBAAmB"}
package/dist/index.d.ts CHANGED
@@ -1,290 +1,4 @@
1
- import { Agent } from "undici";
2
- import { ReadableStream as ReadableStream$1 } from "node:stream/web";
3
- //#region src/http.d.ts
4
- type HttpAgentOptions = {
5
- pipelining?: number | undefined;
6
- allowH2?: boolean | undefined;
7
- maxConcurrentStreams?: number | undefined;
8
- keepAliveTimeout?: number | undefined;
9
- };
10
- type DownloadResult = {
11
- mimeType: string;
12
- size: number;
13
- bytes(): Promise<Uint8Array>;
14
- stream(): ReadableStream<Uint8Array>;
15
- };
16
- type ProxyResult = {
17
- status: number;
18
- headers: Headers;
19
- stream(): ReadableStream<Uint8Array>;
20
- };
21
- type SitemapProxyOptions = {
22
- /** chunk source as received from the query string; core decides whether the source/page pair is valid */
23
- source?: string | undefined;
24
- /** chunk page as received from the query string */
25
- page?: string | undefined;
26
- /** the incoming request's Accept-Encoding, so stored gzip bytes pass through untouched */
27
- acceptEncoding?: string | undefined;
28
- /** the incoming request's If-None-Match, so core can answer 304 */
29
- ifNoneMatch?: string | undefined;
30
- };
31
- //#endregion
32
- //#region src/introspection.d.ts
33
- type ResourceAction = 'READ' | 'CREATE' | 'UPDATE' | 'DELETE';
34
- type ResourcePermissions = {
35
- resourceType: 'ENTITY' | 'ASSET' | 'ROUTE' | 'I18N_MESSAGE_COLLECTION' | 'MODELLING' | 'EXTENSION' | (string & {});
36
- scope: string | null;
37
- actions: ResourceAction[];
38
- };
39
- type IntrospectedUser = {
40
- id: string;
41
- username: string;
42
- firstName: string;
43
- lastName: string;
44
- email: string;
45
- };
46
- type TokenIntrospection = {
47
- active: false;
48
- } | {
49
- active: true;
50
- audience: string;
51
- expiresAt: Date;
52
- user: IntrospectedUser;
53
- permissions: ResourcePermissions[];
54
- };
55
- type TokenIntrospectorOptions = {
56
- audiences: string[];
57
- maxAgeMs?: number | undefined;
58
- maxEntries?: number | undefined;
59
- };
60
- type TokenIntrospector = {
61
- introspect: (token: string) => Promise<TokenIntrospection>;
62
- };
63
- export declare function createTokenIntrospector(introspect: (token: string) => Promise<TokenIntrospection>, options: TokenIntrospectorOptions): TokenIntrospector;
64
- //#endregion
65
- //#region src/types.d.ts
66
- type OperationKind = 'query' | 'mutation' | 'subscription';
67
- type OperationDef<TResult = unknown, TVariables = Record<string, unknown>, TKind extends OperationKind = OperationKind> = {
68
- document: string;
69
- kind: TKind;
70
- /** phantom type — exists only at the type level */
71
- __result?: TResult | undefined;
72
- /** phantom type — exists only at the type level */
73
- __variables?: TVariables | undefined;
74
- };
75
- type OperationMap = Record<string, OperationDef>;
76
- type InferResult<T extends OperationDef> = NonNullable<T['__result']>;
77
- type InferVariables<T extends OperationDef> = NonNullable<T['__variables']>;
78
- type RpcMethod<T extends OperationDef> = T['kind'] extends 'subscription' ? InferVariables<T> extends Record<string, never> ? () => AsyncIterable<InferResult<T>> : (variables: InferVariables<T>) => AsyncIterable<InferResult<T>> : InferVariables<T> extends Record<string, never> ? () => Promise<InferResult<T>> : (variables: InferVariables<T>) => Promise<InferResult<T>>;
79
- type Rpc<T extends OperationMap> = { [K in keyof T]: RpcMethod<T[K]>; };
80
- /**
81
- * Discriminator for how a SourceDef binds to a Subscription field:
82
- * - `entity` — a Contello entity model collection (`categoriesBatch` etc.), accepts optional `{ ids }` filter
83
- * - `singleton` — a single Contello entity (`config` etc.), no args
84
- * - `route` — built-in: `contelloRoutesBatch`, optional `{ ids, paths }` filter
85
- * - `asset` — built-in: `contelloAssetsBatch`, optional `{ ids }` filter
86
- * - `i18nMessage` — built-in: `contelloI18nMessagesBatch`, requires `{ collection }` and optional `{ ids }` filter
87
- */
88
- type SourceCardinality = 'entity' | 'singleton' | 'route' | 'asset' | 'i18nMessage';
89
- /**
90
- * One argument of a write mutation and what fills it. Entity mutations take a single input
91
- * object; the built-ins vary — `createContelloRoute` takes `route:`, `deleteContelloRoute`
92
- * takes a bare `id:`.
93
- */
94
- type SourceMutationArgument = {
95
- /** the GQL argument name — `request`, `route`, `id` */
96
- name: string;
97
- /** the rendered GQL type, including nullability — `CreateCategoryRequestInput!`, `String` */
98
- type: string;
99
- /** `input` takes the caller's input, `id` the id passed to a delete */
100
- from: 'input' | 'id';
101
- /**
102
- * the single field of a one-field envelope argument (`CreateCategoryRequestInput { entity }`).
103
- * When set, the accessor takes the inner input and the runtime nests it under this key.
104
- */
105
- envelope?: string | undefined;
106
- };
107
- /**
108
- * What a write mutation answers with:
109
- * - `entity` — the entity itself, selected through the source's fragment
110
- * - `idObject` — an object carrying `id` (`ContelloEntityDeleteResponse`)
111
- * - `idScalar` — a bare id (`deleteContelloRoute: String!`)
112
- */
113
- type SourceMutationResult = 'entity' | 'idObject' | 'idScalar';
114
- /**
115
- * How one write operation of a source binds to a Mutation field. Emitted by the generator
116
- * from introspection — the runtime never derives field or argument names by string munging.
117
- */
118
- type SourceMutationBinding = {
119
- /** the mutation field — `createCategory` */
120
- field: string;
121
- arguments: SourceMutationArgument[];
122
- result: SourceMutationResult;
123
- };
124
- /** Mutation bindings of a source. Absent operations are simply missing (singletons have no `create`). */
125
- type SourceMutations = {
126
- create?: SourceMutationBinding | undefined;
127
- update?: SourceMutationBinding | undefined;
128
- delete?: SourceMutationBinding | undefined;
129
- };
130
- /**
131
- * Phantom shape carrying the input types of a source's write operations. A key is present
132
- * only when the schema exposes the matching mutation, so `client.sources.x.create` exists
133
- * exactly when `createX` does.
134
- */
135
- type SourceWrites = {
136
- create?: unknown;
137
- update?: unknown;
138
- delete?: unknown;
139
- };
140
- type SourceDef<TModel extends string = string, TCardinality extends SourceCardinality = SourceCardinality, TResult = unknown, TWrites = unknown> = {
141
- /** the GQL fragment text — bundled with transitive deps if any */
142
- document: string;
143
- /** the fragment name to spread inside the source subscription — e.g. `Category` */
144
- fragment: string;
145
- /** the subscription field this fragment is bound to — `categoriesBatch`, `config`, etc */
146
- subscription: string;
147
- /** write bindings — present only for sources whose model exposes entity mutations */
148
- mutations?: SourceMutations | undefined;
149
- __model: TModel;
150
- __cardinality: TCardinality;
151
- /** phantom type — exists only at the type level */
152
- __result?: TResult | undefined;
153
- /** phantom type — exists only at the type level */
154
- __writes?: TWrites | undefined;
155
- };
156
- type SourceMap = Record<string, SourceDef>;
157
- /**
158
- * The bundle emitted by `contello-client generate`. Pass to `createContelloClient({ schema })`
159
- * (and to `createStore`, `createContello`). Each layer reads what it needs:
160
- * - client uses `operations` (for `client.rpc.*`) and `sources` (for `client.sources.*`).
161
- * - store uses `models` (for the dependency resolver) on top of what client uses.
162
- */
163
- type Schema<TOps extends OperationMap = OperationMap, TSources extends SourceMap = SourceMap, TModels extends string = string> = {
164
- operations: TOps;
165
- sources: TSources;
166
- models: Record<TModels, string>;
167
- };
168
- type SourceFetcherFor<S> = S extends SourceDef<string, 'singleton', infer R> ? () => Promise<R> : S extends SourceDef<string, 'entity', infer R> ? (vars?: {
169
- ids?: string[];
170
- }) => Promise<R[]> : S extends SourceDef<string, 'route', infer R> ? (vars?: {
171
- ids?: string[] | undefined;
172
- paths?: string[] | undefined;
173
- } | undefined) => Promise<R[]> : S extends SourceDef<string, 'asset', infer R> ? (vars?: {
174
- ids?: string[] | undefined;
175
- } | undefined) => Promise<R[]> : S extends SourceDef<string, 'i18nMessage', infer R> ? (vars: {
176
- collection: string;
177
- ids?: string[] | undefined;
178
- }) => Promise<R[]> : never;
179
- /** Extracts the phantom write-input shape of a SourceDef. */
180
- type WritesOf<S> = S extends SourceDef<string, SourceCardinality, any, infer W> ? W : unknown;
181
- /** Extracts the phantom result shape of a SourceDef — what its fragment selects. */
182
- type ResultOf<S> = S extends SourceDef<string, SourceCardinality, infer R, any> ? R : unknown;
183
- /**
184
- * Per-source write accessors. Each method exists only when the generator found the matching
185
- * mutation. A `create`/`update` selects the source's own fragment, so it answers with the entity
186
- * in exactly the shape `fetch` yields; a `delete` answers with the id it removed. Nothing is
187
- * cached here — that is the job of the collection that owns the source in `@contello/store`.
188
- */
189
- type SourceWritersFor<S> = (WritesOf<S> extends {
190
- create: infer TCreate;
191
- } ? {
192
- create: (input: TCreate) => Promise<ResultOf<S>>;
193
- } : Record<never, never>) & (WritesOf<S> extends {
194
- update: infer TUpdate;
195
- } ? {
196
- update: (input: TUpdate) => Promise<ResultOf<S>>;
197
- } : Record<never, never>) & (WritesOf<S> extends {
198
- delete: infer TDelete;
199
- } ? {
200
- delete: (input: TDelete) => Promise<string>;
201
- } : Record<never, never>);
202
- /** Per-source runtime accessor: `client.sources.category.fetch()` → `Promise<CategoryFragment[]>` etc. */
203
- type SourceAccessors<TSources extends SourceMap> = { [K in keyof TSources]: {
204
- fetch: SourceFetcherFor<TSources[K]>;
205
- } & SourceWritersFor<TSources[K]>; };
206
- //#endregion
207
- //#region src/upload.d.ts
208
- type UploadMetadata = {
209
- name: string;
210
- mimeType?: string | undefined;
211
- size?: number | undefined;
212
- annotations?: {
213
- key: string;
214
- value: string;
215
- }[] | undefined;
216
- collectionRefs?: string[] | undefined;
217
- /**
218
- * `deleteIfNotUsed` lets the server delete the asset once nothing references it.
219
- * @default 'retain'
220
- */
221
- retentionPolicy?: 'retain' | 'deleteIfNotUsed' | undefined;
222
- };
223
- type UploadData = Uint8Array | ReadableStream$1<Uint8Array> | ReadableStream<Uint8Array>;
224
- type UploadOptions = {
225
- chunkSize?: number | undefined;
226
- abort?: AbortSignal | undefined;
227
- };
228
- //#endregion
229
- //#region src/client.d.ts
230
- type ConnectionContext = {
231
- connectionId: string;
232
- websocketUrl: string;
233
- };
234
- type ConnectionEvents = {
235
- onConnected?: ((context: ConnectionContext) => void) | undefined;
236
- onConnecting?: ((context: ConnectionContext) => void) | undefined;
237
- onClosed?: ((context: ConnectionContext) => void) | undefined;
238
- onError?: ((context: ConnectionContext, error: unknown) => void) | undefined;
239
- };
240
- type ContelloClientOptions<TSchema extends Schema | undefined = undefined> = {
241
- url: string;
242
- project: string;
243
- token: string;
244
- schema?: TSchema | undefined;
245
- connections?: number | undefined;
246
- http?: HttpAgentOptions | undefined;
247
- onConnected?: (() => void) | undefined;
248
- onReconnecting?: (() => void) | undefined;
249
- onError?: ((error: unknown) => void) | undefined;
250
- connectionEvents?: ConnectionEvents | undefined;
251
- };
252
- export declare class ContelloClient<TSchema extends Schema | undefined = undefined> {
253
- private _pool;
254
- private _rpc;
255
- private _sources;
256
- private _url;
257
- private _project;
258
- private _token;
259
- private _agent;
260
- constructor(options: ContelloClientOptions<TSchema>);
261
- get rpc(): TSchema extends Schema<infer TOps, any, any> ? Rpc<TOps> : never;
262
- get sources(): TSchema extends Schema<any, infer TSources, any> ? SourceAccessors<TSources> : never;
263
- init(): Promise<void>;
264
- destroy(): Promise<void>;
265
- ping(): Promise<void>;
266
- /**
267
- * What a temporary token the Contello ui handed to an extension page stands for in the project of
268
- * this client: the user and the user's effective permissions, or inactive. The client's
269
- * application needs read access to the project. See `createTokenIntrospector` for the caching
270
- * wrapper a backend puts in front of its requests.
271
- */
272
- introspectToken(token: string): Promise<TokenIntrospection>;
273
- /**
274
- * Open a subscription on the websocket. Each `[Symbol.asyncIterator]()` call (the implicit one
275
- * from `for await`, or via `rxjs.from(this)`) starts a fresh server subscription and tears it
276
- * down when the iterator is returned (`break`, error, or explicit stop).
277
- */
278
- subscribe<TData>(query: string, variables?: Record<string, unknown> | undefined): AsyncIterable<TData>;
279
- download(fileId: string): Promise<DownloadResult>;
280
- proxyHls(path: string, signal?: AbortSignal | undefined): Promise<ProxyResult>;
281
- proxySitemap(sitemapId: string, options: SitemapProxyOptions, signal?: AbortSignal | undefined): Promise<ProxyResult>;
282
- upload(data: UploadData, meta: UploadMetadata, options?: UploadOptions | undefined): Promise<string>;
283
- execute<TData>(query: string, variables?: Record<string, unknown> | undefined): Promise<TData>;
284
- }
285
- export declare function createContelloClient<TSchema extends Schema | undefined = undefined>(options: ContelloClientOptions<TSchema>): ContelloClient<TSchema>;
286
- //#endregion
287
- //#region src/scalars.d.ts
1
+ import { A as DownloadResult, C as IntrospectedUser, D as TokenIntrospector, E as TokenIntrospection, M as ProxyResult, N as SitemapProxyOptions, O as TokenIntrospectorOptions, S as SourceWrites, T as ResourcePermissions, _ as SourceMap, a as createContelloClient, b as SourceMutationResult, c as UploadOptions, d as OperationMap, f as Rpc, g as SourceDef, h as SourceCardinality, i as ContelloClientOptions, j as HttpAgentOptions, k as createTokenIntrospector, l as OperationDef, m as SourceAccessors, n as ConnectionEvents, o as UploadData, p as Schema, r as ContelloClient, s as UploadMetadata, t as ConnectionContext, u as OperationKind, v as SourceMutationArgument, w as ResourceAction, x as SourceMutations, y as SourceMutationBinding } from "./client-BxOONMjD.js";
288
2
  type LocalDateTime = {
289
3
  year: number;
290
4
  month: number;
@@ -298,11 +12,7 @@ type LocalDate = {
298
12
  month: number;
299
13
  day: number;
300
14
  };
301
- //#endregion
302
- //#region src/source-subscription.d.ts
303
15
  export declare function createSourceSubscription(source: SourceDef): string;
304
- //#endregion
305
- //#region src/source-mutation.d.ts
306
16
  type SourceMutationKind = keyof SourceMutations;
307
17
  /** What a write takes: the caller's input, and the id for a delete. */
308
18
  type SourceMutationValues = {
@@ -320,8 +30,6 @@ export declare function createSourceMutation(source: SourceDef, kind: SourceMuta
320
30
  export declare function createSourceMutationVariables(binding: SourceMutationBinding, values: SourceMutationValues): Record<string, unknown>;
321
31
  /** Pulls the id out of whatever shape the mutation answered with. */
322
32
  export declare function readSourceMutationId(binding: SourceMutationBinding, result: unknown): string;
323
- //#endregion
324
- //#region src/built-in-mutations.d.ts
325
33
  /**
326
34
  * Write bindings for the built-in sources. Unlike entity mutations these are not derived — their
327
35
  * field and argument names are fixed parts of every Contello schema — but the generator still
@@ -335,6 +43,5 @@ export declare function readSourceMutationId(binding: SourceMutationBinding, res
335
43
  * Assets have no `create` — an asset comes into being through `client.upload()`, not a mutation.
336
44
  */
337
45
  export declare const BUILT_IN_MUTATIONS: Partial<Record<SourceCardinality, SourceMutations>>;
338
- //#endregion
339
- export type { ConnectionContext, ConnectionEvents, ContelloClientOptions, DownloadResult, HttpAgentOptions, IntrospectedUser, LocalDate, LocalDateTime, OperationDef, OperationKind, OperationMap, ProxyResult, ResourceAction, ResourcePermissions, Rpc, Schema, SitemapProxyOptions, SourceAccessors, SourceCardinality, SourceDef, SourceMap, SourceMutationArgument, SourceMutationBinding, SourceMutationKind, SourceMutationResult, SourceMutationValues, SourceMutations, SourceWrites, TokenIntrospection, TokenIntrospector, TokenIntrospectorOptions, UploadData, UploadMetadata, UploadOptions };
46
+ export { type ConnectionContext, type ConnectionEvents, ContelloClient, type ContelloClientOptions, type DownloadResult, type HttpAgentOptions, type IntrospectedUser, type LocalDate, type LocalDateTime, type OperationDef, type OperationKind, type OperationMap, type ProxyResult, type ResourceAction, type ResourcePermissions, type Rpc, type Schema, type SitemapProxyOptions, type SourceAccessors, type SourceCardinality, type SourceDef, type SourceMap, type SourceMutationArgument, type SourceMutationBinding, type SourceMutationKind, type SourceMutationResult, type SourceMutationValues, type SourceMutations, type SourceWrites, type TokenIntrospection, type TokenIntrospector, type TokenIntrospectorOptions, type UploadData, type UploadMetadata, type UploadOptions, createContelloClient, createTokenIntrospector };
340
47
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["NodeReadableStream"],"sources":["../src/http.ts","../src/introspection.ts","../src/types.ts","../src/upload.ts","../src/client.ts","../src/scalars.ts","../src/source-subscription.ts","../src/source-mutation.ts","../src/built-in-mutations.ts"],"mappings":";;;KAkCY;EACV;EACA;EACA;EACA;;KAcU;EACV;EACA;EACA,SAAS,QAAQ;EACjB,UAAU,eAAe;;KAiCf;EACV;EACA,SAAS;EACT,UAAU,eAAe;;KAqBf;;EAEV;;EAEA;;EAEA;;EAEA;;;;KCjHU;KAKA;EACV;EACA;EACA,SAAS;;KAGC;EACV;EACA;EACA;EACA;EACA;;KAKU;EACN;;EAEF;EAEA;EACA,WAAW;EACX,MAAM;EACN,aAAa;;KAgCL;EAGV;EAGA;EAEA;;KAGU;EACV,aAAa,kBAAkB,QAAQ;;wBAUzB,wBACd,aAAa,kBAAkB,QAAQ,qBACvC,SAAS,2BACR;;;KC9FS;KAEA,aACV,mBACA,aAAa,yBACb,cAAc,gBAAgB;EAE9B;EACA,MAAM;;EAEN,WAAW;;EAEX,cAAc;;KAGJ,eAAe,eAAe;KAE9B,YAAY,UAAU,gBAAgB,YAAY;KAClD,eAAe,UAAU,gBAAgB,YAAY;KAErD,UAAU,UAAU,gBAAgB,mCAC5C,eAAe,WAAW,8BAClB,cAAc,YAAY,OAC/B,WAAW,eAAe,OAAO,cAAc,YAAY,MAC9D,eAAe,WAAW,8BAClB,QAAQ,YAAY,OACzB,WAAW,eAAe,OAAO,QAAQ,YAAY;KAEhD,IAAI,UAAU,mBACvB,WAAW,IAAI,UAAU,EAAE;;;;;;;;;KAWlB;;;;;;KAOA;;EAEV;;EAEA;;EAEA;;;;;EAKA;;;;;;;;KASU;;;;;KAMA;;EAEV;EACA,W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SAAS,mBAAmB;;KAG9B,sBAAsB,gBAAgB;EAChD;EACA;EACA;EACA,SAAS;EACT;EACA,OAAO;EACP;EACA;EACA,YAAY;EACZ,mBAAmB;;qBAKR,eAAe,gBAAgB;UAClC;UACA;UACA;UACA;UACA;UACA;UACA;EAEI,YAAA,SAAS,sBAAsB;MAuFvC,OAAO,gBAAgB,aAAa,kBAAkB,IAAI;MAQ1D,WAAW,gBAAgB,kBAAkB,iBAAiB,gBAAgB;EAQ5E,QAAQ;EAIR,WAAW;EAKX,QAAQ;;;;;;;EAWd,gBAAgB,gBAAgB,QAAQ;;;;;;EAaxC,UAAU,OAAO,eAAe,YAAY,sCAAsC,cAAc;EA2FhG,SAAS,iBAAiB,QAAQ;EAIlC,SAAS,cAAc,SAAS,0BAA0B,QAAQ;EAIlE,aACE,mBACA,SAAS,qBACT,SAAS,0BACR,QAAQ;EAOX,OAAO,MAAM,YAAY,MAAM,gBAAgB,UAAU,4BAA4B;EAOrF,QAAQ,OAAO,eAAe,YAAY,sCAAsC,QAAQ;;wBAS1E,qBAAqB,gBAAgB,gCACnD,SAAS,sBAAsB,WAC9B,eAAe;;;KCrUN;EACV;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;EACA;;;;wBCcc,yBAAyB,QAAQ;;;KCvBrC,2BAA2B;;KAG3B;EACV;EACA;;;wBAwBc,qBAAqB,QAAQ,WAAW,MAAM;;;;;;;wBA+B9C,8BACd,SAAS,uBACT,QAAQ,uBACP;;wBAYa,qBAAqB,SAAS,uBAAuB;;;;;;;;;;;;;;;qBChExD,oBAAoB,QAAQ,OAAO,mBAAmB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/scalars.ts","../src/source-subscription.ts","../src/source-mutation.ts","../src/built-in-mutations.ts"],"mappings":";KAAY;EACV;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;EACA;;wBCcc,yBAAyB,QAAQ;KCvBrC,2BAA2B;;KAG3B;EACV;EACA;;;wBAwBc,qBAAqB,QAAQ,WAAW,MAAM;;;;;;;wBA+B9C,8BACd,SAAS,uBACT,QAAQ,uBACP;;wBAYa,qBAAqB,SAAS,uBAAuB;;;;;;;;;;;;;qBChExD,oBAAoB,QAAQ,OAAO,mBAAmB"}