Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "swapi dev to tech migration (#59)" #64

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -719,15 +719,15 @@ resolution of the two fetch functions they each depend on.
```json
> .init -f "example/ex21.json"
{
"story": "${ [partI, 'then', partII]~>$join(' ')}",
"handleRes": "${ function($res){$res.ok? $res.json():$res.status?{'status': $res.status}:$res} }",
"call": "${function($url){$fetch($url) ~> handleRes}}",
"partI": "${ [han, 'piloted the', falcon] ~> $join(' ')}",
"luke": "${ call('https://swapi.tech/api/people/?name=luke').result[0].properties.name}",
"xwing": "${ call('https://swapi.tech/api/starships/?name=x-wing').result[0].properties.name}",
"partII": "${ [luke, 'piloted the', xwing] ~> $join(' ')}",
"han": "${ call('https://swapi.tech/api/people/?name=han').result[0].properties.name}",
"falcon": "${ call('https://swapi.tech/api/starships/?name=Millennium').result[0].properties.name}"
"story": "${ [partI, 'then', partII]~>$join(' ')}",
"handleRes": "${ function($res){$res.ok? $res.json():$res.status?{'status': $res.status}:$res} }",
"call": "${function($url){$fetch($url) ~> handleRes}}",
"partI": "${ [han, 'piloted the', falcon] ~> $join(' ')}",
"luke": "${ call('https://swapi.dev/api/people/?search=luke').results[0].name}",
"xwing": "${ call('https://swapi.dev/api/starships/?search=x').results[0].name}",
"partII": "${ [luke, 'piloted the', xwing] ~> $join(' ')}",
"han": "${ call('https://swapi.dev/api/people/?search=han').results[0].name}",
"falcon": "${ call('https://swapi.dev/api/starships/?search=Millennium').results[0].name}"
}
> .plan
[
Expand Down Expand Up @@ -763,11 +763,11 @@ The .svg command serves an SVG diagram of the DAG
"handleRes": "${ function($res){$res.ok? $res.json():$res.status?{'status': $res.status}:$res} }",
"call": "${function($url){$fetch($url) ~> handleRes}}",
"partI": "${ [han, 'piloted the', falcon] ~> $join(' ')}",
"luke": "${ call('https://swapi.tech/api/people/?name=luke').result[0].properties.name}",
"xwing": "${ call('https://swapi.tech/api/starships/?name=x-wing').result[0].properties.name}",
"luke": "${ call('https://swapi.dev/api/people/?search=luke').results[0].name}",
"xwing": "${ call('https://swapi.dev/api/starships/?search=x').results[0].name}",
"partII": "${ [luke, 'piloted the', xwing] ~> $join(' ')}",
"han": "${ call('https://swapi.tech/api/people/?name=han').result[0].properties.name}",
"falcon": "${ call('https://swapi.tech/api/starships/?name=Millennium').result[0].properties.name}"
"han": "${ call('https://swapi.dev/api/people/?search=han').results[0].name}",
"falcon": "${ call('https://swapi.dev/api/starships/?search=Millennium').results[0].name}"
}
> .svg --port=4042
Server is running on port 4042
Expand Down
2 changes: 1 addition & 1 deletion example/concurrent-homeworlds.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"people": ["luke", "han"],
"personDetails": "!${ people.$fetch('https://swapi.tech/api/people/?search='& $).json().results[0]}",
"personDetails": "!${ people.$fetch('https://swapi.dev/api/people/?search='& $).json().results[0]}",
"homeworldURLs": "${ personDetails.homeworld }",
"homeworldDetails": "!${ homeworldURLs.$fetch($).json() }",
"homeworldName": "${ homeworldDetails.name }"
Expand Down
8 changes: 4 additions & 4 deletions example/ex21.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"handleRes": "${ function($res){$res.ok? $res.json():$res.status?{'status': $res.status}:$res} }",
"call": "${function($url){$fetch($url) ~> handleRes}}",
"partI": "${ [han, 'piloted the', falcon] ~> $join(' ')}",
"luke": "${ call('https://swapi.tech/api/people/?name=luke').result[0].properties.name}",
"xwing": "${ call('https://swapi.tech/api/starships/?name=x-wing').result[0].properties.name}",
"luke": "${ call('https://swapi.dev/api/people/?search=luke').results[0].name}",
"xwing": "${ call('https://swapi.dev/api/starships/?search=x').results[0].name}",
"partII": "${ [luke, 'piloted the', xwing] ~> $join(' ')}",
"han": "${ call('https://swapi.tech/api/people/?name=han').result[0].properties.name}",
"falcon": "${ call('https://swapi.tech/api/starships/?name=Millennium').result[0].properties.name}"
"han": "${ call('https://swapi.dev/api/people/?search=han').results[0].name}",
"falcon": "${ call('https://swapi.dev/api/starships/?search=Millennium').results[0].name}"
}
6 changes: 3 additions & 3 deletions example/ex22.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"toStr": "${ function($_){$_.error?'UNKNOWN':$_.results[0].name} }",
"partI": "${ [han, 'piloted the', falcon]~> $join(' ')}",
"luke": "${ call('https://*****BROKEN-ON-PURPOSE-TO-SHOW-ERROR-HANDLING*****/api/people/?search=luke')}",
"xwing": "${ call('https://swapi.tech/api/starships/?search=x')}",
"xwing": "${ call('https://swapi.dev/api/starships/?search=x')}",
"partII": "${ [luke, 'piloted the', xwing]~> $join(' ')}",
"han": "${ call('https://swapi.tech/api/people/?search=han')}",
"falcon": "${ call('https://swapi.tech/api/starships/?search=Millennium')}"
"han": "${ call('https://swapi.dev/api/people/?search=han')}",
"falcon": "${ call('https://swapi.dev/api/starships/?search=Millennium')}"
}
6 changes: 3 additions & 3 deletions example/ex22.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ call: |
}
partI: "${ [han, 'piloted the', falcon]~> $join(' ')}"
luke: "${ call('https://*****BROKEN-ON-PURPOSE-TO-SHOW-ERROR-HANDLING*****/api/people/?search=luke')}"
xwing: "${ call('https://swapi.tech/api/starships/?search=x')}"
xwing: "${ call('https://swapi.dev/api/starships/?search=x')}"
partII: "${ [luke, 'piloted the', xwing]~> $join(' ')}"
han: "${ call('https://swapi.tech/api/people/?search=han')}"
falcon: "${ call('https://swapi.tech/api/starships/?search=Millennium')}"
han: "${ call('https://swapi.dev/api/people/?search=han')}"
falcon: "${ call('https://swapi.dev/api/starships/?search=Millennium')}"
2 changes: 1 addition & 1 deletion example/homeworlds.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lukePersonDetails": "${ $fetch('https://swapi.tech/api/people/?search=luke').json().results[0]}",
"lukePersonDetails": "${ $fetch('https://swapi.dev/api/people/?search=luke').json().results[0]}",
"lukeHomeworldURL": "${ lukePersonDetails.homeworld }",
"homeworldDetails": "${ $fetch(lukeHomeworldURL).json() }",
"homeworldName": "${ homeworldDetails.name }"
Expand Down
2 changes: 1 addition & 1 deletion src/test/DependencyFinder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ test("rando", () => {
});

test("navigate into function's return", () => {
const program = "call('https://swapi.tech/api/people/?search=luke').results[0].name";
const program = "call('https://swapi.dev/api/people/?search=luke').results[0].name";
const df = new DependencyFinder(program);
expect(df.findDependencies()).toEqual([["call"]]);
});
Expand Down
14 changes: 7 additions & 7 deletions src/test/TemplateProcessor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2277,21 +2277,21 @@ test("dataChangeCallback on delete op from Snapshot", async () => {
"eye_color": "brown",
"birth_year": "29BBY",
"gender": "male",
"homeworld": "https://swapi.tech/api/planets/22/",
"homeworld": "https://swapi.dev/api/planets/22/",
"films": [
"https://swapi.tech/api/films/1/",
"https://swapi.tech/api/films/2/",
"https://swapi.tech/api/films/3/"
"https://swapi.dev/api/films/1/",
"https://swapi.dev/api/films/2/",
"https://swapi.dev/api/films/3/"
],
"species": [],
"vehicles": [],
"starships": [
"https://swapi.tech/api/starships/10/",
"https://swapi.tech/api/starships/22/"
"https://swapi.dev/api/starships/10/",
"https://swapi.dev/api/starships/22/"
],
"created": "2014-12-10T16:49:14.582000Z",
"edited": "2014-12-20T21:17:50.334000Z",
"url": "https://swapi.tech/api/people/14/"
"url": "https://swapi.dev/api/people/14/"
}
}
}
Expand Down
Loading