···8282 application <atfile-uri> opens with\n
8383 now
8484 Get date in ISO-8601 format\n
8585- record add <record-json> [<collection>]
8686- record get <key> [<collection>] [<actor>]
8585+ record list <at-uri>
8686+ record create <collection> <record-json>
8787+ record create <at-uri> <record-json>
8788 record get <at-uri>
8888- record put <key> <record-json> [<collection>]
8989- record put <at-uri> <record-json>
9090- record rm <key> [<collection>]
9191- record rm <at-uri>
8989+ record update <at-uri> <record-json>
9090+ record recreate <at-uri> <record-json>
9191+ record delete <at-uri>
9292 Manage records on a repository
9393- ā ļø No validation is performed. Here be dragons!
9494- ā¹ļø <collection> defaults to '$_nsid_upload'\n
9393+ ā ļø No validation is performed. Here be dragons!\n
9594 resolve <actor>
9695 Get details for <actor>\n
9796 stream [<collection(s)>] [<did(s)>] [<cursor>] [<compress>]
-88
src/commands/old_cmds.sh
···518518 fi
519519}
520520521521-function atfile.invoke.manage_record() {
522522- function atfile.invoke.manage_record.get_collection() {
523523- collection="$_nsid_upload"
524524- parameter_output="$1"
525525-526526- [[ -n "$parameter_output" ]] && collection="$1" # fuck it, manage all the records from atfile!
527527- echo "$collection"
528528- }
529529-530530- case "$1" in
531531- "create")
532532- collection="$(atfile.invoke.manage_record.get_collection "$3")"
533533- record="$2"
534534- [[ -z "$record" ]] && atfile.die "<record> not set"
535535-536536- record_json="$(echo "$record" | jq)"
537537- # shellcheck disable=SC2181
538538- [[ $? != 0 ]] && atfile.die "Invalid JSON"
539539-540540- com.atproto.repo.createRecord "$_username" "$collection" "$record_json" | jq
541541- ;;
542542- "delete")
543543- collection="$(atfile.invoke.manage_record.get_collection "$3")"
544544- key="$2"
545545- [[ -z "$key" ]] && atfile.die "<key/at-uri> not set"
546546-547547- if [[ "$key" == at:* ]]; then
548548- at_uri="$key"
549549- collection="$(echo "$at_uri" | cut -d "/" -f 4)"
550550- key="$(echo "$at_uri" | cut -d "/" -f 5)"
551551- username="$(echo "$at_uri" | cut -d "/" -f 3)"
552552-553553- [[ "$username" != "$_username" ]] && atfile.die "Unable to delete record ā not owned by you ($_username)"
554554- fi
555555-556556- com.atproto.repo.deleteRecord "$_username" "$collection" "$key" | jq
557557- ;;
558558- "get")
559559- collection="$(atfile.invoke.manage_record.get_collection "$3")"
560560- key="$2"
561561- username="$4"
562562- [[ -z "$key" ]] && atfile.die "<key/at-uri> not set"
563563-564564- if [[ "$key" == at:* ]]; then
565565- at_uri="$key"
566566- collection="$(echo "$at_uri" | cut -d "/" -f 4)"
567567- key="$(echo "$at_uri" | cut -d "/" -f 5)"
568568- username="$(echo "$at_uri" | cut -d "/" -f 3)"
569569- fi
570570-571571- if [[ -z "$username" ]]; then
572572- username="$_username"
573573- else
574574- # shellcheck disable=SC2053
575575- if [[ $username != $_username ]]; then
576576- atfile.util.override_actor "$username"
577577- fi
578578- fi
579579-580580- com.atproto.repo.getRecord "$username" "$collection" "$key" | jq
581581- atfile.util.override_actor_reset
582582- ;;
583583- # BUG: Collection is always blue.zio.atfile.upload when not using at://
584584- "put")
585585- collection="$(atfile.invoke.manage_record.get_collection "$4")"
586586- key="$2"
587587- record="$3"
588588- [[ -z "$key" ]] && atfile.die "<key/at-uri> not set"
589589- [[ -z "$record" ]] && atfile.die "<record> not set"
590590-591591- record_json="$(echo "$record" | jq)"
592592- # shellcheck disable=SC2181
593593- [[ $? != 0 ]] && atfile.die "Invalid JSON"
594594-595595- if [[ "$key" == at:* ]]; then
596596- at_uri="$key"
597597- collection="$(echo "$at_uri" | cut -d "/" -f 4)"
598598- key="$(echo "$at_uri" | cut -d "/" -f 5)"
599599- username="$(echo "$at_uri" | cut -d "/" -f 3)"
600600-601601- [[ "$username" != "$_username" ]] && atfile.die "Unable to put record ā not owned by you ($_username)"
602602- fi
603603-604604- com.atproto.repo.putRecord "$_username" "$collection" "$key" "$record" | jq
605605- ;;
606606- esac
607607-}
608608-609521function atfile.invoke.print() {
610522 key="$1"
611523 unset error