@intuned/runtime-dev 1.3.19-new-cli.0 → 1.3.21-fix.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 (100) hide show
  1. package/bin/intuned +2 -20
  2. package/dist/commands/api/run.js +1 -1
  3. package/dist/commands/intuned-cli/commands/attempt.command.d.ts +1 -0
  4. package/dist/commands/intuned-cli/commands/attempt.command.js +8 -0
  5. package/dist/commands/intuned-cli/commands/attempt_api.command.d.ts +1 -0
  6. package/dist/commands/intuned-cli/commands/attempt_api.command.js +30 -0
  7. package/dist/commands/intuned-cli/commands/attempt_authsession.command.d.ts +1 -0
  8. package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +8 -0
  9. package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.d.ts +1 -0
  10. package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +19 -0
  11. package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.d.ts +1 -0
  12. package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +24 -0
  13. package/dist/commands/intuned-cli/commands/authsession.command.d.ts +1 -0
  14. package/dist/commands/intuned-cli/commands/authsession.command.js +8 -0
  15. package/dist/commands/intuned-cli/commands/authsession_record.command.d.ts +1 -0
  16. package/dist/commands/intuned-cli/commands/authsession_record.command.js +32 -0
  17. package/dist/commands/intuned-cli/commands/authsession_scaffold.command.d.ts +1 -0
  18. package/dist/commands/intuned-cli/commands/authsession_scaffold.command.js +16 -0
  19. package/dist/commands/intuned-cli/commands/build.command.d.ts +1 -0
  20. package/dist/commands/intuned-cli/commands/build.command.js +12 -0
  21. package/dist/commands/intuned-cli/commands/command.d.ts +2 -0
  22. package/dist/commands/intuned-cli/commands/command.js +9 -0
  23. package/dist/commands/intuned-cli/commands/deploy.command.d.ts +1 -0
  24. package/dist/commands/intuned-cli/commands/deploy.command.js +42 -0
  25. package/dist/commands/intuned-cli/commands/index.d.ts +18 -0
  26. package/dist/commands/intuned-cli/commands/index.js +203 -0
  27. package/dist/commands/intuned-cli/commands/provision.command.d.ts +13 -0
  28. package/dist/commands/intuned-cli/commands/provision.command.js +50 -0
  29. package/dist/commands/intuned-cli/commands/run.command.d.ts +1 -0
  30. package/dist/commands/intuned-cli/commands/run.command.js +8 -0
  31. package/dist/commands/intuned-cli/commands/run_api.command.d.ts +1 -0
  32. package/dist/commands/intuned-cli/commands/run_api.command.js +46 -0
  33. package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +35 -0
  34. package/dist/commands/intuned-cli/commands/run_authsession.command.js +17 -0
  35. package/dist/commands/intuned-cli/commands/run_authsession_create.command.d.ts +1 -0
  36. package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +35 -0
  37. package/dist/commands/intuned-cli/commands/run_authsession_update.command.d.ts +1 -0
  38. package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +35 -0
  39. package/dist/commands/intuned-cli/commands/run_authsession_validate.command.d.ts +1 -0
  40. package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +33 -0
  41. package/dist/commands/intuned-cli/commands/types.d.ts +39 -0
  42. package/dist/commands/intuned-cli/commands/types.js +33 -0
  43. package/dist/commands/intuned-cli/constants/index.d.ts +17 -0
  44. package/dist/commands/intuned-cli/constants/index.js +25 -0
  45. package/dist/commands/intuned-cli/controller/__test__/api.test.js +399 -0
  46. package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +1061 -0
  47. package/dist/commands/intuned-cli/controller/api.d.ts +42 -0
  48. package/dist/commands/intuned-cli/controller/api.js +194 -0
  49. package/dist/commands/intuned-cli/controller/authSession.d.ts +209 -0
  50. package/dist/commands/intuned-cli/controller/authSession.js +425 -0
  51. package/dist/commands/intuned-cli/controller/build.d.ts +1 -0
  52. package/dist/commands/intuned-cli/controller/build.js +35 -0
  53. package/dist/commands/intuned-cli/controller/deploy.d.ts +5 -0
  54. package/dist/commands/intuned-cli/controller/deploy.js +317 -0
  55. package/dist/commands/intuned-cli/controller/index.d.ts +1 -0
  56. package/dist/commands/intuned-cli/controller/index.js +45 -0
  57. package/dist/commands/intuned-cli/controller/provision.d.ts +21 -0
  58. package/dist/commands/intuned-cli/controller/provision.js +299 -0
  59. package/dist/commands/intuned-cli/controller/scaffold.d.ts +1 -0
  60. package/dist/commands/intuned-cli/controller/scaffold.js +77 -0
  61. package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +152 -0
  62. package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +41 -0
  63. package/dist/commands/intuned-cli/helpers/api.d.ts +3 -0
  64. package/dist/commands/intuned-cli/helpers/api.js +16 -0
  65. package/dist/commands/intuned-cli/helpers/auth.d.ts +46 -0
  66. package/dist/commands/intuned-cli/helpers/auth.js +147 -0
  67. package/dist/commands/intuned-cli/helpers/backend.d.ts +8 -0
  68. package/dist/commands/intuned-cli/helpers/backend.js +35 -0
  69. package/dist/commands/intuned-cli/helpers/browser.d.ts +14 -0
  70. package/dist/commands/intuned-cli/helpers/browser.js +93 -0
  71. package/dist/commands/intuned-cli/helpers/context.d.ts +3 -0
  72. package/dist/commands/intuned-cli/helpers/context.js +33 -0
  73. package/dist/commands/intuned-cli/helpers/errors.d.ts +16 -0
  74. package/dist/commands/intuned-cli/helpers/errors.js +44 -0
  75. package/dist/commands/intuned-cli/helpers/index.d.ts +12 -0
  76. package/dist/commands/intuned-cli/helpers/index.js +137 -0
  77. package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +40 -0
  78. package/dist/commands/intuned-cli/helpers/intunedJson.js +20 -0
  79. package/dist/commands/intuned-cli/helpers/prompts.d.ts +3 -0
  80. package/dist/commands/intuned-cli/helpers/prompts.js +71 -0
  81. package/dist/commands/intuned-cli/helpers/proxy.d.ts +5 -0
  82. package/dist/commands/intuned-cli/helpers/proxy.js +23 -0
  83. package/dist/commands/intuned-cli/helpers/terminal.d.ts +5 -0
  84. package/dist/commands/intuned-cli/helpers/terminal.js +13 -0
  85. package/dist/commands/intuned-cli/helpers/timeout.d.ts +1 -0
  86. package/dist/commands/intuned-cli/helpers/timeout.js +23 -0
  87. package/dist/commands/intuned-cli/helpers/traces.d.ts +2 -0
  88. package/dist/commands/intuned-cli/helpers/traces.js +32 -0
  89. package/dist/commands/intuned-cli/helpers/validation.d.ts +2 -0
  90. package/dist/commands/intuned-cli/helpers/validation.js +14 -0
  91. package/dist/commands/intuned-cli/helpers/wrapper.d.ts +2 -0
  92. package/dist/commands/intuned-cli/helpers/wrapper.js +76 -0
  93. package/dist/commands/intuned-cli/index.d.ts +1 -0
  94. package/dist/commands/intuned-cli/index.js +16 -0
  95. package/dist/commands/intuned-cli/main.d.ts +1 -0
  96. package/dist/commands/intuned-cli/main.js +35 -0
  97. package/dist/commands/intuned-cli/types.d.ts +70 -0
  98. package/dist/commands/intuned-cli/types.js +22 -0
  99. package/dist/vendor/runtime-interface.js +30 -14
  100. package/package.json +2 -2
