Skip to content

Commit 994837b

Browse files
authored
Merge pull request #26 from smsapi/v3
v3
2 parents 3fcf8ec + 77aada4 commit 994837b

File tree

221 files changed

+5418
-2075
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+5418
-2075
lines changed

.github/workflows/publish-package.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Maven Central Repository
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '8'
22+
distribution: 'temurin'
23+
server-id: central
24+
server-username: MAVEN_USERNAME
25+
server-password: MAVEN_PASSWORD
26+
27+
- name: Build with Maven
28+
run: mvn --batch-mode package --file pom.xml
29+
30+
- name: Publish to Maven Central Repository
31+
run: mvn --batch-mode deploy
32+
env:
33+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
34+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
35+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_CENTRAL_GPG_SECRET_KEY_PASSWORD }}
36+
MAVEN_GPG_KEY: ${{ secrets.MAVEN_CENTRAL_GPG_SECRET_KEY }}

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@ build.xml
44
manifest.mf
55
_ids_test.txt
66
/.idea/
7-
/*.iml
7+
/*.iml
8+
/target/
9+
/pom.xml.releaseBackup
10+
/release.properties
11+
12+
/src/test/config/config.json

CHANGELOG.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
5+
6+
## [Unreleased]
7+
8+
## [3.0.0-RC17] - 2024-10-29
9+
### Changed
10+
- `pl.smsapi.api.action.subusers.SubuserAdd` and `pl.smsapi.api.action.subusers.SubuserEdit` actions setters, fluent interface added
11+
12+
## [3.0.0-RC5 - 3.0.0-RC16] - 2024-09-23
13+
### Changed
14+
- build process
15+
16+
## [3.0.0-RC4]
17+
### Added
18+
- new Sendernames API
19+
- new Contacts API
20+
- Subusers API
21+
- `pl.smsapi.exception.SmsapiErrorException` to handle API error responses
22+
- `date_sent` to SMS/MMS send action responses
23+
- `time_restriction` parameter for SMS send action
24+
- HLR action factory, `HlrFactory`
25+
- HLR with IDX support
26+
27+
### Changed
28+
- `pl.smsapi.api.UserFactory.actionAdd` marked as deprecated, use `pl.smsapi.api.action.subusers.SubusersFactory.actionAdd` instead
29+
- `pl.smsapi.api.UserFactory.actionEdit` marked as deprecated, use `pl.smsapi.api.action.subusers.SubusersFactory.actionEdit` instead
30+
- `pl.smsapi.api.UserFactory.actionList` marked as deprecated, use `pl.smsapi.api.action.subusers.SubusersFactory.actionList` instead
31+
- `pl.smsapi.api.action.user.UserAdd` marked as deprecated, use `pl.smsapi.api.action.subusers.SubuserAdd` instead
32+
- `pl.smsapi.api.action.user.UserEdit` marked as deprecated, use `pl.smsapi.api.action.subusers.SubuserEdit` instead
33+
- `pl.smsapi.api.action.user.UserGet` marked as deprecated, use `pl.smsapi.api.action.subusers.SubuserGet` instead
34+
- `pl.smsapi.api.action.user.UserList` marked as deprecated, use `pl.smsapi.api.action.subusers.SubusersList` instead
35+
- `pl.smsapi.BasicAuthClient` marked as deprecated
36+
- non-proxy action factories marked as deprecated
37+
- `pl.smsapi.api.ContactsFactory` marked as deprecated, use `pl.smsapi.api.action.contacts.ContactsFactory` or `pl.smsapi.api.action.contacts.groups.GroupsFactory` instead
38+
- `pl.smsapi.exception.ActionException` marked as deprecated, use `pl.smsapi.exception.SmsapiLegacyErrorException` instead
39+
- `pl.smsapi.exception.ClientException` marked as deprecated, use `pl.smsapi.exception.SmsapiLegacyErrorException` instead
40+
- `pl.smsapi.exception.HostException` marked as deprecated, use `pl.smsapi.exception.SmsapiLegacyErrorException` instead
41+
- all client and server side errors are now being translated to `pl.smsapi.exception.SmsapiErrorException` or `pl.smsapi.exception.SmsapiLegacyErrorException`
42+
- `pl.smsapi.api.VmsFactory.actionSend` without parameters marked as deprecated
43+
- `pl.smsapi.api.VmsFactory.actionGet` without parameters marked as deprecated
44+
- `pl.smsapi.api.VmsFactory.actionDelete` without parameters marked as deprecated
45+
- `pl.smsapi.api.action.vms.VMSDelete` without parameters marked as deprecated
46+
- `pl.smsapi.api.action.vms.VMSGet` without parameters marked as deprecated
47+
- `pl.smsapi.api.action.vms.VMSSend` without parameters marked as deprecated
48+
- `pl.smsapi.api.SmsFactory.actionSend` without parameters marked as deprecated
49+
- `pl.smsapi.api.action.sms.SMSSend` without parameters marked as deprecated
50+
- `pl.smsapi.api.SmsFactory.actionGet` without parameters marked as deprecated
51+
- `pl.smsapi.api.action.sms.SMSGet` without parameters marked as deprecated
52+
- `pl.smsapi.api.SmsFactory.actionDelete` without parameters marked as deprecated
53+
- `pl.smsapi.api.action.sms.SMSDelete` without parameters marked as deprecated
54+
- `pl.smsapi.api.action.hlr.HLRCheckNumber` without parameters marked as deprecated
55+
- `pl.smsapi.api.action.sender.SenderAdd` marked as deprecated, use `pl.smsapi.api.action.sms.sendernames.SendernameAdd` instead
56+
- `pl.smsapi.api.action.sender.SenderDefault` marked as deprecated, use `pl.smsapi.api.action.sms.sendernames.SendernameMakeDefault` instead
57+
- `pl.smsapi.api.action.sender.SenderDelete` marked as deprecated, use `pl.smsapi.api.action.sms.sendernames.SendernameDelete` instead
58+
- `pl.smsapi.api.action.sender.SenderList` marked as deprecated, use `pl.smsapi.api.action.sms.sendernames.SendernamesList` instead
59+
- `pl.smsapi.api.SenderFactory` marked as deprecated, use `pl.smsapi.api.action.sms.sendernames.SendernamesFactory` instead
60+
61+
### Removed
62+
- legacy `phonebook.do` contacts API support
63+
64+
### Removed
65+
- deprecated `pl.smsapi.proxy.Proxy#execute` method
66+
67+
## [3.0.0-RC2 - 3.0.0-RC3] - 2024-03-04
68+
### Changed
69+
- build process
70+
71+
## [3.0.0-RC1] - 2024-03-01
72+
### Changed
73+
- Java 6 support dropped

LICENSE renamed to LICENSE.md

File renamed without changes.

README.md

Lines changed: 12 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -2,66 +2,20 @@
22

33
## How to install
44

5-
JARs, POMs and docs available are at https://labs.smsapi.com/maven.
6-
7-
Library https://github.com/douglascrockford/JSON-java is required.
8-
9-
### How to install using Maven
5+
### How to install using Maven Central Repository
106

117
Add following in your project **pom.xml** file:
128

13-
* in `<repositories>` section add SMSAPI repository:
14-
15-
```xml
16-
<repository>
17-
<releases>
18-
<enabled>true</enabled>
19-
<updatePolicy>always</updatePolicy>
20-
<checksumPolicy>fail</checksumPolicy>
21-
</releases>
22-
<id>smsapi</id>
23-
<name>smsapi</name>
24-
<url>https://labs.smsapi.com/maven/</url>
25-
<layout>default</layout>
26-
</repository>
27-
```
28-
299
* in `<dependencies>` section add SMSAPI dependency:
3010

3111
```xml
3212
<dependency>
3313
<groupId>pl.smsapi</groupId>
3414
<artifactId>smsapi-lib</artifactId>
35-
<version>2.4</version>
15+
<version>3.0.0-RC15</version>
3616
</dependency>
3717
```
3818

39-
### How to install using Gradle
40-
41-
Add following in your project **build.gradle** file:
42-
43-
* in `plugins` section:
44-
45-
```
46-
id 'java'
47-
id 'java-library'
48-
```
49-
50-
* in `repositories` section:
51-
52-
```
53-
mavenCentral()
54-
maven {
55-
url 'https://labs.smsapi.com/maven/'
56-
}
57-
```
58-
59-
* in `dependencies` section:
60-
61-
```
62-
api 'pl.smsapi:smsapi-lib:2.5'
63-
```
64-
6519
## How to use
6620

6721
To use *SMSAPI.PL* set proxy URL to **https://api.smsapi.pl/**. \
@@ -97,20 +51,15 @@ public class Example {
9751

9852
SmsFactory smsApi = new SmsFactory(client, proxy);
9953

100-
SMSSend action = smsApi.actionSend()
101-
.setTo("000000000")
102-
.setText("test");
54+
SMSSend action = smsApi.actionSend("000000000", "test message");
10355

10456
StatusResponse result = action.execute();
10557

106-
Optional<MessageResponse> status = result.getList().stream().findFirst();
107-
if (status.isEmpty()) {
108-
throw new RuntimeException();
109-
}
58+
MessageResponse status = result.getList().get(0);
11059

111-
System.out.println("Phone number: " + status.get().getNumber());
112-
System.out.println("Shipment id: " + status.get().getId());
113-
System.out.println("Shipment status: " + status.get().getStatus());
60+
System.out.println("Phone number: " + status.getNumber());
61+
System.out.println("Shipment id: " + status.getId());
62+
System.out.println("Shipment status: " + status.getStatus());
11463

11564
} catch (SmsapiException e) {
11665
System.out.println("Exception: " + e.getMessage());
@@ -151,9 +100,7 @@ public class Example {
151100

152101
String[] to = {"000000000", "000000001"};
153102

154-
SMSSend action = smsApi.actionSend()
155-
.setTo(to)
156-
.setText("test");
103+
SMSSend action = smsApi.actionSend(to, "test message");
157104

158105
StatusResponse result = action.execute();
159106

@@ -203,29 +150,14 @@ public class Example2ci {
203150
SMSGet getAction = smsApi.actionGet(shipmentId);
204151

205152
StatusResponse shipmentStatus = getAction.execute();
206-
Optional<MessageResponse> statusAfterGet = shipmentStatus.getList().stream().findFirst();
207-
if (statusAfterGet.isEmpty()) {
208-
throw new RuntimeException();
209-
}
153+
MessageResponse statusAfterGet = shipmentStatus.getList().get(0);
210154

211-
System.out.println("Phone number: " + statusAfterGet.get().getNumber());
212-
System.out.println("Shipment id: " + statusAfterGet.get().getId());
213-
System.out.println("Shipment status: " + statusAfterGet.get().getStatus());
155+
System.out.println("Phone number: " + statusAfterGet.getNumber());
156+
System.out.println("Shipment id: " + statusAfterGet.getId());
157+
System.out.println("Shipment status: " + statusAfterGet.getStatus());
214158
} catch (SmsapiException e) {
215159
System.out.println("Exception: " + e.getMessage());
216160
}
217161
}
218162
}
219163
```
220-
221-
## JAVADOC
222-
[2.3](http://labs.smsapi.com/docs/javadoc/pl/smsapi/smsapi-lib/2.3/)
223-
224-
[2.2](http://labs.smsapi.com/docs/javadoc/pl/smsapi/smsapi-lib/2.2/)
225-
226-
[2.1](http://labs.smsapi.com/docs/javadoc/pl/smsapi/smsapi-lib/2.1/)
227-
228-
[2.0](http://labs.smsapi.com/docs/javadoc/pl/smsapi/smsapi-lib/2.0/)
229-
230-
## LICENSE
231-
[Apache 2.0 License](https://github.com/smsapi/smsapi-java-client/blob/master/LICENSE)

dist/1.0/json_douglascrockford.jar

-81.7 KB
Binary file not shown.

dist/1.0/smsapi-lib-1.0.jar

-77.5 KB
Binary file not shown.

dist/1.1/json-20140107.jar

-63.4 KB
Binary file not shown.

dist/1.1/smsapi-lib-1.1.jar

-78.7 KB
Binary file not shown.

dist/2.0/json-20140107.jar

-63.4 KB
Binary file not shown.

dist/2.0/smsapi-lib-2.0.jar

-65.9 KB
Binary file not shown.

dist/2.1/json-20140107.jar

-63.4 KB
Binary file not shown.

dist/2.1/smsapi-lib-2.1-javadoc.jar

-430 KB
Binary file not shown.

dist/2.1/smsapi-lib-2.1-sources.jar

-36.7 KB
Binary file not shown.

dist/2.1/smsapi-lib-2.1.jar

-65.6 KB
Binary file not shown.

dist/2.2/json-20140107.jar

-63.4 KB
Binary file not shown.

dist/2.2/smsapi-lib-2.2-javadoc.jar

-430 KB
Binary file not shown.

dist/2.2/smsapi-lib-2.2-sources.jar

-36.7 KB
Binary file not shown.

dist/2.2/smsapi-lib-2.2.jar

-65.6 KB
Binary file not shown.

dist/2.3/commons-codec-1.10.jar

-278 KB
Binary file not shown.

dist/2.3/json-20140107.jar

-63.4 KB
Binary file not shown.

dist/2.3/smsapi-lib-2.3-javadoc.jar

-566 KB
Binary file not shown.

dist/2.3/smsapi-lib-2.3-sources.jar

-52.2 KB
Binary file not shown.

dist/2.3/smsapi-lib-2.3.jar

-87.7 KB
Binary file not shown.

dist/2.4/commons-codec-1.10.jar

-278 KB
Binary file not shown.

dist/2.4/json-20140107.jar

-63.4 KB
Binary file not shown.

dist/2.4/smsapi-lib-2.4-javadoc.jar

-583 KB
Binary file not shown.

dist/2.4/smsapi-lib-2.4-sources.jar

-53.3 KB
Binary file not shown.

dist/2.4/smsapi-lib-2.4.jar

-89.5 KB
Binary file not shown.

dist/2.5/commons-codec-1.10.jar

-278 KB
Binary file not shown.

dist/2.5/json-20140107.jar

-63.4 KB
Binary file not shown.

dist/2.5/smsapi-lib-2.5-javadoc.jar

-990 KB
Binary file not shown.

dist/2.5/smsapi-lib-2.5-sources.jar

-51.8 KB
Binary file not shown.

dist/2.5/smsapi-lib-2.5.jar

-89.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)