Skip to content

Commit 4e34017

Browse files
committed
Update documentation and relevant helper functions with collaborative content changes/changes made for public release
1 parent c77b8d5 commit 4e34017

File tree

5 files changed

+51
-22
lines changed

5 files changed

+51
-22
lines changed

src/helpers/conversations.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ object.list_until = async function(should_continue, sort_options) {
3232
};
3333

3434
// Create a new conversation.
35-
object.create = async function(title, message, recipient_id) {
36-
let body_data = {title: title, message: message, recipient_id: recipient_id};
35+
object.create = async function(title, message, recipient_ids) {
36+
let body_data = {title: title, message: message, recipient_id: recipient_ids};
3737
return await this.wrapper.post(`/conversations`, body_data);
3838
};
3939

src/helpers/members/members.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ object.fetch = async function(member_id) {
2929
return await this.wrapper.get(`/members/${member_id}`);
3030
};
3131

32+
// Fetch detailed information about a member by username.
33+
//
34+
// See documentation for response object fields: https://www.mc-market.org/wiki/ultimate-api-v1-members/
35+
object.fetch_by_username = async function(username) {
36+
return await this.wrapper.get(`/members/username/${username}`);
37+
};
38+
3239
// Fetch a list of recently issued bans.
3340
//
3441
// See documentation for response object fields: https://www.mc-market.org/wiki/ultimate-api-v1-members/

src/helpers/resources/licenses.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,12 @@ object.fetch = async function(resource_id, license_id) {
5252
return await this.wrapper.get(`/resources/${resource_id}/licenses/${license_id}`);
5353
};
5454

55-
// Modify a license for a given resource.
56-
//
57-
// See documentation for response array object fields:
58-
// https://www.mc-market.org/wiki/ultimate-api-v1-resources-licenses/
59-
object.modify = async function(resource_id, license_id, fields) {
60-
return await this.wrapper.patch(`/resources/${resource_id}/licenses/${license_id}`, fields);
61-
};
62-
63-
// Validate a license for a given resource.
55+
// Fetch a member's license for a given resource.
6456
//
6557
// See documentation for response array object fields:
6658
// https://www.mc-market.org/wiki/ultimate-api-v1-resources-licenses/
67-
object.validate = async function(resource_id, license_id, fields) {
68-
let endpoint = `/resources/${resource_id}/licenses/${license_id}`;
59+
object.fetch_member = async function(resource_id, purchaser_id, fields) {
60+
let endpoint = `/resources/${resource_id}/licenses/member/${purchaser_id}`;
6961

7062
if (this.wrapper.token.type === "Shared") {
7163
endpoint += `?nonce=${fields.nonce}&timestamp=${fields.timestamp}`
@@ -74,5 +66,13 @@ object.validate = async function(resource_id, license_id, fields) {
7466
return await this.wrapper.get(endpoint, fields);
7567
};
7668

69+
// Modify a license for a given resource.
70+
//
71+
// See documentation for response array object fields:
72+
// https://www.mc-market.org/wiki/ultimate-api-v1-resources-licenses/
73+
object.modify = async function(resource_id, license_id, fields) {
74+
return await this.wrapper.patch(`/resources/${resource_id}/licenses/${license_id}`, fields);
75+
};
76+
7777
/* exports */
7878
module.exports = object;

src/helpers/resources/resources.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,35 @@ object.list_owned_until = async function(should_continue, sort_options) {
5252
return await this.wrapper.list_until(`/resources/owned`, should_continue, sort_options);
5353
};
5454

55+
// List a page of collaborated resources (with optional sort options).
56+
//
57+
// See documentation for response array object fields: https://www.mc-market.org/wiki/ultimate-api-v1-resources/
58+
object.list_collaborated = async function(sort_options) {
59+
return await this.wrapper.get(`/resources/collaborated`, sort_options);
60+
};
61+
62+
// List all pages of collaborated resources (with optional sort options).
63+
//
64+
// See documentation for response array object fields: https://www.mc-market.org/wiki/ultimate-api-v1-resources/
65+
object.list_collaborated_all = async function(sort_options) {
66+
return await this.wrapper.list_until(`/resources/collaborated`, () => true, sort_options);
67+
};
68+
69+
// List multiple pages of collaborated resources (with optional sort options) until a condition is no longer met.
70+
//
71+
// See documentation for response array object fields: https://www.mc-market.org/wiki/ultimate-api-v1-resources/
72+
object.list_collaborated_until = async function(should_continue, sort_options) {
73+
return await this.wrapper.list_until(`/resources/collaborated`, should_continue, sort_options);
74+
};
75+
5576
// Fetch detailed information about a resource.
5677
//
5778
// See documentation for response array object fields: https://www.mc-market.org/wiki/ultimate-api-v1-resources/
5879
object.fetch = async function(resource_id) {
5980
return await this.wrapper.get(`/resources/${resource_id}`);
6081
};
6182

62-
// Edit resource fields.
83+
// Edit resource fields for a resource you own or collaborate on.
6384
object.edit = async function(resource_id, fields) {
6485
return await this.wrapper.patch(`/resources/${resource_id}`, fields);
6586
};

src/helpers/threads.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,56 +11,57 @@ object.init = function(wrapper) {
1111
};
1212

1313
/* functions */
14-
// List a page of threads you own (with optional sort options).
14+
// List a page of threads you own or collaborate on (with optional sort options).
1515
//
1616
// See documentation for response array object fields: https://www.mc-market.org/wiki/ultimate-api-v1-threads/
1717
object.list = async function(sort_options) {
1818
return await this.wrapper.get(`/threads`, sort_options);
1919
};
2020

21-
// List all pages of threads you own (with optional sort options).
21+
// List all pages of threads you own or collaborate on (with optional sort options).
2222
//
2323
// See documentation for response array object fields: https://www.mc-market.org/wiki/ultimate-api-v1-threads/
2424
object.list_all = async function(sort_options) {
2525
return await this.wrapper.list_until(`/threads`, () => true, sort_options);
2626
};
2727

28-
// List multiple pages of threads you own (with optional sort options) until a condition is no longer met.
28+
// List multiple pages of threads you own or collaborate on (with optional sort options) until a condition is no longer
29+
// met.
2930
//
3031
// See documentation for response array object fields: https://www.mc-market.org/wiki/ultimate-api-v1-threads/
3132
object.list_until = async function(should_continue, sort_options) {
3233
return await this.wrapper.list_until(`/threads`, should_continue, sort_options);
3334
};
3435

35-
// Fetch detailed information about a thread you own.
36+
// Fetch detailed information about a thread you own or collaborate on.
3637
//
3738
// See documentation for response array object fields: https://www.mc-market.org/wiki/ultimate-api-v1-threads/
3839
object.fetch = async function(thread_id) {
3940
return await this.wrapper.get(`/threads/${thread_id}`);
4041
};
4142

42-
// List a page of replies for a thread you own (with optional sort options).
43+
// List a page of replies for a thread you own or collaborate on (with optional sort options).
4344
//
4445
// See documentation for response array object fields: https://www.mc-market.org/wiki/ultimate-api-v1-threads-replies/
4546
object.list_replies = async function(thread_id, sort_options) {
4647
return await this.wrapper.get(`/threads/${thread_id}/replies`, sort_options);
4748
};
4849

49-
// List all pages of replies for a thread you own (with optional sort options).
50+
// List all pages of replies for a thread you own or collaborate on (with optional sort options).
5051
//
5152
// See documentation for response array object fields: https://www.mc-market.org/wiki/ultimate-api-v1-threads-replies/
5253
object.list_replies_all = async function(thread_id, sort_options) {
5354
return await this.wrapper.list_until(`/threads/${thread_id}/replies`, () => true, sort_options);
5455
};
5556

56-
// List multiple pages of replies for a thread you own (with optional sort options) until a condition is no longer met.
57+
// List multiple pages of replies for a thread you own or collaborate on (with optional sort options) until a condition is no longer met.
5758
//
5859
// See documentation for response array object fields: https://www.mc-market.org/wiki/ultimate-api-v1-threads-replies/
5960
object.list_replies_until = async function(thread_id, should_continue, sort_options) {
6061
return await this.wrapper.list_until(`/threads/${thread_id}/replies`, should_continue, sort_options);
6162
};
6263

63-
// Reply to a thread you own.
64+
// Reply to a thread you own or collaborate on.
6465
object.reply = async function(thread_id, message) {
6566
return await this.wrapper.post(`/threads/${thread_id}/replies`, {message: message});
6667
};

0 commit comments

Comments
 (0)