@@ -0,0 +1,70 @@
1
+ import { z } from "zod";
2
+ declare const fileNodeSchema: z.ZodObject<{
3
+ file: z.ZodObject<{
4
+ contents: z.ZodUnion<[z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ contents: string | Uint8Array;
7
+ }, {
8
+ contents: string | Uint8Array;
9
+ }>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ file: {
12
+ contents: string | Uint8Array;
13
+ };
14
+ }, {
15
+ file: {
16
+ contents: string | Uint8Array;
17
+ };
18
+ }>;
19
+ export type FileNode = z.infer<typeof fileNodeSchema>;
20
+ export type DirectoryNode = {
21
+ directory: {
22
+ [key: string]: FileNode | DirectoryNode;
23
+ };
24
+ };
25
+ export declare const fileSystemTreeSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodType<DirectoryNode, z.ZodTypeDef, DirectoryNode>, z.ZodObject<{
26
+ file: z.ZodObject<{
27
+ contents: z.ZodUnion<[z.ZodString, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ contents: string | Uint8Array;
30
+ }, {
31
+ contents: string | Uint8Array;
32
+ }>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ file: {
35
+ contents: string | Uint8Array;
36
+ };
37
+ }, {
38
+ file: {
39
+ contents: string | Uint8Array;
40
+ };
41
+ }>]>>;
42
+ export type FileSystemTree = z.infer<typeof fileSystemTreeSchema>;
43
+ export interface AuthCredentials {
44
+ workspaceId: string;
45
+ apiKey: string;
46
+ }
47
+ export declare enum ApiAuthSessionBehavior {
48
+ PERFORM_CHECK_AND_REFRESH = "PERFORM_CHECK_AND_REFRESH",
49
+ SKIP_CHECK_AND_REFRESH = "SKIP_CHECK_AND_REFRESH"
50
+ }
51
+ export declare const CHECK_FAILED_ERROR_MESSAGE = "AuthSession check failed";
52
+ export type AuthSessionType = "API" | "MANUAL";
53
+ export type AuthSessionMetadata = {
54
+ createdAt: string;
55
+ updatedAt: string;
56
+ authSessionId: string;
57
+ authSessionType: AuthSessionType;
58
+ authSessionInput?: Record<string, any>;
59
+ authSessionProxy?: string;
60
+ recorderStartUrl?: string;
61
+ recorderEndUrl?: string;
62
+ };
63
+ export interface SessionStorageState {
64
+ origin: string;
65
+ sessionStorage: {
66
+ name: string;
67
+ value: string;
68
+ }[];
69
+ }
70
+ export {};
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fileSystemTreeSchema = exports.CHECK_FAILED_ERROR_MESSAGE = exports.ApiAuthSessionBehavior = void 0;
7
+ var _zod = require("zod");
8
+ const fileNodeSchema = _zod.z.object({
9
+ file: _zod.z.object({
10
+ contents: _zod.z.union([_zod.z.string(), _zod.z.instanceof(Uint8Array)])
11
+ })
12
+ });
13
+ const directoryNodeSchema = _zod.z.lazy(() => _zod.z.object({
14
+ directory: fileSystemTreeSchema
15
+ }));
16
+ const fileSystemTreeSchema = exports.fileSystemTreeSchema = _zod.z.record(_zod.z.union([directoryNodeSchema, fileNodeSchema]));
17
+ let ApiAuthSessionBehavior = exports.ApiAuthSessionBehavior = function (ApiAuthSessionBehavior) {
18
+ ApiAuthSessionBehavior["PERFORM_CHECK_AND_REFRESH"] = "PERFORM_CHECK_AND_REFRESH";
19
+ ApiAuthSessionBehavior["SKIP_CHECK_AND_REFRESH"] = "SKIP_CHECK_AND_REFRESH";
20
+ return ApiAuthSessionBehavior;
21
+ }({});
22
+ const CHECK_FAILED_ERROR_MESSAGE = exports.CHECK_FAILED_ERROR_MESSAGE = "AuthSession check failed";
@@ -126,6 +126,7 @@ var require_errors = __commonJS({
126
126
  var AutomationError = class extends RunAutomationError {
127
127
  constructor(error) {
128
128
  super(exports2.automationError, `[${error?.name ?? error}] ${error?.message}`);
129
+ this.error = error;
129
130
  this.details = {
130
131
  ...error,
131
132
  name: error?.name,
@@ -260,7 +261,6 @@ var require_types = __commonJS({
260
261
  jobId: zod_1.default.string().optional(),
261
262
  jobRunId: zod_1.default.string().optional(),
262
263
  runId: zod_1.default.string().optional(),
263
- queueId: zod_1.default.string().optional(),
264
264
  authSessionId: zod_1.default.string().optional()
265
265
  }).optional()
266
266
  });
@@ -327,19 +327,29 @@ var require_interfaceClient = __commonJS({
327
327
  }) : function(o, v) {
328
328
  o["default"] = v;
329
329
  });
330
- var __importStar = exports2 && exports2.__importStar || function(mod) {
331
- if (mod && mod.__esModule) return mod;
332
- var result = {};
333
- if (mod != null) {
334
- for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
335
- }
336
- __setModuleDefault(result, mod);
337
- return result;
338
- };
330
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
331
+ var ownKeys = function(o) {
332
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
333
+ var ar = [];
334
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
335
+ return ar;
336
+ };
337
+ return ownKeys(o);
338
+ };
339
+ return function(mod) {
340
+ if (mod && mod.__esModule) return mod;
341
+ var result = {};
342
+ if (mod != null) {
343
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
344
+ }
345
+ __setModuleDefault(result, mod);
346
+ return result;
347
+ };
348
+ })();
339
349
  Object.defineProperty(exports2, "__esModule", { value: true });
