Skip to content
Open
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
11 changes: 11 additions & 0 deletions plugins/NASA/v1/configValidation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"steps": [
{
"displayName": "Connect to NASA's API",
"dataStream": { "name": "apodToday" },
"required": true,
"error": "Could not authenticate with NASA's API. Check your API key at api.nasa.gov — DEMO_KEY is shared and may be rate-limited.",
"success": "Connected to NASA's API successfully."
}
]
}
23 changes: 23 additions & 0 deletions plugins/NASA/v1/custom_types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
{
"name": "Near-Earth Object",
"sourceType": "Near-Earth Object",
"icon": "meteor",
"singular": "Near-Earth Object",
"plural": "Near-Earth Objects"
},
{
"name": "Space Weather Notification",
"sourceType": "Space Weather Notification",
"icon": "sun",
"singular": "Space Weather Notification",
"plural": "Space Weather Notifications"
},
{
"name": "Satellite",
"sourceType": "Satellite",
"icon": "satellite",
"singular": "Satellite",
"plural": "Satellites"
}
]
37 changes: 37 additions & 0 deletions plugins/NASA/v1/dataStreams/apodGallery.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "apodGallery",
"displayName": "Astronomy Picture of the Day Gallery",
"description": "Astronomy pictures of the day over a date range",
"tags": ["Astronomy"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "/planetary/apod",
"getArgs": [
{
"key": "start_date",
"value": "{{new Date(timeframe.start).toISOString().split('T')[0]}}"
},
{
"key": "end_date",
"value": "{{new Date(timeframe.end).toISOString().split('T')[0]}}"
}
]
},
"matches": "none",
"metadata": [
{ "name": "title", "displayName": "Title", "shape": "string", "role": "label" },
{ "name": "date", "displayName": "Date", "shape": "date", "role": "timestamp" },
{ "name": "explanation", "displayName": "Explanation", "shape": "string" },
{ "name": "media_type", "displayName": "Media Type", "shape": "string" },
{ "name": "url", "displayName": "Media URL", "shape": ["url", { "label": "View" }] },
{
"name": "hdurl",
"displayName": "HD Image URL",
"shape": ["url", { "label": "View HD" }],
"visible": false
},
{ "name": "copyright", "displayName": "Copyright", "shape": "string", "visible": false }
],
"timeframes": ["last7days", "last30days", "thisMonth", "lastMonth", "thisQuarter", "thisYear"]
}
28 changes: 28 additions & 0 deletions plugins/NASA/v1/dataStreams/apodToday.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "apodToday",
"displayName": "Astronomy Picture of the Day",
"description": "The current featured astronomy image or video, with its explanation",
"tags": ["Astronomy"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "/planetary/apod",
"expandInnerObjects": true
},
"matches": "none",
"metadata": [
{ "name": "title", "displayName": "Title", "shape": "string", "role": "label" },
{ "name": "date", "displayName": "Date", "shape": "date", "role": "timestamp" },
{ "name": "explanation", "displayName": "Explanation", "shape": "string" },
{ "name": "media_type", "displayName": "Media Type", "shape": "string" },
{ "name": "url", "displayName": "Media URL", "shape": ["url", { "label": "View" }] },
{
"name": "hdurl",
"displayName": "HD Image URL",
"shape": ["url", { "label": "View HD" }],
"visible": false
},
{ "name": "copyright", "displayName": "Copyright", "shape": "string", "visible": false }
],
"timeframes": false
}
53 changes: 53 additions & 0 deletions plugins/NASA/v1/dataStreams/donkiNotifications.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "donkiNotifications",
"displayName": "Space Weather Notifications",
"description": "Space weather alerts from the last 30 days, covering solar flares, coronal mass ejections, geomagnetic storms and other event types",
"tags": ["Astronomy", "Alerts"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "/DONKI/notifications",
"getArgs": [
{ "key": "type", "value": "all" },
{
"key": "startDate",
"value": "{{new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString().split('T')[0]}}"
},
{ "key": "endDate", "value": "{{new Date().toISOString().split('T')[0]}}" }
]
},
"matches": "none",
"metadata": [
{ "name": "messageID", "displayName": "Message ID", "shape": "string", "role": "id" },
{ "name": "messageType", "displayName": "Type", "shape": "string" },
{
"name": "messageIssueTime",
"displayName": "Issued",
"shape": "date",
"role": "timestamp"
},
{
"name": "messageURL",
"displayName": "Details",
"shape": ["url", { "label": "View" }],
"visible": false
},
{ "name": "messageBody", "displayName": "Message Body", "shape": "string", "visible": false },
{
"name": "title",
"displayName": "Notification",
"computed": true,
"valueExpression": "{{ $['messageType'] + ' — ' + $['messageIssueTime'].split('T')[0] }}",
"shape": "string",
"role": "label"
},
{
"name": "summary",
"displayName": "Summary",
"computed": true,
"valueExpression": "{{ $['messageBody'].substring(0, 300) }}",
"shape": "string"
}
],
"timeframes": false
}
41 changes: 41 additions & 0 deletions plugins/NASA/v1/dataStreams/neoCloseApproaches.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "neoCloseApproaches",
"displayName": "Near-Earth Object Close Approaches",
"description": "All known close approaches to Earth (and other bodies) for a near-Earth asteroid, past and future",
"tags": ["Astronomy"],
"baseDataSourceName": "httpRequestScopedSingle",
"config": {
"httpMethod": "get",
"endpointPath": "/neo/rest/v1/neo/{{object.rawId}}",
"pathToData": "close_approach_data",
"expandInnerObjects": true
},
"matches": { "sourceType": { "type": "oneOf", "values": ["Near-Earth Object"] } },
"metadata": [
{
"name": "close_approach_date",
"displayName": "Close Approach Date",
"shape": "date",
"role": "timestamp"
},
{
"name": "close_approach_date_full",
"displayName": "Close Approach Date (Full)",
"shape": "string",
"visible": false
},
{ "name": "orbiting_body", "displayName": "Orbiting Body", "shape": "string" },
{
"name": "miss_distance.kilometers",
"displayName": "Miss Distance (km)",
"shape": ["number", { "thousandsSeparator": true }]
},
{
"name": "relative_velocity.kilometers_per_hour",
"displayName": "Relative Velocity (km/h)",
"shape": ["number", { "thousandsSeparator": true }]
},
{ "pattern": ".*" }
],
"timeframes": false
}
69 changes: 69 additions & 0 deletions plugins/NASA/v1/dataStreams/neoFeed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"name": "neoFeed",
"displayName": "Near-Earth Object Close Approaches",
"description": "Asteroids with a close approach to Earth in the current 7-day window, one row per asteroid",
"tags": ["Astronomy"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "/neo/rest/v1/feed",
"getArgs": [
{ "key": "start_date", "value": "{{new Date().toISOString().split('T')[0]}}" },
{
"key": "end_date",
"value": "{{new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString().split('T')[0]}}"
}
Comment on lines +11 to +15

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

What is the maximum date range for the NASA NeoWs feed endpoint (/neo/rest/v1/feed)? Does it count the range inclusively or exclusively?

💡 Result:

The maximum date range for the NASA NeoWs feed endpoint (/neo/rest/v1/feed) is 7 days [1][2][3][4]. While some earlier documentation or external sources might have occasionally cited different limits, the consensus among technical documentation is that the API restricts queries to a span of no more than 7 days [1][2][3][5][4]. Regarding inclusivity, the date range is inclusive of both the start_date and the end_date [5][6]. When you perform a request, the API returns near-Earth object data for the entire duration of the specified range, including all records from the start and end dates provided in the query parameters [5].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'FILE CONTEXT\n'
git ls-files plugins/NASA/v1/dataStreams/neoFeed.json
wc -l plugins/NASA/v1/dataStreams/neoFeed.json
cat -n plugins/NASA/v1/dataStreams/neoFeed.json | sed -n '1,80p'

printf '\nDOC SEARCH\n'
python3 - <<'PY'
import urllib.parse, json, sys, textwrap, subprocess, os
queries = [
    "site:api.nasa.gov neo/rest/v1/feed 7 days inclusive start_date end_date",
    "NASA NeoWs feed endpoint 7 days inclusive date range",
]
for q in queries:
    print(f"\nQUERY: {q}")
    # no network fetch here; just print for the record if external browsing isn't available
PY

Repository: squaredup/plugins

Length of output: 3427


Cap the NeoWs feed window at 6 days
start_date to end_date is inclusive, so today + 7 requests 8 calendar days and can return a 400. Use today + 6 instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/NASA/v1/dataStreams/neoFeed.json` around lines 11 - 15, Update the
end_date expression in the NeoWs feed parameters to add 6 days instead of 7,
while preserving the existing ISO date formatting and start_date behavior.

],
"postRequestScript": "neoFeed.js"
},
"matches": "none",
"metadata": [
{ "name": "id", "displayName": "Asteroid ID", "shape": "string", "role": "id" },
{ "name": "name", "displayName": "Name", "shape": "string", "role": "label" },
{
"name": "close_approach_date",
"displayName": "Close Approach Date",
"shape": "date",
"role": "timestamp"
},
{
"name": "miss_distance_km",
"displayName": "Miss Distance (km)",
"shape": ["number", { "thousandsSeparator": true }]
},
{
"name": "relative_velocity_kph",
"displayName": "Relative Velocity (km/h)",
"shape": ["number", { "thousandsSeparator": true }]
},
{
"name": "is_potentially_hazardous_asteroid",
"displayName": "Potentially Hazardous",
"shape": "boolean"
},
{ "name": "is_sentry_object", "displayName": "Sentry Object", "shape": "boolean" },
{
"name": "absolute_magnitude_h",
"displayName": "Absolute Magnitude (H)",
"shape": ["number", { "decimalPlaces": 2 }]
},
{
"name": "estimated_diameter_min_km",
"displayName": "Est. Diameter Min (km)",
"shape": ["number", { "decimalPlaces": 3 }]
},
{
"name": "estimated_diameter_max_km",
"displayName": "Est. Diameter Max (km)",
"shape": ["number", { "decimalPlaces": 3 }]
},
{ "name": "orbiting_body", "displayName": "Orbiting Body", "shape": "string" },
{
"name": "nasa_jpl_url",
"displayName": "JPL Details",
"shape": ["url", { "label": "View" }],
"visible": false
}
],
"timeframes": false
}
50 changes: 50 additions & 0 deletions plugins/NASA/v1/dataStreams/neoSummary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "neoSummary",
"displayName": "Near-Earth Object Summary",
"description": "Current attributes of a near-Earth asteroid, including size, hazard classification and Sentry monitoring status",
"tags": ["Astronomy"],
"baseDataSourceName": "httpRequestScopedSingle",
"config": {
"httpMethod": "get",
"endpointPath": "/neo/rest/v1/neo/{{object.rawId}}",
"postRequestScript": "neoSummary.js"
},
"matches": { "sourceType": { "type": "oneOf", "values": ["Near-Earth Object"] } },
"metadata": [
{ "name": "id", "displayName": "Asteroid ID", "shape": "string", "visible": false },
{ "name": "name", "displayName": "Name", "shape": "string", "role": "label" },
{
"name": "absolute_magnitude_h",
"displayName": "Absolute Magnitude (H)",
"shape": ["number", { "decimalPlaces": 2 }]
},
{
"name": "is_potentially_hazardous_asteroid",
"displayName": "Potentially Hazardous",
"shape": "boolean"
},
{ "name": "is_sentry_object", "displayName": "Sentry Object", "shape": "boolean" },
{
"name": "nasa_jpl_url",
"displayName": "JPL Details",
"shape": ["url", { "label": "View" }],
"visible": false
},
{
"name": "estimated_diameter_min_km",
"displayName": "Est. Diameter Min (km)",
"shape": ["number", { "decimalPlaces": 3 }]
},
{
"name": "estimated_diameter_max_km",
"displayName": "Est. Diameter Max (km)",
"shape": ["number", { "decimalPlaces": 3 }]
},
{
"name": "close_approach_count",
"displayName": "Close Approach Count",
"shape": "number"
}
],
"timeframes": false
}
44 changes: 44 additions & 0 deletions plugins/NASA/v1/dataStreams/satelliteLocation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "satelliteLocation",
"displayName": "Satellite Location",
"description": "GSE coordinate position of a satellite over time",
"tags": ["Astronomy"],
"baseDataSourceName": "httpRequestScopedSingle",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check ui.json for a scope parameter related to satelliteLocation and its objectLimit setting.

# Find ui.json in the NASA plugin directory
fd -t f "ui.json" plugins/NASA/v1/ --exec cat -n {}

Repository: squaredup/plugins

Length of output: 596


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- plugins/NASA/v1/dataStreams/satelliteLocation.json ---'
cat -n plugins/NASA/v1/dataStreams/satelliteLocation.json

echo
echo '--- scoped streams with httpRequestScopedSingle and objectLimit in plugins/NASA/v1/dataStreams ---'
rg -n '"baseDataSourceName"\s*:\s*"httpRequestScopedSingle"|"objectLimit"\s*:' plugins/NASA/v1/dataStreams

Repository: squaredup/plugins

Length of output: 3364


Add objectLimit: 1 to this stream. The NASA UI only defines apiKey, so nothing enforces the single-object constraint for httpRequestScopedSingle.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/NASA/v1/dataStreams/satelliteLocation.json` at line 6, Add
"objectLimit": 1 to the satellite location stream configuration associated with
baseDataSourceName "httpRequestScopedSingle", ensuring the stream enforces a
single returned object despite the NASA UI only defining apiKey.

Source: Learnings

"config": {
"baseUrl": "https://sscweb.gsfc.nasa.gov/WS/sscr/2",
"httpMethod": "post",
"endpointPath": "/locations",
"headers": [
{ "key": "Accept", "value": "application/json" },
{ "key": "Content-Type", "value": "application/json" }
],
"postBody": "[\"gov.nasa.gsfc.sscweb.schema.DataRequest\", {\"TimeInterval\": [\"gov.nasa.gsfc.sscweb.schema.TimeInterval\", {\"Start\": [\"javax.xml.datatype.XMLGregorianCalendar\", \"{{timeframe.start}}\"], \"End\": [\"javax.xml.datatype.XMLGregorianCalendar\", \"{{timeframe.end}}\"]}], \"Satellites\": [\"java.util.ArrayList\", [[\"gov.nasa.gsfc.sscweb.schema.SatelliteSpecification\", {\"Id\": \"{{object.rawId}}\", \"ResolutionFactor\": 1}]]], \"OutputOptions\": [\"gov.nasa.gsfc.sscweb.schema.OutputOptions\", {\"AllLocationFilters\": false, \"CoordinateOptions\": [\"java.util.ArrayList\", [[\"gov.nasa.gsfc.sscweb.schema.FilteredCoordinateOptions\", {\"CoordinateSystem\": \"GSE\", \"Component\": \"X\"}], [\"gov.nasa.gsfc.sscweb.schema.FilteredCoordinateOptions\", {\"CoordinateSystem\": \"GSE\", \"Component\": \"Y\"}], [\"gov.nasa.gsfc.sscweb.schema.FilteredCoordinateOptions\", {\"CoordinateSystem\": \"GSE\", \"Component\": \"Z\"}]]], \"MinMaxPoints\": 2}]}]",
"postRequestScript": "satelliteLocation.js"
},
"matches": { "sourceType": { "type": "oneOf", "values": ["Satellite"] } },
"metadata": [
{ "name": "time", "displayName": "Time", "shape": "date", "role": "timestamp" },
{
"name": "x",
"displayName": "X (km)",
"shape": ["number", { "decimalPlaces": 2 }]
},
{
"name": "y",
"displayName": "Y (km)",
"shape": ["number", { "decimalPlaces": 2 }]
},
{
"name": "z",
"displayName": "Z (km)",
"shape": ["number", { "decimalPlaces": 2 }]
},
{
"name": "coordinateSystem",
"displayName": "Coordinate System",
"shape": "string",
"visible": false
}
],
"timeframes": ["last1hour", "last12hours", "last24hours", "last7days"]
}
33 changes: 33 additions & 0 deletions plugins/NASA/v1/dataStreams/satellites.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "satellites",
"displayName": "Actively Tracked Satellites",
"description": "Satellites and spacecraft currently tracked by NASA's Satellite Situation Center",
"tags": ["Astronomy"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"baseUrl": "https://sscweb.gsfc.nasa.gov/WS/sscr/2",
"httpMethod": "get",
"endpointPath": "/observatories",
"headers": [{ "key": "Accept", "value": "application/json" }],
"postRequestScript": "satellites.js"
},
"matches": "none",
"metadata": [
{ "name": "id", "displayName": "SSC ID", "shape": "string", "visible": false },
{ "name": "name", "displayName": "Name", "shape": "string", "role": "label" },
{
"name": "resolution",
"displayName": "Native Resolution (s)",
"shape": "number"
},
{ "name": "startTime", "displayName": "Tracking Start", "shape": "date" },
{ "name": "endTime", "displayName": "Tracking End", "shape": "date" },
{
"name": "resourceId",
"displayName": "SPASE Resource ID",
"shape": "string",
"visible": false
}
],
"timeframes": false
}
Loading
Loading