This repository has been archived by the owner on Mar 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Add deprecation notice #66
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{:files {:extensions #{"clj" "cljs" "cljc" "cljx" "edn"} | ||
:ignore #{"target" ".git" ".idea" ".vscode" "node_modules"}} | ||
:rules {:namespaces {:enabled? false}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Deploy to Clojars | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
|
||
- name: Cache maven dependencies | ||
uses: actions/cache@v4 | ||
env: | ||
cache-name: cache-maven | ||
with: | ||
path: ~/.m2 | ||
save-always: true | ||
key: ${{ runner.os }}-clj-${{ hashFiles('**/project.clj') }} | ||
restore-keys: | | ||
${{ runner.os }}-clj | ||
|
||
- name: Install Clojure dependencies | ||
run: | | ||
lein deps && lein project-version | ||
|
||
- name: Run sanity tests | ||
run: lein test | ||
|
||
- name: Run build test | ||
run: lein jar | ||
|
||
- name: Publish to Clojars | ||
env: | ||
CLOJARS_USER: ${{ secrets.CLOJARS_USER }} | ||
CLOJARS_PASS: ${{ secrets.CLOJARS_PASS }} | ||
run: lein deploy clojars | ||
|
||
- name: Resolve version | ||
id: versionchk | ||
run: echo "::set-output name=VERSION::$(lein project-version)" | ||
|
||
- name: Push Tag | ||
uses: hole19/[email protected] | ||
env: | ||
TAG: v${{ steps.versionchk.outputs.VERSION }} | ||
GITHUB_TOKEN: ${{ secrets.WALL_BREW_BOT_PAT }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,108 @@ | ||
pom.xml | ||
## Linter Caches | ||
|
||
### clj-kondo | ||
**/.clj-kondo/.cache | ||
/.clj-kondo/.cache | ||
/cli/.clj-kondo/ | ||
/.clj-kondo/.cache | ||
.clj-kondo/.cache/ | ||
|
||
### Clojure LSP | ||
**/.lsp/.cache | ||
/.lsp/.cache | ||
/clojure-lsp | ||
lib/clojure-lsp.integration-test.out | ||
.lsp/ | ||
|
||
## Editors | ||
|
||
### Calva | ||
*.calva | ||
/.calva/output-window | ||
output.calva-repl | ||
|
||
### VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
|
||
### IntelliJ / Cursive | ||
.idea | ||
/.idea | ||
|
||
### Emacs | ||
/.emacs.desktop | ||
/.emacs.desktop.lock | ||
*.elc | ||
auto-save-list | ||
tramp | ||
|
||
### Vim | ||
*.swp | ||
*.swo | ||
Session.vim | ||
Sessionx.vim | ||
|
||
## Operating System Files | ||
|
||
### OSX | ||
.DS_Store | ||
/.DS_Store | ||
.DS_Store? | ||
|
||
### Windows | ||
Thumbs.db | ||
ehthumbs.db | ||
ehthumbs_vista.db | ||
|
||
## Build Tools | ||
|
||
### Leiningen | ||
/.lein-failures | ||
/.lein-repl-history | ||
/.lh | ||
/*.jar | ||
/.classpath | ||
/.project | ||
/.settings/ | ||
/reports | ||
/test.clj | ||
/.cpcache | ||
/.rebel_readline_history | ||
/.rebel_readline_history.lock | ||
.lein-deps-sum | ||
.lein-repl-history | ||
.lein-plugins/ | ||
.lein-failures | ||
.nrepl-port | ||
|
||
### Homebrew | ||
.cask/ | ||
.planck_cache | ||
.yagni | ||
|
||
### Maven | ||
pom.xml.asc | ||
*.jar | ||
*.class | ||
/lib/ | ||
/classes/ | ||
/target/ | ||
/checkouts/ | ||
.lein-deps-sum | ||
.lein-repl-history | ||
.lein-plugins/ | ||
.lein-failures | ||
.nrepl-port | ||
|
||
### Tools.deps | ||
.cpcache/ | ||
|
||
### NPM (Used for ClojureScript) | ||
/dist | ||
/tmp | ||
/out-tsc | ||
node_modules/ | ||
jspm_packages/ | ||
.npm | ||
.eslintcache | ||
.node_repl_history | ||
|
||
# This file was automatically copied and populated by rebroadcast | ||
# Do not edit this file directly, instead modify the source at https://github.com/Wall-Brew-Co/rebroadcast/blob/master/sources/clojure/.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## v1.1.0 / 2024 Mar 10 | ||
|
||
> This release marks the library as deprecated | ||
|
||
## v1.0.0 / 2021 Oct 22 | ||
|
||
> This release adds all initial functionality |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.wallbrew</groupId> | ||
<artifactId>strawpoll-client</artifactId> | ||
<packaging>jar</packaging> | ||
<version>1.1.0</version> | ||
<name>strawpoll-client</name> | ||
<description>A clj-http client library for https://strawpoll.com/</description> | ||
<url>https://github.com/Wall-Brew-Co/strawpoll-client</url> | ||
<licenses> | ||
<license> | ||
<name>MIT</name> | ||
<url>https://opensource.org/licenses/MIT</url> | ||
</license> | ||
</licenses> | ||
<scm> | ||
<url>https://github.com/Wall-Brew-Co/strawpoll-client</url> | ||
<connection>scm:git:git://github.com/Wall-Brew-Co/strawpoll-client.git</connection> | ||
<developerConnection>scm:git:ssh://[email protected]/Wall-Brew-Co/strawpoll-client.git</developerConnection> | ||
<tag>a950d5a52f4a77010c121b95b5b7a78f94971021</tag> | ||
</scm> | ||
<build> | ||
<sourceDirectory>src</sourceDirectory> | ||
<testSourceDirectory>test</testSourceDirectory> | ||
<resources> | ||
<resource> | ||
<directory>resources</directory> | ||
</resource> | ||
</resources> | ||
<testResources> | ||
<testResource> | ||
<directory>resources</directory> | ||
</testResource> | ||
</testResources> | ||
<directory>target</directory> | ||
<outputDirectory>target/classes</outputDirectory> | ||
<plugins/> | ||
</build> | ||
<repositories> | ||
<repository> | ||
<id>central</id> | ||
<url>https://repo1.maven.org/maven2/</url> | ||
<snapshots> | ||
<enabled>false</enabled> | ||
</snapshots> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
</repository> | ||
<repository> | ||
<id>clojars</id> | ||
<url>https://repo.clojars.org/</url> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
</repository> | ||
</repositories> | ||
<dependencyManagement> | ||
<dependencies/> | ||
</dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>cheshire</groupId> | ||
<artifactId>cheshire</artifactId> | ||
<version>5.12.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>clj-http</groupId> | ||
<artifactId>clj-http</artifactId> | ||
<version>3.12.3</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.clojure</groupId> | ||
<artifactId>clojure</artifactId> | ||
<version>1.11.2</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>circleci</groupId> | ||
<artifactId>bond</artifactId> | ||
<version>0.6.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>clj-http-fake</groupId> | ||
<artifactId>clj-http-fake</artifactId> | ||
<version>1.0.4</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> | ||
|
||
<!-- This file was autogenerated by Leiningen. | ||
Please do not edit it directly; instead edit project.clj and regenerate it. | ||
It should not be considered canonical data. For more information see | ||
https://codeberg.org/leiningen/leiningen --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,28 @@ | ||
(defproject com.wallbrew/strawpoll-client "1.0.0" | ||
(defproject com.wallbrew/strawpoll-client "1.1.0" | ||
:description "A clj-http client library for https://strawpoll.com/" | ||
:url "https://github.com/Wall-Brew-Co/strawpoll-client" | ||
:license {:name "MIT" | ||
:url "https://opensource.org/licenses/MIT"} | ||
:license {:name "MIT" | ||
:url "https://opensource.org/licenses/MIT" | ||
:distribution :repo | ||
:comments "Same-as all Wall-Brew projects."} | ||
:scm {:name "git" | ||
:url "https://github.com/Wall-Brew-Co/strawpoll-client"} | ||
:dependencies [[cheshire "5.12.0"] | ||
[clj-http "3.12.3"] | ||
[org.clojure/clojure "1.11.2"]] | ||
:plugins [[com.github.clj-kondo/lein-clj-kondo "2024.03.05"] | ||
[com.wallbrew/lein-sealog "1.2.0"] | ||
[lein-cljsbuild "1.1.8"] | ||
[lein-project-version "0.1.0"] | ||
[mvxcvi/cljstyle "0.16.630"] | ||
[ns-sort "1.0.3"]] | ||
:profiles {:uberjar {:aot :all} | ||
:dev {:dependencies [[circleci/bond "0.6.0"] | ||
[clj-http-fake "1.0.4"]]}} | ||
:dev {:dependencies [[circleci/bond "0.6.0"] | ||
[clj-http-fake "1.0.4"]]}} | ||
:resource-paths ["resources"] | ||
:deploy-branches ["master"] | ||
:deploy-repositories [["clojars" {:url "https://clojars.org/repo" | ||
:username :env/clojars_user | ||
:password :env/clojars_pass | ||
:sign-releases false}]] | ||
:min-lein-version "2.5.3") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
(ns strawpoll-client.core | ||
"Basic functions to interact with [Strawpoll](https://strawpoll.com/en/api-docs/)" | ||
(:require | ||
[cheshire.core :as json] | ||
[clj-http.client :as client] | ||
[strawpoll-client.impl :as impl])) | ||
(:require [cheshire.core :as json] | ||
[clj-http.client :as client] | ||
[strawpoll-client.impl :as impl])) | ||
|
||
|
||
(defn ->client | ||
(defn ^:deprecated ->client | ||
"Create a client, which is the required first argument to `create-poll!`, `get-poll-results!`, and `delete-poll!`. | ||
This function expects an option map, with the following key sets: | ||
- :api-key - The Strawpoll API key for your project. | ||
|
@@ -16,11 +15,11 @@ | |
All remaining keys will be passed to the underlying [clj-http request function](https://github.com/dakrone/clj-http)" | ||
[{:keys [clj-http-opts] | ||
:as opts}] | ||
{:api-key (impl/load-api-key! opts) | ||
Check warning on line 18 in src/strawpoll_client/core.clj GitHub Actions / clj-kondo
|
||
:clj-http-opts clj-http-opts}) | ||
|
||
|
||
(defn create-poll! | ||
(defn ^:deprecated create-poll! | ||
"Create a poll using the provided `client` titled `title` with `answers`. | ||
`client` is expected to be the return value of `strawpoll-client.core/->client` | ||
`title` is a string representing the title of the poll you wish to create. | ||
|
@@ -73,13 +72,16 @@ | |
(:body (client/post (impl/->url "/poll") request-opts))))) | ||
|
||
|
||
(defn ->poll-id | ||
#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]} | ||
|
||
|
||
(defn ^:deprecated ->poll-id | ||
"A convenience function to extract the identifier of a poll from the return value of `strawpoll-client.core/create-poll!`" | ||
[create-poll!-response] | ||
(:content_id create-poll!-response)) | ||
|
||
|
||
(defn get-poll-results! | ||
(defn ^:deprecated get-poll-results! | ||
"Get the current results of `poll-id` using the provided client. | ||
The poll-id is encoded in the response of `strawpoll-client.core/create-poll!` as `content_id`, which may be retreived by `strawpoll-client.core/->poll-id`" | ||
[{:keys [api-key clj-http-opts]} poll-id] | ||
|
@@ -91,7 +93,7 @@ | |
(:body (client/get (impl/->url "/poll/" poll-id) request-opts)))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [clj-kondo] reported by reviewdog 🐶 |
||
|
||
|
||
(defn delete-poll! | ||
(defn ^:deprecated delete-poll! | ||
"Permanently delete `poll-id` using the provided client. | ||
The poll-id is encoded in the response of `strawpoll-client.core/create-poll!` as `content_id`, which may be retreived by `strawpoll-client.core/->poll-id`" | ||
[{:keys [api-key clj-http-opts]} poll-id] | ||
|
@@ -102,7 +104,7 @@ | |
:accept :json | ||
:as :json | ||
:body (json/generate-string body)}) | ||
resp (:body (client/delete (impl/->url "/content/delete") request-opts))] | ||
(if (zero? (:success resp)) | ||
(Exception. (str "Failure deleting poll! " (:message resp))) | ||
resp))) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clj-kondo] reported by reviewdog 🐶
#'strawpoll-client.impl/->url is deprecated