@magiclabs.ai/magicbook-client 0.7.24-canary → 0.7.26

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/index.d.cts CHANGED
@@ -4288,6 +4288,9 @@ declare const styles: {
4288
4288
  e276151076d94d279d0d0b3608e3fba7: {
4289
4289
  slug: string;
4290
4290
  };
4291
+ cbec6602c5474f8fafc1980fb068db2a: {
4292
+ slug: string;
4293
+ };
4291
4294
  };
4292
4295
  declare const bookSizes: readonly ["4.5x4", "5x7", "6x6", "6x8", "7x5", "8x8", "8x11", "10x10", "11x8", "11x14", "12x12"];
4293
4296
  declare const coverTypes: readonly ["sc", "hc", "pl"];
@@ -4427,12 +4430,12 @@ declare class ImagesEndpoints {
4427
4430
  }
4428
4431
 
4429
4432
  declare const spreadServerSchema: z.ZodObject<{
4430
- id: z.ZodOptional<z.ZodString>;
4433
+ id: z.ZodString;
4431
4434
  book_id: z.ZodString;
4432
4435
  state: z.ZodString;
4433
4436
  spread_type: z.ZodString;
4434
- width: z.ZodOptional<z.ZodNumber>;
4435
- height: z.ZodOptional<z.ZodNumber>;
4437
+ width: z.ZodNumber;
4438
+ height: z.ZodNumber;
4436
4439
  sequence: z.ZodNumber;
4437
4440
  wells: z.ZodArray<z.ZodUnknown, "many">;
4438
4441
  background: z.ZodUnknown;
@@ -4442,7 +4445,10 @@ declare const spreadServerSchema: z.ZodObject<{
4442
4445
  metadata: z.ZodUnknown;
4443
4446
  url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4444
4447
  }, "strip", z.ZodTypeAny, {
4448
+ id: string;
4445
4449
  state: string;
4450
+ width: number;
4451
+ height: number;
4446
4452
  book_id: string;
4447
4453
  spread_type: string;
4448
4454
  sequence: number;
@@ -4450,14 +4456,14 @@ declare const spreadServerSchema: z.ZodObject<{
4450
4456
  laid_out_at: string | null;
4451
4457
  embellished_at: string | null;
4452
4458
  polished_at: string | null;
4453
- id?: string | undefined;
4454
4459
  url?: string | null | undefined;
4455
- width?: number | undefined;
4456
- height?: number | undefined;
4457
4460
  metadata?: unknown;
4458
4461
  background?: unknown;
4459
4462
  }, {
4463
+ id: string;
4460
4464
  state: string;
4465
+ width: number;
4466
+ height: number;
4461
4467
  book_id: string;
4462
4468
  spread_type: string;
4463
4469
  sequence: number;
@@ -4465,21 +4471,18 @@ declare const spreadServerSchema: z.ZodObject<{
4465
4471
  laid_out_at: string | null;
4466
4472
  embellished_at: string | null;
4467
4473
  polished_at: string | null;
4468
- id?: string | undefined;
4469
4474
  url?: string | null | undefined;
4470
- width?: number | undefined;
4471
- height?: number | undefined;
4472
4475
  metadata?: unknown;
4473
4476
  background?: unknown;
4474
4477
  }>;
4475
4478
  type SpreadServer = z.infer<typeof spreadServerSchema>;
4476
4479
  declare const spreadSchema: z.ZodObject<{
4477
- id: z.ZodOptional<z.ZodString>;
4480
+ id: z.ZodString;
4478
4481
  bookId: z.ZodString;
4479
4482
  state: z.ZodString;
4480
4483
  spreadType: z.ZodString;
4481
- width: z.ZodOptional<z.ZodNumber>;
4482
- height: z.ZodOptional<z.ZodNumber>;
4484
+ width: z.ZodNumber;
4485
+ height: z.ZodNumber;
4483
4486
  sequence: z.ZodNumber;
4484
4487
  wells: z.ZodArray<z.ZodUnknown, "many">;
4485
4488
  background: z.ZodUnknown;
@@ -4489,7 +4492,10 @@ declare const spreadSchema: z.ZodObject<{
4489
4492
  metadata: z.ZodUnknown;
4490
4493
  url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4491
4494
  }, "strip", z.ZodTypeAny, {
4495
+ id: string;
4492
4496
  state: string;
4497
+ width: number;
4498
+ height: number;
4493
4499
  sequence: number;
4494
4500
  wells: unknown[];
4495
4501
  bookId: string;
@@ -4497,14 +4503,14 @@ declare const spreadSchema: z.ZodObject<{
4497
4503
  laidOutAt: string | null;
4498
4504
  embellishedAt: string | null;
4499
4505
  polishedAt: string | null;
4500
- id?: string | undefined;
4501
4506
  url?: string | null | undefined;
4502
- width?: number | undefined;
4503
- height?: number | undefined;
4504
4507
  metadata?: unknown;
4505
4508
  background?: unknown;
4506
4509
  }, {
4510
+ id: string;
4507
4511
  state: string;
4512
+ width: number;
4513
+ height: number;
4508
4514
  sequence: number;
4509
4515
  wells: unknown[];
4510
4516
  bookId: string;
@@ -4512,10 +4518,7 @@ declare const spreadSchema: z.ZodObject<{
4512
4518
  laidOutAt: string | null;
4513
4519
  embellishedAt: string | null;
4514
4520
  polishedAt: string | null;
4515
- id?: string | undefined;
4516
4521
  url?: string | null | undefined;
4517
- width?: number | undefined;
4518
- height?: number | undefined;
4519
4522
  metadata?: unknown;
4520
4523
  background?: unknown;
4521
4524
  }>;
@@ -4525,7 +4528,10 @@ declare class SpreadsEndpoints {
4525
4528
  private readonly engineAPI;
4526
4529
  constructor(engineAPI: EngineAPI);
4527
4530
  list(bookId: string): Promise<{
4531
+ id: string;
4528
4532
  state: string;
4533
+ width: number;
4534
+ height: number;
4529
4535
  book_id: string;
4530
4536
  spread_type: string;
4531
4537
  sequence: number;
@@ -4533,15 +4539,15 @@ declare class SpreadsEndpoints {
4533
4539
  laid_out_at: string | null;
4534
4540
  embellished_at: string | null;
4535
4541
  polished_at: string | null;
4536
- id?: string | undefined;
4537
4542
  url?: string | null | undefined;
4538
- width?: number | undefined;
4539
- height?: number | undefined;
4540
4543
  metadata?: unknown;
4541
4544
  background?: unknown;
4542
4545
  }[]>;
4543
- create(bookId: string, spread: SpreadServer): Promise<{
4546
+ create(bookId: string, spread: Partial<SpreadServer>): Promise<{
4547
+ id: string;
4544
4548
  state: string;
4549
+ width: number;
4550
+ height: number;
4545
4551
  book_id: string;
4546
4552
  spread_type: string;
4547
4553
  sequence: number;
@@ -4549,15 +4555,15 @@ declare class SpreadsEndpoints {
4549
4555
  laid_out_at: string | null;
4550
4556
  embellished_at: string | null;
4551
4557
  polished_at: string | null;
4552
- id?: string | undefined;
4553
4558
  url?: string | null | undefined;
4554
- width?: number | undefined;
4555
- height?: number | undefined;
4556
4559
  metadata?: unknown;
4557
4560
  background?: unknown;
4558
4561
  }>;
4559
4562
  retrieve(spreadId: string, bookId: string): Promise<{
4563
+ id: string;
4560
4564
  state: string;
4565
+ width: number;
4566
+ height: number;
4561
4567
  book_id: string;
4562
4568
  spread_type: string;
4563
4569
  sequence: number;
@@ -4565,16 +4571,16 @@ declare class SpreadsEndpoints {
4565
4571
  laid_out_at: string | null;
4566
4572
  embellished_at: string | null;
4567
4573
  polished_at: string | null;
4568
- id?: string | undefined;
4569
4574
  url?: string | null | undefined;
4570
- width?: number | undefined;
4571
- height?: number | undefined;
4572
4575
  metadata?: unknown;
4573
4576
  background?: unknown;
4574
4577
  }>;
4575
4578
  render(spreadId: string, bookId: string, size?: number): Promise<any>;
4576
- update(spreadId: string, bookId: string, spread: SpreadServer): Promise<{
4579
+ update(spreadId: string, bookId: string, spread: Partial<SpreadServer>): Promise<{
4580
+ id: string;
4577
4581
  state: string;
4582
+ width: number;
4583
+ height: number;
4578
4584
  book_id: string;
4579
4585
  spread_type: string;
4580
4586
  sequence: number;
@@ -4582,10 +4588,7 @@ declare class SpreadsEndpoints {
4582
4588
  laid_out_at: string | null;
4583
4589
  embellished_at: string | null;
4584
4590
  polished_at: string | null;
4585
- id?: string | undefined;
4586
4591
  url?: string | null | undefined;
4587
- width?: number | undefined;
4588
- height?: number | undefined;
4589
4592
  metadata?: unknown;
4590
4593
  background?: unknown;
4591
4594
  }>;
package/index.d.ts CHANGED
@@ -4288,6 +4288,9 @@ declare const styles: {
4288
4288
  e276151076d94d279d0d0b3608e3fba7: {
4289
4289
  slug: string;
4290
4290
  };
4291
+ cbec6602c5474f8fafc1980fb068db2a: {
4292
+ slug: string;
4293
+ };
4291
4294
  };
4292
4295
  declare const bookSizes: readonly ["4.5x4", "5x7", "6x6", "6x8", "7x5", "8x8", "8x11", "10x10", "11x8", "11x14", "12x12"];
4293
4296
  declare const coverTypes: readonly ["sc", "hc", "pl"];
@@ -4427,12 +4430,12 @@ declare class ImagesEndpoints {
4427
4430
  }
4428
4431
 
4429
4432
  declare const spreadServerSchema: z.ZodObject<{
4430
- id: z.ZodOptional<z.ZodString>;
4433
+ id: z.ZodString;
4431
4434
  book_id: z.ZodString;
4432
4435
  state: z.ZodString;
4433
4436
  spread_type: z.ZodString;
4434
- width: z.ZodOptional<z.ZodNumber>;
4435
- height: z.ZodOptional<z.ZodNumber>;
4437
+ width: z.ZodNumber;
4438
+ height: z.ZodNumber;
4436
4439
  sequence: z.ZodNumber;
4437
4440
  wells: z.ZodArray<z.ZodUnknown, "many">;
4438
4441
  background: z.ZodUnknown;
@@ -4442,7 +4445,10 @@ declare const spreadServerSchema: z.ZodObject<{
4442
4445
  metadata: z.ZodUnknown;
4443
4446
  url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4444
4447
  }, "strip", z.ZodTypeAny, {
4448
+ id: string;
4445
4449
  state: string;
4450
+ width: number;
4451
+ height: number;
4446
4452
  book_id: string;
4447
4453
  spread_type: string;
4448
4454
  sequence: number;
@@ -4450,14 +4456,14 @@ declare const spreadServerSchema: z.ZodObject<{
4450
4456
  laid_out_at: string | null;
4451
4457
  embellished_at: string | null;
4452
4458
  polished_at: string | null;
4453
- id?: string | undefined;
4454
4459
  url?: string | null | undefined;
4455
- width?: number | undefined;
4456
- height?: number | undefined;
4457
4460
  metadata?: unknown;
4458
4461
  background?: unknown;
4459
4462
  }, {
4463
+ id: string;
4460
4464
  state: string;
4465
+ width: number;
4466
+ height: number;
4461
4467
  book_id: string;
4462
4468
  spread_type: string;
4463
4469
  sequence: number;
@@ -4465,21 +4471,18 @@ declare const spreadServerSchema: z.ZodObject<{
4465
4471
  laid_out_at: string | null;
4466
4472
  embellished_at: string | null;
4467
4473
  polished_at: string | null;
4468
- id?: string | undefined;
4469
4474
  url?: string | null | undefined;
4470
- width?: number | undefined;
4471
- height?: number | undefined;
4472
4475
  metadata?: unknown;
4473
4476
  background?: unknown;
4474
4477
  }>;
4475
4478
  type SpreadServer = z.infer<typeof spreadServerSchema>;
4476
4479
  declare const spreadSchema: z.ZodObject<{
4477
- id: z.ZodOptional<z.ZodString>;
4480
+ id: z.ZodString;
4478
4481
  bookId: z.ZodString;
4479
4482
  state: z.ZodString;
4480
4483
  spreadType: z.ZodString;
4481
- width: z.ZodOptional<z.ZodNumber>;
4482
- height: z.ZodOptional<z.ZodNumber>;
4484
+ width: z.ZodNumber;
4485
+ height: z.ZodNumber;
4483
4486
  sequence: z.ZodNumber;
4484
4487
  wells: z.ZodArray<z.ZodUnknown, "many">;
4485
4488
  background: z.ZodUnknown;
@@ -4489,7 +4492,10 @@ declare const spreadSchema: z.ZodObject<{
4489
4492
  metadata: z.ZodUnknown;
4490
4493
  url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4491
4494
  }, "strip", z.ZodTypeAny, {
4495
+ id: string;
4492
4496
  state: string;
4497
+ width: number;
4498
+ height: number;
4493
4499
  sequence: number;
4494
4500
  wells: unknown[];
4495
4501
  bookId: string;
@@ -4497,14 +4503,14 @@ declare const spreadSchema: z.ZodObject<{
4497
4503
  laidOutAt: string | null;
4498
4504
  embellishedAt: string | null;
4499
4505
  polishedAt: string | null;
4500
- id?: string | undefined;
4501
4506
  url?: string | null | undefined;
4502
- width?: number | undefined;
4503
- height?: number | undefined;
4504
4507
  metadata?: unknown;
4505
4508
  background?: unknown;
4506
4509
  }, {
4510
+ id: string;
4507
4511
  state: string;
4512
+ width: number;
4513
+ height: number;
4508
4514
  sequence: number;
4509
4515
  wells: unknown[];
4510
4516
  bookId: string;
@@ -4512,10 +4518,7 @@ declare const spreadSchema: z.ZodObject<{
4512
4518
  laidOutAt: string | null;
4513
4519
  embellishedAt: string | null;
4514
4520
  polishedAt: string | null;
4515
- id?: string | undefined;
4516
4521
  url?: string | null | undefined;
4517
- width?: number | undefined;
4518
- height?: number | undefined;
4519
4522
  metadata?: unknown;
4520
4523
  background?: unknown;
4521
4524
  }>;
@@ -4525,7 +4528,10 @@ declare class SpreadsEndpoints {
4525
4528
  private readonly engineAPI;
4526
4529
  constructor(engineAPI: EngineAPI);
4527
4530
  list(bookId: string): Promise<{
4531
+ id: string;
4528
4532
  state: string;
4533
+ width: number;
4534
+ height: number;
4529
4535
  book_id: string;
4530
4536
  spread_type: string;
4531
4537
  sequence: number;
@@ -4533,15 +4539,15 @@ declare class SpreadsEndpoints {
4533
4539
  laid_out_at: string | null;
4534
4540
  embellished_at: string | null;
4535
4541
  polished_at: string | null;
4536
- id?: string | undefined;
4537
4542
  url?: string | null | undefined;
4538
- width?: number | undefined;
4539
- height?: number | undefined;
4540
4543
  metadata?: unknown;
4541
4544
  background?: unknown;
4542
4545
  }[]>;
4543
- create(bookId: string, spread: SpreadServer): Promise<{
4546
+ create(bookId: string, spread: Partial<SpreadServer>): Promise<{
4547
+ id: string;
4544
4548
  state: string;
4549
+ width: number;
4550
+ height: number;
4545
4551
  book_id: string;
4546
4552
  spread_type: string;
4547
4553
  sequence: number;
@@ -4549,15 +4555,15 @@ declare class SpreadsEndpoints {
4549
4555
  laid_out_at: string | null;
4550
4556
  embellished_at: string | null;
4551
4557
  polished_at: string | null;
4552
- id?: string | undefined;
4553
4558
  url?: string | null | undefined;
4554
- width?: number | undefined;
4555
- height?: number | undefined;
4556
4559
  metadata?: unknown;
4557
4560
  background?: unknown;
4558
4561
  }>;
4559
4562
  retrieve(spreadId: string, bookId: string): Promise<{
4563
+ id: string;
4560
4564
  state: string;
4565
+ width: number;
4566
+ height: number;
4561
4567
  book_id: string;
4562
4568
  spread_type: string;
4563
4569
  sequence: number;
@@ -4565,16 +4571,16 @@ declare class SpreadsEndpoints {
4565
4571
  laid_out_at: string | null;
4566
4572
  embellished_at: string | null;
4567
4573
  polished_at: string | null;
4568
- id?: string | undefined;
4569
4574
  url?: string | null | undefined;
4570
- width?: number | undefined;
4571
- height?: number | undefined;
4572
4575
  metadata?: unknown;
4573
4576
  background?: unknown;
4574
4577
  }>;
4575
4578
  render(spreadId: string, bookId: string, size?: number): Promise<any>;
4576
- update(spreadId: string, bookId: string, spread: SpreadServer): Promise<{
4579
+ update(spreadId: string, bookId: string, spread: Partial<SpreadServer>): Promise<{
4580
+ id: string;
4577
4581
  state: string;
4582
+ width: number;
4583
+ height: number;
4578
4584
  book_id: string;
4579
4585
  spread_type: string;
4580
4586
  sequence: number;
@@ -4582,10 +4588,7 @@ declare class SpreadsEndpoints {
4582
4588
  laid_out_at: string | null;
4583
4589
  embellished_at: string | null;
4584
4590
  polished_at: string | null;
4585
- id?: string | undefined;
4586
4591
  url?: string | null | undefined;
4587
- width?: number | undefined;
4588
- height?: number | undefined;
4589
4592
  metadata?: unknown;
4590
4593
  background?: unknown;
4591
4594
  }>;
package/index.iife.js CHANGED
@@ -1541,7 +1541,8 @@ var MagicLabs = (() => {
1541
1541
  "5771ff862c394c9a8fcf4237a267651c": { slug: "studio-dark-snap" },
1542
1542
  "990e71b3b45d4baaa7236328c64c8364": { slug: "our-family-snap" },
1543
1543
  "2c5700f2b32c49d186b85e57449cdda6": { slug: "favourite-things-snap" },
1544
- e276151076d94d279d0d0b3608e3fba7: { slug: "my-family-snap" }
1544
+ e276151076d94d279d0d0b3608e3fba7: { slug: "my-family-snap" },
1545
+ "cbec6602c5474f8fafc1980fb068db2a": { slug: "graphic-love-snap" }
1545
1546
  };
1546
1547
  var bookSizes = [
1547
1548
  "4.5x4",
@@ -6239,7 +6240,7 @@ var MagicLabs = (() => {
6239
6240
  const res = await fetch(this.cleanUrl(new URL(props.path, this.baseUrl).href), options);
6240
6241
  if (res.status >= 200 && res.status < 300) {
6241
6242
  try {
6242
- return await res.json();
6243
+ return await res.clone().json();
6243
6244
  } catch (error) {
6244
6245
  try {
6245
6246
  return await res.text();
@@ -6321,12 +6322,12 @@ var MagicLabs = (() => {
6321
6322
  }
6322
6323
  };
6323
6324
  var spreadServerSchema = z.object({
6324
- id: z.string().optional(),
6325
+ id: z.string(),
6325
6326
  book_id: z.string(),
6326
6327
  state: z.string(),
6327
6328
  spread_type: z.string(),
6328
- width: z.number().optional(),
6329
- height: z.number().optional(),
6329
+ width: z.number(),
6330
+ height: z.number(),
6330
6331
  sequence: z.number(),
6331
6332
  wells: z.array(z.unknown()),
6332
6333
  background: z.unknown(),
@@ -6337,12 +6338,12 @@ var MagicLabs = (() => {
6337
6338
  url: z.string().nullable().optional()
6338
6339
  });
6339
6340
  var spreadSchema = z.object({
6340
- id: z.string().optional(),
6341
+ id: z.string(),
6341
6342
  bookId: z.string(),
6342
6343
  state: z.string(),
6343
6344
  spreadType: z.string(),
6344
- width: z.number().optional(),
6345
- height: z.number().optional(),
6345
+ width: z.number(),
6346
+ height: z.number(),
6346
6347
  sequence: z.number(),
6347
6348
  wells: z.array(z.unknown()),
6348
6349
  background: z.unknown(),