node-simctl 8.0.9 → 8.1.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.
Files changed (156) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/index.d.ts +2 -1
  3. package/build/index.d.ts.map +1 -1
  4. package/build/index.js.map +1 -1
  5. package/build/lib/helpers.d.ts +17 -9
  6. package/build/lib/helpers.d.ts.map +1 -1
  7. package/build/lib/helpers.js +50 -4
  8. package/build/lib/helpers.js.map +1 -1
  9. package/build/lib/logger.d.ts +2 -3
  10. package/build/lib/logger.d.ts.map +1 -1
  11. package/build/lib/logger.js +3 -5
  12. package/build/lib/logger.js.map +1 -1
  13. package/build/lib/simctl.d.ts +82 -188
  14. package/build/lib/simctl.d.ts.map +1 -1
  15. package/build/lib/simctl.js +98 -150
  16. package/build/lib/simctl.js.map +1 -1
  17. package/build/lib/subcommands/addmedia.d.ts +14 -16
  18. package/build/lib/subcommands/addmedia.d.ts.map +1 -1
  19. package/build/lib/subcommands/addmedia.js +5 -7
  20. package/build/lib/subcommands/addmedia.js.map +1 -1
  21. package/build/lib/subcommands/appinfo.d.ts +13 -45
  22. package/build/lib/subcommands/appinfo.d.ts.map +1 -1
  23. package/build/lib/subcommands/appinfo.js +31 -42
  24. package/build/lib/subcommands/appinfo.js.map +1 -1
  25. package/build/lib/subcommands/boot.d.ts +9 -12
  26. package/build/lib/subcommands/boot.d.ts.map +1 -1
  27. package/build/lib/subcommands/boot.js +5 -40
  28. package/build/lib/subcommands/boot.js.map +1 -1
  29. package/build/lib/subcommands/bootstatus.d.ts +16 -56
  30. package/build/lib/subcommands/bootstatus.d.ts.map +1 -1
  31. package/build/lib/subcommands/bootstatus.js +8 -22
  32. package/build/lib/subcommands/bootstatus.js.map +1 -1
  33. package/build/lib/subcommands/create.d.ts +15 -34
  34. package/build/lib/subcommands/create.d.ts.map +1 -1
  35. package/build/lib/subcommands/create.js +23 -66
  36. package/build/lib/subcommands/create.js.map +1 -1
  37. package/build/lib/subcommands/delete.d.ts +9 -12
  38. package/build/lib/subcommands/delete.d.ts.map +1 -1
  39. package/build/lib/subcommands/delete.js +3 -5
  40. package/build/lib/subcommands/delete.js.map +1 -1
  41. package/build/lib/subcommands/erase.d.ts +12 -15
  42. package/build/lib/subcommands/erase.d.ts.map +1 -1
  43. package/build/lib/subcommands/erase.js +4 -6
  44. package/build/lib/subcommands/erase.js.map +1 -1
  45. package/build/lib/subcommands/get_app_container.d.ts +19 -22
  46. package/build/lib/subcommands/get_app_container.d.ts.map +1 -1
  47. package/build/lib/subcommands/get_app_container.js +6 -8
  48. package/build/lib/subcommands/get_app_container.js.map +1 -1
  49. package/build/lib/subcommands/getenv.d.ts +11 -14
  50. package/build/lib/subcommands/getenv.d.ts.map +1 -1
  51. package/build/lib/subcommands/getenv.js +5 -7
  52. package/build/lib/subcommands/getenv.js.map +1 -1
  53. package/build/lib/subcommands/install.d.ts +12 -15
  54. package/build/lib/subcommands/install.d.ts.map +1 -1
  55. package/build/lib/subcommands/install.js +4 -6
  56. package/build/lib/subcommands/install.js.map +1 -1
  57. package/build/lib/subcommands/io.d.ts +12 -15
  58. package/build/lib/subcommands/io.d.ts.map +1 -1
  59. package/build/lib/subcommands/io.js +4 -6
  60. package/build/lib/subcommands/io.js.map +1 -1
  61. package/build/lib/subcommands/keychain.d.ts +37 -55
  62. package/build/lib/subcommands/keychain.d.ts.map +1 -1
  63. package/build/lib/subcommands/keychain.js +16 -25
  64. package/build/lib/subcommands/keychain.js.map +1 -1
  65. package/build/lib/subcommands/launch.d.ts +16 -19
  66. package/build/lib/subcommands/launch.d.ts.map +1 -1
  67. package/build/lib/subcommands/launch.js +9 -11
  68. package/build/lib/subcommands/launch.js.map +1 -1
  69. package/build/lib/subcommands/list.d.ts +94 -125
  70. package/build/lib/subcommands/list.d.ts.map +1 -1
  71. package/build/lib/subcommands/list.js +34 -92
  72. package/build/lib/subcommands/list.js.map +1 -1
  73. package/build/lib/subcommands/location.d.ts +18 -22
  74. package/build/lib/subcommands/location.d.ts.map +1 -1
  75. package/build/lib/subcommands/location.js +11 -13
  76. package/build/lib/subcommands/location.js.map +1 -1
  77. package/build/lib/subcommands/openurl.d.ts +15 -17
  78. package/build/lib/subcommands/openurl.d.ts.map +1 -1
  79. package/build/lib/subcommands/openurl.js +5 -7
  80. package/build/lib/subcommands/openurl.js.map +1 -1
  81. package/build/lib/subcommands/pbcopy.d.ts +14 -17
  82. package/build/lib/subcommands/pbcopy.d.ts.map +1 -1
  83. package/build/lib/subcommands/pbcopy.js +5 -7
  84. package/build/lib/subcommands/pbcopy.js.map +1 -1
  85. package/build/lib/subcommands/pbpaste.d.ts +14 -17
  86. package/build/lib/subcommands/pbpaste.d.ts.map +1 -1
  87. package/build/lib/subcommands/pbpaste.js +5 -7
  88. package/build/lib/subcommands/pbpaste.js.map +1 -1
  89. package/build/lib/subcommands/privacy.d.ts +52 -57
  90. package/build/lib/subcommands/privacy.d.ts.map +1 -1
  91. package/build/lib/subcommands/privacy.js +15 -17
  92. package/build/lib/subcommands/privacy.js.map +1 -1
  93. package/build/lib/subcommands/push.d.ts +22 -25
  94. package/build/lib/subcommands/push.d.ts.map +1 -1
  95. package/build/lib/subcommands/push.js +5 -7
  96. package/build/lib/subcommands/push.js.map +1 -1
  97. package/build/lib/subcommands/shutdown.d.ts +9 -12
  98. package/build/lib/subcommands/shutdown.d.ts.map +1 -1
  99. package/build/lib/subcommands/shutdown.js +5 -40
  100. package/build/lib/subcommands/shutdown.js.map +1 -1
  101. package/build/lib/subcommands/spawn.d.ts +24 -27
  102. package/build/lib/subcommands/spawn.d.ts.map +1 -1
  103. package/build/lib/subcommands/spawn.js +12 -14
  104. package/build/lib/subcommands/spawn.js.map +1 -1
  105. package/build/lib/subcommands/terminate.d.ts +12 -15
  106. package/build/lib/subcommands/terminate.d.ts.map +1 -1
  107. package/build/lib/subcommands/terminate.js +4 -6
  108. package/build/lib/subcommands/terminate.js.map +1 -1
  109. package/build/lib/subcommands/ui.d.ts +97 -105
  110. package/build/lib/subcommands/ui.d.ts.map +1 -1
  111. package/build/lib/subcommands/ui.js +24 -26
  112. package/build/lib/subcommands/ui.js.map +1 -1
  113. package/build/lib/subcommands/uninstall.d.ts +13 -16
  114. package/build/lib/subcommands/uninstall.d.ts.map +1 -1
  115. package/build/lib/subcommands/uninstall.js +4 -6
  116. package/build/lib/subcommands/uninstall.js.map +1 -1
  117. package/build/lib/types.d.ts +231 -0
  118. package/build/lib/types.d.ts.map +1 -0
  119. package/build/lib/types.js +3 -0
  120. package/build/lib/types.js.map +1 -0
  121. package/index.ts +13 -0
  122. package/lib/helpers.ts +81 -0
  123. package/lib/{logger.js → logger.ts} +2 -5
  124. package/lib/simctl.ts +221 -0
  125. package/lib/subcommands/{addmedia.js → addmedia.ts} +6 -8
  126. package/lib/subcommands/appinfo.ts +39 -0
  127. package/lib/subcommands/{boot.js → boot.ts} +5 -10
  128. package/lib/subcommands/bootstatus.ts +108 -0
  129. package/lib/subcommands/{create.js → create.ts} +29 -35
  130. package/lib/subcommands/{delete.js → delete.ts} +3 -5
  131. package/lib/subcommands/{erase.js → erase.ts} +4 -7
  132. package/lib/subcommands/{get_app_container.js → get_app_container.ts} +10 -8
  133. package/lib/subcommands/{getenv.js → getenv.ts} +5 -7
  134. package/lib/subcommands/{install.js → install.ts} +4 -6
  135. package/lib/subcommands/{io.js → io.ts} +4 -7
  136. package/lib/subcommands/{keychain.js → keychain.ts} +30 -32
  137. package/lib/subcommands/{launch.js → launch.ts} +9 -12
  138. package/lib/subcommands/{list.js → list.ts} +67 -60
  139. package/lib/subcommands/{location.js → location.ts} +15 -14
  140. package/lib/subcommands/{openurl.js → openurl.ts} +6 -7
  141. package/lib/subcommands/{pbcopy.js → pbcopy.ts} +11 -8
  142. package/lib/subcommands/{pbpaste.js → pbpaste.ts} +5 -7
  143. package/lib/subcommands/{privacy.js → privacy.ts} +13 -17
  144. package/lib/subcommands/{push.js → push.ts} +5 -8
  145. package/lib/subcommands/{shutdown.js → shutdown.ts} +5 -8
  146. package/lib/subcommands/{spawn.js → spawn.ts} +21 -17
  147. package/lib/subcommands/{terminate.js → terminate.ts} +4 -6
  148. package/lib/subcommands/{ui.js → ui.ts} +19 -28
  149. package/lib/subcommands/{uninstall.js → uninstall.ts} +4 -6
  150. package/lib/types.ts +243 -0
  151. package/package.json +2 -2
  152. package/index.js +0 -4
  153. package/lib/helpers.js +0 -37
  154. package/lib/simctl.js +0 -299
  155. package/lib/subcommands/appinfo.js +0 -51
  156. package/lib/subcommands/bootstatus.js +0 -119
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const commands = {};
3
+ exports.setLocation = setLocation;
4
+ exports.clearLocation = clearLocation;
4
5
  /**
5
6
  * Formats the given location argument for simctl usage
6
7
  *
7
- * @param {string} name Argument name
8
- * @param {string|number} value Location argument value
9
- * @returns {string} Formatted value, for example -73.768254
8
+ * @param name Argument name
9
+ * @param value Location argument value
10
+ * @returns Formatted value, for example -73.768254
10
11
  */
