greybel-mock-environment 1.8.2 → 1.9.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.
@@ -115,7 +115,8 @@ var MockEnvironment = /** @class */ (function () {
115
115
  owner: 'root',
116
116
  isProtected: true,
117
117
  type: types_1.FileType.Binary,
118
- content: myProgramContent
118
+ content: myProgramContent,
119
+ isExternalProgram: true
119
120
  });
120
121
  currentPath.putEntity(programPath);
121
122
  me.localSession = new types_1.Session({
@@ -59,12 +59,14 @@ export interface FileOptions extends Omit<EntityOptions, 'isFolder'> {
59
59
  type: FileType;
60
60
  allowImport?: boolean;
61
61
  version?: string;
62
+ isExternalProgram?: boolean;
62
63
  }
63
64
  export declare class File extends Entity {
64
65
  content: string;
65
66
  type: FileType;
66
67
  allowImport: boolean;
67
68
  version: Version;
69
+ isExternalProgram: boolean;
68
70
  constructor(options: FileOptions, parent?: Entity);
69
71
  getSize(): number;
70
72
  copy(): File;
@@ -161,11 +161,14 @@ exports.Entity = Entity;
161
161
  var File = /** @class */ (function (_super) {
162
162
  __extends(File, _super);
163
163
  function File(options, parent) {
164
- var _this = _super.call(this, __assign(__assign({}, options), { isFolder: false }), parent) || this;
165
- _this.content = options.content || '';
164
+ var _this = this;
165
+ var _a, _b;
166
+ _this = _super.call(this, __assign(__assign({}, options), { isFolder: false }), parent) || this;
167
+ _this.content = (_a = options.content) !== null && _a !== void 0 ? _a : '';
166
168
  _this.type = options.type;
167
169
  _this.allowImport = options.allowImport;
168
170
  _this.version = new version_1.Version({ version: options.version });
171
+ _this.isExternalProgram = (_b = options.isExternalProgram) !== null && _b !== void 0 ? _b : false;
169
172
  return _this;
170
173
  }
171
174
  File.prototype.getSize = function () {
@@ -179,7 +182,8 @@ var File = /** @class */ (function (_super) {
179
182
  content: this.content,
180
183
  type: this.type,
181
184
  allowImport: this.allowImport,
182
- version: this.version.toString()
185
+ version: this.version.toString(),
186
+ isExternalProgram: this.isExternalProgram
183
187
  });
184
188
  return newEntity;
185
189
  };
@@ -139,7 +139,7 @@ var LibraryManager = /** @class */ (function () {
139
139
  }
140
140
  LibraryManager.prototype.initialize = function () {
141
141
  this.register(library_1.Library.METAXPLOIT, [vulnerabilities_1.VulnerabilityMode.Local]);
142
- this.register(library_1.Library.BLOCKCHAIN, []);
142
+ this.register(library_1.Library.BLOCKCHAIN, [vulnerabilities_1.VulnerabilityMode.Local]);
143
143
  this.register(library_1.Library.CRYPTO, [vulnerabilities_1.VulnerabilityMode.Local]);
144
144
  this.register(library_1.Library.FTP);
145
145
  this.register(library_1.Library.HTTP);
@@ -154,7 +154,7 @@ var LibraryManager = /** @class */ (function () {
154
154
  this.register(library_1.Library.CHAT);
155
155
  this.register(library_1.Library.CAM);
156
156
  this.register(library_1.Library.REPOSITORY);
157
- this.register(library_1.Library.APT_CLIENT, []);
157
+ this.register(library_1.Library.APT_CLIENT, [vulnerabilities_1.VulnerabilityMode.Local]);
158
158
  this.register(library_1.Library.TEST_LIB, []);
159
159
  };
160
160
  LibraryManager.prototype.register = function (library, allowedModes) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greybel-mock-environment",
3
- "version": "1.8.2",
3
+ "version": "1.9.0",
4
4
  "description": "Mock environment",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index",
@@ -48,7 +48,7 @@
48
48
  "dependencies": {
49
49
  "@types/random-seed": "^0.3.3",
50
50
  "blueimp-md5": "^2.19.0",
51
- "greyscript-core": "^0.9.17",
51
+ "greyscript-core": "^0.10.0",
52
52
  "random-seed": "^0.3.0",
53
53
  "random-username-generator": "^1.0.4"
54
54
  }