@anitrack/patreon-wrapper 1.5.2 → 1.5.4
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.
- package/.prettierrc +6 -0
- package/LICENSE +21 -21
- package/README.md +185 -157
- package/package.json +35 -36
- package/{lib → src}/index.d.ts +95 -79
- package/src/index.d.ts.map +1 -0
- package/src/index.js +179 -0
- package/src/index.js.map +1 -0
- package/src/index.ts +309 -265
- package/tsconfig.json +14 -102
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -157
- package/lib/index.js.map +0 -1
package/.prettierrc
ADDED
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 AniTrack
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 AniTrack
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,157 +1,185 @@
|
|
|
1
|
-
# 🍊 Patreon Wrapper
|
|
2
|
-
|
|
3
|
-
💎 Universal Patron API v2 wrapper that simplifies their API usage in JavaScript
|
|
4
|
-
|
|
5
|
-
> This package was previously used on [AniTrack.co](https://anitrack.co) before switching to the payment gateway
|
|
6
|
-
|
|
7
|
-
# Table of Contents
|
|
8
|
-
|
|
9
|
-
- [Install](#Install%20the%20package)
|
|
10
|
-
- [Getting Started](#Getting%20Started)
|
|
11
|
-
- [Sandbox for development](#Patreon%20Sandbox)
|
|
12
|
-
- [License](#license)
|
|
13
|
-
|
|
14
|
-
<br />
|
|
15
|
-
|
|
16
|
-
# Install the package
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
$ npm install @anitrack/patreon-wrapper
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
<br />
|
|
23
|
-
|
|
24
|
-
# Getting Started
|
|
25
|
-
|
|
26
|
-
```js
|
|
27
|
-
import { Patreon } from '@anitrack/patreon-wrapper';
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
<br />
|
|
31
|
-
|
|
32
|
-
# API Authorization
|
|
33
|
-
|
|
34
|
-
> Where do I find Campaign ID? F12 your Patreon page and search for "campaign" then keep looking until you finds URL with campaign params that contains around 7 degits. That should be your Campaign ID
|
|
35
|
-
|
|
36
|
-
```js
|
|
37
|
-
Patreon.Authorization({
|
|
38
|
-
AccessToken: 'YOUR_API_V2_ACCESS_TOKEN',
|
|
39
|
-
CampaignID: 'YOUR_CAPAIGN_ID',
|
|
40
|
-
});
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
<br />
|
|
44
|
-
|
|
45
|
-
# Package Usage
|
|
46
|
-
|
|
47
|
-
## Fetching
|
|
48
|
-
|
|
49
|
-
```js
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
1
|
+
# 🍊 Patreon Wrapper
|
|
2
|
+
|
|
3
|
+
💎 Universal Patron API v2 wrapper that simplifies their API usage in JavaScript
|
|
4
|
+
|
|
5
|
+
> This package was previously used on [AniTrack.co](https://anitrack.co) before switching to the payment gateway
|
|
6
|
+
|
|
7
|
+
# Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Install](#Install%20the%20package)
|
|
10
|
+
- [Getting Started](#Getting%20Started)
|
|
11
|
+
- [Sandbox for development](#Patreon%20Sandbox)
|
|
12
|
+
- [License](#license)
|
|
13
|
+
|
|
14
|
+
<br />
|
|
15
|
+
|
|
16
|
+
# Install the package
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
$ npm install @anitrack/patreon-wrapper
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
<br />
|
|
23
|
+
|
|
24
|
+
# Getting Started
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { Patreon } from '@anitrack/patreon-wrapper';
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
<br />
|
|
31
|
+
|
|
32
|
+
# API Authorization
|
|
33
|
+
|
|
34
|
+
> Where do I find Campaign ID? F12 your Patreon page and search for "campaign" then keep looking until you finds URL with campaign params that contains around 7 degits. That should be your Campaign ID
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
Patreon.Authorization({
|
|
38
|
+
AccessToken: 'YOUR_API_V2_ACCESS_TOKEN',
|
|
39
|
+
CampaignID: 'YOUR_CAPAIGN_ID',
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
<br />
|
|
44
|
+
|
|
45
|
+
# Package Usage
|
|
46
|
+
|
|
47
|
+
## Fetching Campaign Info
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
const Campaign = await Patreon.FetchCampaign();
|
|
51
|
+
console.log(Campaign);
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Campaign object example
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
{
|
|
58
|
+
id: '1234567',
|
|
59
|
+
name: 'My Campaign',
|
|
60
|
+
patronCount: 142,
|
|
61
|
+
currency: 'USD',
|
|
62
|
+
isMonthly: true,
|
|
63
|
+
isNsfw: false,
|
|
64
|
+
summary: 'Support my work.',
|
|
65
|
+
createdAt: '2022-01-15T15:00:00.000+00:00',
|
|
66
|
+
publishedAt: '2022-01-16T10:00:00.000+00:00',
|
|
67
|
+
imageUrl: 'https://example.url',
|
|
68
|
+
imageSmallUrl: 'https://example.url',
|
|
69
|
+
discordServerId: '1234567890'
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Fetching every Patrons from the Campaign
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
const Patrons = await Patreon.FetchPatrons([
|
|
77
|
+
'active_patron',
|
|
78
|
+
'declined_patron',
|
|
79
|
+
'former_patron',
|
|
80
|
+
]);
|
|
81
|
+
|
|
82
|
+
console.log(Patrons);
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Patron object example
|
|
86
|
+
|
|
87
|
+
console.log(Patrons) from above
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
[
|
|
91
|
+
{
|
|
92
|
+
displayId: '12345678',
|
|
93
|
+
displayName: 'Username',
|
|
94
|
+
emailAddress: 'email@address.com',
|
|
95
|
+
isFollower: false,
|
|
96
|
+
subscription: {
|
|
97
|
+
note: '',
|
|
98
|
+
currentEntitled: {
|
|
99
|
+
status: 'active_patron',
|
|
100
|
+
lastChargeStatus: 'Paid',
|
|
101
|
+
tier: {
|
|
102
|
+
id: '12345678',
|
|
103
|
+
title: 'My First Tier'
|
|
104
|
+
},
|
|
105
|
+
cents: 500,
|
|
106
|
+
willPayCents: 500,
|
|
107
|
+
lifetimeCents: 1500,
|
|
108
|
+
firstCharge: '2022-01-15 15:00:00.000',
|
|
109
|
+
nextCharge: '2022-05-15 15:00:00.000',
|
|
110
|
+
lastCharge: '2022-05-15 15:00:00.000'
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
mediaConnection: {
|
|
114
|
+
patreon: {
|
|
115
|
+
id: '12345678',
|
|
116
|
+
url: 'https://www.patreon.com/api/oauth2/v2/user/12345678'
|
|
117
|
+
},
|
|
118
|
+
discord: {
|
|
119
|
+
id: '12345678',
|
|
120
|
+
url: 'https://discord.com/users/12345678'
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
...
|
|
125
|
+
]
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
<br />
|
|
129
|
+
|
|
130
|
+
# Patreon Sandbox
|
|
131
|
+
|
|
132
|
+
> This is great for development and working with sandbox patrons users. The sandbox patrons object will be exactly the same as real ones!
|
|
133
|
+
|
|
134
|
+
## Adding Custom Patrons to the Sandbox
|
|
135
|
+
|
|
136
|
+
You can add as much sandbox patrons as you want
|
|
137
|
+
|
|
138
|
+
```js
|
|
139
|
+
import { Sandbox } from '@anitrack/patreon-wrapper';
|
|
140
|
+
|
|
141
|
+
Sandbox.AddPatron({
|
|
142
|
+
displayId: '123', // Patreon ID
|
|
143
|
+
displayName: '123', // Patreon Username
|
|
144
|
+
emailAddress: 'email@address.com', // Patreon Email
|
|
145
|
+
tier: { id: '123', title: 'Tier 1' }, // Current Tier
|
|
146
|
+
cents: 500, // Current paying in cent 500 -> $5.00
|
|
147
|
+
willPayCents: 500, // Next pay price
|
|
148
|
+
lifetimeCents: 1500, // Total lifetime spent
|
|
149
|
+
firstCharge: '2022-01-15 15:00:00.000', // ISO 8601 String date format
|
|
150
|
+
nextCharge: '2022-05-15 15:00:00.000',
|
|
151
|
+
lastCharge: '2022-04-15 15:00:00.000',
|
|
152
|
+
patronStatus: 'active_patron',
|
|
153
|
+
mediaConnection: {
|
|
154
|
+
patreon: {
|
|
155
|
+
id: '123',
|
|
156
|
+
url: 'https://www.patreon.com/api/oauth2/v2/user/user_id',
|
|
157
|
+
},
|
|
158
|
+
discord: { id: '123', url: 'https://discord.com/users/user_id' },
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
const Patrons = Sandbox.GetPatrons();
|
|
163
|
+
|
|
164
|
+
console.log(Patrons);
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Get both Sandbox Patrons and Real Patrons
|
|
168
|
+
|
|
169
|
+
set third boolean argument "showSandboxPatrons" to true
|
|
170
|
+
|
|
171
|
+
```js
|
|
172
|
+
const Patrons = await Patreon.FetchPatrons(
|
|
173
|
+
['active_patron', 'declined_patron', 'former_patron'],
|
|
174
|
+
450,
|
|
175
|
+
true
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
console.log(Patrons);
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
<br />
|
|
182
|
+
|
|
183
|
+
# License
|
|
184
|
+
|
|
185
|
+
[MIT](LICENSE)
|
package/package.json
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@anitrack/patreon-wrapper",
|
|
3
|
+
"version": "1.5.4",
|
|
4
|
+
"description": "Universal Patron API v2 wrapper that simplifies their API usage in JavaScript",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"types": "lib",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc -p ."
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git://github.com/AniTrack/patreon-wrapper.git"
|
|
13
|
+
},
|
|
14
|
+
"author": "AniTrack",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"patreon",
|
|
17
|
+
"discord",
|
|
18
|
+
"api"
|
|
19
|
+
],
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/AniTrack/patreon-wrapper/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/AniTrack/patreon-wrapper#readme",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"axios": "^1.17.0"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"ts-node": "^10.9.2",
|
|
33
|
+
"typescript": "^6.0.3"
|
|
34
|
+
}
|
|
35
|
+
}
|
package/{lib → src}/index.d.ts
RENAMED
|
@@ -1,80 +1,96 @@
|
|
|
1
|
-
export type PatronStatus = 'active_patron' | 'declined_patron' | 'former_patron';
|
|
2
|
-
export type PatronAPIAuth = {
|
|
3
|
-
AccessToken: string;
|
|
4
|
-
CampaignID: string;
|
|
5
|
-
};
|
|
6
|
-
export type PatronType = {
|
|
7
|
-
displayId: string;
|
|
8
|
-
displayName: string;
|
|
9
|
-
emailAddress: string;
|
|
10
|
-
isFollower: boolean;
|
|
11
|
-
subscription: {
|
|
12
|
-
note: string;
|
|
13
|
-
currentEntitled: {
|
|
14
|
-
status: PatronStatus;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
1
|
+
export type PatronStatus = 'active_patron' | 'declined_patron' | 'former_patron';
|
|
2
|
+
export type PatronAPIAuth = {
|
|
3
|
+
AccessToken: string;
|
|
4
|
+
CampaignID: string;
|
|
5
|
+
};
|
|
6
|
+
export type PatronType = {
|
|
7
|
+
displayId: string;
|
|
8
|
+
displayName: string | null;
|
|
9
|
+
emailAddress: string | null;
|
|
10
|
+
isFollower: boolean;
|
|
11
|
+
subscription: {
|
|
12
|
+
note: string;
|
|
13
|
+
currentEntitled: {
|
|
14
|
+
status: PatronStatus;
|
|
15
|
+
lastChargeStatus: string | null;
|
|
16
|
+
tier: {
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
};
|
|
20
|
+
cents: number;
|
|
21
|
+
willPayCents: number;
|
|
22
|
+
lifetimeCents: number;
|
|
23
|
+
firstCharge: string;
|
|
24
|
+
nextCharge: string;
|
|
25
|
+
lastCharge: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
mediaConnection: {
|
|
29
|
+
patreon: {
|
|
30
|
+
id: string;
|
|
31
|
+
url: string;
|
|
32
|
+
};
|
|
33
|
+
discord: {
|
|
34
|
+
id: string | null;
|
|
35
|
+
url: string | null;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export type CampaignType = {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
patronCount: number;
|
|
43
|
+
currency: string;
|
|
44
|
+
isMonthly: boolean;
|
|
45
|
+
isNsfw: boolean;
|
|
46
|
+
summary: string | null;
|
|
47
|
+
createdAt: string;
|
|
48
|
+
publishedAt: string | null;
|
|
49
|
+
imageUrl: string | null;
|
|
50
|
+
imageSmallUrl: string | null;
|
|
51
|
+
discordServerId: string | null;
|
|
52
|
+
};
|
|
53
|
+
export type SandboxOptions = {
|
|
54
|
+
displayId: string;
|
|
55
|
+
displayName: string;
|
|
56
|
+
emailAddress: string;
|
|
57
|
+
tier: {
|
|
58
|
+
id: string;
|
|
59
|
+
title: string;
|
|
60
|
+
};
|
|
61
|
+
cents: number;
|
|
62
|
+
willPayCents: number;
|
|
63
|
+
lifetimeCents: number;
|
|
64
|
+
patronStatus: PatronStatus;
|
|
65
|
+
firstCharge: string;
|
|
66
|
+
nextCharge: string;
|
|
67
|
+
lastCharge: string;
|
|
68
|
+
mediaConnection: {
|
|
69
|
+
patreon: {
|
|
70
|
+
id: string;
|
|
71
|
+
url: string;
|
|
72
|
+
};
|
|
73
|
+
discord: {
|
|
74
|
+
id: string | null;
|
|
75
|
+
url: string | null;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export declare class Patreon {
|
|
80
|
+
private static _URL;
|
|
81
|
+
private static _AccessToken;
|
|
82
|
+
private static _CampaignID;
|
|
83
|
+
private static _SandboxPatrons;
|
|
84
|
+
static Authorization(AuthCredentials: PatronAPIAuth): void;
|
|
85
|
+
private static FetchAPI;
|
|
86
|
+
private static BuildMembersURL;
|
|
87
|
+
static FetchPatrons(filters?: Array<PatronStatus>, pageSize?: number, showSandboxPatrons?: boolean): Promise<PatronType[]>;
|
|
88
|
+
protected static _SandboxAddPatron(Patron: SandboxOptions): void;
|
|
89
|
+
protected static _SandboxGetPatron(): SandboxOptions[];
|
|
90
|
+
static FetchCampaign(): Promise<CampaignType>;
|
|
91
|
+
}
|
|
92
|
+
export declare class Sandbox extends Patreon {
|
|
93
|
+
static GetPatrons(): SandboxOptions[];
|
|
94
|
+
static AddPatron(Patron: SandboxOptions): void;
|
|
95
|
+
}
|
|
80
96
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 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