Skip to content

Commit 794b65b

Browse files
author
mailslurp-sdk-bot
committed
15.13.29 - add-java-links
0 parents  commit 794b65b

File tree

221 files changed

+7883
-0
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

+7883
-0
lines changed

.openapi-generator-ignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

.openapi-generator/VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4.3.1

LICENSE

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2022 MailSlurp Email API (Provided by Pettman OÜ, Estonia)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+158
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# MailSlurp GraphQL Email API
2+
3+
MailSlurp has a powerful free GraphQL email API that lets you fetch and read emails with GraphQL in React, Apollo, iOS, Android or server to server. You can create disposable test email accounts on demand or permanent custom domains. Send and receive emails and attachments from any client that uses GraphQL.
4+
5+
If you are unfamiliar with GraphQL don't worry - MailSlurp has a traditional [REST API](https://docs.mailslurp.com/api/) and [compiled SDK Clients](https://www.mailslurp.com/developers/) in many languages.
6+
7+
## Quick links
8+
- API server root is [https://graph.mailslurp.com/](https://graph.mailslurp.com/)
9+
- See the Github for [graphql schema definitions](https://github.com/mailslurp/mailslurp-client-graphql/blob/master/mailslurp/)
10+
- Go to the [MailSlurp GraphQL Playground](https://graphql.mailslurp.com) to explore yourself
11+
- Read the [graphQL getting started guide](https://www.mailslurp.com/guides/graphql-email-api/) for more help
12+
13+
## Getting started
14+
MailSlurp's API is free but requires an API_KEY. [Obtain an API_KEY](https://app.mailslurp.com) at app.mailslurp.com first. **Include you api key in an `x-api-key` header** to authenticate you requests.
15+
16+
### HTTP requests
17+
You can query the GraphQL api using any client. Here is an example using Curl in a terminal:
18+
19+
```bash
20+
curl -lX POST https://graphql.mailslurp.com -H 'x-api-key:YOUR_API_KEY' -H "Content-Type: application/json" -d '{ "query": "{ inboxes { totalElements } }"}'
21+
```
22+
23+
For simpler usage please see the Javascript examples.
24+
25+
### Javascript usage
26+
Add the `graphql-request` library to your node project.
27+
28+
```bash
29+
npm install --save graphql-request
30+
```
31+
32+
Create a client using the `https://graphql.mailslurp.com` root endpoint and pass your api key as a header.
33+
34+
```javascript
35+
import {GraphQLClient} from "graphql-request";
36+
37+
export function getClient(apiKey) {
38+
if (!apiKey) {
39+
throw "Please set missing API_KEY"
40+
}
41+
// create a new graphql-request client using the MailSlurp graphql endpoint
42+
// and passing a headers map including your MailSlurp API Key using "x-api-key" header
43+
return new GraphQLClient('https://graphql.mailslurp.com', {
44+
headers: {
45+
'x-api-key': apiKey,
46+
},
47+
});
48+
}
49+
```
50+
51+
## Create email inbox
52+
Using the client function we created above we can create a new email address using the `createInbox` mutation.
53+
54+
Note: the examples that follow use the AVA test framework to demonstrate usage - you can use any frameworks you wish with GraphQL.
55+
56+
```javascript
57+
import test from 'ava';
58+
import {gql} from "graphql-request";
59+
import {getClient} from "./index.mjs";
60+
61+
const apiKey = process.env.API_KEY;
62+
63+
test('can create inbox', async t => {
64+
const {createInbox} = await getClient(apiKey).request(gql`
65+
mutation {
66+
createInbox {
67+
id
68+
emailAddress
69+
}
70+
}
71+
`);
72+
t.is(!!createInbox.id, true);
73+
t.is(createInbox.emailAddress.indexOf('@mailslurp') > -1, true);
74+
});
75+
```
76+
77+
## Send email in GraphQL
78+
79+
Use the `sendEmail` mutation to send a real email from your inbox.
80+
81+
```javascript
82+
test('can send an email', async t => {
83+
// create an inbox
84+
const {createInbox} = await getClient(apiKey).request(gql`
85+
mutation {
86+
createInbox {
87+
id
88+
emailAddress
89+
}
90+
}
91+
`);
92+
// send an email using mutation
93+
const {sendEmail} = await getClient(apiKey).request(gql`
94+
mutation {
95+
sendEmail(fromInboxId: "${createInbox.id}", to: ["${createInbox.emailAddress}"], subject: "Test subject") {
96+
from
97+
to
98+
subject
99+
}
100+
}
101+
`);
102+
t.is(sendEmail.from, createInbox.emailAddress)
103+
t.is(sendEmail.subject, "Test subject")
104+
t.is(sendEmail.to.indexOf(createInbox.emailAddress) > -1, true)
105+
});
106+
```
107+
108+
## Receive and read email using GraphQL
109+
You can query emails that you know already exist using the `email` and `emails` queries. To block until an expected email either arrives or is found in an inbox use the `waitForX` queries:
110+
111+
```javascript
112+
test('can send an email and receive the contents', async t => {
113+
// create an inbox
114+
const {createInbox} = await getClient(apiKey).request(gql`
115+
mutation {
116+
createInbox {
117+
id
118+
emailAddress
119+
}
120+
}
121+
`);
122+
// send an email using mutation
123+
const {sendEmail} = await getClient(apiKey).request(gql`
124+
mutation {
125+
sendEmail(fromInboxId: "${createInbox.id}", to: ["${createInbox.emailAddress}"], subject: "Test subject", body: "Hello") {
126+
from
127+
to
128+
subject
129+
}
130+
}
131+
`);
132+
133+
// wait for the email to arrive
134+
const {waitForLatestEmail} = await getClient(apiKey).request(gql`
135+
query {
136+
waitForLatestEmail(inboxId: "${createInbox.id}", timeout: 60000, unreadOnly: true) {
137+
id
138+
from
139+
to
140+
subject
141+
body
142+
}
143+
}
144+
`);
145+
t.is(waitForLatestEmail.body.indexOf("Hello") > -1 , true)
146+
t.is(waitForLatestEmail.subject.indexOf(sendEmail.subject) > -1 , true)
147+
t.is(waitForLatestEmail.from.indexOf(sendEmail.from) > -1 , true)
148+
149+
// delete the email afterwards
150+
const {deleteEmail} = await getClient(apiKey).request(gql`
151+
mutation {
152+
deleteEmail(emailId: "${waitForLatestEmail.id}")
153+
}
154+
`);
155+
t.is(deleteEmail === "deleted", true)
156+
157+
});
158+
```

SECURITY.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Security
2+
3+
This client calls the MailSlurp API endpoints. Connections should be made over secure HTTPS using your secure API Token. Do not share or commit the token if you can avoid doing so.
4+
To report security issues or talk with MailSlurp support please email [[email protected]](mailto:[email protected]).

SUPPORT.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Support
2+
3+
To report issues or talk with MailSlurp support please email [[email protected]](mailto:[email protected]).
4+
Alternatively you can visit our [support portal](https://mailslurp.zendesk.com) or open a ticket in the corresponding [Github repository](https://www.github.com/mailslurp).

docs/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# MailSlurp GraphQL Schemas
2+
3+
Generated graphql schema for MailSlurp [email API](https://www.mailslurp.com/guides/graphql-email-api/).
4+
5+
See [models and api documentation](https://github.com/mailslurp/mailslurp-client-graphql/blob/master/mailslurp/) for schema definitions.
+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# MailSlurp API
2+
# MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
3+
# The version of the OpenAPI document: 6.5.2
4+
5+
# Generated by OpenAPI Generator: https://openapi-generator.tech
6+
#
7+
8+
# package mailslurp
9+
10+
# alias_controller_api
11+
12+
type mutation {
13+
# Create an email alias. Must be verified by clicking link inside verification email that will be sent to the address. Once verified the alias will be active.
14+
# Email aliases use a MailSlurp randomly generated email address (or a custom domain inbox that you provide) to mask or proxy a real email address. Emails sent to the alias address will be forwarded to the hidden email address it was created for. If you want to send a reply use the threadId attached
15+
# @param CreateAliasOptions createAliasOptions
16+
# @return [AliasDto]
17+
CreateAlias(createAliasOptions: CreateAliasOptions): AliasDto
18+
19+
# Delete an email alias
20+
# @param ID! aliasId
21+
# @return [null]
22+
DeleteAlias(aliasId: ID!): null
23+
24+
# Reply to an email
25+
# Send the reply to the email sender or reply-to and include same subject cc bcc etc. Reply to an email and the contents will be sent with the existing subject to the emails `to`, `cc`, and `bcc`.
26+
# @param ID! aliasId ID of the alias that email belongs to
27+
# @param ID! emailId ID of the email that should be replied to
28+
# @param ReplyToAliasEmailOptions replyToAliasEmailOptions
29+
# @return [SentEmailDto]
30+
ReplyToAliasEmail(aliasId: ID!, emailId: ID!, replyToAliasEmailOptions: ReplyToAliasEmailOptions): SentEmailDto
31+
32+
# Send an email from an alias inbox
33+
# Send an email from an alias. Replies to the email will be forwarded to the alias masked email address
34+
# @param ID! aliasId
35+
# @param SendEmailOptions sendEmailOptions
36+
# @return [SentEmailDto]
37+
SendAliasEmail(aliasId: ID!, sendEmailOptions: SendEmailOptions): SentEmailDto
38+
39+
# Update an email alias
40+
# @param ID! aliasId
41+
# @param UpdateAliasOptions updateAliasOptions
42+
# @return [AliasDto]
43+
UpdateAlias(aliasId: ID!, updateAliasOptions: UpdateAliasOptions): AliasDto
44+
45+
}
46+
47+
type query {
48+
# Get an email alias
49+
# Get an email alias by ID
50+
# @param ID! aliasId
51+
# @return [AliasDto]
52+
GetAlias(aliasId: ID!): AliasDto
53+
54+
# Get emails for an alias
55+
# Get paginated emails for an alias by ID
56+
# @param ID! aliasId
57+
# @param Int! page Optional page index alias email list pagination
58+
# @param Int! size Optional page size alias email list pagination
59+
# @param String! sort Optional createdAt sort direction ASC or DESC
60+
# @param String! since Optional filter by sent after given date time
61+
# @param String! before Optional filter by sent before given date time
62+
# @return [PageEmailProjection]
63+
GetAliasEmails(aliasId: ID!, page: Int!, size: Int!, sort: String!, since: String!, before: String!): PageEmailProjection
64+
65+
# Get threads created for an alias
66+
# Returns threads created for an email alias in paginated form
67+
# @param ID! aliasId
68+
# @param Int! page Optional page index in thread list pagination
69+
# @param Int! size Optional page size in thread list pagination
70+
# @param String! sort Optional createdAt sort direction ASC or DESC
71+
# @param String! since Optional filter by sent after given date time
72+
# @param String! before Optional filter by sent before given date time
73+
# @return [PageThreadProjection]
74+
GetAliasThreads(aliasId: ID!, page: Int!, size: Int!, sort: String!, since: String!, before: String!): PageThreadProjection
75+
76+
# Get all email aliases you have created
77+
# Get all email aliases in paginated form
78+
# @param Int! page Optional page index in alias list pagination
79+
# @param Int! size Optional page size in alias list pagination
80+
# @param String! sort Optional createdAt sort direction ASC or DESC
81+
# @param String! since Filter by created at after the given timestamp
82+
# @param String! before Filter by created at before the given timestamp
83+
# @return [PageAlias]
84+
GetAliases(page: Int!, size: Int!, sort: String!, since: String!, before: String!): PageAlias
85+
86+
}
87+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# MailSlurp API
2+
# MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository
3+
# The version of the OpenAPI document: 6.5.2
4+
5+
# Generated by OpenAPI Generator: https://openapi-generator.tech
6+
#
7+
8+
# package mailslurp
9+
10+
# api_user_controller_api
11+
12+
type mutation {
13+
# Utility function to extract properties from JSON objects in language where this is cumbersome.
14+
# @param String! property JSON property name or dot separated path selector such as `a.b.c`
15+
# @param TodoObjectMapping body
16+
# @return [String!]
17+
GetJsonPropertyAsString(property: String!, body: TodoObjectMapping): String!
18+
19+
}
20+
21+
type query {
22+
# @return [UserInfoDto]
23+
GetUserInfo(): UserInfoDto
24+
25+
}
26+

0 commit comments

Comments
 (0)