Commit graph

136 commits

Author SHA1 Message Date
acfd34f259
Trigger workflow
All checks were successful
Tests / test (pull_request) Successful in 17s
2024-08-17 19:11:43 +01:00
a52f2c6545
try skipping job on draft PRs
All checks were successful
Tests / test (pull_request) Has been skipped
2024-08-17 19:00:52 +01:00
2aa49b2b2e
add test target as job input
All checks were successful
Tests / test (pull_request) Successful in 16s
2024-08-17 18:17:44 +01:00
91c2ffeb93
run mage action without input (error expected)
Some checks failed
Tests / test (pull_request) Failing after 4s
2024-08-17 18:13:56 +01:00
545ba48f4a
test with go install
All checks were successful
Tests / test (pull_request) Successful in 1m29s
2024-08-17 17:56:12 +01:00
cdcca4cff6
add our first unit test
All checks were successful
Tests / test (pull_request) Successful in 22s
2024-08-17 17:40:17 +01:00
08981319e1
add Dockerfile to pre-install mage
All checks were successful
Tests / test (pull_request) Successful in 59s
2024-08-17 17:21:28 +01:00
d9f5215462
there was a typo
Some checks failed
Tests / test (pull_request) Failing after 18s
2024-08-17 16:49:46 +01:00
52d2b45a92
add Dockerfile
Some checks failed
Tests / test (pull_request) Failing after 4s
2024-08-17 16:46:03 +01:00
72ab61e28b
checkpoint: add workflow for tests
Some checks failed
Tests / test (pull_request) Failing after 5s
2024-08-17 16:35:27 +01:00
009515ddb4
[skip ci] chore: set minimum go version to 1.23.0 2024-08-17 11:45:40 +01:00
dd6c21afe8
refactor: clean up errors
All checks were successful
REUSE Compliance Check / check (push) Successful in 6s
- Created generic Error types to remove the need to import the errors
  package.
- Used the generic Error types in place of the single use custom Error
  types that have no fields.
- Created new Error types where necessary.

PR: #50
2024-08-17 11:31:06 +01:00
f223e0417c
fix: view the summary of a status
All checks were successful
REUSE Compliance Check / check (push) Successful in 6s
View the status' summary/spoiler/content warning text if it exists.
2024-08-17 03:49:17 +01:00
ee13dcde00
chore: update .golangci.yaml
All checks were successful
REUSE Compliance Check / check (push) Successful in 6s
2024-08-16 23:12:17 +01:00
39d9ef1a38
fix(BREAKING): remove the from-file flag
All checks were successful
REUSE Compliance Check / check (push) Successful in 8s
The from-file flag was used to read text from a file for creating
statuses. This flag is now removed and replaced with the file@ prefix
with the content flag.

For example, --from-file status.md is now replaced with
--content file@status.md
2024-08-16 19:57:44 +01:00
c0f1f7d03a
feat: deleting statuses
All checks were successful
REUSE Compliance Check / check (push) Successful in 11s
This commit adds support for deleting statuses.

Before sending the delete request to the instance, Enbas will first
verify that the status that the user wants to delete actually belongs to
them.

The user has the option to save the text of the deleted status. This
will be written to a text file within the cache directory.

PR: #48
Resolves: #44
2024-08-16 18:53:08 +01:00
9bcb924ac0
ci: add workflow for REUSE Compliance Check
All checks were successful
REUSE Compliance Check / check (push) Successful in 5s
For now the compliance checks will be performed whenever a change is
made on the main branch.
2024-08-16 16:07:53 +01:00
0a41516ae9
chore: update REUSE.toml 2024-08-16 15:03:16 +01:00
3037af60ed
feat: mute and unmute statuses
This commit adds support for muting and unmuting statuses. When viewing
a status the user can now see whether they've muted the status or not.
A status can only be muted by the user if they own it or are mentioned
in it.

PR: apollo/enbas#47
Resolves: apollo/enbas#46
2024-08-16 14:42:57 +01:00
42f54c6020
feat: add more support for media attachments
This commit adds more support for interacting with media attachments.
Now users can:

- Upload media to their instances and create media attachments.
- Edit existing media attachments.
- Attach one or more existing media to a new status.
- Upload and attach one or more media files to a new status.

PR: apollo/enbas#42
Resolves: apollo/enbas#29
2024-08-15 21:40:17 +01:00
4e76d20a7a
fix: strip trailing empty line when reading files
Updated the ReadFile function in 'utilities' by using the Scanner from
the bufio package to read lines from a text file. The trailing empty
line is stripped after scanning and before returning back to the caller.
2024-08-15 15:24:25 +01:00
eb016b96e9
fix(BREAKING): update poll interaction
Summary:

