@atelier201/cli 0.5.0 → 0.7.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.
@@ -1370,7 +1370,7 @@ export const API_OPERATIONS = [
1370
1370
  "method": "PATCH",
1371
1371
  "path": "/v1/sites/{site_id}",
1372
1372
  "summary": "Rename a site",
1373
- "description": "Changes the name shown in Atelier201. The address (slug) does not change.",
1373
+ "description": "Changes the name shown in Atelier201. A random first address, never published, follows the name; any other address does not change (see setSiteAddress).",
1374
1374
  "authentication_required": true,
1375
1375
  "scope": "sites:write",
1376
1376
  "surfaces": {
@@ -5036,7 +5036,7 @@ export const API_OPERATIONS = [
5036
5036
  "method": "POST",
5037
5037
  "path": "/v1/sites/{site_id}/builds",
5038
5038
  "summary": "Build a site",
5039
- "description": "Compiles the draft (or `revision`) into a static site, in an isolated container with no network. Returns at once with `build` (its `id`, state `queued`) and `reused`; then getSiteBuild with `wait=50` answers when it is `ready` or `failed` (usually under a minute). A ready build of the same revision is reused instead of building twice.",
5039
+ "description": "Compiles the draft (or `revision`) into a static site, in an isolated container with no network. Returns at once with `build` (its `id`, state `queued`), `reused` and `is_requested_revision`; then getSiteBuild with `wait=50` answers when it is `ready` or `failed` (usually under a minute). A ready build of the same revision is reused instead of building twice. One build runs at a time per site: when an earlier version is running, the answer is that build with `is_requested_revision: false`; wait for it, then call again.",
5040
5040
  "authentication_required": true,
5041
5041
  "scope": "sites:write",
5042
5042
  "surfaces": {
@@ -5237,11 +5237,20 @@ export const API_OPERATIONS = [
5237
5237
  },
5238
5238
  "reused": {
5239
5239
  "type": "boolean"
5240
+ },
5241
+ "is_requested_revision": {
5242
+ "type": "boolean",
5243
+ "description": "False when `build` is an earlier version already running (one build at a time per site): wait for it to finish, whatever its outcome, then start again to get the build of the revision you asked for."
5244
+ },
5245
+ "note": {
5246
+ "description": "What to do next, present when is_requested_revision is false.",
5247
+ "type": "string"
5240
5248
  }
5241
5249
  },
5242
5250
  "required": [
5243
5251
  "build",
5244
- "reused"
5252
+ "reused",
5253
+ "is_requested_revision"
5245
5254
  ],
5246
5255
  "additionalProperties": false
5247
5256
  },
@@ -6171,7 +6180,7 @@ export const API_OPERATIONS = [
6171
6180
  "method": "POST",
6172
6181
  "path": "/v1/sites/{site_id}/previews",
6173
6182
  "summary": "Share a preview",
6174
- "description": "A private link that shows one build (default: the newest ready build of the draft) for 7 days (1 to 30). Anyone with the link can see it; it grants nothing else and is never indexed.",
6183
+ "description": "A private link that shows one build (default: the newest ready build of the draft) for 7 days (1 to 30). Anyone with the link can see it; it grants nothing else and is never indexed. The link runs sandboxed with origin `null`: Workers, browser storage and third-party APIs that refuse that origin fail there and work once published.",
6175
6184
  "authentication_required": true,
6176
6185
  "scope": "sites:write",
6177
6186
  "surfaces": {
@@ -6542,6 +6551,448 @@ export const API_OPERATIONS = [
6542
6551
  }
6543
6552
  }
6544
6553
  },
6554
+ {
6555
+ "operation_id": "getSiteAnalytics",
6556
+ "method": "GET",
6557
+ "path": "/v1/sites/{site_id}/analytics",
6558
+ "summary": "Read a site's visitor numbers",
6559
+ "description": "Page views of the live site by people, with pages, sources, countries and devices, over a period. No credits. Visitor figures are null when the owner turned visitor counting off, which only the owner can change, in the dashboard.",
6560
+ "authentication_required": true,
6561
+ "scope": "sites:read",
6562
+ "surfaces": {
6563
+ "cli": "atelier201 analytics",
6564
+ "mcp": "get_site_analytics"
6565
+ },
6566
+ "parameters": [
6567
+ {
6568
+ "name": "site_id",
6569
+ "in": "path",
6570
+ "required": true,
6571
+ "schema": {
6572
+ "type": "string"
6573
+ },
6574
+ "description": "The site's id, or its slug (the address before .atelier201.page)."
6575
+ },
6576
+ {
6577
+ "name": "period",
6578
+ "in": "query",
6579
+ "required": false,
6580
+ "schema": {
6581
+ "description": "today, 7d, 30d, 90d or 12m. Default 30d.",
6582
+ "type": "string",
6583
+ "enum": [
6584
+ "today",
6585
+ "7d",
6586
+ "30d",
6587
+ "90d",
6588
+ "12m"
6589
+ ]
6590
+ }
6591
+ }
6592
+ ],
6593
+ "request_body": null,
6594
+ "responses": {
6595
+ "200": {
6596
+ "description": "Read a site's visitor numbers",
6597
+ "content": {
6598
+ "application/json": {
6599
+ "schema": {
6600
+ "type": "object",
6601
+ "properties": {
6602
+ "data": {
6603
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
6604
+ "type": "object",
6605
+ "properties": {
6606
+ "period": {
6607
+ "type": "string",
6608
+ "enum": [
6609
+ "today",
6610
+ "7d",
6611
+ "30d",
6612
+ "90d",
6613
+ "12m"
6614
+ ]
6615
+ },
6616
+ "from": {
6617
+ "type": "string",
6618
+ "description": "First UTC day covered."
6619
+ },
6620
+ "to": {
6621
+ "type": "string",
6622
+ "description": "Last UTC day covered: yesterday when today's live read was not available."
6623
+ },
6624
+ "visitor_counting": {
6625
+ "type": "boolean",
6626
+ "description": "False when the owner turned visitor counting off: the visitor figures are then null."
6627
+ },
6628
+ "totals": {
6629
+ "type": "object",
6630
+ "properties": {
6631
+ "views": {
6632
+ "type": "number"
6633
+ },
6634
+ "visitors": {
6635
+ "type": [
6636
+ "number",
6637
+ "null"
6638
+ ]
6639
+ },
6640
+ "visits": {
6641
+ "type": [
6642
+ "number",
6643
+ "null"
6644
+ ]
6645
+ },
6646
+ "bounce_rate": {
6647
+ "description": "Share of visits with a single page view, 0 to 1.",
6648
+ "type": [
6649
+ "number",
6650
+ "null"
6651
+ ]
6652
+ },
6653
+ "visit_seconds": {
6654
+ "type": [
6655
+ "number",
6656
+ "null"
6657
+ ]
6658
+ },
6659
+ "views_per_visit": {
6660
+ "type": [
6661
+ "number",
6662
+ "null"
6663
+ ]
6664
+ }
6665
+ },
6666
+ "required": [
6667
+ "views",
6668
+ "visitors",
6669
+ "visits",
6670
+ "bounce_rate",
6671
+ "visit_seconds",
6672
+ "views_per_visit"
6673
+ ],
6674
+ "additionalProperties": false
6675
+ },
6676
+ "previous": {
6677
+ "anyOf": [
6678
+ {
6679
+ "type": "object",
6680
+ "properties": {
6681
+ "views": {
6682
+ "type": "number"
6683
+ },
6684
+ "visitors": {
6685
+ "type": [
6686
+ "number",
6687
+ "null"
6688
+ ]
6689
+ },
6690
+ "visits": {
6691
+ "type": [
6692
+ "number",
6693
+ "null"
6694
+ ]
6695
+ },
6696
+ "bounce_rate": {
6697
+ "description": "Share of visits with a single page view, 0 to 1.",
6698
+ "type": [
6699
+ "number",
6700
+ "null"
6701
+ ]
6702
+ },
6703
+ "visit_seconds": {
6704
+ "type": [
6705
+ "number",
6706
+ "null"
6707
+ ]
6708
+ },
6709
+ "views_per_visit": {
6710
+ "type": [
6711
+ "number",
6712
+ "null"
6713
+ ]
6714
+ }
6715
+ },
6716
+ "required": [
6717
+ "views",
6718
+ "visitors",
6719
+ "visits",
6720
+ "bounce_rate",
6721
+ "visit_seconds",
6722
+ "views_per_visit"
6723
+ ],
6724
+ "additionalProperties": false
6725
+ },
6726
+ {
6727
+ "type": "null"
6728
+ }
6729
+ ],
6730
+ "description": "The same number of days just before. Null when there is no data then, and for today."
6731
+ },
6732
+ "series": {
6733
+ "type": "array",
6734
+ "items": {
6735
+ "type": "object",
6736
+ "properties": {
6737
+ "at": {
6738
+ "type": "string"
6739
+ },
6740
+ "views": {
6741
+ "type": "number"
6742
+ },
6743
+ "visitors": {
6744
+ "type": [
6745
+ "number",
6746
+ "null"
6747
+ ]
6748
+ }
6749
+ },
6750
+ "required": [
6751
+ "at",
6752
+ "views",
6753
+ "visitors"
6754
+ ],
6755
+ "additionalProperties": false
6756
+ }
6757
+ },
6758
+ "pages": {
6759
+ "type": "array",
6760
+ "items": {
6761
+ "type": "object",
6762
+ "properties": {
6763
+ "key": {
6764
+ "type": "string"
6765
+ },
6766
+ "views": {
6767
+ "type": "number"
6768
+ },
6769
+ "visitors": {
6770
+ "type": [
6771
+ "number",
6772
+ "null"
6773
+ ]
6774
+ }
6775
+ },
6776
+ "required": [
6777
+ "key",
6778
+ "views",
6779
+ "visitors"
6780
+ ],
6781
+ "additionalProperties": false
6782
+ }
6783
+ },
6784
+ "sources": {
6785
+ "type": "array",
6786
+ "items": {
6787
+ "type": "object",
6788
+ "properties": {
6789
+ "key": {
6790
+ "type": "string"
6791
+ },
6792
+ "views": {
6793
+ "type": "number"
6794
+ },
6795
+ "visitors": {
6796
+ "type": [
6797
+ "number",
6798
+ "null"
6799
+ ]
6800
+ }
6801
+ },
6802
+ "required": [
6803
+ "key",
6804
+ "views",
6805
+ "visitors"
6806
+ ],
6807
+ "additionalProperties": false
6808
+ },
6809
+ "description": "Where views arrived from. Clicks inside the site are not arrivals, so these add up to fewer than the total."
6810
+ },
6811
+ "countries": {
6812
+ "type": "array",
6813
+ "items": {
6814
+ "type": "object",
6815
+ "properties": {
6816
+ "key": {
6817
+ "type": "string"
6818
+ },
6819
+ "views": {
6820
+ "type": "number"
6821
+ },
6822
+ "visitors": {
6823
+ "type": [
6824
+ "number",
6825
+ "null"
6826
+ ]
6827
+ }
6828
+ },
6829
+ "required": [
6830
+ "key",
6831
+ "views",
6832
+ "visitors"
6833
+ ],
6834
+ "additionalProperties": false
6835
+ }
6836
+ },
6837
+ "devices": {
6838
+ "type": "array",
6839
+ "items": {
6840
+ "type": "object",
6841
+ "properties": {
6842
+ "key": {
6843
+ "type": "string"
6844
+ },
6845
+ "views": {
6846
+ "type": "number"
6847
+ },
6848
+ "visitors": {
6849
+ "type": [
6850
+ "number",
6851
+ "null"
6852
+ ]
6853
+ }
6854
+ },
6855
+ "required": [
6856
+ "key",
6857
+ "views",
6858
+ "visitors"
6859
+ ],
6860
+ "additionalProperties": false
6861
+ }
6862
+ },
6863
+ "browsers": {
6864
+ "type": "array",
6865
+ "items": {
6866
+ "type": "object",
6867
+ "properties": {
6868
+ "key": {
6869
+ "type": "string"
6870
+ },
6871
+ "views": {
6872
+ "type": "number"
6873
+ },
6874
+ "visitors": {
6875
+ "type": [
6876
+ "number",
6877
+ "null"
6878
+ ]
6879
+ }
6880
+ },
6881
+ "required": [
6882
+ "key",
6883
+ "views",
6884
+ "visitors"
6885
+ ],
6886
+ "additionalProperties": false
6887
+ }
6888
+ },
6889
+ "os": {
6890
+ "type": "array",
6891
+ "items": {
6892
+ "type": "object",
6893
+ "properties": {
6894
+ "key": {
6895
+ "type": "string"
6896
+ },
6897
+ "views": {
6898
+ "type": "number"
6899
+ },
6900
+ "visitors": {
6901
+ "type": [
6902
+ "number",
6903
+ "null"
6904
+ ]
6905
+ }
6906
+ },
6907
+ "required": [
6908
+ "key",
6909
+ "views",
6910
+ "visitors"
6911
+ ],
6912
+ "additionalProperties": false
6913
+ }
6914
+ },
6915
+ "bot_views": {
6916
+ "type": "number",
6917
+ "description": "Views by bots, kept apart from every figure above."
6918
+ },
6919
+ "updated_at": {
6920
+ "description": "When the last full day was rolled up. Null before the first night.",
6921
+ "type": [
6922
+ "string",
6923
+ "null"
6924
+ ]
6925
+ }
6926
+ },
6927
+ "required": [
6928
+ "period",
6929
+ "from",
6930
+ "to",
6931
+ "visitor_counting",
6932
+ "totals",
6933
+ "previous",
6934
+ "series",
6935
+ "pages",
6936
+ "sources",
6937
+ "countries",
6938
+ "devices",
6939
+ "browsers",
6940
+ "os",
6941
+ "bot_views",
6942
+ "updated_at"
6943
+ ],
6944
+ "additionalProperties": false
6945
+ },
6946
+ "request_id": {
6947
+ "type": "string"
6948
+ }
6949
+ },
6950
+ "required": [
6951
+ "data",
6952
+ "request_id"
6953
+ ]
6954
+ }
6955
+ }
6956
+ }
6957
+ },
6958
+ "400": {
6959
+ "$ref": "#/components/responses/Error400"
6960
+ },
6961
+ "401": {
6962
+ "$ref": "#/components/responses/Error401"
6963
+ },
6964
+ "402": {
6965
+ "$ref": "#/components/responses/Error402"
6966
+ },
6967
+ "403": {
6968
+ "$ref": "#/components/responses/Error403"
6969
+ },
6970
+ "404": {
6971
+ "$ref": "#/components/responses/Error404"
6972
+ },
6973
+ "409": {
6974
+ "$ref": "#/components/responses/Error409"
6975
+ },
6976
+ "410": {
6977
+ "$ref": "#/components/responses/Error410"
6978
+ },
6979
+ "413": {
6980
+ "$ref": "#/components/responses/Error413"
6981
+ },
6982
+ "422": {
6983
+ "$ref": "#/components/responses/Error422"
6984
+ },
6985
+ "429": {
6986
+ "$ref": "#/components/responses/Error429"
6987
+ },
6988
+ "500": {
6989
+ "$ref": "#/components/responses/Error500"
6990
+ },
6991
+ "503": {
6992
+ "$ref": "#/components/responses/Error503"
6993
+ }
6994
+ }
6995
+ },
6545
6996
  {
6546
6997
  "operation_id": "reviewSitePublish",
6547
6998
  "method": "GET",
@@ -6603,6 +7054,27 @@ export const API_OPERATIONS = [
6603
7054
  "url": {
6604
7055
  "type": "string"
6605
7056
  },
7057
+ "platform_address": {
7058
+ "type": "object",
7059
+ "properties": {
7060
+ "slug": {
7061
+ "type": "string"
7062
+ },
7063
+ "domain": {
7064
+ "type": "string"
7065
+ },
7066
+ "is_main": {
7067
+ "type": "boolean"
7068
+ }
7069
+ },
7070
+ "required": [
7071
+ "slug",
7072
+ "domain",
7073
+ "is_main"
7074
+ ],
7075
+ "additionalProperties": false,
7076
+ "description": "The address included with the site, which set_site_address changes. is_main: visitors land on it, no custom domain has taken over."
7077
+ },
6606
7078
  "build": {
6607
7079
  "anyOf": [
6608
7080
  {
@@ -6845,6 +7317,7 @@ export const API_OPERATIONS = [
6845
7317
  "required": [
6846
7318
  "site_id",
6847
7319
  "url",
7320
+ "platform_address",
6848
7321
  "build",
6849
7322
  "revision",
6850
7323
  "draft_revision",
@@ -6993,6 +7466,26 @@ export const API_OPERATIONS = [
6993
7466
  "minimum": -9007199254740991,
6994
7467
  "maximum": 9007199254740991
6995
7468
  },
7469
+ "warnings": {
7470
+ "type": "array",
7471
+ "items": {
7472
+ "type": "object",
7473
+ "properties": {
7474
+ "code": {
7475
+ "type": "string"
7476
+ },
7477
+ "message": {
7478
+ "type": "string"
7479
+ }
7480
+ },
7481
+ "required": [
7482
+ "code",
7483
+ "message"
7484
+ ],
7485
+ "additionalProperties": false
7486
+ },
7487
+ "description": "What went live with something left out: an ignored `_redirects` line loses a moved page. Fix it and publish again."
7488
+ },
6996
7489
  "built": {
6997
7490
  "description": "True when the draft had to be built first.",
6998
7491
  "type": "boolean"
@@ -7003,7 +7496,8 @@ export const API_OPERATIONS = [
7003
7496
  "build_id",
7004
7497
  "generation",
7005
7498
  "url",
7006
- "visible_within_seconds"
7499
+ "visible_within_seconds",
7500
+ "warnings"
7007
7501
  ],
7008
7502
  "additionalProperties": false
7009
7503
  },
@@ -8000,7 +8494,114 @@ export const API_OPERATIONS = [
8000
8494
  },
8001
8495
  "required": [
8002
8496
  "id",
8003
- "message"
8497
+ "message"
8498
+ ],
8499
+ "additionalProperties": false
8500
+ },
8501
+ "request_id": {
8502
+ "type": "string"
8503
+ }
8504
+ },
8505
+ "required": [
8506
+ "data",
8507
+ "request_id"
8508
+ ]
8509
+ }
8510
+ }
8511
+ }
8512
+ },
8513
+ "400": {
8514
+ "$ref": "#/components/responses/Error400"
8515
+ },
8516
+ "401": {
8517
+ "$ref": "#/components/responses/Error401"
8518
+ },
8519
+ "402": {
8520
+ "$ref": "#/components/responses/Error402"
8521
+ },
8522
+ "403": {
8523
+ "$ref": "#/components/responses/Error403"
8524
+ },
8525
+ "404": {
8526
+ "$ref": "#/components/responses/Error404"
8527
+ },
8528
+ "409": {
8529
+ "$ref": "#/components/responses/Error409"
8530
+ },
8531
+ "410": {
8532
+ "$ref": "#/components/responses/Error410"
8533
+ },
8534
+ "413": {
8535
+ "$ref": "#/components/responses/Error413"
8536
+ },
8537
+ "422": {
8538
+ "$ref": "#/components/responses/Error422"
8539
+ },
8540
+ "429": {
8541
+ "$ref": "#/components/responses/Error429"
8542
+ },
8543
+ "500": {
8544
+ "$ref": "#/components/responses/Error500"
8545
+ },
8546
+ "503": {
8547
+ "$ref": "#/components/responses/Error503"
8548
+ }
8549
+ }
8550
+ },
8551
+ {
8552
+ "operation_id": "removeSiteDomain",
8553
+ "method": "DELETE",
8554
+ "path": "/v1/sites/{site_id}/domains/{domain_id}",
8555
+ "summary": "Remove a domain",
8556
+ "description": "The site stops answering on this domain within about a minute. Its atelier201.page address keeps working.",
8557
+ "authentication_required": true,
8558
+ "scope": "domains:write",
8559
+ "surfaces": {
8560
+ "cli": "atelier201 domains remove",
8561
+ "mcp": "remove_domain"
8562
+ },
8563
+ "parameters": [
8564
+ {
8565
+ "name": "site_id",
8566
+ "in": "path",
8567
+ "required": true,
8568
+ "schema": {
8569
+ "type": "string"
8570
+ },
8571
+ "description": "The site's id, or its slug (the address before .atelier201.page)."
8572
+ },
8573
+ {
8574
+ "name": "domain_id",
8575
+ "in": "path",
8576
+ "required": true,
8577
+ "schema": {
8578
+ "type": "string"
8579
+ }
8580
+ }
8581
+ ],
8582
+ "request_body": null,
8583
+ "responses": {
8584
+ "200": {
8585
+ "description": "Remove a domain",
8586
+ "content": {
8587
+ "application/json": {
8588
+ "schema": {
8589
+ "type": "object",
8590
+ "properties": {
8591
+ "data": {
8592
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
8593
+ "type": "object",
8594
+ "properties": {
8595
+ "id": {
8596
+ "type": "string"
8597
+ },
8598
+ "removed": {
8599
+ "type": "boolean"
8600
+ }
8601
+ },
8602
+ "required": [
8603
+ "id",
8604
+ "removed"
8004
8605
  ],
8005
8606
  "additionalProperties": false
8006
8607
  },
@@ -8055,16 +8656,16 @@ export const API_OPERATIONS = [
8055
8656
  }
8056
8657
  },
8057
8658
  {
8058
- "operation_id": "removeSiteDomain",
8059
- "method": "DELETE",
8060
- "path": "/v1/sites/{site_id}/domains/{domain_id}",
8061
- "summary": "Remove a domain",
8062
- "description": "The site stops answering on this domain within about a minute. Its atelier201.page address keeps working.",
8659
+ "operation_id": "setSiteAddress",
8660
+ "method": "POST",
8661
+ "path": "/v1/sites/{site_id}/address",
8662
+ "summary": "Change the site's atelier201.page address",
8663
+ "description": "Moves the site to <slug>.atelier201.page. The address must be free. The previous one redirects here for 30 days (visitors keep their links) and only this site can take it back meanwhile. Existing preview links keep working. A live site whose main address this is gets a rebuild; publish it to finish. No credits.",
8063
8664
  "authentication_required": true,
8064
8665
  "scope": "domains:write",
8065
8666
  "surfaces": {
8066
- "cli": "atelier201 domains remove",
8067
- "mcp": "remove_domain"
8667
+ "cli": "atelier201 domains address",
8668
+ "mcp": "set_site_address"
8068
8669
  },
8069
8670
  "parameters": [
8070
8671
  {
@@ -8075,20 +8676,34 @@ export const API_OPERATIONS = [
8075
8676
  "type": "string"
8076
8677
  },
8077
8678
  "description": "The site's id, or its slug (the address before .atelier201.page)."
8078
- },
8079
- {
8080
- "name": "domain_id",
8081
- "in": "path",
8082
- "required": true,
8083
- "schema": {
8084
- "type": "string"
8085
- }
8086
8679
  }
8087
8680
  ],
8088
- "request_body": null,
8681
+ "request_body": {
8682
+ "required": true,
8683
+ "content": {
8684
+ "application/json": {
8685
+ "schema": {
8686
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
8687
+ "type": "object",
8688
+ "properties": {
8689
+ "slug": {
8690
+ "type": "string",
8691
+ "minLength": 3,
8692
+ "maxLength": 40,
8693
+ "description": "The new address: <slug>.atelier201.page. 3 to 40 lowercase letters, digits or single hyphens."
8694
+ }
8695
+ },
8696
+ "required": [
8697
+ "slug"
8698
+ ],
8699
+ "additionalProperties": false
8700
+ }
8701
+ }
8702
+ }
8703
+ },
8089
8704
  "responses": {
8090
8705
  "200": {
8091
- "description": "Remove a domain",
8706
+ "description": "Change the site's atelier201.page address",
8092
8707
  "content": {
8093
8708
  "application/json": {
8094
8709
  "schema": {
@@ -8098,16 +8713,200 @@ export const API_OPERATIONS = [
8098
8713
  "$schema": "https://json-schema.org/draft/2020-12/schema",
8099
8714
  "type": "object",
8100
8715
  "properties": {
8101
- "id": {
8716
+ "slug": {
8102
8717
  "type": "string"
8103
8718
  },
8104
- "removed": {
8105
- "type": "boolean"
8719
+ "hostname": {
8720
+ "type": "string"
8721
+ },
8722
+ "url": {
8723
+ "type": "string"
8724
+ },
8725
+ "previous_hostname": {
8726
+ "description": "The address given up. Null when the site already had this address.",
8727
+ "type": [
8728
+ "string",
8729
+ "null"
8730
+ ]
8731
+ },
8732
+ "redirects_until": {
8733
+ "description": "Until when the previous address redirects here. Null when the site was never published: it had no visitors to redirect.",
8734
+ "type": [
8735
+ "string",
8736
+ "null"
8737
+ ]
8738
+ },
8739
+ "rebuild": {
8740
+ "anyOf": [
8741
+ {
8742
+ "type": "object",
8743
+ "properties": {
8744
+ "id": {
8745
+ "type": "string"
8746
+ },
8747
+ "site_id": {
8748
+ "type": "string"
8749
+ },
8750
+ "revision": {
8751
+ "type": "string",
8752
+ "minLength": 40,
8753
+ "maxLength": 40,
8754
+ "description": "A Git commit id (40 hex characters) of the site's repository."
8755
+ },
8756
+ "state": {
8757
+ "type": "string",
8758
+ "enum": [
8759
+ "queued",
8760
+ "building",
8761
+ "collecting",
8762
+ "ready",
8763
+ "failed",
8764
+ "cancelled"
8765
+ ]
8766
+ },
8767
+ "target_origin": {
8768
+ "type": "string"
8769
+ },
8770
+ "profile": {
8771
+ "type": "string",
8772
+ "enum": [
8773
+ "standard",
8774
+ "guest-demo"
8775
+ ]
8776
+ },
8777
+ "file_count": {
8778
+ "anyOf": [
8779
+ {
8780
+ "type": "integer",
8781
+ "minimum": -9007199254740991,
8782
+ "maximum": 9007199254740991
8783
+ },
8784
+ {
8785
+ "type": "null"
8786
+ }
8787
+ ]
8788
+ },
8789
+ "total_bytes": {
8790
+ "anyOf": [
8791
+ {
8792
+ "type": "integer",
8793
+ "minimum": -9007199254740991,
8794
+ "maximum": 9007199254740991
8795
+ },
8796
+ {
8797
+ "type": "null"
8798
+ }
8799
+ ]
8800
+ },
8801
+ "duration_ms": {
8802
+ "anyOf": [
8803
+ {
8804
+ "type": "integer",
8805
+ "minimum": -9007199254740991,
8806
+ "maximum": 9007199254740991
8807
+ },
8808
+ {
8809
+ "type": "null"
8810
+ }
8811
+ ]
8812
+ },
8813
+ "error": {
8814
+ "anyOf": [
8815
+ {
8816
+ "type": "object",
8817
+ "properties": {
8818
+ "code": {
8819
+ "type": "string"
8820
+ },
8821
+ "message": {
8822
+ "type": [
8823
+ "string",
8824
+ "null"
8825
+ ]
8826
+ }
8827
+ },
8828
+ "required": [
8829
+ "code",
8830
+ "message"
8831
+ ],
8832
+ "additionalProperties": false
8833
+ },
8834
+ {
8835
+ "type": "null"
8836
+ }
8837
+ ]
8838
+ },
8839
+ "warnings": {
8840
+ "type": "array",
8841
+ "items": {
8842
+ "type": "string"
8843
+ }
8844
+ },
8845
+ "created_at": {
8846
+ "type": "string",
8847
+ "description": "ISO 8601, UTC."
8848
+ },
8849
+ "started_at": {
8850
+ "anyOf": [
8851
+ {
8852
+ "type": "string",
8853
+ "description": "ISO 8601, UTC."
8854
+ },
8855
+ {
8856
+ "type": "null"
8857
+ }
8858
+ ]
8859
+ },
8860
+ "finished_at": {
8861
+ "anyOf": [
8862
+ {
8863
+ "type": "string",
8864
+ "description": "ISO 8601, UTC."
8865
+ },
8866
+ {
8867
+ "type": "null"
8868
+ }
8869
+ ]
8870
+ }
8871
+ },
8872
+ "required": [
8873
+ "id",
8874
+ "site_id",
8875
+ "revision",
8876
+ "state",
8877
+ "target_origin",
8878
+ "profile",
8879
+ "file_count",
8880
+ "total_bytes",
8881
+ "duration_ms",
8882
+ "error",
8883
+ "warnings",
8884
+ "created_at",
8885
+ "started_at",
8886
+ "finished_at"
8887
+ ],
8888
+ "additionalProperties": false
8889
+ },
8890
+ {
8891
+ "type": "null"
8892
+ }
8893
+ ]
8894
+ },
8895
+ "next_action": {
8896
+ "type": [
8897
+ "string",
8898
+ "null"
8899
+ ]
8106
8900
  }
8107
8901
  },
8108
8902
  "required": [
8109
- "id",
8110
- "removed"
8903
+ "slug",
8904
+ "hostname",
8905
+ "url",
8906
+ "previous_hostname",
8907
+ "redirects_until",
8908
+ "rebuild",
8909
+ "next_action"
8111
8910
  ],
8112
8911
  "additionalProperties": false
8113
8912
  },
@@ -10160,6 +10959,10 @@ export const API_OPERATIONS = [
10160
10959
  "null"
10161
10960
  ]
10162
10961
  },
10962
+ "keep_original": {
10963
+ "type": "boolean",
10964
+ "description": "Stored exactly as uploaded, and never re-encoded by a build. Otherwise a picture over 200 KB is compressed when it arrives (2000 px at most, towards 150 KB, quality 75 or more, metadata removed)."
10965
+ },
10163
10966
  "created_at": {
10164
10967
  "type": "string",
10165
10968
  "description": "ISO 8601, UTC."
@@ -10174,6 +10977,7 @@ export const API_OPERATIONS = [
10174
10977
  "alt",
10175
10978
  "credit",
10176
10979
  "source_url",
10980
+ "keep_original",
10177
10981
  "created_at"
10178
10982
  ],
10179
10983
  "additionalProperties": false
@@ -10252,7 +11056,7 @@ export const API_OPERATIONS = [
10252
11056
  "method": "POST",
10253
11057
  "path": "/v1/sites/{site_id}/media",
10254
11058
  "summary": "Upload a media file",
10255
- "description": "Send the file as the raw request body with `?filename=`. Images, PDF and short videos, 20 MB each. Reference it as /media/<filename> in content; it is included from the next build.",
11059
+ "description": "Send the file as the raw request body with `?filename=`. Images, PDF and short videos, 20 MB each. A picture over 200 KB is compressed when it arrives (2000 px at most, towards 150 KB, sharp on Retina, metadata removed); `keep_original=true` stores it exactly as sent, only when the owner asks. Reference it as /media/<filename> in content; it is included from the next build.",
10256
11060
  "authentication_required": true,
10257
11061
  "scope": "sites:write",
10258
11062
  "surfaces": {
@@ -10287,6 +11091,15 @@ export const API_OPERATIONS = [
10287
11091
  "type": "string",
10288
11092
  "maxLength": 300
10289
11093
  }
11094
+ },
11095
+ {
11096
+ "name": "keep_original",
11097
+ "in": "query",
11098
+ "required": false,
11099
+ "schema": {
11100
+ "description": "true keeps the file exactly as sent, at full quality and weight: only when the owner asks for it (a photographer's work). By default a picture over 200 KB is compressed when it arrives.",
11101
+ "type": "boolean"
11102
+ }
10290
11103
  }
10291
11104
  ],
10292
11105
  "request_body": null,
@@ -10339,10 +11152,20 @@ export const API_OPERATIONS = [
10339
11152
  "null"
10340
11153
  ]
10341
11154
  },
11155
+ "keep_original": {
11156
+ "type": "boolean",
11157
+ "description": "Stored exactly as uploaded, and never re-encoded by a build. Otherwise a picture over 200 KB is compressed when it arrives (2000 px at most, towards 150 KB, quality 75 or more, metadata removed)."
11158
+ },
10342
11159
  "created_at": {
10343
11160
  "type": "string",
10344
11161
  "description": "ISO 8601, UTC."
10345
11162
  },
11163
+ "original_size": {
11164
+ "type": "integer",
11165
+ "minimum": -9007199254740991,
11166
+ "maximum": 9007199254740991,
11167
+ "description": "The size that was sent, in bytes; `size` is what is stored after compression."
11168
+ },
10346
11169
  "next_action": {
10347
11170
  "type": "string"
10348
11171
  }
@@ -10356,7 +11179,9 @@ export const API_OPERATIONS = [
10356
11179
  "alt",
10357
11180
  "credit",
10358
11181
  "source_url",
11182
+ "keep_original",
10359
11183
  "created_at",
11184
+ "original_size",
10360
11185
  "next_action"
10361
11186
  ],
10362
11187
  "additionalProperties": false
@@ -10909,6 +11734,10 @@ export const API_OPERATIONS = [
10909
11734
  "null"
10910
11735
  ]
10911
11736
  },
11737
+ "keep_original": {
11738
+ "type": "boolean",
11739
+ "description": "Stored exactly as uploaded, and never re-encoded by a build. Otherwise a picture over 200 KB is compressed when it arrives (2000 px at most, towards 150 KB, quality 75 or more, metadata removed)."
11740
+ },
10912
11741
  "source": {
10913
11742
  "type": "object",
10914
11743
  "propertyNames": {
@@ -10928,6 +11757,7 @@ export const API_OPERATIONS = [
10928
11757
  "alt",
10929
11758
  "credit",
10930
11759
  "source_url",
11760
+ "keep_original",
10931
11761
  "source",
10932
11762
  "next_action"
10933
11763
  ],
@@ -11503,6 +12333,10 @@ export const API_OPERATIONS = [
11503
12333
  "string",
11504
12334
  "null"
11505
12335
  ]
12336
+ },
12337
+ "keep_original": {
12338
+ "type": "boolean",
12339
+ "description": "Stored exactly as uploaded, and never re-encoded by a build. Otherwise a picture over 200 KB is compressed when it arrives (2000 px at most, towards 150 KB, quality 75 or more, metadata removed)."
11506
12340
  }
11507
12341
  },
11508
12342
  "required": [
@@ -11511,7 +12345,8 @@ export const API_OPERATIONS = [
11511
12345
  "mime",
11512
12346
  "size",
11513
12347
  "alt",
11514
- "credit"
12348
+ "credit",
12349
+ "keep_original"
11515
12350
  ],
11516
12351
  "additionalProperties": false
11517
12352
  },
@@ -11721,6 +12556,10 @@ export const API_OPERATIONS = [
11721
12556
  "string",
11722
12557
  "null"
11723
12558
  ]
12559
+ },
12560
+ "keep_original": {
12561
+ "type": "boolean",
12562
+ "description": "Stored exactly as uploaded, and never re-encoded by a build. Otherwise a picture over 200 KB is compressed when it arrives (2000 px at most, towards 150 KB, quality 75 or more, metadata removed)."
11724
12563
  }
11725
12564
  },
11726
12565
  "required": [
@@ -11729,7 +12568,8 @@ export const API_OPERATIONS = [
11729
12568
  "mime",
11730
12569
  "size",
11731
12570
  "alt",
11732
- "credit"
12571
+ "credit",
12572
+ "keep_original"
11733
12573
  ],
11734
12574
  "additionalProperties": false
11735
12575
  },
@@ -12552,7 +13392,7 @@ export const API_OPERATIONS = [
12552
13392
  "method": "POST",
12553
13393
  "path": "/v1/guest/sites/{site_id}/builds",
12554
13394
  "summary": "Build a guest site",
12555
- "description": "Authorization: Guest <write_token>. Builds the guest site (3 builds per guest site). Then poll its status for the demo URL.",
13395
+ "description": "Authorization: Guest <write_token>. Builds the guest site (3 builds per guest site). Then poll its status for the demo URL. One build runs at a time: `is_requested_revision` false means `build` is an earlier version, so wait for it to end and call this again.",
12556
13396
  "authentication_required": false,
12557
13397
  "scope": null,
12558
13398
  "surfaces": {
@@ -12587,6 +13427,10 @@ export const API_OPERATIONS = [
12587
13427
  "reused": {
12588
13428
  "type": "boolean"
12589
13429
  },
13430
+ "is_requested_revision": {
13431
+ "type": "boolean",
13432
+ "description": "False when `build` is an earlier version already running."
13433
+ },
12590
13434
  "next_action": {
12591
13435
  "type": "string"
12592
13436
  }
@@ -12594,6 +13438,7 @@ export const API_OPERATIONS = [
12594
13438
  "required": [
12595
13439
  "build",
12596
13440
  "reused",
13441
+ "is_requested_revision",
12597
13442
  "next_action"
12598
13443
  ],
12599
13444
  "additionalProperties": false