Skip to content

Commit 7151ac8

Browse files
author
mailslurp-sdk-bot
committed
15.17.41 - add-ruby-docs
0 parents  commit 7151ac8

File tree

298 files changed

+11365
-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.

298 files changed

+11365
-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 2024 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://www.mailslurp.com/support/) 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.
+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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 String! search Optional search term
79+
# @param Int! page Optional page index in alias list pagination
80+
# @param Int! size Optional page size in alias list pagination
81+
# @param String! sort Optional createdAt sort direction ASC or DESC
82+
# @param String! since Filter by created at after the given timestamp
83+
# @param String! before Filter by created at before the given timestamp
84+
# @return [PageAlias]
85+
GetAliases(search: String!, page: Int!, size: Int!, sort: String!, since: String!, before: String!): PageAlias
86+
87+
# Get a thread
88+
# Return a thread associated with an alias
89+
# @param ID! threadId
90+
# @return [ThreadProjection]
91+
GetThread(threadId: ID!): ThreadProjection
92+
93+
# Get all threads
94+
# Returns threads created for all aliases in paginated form
95+
# @param Int! page Optional page index in thread list pagination
96+
# @param Int! size Optional page size in thread list pagination
97+
# @param String! sort Optional createdAt sort direction ASC or DESC
98+
# @param String! since Optional filter by sent after given date time
99+
# @param String! before Optional filter by sent before given date time
100+
# @return [PageThreadProjection]
101+
GetThreadsPaginated(page: Int!, size: Int!, sort: String!, since: String!, before: String!): PageThreadProjection
102+
103+
}
104+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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+
# attachment_controller_api
11+
12+
type mutation {
13+
# Delete all attachments
14+
# @return [null]
15+
DeleteAllAttachments(): null
16+
17+
# Delete an attachment
18+
# @param String! attachmentId ID of attachment
19+
# @return [null]
20+
DeleteAttachment(attachmentId: String!): null
21+
22+
# Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
23+
# @param UploadAttachmentOptions uploadAttachmentOptions
24+
# @return [[String!]]
25+
UploadAttachment(uploadAttachmentOptions: UploadAttachmentOptions): [String!]
26+
27+
# Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
28+
# @param String! contentType
29+
# @param String! contentType2 Optional contentType for file. For instance `application/pdf`
30+
# @param String! contentId Optional content ID (CID) to save upload with
31+
# @param String! filename Optional filename to save upload with
32+
# @param String! filename2
33+
# @return [[String!]]
34+
UploadAttachmentBytes(contentType: String!, contentType2: String!, contentId: String!, filename: String!, filename2: String!): [String!]
35+
36+
# Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
37+
# @param String! contentId Optional content ID of attachment
38+
# @param String! contentType Optional content type of attachment
39+
# @param String! filename Optional name of file
40+
# @param String! xFilename Optional content type header of attachment
41+
# @param InlineObject inlineObject
42+
# @return [[String!]]
43+
UploadMultipartForm(contentId: String!, contentType: String!, filename: String!, xFilename: String!, inlineObject: InlineObject): [String!]
44+
45+
}
46+
47+
type query {
48+
# Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents.
49+
# Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the `downloadAttachment` method but allows some clients to get around issues with binary responses.
50+
# @param String! attachmentId ID of attachment
51+
# @return [DownloadAttachmentDto]
52+
DownloadAttachmentAsBase64Encoded(attachmentId: String!): DownloadAttachmentDto
53+
54+
# Download attachments. Get email attachment bytes. If you have trouble with byte responses try the `downloadAttachmentBase64` response endpoints.
55+
# Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
56+
# @param String! attachmentId ID of attachment
57+
# @return [String!]
58+
DownloadAttachmentAsBytes(attachmentId: String!): String!
59+
60+
# Get an attachment entity
61+
# @param String! attachmentId ID of attachment
62+
# @return [AttachmentEntity]
63+
GetAttachment(attachmentId: String!): AttachmentEntity
64+
65+
# Get email attachment metadata information
66+
# Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties `name` and `content-type` and `content-length` in bytes for a given attachment.
67+
# @param String! attachmentId ID of attachment
68+
# @return [AttachmentMetaData]
69+
GetAttachmentInfo(attachmentId: String!): AttachmentMetaData
70+
71+
# Get email attachments
72+
# Get all attachments in paginated response. Each entity contains meta data for the attachment such as `name` and `content-type`. Use the `attachmentId` and the download endpoints to get the file contents.
73+
# @param Int! page Optional page index for list pagination
74+
# @param Int! size Optional page size for list pagination
75+
# @param String! sort Optional createdAt sort direction ASC or DESC
76+
# @param String! fileNameFilter Optional file name and content type search filter
77+
# @param String! since Filter by created at after the given timestamp
78+
# @param String! before Filter by created at before the given timestamp
79+
# @param ID! inboxId Optional inboxId to filter attachments by
80+
# @return [PageAttachmentEntity]
81+
GetAttachments(page: Int!, size: Int!, sort: String!, fileNameFilter: String!, since: String!, before: String!, inboxId: ID!): PageAttachmentEntity
82+
83+
}
84+

0 commit comments

Comments
 (0)