loops_sdk 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +67 -3
- data/lib/loops_sdk/contact_properties.rb +19 -0
- data/lib/loops_sdk/transactional.rb +3 -0
- data/lib/loops_sdk/version.rb +1 -1
- metadata +3 -9
- data/.rubocop.yml +0 -11
- data/CHANGELOG.md +0 -21
- data/CODE_OF_CONDUCT.md +0 -132
- data/CONTRIBUTING.md +0 -51
- data/Rakefile +0 -8
- data/lib/loops_sdk/custom_fields.rb +0 -11
- data/sig/loops_sdk.rbs +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8eeddad6948c305215fe8efe6bd218550fad021aaa12615f6e32b8d69d552fda
|
4
|
+
data.tar.gz: b4632c42a4762b587fc5a96b05c8aa25f734823bb2fe5de31a181556a6ac976d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9cff4116be11b5c86aa25137b0fe832ee1dd1875a33a3625554a094048781b2637388ed6065c8cd23be28d6b1771567f1fd5704c63f2f985aae4f3abd5b9f1f
|
7
|
+
data.tar.gz: fc376fc43f139688c1e76bbe5a06cad0c39e6b3762f481636438a33e1548fa9af6eb1ea90f228384cccad162acb88aec927f50cf1487d35e88e18cdba1abc893
|
data/README.md
CHANGED
@@ -110,6 +110,7 @@ You can use custom contact properties in API calls. Please make sure to [add cus
|
|
110
110
|
- [MailingLists.list()](#mailinglistslist)
|
111
111
|
- [Events.send()](#eventssend)
|
112
112
|
- [Transactional.send()](#transactionalsend)
|
113
|
+
- [Transactional.list()](#transactionallist)
|
113
114
|
|
114
115
|
---
|
115
116
|
|
@@ -235,7 +236,8 @@ response = LoopsSdk::Contacts.update(
|
|
235
236
|
email: "newemail@gmail.com",
|
236
237
|
properties: {
|
237
238
|
userId: "1234",
|
238
|
-
}
|
239
|
+
}
|
240
|
+
)
|
239
241
|
```
|
240
242
|
|
241
243
|
#### Response
|
@@ -555,7 +557,7 @@ response = LoopsSdk::Events.send(
|
|
555
557
|
cm06f5v0e45nf0ml5754o9cix: true,
|
556
558
|
cm16k73gq014h0mmj5b6jdi9r: false,
|
557
559
|
},
|
558
|
-
|
560
|
+
)
|
559
561
|
|
560
562
|
# In this case with both email and userId present, the system will look for a contact with either a
|
561
563
|
# matching `email` or `user_id` value.
|
@@ -570,7 +572,7 @@ response = LoopsSdk::Events.send(
|
|
570
572
|
firstName: "Bob",
|
571
573
|
plan: "pro",
|
572
574
|
},
|
573
|
-
|
575
|
+
)
|
574
576
|
```
|
575
577
|
|
576
578
|
#### Response
|
@@ -672,6 +674,68 @@ If there is a problem with the request, a descriptive error message will be retu
|
|
672
674
|
|
673
675
|
---
|
674
676
|
|
677
|
+
### Transactional.list()
|
678
|
+
|
679
|
+
Get a list of published transactional emails.
|
680
|
+
|
681
|
+
[API Reference](https://loops.so/docs/api-reference/list-transactional-emails)
|
682
|
+
|
683
|
+
#### Parameters
|
684
|
+
|
685
|
+
| Name | Type | Required | Notes |
|
686
|
+
| --------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
687
|
+
| `perPage` | integer | No | How many results to return per page. Must be between 10 and 50. Defaults to 20 if omitted. |
|
688
|
+
| `cursor` | string | No | A cursor, to return a specific page of results. Cursors can be found from the `pagination.nextCursor` value in each response. |
|
689
|
+
|
690
|
+
#### Example
|
691
|
+
|
692
|
+
```ruby
|
693
|
+
response = LoopsSdk::Transactional.list
|
694
|
+
|
695
|
+
response = LoopsSdk::Transactional.list(perPage: 15)
|
696
|
+
```
|
697
|
+
|
698
|
+
#### Response
|
699
|
+
|
700
|
+
```json
|
701
|
+
{
|
702
|
+
"pagination": {
|
703
|
+
"totalResults": 23,
|
704
|
+
"returnedResults": 20,
|
705
|
+
"perPage": 20,
|
706
|
+
"totalPages": 2,
|
707
|
+
"nextCursor": "clyo0q4wo01p59fsecyxqsh38",
|
708
|
+
"nextPage": "https://app.loops.so/api/v1/transactional?cursor=clyo0q4wo01p59fsecyxqsh38&perPage=20"
|
709
|
+
},
|
710
|
+
"data": [
|
711
|
+
{
|
712
|
+
"id": "clfn0k1yg001imo0fdeqg30i8",
|
713
|
+
"lastUpdated": "2023-11-06T17:48:07.249Z",
|
714
|
+
"dataVariables": []
|
715
|
+
},
|
716
|
+
{
|
717
|
+
"id": "cll42l54f20i1la0lfooe3z12",
|
718
|
+
"lastUpdated": "2025-02-02T02:56:28.845Z",
|
719
|
+
"dataVariables": [
|
720
|
+
"confirmationUrl"
|
721
|
+
]
|
722
|
+
},
|
723
|
+
{
|
724
|
+
"id": "clw6rbuwp01rmeiyndm80155l",
|
725
|
+
"lastUpdated": "2024-05-14T19:02:52.000Z",
|
726
|
+
"dataVariables": [
|
727
|
+
"firstName",
|
728
|
+
"lastName",
|
729
|
+
"inviteLink"
|
730
|
+
]
|
731
|
+
},
|
732
|
+
...
|
733
|
+
]
|
734
|
+
}
|
735
|
+
```
|
736
|
+
|
737
|
+
---
|
738
|
+
|
675
739
|
## Contributing
|
676
740
|
|
677
741
|
Bug reports and pull requests are welcome. Please read our [Contributing Guidelines](CONTRIBUTING.md).
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module LoopsSdk
|
4
|
+
class ContactProperties < Base
|
5
|
+
class << self
|
6
|
+
def create(name:, type:)
|
7
|
+
body = {
|
8
|
+
name: name,
|
9
|
+
type: type
|
10
|
+
}
|
11
|
+
make_request(:post, "v1/contacts/properties", {}, body)
|
12
|
+
end
|
13
|
+
def list(list: nil)
|
14
|
+
raise ArgumentError, "List value must be nil, 'custom' or 'all'." unless [nil, "custom", "all"].include?(list)
|
15
|
+
make_request(:get, "v1/contacts/properties", {list: list || "all"})
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -3,6 +3,9 @@
|
|
3
3
|
module LoopsSdk
|
4
4
|
class Transactional < Base
|
5
5
|
class << self
|
6
|
+
def list(perPage: 20, cursor: nil)
|
7
|
+
make_request(:get, "v1/transactional", { perPage: perPage, cursor: cursor })
|
8
|
+
end
|
6
9
|
def send(transactional_id:, email:, add_to_audience: false, data_variables: {}, attachments: [])
|
7
10
|
attachments = attachments.map do |attachment|
|
8
11
|
attachment.transform_keys { |key| key == :content_type ? :contentType : key }
|
data/lib/loops_sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loops_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Rowden
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02-
|
11
|
+
date: 2025-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -31,24 +31,18 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
-
- ".rubocop.yml"
|
35
|
-
- CHANGELOG.md
|
36
|
-
- CODE_OF_CONDUCT.md
|
37
|
-
- CONTRIBUTING.md
|
38
34
|
- LICENSE.txt
|
39
35
|
- README.md
|
40
|
-
- Rakefile
|
41
36
|
- lib/loops_sdk.rb
|
42
37
|
- lib/loops_sdk/api_key.rb
|
43
38
|
- lib/loops_sdk/base.rb
|
44
39
|
- lib/loops_sdk/configuration.rb
|
40
|
+
- lib/loops_sdk/contact_properties.rb
|
45
41
|
- lib/loops_sdk/contacts.rb
|
46
|
-
- lib/loops_sdk/custom_fields.rb
|
47
42
|
- lib/loops_sdk/events.rb
|
48
43
|
- lib/loops_sdk/mailing_lists.rb
|
49
44
|
- lib/loops_sdk/transactional.rb
|
50
45
|
- lib/loops_sdk/version.rb
|
51
|
-
- sig/loops_sdk.rbs
|
52
46
|
homepage: https://loops.so/docs/api-reference
|
53
47
|
licenses:
|
54
48
|
- MIT
|
data/.rubocop.yml
DELETED
data/CHANGELOG.md
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
## v1.0.0 - Feb 26, 2025
|
2
|
-
|
3
|
-
- JSON from API errors is now accessible from the `APIError` class.
|
4
|
-
- Added support for two new contact property endpoints: `ContactProperties.create()` and `ContactProperties.list()`.
|
5
|
-
- Deprecated and removed the `CustomFields.list()` method (you can now use `ContactProperties.list()` instead).
|
6
|
-
|
7
|
-
## v0.2.0 - Oct 29, 2024
|
8
|
-
|
9
|
-
Added rate limit handling with `RateLimitError`.
|
10
|
-
|
11
|
-
## v0.1.2 - Aug 16, 2024
|
12
|
-
|
13
|
-
Support for resetting contact properties with `nil`.
|
14
|
-
|
15
|
-
## v0.1.1 - Aug 16, 2024
|
16
|
-
|
17
|
-
Added `ApiKey.test` method for testing API keys.
|
18
|
-
|
19
|
-
## v0.1.0 - Aug 16, 2024
|
20
|
-
|
21
|
-
Initial release.
|
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,132 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our
|
6
|
-
community a harassment-free experience for everyone, regardless of age, body
|
7
|
-
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
8
|
-
identity and expression, level of experience, education, socio-economic status,
|
9
|
-
nationality, personal appearance, race, caste, color, religion, or sexual
|
10
|
-
identity and orientation.
|
11
|
-
|
12
|
-
We pledge to act and interact in ways that contribute to an open, welcoming,
|
13
|
-
diverse, inclusive, and healthy community.
|
14
|
-
|
15
|
-
## Our Standards
|
16
|
-
|
17
|
-
Examples of behavior that contributes to a positive environment for our
|
18
|
-
community include:
|
19
|
-
|
20
|
-
- Demonstrating empathy and kindness toward other people
|
21
|
-
- Being respectful of differing opinions, viewpoints, and experiences
|
22
|
-
- Giving and gracefully accepting constructive feedback
|
23
|
-
- Accepting responsibility and apologizing to those affected by our mistakes,
|
24
|
-
and learning from the experience
|
25
|
-
- Focusing on what is best not just for us as individuals, but for the overall
|
26
|
-
community
|
27
|
-
|
28
|
-
Examples of unacceptable behavior include:
|
29
|
-
|
30
|
-
- The use of sexualized language or imagery, and sexual attention or advances of
|
31
|
-
any kind
|
32
|
-
- Trolling, insulting or derogatory comments, and personal or political attacks
|
33
|
-
- Public or private harassment
|
34
|
-
- Publishing others' private information, such as a physical or email address,
|
35
|
-
without their explicit permission
|
36
|
-
- Other conduct which could reasonably be considered inappropriate in a
|
37
|
-
professional setting
|
38
|
-
|
39
|
-
## Enforcement Responsibilities
|
40
|
-
|
41
|
-
Community leaders are responsible for clarifying and enforcing our standards of
|
42
|
-
acceptable behavior and will take appropriate and fair corrective action in
|
43
|
-
response to any behavior that they deem inappropriate, threatening, offensive,
|
44
|
-
or harmful.
|
45
|
-
|
46
|
-
Community leaders have the right and responsibility to remove, edit, or reject
|
47
|
-
comments, commits, code, wiki edits, issues, and other contributions that are
|
48
|
-
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
49
|
-
decisions when appropriate.
|
50
|
-
|
51
|
-
## Scope
|
52
|
-
|
53
|
-
This Code of Conduct applies within all community spaces, and also applies when
|
54
|
-
an individual is officially representing the community in public spaces.
|
55
|
-
Examples of representing our community include using an official email address,
|
56
|
-
posting via an official social media account, or acting as an appointed
|
57
|
-
representative at an online or offline event.
|
58
|
-
|
59
|
-
## Enforcement
|
60
|
-
|
61
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
62
|
-
reported to the community leaders responsible for enforcement at
|
63
|
-
[INSERT CONTACT METHOD].
|
64
|
-
All complaints will be reviewed and investigated promptly and fairly.
|
65
|
-
|
66
|
-
All community leaders are obligated to respect the privacy and security of the
|
67
|
-
reporter of any incident.
|
68
|
-
|
69
|
-
## Enforcement Guidelines
|
70
|
-
|
71
|
-
Community leaders will follow these Community Impact Guidelines in determining
|
72
|
-
the consequences for any action they deem in violation of this Code of Conduct:
|
73
|
-
|
74
|
-
### 1. Correction
|
75
|
-
|
76
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed
|
77
|
-
unprofessional or unwelcome in the community.
|
78
|
-
|
79
|
-
**Consequence**: A private, written warning from community leaders, providing
|
80
|
-
clarity around the nature of the violation and an explanation of why the
|
81
|
-
behavior was inappropriate. A public apology may be requested.
|
82
|
-
|
83
|
-
### 2. Warning
|
84
|
-
|
85
|
-
**Community Impact**: A violation through a single incident or series of
|
86
|
-
actions.
|
87
|
-
|
88
|
-
**Consequence**: A warning with consequences for continued behavior. No
|
89
|
-
interaction with the people involved, including unsolicited interaction with
|
90
|
-
those enforcing the Code of Conduct, for a specified period of time. This
|
91
|
-
includes avoiding interactions in community spaces as well as external channels
|
92
|
-
like social media. Violating these terms may lead to a temporary or permanent
|
93
|
-
ban.
|
94
|
-
|
95
|
-
### 3. Temporary Ban
|
96
|
-
|
97
|
-
**Community Impact**: A serious violation of community standards, including
|
98
|
-
sustained inappropriate behavior.
|
99
|
-
|
100
|
-
**Consequence**: A temporary ban from any sort of interaction or public
|
101
|
-
communication with the community for a specified period of time. No public or
|
102
|
-
private interaction with the people involved, including unsolicited interaction
|
103
|
-
with those enforcing the Code of Conduct, is allowed during this period.
|
104
|
-
Violating these terms may lead to a permanent ban.
|
105
|
-
|
106
|
-
### 4. Permanent Ban
|
107
|
-
|
108
|
-
**Community Impact**: Demonstrating a pattern of violation of community
|
109
|
-
standards, including sustained inappropriate behavior, harassment of an
|
110
|
-
individual, or aggression toward or disparagement of classes of individuals.
|
111
|
-
|
112
|
-
**Consequence**: A permanent ban from any sort of public interaction within the
|
113
|
-
community.
|
114
|
-
|
115
|
-
## Attribution
|
116
|
-
|
117
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
118
|
-
version 2.1, available at
|
119
|
-
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
120
|
-
|
121
|
-
Community Impact Guidelines were inspired by
|
122
|
-
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
123
|
-
|
124
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
125
|
-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
126
|
-
[https://www.contributor-covenant.org/translations][translations].
|
127
|
-
|
128
|
-
[homepage]: https://www.contributor-covenant.org
|
129
|
-
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
130
|
-
[Mozilla CoC]: https://github.com/mozilla/diversity
|
131
|
-
[FAQ]: https://www.contributor-covenant.org/faq
|
132
|
-
[translations]: https://www.contributor-covenant.org/translations
|
data/CONTRIBUTING.md
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
# Contributing to Loops Ruby SDK
|
2
|
-
|
3
|
-
Thank you for your interest in contributing to Loops Ruby SDK. We welcome contributions from the community and are excited to see what you'll bring to the project.
|
4
|
-
|
5
|
-
## Getting Started
|
6
|
-
|
7
|
-
1. Fork the repository on GitHub.
|
8
|
-
2. Clone your fork locally: `git clone <https://github.com/Loops-so/loops-rb.git`>
|
9
|
-
3. Create a new branch for your feature or bug fix: `git checkout -b your-branch-name`
|
10
|
-
|
11
|
-
## Making Changes
|
12
|
-
|
13
|
-
1. Make your changes in your branch.
|
14
|
-
2. Follow the coding style and conventions used in the project.
|
15
|
-
3. Write clear, concise commit messages.
|
16
|
-
4. Test your changes thoroughly.
|
17
|
-
|
18
|
-
## Submitting a Pull Request
|
19
|
-
|
20
|
-
1. Push your changes to your fork on GitHub.
|
21
|
-
2. From your fork, open a pull request in the correct branch of the main repository.
|
22
|
-
3. Provide a clear title and description for your pull request using our PR template.
|
23
|
-
4. Link any relevant issues in the pull request description.
|
24
|
-
|
25
|
-
## Code of Conduct
|
26
|
-
|
27
|
-
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project, you agree to abide by its terms.
|
28
|
-
|
29
|
-
## Reporting Bugs
|
30
|
-
|
31
|
-
If you find a bug, please open an issue on GitHub. Include as much detail as possible:
|
32
|
-
|
33
|
-
- A clear and descriptive title
|
34
|
-
- Steps to reproduce the issue
|
35
|
-
- Expected behavior
|
36
|
-
- Actual behavior
|
37
|
-
- Any error messages or screenshots
|
38
|
-
|
39
|
-
## Suggesting Enhancements
|
40
|
-
|
41
|
-
We welcome suggestions for enhancements! Please open an issue on GitHub with:
|
42
|
-
|
43
|
-
- A clear and descriptive title
|
44
|
-
- A detailed description of the proposed enhancement
|
45
|
-
- Any examples or mock-ups if applicable
|
46
|
-
|
47
|
-
## Questions?
|
48
|
-
|
49
|
-
If you have any questions, feel free to open an issue or contact the maintainers directly.
|
50
|
-
|
51
|
-
Thank you for contributing!
|
data/Rakefile
DELETED
data/sig/loops_sdk.rbs
DELETED