@inworld/cli 1.0.0-rc.1 → 1.0.0-rc.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.
Files changed (247) hide show
  1. package/dist/index.js +15 -15
  2. package/package.json +1 -1
  3. package/dist/package.json +0 -53
  4. package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.d.ts +0 -10
  5. package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.d.ts.map +0 -1
  6. package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.js +0 -15
  7. package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.js.map +0 -1
  8. package/dist/proto/generated/portal/ai/inworld/studio/v1/errors.pb.d.ts +0 -13
  9. package/dist/proto/generated/portal/ai/inworld/studio/v1/errors.pb.d.ts.map +0 -1
  10. package/dist/proto/generated/portal/ai/inworld/studio/v1/errors.pb.js +0 -2
  11. package/dist/proto/generated/portal/ai/inworld/studio/v1/errors.pb.js.map +0 -1
  12. package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.d.ts +0 -7
  13. package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.d.ts.map +0 -1
  14. package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.js +0 -14
  15. package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.js.map +0 -1
  16. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.d.ts +0 -14
  17. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.d.ts.map +0 -1
  18. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.js +0 -6
  19. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.js.map +0 -1
  20. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb.d.ts +0 -116
  21. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb.d.ts.map +0 -1
  22. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb.js +0 -71
  23. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb.js.map +0 -1
  24. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.d.ts +0 -14
  25. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.d.ts.map +0 -1
  26. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.js +0 -6
  27. package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.js.map +0 -1
  28. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.d.ts +0 -78
  29. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.d.ts.map +0 -1
  30. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.js +0 -39
  31. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.js.map +0 -1
  32. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.d.ts +0 -10
  33. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.d.ts.map +0 -1
  34. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.js +0 -6
  35. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.js.map +0 -1
  36. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.d.ts +0 -7
  37. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.d.ts.map +0 -1
  38. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.js +0 -12
  39. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.js.map +0 -1
  40. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.d.ts +0 -115
  41. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.d.ts.map +0 -1
  42. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.js +0 -85
  43. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.js.map +0 -1
  44. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.d.ts +0 -255
  45. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.d.ts.map +0 -1
  46. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.js +0 -87
  47. package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.js.map +0 -1
  48. package/dist/proto/generated/portal/fetch.pb.d.ts +0 -26
  49. package/dist/proto/generated/portal/fetch.pb.d.ts.map +0 -1
  50. package/dist/proto/generated/portal/fetch.pb.js +0 -274
  51. package/dist/proto/generated/portal/fetch.pb.js.map +0 -1
  52. package/dist/src/auth/callback_server.d.ts +0 -41
  53. package/dist/src/auth/callback_server.d.ts.map +0 -1
  54. package/dist/src/auth/callback_server.js +0 -136
  55. package/dist/src/auth/callback_server.js.map +0 -1
  56. package/dist/src/auth/manager.d.ts +0 -97
  57. package/dist/src/auth/manager.d.ts.map +0 -1
  58. package/dist/src/auth/manager.js +0 -338
  59. package/dist/src/auth/manager.js.map +0 -1
  60. package/dist/src/auth/utils.d.ts +0 -45
  61. package/dist/src/auth/utils.d.ts.map +0 -1
  62. package/dist/src/auth/utils.js +0 -183
  63. package/dist/src/auth/utils.js.map +0 -1
  64. package/dist/src/commands/auth/disable_telemetry_command.d.ts +0 -3
  65. package/dist/src/commands/auth/disable_telemetry_command.d.ts.map +0 -1
  66. package/dist/src/commands/auth/disable_telemetry_command.js +0 -21
  67. package/dist/src/commands/auth/disable_telemetry_command.js.map +0 -1
  68. package/dist/src/commands/auth/enable_telemetry_command.d.ts +0 -3
  69. package/dist/src/commands/auth/enable_telemetry_command.d.ts.map +0 -1
  70. package/dist/src/commands/auth/enable_telemetry_command.js +0 -22
  71. package/dist/src/commands/auth/enable_telemetry_command.js.map +0 -1
  72. package/dist/src/commands/auth/login_ci_command.d.ts +0 -3
  73. package/dist/src/commands/auth/login_ci_command.d.ts.map +0 -1
  74. package/dist/src/commands/auth/login_ci_command.js +0 -41
  75. package/dist/src/commands/auth/login_ci_command.js.map +0 -1
  76. package/dist/src/commands/auth/login_command.d.ts +0 -4
  77. package/dist/src/commands/auth/login_command.d.ts.map +0 -1
  78. package/dist/src/commands/auth/login_command.js +0 -134
  79. package/dist/src/commands/auth/login_command.js.map +0 -1
  80. package/dist/src/commands/auth/logout_command.d.ts +0 -4
  81. package/dist/src/commands/auth/logout_command.d.ts.map +0 -1
  82. package/dist/src/commands/auth/logout_command.js +0 -54
  83. package/dist/src/commands/auth/logout_command.js.map +0 -1
  84. package/dist/src/commands/auth/print_access_token_command.d.ts +0 -3
  85. package/dist/src/commands/auth/print_access_token_command.d.ts.map +0 -1
  86. package/dist/src/commands/auth/print_access_token_command.js +0 -21
  87. package/dist/src/commands/auth/print_access_token_command.js.map +0 -1
  88. package/dist/src/commands/auth/print_api_key_command.d.ts +0 -3
  89. package/dist/src/commands/auth/print_api_key_command.d.ts.map +0 -1
  90. package/dist/src/commands/auth/print_api_key_command.js +0 -26
  91. package/dist/src/commands/auth/print_api_key_command.js.map +0 -1
  92. package/dist/src/commands/auth/status_command.d.ts +0 -4
  93. package/dist/src/commands/auth/status_command.d.ts.map +0 -1
  94. package/dist/src/commands/auth/status_command.js +0 -84
  95. package/dist/src/commands/auth/status_command.js.map +0 -1
  96. package/dist/src/commands/auth_command.d.ts +0 -3
  97. package/dist/src/commands/auth_command.d.ts.map +0 -1
  98. package/dist/src/commands/auth_command.js +0 -24
  99. package/dist/src/commands/auth_command.js.map +0 -1
  100. package/dist/src/commands/graph/graph_deploy_command.d.ts +0 -24
  101. package/dist/src/commands/graph/graph_deploy_command.d.ts.map +0 -1
  102. package/dist/src/commands/graph/graph_deploy_command.js +0 -204
  103. package/dist/src/commands/graph/graph_deploy_command.js.map +0 -1
  104. package/dist/src/commands/graph/graph_init_command.d.ts +0 -4
  105. package/dist/src/commands/graph/graph_init_command.d.ts.map +0 -1
  106. package/dist/src/commands/graph/graph_init_command.js +0 -335
  107. package/dist/src/commands/graph/graph_init_command.js.map +0 -1
  108. package/dist/src/commands/graph/graph_run_command.d.ts +0 -24
  109. package/dist/src/commands/graph/graph_run_command.d.ts.map +0 -1
  110. package/dist/src/commands/graph/graph_run_command.js +0 -50
  111. package/dist/src/commands/graph/graph_run_command.js.map +0 -1
  112. package/dist/src/commands/graph/graph_serve_command.d.ts +0 -4
  113. package/dist/src/commands/graph/graph_serve_command.d.ts.map +0 -1
  114. package/dist/src/commands/graph/graph_serve_command.js +0 -40
  115. package/dist/src/commands/graph/graph_serve_command.js.map +0 -1
  116. package/dist/src/commands/graph/graph_variant_command.d.ts +0 -3
  117. package/dist/src/commands/graph/graph_variant_command.d.ts.map +0 -1
  118. package/dist/src/commands/graph/graph_variant_command.js +0 -13
  119. package/dist/src/commands/graph/graph_variant_command.js.map +0 -1
  120. package/dist/src/commands/graph/graph_visualize_command.d.ts +0 -7
  121. package/dist/src/commands/graph/graph_visualize_command.d.ts.map +0 -1
  122. package/dist/src/commands/graph/graph_visualize_command.js +0 -35
  123. package/dist/src/commands/graph/graph_visualize_command.js.map +0 -1
  124. package/dist/src/commands/graph/variant/graph_variant_list_command.d.ts +0 -3
  125. package/dist/src/commands/graph/variant/graph_variant_list_command.d.ts.map +0 -1
  126. package/dist/src/commands/graph/variant/graph_variant_list_command.js +0 -26
  127. package/dist/src/commands/graph/variant/graph_variant_list_command.js.map +0 -1
  128. package/dist/src/commands/graph/variant/graph_variant_print_command.d.ts +0 -7
  129. package/dist/src/commands/graph/variant/graph_variant_print_command.d.ts.map +0 -1
  130. package/dist/src/commands/graph/variant/graph_variant_print_command.js +0 -46
  131. package/dist/src/commands/graph/variant/graph_variant_print_command.js.map +0 -1
  132. package/dist/src/commands/graph/variant/graph_variant_register_command.d.ts +0 -3
  133. package/dist/src/commands/graph/variant/graph_variant_register_command.d.ts.map +0 -1
  134. package/dist/src/commands/graph/variant/graph_variant_register_command.js +0 -46
  135. package/dist/src/commands/graph/variant/graph_variant_register_command.js.map +0 -1
  136. package/dist/src/commands/graph_command.d.ts +0 -3
  137. package/dist/src/commands/graph_command.d.ts.map +0 -1
  138. package/dist/src/commands/graph_command.js +0 -20
  139. package/dist/src/commands/graph_command.js.map +0 -1
  140. package/dist/src/commands/tts/tts_clone_command.d.ts +0 -6
  141. package/dist/src/commands/tts/tts_clone_command.d.ts.map +0 -1
  142. package/dist/src/commands/tts/tts_clone_command.js +0 -80
  143. package/dist/src/commands/tts/tts_clone_command.js.map +0 -1
  144. package/dist/src/commands/tts/tts_design_command.d.ts +0 -6
  145. package/dist/src/commands/tts/tts_design_command.d.ts.map +0 -1
  146. package/dist/src/commands/tts/tts_design_command.js +0 -216
  147. package/dist/src/commands/tts/tts_design_command.js.map +0 -1
  148. package/dist/src/commands/tts/tts_list_voices_command.d.ts +0 -6
  149. package/dist/src/commands/tts/tts_list_voices_command.d.ts.map +0 -1
  150. package/dist/src/commands/tts/tts_list_voices_command.js +0 -108
  151. package/dist/src/commands/tts/tts_list_voices_command.js.map +0 -1
  152. package/dist/src/commands/tts/tts_synthesize_command.d.ts +0 -6
  153. package/dist/src/commands/tts/tts_synthesize_command.d.ts.map +0 -1
  154. package/dist/src/commands/tts/tts_synthesize_command.js +0 -351
  155. package/dist/src/commands/tts/tts_synthesize_command.js.map +0 -1
  156. package/dist/src/commands/tts/tts_utils.d.ts +0 -14
  157. package/dist/src/commands/tts/tts_utils.d.ts.map +0 -1
  158. package/dist/src/commands/tts/tts_utils.js +0 -84
  159. package/dist/src/commands/tts/tts_utils.js.map +0 -1
  160. package/dist/src/commands/tts_commands.d.ts +0 -6
  161. package/dist/src/commands/tts_commands.d.ts.map +0 -1
  162. package/dist/src/commands/tts_commands.js +0 -18
  163. package/dist/src/commands/tts_commands.js.map +0 -1
  164. package/dist/src/commands/workspace_command.d.ts +0 -22
  165. package/dist/src/commands/workspace_command.d.ts.map +0 -1
  166. package/dist/src/commands/workspace_command.js +0 -72
  167. package/dist/src/commands/workspace_command.js.map +0 -1
  168. package/dist/src/constants.d.ts +0 -11
  169. package/dist/src/constants.d.ts.map +0 -1
  170. package/dist/src/constants.js +0 -48
  171. package/dist/src/constants.js.map +0 -1
  172. package/dist/src/grpc/core/InworldError.d.ts +0 -30
  173. package/dist/src/grpc/core/InworldError.d.ts.map +0 -1
  174. package/dist/src/grpc/core/InworldError.js +0 -46
  175. package/dist/src/grpc/core/InworldError.js.map +0 -1
  176. package/dist/src/grpc/core/statusCodes.d.ts +0 -122
  177. package/dist/src/grpc/core/statusCodes.d.ts.map +0 -1
  178. package/dist/src/grpc/core/statusCodes.js +0 -133
  179. package/dist/src/grpc/core/statusCodes.js.map +0 -1
  180. package/dist/src/index.d.ts +0 -2
  181. package/dist/src/index.d.ts.map +0 -1
  182. package/dist/src/index.js +0 -139
  183. package/dist/src/index.js.map +0 -1
  184. package/dist/src/services/analytics.d.ts +0 -45
  185. package/dist/src/services/analytics.d.ts.map +0 -1
  186. package/dist/src/services/analytics.js +0 -139
  187. package/dist/src/services/analytics.js.map +0 -1
  188. package/dist/src/services/deploy_service.d.ts +0 -4
  189. package/dist/src/services/deploy_service.d.ts.map +0 -1
  190. package/dist/src/services/deploy_service.js +0 -128
  191. package/dist/src/services/deploy_service.js.map +0 -1
  192. package/dist/src/services/graph_loader.d.ts +0 -7
  193. package/dist/src/services/graph_loader.d.ts.map +0 -1
  194. package/dist/src/services/graph_loader.js +0 -103
  195. package/dist/src/services/graph_loader.js.map +0 -1
  196. package/dist/src/services/graph_variant_service.d.ts +0 -12
  197. package/dist/src/services/graph_variant_service.d.ts.map +0 -1
  198. package/dist/src/services/graph_variant_service.js +0 -66
  199. package/dist/src/services/graph_variant_service.js.map +0 -1
  200. package/dist/src/services/template_service.d.ts +0 -79
  201. package/dist/src/services/template_service.d.ts.map +0 -1
  202. package/dist/src/services/template_service.js +0 -299
  203. package/dist/src/services/template_service.js.map +0 -1
  204. package/dist/src/services/tts_service.d.ts +0 -340
  205. package/dist/src/services/tts_service.d.ts.map +0 -1
  206. package/dist/src/services/tts_service.js +0 -320
  207. package/dist/src/services/tts_service.js.map +0 -1
  208. package/dist/src/services/update_checker.d.ts +0 -37
  209. package/dist/src/services/update_checker.d.ts.map +0 -1
  210. package/dist/src/services/update_checker.js +0 -134
  211. package/dist/src/services/update_checker.js.map +0 -1
  212. package/dist/src/services/workspace_service.d.ts +0 -53
  213. package/dist/src/services/workspace_service.d.ts.map +0 -1
  214. package/dist/src/services/workspace_service.js +0 -324
  215. package/dist/src/services/workspace_service.js.map +0 -1
  216. package/dist/src/utils/array.d.ts +0 -2
  217. package/dist/src/utils/array.d.ts.map +0 -1
  218. package/dist/src/utils/array.js +0 -4
  219. package/dist/src/utils/array.js.map +0 -1
  220. package/dist/src/utils/audio_player.d.ts +0 -10
  221. package/dist/src/utils/audio_player.d.ts.map +0 -1
  222. package/dist/src/utils/audio_player.js +0 -34
  223. package/dist/src/utils/audio_player.js.map +0 -1
  224. package/dist/src/utils/confirm.d.ts +0 -62
  225. package/dist/src/utils/confirm.d.ts.map +0 -1
  226. package/dist/src/utils/confirm.js +0 -90
  227. package/dist/src/utils/confirm.js.map +0 -1
  228. package/dist/src/utils/long_running_operations.d.ts +0 -38
  229. package/dist/src/utils/long_running_operations.d.ts.map +0 -1
  230. package/dist/src/utils/long_running_operations.js +0 -62
  231. package/dist/src/utils/long_running_operations.js.map +0 -1
  232. package/dist/src/utils/resource_name_helper.d.ts +0 -17
  233. package/dist/src/utils/resource_name_helper.d.ts.map +0 -1
  234. package/dist/src/utils/resource_name_helper.js +0 -38
  235. package/dist/src/utils/resource_name_helper.js.map +0 -1
  236. package/dist/src/utils/selector.d.ts +0 -62
  237. package/dist/src/utils/selector.d.ts.map +0 -1
  238. package/dist/src/utils/selector.js +0 -76
  239. package/dist/src/utils/selector.js.map +0 -1
  240. package/dist/src/utils/spinner.d.ts +0 -75
  241. package/dist/src/utils/spinner.d.ts.map +0 -1
  242. package/dist/src/utils/spinner.js +0 -178
  243. package/dist/src/utils/spinner.js.map +0 -1
  244. package/dist/src/utils/ui.d.ts +0 -27
  245. package/dist/src/utils/ui.d.ts.map +0 -1
  246. package/dist/src/utils/ui.js +0 -89
  247. package/dist/src/utils/ui.js.map +0 -1
