@intuned/runtime-dev 1.3.17-source.0 → 1.3.18-interface.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 (224) hide show
  1. package/InterfaceTemplate/index.playwright.ts +1 -1
  2. package/api/sample.ts +4 -0
  3. package/bin/intuned +0 -0
  4. package/bin/intuned-interface +7 -0
  5. package/package.json +10 -8
  6. package/dist/commands/api/run.d.ts +0 -6
  7. package/dist/commands/api/run.js +0 -119
  8. package/dist/commands/auth-sessions/load.d.ts +0 -2
  9. package/dist/commands/auth-sessions/load.js +0 -35
  10. package/dist/commands/auth-sessions/run-check.d.ts +0 -2
  11. package/dist/commands/auth-sessions/run-check.js +0 -74
  12. package/dist/commands/auth-sessions/run-create.d.ts +0 -2
  13. package/dist/commands/auth-sessions/run-create.js +0 -78
  14. package/dist/commands/browser/save-state.d.ts +0 -2
  15. package/dist/commands/browser/save-state.js +0 -17
  16. package/dist/commands/browser/start-browser.d.ts +0 -2
  17. package/dist/commands/browser/start-browser.js +0 -14
  18. package/dist/commands/build.d.ts +0 -1
  19. package/dist/commands/build.js +0 -85
  20. package/dist/commands/common/browserUtils.d.ts +0 -14
  21. package/dist/commands/common/browserUtils.js +0 -58
  22. package/dist/commands/common/getFirstLineNumber.d.ts +0 -9
  23. package/dist/commands/common/getFirstLineNumber.js +0 -101
  24. package/dist/commands/common/getFirstLineNumber.test.js +0 -228
  25. package/dist/commands/common/projectExclusions.d.ts +0 -2
  26. package/dist/commands/common/projectExclusions.js +0 -8
  27. package/dist/commands/common/sendMessageToClient.d.ts +0 -1
  28. package/dist/commands/common/sendMessageToClient.js +0 -10
  29. package/dist/commands/common/tsNodeImport.d.ts +0 -2
  30. package/dist/commands/common/tsNodeImport.js +0 -43
  31. package/dist/commands/common/utils/fileUtils.d.ts +0 -6
  32. package/dist/commands/common/utils/fileUtils.js +0 -33
  33. package/dist/commands/common/utils/settings.d.ts +0 -2
  34. package/dist/commands/common/utils/settings.js +0 -31
  35. package/dist/commands/common/utils/template.d.ts +0 -2
  36. package/dist/commands/common/utils/template.js +0 -31
  37. package/dist/commands/common/utils/unixSocket.d.ts +0 -23
  38. package/dist/commands/common/utils/unixSocket.js +0 -87
  39. package/dist/commands/get-headless-user-agent.d.ts +0 -1
  40. package/dist/commands/get-headless-user-agent.js +0 -18
  41. package/dist/commands/interface/run.d.ts +0 -1
  42. package/dist/commands/interface/run.js +0 -215
  43. package/dist/commands/intuned-cli/commands/attempt.command.d.ts +0 -1
  44. package/dist/commands/intuned-cli/commands/attempt.command.js +0 -8
  45. package/dist/commands/intuned-cli/commands/attempt_api.command.d.ts +0 -1
  46. package/dist/commands/intuned-cli/commands/attempt_api.command.js +0 -30
  47. package/dist/commands/intuned-cli/commands/attempt_authsession.command.d.ts +0 -1
  48. package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +0 -8
  49. package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.d.ts +0 -1
  50. package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +0 -19
  51. package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.d.ts +0 -1
  52. package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +0 -24
  53. package/dist/commands/intuned-cli/commands/authsession.command.d.ts +0 -1
  54. package/dist/commands/intuned-cli/commands/authsession.command.js +0 -8
  55. package/dist/commands/intuned-cli/commands/authsession_record.command.d.ts +0 -1
  56. package/dist/commands/intuned-cli/commands/authsession_record.command.js +0 -32
  57. package/dist/commands/intuned-cli/commands/authsession_scaffold.command.d.ts +0 -1
  58. package/dist/commands/intuned-cli/commands/authsession_scaffold.command.js +0 -16
  59. package/dist/commands/intuned-cli/commands/build.command.d.ts +0 -1
  60. package/dist/commands/intuned-cli/commands/build.command.js +0 -12
  61. package/dist/commands/intuned-cli/commands/command.d.ts +0 -2
  62. package/dist/commands/intuned-cli/commands/command.js +0 -9
  63. package/dist/commands/intuned-cli/commands/deploy.command.d.ts +0 -1
  64. package/dist/commands/intuned-cli/commands/deploy.command.js +0 -42
  65. package/dist/commands/intuned-cli/commands/index.d.ts +0 -18
  66. package/dist/commands/intuned-cli/commands/index.js +0 -203
  67. package/dist/commands/intuned-cli/commands/provision.command.d.ts +0 -13
  68. package/dist/commands/intuned-cli/commands/provision.command.js +0 -50
  69. package/dist/commands/intuned-cli/commands/run.command.d.ts +0 -1
  70. package/dist/commands/intuned-cli/commands/run.command.js +0 -8
  71. package/dist/commands/intuned-cli/commands/run_api.command.d.ts +0 -1
  72. package/dist/commands/intuned-cli/commands/run_api.command.js +0 -46
  73. package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +0 -31
  74. package/dist/commands/intuned-cli/commands/run_authsession.command.js +0 -17
  75. package/dist/commands/intuned-cli/commands/run_authsession_create.command.d.ts +0 -1
  76. package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +0 -35
  77. package/dist/commands/intuned-cli/commands/run_authsession_update.command.d.ts +0 -1
  78. package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +0 -35
  79. package/dist/commands/intuned-cli/commands/run_authsession_validate.command.d.ts +0 -1
  80. package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +0 -33
  81. package/dist/commands/intuned-cli/commands/types.d.ts +0 -35
  82. package/dist/commands/intuned-cli/commands/types.js +0 -31
  83. package/dist/commands/intuned-cli/constants/index.d.ts +0 -17
  84. package/dist/commands/intuned-cli/constants/index.js +0 -25
  85. package/dist/commands/intuned-cli/controller/__test__/api.test.js +0 -398
  86. package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +0 -1060
  87. package/dist/commands/intuned-cli/controller/api.d.ts +0 -42
  88. package/dist/commands/intuned-cli/controller/api.js +0 -194
  89. package/dist/commands/intuned-cli/controller/authSession.d.ts +0 -209
  90. package/dist/commands/intuned-cli/controller/authSession.js +0 -424
  91. package/dist/commands/intuned-cli/controller/build.d.ts +0 -1
  92. package/dist/commands/intuned-cli/controller/build.js +0 -36
  93. package/dist/commands/intuned-cli/controller/deploy.d.ts +0 -5
  94. package/dist/commands/intuned-cli/controller/deploy.js +0 -318
  95. package/dist/commands/intuned-cli/controller/index.d.ts +0 -1
  96. package/dist/commands/intuned-cli/controller/index.js +0 -46
  97. package/dist/commands/intuned-cli/controller/provision.d.ts +0 -21
  98. package/dist/commands/intuned-cli/controller/provision.js +0 -300
  99. package/dist/commands/intuned-cli/controller/scaffold.d.ts +0 -1
  100. package/dist/commands/intuned-cli/controller/scaffold.js +0 -77
  101. package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +0 -115
  102. package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +0 -41
  103. package/dist/commands/intuned-cli/helpers/api.d.ts +0 -3
  104. package/dist/commands/intuned-cli/helpers/api.js +0 -16
  105. package/dist/commands/intuned-cli/helpers/auth.d.ts +0 -46
  106. package/dist/commands/intuned-cli/helpers/auth.js +0 -147
  107. package/dist/commands/intuned-cli/helpers/backend.d.ts +0 -8
  108. package/dist/commands/intuned-cli/helpers/backend.js +0 -35
  109. package/dist/commands/intuned-cli/helpers/browser.d.ts +0 -15
  110. package/dist/commands/intuned-cli/helpers/browser.js +0 -64
  111. package/dist/commands/intuned-cli/helpers/context.d.ts +0 -3
  112. package/dist/commands/intuned-cli/helpers/context.js +0 -33
  113. package/dist/commands/intuned-cli/helpers/errors.d.ts +0 -16
  114. package/dist/commands/intuned-cli/helpers/errors.js +0 -44
  115. package/dist/commands/intuned-cli/helpers/index.d.ts +0 -12
  116. package/dist/commands/intuned-cli/helpers/index.js +0 -137
  117. package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +0 -39
  118. package/dist/commands/intuned-cli/helpers/intunedJson.js +0 -20
  119. package/dist/commands/intuned-cli/helpers/prompts.d.ts +0 -3
  120. package/dist/commands/intuned-cli/helpers/prompts.js +0 -71
  121. package/dist/commands/intuned-cli/helpers/proxy.d.ts +0 -5
  122. package/dist/commands/intuned-cli/helpers/proxy.js +0 -23
  123. package/dist/commands/intuned-cli/helpers/terminal.d.ts +0 -5
  124. package/dist/commands/intuned-cli/helpers/terminal.js +0 -13
  125. package/dist/commands/intuned-cli/helpers/timeout.d.ts +0 -1
  126. package/dist/commands/intuned-cli/helpers/timeout.js +0 -23
  127. package/dist/commands/intuned-cli/helpers/traces.d.ts +0 -2
  128. package/dist/commands/intuned-cli/helpers/traces.js +0 -32
  129. package/dist/commands/intuned-cli/helpers/validation.d.ts +0 -2
  130. package/dist/commands/intuned-cli/helpers/validation.js +0 -14
  131. package/dist/commands/intuned-cli/helpers/wrapper.d.ts +0 -2
  132. package/dist/commands/intuned-cli/helpers/wrapper.js +0 -76
  133. package/dist/commands/intuned-cli/index.d.ts +0 -1
  134. package/dist/commands/intuned-cli/index.js +0 -16
  135. package/dist/commands/intuned-cli/main.d.ts +0 -1
  136. package/dist/commands/intuned-cli/main.js +0 -36
  137. package/dist/commands/intuned-cli/types.d.ts +0 -70
  138. package/dist/commands/intuned-cli/types.js +0 -22
  139. package/dist/commands/ts-check.d.ts +0 -2
  140. package/dist/commands/ts-check.js +0 -56
  141. package/dist/common/Logger/Logger/index.d.ts +0 -12
  142. package/dist/common/Logger/Logger/index.js +0 -60
  143. package/dist/common/Logger/Logger/types.d.ts +0 -8
  144. package/dist/common/Logger/Logger/types.js +0 -5
  145. package/dist/common/Logger/index.d.ts +0 -12
  146. package/dist/common/Logger/index.js +0 -60
  147. package/dist/common/Logger/types.d.ts +0 -8
  148. package/dist/common/Logger/types.js +0 -5
  149. package/dist/common/assets/browser_scripts.js +0 -2580
  150. package/dist/common/asyncLocalStorage/index.d.ts +0 -16
  151. package/dist/common/asyncLocalStorage/index.js +0 -17
  152. package/dist/common/backendFunctions/getAuthSessionParameters.d.ts +0 -1
  153. package/dist/common/backendFunctions/getAuthSessionParameters.js +0 -38
  154. package/dist/common/binStartupScript.d.ts +0 -1
  155. package/dist/common/binStartupScript.js +0 -37
  156. package/dist/common/cleanEnvironmentVariables.d.ts +0 -1
  157. package/dist/common/cleanEnvironmentVariables.js +0 -16
  158. package/dist/common/constants.d.ts +0 -10
  159. package/dist/common/constants.js +0 -16
  160. package/dist/common/contextStorageStateHelpers.d.ts +0 -21
  161. package/dist/common/contextStorageStateHelpers.js +0 -81
  162. package/dist/common/extension/extensionsHelpers.d.ts +0 -11
  163. package/dist/common/extension/extensionsHelpers.js +0 -147
  164. package/dist/common/extension/intunedExtensionServer.d.ts +0 -24
  165. package/dist/common/extension/intunedExtensionServer.js +0 -178
  166. package/dist/common/extension/types.d.ts +0 -212
  167. package/dist/common/extension/types.js +0 -51
  168. package/dist/common/formatZodError.d.ts +0 -2
  169. package/dist/common/formatZodError.js +0 -18
  170. package/dist/common/intunedJson.d.ts +0 -229
  171. package/dist/common/intunedJson.js +0 -133
  172. package/dist/common/jwtTokenManager.d.ts +0 -17
  173. package/dist/common/jwtTokenManager.js +0 -109
  174. package/dist/common/launchBrowser.d.ts +0 -33
  175. package/dist/common/launchBrowser.js +0 -235
  176. package/dist/common/playwrightContext.d.ts +0 -31
  177. package/dist/common/playwrightContext.js +0 -150
  178. package/dist/common/runApi/errors.d.ts +0 -72
  179. package/dist/common/runApi/errors.js +0 -169
  180. package/dist/common/runApi/importUsingImportFunction.d.ts +0 -9
  181. package/dist/common/runApi/importUsingImportFunction.js +0 -46
  182. package/dist/common/runApi/index.d.ts +0 -11
  183. package/dist/common/runApi/index.js +0 -203
  184. package/dist/common/runApi/types.d.ts +0 -830
  185. package/dist/common/runApi/types.js +0 -73
  186. package/dist/common/settingsSchema.d.ts +0 -533
  187. package/dist/common/settingsSchema.js +0 -58
  188. package/dist/common/setupContextHook.d.ts +0 -17
  189. package/dist/common/setupContextHook.js +0 -22
  190. package/dist/common/telemetry.d.ts +0 -3
  191. package/dist/common/telemetry.js +0 -32
  192. package/dist/index.d.ts +0 -5
  193. package/dist/index.js +0 -124
  194. package/dist/runtime/RunError.d.ts +0 -5
  195. package/dist/runtime/RunError.js +0 -19
  196. package/dist/runtime/attemptStore.d.ts +0 -2
  197. package/dist/runtime/attemptStore.js +0 -23
  198. package/dist/runtime/captcha.d.ts +0 -15
  199. package/dist/runtime/captcha.js +0 -191
  200. package/dist/runtime/captcha.test.js +0 -821
  201. package/dist/runtime/downloadDirectory.d.ts +0 -1
  202. package/dist/runtime/downloadDirectory.js +0 -19
  203. package/dist/runtime/enums.d.js +0 -5
  204. package/dist/runtime/enums.d.ts +0 -11
  205. package/dist/runtime/enums.js +0 -18
  206. package/dist/runtime/executionHelpers.test.js +0 -52
  207. package/dist/runtime/export.d.js +0 -5
  208. package/dist/runtime/export.d.ts +0 -284
  209. package/dist/runtime/extendPayload.d.ts +0 -2
  210. package/dist/runtime/extendPayload.js +0 -21
  211. package/dist/runtime/extendTimeout.d.ts +0 -1
  212. package/dist/runtime/extendTimeout.js +0 -23
  213. package/dist/runtime/getAiGatewayConfig.d.ts +0 -10
  214. package/dist/runtime/getAiGatewayConfig.js +0 -16
  215. package/dist/runtime/getAuthSessionParameters.d.ts +0 -1
  216. package/dist/runtime/getAuthSessionParameters.js +0 -20
  217. package/dist/runtime/index.d.ts +0 -10
  218. package/dist/runtime/index.js +0 -111
  219. package/dist/runtime/persistentStore.d.ts +0 -2
  220. package/dist/runtime/persistentStore.js +0 -37
  221. package/dist/runtime/persistentStore.test.js +0 -101
  222. package/dist/runtime/runInfo.d.ts +0 -2
  223. package/dist/runtime/runInfo.js +0 -21
  224. /package/InterfaceTemplate/{utils.ts → __utils.ts} +0 -0
