diff --git a/.changeset/reject-year-zero-cursor.md b/.changeset/reject-year-zero-cursor.md new file mode 100644 index 00000000..613b6ef1 --- /dev/null +++ b/.changeset/reject-year-zero-cursor.md @@ -0,0 +1,5 @@ +--- +'@hypercerts-org/happyview-modules': patch +--- + +A list request whose `cursor` or `before` timestamp is in year 0000 now returns an `InvalidRequest` error. Several endpoints used to answer it with an HTTP 500. `listVocabTags` now reports this as "cursor is malformed". diff --git a/happyview-modules/lua/endpoints/getActorLikes.lua b/happyview-modules/lua/endpoints/getActorLikes.lua index 2f29f12e..11862f04 100644 --- a/happyview-modules/lua/endpoints/getActorLikes.lua +++ b/happyview-modules/lua/endpoints/getActorLikes.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/getActorReposts.lua b/happyview-modules/lua/endpoints/getActorReposts.lua index 1fc71f6a..3c367fe7 100644 --- a/happyview-modules/lua/endpoints/getActorReposts.lua +++ b/happyview-modules/lua/endpoints/getActorReposts.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/getLikes.lua b/happyview-modules/lua/endpoints/getLikes.lua index 7b9d2a2d..3ac73cc7 100644 --- a/happyview-modules/lua/endpoints/getLikes.lua +++ b/happyview-modules/lua/endpoints/getLikes.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/getReposts.lua b/happyview-modules/lua/endpoints/getReposts.lua index 7870273c..97880d21 100644 --- a/happyview-modules/lua/endpoints/getReposts.lua +++ b/happyview-modules/lua/endpoints/getReposts.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/listAcknowledgements.lua b/happyview-modules/lua/endpoints/listAcknowledgements.lua index ff6fba61..0e43d197 100644 --- a/happyview-modules/lua/endpoints/listAcknowledgements.lua +++ b/happyview-modules/lua/endpoints/listAcknowledgements.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -147,12 +148,51 @@ local function valid_nsid(value) return #name <= 63 and name:match("^[A-Za-z][A-Za-z0-9]*$") ~= nil end -local generic_valid_datetime = valid_datetime +local function parse_sort_direction(params) + local direction = scalar(params, "sortDirection") or "desc" + if direction ~= "asc" and direction ~= "desc" then invalid("sortDirection must be 'asc' or 'desc'") end + return direction +end -local function acknowledgement_valid_datetime(value) - if type(value) ~= "string" then return false end - if value:match("^(%d%d%d%d)") == "0000" then return false end - return generic_valid_datetime(value) +local function cursor_encode(value) + local encoded = json.encode(value) + return (encoded:gsub(".", function(char) return string.format("%02x", string.byte(char)) end)) +end + +-- Decodes a hex-encoded {v, d, t, u} list cursor. Rejects malformed tokens, other +-- sort directions and unknown keys; validate_value(value) -> boolean runs the +-- endpoint-specific check on t and u. Not for endpoints that skip the 8192-character +-- cap or accept extra keys. +local function decode_cursor(token, direction, validate_value) + if token == nil then return nil end + if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then + invalid("cursor is malformed") + end + local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) + local ok, value = pcall(json.decode, decoded) + if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction + or type(value.t) ~= "string" or type(value.u) ~= "string" then + invalid("cursor is malformed or belongs to another sortDirection") + end + for key in pairs(value) do + if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end + end + if not validate_value(value) then invalid("cursor is malformed") end + return value +end + +-- Adds `column IN ($n, ...)` to where, binding items; an empty list matches nothing. +local function add_in(where, binds, column, items) + if #items == 0 then + where[#where + 1] = "FALSE" + return + end + local marks = {} + for _, item in ipairs(items) do + binds[#binds + 1] = item + marks[#marks + 1] = "$" .. #binds + end + where[#where + 1] = column .. " IN (" .. table.concat(marks, ", ") .. ")" end local function valid_cursor_timestamp(value) @@ -160,7 +200,7 @@ local function valid_cursor_timestamp(value) or not value:match("^%d%d%d%d%-%d%d%-%d%dT%d%d:%d%d:%d%d%.%d%d%d%d%d%dZ$") then return false end - return acknowledgement_valid_datetime(value) + return valid_datetime(value) end local function acknowledgement_array(key, format) @@ -205,39 +245,11 @@ local function acknowledgement_array(key, format) return unique end -local function bind_acknowledgement_values(values, items) - local placeholders = {} - for _, item in ipairs(items) do - values[#values + 1] = item - placeholders[#placeholders + 1] = "$" .. #values - end - return placeholders -end - -local function cursor_encode(value) - local encoded = json.encode(value) - return (encoded:gsub(".", function(char) return string.format("%02x", string.byte(char)) end)) -end - local function decode_acknowledgement_cursor(token, direction) - if token == nil then return nil end - if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then - invalid("cursor is malformed") - end - local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) - local ok, value = pcall(json.decode, decoded) - if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction - or type(value.t) ~= "string" or type(value.u) ~= "string" then - invalid("cursor is malformed or belongs to another sortDirection") - end - for key in pairs(value) do - if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end - end - local valid, collection = valid_record_uri(value.u) - if not valid_cursor_timestamp(value.t) or not valid or collection ~= ACKNOWLEDGEMENT then - invalid("cursor is malformed") - end - return value + return decode_cursor(token, direction, function(value) + local valid, collection = valid_record_uri(value.u) + return valid_cursor_timestamp(value.t) and valid and collection == ACKNOWLEDGEMENT + end) end local function acknowledgement_sort_expression() @@ -252,22 +264,8 @@ end local function acknowledgement_list_query(authors, subjects, limit, cursor, direction) local where, values = { "acknowledgement.collection = $1" }, { ACKNOWLEDGEMENT } - if authors then - if #authors == 0 then - where[#where + 1] = "FALSE" - else - where[#where + 1] = "acknowledgement.did IN (" .. - table.concat(bind_acknowledgement_values(values, authors), ", ") .. ")" - end - end - if subjects then - if #subjects == 0 then - where[#where + 1] = "FALSE" - else - where[#where + 1] = "acknowledgement.record::jsonb->'subject'->>'uri' IN (" .. - table.concat(bind_acknowledgement_values(values, subjects), ", ") .. ")" - end - end + if authors then add_in(where, values, "acknowledgement.did", authors) end + if subjects then add_in(where, values, "acknowledgement.record::jsonb->'subject'->>'uri'", subjects) end local page_values, page_where = {}, {} for _, value in ipairs(values) do page_values[#page_values + 1] = value end @@ -303,8 +301,7 @@ local function list_acknowledgements() }) local authors = acknowledgement_array("authors", "did") local subjects = acknowledgement_array("subjects", "at-uri") - local direction = scalar(params, "sortDirection") or "desc" - if direction ~= "asc" and direction ~= "desc" then invalid("sortDirection must be 'asc' or 'desc'") end + local direction = parse_sort_direction(params) local limit = parse_list_limit(params) local cursor = decode_acknowledgement_cursor(scalar(params, "cursor"), direction) local rows = acknowledgement_list_query(authors, subjects, limit, cursor, direction) diff --git a/happyview-modules/lua/endpoints/listActivities.lua b/happyview-modules/lua/endpoints/listActivities.lua index c43e79f4..77d6a7a0 100644 --- a/happyview-modules/lua/endpoints/listActivities.lua +++ b/happyview-modules/lua/endpoints/listActivities.lua @@ -242,6 +242,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -267,37 +268,19 @@ local function parse_list_limit(params) return limit end -local CREATED_AT_SORT_COLUMNS = { - profile = { record = "record", indexed_at = "indexed_at", created_at = "created_at" }, - organization = { - record = "organization.record", - indexed_at = "organization.indexed_at", - created_at = "organization.created_at", - }, - activity = { - record = "activity.record", - indexed_at = "activity.indexed_at", - created_at = "activity.created_at", - }, - collection = { - record = "collection.record", - indexed_at = "collection.indexed_at", - created_at = "collection.created_at", - }, -} local CREATED_AT_SORT_PATTERN = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" -local function created_at_sort_expression(source) - local columns = CREATED_AT_SORT_COLUMNS[source] - if not columns then - error("CreatedAtSortExpressionError: source must be 'profile', 'organization', 'activity', or 'collection'", 0) - end - - local created = columns.record .. "::jsonb->>'createdAt'" - return "CASE WHEN jsonb_typeof(" .. columns.record .. "::jsonb->'createdAt') = 'string' AND " .. created .. +-- Sort key for a happyview_records row: the record's own createdAt when it is a +-- valid timestamp, otherwise COALESCE(indexed_at, created_at). `alias` is the +-- table alias; nil selects unqualified columns. +local function created_at_sort(alias) + local prefix = alias and (alias .. ".") or "" + local record, indexed_at, created_at = prefix .. "record", prefix .. "indexed_at", prefix .. "created_at" + local created = record .. "::jsonb->>'createdAt'" + return "CASE WHEN jsonb_typeof(" .. record .. "::jsonb->'createdAt') = 'string' AND " .. created .. " ~ '" .. CREATED_AT_SORT_PATTERN .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. - ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. columns.indexed_at .. - "::timestamptz, " .. columns.created_at .. "::timestamptz) END" + ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. indexed_at .. + "::timestamptz, " .. created_at .. "::timestamptz) END" end local function activity_scalar(values, key) @@ -455,7 +438,7 @@ local function activity_query(authors, has_organization_record, contributors, in local sql = "SELECT activity.uri, activity.did, activity.cid, activity.indexed_at::text AS indexed_at, " .. "activity.record::text AS record, to_char(sorted.sort_at AT TIME ZONE 'UTC', " .. "'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. - "FROM happyview_records AS activity CROSS JOIN LATERAL (SELECT " .. created_at_sort_expression("activity") .. " AS sort_at) AS sorted " .. + "FROM happyview_records AS activity CROSS JOIN LATERAL (SELECT " .. created_at_sort("activity") .. " AS sort_at) AS sorted " .. "WHERE " .. table.concat(where, " AND ") .. " ORDER BY sorted.sort_at " .. ordering .. ", activity.uri " .. ordering .. " LIMIT $" .. #values local rows = query(sql, values) diff --git a/happyview-modules/lua/endpoints/listActorFollowers.lua b/happyview-modules/lua/endpoints/listActorFollowers.lua index e865438b..55d3af98 100644 --- a/happyview-modules/lua/endpoints/listActorFollowers.lua +++ b/happyview-modules/lua/endpoints/listActorFollowers.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/listActorFollowing.lua b/happyview-modules/lua/endpoints/listActorFollowing.lua index 2437f59e..0f40eb93 100644 --- a/happyview-modules/lua/endpoints/listActorFollowing.lua +++ b/happyview-modules/lua/endpoints/listActorFollowing.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/listAttachments.lua b/happyview-modules/lua/endpoints/listAttachments.lua index ef594193..e5c93c7f 100644 --- a/happyview-modules/lua/endpoints/listAttachments.lua +++ b/happyview-modules/lua/endpoints/listAttachments.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/listBadgeAwards.lua b/happyview-modules/lua/endpoints/listBadgeAwards.lua index 1bccbc3f..d67c1379 100644 --- a/happyview-modules/lua/endpoints/listBadgeAwards.lua +++ b/happyview-modules/lua/endpoints/listBadgeAwards.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/listBadgeDefinitions.lua b/happyview-modules/lua/endpoints/listBadgeDefinitions.lua index ea51d27c..6923f2b5 100644 --- a/happyview-modules/lua/endpoints/listBadgeDefinitions.lua +++ b/happyview-modules/lua/endpoints/listBadgeDefinitions.lua @@ -52,6 +52,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/listBadgeResponses.lua b/happyview-modules/lua/endpoints/listBadgeResponses.lua index 336e252f..536b0f61 100644 --- a/happyview-modules/lua/endpoints/listBadgeResponses.lua +++ b/happyview-modules/lua/endpoints/listBadgeResponses.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/listCollections.lua b/happyview-modules/lua/endpoints/listCollections.lua index a222f76f..a23780bb 100644 --- a/happyview-modules/lua/endpoints/listCollections.lua +++ b/happyview-modules/lua/endpoints/listCollections.lua @@ -258,6 +258,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -275,37 +276,19 @@ local function valid_datetime(value) return true end -local CREATED_AT_SORT_COLUMNS = { - profile = { record = "record", indexed_at = "indexed_at", created_at = "created_at" }, - organization = { - record = "organization.record", - indexed_at = "organization.indexed_at", - created_at = "organization.created_at", - }, - activity = { - record = "activity.record", - indexed_at = "activity.indexed_at", - created_at = "activity.created_at", - }, - collection = { - record = "collection.record", - indexed_at = "collection.indexed_at", - created_at = "collection.created_at", - }, -} local CREATED_AT_SORT_PATTERN = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" -local function created_at_sort_expression(source) - local columns = CREATED_AT_SORT_COLUMNS[source] - if not columns then - error("CreatedAtSortExpressionError: source must be 'profile', 'organization', 'activity', or 'collection'", 0) - end - - local created = columns.record .. "::jsonb->>'createdAt'" - return "CASE WHEN jsonb_typeof(" .. columns.record .. "::jsonb->'createdAt') = 'string' AND " .. created .. +-- Sort key for a happyview_records row: the record's own createdAt when it is a +-- valid timestamp, otherwise COALESCE(indexed_at, created_at). `alias` is the +-- table alias; nil selects unqualified columns. +local function created_at_sort(alias) + local prefix = alias and (alias .. ".") or "" + local record, indexed_at, created_at = prefix .. "record", prefix .. "indexed_at", prefix .. "created_at" + local created = record .. "::jsonb->>'createdAt'" + return "CASE WHEN jsonb_typeof(" .. record .. "::jsonb->'createdAt') = 'string' AND " .. created .. " ~ '" .. CREATED_AT_SORT_PATTERN .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. - ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. columns.indexed_at .. - "::timestamptz, " .. columns.created_at .. "::timestamptz) END" + ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. indexed_at .. + "::timestamptz, " .. created_at .. "::timestamptz) END" end local function collection_array(key, kind) @@ -487,7 +470,7 @@ end local function collection_list_sql(where, values, limit, direction) values[#values + 1] = limit + 1 local ordering = direction == "asc" and "ASC" or "DESC" - local sort_key = created_at_sort_expression("collection") + local sort_key = created_at_sort("collection") return "SELECT collection.uri, collection.did, collection.cid, collection.indexed_at::text AS indexed_at, " .. "collection.record::text AS record, to_char(sorted.sort_at AT TIME ZONE 'UTC', " .. "'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. diff --git a/happyview-modules/lua/endpoints/listContributions.lua b/happyview-modules/lua/endpoints/listContributions.lua index e87fb11e..a05e1754 100644 --- a/happyview-modules/lua/endpoints/listContributions.lua +++ b/happyview-modules/lua/endpoints/listContributions.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -150,6 +151,42 @@ local function contribution_view(row) return view end +-- Decodes a hex-encoded {v, d, t, u} list cursor. Rejects malformed tokens, other +-- sort directions and unknown keys; validate_value(value) -> boolean runs the +-- endpoint-specific check on t and u. Not for endpoints that skip the 8192-character +-- cap or accept extra keys. +local function decode_cursor(token, direction, validate_value) + if token == nil then return nil end + if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then + invalid("cursor is malformed") + end + local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) + local ok, value = pcall(json.decode, decoded) + if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction + or type(value.t) ~= "string" or type(value.u) ~= "string" then + invalid("cursor is malformed or belongs to another sortDirection") + end + for key in pairs(value) do + if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end + end + if not validate_value(value) then invalid("cursor is malformed") end + return value +end + +-- Adds `column IN ($n, ...)` to where, binding items; an empty list matches nothing. +local function add_in(where, binds, column, items) + if #items == 0 then + where[#where + 1] = "FALSE" + return + end + local marks = {} + for _, item in ipairs(items) do + binds[#binds + 1] = item + marks[#marks + 1] = "$" .. #binds + end + where[#where + 1] = column .. " IN (" .. table.concat(marks, ", ") .. ")" +end + local function contribution_authors() local value = params.authors if value == nil then return nil end @@ -186,44 +223,11 @@ local function contribution_authors() return authors end -local function valid_contribution_cursor_datetime(value) - if type(value) ~= "string" or not valid_datetime(value) then return false end - return value:sub(1, 4) ~= "0000" -end - local function decode_contribution_cursor(token, direction) - if token == nil then return nil end - if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then - invalid("cursor is malformed") - end - local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) - local ok, value = pcall(json.decode, decoded) - if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction - or type(value.t) ~= "string" or type(value.u) ~= "string" then - invalid("cursor is malformed or belongs to another sortDirection") - end - for key in pairs(value) do - if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end - end - local valid = valid_contribution_uri(value.u) - if not valid or not valid_contribution_cursor_datetime(value.t) then - invalid("cursor is malformed") - end - return value -end - -local function add_contribution_authors(where, values, authors) - if authors == nil then return end - if #authors == 0 then - where[#where + 1] = "FALSE" - return - end - local placeholders = {} - for _, did in ipairs(authors) do - values[#values + 1] = did - placeholders[#placeholders + 1] = "$" .. #values - end - where[#where + 1] = "contribution.did IN (" .. table.concat(placeholders, ", ") .. ")" + return decode_cursor(token, direction, function(value) + local valid = valid_contribution_uri(value.u) + return valid and valid_datetime(value.t) + end) end local function contribution_sort_key() @@ -236,7 +240,7 @@ end local function query_contributions(authors, limit, cursor, direction) local where, values = { "contribution.collection = $1" }, { CONTRIBUTION } - add_contribution_authors(where, values, authors) + if authors then add_in(where, values, "contribution.did", authors) end if cursor then values[#values + 1] = cursor.t local timestamp = "$" .. #values diff --git a/happyview-modules/lua/endpoints/listContributorInformation.lua b/happyview-modules/lua/endpoints/listContributorInformation.lua index 235bdd35..2909a7a8 100644 --- a/happyview-modules/lua/endpoints/listContributorInformation.lua +++ b/happyview-modules/lua/endpoints/listContributorInformation.lua @@ -95,6 +95,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -131,8 +132,55 @@ local function cursor_encode(value) return (encoded:gsub(".", function(char) return string.format("%02x", string.byte(char)) end)) end -local function contributor_information_datetime(value) - return valid_datetime(value) and tonumber(value:sub(1, 4)) > 0 +-- Decodes a hex-encoded {v, d, t, u} list cursor. Rejects malformed tokens, other +-- sort directions and unknown keys; validate_value(value) -> boolean runs the +-- endpoint-specific check on t and u. Not for endpoints that skip the 8192-character +-- cap or accept extra keys. +local function decode_cursor(token, direction, validate_value) + if token == nil then return nil end + if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then + invalid("cursor is malformed") + end + local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) + local ok, value = pcall(json.decode, decoded) + if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction + or type(value.t) ~= "string" or type(value.u) ~= "string" then + invalid("cursor is malformed or belongs to another sortDirection") + end + for key in pairs(value) do + if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end + end + if not validate_value(value) then invalid("cursor is malformed") end + return value +end + +-- Adds `column IN ($n, ...)` to where, binding items; an empty list matches nothing. +local function add_in(where, binds, column, items) + if #items == 0 then + where[#where + 1] = "FALSE" + return + end + local marks = {} + for _, item in ipairs(items) do + binds[#binds + 1] = item + marks[#marks + 1] = "$" .. #binds + end + where[#where + 1] = column .. " IN (" .. table.concat(marks, ", ") .. ")" +end + +local CREATED_AT_SORT_PATTERN = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" + +-- Sort key for a happyview_records row: the record's own createdAt when it is a +-- valid timestamp, otherwise COALESCE(indexed_at, created_at). `alias` is the +-- table alias; nil selects unqualified columns. +local function created_at_sort(alias) + local prefix = alias and (alias .. ".") or "" + local record, indexed_at, created_at = prefix .. "record", prefix .. "indexed_at", prefix .. "created_at" + local created = record .. "::jsonb->>'createdAt'" + return "CASE WHEN jsonb_typeof(" .. record .. "::jsonb->'createdAt') = 'string' AND " .. created .. + " ~ '" .. CREATED_AT_SORT_PATTERN .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. + ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. indexed_at .. + "::timestamptz, " .. created_at .. "::timestamptz) END" end local function contributor_information_query(sql, values) @@ -185,38 +233,10 @@ local function contributor_information_array(params, key, validate, description) return unique end -local function contributor_information_bind_in(where, values, expression, items) - if not items then return end - if #items == 0 then - where[#where + 1] = "FALSE" - return - end - local placeholders = {} - for _, item in ipairs(items) do - values[#values + 1] = item - placeholders[#placeholders + 1] = "$" .. #values - end - where[#where + 1] = expression .. " IN (" .. table.concat(placeholders, ", ") .. ")" -end - local function contributor_information_cursor_decode(token, direction) - if token == nil then return nil end - if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then - invalid("cursor is malformed") - end - local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) - local ok, value = pcall(json.decode, decoded) - if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction - or type(value.t) ~= "string" or type(value.u) ~= "string" then - invalid("cursor is malformed or belongs to another sortDirection") - end - for key in pairs(value) do - if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end - end - if not contributor_information_uri(value.u) or not contributor_information_datetime(value.t) then - invalid("cursor is malformed") - end - return value + return decode_cursor(token, direction, function(value) + return contributor_information_uri(value.u) and valid_datetime(value.t) + end) end local function preserve_contributor_author_timestamps(author) @@ -229,18 +249,9 @@ local function preserve_contributor_author_timestamps(author) end end -local function contributor_information_sort_expression() - local created = "contributor.record::jsonb->>'createdAt'" - local zoned = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" - return "CASE WHEN jsonb_typeof(contributor.record::jsonb->'createdAt') = 'string' AND " .. created .. - " ~ '" .. zoned .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. - ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE " .. - "COALESCE(contributor.indexed_at::timestamptz, contributor.created_at::timestamptz) END" -end - local function query_contributor_information(authors, limit, cursor, direction) local where, values = { "contributor.collection = $1" }, { CONTRIBUTOR_INFORMATION_COLLECTION } - contributor_information_bind_in(where, values, "contributor.did", authors) + if authors then add_in(where, values, "contributor.did", authors) end if cursor then values[#values + 1] = cursor.t @@ -254,7 +265,7 @@ local function query_contributor_information(authors, limit, cursor, direction) values[#values + 1] = limit + 1 local ordering = direction == "asc" and "ASC" or "DESC" - local sort_key = contributor_information_sort_expression() + local sort_key = created_at_sort("contributor") local sql = "SELECT contributor.uri, contributor.did, contributor.cid, " .. "contributor.indexed_at::text AS indexed_at, contributor.record::text AS record, " .. "to_char(sorted.sort_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. diff --git a/happyview-modules/lua/endpoints/listEntityFollowers.lua b/happyview-modules/lua/endpoints/listEntityFollowers.lua index f0e5223f..98385511 100644 --- a/happyview-modules/lua/endpoints/listEntityFollowers.lua +++ b/happyview-modules/lua/endpoints/listEntityFollowers.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/listEntityFollowing.lua b/happyview-modules/lua/endpoints/listEntityFollowing.lua index 25335175..e2c44d89 100644 --- a/happyview-modules/lua/endpoints/listEntityFollowing.lua +++ b/happyview-modules/lua/endpoints/listEntityFollowing.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/listEvaluations.lua b/happyview-modules/lua/endpoints/listEvaluations.lua index 393ebf35..3925cda6 100644 --- a/happyview-modules/lua/endpoints/listEvaluations.lua +++ b/happyview-modules/lua/endpoints/listEvaluations.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/listEvmLinks.lua b/happyview-modules/lua/endpoints/listEvmLinks.lua index b190ba86..675c843e 100644 --- a/happyview-modules/lua/endpoints/listEvmLinks.lua +++ b/happyview-modules/lua/endpoints/listEvmLinks.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/listFeatures.lua b/happyview-modules/lua/endpoints/listFeatures.lua index 7362e5bb..d40a6b92 100644 --- a/happyview-modules/lua/endpoints/listFeatures.lua +++ b/happyview-modules/lua/endpoints/listFeatures.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -253,7 +254,7 @@ local function feature_cursor_decode(token, direction) for key in pairs(value) do if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end end - if not feature_valid_uri(value.u) or value.t:sub(1, 4) == "0000" or not valid_datetime(value.t) then + if not feature_valid_uri(value.u) or not valid_datetime(value.t) then invalid("cursor is malformed") end return value diff --git a/happyview-modules/lua/endpoints/listLocations.lua b/happyview-modules/lua/endpoints/listLocations.lua index 15dab956..4e9d8d1b 100644 --- a/happyview-modules/lua/endpoints/listLocations.lua +++ b/happyview-modules/lua/endpoints/listLocations.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/listMeasurements.lua b/happyview-modules/lua/endpoints/listMeasurements.lua index b1be923d..0e4454ef 100644 --- a/happyview-modules/lua/endpoints/listMeasurements.lua +++ b/happyview-modules/lua/endpoints/listMeasurements.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -182,6 +183,57 @@ local function valid_nsid(value) return #name <= 63 and name:match("^[A-Za-z][A-Za-z0-9]*$") ~= nil end +-- Decodes a hex-encoded {v, d, t, u} list cursor. Rejects malformed tokens, other +-- sort directions and unknown keys; validate_value(value) -> boolean runs the +-- endpoint-specific check on t and u. Not for endpoints that skip the 8192-character +-- cap or accept extra keys. +local function decode_cursor(token, direction, validate_value) + if token == nil then return nil end + if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then + invalid("cursor is malformed") + end + local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) + local ok, value = pcall(json.decode, decoded) + if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction + or type(value.t) ~= "string" or type(value.u) ~= "string" then + invalid("cursor is malformed or belongs to another sortDirection") + end + for key in pairs(value) do + if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end + end + if not validate_value(value) then invalid("cursor is malformed") end + return value +end + +-- Adds `column IN ($n, ...)` to where, binding items; an empty list matches nothing. +local function add_in(where, binds, column, items) + if #items == 0 then + where[#where + 1] = "FALSE" + return + end + local marks = {} + for _, item in ipairs(items) do + binds[#binds + 1] = item + marks[#marks + 1] = "$" .. #binds + end + where[#where + 1] = column .. " IN (" .. table.concat(marks, ", ") .. ")" +end + +local CREATED_AT_SORT_PATTERN = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" + +-- Sort key for a happyview_records row: the record's own createdAt when it is a +-- valid timestamp, otherwise COALESCE(indexed_at, created_at). `alias` is the +-- table alias; nil selects unqualified columns. +local function created_at_sort(alias) + local prefix = alias and (alias .. ".") or "" + local record, indexed_at, created_at = prefix .. "record", prefix .. "indexed_at", prefix .. "created_at" + local created = record .. "::jsonb->>'createdAt'" + return "CASE WHEN jsonb_typeof(" .. record .. "::jsonb->'createdAt') = 'string' AND " .. created .. + " ~ '" .. CREATED_AT_SORT_PATTERN .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. + ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. indexed_at .. + "::timestamptz, " .. created_at .. "::timestamptz) END" +end + local function measurement_array(key, format) local value = params[key] if value == nil then return nil end @@ -235,45 +287,15 @@ local function bind_values(values, items) end local function decode_measurement_cursor(token, direction) - if token == nil then return nil end - if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then - invalid("cursor is malformed") - end - local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) - local ok, value = pcall(json.decode, decoded) - if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction - or type(value.t) ~= "string" or type(value.u) ~= "string" then - invalid("cursor is malformed or belongs to another sortDirection") - end - for key in pairs(value) do - if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end - end - local valid, collection = measurement_valid_record_uri(value.u) - -- PostgreSQL timestamptz has no year zero, so reject it before binding the cursor. - if value.t:sub(1, 4) == "0000" or not valid_datetime(value.t) or not valid or collection ~= MEASUREMENT then - invalid("cursor is malformed") - end - return value -end - -local function measurement_sort_expression() - local created = "measurement.record::jsonb->>'createdAt'" - local zoned = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" - return "CASE WHEN jsonb_typeof(measurement.record::jsonb->'createdAt') = 'string' AND " .. created .. - " ~ '" .. zoned .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. - ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE " .. - "COALESCE(measurement.indexed_at::timestamptz, measurement.created_at::timestamptz) END" + return decode_cursor(token, direction, function(value) + local valid, collection = measurement_valid_record_uri(value.u) + return valid_datetime(value.t) and valid and collection == MEASUREMENT + end) end local function measurement_list_query(authors, subjects, limit, cursor, direction) local where, values = { "measurement.collection = $1" }, { MEASUREMENT } - if authors then - if #authors == 0 then - where[#where + 1] = "FALSE" - else - where[#where + 1] = "measurement.did IN (" .. table.concat(bind_values(values, authors), ", ") .. ")" - end - end + if authors then add_in(where, values, "measurement.did", authors) end if subjects then if #subjects == 0 then where[#where + 1] = "FALSE" @@ -305,7 +327,7 @@ local function measurement_list_query(authors, subjects, limit, cursor, directio "measurement.indexed_at::text AS indexed_at, measurement.record::text AS record, " .. "to_char(sorted.sort_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. "FROM happyview_records AS measurement CROSS JOIN LATERAL (SELECT " .. - measurement_sort_expression() .. " AS sort_at) AS sorted WHERE " .. table.concat(page_where, " AND ") .. + created_at_sort("measurement") .. " AS sort_at) AS sorted WHERE " .. table.concat(page_where, " AND ") .. " ORDER BY sorted.sort_at " .. ordering .. ", measurement.uri " .. ordering .. " LIMIT $" .. #page_values local rows = measurement_query(sql, page_values) diff --git a/happyview-modules/lua/endpoints/listOrganizations.lua b/happyview-modules/lua/endpoints/listOrganizations.lua index 9df39110..c8c76c97 100644 --- a/happyview-modules/lua/endpoints/listOrganizations.lua +++ b/happyview-modules/lua/endpoints/listOrganizations.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -184,37 +185,19 @@ local function hydrate_organization_actors(actors) hydrate_locations(actors) end -local CREATED_AT_SORT_COLUMNS = { - profile = { record = "record", indexed_at = "indexed_at", created_at = "created_at" }, - organization = { - record = "organization.record", - indexed_at = "organization.indexed_at", - created_at = "organization.created_at", - }, - activity = { - record = "activity.record", - indexed_at = "activity.indexed_at", - created_at = "activity.created_at", - }, - collection = { - record = "collection.record", - indexed_at = "collection.indexed_at", - created_at = "collection.created_at", - }, -} local CREATED_AT_SORT_PATTERN = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" -local function created_at_sort_expression(source) - local columns = CREATED_AT_SORT_COLUMNS[source] - if not columns then - error("CreatedAtSortExpressionError: source must be 'profile', 'organization', 'activity', or 'collection'", 0) - end - - local created = columns.record .. "::jsonb->>'createdAt'" - return "CASE WHEN jsonb_typeof(" .. columns.record .. "::jsonb->'createdAt') = 'string' AND " .. created .. +-- Sort key for a happyview_records row: the record's own createdAt when it is a +-- valid timestamp, otherwise COALESCE(indexed_at, created_at). `alias` is the +-- table alias; nil selects unqualified columns. +local function created_at_sort(alias) + local prefix = alias and (alias .. ".") or "" + local record, indexed_at, created_at = prefix .. "record", prefix .. "indexed_at", prefix .. "created_at" + local created = record .. "::jsonb->>'createdAt'" + return "CASE WHEN jsonb_typeof(" .. record .. "::jsonb->'createdAt') = 'string' AND " .. created .. " ~ '" .. CREATED_AT_SORT_PATTERN .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. - ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. columns.indexed_at .. - "::timestamptz, " .. columns.created_at .. "::timestamptz) END" + ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. indexed_at .. + "::timestamptz, " .. created_at .. "::timestamptz) END" end local function valid_organization_uri(value) @@ -332,7 +315,7 @@ local function query_organizations(actors, organization_types, visibility, searc values[#values + 1] = limit + 1 local ordering = direction == "asc" and "ASC" or "DESC" - local sort_key = created_at_sort_expression("organization") + local sort_key = created_at_sort("organization") local sql = "SELECT organization.uri, organization.did, organization.cid, organization.indexed_at::text AS indexed_at, " .. "organization.record::text AS record, to_char(sorted.sort_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. "FROM happyview_records AS organization CROSS JOIN LATERAL (SELECT " .. sort_key .. " AS sort_at) AS sorted WHERE " .. diff --git a/happyview-modules/lua/endpoints/listProfiles.lua b/happyview-modules/lua/endpoints/listProfiles.lua index 63e21779..f721780f 100644 --- a/happyview-modules/lua/endpoints/listProfiles.lua +++ b/happyview-modules/lua/endpoints/listProfiles.lua @@ -33,6 +33,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -90,37 +91,19 @@ local function query(sql, values) return result end -local CREATED_AT_SORT_COLUMNS = { - profile = { record = "record", indexed_at = "indexed_at", created_at = "created_at" }, - organization = { - record = "organization.record", - indexed_at = "organization.indexed_at", - created_at = "organization.created_at", - }, - activity = { - record = "activity.record", - indexed_at = "activity.indexed_at", - created_at = "activity.created_at", - }, - collection = { - record = "collection.record", - indexed_at = "collection.indexed_at", - created_at = "collection.created_at", - }, -} local CREATED_AT_SORT_PATTERN = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" -local function created_at_sort_expression(source) - local columns = CREATED_AT_SORT_COLUMNS[source] - if not columns then - error("CreatedAtSortExpressionError: source must be 'profile', 'organization', 'activity', or 'collection'", 0) - end - - local created = columns.record .. "::jsonb->>'createdAt'" - return "CASE WHEN jsonb_typeof(" .. columns.record .. "::jsonb->'createdAt') = 'string' AND " .. created .. +-- Sort key for a happyview_records row: the record's own createdAt when it is a +-- valid timestamp, otherwise COALESCE(indexed_at, created_at). `alias` is the +-- table alias; nil selects unqualified columns. +local function created_at_sort(alias) + local prefix = alias and (alias .. ".") or "" + local record, indexed_at, created_at = prefix .. "record", prefix .. "indexed_at", prefix .. "created_at" + local created = record .. "::jsonb->>'createdAt'" + return "CASE WHEN jsonb_typeof(" .. record .. "::jsonb->'createdAt') = 'string' AND " .. created .. " ~ '" .. CREATED_AT_SORT_PATTERN .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. - ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. columns.indexed_at .. - "::timestamptz, " .. columns.created_at .. "::timestamptz) END" + ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. indexed_at .. + "::timestamptz, " .. created_at .. "::timestamptz) END" end local function valid_profile_uri(value) @@ -198,7 +181,7 @@ local function query_profiles(actors, search, limit, cursor, direction) values[#values + 1] = limit + 1 local ordering = direction == "asc" and "ASC" or "DESC" - local sort_key = created_at_sort_expression("profile") + local sort_key = created_at_sort() local sql = "SELECT uri, did, cid, indexed_at::text AS indexed_at, record::text AS record, " .. "to_char(sorted.sort_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. "FROM happyview_records CROSS JOIN LATERAL (SELECT " .. sort_key .. " AS sort_at) sorted WHERE " diff --git a/happyview-modules/lua/endpoints/listReceipts.lua b/happyview-modules/lua/endpoints/listReceipts.lua index fa320206..52315b75 100644 --- a/happyview-modules/lua/endpoints/listReceipts.lua +++ b/happyview-modules/lua/endpoints/listReceipts.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/listRecentFollows.lua b/happyview-modules/lua/endpoints/listRecentFollows.lua index 1ec3bece..4a4bfeab 100644 --- a/happyview-modules/lua/endpoints/listRecentFollows.lua +++ b/happyview-modules/lua/endpoints/listRecentFollows.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/listRights.lua b/happyview-modules/lua/endpoints/listRights.lua index f3c95999..499fc669 100644 --- a/happyview-modules/lua/endpoints/listRights.lua +++ b/happyview-modules/lua/endpoints/listRights.lua @@ -110,6 +110,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -146,6 +147,57 @@ local function cursor_encode(value) return (encoded:gsub(".", function(char) return string.format("%02x", string.byte(char)) end)) end +-- Decodes a hex-encoded {v, d, t, u} list cursor. Rejects malformed tokens, other +-- sort directions and unknown keys; validate_value(value) -> boolean runs the +-- endpoint-specific check on t and u. Not for endpoints that skip the 8192-character +-- cap or accept extra keys. +local function decode_cursor(token, direction, validate_value) + if token == nil then return nil end + if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then + invalid("cursor is malformed") + end + local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) + local ok, value = pcall(json.decode, decoded) + if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction + or type(value.t) ~= "string" or type(value.u) ~= "string" then + invalid("cursor is malformed or belongs to another sortDirection") + end + for key in pairs(value) do + if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end + end + if not validate_value(value) then invalid("cursor is malformed") end + return value +end + +-- Adds `column IN ($n, ...)` to where, binding items; an empty list matches nothing. +local function add_in(where, binds, column, items) + if #items == 0 then + where[#where + 1] = "FALSE" + return + end + local marks = {} + for _, item in ipairs(items) do + binds[#binds + 1] = item + marks[#marks + 1] = "$" .. #binds + end + where[#where + 1] = column .. " IN (" .. table.concat(marks, ", ") .. ")" +end + +local CREATED_AT_SORT_PATTERN = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" + +-- Sort key for a happyview_records row: the record's own createdAt when it is a +-- valid timestamp, otherwise COALESCE(indexed_at, created_at). `alias` is the +-- table alias; nil selects unqualified columns. +local function created_at_sort(alias) + local prefix = alias and (alias .. ".") or "" + local record, indexed_at, created_at = prefix .. "record", prefix .. "indexed_at", prefix .. "created_at" + local created = record .. "::jsonb->>'createdAt'" + return "CASE WHEN jsonb_typeof(" .. record .. "::jsonb->'createdAt') = 'string' AND " .. created .. + " ~ '" .. CREATED_AT_SORT_PATTERN .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. + ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. indexed_at .. + "::timestamptz, " .. created_at .. "::timestamptz) END" +end + local RIGHTS = "org.hypercerts.claim.rights" local function rights_list_run_query(sql, values) @@ -190,51 +242,16 @@ local function rights_list_array(value) end local function rights_list_cursor_decode(token, direction) - if token == nil then return nil end - if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then - invalid("cursor is malformed") - end - local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) - local ok, value = pcall(json.decode, decoded) - if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction - or type(value.t) ~= "string" or type(value.u) ~= "string" then - invalid("cursor is malformed or belongs to another sortDirection") - end - for key in pairs(value) do - if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end - end - local valid, collection = rights_valid_record_uri(value.u) - local year = tonumber(value.t:sub(1, 4)) - if not valid_datetime(value.t) or not year or year < 1 or not valid or collection ~= RIGHTS then - invalid("cursor is malformed") - end - return value -end - -local function rights_sort_expression() - local created = "rights.record::jsonb->>'createdAt'" - local zoned = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" - return "CASE WHEN jsonb_typeof(rights.record::jsonb->'createdAt') = 'string' AND " .. created .. - " ~ '" .. zoned .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. - ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE " .. - "COALESCE(rights.indexed_at::timestamptz, rights.created_at::timestamptz) END" + return decode_cursor(token, direction, function(value) + local valid, collection = rights_valid_record_uri(value.u) + return valid_datetime(value.t) and valid and collection == RIGHTS + end) end local function rights_list_query(authors, limit, cursor, direction) local where, values = { "rights.collection = $1" }, { RIGHTS } - if authors then - if #authors == 0 then - where[#where + 1] = "FALSE" - else - local marks = {} - for _, did in ipairs(authors) do - values[#values + 1] = did - marks[#marks + 1] = "$" .. #values - end - where[#where + 1] = "rights.did IN (" .. table.concat(marks, ", ") .. ")" - end - end + if authors then add_in(where, values, "rights.did", authors) end if cursor then values[#values + 1] = cursor.t @@ -250,7 +267,7 @@ local function rights_list_query(authors, limit, cursor, direction) local sql = "SELECT rights.uri, rights.did, rights.cid, rights.indexed_at::text AS indexed_at, " .. "rights.record::text AS record, to_char(sorted.sort_at AT TIME ZONE 'UTC', " .. "'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. - "FROM happyview_records AS rights CROSS JOIN LATERAL (SELECT " .. rights_sort_expression() .. " AS sort_at) AS sorted " .. + "FROM happyview_records AS rights CROSS JOIN LATERAL (SELECT " .. created_at_sort("rights") .. " AS sort_at) AS sorted " .. "WHERE " .. table.concat(where, " AND ") .. " ORDER BY sorted.sort_at " .. ordering .. ", rights.uri " .. ordering .. " LIMIT $" .. #values local rows = rights_list_run_query(sql, values) diff --git a/happyview-modules/lua/endpoints/listVocabTags.lua b/happyview-modules/lua/endpoints/listVocabTags.lua index f977072e..089f8f3a 100644 --- a/happyview-modules/lua/endpoints/listVocabTags.lua +++ b/happyview-modules/lua/endpoints/listVocabTags.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -214,7 +215,6 @@ local function decode_cursor(token, direction, authors) end end if not valid_datetime(value.t) then invalid("cursor is malformed") end - if value.t:sub(1, 4) == "0000" then invalid("cursor timestamp year must be greater than 0000") end if not valid_vocab_tag_uri(value.u) then invalid("cursor is malformed") end return value end diff --git a/happyview-modules/lua/endpoints/listWorkscopeTags.lua b/happyview-modules/lua/endpoints/listWorkscopeTags.lua index d772fc3c..90a04ba0 100644 --- a/happyview-modules/lua/endpoints/listWorkscopeTags.lua +++ b/happyview-modules/lua/endpoints/listWorkscopeTags.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -153,6 +154,42 @@ local function workscope_tag_view(row) } end +-- Decodes a hex-encoded {v, d, t, u} list cursor. Rejects malformed tokens, other +-- sort directions and unknown keys; validate_value(value) -> boolean runs the +-- endpoint-specific check on t and u. Not for endpoints that skip the 8192-character +-- cap or accept extra keys. +local function decode_cursor(token, direction, validate_value) + if token == nil then return nil end + if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then + invalid("cursor is malformed") + end + local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) + local ok, value = pcall(json.decode, decoded) + if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction + or type(value.t) ~= "string" or type(value.u) ~= "string" then + invalid("cursor is malformed or belongs to another sortDirection") + end + for key in pairs(value) do + if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end + end + if not validate_value(value) then invalid("cursor is malformed") end + return value +end + +-- Adds `column IN ($n, ...)` to where, binding items; an empty list matches nothing. +local function add_in(where, binds, column, items) + if #items == 0 then + where[#where + 1] = "FALSE" + return + end + local marks = {} + for _, item in ipairs(items) do + binds[#binds + 1] = item + marks[#marks + 1] = "$" .. #binds + end + where[#where + 1] = column .. " IN (" .. table.concat(marks, ", ") .. ")" +end + local function workscope_tag_array(key) local value = params[key] if value == nil then return nil end @@ -192,24 +229,10 @@ local function workscope_tag_array(key) end local function workscope_tag_decode_cursor(token, direction) - if token == nil then return nil end - if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then - invalid("cursor is malformed") - end - local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) - local ok, value = pcall(json.decode, decoded) - if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction - or type(value.t) ~= "string" or type(value.u) ~= "string" then - invalid("cursor is malformed or belongs to another sortDirection") - end - for key in pairs(value) do - if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end - end - local valid, collection = workscope_tag_valid_record_uri(value.u) - if not valid_datetime(value.t) or value.t:sub(1, 4) == "0000" or not valid or collection ~= WORKSCOPE_TAG then - invalid("cursor is malformed") - end - return value + return decode_cursor(token, direction, function(value) + local valid, collection = workscope_tag_valid_record_uri(value.u) + return valid_datetime(value.t) and valid and collection == WORKSCOPE_TAG + end) end local function workscope_tag_list() @@ -220,18 +243,7 @@ local function workscope_tag_list() local cursor = workscope_tag_decode_cursor(scalar(params, "cursor"), direction) local where, values = { "workscope_tag.collection = $1" }, { WORKSCOPE_TAG } - if authors then - if #authors == 0 then - where[#where + 1] = "FALSE" - else - local placeholders = {} - for _, did in ipairs(authors) do - values[#values + 1] = did - placeholders[#placeholders + 1] = "$" .. #values - end - where[#where + 1] = "workscope_tag.did IN (" .. table.concat(placeholders, ", ") .. ")" - end - end + if authors then add_in(where, values, "workscope_tag.did", authors) end if cursor then values[#values + 1] = cursor.t local timestamp = "$" .. #values diff --git a/happyview-modules/lua/endpoints/searchActivities.lua b/happyview-modules/lua/endpoints/searchActivities.lua index 40402505..63fbee71 100644 --- a/happyview-modules/lua/endpoints/searchActivities.lua +++ b/happyview-modules/lua/endpoints/searchActivities.lua @@ -242,6 +242,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -267,37 +268,19 @@ local function parse_list_limit(params) return limit end -local CREATED_AT_SORT_COLUMNS = { - profile = { record = "record", indexed_at = "indexed_at", created_at = "created_at" }, - organization = { - record = "organization.record", - indexed_at = "organization.indexed_at", - created_at = "organization.created_at", - }, - activity = { - record = "activity.record", - indexed_at = "activity.indexed_at", - created_at = "activity.created_at", - }, - collection = { - record = "collection.record", - indexed_at = "collection.indexed_at", - created_at = "collection.created_at", - }, -} local CREATED_AT_SORT_PATTERN = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" -local function created_at_sort_expression(source) - local columns = CREATED_AT_SORT_COLUMNS[source] - if not columns then - error("CreatedAtSortExpressionError: source must be 'profile', 'organization', 'activity', or 'collection'", 0) - end - - local created = columns.record .. "::jsonb->>'createdAt'" - return "CASE WHEN jsonb_typeof(" .. columns.record .. "::jsonb->'createdAt') = 'string' AND " .. created .. +-- Sort key for a happyview_records row: the record's own createdAt when it is a +-- valid timestamp, otherwise COALESCE(indexed_at, created_at). `alias` is the +-- table alias; nil selects unqualified columns. +local function created_at_sort(alias) + local prefix = alias and (alias .. ".") or "" + local record, indexed_at, created_at = prefix .. "record", prefix .. "indexed_at", prefix .. "created_at" + local created = record .. "::jsonb->>'createdAt'" + return "CASE WHEN jsonb_typeof(" .. record .. "::jsonb->'createdAt') = 'string' AND " .. created .. " ~ '" .. CREATED_AT_SORT_PATTERN .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. - ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. columns.indexed_at .. - "::timestamptz, " .. columns.created_at .. "::timestamptz) END" + ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. indexed_at .. + "::timestamptz, " .. created_at .. "::timestamptz) END" end local function activity_scalar(values, key) @@ -455,7 +438,7 @@ local function activity_query(authors, has_organization_record, contributors, in local sql = "SELECT activity.uri, activity.did, activity.cid, activity.indexed_at::text AS indexed_at, " .. "activity.record::text AS record, to_char(sorted.sort_at AT TIME ZONE 'UTC', " .. "'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. - "FROM happyview_records AS activity CROSS JOIN LATERAL (SELECT " .. created_at_sort_expression("activity") .. " AS sort_at) AS sorted " .. + "FROM happyview_records AS activity CROSS JOIN LATERAL (SELECT " .. created_at_sort("activity") .. " AS sort_at) AS sorted " .. "WHERE " .. table.concat(where, " AND ") .. " ORDER BY sorted.sort_at " .. ordering .. ", activity.uri " .. ordering .. " LIMIT $" .. #values local rows = query(sql, values) diff --git a/happyview-modules/lua/endpoints/searchBadgeDefinitions.lua b/happyview-modules/lua/endpoints/searchBadgeDefinitions.lua index c30b764f..e78a63ea 100644 --- a/happyview-modules/lua/endpoints/searchBadgeDefinitions.lua +++ b/happyview-modules/lua/endpoints/searchBadgeDefinitions.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/endpoints/searchCollections.lua b/happyview-modules/lua/endpoints/searchCollections.lua index 3d584548..553705b3 100644 --- a/happyview-modules/lua/endpoints/searchCollections.lua +++ b/happyview-modules/lua/endpoints/searchCollections.lua @@ -258,6 +258,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -275,37 +276,19 @@ local function valid_datetime(value) return true end -local CREATED_AT_SORT_COLUMNS = { - profile = { record = "record", indexed_at = "indexed_at", created_at = "created_at" }, - organization = { - record = "organization.record", - indexed_at = "organization.indexed_at", - created_at = "organization.created_at", - }, - activity = { - record = "activity.record", - indexed_at = "activity.indexed_at", - created_at = "activity.created_at", - }, - collection = { - record = "collection.record", - indexed_at = "collection.indexed_at", - created_at = "collection.created_at", - }, -} local CREATED_AT_SORT_PATTERN = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" -local function created_at_sort_expression(source) - local columns = CREATED_AT_SORT_COLUMNS[source] - if not columns then - error("CreatedAtSortExpressionError: source must be 'profile', 'organization', 'activity', or 'collection'", 0) - end - - local created = columns.record .. "::jsonb->>'createdAt'" - return "CASE WHEN jsonb_typeof(" .. columns.record .. "::jsonb->'createdAt') = 'string' AND " .. created .. +-- Sort key for a happyview_records row: the record's own createdAt when it is a +-- valid timestamp, otherwise COALESCE(indexed_at, created_at). `alias` is the +-- table alias; nil selects unqualified columns. +local function created_at_sort(alias) + local prefix = alias and (alias .. ".") or "" + local record, indexed_at, created_at = prefix .. "record", prefix .. "indexed_at", prefix .. "created_at" + local created = record .. "::jsonb->>'createdAt'" + return "CASE WHEN jsonb_typeof(" .. record .. "::jsonb->'createdAt') = 'string' AND " .. created .. " ~ '" .. CREATED_AT_SORT_PATTERN .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. - ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. columns.indexed_at .. - "::timestamptz, " .. columns.created_at .. "::timestamptz) END" + ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. indexed_at .. + "::timestamptz, " .. created_at .. "::timestamptz) END" end local function collection_array(key, kind) @@ -487,7 +470,7 @@ end local function collection_list_sql(where, values, limit, direction) values[#values + 1] = limit + 1 local ordering = direction == "asc" and "ASC" or "DESC" - local sort_key = created_at_sort_expression("collection") + local sort_key = created_at_sort("collection") return "SELECT collection.uri, collection.did, collection.cid, collection.indexed_at::text AS indexed_at, " .. "collection.record::text AS record, to_char(sorted.sort_at AT TIME ZONE 'UTC', " .. "'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. diff --git a/happyview-modules/lua/endpoints/searchOrganizations.lua b/happyview-modules/lua/endpoints/searchOrganizations.lua index ba5ef70f..a8d5f166 100644 --- a/happyview-modules/lua/endpoints/searchOrganizations.lua +++ b/happyview-modules/lua/endpoints/searchOrganizations.lua @@ -45,6 +45,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -184,37 +185,19 @@ local function hydrate_organization_actors(actors) hydrate_locations(actors) end -local CREATED_AT_SORT_COLUMNS = { - profile = { record = "record", indexed_at = "indexed_at", created_at = "created_at" }, - organization = { - record = "organization.record", - indexed_at = "organization.indexed_at", - created_at = "organization.created_at", - }, - activity = { - record = "activity.record", - indexed_at = "activity.indexed_at", - created_at = "activity.created_at", - }, - collection = { - record = "collection.record", - indexed_at = "collection.indexed_at", - created_at = "collection.created_at", - }, -} local CREATED_AT_SORT_PATTERN = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" -local function created_at_sort_expression(source) - local columns = CREATED_AT_SORT_COLUMNS[source] - if not columns then - error("CreatedAtSortExpressionError: source must be 'profile', 'organization', 'activity', or 'collection'", 0) - end - - local created = columns.record .. "::jsonb->>'createdAt'" - return "CASE WHEN jsonb_typeof(" .. columns.record .. "::jsonb->'createdAt') = 'string' AND " .. created .. +-- Sort key for a happyview_records row: the record's own createdAt when it is a +-- valid timestamp, otherwise COALESCE(indexed_at, created_at). `alias` is the +-- table alias; nil selects unqualified columns. +local function created_at_sort(alias) + local prefix = alias and (alias .. ".") or "" + local record, indexed_at, created_at = prefix .. "record", prefix .. "indexed_at", prefix .. "created_at" + local created = record .. "::jsonb->>'createdAt'" + return "CASE WHEN jsonb_typeof(" .. record .. "::jsonb->'createdAt') = 'string' AND " .. created .. " ~ '" .. CREATED_AT_SORT_PATTERN .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. - ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. columns.indexed_at .. - "::timestamptz, " .. columns.created_at .. "::timestamptz) END" + ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. indexed_at .. + "::timestamptz, " .. created_at .. "::timestamptz) END" end local function valid_organization_uri(value) @@ -332,7 +315,7 @@ local function query_organizations(actors, organization_types, visibility, searc values[#values + 1] = limit + 1 local ordering = direction == "asc" and "ASC" or "DESC" - local sort_key = created_at_sort_expression("organization") + local sort_key = created_at_sort("organization") local sql = "SELECT organization.uri, organization.did, organization.cid, organization.indexed_at::text AS indexed_at, " .. "organization.record::text AS record, to_char(sorted.sort_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. "FROM happyview_records AS organization CROSS JOIN LATERAL (SELECT " .. sort_key .. " AS sort_at) AS sorted WHERE " .. diff --git a/happyview-modules/lua/endpoints/searchProfiles.lua b/happyview-modules/lua/endpoints/searchProfiles.lua index f1c8dd3d..bef76ab5 100644 --- a/happyview-modules/lua/endpoints/searchProfiles.lua +++ b/happyview-modules/lua/endpoints/searchProfiles.lua @@ -33,6 +33,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) @@ -90,37 +91,19 @@ local function query(sql, values) return result end -local CREATED_AT_SORT_COLUMNS = { - profile = { record = "record", indexed_at = "indexed_at", created_at = "created_at" }, - organization = { - record = "organization.record", - indexed_at = "organization.indexed_at", - created_at = "organization.created_at", - }, - activity = { - record = "activity.record", - indexed_at = "activity.indexed_at", - created_at = "activity.created_at", - }, - collection = { - record = "collection.record", - indexed_at = "collection.indexed_at", - created_at = "collection.created_at", - }, -} local CREATED_AT_SORT_PATTERN = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" -local function created_at_sort_expression(source) - local columns = CREATED_AT_SORT_COLUMNS[source] - if not columns then - error("CreatedAtSortExpressionError: source must be 'profile', 'organization', 'activity', or 'collection'", 0) - end - - local created = columns.record .. "::jsonb->>'createdAt'" - return "CASE WHEN jsonb_typeof(" .. columns.record .. "::jsonb->'createdAt') = 'string' AND " .. created .. +-- Sort key for a happyview_records row: the record's own createdAt when it is a +-- valid timestamp, otherwise COALESCE(indexed_at, created_at). `alias` is the +-- table alias; nil selects unqualified columns. +local function created_at_sort(alias) + local prefix = alias and (alias .. ".") or "" + local record, indexed_at, created_at = prefix .. "record", prefix .. "indexed_at", prefix .. "created_at" + local created = record .. "::jsonb->>'createdAt'" + return "CASE WHEN jsonb_typeof(" .. record .. "::jsonb->'createdAt') = 'string' AND " .. created .. " ~ '" .. CREATED_AT_SORT_PATTERN .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. - ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. columns.indexed_at .. - "::timestamptz, " .. columns.created_at .. "::timestamptz) END" + ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. indexed_at .. + "::timestamptz, " .. created_at .. "::timestamptz) END" end local function valid_profile_uri(value) @@ -198,7 +181,7 @@ local function query_profiles(actors, search, limit, cursor, direction) values[#values + 1] = limit + 1 local ordering = direction == "asc" and "ASC" or "DESC" - local sort_key = created_at_sort_expression("profile") + local sort_key = created_at_sort() local sql = "SELECT uri, did, cid, indexed_at::text AS indexed_at, record::text AS record, " .. "to_char(sorted.sort_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. "FROM happyview_records CROSS JOIN LATERAL (SELECT " .. sort_key .. " AS sort_at) sorted WHERE " diff --git a/happyview-modules/lua/shared/acknowledgementList.lua b/happyview-modules/lua/shared/acknowledgementList.lua index ef3773e5..fe8ae8db 100644 --- a/happyview-modules/lua/shared/acknowledgementList.lua +++ b/happyview-modules/lua/shared/acknowledgementList.lua @@ -1,17 +1,9 @@ -local generic_valid_datetime = valid_datetime - -local function acknowledgement_valid_datetime(value) - if type(value) ~= "string" then return false end - if value:match("^(%d%d%d%d)") == "0000" then return false end - return generic_valid_datetime(value) -end - local function valid_cursor_timestamp(value) if type(value) ~= "string" or #value ~= 27 or not value:match("^%d%d%d%d%-%d%d%-%d%dT%d%d:%d%d:%d%d%.%d%d%d%d%d%dZ$") then return false end - return acknowledgement_valid_datetime(value) + return valid_datetime(value) end local function acknowledgement_array(key, format) @@ -56,39 +48,11 @@ local function acknowledgement_array(key, format) return unique end -local function bind_acknowledgement_values(values, items) - local placeholders = {} - for _, item in ipairs(items) do - values[#values + 1] = item - placeholders[#placeholders + 1] = "$" .. #values - end - return placeholders -end - -local function cursor_encode(value) - local encoded = json.encode(value) - return (encoded:gsub(".", function(char) return string.format("%02x", string.byte(char)) end)) -end - local function decode_acknowledgement_cursor(token, direction) - if token == nil then return nil end - if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then - invalid("cursor is malformed") - end - local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) - local ok, value = pcall(json.decode, decoded) - if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction - or type(value.t) ~= "string" or type(value.u) ~= "string" then - invalid("cursor is malformed or belongs to another sortDirection") - end - for key in pairs(value) do - if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end - end - local valid, collection = valid_record_uri(value.u) - if not valid_cursor_timestamp(value.t) or not valid or collection ~= ACKNOWLEDGEMENT then - invalid("cursor is malformed") - end - return value + return decode_cursor(token, direction, function(value) + local valid, collection = valid_record_uri(value.u) + return valid_cursor_timestamp(value.t) and valid and collection == ACKNOWLEDGEMENT + end) end local function acknowledgement_sort_expression() @@ -103,22 +67,8 @@ end local function acknowledgement_list_query(authors, subjects, limit, cursor, direction) local where, values = { "acknowledgement.collection = $1" }, { ACKNOWLEDGEMENT } - if authors then - if #authors == 0 then - where[#where + 1] = "FALSE" - else - where[#where + 1] = "acknowledgement.did IN (" .. - table.concat(bind_acknowledgement_values(values, authors), ", ") .. ")" - end - end - if subjects then - if #subjects == 0 then - where[#where + 1] = "FALSE" - else - where[#where + 1] = "acknowledgement.record::jsonb->'subject'->>'uri' IN (" .. - table.concat(bind_acknowledgement_values(values, subjects), ", ") .. ")" - end - end + if authors then add_in(where, values, "acknowledgement.did", authors) end + if subjects then add_in(where, values, "acknowledgement.record::jsonb->'subject'->>'uri'", subjects) end local page_values, page_where = {}, {} for _, value in ipairs(values) do page_values[#page_values + 1] = value end @@ -154,8 +104,7 @@ local function list_acknowledgements() }) local authors = acknowledgement_array("authors", "did") local subjects = acknowledgement_array("subjects", "at-uri") - local direction = scalar(params, "sortDirection") or "desc" - if direction ~= "asc" and direction ~= "desc" then invalid("sortDirection must be 'asc' or 'desc'") end + local direction = parse_sort_direction(params) local limit = parse_list_limit(params) local cursor = decode_acknowledgement_cursor(scalar(params, "cursor"), direction) local rows = acknowledgement_list_query(authors, subjects, limit, cursor, direction) diff --git a/happyview-modules/lua/shared/activityList.lua b/happyview-modules/lua/shared/activityList.lua index 68144770..603855c0 100644 --- a/happyview-modules/lua/shared/activityList.lua +++ b/happyview-modules/lua/shared/activityList.lua @@ -153,7 +153,7 @@ local function activity_query(authors, has_organization_record, contributors, in local sql = "SELECT activity.uri, activity.did, activity.cid, activity.indexed_at::text AS indexed_at, " .. "activity.record::text AS record, to_char(sorted.sort_at AT TIME ZONE 'UTC', " .. "'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. - "FROM happyview_records AS activity CROSS JOIN LATERAL (SELECT " .. created_at_sort_expression("activity") .. " AS sort_at) AS sorted " .. + "FROM happyview_records AS activity CROSS JOIN LATERAL (SELECT " .. created_at_sort("activity") .. " AS sort_at) AS sorted " .. "WHERE " .. table.concat(where, " AND ") .. " ORDER BY sorted.sort_at " .. ordering .. ", activity.uri " .. ordering .. " LIMIT $" .. #values local rows = query(sql, values) diff --git a/happyview-modules/lua/shared/collectionList.lua b/happyview-modules/lua/shared/collectionList.lua index d6295272..de89183c 100644 --- a/happyview-modules/lua/shared/collectionList.lua +++ b/happyview-modules/lua/shared/collectionList.lua @@ -177,7 +177,7 @@ end local function collection_list_sql(where, values, limit, direction) values[#values + 1] = limit + 1 local ordering = direction == "asc" and "ASC" or "DESC" - local sort_key = created_at_sort_expression("collection") + local sort_key = created_at_sort("collection") return "SELECT collection.uri, collection.did, collection.cid, collection.indexed_at::text AS indexed_at, " .. "collection.record::text AS record, to_char(sorted.sort_at AT TIME ZONE 'UTC', " .. "'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. diff --git a/happyview-modules/lua/shared/createdAtSort.lua b/happyview-modules/lua/shared/createdAtSort.lua index 171bef7c..65456e1d 100644 --- a/happyview-modules/lua/shared/createdAtSort.lua +++ b/happyview-modules/lua/shared/createdAtSort.lua @@ -1,32 +1,14 @@ -local CREATED_AT_SORT_COLUMNS = { - profile = { record = "record", indexed_at = "indexed_at", created_at = "created_at" }, - organization = { - record = "organization.record", - indexed_at = "organization.indexed_at", - created_at = "organization.created_at", - }, - activity = { - record = "activity.record", - indexed_at = "activity.indexed_at", - created_at = "activity.created_at", - }, - collection = { - record = "collection.record", - indexed_at = "collection.indexed_at", - created_at = "collection.created_at", - }, -} local CREATED_AT_SORT_PATTERN = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" -local function created_at_sort_expression(source) - local columns = CREATED_AT_SORT_COLUMNS[source] - if not columns then - error("CreatedAtSortExpressionError: source must be 'profile', 'organization', 'activity', or 'collection'", 0) - end - - local created = columns.record .. "::jsonb->>'createdAt'" - return "CASE WHEN jsonb_typeof(" .. columns.record .. "::jsonb->'createdAt') = 'string' AND " .. created .. +-- Sort key for a happyview_records row: the record's own createdAt when it is a +-- valid timestamp, otherwise COALESCE(indexed_at, created_at). `alias` is the +-- table alias; nil selects unqualified columns. +local function created_at_sort(alias) + local prefix = alias and (alias .. ".") or "" + local record, indexed_at, created_at = prefix .. "record", prefix .. "indexed_at", prefix .. "created_at" + local created = record .. "::jsonb->>'createdAt'" + return "CASE WHEN jsonb_typeof(" .. record .. "::jsonb->'createdAt') = 'string' AND " .. created .. " ~ '" .. CREATED_AT_SORT_PATTERN .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. - ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. columns.indexed_at .. - "::timestamptz, " .. columns.created_at .. "::timestamptz) END" + ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE COALESCE(" .. indexed_at .. + "::timestamptz, " .. created_at .. "::timestamptz) END" end diff --git a/happyview-modules/lua/shared/datetimeValidation.lua b/happyview-modules/lua/shared/datetimeValidation.lua index 598169bc..07e40370 100644 --- a/happyview-modules/lua/shared/datetimeValidation.lua +++ b/happyview-modules/lua/shared/datetimeValidation.lua @@ -4,6 +4,7 @@ local function valid_datetime(value) "^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)(.*)$") if not year then return false end year, month, day = tonumber(year), tonumber(month), tonumber(day) + if year < 1 then return false end hour, minute, second = tonumber(hour), tonumber(minute), tonumber(second) if month < 1 or month > 12 or hour > 23 or minute > 59 or second > 59 then return false end local leap = year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0) diff --git a/happyview-modules/lua/shared/listCursor.lua b/happyview-modules/lua/shared/listCursor.lua new file mode 100644 index 00000000..e0a8586e --- /dev/null +++ b/happyview-modules/lua/shared/listCursor.lua @@ -0,0 +1,21 @@ +-- Decodes a hex-encoded {v, d, t, u} list cursor. Rejects malformed tokens, other +-- sort directions and unknown keys; validate_value(value) -> boolean runs the +-- endpoint-specific check on t and u. Not for endpoints that skip the 8192-character +-- cap or accept extra keys. +local function decode_cursor(token, direction, validate_value) + if token == nil then return nil end + if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then + invalid("cursor is malformed") + end + local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) + local ok, value = pcall(json.decode, decoded) + if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction + or type(value.t) ~= "string" or type(value.u) ~= "string" then + invalid("cursor is malformed or belongs to another sortDirection") + end + for key in pairs(value) do + if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end + end + if not validate_value(value) then invalid("cursor is malformed") end + return value +end diff --git a/happyview-modules/lua/shared/listWhere.lua b/happyview-modules/lua/shared/listWhere.lua new file mode 100644 index 00000000..b5080271 --- /dev/null +++ b/happyview-modules/lua/shared/listWhere.lua @@ -0,0 +1,13 @@ +-- Adds `column IN ($n, ...)` to where, binding items; an empty list matches nothing. +local function add_in(where, binds, column, items) + if #items == 0 then + where[#where + 1] = "FALSE" + return + end + local marks = {} + for _, item in ipairs(items) do + binds[#binds + 1] = item + marks[#marks + 1] = "$" .. #binds + end + where[#where + 1] = column .. " IN (" .. table.concat(marks, ", ") .. ")" +end diff --git a/happyview-modules/lua/shared/organizationList.lua b/happyview-modules/lua/shared/organizationList.lua index 4117d813..67721f1f 100644 --- a/happyview-modules/lua/shared/organizationList.lua +++ b/happyview-modules/lua/shared/organizationList.lua @@ -113,7 +113,7 @@ local function query_organizations(actors, organization_types, visibility, searc values[#values + 1] = limit + 1 local ordering = direction == "asc" and "ASC" or "DESC" - local sort_key = created_at_sort_expression("organization") + local sort_key = created_at_sort("organization") local sql = "SELECT organization.uri, organization.did, organization.cid, organization.indexed_at::text AS indexed_at, " .. "organization.record::text AS record, to_char(sorted.sort_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. "FROM happyview_records AS organization CROSS JOIN LATERAL (SELECT " .. sort_key .. " AS sort_at) AS sorted WHERE " .. diff --git a/happyview-modules/lua/shared/profileList.lua b/happyview-modules/lua/shared/profileList.lua index efb2f159..eb28a59b 100644 --- a/happyview-modules/lua/shared/profileList.lua +++ b/happyview-modules/lua/shared/profileList.lua @@ -73,7 +73,7 @@ local function query_profiles(actors, search, limit, cursor, direction) values[#values + 1] = limit + 1 local ordering = direction == "asc" and "ASC" or "DESC" - local sort_key = created_at_sort_expression("profile") + local sort_key = created_at_sort() local sql = "SELECT uri, did, cid, indexed_at::text AS indexed_at, record::text AS record, " .. "to_char(sorted.sort_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. "FROM happyview_records CROSS JOIN LATERAL (SELECT " .. sort_key .. " AS sort_at) sorted WHERE " diff --git a/happyview-modules/lua/shared/workscopeTagList.lua b/happyview-modules/lua/shared/workscopeTagList.lua index 99064f28..7b5a553f 100644 --- a/happyview-modules/lua/shared/workscopeTagList.lua +++ b/happyview-modules/lua/shared/workscopeTagList.lua @@ -37,24 +37,10 @@ local function workscope_tag_array(key) end local function workscope_tag_decode_cursor(token, direction) - if token == nil then return nil end - if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then - invalid("cursor is malformed") - end - local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) - local ok, value = pcall(json.decode, decoded) - if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction - or type(value.t) ~= "string" or type(value.u) ~= "string" then - invalid("cursor is malformed or belongs to another sortDirection") - end - for key in pairs(value) do - if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end - end - local valid, collection = workscope_tag_valid_record_uri(value.u) - if not valid_datetime(value.t) or value.t:sub(1, 4) == "0000" or not valid or collection ~= WORKSCOPE_TAG then - invalid("cursor is malformed") - end - return value + return decode_cursor(token, direction, function(value) + local valid, collection = workscope_tag_valid_record_uri(value.u) + return valid_datetime(value.t) and valid and collection == WORKSCOPE_TAG + end) end local function workscope_tag_list() @@ -65,18 +51,7 @@ local function workscope_tag_list() local cursor = workscope_tag_decode_cursor(scalar(params, "cursor"), direction) local where, values = { "workscope_tag.collection = $1" }, { WORKSCOPE_TAG } - if authors then - if #authors == 0 then - where[#where + 1] = "FALSE" - else - local placeholders = {} - for _, did in ipairs(authors) do - values[#values + 1] = did - placeholders[#placeholders + 1] = "$" .. #values - end - where[#where + 1] = "workscope_tag.did IN (" .. table.concat(placeholders, ", ") .. ")" - end - end + if authors then add_in(where, values, "workscope_tag.did", authors) end if cursor then values[#values + 1] = cursor.t local timestamp = "$" .. #values diff --git a/happyview-modules/lua/src/listContributions.lua b/happyview-modules/lua/src/listContributions.lua index 67700162..09f0cd16 100644 --- a/happyview-modules/lua/src/listContributions.lua +++ b/happyview-modules/lua/src/listContributions.lua @@ -34,44 +34,11 @@ local function contribution_authors() return authors end -local function valid_contribution_cursor_datetime(value) - if type(value) ~= "string" or not valid_datetime(value) then return false end - return value:sub(1, 4) ~= "0000" -end - local function decode_contribution_cursor(token, direction) - if token == nil then return nil end - if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then - invalid("cursor is malformed") - end - local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) - local ok, value = pcall(json.decode, decoded) - if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction - or type(value.t) ~= "string" or type(value.u) ~= "string" then - invalid("cursor is malformed or belongs to another sortDirection") - end - for key in pairs(value) do - if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end - end - local valid = valid_contribution_uri(value.u) - if not valid or not valid_contribution_cursor_datetime(value.t) then - invalid("cursor is malformed") - end - return value -end - -local function add_contribution_authors(where, values, authors) - if authors == nil then return end - if #authors == 0 then - where[#where + 1] = "FALSE" - return - end - local placeholders = {} - for _, did in ipairs(authors) do - values[#values + 1] = did - placeholders[#placeholders + 1] = "$" .. #values - end - where[#where + 1] = "contribution.did IN (" .. table.concat(placeholders, ", ") .. ")" + return decode_cursor(token, direction, function(value) + local valid = valid_contribution_uri(value.u) + return valid and valid_datetime(value.t) + end) end local function contribution_sort_key() @@ -84,7 +51,7 @@ end local function query_contributions(authors, limit, cursor, direction) local where, values = { "contribution.collection = $1" }, { CONTRIBUTION } - add_contribution_authors(where, values, authors) + if authors then add_in(where, values, "contribution.did", authors) end if cursor then values[#values + 1] = cursor.t local timestamp = "$" .. #values diff --git a/happyview-modules/lua/src/listContributorInformation.lua b/happyview-modules/lua/src/listContributorInformation.lua index 4c83a0e2..1bb77965 100644 --- a/happyview-modules/lua/src/listContributorInformation.lua +++ b/happyview-modules/lua/src/listContributorInformation.lua @@ -1,7 +1,3 @@ -local function contributor_information_datetime(value) - return valid_datetime(value) and tonumber(value:sub(1, 4)) > 0 -end - local function contributor_information_query(sql, values) local backend_ok, backend = pcall(db.backend) if not backend_ok or backend ~= "postgres" then @@ -52,38 +48,10 @@ local function contributor_information_array(params, key, validate, description) return unique end -local function contributor_information_bind_in(where, values, expression, items) - if not items then return end - if #items == 0 then - where[#where + 1] = "FALSE" - return - end - local placeholders = {} - for _, item in ipairs(items) do - values[#values + 1] = item - placeholders[#placeholders + 1] = "$" .. #values - end - where[#where + 1] = expression .. " IN (" .. table.concat(placeholders, ", ") .. ")" -end - local function contributor_information_cursor_decode(token, direction) - if token == nil then return nil end - if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then - invalid("cursor is malformed") - end - local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) - local ok, value = pcall(json.decode, decoded) - if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction - or type(value.t) ~= "string" or type(value.u) ~= "string" then - invalid("cursor is malformed or belongs to another sortDirection") - end - for key in pairs(value) do - if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end - end - if not contributor_information_uri(value.u) or not contributor_information_datetime(value.t) then - invalid("cursor is malformed") - end - return value + return decode_cursor(token, direction, function(value) + return contributor_information_uri(value.u) and valid_datetime(value.t) + end) end local function preserve_contributor_author_timestamps(author) @@ -96,18 +64,9 @@ local function preserve_contributor_author_timestamps(author) end end -local function contributor_information_sort_expression() - local created = "contributor.record::jsonb->>'createdAt'" - local zoned = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" - return "CASE WHEN jsonb_typeof(contributor.record::jsonb->'createdAt') = 'string' AND " .. created .. - " ~ '" .. zoned .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. - ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE " .. - "COALESCE(contributor.indexed_at::timestamptz, contributor.created_at::timestamptz) END" -end - local function query_contributor_information(authors, limit, cursor, direction) local where, values = { "contributor.collection = $1" }, { CONTRIBUTOR_INFORMATION_COLLECTION } - contributor_information_bind_in(where, values, "contributor.did", authors) + if authors then add_in(where, values, "contributor.did", authors) end if cursor then values[#values + 1] = cursor.t @@ -121,7 +80,7 @@ local function query_contributor_information(authors, limit, cursor, direction) values[#values + 1] = limit + 1 local ordering = direction == "asc" and "ASC" or "DESC" - local sort_key = contributor_information_sort_expression() + local sort_key = created_at_sort("contributor") local sql = "SELECT contributor.uri, contributor.did, contributor.cid, " .. "contributor.indexed_at::text AS indexed_at, contributor.record::text AS record, " .. "to_char(sorted.sort_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. diff --git a/happyview-modules/lua/src/listFeatures.lua b/happyview-modules/lua/src/listFeatures.lua index 23281b02..acec60ca 100644 --- a/happyview-modules/lua/src/listFeatures.lua +++ b/happyview-modules/lua/src/listFeatures.lua @@ -91,7 +91,7 @@ local function feature_cursor_decode(token, direction) for key in pairs(value) do if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end end - if not feature_valid_uri(value.u) or value.t:sub(1, 4) == "0000" or not valid_datetime(value.t) then + if not feature_valid_uri(value.u) or not valid_datetime(value.t) then invalid("cursor is malformed") end return value diff --git a/happyview-modules/lua/src/listMeasurements.lua b/happyview-modules/lua/src/listMeasurements.lua index 5f6143f1..d20be61b 100644 --- a/happyview-modules/lua/src/listMeasurements.lua +++ b/happyview-modules/lua/src/listMeasurements.lua @@ -51,45 +51,15 @@ local function bind_values(values, items) end local function decode_measurement_cursor(token, direction) - if token == nil then return nil end - if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then - invalid("cursor is malformed") - end - local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) - local ok, value = pcall(json.decode, decoded) - if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction - or type(value.t) ~= "string" or type(value.u) ~= "string" then - invalid("cursor is malformed or belongs to another sortDirection") - end - for key in pairs(value) do - if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end - end - local valid, collection = measurement_valid_record_uri(value.u) - -- PostgreSQL timestamptz has no year zero, so reject it before binding the cursor. - if value.t:sub(1, 4) == "0000" or not valid_datetime(value.t) or not valid or collection ~= MEASUREMENT then - invalid("cursor is malformed") - end - return value -end - -local function measurement_sort_expression() - local created = "measurement.record::jsonb->>'createdAt'" - local zoned = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" - return "CASE WHEN jsonb_typeof(measurement.record::jsonb->'createdAt') = 'string' AND " .. created .. - " ~ '" .. zoned .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. - ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE " .. - "COALESCE(measurement.indexed_at::timestamptz, measurement.created_at::timestamptz) END" + return decode_cursor(token, direction, function(value) + local valid, collection = measurement_valid_record_uri(value.u) + return valid_datetime(value.t) and valid and collection == MEASUREMENT + end) end local function measurement_list_query(authors, subjects, limit, cursor, direction) local where, values = { "measurement.collection = $1" }, { MEASUREMENT } - if authors then - if #authors == 0 then - where[#where + 1] = "FALSE" - else - where[#where + 1] = "measurement.did IN (" .. table.concat(bind_values(values, authors), ", ") .. ")" - end - end + if authors then add_in(where, values, "measurement.did", authors) end if subjects then if #subjects == 0 then where[#where + 1] = "FALSE" @@ -121,7 +91,7 @@ local function measurement_list_query(authors, subjects, limit, cursor, directio "measurement.indexed_at::text AS indexed_at, measurement.record::text AS record, " .. "to_char(sorted.sort_at AT TIME ZONE 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. "FROM happyview_records AS measurement CROSS JOIN LATERAL (SELECT " .. - measurement_sort_expression() .. " AS sort_at) AS sorted WHERE " .. table.concat(page_where, " AND ") .. + created_at_sort("measurement") .. " AS sort_at) AS sorted WHERE " .. table.concat(page_where, " AND ") .. " ORDER BY sorted.sort_at " .. ordering .. ", measurement.uri " .. ordering .. " LIMIT $" .. #page_values local rows = measurement_query(sql, page_values) diff --git a/happyview-modules/lua/src/listRights.lua b/happyview-modules/lua/src/listRights.lua index 811b7fb2..fdddd392 100644 --- a/happyview-modules/lua/src/listRights.lua +++ b/happyview-modules/lua/src/listRights.lua @@ -42,51 +42,16 @@ local function rights_list_array(value) end local function rights_list_cursor_decode(token, direction) - if token == nil then return nil end - if #token == 0 or #token > 8192 or #token % 2 ~= 0 or token:find("[^0-9a-f]") then - invalid("cursor is malformed") - end - local decoded = token:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end) - local ok, value = pcall(json.decode, decoded) - if not ok or type(value) ~= "table" or value.v ~= 1 or value.d ~= direction - or type(value.t) ~= "string" or type(value.u) ~= "string" then - invalid("cursor is malformed or belongs to another sortDirection") - end - for key in pairs(value) do - if key ~= "v" and key ~= "d" and key ~= "t" and key ~= "u" then invalid("cursor is malformed") end - end - local valid, collection = rights_valid_record_uri(value.u) - local year = tonumber(value.t:sub(1, 4)) - if not valid_datetime(value.t) or not year or year < 1 or not valid or collection ~= RIGHTS then - invalid("cursor is malformed") - end - return value -end - -local function rights_sort_expression() - local created = "rights.record::jsonb->>'createdAt'" - local zoned = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$" - return "CASE WHEN jsonb_typeof(rights.record::jsonb->'createdAt') = 'string' AND " .. created .. - " ~ '" .. zoned .. "' AND " .. created .. " !~ '-00:00$' AND pg_input_is_valid(" .. created .. - ", 'timestamptz') THEN (" .. created .. ")::timestamptz ELSE " .. - "COALESCE(rights.indexed_at::timestamptz, rights.created_at::timestamptz) END" + return decode_cursor(token, direction, function(value) + local valid, collection = rights_valid_record_uri(value.u) + return valid_datetime(value.t) and valid and collection == RIGHTS + end) end local function rights_list_query(authors, limit, cursor, direction) local where, values = { "rights.collection = $1" }, { RIGHTS } - if authors then - if #authors == 0 then - where[#where + 1] = "FALSE" - else - local marks = {} - for _, did in ipairs(authors) do - values[#values + 1] = did - marks[#marks + 1] = "$" .. #values - end - where[#where + 1] = "rights.did IN (" .. table.concat(marks, ", ") .. ")" - end - end + if authors then add_in(where, values, "rights.did", authors) end if cursor then values[#values + 1] = cursor.t @@ -102,7 +67,7 @@ local function rights_list_query(authors, limit, cursor, direction) local sql = "SELECT rights.uri, rights.did, rights.cid, rights.indexed_at::text AS indexed_at, " .. "rights.record::text AS record, to_char(sorted.sort_at AT TIME ZONE 'UTC', " .. "'YYYY-MM-DD\"T\"HH24:MI:SS.US\"Z\"') AS sort_timestamp " .. - "FROM happyview_records AS rights CROSS JOIN LATERAL (SELECT " .. rights_sort_expression() .. " AS sort_at) AS sorted " .. + "FROM happyview_records AS rights CROSS JOIN LATERAL (SELECT " .. created_at_sort("rights") .. " AS sort_at) AS sorted " .. "WHERE " .. table.concat(where, " AND ") .. " ORDER BY sorted.sort_at " .. ordering .. ", rights.uri " .. ordering .. " LIMIT $" .. #values local rows = rights_list_run_query(sql, values) diff --git a/happyview-modules/lua/src/listVocabTags.lua b/happyview-modules/lua/src/listVocabTags.lua index 8a670da3..287cac96 100644 --- a/happyview-modules/lua/src/listVocabTags.lua +++ b/happyview-modules/lua/src/listVocabTags.lua @@ -72,7 +72,6 @@ local function decode_cursor(token, direction, authors) end end if not valid_datetime(value.t) then invalid("cursor is malformed") end - if value.t:sub(1, 4) == "0000" then invalid("cursor timestamp year must be greater than 0000") end if not valid_vocab_tag_uri(value.u) then invalid("cursor is malformed") end return value end diff --git a/happyview-modules/modules/acknowledgements/manifest.json b/happyview-modules/modules/acknowledgements/manifest.json index 4ae64fd3..0e965ee9 100644 --- a/happyview-modules/modules/acknowledgements/manifest.json +++ b/happyview-modules/modules/acknowledgements/manifest.json @@ -68,6 +68,9 @@ "../../lua/shared/listValidation.lua", "../../lua/shared/acknowledgement.lua", "../../lua/shared/nsidValidation.lua", + "../../lua/shared/listQuery.lua", + "../../lua/shared/listCursor.lua", + "../../lua/shared/listWhere.lua", "../../lua/shared/acknowledgementList.lua" ], "config": { diff --git a/happyview-modules/modules/context-measurements/manifest.json b/happyview-modules/modules/context-measurements/manifest.json index 99a5e3b7..20704d1c 100644 --- a/happyview-modules/modules/context-measurements/manifest.json +++ b/happyview-modules/modules/context-measurements/manifest.json @@ -54,7 +54,10 @@ "../../lua/shared/recordView.lua", "../../lua/shared/actorView.lua", "../../lua/shared/measurementQuery.lua", - "../../lua/shared/nsidValidation.lua" + "../../lua/shared/nsidValidation.lua", + "../../lua/shared/listCursor.lua", + "../../lua/shared/listWhere.lua", + "../../lua/shared/createdAtSort.lua" ], "config": { "script_type": "lua" diff --git a/happyview-modules/modules/contribution/manifest.json b/happyview-modules/modules/contribution/manifest.json index ebf4e040..5d650240 100644 --- a/happyview-modules/modules/contribution/manifest.json +++ b/happyview-modules/modules/contribution/manifest.json @@ -44,7 +44,9 @@ "../../lua/shared/listQuery.lua", "../../lua/shared/recordView.lua", "../../lua/shared/actorView.lua", - "../../lua/shared/contribution.lua" + "../../lua/shared/contribution.lua", + "../../lua/shared/listCursor.lua", + "../../lua/shared/listWhere.lua" ], "config": { "script_type": "lua" }, "dependsOn": ["org.hypercerts.claim.listContributions"] diff --git a/happyview-modules/modules/contributor-information/manifest.json b/happyview-modules/modules/contributor-information/manifest.json index 6f25e619..9ad5d784 100644 --- a/happyview-modules/modules/contributor-information/manifest.json +++ b/happyview-modules/modules/contributor-information/manifest.json @@ -57,7 +57,10 @@ "../../lua/shared/actorView.lua", "../../lua/shared/datetimeValidation.lua", "../../lua/shared/listValidation.lua", - "../../lua/shared/listQuery.lua" + "../../lua/shared/listQuery.lua", + "../../lua/shared/listCursor.lua", + "../../lua/shared/listWhere.lua", + "../../lua/shared/createdAtSort.lua" ], "config": { "script_type": "lua", diff --git a/happyview-modules/modules/rights/manifest.json b/happyview-modules/modules/rights/manifest.json index 82d77df5..fa6d52cd 100644 --- a/happyview-modules/modules/rights/manifest.json +++ b/happyview-modules/modules/rights/manifest.json @@ -46,7 +46,10 @@ "../../lua/shared/rightsView.lua", "../../lua/shared/datetimeValidation.lua", "../../lua/shared/listValidation.lua", - "../../lua/shared/listQuery.lua" + "../../lua/shared/listQuery.lua", + "../../lua/shared/listCursor.lua", + "../../lua/shared/listWhere.lua", + "../../lua/shared/createdAtSort.lua" ], "config": { "script_type": "lua", "description": "List rights records" }, "dependsOn": ["org.hypercerts.claim.listRights"] diff --git a/happyview-modules/modules/workscope-tags/manifest.json b/happyview-modules/modules/workscope-tags/manifest.json index d24cbb93..119e56ee 100644 --- a/happyview-modules/modules/workscope-tags/manifest.json +++ b/happyview-modules/modules/workscope-tags/manifest.json @@ -54,6 +54,8 @@ "../../lua/shared/workscopeRecordView.lua", "../../lua/shared/actorView.lua", "../../lua/shared/workscopeTag.lua", + "../../lua/shared/listCursor.lua", + "../../lua/shared/listWhere.lua", "../../lua/shared/workscopeTagList.lua" ], "config": { diff --git a/happyview-modules/tests/unit/endpoints/rights-edge-lua.test.js b/happyview-modules/tests/unit/endpoints/rights-edge-lua.test.js index 0f2cf90d..baabaff7 100644 --- a/happyview-modules/tests/unit/endpoints/rights-edge-lua.test.js +++ b/happyview-modules/tests/unit/endpoints/rights-edge-lua.test.js @@ -22,6 +22,9 @@ async function endpointSources(name) { "lua/shared/datetimeValidation.lua", "lua/shared/listValidation.lua", "lua/shared/listQuery.lua", + "lua/shared/listCursor.lua", + "lua/shared/listWhere.lua", + "lua/shared/createdAtSort.lua", ); return Promise.all([...shared, `lua/src/${name}.lua`].map(read)); } diff --git a/happyview-modules/tests/unit/endpoints/rights-lua.test.js b/happyview-modules/tests/unit/endpoints/rights-lua.test.js index 9ec711de..92e00aff 100644 --- a/happyview-modules/tests/unit/endpoints/rights-lua.test.js +++ b/happyview-modules/tests/unit/endpoints/rights-lua.test.js @@ -106,6 +106,9 @@ async function listRightsSources() { read("lua/shared/datetimeValidation.lua"), read("lua/shared/listValidation.lua"), read("lua/shared/listQuery.lua"), + read("lua/shared/listCursor.lua"), + read("lua/shared/listWhere.lua"), + read("lua/shared/createdAtSort.lua"), read("lua/src/listRights.lua"), ]); } diff --git a/happyview-modules/tests/unit/list-golden/list-endpoints.golden.jsonl b/happyview-modules/tests/unit/list-golden/list-endpoints.golden.jsonl index e7e400dd..38f10a52 100644 --- a/happyview-modules/tests/unit/list-golden/list-endpoints.golden.jsonl +++ b/happyview-modules/tests/unit/list-golden/list-endpoints.golden.jsonl @@ -310,12 +310,12 @@ {"endpoint":"app.certified.actor.listOrganizations","case":"paged:desc","calls":[{"binds":["app.certified.actor.organization",3],"sql":"22e0220699"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"},{"binds":["app.certified.location","at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.location/3klocation2","at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.location/3klocation1"],"sql":"598df7d2c2"}],"outcome":{"result":{"actors":[{"did":"did:plc:abcdefghijklmnopqrstuvwz","location":null,"organization":{"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.actor.organization","createdAt":"2025-01-03T00:00:00Z","location":{"cid":"bafylocation2","uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.location/3klocation2"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.actor.organization/self"},"profile":null},{"did":"did:plc:abcdefghijklmnopqrstuvwy","location":null,"organization":{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.actor.organization","createdAt":"2025-01-02T00:00:00Z","location":{"cid":"bafylocation1","uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.location/3klocation1"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.actor.organization/self"},"profile":null}],"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e6163746f722e6f7267616e697a6174696f6e2f73656c66222c2276223a317d"}}} {"endpoint":"app.certified.actor.listOrganizations","case":"cursor:valid:desc","calls":[{"binds":["app.certified.actor.organization","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.organization/self",26],"sql":"46a96a9b3e"}],"outcome":{"result":{"actors":[]}}} {"endpoint":"app.certified.actor.listOrganizations","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.actor.organization","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.organization/self",8],"sql":"46a96a9b3e"}],"outcome":{"result":{"actors":[]}}} -{"endpoint":"app.certified.actor.listOrganizations","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.actor.organization","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.organization/self",26],"sql":"46a96a9b3e"}],"outcome":{"result":{"actors":[]}}} +{"endpoint":"app.certified.actor.listOrganizations","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.actor.listOrganizations","case":"sort=asc","calls":[{"binds":["app.certified.actor.organization",26],"sql":"a5a8ed742f"}],"outcome":{"result":{"actors":[]}}} {"endpoint":"app.certified.actor.listOrganizations","case":"paged:asc","calls":[{"binds":["app.certified.actor.organization",3],"sql":"a5a8ed742f"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"},{"binds":["app.certified.location","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.location/3klocation0","at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.location/3klocation1"],"sql":"598df7d2c2"}],"outcome":{"result":{"actors":[{"did":"did:plc:abcdefghijklmnopqrstuvwx","location":null,"organization":{"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.actor.organization","createdAt":"2025-01-01T00:00:00Z","location":{"cid":"bafylocation0","uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.location/3klocation0"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.organization/self"},"profile":null},{"did":"did:plc:abcdefghijklmnopqrstuvwy","location":null,"organization":{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.actor.organization","createdAt":"2025-01-02T00:00:00Z","location":{"cid":"bafylocation1","uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.location/3klocation1"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.actor.organization/self"},"profile":null}],"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e6163746f722e6f7267616e697a6174696f6e2f73656c66222c2276223a317d"}}} {"endpoint":"app.certified.actor.listOrganizations","case":"cursor:valid:asc","calls":[{"binds":["app.certified.actor.organization","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.organization/self",26],"sql":"fd0f96ef32"}],"outcome":{"result":{"actors":[]}}} {"endpoint":"app.certified.actor.listOrganizations","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.actor.organization","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.organization/self",8],"sql":"fd0f96ef32"}],"outcome":{"result":{"actors":[]}}} -{"endpoint":"app.certified.actor.listOrganizations","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.actor.organization","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.organization/self",26],"sql":"fd0f96ef32"}],"outcome":{"result":{"actors":[]}}} +{"endpoint":"app.certified.actor.listOrganizations","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.actor.listOrganizations","case":"filter:organizationTypes:many","calls":[{"binds":["app.certified.actor.organization","nonprofit","company","dao",26],"sql":"74bec3e87a"}],"outcome":{"result":{"actors":[]}}} {"endpoint":"app.certified.actor.listOrganizations","case":"filter:organizationTypes:one","calls":[{"binds":["app.certified.actor.organization","nonprofit",26],"sql":"bec466bdba"}],"outcome":{"result":{"actors":[]}}} {"endpoint":"app.certified.actor.listOrganizations","case":"filter:organizationTypes:one-scalar","calls":[{"binds":["app.certified.actor.organization","nonprofit",26],"sql":"bec466bdba"}],"outcome":{"result":{"actors":[]}}} @@ -428,12 +428,12 @@ {"endpoint":"app.certified.actor.listProfiles","case":"paged:desc","calls":[{"binds":["app.certified.actor.profile",3],"sql":"259d5b6011"}],"outcome":{"result":{"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e6163746f722e70726f66696c652f73656c66222c2276223a317d","profiles":[{"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.actor.profile","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.actor.profile/self"},{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.actor.profile","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.actor.profile/self"}]}}} {"endpoint":"app.certified.actor.listProfiles","case":"cursor:valid:desc","calls":[{"binds":["app.certified.actor.profile","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.profile/self",26],"sql":"9e6090d8e4"}],"outcome":{"result":{"profiles":[]}}} {"endpoint":"app.certified.actor.listProfiles","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.actor.profile","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.profile/self",8],"sql":"9e6090d8e4"}],"outcome":{"result":{"profiles":[]}}} -{"endpoint":"app.certified.actor.listProfiles","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.actor.profile","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.profile/self",26],"sql":"9e6090d8e4"}],"outcome":{"result":{"profiles":[]}}} +{"endpoint":"app.certified.actor.listProfiles","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.actor.listProfiles","case":"sort=asc","calls":[{"binds":["app.certified.actor.profile",26],"sql":"d05b037b0c"}],"outcome":{"result":{"profiles":[]}}} {"endpoint":"app.certified.actor.listProfiles","case":"paged:asc","calls":[{"binds":["app.certified.actor.profile",3],"sql":"d05b037b0c"}],"outcome":{"result":{"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e6163746f722e70726f66696c652f73656c66222c2276223a317d","profiles":[{"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.actor.profile","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.profile/self"},{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.actor.profile","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.actor.profile/self"}]}}} {"endpoint":"app.certified.actor.listProfiles","case":"cursor:valid:asc","calls":[{"binds":["app.certified.actor.profile","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.profile/self",26],"sql":"536c6066fd"}],"outcome":{"result":{"profiles":[]}}} {"endpoint":"app.certified.actor.listProfiles","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.actor.profile","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.profile/self",8],"sql":"536c6066fd"}],"outcome":{"result":{"profiles":[]}}} -{"endpoint":"app.certified.actor.listProfiles","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.actor.profile","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.profile/self",26],"sql":"536c6066fd"}],"outcome":{"result":{"profiles":[]}}} +{"endpoint":"app.certified.actor.listProfiles","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.actor.listProfiles","case":"error:sortDirection=bad","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.actor.listProfiles","case":"error:sortDirection=ASC","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.actor.listProfiles","case":"error:sortDirection=empty","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} @@ -537,12 +537,12 @@ {"endpoint":"app.certified.actor.searchOrganizations","case":"paged:desc","calls":[{"binds":["app.certified.actor.organization","test","app.certified.actor.profile",3],"sql":"0af04d2949"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"},{"binds":["app.certified.location","at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.location/3klocation2","at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.location/3klocation1"],"sql":"598df7d2c2"}],"outcome":{"result":{"actors":[{"did":"did:plc:abcdefghijklmnopqrstuvwz","location":null,"organization":{"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.actor.organization","createdAt":"2025-01-03T00:00:00Z","location":{"cid":"bafylocation2","uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.location/3klocation2"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.actor.organization/self"},"profile":null},{"did":"did:plc:abcdefghijklmnopqrstuvwy","location":null,"organization":{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.actor.organization","createdAt":"2025-01-02T00:00:00Z","location":{"cid":"bafylocation1","uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.location/3klocation1"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.actor.organization/self"},"profile":null}],"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e6163746f722e6f7267616e697a6174696f6e2f73656c66222c2276223a317d"}}} {"endpoint":"app.certified.actor.searchOrganizations","case":"cursor:valid:desc","calls":[{"binds":["app.certified.actor.organization","test","app.certified.actor.profile","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.organization/self",26],"sql":"ba980873dd"}],"outcome":{"result":{"actors":[]}}} {"endpoint":"app.certified.actor.searchOrganizations","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.actor.organization","test","app.certified.actor.profile","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.organization/self",8],"sql":"ba980873dd"}],"outcome":{"result":{"actors":[]}}} -{"endpoint":"app.certified.actor.searchOrganizations","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.actor.organization","test","app.certified.actor.profile","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.organization/self",26],"sql":"ba980873dd"}],"outcome":{"result":{"actors":[]}}} +{"endpoint":"app.certified.actor.searchOrganizations","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.actor.searchOrganizations","case":"sort=asc","calls":[{"binds":["app.certified.actor.organization","test","app.certified.actor.profile",26],"sql":"196724248c"}],"outcome":{"result":{"actors":[]}}} {"endpoint":"app.certified.actor.searchOrganizations","case":"paged:asc","calls":[{"binds":["app.certified.actor.organization","test","app.certified.actor.profile",3],"sql":"196724248c"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"},{"binds":["app.certified.location","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.location/3klocation0","at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.location/3klocation1"],"sql":"598df7d2c2"}],"outcome":{"result":{"actors":[{"did":"did:plc:abcdefghijklmnopqrstuvwx","location":null,"organization":{"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.actor.organization","createdAt":"2025-01-01T00:00:00Z","location":{"cid":"bafylocation0","uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.location/3klocation0"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.organization/self"},"profile":null},{"did":"did:plc:abcdefghijklmnopqrstuvwy","location":null,"organization":{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.actor.organization","createdAt":"2025-01-02T00:00:00Z","location":{"cid":"bafylocation1","uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.location/3klocation1"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.actor.organization/self"},"profile":null}],"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e6163746f722e6f7267616e697a6174696f6e2f73656c66222c2276223a317d"}}} {"endpoint":"app.certified.actor.searchOrganizations","case":"cursor:valid:asc","calls":[{"binds":["app.certified.actor.organization","test","app.certified.actor.profile","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.organization/self",26],"sql":"aed3d6f7c0"}],"outcome":{"result":{"actors":[]}}} {"endpoint":"app.certified.actor.searchOrganizations","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.actor.organization","test","app.certified.actor.profile","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.organization/self",8],"sql":"aed3d6f7c0"}],"outcome":{"result":{"actors":[]}}} -{"endpoint":"app.certified.actor.searchOrganizations","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.actor.organization","test","app.certified.actor.profile","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.organization/self",26],"sql":"aed3d6f7c0"}],"outcome":{"result":{"actors":[]}}} +{"endpoint":"app.certified.actor.searchOrganizations","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.actor.searchOrganizations","case":"filter:actors:many","calls":[{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy","did:plc:abcdefghijklmnopqrstuvwz","test","app.certified.actor.profile",26],"sql":"63e9f57c41"}],"outcome":{"result":{"actors":[]}}} {"endpoint":"app.certified.actor.searchOrganizations","case":"filter:actors:one","calls":[{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","test","app.certified.actor.profile",26],"sql":"51a1308039"}],"outcome":{"result":{"actors":[]}}} {"endpoint":"app.certified.actor.searchOrganizations","case":"filter:actors:one-scalar","calls":[{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","test","app.certified.actor.profile",26],"sql":"51a1308039"}],"outcome":{"result":{"actors":[]}}} @@ -660,12 +660,12 @@ {"endpoint":"app.certified.actor.searchProfiles","case":"paged:desc","calls":[{"binds":["app.certified.actor.profile","test",3],"sql":"238b55a03a"}],"outcome":{"result":{"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e6163746f722e70726f66696c652f73656c66222c2276223a317d","profiles":[{"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.actor.profile","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.actor.profile/self"},{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.actor.profile","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.actor.profile/self"}]}}} {"endpoint":"app.certified.actor.searchProfiles","case":"cursor:valid:desc","calls":[{"binds":["app.certified.actor.profile","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.profile/self",26],"sql":"142fb30cf8"}],"outcome":{"result":{"profiles":[]}}} {"endpoint":"app.certified.actor.searchProfiles","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.actor.profile","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.profile/self",8],"sql":"142fb30cf8"}],"outcome":{"result":{"profiles":[]}}} -{"endpoint":"app.certified.actor.searchProfiles","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.actor.profile","test","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.profile/self",26],"sql":"142fb30cf8"}],"outcome":{"result":{"profiles":[]}}} +{"endpoint":"app.certified.actor.searchProfiles","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.actor.searchProfiles","case":"sort=asc","calls":[{"binds":["app.certified.actor.profile","test",26],"sql":"f1591fc881"}],"outcome":{"result":{"profiles":[]}}} {"endpoint":"app.certified.actor.searchProfiles","case":"paged:asc","calls":[{"binds":["app.certified.actor.profile","test",3],"sql":"f1591fc881"}],"outcome":{"result":{"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e6163746f722e70726f66696c652f73656c66222c2276223a317d","profiles":[{"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.actor.profile","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.profile/self"},{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.actor.profile","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.actor.profile/self"}]}}} {"endpoint":"app.certified.actor.searchProfiles","case":"cursor:valid:asc","calls":[{"binds":["app.certified.actor.profile","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.profile/self",26],"sql":"2cd52c5f03"}],"outcome":{"result":{"profiles":[]}}} {"endpoint":"app.certified.actor.searchProfiles","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.actor.profile","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.profile/self",8],"sql":"2cd52c5f03"}],"outcome":{"result":{"profiles":[]}}} -{"endpoint":"app.certified.actor.searchProfiles","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.actor.profile","test","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.actor.profile/self",26],"sql":"2cd52c5f03"}],"outcome":{"result":{"profiles":[]}}} +{"endpoint":"app.certified.actor.searchProfiles","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.actor.searchProfiles","case":"filter:actors:many","calls":[{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy","did:plc:abcdefghijklmnopqrstuvwz","test",26],"sql":"921d3f3c56"}],"outcome":{"result":{"profiles":[]}}} {"endpoint":"app.certified.actor.searchProfiles","case":"filter:actors:one","calls":[{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","test",26],"sql":"a4a6ef4bdf"}],"outcome":{"result":{"profiles":[]}}} {"endpoint":"app.certified.actor.searchProfiles","case":"filter:actors:one-scalar","calls":[{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","test",26],"sql":"a4a6ef4bdf"}],"outcome":{"result":{"profiles":[]}}} @@ -774,12 +774,12 @@ {"endpoint":"app.certified.badge.listBadgeAwards","case":"paged:desc","calls":[{"binds":["app.certified.badge.award",3],"sql":"eb4293ef0a"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"badgeAwards":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null},"badge":null,"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","recipientResponse":null,"record":{"$type":"app.certified.badge.award","createdAt":"2025-01-03T00:00:00Z"},"responseStatus":"unanswered","uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.badge.award/3kabcdefghijc"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"badge":null,"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","recipientResponse":null,"record":{"$type":"app.certified.badge.award","createdAt":"2025-01-02T00:00:00Z"},"responseStatus":"unanswered","uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.badge.award/3kabcdefghijb"}],"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e62616467652e61776172642f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"app.certified.badge.listBadgeAwards","case":"cursor:valid:desc","calls":[{"binds":["app.certified.badge.award","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.award/3kabcdefghijk",26],"sql":"5c69857418"}],"outcome":{"result":{"badgeAwards":[]}}} {"endpoint":"app.certified.badge.listBadgeAwards","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.badge.award","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.award/3kabcdefghijk",8],"sql":"5c69857418"}],"outcome":{"result":{"badgeAwards":[]}}} -{"endpoint":"app.certified.badge.listBadgeAwards","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.badge.award","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.award/3kabcdefghijk",26],"sql":"5c69857418"}],"outcome":{"result":{"badgeAwards":[]}}} +{"endpoint":"app.certified.badge.listBadgeAwards","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.badge.listBadgeAwards","case":"sort=asc","calls":[{"binds":["app.certified.badge.award",26],"sql":"70f00b7198"}],"outcome":{"result":{"badgeAwards":[]}}} {"endpoint":"app.certified.badge.listBadgeAwards","case":"paged:asc","calls":[{"binds":["app.certified.badge.award",3],"sql":"70f00b7198"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"badgeAwards":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwx","organization":null,"profile":null},"badge":null,"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","recipientResponse":null,"record":{"$type":"app.certified.badge.award","createdAt":"2025-01-01T00:00:00Z"},"responseStatus":"unanswered","uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.award/3kabcdefghija"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"badge":null,"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","recipientResponse":null,"record":{"$type":"app.certified.badge.award","createdAt":"2025-01-02T00:00:00Z"},"responseStatus":"unanswered","uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.badge.award/3kabcdefghijb"}],"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e62616467652e61776172642f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"app.certified.badge.listBadgeAwards","case":"cursor:valid:asc","calls":[{"binds":["app.certified.badge.award","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.award/3kabcdefghijk",26],"sql":"6d1dd77a51"}],"outcome":{"result":{"badgeAwards":[]}}} {"endpoint":"app.certified.badge.listBadgeAwards","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.badge.award","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.award/3kabcdefghijk",8],"sql":"6d1dd77a51"}],"outcome":{"result":{"badgeAwards":[]}}} -{"endpoint":"app.certified.badge.listBadgeAwards","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.badge.award","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.award/3kabcdefghijk",26],"sql":"6d1dd77a51"}],"outcome":{"result":{"badgeAwards":[]}}} +{"endpoint":"app.certified.badge.listBadgeAwards","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.badge.listBadgeAwards","case":"paged:includeTotal","calls":[{"binds":["app.certified.badge.award",3],"sql":"3dfa9c7309"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"badgeAwards":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null},"badge":null,"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","recipientResponse":null,"record":{"$type":"app.certified.badge.award","createdAt":"2025-01-03T00:00:00Z"},"responseStatus":"unanswered","uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.badge.award/3kabcdefghijc"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"badge":null,"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","recipientResponse":null,"record":{"$type":"app.certified.badge.award","createdAt":"2025-01-02T00:00:00Z"},"responseStatus":"unanswered","uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.badge.award/3kabcdefghijb"}],"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e62616467652e61776172642f336b6162636465666768696a62222c2276223a317d","totalCount":12}}} {"endpoint":"app.certified.badge.listBadgeAwards","case":"filter:authors:many","calls":[{"binds":["app.certified.badge.award","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy","did:plc:abcdefghijklmnopqrstuvwz",26],"sql":"b64d798d72"}],"outcome":{"result":{"badgeAwards":[]}}} {"endpoint":"app.certified.badge.listBadgeAwards","case":"filter:authors:one","calls":[{"binds":["app.certified.badge.award","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"03c5ffce2b"}],"outcome":{"result":{"badgeAwards":[]}}} @@ -914,12 +914,12 @@ {"endpoint":"app.certified.badge.listBadgeDefinitions","case":"paged:desc","calls":[{"binds":["app.certified.badge.definition",3],"sql":"fdd374e87e"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"badgeDefinitions":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null},"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.badge.definition","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.badge.definition/3kabcdefghijc"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.badge.definition","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.badge.definition/3kabcdefghijb"}],"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e62616467652e646566696e6974696f6e2f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"app.certified.badge.listBadgeDefinitions","case":"cursor:valid:desc","calls":[{"binds":["app.certified.badge.definition","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.definition/3kabcdefghijk",26],"sql":"2712d7dd78"}],"outcome":{"result":{"badgeDefinitions":[]}}} {"endpoint":"app.certified.badge.listBadgeDefinitions","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.badge.definition","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.definition/3kabcdefghijk",8],"sql":"2712d7dd78"}],"outcome":{"result":{"badgeDefinitions":[]}}} -{"endpoint":"app.certified.badge.listBadgeDefinitions","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.badge.definition","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.definition/3kabcdefghijk",26],"sql":"2712d7dd78"}],"outcome":{"result":{"badgeDefinitions":[]}}} +{"endpoint":"app.certified.badge.listBadgeDefinitions","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.badge.listBadgeDefinitions","case":"sort=asc","calls":[{"binds":["app.certified.badge.definition",26],"sql":"fbade26882"}],"outcome":{"result":{"badgeDefinitions":[]}}} {"endpoint":"app.certified.badge.listBadgeDefinitions","case":"paged:asc","calls":[{"binds":["app.certified.badge.definition",3],"sql":"fbade26882"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"badgeDefinitions":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwx","organization":null,"profile":null},"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.badge.definition","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.definition/3kabcdefghija"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.badge.definition","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.badge.definition/3kabcdefghijb"}],"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e62616467652e646566696e6974696f6e2f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"app.certified.badge.listBadgeDefinitions","case":"cursor:valid:asc","calls":[{"binds":["app.certified.badge.definition","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.definition/3kabcdefghijk",26],"sql":"f415ca0b71"}],"outcome":{"result":{"badgeDefinitions":[]}}} {"endpoint":"app.certified.badge.listBadgeDefinitions","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.badge.definition","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.definition/3kabcdefghijk",8],"sql":"f415ca0b71"}],"outcome":{"result":{"badgeDefinitions":[]}}} -{"endpoint":"app.certified.badge.listBadgeDefinitions","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.badge.definition","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.definition/3kabcdefghijk",26],"sql":"f415ca0b71"}],"outcome":{"result":{"badgeDefinitions":[]}}} +{"endpoint":"app.certified.badge.listBadgeDefinitions","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.badge.listBadgeDefinitions","case":"filter:authors:many","calls":[{"binds":["app.certified.badge.definition","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy","did:plc:abcdefghijklmnopqrstuvwz",26],"sql":"056193581d"}],"outcome":{"result":{"badgeDefinitions":[]}}} {"endpoint":"app.certified.badge.listBadgeDefinitions","case":"filter:authors:one","calls":[{"binds":["app.certified.badge.definition","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"cf715d2ab7"}],"outcome":{"result":{"badgeDefinitions":[]}}} {"endpoint":"app.certified.badge.listBadgeDefinitions","case":"filter:authors:one-scalar","calls":[{"binds":["app.certified.badge.definition","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"cf715d2ab7"}],"outcome":{"result":{"badgeDefinitions":[]}}} @@ -1033,12 +1033,12 @@ {"endpoint":"app.certified.badge.listBadgeResponses","case":"paged:desc","calls":[{"binds":["app.certified.badge.response",3],"sql":"c165186104"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"badgeResponses":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null},"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.badge.response","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.badge.response/3kabcdefghijc"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.badge.response","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.badge.response/3kabcdefghijb"}],"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e62616467652e726573706f6e73652f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"app.certified.badge.listBadgeResponses","case":"cursor:valid:desc","calls":[{"binds":["app.certified.badge.response","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.response/3kabcdefghijk",26],"sql":"bf4fe3b608"}],"outcome":{"result":{"badgeResponses":[]}}} {"endpoint":"app.certified.badge.listBadgeResponses","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.badge.response","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.response/3kabcdefghijk",8],"sql":"bf4fe3b608"}],"outcome":{"result":{"badgeResponses":[]}}} -{"endpoint":"app.certified.badge.listBadgeResponses","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.badge.response","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.response/3kabcdefghijk",26],"sql":"bf4fe3b608"}],"outcome":{"result":{"badgeResponses":[]}}} +{"endpoint":"app.certified.badge.listBadgeResponses","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.badge.listBadgeResponses","case":"sort=asc","calls":[{"binds":["app.certified.badge.response",26],"sql":"b2723dc542"}],"outcome":{"result":{"badgeResponses":[]}}} {"endpoint":"app.certified.badge.listBadgeResponses","case":"paged:asc","calls":[{"binds":["app.certified.badge.response",3],"sql":"b2723dc542"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"badgeResponses":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwx","organization":null,"profile":null},"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.badge.response","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.response/3kabcdefghija"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.badge.response","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.badge.response/3kabcdefghijb"}],"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e62616467652e726573706f6e73652f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"app.certified.badge.listBadgeResponses","case":"cursor:valid:asc","calls":[{"binds":["app.certified.badge.response","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.response/3kabcdefghijk",26],"sql":"22bccf85c3"}],"outcome":{"result":{"badgeResponses":[]}}} {"endpoint":"app.certified.badge.listBadgeResponses","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.badge.response","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.response/3kabcdefghijk",8],"sql":"22bccf85c3"}],"outcome":{"result":{"badgeResponses":[]}}} -{"endpoint":"app.certified.badge.listBadgeResponses","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.badge.response","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.response/3kabcdefghijk",26],"sql":"22bccf85c3"}],"outcome":{"result":{"badgeResponses":[]}}} +{"endpoint":"app.certified.badge.listBadgeResponses","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.badge.listBadgeResponses","case":"filter:badgeAward=at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.award/3kabcdefghija","calls":[{"binds":["app.certified.badge.response","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.award/3kabcdefghija",26],"sql":"dd9a4311b1"}],"outcome":{"result":{"badgeResponses":[]}}} {"endpoint":"app.certified.badge.listBadgeResponses","case":"filter:badgeAward=at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.award/3kabcdefghijb","calls":[{"binds":["app.certified.badge.response","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.award/3kabcdefghijb",26],"sql":"dd9a4311b1"}],"outcome":{"result":{"badgeResponses":[]}}} {"endpoint":"app.certified.badge.listBadgeResponses","case":"filter:badgeAward=at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.award/3kabcdefghijc","calls":[{"binds":["app.certified.badge.response","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.award/3kabcdefghijc",26],"sql":"dd9a4311b1"}],"outcome":{"result":{"badgeResponses":[]}}} @@ -1144,12 +1144,12 @@ {"endpoint":"app.certified.badge.searchBadgeDefinitions","case":"paged:desc","calls":[{"binds":["app.certified.badge.definition","test",3],"sql":"4ce821995f"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"badgeDefinitions":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null},"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.badge.definition","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.badge.definition/3kabcdefghijc"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.badge.definition","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.badge.definition/3kabcdefghijb"}],"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e62616467652e646566696e6974696f6e2f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"app.certified.badge.searchBadgeDefinitions","case":"cursor:valid:desc","calls":[{"binds":["app.certified.badge.definition","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.definition/3kabcdefghijk",26],"sql":"9a5987f560"}],"outcome":{"result":{"badgeDefinitions":[]}}} {"endpoint":"app.certified.badge.searchBadgeDefinitions","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.badge.definition","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.definition/3kabcdefghijk",8],"sql":"9a5987f560"}],"outcome":{"result":{"badgeDefinitions":[]}}} -{"endpoint":"app.certified.badge.searchBadgeDefinitions","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.badge.definition","test","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.definition/3kabcdefghijk",26],"sql":"9a5987f560"}],"outcome":{"result":{"badgeDefinitions":[]}}} +{"endpoint":"app.certified.badge.searchBadgeDefinitions","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.badge.searchBadgeDefinitions","case":"sort=asc","calls":[{"binds":["app.certified.badge.definition","test",26],"sql":"e010df8163"}],"outcome":{"result":{"badgeDefinitions":[]}}} {"endpoint":"app.certified.badge.searchBadgeDefinitions","case":"paged:asc","calls":[{"binds":["app.certified.badge.definition","test",3],"sql":"e010df8163"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"badgeDefinitions":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwx","organization":null,"profile":null},"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.badge.definition","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.definition/3kabcdefghija"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.badge.definition","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.badge.definition/3kabcdefghijb"}],"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e62616467652e646566696e6974696f6e2f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"app.certified.badge.searchBadgeDefinitions","case":"cursor:valid:asc","calls":[{"binds":["app.certified.badge.definition","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.definition/3kabcdefghijk",26],"sql":"2bb21188b6"}],"outcome":{"result":{"badgeDefinitions":[]}}} {"endpoint":"app.certified.badge.searchBadgeDefinitions","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.badge.definition","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.definition/3kabcdefghijk",8],"sql":"2bb21188b6"}],"outcome":{"result":{"badgeDefinitions":[]}}} -{"endpoint":"app.certified.badge.searchBadgeDefinitions","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.badge.definition","test","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.badge.definition/3kabcdefghijk",26],"sql":"2bb21188b6"}],"outcome":{"result":{"badgeDefinitions":[]}}} +{"endpoint":"app.certified.badge.searchBadgeDefinitions","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.badge.searchBadgeDefinitions","case":"filter:authors:many","calls":[{"binds":["app.certified.badge.definition","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy","did:plc:abcdefghijklmnopqrstuvwz","test",26],"sql":"e956f87416"}],"outcome":{"result":{"badgeDefinitions":[]}}} {"endpoint":"app.certified.badge.searchBadgeDefinitions","case":"filter:authors:one","calls":[{"binds":["app.certified.badge.definition","did:plc:abcdefghijklmnopqrstuvwx","test",26],"sql":"7705bb084a"}],"outcome":{"result":{"badgeDefinitions":[]}}} {"endpoint":"app.certified.badge.searchBadgeDefinitions","case":"filter:authors:one-scalar","calls":[{"binds":["app.certified.badge.definition","did:plc:abcdefghijklmnopqrstuvwx","test",26],"sql":"7705bb084a"}],"outcome":{"result":{"badgeDefinitions":[]}}} @@ -1264,12 +1264,12 @@ {"endpoint":"app.certified.feed.getActorLikes","case":"paged:desc","calls":[{"binds":["app.certified.feed.like","did:plc:abcdefghijklmnopqrstuvwx",3],"sql":"958119e969"}],"outcome":{"result":{"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e666565642e6c696b652f336b6162636465666768696a62222c2276223a317d","likes":[{"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.feed.like","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.feed.like/3kabcdefghijc"},{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.feed.like","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.feed.like/3kabcdefghijb"}]}}} {"endpoint":"app.certified.feed.getActorLikes","case":"cursor:valid:desc","calls":[{"binds":["app.certified.feed.like","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.like/3kabcdefghijk",26],"sql":"4cd8918f5f"}],"outcome":{"result":{"likes":[]}}} {"endpoint":"app.certified.feed.getActorLikes","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.feed.like","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.like/3kabcdefghijk",8],"sql":"4cd8918f5f"}],"outcome":{"result":{"likes":[]}}} -{"endpoint":"app.certified.feed.getActorLikes","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.feed.like","did:plc:abcdefghijklmnopqrstuvwx","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.like/3kabcdefghijk",26],"sql":"4cd8918f5f"}],"outcome":{"result":{"likes":[]}}} +{"endpoint":"app.certified.feed.getActorLikes","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.feed.getActorLikes","case":"sort=asc","calls":[{"binds":["app.certified.feed.like","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"50fae54f8e"}],"outcome":{"result":{"likes":[]}}} {"endpoint":"app.certified.feed.getActorLikes","case":"paged:asc","calls":[{"binds":["app.certified.feed.like","did:plc:abcdefghijklmnopqrstuvwx",3],"sql":"50fae54f8e"}],"outcome":{"result":{"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e666565642e6c696b652f336b6162636465666768696a62222c2276223a317d","likes":[{"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.feed.like","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.like/3kabcdefghija"},{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.feed.like","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.feed.like/3kabcdefghijb"}]}}} {"endpoint":"app.certified.feed.getActorLikes","case":"cursor:valid:asc","calls":[{"binds":["app.certified.feed.like","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.like/3kabcdefghijk",26],"sql":"060c0aac20"}],"outcome":{"result":{"likes":[]}}} {"endpoint":"app.certified.feed.getActorLikes","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.feed.like","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.like/3kabcdefghijk",8],"sql":"060c0aac20"}],"outcome":{"result":{"likes":[]}}} -{"endpoint":"app.certified.feed.getActorLikes","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.feed.like","did:plc:abcdefghijklmnopqrstuvwx","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.like/3kabcdefghijk",26],"sql":"060c0aac20"}],"outcome":{"result":{"likes":[]}}} +{"endpoint":"app.certified.feed.getActorLikes","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.feed.getActorLikes","case":"error:sortDirection=bad","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.feed.getActorLikes","case":"error:sortDirection=ASC","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.feed.getActorLikes","case":"error:sortDirection=empty","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} @@ -1372,12 +1372,12 @@ {"endpoint":"app.certified.feed.getActorReposts","case":"paged:desc","calls":[{"binds":["app.certified.feed.repost","did:plc:abcdefghijklmnopqrstuvwx",3],"sql":"958119e969"}],"outcome":{"result":{"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e666565642e7265706f73742f336b6162636465666768696a62222c2276223a317d","reposts":[{"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.feed.repost","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.feed.repost/3kabcdefghijc"},{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.feed.repost","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.feed.repost/3kabcdefghijb"}]}}} {"endpoint":"app.certified.feed.getActorReposts","case":"cursor:valid:desc","calls":[{"binds":["app.certified.feed.repost","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.repost/3kabcdefghijk",26],"sql":"4cd8918f5f"}],"outcome":{"result":{"reposts":[]}}} {"endpoint":"app.certified.feed.getActorReposts","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.feed.repost","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.repost/3kabcdefghijk",8],"sql":"4cd8918f5f"}],"outcome":{"result":{"reposts":[]}}} -{"endpoint":"app.certified.feed.getActorReposts","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.feed.repost","did:plc:abcdefghijklmnopqrstuvwx","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.repost/3kabcdefghijk",26],"sql":"4cd8918f5f"}],"outcome":{"result":{"reposts":[]}}} +{"endpoint":"app.certified.feed.getActorReposts","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.feed.getActorReposts","case":"sort=asc","calls":[{"binds":["app.certified.feed.repost","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"50fae54f8e"}],"outcome":{"result":{"reposts":[]}}} {"endpoint":"app.certified.feed.getActorReposts","case":"paged:asc","calls":[{"binds":["app.certified.feed.repost","did:plc:abcdefghijklmnopqrstuvwx",3],"sql":"50fae54f8e"}],"outcome":{"result":{"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e666565642e7265706f73742f336b6162636465666768696a62222c2276223a317d","reposts":[{"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.feed.repost","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.repost/3kabcdefghija"},{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.feed.repost","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.feed.repost/3kabcdefghijb"}]}}} {"endpoint":"app.certified.feed.getActorReposts","case":"cursor:valid:asc","calls":[{"binds":["app.certified.feed.repost","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.repost/3kabcdefghijk",26],"sql":"060c0aac20"}],"outcome":{"result":{"reposts":[]}}} {"endpoint":"app.certified.feed.getActorReposts","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.feed.repost","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.repost/3kabcdefghijk",8],"sql":"060c0aac20"}],"outcome":{"result":{"reposts":[]}}} -{"endpoint":"app.certified.feed.getActorReposts","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.feed.repost","did:plc:abcdefghijklmnopqrstuvwx","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.repost/3kabcdefghijk",26],"sql":"060c0aac20"}],"outcome":{"result":{"reposts":[]}}} +{"endpoint":"app.certified.feed.getActorReposts","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.feed.getActorReposts","case":"error:sortDirection=bad","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.feed.getActorReposts","case":"error:sortDirection=ASC","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.feed.getActorReposts","case":"error:sortDirection=empty","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} @@ -1480,12 +1480,12 @@ {"endpoint":"app.certified.feed.getLikes","case":"paged:desc","calls":[{"binds":["app.certified.feed.like","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",3],"sql":"235652cf2d"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e666565642e6c696b652f336b6162636465666768696a62222c2276223a317d","likeCount":12,"likes":[{"did":"did:plc:abcdefghijklmnopqrstuvwz","like":{"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.feed.like","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.feed.like/3kabcdefghijc"},"organization":null,"profile":null},{"did":"did:plc:abcdefghijklmnopqrstuvwy","like":{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.feed.like","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.feed.like/3kabcdefghijb"},"organization":null,"profile":null}]}}} {"endpoint":"app.certified.feed.getLikes","case":"cursor:valid:desc","calls":[{"binds":["app.certified.feed.like","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.like/3kabcdefghijk",26],"sql":"9820dcd288"}],"outcome":{"result":{"likeCount":0,"likes":[]}}} {"endpoint":"app.certified.feed.getLikes","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.feed.like","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.like/3kabcdefghijk",8],"sql":"9820dcd288"}],"outcome":{"result":{"likeCount":0,"likes":[]}}} -{"endpoint":"app.certified.feed.getLikes","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.feed.like","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.like/3kabcdefghijk",26],"sql":"9820dcd288"}],"outcome":{"result":{"likeCount":0,"likes":[]}}} +{"endpoint":"app.certified.feed.getLikes","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.feed.getLikes","case":"sort=asc","calls":[{"binds":["app.certified.feed.like","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",26],"sql":"b30c649623"}],"outcome":{"result":{"likeCount":0,"likes":[]}}} {"endpoint":"app.certified.feed.getLikes","case":"paged:asc","calls":[{"binds":["app.certified.feed.like","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",3],"sql":"b30c649623"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e666565642e6c696b652f336b6162636465666768696a62222c2276223a317d","likeCount":12,"likes":[{"did":"did:plc:abcdefghijklmnopqrstuvwx","like":{"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.feed.like","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.like/3kabcdefghija"},"organization":null,"profile":null},{"did":"did:plc:abcdefghijklmnopqrstuvwy","like":{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.feed.like","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.feed.like/3kabcdefghijb"},"organization":null,"profile":null}]}}} {"endpoint":"app.certified.feed.getLikes","case":"cursor:valid:asc","calls":[{"binds":["app.certified.feed.like","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.like/3kabcdefghijk",26],"sql":"9d26dac464"}],"outcome":{"result":{"likeCount":0,"likes":[]}}} {"endpoint":"app.certified.feed.getLikes","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.feed.like","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.like/3kabcdefghijk",8],"sql":"9d26dac464"}],"outcome":{"result":{"likeCount":0,"likes":[]}}} -{"endpoint":"app.certified.feed.getLikes","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.feed.like","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.like/3kabcdefghijk",26],"sql":"9d26dac464"}],"outcome":{"result":{"likeCount":0,"likes":[]}}} +{"endpoint":"app.certified.feed.getLikes","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.feed.getLikes","case":"error:sortDirection=bad","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.feed.getLikes","case":"error:sortDirection=ASC","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.feed.getLikes","case":"error:sortDirection=empty","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} @@ -1588,12 +1588,12 @@ {"endpoint":"app.certified.feed.getReposts","case":"paged:desc","calls":[{"binds":["app.certified.feed.repost","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",3],"sql":"235652cf2d"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e666565642e7265706f73742f336b6162636465666768696a62222c2276223a317d","repostCount":12,"reposts":[{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null,"repost":{"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.feed.repost","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.feed.repost/3kabcdefghijc"}},{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null,"repost":{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.feed.repost","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.feed.repost/3kabcdefghijb"}}]}}} {"endpoint":"app.certified.feed.getReposts","case":"cursor:valid:desc","calls":[{"binds":["app.certified.feed.repost","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.repost/3kabcdefghijk",26],"sql":"9820dcd288"}],"outcome":{"result":{"repostCount":0,"reposts":[]}}} {"endpoint":"app.certified.feed.getReposts","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.feed.repost","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.repost/3kabcdefghijk",8],"sql":"9820dcd288"}],"outcome":{"result":{"repostCount":0,"reposts":[]}}} -{"endpoint":"app.certified.feed.getReposts","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.feed.repost","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.repost/3kabcdefghijk",26],"sql":"9820dcd288"}],"outcome":{"result":{"repostCount":0,"reposts":[]}}} +{"endpoint":"app.certified.feed.getReposts","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.feed.getReposts","case":"sort=asc","calls":[{"binds":["app.certified.feed.repost","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",26],"sql":"b30c649623"}],"outcome":{"result":{"repostCount":0,"reposts":[]}}} {"endpoint":"app.certified.feed.getReposts","case":"paged:asc","calls":[{"binds":["app.certified.feed.repost","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",3],"sql":"b30c649623"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e666565642e7265706f73742f336b6162636465666768696a62222c2276223a317d","repostCount":12,"reposts":[{"did":"did:plc:abcdefghijklmnopqrstuvwx","organization":null,"profile":null,"repost":{"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.feed.repost","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.repost/3kabcdefghija"}},{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null,"repost":{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.feed.repost","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.feed.repost/3kabcdefghijb"}}]}}} {"endpoint":"app.certified.feed.getReposts","case":"cursor:valid:asc","calls":[{"binds":["app.certified.feed.repost","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.repost/3kabcdefghijk",26],"sql":"9d26dac464"}],"outcome":{"result":{"repostCount":0,"reposts":[]}}} {"endpoint":"app.certified.feed.getReposts","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.feed.repost","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.repost/3kabcdefghijk",8],"sql":"9d26dac464"}],"outcome":{"result":{"repostCount":0,"reposts":[]}}} -{"endpoint":"app.certified.feed.getReposts","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.feed.repost","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.feed.repost/3kabcdefghijk",26],"sql":"9d26dac464"}],"outcome":{"result":{"repostCount":0,"reposts":[]}}} +{"endpoint":"app.certified.feed.getReposts","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.feed.getReposts","case":"error:sortDirection=bad","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.feed.getReposts","case":"error:sortDirection=ASC","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.feed.getReposts","case":"error:sortDirection=empty","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} @@ -1696,12 +1696,12 @@ {"endpoint":"app.certified.graph.listActorFollowers","case":"paged:desc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx",3],"sql":"107d3663f6"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e67726170682e666f6c6c6f772f336b6162636465666768696a62222c2276223a317d","followers":[{"did":"did:plc:abcdefghijklmnopqrstuvwz","follow":{"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.graph.follow","createdAt":"2025-01-03T00:00:00Z","subject":"did:plc:abcdefghijklmnopqrstuvwz"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.graph.follow/3kabcdefghijc"},"organization":null,"profile":null},{"did":"did:plc:abcdefghijklmnopqrstuvwy","follow":{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.graph.follow","createdAt":"2025-01-02T00:00:00Z","subject":"did:plc:abcdefghijklmnopqrstuvwy"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.graph.follow/3kabcdefghijb"},"organization":null,"profile":null}],"totalCount":12}}} {"endpoint":"app.certified.graph.listActorFollowers","case":"cursor:valid:desc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.follow/3kabcdefghijk",26],"sql":"a4f35cd109"}],"outcome":{"result":{"followers":[],"totalCount":0}}} {"endpoint":"app.certified.graph.listActorFollowers","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.follow/3kabcdefghijk",8],"sql":"a4f35cd109"}],"outcome":{"result":{"followers":[],"totalCount":0}}} -{"endpoint":"app.certified.graph.listActorFollowers","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.follow/3kabcdefghijk",26],"sql":"a4f35cd109"}],"outcome":{"result":{"followers":[],"totalCount":0}}} +{"endpoint":"app.certified.graph.listActorFollowers","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.graph.listActorFollowers","case":"sort=asc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"0d65b5c846"}],"outcome":{"result":{"followers":[],"totalCount":0}}} {"endpoint":"app.certified.graph.listActorFollowers","case":"paged:asc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx",3],"sql":"0d65b5c846"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e67726170682e666f6c6c6f772f336b6162636465666768696a62222c2276223a317d","followers":[{"did":"did:plc:abcdefghijklmnopqrstuvwx","follow":{"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.graph.follow","createdAt":"2025-01-01T00:00:00Z","subject":"did:plc:abcdefghijklmnopqrstuvwx"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.follow/3kabcdefghija"},"organization":null,"profile":null},{"did":"did:plc:abcdefghijklmnopqrstuvwy","follow":{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.graph.follow","createdAt":"2025-01-02T00:00:00Z","subject":"did:plc:abcdefghijklmnopqrstuvwy"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.graph.follow/3kabcdefghijb"},"organization":null,"profile":null}],"totalCount":12}}} {"endpoint":"app.certified.graph.listActorFollowers","case":"cursor:valid:asc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.follow/3kabcdefghijk",26],"sql":"81d1f27eb3"}],"outcome":{"result":{"followers":[],"totalCount":0}}} {"endpoint":"app.certified.graph.listActorFollowers","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.follow/3kabcdefghijk",8],"sql":"81d1f27eb3"}],"outcome":{"result":{"followers":[],"totalCount":0}}} -{"endpoint":"app.certified.graph.listActorFollowers","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.follow/3kabcdefghijk",26],"sql":"81d1f27eb3"}],"outcome":{"result":{"followers":[],"totalCount":0}}} +{"endpoint":"app.certified.graph.listActorFollowers","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.graph.listActorFollowers","case":"error:sortDirection=bad","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.graph.listActorFollowers","case":"error:sortDirection=ASC","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.graph.listActorFollowers","case":"error:sortDirection=empty","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} @@ -1804,12 +1804,12 @@ {"endpoint":"app.certified.graph.listActorFollowing","case":"paged:desc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx",3],"sql":"f3857e8ed7"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e67726170682e666f6c6c6f772f336b6162636465666768696a62222c2276223a317d","following":[{"did":"did:plc:abcdefghijklmnopqrstuvwz","follow":{"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.graph.follow","createdAt":"2025-01-03T00:00:00Z","subject":"did:plc:abcdefghijklmnopqrstuvwz"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.graph.follow/3kabcdefghijc"},"organization":null,"profile":null},{"did":"did:plc:abcdefghijklmnopqrstuvwy","follow":{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.graph.follow","createdAt":"2025-01-02T00:00:00Z","subject":"did:plc:abcdefghijklmnopqrstuvwy"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.graph.follow/3kabcdefghijb"},"organization":null,"profile":null}],"totalCount":12}}} {"endpoint":"app.certified.graph.listActorFollowing","case":"cursor:valid:desc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.follow/3kabcdefghijk",26],"sql":"b224c5782a"}],"outcome":{"result":{"following":[],"totalCount":0}}} {"endpoint":"app.certified.graph.listActorFollowing","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.follow/3kabcdefghijk",8],"sql":"b224c5782a"}],"outcome":{"result":{"following":[],"totalCount":0}}} -{"endpoint":"app.certified.graph.listActorFollowing","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.follow/3kabcdefghijk",26],"sql":"b224c5782a"}],"outcome":{"result":{"following":[],"totalCount":0}}} +{"endpoint":"app.certified.graph.listActorFollowing","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.graph.listActorFollowing","case":"sort=asc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"4bd67beea6"}],"outcome":{"result":{"following":[],"totalCount":0}}} {"endpoint":"app.certified.graph.listActorFollowing","case":"paged:asc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx",3],"sql":"4bd67beea6"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e67726170682e666f6c6c6f772f336b6162636465666768696a62222c2276223a317d","following":[{"did":"did:plc:abcdefghijklmnopqrstuvwx","follow":{"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.graph.follow","createdAt":"2025-01-01T00:00:00Z","subject":"did:plc:abcdefghijklmnopqrstuvwx"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.follow/3kabcdefghija"},"organization":null,"profile":null},{"did":"did:plc:abcdefghijklmnopqrstuvwy","follow":{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.graph.follow","createdAt":"2025-01-02T00:00:00Z","subject":"did:plc:abcdefghijklmnopqrstuvwy"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.graph.follow/3kabcdefghijb"},"organization":null,"profile":null}],"totalCount":12}}} {"endpoint":"app.certified.graph.listActorFollowing","case":"cursor:valid:asc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.follow/3kabcdefghijk",26],"sql":"ceeb1a63af"}],"outcome":{"result":{"following":[],"totalCount":0}}} {"endpoint":"app.certified.graph.listActorFollowing","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.follow/3kabcdefghijk",8],"sql":"ceeb1a63af"}],"outcome":{"result":{"following":[],"totalCount":0}}} -{"endpoint":"app.certified.graph.listActorFollowing","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.graph.follow","did:plc:abcdefghijklmnopqrstuvwx","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.follow/3kabcdefghijk",26],"sql":"ceeb1a63af"}],"outcome":{"result":{"following":[],"totalCount":0}}} +{"endpoint":"app.certified.graph.listActorFollowing","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.graph.listActorFollowing","case":"error:sortDirection=bad","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.graph.listActorFollowing","case":"error:sortDirection=ASC","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.graph.listActorFollowing","case":"error:sortDirection=empty","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} @@ -1912,12 +1912,12 @@ {"endpoint":"app.certified.graph.listEntityFollowers","case":"paged:desc","calls":[{"binds":["app.certified.graph.entityFollow","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",3],"sql":"dc37a02dda"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"}],"outcome":{"result":{"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e67726170682e656e74697479466f6c6c6f772f336b6162636465666768696a62222c2276223a317d","followers":[{"$type":"app.certified.graph.listEntityFollowers#entityFollowerView","did":"did:plc:abcdefghijklmnopqrstuvwz","follow":{"$type":"app.certified.graph.getEntityFollow#entityFollowRecordView","cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.graph.entityFollow","createdAt":"2025-01-03T00:00:00Z","subject":{"cid":"bafyactivity2","uri":"at://did:plc:abcdefghijklmnopqrstuvwz/org.hypercerts.claim.activity/3kabcdefghijk"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.graph.entityFollow/3kabcdefghijc"},"organization":null,"profile":null},{"$type":"app.certified.graph.listEntityFollowers#entityFollowerView","did":"did:plc:abcdefghijklmnopqrstuvwy","follow":{"$type":"app.certified.graph.getEntityFollow#entityFollowRecordView","cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.graph.entityFollow","createdAt":"2025-01-02T00:00:00Z","subject":{"cid":"bafyactivity1","uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.claim.activity/3kabcdefghijk"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.graph.entityFollow/3kabcdefghijb"},"organization":null,"profile":null}],"totalCount":12}}} {"endpoint":"app.certified.graph.listEntityFollowers","case":"cursor:valid:desc","calls":[{"binds":["app.certified.graph.entityFollow","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghijk",26],"sql":"3e0ec9791e"}],"outcome":{"result":{"followers":[],"totalCount":0}}} {"endpoint":"app.certified.graph.listEntityFollowers","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.graph.entityFollow","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghijk",8],"sql":"3e0ec9791e"}],"outcome":{"result":{"followers":[],"totalCount":0}}} -{"endpoint":"app.certified.graph.listEntityFollowers","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.graph.entityFollow","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghijk",26],"sql":"3e0ec9791e"}],"outcome":{"result":{"followers":[],"totalCount":0}}} +{"endpoint":"app.certified.graph.listEntityFollowers","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.graph.listEntityFollowers","case":"sort=asc","calls":[{"binds":["app.certified.graph.entityFollow","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",26],"sql":"82466a8847"}],"outcome":{"result":{"followers":[],"totalCount":0}}} {"endpoint":"app.certified.graph.listEntityFollowers","case":"paged:asc","calls":[{"binds":["app.certified.graph.entityFollow","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",3],"sql":"82466a8847"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"}],"outcome":{"result":{"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e67726170682e656e74697479466f6c6c6f772f336b6162636465666768696a62222c2276223a317d","followers":[{"$type":"app.certified.graph.listEntityFollowers#entityFollowerView","did":"did:plc:abcdefghijklmnopqrstuvwx","follow":{"$type":"app.certified.graph.getEntityFollow#entityFollowRecordView","cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.graph.entityFollow","createdAt":"2025-01-01T00:00:00Z","subject":{"cid":"bafyactivity0","uri":"at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghija"},"organization":null,"profile":null},{"$type":"app.certified.graph.listEntityFollowers#entityFollowerView","did":"did:plc:abcdefghijklmnopqrstuvwy","follow":{"$type":"app.certified.graph.getEntityFollow#entityFollowRecordView","cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.graph.entityFollow","createdAt":"2025-01-02T00:00:00Z","subject":{"cid":"bafyactivity1","uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.claim.activity/3kabcdefghijk"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.graph.entityFollow/3kabcdefghijb"},"organization":null,"profile":null}],"totalCount":12}}} {"endpoint":"app.certified.graph.listEntityFollowers","case":"cursor:valid:asc","calls":[{"binds":["app.certified.graph.entityFollow","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghijk",26],"sql":"ca6fa49a9a"}],"outcome":{"result":{"followers":[],"totalCount":0}}} {"endpoint":"app.certified.graph.listEntityFollowers","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.graph.entityFollow","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghijk",8],"sql":"ca6fa49a9a"}],"outcome":{"result":{"followers":[],"totalCount":0}}} -{"endpoint":"app.certified.graph.listEntityFollowers","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.graph.entityFollow","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghijk",26],"sql":"ca6fa49a9a"}],"outcome":{"result":{"followers":[],"totalCount":0}}} +{"endpoint":"app.certified.graph.listEntityFollowers","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.graph.listEntityFollowers","case":"error:sortDirection=bad","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.graph.listEntityFollowers","case":"error:sortDirection=ASC","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.graph.listEntityFollowers","case":"error:sortDirection=empty","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} @@ -2020,12 +2020,12 @@ {"endpoint":"app.certified.graph.listEntityFollowing","case":"paged:desc","calls":[{"binds":["app.certified.graph.entityFollow","did:plc:abcdefghijklmnopqrstuvwx",4],"sql":"47811ad6f2"},{"binds":["org.hypercerts.claim.activity","at://did:plc:abcdefghijklmnopqrstuvwz/org.hypercerts.claim.activity/3kabcdefghijk","at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.claim.activity/3kabcdefghijk"],"sql":"1b8c5a6a7c"}],"outcome":{"result":{"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e67726170682e656e74697479466f6c6c6f772f336b6162636465666768696a62222c2276223a317d","entities":[{"$type":"app.certified.graph.listEntityFollowing#entityFollowingItem","entity":null,"follow":{"$type":"app.certified.graph.getEntityFollow#entityFollowRecordView","cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.graph.entityFollow","createdAt":"2025-01-03T00:00:00Z","subject":{"cid":"bafyactivity2","uri":"at://did:plc:abcdefghijklmnopqrstuvwz/org.hypercerts.claim.activity/3kabcdefghijk"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.graph.entityFollow/3kabcdefghijc"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/org.hypercerts.claim.activity/3kabcdefghijk"},{"$type":"app.certified.graph.listEntityFollowing#entityFollowingItem","entity":null,"follow":{"$type":"app.certified.graph.getEntityFollow#entityFollowRecordView","cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.graph.entityFollow","createdAt":"2025-01-02T00:00:00Z","subject":{"cid":"bafyactivity1","uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.claim.activity/3kabcdefghijk"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.graph.entityFollow/3kabcdefghijb"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.claim.activity/3kabcdefghijk"}]}}} {"endpoint":"app.certified.graph.listEntityFollowing","case":"cursor:valid:desc","calls":[{"binds":["app.certified.graph.entityFollow","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghijk",27],"sql":"f87bb726ad"}],"outcome":{"result":{"entities":[]}}} {"endpoint":"app.certified.graph.listEntityFollowing","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.graph.entityFollow","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghijk",9],"sql":"f87bb726ad"}],"outcome":{"result":{"entities":[]}}} -{"endpoint":"app.certified.graph.listEntityFollowing","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.graph.entityFollow","did:plc:abcdefghijklmnopqrstuvwx","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghijk",27],"sql":"f87bb726ad"}],"outcome":{"result":{"entities":[]}}} +{"endpoint":"app.certified.graph.listEntityFollowing","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.graph.listEntityFollowing","case":"sort=asc","calls":[{"binds":["app.certified.graph.entityFollow","did:plc:abcdefghijklmnopqrstuvwx",27],"sql":"51e5c58ca9"}],"outcome":{"result":{"entities":[]}}} {"endpoint":"app.certified.graph.listEntityFollowing","case":"paged:asc","calls":[{"binds":["app.certified.graph.entityFollow","did:plc:abcdefghijklmnopqrstuvwx",4],"sql":"51e5c58ca9"},{"binds":["org.hypercerts.claim.activity","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk","at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.claim.activity/3kabcdefghijk"],"sql":"1b8c5a6a7c"}],"outcome":{"result":{"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e67726170682e656e74697479466f6c6c6f772f336b6162636465666768696a62222c2276223a317d","entities":[{"$type":"app.certified.graph.listEntityFollowing#entityFollowingItem","entity":null,"follow":{"$type":"app.certified.graph.getEntityFollow#entityFollowRecordView","cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.graph.entityFollow","createdAt":"2025-01-01T00:00:00Z","subject":{"cid":"bafyactivity0","uri":"at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghija"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk"},{"$type":"app.certified.graph.listEntityFollowing#entityFollowingItem","entity":null,"follow":{"$type":"app.certified.graph.getEntityFollow#entityFollowRecordView","cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.graph.entityFollow","createdAt":"2025-01-02T00:00:00Z","subject":{"cid":"bafyactivity1","uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.claim.activity/3kabcdefghijk"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.graph.entityFollow/3kabcdefghijb"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.claim.activity/3kabcdefghijk"}]}}} {"endpoint":"app.certified.graph.listEntityFollowing","case":"cursor:valid:asc","calls":[{"binds":["app.certified.graph.entityFollow","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghijk",27],"sql":"935a7082cc"}],"outcome":{"result":{"entities":[]}}} {"endpoint":"app.certified.graph.listEntityFollowing","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.graph.entityFollow","did:plc:abcdefghijklmnopqrstuvwx","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghijk",9],"sql":"935a7082cc"}],"outcome":{"result":{"entities":[]}}} -{"endpoint":"app.certified.graph.listEntityFollowing","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.graph.entityFollow","did:plc:abcdefghijklmnopqrstuvwx","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghijk",27],"sql":"935a7082cc"}],"outcome":{"result":{"entities":[]}}} +{"endpoint":"app.certified.graph.listEntityFollowing","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.graph.listEntityFollowing","case":"error:sortDirection=bad","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.graph.listEntityFollowing","case":"error:sortDirection=ASC","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} {"endpoint":"app.certified.graph.listEntityFollowing","case":"error:sortDirection=empty","calls":[],"outcome":{"error":"InvalidRequest: sortDirection must be 'asc' or 'desc'"}} @@ -2127,7 +2127,7 @@ {"endpoint":"app.certified.graph.listRecentFollows","case":"paged:default","calls":[{"binds":["app.certified.graph.follow","app.certified.graph.entityFollow",3],"sql":"04564cc9e7"}],"outcome":{"result":{"cursor":"7b2262223a66616c73652c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e67726170682e656e74697479466f6c6c6f772f336b6162636465666768696a62222c2276223a317d","follows":[{"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.graph.entityFollow","createdAt":"2025-01-03T00:00:00Z","subject":{"cid":"bafyactivity2","uri":"at://did:plc:abcdefghijklmnopqrstuvwz/org.hypercerts.claim.activity/3kabcdefghijk"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.graph.entityFollow/3kabcdefghijc"},{"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.graph.entityFollow","createdAt":"2025-01-02T00:00:00Z","subject":{"cid":"bafyactivity1","uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.claim.activity/3kabcdefghijk"}},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.graph.entityFollow/3kabcdefghijb"}]}}} {"endpoint":"app.certified.graph.listRecentFollows","case":"cursor:valid:default","calls":[{"binds":["app.certified.graph.follow","app.certified.graph.entityFollow","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghijk",26],"sql":"a97172131c"}],"outcome":{"result":{"follows":[]}}} {"endpoint":"app.certified.graph.listRecentFollows","case":"cursor:valid+limit=7:default","calls":[{"binds":["app.certified.graph.follow","app.certified.graph.entityFollow","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghijk",8],"sql":"a97172131c"}],"outcome":{"result":{"follows":[]}}} -{"endpoint":"app.certified.graph.listRecentFollows","case":"year0000:cursor:default","calls":[{"binds":["app.certified.graph.follow","app.certified.graph.entityFollow","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.graph.entityFollow/3kabcdefghijk",26],"sql":"a97172131c"}],"outcome":{"result":{"follows":[]}}} +{"endpoint":"app.certified.graph.listRecentFollows","case":"year0000:cursor:default","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed or belongs to another before value"}} {"endpoint":"app.certified.graph.listRecentFollows","case":"filter:before=2025-06-01T00:00:00Z","calls":[{"binds":["app.certified.graph.follow","app.certified.graph.entityFollow","2025-06-01T00:00:00Z",26],"sql":"b1eb0cc1f8"}],"outcome":{"result":{"follows":[]}}} {"endpoint":"app.certified.graph.listRecentFollows","case":"filter:before=2025-06-01T00:00:00Z","calls":[{"binds":["app.certified.graph.follow","app.certified.graph.entityFollow","2025-06-01T00:00:00Z",26],"sql":"b1eb0cc1f8"}],"outcome":{"result":{"follows":[]}}} {"endpoint":"app.certified.graph.listRecentFollows","case":"filter:before=2025-06-01T00:00:00Z","calls":[{"binds":["app.certified.graph.follow","app.certified.graph.entityFollow","2025-06-01T00:00:00Z",26],"sql":"b1eb0cc1f8"}],"outcome":{"result":{"follows":[]}}} @@ -2228,12 +2228,12 @@ {"endpoint":"app.certified.link.listEvmLinks","case":"paged:desc","calls":[{"binds":["app.certified.link.evm",3],"sql":"7054b0a493"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e6c696e6b2e65766d2f336b6162636465666768696a62222c2276223a317d","evmLinks":[{"actor":{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null},"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.link.evm","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.link.evm/3kabcdefghijc"},{"actor":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.link.evm","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.link.evm/3kabcdefghijb"}]}}} {"endpoint":"app.certified.link.listEvmLinks","case":"cursor:valid:desc","calls":[{"binds":["app.certified.link.evm","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.link.evm/3kabcdefghijk",26],"sql":"9d1064a743"}],"outcome":{"result":{"evmLinks":[]}}} {"endpoint":"app.certified.link.listEvmLinks","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.link.evm","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.link.evm/3kabcdefghijk",8],"sql":"9d1064a743"}],"outcome":{"result":{"evmLinks":[]}}} -{"endpoint":"app.certified.link.listEvmLinks","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.link.evm","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.link.evm/3kabcdefghijk",26],"sql":"9d1064a743"}],"outcome":{"result":{"evmLinks":[]}}} +{"endpoint":"app.certified.link.listEvmLinks","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.link.listEvmLinks","case":"sort=asc","calls":[{"binds":["app.certified.link.evm",26],"sql":"a03dd453be"}],"outcome":{"result":{"evmLinks":[]}}} {"endpoint":"app.certified.link.listEvmLinks","case":"paged:asc","calls":[{"binds":["app.certified.link.evm",3],"sql":"a03dd453be"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e6c696e6b2e65766d2f336b6162636465666768696a62222c2276223a317d","evmLinks":[{"actor":{"did":"did:plc:abcdefghijklmnopqrstuvwx","organization":null,"profile":null},"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.link.evm","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.link.evm/3kabcdefghija"},{"actor":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.link.evm","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.link.evm/3kabcdefghijb"}]}}} {"endpoint":"app.certified.link.listEvmLinks","case":"cursor:valid:asc","calls":[{"binds":["app.certified.link.evm","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.link.evm/3kabcdefghijk",26],"sql":"deb4345aab"}],"outcome":{"result":{"evmLinks":[]}}} {"endpoint":"app.certified.link.listEvmLinks","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.link.evm","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.link.evm/3kabcdefghijk",8],"sql":"deb4345aab"}],"outcome":{"result":{"evmLinks":[]}}} -{"endpoint":"app.certified.link.listEvmLinks","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.link.evm","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.link.evm/3kabcdefghijk",26],"sql":"deb4345aab"}],"outcome":{"result":{"evmLinks":[]}}} +{"endpoint":"app.certified.link.listEvmLinks","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.link.listEvmLinks","case":"filter:actors:many","calls":[{"binds":["app.certified.link.evm","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy","did:plc:abcdefghijklmnopqrstuvwz",26],"sql":"cf034f3460"}],"outcome":{"result":{"evmLinks":[]}}} {"endpoint":"app.certified.link.listEvmLinks","case":"filter:actors:one","calls":[{"binds":["app.certified.link.evm","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"269699e131"}],"outcome":{"result":{"evmLinks":[]}}} {"endpoint":"app.certified.link.listEvmLinks","case":"filter:actors:one-scalar","calls":[{"binds":["app.certified.link.evm","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"269699e131"}],"outcome":{"result":{"evmLinks":[]}}} @@ -2347,12 +2347,12 @@ {"endpoint":"app.certified.location.listLocations","case":"paged:desc","calls":[{"binds":["app.certified.location",3],"sql":"fdd374e87e"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e6c6f636174696f6e2f336b6162636465666768696a62222c2276223a317d","locations":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null},"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"app.certified.location","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/app.certified.location/3kabcdefghijc"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.location","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.location/3kabcdefghijb"}]}}} {"endpoint":"app.certified.location.listLocations","case":"cursor:valid:desc","calls":[{"binds":["app.certified.location","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.location/3kabcdefghijk",26],"sql":"2712d7dd78"}],"outcome":{"result":{"locations":[]}}} {"endpoint":"app.certified.location.listLocations","case":"cursor:valid+limit=7:desc","calls":[{"binds":["app.certified.location","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.location/3kabcdefghijk",8],"sql":"2712d7dd78"}],"outcome":{"result":{"locations":[]}}} -{"endpoint":"app.certified.location.listLocations","case":"year0000:cursor:desc","calls":[{"binds":["app.certified.location","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.location/3kabcdefghijk",26],"sql":"2712d7dd78"}],"outcome":{"result":{"locations":[]}}} +{"endpoint":"app.certified.location.listLocations","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.location.listLocations","case":"sort=asc","calls":[{"binds":["app.certified.location",26],"sql":"fbade26882"}],"outcome":{"result":{"locations":[]}}} {"endpoint":"app.certified.location.listLocations","case":"paged:asc","calls":[{"binds":["app.certified.location",3],"sql":"fbade26882"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6170702e6365727469666965642e6c6f636174696f6e2f336b6162636465666768696a62222c2276223a317d","locations":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwx","organization":null,"profile":null},"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"app.certified.location","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.location/3kabcdefghija"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"app.certified.location","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/app.certified.location/3kabcdefghijb"}]}}} {"endpoint":"app.certified.location.listLocations","case":"cursor:valid:asc","calls":[{"binds":["app.certified.location","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.location/3kabcdefghijk",26],"sql":"f415ca0b71"}],"outcome":{"result":{"locations":[]}}} {"endpoint":"app.certified.location.listLocations","case":"cursor:valid+limit=7:asc","calls":[{"binds":["app.certified.location","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.location/3kabcdefghijk",8],"sql":"f415ca0b71"}],"outcome":{"result":{"locations":[]}}} -{"endpoint":"app.certified.location.listLocations","case":"year0000:cursor:asc","calls":[{"binds":["app.certified.location","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/app.certified.location/3kabcdefghijk",26],"sql":"f415ca0b71"}],"outcome":{"result":{"locations":[]}}} +{"endpoint":"app.certified.location.listLocations","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"app.certified.location.listLocations","case":"filter:authors:many","calls":[{"binds":["app.certified.location","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy","did:plc:abcdefghijklmnopqrstuvwz",26],"sql":"056193581d"}],"outcome":{"result":{"locations":[]}}} {"endpoint":"app.certified.location.listLocations","case":"filter:authors:one","calls":[{"binds":["app.certified.location","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"cf715d2ab7"}],"outcome":{"result":{"locations":[]}}} {"endpoint":"app.certified.location.listLocations","case":"filter:authors:one-scalar","calls":[{"binds":["app.certified.location","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"cf715d2ab7"}],"outcome":{"result":{"locations":[]}}} @@ -2471,12 +2471,12 @@ {"endpoint":"org.hypercerts.claim.listActivities","case":"paged:desc","calls":[{"binds":["org.hypercerts.claim.activity",3],"sql":"d1229757a9"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"}],"outcome":{"result":{"activities":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null},"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"org.hypercerts.claim.activity","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/org.hypercerts.claim.activity/3kabcdefghijc"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.claim.activity","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.claim.activity/3kabcdefghijb"}],"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e636c61696d2e61637469766974792f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"org.hypercerts.claim.listActivities","case":"cursor:valid:desc","calls":[{"binds":["org.hypercerts.claim.activity","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",26],"sql":"1df3d14bb5"}],"outcome":{"result":{"activities":[]}}} {"endpoint":"org.hypercerts.claim.listActivities","case":"cursor:valid+limit=7:desc","calls":[{"binds":["org.hypercerts.claim.activity","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",8],"sql":"1df3d14bb5"}],"outcome":{"result":{"activities":[]}}} -{"endpoint":"org.hypercerts.claim.listActivities","case":"year0000:cursor:desc","calls":[{"binds":["org.hypercerts.claim.activity","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",26],"sql":"1df3d14bb5"}],"outcome":{"result":{"activities":[]}}} +{"endpoint":"org.hypercerts.claim.listActivities","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.claim.listActivities","case":"sort=asc","calls":[{"binds":["org.hypercerts.claim.activity",26],"sql":"a916de18ad"}],"outcome":{"result":{"activities":[]}}} {"endpoint":"org.hypercerts.claim.listActivities","case":"paged:asc","calls":[{"binds":["org.hypercerts.claim.activity",3],"sql":"a916de18ad"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"}],"outcome":{"result":{"activities":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwx","organization":null,"profile":null},"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"org.hypercerts.claim.activity","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghija"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.claim.activity","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.claim.activity/3kabcdefghijb"}],"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e636c61696d2e61637469766974792f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"org.hypercerts.claim.listActivities","case":"cursor:valid:asc","calls":[{"binds":["org.hypercerts.claim.activity","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",26],"sql":"79c0ea89fc"}],"outcome":{"result":{"activities":[]}}} {"endpoint":"org.hypercerts.claim.listActivities","case":"cursor:valid+limit=7:asc","calls":[{"binds":["org.hypercerts.claim.activity","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",8],"sql":"79c0ea89fc"}],"outcome":{"result":{"activities":[]}}} -{"endpoint":"org.hypercerts.claim.listActivities","case":"year0000:cursor:asc","calls":[{"binds":["org.hypercerts.claim.activity","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",26],"sql":"79c0ea89fc"}],"outcome":{"result":{"activities":[]}}} +{"endpoint":"org.hypercerts.claim.listActivities","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.claim.listActivities","case":"filter:authors:many","calls":[{"binds":["org.hypercerts.claim.activity","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy","did:plc:abcdefghijklmnopqrstuvwz",26],"sql":"3d578b7933"}],"outcome":{"result":{"activities":[]}}} {"endpoint":"org.hypercerts.claim.listActivities","case":"filter:authors:one","calls":[{"binds":["org.hypercerts.claim.activity","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"80efd5c186"}],"outcome":{"result":{"activities":[]}}} {"endpoint":"org.hypercerts.claim.listActivities","case":"filter:authors:one-scalar","calls":[{"binds":["org.hypercerts.claim.activity","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"80efd5c186"}],"outcome":{"result":{"activities":[]}}} @@ -2943,12 +2943,12 @@ {"endpoint":"org.hypercerts.claim.searchActivities","case":"paged:desc","calls":[{"binds":["org.hypercerts.claim.activity","test",3],"sql":"69fc88161b"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"}],"outcome":{"result":{"activities":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null},"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"org.hypercerts.claim.activity","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/org.hypercerts.claim.activity/3kabcdefghijc"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.claim.activity","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.claim.activity/3kabcdefghijb"}],"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e636c61696d2e61637469766974792f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"org.hypercerts.claim.searchActivities","case":"cursor:valid:desc","calls":[{"binds":["org.hypercerts.claim.activity","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",26],"sql":"bc0b02e384"}],"outcome":{"result":{"activities":[]}}} {"endpoint":"org.hypercerts.claim.searchActivities","case":"cursor:valid+limit=7:desc","calls":[{"binds":["org.hypercerts.claim.activity","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",8],"sql":"bc0b02e384"}],"outcome":{"result":{"activities":[]}}} -{"endpoint":"org.hypercerts.claim.searchActivities","case":"year0000:cursor:desc","calls":[{"binds":["org.hypercerts.claim.activity","test","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",26],"sql":"bc0b02e384"}],"outcome":{"result":{"activities":[]}}} +{"endpoint":"org.hypercerts.claim.searchActivities","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.claim.searchActivities","case":"sort=asc","calls":[{"binds":["org.hypercerts.claim.activity","test",26],"sql":"505fa63bf8"}],"outcome":{"result":{"activities":[]}}} {"endpoint":"org.hypercerts.claim.searchActivities","case":"paged:asc","calls":[{"binds":["org.hypercerts.claim.activity","test",3],"sql":"505fa63bf8"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"}],"outcome":{"result":{"activities":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwx","organization":null,"profile":null},"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"org.hypercerts.claim.activity","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghija"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.claim.activity","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.claim.activity/3kabcdefghijb"}],"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e636c61696d2e61637469766974792f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"org.hypercerts.claim.searchActivities","case":"cursor:valid:asc","calls":[{"binds":["org.hypercerts.claim.activity","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",26],"sql":"966cd6b22a"}],"outcome":{"result":{"activities":[]}}} {"endpoint":"org.hypercerts.claim.searchActivities","case":"cursor:valid+limit=7:asc","calls":[{"binds":["org.hypercerts.claim.activity","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",8],"sql":"966cd6b22a"}],"outcome":{"result":{"activities":[]}}} -{"endpoint":"org.hypercerts.claim.searchActivities","case":"year0000:cursor:asc","calls":[{"binds":["org.hypercerts.claim.activity","test","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.claim.activity/3kabcdefghijk",26],"sql":"966cd6b22a"}],"outcome":{"result":{"activities":[]}}} +{"endpoint":"org.hypercerts.claim.searchActivities","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.claim.searchActivities","case":"filter:authors:many","calls":[{"binds":["org.hypercerts.claim.activity","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy","did:plc:abcdefghijklmnopqrstuvwz","test",26],"sql":"c339a78b2e"}],"outcome":{"result":{"activities":[]}}} {"endpoint":"org.hypercerts.claim.searchActivities","case":"filter:authors:one","calls":[{"binds":["org.hypercerts.claim.activity","did:plc:abcdefghijklmnopqrstuvwx","test",26],"sql":"d384922db1"}],"outcome":{"result":{"activities":[]}}} {"endpoint":"org.hypercerts.claim.searchActivities","case":"filter:authors:one-scalar","calls":[{"binds":["org.hypercerts.claim.activity","did:plc:abcdefghijklmnopqrstuvwx","test",26],"sql":"d384922db1"}],"outcome":{"result":{"activities":[]}}} @@ -3113,12 +3113,12 @@ {"endpoint":"org.hypercerts.collection.listCollections","case":"paged:desc","calls":[{"binds":["org.hypercerts.collection",3],"sql":"3f156e9653"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"}],"outcome":{"result":{"collections":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null},"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"org.hypercerts.collection","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/org.hypercerts.collection/3kabcdefghijc"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.collection","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.collection/3kabcdefghijb"}],"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e636f6c6c656374696f6e2f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"org.hypercerts.collection.listCollections","case":"cursor:valid:desc","calls":[{"binds":["org.hypercerts.collection","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.collection/3kabcdefghijk",26],"sql":"926179a34c"}],"outcome":{"result":{"collections":[]}}} {"endpoint":"org.hypercerts.collection.listCollections","case":"cursor:valid+limit=7:desc","calls":[{"binds":["org.hypercerts.collection","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.collection/3kabcdefghijk",8],"sql":"926179a34c"}],"outcome":{"result":{"collections":[]}}} -{"endpoint":"org.hypercerts.collection.listCollections","case":"year0000:cursor:desc","calls":[{"binds":["org.hypercerts.collection","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.collection/3kabcdefghijk",26],"sql":"926179a34c"}],"outcome":{"result":{"collections":[]}}} +{"endpoint":"org.hypercerts.collection.listCollections","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.collection.listCollections","case":"sort=asc","calls":[{"binds":["org.hypercerts.collection",26],"sql":"71a0d93bf2"}],"outcome":{"result":{"collections":[]}}} {"endpoint":"org.hypercerts.collection.listCollections","case":"paged:asc","calls":[{"binds":["org.hypercerts.collection",3],"sql":"71a0d93bf2"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"}],"outcome":{"result":{"collections":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwx","organization":null,"profile":null},"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"org.hypercerts.collection","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.collection/3kabcdefghija"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.collection","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.collection/3kabcdefghijb"}],"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e636f6c6c656374696f6e2f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"org.hypercerts.collection.listCollections","case":"cursor:valid:asc","calls":[{"binds":["org.hypercerts.collection","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.collection/3kabcdefghijk",26],"sql":"66b024f84a"}],"outcome":{"result":{"collections":[]}}} {"endpoint":"org.hypercerts.collection.listCollections","case":"cursor:valid+limit=7:asc","calls":[{"binds":["org.hypercerts.collection","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.collection/3kabcdefghijk",8],"sql":"66b024f84a"}],"outcome":{"result":{"collections":[]}}} -{"endpoint":"org.hypercerts.collection.listCollections","case":"year0000:cursor:asc","calls":[{"binds":["org.hypercerts.collection","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.collection/3kabcdefghijk",26],"sql":"66b024f84a"}],"outcome":{"result":{"collections":[]}}} +{"endpoint":"org.hypercerts.collection.listCollections","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.collection.listCollections","case":"filter:authors:many","calls":[{"binds":["org.hypercerts.collection","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy","did:plc:abcdefghijklmnopqrstuvwz",26],"sql":"c8876d3546"}],"outcome":{"result":{"collections":[]}}} {"endpoint":"org.hypercerts.collection.listCollections","case":"filter:authors:one","calls":[{"binds":["org.hypercerts.collection","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"2888f75ed0"}],"outcome":{"result":{"collections":[]}}} {"endpoint":"org.hypercerts.collection.listCollections","case":"filter:authors:one-scalar","calls":[{"binds":["org.hypercerts.collection","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"2888f75ed0"}],"outcome":{"result":{"collections":[]}}} @@ -3251,12 +3251,12 @@ {"endpoint":"org.hypercerts.collection.searchCollections","case":"paged:desc","calls":[{"binds":["org.hypercerts.collection","test",3],"sql":"b69842f8a9"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"}],"outcome":{"result":{"collections":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null},"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"org.hypercerts.collection","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/org.hypercerts.collection/3kabcdefghijc"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.collection","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.collection/3kabcdefghijb"}],"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e636f6c6c656374696f6e2f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"org.hypercerts.collection.searchCollections","case":"cursor:valid:desc","calls":[{"binds":["org.hypercerts.collection","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.collection/3kabcdefghijk",26],"sql":"6ae42317e4"}],"outcome":{"result":{"collections":[]}}} {"endpoint":"org.hypercerts.collection.searchCollections","case":"cursor:valid+limit=7:desc","calls":[{"binds":["org.hypercerts.collection","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.collection/3kabcdefghijk",8],"sql":"6ae42317e4"}],"outcome":{"result":{"collections":[]}}} -{"endpoint":"org.hypercerts.collection.searchCollections","case":"year0000:cursor:desc","calls":[{"binds":["org.hypercerts.collection","test","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.collection/3kabcdefghijk",26],"sql":"6ae42317e4"}],"outcome":{"result":{"collections":[]}}} +{"endpoint":"org.hypercerts.collection.searchCollections","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.collection.searchCollections","case":"sort=asc","calls":[{"binds":["org.hypercerts.collection","test",26],"sql":"78f494786e"}],"outcome":{"result":{"collections":[]}}} {"endpoint":"org.hypercerts.collection.searchCollections","case":"paged:asc","calls":[{"binds":["org.hypercerts.collection","test",3],"sql":"78f494786e"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"26f10c09e4"}],"outcome":{"result":{"collections":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwx","organization":null,"profile":null},"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"org.hypercerts.collection","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.collection/3kabcdefghija"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.collection","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.collection/3kabcdefghijb"}],"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e636f6c6c656374696f6e2f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"org.hypercerts.collection.searchCollections","case":"cursor:valid:asc","calls":[{"binds":["org.hypercerts.collection","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.collection/3kabcdefghijk",26],"sql":"bc4dedfbb8"}],"outcome":{"result":{"collections":[]}}} {"endpoint":"org.hypercerts.collection.searchCollections","case":"cursor:valid+limit=7:asc","calls":[{"binds":["org.hypercerts.collection","test","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.collection/3kabcdefghijk",8],"sql":"bc4dedfbb8"}],"outcome":{"result":{"collections":[]}}} -{"endpoint":"org.hypercerts.collection.searchCollections","case":"year0000:cursor:asc","calls":[{"binds":["org.hypercerts.collection","test","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.collection/3kabcdefghijk",26],"sql":"bc4dedfbb8"}],"outcome":{"result":{"collections":[]}}} +{"endpoint":"org.hypercerts.collection.searchCollections","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.collection.searchCollections","case":"filter:authors:many","calls":[{"binds":["org.hypercerts.collection","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy","did:plc:abcdefghijklmnopqrstuvwz","test",26],"sql":"4e7d5b3238"}],"outcome":{"result":{"collections":[]}}} {"endpoint":"org.hypercerts.collection.searchCollections","case":"filter:authors:one","calls":[{"binds":["org.hypercerts.collection","did:plc:abcdefghijklmnopqrstuvwx","test",26],"sql":"acdeba05c5"}],"outcome":{"result":{"collections":[]}}} {"endpoint":"org.hypercerts.collection.searchCollections","case":"filter:authors:one-scalar","calls":[{"binds":["org.hypercerts.collection","did:plc:abcdefghijklmnopqrstuvwx","test",26],"sql":"acdeba05c5"}],"outcome":{"result":{"collections":[]}}} @@ -3548,12 +3548,12 @@ {"endpoint":"org.hypercerts.context.listAttachments","case":"paged:desc","calls":[{"binds":["org.hypercerts.context.attachment",3],"sql":"7d4bb27bf2"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"attachments":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null},"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"org.hypercerts.context.attachment","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/org.hypercerts.context.attachment/3kabcdefghijc"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.context.attachment","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.context.attachment/3kabcdefghijb"}],"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e636f6e746578742e6174746163686d656e742f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"org.hypercerts.context.listAttachments","case":"cursor:valid:desc","calls":[{"binds":["org.hypercerts.context.attachment","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.context.attachment/3kabcdefghijk",26],"sql":"165b82cc8c"}],"outcome":{"result":{"attachments":[]}}} {"endpoint":"org.hypercerts.context.listAttachments","case":"cursor:valid+limit=7:desc","calls":[{"binds":["org.hypercerts.context.attachment","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.context.attachment/3kabcdefghijk",8],"sql":"165b82cc8c"}],"outcome":{"result":{"attachments":[]}}} -{"endpoint":"org.hypercerts.context.listAttachments","case":"year0000:cursor:desc","calls":[{"binds":["org.hypercerts.context.attachment","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.context.attachment/3kabcdefghijk",26],"sql":"165b82cc8c"}],"outcome":{"result":{"attachments":[]}}} +{"endpoint":"org.hypercerts.context.listAttachments","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.context.listAttachments","case":"sort=asc","calls":[{"binds":["org.hypercerts.context.attachment",26],"sql":"659e7408ff"}],"outcome":{"result":{"attachments":[]}}} {"endpoint":"org.hypercerts.context.listAttachments","case":"paged:asc","calls":[{"binds":["org.hypercerts.context.attachment",3],"sql":"659e7408ff"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"attachments":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwx","organization":null,"profile":null},"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"org.hypercerts.context.attachment","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.context.attachment/3kabcdefghija"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.context.attachment","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.context.attachment/3kabcdefghijb"}],"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e636f6e746578742e6174746163686d656e742f336b6162636465666768696a62222c2276223a317d"}}} {"endpoint":"org.hypercerts.context.listAttachments","case":"cursor:valid:asc","calls":[{"binds":["org.hypercerts.context.attachment","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.context.attachment/3kabcdefghijk",26],"sql":"1c9c2867bb"}],"outcome":{"result":{"attachments":[]}}} {"endpoint":"org.hypercerts.context.listAttachments","case":"cursor:valid+limit=7:asc","calls":[{"binds":["org.hypercerts.context.attachment","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.context.attachment/3kabcdefghijk",8],"sql":"1c9c2867bb"}],"outcome":{"result":{"attachments":[]}}} -{"endpoint":"org.hypercerts.context.listAttachments","case":"year0000:cursor:asc","calls":[{"binds":["org.hypercerts.context.attachment","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.context.attachment/3kabcdefghijk",26],"sql":"1c9c2867bb"}],"outcome":{"result":{"attachments":[]}}} +{"endpoint":"org.hypercerts.context.listAttachments","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.context.listAttachments","case":"filter:authors:many","calls":[{"binds":["org.hypercerts.context.attachment","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy","did:plc:abcdefghijklmnopqrstuvwz",26],"sql":"5d8073cadf"}],"outcome":{"result":{"attachments":[]}}} {"endpoint":"org.hypercerts.context.listAttachments","case":"filter:authors:one","calls":[{"binds":["org.hypercerts.context.attachment","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"e918e80b8b"}],"outcome":{"result":{"attachments":[]}}} {"endpoint":"org.hypercerts.context.listAttachments","case":"filter:authors:one-scalar","calls":[{"binds":["org.hypercerts.context.attachment","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"e918e80b8b"}],"outcome":{"result":{"attachments":[]}}} @@ -3677,12 +3677,12 @@ {"endpoint":"org.hypercerts.context.listEvaluations","case":"paged:desc","calls":[{"binds":["org.hypercerts.context.evaluation",3],"sql":"6d8c64ef3d"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e636f6e746578742e6576616c756174696f6e2f336b6162636465666768696a62222c2276223a317d","evaluations":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null},"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","evaluators":[],"indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"org.hypercerts.context.evaluation","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/org.hypercerts.context.evaluation/3kabcdefghijc"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","evaluators":[],"indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.context.evaluation","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.context.evaluation/3kabcdefghijb"}]}}} {"endpoint":"org.hypercerts.context.listEvaluations","case":"cursor:valid:desc","calls":[{"binds":["org.hypercerts.context.evaluation","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.context.evaluation/3kabcdefghijk",26],"sql":"4348a3a8ae"}],"outcome":{"result":{"evaluations":[]}}} {"endpoint":"org.hypercerts.context.listEvaluations","case":"cursor:valid+limit=7:desc","calls":[{"binds":["org.hypercerts.context.evaluation","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.context.evaluation/3kabcdefghijk",8],"sql":"4348a3a8ae"}],"outcome":{"result":{"evaluations":[]}}} -{"endpoint":"org.hypercerts.context.listEvaluations","case":"year0000:cursor:desc","calls":[{"binds":["org.hypercerts.context.evaluation","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.context.evaluation/3kabcdefghijk",26],"sql":"4348a3a8ae"}],"outcome":{"result":{"evaluations":[]}}} +{"endpoint":"org.hypercerts.context.listEvaluations","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.context.listEvaluations","case":"sort=asc","calls":[{"binds":["org.hypercerts.context.evaluation",26],"sql":"b9753b45e0"}],"outcome":{"result":{"evaluations":[]}}} {"endpoint":"org.hypercerts.context.listEvaluations","case":"paged:asc","calls":[{"binds":["org.hypercerts.context.evaluation",3],"sql":"b9753b45e0"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e636f6e746578742e6576616c756174696f6e2f336b6162636465666768696a62222c2276223a317d","evaluations":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwx","organization":null,"profile":null},"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","evaluators":[],"indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"org.hypercerts.context.evaluation","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.context.evaluation/3kabcdefghija"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","evaluators":[],"indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.context.evaluation","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.context.evaluation/3kabcdefghijb"}]}}} {"endpoint":"org.hypercerts.context.listEvaluations","case":"cursor:valid:asc","calls":[{"binds":["org.hypercerts.context.evaluation","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.context.evaluation/3kabcdefghijk",26],"sql":"3579ec0f41"}],"outcome":{"result":{"evaluations":[]}}} {"endpoint":"org.hypercerts.context.listEvaluations","case":"cursor:valid+limit=7:asc","calls":[{"binds":["org.hypercerts.context.evaluation","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.context.evaluation/3kabcdefghijk",8],"sql":"3579ec0f41"}],"outcome":{"result":{"evaluations":[]}}} -{"endpoint":"org.hypercerts.context.listEvaluations","case":"year0000:cursor:asc","calls":[{"binds":["org.hypercerts.context.evaluation","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.context.evaluation/3kabcdefghijk",26],"sql":"3579ec0f41"}],"outcome":{"result":{"evaluations":[]}}} +{"endpoint":"org.hypercerts.context.listEvaluations","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.context.listEvaluations","case":"filter:authors:many","calls":[{"binds":["org.hypercerts.context.evaluation","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy","did:plc:abcdefghijklmnopqrstuvwz",26],"sql":"9b7df21f2c"}],"outcome":{"result":{"evaluations":[]}}} {"endpoint":"org.hypercerts.context.listEvaluations","case":"filter:authors:one","calls":[{"binds":["org.hypercerts.context.evaluation","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"56eaf46105"}],"outcome":{"result":{"evaluations":[]}}} {"endpoint":"org.hypercerts.context.listEvaluations","case":"filter:authors:one-scalar","calls":[{"binds":["org.hypercerts.context.evaluation","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"56eaf46105"}],"outcome":{"result":{"evaluations":[]}}} @@ -4043,12 +4043,12 @@ {"endpoint":"org.hypercerts.funding.listReceipts","case":"paged:desc","calls":[{"binds":["org.hypercerts.funding.receipt",3],"sql":"7a3a9df1b7"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a2264657363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e66756e64696e672e726563656970742f336b6162636465666768696a62222c2276223a317d","receipts":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null},"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"org.hypercerts.funding.receipt","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/org.hypercerts.funding.receipt/3kabcdefghijc"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.funding.receipt","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.funding.receipt/3kabcdefghijb"}]}}} {"endpoint":"org.hypercerts.funding.listReceipts","case":"cursor:valid:desc","calls":[{"binds":["org.hypercerts.funding.receipt","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.funding.receipt/3kabcdefghijk",26],"sql":"47dcb081c6"}],"outcome":{"result":{"receipts":[]}}} {"endpoint":"org.hypercerts.funding.listReceipts","case":"cursor:valid+limit=7:desc","calls":[{"binds":["org.hypercerts.funding.receipt","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.funding.receipt/3kabcdefghijk",8],"sql":"47dcb081c6"}],"outcome":{"result":{"receipts":[]}}} -{"endpoint":"org.hypercerts.funding.listReceipts","case":"year0000:cursor:desc","calls":[{"binds":["org.hypercerts.funding.receipt","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.funding.receipt/3kabcdefghijk",26],"sql":"47dcb081c6"}],"outcome":{"result":{"receipts":[]}}} +{"endpoint":"org.hypercerts.funding.listReceipts","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.funding.listReceipts","case":"sort=asc","calls":[{"binds":["org.hypercerts.funding.receipt",26],"sql":"0b5e125e2f"}],"outcome":{"result":{"receipts":[]}}} {"endpoint":"org.hypercerts.funding.listReceipts","case":"paged:asc","calls":[{"binds":["org.hypercerts.funding.receipt",3],"sql":"0b5e125e2f"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a22617363222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e66756e64696e672e726563656970742f336b6162636465666768696a62222c2276223a317d","receipts":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwx","organization":null,"profile":null},"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"org.hypercerts.funding.receipt","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.funding.receipt/3kabcdefghija"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.funding.receipt","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.funding.receipt/3kabcdefghijb"}]}}} {"endpoint":"org.hypercerts.funding.listReceipts","case":"cursor:valid:asc","calls":[{"binds":["org.hypercerts.funding.receipt","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.funding.receipt/3kabcdefghijk",26],"sql":"9c5d84a518"}],"outcome":{"result":{"receipts":[]}}} {"endpoint":"org.hypercerts.funding.listReceipts","case":"cursor:valid+limit=7:asc","calls":[{"binds":["org.hypercerts.funding.receipt","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.funding.receipt/3kabcdefghijk",8],"sql":"9c5d84a518"}],"outcome":{"result":{"receipts":[]}}} -{"endpoint":"org.hypercerts.funding.listReceipts","case":"year0000:cursor:asc","calls":[{"binds":["org.hypercerts.funding.receipt","0000-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.funding.receipt/3kabcdefghijk",26],"sql":"9c5d84a518"}],"outcome":{"result":{"receipts":[]}}} +{"endpoint":"org.hypercerts.funding.listReceipts","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.funding.listReceipts","case":"filter:authors:many","calls":[{"binds":["org.hypercerts.funding.receipt","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy","did:plc:abcdefghijklmnopqrstuvwz",26],"sql":"18e7a85675"}],"outcome":{"result":{"receipts":[]}}} {"endpoint":"org.hypercerts.funding.listReceipts","case":"filter:authors:one","calls":[{"binds":["org.hypercerts.funding.receipt","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"032ae5b6b1"}],"outcome":{"result":{"receipts":[]}}} {"endpoint":"org.hypercerts.funding.listReceipts","case":"filter:authors:one-scalar","calls":[{"binds":["org.hypercerts.funding.receipt","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"032ae5b6b1"}],"outcome":{"result":{"receipts":[]}}} @@ -4184,12 +4184,12 @@ {"endpoint":"org.hypercerts.vocab.listVocabTags","case":"paged:desc","calls":[{"binds":["org.hypercerts.vocab.tag",3],"sql":"fdd374e87e"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwz","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a2264657363222c2266223a22222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e766f6361622e7461672f336b6162636465666768696a62222c2276223a317d","vocabTags":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwz","organization":null,"profile":null},"cid":"bafyfixture2","did":"did:plc:abcdefghijklmnopqrstuvwz","indexedAt":"2025-01-03T00:00:00Z","record":{"$type":"org.hypercerts.vocab.tag","createdAt":"2025-01-03T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwz/org.hypercerts.vocab.tag/3kabcdefghijc"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.vocab.tag","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.vocab.tag/3kabcdefghijb"}]}}} {"endpoint":"org.hypercerts.vocab.listVocabTags","case":"cursor:valid:desc","calls":[{"binds":["org.hypercerts.vocab.tag","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.vocab.tag/3kabcdefghijk",26],"sql":"2712d7dd78"}],"outcome":{"result":{"vocabTags":[]}}} {"endpoint":"org.hypercerts.vocab.listVocabTags","case":"cursor:valid+limit=7:desc","calls":[{"binds":["org.hypercerts.vocab.tag","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.vocab.tag/3kabcdefghijk",8],"sql":"2712d7dd78"}],"outcome":{"result":{"vocabTags":[]}}} -{"endpoint":"org.hypercerts.vocab.listVocabTags","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor timestamp year must be greater than 0000"}} +{"endpoint":"org.hypercerts.vocab.listVocabTags","case":"year0000:cursor:desc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.vocab.listVocabTags","case":"sort=asc","calls":[{"binds":["org.hypercerts.vocab.tag",26],"sql":"fbade26882"}],"outcome":{"result":{"vocabTags":[]}}} {"endpoint":"org.hypercerts.vocab.listVocabTags","case":"paged:asc","calls":[{"binds":["org.hypercerts.vocab.tag",3],"sql":"fbade26882"},{"binds":["app.certified.actor.profile","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"},{"binds":["app.certified.actor.organization","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy"],"sql":"bb51fad104"}],"outcome":{"result":{"cursor":"7b2264223a22617363222c2266223a22222c2274223a22323032352d30312d30325430303a30303a30302e3030303030305a222c2275223a2261743a2f2f6469643a706c633a6162636465666768696a6b6c6d6e6f7071727374757677792f6f72672e687970657263657274732e766f6361622e7461672f336b6162636465666768696a62222c2276223a317d","vocabTags":[{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwx","organization":null,"profile":null},"cid":"bafyfixture0","did":"did:plc:abcdefghijklmnopqrstuvwx","indexedAt":"2025-01-01T00:00:00Z","record":{"$type":"org.hypercerts.vocab.tag","createdAt":"2025-01-01T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.vocab.tag/3kabcdefghija"},{"author":{"did":"did:plc:abcdefghijklmnopqrstuvwy","organization":null,"profile":null},"cid":"bafyfixture1","did":"did:plc:abcdefghijklmnopqrstuvwy","indexedAt":"2025-01-02T00:00:00Z","record":{"$type":"org.hypercerts.vocab.tag","createdAt":"2025-01-02T00:00:00Z"},"uri":"at://did:plc:abcdefghijklmnopqrstuvwy/org.hypercerts.vocab.tag/3kabcdefghijb"}]}}} {"endpoint":"org.hypercerts.vocab.listVocabTags","case":"cursor:valid:asc","calls":[{"binds":["org.hypercerts.vocab.tag","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.vocab.tag/3kabcdefghijk",26],"sql":"f415ca0b71"}],"outcome":{"result":{"vocabTags":[]}}} {"endpoint":"org.hypercerts.vocab.listVocabTags","case":"cursor:valid+limit=7:asc","calls":[{"binds":["org.hypercerts.vocab.tag","2025-01-01T00:00:00Z","at://did:plc:abcdefghijklmnopqrstuvwx/org.hypercerts.vocab.tag/3kabcdefghijk",8],"sql":"f415ca0b71"}],"outcome":{"result":{"vocabTags":[]}}} -{"endpoint":"org.hypercerts.vocab.listVocabTags","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor timestamp year must be greater than 0000"}} +{"endpoint":"org.hypercerts.vocab.listVocabTags","case":"year0000:cursor:asc","calls":[],"outcome":{"error":"InvalidRequest: cursor is malformed"}} {"endpoint":"org.hypercerts.vocab.listVocabTags","case":"filter:authors:many","calls":[{"binds":["org.hypercerts.vocab.tag","did:plc:abcdefghijklmnopqrstuvwx","did:plc:abcdefghijklmnopqrstuvwy","did:plc:abcdefghijklmnopqrstuvwz",26],"sql":"056193581d"}],"outcome":{"result":{"vocabTags":[]}}} {"endpoint":"org.hypercerts.vocab.listVocabTags","case":"filter:authors:one","calls":[{"binds":["org.hypercerts.vocab.tag","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"cf715d2ab7"}],"outcome":{"result":{"vocabTags":[]}}} {"endpoint":"org.hypercerts.vocab.listVocabTags","case":"filter:authors:one-scalar","calls":[{"binds":["org.hypercerts.vocab.tag","did:plc:abcdefghijklmnopqrstuvwx",26],"sql":"cf715d2ab7"}],"outcome":{"result":{"vocabTags":[]}}} diff --git a/happyview-modules/tests/unit/tooling/listContributorInformation.test.js b/happyview-modules/tests/unit/tooling/listContributorInformation.test.js index e0339a0d..57b4f032 100644 --- a/happyview-modules/tests/unit/tooling/listContributorInformation.test.js +++ b/happyview-modules/tests/unit/tooling/listContributorInformation.test.js @@ -19,6 +19,9 @@ test("listContributorInformation filters repeated authors and resumes in the sel read("lua/shared/datetimeValidation.lua"), read("lua/shared/listValidation.lua"), read("lua/shared/listQuery.lua"), + read("lua/shared/listCursor.lua"), + read("lua/shared/listWhere.lua"), + read("lua/shared/createdAtSort.lua"), read("lua/src/listContributorInformation.lua"), ]); const program = `JSON_NULL = {} diff --git a/happyview-modules/tests/unit/tooling/vocab-tags.test.js b/happyview-modules/tests/unit/tooling/vocab-tags.test.js index a81dd610..7e00f17a 100644 --- a/happyview-modules/tests/unit/tooling/vocab-tags.test.js +++ b/happyview-modules/tests/unit/tooling/vocab-tags.test.js @@ -446,7 +446,7 @@ test("listVocabTags rejects a year-zero cursor timestamp before querying", async await runLua({ endpoint: "listVocabTags", params: { sortDirection: "asc", cursor: cursor({ timestamp: "0000-01-01T00:00:00Z" }) }, - expectError: "InvalidRequest: cursor timestamp year must be greater than 0000", + expectError: "InvalidRequest: cursor is malformed", assertions: "assert(#calls == 0)", }); });