@fmaplabs/meta-manifest 0.1.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.
@@ -0,0 +1,602 @@
1
+ import { A as AdminGraphQLClient } from './client-CdkKviW2.cjs';
2
+ export { S as SyncTransportError } from './client-CdkKviW2.cjs';
3
+
4
+ declare const DEFAULT_API_VERSION = "2026-07";
5
+ interface Config {
6
+ /** e.g. "my-store.myshopify.com" */
7
+ shop: string;
8
+ /** Admin API access token; reference via process.env in your config file. */
9
+ accessToken: string;
10
+ /** Admin API version. Defaults to DEFAULT_API_VERSION. */
11
+ apiVersion?: string;
12
+ /** Path to the schema module whose `schemas` export drives diff/push, and pull writes. */
13
+ schema: string;
14
+ }
15
+ /** Identity helper for type inference in `meta-manifest.config.ts`. */
16
+ declare function defineConfig(config: Config): Config;
17
+ /** Validate a loaded config object, throwing a one-line Error naming the first missing field. */
18
+ declare function validateConfig(raw: unknown): Config;
19
+
20
+ interface StandardSchemaV1<Input = unknown, Output = Input> {
21
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
22
+ }
23
+ declare namespace StandardSchemaV1 {
24
+ interface Props<Input = unknown, Output = Input> {
25
+ readonly version: 1;
26
+ readonly vendor: string;
27
+ readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
28
+ readonly types?: Types<Input, Output>;
29
+ }
30
+ type Result<Output> = SuccessResult<Output> | FailureResult;
31
+ interface SuccessResult<Output> {
32
+ readonly value: Output;
33
+ readonly issues?: undefined;
34
+ }
35
+ interface FailureResult {
36
+ readonly issues: ReadonlyArray<Issue>;
37
+ }
38
+ interface Issue {
39
+ readonly message: string;
40
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment>;
41
+ }
42
+ interface PathSegment {
43
+ readonly key: PropertyKey;
44
+ }
45
+ interface Types<Input = unknown, Output = Input> {
46
+ readonly input: Input;
47
+ readonly output: Output;
48
+ }
49
+ type InferInput<S extends StandardSchemaV1> = NonNullable<S["~standard"]["types"]>["input"];
50
+ type InferOutput<S extends StandardSchemaV1> = NonNullable<S["~standard"]["types"]>["output"];
51
+ }
52
+
53
+ type FieldValidation = {
54
+ name: string;
55
+ value: string;
56
+ };
57
+ type Issue = {
58
+ message: string;
59
+ path?: PropertyKey[];
60
+ };
61
+ type DecodeResult<T> = {
62
+ value: T;
63
+ issues?: undefined;
64
+ } | {
65
+ value?: undefined;
66
+ issues: Issue[];
67
+ };
68
+ declare abstract class Field<TOut, TIn = TOut, Req extends boolean = false> {
69
+ abstract readonly shopifyType: string;
70
+ /** True when Shopify stores this type as a JSON string (objects, lists). */
71
+ protected readonly wireIsJson: boolean;
72
+ required: boolean;
73
+ name?: string;
74
+ description?: string;
75
+ readonly _out: TOut;
76
+ readonly _in: TIn;
77
+ readonly _req: Req;
78
+ /** Shopify definition validations, e.g. [{ name: "max", value: "120" }]. */
79
+ abstract validations(): FieldValidation[];
80
+ /** Typed value -> JSON representation (number/string/object). */
81
+ protected abstract toJson(value: TIn): unknown;
82
+ /** JSON representation -> typed value (no constraint checking). */
83
+ protected abstract fromJson(json: unknown): DecodeResult<TOut>;
84
+ /** Constraint validation on an already-typed value. */
85
+ protected check(_value: TOut): Issue[];
86
+ /** Shopify wire (string or jsonValue) -> typed value (no constraint checking). */
87
+ coerce(wire: unknown): DecodeResult<TOut>;
88
+ /** Shopify wire -> typed value, validated. */
89
+ decode(wire: unknown): DecodeResult<TOut>;
90
+ /** Typed value -> Shopify wire string. */
91
+ encode(value: TIn): string;
92
+ /** Element-level JSON form (for embedding inside list values). */
93
+ elementToJson(value: TIn): unknown;
94
+ /** Element-level decode from a JSON form (coerce + check), for list elements. */
95
+ elementFromJson(json: unknown): DecodeResult<TOut>;
96
+ get ["~standard"](): StandardSchemaV1.Props<TIn, TOut>;
97
+ }
98
+
99
+ interface BooleanOptions<R extends boolean = false> {
100
+ name?: string;
101
+ description?: string;
102
+ required?: R;
103
+ }
104
+ declare class BooleanField<R extends boolean> extends Field<boolean, boolean, R> {
105
+ readonly shopifyType = "boolean";
106
+ constructor(opts: BooleanOptions<R>);
107
+ validations(): FieldValidation[];
108
+ protected toJson(value: boolean): unknown;
109
+ protected fromJson(json: unknown): DecodeResult<boolean>;
110
+ }
111
+ declare function boolean<R extends boolean = false>(opts?: BooleanOptions<R>): BooleanField<R>;
112
+
113
+ type InnerOut<E> = E extends Field<infer O, any, any> ? O : never;
114
+ type InnerIn<E> = E extends Field<any, infer I, any> ? I : never;
115
+ interface ListOptions<R extends boolean = false> {
116
+ name?: string;
117
+ description?: string;
118
+ required?: R;
119
+ min?: number;
120
+ max?: number;
121
+ }
122
+ declare class ListField<E extends Field<any, any, any>, R extends boolean> extends Field<InnerOut<E>[], InnerIn<E>[], R> {
123
+ private readonly inner;
124
+ private readonly o;
125
+ readonly shopifyType: string;
126
+ protected readonly wireIsJson = true;
127
+ constructor(inner: E, o: ListOptions<R>);
128
+ validations(): FieldValidation[];
129
+ protected toJson(value: InnerIn<E>[]): unknown;
130
+ protected fromJson(json: unknown): DecodeResult<InnerOut<E>[]>;
131
+ }
132
+ declare function list<E extends Field<any, any, any>, R extends boolean = false>(inner: E, opts?: ListOptions<R>): ListField<E, R>;
133
+
134
+ interface Measure {
135
+ value: number;
136
+ unit: string;
137
+ }
138
+ interface MeasureOptions<R extends boolean = false> {
139
+ name?: string;
140
+ description?: string;
141
+ required?: R;
142
+ }
143
+ declare class MeasurementField<R extends boolean> extends Field<Measure, Measure, R> {
144
+ readonly shopifyType: "dimension" | "weight" | "volume";
145
+ protected readonly wireIsJson = true;
146
+ constructor(opts: MeasureOptions<R>, shopifyType: "dimension" | "weight" | "volume");
147
+ validations(): FieldValidation[];
148
+ protected toJson(value: Measure): unknown;
149
+ protected fromJson(json: unknown): DecodeResult<Measure>;
150
+ }
151
+ declare function dimension<R extends boolean = false>(opts?: MeasureOptions<R>): MeasurementField<R>;
152
+ declare function weight<R extends boolean = false>(opts?: MeasureOptions<R>): MeasurementField<R>;
153
+ declare function volume<R extends boolean = false>(opts?: MeasureOptions<R>): MeasurementField<R>;
154
+
155
+ interface Money {
156
+ amount: string;
157
+ currencyCode: string;
158
+ }
159
+ interface MoneyOptions<R extends boolean = false> {
160
+ name?: string;
161
+ description?: string;
162
+ required?: R;
163
+ }
164
+ declare class MoneyField<R extends boolean> extends Field<Money, Money, R> {
165
+ readonly shopifyType = "money";
166
+ protected readonly wireIsJson = true;
167
+ constructor(opts: MoneyOptions<R>);
168
+ validations(): FieldValidation[];
169
+ protected toJson(value: Money): unknown;
170
+ protected fromJson(json: unknown): DecodeResult<Money>;
171
+ }
172
+ declare function money<R extends boolean = false>(opts?: MoneyOptions<R>): MoneyField<R>;
173
+
174
+ interface NumberOptions<R extends boolean = false> {
175
+ name?: string;
176
+ description?: string;
177
+ required?: R;
178
+ min?: number;
179
+ max?: number;
180
+ }
181
+ interface DecimalOptions<R extends boolean = false> extends NumberOptions<R> {
182
+ maxPrecision?: number;
183
+ }
184
+ declare abstract class NumericField<R extends boolean> extends Field<number, number, R> {
185
+ protected readonly opts: NumberOptions<R>;
186
+ constructor(opts: NumberOptions<R>);
187
+ protected toJson(value: number): unknown;
188
+ protected fromJson(json: unknown): DecodeResult<number>;
189
+ protected rangeIssues(value: number): Issue[];
190
+ protected baseValidations(): FieldValidation[];
191
+ }
192
+ declare class IntegerField<R extends boolean> extends NumericField<R> {
193
+ readonly shopifyType = "number_integer";
194
+ validations(): FieldValidation[];
195
+ protected check(value: number): Issue[];
196
+ }
197
+ declare class DecimalField<R extends boolean> extends NumericField<R> {
198
+ private readonly decimalOpts;
199
+ readonly shopifyType = "number_decimal";
200
+ constructor(decimalOpts: DecimalOptions<R>);
201
+ validations(): FieldValidation[];
202
+ protected check(value: number): Issue[];
203
+ }
204
+ declare function integer<R extends boolean = false>(opts?: NumberOptions<R>): IntegerField<R>;
205
+ declare function decimal<R extends boolean = false>(opts?: DecimalOptions<R>): DecimalField<R>;
206
+
207
+ interface Rating {
208
+ value: number;
209
+ scaleMin: number;
210
+ scaleMax: number;
211
+ }
212
+ interface RatingInput {
213
+ value: number;
214
+ }
215
+ interface RatingOptions<R extends boolean = false> {
216
+ name?: string;
217
+ description?: string;
218
+ required?: R;
219
+ min: number;
220
+ max: number;
221
+ }
222
+ declare class RatingField<R extends boolean> extends Field<Rating, RatingInput, R> {
223
+ private readonly o;
224
+ readonly shopifyType = "rating";
225
+ protected readonly wireIsJson = true;
226
+ constructor(o: RatingOptions<R>);
227
+ validations(): FieldValidation[];
228
+ protected toJson(value: RatingInput): unknown;
229
+ protected fromJson(json: unknown): DecodeResult<Rating>;
230
+ protected check(value: Rating): Issue[];
231
+ get ["~standard"](): StandardSchemaV1.Props<RatingInput, Rating>;
232
+ }
233
+ declare function rating<R extends boolean = false>(opts: RatingOptions<R>): RatingField<R>;
234
+
235
+ interface RefOptions<R extends boolean = false> {
236
+ name?: string;
237
+ description?: string;
238
+ required?: R;
239
+ }
240
+ declare abstract class GidField<R extends boolean> extends Field<string, string, R> {
241
+ constructor(opts: RefOptions<R>);
242
+ protected toJson(value: string): unknown;
243
+ protected fromJson(json: unknown): DecodeResult<string>;
244
+ }
245
+ declare class SimpleRefField<R extends boolean> extends GidField<R> {
246
+ readonly shopifyType: string;
247
+ constructor(opts: RefOptions<R>, shopifyType: string);
248
+ validations(): FieldValidation[];
249
+ }
250
+ type FileType = "Image" | "Video";
251
+ interface FileOptions<R extends boolean = false> extends RefOptions<R> {
252
+ accept?: readonly FileType[];
253
+ }
254
+ declare class FileField<R extends boolean> extends GidField<R> {
255
+ private readonly o;
256
+ readonly shopifyType = "file_reference";
257
+ constructor(o: FileOptions<R>);
258
+ validations(): FieldValidation[];
259
+ }
260
+ type TypeRef = {
261
+ type: string;
262
+ } | (() => {
263
+ type: string;
264
+ });
265
+ declare class MetaobjectRefField<R extends boolean> extends GidField<R> {
266
+ private readonly target;
267
+ readonly shopifyType = "metaobject_reference";
268
+ constructor(target: TypeRef, opts: RefOptions<R>);
269
+ validations(): FieldValidation[];
270
+ }
271
+ declare function product<R extends boolean = false>(opts?: RefOptions<R>): SimpleRefField<R>;
272
+ declare function variant<R extends boolean = false>(opts?: RefOptions<R>): SimpleRefField<R>;
273
+ declare function collection<R extends boolean = false>(opts?: RefOptions<R>): SimpleRefField<R>;
274
+ declare function page<R extends boolean = false>(opts?: RefOptions<R>): SimpleRefField<R>;
275
+ declare function file<R extends boolean = false>(opts?: FileOptions<R>): FileField<R>;
276
+ declare function ref<R extends boolean = false>(target: TypeRef, opts?: RefOptions<R>): MetaobjectRefField<R>;
277
+
278
+ interface BaseOptions<R extends boolean = false> {
279
+ name?: string;
280
+ description?: string;
281
+ required?: R;
282
+ }
283
+ declare abstract class StringScalarField<R extends boolean> extends Field<string, string, R> {
284
+ constructor(opts: BaseOptions<R>);
285
+ protected toJson(value: string): unknown;
286
+ protected fromJson(json: unknown): DecodeResult<string>;
287
+ }
288
+ interface DateOptions<R extends boolean = false> extends BaseOptions<R> {
289
+ min?: string;
290
+ max?: string;
291
+ }
292
+ declare class DateField<R extends boolean> extends StringScalarField<R> {
293
+ private readonly o;
294
+ readonly shopifyType: "date" | "date_time";
295
+ constructor(o: DateOptions<R>, shopifyType: "date" | "date_time");
296
+ validations(): FieldValidation[];
297
+ }
298
+ interface UrlOptions<R extends boolean = false> extends BaseOptions<R> {
299
+ allowedDomains?: readonly string[];
300
+ }
301
+ declare class UrlField<R extends boolean> extends StringScalarField<R> {
302
+ private readonly o;
303
+ readonly shopifyType = "url";
304
+ constructor(o: UrlOptions<R>);
305
+ validations(): FieldValidation[];
306
+ }
307
+ declare class ColorField<R extends boolean> extends StringScalarField<R> {
308
+ readonly shopifyType = "color";
309
+ validations(): FieldValidation[];
310
+ protected check(value: string): Issue[];
311
+ }
312
+ declare class JsonField<R extends boolean> extends Field<unknown, unknown, R> {
313
+ readonly shopifyType = "json";
314
+ protected readonly wireIsJson = true;
315
+ constructor(opts: BaseOptions<R>);
316
+ validations(): FieldValidation[];
317
+ protected toJson(value: unknown): unknown;
318
+ protected fromJson(json: unknown): DecodeResult<unknown>;
319
+ }
320
+ declare function date<R extends boolean = false>(opts?: DateOptions<R>): DateField<R>;
321
+ declare function dateTime<R extends boolean = false>(opts?: DateOptions<R>): DateField<R>;
322
+ declare function url<R extends boolean = false>(opts?: UrlOptions<R>): UrlField<R>;
323
+ declare function color<R extends boolean = false>(opts?: BaseOptions<R>): ColorField<R>;
324
+ declare function json<R extends boolean = false>(opts?: BaseOptions<R>): JsonField<R>;
325
+
326
+ interface TextOptions<R extends boolean = false> {
327
+ name?: string;
328
+ description?: string;
329
+ required?: R;
330
+ min?: number;
331
+ max?: number;
332
+ regex?: string;
333
+ choices?: readonly string[];
334
+ }
335
+ type MultilineOptions<R extends boolean = false> = Omit<TextOptions<R>, "choices">;
336
+ declare class TextField<R extends boolean> extends Field<string, string, R> {
337
+ private readonly opts;
338
+ readonly shopifyType: string;
339
+ constructor(opts: TextOptions<R>, multiline: boolean);
340
+ validations(): FieldValidation[];
341
+ protected toJson(value: string): unknown;
342
+ protected fromJson(json: unknown): DecodeResult<string>;
343
+ protected check(value: string): Issue[];
344
+ }
345
+ declare function text<R extends boolean = false>(opts?: TextOptions<R>): TextField<R>;
346
+ declare function multilineText<R extends boolean = false>(opts?: MultilineOptions<R>): TextField<R>;
347
+
348
+ declare const m: {
349
+ readonly text: typeof text;
350
+ readonly multilineText: typeof multilineText;
351
+ readonly integer: typeof integer;
352
+ readonly decimal: typeof decimal;
353
+ readonly boolean: typeof boolean;
354
+ readonly date: typeof date;
355
+ readonly dateTime: typeof dateTime;
356
+ readonly url: typeof url;
357
+ readonly color: typeof color;
358
+ readonly json: typeof json;
359
+ readonly money: typeof money;
360
+ readonly dimension: typeof dimension;
361
+ readonly weight: typeof weight;
362
+ readonly volume: typeof volume;
363
+ readonly rating: typeof rating;
364
+ readonly product: typeof product;
365
+ readonly variant: typeof variant;
366
+ readonly collection: typeof collection;
367
+ readonly page: typeof page;
368
+ readonly file: typeof file;
369
+ readonly ref: typeof ref;
370
+ readonly list: typeof list;
371
+ };
372
+
373
+ type FieldMap = Record<string, Field<any, any, any>>;
374
+ type FieldOut<T> = T extends Field<infer O, any, any> ? O : never;
375
+ type FieldIn<T> = T extends Field<any, infer I, any> ? I : never;
376
+ type IsRequired<T> = T extends Field<any, any, true> ? true : false;
377
+ type RequiredKeys<F extends FieldMap> = {
378
+ [K in keyof F]: IsRequired<F[K]> extends true ? K : never;
379
+ }[keyof F];
380
+ type OptionalKeys<F extends FieldMap> = Exclude<keyof F, RequiredKeys<F>>;
381
+ type Simplify<T> = {
382
+ [K in keyof T]: T[K];
383
+ } & {};
384
+ type Infer<F extends FieldMap> = Simplify<{
385
+ [K in RequiredKeys<F>]: FieldOut<F[K]>;
386
+ } & {
387
+ [K in OptionalKeys<F>]?: FieldOut<F[K]>;
388
+ }>;
389
+ type InferInput<F extends FieldMap> = Simplify<{
390
+ [K in RequiredKeys<F>]: FieldIn<F[K]>;
391
+ } & {
392
+ [K in OptionalKeys<F>]?: FieldIn<F[K]>;
393
+ }>;
394
+
395
+ interface FieldDefinitionInput {
396
+ key: string;
397
+ name: string;
398
+ description?: string;
399
+ required: boolean;
400
+ type: string;
401
+ validations: FieldValidation[];
402
+ }
403
+ interface MetaobjectDefinitionInput {
404
+ type: string;
405
+ name: string;
406
+ description?: string;
407
+ displayNameKey?: string;
408
+ access?: {
409
+ admin?: string;
410
+ storefront?: string;
411
+ };
412
+ capabilities?: Record<string, {
413
+ enabled: boolean;
414
+ }>;
415
+ fieldDefinitions: FieldDefinitionInput[];
416
+ }
417
+ declare function toDefinitionInput<F extends FieldMap>(schema: MetaobjectSchema<F>): MetaobjectDefinitionInput;
418
+
419
+ interface AccessConfig {
420
+ admin?: "merchant_read" | "merchant_read_write";
421
+ storefront?: "public_read" | "none";
422
+ }
423
+ interface CapabilitiesConfig {
424
+ publishable?: boolean;
425
+ translatable?: boolean;
426
+ renderable?: boolean;
427
+ }
428
+ interface MetaobjectConfig<F> {
429
+ name: string;
430
+ description?: string;
431
+ displayName?: keyof F & string;
432
+ access?: AccessConfig;
433
+ capabilities?: CapabilitiesConfig;
434
+ fields: F;
435
+ }
436
+ type ParseInput = ReadonlyArray<{
437
+ key: string;
438
+ jsonValue?: unknown;
439
+ value?: unknown;
440
+ }> | Record<string, unknown>;
441
+ interface MetaobjectSchema<F extends FieldMap> {
442
+ readonly handle: string;
443
+ readonly type: string;
444
+ readonly config: MetaobjectConfig<F>;
445
+ readonly fields: F;
446
+ parse(input: ParseInput): {
447
+ value: Infer<F>;
448
+ issues?: undefined;
449
+ } | {
450
+ value?: undefined;
451
+ issues: Issue[];
452
+ };
453
+ encode(value: InferInput<F>): Array<{
454
+ key: string;
455
+ value: string;
456
+ }>;
457
+ toDefinitionInput(): MetaobjectDefinitionInput;
458
+ readonly ["~standard"]: StandardSchemaV1.Props<InferInput<F>, Infer<F>>;
459
+ }
460
+ declare function defineMetaobject<F extends Record<string, unknown>>(handle: string, config: MetaobjectConfig<F>): F extends FieldMap ? MetaobjectSchema<F> : never;
461
+
462
+ interface RemoteField {
463
+ key: string;
464
+ type: string;
465
+ required: boolean;
466
+ validations: FieldValidation[];
467
+ }
468
+ interface RemoteDefinition {
469
+ type: string;
470
+ name?: string;
471
+ fields: RemoteField[];
472
+ }
473
+ declare function normalizeLocal<F extends FieldMap>(schema: MetaobjectSchema<F>): RemoteDefinition;
474
+ interface PulledFieldDefinition {
475
+ key: string;
476
+ type: {
477
+ name: string;
478
+ } | string;
479
+ required: boolean;
480
+ validations?: FieldValidation[];
481
+ }
482
+ interface PulledDefinition {
483
+ type: string;
484
+ name?: string;
485
+ fieldDefinitions: PulledFieldDefinition[];
486
+ }
487
+ declare function normalizeRemote(def: PulledDefinition): RemoteDefinition;
488
+
489
+ /**
490
+ * Generate `schema.ts` source (using `defineMetaobject`/`m`) from remote definitions.
491
+ * Definitions are emitted in dependency order so `m.ref(...)` points at a declared const.
492
+ * Unmapped types/validations become `// TODO: unmapped …` and are logged via console.warn.
493
+ */
494
+ declare function generateSchemaSource(defs: RemoteDefinition[]): string;
495
+
496
+ type DiffOp = {
497
+ kind: "createDefinition";
498
+ type: string;
499
+ definition: RemoteDefinition;
500
+ } | {
501
+ kind: "addField";
502
+ type: string;
503
+ field: RemoteField;
504
+ } | {
505
+ kind: "updateField";
506
+ type: string;
507
+ key: string;
508
+ changes: Partial<RemoteField>;
509
+ } | {
510
+ kind: "changeFieldType";
511
+ type: string;
512
+ key: string;
513
+ from: string;
514
+ to: string;
515
+ destructive: true;
516
+ } | {
517
+ kind: "removeField";
518
+ type: string;
519
+ key: string;
520
+ destructive: true;
521
+ };
522
+ declare function diff(local: RemoteDefinition[], remote: RemoteDefinition[]): DiffOp[];
523
+
524
+ /**
525
+ * A definition read back from the store. `type` is the canonical "$app:…" key
526
+ * (the REQUESTED type, re-labeled from the resolved `app--…` form Shopify
527
+ * returns) so `diff()` matches local↔remote; `id` is the GID `push` threads into
528
+ * update ops. [design §6]
529
+ */
530
+ interface PulledRemote {
531
+ id: string;
532
+ type: string;
533
+ definition: PulledDefinition;
534
+ }
535
+ /**
536
+ * Reads the current metaobject definitions for the given `$app:` types. A type
537
+ * absent from the store is omitted (so `diff()` emits a create). Each present
538
+ * node is re-labeled with the requested type and its `id` is captured. [design §6]
539
+ */
540
+ declare function pull(client: AdminGraphQLClient, types: readonly string[]): Promise<PulledRemote[]>;
541
+ /**
542
+ * Enumerate every metaobject definition in the store. By default returns only
543
+ * app-owned definitions, re-labeled to canonical "$app:<handle>" types so they
544
+ * round-trip through `defineMetaobject`. [design §3]
545
+ */
546
+ declare function pullAll(client: AdminGraphQLClient, opts?: {
547
+ appOwnedOnly?: boolean;
548
+ }): Promise<PulledRemote[]>;
549
+
550
+ interface PushOptions {
551
+ /** Apply destructive ops (`removeField`, `changeFieldType`). Default false. */
552
+ allowDestructive?: boolean;
553
+ }
554
+ type PushOpResult = {
555
+ op: DiffOp;
556
+ status: "applied";
557
+ id?: string;
558
+ } | {
559
+ op: DiffOp;
560
+ status: "skipped";
561
+ reason: "destructive";
562
+ } | {
563
+ op: DiffOp;
564
+ status: "blocked";
565
+ reason: string;
566
+ } | {
567
+ op: DiffOp;
568
+ status: "failed";
569
+ userErrors: UserError[];
570
+ };
571
+ interface PushResult {
572
+ results: PushOpResult[];
573
+ counts: {
574
+ applied: number;
575
+ skipped: number;
576
+ blocked: number;
577
+ failed: number;
578
+ };
579
+ ok: boolean;
580
+ }
581
+ type UserError = {
582
+ field?: string[];
583
+ message: string;
584
+ code?: string;
585
+ };
586
+ /**
587
+ * Applies a `diff()` plan to a store. Safe ops run; destructive ops are skipped
588
+ * unless `allowDestructive`. Per-op `userErrors` become `failed` entries (never
589
+ * thrown); only transport / top-level GraphQL errors propagate. [design §7, §8]
590
+ *
591
+ * Create ops run in dependency order (a referenced type before its referencer);
592
+ * types in a reference cycle are `blocked`. Results are returned in plan order;
593
+ * client calls happen in execution order. [design §7]
594
+ */
595
+ declare function push(client: AdminGraphQLClient, plan: DiffOp[], sources: {
596
+ definitions: MetaobjectDefinitionInput[];
597
+ remote: PulledRemote[];
598
+ }, options?: PushOptions): Promise<PushResult>;
599
+
600
+ type AnySchema = MetaobjectSchema<any>;
601
+
602
+ export { type AccessConfig, AdminGraphQLClient, type AnySchema, type CapabilitiesConfig, type Config, DEFAULT_API_VERSION, type DecodeResult, type DiffOp, Field, type FieldDefinitionInput, type FieldValidation, type FileType, type Infer, type InferInput, type Issue, type Measure, type MetaobjectConfig, type MetaobjectDefinitionInput, type MetaobjectSchema, type Money, type ParseInput, type PulledRemote, type PushOpResult, type PushOptions, type PushResult, type Rating, type RatingInput, type RemoteDefinition, type RemoteField, StandardSchemaV1, type TypeRef, defineConfig, defineMetaobject, diff, generateSchemaSource, m, normalizeLocal, normalizeRemote, pull, pullAll, push, toDefinitionInput, validateConfig };