This commit updates and enhances poll interaction. From now on users
will interact with a poll via the status that contains it. Direct
interaction with the poll (via the poll's ID) is no longer supported.
This helps resolve an issue where it wasn't possible to find the owner
of the poll when interacting with it directly.

Changes:

- Users can no longer view a poll directly using the Poll ID.
  Instead polls can be viewed when viewing statuses or timelines.
- More details about a poll is shown in statuses and timelines.
- Votes are now added to polls via statuses.
- Poll results are hidden unless the following conditions are met.
    - The user is the owner of the poll.
    - The poll has expired.
    - The user has already voted in the poll.
- Enbas can now detect and stop a poll owner from voting in their own
  poll.
- When a status is created Enbas will now only print the ID of the
  created status instead of the whole thing.

PR: apollo/enbas#43

Resolves apollo/enbas#39
2024-08-14 11:29:30 +01:00
a0eab3b6ae
refactor: clean up the getAccountID function sig
The getAccountID function no longer needs the path to the credentials
file.
2024-08-13 23:51:16 +01:00
878a898d4c
fix: use VerifyCredentials to get account info
Use the clients VerifyCredentials method to get the user's account
information.
2024-08-13 23:41:12 +01:00
b77bbaa6e0
fix: updated internal/executor/executors.go 2024-08-13 17:18:55 +01:00
84091f398d
feat: add Enbas CLI schema and code generator
Summary:

- Created a custom CLI schema for Enbas which will act as the Source
  of Truth for code and document generation.
- Created a code generator which uses the schema to generate the
  executor definitions and code in the internal usage package.

Changes:

- Created the Enbas CLI schema as the Source of Truth for Enbas.
- Created the code generator that generates the executor
  definitions and code in the usage package.
- Regenerated the executor definitions using the code generator.
- Moved the custom flag value types to the new internal flag
  package.
- Created a new flag value type for the bool pointer to replace the
  flag.BoolFunc() used for the sensitive and no-color flags.
- Moved the version and build variables to the new internal version
  package to simplify the version executor.
- Created a new usage package and moved the usage functions there.
- Changed the type of the account-name flag from string to the
  internal StringSliceValue type.
2024-08-13 14:53:26 +01:00
299b134b58
chore: set minimum go version to 1.22.6 2024-08-09 09:31:51 +01:00
cb7ac4175d
style: ran gofmt 2024-08-02 13:04:40 +01:00
2ccfdc4336
refactor: update client package
- add a type for the parameters of the sendRequest method
- contentType is now a parameter for the sendRequest method.
2024-08-02 08:15:15 +01:00
bad22ecd70
feat: add all-images and all-videos flags
When viewing media attachments from a status, the all-images and
all-videos flags will allow users to view all images or videos,
respectively.
2024-08-01 04:24:47 +01:00
3d20adfa57
chore: REUSE.toml
- Replace .reuse/dep5 with the new REUSE.toml file.
- Add licensing information to REUSE.toml and remove the licensing
  headers from the source files.
2024-08-01 04:01:38 +01:00
60aeec06f9
feat: add all-images and all-videos flags
When viewing media attachments from a status, the all-images and
all-videos flags will allow users to view all images or videos
respectively.
2024-08-01 00:54:27 +01:00
6bc00138ab
feat: show statuses created from an account
When viewing an account's information the user can now optionally view
the statuses that the account has created.
2024-08-01 00:24:31 +01:00
c468d1fb62
refactor: create constant values for base paths
Created constant values for the Accounts and Follow Requests base API
paths.
2024-07-10 12:06:36 +01:00
6e260266b1
fix: update the status list printer function
- Show whether a status is a boost, a reply to another status or a
  normal post.
- Move the "Created At" field to a new line.
- Show the date and time when a status was boosted.
2024-07-10 09:14:13 +01:00
2bb801b6d0
feat: add ability to reply to statuses 2024-07-09 03:13:54 +01:00
ec282e207f
refactor: use baseListPath where necessary
Replace the static string of the base list API path with the
baseListPath constant.
2024-07-09 00:25:43 +01:00
28bf902599
fix: improve how lists are displayed
Improve how ordered and unordered lists are displayed within the
contents of a status by adding indentation when a list item is wrapped.

Changes:

- fix: improve how ordered and unordered lists are displayed in status
  and status list views.
- fix: improve how media attachments are displayed in status list views.
- refactor: move the line wrapping and HTML converting functions from
  utilities to the internal printer package.
- refactor: the convertHTMLToText now (optionally) applies line
  wrapping after conversion.
2024-07-08 22:53:13 +01:00
c72340490d
fix: user's boosted action in status list view
Correctly use status.Reblogged instead of status.Bookmarked value when
showing if a user has boosted a status or not in the status list view.
2024-07-07 19:15:23 +01:00
e0b4174a76
chore: add missing license annotation 2024-07-06 18:11:15 +01:00
181384fea3
docs: add the user manual
The user manual: a page that users can reference when playing with
Enbas.
2024-07-06 17:36:42 +01:00
d52bb3fdf4
fix: print error messages from instance
If an error occurs when sending a request to an instance, try and decode
and print the error message back to the user.
2024-07-04 11:27:00 +01:00
e5eb2d72a8
fix: set minimum go version to 1.22.5 2024-07-03 23:25:22 +01:00
f64f8a43a6
fix: command line format for showing followers
CHANGES:

- When viewing followers and followings from an account, the from flag
  must now be set by the user.
    - enbas show --type followers --from account --my-account
    - enbas show --type following --from account --account-name john

- New error type for unsupported show operations: Return an error if
  enbas detects an unsupported show operation (e.g. showing media from a
  list).
2024-07-03 14:20:25 +01:00
a8aeec2fbf
fix: update description for the vote flag 2024-07-03 13:34:27 +01:00
5ec1cc0e18
fix: rename the choose flag.
Rename to choose flag to vote for voting in polls.
2024-07-03 13:21:32 +01:00
1541aa6936
docs(README): fix link to installation guide 2024-07-02 13:31:14 +01:00
c12a2ce293
docs(README): update mirrored forges
Add Radicle as a forge (network) that the main branch is mirrored to.
2024-07-02 11:16:32 +01:00
4d0a42ba23
fix: mute accounts indefinitely by default 2024-07-01 21:27:04 +01:00
e4cce2cae4
refactor: update structure of switch executor 2024-07-01 21:12:20 +01:00