commerce-kit 0.51.0 → 0.53.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.
@@ -3020,7 +3020,9 @@ type APIProductGetByIdResult = {
3020
3020
  }[];
3021
3021
  };
3022
3022
  };
3023
- type APIProductGetByIdParams = any;
3023
+ type APIProductGetByIdParams = {
3024
+ idOrSlug: string;
3025
+ };
3024
3026
  type APIProductGetByIdQueryParams = {
3025
3027
  lang?: string;
3026
3028
  currency?: string;
@@ -3109,6 +3111,7 @@ type APICartGetResult = {
3109
3111
  } | null;
3110
3112
  stripeTaxCode: string | null;
3111
3113
  categoryId: string | null;
3114
+ brandId: string | null;
3112
3115
  productTaxRate: {
3113
3116
  createdAt: string;
3114
3117
  updatedAt: string;
@@ -3316,6 +3319,15 @@ type APICartGetResult = {
3316
3319
  products: {
3317
3320
  id: string;
3318
3321
  }[];
3322
+ brands: {
3323
+ id: string;
3324
+ }[];
3325
+ collections: {
3326
+ id: string;
3327
+ }[];
3328
+ categories: {
3329
+ id: string;
3330
+ }[];
3319
3331
  prices: {
3320
3332
  createdAt: string;
3321
3333
  updatedAt: string;
@@ -3349,6 +3361,15 @@ type APICartGetResult = {
3349
3361
  products: {
3350
3362
  id: string;
3351
3363
  }[];
3364
+ brands: {
3365
+ id: string;
3366
+ }[];
3367
+ collections: {
3368
+ id: string;
3369
+ }[];
3370
+ categories: {
3371
+ id: string;
3372
+ }[];
3352
3373
  prices: {
3353
3374
  createdAt: string;
3354
3375
  updatedAt: string;
@@ -3370,6 +3391,15 @@ type APICartGetResult = {
3370
3391
  products: {
3371
3392
  id: string;
3372
3393
  }[];
3394
+ brands: {
3395
+ id: string;
3396
+ }[];
3397
+ collections: {
3398
+ id: string;
3399
+ }[];
3400
+ categories: {
3401
+ id: string;
3402
+ }[];
3373
3403
  prices: {
3374
3404
  createdAt: string;
3375
3405
  updatedAt: string;
@@ -3557,6 +3587,7 @@ type APICartCreateResult = {
3557
3587
  } | null;
3558
3588
  stripeTaxCode: string | null;
3559
3589
  categoryId: string | null;
3590
+ brandId: string | null;
3560
3591
  productTaxRate: {
3561
3592
  createdAt: string;
3562
3593
  updatedAt: string;
@@ -3764,6 +3795,15 @@ type APICartCreateResult = {
3764
3795
  products: {
3765
3796
  id: string;
3766
3797
  }[];
3798
+ brands: {
3799
+ id: string;
3800
+ }[];
3801
+ collections: {
3802
+ id: string;
3803
+ }[];
3804
+ categories: {
3805
+ id: string;
3806
+ }[];
3767
3807
  prices: {
3768
3808
  createdAt: string;
3769
3809
  updatedAt: string;
@@ -3797,6 +3837,15 @@ type APICartCreateResult = {
3797
3837
  products: {
3798
3838
  id: string;
3799
3839
  }[];
3840
+ brands: {
3841
+ id: string;
3842
+ }[];
3843
+ collections: {
3844
+ id: string;
3845
+ }[];
3846
+ categories: {
3847
+ id: string;
3848
+ }[];
3800
3849
  prices: {
3801
3850
  createdAt: string;
3802
3851
  updatedAt: string;
@@ -3818,6 +3867,15 @@ type APICartCreateResult = {
3818
3867
  products: {
3819
3868
  id: string;
3820
3869
  }[];
3870
+ brands: {
3871
+ id: string;
3872
+ }[];
3873
+ collections: {
3874
+ id: string;
3875
+ }[];
3876
+ categories: {
3877
+ id: string;
3878
+ }[];
3821
3879
  prices: {
3822
3880
  createdAt: string;
3823
3881
  updatedAt: string;
@@ -3989,6 +4047,7 @@ type APICartRemoveItemResult = {
3989
4047
  } | null;
3990
4048
  stripeTaxCode: string | null;
3991
4049
  categoryId: string | null;
4050
+ brandId: string | null;
3992
4051
  productTaxRate: {
3993
4052
  createdAt: string;
3994
4053
  updatedAt: string;
@@ -4196,6 +4255,15 @@ type APICartRemoveItemResult = {
4196
4255
  products: {
4197
4256
  id: string;
4198
4257
  }[];
4258
+ brands: {
4259
+ id: string;
4260
+ }[];
4261
+ collections: {
4262
+ id: string;
4263
+ }[];
4264
+ categories: {
4265
+ id: string;
4266
+ }[];
4199
4267
  prices: {
4200
4268
  createdAt: string;
4201
4269
  updatedAt: string;
@@ -4229,6 +4297,15 @@ type APICartRemoveItemResult = {
4229
4297
  products: {
4230
4298
  id: string;
4231
4299
  }[];
4300
+ brands: {
4301
+ id: string;
4302
+ }[];
4303
+ collections: {
4304
+ id: string;
4305
+ }[];
4306
+ categories: {
4307
+ id: string;
4308
+ }[];
4232
4309
  prices: {
4233
4310
  createdAt: string;
4234
4311
  updatedAt: string;
@@ -4250,6 +4327,15 @@ type APICartRemoveItemResult = {
4250
4327
  products: {
4251
4328
  id: string;
4252
4329
  }[];
4330
+ brands: {
4331
+ id: string;
4332
+ }[];
4333
+ collections: {
4334
+ id: string;
4335
+ }[];
4336
+ categories: {
4337
+ id: string;
4338
+ }[];
4253
4339
  prices: {
4254
4340
  createdAt: string;
4255
4341
  updatedAt: string;
@@ -4340,6 +4426,213 @@ type APICartRemoveItemResult = {
4340
4426
  type APICartRemoveItemQueryParams = {
4341
4427
  subscriptionPlanId?: string | undefined;
4342
4428
  };
4429
+ type APICouponGetByIdResult = {
4430
+ id: string;
4431
+ code: string;
4432
+ type: "fixed" | "percentage";
4433
+ value: number;
4434
+ timesRedeemed: number;
4435
+ maxUses: number | null;
4436
+ startDate: string | null;
4437
+ endDate: string | null;
4438
+ minProductCount: number | null;
4439
+ maxProductCount: number | null;
4440
+ productIds: string[];
4441
+ collectionIds: string[];
4442
+ categoryIds: string[];
4443
+ brandIds: string[];
4444
+ currencyAmounts: {
4445
+ [k: string]: number;
4446
+ };
4447
+ createdAt: string;
4448
+ updatedAt: string;
4449
+ };
4450
+ type APICouponsBrowseResult = {
4451
+ data: APICouponGetByIdResult[];
4452
+ meta: {
4453
+ count: number;
4454
+ offset: number;
4455
+ limit: number;
4456
+ };
4457
+ };
4458
+ type APICouponsBrowseQueryParams = {
4459
+ offset?: number | undefined;
4460
+ limit?: number | undefined;
4461
+ query?: string | undefined;
4462
+ };
4463
+ type APICouponCreateBody = {
4464
+ code: string;
4465
+ type: "fixed" | "percentage";
4466
+ value: number;
4467
+ products: string[];
4468
+ collections: string[];
4469
+ categories: string[];
4470
+ brands: string[];
4471
+ startDate?: string | null | undefined;
4472
+ endDate?: string | null | undefined;
4473
+ maxUses?: number | null | undefined;
4474
+ minProductCount?: number | null | undefined;
4475
+ maxProductCount?: number | null | undefined;
4476
+ currencyAmounts?: Record<string, number> | undefined;
4477
+ };
4478
+ type APICouponCreateResult = {
4479
+ id: string;
4480
+ code: string;
4481
+ type: "fixed" | "percentage";
4482
+ value: number;
4483
+ timesRedeemed: number;
4484
+ maxUses: number | null;
4485
+ startDate: string | null;
4486
+ endDate: string | null;
4487
+ minProductCount: number | null;
4488
+ maxProductCount: number | null;
4489
+ productIds: string[];
4490
+ collectionIds: string[];
4491
+ categoryIds: string[];
4492
+ brandIds: string[];
4493
+ currencyAmounts: {
4494
+ [k: string]: number;
4495
+ };
4496
+ createdAt: string;
4497
+ updatedAt: string;
4498
+ };
4499
+ type APICouponUpdateBody = {
4500
+ code: string;
4501
+ type: "fixed" | "percentage";
4502
+ value: number;
4503
+ products: string[];
4504
+ collections: string[];
4505
+ categories: string[];
4506
+ brands: string[];
4507
+ startDate?: string | null | undefined;
4508
+ endDate?: string | null | undefined;
4509
+ maxUses?: number | null | undefined;
4510
+ minProductCount?: number | null | undefined;
4511
+ maxProductCount?: number | null | undefined;
4512
+ currencyAmounts?: Record<string, number> | undefined;
4513
+ };
4514
+ type APICouponUpdateResult = {
4515
+ id: string;
4516
+ code: string;
4517
+ type: "fixed" | "percentage";
4518
+ value: number;
4519
+ timesRedeemed: number;
4520
+ maxUses: number | null;
4521
+ startDate: string | null;
4522
+ endDate: string | null;
4523
+ minProductCount: number | null;
4524
+ maxProductCount: number | null;
4525
+ productIds: string[];
4526
+ collectionIds: string[];
4527
+ categoryIds: string[];
4528
+ brandIds: string[];
4529
+ currencyAmounts: {
4530
+ [k: string]: number;
4531
+ };
4532
+ createdAt: string;
4533
+ updatedAt: string;
4534
+ };
4535
+ type APICouponGetByIdParams = {
4536
+ idOrCode: string;
4537
+ };
4538
+ type APICouponDeleteResult = {
4539
+ ok: boolean;
4540
+ deleted: number;
4541
+ };
4542
+ type APISupportCase = {
4543
+ id: string;
4544
+ number: number;
4545
+ subject: string;
4546
+ category: "other" | "orders_payments" | "products_catalog" | "domains_setup" | "billing_plans" | "store_builder";
4547
+ severity: "normal" | "high" | "low" | "critical";
4548
+ status: "open" | "answered" | "closed";
4549
+ createdAt: string;
4550
+ lastActivityAt: string;
4551
+ closedAt: string | null;
4552
+ };
4553
+ type APISupportCaseMessage = {
4554
+ id: string;
4555
+ authorKind: "merchant" | "support";
4556
+ authorLabel: string;
4557
+ body: string;
4558
+ attachments: {
4559
+ url: string;
4560
+ contentType: string;
4561
+ name?: string;
4562
+ }[];
4563
+ createdAt: string;
4564
+ };
4565
+ type APISupportCasesBrowseResult = {
4566
+ data: APISupportCase[];
4567
+ meta: {
4568
+ count: number;
4569
+ offset: number;
4570
+ limit: number;
4571
+ };
4572
+ };
4573
+ type APISupportCasesBrowseQueryParams = {
4574
+ offset?: number | undefined;
4575
+ limit?: number | undefined;
4576
+ query?: string | undefined;
4577
+ status?: "open" | "answered" | "closed" | "all" | undefined;
4578
+ severity?: "normal" | "high" | "low" | "critical" | "all" | undefined;
4579
+ };
4580
+ type APISupportCaseCreateBody = {
4581
+ body: string;
4582
+ subject?: string | undefined;
4583
+ category?: "other" | "orders_payments" | "products_catalog" | "domains_setup" | "billing_plans" | "store_builder" | undefined;
4584
+ severity?: "normal" | "high" | "low" | "critical" | undefined;
4585
+ author?: string | undefined;
4586
+ };
4587
+ type APISupportCaseCreateResult = {
4588
+ id: string;
4589
+ number: number;
4590
+ subject: string;
4591
+ category: "other" | "orders_payments" | "products_catalog" | "domains_setup" | "billing_plans" | "store_builder";
4592
+ severity: "normal" | "high" | "low" | "critical";
4593
+ status: "open" | "answered" | "closed";
4594
+ createdAt: string;
4595
+ lastActivityAt: string;
4596
+ closedAt: string | null;
4597
+ };
4598
+ type APISupportCaseGetResult = {
4599
+ id: string;
4600
+ number: number;
4601
+ subject: string;
4602
+ category: "other" | "orders_payments" | "products_catalog" | "domains_setup" | "billing_plans" | "store_builder";
4603
+ severity: "normal" | "high" | "low" | "critical";
4604
+ status: "open" | "answered" | "closed";
4605
+ createdAt: string;
4606
+ lastActivityAt: string;
4607
+ closedAt: string | null;
4608
+ } & {
4609
+ messages: APISupportCaseMessage[];
4610
+ };
4611
+ type APISupportCaseGetParams = {
4612
+ idOrNumber: string;
4613
+ };
4614
+ type APISupportCaseUpdateBody = {
4615
+ status: "open" | "closed";
4616
+ };
4617
+ type APISupportCaseUpdateResult = {
4618
+ id: string;
4619
+ number: number;
4620
+ subject: string;
4621
+ category: "other" | "orders_payments" | "products_catalog" | "domains_setup" | "billing_plans" | "store_builder";
4622
+ severity: "normal" | "high" | "low" | "critical";
4623
+ status: "open" | "answered" | "closed";
4624
+ createdAt: string;
4625
+ lastActivityAt: string;
4626
+ closedAt: string | null;
4627
+ };
4628
+ type APISupportCaseMessageCreateBody = {
4629
+ body: string;
4630
+ author?: string | undefined;
4631
+ };
4632
+ type APISupportCaseMessageCreateResult = {
4633
+ message: APISupportCaseMessage;
4634
+ status: APISupportCase["status"];
4635
+ };
4343
4636
  type APIOrdersBrowseResult = {
4344
4637
  data: ({
4345
4638
  id: string;
@@ -4440,6 +4733,7 @@ type APIOrdersBrowseResult = {
4440
4733
  } | null;
4441
4734
  storeId: string;
4442
4735
  categoryId: string | null;
4736
+ brandId: string | null;
4443
4737
  summary: string | null;
4444
4738
  content: any;
4445
4739
  createdAt: string;
@@ -4892,6 +5186,7 @@ type APIOrdersBrowseResult = {
4892
5186
  } | null;
4893
5187
  storeId: string;
4894
5188
  categoryId: string | null;
5189
+ brandId: string | null;
4895
5190
  summary: string | null;
4896
5191
  content: any;
4897
5192
  createdAt: string;
@@ -5355,6 +5650,7 @@ type APIOrderGetByIdResult = {
5355
5650
  } | null;
5356
5651
  storeId: string;
5357
5652
  categoryId: string | null;
5653
+ brandId: string | null;
5358
5654
  summary: string | null;
5359
5655
  content: any;
5360
5656
  createdAt: string;
@@ -5840,6 +6136,7 @@ type APIOrderGetByIdResult = {
5840
6136
  } | null;
5841
6137
  storeId: string;
5842
6138
  categoryId: string | null;
6139
+ brandId: string | null;
5843
6140
  summary: string | null;
5844
6141
  content: any;
5845
6142
  createdAt: string;
@@ -6196,7 +6493,9 @@ type APIOrderGetByIdResult = {
6196
6493
  }[] | null;
6197
6494
  };
6198
6495
  };
6199
- type APIOrderGetByIdParams = any;
6496
+ type APIOrderGetByIdParams = {
6497
+ id: string;
6498
+ };
6200
6499
  type APICategoriesBrowseResult = Omit<{
6201
6500
  data: {
6202
6501
  id: string;
@@ -6491,7 +6790,9 @@ type APICategoryGetByIdResult = ({
6491
6790
  }) & {
6492
6791
  lang?: string;
6493
6792
  };
6494
- type APICategoryGetByIdParams = any;
6793
+ type APICategoryGetByIdParams = {
6794
+ idOrSlug: string;
6795
+ };
6495
6796
  type APICategoryGetByIdQueryParams = {
6496
6797
  lang?: string;
6497
6798
  };
@@ -6677,7 +6978,9 @@ type APICollectionGetByIdResult = ({
6677
6978
  }) & {
6678
6979
  lang?: string;
6679
6980
  };
6680
- type APICollectionGetByIdParams = any;
6981
+ type APICollectionGetByIdParams = {
6982
+ idOrSlug: string;
6983
+ };
6681
6984
  type APICollectionGetByIdQueryParams = {
6682
6985
  lang?: string;
6683
6986
  };
@@ -6886,6 +7189,7 @@ type APIMeGetResult = {
6886
7189
  addressId: string | null;
6887
7190
  subdomain: string;
6888
7191
  domain: string | null;
7192
+ domainVerified: boolean;
6889
7193
  emailDomain: string | null;
6890
7194
  emailDomainId: string | null;
6891
7195
  emailDomainVerified: boolean;
@@ -7092,7 +7396,9 @@ type APIPostGetByIdResult = {
7092
7396
  filters: unknown;
7093
7397
  publishedAt: string | null;
7094
7398
  } | null | undefined;
7095
- type APIPostGetByIdParams = any;
7399
+ type APIPostGetByIdParams = {
7400
+ idOrSlug: string;
7401
+ };
7096
7402
  type APIPostCreateBody = {
7097
7403
  title: string;
7098
7404
  slug: string;
@@ -7212,7 +7518,9 @@ type APIBlogCategoryGetByIdResult = {
7212
7518
  canonical?: string | null | undefined;
7213
7519
  } | null;
7214
7520
  };
7215
- type APIBlogCategoryGetByIdParams = any;
7521
+ type APIBlogCategoryGetByIdParams = {
7522
+ idOrSlug: string;
7523
+ };
7216
7524
  type APIBlogCategoryCreateBody = {
7217
7525
  name: string;
7218
7526
  slug?: string | undefined;
@@ -7330,7 +7638,9 @@ type APICustomerGetByIdResult = {
7330
7638
  }>;
7331
7639
  createdAt: string;
7332
7640
  };
7333
- type APICustomerGetByIdParams = any;
7641
+ type APICustomerGetByIdParams = {
7642
+ id: string;
7643
+ };
7334
7644
  type APICustomerUpdateBody = {
7335
7645
  name?: string;
7336
7646
  phone?: string;
@@ -7426,7 +7736,9 @@ type APIVariantGetByIdResult = {
7426
7736
  images: string[];
7427
7737
  };
7428
7738
  };
7429
- type APIVariantGetByIdParams = any;
7739
+ type APIVariantGetByIdParams = {
7740
+ idOrSku: string;
7741
+ };
7430
7742
  type APIVariantGetByIdQueryParams = {
7431
7743
  currency?: string;
7432
7744
  };
@@ -7684,7 +7996,9 @@ type APILegalPageGetByPathResult = {
7684
7996
  createdAt: string;
7685
7997
  updatedAt: string;
7686
7998
  } | null;
7687
- type APILegalPageGetByPathParams = any;
7999
+ type APILegalPageGetByPathParams = {
8000
+ path: string;
8001
+ };
7688
8002
  type APILegalPageGetByPathQueryParams = {
7689
8003
  lang?: string;
7690
8004
  };
@@ -7929,7 +8243,9 @@ type APIInstaviewImagesBrowseResult = {
7929
8243
  }>;
7930
8244
  nextCursor: string | null;
7931
8245
  };
7932
- type APIInstaviewImagesBrowseParams = any;
8246
+ type APIInstaviewImagesBrowseParams = {
8247
+ handle: string;
8248
+ };
7933
8249
  type APIInstaviewImagesBrowseQueryParams = {
7934
8250
  limit?: number;
7935
8251
  cursor?: string;
@@ -7967,7 +8283,9 @@ type APIEventsBrowseResult = {
7967
8283
  }[];
7968
8284
  total: number;
7969
8285
  };
7970
- type APIEventGetByIdParams = any;
8286
+ type APIEventGetByIdParams = {
8287
+ idOrSlug: string;
8288
+ };
7971
8289
  type APIEventGetByIdResult = {
7972
8290
  event: {
7973
8291
  id: string;
@@ -8055,7 +8373,9 @@ type APIEventAttendeesBrowseResult = {
8055
8373
  }[];
8056
8374
  totalTickets: number;
8057
8375
  };
8058
- type APITicketsGetParams = any;
8376
+ type APITicketsGetParams = {
8377
+ code: string;
8378
+ };
8059
8379
  type APITicketsGetQueryParams = {
8060
8380
  email: string;
8061
8381
  };
@@ -8131,7 +8451,9 @@ type APITicketsUpdateResult = {
8131
8451
  }[];
8132
8452
  }[];
8133
8453
  };
8134
- type APITicketAttendeeGetParams = any;
8454
+ type APITicketAttendeeGetParams = {
8455
+ token: string;
8456
+ };
8135
8457
  type APITicketAttendeeGetResult = {
8136
8458
  token: string;
8137
8459
  attendee: {
@@ -8222,7 +8544,9 @@ type APIBrandsBrowseQueryParams = {
8222
8544
  active?: boolean | undefined;
8223
8545
  lang?: string | undefined;
8224
8546
  };
8225
- type APIBrandGetByIdParams = any;
8547
+ type APIBrandGetByIdParams = {
8548
+ idOrSlug: string;
8549
+ };
8226
8550
  type APIBrandGetByIdResult = {
8227
8551
  id: string;
8228
8552
  name: string;
@@ -8380,7 +8704,9 @@ type APIBrandAssignProductsResult = {
8380
8704
  assigned: number;
8381
8705
  notFound: string[];
8382
8706
  };
8383
- type APIOrderRefundsParams = any;
8707
+ type APIOrderRefundsParams = {
8708
+ id: string;
8709
+ };
8384
8710
  type APIOrderRefundsBrowseResult = {
8385
8711
  data: {
8386
8712
  createdAt: string;
@@ -8416,7 +8742,10 @@ type APIOrderRefundsBrowseQueryParams = {
8416
8742
  offset?: number | undefined;
8417
8743
  limit?: number | undefined;
8418
8744
  };
8419
- type APIOrderRefundGetParams = any;
8745
+ type APIOrderRefundGetParams = {
8746
+ id: string;
8747
+ refundId: string;
8748
+ };
8420
8749
  type APIOrderRefundGetResult = {
8421
8750
  id: string;
8422
8751
  createdAt: string;
@@ -8469,4 +8798,4 @@ type APICartDeleteResult = {
8469
8798
  success: boolean;
8470
8799
  };
8471
8800
 
8472
- export type { APIBlogCategoriesBrowseQueryParams, APIBlogCategoriesBrowseResult, APIBlogCategoryCreateBody, APIBlogCategoryCreateResult, APIBlogCategoryDeleteResult, APIBlogCategoryGetByIdParams, APIBlogCategoryGetByIdResult, APIBlogCategoryUpdateBody, APIBlogCategoryUpdateResult, APIBrandAssignProductsBody, APIBrandAssignProductsResult, APIBrandCreateBody, APIBrandCreateResult, APIBrandDeleteResult, APIBrandGetByIdParams, APIBrandGetByIdResult, APIBrandUpdateBody, APIBrandUpdateResult, APIBrandsBrowseQueryParams, APIBrandsBrowseResult, APICartAddBody, APICartAddResult, APICartCreateBody, APICartCreateResult, APICartDeleteResult, APICartGetResult, APICartRemoveItemQueryParams, APICartRemoveItemResult, APICategoriesBrowseQueryParams, APICategoriesBrowseResult, APICategoryCreateBody, APICategoryCreateResult, APICategoryDeleteResult, APICategoryGetByIdParams, APICategoryGetByIdQueryParams, APICategoryGetByIdResult, APICategoryUpdateBody, APICategoryUpdateQueryParams, APICategoryUpdateResult, APICollectionCreateBody, APICollectionCreateResult, APICollectionDeleteResult, APICollectionGetByIdParams, APICollectionGetByIdQueryParams, APICollectionGetByIdResult, APICollectionUpdateBody, APICollectionUpdateResult, APICollectionsBrowseQueryParams, APICollectionsBrowseResult, APIContactMessageCreateBody, APIContactMessageCreateResult, APICustomerAddressCreateBody, APICustomerAddressCreateResult, APICustomerGetByIdParams, APICustomerGetByIdResult, APICustomerOrdersBrowseQueryParams, APICustomerOrdersBrowseResult, APICustomerUpdateBody, APICustomerUpdateResult, APICustomersBrowseQueryParams, APICustomersBrowseResult, APIEventAttendeesBrowseResult, APIEventCreateBody, APIEventCreateResult, APIEventGetByIdParams, APIEventGetByIdResult, APIEventUpdateBody, APIEventUpdateResult, APIEventsBrowseQueryParams, APIEventsBrowseResult, APIInstaviewImagesBrowseParams, APIInstaviewImagesBrowseQueryParams, APIInstaviewImagesBrowseResult, APIInventoryAdjustBody, APIInventoryAdjustResult, APIInventoryBrowseQueryParams, APIInventoryBrowseResult, APILegalPageCreateBody, APILegalPageCreateQueryParams, APILegalPageCreateResult, APILegalPageGetByPathParams, APILegalPageGetByPathQueryParams, APILegalPageGetByPathResult, APILegalPageUpdateBody, APILegalPageUpdateQueryParams, APILegalPageUpdateResult, APILegalPagesBrowseQueryParams, APILegalPagesBrowseResult, APIMeGetResult, APIOrderGetByIdParams, APIOrderGetByIdResult, APIOrderRefundGetParams, APIOrderRefundGetResult, APIOrderRefundsBrowseQueryParams, APIOrderRefundsBrowseResult, APIOrderRefundsParams, APIOrderUpdateBody, APIOrderUpdateResult, APIOrdersBrowseQueryParams, APIOrdersBrowseResult, APIPostCommentCreateBody, APIPostCommentCreateResult, APIPostCommentsBrowseQueryParams, APIPostCommentsBrowseResult, APIPostCreateBody, APIPostCreateResult, APIPostDeleteResult, APIPostGetByIdParams, APIPostGetByIdResult, APIPostUpdateBody, APIPostUpdateResult, APIPostsBrowseQueryParams, APIPostsBrowseResult, APIProductBatchBody, APIProductBatchResult, APIProductCreateBody, APIProductCreateResult, APIProductDeleteQueryParams, APIProductDeleteResult, APIProductFiltersResult, APIProductGetByIdParams, APIProductGetByIdQueryParams, APIProductGetByIdResult, APIProductReviewCreateBody, APIProductReviewCreateResult, APIProductReviewsBrowseQueryParams, APIProductReviewsBrowseResult, APIProductUpdateBody, APIProductUpdateQueryParams, APIProductUpdateResult, APIProductsBrowseQueryParams, APIProductsBrowseResult, APISearchQueryParams, APISearchResult, APISocialsGetResult, APISubscriberCreateBody, APISubscriberCreateResult, APISubscriberDeleteResult, APITicketAttendeeGetParams, APITicketAttendeeGetResult, APITicketsGetParams, APITicketsGetQueryParams, APITicketsGetResult, APITicketsUpdateBody, APITicketsUpdateResult, APIVariantCreateBody, APIVariantCreateResult, APIVariantGetByIdParams, APIVariantGetByIdQueryParams, APIVariantGetByIdResult, APIVariantUpdateBody, APIVariantUpdateResult, JSONContent };
8801
+ export type { APIBlogCategoriesBrowseQueryParams, APIBlogCategoriesBrowseResult, APIBlogCategoryCreateBody, APIBlogCategoryCreateResult, APIBlogCategoryDeleteResult, APIBlogCategoryGetByIdParams, APIBlogCategoryGetByIdResult, APIBlogCategoryUpdateBody, APIBlogCategoryUpdateResult, APIBrandAssignProductsBody, APIBrandAssignProductsResult, APIBrandCreateBody, APIBrandCreateResult, APIBrandDeleteResult, APIBrandGetByIdParams, APIBrandGetByIdResult, APIBrandUpdateBody, APIBrandUpdateResult, APIBrandsBrowseQueryParams, APIBrandsBrowseResult, APICartAddBody, APICartAddResult, APICartCreateBody, APICartCreateResult, APICartDeleteResult, APICartGetResult, APICartRemoveItemQueryParams, APICartRemoveItemResult, APICategoriesBrowseQueryParams, APICategoriesBrowseResult, APICategoryCreateBody, APICategoryCreateResult, APICategoryDeleteResult, APICategoryGetByIdParams, APICategoryGetByIdQueryParams, APICategoryGetByIdResult, APICategoryUpdateBody, APICategoryUpdateQueryParams, APICategoryUpdateResult, APICollectionCreateBody, APICollectionCreateResult, APICollectionDeleteResult, APICollectionGetByIdParams, APICollectionGetByIdQueryParams, APICollectionGetByIdResult, APICollectionUpdateBody, APICollectionUpdateResult, APICollectionsBrowseQueryParams, APICollectionsBrowseResult, APIContactMessageCreateBody, APIContactMessageCreateResult, APICouponCreateBody, APICouponCreateResult, APICouponDeleteResult, APICouponGetByIdParams, APICouponGetByIdResult, APICouponUpdateBody, APICouponUpdateResult, APICouponsBrowseQueryParams, APICouponsBrowseResult, APICustomerAddressCreateBody, APICustomerAddressCreateResult, APICustomerGetByIdParams, APICustomerGetByIdResult, APICustomerOrdersBrowseQueryParams, APICustomerOrdersBrowseResult, APICustomerUpdateBody, APICustomerUpdateResult, APICustomersBrowseQueryParams, APICustomersBrowseResult, APIEventAttendeesBrowseResult, APIEventCreateBody, APIEventCreateResult, APIEventGetByIdParams, APIEventGetByIdResult, APIEventUpdateBody, APIEventUpdateResult, APIEventsBrowseQueryParams, APIEventsBrowseResult, APIInstaviewImagesBrowseParams, APIInstaviewImagesBrowseQueryParams, APIInstaviewImagesBrowseResult, APIInventoryAdjustBody, APIInventoryAdjustResult, APIInventoryBrowseQueryParams, APIInventoryBrowseResult, APILegalPageCreateBody, APILegalPageCreateQueryParams, APILegalPageCreateResult, APILegalPageGetByPathParams, APILegalPageGetByPathQueryParams, APILegalPageGetByPathResult, APILegalPageUpdateBody, APILegalPageUpdateQueryParams, APILegalPageUpdateResult, APILegalPagesBrowseQueryParams, APILegalPagesBrowseResult, APIMeGetResult, APIOrderGetByIdParams, APIOrderGetByIdResult, APIOrderRefundGetParams, APIOrderRefundGetResult, APIOrderRefundsBrowseQueryParams, APIOrderRefundsBrowseResult, APIOrderRefundsParams, APIOrderUpdateBody, APIOrderUpdateResult, APIOrdersBrowseQueryParams, APIOrdersBrowseResult, APIPostCommentCreateBody, APIPostCommentCreateResult, APIPostCommentsBrowseQueryParams, APIPostCommentsBrowseResult, APIPostCreateBody, APIPostCreateResult, APIPostDeleteResult, APIPostGetByIdParams, APIPostGetByIdResult, APIPostUpdateBody, APIPostUpdateResult, APIPostsBrowseQueryParams, APIPostsBrowseResult, APIProductBatchBody, APIProductBatchResult, APIProductCreateBody, APIProductCreateResult, APIProductDeleteQueryParams, APIProductDeleteResult, APIProductFiltersResult, APIProductGetByIdParams, APIProductGetByIdQueryParams, APIProductGetByIdResult, APIProductReviewCreateBody, APIProductReviewCreateResult, APIProductReviewsBrowseQueryParams, APIProductReviewsBrowseResult, APIProductUpdateBody, APIProductUpdateQueryParams, APIProductUpdateResult, APIProductsBrowseQueryParams, APIProductsBrowseResult, APISearchQueryParams, APISearchResult, APISocialsGetResult, APISubscriberCreateBody, APISubscriberCreateResult, APISubscriberDeleteResult, APISupportCase, APISupportCaseCreateBody, APISupportCaseCreateResult, APISupportCaseGetParams, APISupportCaseGetResult, APISupportCaseMessage, APISupportCaseMessageCreateBody, APISupportCaseMessageCreateResult, APISupportCaseUpdateBody, APISupportCaseUpdateResult, APISupportCasesBrowseQueryParams, APISupportCasesBrowseResult, APITicketAttendeeGetParams, APITicketAttendeeGetResult, APITicketsGetParams, APITicketsGetQueryParams, APITicketsGetResult, APITicketsUpdateBody, APITicketsUpdateResult, APIVariantCreateBody, APIVariantCreateResult, APIVariantGetByIdParams, APIVariantGetByIdQueryParams, APIVariantGetByIdResult, APIVariantUpdateBody, APIVariantUpdateResult, JSONContent };
package/dist/browser.js CHANGED
@@ -1,2 +1,2 @@
1
- function w(){typeof window>"u"||(console.log("[YNS Sandbox Inspectors] module evaluated"),k(),S(),x())}w();function x(){if(window.parent===window)return;let o=5e3,i=10,e=2e3,t=0,n="",c=0;function f(d,l){let m=Date.now();c>=i||d===n&&m-t<o||(t=m,n=d,c+=1,window.parent.postMessage({type:"runtime-error",message:d,stack:l?l.slice(0,e):void 0,pagePath:window.location.pathname},"*"))}window.addEventListener("error",d=>{let l=d.error,m=l instanceof Error?l.message:d.message||"Unknown error",y=l instanceof Error?l.stack:void 0;f(m,y)}),window.addEventListener("unhandledrejection",d=>{let l=d.reason,m=l instanceof Error?l.message:String(l??"Unhandled rejection"),y=l instanceof Error?l.stack:void 0;f(m,y)})}var C=new Set(["HEAD","SCRIPT","STYLE","NOSCRIPT","HTML"]);function L(o){if(o.id)return`${o.tagName.toLowerCase()}#${CSS.escape(o.id)}`;let i=[],e=o;for(;e&&e!==document.body&&e!==document.documentElement;){let t=e.tagName.toLowerCase();if(e.id){i.unshift(`${t}#${CSS.escape(e.id)}`);break}let n=Array.from(e.classList).filter(d=>!d.startsWith("data-yns-"));n.length>0&&(t+=`.${n.map(d=>CSS.escape(d)).join(".")}`);let c=e.parentElement,f=e.tagName;if(c&&Array.from(c.children).filter(l=>l.tagName===f&&(n.length===0||n.every(m=>l.classList.contains(m)))).length>1){let l=Array.from(c.children).indexOf(e)+1;t+=`:nth-child(${l})`}i.unshift(t),e=e.parentElement}return i.join(" > ")}function E(o,i){let e=o.getBoundingClientRect(),t=window.getComputedStyle(o),n=(o.textContent??"").trim();return{tag:o.tagName.toLowerCase(),id:o.id||void 0,classes:Array.from(o.classList).filter(c=>!c.startsWith("data-yns-")),textContent:n.length>i?`${n.slice(0,i)}\u2026`:n,cssSelector:L(o),boundingRect:{top:e.top,left:e.left,width:e.width,height:e.height},computedStyles:{color:t.color,backgroundColor:t.backgroundColor,fontSize:t.fontSize,fontFamily:t.fontFamily,padding:t.padding,margin:t.margin}}}function v(o,i){if(!o?.tagName||C.has(o.tagName))return!0;for(let e of i)if(o.hasAttribute?.(e))return!0;return!1}function k(){let o=!1,i=null,e=null,t=document.createElement("div");t.setAttribute("data-yns-design-overlay","hover"),t.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483646","border: 2px solid #3b82f6","background: rgba(59, 130, 246, 0.08)","border-radius: 3px","display: none","transition: top 0.05s, left 0.05s, width 0.05s, height 0.05s"].join(";");let n=document.createElement("div");n.setAttribute("data-yns-design-overlay","label"),n.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483647","background: #3b82f6","color: #fff","font-size: 11px","font-family: ui-monospace, monospace","padding: 2px 6px","border-radius: 3px","white-space: nowrap","display: none"].join(";"),document.documentElement.appendChild(t),document.documentElement.appendChild(n);let c=document.createElement("style");c.setAttribute("data-yns-design-overlay","style"),c.textContent="[data-yns-selected] { outline: 2px solid #3b82f6 !important; outline-offset: 1px; }",document.head.appendChild(c);function f(u){let r=u.getBoundingClientRect();t.style.top=`${r.top}px`,t.style.left=`${r.left}px`,t.style.width=`${r.width}px`,t.style.height=`${r.height}px`,t.style.display="block";let a=Array.from(u.classList).filter(p=>!p.startsWith("data-yns-")),s=u.tagName.toLowerCase()+(a.length?`.${a[0]}`:"");n.textContent=s,n.style.left=`${r.left}px`,n.style.top=`${Math.max(0,r.top-22)}px`,n.style.display="block"}let d=u=>{let r=document.elementFromPoint(u.clientX,u.clientY);if(v(r,["data-yns-design-overlay"])){t.style.display="none",n.style.display="none",i=null;return}i=r,requestAnimationFrame(()=>{i===r&&o&&r&&f(r)})},l=()=>{t.style.display="none",n.style.display="none",i=null},m=u=>{if(!o||!i)return;u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation();let r=i;if(v(r,["data-yns-design-overlay"]))return;let a=E(r,120),s=a.cssSelector;e&&e.el.removeAttribute("data-yns-selected"),e&&e.cssSelector===s?(e=null,window.parent.postMessage({type:"element-deselected",data:a},"*")):(e={el:r,cssSelector:s},r.setAttribute("data-yns-selected",""),window.parent.postMessage({type:"element-selected",data:a},"*"))},y=u=>{u.key==="Escape"&&o&&(h(),window.parent.postMessage({type:"design-mode-cleared"},"*"))};function b(){o=!0,document.addEventListener("mousemove",d,!0),document.addEventListener("mouseleave",l),document.addEventListener("click",m,!0),document.addEventListener("keydown",y,!0)}function h(){o=!1,document.removeEventListener("mousemove",d,!0),document.removeEventListener("mouseleave",l),document.removeEventListener("click",m,!0),document.removeEventListener("keydown",y,!0),t.style.display="none",n.style.display="none",i=null,e&&(e.el.removeAttribute("data-yns-selected"),e=null)}window.addEventListener("message",u=>{let r=u.data;!r||typeof r!="object"||(r.type==="design-mode-toggle"&&(r.enabled?b():(h(),window.parent.postMessage({type:"design-mode-cleared"},"*"))),r.type==="design-mode-deselect"&&e&&(e.el.removeAttribute("data-yns-selected"),e=null))})}function S(){let o=!1,i=null,e=[],t=document.createElement("div");t.setAttribute("data-yns-comment-overlay","hover"),t.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483644","border: 2px dashed #10b981","background: rgba(16, 185, 129, 0.06)","border-radius: 3px","display: none","transition: top 0.05s, left 0.05s, width 0.05s, height 0.05s"].join(";");let n=document.createElement("div");n.setAttribute("data-yns-comment-overlay","cursor-label"),n.textContent="Click to comment",n.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483645","background: #059669","color: #fff","font-size: 11px","font-family: ui-sans-serif, system-ui, sans-serif","padding: 3px 8px","border-radius: 4px","white-space: nowrap","display: none","box-shadow: 0 2px 6px rgba(0,0,0,0.15)"].join(";");let c=document.createElement("div");c.setAttribute("data-yns-comment-overlay","pins"),c.style.cssText="position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2147483643;",document.documentElement.appendChild(t),document.documentElement.appendChild(n),document.documentElement.appendChild(c);function f(){c.innerHTML="";for(let a of e){let s=null;try{s=document.querySelector(a.selector)}catch{s=null}if(!s)continue;let p=s.getBoundingClientRect(),g=document.createElement("div");g.style.cssText=["position: fixed",`top: ${p.top-12}px`,`left: ${p.left+p.width/2-12}px`,"width: 24px","height: 24px","border-radius: 50%","background: #059669","color: #fff","display: flex","align-items: center","justify-content: center","font-size: 12px","font-weight: 600","font-family: ui-sans-serif, system-ui, sans-serif","box-shadow: 0 2px 8px rgba(0,0,0,0.2)","pointer-events: none"].join(";"),g.textContent=String(a.number),c.appendChild(g)}}let d=a=>{let s=document.elementFromPoint(a.clientX,a.clientY);if(v(s,["data-yns-comment-overlay","data-yns-design-overlay"])){t.style.display="none",n.style.display="none",i=null;return}i=s,requestAnimationFrame(()=>{if(i===s&&o&&s){let p=s.getBoundingClientRect();t.style.top=`${p.top}px`,t.style.left=`${p.left}px`,t.style.width=`${p.width}px`,t.style.height=`${p.height}px`,t.style.display="block",n.style.left=`${a.clientX+14}px`,n.style.top=`${a.clientY+14}px`,n.style.display="block"}})},l=()=>{t.style.display="none",n.style.display="none",i=null},m=a=>{if(!o||!i)return;a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation();let s=i;if(v(s,["data-yns-comment-overlay","data-yns-design-overlay"]))return;let p=E(s,200),g=s.getBoundingClientRect();window.parent.postMessage({type:"comment-click",data:{element:p,clickPosition:{x:a.clientX,y:a.clientY},elementRect:{top:g.top,left:g.left,width:g.width,height:g.height},pagePath:window.location.pathname}},"*")},y=a=>{a.key==="Escape"&&o&&(h(),window.parent.postMessage({type:"comment-mode-cleared"},"*"))};function b(){o=!0,document.body.style.cursor="crosshair",document.addEventListener("mousemove",d,!0),document.addEventListener("mouseleave",l),document.addEventListener("click",m,!0),document.addEventListener("keydown",y,!0)}function h(){o=!1,document.body.style.cursor="",document.removeEventListener("mousemove",d,!0),document.removeEventListener("mouseleave",l),document.removeEventListener("click",m,!0),document.removeEventListener("keydown",y,!0),t.style.display="none",n.style.display="none",i=null}let u=!1,r=()=>{u||(u=!0,requestAnimationFrame(()=>{u=!1,f()}))};window.addEventListener("scroll",r,{passive:!0}),window.addEventListener("resize",r,{passive:!0}),window.addEventListener("message",a=>{let s=a.data;!s||typeof s!="object"||(s.type==="comment-mode-toggle"&&(s.enabled?b():h()),s.type==="comment-pins-update"&&(e=s.pins??[],f()),s.type==="comment-pin-remove"&&(e=e.filter(p=>p.id!==s.pinId),f()))})}export{w as startSandboxInspectors};
1
+ function w(){typeof window>"u"||(console.log("[YNS Sandbox Inspectors] module evaluated"),f(),p())}w();function p(){if(window.parent===window)return;let r="yns-builder-annotations-script";if(document.getElementById(r))return;let s=process.env.NEXT_PUBLIC_YNS_TOOLBAR_BASE||"https://toolbar.yns.cx",t=document.createElement("script");t.id=r,t.async=!0,t.src=`${s}/annotations.js`,document.head.appendChild(t)}function f(){if(window.parent===window)return;let r=5e3,s=10,t=2e3,a=0,c="",d=0;function u(e,n){let o=Date.now();d>=s||e===c&&o-a<r||(a=o,c=e,d+=1,window.parent.postMessage({type:"runtime-error",message:e,stack:n?n.slice(0,t):void 0,pagePath:window.location.pathname},"*"))}window.addEventListener("error",e=>{let n=e.error,o=n instanceof Error?n.message:e.message||"Unknown error",i=n instanceof Error?n.stack:void 0;u(o,i)}),window.addEventListener("unhandledrejection",e=>{let n=e.reason,o=n instanceof Error?n.message:String(n??"Unhandled rejection"),i=n instanceof Error?n.stack:void 0;u(o,i)})}export{w as startSandboxInspectors};
2
2
  //# sourceMappingURL=browser.js.map