codify-plugin-lib 1.0.182-beta8 → 1.0.182-beta9

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.
@@ -1,6 +1,6 @@
1
1
  import pty from '@homebridge/node-pty-prebuilt-multiarch';
2
2
  import { Ajv } from 'ajv';
3
- import { CommandRequestResponseDataSchema, CommandRequestType, MessageCmd } from 'codify-schemas';
3
+ import { CommandRequestResponseDataSchema, MessageCmd } from 'codify-schemas';
4
4
  import { nanoid } from 'nanoid';
5
5
  import { EventEmitter } from 'node:events';
6
6
  import stripAnsi from 'strip-ansi';
@@ -97,13 +97,11 @@ export class SequentialPty {
97
97
  }
98
98
  };
99
99
  process.on('message', listener);
100
- const { requiresRoot, interactive, ...options } = opts;
101
100
  process.send({
102
101
  cmd: MessageCmd.COMMAND_REQUEST,
103
102
  data: {
104
103
  command: cmd,
105
- type: requiresRoot ? CommandRequestType.SUDO : CommandRequestType.INTERACTIVE,
106
- options: options ?? {},
104
+ options: opts ?? {},
107
105
  },
108
106
  requestId
109
107
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codify-plugin-lib",
3
- "version": "1.0.182-beta8",
3
+ "version": "1.0.182-beta9",
4
4
  "description": "Library plugin library",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "ajv": "^8.12.0",
23
23
  "ajv-formats": "^2.1.1",
24
24
  "clean-deep": "^3.4.0",
25
- "codify-schemas": "1.0.86-beta3",
25
+ "codify-schemas": "1.0.86-beta4",
26
26
  "lodash.isequal": "^4.5.0",
27
27
  "nanoid": "^5.0.9",
28
28
  "strip-ansi": "^7.1.0",
@@ -3,7 +3,6 @@ import { Ajv } from 'ajv';
3
3
  import {
4
4
  CommandRequestResponseData,
5
5
  CommandRequestResponseDataSchema,
6
- CommandRequestType,
7
6
  IpcMessageV2,
8
7
  MessageCmd
9
8
  } from 'codify-schemas';
@@ -131,14 +130,11 @@ export class SequentialPty implements IPty {
131
130
 
132
131
  process.on('message', listener);
133
132
 
134
- const { requiresRoot, interactive, ...options } = opts;
135
-
136
133
  process.send!(<IpcMessageV2>{
137
134
  cmd: MessageCmd.COMMAND_REQUEST,
138
135
  data: {
139
136
  command: cmd,
140
- type: requiresRoot ? CommandRequestType.SUDO : CommandRequestType.INTERACTIVE,
141
- options: options ?? {},
137
+ options: opts ?? {},
142
138
  },
143
139
  requestId
144
140
  })
@@ -2,8 +2,7 @@ import { describe, expect, it, vi } from 'vitest';
2
2
  import { SequentialPty } from './seqeuntial-pty.js';
3
3
  import { VerbosityLevel } from '../utils/verbosity-level.js';
4
4
  import { MessageStatus, SpawnStatus } from 'codify-schemas/src/types/index.js';
5
- import * as v8 from 'node:v8';
6
- import { CommandRequestType, IpcMessageV2, MessageCmd } from 'codify-schemas';
5
+ import { IpcMessageV2, MessageCmd } from 'codify-schemas';
7
6
 
8
7
  describe('SequentialPty tests', () => {
9
8
  it('Can launch a simple command', async () => {
@@ -60,9 +59,9 @@ describe('SequentialPty tests', () => {
60
59
  requestId: expect.any(String),
61
60
  data: {
62
61
  command: 'ls',
63
- type: CommandRequestType.INTERACTIVE,
64
62
  options: {
65
63
  cwd: '/tmp',
64
+ interactive: true,
66
65
  }
67
66
  }
68
67
  })
@@ -102,8 +101,10 @@ describe('SequentialPty tests', () => {
102
101
  requestId: expect.any(String),
103
102
  data: {
104
103
  command: 'ls',
105
- type: CommandRequestType.SUDO,
106
- options: {}
104
+ options: {
105
+ interactive: true,
106
+ requiresRoot: true,
107
+ }
107
108
  }
108
109
  })
109
110
 
@@ -142,8 +143,10 @@ describe('SequentialPty tests', () => {
142
143
  requestId: expect.any(String),
143
144
  data: {
144
145
  command: 'ls',
145
- type: CommandRequestType.SUDO,
146
- options: {}
146
+ options: {
147
+ requiresRoot: true,
148
+ interactive: true,
149
+ }
147
150
  }
148
151
  })
149
152