@beauraines/rtm-api 1.14.3 → 1.15.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.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/list/helper.js +19 -1
- package/src/user/lists.js +36 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.15.0](https://github.com/beauraines/rtm-api/compare/v1.14.3...v1.15.0) (2026-05-23)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* Implement unarchiving lists ([#92](https://github.com/beauraines/rtm-api/issues/92)) ([8946e4c](https://github.com/beauraines/rtm-api/commit/8946e4c6f9d4fd75e0f10e40962a2dd54c8455ac))
|
|
11
|
+
|
|
5
12
|
### [1.14.3](https://github.com/beauraines/rtm-api/compare/v1.14.1...v1.14.3) (2026-03-24)
|
|
6
13
|
|
|
7
14
|
|
package/package.json
CHANGED
package/src/list/helper.js
CHANGED
|
@@ -122,10 +122,28 @@ function archive(id, user, callback) {
|
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
/**
|
|
126
|
+
* API Call: rtm.lists.unarchive
|
|
127
|
+
* @param id RTM List ID
|
|
128
|
+
* @param user RTMUser
|
|
129
|
+
* @param callback Callback function(err)
|
|
130
|
+
* @private
|
|
131
|
+
*/
|
|
132
|
+
function unarchive(id, user, callback) {
|
|
133
|
+
let params = {
|
|
134
|
+
timeline: user.timeline,
|
|
135
|
+
list_id: id
|
|
136
|
+
};
|
|
137
|
+
user.get('rtm.lists.unarchive', params, function(err) {
|
|
138
|
+
return callback(err);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
125
142
|
module.exports = {
|
|
126
143
|
get: get,
|
|
127
144
|
add: add,
|
|
128
145
|
remove: remove,
|
|
129
146
|
rename: rename,
|
|
130
|
-
archive: archive
|
|
147
|
+
archive: archive,
|
|
148
|
+
unarchive: unarchive
|
|
131
149
|
};
|
package/src/user/lists.js
CHANGED
|
@@ -7,7 +7,7 @@ const _lists = require('../list/helper.js');
|
|
|
7
7
|
/**
|
|
8
8
|
* This module returns the RTM list-related functions for the RTMUser
|
|
9
9
|
* @param {RTMUser} user RTM User instance
|
|
10
|
-
* @returns {{get: function, update: function, add: function, remove: function, rename: function, archive: function}}
|
|
10
|
+
* @returns {{get: function, update: function, add: function, remove: function, rename: function, archive: function, unarchive: function}}
|
|
11
11
|
* @private
|
|
12
12
|
*/
|
|
13
13
|
module.exports = function(user) {
|
|
@@ -134,7 +134,7 @@ module.exports = function(user) {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
//
|
|
137
|
+
// Archive the matching List
|
|
138
138
|
if ( ids.length === 1 ) {
|
|
139
139
|
return _lists.archive(ids[0], user, callback);
|
|
140
140
|
}
|
|
@@ -146,5 +146,39 @@ module.exports = function(user) {
|
|
|
146
146
|
|
|
147
147
|
};
|
|
148
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Unarchive the specified RTM List for this User
|
|
151
|
+
* @param {string} name RTM List Name
|
|
152
|
+
* @param {function} callback Callback function(err)
|
|
153
|
+
* @param {RTMError} callback.err RTM API Error Response, if encountered
|
|
154
|
+
* @function RTMUser~lists/unarchive
|
|
155
|
+
*/
|
|
156
|
+
rtn.unarchive = function(name, callback) {
|
|
157
|
+
// Get the User's Lists
|
|
158
|
+
_lists.get(user, function(err, lists) {
|
|
159
|
+
if ( err ) {
|
|
160
|
+
return callback(err);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Find the matching list IDs
|
|
164
|
+
let ids = [];
|
|
165
|
+
for ( let i = 0; i < lists.length; i++ ) {
|
|
166
|
+
if ( lists[i].name.toLowerCase() === name.toLowerCase() ) {
|
|
167
|
+
ids.push(lists[i].id);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Unarchive the matching List
|
|
172
|
+
if ( ids.length === 1 ) {
|
|
173
|
+
return _lists.unarchive(ids[0], user, callback);
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
return callback(errors.referenceError());
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
};
|
|
182
|
+
|
|
149
183
|
return rtn;
|
|
150
184
|
};
|