Project

DearDiary.get_projectFunction
get_project(id::Integer)::Optional{Project}

Get a Project by id.

Arguments

  • id::Integer: The id of the project to query.

Returns

A Project object. If the record does not exist, return nothing.

source
get_project(client::Client, id::Integer)::Optional{Project}

Fetch a Project via GET /project/{id} on the API behind client. Returns nothing when the server replies 404 (record missing or viewer lacks ReadPermission) and raises ClientError for other failures.

source
DearDiary.get_projectsFunction
get_projects()::Array{Project, 1}

Get all Project.

Returns

An array of Project objects.

source
get_projects(user::User)::Array{Project,1}

Return the projects visible to user.

Admins see every project. Non-admins see only projects where they have a UserPermission record with ReadPermission granted; projects without a matching permission row are omitted entirely so the dashboard never shows cards the viewer cannot open.

Arguments

  • user::User: The viewer.

Returns

An array of Project objects scoped to the user's read access.

source
get_projects(client::Client)::Array{Project,1}

List every Project the authenticated viewer can read via GET /project/. Admins receive every project; non-admins receive only those with ReadPermission granted.

source
DearDiary.create_projectFunction
create_project(user_id::Integer, name::AbstractString)::NamedTuple{id::Optional{<:Int64},status::DataType}

Create a Project.

Arguments

  • user_id::Integer: The id of the user creating the project. The user must have admin privileges.
  • name::AbstractString: The name of the project.

Returns

  • The created project ID. If an error occurs, nothing is returned.
  • An UpsertResult. Created if the record was successfully created, Duplicate if the record already exists, Unprocessable if the record violates a constraint, and Error if an error occurred while creating the record.
source
create_project(name::AbstractString)::NamedTuple{id::Optional{<:Int64},status::DataType}

Create a Project. Uses the "default" user to create the project.

Arguments

  • name::AbstractString: The name of the project.

Returns

  • The created project ID. If an error occurs, nothing is returned.
  • An UpsertResult. Created if the record was successfully created, Duplicate if the record already exists, Unprocessable if the record violates a constraint, and Error if an error occurred while creating the record.
source
create_project(client::Client, name::AbstractString)::Int64

Create a Project named name via POST /project/. The route requires an admin viewer; non-admin callers receive 403 ADMIN_REQUIRED. Returns the new project id.

source
DearDiary.update_projectFunction
update_project(id::Int, name::Optional{AbstractString}, description::Optional{AbstractString})::Type{<:UpsertResult}

Update a Project record.

Arguments

  • id::Integer: The id of the project to update.
  • name::Optional{AbstractString}: The new name for the project.
  • description::Optional{AbstractString}: The new description for the project.

Returns

An UpsertResult. Updated if the record was successfully updated (or no changes were made), Duplicate if the record already exists, Unprocessable if the record violates a constraint, and Error if an error occurred while creating the record.

source
update_project(client::Client, id::Integer; name=nothing, description=nothing)::Nothing

Patch a Project via PATCH /project/{id}. Any keyword left as nothing is left untouched server-side. Admin-only. Raises ClientError on failure.

source