Skip to content

Commit

Permalink
Merge branch 'koonpeng/hammer-jazzy-base' into ac/fix-build
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <[email protected]>
  • Loading branch information
aaronchongth committed Jul 17, 2024
2 parents d027eea + 6d03a14 commit 3e0a42f
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 120 deletions.
24 changes: 12 additions & 12 deletions packages/api-client/lib/openapi/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10526,9 +10526,9 @@ export const TasksApiAxiosParamCreator = function (configuration?: Configuration
* @param {string | null} [assignedTo] comma separated list of assigned robot names
* @param {string | null} [status] comma separated list of statuses
* @param {string | null} [label] comma separated list of labels, each item must be in the form &lt;key&gt;&#x3D;&lt;value&gt;, multiple items will filter tasks with all the labels
* @param {string} [requestTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [startTimeBetween] The period of start time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [finishTimeBetween] The period of finish time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [requestTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [startTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [finishTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {number | null} [limit] defaults to 100
* @param {number | null} [offset] defaults to 0
* @param {string | null} [orderBy] common separated list of fields to order by, prefix with \&#39;-\&#39; to sort descendingly.
Expand Down Expand Up @@ -11485,9 +11485,9 @@ export const TasksApiFp = function (configuration?: Configuration) {
* @param {string | null} [assignedTo] comma separated list of assigned robot names
* @param {string | null} [status] comma separated list of statuses
* @param {string | null} [label] comma separated list of labels, each item must be in the form &lt;key&gt;&#x3D;&lt;value&gt;, multiple items will filter tasks with all the labels
* @param {string} [requestTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [startTimeBetween] The period of start time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [finishTimeBetween] The period of finish time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [requestTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [startTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [finishTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {number | null} [limit] defaults to 100
* @param {number | null} [offset] defaults to 0
* @param {string | null} [orderBy] common separated list of fields to order by, prefix with \&#39;-\&#39; to sort descendingly.
Expand Down Expand Up @@ -12031,9 +12031,9 @@ export const TasksApiFactory = function (
* @param {string | null} [assignedTo] comma separated list of assigned robot names
* @param {string | null} [status] comma separated list of statuses
* @param {string | null} [label] comma separated list of labels, each item must be in the form &lt;key&gt;&#x3D;&lt;value&gt;, multiple items will filter tasks with all the labels
* @param {string} [requestTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [startTimeBetween] The period of start time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [finishTimeBetween] The period of finish time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [requestTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [startTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [finishTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {number | null} [limit] defaults to 100
* @param {number | null} [offset] defaults to 0
* @param {string | null} [orderBy] common separated list of fields to order by, prefix with \&#39;-\&#39; to sort descendingly.
Expand Down Expand Up @@ -12602,9 +12602,9 @@ export class TasksApi extends BaseAPI {
* @param {string | null} [assignedTo] comma separated list of assigned robot names
* @param {string | null} [status] comma separated list of statuses
* @param {string | null} [label] comma separated list of labels, each item must be in the form &lt;key&gt;&#x3D;&lt;value&gt;, multiple items will filter tasks with all the labels
* @param {string} [requestTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [startTimeBetween] The period of start time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [finishTimeBetween] The period of finish time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [requestTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [startTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [finishTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {number | null} [limit] defaults to 100
* @param {number | null} [offset] defaults to 0
* @param {string | null} [orderBy] common separated list of fields to order by, prefix with \&#39;-\&#39; to sort descendingly.
Expand Down
2 changes: 1 addition & 1 deletion packages/api-client/lib/version.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// THIS FILE IS GENERATED
export const version = {
rmfServer: '13db0e386c955fb5ba140f91d27b595875088579',
rmfServer: 'd027eea607b0ccbd8ce18ec320fb83b06ea6aa3e',
openapiGenerator: '',
};
12 changes: 6 additions & 6 deletions packages/api-client/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,11 +892,11 @@ export default {
schema: {
type: 'string',
description:
'\n The period of request time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
'\n The period of request time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
title: 'Request Time Between',
},
description:
'\n The period of request time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
'\n The period of request time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
},
{
name: 'start_time_between',
Expand All @@ -905,11 +905,11 @@ export default {
schema: {
type: 'string',
description:
'\n The period of start time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
'\n The period of request time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
title: 'Start Time Between',
},
description:
'\n The period of start time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
'\n The period of request time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
},
{
name: 'finish_time_between',
Expand All @@ -918,11 +918,11 @@ export default {
schema: {
type: 'string',
description:
'\n The period of finish time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
'\n The period of request time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
title: 'Finish Time Between',
},
description:
'\n The period of finish time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
'\n The period of request time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
},
{
name: 'limit',
Expand Down
124 changes: 33 additions & 91 deletions packages/api-server/api_server/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,94 +47,36 @@ def between_query(
return period


def request_time_between_query(
request_time_between: str = Query(
None,
description="""
The period of request time to fetch, in unix millis.
This must be a comma separated string, 'X,Y' to fetch between X millis and Y millis inclusive.
Example:
"1000,2000" - Fetches logs between unix millis 1000 and 2000.
""",
),
now: int = Depends(ros_time.now),
) -> tuple[datetime, datetime] | None:
if request_time_between is None:
return None
if request_time_between.startswith("-"):
# Cap at 0 millis
period = (
datetime.fromtimestamp(0),
datetime.fromtimestamp(now / 1000),
)
else:
parts = request_time_between.split(",")
period = (
datetime.fromtimestamp(int(parts[0]) / 1000),
datetime.fromtimestamp(int(parts[1]) / 1000),
)
return period


def start_time_between_query(
start_time_between: str = Query(
None,
description="""
The period of start time to fetch, in unix millis.
This must be a comma separated string, 'X,Y' to fetch between X millis and Y millis inclusive.
Example:
"1000,2000" - Fetches logs between unix millis 1000 and 2000.
""",
),
now: int = Depends(ros_time.now),
) -> tuple[datetime, datetime] | None:
if start_time_between is None:
return None
if start_time_between.startswith("-"):
# Cap at 0 millis
period = (
datetime.fromtimestamp(0),
datetime.fromtimestamp(now / 1000),
)
else:
parts = start_time_between.split(",")
period = (
datetime.fromtimestamp(int(parts[0]) / 1000),
datetime.fromtimestamp(int(parts[1]) / 1000),
)
return period


def finish_time_between_query(
finish_time_between: str = Query(
None,
description="""
The period of finish time to fetch, in unix millis.
This must be a comma separated string, 'X,Y' to fetch between X millis and Y millis inclusive.
Example:
"1000,2000" - Fetches logs between unix millis 1000 and 2000.
""",
),
now: int = Depends(ros_time.now),
) -> tuple[datetime, datetime] | None:
if finish_time_between is None:
return None
if finish_time_between.startswith("-"):
# Cap at 0 millis
period = (
datetime.fromtimestamp(0),
datetime.fromtimestamp(now / 1000),
)
else:
parts = finish_time_between.split(",")
period = (
datetime.fromtimestamp(int(parts[0]) / 1000),
datetime.fromtimestamp(int(parts[1]) / 1000),
)
return period
def time_between_query(alias: str):
def dep(
time_between: str = Query(
None,
alias=alias,
description="""
The period of request time to fetch, in unix millis.
This must be a comma separated string, 'X,Y' to fetch between X millis and Y millis inclusive.
Example:
"1000,2000" - Fetches logs between unix millis 1000 and 2000.
""",
),
now: int = Depends(ros_time.now),
) -> tuple[datetime, datetime] | None:
if time_between is None:
return None
if time_between.startswith("-"):
# Cap at 0 millis
period = (
datetime.fromtimestamp(0),
datetime.fromtimestamp(now / 1000),
)
else:
parts = time_between.split(",")
period = (
datetime.fromtimestamp(int(parts[0]) / 1000),
datetime.fromtimestamp(int(parts[1]) / 1000),
)
return period

return dep
Loading

0 comments on commit 3e0a42f

Please sign in to comment.