Skip to content

Commit 9d03fdc

Browse files
authored
feat: user migration routes (#26)
* Fix: add migrateApplication * Fix: route, parameter, timeout * Fix: change route * Fix: add hermes application_id migration method * Fix: change method name, add opts param
1 parent 280299b commit 9d03fdc

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

lib/Services/cayenne.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,17 @@ class Cayenne extends Request {
992992
return this.send('GET', path);
993993
}
994994

995+
/**
996+
* @param {Object} payload
997+
* @param {Object} opts
998+
*/
999+
migrateUser(payload, opts) {
1000+
const path = `/move/users`;
1001+
opts = { response: 60000, deadline: 90000, ...opts };
1002+
opts.payload = payload;
1003+
return this.send('POST', path, opts);
1004+
}
1005+
9951006
/**
9961007
* * End Applications
9971008
*/

lib/Services/executor.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,17 @@ class Executor extends Request {
234234
const path = `/graphql`;
235235
return this.send('GET', path, { query });
236236
}
237+
238+
/**
239+
* @param {Object} payload
240+
* @param {Object} opts
241+
*/
242+
migrateUser(payload, opts) {
243+
const path = `/move/users`;
244+
opts = { response: 60000, deadline: 90000, ...opts };
245+
opts.payload = payload;
246+
return this.send('POST', path, opts);
247+
}
237248
}
238249

239250
module.exports = Executor;

lib/Services/hermes.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,17 @@ class Hermes extends Request {
168168

169169
return this.send('POST', path, { payload, query });
170170
}
171+
172+
/**
173+
* @param {Object} payload
174+
* @param {Object} opts
175+
*/
176+
migrateUser(payload, opts) {
177+
const path = `/move/users`;
178+
opts = { response: 60000, deadline: 90000, ...opts };
179+
opts.payload = payload;
180+
return this.send('POST', path, opts);
181+
}
171182
}
172183

173184
module.exports = Hermes;

0 commit comments

Comments
 (0)