@beauraines/rtm-api 1.14.2 → 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 CHANGED
@@ -2,11 +2,19 @@
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.14.2](https://github.com/beauraines/rtm-api/compare/v1.14.1...v1.14.2) (2026-03-24)
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
+
12
+ ### [1.14.3](https://github.com/beauraines/rtm-api/compare/v1.14.1...v1.14.3) (2026-03-24)
6
13
 
7
14
 
8
15
  ### Bug Fixes
9
16
 
17
+ * **deps:** bump debug from 4.4.0 to 4.4.3 ([#76](https://github.com/beauraines/rtm-api/issues/76)) ([aa26e00](https://github.com/beauraines/rtm-api/commit/aa26e00e2c5d0c56ed147c420b901adb8c7e0161)), closes [debug-js/debug#1005](https://github.com/debug-js/debug/issues/1005) [debug-js/debug#997](https://github.com/debug-js/debug/issues/997) [#987](https://github.com/beauraines/rtm-api/issues/987) [debug-js/debug#988](https://github.com/debug-js/debug/issues/988) [debug-js/debug#997](https://github.com/debug-js/debug/issues/997) [debug-js/debug#988](https://github.com/debug-js/debug/issues/988) [#987](https://github.com/beauraines/rtm-api/issues/987) [#988](https://github.com/beauraines/rtm-api/issues/988)
10
18
  * **deps:** bump lodash from 4.17.21 to 4.17.23 ([#77](https://github.com/beauraines/rtm-api/issues/77)) ([a488bac](https://github.com/beauraines/rtm-api/commit/a488bac293e7e5b4d23d1edd51cb43106bc3aa11)), closes [#6088](https://github.com/beauraines/rtm-api/issues/6088) [#6071](https://github.com/beauraines/rtm-api/issues/6071) [#6062](https://github.com/beauraines/rtm-api/issues/6062) [#6056](https://github.com/beauraines/rtm-api/issues/6056) [#6053](https://github.com/beauraines/rtm-api/issues/6053) [#6052](https://github.com/beauraines/rtm-api/issues/6052) [#6039](https://github.com/beauraines/rtm-api/issues/6039) [#6023](https://github.com/beauraines/rtm-api/issues/6023) [#5968](https://github.com/beauraines/rtm-api/issues/5968)
11
19
 
12
20
  ### [1.14.1](https://github.com/beauraines/rtm-api/compare/v1.14.0...v1.14.1) (2025-12-19)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beauraines/rtm-api",
3
- "version": "1.14.2",
3
+ "version": "1.15.0",
4
4
  "description": "Remember the Milk API Interface",
5
5
  "author": "David Waring <dev@davidwaring.net> (https://davidwaring.net)",
6
6
  "contributors": [
@@ -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
- // Remove the matching List
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
  };