@@ -1,212 +0,0 @@
1
- import { z } from "zod";
2
- export declare const captchaTypeSchema: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
3
- export type CaptchaType = z.infer<typeof captchaTypeSchema>;
4
- export declare const captchaStatusSchema: z.ZodEnum<["attached", "solving", "solved", "error", "detached"]>;
5
- export type CaptchaStatus = z.infer<typeof captchaStatusSchema>;
6
- export declare const captchaErrorCodeSchema: z.ZodEnum<["HIT_LIMIT", "MAX_RETRIES", "UNEXPECTED_SERVER_RESPONSE", "UNEXPECTED_ERROR"]>;
7
- export type CaptchaErrorCode = z.infer<typeof captchaErrorCodeSchema>;
8
- export declare const captchaErrorSchema: z.ZodObject<{
9
- code: z.ZodEnum<["HIT_LIMIT", "MAX_RETRIES", "UNEXPECTED_SERVER_RESPONSE", "UNEXPECTED_ERROR"]>;
10
- error: z.ZodOptional<z.ZodUnknown>;
11
- }, "strip", z.ZodTypeAny, {
12
- code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
13
- error?: unknown;
14
- }, {
15
- code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
16
- error?: unknown;
17
- }>;
18
- export type CaptchaError = z.infer<typeof captchaErrorSchema>;
19
- declare const captchaBaseSchema: z.ZodObject<{
20
- id: z.ZodString;
21
- tabId: z.ZodNumber;
22
- type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
23
- retryCount: z.ZodOptional<z.ZodNumber>;
24
- }, "strip", z.ZodTypeAny, {
25
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
26
- id: string;
27
- tabId: number;
28
- retryCount?: number | undefined;
29
- }, {
30
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
31
- id: string;
32
- tabId: number;
33
- retryCount?: number | undefined;
34
- }>;
35
- export type CaptchaBase = z.infer<typeof captchaBaseSchema>;
36
- declare const captchaNonErrorSchema: z.ZodObject<{
37
- type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
38
- id: z.ZodString;
39
- tabId: z.ZodNumber;
40
- retryCount: z.ZodOptional<z.ZodNumber>;
41
- status: z.ZodEnum<["attached", "solving", "solved", "detached"]>;
42
- }, "strip", z.ZodTypeAny, {
43
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
44
- status: "attached" | "solving" | "solved" | "detached";
45
- id: string;
46
- tabId: number;
47
- retryCount?: number | undefined;
48
- }, {
49
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
50
- status: "attached" | "solving" | "solved" | "detached";
51
- id: string;
52
- tabId: number;
53
- retryCount?: number | undefined;
54
- }>;
55
- export type CaptchaNonError = z.infer<typeof captchaNonErrorSchema>;
56
- declare const captchaErrorStatusSchema: z.ZodObject<{
57
- type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
58
- id: z.ZodString;
59
- tabId: z.ZodNumber;
60
- retryCount: z.ZodOptional<z.ZodNumber>;
61
- status: z.ZodLiteral<"error">;
62
- error: z.ZodObject<{
63
- code: z.ZodEnum<["HIT_LIMIT", "MAX_RETRIES", "UNEXPECTED_SERVER_RESPONSE", "UNEXPECTED_ERROR"]>;
64
- error: z.ZodOptional<z.ZodUnknown>;
65
- }, "strip", z.ZodTypeAny, {
66
- code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
67
- error?: unknown;
68
- }, {
69
- code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
70
- error?: unknown;
71
- }>;
72
- }, "strip", z.ZodTypeAny, {
73
- error: {
74
- code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
75
- error?: unknown;
76
- };
77
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
78
- status: "error";
79
- id: string;
80
- tabId: number;
81
- retryCount?: number | undefined;
82
- }, {
83
- error: {
84
- code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
85
- error?: unknown;
86
- };
87
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
88
- status: "error";
89
- id: string;
90
- tabId: number;
91
- retryCount?: number | undefined;
92
- }>;
93
- export type CaptchaErrorStatus = z.infer<typeof captchaErrorStatusSchema>;
94
- export declare const captchaSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
95
- type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
96
- id: z.ZodString;
97
- tabId: z.ZodNumber;
98
- retryCount: z.ZodOptional<z.ZodNumber>;
99
- status: z.ZodLiteral<"attached">;
100
- }, "strip", z.ZodTypeAny, {
101
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
102
- status: "attached";
103
- id: string;
104
- tabId: number;
105
- retryCount?: number | undefined;
106
- }, {
107
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
108
- status: "attached";
109
- id: string;
110
- tabId: number;
111
- retryCount?: number | undefined;
112
- }>, z.ZodObject<{
113
- type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
114
- id: z.ZodString;
115
- tabId: z.ZodNumber;
116
- retryCount: z.ZodOptional<z.ZodNumber>;
117
- status: z.ZodLiteral<"solving">;
118
- }, "strip", z.ZodTypeAny, {
119
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
120
- status: "solving";
121
- id: string;
122
- tabId: number;
123
- retryCount?: number | undefined;
124
- }, {
125
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
126
- status: "solving";
127
- id: string;
128
- tabId: number;
129
- retryCount?: number | undefined;
130
- }>, z.ZodObject<{
131
- type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
132
- id: z.ZodString;
133
- tabId: z.ZodNumber;
134
- retryCount: z.ZodOptional<z.ZodNumber>;
135
- status: z.ZodLiteral<"solved">;
136
- }, "strip", z.ZodTypeAny, {
137
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
138
- status: "solved";
139
- id: string;
140
- tabId: number;
141
- retryCount?: number | undefined;
142
- }, {
143
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
144
- status: "solved";
145
- id: string;
146
- tabId: number;
147
- retryCount?: number | undefined;
148
- }>, z.ZodObject<{
149
- type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
150
- id: z.ZodString;
151
- tabId: z.ZodNumber;
152
- retryCount: z.ZodOptional<z.ZodNumber>;
153
- status: z.ZodLiteral<"detached">;
154
- }, "strip", z.ZodTypeAny, {
155
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
156
- status: "detached";
157
- id: string;
158
- tabId: number;
159
- retryCount?: number | undefined;
160
- }, {
161
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
162
- status: "detached";
163
- id: string;
164
- tabId: number;
165
- retryCount?: number | undefined;
166
- }>, z.ZodObject<{
167
- type: z.ZodEnum<["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]>;
168
- id: z.ZodString;
169
- tabId: z.ZodNumber;
170
- retryCount: z.ZodOptional<z.ZodNumber>;
171
- status: z.ZodLiteral<"error">;
172
- error: z.ZodObject<{
173
- code: z.ZodEnum<["HIT_LIMIT", "MAX_RETRIES", "UNEXPECTED_SERVER_RESPONSE", "UNEXPECTED_ERROR"]>;
174
- error: z.ZodOptional<z.ZodUnknown>;
175
- }, "strip", z.ZodTypeAny, {
176
- code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
177
- error?: unknown;
178
- }, {
179
- code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
180
- error?: unknown;
181
- }>;
182
- }, "strip", z.ZodTypeAny, {
183
- error: {
184
- code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
185
- error?: unknown;
186
- };
187
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
188
- status: "error";
189
- id: string;
190
- tabId: number;
191
- retryCount?: number | undefined;
192
- }, {
193
- error: {
194
- code: "HIT_LIMIT" | "MAX_RETRIES" | "UNEXPECTED_SERVER_RESPONSE" | "UNEXPECTED_ERROR";
195
- error?: unknown;
196
- };
197
- type: "aws" | "cloudflare" | "customcaptcha" | "funcaptcha" | "geetest" | "hcaptcha" | "lemincaptcha" | "recaptcha" | "textcaptcha";
198
- status: "error";
199
- id: string;
200
- tabId: number;
201
- retryCount?: number | undefined;
202
- }>]>;
203
- export type Captcha = z.infer<typeof captchaSchema>;
204
- export type CaptchaCallback = (captcha: Captcha) => Promise<void> | void;
205
- export declare class CaptchaSolveError extends Error {
206
- error: CaptchaError;
207
- constructor(message: string, error: CaptchaError);
208
- }
209
- export declare class TimeoutError extends Error {
210
- constructor(message: string);
211
- }
212
- export {};
@@ -1,51 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.captchaTypeSchema = exports.captchaStatusSchema = exports.captchaSchema = exports.captchaErrorSchema = exports.captchaErrorCodeSchema = exports.TimeoutError = exports.CaptchaSolveError = void 0;
7
- var _zod = require("zod");
8
- const captchaTypeSchema = exports.captchaTypeSchema = _zod.z.enum(["aws", "cloudflare", "customcaptcha", "funcaptcha", "geetest", "hcaptcha", "lemincaptcha", "recaptcha", "textcaptcha"]);
9
- const captchaStatusSchema = exports.captchaStatusSchema = _zod.z.enum(["attached", "solving", "solved", "error", "detached"]);
10
- const captchaErrorCodeSchema = exports.captchaErrorCodeSchema = _zod.z.enum(["HIT_LIMIT", "MAX_RETRIES", "UNEXPECTED_SERVER_RESPONSE", "UNEXPECTED_ERROR"]);
11
- const captchaErrorSchema = exports.captchaErrorSchema = _zod.z.object({
12
- code: captchaErrorCodeSchema,
13
- error: _zod.z.unknown().optional()
14
- });
15
- const captchaBaseSchema = _zod.z.object({
16
- id: _zod.z.string().min(1),
17
- tabId: _zod.z.number().int().positive(),
18
- type: captchaTypeSchema,
19
- retryCount: _zod.z.number().int().nonnegative().optional()
20
- });
21
- const captchaNonErrorSchema = captchaBaseSchema.extend({
22
- status: captchaStatusSchema.exclude(["error"])
23
- });
24
- const captchaErrorStatusSchema = captchaBaseSchema.extend({
25
- status: _zod.z.literal("error"),
26
- error: captchaErrorSchema
27
- });
28
- const captchaSchema = exports.captchaSchema = _zod.z.discriminatedUnion("status", [captchaBaseSchema.extend({
29
- status: _zod.z.literal("attached")
30
- }), captchaBaseSchema.extend({
31
- status: _zod.z.literal("solving")
32
- }), captchaBaseSchema.extend({
33
- status: _zod.z.literal("solved")
34
- }), captchaBaseSchema.extend({
35
- status: _zod.z.literal("detached")
36
- }), captchaErrorStatusSchema]);
37
- class CaptchaSolveError extends Error {
38
- constructor(message, error) {
39
- super(message);
40
- this.error = error;
41
- this.name = "CaptchaSolveError";
42
- }
43
- }
44
- exports.CaptchaSolveError = CaptchaSolveError;
45
- class TimeoutError extends Error {
46
- constructor(message) {
47
- super(message);
48
- this.name = "TimeoutError";
49
- }
50
- }
51
- exports.TimeoutError = TimeoutError;
@@ -1,2 +0,0 @@
1
- import { ZodError } from "zod";
2
- export declare function formatZodError(zodError: ZodError): string[];
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.formatZodError = formatZodError;
7
- function formatZodError(zodError) {
8
- const formattedErrors = zodError.errors.map(error => {
9
- const path = error.path.map(segment => {
10
- return typeof segment === "number" ? `[${segment}]` : segment;
11
- }).join(".");
12
- if (path) {
13
- return `${path} is invalid - ${error.message}`;
14
- }
15
- return error.message;
16
- });
17
- return formattedErrors;
18
- }
@@ -1,229 +0,0 @@
1
- import { z } from "zod";
2
- import { type Err, type Ok } from "neverthrow";
3
- export declare const intunedJsonSchema: z.ZodIntersection<z.ZodObject<{
4
- projectName: z.ZodOptional<z.ZodString>;
5
- workspaceId: z.ZodOptional<z.ZodString>;
6
- metadata: z.ZodCatch<z.ZodOptional<z.ZodObject<{
7
- defaultJobInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
8
- defaultRunPlaygroundInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
9
- testAuthSessionInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
10
- }, "strip", z.ZodTypeAny, {
11
- defaultJobInput?: Record<string, any> | undefined;
12
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
13
- testAuthSessionInput?: Record<string, any> | undefined;
14
- }, {
15
- defaultJobInput?: unknown;
16
- defaultRunPlaygroundInput?: unknown;
17
- testAuthSessionInput?: unknown;
18
- }>>>;
19
- stealthMode: z.ZodCatch<z.ZodOptional<z.ZodObject<{
20
- enabled: z.ZodBoolean;
21
- }, "strip", z.ZodTypeAny, {
22
- enabled: boolean;
23
- }, {
24
- enabled: boolean;
25
- }>>>;
26
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
27
- projectName: z.ZodOptional<z.ZodString>;
28
- workspaceId: z.ZodOptional<z.ZodString>;
29
- metadata: z.ZodCatch<z.ZodOptional<z.ZodObject<{
30
- defaultJobInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
31
- defaultRunPlaygroundInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
32
- testAuthSessionInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
33
- }, "strip", z.ZodTypeAny, {
34
- defaultJobInput?: Record<string, any> | undefined;
35
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
36
- testAuthSessionInput?: Record<string, any> | undefined;
37
- }, {
38
- defaultJobInput?: unknown;
39
- defaultRunPlaygroundInput?: unknown;
40
- testAuthSessionInput?: unknown;
41
- }>>>;
42
- stealthMode: z.ZodCatch<z.ZodOptional<z.ZodObject<{
43
- enabled: z.ZodBoolean;
44
- }, "strip", z.ZodTypeAny, {
45
- enabled: boolean;
46
- }, {
47
- enabled: boolean;
48
- }>>>;
49
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
50
- projectName: z.ZodOptional<z.ZodString>;
51
- workspaceId: z.ZodOptional<z.ZodString>;
52
- metadata: z.ZodCatch<z.ZodOptional<z.ZodObject<{
53
- defaultJobInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
54
- defaultRunPlaygroundInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
55
- testAuthSessionInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
56
- }, "strip", z.ZodTypeAny, {
57
- defaultJobInput?: Record<string, any> | undefined;
58
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
59
- testAuthSessionInput?: Record<string, any> | undefined;
60
- }, {
61
- defaultJobInput?: unknown;
62
- defaultRunPlaygroundInput?: unknown;
63
- testAuthSessionInput?: unknown;
64
- }>>>;
65
- stealthMode: z.ZodCatch<z.ZodOptional<z.ZodObject<{
66
- enabled: z.ZodBoolean;
67
- }, "strip", z.ZodTypeAny, {
68
- enabled: boolean;
69
- }, {
70
- enabled: boolean;
71
- }>>>;
72
- }, z.ZodTypeAny, "passthrough">>, z.ZodUnion<[z.ZodObject<{
73
- authSessions: z.ZodObject<{
74
- enabled: z.ZodLiteral<false>;
75
- }, "strip", z.ZodTypeAny, {
76
- enabled: false;
77
- }, {
78
- enabled: false;
79
- }>;
80
- apiAccess: z.ZodObject<{
81
- enabled: z.ZodLiteral<false>;
82
- }, "strip", z.ZodTypeAny, {
83
- enabled: false;
84
- }, {
85
- enabled: false;
86
- }>;
87
- }, "strip", z.ZodTypeAny, {
88
- authSessions: {
89
- enabled: false;
90
- };
91
- apiAccess: {
92
- enabled: false;
93
- };
94
- }, {
95
- authSessions: {
96
- enabled: false;
97
- };
98
- apiAccess: {
99
- enabled: false;
100
- };
101
- }>, z.ZodObject<{
102
- authSessions: z.ZodUnion<[z.ZodObject<{
103
- enabled: z.ZodLiteral<false>;
104
- }, "strip", z.ZodTypeAny, {
105
- enabled: false;
106
- }, {
107
- enabled: false;
108
- }>, z.ZodObject<{
109
- enabled: z.ZodLiteral<true>;
110
- type: z.ZodEnum<["MANUAL", "API"]>;
111
- startUrl: z.ZodOptional<z.ZodString>;
112
- finishUrl: z.ZodOptional<z.ZodString>;
113
- }, "strip", z.ZodTypeAny, {
114
- type: "API" | "MANUAL";
115
- enabled: true;
116
- startUrl?: string | undefined;
117
- finishUrl?: string | undefined;
118
- }, {
119
- type: "API" | "MANUAL";
120
- enabled: true;
121
- startUrl?: string | undefined;
122
- finishUrl?: string | undefined;
123
- }>]>;
124
- apiAccess: z.ZodObject<{
125
- enabled: z.ZodLiteral<true>;
126
- }, "strip", z.ZodTypeAny, {
127
- enabled: true;
128
- }, {
129
- enabled: true;
130
- }>;
131
- }, "strip", z.ZodTypeAny, {
132
- authSessions: {
133
- enabled: false;
134
- } | {
135
- type: "API" | "MANUAL";
136
- enabled: true;
137
- startUrl?: string | undefined;
138
- finishUrl?: string | undefined;
139
- };
140
- apiAccess: {
141
- enabled: true;
142
- };
143
- }, {
144
- authSessions: {
145
- enabled: false;
146
- } | {
147
- type: "API" | "MANUAL";
148
- enabled: true;
149
- startUrl?: string | undefined;
150
- finishUrl?: string | undefined;
151
- };
152
- apiAccess: {
153
- enabled: true;
154
- };
155
- }>]>>;
156
- export type IntunedJson = z.infer<typeof intunedJsonSchema>;
157
- export declare const intunedSettingsFileNames: readonly ["Intuned.json", "Intuned.jsonc", "Intuned.yaml", "Intuned.yml", "Intuned.toml"];
158
- export declare function loadIntunedJson(): Promise<Err<never, string> | Ok<{
159
- projectName?: string | undefined;
160
- workspaceId?: string | undefined;
161
- metadata?: {
162
- defaultJobInput?: Record<string, any> | undefined;
163
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
164
- testAuthSessionInput?: Record<string, any> | undefined;
165
- } | undefined;
166
- stealthMode?: {
167
- enabled: boolean;
168
- } | undefined;
169
- } & {
170
- [k: string]: unknown;
171
- } & ({
172
- authSessions: {
173
- enabled: false;
174
- };
175
- apiAccess: {
176
- enabled: false;
177
- };
178
- } | {
179
- authSessions: {
180
- enabled: false;
181
- } | {
182
- type: "API" | "MANUAL";
183
- enabled: true;
184
- startUrl?: string | undefined;
185
- finishUrl?: string | undefined;
186
- };
187
- apiAccess: {
188
- enabled: true;
189
- };
190
- }), never>>;
191
- export declare function getIntunedSettingsFile(): Promise<Ok<{
192
- name: typeof intunedSettingsFileNames[number];
193
- path: string;
194
- parse: (content: string) => any;
195
- }, never> | Err<never, string>>;
196
- export declare function getIntunedSettingsFileName(): Promise<Err<never, string> | Ok<"Intuned.json" | "Intuned.jsonc" | "Intuned.yaml" | "Intuned.yml" | "Intuned.toml", never>>;
197
- export declare function loadIntunedJsonSync(): Err<never, string> | Ok<{
198
- projectName?: string | undefined;
199
- workspaceId?: string | undefined;
200
- metadata?: {
201
- defaultJobInput?: Record<string, any> | undefined;
202
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
203
- testAuthSessionInput?: Record<string, any> | undefined;
204
- } | undefined;
205
- stealthMode?: {
206
- enabled: boolean;
207
- } | undefined;
208
- } & {
209
- [k: string]: unknown;
210
- } & ({
211
- authSessions: {
212
- enabled: false;
213
- };
214
- apiAccess: {
215
- enabled: false;
216
- };
217
- } | {
218
- authSessions: {
219
- enabled: false;
220
- } | {
221
- type: "API" | "MANUAL";
222
- enabled: true;
223
- startUrl?: string | undefined;
224
- finishUrl?: string | undefined;
225
- };
226
- apiAccess: {
227
- enabled: true;
228
- };
229
- }), never>;
@@ -1,133 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getIntunedSettingsFile = getIntunedSettingsFile;
7
- exports.getIntunedSettingsFileName = getIntunedSettingsFileName;
8
- exports.intunedSettingsFileNames = exports.intunedJsonSchema = void 0;
9
- exports.loadIntunedJson = loadIntunedJson;
10
- exports.loadIntunedJsonSync = loadIntunedJsonSync;
11
- var _path = _interopRequireDefault(require("path"));
12
- var fs = _interopRequireWildcard(require("fs-extra"));
13
- var _zod = require("zod");
14
- var JSONC = _interopRequireWildcard(require("jsonc-parser"));
15
- var YAML = _interopRequireWildcard(require("yaml"));
16
- var TOML = _interopRequireWildcard(require("smol-toml"));
17
- var _neverthrow = require("neverthrow");
18
- var _formatZodError = require("./formatZodError");
19
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
20
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
21
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
22
- const playwright = undefined;
23
- const intunedJsonSchema = exports.intunedJsonSchema = _zod.z.object({
24
- projectName: _zod.z.string().optional(),
25
- workspaceId: _zod.z.string().optional(),
26
- metadata: _zod.z.object({
27
- defaultJobInput: _zod.z.record(_zod.z.any()).optional().catch(undefined),
28
- defaultRunPlaygroundInput: _zod.z.record(_zod.z.any()).optional().catch(undefined),
29
- testAuthSessionInput: _zod.z.record(_zod.z.any()).optional().catch(undefined)
30
- }).optional().catch(undefined),
31
- stealthMode: _zod.z.object({
32
- enabled: _zod.z.boolean()
33
- }).optional().catch(undefined)
34
- }).passthrough().and(_zod.z.union([_zod.z.object({
35
- authSessions: _zod.z.object({
36
- enabled: _zod.z.literal(false)
37
- }),
38
- apiAccess: _zod.z.object({
39
- enabled: _zod.z.literal(false)
40
- })
41
- }), _zod.z.object({
42
- authSessions: _zod.z.union([_zod.z.object({
43
- enabled: _zod.z.literal(false)
44
- }), _zod.z.object({
45
- enabled: _zod.z.literal(true),
46
- type: _zod.z.enum(["MANUAL", "API"]),
47
- startUrl: _zod.z.string().optional(),
48
- finishUrl: _zod.z.string().optional()
49
- })]),
50
- apiAccess: _zod.z.object({
51
- enabled: _zod.z.literal(true)
52
- })
53
- })]));
54
- const intunedSettingsFileNames = exports.intunedSettingsFileNames = ["Intuned.json", "Intuned.jsonc", "Intuned.yaml", "Intuned.yml", "Intuned.toml"];
55
- async function loadIntunedJson() {
56
- const settingsFileResult = await getIntunedSettingsFile();
57
- if (!settingsFileResult.isOk()) {
58
- return settingsFileResult;
59
- }
60
- const settingsFile = settingsFileResult.value;
61
- const intunedJsonContent = await fs.readFile(settingsFile.path, "utf-8");
62
- let intunedJson;
63
- try {
64
- intunedJson = settingsFile.parse(intunedJsonContent);
65
- } catch (e) {
66
- return (0, _neverthrow.err)(`Failed to parse ${settingsFile.name}: ${e.message}`);
67
- }
68
- const parseResult = intunedJsonSchema.safeParse(intunedJson);
69
- if (!parseResult.success) {
70
- return (0, _neverthrow.err)(`${settingsFile.name} is not valid:\n${(0, _formatZodError.formatZodError)(parseResult.error)}\nPlease fix the errors and try again.`);
71
- }
72
- return (0, _neverthrow.ok)(parseResult.data);
73
- }
74
- const intunedSettingsParsers = {
75
- "Intuned.json": JSON.parse,
76
- "Intuned.jsonc": JSONC.parse,
77
- "Intuned.yaml": YAML.parse,
78
- "Intuned.yml": YAML.parse,
79
- "Intuned.toml": TOML.parse
80
- };
81
- async function getIntunedSettingsFile() {
82
- for (const fileName of intunedSettingsFileNames) {
83
- const filePath = _path.default.join(process.cwd(), fileName);
84
- if (await fs.exists(filePath)) {
85
- return (0, _neverthrow.ok)({
86
- name: fileName,
87
- path: filePath,
88
- parse: intunedSettingsParsers[fileName]
89
- });
90
- }
91
- }
92
- return (0, _neverthrow.err)("No Intuned settings file found.");
93
- }
94
- async function getIntunedSettingsFileName() {
95
- const settingsFileResult = await getIntunedSettingsFile();
96
- if (!settingsFileResult.isOk()) {
97
- return settingsFileResult;
98
- }
99
- return (0, _neverthrow.ok)(settingsFileResult.value.name);
100
- }
101
- function loadIntunedJsonSync() {
102
- const settingsFileResult = getIntunedSettingsFileSync();
103
- if (!settingsFileResult.isOk()) {
104
- return settingsFileResult;
105
- }
106
- const settingsFile = settingsFileResult.value;
107
- const intunedJsonContent = fs.readFileSync(settingsFile.path, "utf-8");
108
- let intunedJson;
109
- try {
110
- intunedJson = settingsFile.parse(intunedJsonContent);
111
- } catch (e) {
112
- return (0, _neverthrow.err)(`Failed to parse ${settingsFile.name}: ${e.message}`);
113
- }
114
- const parseResult = intunedJsonSchema.safeParse(intunedJson);
115
- if (!parseResult.success) {
116
- const formattedError = parseResult.error.errors.map(e => `- ${e.path.join(".")}: ${e.message}`).join("\n");
117
- return (0, _neverthrow.err)(`${settingsFile.name} is not valid:\n${formattedError}\nPlease fix the errors and try again.`);
118
- }
119
- return (0, _neverthrow.ok)(parseResult.data);
120
- }
121
- function getIntunedSettingsFileSync() {
122
- for (const fileName of intunedSettingsFileNames) {
123
- const filePath = _path.default.join(process.cwd(), fileName);
124
- if (fs.existsSync(filePath)) {
125
- return (0, _neverthrow.ok)({
126
- name: fileName,
127
- path: filePath,
128
- parse: intunedSettingsParsers[fileName]
129
- });
130
- }
131
- }
132
- return (0, _neverthrow.err)("No Intuned settings file found.");
133
- }
@@ -1,17 +0,0 @@
1
- import fetch from "cross-fetch";
2
- declare class JwtTokenManager {
3
- private _token;
4
- private tokenRefreshTimeout;
5
- private refreshTokenPath;
6
- constructor(refreshTokenPath: string);
7
- get token(): string | undefined;
8
- set token(newToken: string | undefined);
9
- private get timeToRefresh();
10
- private scheduleTokenRefresh;
11
- private refreshToken;
12
- fetchWithToken(...[input, init]: Parameters<typeof fetch>): Promise<Response>;
13
- get backendFunctionsBaseUrl(): string | undefined;
14
- }
15
- export declare const backendFunctionsTokenManager: JwtTokenManager;
16
- export declare function callBackendFunctionWithToken(path: string, init?: Parameters<typeof fetch>[1]): Promise<Response>;
17
- export {};