mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-05-30 15:14:14 +00:00
Compare commits
35 Commits
6b6151188c
...
f285a8516d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f285a8516d | ||
|
|
a03d17a9e4 | ||
|
|
364f89f1d0 | ||
|
|
7773a3fd83 | ||
|
|
30f1464092 | ||
|
|
52543fbc5e | ||
|
|
c633f478c2 | ||
|
|
dd1d41c798 | ||
|
|
ed6f41c691 | ||
|
|
b4d5da7bf0 | ||
|
|
1702266b75 | ||
|
|
da0d67a2db | ||
|
|
14b48e4784 | ||
|
|
cafced7a67 | ||
|
|
11ee28a2e1 | ||
|
|
6810877b4d | ||
|
|
afc3c458a9 | ||
|
|
b6e895b47e | ||
|
|
0f83b784e9 | ||
|
|
8376d1f477 | ||
|
|
d7c0c7000f | ||
|
|
c6ac4b2692 | ||
|
|
6135dae301 | ||
|
|
1b3c898415 | ||
|
|
a215294c68 | ||
|
|
5f9fb1da88 | ||
|
|
b6b8276fd6 | ||
|
|
cde6fff336 | ||
|
|
3f15de0946 | ||
|
|
a38b7edbdf | ||
|
|
04b7b1e47d | ||
|
|
9580ab0777 | ||
|
|
cab77e0c08 | ||
|
|
a65c228c9b | ||
|
|
d271a2db3d |
@ -1,5 +1,7 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
## [0.14.2] - 2026-04-04
|
## [0.14.2] - 2026-04-04
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
10
README.md
10
README.md
@ -148,6 +148,16 @@ version installed, you can replace `./gradlew` with `gradle` in the following st
|
|||||||
./gradlew run --args="--help"
|
./gradlew run --args="--help"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### JSON Schemas for the JSON-RPC mode
|
||||||
|
|
||||||
|
1. Generate [JSON Schema](https://json-schema.org/) files for all the JSON-RPC data classes (`src/main/java/org/asamk/signal/json`):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./gradlew jsonSchemas
|
||||||
|
```
|
||||||
|
|
||||||
|
2. The generated files can be found in the `build/generated/META-INF/schemas` folder.
|
||||||
|
|
||||||
### Building a native binary with GraalVM (EXPERIMENTAL)
|
### Building a native binary with GraalVM (EXPERIMENTAL)
|
||||||
|
|
||||||
It is possible to build a native binary with [GraalVM](https://www.graalvm.org). This is still experimental and will not
|
It is possible to build a native binary with [GraalVM](https://www.graalvm.org). This is still experimental and will not
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import groovy.json.JsonOutput
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
java
|
java
|
||||||
application
|
application
|
||||||
@ -8,7 +10,7 @@ plugins {
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
group = "org.asamk"
|
group = "org.asamk"
|
||||||
version = "0.14.2"
|
version = "0.14.3-SNAPSHOT"
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
@ -72,6 +74,11 @@ val excludePatterns = mapOf(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val schemaAnnotationProcessor by configurations.creating {
|
||||||
|
isCanBeConsumed = false
|
||||||
|
isCanBeResolved = true
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
registerTransform(JarFileExcluder::class) {
|
registerTransform(JarFileExcluder::class) {
|
||||||
from.attribute(minified, false).attribute(artifactType, "jar")
|
from.attribute(minified, false).attribute(artifactType, "jar")
|
||||||
@ -82,6 +89,8 @@ dependencies {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
schemaAnnotationProcessor(libs.micronaut.json.schema.processor)
|
||||||
|
schemaAnnotationProcessor(libs.micronaut.inject.java)
|
||||||
implementation(libs.bouncycastle)
|
implementation(libs.bouncycastle)
|
||||||
implementation(libs.jackson.databind)
|
implementation(libs.jackson.databind)
|
||||||
implementation(libs.argparse4j)
|
implementation(libs.argparse4j)
|
||||||
@ -90,6 +99,10 @@ dependencies {
|
|||||||
implementation(libs.slf4j.jul)
|
implementation(libs.slf4j.jul)
|
||||||
implementation(libs.logback)
|
implementation(libs.logback)
|
||||||
implementation(libs.zxing)
|
implementation(libs.zxing)
|
||||||
|
implementation(libs.micronaut.json.schema.annotations)
|
||||||
|
if (gradle.startParameter.taskNames.any { it.contains("jsonSchemas") }) {
|
||||||
|
implementation(libs.micronaut.json.schema.generator)
|
||||||
|
}
|
||||||
implementation(project(":libsignal-cli"))
|
implementation(project(":libsignal-cli"))
|
||||||
|
|
||||||
testImplementation(libs.junit.jupiter)
|
testImplementation(libs.junit.jupiter)
|
||||||
@ -160,3 +173,30 @@ tasks.register("writeLibsignalVersion") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register<JavaCompile>("jsonSchemas") {
|
||||||
|
dependsOn(tasks.compileJava)
|
||||||
|
val schemaBaseUri = "http://localhost:8080/schemas/"
|
||||||
|
source = sourceSets.main.get().java
|
||||||
|
include("org/asamk/signal/json/**/*.java")
|
||||||
|
classpath = sourceSets.main.get().compileClasspath + files(sourceSets.main.get().java.destinationDirectory)
|
||||||
|
destinationDirectory.set(layout.buildDirectory.dir("generated"))
|
||||||
|
options.annotationProcessorPath = schemaAnnotationProcessor
|
||||||
|
options.compilerArgs.addAll(
|
||||||
|
listOf(
|
||||||
|
"-Amicronaut.processing.group=org.asamk",
|
||||||
|
"-Amicronaut.processing.module=signal-cli",
|
||||||
|
"-Amicronaut.processing.annotations=org.asamk.signal.json.*",
|
||||||
|
"-Amicronaut.jsonschema.baseUri=$schemaBaseUri",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
doLast {
|
||||||
|
fileTree(destinationDirectory.get().dir("META-INF/schemas").asFile) {
|
||||||
|
include("*.schema.json")
|
||||||
|
}.forEach { schemaFile ->
|
||||||
|
val normalized = schemaFile.readText().replace("\"$schemaBaseUri/", "\"")
|
||||||
|
val prettyJson = JsonOutput.prettyPrint(normalized)
|
||||||
|
schemaFile.writeText("$prettyJson\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
[versions]
|
[versions]
|
||||||
slf4j = "2.0.17"
|
slf4j = "2.0.17"
|
||||||
junit = "6.0.2"
|
junit = "6.0.2"
|
||||||
|
micronaut-json-schema = "2.0.0-M6"
|
||||||
|
micronaut-core = "4.9.3"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
bouncycastle = "org.bouncycastle:bcprov-jdk18on:1.83"
|
bouncycastle = "org.bouncycastle:bcprov-jdk18on:1.83"
|
||||||
@ -8,6 +10,10 @@ jackson-databind = "com.fasterxml.jackson.core:jackson-databind:2.20.2"
|
|||||||
argparse4j = "net.sourceforge.argparse4j:argparse4j:0.9.0"
|
argparse4j = "net.sourceforge.argparse4j:argparse4j:0.9.0"
|
||||||
dbusjava = "com.github.hypfvieh:dbus-java-transport-native-unixsocket:5.0.0"
|
dbusjava = "com.github.hypfvieh:dbus-java-transport-native-unixsocket:5.0.0"
|
||||||
zxing = "com.google.zxing:core:3.5.4"
|
zxing = "com.google.zxing:core:3.5.4"
|
||||||
|
micronaut-json-schema-annotations = { module = "io.micronaut.jsonschema:micronaut-json-schema-annotations", version.ref = "micronaut-json-schema" }
|
||||||
|
micronaut-json-schema-processor = { module = "io.micronaut.jsonschema:micronaut-json-schema-processor", version.ref = "micronaut-json-schema" }
|
||||||
|
micronaut-json-schema-generator = { module = "io.micronaut.jsonschema:micronaut-json-schema-generator", version.ref = "micronaut-json-schema" }
|
||||||
|
micronaut-inject-java = { module = "io.micronaut:micronaut-inject-java", version.ref = "micronaut-core" }
|
||||||
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
|
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
|
||||||
slf4j-jul = { module = "org.slf4j:jul-to-slf4j", version.ref = "slf4j" }
|
slf4j-jul = { module = "org.slf4j:jul-to-slf4j", version.ref = "slf4j" }
|
||||||
logback = "ch.qos.logback:logback-classic:1.5.32"
|
logback = "ch.qos.logback:logback-classic:1.5.32"
|
||||||
|
|||||||
@ -11,11 +11,14 @@ import org.signal.libsignal.protocol.InvalidMessageException;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.whispersystems.signalservice.api.crypto.AttachmentCipherInputStream;
|
import org.whispersystems.signalservice.api.crypto.AttachmentCipherInputStream;
|
||||||
|
import org.whispersystems.signalservice.api.crypto.AttachmentCipherStreamUtil;
|
||||||
import org.whispersystems.signalservice.api.messages.SignalServiceAttachment;
|
import org.whispersystems.signalservice.api.messages.SignalServiceAttachment;
|
||||||
import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentPointer;
|
import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentPointer;
|
||||||
import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentStream;
|
import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentStream;
|
||||||
import org.whispersystems.signalservice.api.push.exceptions.MissingConfigurationException;
|
import org.whispersystems.signalservice.api.push.exceptions.MissingConfigurationException;
|
||||||
import org.whispersystems.signalservice.api.util.StreamDetails;
|
import org.whispersystems.signalservice.api.util.StreamDetails;
|
||||||
|
import org.whispersystems.signalservice.internal.crypto.PaddingInputStream;
|
||||||
|
import org.whispersystems.signalservice.internal.push.http.ResumableUploadSpec;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -89,12 +92,12 @@ public class AttachmentHelper {
|
|||||||
final boolean voiceNote
|
final boolean voiceNote
|
||||||
) throws AttachmentInvalidException {
|
) throws AttachmentInvalidException {
|
||||||
try {
|
try {
|
||||||
final var streamDetails = Utils.createStreamDetails(attachment);
|
final var streamDetailsAndFileName = Utils.createStreamDetails(attachment);
|
||||||
final var uploadSpec = dependencies.getMessageSender()
|
final var streamDetails = streamDetailsAndFileName.first();
|
||||||
.getResumableUploadSpec(streamDetails.first().getLength());
|
final var uploadSpec = getResumableUploadSpec(streamDetails);
|
||||||
|
|
||||||
return AttachmentUtils.createAttachmentStream(streamDetails.first(),
|
return AttachmentUtils.createAttachmentStream(streamDetails,
|
||||||
streamDetails.second(),
|
streamDetailsAndFileName.second(),
|
||||||
voiceNote,
|
voiceNote,
|
||||||
uploadSpec);
|
uploadSpec);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -102,6 +105,13 @@ public class AttachmentHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResumableUploadSpec getResumableUploadSpec(final StreamDetails streamDetails) throws IOException {
|
||||||
|
final var streamLength = streamDetails.getLength();
|
||||||
|
final var ciphertextLength = AttachmentCipherStreamUtil.getCiphertextLength(PaddingInputStream.getPaddedSize(
|
||||||
|
streamLength));
|
||||||
|
return dependencies.getMessageSender().getResumableUploadSpec(ciphertextLength);
|
||||||
|
}
|
||||||
|
|
||||||
public SignalServiceAttachmentPointer uploadAttachment(String attachment) throws IOException, AttachmentInvalidException {
|
public SignalServiceAttachmentPointer uploadAttachment(String attachment) throws IOException, AttachmentInvalidException {
|
||||||
final var attachmentStream = getAttachmentStream(attachment, false);
|
final var attachmentStream = getAttachmentStream(attachment, false);
|
||||||
return uploadAttachment(attachmentStream);
|
return uploadAttachment(attachmentStream);
|
||||||
|
|||||||
@ -123,7 +123,7 @@ public class GroupHelper {
|
|||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
final var uploadSpec = dependencies.getMessageSender().getResumableUploadSpec(streamDetails.getLength());
|
final var uploadSpec = context.getAttachmentHelper().getResumableUploadSpec(streamDetails);
|
||||||
return Optional.of(AttachmentUtils.createAttachmentStream(streamDetails, Optional.empty(), uploadSpec));
|
return Optional.of(AttachmentUtils.createAttachmentStream(streamDetails, Optional.empty(), uploadSpec));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,7 @@ import org.whispersystems.signalservice.api.messages.multidevice.StickerPackOper
|
|||||||
import org.whispersystems.signalservice.api.messages.multidevice.VerifiedMessage;
|
import org.whispersystems.signalservice.api.messages.multidevice.VerifiedMessage;
|
||||||
import org.whispersystems.signalservice.api.messages.multidevice.ViewedMessage;
|
import org.whispersystems.signalservice.api.messages.multidevice.ViewedMessage;
|
||||||
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
|
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
|
||||||
|
import org.whispersystems.signalservice.api.util.StreamDetails;
|
||||||
import org.whispersystems.signalservice.internal.push.SyncMessage;
|
import org.whispersystems.signalservice.internal.push.SyncMessage;
|
||||||
|
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
@ -131,13 +132,14 @@ public class SyncHelper {
|
|||||||
|
|
||||||
if (groupsFile.exists() && groupsFile.length() > 0) {
|
if (groupsFile.exists() && groupsFile.length() > 0) {
|
||||||
try (var groupsFileStream = new FileInputStream(groupsFile)) {
|
try (var groupsFileStream = new FileInputStream(groupsFile)) {
|
||||||
final var uploadSpec = context.getDependencies()
|
final var streamDetails = new StreamDetails(groupsFileStream,
|
||||||
.getMessageSender()
|
MimeUtils.OCTET_STREAM,
|
||||||
.getResumableUploadSpec(groupsFile.length());
|
groupsFile.length());
|
||||||
|
final var uploadSpec = context.getAttachmentHelper().getResumableUploadSpec(streamDetails);
|
||||||
var attachmentStream = SignalServiceAttachment.newStreamBuilder()
|
var attachmentStream = SignalServiceAttachment.newStreamBuilder()
|
||||||
.withStream(groupsFileStream)
|
.withStream(streamDetails.getStream())
|
||||||
.withContentType(MimeUtils.OCTET_STREAM)
|
.withContentType(streamDetails.getContentType())
|
||||||
.withLength(groupsFile.length())
|
.withLength(streamDetails.getLength())
|
||||||
.withResumableUploadSpec(uploadSpec)
|
.withResumableUploadSpec(uploadSpec)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@ -192,13 +194,14 @@ public class SyncHelper {
|
|||||||
|
|
||||||
if (contactsFile.exists() && contactsFile.length() > 0) {
|
if (contactsFile.exists() && contactsFile.length() > 0) {
|
||||||
try (var contactsFileStream = new FileInputStream(contactsFile)) {
|
try (var contactsFileStream = new FileInputStream(contactsFile)) {
|
||||||
final var uploadSpec = context.getDependencies()
|
final var streamDetails = new StreamDetails(contactsFileStream,
|
||||||
.getMessageSender()
|
MimeUtils.OCTET_STREAM,
|
||||||
.getResumableUploadSpec(contactsFile.length());
|
contactsFile.length());
|
||||||
|
final var uploadSpec = context.getAttachmentHelper().getResumableUploadSpec(streamDetails);
|
||||||
var attachmentStream = SignalServiceAttachment.newStreamBuilder()
|
var attachmentStream = SignalServiceAttachment.newStreamBuilder()
|
||||||
.withStream(contactsFileStream)
|
.withStream(streamDetails.getStream())
|
||||||
.withContentType(MimeUtils.OCTET_STREAM)
|
.withContentType(streamDetails.getContentType())
|
||||||
.withLength(contactsFile.length())
|
.withLength(streamDetails.getLength())
|
||||||
.withResumableUploadSpec(uploadSpec)
|
.withResumableUploadSpec(uploadSpec)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|||||||
@ -839,8 +839,7 @@ public class ManagerImpl implements Manager {
|
|||||||
final var streamDetails = new StreamDetails(new ByteArrayInputStream(messageBytes),
|
final var streamDetails = new StreamDetails(new ByteArrayInputStream(messageBytes),
|
||||||
MimeUtils.LONG_TEXT,
|
MimeUtils.LONG_TEXT,
|
||||||
messageBytes.length);
|
messageBytes.length);
|
||||||
final var uploadSpec = dependencies.getMessageSender()
|
final var uploadSpec = context.getAttachmentHelper().getResumableUploadSpec(streamDetails);
|
||||||
.getResumableUploadSpec(streamDetails.getLength());
|
|
||||||
final var textAttachment = AttachmentUtils.createAttachmentStream(streamDetails,
|
final var textAttachment = AttachmentUtils.createAttachmentStream(streamDetails,
|
||||||
Optional.empty(),
|
Optional.empty(),
|
||||||
uploadSpec);
|
uploadSpec);
|
||||||
@ -908,7 +907,7 @@ public class ManagerImpl implements Manager {
|
|||||||
if (streamDetails == null) {
|
if (streamDetails == null) {
|
||||||
throw new InvalidStickerException("Missing local sticker file");
|
throw new InvalidStickerException("Missing local sticker file");
|
||||||
}
|
}
|
||||||
final var uploadSpec = dependencies.getMessageSender().getResumableUploadSpec(streamDetails.getLength());
|
final var uploadSpec = context.getAttachmentHelper().getResumableUploadSpec(streamDetails);
|
||||||
final var stickerAttachment = AttachmentUtils.createAttachmentStream(streamDetails,
|
final var stickerAttachment = AttachmentUtils.createAttachmentStream(streamDetails,
|
||||||
Optional.empty(),
|
Optional.empty(),
|
||||||
uploadSpec);
|
uploadSpec);
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@JsonSchema(title = "AdminDelete")
|
||||||
public record JsonAdminDelete(
|
public record JsonAdminDelete(
|
||||||
@Deprecated String targetAuthor, String targetAuthorNumber, String targetAuthorUuid, long targetSentTimestamp
|
@Deprecated String targetAuthor, String targetAuthorNumber, String targetAuthorUuid, long targetSentTimestamp
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
|
@JsonSchema(title = "Attachment")
|
||||||
record JsonAttachment(
|
record JsonAttachment(
|
||||||
String contentType,
|
String contentType,
|
||||||
String filename,
|
String filename,
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
|
@JsonSchema(title = "AttachmentData")
|
||||||
public record JsonAttachmentData(
|
public record JsonAttachmentData(
|
||||||
String data
|
String data
|
||||||
) {}
|
) {}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
@ -10,6 +11,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import static org.asamk.signal.manager.util.Utils.callIdUnsigned;
|
import static org.asamk.signal.manager.util.Utils.callIdUnsigned;
|
||||||
|
|
||||||
|
@JsonSchema(title = "CallMessage")
|
||||||
record JsonCallMessage(
|
record JsonCallMessage(
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL) Offer offerMessage,
|
@JsonInclude(JsonInclude.Include.NON_NULL) Offer offerMessage,
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL) Answer answerMessage,
|
@JsonInclude(JsonInclude.Include.NON_NULL) Answer answerMessage,
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@JsonSchema(title = "Contact")
|
||||||
public record JsonContact(
|
public record JsonContact(
|
||||||
String number,
|
String number,
|
||||||
String uuid,
|
String uuid,
|
||||||
@ -26,6 +28,7 @@ public record JsonContact(
|
|||||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonInternal internal
|
@JsonInclude(JsonInclude.Include.NON_NULL) JsonInternal internal
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
@JsonSchema(title = "Profile")
|
||||||
public record JsonProfile(
|
public record JsonProfile(
|
||||||
long lastUpdateTimestamp,
|
long lastUpdateTimestamp,
|
||||||
String givenName,
|
String givenName,
|
||||||
@ -36,6 +39,7 @@ public record JsonContact(
|
|||||||
String mobileCoinAddress
|
String mobileCoinAddress
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
@JsonSchema(title = "Internal")
|
||||||
public record JsonInternal(
|
public record JsonInternal(
|
||||||
List<String> capabilities,
|
List<String> capabilities,
|
||||||
String unidentifiedAccessMode,
|
String unidentifiedAccessMode,
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
import org.asamk.signal.util.Util;
|
import org.asamk.signal.util.Util;
|
||||||
|
|
||||||
|
@JsonSchema(title = "ContactAddress")
|
||||||
public record JsonContactAddress(
|
public record JsonContactAddress(
|
||||||
String type,
|
String type,
|
||||||
String label,
|
String label,
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
|
@JsonSchema(title = "ContactAvatar")
|
||||||
public record JsonContactAvatar(JsonAttachment attachment, boolean isProfile) {
|
public record JsonContactAvatar(JsonAttachment attachment, boolean isProfile) {
|
||||||
|
|
||||||
static JsonContactAvatar from(MessageEnvelope.Data.SharedContact.Avatar avatar) {
|
static JsonContactAvatar from(MessageEnvelope.Data.SharedContact.Avatar avatar) {
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
import org.asamk.signal.util.Util;
|
import org.asamk.signal.util.Util;
|
||||||
|
|
||||||
|
@JsonSchema(title = "ContactEmail")
|
||||||
public record JsonContactEmail(String value, String type, String label) {
|
public record JsonContactEmail(String value, String type, String label) {
|
||||||
|
|
||||||
static JsonContactEmail from(MessageEnvelope.Data.SharedContact.Email email) {
|
static JsonContactEmail from(MessageEnvelope.Data.SharedContact.Email email) {
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
import org.asamk.signal.util.Util;
|
import org.asamk.signal.util.Util;
|
||||||
|
|
||||||
|
@JsonSchema(title = "ContactName")
|
||||||
public record JsonContactName(
|
public record JsonContactName(
|
||||||
String nickname, String given, String family, String prefix, String suffix, String middle
|
String nickname, String given, String family, String prefix, String suffix, String middle
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
import org.asamk.signal.util.Util;
|
import org.asamk.signal.util.Util;
|
||||||
|
|
||||||
|
@JsonSchema(title = "ContactPhone")
|
||||||
public record JsonContactPhone(String value, String type, String label) {
|
public record JsonContactPhone(String value, String type, String label) {
|
||||||
|
|
||||||
static JsonContactPhone from(MessageEnvelope.Data.SharedContact.Phone phone) {
|
static JsonContactPhone from(MessageEnvelope.Data.SharedContact.Phone phone) {
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.Manager;
|
import org.asamk.signal.manager.Manager;
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@JsonSchema(title = "DataMessage")
|
||||||
record JsonDataMessage(
|
record JsonDataMessage(
|
||||||
long timestamp,
|
long timestamp,
|
||||||
String message,
|
String message,
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.Manager;
|
import org.asamk.signal.manager.Manager;
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
|
@JsonSchema(title = "EditMessage")
|
||||||
record JsonEditMessage(long targetSentTimestamp, JsonDataMessage dataMessage) {
|
record JsonEditMessage(long targetSentTimestamp, JsonDataMessage dataMessage) {
|
||||||
|
|
||||||
static JsonEditMessage from(MessageEnvelope.Edit editMessage, Manager m) {
|
static JsonEditMessage from(MessageEnvelope.Edit editMessage, Manager m) {
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
|
@JsonSchema(title = "Error")
|
||||||
public record JsonError(String message, String type) {
|
public record JsonError(String message, String type) {
|
||||||
|
|
||||||
public static JsonError from(Throwable exception) {
|
public static JsonError from(Throwable exception) {
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.Manager;
|
import org.asamk.signal.manager.Manager;
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
|
@JsonSchema(title = "GroupInfo")
|
||||||
record JsonGroupInfo(String groupId, String groupName, int revision, String type) {
|
record JsonGroupInfo(String groupId, String groupName, int revision, String type) {
|
||||||
|
|
||||||
static JsonGroupInfo from(MessageEnvelope.Data.GroupContext groupContext, Manager m) {
|
static JsonGroupInfo from(MessageEnvelope.Data.GroupContext groupContext, Manager m) {
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@JsonSchema(title = "Mention")
|
||||||
public record JsonMention(@Deprecated String name, String number, String uuid, int start, int length) {
|
public record JsonMention(@Deprecated String name, String number, String uuid, int start, int length) {
|
||||||
|
|
||||||
static JsonMention from(MessageEnvelope.Data.Mention mention) {
|
static JsonMention from(MessageEnvelope.Data.Mention mention) {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.Manager;
|
import org.asamk.signal.manager.Manager;
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
@ -10,6 +11,7 @@ import org.asamk.signal.manager.api.UntrustedIdentityException;
|
|||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@JsonSchema(title = "MessageEnvelope")
|
||||||
public record JsonMessageEnvelope(
|
public record JsonMessageEnvelope(
|
||||||
@Deprecated String source,
|
@Deprecated String source,
|
||||||
String sourceNumber,
|
String sourceNumber,
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
|
@JsonSchema(title = "Payment")
|
||||||
public record JsonPayment(String note, byte[] receipt) {
|
public record JsonPayment(String note, byte[] receipt) {
|
||||||
|
|
||||||
static JsonPayment from(MessageEnvelope.Data.Payment payment) {
|
static JsonPayment from(MessageEnvelope.Data.Payment payment) {
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@JsonSchema(title = "PinMessage")
|
||||||
public record JsonPinMessage(
|
public record JsonPinMessage(
|
||||||
@Deprecated String targetAuthor,
|
@Deprecated String targetAuthor,
|
||||||
String targetAuthorNumber,
|
String targetAuthorNumber,
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@JsonSchema(title = "PollCreate")
|
||||||
public record JsonPollCreate(
|
public record JsonPollCreate(
|
||||||
String question, boolean allowMultiple, List<String> options
|
String question, boolean allowMultiple, List<String> options
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
|
@JsonSchema(title = "PollTerminate")
|
||||||
public record JsonPollTerminate(long targetSentTimestamp) {
|
public record JsonPollTerminate(long targetSentTimestamp) {
|
||||||
|
|
||||||
static JsonPollTerminate from(MessageEnvelope.Data.PollTerminate pollTerminate) {
|
static JsonPollTerminate from(MessageEnvelope.Data.PollTerminate pollTerminate) {
|
||||||
|
|||||||
@ -1,10 +1,13 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@JsonSchema(title = "PollVote")
|
||||||
public record JsonPollVote(
|
public record JsonPollVote(
|
||||||
@Deprecated String author,
|
@Deprecated String author,
|
||||||
String authorNumber,
|
String authorNumber,
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
|
@JsonSchema(title = "Preview")
|
||||||
public record JsonPreview(String url, String title, String description, JsonAttachment image) {
|
public record JsonPreview(String url, String title, String description, JsonAttachment image) {
|
||||||
|
|
||||||
static JsonPreview from(MessageEnvelope.Data.Preview preview) {
|
static JsonPreview from(MessageEnvelope.Data.Preview preview) {
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@JsonSchema(title = "Quote")
|
||||||
public record JsonQuote(
|
public record JsonQuote(
|
||||||
long id,
|
long id,
|
||||||
@Deprecated String author,
|
@Deprecated String author,
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
|
@JsonSchema(title = "QuotedAttachment")
|
||||||
public record JsonQuotedAttachment(
|
public record JsonQuotedAttachment(
|
||||||
String contentType, String filename, @JsonInclude(JsonInclude.Include.NON_NULL) JsonAttachment thumbnail
|
String contentType, String filename, @JsonInclude(JsonInclude.Include.NON_NULL) JsonAttachment thumbnail
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@JsonSchema(title = "Reaction")
|
||||||
public record JsonReaction(
|
public record JsonReaction(
|
||||||
String emoji,
|
String emoji,
|
||||||
@Deprecated String targetAuthor,
|
@Deprecated String targetAuthor,
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@JsonSchema(title = "ReceiptMessage")
|
||||||
record JsonReceiptMessage(long when, boolean isDelivery, boolean isRead, boolean isViewed, List<Long> timestamps) {
|
record JsonReceiptMessage(long when, boolean isDelivery, boolean isRead, boolean isViewed, List<Long> timestamps) {
|
||||||
|
|
||||||
static JsonReceiptMessage from(MessageEnvelope.Receipt receiptMessage) {
|
static JsonReceiptMessage from(MessageEnvelope.Receipt receiptMessage) {
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.RecipientAddress;
|
import org.asamk.signal.manager.api.RecipientAddress;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@JsonSchema(title = "RecipientAddress")
|
||||||
public record JsonRecipientAddress(String uuid, String number, String username) {
|
public record JsonRecipientAddress(String uuid, String number, String username) {
|
||||||
|
|
||||||
public static JsonRecipientAddress from(RecipientAddress address) {
|
public static JsonRecipientAddress from(RecipientAddress address) {
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
|
@JsonSchema(title = "RemoteDelete")
|
||||||
record JsonRemoteDelete(long timestamp) {}
|
record JsonRemoteDelete(long timestamp) {}
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.GroupId;
|
import org.asamk.signal.manager.api.GroupId;
|
||||||
import org.asamk.signal.manager.api.SendMessageResult;
|
import org.asamk.signal.manager.api.SendMessageResult;
|
||||||
|
|
||||||
|
@JsonSchema(title = "SendMessageResult")
|
||||||
public record JsonSendMessageResult(
|
public record JsonSendMessageResult(
|
||||||
JsonRecipientAddress recipientAddress,
|
JsonRecipientAddress recipientAddress,
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL) String groupId,
|
@JsonInclude(JsonInclude.Include.NON_NULL) String groupId,
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@JsonSchema(title = "SharedContact")
|
||||||
public record JsonSharedContact(
|
public record JsonSharedContact(
|
||||||
JsonContactName name,
|
JsonContactName name,
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonContactAvatar avatar,
|
@JsonInclude(JsonInclude.Include.NON_NULL) JsonContactAvatar avatar,
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
import org.asamk.signal.util.Hex;
|
import org.asamk.signal.util.Hex;
|
||||||
|
|
||||||
|
@JsonSchema(title = "Sticker")
|
||||||
public record JsonSticker(String packId, int stickerId) {
|
public record JsonSticker(String packId, int stickerId) {
|
||||||
|
|
||||||
static JsonSticker from(MessageEnvelope.Data.Sticker sticker) {
|
static JsonSticker from(MessageEnvelope.Data.Sticker sticker) {
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@JsonSchema(title = "StoryContext")
|
||||||
record JsonStoryContext(
|
record JsonStoryContext(
|
||||||
String authorNumber, String authorUuid, long sentTimestamp
|
String authorNumber, String authorUuid, long sentTimestamp
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.Color;
|
import org.asamk.signal.manager.api.Color;
|
||||||
import org.asamk.signal.manager.api.GroupId;
|
import org.asamk.signal.manager.api.GroupId;
|
||||||
@ -8,6 +9,7 @@ import org.asamk.signal.manager.api.MessageEnvelope;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@JsonSchema(title = "StoryMessage")
|
||||||
record JsonStoryMessage(
|
record JsonStoryMessage(
|
||||||
boolean allowsReplies,
|
boolean allowsReplies,
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL) String groupId,
|
@JsonInclude(JsonInclude.Include.NON_NULL) String groupId,
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package org.asamk.signal.json;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.annotation.JsonUnwrapped;
|
import com.fasterxml.jackson.annotation.JsonUnwrapped;
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.Manager;
|
import org.asamk.signal.manager.Manager;
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
@ -9,6 +10,7 @@ import org.asamk.signal.manager.api.RecipientAddress;
|
|||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@JsonSchema(title = "SyncDataMessage")
|
||||||
record JsonSyncDataMessage(
|
record JsonSyncDataMessage(
|
||||||
@Deprecated String destination,
|
@Deprecated String destination,
|
||||||
String destinationNumber,
|
String destinationNumber,
|
||||||
|
|||||||
@ -9,12 +9,15 @@ import org.asamk.signal.manager.api.RecipientAddress;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
enum JsonSyncMessageType {
|
enum JsonSyncMessageType {
|
||||||
CONTACTS_SYNC,
|
CONTACTS_SYNC,
|
||||||
GROUPS_SYNC,
|
GROUPS_SYNC,
|
||||||
REQUEST_SYNC
|
REQUEST_SYNC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonSchema(title = "SyncMessage")
|
||||||
record JsonSyncMessage(
|
record JsonSyncMessage(
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonSyncDataMessage sentMessage,
|
@JsonInclude(JsonInclude.Include.NON_NULL) JsonSyncDataMessage sentMessage,
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL) JsonSyncStoryMessage sentStoryMessage,
|
@JsonInclude(JsonInclude.Include.NON_NULL) JsonSyncStoryMessage sentStoryMessage,
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@JsonSchema(title = "SyncReadMessage")
|
||||||
record JsonSyncReadMessage(
|
record JsonSyncReadMessage(
|
||||||
@Deprecated String sender, String senderNumber, String senderUuid, long timestamp
|
@Deprecated String sender, String senderNumber, String senderUuid, long timestamp
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonUnwrapped;
|
import com.fasterxml.jackson.annotation.JsonUnwrapped;
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@JsonSchema(title = "SyncStoryMessage")
|
||||||
record JsonSyncStoryMessage(
|
record JsonSyncStoryMessage(
|
||||||
String destinationNumber, String destinationUuid, @JsonUnwrapped JsonStoryMessage dataMessage
|
String destinationNumber, String destinationUuid, @JsonUnwrapped JsonStoryMessage dataMessage
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.TextStyle;
|
import org.asamk.signal.manager.api.TextStyle;
|
||||||
|
|
||||||
|
@JsonSchema(title = "TextStyle")
|
||||||
public record JsonTextStyle(String style, int start, int length) {
|
public record JsonTextStyle(String style, int start, int length) {
|
||||||
|
|
||||||
static JsonTextStyle from(TextStyle textStyle) {
|
static JsonTextStyle from(TextStyle textStyle) {
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.GroupId;
|
import org.asamk.signal.manager.api.GroupId;
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
|
@JsonSchema(title = "TypingMessage")
|
||||||
record JsonTypingMessage(
|
record JsonTypingMessage(
|
||||||
String action, long timestamp, @JsonInclude(JsonInclude.Include.NON_NULL) String groupId
|
String action, long timestamp, @JsonInclude(JsonInclude.Include.NON_NULL) String groupId
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
package org.asamk.signal.json;
|
package org.asamk.signal.json;
|
||||||
|
|
||||||
|
import io.micronaut.jsonschema.JsonSchema;
|
||||||
|
|
||||||
import org.asamk.signal.manager.api.MessageEnvelope;
|
import org.asamk.signal.manager.api.MessageEnvelope;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@JsonSchema(title = "UnpinMessage")
|
||||||
public record JsonUnpinMessage(
|
public record JsonUnpinMessage(
|
||||||
@Deprecated String targetAuthor, String targetAuthorNumber, String targetAuthorUuid, long targetSentTimestamp
|
@Deprecated String targetAuthor, String targetAuthorNumber, String targetAuthorUuid, long targetSentTimestamp
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -1486,6 +1486,13 @@
|
|||||||
"type": "kotlin.Pair",
|
"type": "kotlin.Pair",
|
||||||
"jniAccessible": true,
|
"jniAccessible": true,
|
||||||
"methods": [
|
"methods": [
|
||||||
|
{
|
||||||
|
"name": "<init>",
|
||||||
|
"parameterTypes": [
|
||||||
|
"java.lang.Object",
|
||||||
|
"java.lang.Object"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "getFirst",
|
"name": "getFirst",
|
||||||
"parameterTypes": []
|
"parameterTypes": []
|
||||||
@ -1496,6 +1503,9 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "kotlin.Pair[]"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "kotlin.SafePublicationLazyImpl",
|
"type": "kotlin.SafePublicationLazyImpl",
|
||||||
"fields": [
|
"fields": [
|
||||||
@ -5821,6 +5831,21 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "org.signal.libsignal.net.UploadForm",
|
||||||
|
"jniAccessible": true,
|
||||||
|
"methods": [
|
||||||
|
{
|
||||||
|
"name": "fromNative",
|
||||||
|
"parameterTypes": [
|
||||||
|
"int",
|
||||||
|
"java.lang.String",
|
||||||
|
"java.lang.Object[]",
|
||||||
|
"java.lang.String"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "org.signal.libsignal.net.internal.BridgeChatListener",
|
"type": "org.signal.libsignal.net.internal.BridgeChatListener",
|
||||||
"jniAccessible": true
|
"jniAccessible": true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user