11
12
  function formatArg(name, value) {
12
13
  const flt = parseFloat(`${value}`);
@@ -19,30 +20,27 @@ function formatArg(name, value) {
19
20
  * Set the Simulator location to a specific latitude and longitude.
20
21
  * This functionality is only available since Xcode 14.
21
22
  *
22
- * @this {import('../simctl').Simctl}
23
- * @param {string|number} latitude Location latitude value
24
- * @param {string|number} longitude Location longitude value
23
+ * @param latitude Location latitude value
24
+ * @param longitude Location longitude value
25
25
  * @throws {Error} If the corresponding simctl subcommand command
26
26
  * returns non-zero return code.
27
27
  * @throws {TypeError} If any of the arguments is not a valid value.
28
28
  */
29
- commands.setLocation = async function setLocation(latitude, longitude) {
29
+ async function setLocation(latitude, longitude) {
30
30
  const lat = formatArg('latitude', latitude);
31
31
  const lon = formatArg('longitude', longitude);
32
32
  await this.exec('location', {
33
33
  args: [this.requireUdid('location'), 'set', `${lat},${lon}`],
34
34
  });
35
- };
35
+ }
36
36
  /**
37
37
  * Stop any running scenario and clear any simulated location.
38
38
  *
39
39
  * @since Xcode 14.
40
- * @this {import('../simctl').Simctl}
41
40
  */
42
- commands.clearLocation = async function clearLocation() {
41
+ async function clearLocation() {
43
42
  await this.exec('location', {
44
43
  args: [this.requireUdid('location'), 'clear'],
45
44
  });
46
- };
47
- exports.default = commands;
45
+ }
48
46
  //# sourceMappingURL=location.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"location.js","sourceRoot":"","sources":["../../../lib/subcommands/location.js"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;GAMG;AACH,SAAS,SAAS,CAAE,IAAI,EAAE,KAAK;IAC7B,MAAM,GAAG,GAAG,UAAU,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC;IACnC,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACf,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,iCAAiC,KAAK,WAAW,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACxB,CAAC;AAED;;;;;;;;;;GAUG;AACH,QAAQ,CAAC,WAAW,GAAG,KAAK,UAAU,WAAW,CAAE,QAAQ,EAAE,SAAS;IACpE,MAAM,GAAG,GAAG,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC5C,MAAM,GAAG,GAAG,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC9C,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QAC1B,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;KAC7D,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;GAKG;AACH,QAAQ,CAAC,aAAa,GAAG,KAAK,UAAU,aAAa;IACnD,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QAC1B,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;KAC9C,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"location.js","sourceRoot":"","sources":["../../../lib/subcommands/location.ts"],"names":[],"mappings":";;AA2BA,kCAUC;AAOD,sCAIC;AA9CD;;;;;;GAMG;AACH,SAAS,SAAS,CAAE,IAAY,EAAE,KAAsB;IACtD,MAAM,GAAG,GAAG,UAAU,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC;IACnC,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACf,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,iCAAiC,KAAK,WAAW,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACxB,CAAC;AAED;;;;;;;;;GASG;AACI,KAAK,UAAU,WAAW,CAE/B,QAAyB,EACzB,SAA0B;IAE1B,MAAM,GAAG,GAAG,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC5C,MAAM,GAAG,GAAG,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC9C,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QAC1B,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;KAC7D,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,aAAa;IACjC,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QAC1B,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;KAC9C,CAAC,CAAC;AACL,CAAC"}
@@ -1,18 +1,16 @@
1
- export default commands;
2
- declare namespace commands {
3
- /**
4
- * Open URL scheme on Simulator. iOS will automatically try
5
- * to find a matching application, which supports the given scheme.
6
- * It is required that Simulator is in _booted_ state.
7
- *
8
- * @this {import('../simctl').Simctl}
9
- * @param {string} url - The URL scheme to open, for example http://appiom.io
10
- * will be opened by the built-in mobile browser.
11
- * @return {Promise<import('teen_process').TeenProcessExecResult>} Command execution result.
12
- * @throws {Error} If the corresponding simctl subcommand command
13
- * returns non-zero return code.
14
- * @throws {Error} If the `udid` instance property is unset
15
- */
16
- function openUrl(this: import("../simctl").default, url: string): Promise<import("teen_process").TeenProcessExecResult<any>>;
17
- }
1
+ import type { Simctl } from '../simctl';
2
+ import type { TeenProcessExecResult } from 'teen_process';
3
+ /**
4
+ * Open URL scheme on Simulator. iOS will automatically try
5
+ * to find a matching application, which supports the given scheme.
6
+ * It is required that Simulator is in _booted_ state.
7
+ *
8
+ * @param url - The URL scheme to open, for example http://appiom.io
9
+ * will be opened by the built-in mobile browser.
10
+ * @return Command execution result.
11
+ * @throws {Error} If the corresponding simctl subcommand command
12
+ * returns non-zero return code.
13
+ * @throws {Error} If the `udid` instance property is unset
14
+ */
15
+ export declare function openUrl(this: Simctl, url: string): Promise<TeenProcessExecResult<string>>;
18
16
  //# sourceMappingURL=openurl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openurl.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/openurl.js"],"names":[],"mappings":";;IAEA;;;;;;;;;;;;OAYG;IACH,yDAPW,MAAM,GAEL,OAAO,CAAC,iDAA4C,CAAC,CAShE"}
1
+ {"version":3,"file":"openurl.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/openurl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,wBAAsB,OAAO,CAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAIhG"}
@@ -1,23 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const commands = {};
3
+ exports.openUrl = openUrl;
4
4
  /**
5
5
  * Open URL scheme on Simulator. iOS will automatically try
6
6
  * to find a matching application, which supports the given scheme.
7
7
  * It is required that Simulator is in _booted_ state.
8
8
  *
9
- * @this {import('../simctl').Simctl}
10
- * @param {string} url - The URL scheme to open, for example http://appiom.io
9
+ * @param url - The URL scheme to open, for example http://appiom.io
11
10
  * will be opened by the built-in mobile browser.
12
- * @return {Promise<import('teen_process').TeenProcessExecResult>} Command execution result.
11
+ * @return Command execution result.
13
12
  * @throws {Error} If the corresponding simctl subcommand command
14
13
  * returns non-zero return code.
15
14
  * @throws {Error} If the `udid` instance property is unset
16
15
  */
17
- commands.openUrl = async function openUrl(url) {
16
+ async function openUrl(url) {
18
17
  return await this.exec('openurl', {
19
18
  args: [this.requireUdid('openurl'), url],
20
19
  });
21
- };
22
- exports.default = commands;
20
+ }
23
21
  //# sourceMappingURL=openurl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"openurl.js","sourceRoot":"","sources":["../../../lib/subcommands/openurl.js"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;;;;;GAYG;AACH,QAAQ,CAAC,OAAO,GAAG,KAAK,UAAU,OAAO,CAAE,GAAG;IAC5C,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QAChC,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC;KACzC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"openurl.js","sourceRoot":"","sources":["../../../lib/subcommands/openurl.ts"],"names":[],"mappings":";;AAeA,0BAIC;AAhBD;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,OAAO,CAAgB,GAAW;IACtD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QAChC,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC;KACzC,CAAC,CAAC;AACL,CAAC"}
@@ -1,18 +1,15 @@
1
- export default commands;
2
- declare namespace commands {
3
- /**
4
- * Set the content of Simulator pasteboard.
5
- * It is required that Simulator is in _booted_ state.
6
- *
7
- * @since Xcode SDK 8.1
8
- * @this {import('../simctl').Simctl}
9
- * @param {string} content - The actual string content to be set.
10
- * @param {BufferEncoding} [encoding='utf8'] - The encoding of the given pasteboard content.
11
- * utf8 by default.
12
- * @throws {Error} If the corresponding simctl subcommand command
13
- * returns non-zero return code.
14
- * @throws {Error} If the `udid` instance property is unset
15
- */
16
- function setPasteboard(this: import("../simctl").default, content: string, encoding?: BufferEncoding): Promise<void>;
17
- }
1
+ import type { Simctl } from '../simctl';
2
+ /**
3
+ * Set the content of Simulator pasteboard.
4
+ * It is required that Simulator is in _booted_ state.
5
+ *
6
+ * @since Xcode SDK 8.1
7
+ * @param content - The actual string content to be set.
8
+ * @param encoding - The encoding of the given pasteboard content.
9
+ * utf8 by default.
10
+ * @throws {Error} If the corresponding simctl subcommand command
11
+ * returns non-zero return code.
12
+ * @throws {Error} If the `udid` instance property is unset
13
+ */
14
+ export declare function setPasteboard(this: Simctl, content: string, encoding?: BufferEncoding): Promise<void>;
18
15
  //# sourceMappingURL=pbcopy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pbcopy.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/pbcopy.js"],"names":[],"mappings":";;IAEA;;;;;;;;;;;;OAYG;IACH,mEAPW,MAAM,aACN,cAAc,iBAoBxB"}
1
+ {"version":3,"file":"pbcopy.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/pbcopy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,cAAuB,GAChC,OAAO,CAAC,IAAI,CAAC,CAcf"}
@@ -1,20 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const commands = {};
3
+ exports.setPasteboard = setPasteboard;
4
4
  /**
5
5
  * Set the content of Simulator pasteboard.
6
6
  * It is required that Simulator is in _booted_ state.
7
7
  *
8
8
  * @since Xcode SDK 8.1
9
- * @this {import('../simctl').Simctl}
10
- * @param {string} content - The actual string content to be set.
11
- * @param {BufferEncoding} [encoding='utf8'] - The encoding of the given pasteboard content.
9
+ * @param content - The actual string content to be set.
10
+ * @param encoding - The encoding of the given pasteboard content.
12
11
  * utf8 by default.
13
12
  * @throws {Error} If the corresponding simctl subcommand command
14
13
  * returns non-zero return code.
15
14
  * @throws {Error} If the `udid` instance property is unset
16
15
  */
17
- commands.setPasteboard = async function setPasteboard(content, encoding = 'utf8') {
16
+ async function setPasteboard(content, encoding = 'utf8') {
18
17
  const pbCopySubprocess = await this.exec('pbcopy', {
19
18
  args: [this.requireUdid('pbcopy')],
20
19
  asynchronous: true,
@@ -28,6 +27,5 @@ commands.setPasteboard = async function setPasteboard(content, encoding = 'utf8'
28
27
  stdin.end();
29
28
  }
30
29
  await exitCodeVerifier;
31
- };
32
- exports.default = commands;
30
+ }
33
31
  //# sourceMappingURL=pbcopy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pbcopy.js","sourceRoot":"","sources":["../../../lib/subcommands/pbcopy.js"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;;;;;GAYG;AACH,QAAQ,CAAC,aAAa,GAAG,KAAK,UAAU,aAAa,CAAE,OAAO,EAAE,QAAQ,GAAG,MAAM;IAC/E,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,IA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K,CAAC,GAAG,EAAE,CAAC;IACd,CAAC;IACD,MAAM,gBAAgB,CAAC;AACzB,CAAC"}
@@ -1,18 +1,15 @@
1
- export default commands;
2
- declare namespace commands {
3
- /**
4
- * Get the content of Simulator pasteboard.
5
- * It is required that Simulator is in _booted_ state.
6
- *
7
- * @since Xcode 8.1 SDK
8
- * @this {import('../simctl').Simctl}
9
- * @param {string} [encoding='utf8'] - The encoding of the returned pasteboard content.
10
- * UTF-8 by default.
11
- * @return {Promise<string>} Current content of Simulator pasteboard or an empty string.
12
- * @throws {Error} If the corresponding simctl subcommand command
13
- * returns non-zero return code.
14
- * @throws {Error} If the `udid` instance property is unset
15
- */
16
- function getPasteboard(this: import("../simctl").default, encoding?: string): Promise<string>;
17
- }
1
+ import type { Simctl } from '../simctl';
2
+ /**
3
+ * Get the content of Simulator pasteboard.
4
+ * It is required that Simulator is in _booted_ state.
5
+ *
6
+ * @since Xcode 8.1 SDK
7
+ * @param encoding - The encoding of the returned pasteboard content.
8
+ * UTF-8 by default.
9
+ * @return Current content of Simulator pasteboard or an empty string.
10
+ * @throws {Error} If the corresponding simctl subcommand command
11
+ * returns non-zero return code.
12
+ * @throws {Error} If the `udid` instance property is unset
13
+ */
14
+ export declare function getPasteboard(this: Simctl, encoding?: BufferEncoding): Promise<string>;
18
15
  //# sourceMappingURL=pbpaste.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pbpaste.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/pbpaste.js"],"names":[],"mappings":";;IAEA;;;;;;;;;;;;OAYG;IACH,qEAPW,MAAM,GAEL,OAAO,CAAC,MAAM,CAAC,CAW1B"}
1
+ {"version":3,"file":"pbpaste.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/pbpaste.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,cAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAMrG"}
@@ -1,25 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const commands = {};
3
+ exports.getPasteboard = getPasteboard;
4
4
  /**
5
5
  * Get the content of Simulator pasteboard.
6
6
  * It is required that Simulator is in _booted_ state.
7
7
  *
8
8
  * @since Xcode 8.1 SDK
9
- * @this {import('../simctl').Simctl}
10
- * @param {string} [encoding='utf8'] - The encoding of the returned pasteboard content.
9
+ * @param encoding - The encoding of the returned pasteboard content.
11
10
  * UTF-8 by default.
12
- * @return {Promise<string>} Current content of Simulator pasteboard or an empty string.
11
+ * @return Current content of Simulator pasteboard or an empty string.
13
12
  * @throws {Error} If the corresponding simctl subcommand command
14
13
  * returns non-zero return code.
15
14
  * @throws {Error} If the `udid` instance property is unset
16
15
  */
17
- commands.getPasteboard = async function getPasteboard(encoding = 'utf8') {
16
+ async function getPasteboard(encoding = 'utf8') {
18
17
  const { stdout } = await this.exec('pbpaste', {
19
18
  args: [this.requireUdid('pbpaste')],
20
19
  encoding,
21
20
  });
22
21
  return stdout;
23
- };
24
- exports.default = commands;
22
+ }
25
23
  //# sourceMappingURL=pbpaste.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pbpaste.js","sourceRoot":"","sources":["../../../lib/subcommands/pbpaste.js"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;;;;;GAYG;AACH,QAAQ,CAAC,aAAa,GAAG,KAAK,UAAU,aAAa,CAAE,QAAQ,GAAG,MAAM;IACtE,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QAC1C,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QACnC,QAAQ;KACT,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"pbpaste.js","sourceRoot":"","sources":["../../../lib/subcommands/pbpaste.ts"],"names":[],"mappings":";;AAcA,sCAMC;AAlBD;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,aAAa,CAAgB,WAA2B,MAAM;IAClF,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QAC1C,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QACnC,QAAQ;KACT,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,58 +1,53 @@
1
- export default commands;
2
- declare namespace commands {
3
- /**
4
- * Grants the given permission on the app with the given bundle identifier
5
- *
6
- * @since Xcode 11.4 SDK
7
- * @this {import('../simctl').Simctl}
8
- * @param {string} bundleId the identifier of the application whose
9
- * privacy settings are going to be changed
10
- * @param {string} perm one of possible permission values:
11
- * - all: Apply the action to all services.
12
- * - calendar: Allow access to calendar.
13
- * - contacts-limited: Allow access to basic contact info.
14
- * - contacts: Allow access to full contact details.
15
- * - location: Allow access to location services when app is in use.
16
- * - location-always: Allow access to location services at all times.
17
- * - photos-add: Allow adding photos to the photo library.
18
- * - photos: Allow full access to the photo library.
19
- * - media-library: Allow access to the media library.
20
- * - microphone: Allow access to audio input.
21
- * - motion: Allow access to motion and fitness data.
22
- * - reminders: Allow access to reminders.
23
- * - siri: Allow use of the app with Siri.
24
- * @throws {Error} if the current SDK version does not support the command
25
- * or there was an error while granting the permission
26
- * @throws {Error} If the `udid` instance property is unset
27
- */
28
- function grantPermission(this: import("../simctl").default, bundleId: string, perm: string): Promise<void>;
29
- /**
30
- * Revokes the given permission on the app with the given bundle identifier
31
- * after it has been granted
32
- *
33
- * @since Xcode 11.4 SDK
34
- * @this {import('../simctl').Simctl}
35
- * @param {string} bundleId the identifier of the application whose
36
- * privacy settings are going to be changed
37
- * @param {string} perm one of possible permission values (see `grantPermission`)
38
- * @throws {Error} if the current SDK version does not support the command
39
- * or there was an error while revoking the permission
40
- * @throws {Error} If the `udid` instance property is unset
41
- */
42
- function revokePermission(this: import("../simctl").default, bundleId: string, perm: string): Promise<void>;
43
- /**
44
- * Resets the given permission on the app with the given bundle identifier
45
- * to its default state
46
- *
47
- * @since Xcode 11.4 SDK
48
- * @this {import('../simctl').Simctl}
49
- * @param {string} bundleId the identifier of the application whose
50
- * privacy settings are going to be changed
51
- * @param {string} perm one of possible permission values (see `grantPermission`)
52
- * @throws {Error} if the current SDK version does not support the command
53
- * or there was an error while resetting the permission
54
- * @throws {Error} If the `udid` instance property is unset
55
- */
56
- function resetPermission(this: import("../simctl").default, bundleId: string, perm: string): Promise<void>;
57
- }
1
+ import type { Simctl } from '../simctl';
2
+ /**
3
+ * Grants the given permission on the app with the given bundle identifier
4
+ *
5
+ * @since Xcode 11.4 SDK
6
+ * @param bundleId the identifier of the application whose
7
+ * privacy settings are going to be changed
8
+ * @param perm one of possible permission values:
9
+ * - all: Apply the action to all services.
10
+ * - calendar: Allow access to calendar.
11
+ * - contacts-limited: Allow access to basic contact info.
12
+ * - contacts: Allow access to full contact details.
13
+ * - location: Allow access to location services when app is in use.
14
+ * - location-always: Allow access to location services at all times.
15
+ * - photos-add: Allow adding photos to the photo library.
16
+ * - photos: Allow full access to the photo library.
17
+ * - media-library: Allow access to the media library.
18
+ * - microphone: Allow access to audio input.
19
+ * - motion: Allow access to motion and fitness data.
20
+ * - reminders: Allow access to reminders.
21
+ * - siri: Allow use of the app with Siri.
22
+ * @throws {Error} if the current SDK version does not support the command
23
+ * or there was an error while granting the permission
24
+ * @throws {Error} If the `udid` instance property is unset
25
+ */
26
+ export declare function grantPermission(this: Simctl, bundleId: string, perm: string): Promise<void>;
27
+ /**
28
+ * Revokes the given permission on the app with the given bundle identifier
29
+ * after it has been granted
30
+ *
31
+ * @since Xcode 11.4 SDK
32
+ * @param bundleId the identifier of the application whose
33
+ * privacy settings are going to be changed
34
+ * @param perm one of possible permission values (see `grantPermission`)
35
+ * @throws {Error} if the current SDK version does not support the command
36
+ * or there was an error while revoking the permission
37
+ * @throws {Error} If the `udid` instance property is unset
38
+ */
39
+ export declare function revokePermission(this: Simctl, bundleId: string, perm: string): Promise<void>;
40
+ /**
41
+ * Resets the given permission on the app with the given bundle identifier
42
+ * to its default state
43
+ *
44
+ * @since Xcode 11.4 SDK
45
+ * @param bundleId the identifier of the application whose
46
+ * privacy settings are going to be changed
47
+ * @param perm one of possible permission values (see `grantPermission`)
48
+ * @throws {Error} if the current SDK version does not support the command
49
+ * or there was an error while resetting the permission
50
+ * @throws {Error} If the `udid` instance property is unset
51
+ */
52
+ export declare function resetPermission(this: Simctl, bundleId: string, perm: string): Promise<void>;
58
53
  //# sourceMappingURL=privacy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"privacy.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/privacy.js"],"names":[],"mappings":";;IAEA;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,sEApBW,MAAM,QAEN,MAAM,iBAsBhB;IAED;;;;;;;;;;;;OAYG;IACH,uEAPW,MAAM,QAEN,MAAM,iBAShB;IAED;;;;;;;;;;;;OAYG;IACH,sEAPW,MAAM,QAEN,MAAM,iBAShB"}
1
+ {"version":3,"file":"privacy.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/privacy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,eAAe,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIlG;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAInG;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIlG"}
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const commands = {};
3
+ exports.grantPermission = grantPermission;
4
+ exports.revokePermission = revokePermission;
5
+ exports.resetPermission = resetPermission;
4
6
  /**
5
7
  * Grants the given permission on the app with the given bundle identifier
6
8
  *
7
9
  * @since Xcode 11.4 SDK
8
- * @this {import('../simctl').Simctl}
9
- * @param {string} bundleId the identifier of the application whose
10
+ * @param bundleId the identifier of the application whose
10
11
  * privacy settings are going to be changed
11
- * @param {string} perm one of possible permission values:
12
+ * @param perm one of possible permission values:
12
13
  * - all: Apply the action to all services.
13
14
  * - calendar: Allow access to calendar.
14
15
  * - contacts-limited: Allow access to basic contact info.
@@ -26,46 +27,43 @@ const commands = {};
26
27
  * or there was an error while granting the permission
27
28
  * @throws {Error} If the `udid` instance property is unset
28
29
  */
29
- commands.grantPermission = async function grantPermission(bundleId, perm) {
30
+ async function grantPermission(bundleId, perm) {
30
31
  await this.exec('privacy', {
31
32
  args: [this.requireUdid('privacy grant'), 'grant', perm, bundleId],
32
33
  });
33
- };
34
+ }
34
35
  /**
35
36
  * Revokes the given permission on the app with the given bundle identifier
36
37
  * after it has been granted
37
38
  *
38
39
  * @since Xcode 11.4 SDK
39
- * @this {import('../simctl').Simctl}
40
- * @param {string} bundleId the identifier of the application whose
40
+ * @param bundleId the identifier of the application whose
41
41
  * privacy settings are going to be changed
42
- * @param {string} perm one of possible permission values (see `grantPermission`)
42
+ * @param perm one of possible permission values (see `grantPermission`)
43
43
  * @throws {Error} if the current SDK version does not support the command
44
44
  * or there was an error while revoking the permission
45
45
  * @throws {Error} If the `udid` instance property is unset
46
46
  */
47
- commands.revokePermission = async function revokePermission(bundleId, perm) {
47
+ async function revokePermission(bundleId, perm) {
48
48
  await this.exec('privacy', {
49
49
  args: [this.requireUdid('privacy revoke'), 'revoke', perm, bundleId],
50
50
  });
51
- };
51
+ }
52
52
  /**
53
53
  * Resets the given permission on the app with the given bundle identifier
54
54
  * to its default state
55
55
  *
56
56
  * @since Xcode 11.4 SDK
57
- * @this {import('../simctl').Simctl}
58
- * @param {string} bundleId the identifier of the application whose
57
+ * @param bundleId the identifier of the application whose
59
58
  * privacy settings are going to be changed
60
- * @param {string} perm one of possible permission values (see `grantPermission`)
59
+ * @param perm one of possible permission values (see `grantPermission`)
61
60
  * @throws {Error} if the current SDK version does not support the command
62
61
  * or there was an error while resetting the permission
63
62
  * @throws {Error} If the `udid` instance property is unset
64
63
  */
65
- commands.resetPermission = async function resetPermission(bundleId, perm) {
64
+ async function resetPermission(bundleId, perm) {
66
65
  await this.exec('privacy', {
67
66
  args: [this.requireUdid('private reset'), 'reset', perm, bundleId],
68
67
  });
69
- };
70
- exports.default = commands;
68
+ }
71
69
  //# sourceMappingURL=privacy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"privacy.js","sourceRoot":"","sources":["../../../lib/subcommands/privacy.js"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,QAAQ,CAAC,eAAe,GAAG,KAAK,UAAU,eAAe,CAAE,QAAQ,EAAE,IAAI;IACvE,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QACzB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC;KACnE,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,QAAQ,CAAC,gBAAgB,GAAG,KAAK,UAAU,gBAAgB,CAAE,QAAQ,EAAE,IAAI;IACzE,MAAM,IAAI,CAAC,IAAI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AS,EAAE;QACzB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC;KACnE,CAAC,CAAC;AACL,CAAC"}
@@ -1,26 +1,23 @@
1
- export default commands;
2
- declare namespace commands {
3
- /**
4
- * Send a simulated push notification
5
- *
6
- * @since Xcode 11.4 SDK
7
- * @this {import('../simctl').Simctl}
8
- * @param {Object} payload - The object that describes Apple push notification content.
9
- * It must contain a top-level "Simulator Target Bundle" key with a string value matching
10
- * the target application‘s bundle identifier and "aps" key with valid Apple Push Notification values.
11
- * For example:
12
- * {
13
- * "Simulator Target Bundle": "com.apple.Preferences",
14
- * "aps": {
15
- * "alert": "This is a simulated notification!",
16
- * "badge": 3,
17
- * "sound": "default"
18
- * }
19
- * }
20
- * @throws {Error} if the current SDK version does not support the command
21
- * or there was an error while pushing the notification
22
- * @throws {Error} If the `udid` instance property is unset
23
- */
24
- function pushNotification(this: import("../simctl").default, payload: any): Promise<void>;
25
- }
1
+ import type { Simctl } from '../simctl';
2
+ /**
3
+ * Send a simulated push notification
4
+ *
5
+ * @since Xcode 11.4 SDK
6
+ * @param payload The object that describes Apple push notification content.
7
+ * It must contain a top-level "Simulator Target Bundle" key with a string value matching
8
+ * the target application's bundle identifier and "aps" key with valid Apple Push Notification values.
9
+ * For example:
10
+ * {
11
+ * "Simulator Target Bundle": "com.apple.Preferences",
12
+ * "aps": {
13
+ * "alert": "This is a simulated notification!",
14
+ * "badge": 3,
15
+ * "sound": "default"
16
+ * }
17
+ * }
18
+ * @throws {Error} if the current SDK version does not support the command
19
+ * or there was an error while pushing the notification
20
+ * @throws {Error} If the `udid` instance property is unset
21
+ */
22
+ export declare function pushNotification(this: Simctl, payload: Record<string, any>): Promise<void>;
26
23
  //# sourceMappingURL=push.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/push.js"],"names":[],"mappings":";;IAQA;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,0FAUC"}
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../lib/subcommands/push.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,gBAAgB,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAUjG"}
@@ -3,20 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.pushNotification = pushNotification;
6
7
  const rimraf_1 = require("rimraf");
7
8
  const helpers_1 = require("../helpers");
8
9
  const path_1 = __importDefault(require("path"));
9
10
  const os_1 = __importDefault(require("os"));
10
11
  const promises_1 = __importDefault(require("fs/promises"));
11
- const commands = {};
12
12
  /**
13
13
  * Send a simulated push notification
14
14
  *
15
15
  * @since Xcode 11.4 SDK
16
- * @this {import('../simctl').Simctl}
17
- * @param {Object} payload - The object that describes Apple push notification content.
16
+ * @param payload The object that describes Apple push notification content.
18
17
  * It must contain a top-level "Simulator Target Bundle" key with a string value matching
19
- * the target applications bundle identifier and "aps" key with valid Apple Push Notification values.
18
+ * the target application's bundle identifier and "aps" key with valid Apple Push Notification values.
20
19
  * For example:
21
20
  * {
22
21
  * "Simulator Target Bundle": "com.apple.Preferences",
@@ -30,7 +29,7 @@ const commands = {};
30
29
  * or there was an error while pushing the notification
31
30
  * @throws {Error} If the `udid` instance property is unset
32
31
  */
33
- commands.pushNotification = async function pushNotification(payload) {
32
+ async function pushNotification(payload) {
34
33
  const dstPath = path_1.default.resolve(os_1.default.tmpdir(), `${await (0, helpers_1.uuidV4)()}.json`);
35
34
  try {
36
35
  await promises_1.default.writeFile(dstPath, JSON.stringify(payload), 'utf8');
@@ -41,6 +40,5 @@ commands.pushNotification = async function pushNotification(payload) {
41
40
  finally {
42
41
  await (0, rimraf_1.rimraf)(dstPath);
43
42
  }
44
- };
45
- exports.default = commands;
43
+ }
46
44
  //# sourceMappingURL=push.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"push.js","sourceRoot":"","sources":["../../../lib/subcommands/push.js"],"names":[],"mappings":";;;;;AAAA,mCAAgC;AAChC,wCAAoC;AACpC,gDAAwB;AACxB,4CAAoB;AACpB,2DAA6B;AAE7B,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAQ,CAAC,gBAAgB,GAAG,KAAK,UAAU,gBAAgB,CAAE,OAAO;IAClE,MAAM,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,YAAE,CAAC,MAAM,EAAE,EAAE,GAAG,MAAM,IAAA,gBAAM,GAAE,OAAO,CAAC,CAAC;IACpE,IAAI,CAAC;QACH,MAAM,kBAAE,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;QAC7D,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACtB,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;SAC1C,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,MAAM,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC;IACxB,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"push.js","sourceRoot":"","sources":["../../../lib/subcommands/push.ts"],"names":[],"mappings":";;;;;AA2BA,4CAUC;AArCD,mCAAgC;AAChC,wCAAoC;AACpC,gDAAwB;AACxB,4CAAoB;AACpB,2DAA6B;AAG7B;;;;;;;;;;;;;;;;;;;GAmBG;AACI,KAAK,UAAU,gBAAgB,C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