@@ -1,62 +0,0 @@
1
- // Potred from portal ui code.
2
- import { retryableAuthenticatedInworldRequest } from '@/auth/utils';
3
- import { Operations } from '@/proto/generated/portal/ai/inworld/studio/v1/operations.pb';
4
- const isOperationError = (obj) => typeof obj === 'object' &&
5
- obj !== null &&
6
- typeof obj.code === 'number' &&
7
- typeof obj.message === 'string' &&
8
- ('details' in obj ? Array.isArray(obj.details) : true);
9
- export const isLongRunningOperationResponse = (obj) => typeof obj === 'object' &&
10
- obj !== null &&
11
- typeof obj.name === 'string' &&
12
- typeof obj.done === 'boolean' &&
13
- ('error' in obj ? isOperationError(obj.error) : true);
14
- export const CHECK_LIMIT = 60;
15
- export const CHECK_TIMEOUT = 2000;
16
- //Decoupled polling logic from calling the operation
17
- export const checkLRO = async ({ operationName, signal, checkLimit, checkTimeout, pollOptions, returnWithMetadata, }) => {
18
- let checkResponse;
19
- checkLimit = checkLimit ?? CHECK_LIMIT;
20
- checkTimeout = checkTimeout ?? CHECK_TIMEOUT;
21
- if (pollOptions?.startCallback) {
22
- pollOptions.startCallback(operationName);
23
- }
24
- for (let i = pollOptions?.currentIteration ?? 0; i < checkLimit; i++) {
25
- signal?.throwIfAborted();
26
- try {
27
- checkResponse = await check(operationName, signal, returnWithMetadata);
28
- if (checkResponse?.done) {
29
- if (checkResponse?.error || checkResponse?.metadata?.error) {
30
- pollOptions?.errorCallback?.(operationName, checkResponse.error || checkResponse?.metadata?.error);
31
- throw checkResponse.error || checkResponse?.metadata?.error;
32
- }
33
- pollOptions?.doneCallback?.(operationName, checkResponse?.response);
34
- return (returnWithMetadata ? checkResponse : checkResponse?.response);
35
- }
36
- else {
37
- pollOptions?.iterationCallback?.(operationName, checkResponse, {
38
- checkIteration: i,
39
- checkLimit,
40
- checkTimeout,
41
- });
42
- }
43
- }
44
- catch (error) {
45
- pollOptions?.errorCallback?.(operationName, error);
46
- throw error;
47
- }
48
- await new Promise((resolve) => setTimeout(resolve, checkTimeout));
49
- }
50
- throw new Error(`Operation timeout. Max number of checks reached ${checkLimit}`);
51
- };
52
- const check = async (operationName, signal, returnWithMetadata) => retryableAuthenticatedInworldRequest(Operations.GetOperation, {
53
- nameworkspacescharactersoperations: operationName,
54
- }, returnWithMetadata
55
- ? {
56
- withMetadata: true,
57
- maxRetries: 1,
58
- backoffFactor: 2,
59
- minTimeout: 300,
60
- }
61
- : undefined, signal);
62
- //# sourceMappingURL=long_running_operations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"long_running_operations.js","sourceRoot":"","sources":["../../../src/utils/long_running_operations.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAE9B,OAAO,EAAE,oCAAoC,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAC;AAWzF,MAAM,gBAAgB,GAAG,CAAC,GAAQ,EAAsB,EAAE,CACxD,OAAO,GAAG,KAAK,QAAQ;IACvB,GAAG,KAAK,IAAI;IACZ,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ;IAC5B,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ;IAC/B,CAAC,SAAS,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAEzD,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC5C,GAAQ,EAC6B,EAAE,CACvC,OAAO,GAAG,KAAK,QAAQ;IACvB,GAAG,KAAK,IAAI;IACZ,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ;IAC5B,OAAO,GAAG,C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,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;gBACpE,OAAO,CACL,kBAAkB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,EAAE,QAAQ,CACxD,CAAC;YACT,CAAC;iBAAM,CAAC;gBACN,WAAW,EAAE,iBAAiB,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE;oBAC7D,cAAc,EAAE,CAAC;oBACjB,UAAU;oBACV,YAAY;iBACb,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,WAAW,EAAE,aAAa,EAAE,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;YACnD,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,IAAI,KAAK,CACb,mDAAmD,UAAU,EAAE,CAChE,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,KAAK,EACjB,aAAqB,EACrB,MAAoB,EACpB,kBAA4B,EAC5B,EAAE,CACF,oCAAoC,CAUlC,UAAU,CAAC,YAAY,EACvB;IACE,kCAAkC,EAAE,aAAa;CAClD,EACD,kBAAkB;IAChB,CAAC,CAAC;QACE,YAAY,EAAE,IAAI;QAClB,UAAU,EAAE,CAAC;QACb,aAAa,EAAE,CAAC;QAChB,UAAU,EAAE,GAAG;KAChB;IACH,CAAC,CAAC,SAAS,EACb,MAAM,CACP,CAAC"}
@@ -1,17 +0,0 @@
1
- export declare const parseWorkspaceResourceName: (resourceName: string) => {
2
- workspaceId: string;
3
- };
4
- export declare const parseGraphResourceName: (resourceName: string) => {
5
- workspaceId: string;
6
- graphId: string;
7
- };
8
- export declare const getGraphResourceName: (workspaceId: string, graphId: string) => string;
9
- export declare const getGraphVariantResourceName: (workspaceId: string, graphId: string, variantId: string) => string;
10
- export declare const getWorkspaceResourceName: (workspaceId: string) => string;
11
- /**
12
- * Ensures a workspace value is a full resource name.
13
- * Accepts either "workspaces/foo" or just "foo".
14
- */
15
- export declare const ensureWorkspaceResourceName: (workspace: string) => string;
16
- export declare const getGraphDeploymentResourceName: (workspaceId: string, graphId: string) => string;
17
- //# sourceMappingURL=resource_name_helper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource_name_helper.d.ts","sourceRoot":"","sources":["../../../src/utils/resource_name_helper.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,GAAI,cAAc,MAAM;;CAM9D,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,cAAc,MAAM;;;CAW1D,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,aAAa,MAAM,EAAE,SAAS,MAAM,WAExE,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,aAAa,MAAM,EACnB,SAAS,MAAM,EACf,WAAW,MAAM,WAGlB,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,aAAa,MAAM,WAE3D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,GAAI,WAAW,MAAM,WAI5D,CAAC;AAEF,eAAO,MAAM,8BAA8B,GACzC,aAAa,MAAM,EACnB,SAAS,MAAM,WAGhB,CAAC"}
@@ -1,38 +0,0 @@
1
- export const parseWorkspaceResourceName = (resourceName) => {
2
- const [collection, workspaceId] = resourceName.split('/');
3
- if (collection !== 'workspaces') {
4
- throw new Error(`Invalid workspace resource name: ${resourceName}`);
5
- }
6
- return { workspaceId };
7
- };
8
- export const parseGraphResourceName = (resourceName) => {
9
- const [workspaceCollection, workspaceId, graphCollection, graphId] = resourceName.split('/');
10
- if (workspaceCollection !== 'workspaces' ||
11
- graphCollection !== 'graphs' ||
12
- graphId === undefined) {
13
- throw new Error(`Invalid graph resource name: ${resourceName}`);
14
- }
15
- return { workspaceId, graphId };
16
- };
17
- export const getGraphResourceName = (workspaceId, graphId) => {
18
- return `workspaces/${workspaceId}/graphs/${graphId}`;
19
- };
20
- export const getGraphVariantResourceName = (workspaceId, graphId, variantId) => {
21
- return `${getGraphResourceName(workspaceId, graphId)}/variants/${variantId}`;
22
- };
23
- export const getWorkspaceResourceName = (workspaceId) => {
24
- return `workspaces/${workspaceId}`;
25
- };
26
- /**
27
- * Ensures a workspace value is a full resource name.
28
- * Accepts either "workspaces/foo" or just "foo".
29
- */
30
- export const ensureWorkspaceResourceName = (workspace) => {
31
- return workspace.startsWith('workspaces/')
32
- ? workspace
33
- : `workspaces/${workspace}`;
34
- };
35
- export const getGraphDeploymentResourceName = (workspaceId, graphId) => {
36
- return `${getGraphResourceName(workspaceId, graphId)}/deploy`;
37
- };
38
- //# sourceMappingURL=resource_name_helper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource_name_helper.js","sourceRoot":"","sources":["../../../src/utils/resource_name_helper.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,YAAoB,EAAE,EAAE;IACjE,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1D,IAAI,UAAU,KAAK,YAAY,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,oCAAoC,YAAY,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,EAAE,WAAW,EAAE,CAAC;AACzB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,YAAoB,EAAE,EAAE;IAC7D,MAAM,CAAC,mBAAmB,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,CAAC,GAChE,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1B,IACE,mBAAmB,KAAK,YAAY;QACpC,eAAe,KAAK,QAAQ;QAC5B,OAAO,KAAK,SAAS,EACrB,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,YAAY,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;AAClC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,WAAmB,EAAE,OAAe,EAAE,EAAE;IAC3E,OAAO,cAAc,WAAW,WAAW,OAAO,EAAE,CAAC;AACvD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,WAAmB,EACnB,OAAe,EACf,SAAiB,EACjB,EAAE;IACF,OAAO,GAAG,oBAAoB,CAAC,WAAW,EAAE,OAAO,CAAC,aAAa,SAAS,EAAE,CAAC;AAC/E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,WAAmB,EAAE,EAAE;IAC9D,OAAO,cAAc,WAAW,EAAE,CAAC;AACrC,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,SAAiB,EAAE,EAAE;IAC/D,OAAO,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC;QACxC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,cAAc,SAAS,EAAE,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC5C,WAAmB,EACnB,OAAe,EACf,EAAE;IACF,OAAO,GAAG,oBAAoB,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC;AAChE,CAAC,CAAC"}
@@ -1,62 +0,0 @@
1
- /**
2
- * Options for configuring the selector behavior
3
- */
4
- export interface SelectorOptions<T> {
5
- /**
6
- * The items to select from
7
- */
8
- items: T[];
9
- /**
10
- * Function to get the display name for an item
11
- */
12
- getDisplayName: (item: T) => string;
13
- /**
14
- * Function to get the ID/resource name for an item
15
- */
16
- getIdentifier: (item: T) => string;
17
- /**
18
- * The prompt message to show to the user
19
- */
20
- prompt: string;
21
- /**
22
- * The title to show before listing items
23
- */
24
- title: string;
25
- /**
26
- * If true, automatically select the first item without prompting
27
- */
28
- forceFirst?: boolean;
29
- /**
30
- * Message to show when no items are found
31
- */
32
- noItemsMessage?: string;
33
- /**
34
- * Message to show for invalid selection
35
- */
36
- invalidSelectionMessage?: string;
37
- }
38
- /**
39
- * Generic selector utility that provides a consistent interface for selecting items
40
- * from a list. Supports selection by index number or identifier.
41
- *
42
- * @param options Configuration options for the selector
43
- * @returns The selected item or null if no selection was made
44
- */
45
- export declare function selectItem<T>(options: SelectorOptions<T>): Promise<T | null>;
46
- /**
47
- * Selector options with exit capability
48
- */
49
- export interface SelectorWithExitOptions<T> extends SelectorOptions<T> {
50
- /**
51
- * If true, the process will exit with code 1 when selection fails
52
- */
53
- exitOnFailure?: boolean;
54
- }
55
- /**
56
- * Wrapper around selectItem that exits the process on failure
57
- *
58
- * @param options Configuration options for the selector
59
- * @returns The selected item (never null due to process exit on failure)
60
- */
61
- export declare function selectItemOrExit<T>(options: SelectorWithExitOptions<T>): Promise<T>;
62
- //# sourceMappingURL=selector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selector.d.ts","sourceRoot":"","sources":["../../../src/utils/selector.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC;;OAEG;IACH,KAAK,EAAE,CAAC,EAAE,CAAC;IAEX;;OAEG;IACH,cAAc,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAEpC;;OAEG;IACH,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAEnC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAChC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,GAC1B,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAuEnB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACpE;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,OAAO,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAClC,OAAO,CAAC,CAAC,CAAC,CAUZ"}
@@ -1,76 +0,0 @@
1
- import * as readline from 'readline';
2
- import * as ui from './ui';
3
- /**
4
- * Generic selector utility that provides a consistent interface for selecting items
5
- * from a list. Supports selection by index number or identifier.
6
- *
7
- * @param options Configuration options for the selector
8
- * @returns The selected item or null if no selection was made
9
- */
10
- export async function selectItem(options) {
11
- const { items, getDisplayName, getIdentifier, prompt, title, forceFirst = false, noItemsMessage = 'No items found.', invalidSelectionMessage = 'Invalid selection. Please enter a valid number or identifier.', } = options;
12
- if (items.length === 0) {
13
- ui.printError(noItemsMessage);
14
- return null;
15
- }
16
- // If forceFirst is true, return the first item without prompting
17
- if (forceFirst) {
18
- return items[0];
19
- }
20
- // Display available items
21
- console.log();
22
- ui.printHeader(title);
23
- items.forEach((item, idx) => {
24
- const displayName = getDisplayName(item);
25
- ui.printListItem(`${idx + 1}. ${ui.bright(displayName)}`);
26
- });
27
- // Create readline interface for user input
28
- const rl = readline.createInterface({
29
- input: process.stdin,
30
- output: process.stdout,
31
- });
32
- const question = (query) => new Promise((resolve) => rl.question(query, resolve));
33
- let selectedItem = null;
34
- try {
35
- while (!selectedItem) {
36
- const answer = (await question(`\n${prompt} `)).trim();
37
- // Try to match by number
38
- const idx = parseInt(answer, 10);
39
- if (!isNaN(idx) && idx >= 1 && idx <= items.length) {
40
- selectedItem = items[idx - 1];
41
- }
42
- else {
43
- // Try to match by identifier (full or partial)
44
- selectedItem =
45
- items.find((item) => {
46
- const identifier = getIdentifier(item);
47
- return (identifier === answer || identifier.split('/').pop() === answer);
48
- }) || null;
49
- }
50
- if (!selectedItem) {
51
- ui.printError(invalidSelectionMessage);
52
- // Exit the loop and return null for invalid selection
53
- break;
54
- }
55
- }
56
- }
57
- finally {
58
- rl.close();
59
- }
60
- return selectedItem;
61
- }
62
- /**
63
- * Wrapper around selectItem that exits the process on failure
64
- *
65
- * @param options Configuration options for the selector
66
- * @returns The selected item (never null due to process exit on failure)
67
- */
68
- export async function selectItemOrExit(options) {
69
- const { exitOnFailure = true, ...selectorOptions } = options;
70
- const selected = await selectItem(selectorOptions);
71
- if (!selected && exitOnFailure) {
72
- process.exit(1);
73
- }
74
- return selected;
75
- }
76
- //# sourceMappingURL=selector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selector.js","sourceRoot":"","sources":["../../../src/utils/selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAErC,OAAO,KAAK,EAAE,MAAM,MAAM,CAAC;AA+C3B;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,OAA2B;IAE3B,MAAM,EACJ,KAAK,EACL,cAAc,EACd,aAAa,EACb,MAAM,EACN,KAAK,EACL,UAAU,GAAG,KAAK,EAClB,cAAc,GAAG,iBAAiB,EAClC,uBAAuB,GAAG,+DAA+D,GAC1F,GAAG,OAAO,CAAC;IAEZ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,iEAAiE;IACjE,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,0BAA0B;IAC1B,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CA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AAM,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,MAAM,CAChE,CAAC;oBACJ,CAAC,CAAC,IAAI,IAAI,CAAC;YACf,CAAC;YAED,IAAI,CAAC,YAAY,EAAE,CAAC;gBAClB,EAAE,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;gBACvC,sDAAsD;gBACtD,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAYD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAmC;IAEnC,MAAM,EAAE,aAAa,GAAG,IAAI,EAAE,GAAG,eAAe,EAAE,GAAG,OAAO,CAAC;IAE7D,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,eAAe,CAAC,CAAC;IAEnD,IAAI,CAAC,QAAQ,IAAI,aAAa,EAAE,CAAC;QAC/B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,QAAS,CAAC;AACnB,CAAC"}
@@ -1,75 +0,0 @@
1
- /**
2
- * Configuration for the LRO spinner
3
- */
4
- export interface LROSpinnerConfig {
5
- initialText?: string;
6
- phraseInterval?: number;
7
- showIterations?: boolean;
8
- spinnerStyle?: string;
9
- }
10
- /**
11
- * Creates and manages a spinner for long-running operations
12
- */
13
- export declare class LROSpinner {
14
- private spinner;
15
- private phraseInterval?;
16
- private currentPhraseIndex;
17
- private config;
18
- private iterationCount;
19
- private startTime;
20
- constructor(config?: LROSpinnerConfig);
21
- /**
22
- * Starts the spinner with rotating phrases
23
- */
24
- start(): void;
25
- /**
26
- * Updates the spinner text with current phrase and optional iteration count
27
- */
28
- private updateText;
29
- /**
30
- * Updates the iteration count
31
- */
32
- updateIteration(iteration: number): void;
33
- /**
34
- * Updates spinner with custom text temporarily
35
- */
36
- updateCustomText(text: string): void;
37
- /**
38
- * Succeeds the spinner with a success message
39
- */
40
- succeed(text?: string): void;
41
- /**
42
- * Fails the spinner with an error message
43
- */
44
- fail(text?: string): void;
45
- /**
46
- * Warns the spinner with a warning message
47
- */
48
- warn(text?: string): void;
49
- /**
50
- * Stops the spinner without any status
51
- */
52
- stop(): void;
53
- /**
54
- * Cleans up intervals
55
- */
56
- private cleanup;
57
- /**
58
- * Gets a random phrase for one-off usage
59
- */
60
- static getRandomPhrase(): string;
61
- }
62
- /**
63
- * Helper function to create spinner callbacks for LRO operations
64
- */
65
- export declare function createLROSpinnerCallbacks(config?: LROSpinnerConfig): {
66
- startCallback: (operationName: string) => void;
67
- iterationCallback: (operationName: string, _checkResponse: any, checkData: {
68
- checkIteration: number;
69
- checkLimit: number;
70
- checkTimeout: number;
71
- }) => void;
72
- doneCallback: (_operationName: string, _response: any) => void;
73
- errorCallback: (operationName: string, error: string) => void;
74
- };
75
- //# sourceMappingURL=spinner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/utils/spinner.ts"],"names":[],"mappings":"AA8BA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,kBAAkB,CAAa;IACvC,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,cAAc,CAAa;IACnC,OAAO,CAAC,SAAS,CAAS;gBAEd,MAAM,GAAE,gBAAqB;IAkBzC;;OAEG;IACH,KAAK,IAAI,IAAI;IAWb;;OAEG;IACH,OAAO,CAAC,UAAU;IAiBlB;;OAEG;IACH,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAKxC;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIpC;;OAEG;IACH,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAQ5B;;OAEG;IACH,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAMzB;;OAEG;IACH,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAMzB;;OAEG;IACH,IAAI,IAAI,IAAI;IAKZ;;OAEG;IACH,OAAO,CAAC,OAAO;IAOf;;OAEG;IACH,MAAM,CAAC,eAAe,IAAI,MAAM;CAGjC;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,CAAC,EAAE,gBAAgB;mCAIhC,MAAM;uCASpB,MAAM,kBACL,GAAG,aACR;QACT,cAAc,EAAE,MAAM,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;KACtB;mCAgB4B,MAAM,aAAa,GAAG;mCAOtB,MAAM,SAAS,MAAM;EAOvD"}
@@ -1,178 +0,0 @@
1
- import chalk from 'chalk';
2
- import ora from 'ora';
3
- const PHRASES = [
4
- 'Condensing time-space matter',
5
- 'Starting particle collider',
6
- 'Calibrating quantum flux capacitor',
7
- 'Reversing polarity of neutron flow',
8
- 'Aligning cosmic frequencies',
9
- 'Compiling infinite loops',
10
- 'Downloading more RAM',
11
- 'Reticulating splines',
12
- 'Generating witty loading messages',
13
- 'Convincing electrons to cooperate',
14
- 'Negotiating with the cloud overlords',
15
- 'Bribing the API hamsters',
16
- 'Warming up the server potatoes',
17
- 'Untangling quantum entanglements',
18
- 'Feeding the deployment gremlins',
19
- 'Optimizing coffee-to-code ratio',
20
- 'Summoning the deployment spirits',
21
- 'Consulting the ancient scrolls',
22
- 'Charging the flux compensators',
23
- 'Stabilizing temporal anomalies',
24
- 'Synchronizing parallel universes',
25
- 'Decoding the matrix',
26
- 'Activating turbo encabulator',
27
- 'Adjusting the dilithium crystals',
28
- ];
29
- /**
30
- * Creates and manages a spinner for long-running operations
31
- */
32
- export class LROSpinner {
33
- spinner;
34
- phraseInterval;
35
- currentPhraseIndex = 0;
36
- config;
37
- iterationCount = 0;
38
- startTime;
39
- constructor(config = {}) {
40
- this.config = {
41
- initialText: 'Initializing deployment',
42
- phraseInterval: 10000,
43
- showIterations: true,
44
- spinnerStyle: 'dots8Bit',
45
- ...config,
46
- };
47
- this.spinner = ora({
48
- text: this.config.initialText,
49
- spinner: this.config.spinnerStyle,
50
- color: 'cyan',
51
- });
52
- this.startTime = Date.now();
53
- }
54
- /**
55
- * Starts the spinner with rotating phrases
56
- */
57
- start() {
58
- this.spinner.start();
59
- this.updateText();
60
- // Start rotating phrases
61
- this.phraseInterval = setInterval(() => {
62
- // this.currentPhraseIndex = (this.currentPhraseIndex + 1) % PHRASES.length;
63
- this.updateText();
64
- }, this.config.phraseInterval);
65
- }
66
- /**
67
- * Updates the spinner text with current phrase and optional iteration count
68
- */
69
- updateText() {
70
- const phrase = LROSpinner.getRandomPhrase();
71
- const elapsedSeconds = Math.floor((Date.now() - this.startTime) / 1000);
72
- let text = chalk.cyan(phrase);
73
- if (this.config.showIterations && this.iterationCount > 0) {
74
- text += chalk.gray(` (iteration ${this.iterationCount}, ${elapsedSeconds}s)`);
75
- }
76
- else if (elapsedSeconds > 0) {
77
- text += chalk.gray(` (${elapsedSeconds}s)`);
78
- }
79
- this.spinner.text = text;
80
- }
81
- /**
82
- * Updates the iteration count
83
- */
84
- updateIteration(iteration) {
85
- this.iterationCount = iteration + 1; // Convert 0-based to 1-based for display
86
- this.updateText();
87
- }
88
- /**
89
- * Updates spinner with custom text temporarily
90
- */
91
- updateCustomText(text) {
92
- this.spinner.text = chalk.yellow(text);
93
- }
94
- /**
95
- * Succeeds the spinner with a success message
96
- */
97
- succeed(text) {
98
- this.cleanup();
99
- const elapsedSeconds = Math.floor((Date.now() - this.startTime) / 1000);
100
- const successText = text || `Deployment completed successfully in ${elapsedSeconds}s`;
101
- this.spinner.succeed(chalk.green(successText));
102
- }
103
- /**
104
- * Fails the spinner with an error message
105
- */
106
- fail(text) {
107
- this.cleanup();
108
- const errorText = text || 'Deployment failed';
109
- this.spinner.fail(chalk.red(errorText));
110
- }
111
- /**
112
- * Warns the spinner with a warning message
113
- */
114
- warn(text) {
115
- this.cleanup();
116
- const warnText = text || 'Deployment completed with warnings';
117
- this.spinner.warn(chalk.yellow(warnText));
118
- }
119
- /**
120
- * Stops the spinner without any status
121
- */
122
- stop() {
123
- this.cleanup();
124
- this.spinner.stop();
125
- }
126
- /**
127
- * Cleans up intervals
128
- */
129
- cleanup() {
130
- if (this.phraseInterval) {
131
- clearInterval(this.phraseInterval);
132
- this.phraseInterval = undefined;
133
- }
134
- }
135
- /**
136
- * Gets a random phrase for one-off usage
137
- */
138
- static getRandomPhrase() {
139
- return PHRASES[Math.floor(Math.random() * PHRASES.length)];
140
- }
141
- }
142
- /**
143
- * Helper function to create spinner callbacks for LRO operations
144
- */
145
- export function createLROSpinnerCallbacks(config) {
146
- let spinner = null;
147
- return {
148
- startCallback: (operationName) => {
149
- spinner = new LROSpinner({
150
- ...config,
151
- initialText: `Starting operation: ${operationName}`,
152
- });
153
- spinner.start();
154
- },
155
- iterationCallback: (operationName, _checkResponse, checkData) => {
156
- if (spinner) {
157
- spinner.updateIteration(checkData.checkIteration);
158
- // Add progress warning if getting close to limit
159
- if (checkData.checkIteration > checkData.checkLimit * 0.8) {
160
- spinner.updateCustomText(chalk.yellow(`⚠️ Taking longer than expected... (${checkData.checkIteration}/${checkData.checkLimit})`));
161
- }
162
- }
163
- },
164
- doneCallback: (_operationName, _response) => {
165
- if (spinner) {
166
- spinner.succeed(`Operation completed.`);
167
- spinner = null;
168
- }
169
- },
170
- errorCallback: (operationName, error) => {
171
- if (spinner) {
172
- spinner.fail(`Operation ${operationName} failed: ${error}`);
173
- spinner = null;
174
- }
175
- },
176
- };
177
- }
178
- //# sourceMappingURL=spinner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../src/utils/spinner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAY,MAAM,KAAK,CAAC;AAE/B,MAAM,OAAO,GAAG;IACd,8BAA8B;IAC9B,4BAA4B;IAC5B,oCAAoC;IACpC,oCAAoC;IACpC,6BAA6B;IAC7B,0BAA0B;IAC1B,sBAAsB;IACtB,sBAAsB;IACtB,mCAAmC;IACnC,mCAAmC;IACnC,sCAAsC;IACtC,0BAA0B;IAC1B,gCAAgC;IAChC,kCAAkC;IAClC,iCAAiC;IACjC,iCAAiC;IACjC,kCAAkC;IAClC,gCAAgC;IAChC,gCAAgC;IAChC,gCAAgC;IAChC,kCAAkC;IAClC,qBAAqB;IACrB,8BAA8B;IAC9B,kCAAkC;CACnC,CAAC;AAYF;;GAEG;AACH,MAAM,OAAO,UAAU;IACb,OAAO,CAAM;IACb,cAAc,CAAkB;IAChC,kBAAkB,GAAW,CAAC,CAAC;IAC/B,MAAM,CAA6B;IACnC,cAAc,GAAW,CAAC,CAAC;IAC3B,SAAS,CAAS;IAE1B,YAAY,SAA2B,EAAE;QACvC,IAAI,CAAC,MAAM,GAAG;YACZ,WAAW,EAAE,yBAAyB;YACtC,cAAc,EAAE,KAAK;YACrB,cAAc,EAAE,IAAI;YACpB,YAAY,EAAE,UAAU;YACxB,GAAG,MAAM;SACV,CAAC;QAEF,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;YACjB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,YAAmB;YACxC,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,K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- export declare function printHeader(message: string): void;
2
- export declare function p(message: string): void;
3
- export declare function print(message: string): void;
4
- export declare function printBright(message: string): void;
5
- export declare function printLink(message: string): void;
6
- export declare function printError(message: string): void;
7
- export declare function success(message: string): void;
8
- export declare function printListHeader(message: string): void;
9
- export declare function printListItem(message: string): void;
10
- export declare function cyan(message: string): string;
11
- export declare function yellow(message: string): string;
12
- export declare function green(message: string): string;
13
- export declare function bold(message: string): string;
14
- export declare function bright(message: string): string;
15
- export declare function dim(message: string): string;
16
- export declare function link(message: string): string;
17
- /**
18
- * Prints content in a styled box
19
- */
20
- export declare function printBox(lines: string[], options?: {
21
- color?: string;
22
- padding?: number;
23
- }): void;
24
- export declare function trimBase64Key(key: string): string;
25
- export declare function trimToken(token: string): string;
26
- export declare function workspaceLink(workspaceId: string): string;
27
- //# sourceMappingURL=ui.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../src/utils/ui.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,QAE1C;AAED,wBAAgB,CAAC,CAAC,OAAO,EAAE,MAAM,QAEhC;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,QAEpC;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,QAE1C;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,QAExC;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,QAEzC;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,QAEtC;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,QAE9C;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,QAE5C;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,UAEnC;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,UAErC;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,UAEpC;AAED,wBA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