Take a copy's template update (AS16)
curl --request POST \
--url https://api.eddy.engineer/v1/workshop/copies/{id}/update \
--header 'Content-Type: application/json' \
--data '
{
"agent_resolutions": {},
"expected_version": 123,
"resolutions": {}
}
'import requests
url = "https://api.eddy.engineer/v1/workshop/copies/{id}/update"
payload = {
"agent_resolutions": {},
"expected_version": 123,
"resolutions": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({agent_resolutions: {}, expected_version: 123, resolutions: {}})
};
fetch('https://api.eddy.engineer/v1/workshop/copies/{id}/update', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/workshop/copies/{id}/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_resolutions' => [
],
'expected_version' => 123,
'resolutions' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/workshop/copies/{id}/update"
payload := strings.NewReader("{\n \"agent_resolutions\": {},\n \"expected_version\": 123,\n \"resolutions\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/workshop/copies/{id}/update")
.header("Content-Type", "application/json")
.body("{\n \"agent_resolutions\": {},\n \"expected_version\": 123,\n \"resolutions\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/workshop/copies/{id}/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_resolutions\": {},\n \"expected_version\": 123,\n \"resolutions\": {}\n}"
response = http.request(request)
puts response.read_body{
"agent": {},
"app": {},
"applied": true,
"from": 123,
"offer": {
"base_available": true,
"changes": [
{}
],
"copy": "<string>",
"gone": true,
"kind": "<string>",
"merge": {},
"note": "<string>",
"origin": {},
"template": {},
"template_changes": {},
"update": true,
"version": 123,
"your_changes": {}
},
"to": 123
}Meta
Take a copy's template update (AS16)
The whole-state three-way merge of the copy (ours) and the template’s latest version (theirs) over the version the copy came from (the base), through the document’s family (CO13b’s merge): a node only one side moved takes that side; a node both moved differently is a conflict, never picked silently — the update is refused (409 TEMPLATE_UPDATE_CONFLICT, the conflicts beside it) until each is settled in resolutions (by path or node: ours, theirs or a value). A clean merge saves as the copy’s next version (its own save and version check) with origin at the version it took; a live chain open on the copy rotates onto it.
POST
/
v1
/
workshop
/
copies
/
{id}
/
update
Take a copy's template update (AS16)
curl --request POST \
--url https://api.eddy.engineer/v1/workshop/copies/{id}/update \
--header 'Content-Type: application/json' \
--data '
{
"agent_resolutions": {},
"expected_version": 123,
"resolutions": {}
}
'import requests
url = "https://api.eddy.engineer/v1/workshop/copies/{id}/update"
payload = {
"agent_resolutions": {},
"expected_version": 123,
"resolutions": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({agent_resolutions: {}, expected_version: 123, resolutions: {}})
};
fetch('https://api.eddy.engineer/v1/workshop/copies/{id}/update', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/workshop/copies/{id}/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_resolutions' => [
],
'expected_version' => 123,
'resolutions' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/workshop/copies/{id}/update"
payload := strings.NewReader("{\n \"agent_resolutions\": {},\n \"expected_version\": 123,\n \"resolutions\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/workshop/copies/{id}/update")
.header("Content-Type", "application/json")
.body("{\n \"agent_resolutions\": {},\n \"expected_version\": 123,\n \"resolutions\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/workshop/copies/{id}/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_resolutions\": {},\n \"expected_version\": 123,\n \"resolutions\": {}\n}"
response = http.request(request)
puts response.read_body{
"agent": {},
"app": {},
"applied": true,
"from": 123,
"offer": {
"base_available": true,
"changes": [
{}
],
"copy": "<string>",
"gone": true,
"kind": "<string>",
"merge": {},
"note": "<string>",
"origin": {},
"template": {},
"template_changes": {},
"update": true,
"version": 123,
"your_changes": {}
},
"to": 123
}Body
application/json