340
350
  exports2.JSONLFileClient = exports2.TCPSocketClient = exports2.UnixSocketClient = exports2.SocketClient = void 0;
341
- var net = __importStar(require("net"));
342
351
  var fs = __importStar(require("fs-extra"));
352
+ var net = __importStar(require("net"));
343
353
  var readline_1 = require("readline");
344
354
  var promises_1 = require("timers/promises");
345
355
  var SocketClient = class _SocketClient {
@@ -375,7 +385,13 @@ var require_interfaceClient = __commonJS({
375
385
  if (!(chunk instanceof Buffer)) {
376
386
  break;
377
387
  }
378
- buffer = Buffer.concat([buffer, chunk]);
388
+ buffer = Buffer.concat([
389
+ buffer,
390
+ chunk
391
+ ]);
392
+ if (buffer.length < _SocketClient.LENGTH_HEADER_LENGTH) {
393
+ continue;
394
+ }
379
395
  const length = buffer.readUInt32BE(0);
380
396
  if (buffer.length < length + _SocketClient.LENGTH_HEADER_LENGTH) {
381
397
  continue;
@@ -433,8 +449,8 @@ var require_interfaceClient = __commonJS({
433
449
  async close() {
434
450
  this.fileStream.close();
435
451
  await Promise.race([
436
- new Promise((resolve) => this.fileStream.once("close", resolve)),
437
- new Promise((resolve) => this.fileStream.once("error", resolve)),
452
+ new Promise((resolve) => this.fileStream.once("close", () => resolve(void 0))),
453
+ new Promise((resolve) => this.fileStream.once("error", () => resolve(void 0))),
438
454
  (0, promises_1.setTimeout)(3e3)
439
455
  ]);
440
456
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.3.19-new-cli.0",
3
+ "version": "1.3.21-fix.0",
4
4
  "description": "Intuned runtime",
5
5
  "packageManager": "yarn@4.12.0",
6
6
  "main": "./dist/index.js",
@@ -33,6 +33,7 @@
33
33
  "intuned-auth-session-create": "vite-node ./src/commands/auth/run-create.ts",
34
34
  "intuned-auth-session-load": "vite-node ./src/commands/auth/load.ts",
35
35
  "intuned-ts-check": "yarn prepublishOnly && vite-node ./src/commands/ts-check.ts",
36
+ "intuned": "vite-node ./src/commands/intuned-cli/main.ts",
36
37
  "intuned-get-headless-user-agent": "vite-node ./src/commands/get-headless-user-agent.ts",
37
38
  "build": "rm -rf dist && tsc -p tsconfig.json && yarn copy-dts && babel src --out-dir dist --extensions '.ts' && tsup && cp -r ./src/common/assets dist/common/assets",
38
39
  "test": "vitest run",
@@ -100,7 +101,6 @@
100
101
  "typescript": "5.1.6",
101
102
  "uuid": "11.1.0",
102
103
  "wait-on": "7.2.0",
103
- "which": "^6.0.1",
104
104
  "yaml": "2.8.1",
105
105
  "zod": "^3.21.4"
106
106
  },