-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
110 additions
and
103 deletions.
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
2 changes: 1 addition & 1 deletion
2
...ements/effects/EffSendDiscordWebhook.java → ...iscord/effects/EffSendDiscordWebhook.java
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
2 changes: 1 addition & 1 deletion
2
...elements/expressions/ExprEmbedAuthor.java → .../discord/expressions/ExprEmbedAuthor.java
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
2 changes: 1 addition & 1 deletion
2
.../elements/expressions/ExprEmbedField.java → ...s/discord/expressions/ExprEmbedField.java
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
2 changes: 1 addition & 1 deletion
2
...elements/expressions/ExprEmbedFooter.java → .../discord/expressions/ExprEmbedFooter.java
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
2 changes: 1 addition & 1 deletion
2
...tp/elements/sections/SecEmbedBuilder.java → ...nts/discord/sections/SecEmbedBuilder.java
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
2 changes: 1 addition & 1 deletion
2
.../elements/sections/SecWebhookBuilder.java → ...s/discord/sections/SecWebhookBuilder.java
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,89 @@ | ||
package lol.aabss.skhttp.elements.http; | ||
|
||
import ch.njol.skript.classes.ClassInfo; | ||
import ch.njol.skript.classes.Parser; | ||
import ch.njol.skript.lang.ParseContext; | ||
import ch.njol.skript.registrations.Classes; | ||
import lol.aabss.skhttp.objects.RequestObject; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.net.http.HttpClient; | ||
import java.net.http.HttpResponse; | ||
|
||
public class Types { | ||
static { | ||
Classes.registerClass(new ClassInfo<>(HttpClient.class, "httpclient") | ||
.name("Http Client") | ||
.description("Represents an http client.") | ||
.user("http ?clients?") | ||
.since("1.0") | ||
.parser(new Parser<>() { | ||
@Override | ||
public boolean canParse(@NotNull ParseContext context) { | ||
return false; | ||
} | ||
@Override | ||
public @NotNull String toString(HttpClient o, int flags) { | ||
return toVariableNameString(o); | ||
} | ||
|
||
@Override | ||
public @NotNull String toVariableNameString(HttpClient o) { | ||
return "http client"; | ||
} | ||
} | ||
) | ||
); | ||
|
||
Classes.registerClass(new ClassInfo<>(RequestObject.class, "httprequest") | ||
.name("Http Request") | ||
.description("Represents an http request.") | ||
.user("http ?requests?") | ||
.since("1.0") | ||
.parser(new Parser<>() { | ||
|
||
@Override | ||
public boolean canParse(@NotNull ParseContext context) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public @NotNull String toString(RequestObject o, int flags) { | ||
return toVariableNameString(o); | ||
} | ||
|
||
@Override | ||
public @NotNull String toVariableNameString(RequestObject o) { | ||
return o.request.uri().toString(); | ||
} | ||
} | ||
) | ||
); | ||
|
||
Classes.registerClass(new ClassInfo<>(HttpResponse.class, "httpresponse") | ||
.name("Http Response") | ||
.description("Represents an http response.") | ||
.user("http ?requests?") | ||
.since("1.0") | ||
.parser(new Parser<>() { | ||
|
||
@Override | ||
public boolean canParse(@NotNull ParseContext context) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public @NotNull String toString(HttpResponse o, int flags) { | ||
return toVariableNameString(o); | ||
} | ||
|
||
@Override | ||
public @NotNull String toVariableNameString(HttpResponse o) { | ||
return "http response"; | ||
} | ||
} | ||
) | ||
); | ||
|
||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ttp/elements/effects/EffDownloadFile.java → ...lements/http/effects/EffDownloadFile.java
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
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
2 changes: 1 addition & 1 deletion
2
...ttp/elements/expressions/ExprHeaders.java → ...lements/http/expressions/ExprHeaders.java
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
2 changes: 1 addition & 1 deletion
2
.../elements/expressions/ExprHttpClient.java → ...ents/http/expressions/ExprHttpClient.java
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
2 changes: 1 addition & 1 deletion
2
...lements/expressions/ExprLastResponse.java → ...ts/http/expressions/ExprLastResponse.java
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
2 changes: 1 addition & 1 deletion
2
...http/elements/expressions/ExprMethod.java → ...elements/http/expressions/ExprMethod.java
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
2 changes: 1 addition & 1 deletion
2
...nts/expressions/ExprPreviousResponse.java → ...ttp/expressions/ExprPreviousResponse.java
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
2 changes: 1 addition & 1 deletion
2
.../elements/expressions/ExprStatusCode.java → ...ents/http/expressions/ExprStatusCode.java
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
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
2 changes: 1 addition & 1 deletion
2
...nts/sections/SecSendAsyncHttpRequest.java → ...ttp/sections/SecSendAsyncHttpRequest.java
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