@datocms/cma-client 5.4.20 → 5.4.22

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.
@@ -10945,32 +10945,125 @@ export type PublicInfoAttributes = {
10945
10945
  */
10946
10946
  custom_i18n_messages_template_url: null | string;
10947
10947
  /**
10948
- * Specifies the color-scheme for the project
10948
+ * Specifies the color-scheme for the project. For monochromatic themes the response only includes type and hue — frontends must derive the palette from the hue. For custom themes the primary_color, light_color, accent_color, and dark_color fields are returned.
10949
10949
  */
10950
10950
  theme: {
10951
- primary_color: {
10951
+ /**
10952
+ * Whether the project is using a custom color palette or a monochromatic one derived from a hue.
10953
+ */
10954
+ type: 'custom' | 'monochromatic';
10955
+ /**
10956
+ * If the type is monochromatic, the value will fall between 0 and 359. If it's not, the value will be null.
10957
+ */
10958
+ hue: number | null;
10959
+ /**
10960
+ * An integer color channel value (0-255)
10961
+ */
10962
+ color_channel?: number;
10963
+ /**
10964
+ * An RGBA color value
10965
+ */
10966
+ color?: {
10967
+ /**
10968
+ * An integer color channel value (0-255)
10969
+ */
10952
10970
  red: number;
10971
+ /**
10972
+ * An integer color channel value (0-255)
10973
+ */
10953
10974
  green: number;
10975
+ /**
10976
+ * An integer color channel value (0-255)
10977
+ */
10954
10978
  blue: number;
10979
+ /**
10980
+ * An integer color channel value (0-255)
10981
+ */
10955
10982
  alpha: number;
10956
10983
  [k: string]: unknown;
10957
10984
  };
10958
- light_color: {
10985
+ /**
10986
+ * An RGBA color value
10987
+ */
10988
+ primary_color?: {
10989
+ /**
10990
+ * An integer color channel value (0-255)
10991
+ */
10959
10992
  red: number;
10993
+ /**
10994
+ * An integer color channel value (0-255)
10995
+ */
10960
10996
  green: number;
10997
+ /**
10998
+ * An integer color channel value (0-255)
10999
+ */
10961
11000
  blue: number;
11001
+ /**
11002
+ * An integer color channel value (0-255)
11003
+ */
10962
11004
  alpha: number;
10963
11005
  };
10964
- accent_color: {
11006
+ /**
11007
+ * An RGBA color value
11008
+ */
11009
+ light_color?: {
11010
+ /**
11011
+ * An integer color channel value (0-255)
11012
+ */
10965
11013
  red: number;
11014
+ /**
11015
+ * An integer color channel value (0-255)
11016
+ */
10966
11017
  green: number;
11018
+ /**
11019
+ * An integer color channel value (0-255)
11020
+ */
10967
11021
  blue: number;
11022
+ /**
11023
+ * An integer color channel value (0-255)
11024
+ */
10968
11025
  alpha: number;
10969
11026
  };
10970
- dark_color: {
11027
+ /**
11028
+ * An RGBA color value
11029
+ */
11030
+ accent_color?: {
11031
+ /**
11032
+ * An integer color channel value (0-255)
11033
+ */
11034
+ red: number;
11035
+ /**
11036
+ * An integer color channel value (0-255)
11037
+ */
11038
+ green: number;
11039
+ /**
11040
+ * An integer color channel value (0-255)
11041
+ */
11042
+ blue: number;
11043
+ /**
11044
+ * An integer color channel value (0-255)
11045
+ */
11046
+ alpha: number;
11047
+ };
11048
+ /**
11049
+ * An RGBA color value
11050
+ */
11051
+ dark_color?: {
11052
+ /**
11053
+ * An integer color channel value (0-255)
11054
+ */
10971
11055
  red: number;
11056
+ /**
11057
+ * An integer color channel value (0-255)
11058
+ */
10972
11059
  green: number;
11060
+ /**
11061
+ * An integer color channel value (0-255)
11062
+ */
10973
11063
  blue: number;
11064
+ /**
11065
+ * An integer color channel value (0-255)
11066
+ */
10974
11067
  alpha: number;
10975
11068
  };
10976
11069
  };
@@ -11335,7 +11428,7 @@ export type SiteAttributes = {
11335
11428
  };
11336
11429
  };
11337
11430
  /**
11338
- * Specifies the theme to use in administrative area
11431
+ * Specifies the theme to use in administrative area. For monochromatic themes the response only includes type, hue, and logo — frontends must derive the palette from the hue. For custom themes the primary_color, light_color, accent_color, and dark_color fields are returned.
11339
11432
  */
11340
11433
  theme: {
11341
11434
  /**
@@ -11346,28 +11439,113 @@ export type SiteAttributes = {
11346
11439
  * If the type is monochromatic, the value will fall between 0 and 359. If it's not, the value will be null.
11347
11440
  */
11348
11441
  hue: number | null;
11349
- primary_color: {
11442
+ /**
11443
+ * An integer color channel value (0-255)
11444
+ */
11445
+ color_channel?: number;
11446
+ /**
11447
+ * An RGBA color value
11448
+ */
11449
+ color?: {
11450
+ /**
11451
+ * An integer color channel value (0-255)
11452
+ */
11350
11453
  red: number;
11454
+ /**
11455
+ * An integer color channel value (0-255)
11456
+ */
11351
11457
  green: number;
11458
+ /**
11459
+ * An integer color channel value (0-255)
11460
+ */
11352
11461
  blue: number;
11462
+ /**
11463
+ * An integer color channel value (0-255)
11464
+ */
11353
11465
  alpha: number;
11354
11466
  };
11355
- light_color: {
11467
+ /**
11468
+ * An RGBA color value
11469
+ */
11470
+ primary_color?: {
11471
+ /**
11472
+ * An integer color channel value (0-255)
11473
+ */
11356
11474
  red: number;
11475
+ /**
11476
+ * An integer color channel value (0-255)
11477
+ */
11478
+ green: number;
11479
+ /**
11480
+ * An integer color channel value (0-255)
11481
+ */
11482
+ blue: number;
11483
+ /**
11484
+ * An integer color channel value (0-255)
11485
+ */
11486
+ alpha: number;
11487
+ };
11488
+ /**
11489
+ * An RGBA color value
11490
+ */
11491
+ light_color?: {
11492
+ /**
11493
+ * An integer color channel value (0-255)
11494
+ */
11495
+ red: number;
11496
+ /**
11497
+ * An integer color channel value (0-255)
11498
+ */
11357
11499
  green: number;
11500
+ /**
11501
+ * An integer color channel value (0-255)
11502
+ */
11358
11503
  blue: number;
11504
+ /**
11505
+ * An integer color channel value (0-255)
11506
+ */
11359
11507
  alpha: number;
11360
11508
  };
11361
- accent_color: {
11509
+ /**
11510
+ * An RGBA color value
11511
+ */
11512
+ accent_color?: {
11513
+ /**
11514
+ * An integer color channel value (0-255)
11515
+ */
11362
11516
  red: number;
11517
+ /**
11518
+ * An integer color channel value (0-255)
11519
+ */
11363
11520
  green: number;
11521
+ /**
11522
+ * An integer color channel value (0-255)
11523
+ */
11364
11524
  blue: number;
11525
+ /**
11526
+ * An integer color channel value (0-255)
11527
+ */
11365
11528
  alpha: number;
11366
11529
  };
11367
- dark_color: {
11530
+ /**
11531
+ * An RGBA color value
11532
+ */
11533
+ dark_color?: {
11534
+ /**
11535
+ * An integer color channel value (0-255)
11536
+ */
11368
11537
  red: number;
11538
+ /**
11539
+ * An integer color channel value (0-255)
11540
+ */
11369
11541
  green: number;
11542
+ /**
11543
+ * An integer color channel value (0-255)
11544
+ */
11370
11545
  blue: number;
11546
+ /**
11547
+ * An integer color channel value (0-255)
11548
+ */
11371
11549
  alpha: number;
11372
11550
  };
11373
11551
  /**
@@ -11584,28 +11762,88 @@ export type SiteUpdateSchema = {
11584
11762
  * The upload ID that is used as the logo for the project
11585
11763
  */
11586
11764
  logo: string | null;
11765
+ /**
11766
+ * An RGBA color value
11767
+ */
11587
11768
  primary_color: {
11769
+ /**
11770
+ * An integer color channel value (0-255)
11771
+ */
11588
11772
  red: number;
11773
+ /**
11774
+ * An integer color channel value (0-255)
11775
+ */
11589
11776
  green: number;
11777
+ /**
11778
+ * An integer color channel value (0-255)
11779
+ */
11590
11780
  blue: number;
11781
+ /**
11782
+ * An integer color channel value (0-255)
11783
+ */
11591
11784
  alpha: number;
11592
11785
  };
11786
+ /**
11787
+ * An RGBA color value
11788
+ */
11593
11789
  light_color: {
11790
+ /**
11791
+ * An integer color channel value (0-255)
11792
+ */
11594
11793
  red: number;
11794
+ /**
11795
+ * An integer color channel value (0-255)
11796
+ */
11595
11797
  green: number;
11798
+ /**
11799
+ * An integer color channel value (0-255)
11800
+ */
11596
11801
  blue: number;
11802
+ /**
11803
+ * An integer color channel value (0-255)
11804
+ */
11597
11805
  alpha: number;
11598
11806
  };
11807
+ /**
11808
+ * An RGBA color value
11809
+ */
11599
11810
  accent_color: {
11811
+ /**
11812
+ * An integer color channel value (0-255)
11813
+ */
11600
11814
  red: number;
11815
+ /**
11816
+ * An integer color channel value (0-255)
11817
+ */
11601
11818
  green: number;
11819
+ /**
11820
+ * An integer color channel value (0-255)
11821
+ */
11602
11822
  blue: number;
11823
+ /**
11824
+ * An integer color channel value (0-255)
11825
+ */
11603
11826
  alpha: number;
11604
11827
  };
11828
+ /**
11829
+ * An RGBA color value
11830
+ */
11605
11831
  dark_color?: {
11832
+ /**
11833
+ * An integer color channel value (0-255)
11834
+ */
11606
11835
  red: number;
11836
+ /**
11837
+ * An integer color channel value (0-255)
11838
+ */
11607
11839
  green: number;
11840
+ /**
11841
+ * An integer color channel value (0-255)
11842
+ */
11608
11843
  blue: number;
11844
+ /**
11845
+ * An integer color channel value (0-255)
11846
+ */
11609
11847
  alpha: number;
11610
11848
  };
11611
11849
  [k: string]: unknown;
@@ -59,7 +59,7 @@ export function isValidId(id) {
59
59
  return true;
60
60
  }
61
61
  export function generateId() {
62
- const bytes = v4(null, new Uint8Array(16));
62
+ const bytes = v4(undefined, new Uint8Array(16));
63
63
  // Here we unset the first bit to ensure [A-Za-f] as the first char.
64
64
  //
65
65
  // If we didn't do this, we would generate IDs that, once encoded
@@ -1 +1 @@
1
- {"version":3,"file":"id.js","sourceRoot":"","sources":["../../../src/utilities/id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAE1B,SAAS,6BAA6B,CAAC,KAAiB;IACtD,MAAM,MAAM,GACV,OAAO,MAAM,KAAK,WAAW;QAC3B,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAE5C,oDAAoD;IACpD,OAAO,CACL,MAAM;QACJ,mBAAmB;SAClB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;QACpB,mBAAmB;SAClB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;QACpB,oBAAoB;SACnB,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CACpB,CAAC;AACJ,C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