sidechat.js 2.4.1 → 2.4.2

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/dist/index.cjs CHANGED
@@ -2,6 +2,138 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ /**
6
+ * A user-created post or comment, depending on the "type" prop
7
+ * @typedef {Object} SidechatPostOrComment
8
+ * @prop {"post"|"comment"} type - whether this object represents a post or a comment on a post
9
+ * @prop {String} id - alphanumeric ID of post or comment
10
+ * @prop {Boolean} authored_by_user - undocumented
11
+ * @prop {String} alias - post creator's name in-app
12
+ * @prop {String} group_id - alphanumeric ID of group
13
+ * @prop {SidechatGroup} group - group in which post or comment was created
14
+ * @prop {String} text - text content of post or comment
15
+ * @prop {String} created_at - date string of post or comment creation time
16
+ * @prop {Number} vote_total - sum of upvotes and downvotes
17
+ * @prop {SidechatVoteString} vote_status - current user's vote on post or comment
18
+ * @prop {SidechatSimpleAsset[]} assets - array of simple assets attached to post or comment
19
+ * @prop {Array} attachments - undocumented
20
+ * @prop {Boolean} dms_disabled - whether or not you can send a DM to creator of post
21
+ * @prop {Array} tags - undocumented
22
+ * @prop {SidechatIdentity} identity - creator's identity information
23
+ * @prop {Boolean} pinned - undocumented
24
+ * @prop {Boolean} is_saved - undocumented
25
+ * @prop {"following"|"not_following"} follow_status - undocumented
26
+ * @prop {"group"} [destination] - undocumented
27
+ * @prop {Number} [comment_count] - number of comments on post (only if type=post)
28
+ * @prop {Boolean} [comments_disabled] - whether or not you can comment on post (only if type=post)
29
+ * @prop {String} [parent_post_id] - alphanumeric ID of parent post (only if type=comment)
30
+ * @prop {String} [reply_post_id] - alphanumeric ID of comment being replied to, falls back to parent_post_id (only if type=comment)
31
+ * @prop {String} [context] - text content of comment being replied to, falls back to text (only if type=comment)
32
+ */
33
+
34
+ /**
35
+ * A group object, containing metadata about a group as well as its join conditions and states. Some properties vary based on the endpoint the object came from.
36
+ * @typedef {Object} SidechatGroup
37
+ * @prop {String} id - alphanumeric ID of group
38
+ * @prop {String} name - human-readable name of group
39
+ * @prop {String} analytics_name - name to file group under
40
+ * @prop {"non_member"|"member"} membership_type - whether or not current user is a member of group
41
+ * @prop {String} color - group's theme color as hex code (e.g., #FFFFFF)
42
+ * @prop {"open"|"closed"|"email_domain"} group_join_type - basis on which group accepts new members
43
+ * @prop {"private"|"public_to_all"|"public_to_schools"} group_visibility - group's visibility setting
44
+ * @prop {"show"|"hide"} asset_library_visibility - whether or not group's asset library is visible
45
+ * @prop {Array} [roles] - undocumented
46
+ * @prop {String} [description] - description of group
47
+ * @prop {SidechatPrivateAssetURL} [icon_url] - image URL for group icon
48
+ * @prop {Number} [member_count] - number of users in group
49
+ * @prop {Boolean} [should_show_leaderboard] - undocumented
50
+ */
51
+
52
+ /**
53
+ * An asset object, containing information about an image within a post or comment
54
+ * @typedef {Object} SidechatSimpleAsset
55
+ * @prop {String} id - alphanumeric ID of asset
56
+ * @prop {"image"} type - undocumented
57
+ * @prop {"jpeg"|"png"|"gif"} content_type - file type of asset
58
+ * @prop {Number} width - width of asset
59
+ * @prop {Number} height - height of asset
60
+ * @prop {SidechatPrivateAssetURL} [url] - URL string of asset's location
61
+ */
62
+
63
+ /**
64
+ * An asset object, containing information about an image from the asset library
65
+ * @typedef {Object} SidechatLibraryAsset
66
+ * @prop {String} id - alphanumeric ID of asset
67
+ * @prop {String} created_at - date string of asset creation time
68
+ * @prop {SidechatAssetMetadata} metadata - metadata associated with asset
69
+ * @prop {SidechatPrivateAssetURL} url - URL string of asset's location
70
+ */
71
+
72
+ /**
73
+ * An asset object, containing information about an image from the asset library
74
+ * @typedef {Object} SidechatAssetMetadata
75
+ * @prop {Number} width - width of asset
76
+ * @prop {Number} height - height of asset
77
+ * @prop {"image"} type - undocumented
78
+ * @prop {"jpeg"|"png"|"gif"} content_type - file type of asset
79
+ */
80
+
81
+ /**
82
+ * A user's anonymous identity information
83
+ * @typedef {Object} SidechatIdentity
84
+ * @prop {String} name - representation of user's name (varies across app)
85
+ * @prop {Boolean} posted_with_username - undocumented
86
+ */
87
+
88
+ /**
89
+ * The current user's information
90
+ * @typedef {Object} SidechatCurrentUser
91
+ * @prop {String} id - alphanumeric ID of current user
92
+ * @prop {String} hashedVerifiedEmail - verified email of current user in an unreadable hashed form
93
+ * @prop {Boolean} isGlobalModerator - whether or not user is a moderator
94
+ * @prop {Boolean} isGlobalAdmin - whether or not user is an admin
95
+ * @prop {SidechatMembership[]} memberships
96
+ * @prop {Array} roles - undocumented
97
+ * @prop {String} emailDomain - domain of verified email address on account
98
+ * @prop {String} wildcardEmailDomain - domain of verified email address on account, preceeded by *. to support subdomains
99
+ */
100
+
101
+ /**
102
+ * Representation of a group membership
103
+ * @typedef {Object} SidechatMembership
104
+ * @prop {String} groupId - alphanumeric ID of group
105
+ * @prop {String} type - role of current user in group
106
+ */
107
+
108
+ /**
109
+ * An asset URL that can only be accessed by making a request with a user's bearer token attached in the Authorization header
110
+ * @typedef {String} SidechatPrivateAssetURL
111
+ */
112
+
113
+ /**
114
+ * A cursor for paginating through post lists
115
+ * @typedef {String} SidechatCursorString
116
+ */
117
+
118
+ /**
119
+ * A vote on a comment or post
120
+ * @typedef {"upvote"|"downvote"|"none"} SidechatVoteString
121
+ */
122
+
123
+ /**
124
+ * A user's bearer authentication token needed for most requests
125
+ * @typedef {String} SidechatAuthToken
126
+ */
127
+
128
+ /**
129
+ * A list of posts and the associated cursor
130
+ * @typedef {Object} SidechatPostsAndCursor
131
+ * @prop {SidechatPostOrComment[]} posts
132
+ * @prop {SidechatCursorString} cursor
133
+ */
134
+
135
+ var SidechatTypes = {};
136
+
5
137
  /**
6
138
  * Throwable error caused by the Sidechat API
7
139
  * @class
@@ -1044,3 +1176,4 @@ class SidechatColorList {
1044
1176
  exports.SidechatAPIClient = SidechatAPIClient;
1045
1177
  exports.SidechatAPIError = SidechatAPIError;
1046
1178
  exports.SidechatColorList = SidechatColorList;
1179
+ exports.SidechatTypes = SidechatTypes;
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import SidechatAPIClient from "./classes/SidechatAPIClient.js";
2
2
  import SidechatAPIError from "./classes/SidechatAPIError.js";
3
3
  import SidechatColorList from "./classes/SidechatColorList.js";
4
- export { SidechatAPIClient, SidechatAPIError, SidechatColorList };
4
+ import SidechatTypes from "./types/SidechatTypes.js";
5
+ export { SidechatAPIClient, SidechatAPIError, SidechatColorList, SidechatTypes };
5
6
  //# sourceMappingURL=index.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import SidechatAPIClient from "./classes/SidechatAPIClient.js";
2
2
  import SidechatAPIError from "./classes/SidechatAPIError.js";
3
3
  import SidechatColorList from "./classes/SidechatColorList.js";
4
- export { SidechatAPIClient, SidechatAPIError, SidechatColorList };
4
+ import SidechatTypes from "./types/SidechatTypes.js";
5
+ export { SidechatAPIClient, SidechatAPIError, SidechatColorList, SidechatTypes };
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"8BAC8B,gCAAgC;6BACjC,+BAA+B;8BAC9B,gCAAgC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"8BAC8B,gCAAgC;6BACjC,+BAA+B;8BAC9B,gCAAgC;0BAHpC,0BAA0B"}
package/dist/index.mjs CHANGED
@@ -1,3 +1,135 @@
1
+ /**
2
+ * A user-created post or comment, depending on the "type" prop
3
+ * @typedef {Object} SidechatPostOrComment
4
+ * @prop {"post"|"comment"} type - whether this object represents a post or a comment on a post
5
+ * @prop {String} id - alphanumeric ID of post or comment
6
+ * @prop {Boolean} authored_by_user - undocumented
7
+ * @prop {String} alias - post creator's name in-app
8
+ * @prop {String} group_id - alphanumeric ID of group
9
+ * @prop {SidechatGroup} group - group in which post or comment was created
10
+ * @prop {String} text - text content of post or comment
11
+ * @prop {String} created_at - date string of post or comment creation time
12
+ * @prop {Number} vote_total - sum of upvotes and downvotes
13
+ * @prop {SidechatVoteString} vote_status - current user's vote on post or comment
14
+ * @prop {SidechatSimpleAsset[]} assets - array of simple assets attached to post or comment
15
+ * @prop {Array} attachments - undocumented
16
+ * @prop {Boolean} dms_disabled - whether or not you can send a DM to creator of post
17
+ * @prop {Array} tags - undocumented
18
+ * @prop {SidechatIdentity} identity - creator's identity information
19
+ * @prop {Boolean} pinned - undocumented
20
+ * @prop {Boolean} is_saved - undocumented
21
+ * @prop {"following"|"not_following"} follow_status - undocumented
22
+ * @prop {"group"} [destination] - undocumented
23
+ * @prop {Number} [comment_count] - number of comments on post (only if type=post)
24
+ * @prop {Boolean} [comments_disabled] - whether or not you can comment on post (only if type=post)
25
+ * @prop {String} [parent_post_id] - alphanumeric ID of parent post (only if type=comment)
26
+ * @prop {String} [reply_post_id] - alphanumeric ID of comment being replied to, falls back to parent_post_id (only if type=comment)
27
+ * @prop {String} [context] - text content of comment being replied to, falls back to text (only if type=comment)
28
+ */
29
+
30
+ /**
31
+ * A group object, containing metadata about a group as well as its join conditions and states. Some properties vary based on the endpoint the object came from.
32
+ * @typedef {Object} SidechatGroup
33
+ * @prop {String} id - alphanumeric ID of group
34
+ * @prop {String} name - human-readable name of group
35
+ * @prop {String} analytics_name - name to file group under
36
+ * @prop {"non_member"|"member"} membership_type - whether or not current user is a member of group
37
+ * @prop {String} color - group's theme color as hex code (e.g., #FFFFFF)
38
+ * @prop {"open"|"closed"|"email_domain"} group_join_type - basis on which group accepts new members
39
+ * @prop {"private"|"public_to_all"|"public_to_schools"} group_visibility - group's visibility setting
40
+ * @prop {"show"|"hide"} asset_library_visibility - whether or not group's asset library is visible
41
+ * @prop {Array} [roles] - undocumented
42
+ * @prop {String} [description] - description of group
43
+ * @prop {SidechatPrivateAssetURL} [icon_url] - image URL for group icon
44
+ * @prop {Number} [member_count] - number of users in group
45
+ * @prop {Boolean} [should_show_leaderboard] - undocumented
46
+ */
47
+
48
+ /**
49
+ * An asset object, containing information about an image within a post or comment
50
+ * @typedef {Object} SidechatSimpleAsset
51
+ * @prop {String} id - alphanumeric ID of asset
52
+ * @prop {"image"} type - undocumented
53
+ * @prop {"jpeg"|"png"|"gif"} content_type - file type of asset
54
+ * @prop {Number} width - width of asset
55
+ * @prop {Number} height - height of asset
56
+ * @prop {SidechatPrivateAssetURL} [url] - URL string of asset's location
57
+ */
58
+
59
+ /**
60
+ * An asset object, containing information about an image from the asset library
61
+ * @typedef {Object} SidechatLibraryAsset
62
+ * @prop {String} id - alphanumeric ID of asset
63
+ * @prop {String} created_at - date string of asset creation time
64
+ * @prop {SidechatAssetMetadata} metadata - metadata associated with asset
65
+ * @prop {SidechatPrivateAssetURL} url - URL string of asset's location
66
+ */
67
+
68
+ /**
69
+ * An asset object, containing information about an image from the asset library
70
+ * @typedef {Object} SidechatAssetMetadata
71
+ * @prop {Number} width - width of asset
72
+ * @prop {Number} height - height of asset
73
+ * @prop {"image"} type - undocumented
74
+ * @prop {"jpeg"|"png"|"gif"} content_type - file type of asset
75
+ */
76
+
77
+ /**
78
+ * A user's anonymous identity information
79
+ * @typedef {Object} SidechatIdentity
80
+ * @prop {String} name - representation of user's name (varies across app)
81
+ * @prop {Boolean} posted_with_username - undocumented
82
+ */
83
+
84
+ /**
85
+ * The current user's information
86
+ * @typedef {Object} SidechatCurrentUser
87
+ * @prop {String} id - alphanumeric ID of current user
88
+ * @prop {String} hashedVerifiedEmail - verified email of current user in an unreadable hashed form
89
+ * @prop {Boolean} isGlobalModerator - whether or not user is a moderator
90
+ * @prop {Boolean} isGlobalAdmin - whether or not user is an admin
91
+ * @prop {SidechatMembership[]} memberships
92
+ * @prop {Array} roles - undocumented
93
+ * @prop {String} emailDomain - domain of verified email address on account
94
+ * @prop {String} wildcardEmailDomain - domain of verified email address on account, preceeded by *. to support subdomains
95
+ */
96
+
97
+ /**
98
+ * Representation of a group membership
99
+ * @typedef {Object} SidechatMembership
100
+ * @prop {String} groupId - alphanumeric ID of group
101
+ * @prop {String} type - role of current user in group
102
+ */
103
+
104
+ /**
105
+ * An asset URL that can only be accessed by making a request with a user's bearer token attached in the Authorization header
106
+ * @typedef {String} SidechatPrivateAssetURL
107
+ */
108
+
109
+ /**
110
+ * A cursor for paginating through post lists
111
+ * @typedef {String} SidechatCursorString
112
+ */
113
+
114
+ /**
115
+ * A vote on a comment or post
116
+ * @typedef {"upvote"|"downvote"|"none"} SidechatVoteString
117
+ */
118
+
119
+ /**
120
+ * A user's bearer authentication token needed for most requests
121
+ * @typedef {String} SidechatAuthToken
122
+ */
123
+
124
+ /**
125
+ * A list of posts and the associated cursor
126
+ * @typedef {Object} SidechatPostsAndCursor
127
+ * @prop {SidechatPostOrComment[]} posts
128
+ * @prop {SidechatCursorString} cursor
129
+ */
130
+
131
+ var SidechatTypes = {};
132
+
1
133
  /**
2
134
  * Throwable error caused by the Sidechat API
3
135
  * @class
@@ -1037,4 +1169,4 @@ class SidechatColorList {
1037
1169
  ];
1038
1170
  }
1039
1171
 
1040
- export { SidechatAPIClient, SidechatAPIError, SidechatColorList };
1172
+ export { SidechatAPIClient, SidechatAPIError, SidechatColorList, SidechatTypes };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sidechat.js",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "A reverse-engineered API wrapper for Sidechat",
5
5
  "type": "module",
6
6
  "source": "./src/index.js",
package/src/index.js CHANGED
@@ -1,6 +1,11 @@
1
- import "./types/SidechatTypes.js";
1
+ import SidechatTypes from "./types/SidechatTypes.js";
2
2
  import SidechatAPIClient from "./classes/SidechatAPIClient.js";
3
3
  import SidechatAPIError from "./classes/SidechatAPIError.js";
4
4
  import SidechatColorList from "./classes/SidechatColorList.js";
5
5
 
6
- export { SidechatAPIClient, SidechatAPIError, SidechatColorList };
6
+ export {
7
+ SidechatAPIClient,
8
+ SidechatAPIError,
9
+ SidechatColorList,
10
+ SidechatTypes,
11
+ };