@celonis/content-cli 1.9.1 → 1.10.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 (27) hide show
  1. package/commands/action-flows/action-flow/action-flow.service.js +5 -4
  2. package/commands/asset-registry/asset-registry-api.js +9 -0
  3. package/commands/asset-registry/asset-registry.service.js +52 -2
  4. package/commands/asset-registry/module.js +21 -0
  5. package/commands/configuration-management/api/node-api.js +31 -0
  6. package/commands/configuration-management/batch-import-export.service.js +9 -5
  7. package/commands/configuration-management/module.js +38 -0
  8. package/commands/configuration-management/node.service.js +54 -0
  9. package/commands/studio/manager/widget.manager-factory.js +3 -2
  10. package/core/git-profile/git/git.service.js +4 -3
  11. package/core/git-profile/git-profile.service.js +5 -3
  12. package/core/http/http-shared/base.manager.js +4 -2
  13. package/core/profile/profile.service.js +5 -3
  14. package/core/utils/file-service.js +25 -8
  15. package/core/utils/file.constants.js +18 -0
  16. package/core/utils/logger.js +3 -2
  17. package/lib/commands/asset-registry/asset-registry-api.d.ts +1 -0
  18. package/lib/commands/asset-registry/asset-registry.interfaces.d.ts +8 -0
  19. package/lib/commands/asset-registry/asset-registry.service.d.ts +5 -0
  20. package/lib/commands/asset-registry/module.d.ts +1 -0
  21. package/lib/commands/configuration-management/api/node-api.d.ts +4 -1
  22. package/lib/commands/configuration-management/interfaces/node.interfaces.d.ts +20 -0
  23. package/lib/commands/configuration-management/module.d.ts +3 -0
  24. package/lib/commands/configuration-management/node.service.d.ts +4 -0
  25. package/lib/core/utils/file-service.d.ts +1 -0
  26. package/lib/core/utils/file.constants.d.ts +4 -0
  27. package/package.json +1 -1
@@ -13,7 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  if (v !== undefined) module.exports = v;
14
14
  }
15
15
  else if (typeof define === "function" && define.amd) {
16
- define(["require", "exports", "uuid", "adm-zip", "form-data", "fs", "./action-flow-api", "../../../core/utils/file-service", "../../../core/utils/logger"], factory);
16
+ define(["require", "exports", "uuid", "adm-zip", "form-data", "fs", "./action-flow-api", "../../../core/utils/file-service", "../../../core/utils/logger", "../../../core/utils/file.constants"], factory);
17
17
  }
18
18
  })(function (require, exports) {
19
19
  "use strict";
@@ -26,6 +26,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
26
26
  const action_flow_api_1 = require("./action-flow-api");
27
27
  const file_service_1 = require("../../../core/utils/file-service");
28
28
  const logger_1 = require("../../../core/utils/logger");
29
+ const file_constants_1 = require("../../../core/utils/file.constants");
29
30
  class ActionFlowService {
30
31
  constructor(context) {
31
32
  this.actionFlowApi = new action_flow_api_1.ActionFlowApi(context);
@@ -36,13 +37,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
36
37
  const tmpZip = new AdmZip(exportedActionFlowsData);
37
38
  const zip = new AdmZip();
38
39
  tmpZip.getEntries().forEach(entry => {
39
- zip.addFile(entry.entryName, entry.getData());
40
+ zip.addFile(entry.entryName, entry.getData(), "", file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS);
40
41
  });
41
42
  if (metadataFilePath) {
42
43
  this.attachMetadataFile(metadataFilePath, zip);
43
44
  }
44
45
  const fileName = "action-flows_export_" + (0, uuid_1.v4)() + ".zip";
45
- zip.writeZip(fileName);
46
+ zip.writeZip(fileName, () => fs.chmodSync(fileName, file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS));
46
47
  logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage + fileName);
47
48
  });
48
49
  }
@@ -84,7 +85,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
84
85
  attachMetadataFile(fileName, zip) {
85
86
  fileName = fileName + (fileName.endsWith(".json") ? "" : ".json");
86
87
  const metadata = file_service_1.fileService.readFile(fileName);
87
- zip.addFile(ActionFlowService.METADATA_FILE_NAME, Buffer.from(metadata));
88
+ zip.addFile(ActionFlowService.METADATA_FILE_NAME, Buffer.from(metadata), "", file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS);
88
89
  }
89
90
  }
90
91
  exports.ActionFlowService = ActionFlowService;
@@ -69,6 +69,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
69
69
  });
70
70
  });
71
71
  }
72
+ validate(assetType, body) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ return this.httpClient()
75
+ .post(`/pacman/api/core/asset-registry/validate/${encodeURIComponent(assetType)}`, body)
76
+ .catch((e) => {
77
+ throw new logger_1.FatalError(`Problem validating asset type '${assetType}': ${e}`);
78
+ });
79
+ });
80
+ }
72
81
  }
73
82
  exports.AssetRegistryApi = AssetRegistryApi;
74
83
  });
@@ -13,7 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  if (v !== undefined) module.exports = v;
14
14
  }
15
15
  else if (typeof define === "function" && define.amd) {
16
- define(["require", "exports", "./asset-registry-api", "../../core/utils/file-service", "../../core/utils/logger", "uuid"], factory);
16
+ define(["require", "exports", "./asset-registry-api", "../../core/utils/file-service", "../../core/utils/logger", "uuid", "fs"], factory);
17
17
  }
18
18
  })(function (require, exports) {
19
19
  "use strict";
@@ -23,6 +23,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
23
23
  const file_service_1 = require("../../core/utils/file-service");
24
24
  const logger_1 = require("../../core/utils/logger");
25
25
  const uuid_1 = require("uuid");
26
+ const fs = require("fs");
26
27
  class AssetRegistryService {
27
28
  constructor(context) {
28
29
  this.api = new asset_registry_api_1.AssetRegistryApi(context);
@@ -78,6 +79,54 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
78
79
  this.outputResponse(data, jsonResponse);
79
80
  });
80
81
  }
82
+ validate(opts) {
83
+ return __awaiter(this, void 0, void 0, function* () {
84
+ const payload = this.buildValidatePayload(opts);
85
+ const data = yield this.api.validate(opts.assetType, payload);
86
+ this.outputResponse(data, opts.json);
87
+ });
88
+ }
89
+ buildValidatePayload(opts) {
90
+ const hasNodeKey = !!opts.nodeKey;
91
+ const hasConfig = !!opts.configuration;
92
+ const hasFile = !!opts.file;
93
+ if (hasFile && (hasNodeKey || hasConfig || !!opts.packageKey)) {
94
+ throw new logger_1.FatalError("Option -f is mutually exclusive with --packageKey, --nodeKey and --configuration.");
95
+ }
96
+ if (hasFile) {
97
+ return this.parseJson(fs.readFileSync(opts.file, "utf-8"), `-f ${opts.file}`);
98
+ }
99
+ if (hasNodeKey && hasConfig) {
100
+ throw new logger_1.FatalError("Options --nodeKey and --configuration are mutually exclusive. Use --nodeKey to validate a stored node, or --configuration to validate a configuration. For full control, use -f.");
101
+ }
102
+ if (!hasNodeKey && !hasConfig) {
103
+ throw new logger_1.FatalError("Provide --packageKey with one of --nodeKey (validate a stored node) or --configuration (validate a configuration), or use -f for a full request file.");
104
+ }
105
+ if (!opts.packageKey) {
106
+ throw new logger_1.FatalError("--packageKey is required when using --nodeKey or --configuration.");
107
+ }
108
+ if (hasNodeKey) {
109
+ return {
110
+ assetType: opts.assetType,
111
+ packageKey: opts.packageKey,
112
+ nodeKeys: [opts.nodeKey],
113
+ };
114
+ }
115
+ const configJson = this.parseJson(opts.configuration, "--configuration");
116
+ return {
117
+ assetType: opts.assetType,
118
+ packageKey: opts.packageKey,
119
+ nodes: [{ key: AssetRegistryService.INLINE_VALIDATION_NODE_KEY, configuration: configJson }],
120
+ };
121
+ }
122
+ parseJson(raw, source) {
123
+ try {
124
+ return JSON.parse(raw);
125
+ }
126
+ catch (_a) {
127
+ throw new logger_1.FatalError(`Invalid JSON in ${source}.`);
128
+ }
129
+ }
81
130
  outputResponse(data, jsonResponse) {
82
131
  if (jsonResponse) {
83
132
  const filename = (0, uuid_1.v4)() + ".json";
@@ -89,7 +138,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
89
138
  }
90
139
  }
91
140
  logDescriptorSummary(descriptor) {
92
- logger_1.logger.info(`${descriptor.assetType} - ${descriptor.displayName} [${descriptor.group}] (basePath: ${descriptor.service.basePath})`);
141
+ logger_1.logger.info(`${descriptor.assetType} - ${descriptor.displayName} [${descriptor.group}]`);
93
142
  }
94
143
  logDescriptorDetail(descriptor) {
95
144
  logger_1.logger.info(`Asset Type: ${descriptor.assetType}`);
@@ -112,4 +161,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
112
161
  }
113
162
  }
114
163
  exports.AssetRegistryService = AssetRegistryService;
164
+ AssetRegistryService.INLINE_VALIDATION_NODE_KEY = "validation-node";
115
165
  });
@@ -42,6 +42,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
42
42
  .requiredOption("--assetType <assetType>", "The asset type identifier (e.g., BOARD_V2)")
43
43
  .option("--json", "Return the response as a JSON file")
44
44
  .action(this.getExamples);
45
+ assetRegistryCommand.command("validate")
46
+ .description("Validate asset configuration against the asset service's validate endpoint.")
47
+ .requiredOption("--assetType <assetType>", "The asset type identifier (e.g., BOARD_V2)")
48
+ .option("--packageKey <packageKey>", "Package key. Required when validating with --nodeKey or --configuration.")
49
+ .option("--nodeKey <nodeKey>", "Key of an already-stored node to validate (use with --packageKey).")
50
+ .option("--configuration <configuration>", "Inline JSON of a configuration to validate (use with --packageKey).")
51
+ .option("-f, --file <file>", "Path to a JSON file containing a full ValidateRequest body. Mutually exclusive with the build-from-options flags.")
52
+ .option("--json", "Return the response as a JSON file")
53
+ .action(this.validate);
45
54
  assetRegistryCommand.command("methodology")
46
55
  .description("Get the methodology / best-practices guide for an asset type")
47
56
  .requiredOption("--assetType <assetType>", "The asset type identifier (e.g., BOARD_V2)")
@@ -63,6 +72,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
63
72
  yield new asset_registry_service_1.AssetRegistryService(context).getSchema(options.assetType, !!options.json);
64
73
  });
65
74
  }
75
+ validate(context, command, options) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ yield new asset_registry_service_1.AssetRegistryService(context).validate({
78
+ assetType: options.assetType,
79
+ packageKey: options.packageKey,
80
+ nodeKey: options.nodeKey,
81
+ configuration: options.configuration,
82
+ file: options.file,
83
+ json: !!options.json,
84
+ });
85
+ });
86
+ }
66
87
  getExamples(context, command, options) {
67
88
  return __awaiter(this, void 0, void 0, function* () {
68
89
  yield new asset_registry_service_1.AssetRegistryService(context).getExamples(options.assetType, !!options.json);
@@ -47,6 +47,37 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
47
47
  });
48
48
  });
49
49
  }
50
+ createStagingNode(packageKey, transport, validateOnly) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ const suffix = validateOnly ? "?validate=true" : "";
53
+ return this.httpClient()
54
+ .post(`/pacman/api/core/staging/packages/${packageKey}/nodes${suffix}`, transport)
55
+ .catch((e) => {
56
+ throw new logger_1.FatalError(`Problem creating node in package ${packageKey}: ${e}`);
57
+ });
58
+ });
59
+ }
60
+ updateStagingNode(packageKey, nodeKey, transport, validateOnly) {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ const suffix = validateOnly ? "?validate=true" : "";
63
+ return this.httpClient()
64
+ .put(`/pacman/api/core/staging/packages/${packageKey}/nodes/${nodeKey}${suffix}`, transport)
65
+ .catch((e) => {
66
+ throw new logger_1.FatalError(`Problem updating node ${nodeKey} in package ${packageKey}: ${e}`);
67
+ });
68
+ });
69
+ }
70
+ archiveStagingNode(packageKey, nodeKey, force) {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ const queryParams = new URLSearchParams();
73
+ queryParams.set("force", force.toString());
74
+ return this.httpClient()
75
+ .delete(`/pacman/api/core/staging/packages/${packageKey}/nodes/${nodeKey}/archive?${queryParams.toString()}`)
76
+ .catch((e) => {
77
+ throw new logger_1.FatalError(`Problem archiving node ${nodeKey} in package ${packageKey}: ${e}`);
78
+ });
79
+ });
80
+ }
50
81
  findVersionedNodesByPackage(packageKey, version, withConfiguration, limit, offset) {
51
82
  return __awaiter(this, void 0, void 0, function* () {
52
83
  const queryParams = new URLSearchParams();
@@ -13,7 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  if (v !== undefined) module.exports = v;
14
14
  }
15
15
  else if (typeof define === "function" && define.amd) {
16
- define(["require", "exports", "uuid", "form-data", "stream", "adm-zip", "./interfaces/batch-export-import.constants", "../../core/utils/file-service", "../../core/utils/logger", "../../core/utils/json", "../studio/api/package-api", "./api/batch-import-export-api", "./studio.service", "../../core/git-profile/git/git.service", "fs"], factory);
16
+ define(["require", "exports", "uuid", "form-data", "stream", "adm-zip", "./interfaces/batch-export-import.constants", "../../core/utils/file-service", "../../core/utils/logger", "../../core/utils/json", "../studio/api/package-api", "./api/batch-import-export-api", "./studio.service", "../../core/git-profile/git/git.service", "fs", "../../core/utils/file.constants"], factory);
17
17
  }
18
18
  })(function (require, exports) {
19
19
  "use strict";
@@ -32,6 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
32
  const studio_service_1 = require("./studio.service");
33
33
  const git_service_1 = require("../../core/git-profile/git/git.service");
34
34
  const fs = require("fs");
35
+ const file_constants_1 = require("../../core/utils/file.constants");
35
36
  class BatchImportExportService {
36
37
  constructor(context) {
37
38
  this.batchImportExportApi = new batch_import_export_api_1.BatchImportExportApi(context);
@@ -85,11 +86,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
85
86
  const versionsByPackageKey = this.getVersionsByPackageKey(manifest);
86
87
  let exportedVariables = yield this.getVersionedVariablesForPackagesWithKeys(versionsByPackageKey);
87
88
  exportedVariables = this.studioService.fixConnectionVariables(exportedVariables);
88
- exportedPackagesZip.addFile(batch_export_import_constants_1.BatchExportImportConstants.VARIABLES_FILE_NAME, Buffer.from((0, json_1.stringify)(exportedVariables), "utf8"));
89
+ exportedPackagesZip.addFile(batch_export_import_constants_1.BatchExportImportConstants.VARIABLES_FILE_NAME, Buffer.from((0, json_1.stringify)(exportedVariables), "utf8"), "", file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS);
89
90
  const studioPackageKeys = manifest.filter(packageManifest => packageManifest.flavor === batch_export_import_constants_1.BatchExportImportConstants.STUDIO)
90
91
  .map(packageManifest => packageManifest.packageKey);
91
92
  const studioData = yield this.studioService.getStudioPackageManifests(studioPackageKeys);
92
- exportedPackagesZip.addFile(batch_export_import_constants_1.BatchExportImportConstants.STUDIO_FILE_NAME, Buffer.from((0, json_1.stringify)(studioData), "utf8"));
93
+ exportedPackagesZip.addFile(batch_export_import_constants_1.BatchExportImportConstants.STUDIO_FILE_NAME, Buffer.from((0, json_1.stringify)(studioData), "utf8"), "", file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS);
93
94
  exportedPackagesZip.getEntries().forEach(entry => {
94
95
  if (entry.name.endsWith(batch_export_import_constants_1.BatchExportImportConstants.ZIP_EXTENSION)) {
95
96
  const lastUnderscoreIndex = entry.name.lastIndexOf("_");
@@ -127,8 +128,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
127
128
  batchImportPackages(sourcePath, overwrite, gitBranch, performValidation = false) {
128
129
  return __awaiter(this, void 0, void 0, function* () {
129
130
  let sourceToBeImported;
131
+ let temporaryGitFolder;
130
132
  if (gitBranch) {
131
133
  sourceToBeImported = yield this.gitService.pullFromBranch(gitBranch);
134
+ temporaryGitFolder = sourceToBeImported;
132
135
  }
133
136
  else {
134
137
  sourceToBeImported = sourcePath;
@@ -145,8 +148,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
145
148
  const postPackageImportData = yield this.batchImportExportApi.importPackages(formData, overwrite, performValidation);
146
149
  yield this.studioService.processImportedPackages(configs, existingStudioPackages, studioManifests);
147
150
  if (gitBranch) {
148
- fs.rmSync(sourceToBeImported);
151
+ fs.rmSync(temporaryGitFolder, { recursive: true });
149
152
  }
153
+ fs.rmSync(sourceToBeImported);
150
154
  const reportFileName = "config_import_report_" + (0, uuid_1.v4)() + ".json";
151
155
  file_service_1.fileService.writeToFileWithGivenName(JSON.stringify(postPackageImportData), reportFileName);
152
156
  logger_1.logger.info("Config import report file: " + reportFileName);
@@ -240,7 +244,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
240
244
  else {
241
245
  const fileDownloadedMessage = "File downloaded successfully. New filename: ";
242
246
  const filename = `export_${(0, uuid_1.v4)()}.zip`;
243
- exportedZip.writeZip(filename);
247
+ exportedZip.writeZip(filename, () => fs.chmodSync(filename, file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS));
244
248
  logger_1.logger.info(fileDownloadedMessage + filename);
245
249
  }
246
250
  }
@@ -116,6 +116,29 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
116
116
  .option("--withConfiguration", "Include node configuration in the response", false)
117
117
  .option("--json", "Return the response as a JSON file")
118
118
  .action(this.findNode);
119
+ nodesCommand.command("create")
120
+ .description("Create a new staging node in a package")
121
+ .requiredOption("--packageKey <packageKey>", "Identifier of the package")
122
+ .option("--body <body>", "Node payload as JSON string")
123
+ .option("-f, --file <file>", "Path to a JSON file containing the node payload")
124
+ .option("--validate", "Only validate the payload without persisting. Returns success if valid.", false)
125
+ .option("--json", "Return the response as a JSON file")
126
+ .action(this.createNode);
127
+ nodesCommand.command("update")
128
+ .description("Update a staging node in a package")
129
+ .requiredOption("--packageKey <packageKey>", "Identifier of the package")
130
+ .requiredOption("--nodeKey <nodeKey>", "Identifier of the node")
131
+ .option("--body <body>", "Node payload as JSON string")
132
+ .option("-f, --file <file>", "Path to a JSON file containing the node payload")
133
+ .option("--validate", "Only validate the payload without persisting. Returns success if valid.", false)
134
+ .option("--json", "Return the response as a JSON file")
135
+ .action(this.updateNode);
136
+ nodesCommand.command("archive")
137
+ .description("Archive a staging node in a package")
138
+ .requiredOption("--packageKey <packageKey>", "Identifier of the package")
139
+ .requiredOption("--nodeKey <nodeKey>", "Identifier of the node")
140
+ .option("--force", "Force archive even if the node has dependants", false)
141
+ .action(this.archiveNode);
119
142
  nodesCommand.command("list")
120
143
  .description("List nodes in a specific package version")
121
144
  .requiredOption("--packageKey <packageKey>", "Identifier of the package")
@@ -236,6 +259,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
236
259
  yield new node_service_1.NodeService(context).findNode(options.packageKey, options.nodeKey, options.withConfiguration, (_a = options.packageVersion) !== null && _a !== void 0 ? _a : null, options.json);
237
260
  });
238
261
  }
262
+ createNode(context, command, options) {
263
+ return __awaiter(this, void 0, void 0, function* () {
264
+ yield new node_service_1.NodeService(context).createNode(options.packageKey, options.body, options.file, options.validate, options.json);
265
+ });
266
+ }
267
+ updateNode(context, command, options) {
268
+ return __awaiter(this, void 0, void 0, function* () {
269
+ yield new node_service_1.NodeService(context).updateNode(options.packageKey, options.nodeKey, options.body, options.file, options.validate, options.json);
270
+ });
271
+ }
272
+ archiveNode(context, command, options) {
273
+ return __awaiter(this, void 0, void 0, function* () {
274
+ yield new node_service_1.NodeService(context).archiveNode(options.packageKey, options.nodeKey, options.force);
275
+ });
276
+ }
239
277
  listNodes(context, command, options) {
240
278
  return __awaiter(this, void 0, void 0, function* () {
241
279
  yield new node_service_1.NodeService(context).listNodes(options.packageKey, options.packageVersion, options.limit, options.offset, options.withConfiguration, options.json);
@@ -57,6 +57,60 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
57
57
  }
58
58
  });
59
59
  }
60
+ createNode(packageKey, body, file, validateOnly, jsonResponse) {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ const transport = JSON.parse(NodeService.resolveBody(body, file));
63
+ const node = yield this.nodeApi.createStagingNode(packageKey, transport, validateOnly);
64
+ if (validateOnly) {
65
+ logger_1.logger.info(`Validation successful for node ${transport.key} in package ${packageKey}.`);
66
+ return;
67
+ }
68
+ if (jsonResponse) {
69
+ const filename = (0, uuid_1.v4)() + ".json";
70
+ file_service_1.fileService.writeToFileWithGivenName(JSON.stringify(node, null, 2), filename);
71
+ logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage + filename);
72
+ }
73
+ else {
74
+ this.printNode(node);
75
+ }
76
+ });
77
+ }
78
+ updateNode(packageKey, nodeKey, body, file, validateOnly, jsonResponse) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ const transport = JSON.parse(NodeService.resolveBody(body, file));
81
+ const node = yield this.nodeApi.updateStagingNode(packageKey, nodeKey, transport, validateOnly);
82
+ if (validateOnly) {
83
+ logger_1.logger.info(`Validation successful for node ${nodeKey} in package ${packageKey}.`);
84
+ return;
85
+ }
86
+ if (jsonResponse) {
87
+ const filename = (0, uuid_1.v4)() + ".json";
88
+ file_service_1.fileService.writeToFileWithGivenName(JSON.stringify(node, null, 2), filename);
89
+ logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage + filename);
90
+ }
91
+ else {
92
+ this.printNode(node);
93
+ }
94
+ });
95
+ }
96
+ archiveNode(packageKey, nodeKey, force) {
97
+ return __awaiter(this, void 0, void 0, function* () {
98
+ yield this.nodeApi.archiveStagingNode(packageKey, nodeKey, force);
99
+ logger_1.logger.info(`Node ${nodeKey} in package ${packageKey} archived successfully.`);
100
+ });
101
+ }
102
+ static resolveBody(body, file) {
103
+ if (body && file) {
104
+ throw new Error("Please provide either --body or --file, but not both.");
105
+ }
106
+ if (!body && !file) {
107
+ throw new Error("Please provide either --body or --file.");
108
+ }
109
+ if (file) {
110
+ return file_service_1.fileService.readFile(file);
111
+ }
112
+ return body;
113
+ }
60
114
  printNode(node) {
61
115
  logger_1.logger.info(`ID: ${node.id}`);
62
116
  logger_1.logger.info(`Key: ${node.key}`);
@@ -4,7 +4,7 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "fs", "path", "./widget.manager", "../../../core/utils/logger", "adm-zip", "../../../core/utils/yaml"], factory);
7
+ define(["require", "exports", "fs", "path", "./widget.manager", "../../../core/utils/logger", "adm-zip", "../../../core/utils/yaml", "../../../core/utils/file.constants"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
@@ -16,6 +16,7 @@
16
16
  const logger_1 = require("../../../core/utils/logger");
17
17
  const AdmZip = require("adm-zip");
18
18
  const yaml_1 = require("../../../core/utils/yaml");
19
+ const file_constants_1 = require("../../../core/utils/file.constants");
19
20
  class WidgetManagerFactory {
20
21
  constructor(context) {
21
22
  this.context = context;
@@ -36,7 +37,7 @@
36
37
  const zip = new AdmZip();
37
38
  const zipFileName = path.resolve(process.cwd(), "output.zip");
38
39
  zip.addLocalFolder(path.resolve(process.cwd()));
39
- zip.writeZip(zipFileName);
40
+ zip.writeZip(zipFileName, () => fs.chmodSync(zipFileName, file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS));
40
41
  return fs.createReadStream(path.resolve(process.cwd(), "output.zip"));
41
42
  }
42
43
  fetchManifest() {
@@ -13,7 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  if (v !== undefined) module.exports = v;
14
14
  }
15
15
  else if (typeof define === "function" && define.amd) {
16
- define(["require", "exports", "simple-git", "fs", "path", "node:os", "uuid"], factory);
16
+ define(["require", "exports", "simple-git", "fs", "path", "node:os", "uuid", "../../utils/file.constants"], factory);
17
17
  }
18
18
  })(function (require, exports) {
19
19
  "use strict";
@@ -24,6 +24,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  const path = require("path");
25
25
  const os = require("node:os");
26
26
  const uuid_1 = require("uuid");
27
+ const file_constants_1 = require("../../utils/file.constants");
27
28
  class GitService {
28
29
  constructor(context) {
29
30
  this.gitProfile = context.gitProfile;
@@ -33,7 +34,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
34
  this.validateGitProfileExistence();
34
35
  const repoUrl = this.getRepoUrl();
35
36
  const targetDir = path.join(os.tmpdir(), `content-cli-${(0, uuid_1.v4)()}`);
36
- fs.mkdirSync(targetDir, { recursive: true });
37
+ fs.mkdirSync(targetDir, { recursive: true, mode: file_constants_1.FileConstants.DEFAULT_FOLDER_PERMISSIONS });
37
38
  const git = (0, simple_git_1.default)();
38
39
  try {
39
40
  yield git.clone(repoUrl, targetDir, ["--branch", branch, "--single-branch"]);
@@ -50,7 +51,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
50
51
  return __awaiter(this, void 0, void 0, function* () {
51
52
  this.validateGitProfileExistence();
52
53
  const workingDir = path.join(os.tmpdir(), `content-cli-${(0, uuid_1.v4)()}`);
53
- fs.mkdirSync(workingDir, { recursive: true });
54
+ fs.mkdirSync(workingDir, { recursive: true, mode: file_constants_1.FileConstants.DEFAULT_FOLDER_PERMISSIONS });
54
55
  const repoUrl = this.getRepoUrl();
55
56
  const git = (0, simple_git_1.default)();
56
57
  try {
@@ -13,7 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  if (v !== undefined) module.exports = v;
14
14
  }
15
15
  else if (typeof define === "function" && define.amd) {
16
- define(["require", "exports", "path", "fs", "../utils/logger", "os", "./git-profile.interface", "./git-profile.validator"], factory);
16
+ define(["require", "exports", "path", "fs", "../utils/logger", "os", "./git-profile.interface", "./git-profile.validator", "../utils/file.constants"], factory);
17
17
  }
18
18
  })(function (require, exports) {
19
19
  "use strict";
@@ -25,6 +25,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
25
25
  const os = require("os");
26
26
  const git_profile_interface_1 = require("./git-profile.interface");
27
27
  const git_profile_validator_1 = require("./git-profile.validator");
28
+ const file_constants_1 = require("../utils/file.constants");
28
29
  class GitProfileService {
29
30
  constructor() {
30
31
  this.homedir = os.homedir();
@@ -79,6 +80,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
79
80
  const newProfileFileName = this.constructProfileFileName(profile.name);
80
81
  fs.writeFileSync(path.resolve(this.gitProfileContainerPath, newProfileFileName), JSON.stringify(profile), {
81
82
  encoding: "utf-8",
83
+ mode: file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS,
82
84
  });
83
85
  }
84
86
  validateProfileName(name) {
@@ -101,11 +103,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
101
103
  });
102
104
  }
103
105
  storeConfig(config) {
104
- fs.writeFileSync(this.configContainer, JSON.stringify(config), { encoding: "utf-8" });
106
+ fs.writeFileSync(this.configContainer, JSON.stringify(config), { encoding: "utf-8", mode: file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS });
105
107
  }
106
108
  createProfileContainerIfNotExists() {
107
109
  if (!fs.existsSync(this.gitProfileContainerPath)) {
108
- fs.mkdirSync(this.gitProfileContainerPath);
110
+ fs.mkdirSync(this.gitProfileContainerPath, file_constants_1.FileConstants.DEFAULT_FOLDER_PERMISSIONS);
109
111
  }
110
112
  }
111
113
  constructProfileFileName(profileName) {
@@ -13,7 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  if (v !== undefined) module.exports = v;
14
14
  }
15
15
  else if (typeof define === "function" && define.amd) {
16
- define(["require", "exports", "fs", "path", "../../utils/logger"], factory);
16
+ define(["require", "exports", "fs", "path", "../../utils/logger", "../../utils/file.constants"], factory);
17
17
  }
18
18
  })(function (require, exports) {
19
19
  "use strict";
@@ -22,6 +22,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  const fs = require("fs");
23
23
  const path = require("path");
24
24
  const logger_1 = require("../../utils/logger");
25
+ const file_constants_1 = require("../../utils/file.constants");
25
26
  class BaseManager {
26
27
  constructor(context) {
27
28
  this.fileDownloadedMessage = "File downloaded successfully. New filename: ";
@@ -122,12 +123,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
122
123
  }
123
124
  writeStreamToFile(data) {
124
125
  const filename = this.getConfig().exportFileName;
125
- fs.writeFileSync(filename, data);
126
+ fs.writeFileSync(filename, data, { mode: file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS });
126
127
  return filename;
127
128
  }
128
129
  writeToFileWithGivenName(data, filename) {
129
130
  fs.writeFileSync(path.resolve(process.cwd(), filename), this.getSerializedFileContent(data), {
130
131
  encoding: "utf-8",
132
+ mode: file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS,
131
133
  });
132
134
  }
133
135
  }
@@ -13,7 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  if (v !== undefined) module.exports = v;
14
14
  }
15
15
  else if (typeof define === "function" && define.amd) {
16
- define(["require", "exports", "./profile.interface", "./profile.validator", "path", "fs", "../utils/logger", "openid-client", "axios", "os", "./secret-storage.service"], factory);
16
+ define(["require", "exports", "./profile.interface", "./profile.validator", "path", "fs", "../utils/logger", "openid-client", "axios", "os", "./secret-storage.service", "../utils/file.constants"], factory);
17
17
  }
18
18
  })(function (require, exports) {
19
19
  "use strict";
@@ -28,6 +28,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
28
28
  const axios_1 = require("axios");
29
29
  const os = require("os");
30
30
  const secret_storage_service_1 = require("./secret-storage.service");
31
+ const file_constants_1 = require("../utils/file.constants");
31
32
  const homedir = os.homedir();
32
33
  // use 5 seconds buffer to avoid rare cases when accessToken is just about to expire before the command is sent
33
34
  const expiryBuffer = 5000;
@@ -131,6 +132,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
131
132
  }
132
133
  fs.writeFileSync(path.resolve(this.profileContainerPath, newProfileFileName), JSON.stringify(profileToStore), {
133
134
  encoding: "utf-8",
135
+ mode: file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS,
134
136
  });
135
137
  });
136
138
  }
@@ -149,11 +151,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
149
151
  });
150
152
  }
151
153
  storeConfig(config) {
152
- fs.writeFileSync(this.configContainer, JSON.stringify(config), { encoding: "utf-8" });
154
+ fs.writeFileSync(this.configContainer, JSON.stringify(config), { encoding: "utf-8", mode: file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS });
153
155
  }
154
156
  createProfileContainerIfNotExists() {
155
157
  if (!fs.existsSync(this.profileContainerPath)) {
156
- fs.mkdirSync(this.profileContainerPath);
158
+ fs.mkdirSync(this.profileContainerPath, file_constants_1.FileConstants.DEFAULT_FOLDER_PERMISSIONS);
157
159
  }
158
160
  }
159
161
  constructProfileFileName(profileName) {
@@ -13,7 +13,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  if (v !== undefined) module.exports = v;
14
14
  }
15
15
  else if (typeof define === "function" && define.amd) {
16
- define(["require", "exports", "fs", "path", "./logger", "adm-zip", "uuid", "node:os"], factory);
16
+ define(["require", "exports", "fs", "path", "./logger", "adm-zip", "uuid", "node:os", "./file.constants"], factory);
17
17
  }
18
18
  })(function (require, exports) {
19
19
  "use strict";
@@ -25,10 +25,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
25
25
  const AdmZip = require("adm-zip");
26
26
  const uuid_1 = require("uuid");
27
27
  const os = require("node:os");
28
+ const file_constants_1 = require("./file.constants");
28
29
  class FileService {
29
30
  writeToFileWithGivenName(data, filename) {
30
31
  fs.writeFileSync(path.resolve(process.cwd(), filename), this.getSerializedFileContent(data), {
31
32
  encoding: "utf-8",
33
+ mode: file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS,
32
34
  });
33
35
  }
34
36
  readFileToJson(fileName) {
@@ -45,22 +47,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
45
47
  }
46
48
  extractExportedZipWithNestedZips(zipFile) {
47
49
  const tempDir = path.join(os.tmpdir(), `${(0, uuid_1.v4)()}`);
48
- fs.mkdirSync(tempDir, { recursive: true });
49
50
  return this.extractExportedZipWithNestedZipsToDir(zipFile, tempDir);
50
51
  }
51
52
  extractExportedZipWithNestedZipsToDir(zipFile, targetDir) {
52
- zipFile.extractAllTo(targetDir, true);
53
+ fs.mkdirSync(targetDir, { recursive: true, mode: file_constants_1.FileConstants.DEFAULT_FOLDER_PERMISSIONS });
54
+ zipFile.extractAllTo(targetDir, true, true);
53
55
  const files = fs.readdirSync(targetDir);
54
56
  for (const file of files) {
55
57
  const innerZipPath = path.join(targetDir, file);
56
58
  if (file.endsWith(".zip")) {
57
59
  const nestedZip = new AdmZip(innerZipPath);
58
60
  const nestedDir = innerZipPath.replace(/\.zip$/, "");
59
- fs.mkdirSync(nestedDir, { recursive: true });
60
- nestedZip.extractAllTo(nestedDir, true);
61
+ fs.mkdirSync(nestedDir, { recursive: true, mode: file_constants_1.FileConstants.DEFAULT_FOLDER_PERMISSIONS });
62
+ nestedZip.extractAllTo(nestedDir, true, true);
61
63
  fs.rmSync(innerZipPath); // Optionally remove the inner zip
62
64
  }
63
65
  }
66
+ this.restrictFilePermissions(targetDir);
64
67
  return targetDir;
65
68
  }
66
69
  isDirectory(sourcePath) {
@@ -80,21 +83,35 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
80
83
  const zip = new AdmZip();
81
84
  zip.addLocalFolder(fullPath);
82
85
  const zippedBuffer = zip.toBuffer();
83
- finalZip.addFile(`${file}.zip`, zippedBuffer);
86
+ finalZip.addFile(`${file}.zip`, zippedBuffer, "", file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS);
84
87
  }
85
88
  else if (stat.isFile()) {
86
89
  finalZip.addLocalFile(fullPath);
87
90
  }
88
91
  });
89
92
  const tempDir = path.join(os.tmpdir(), "content-cli-exports");
90
- fs.mkdirSync(tempDir, { recursive: true });
93
+ fs.mkdirSync(tempDir, { recursive: true, mode: file_constants_1.FileConstants.DEFAULT_FOLDER_PERMISSIONS });
91
94
  const zipFilePath = path.join(tempDir, `export_${(0, uuid_1.v4)()}.zip`);
92
- finalZip.writeZip(zipFilePath);
95
+ finalZip.writeZip(zipFilePath, () => fs.chmodSync(zipFilePath, file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS));
93
96
  return zipFilePath;
94
97
  }
95
98
  getSerializedFileContent(data) {
96
99
  return data;
97
100
  }
101
+ restrictFilePermissions(targetDir) {
102
+ var _a;
103
+ const files = fs.readdirSync(targetDir);
104
+ for (const file of files) {
105
+ const filePath = path.join(targetDir, file);
106
+ if ((_a = fs.statSync(filePath)) === null || _a === void 0 ? void 0 : _a.isDirectory()) {
107
+ fs.chmodSync(filePath, file_constants_1.FileConstants.DEFAULT_FOLDER_PERMISSIONS);
108
+ this.restrictFilePermissions(filePath);
109
+ }
110
+ else {
111
+ fs.chmodSync(filePath, file_constants_1.FileConstants.DEFAULT_FILE_PERMISSIONS);
112
+ }
113
+ }
114
+ }
98
115
  }
99
116
  exports.FileService = FileService;
100
117
  FileService.fileDownloadedMessage = "File downloaded successfully. New filename: ";
@@ -0,0 +1,18 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.FileConstants = void 0;
13
+ var FileConstants;
14
+ (function (FileConstants) {
15
+ FileConstants[FileConstants["DEFAULT_FILE_PERMISSIONS"] = 384] = "DEFAULT_FILE_PERMISSIONS";
16
+ FileConstants[FileConstants["DEFAULT_FOLDER_PERMISSIONS"] = 448] = "DEFAULT_FOLDER_PERMISSIONS";
17
+ })(FileConstants || (exports.FileConstants = FileConstants = {}));
18
+ });
@@ -4,7 +4,7 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "winston", "winston-transport", "os", "path", "fs"], factory);
7
+ define(["require", "exports", "winston", "winston-transport", "os", "path", "fs", "./file.constants"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
@@ -15,6 +15,7 @@
15
15
  const os = require("os");
16
16
  const path = require("path");
17
17
  const fs = require("fs");
18
+ const file_constants_1 = require("./file.constants");
18
19
  class CustomTransport extends Transport {
19
20
  constructor(opts) {
20
21
  super(opts);
@@ -43,7 +44,7 @@
43
44
  // --- Ensure log directory exists ---
44
45
  try {
45
46
  if (!fs.existsSync(logDir)) {
46
- fs.mkdirSync(logDir, { recursive: true });
47
+ fs.mkdirSync(logDir, { recursive: true, mode: file_constants_1.FileConstants.DEFAULT_FOLDER_PERMISSIONS });
47
48
  }
48
49
  }
49
50
  catch (error) {
@@ -8,4 +8,5 @@ export declare class AssetRegistryApi {
8
8
  getSchema(assetType: string): Promise<any>;
9
9
  getExamples(assetType: string): Promise<any>;
10
10
  getMethodology(assetType: string): Promise<any>;
11
+ validate(assetType: string, body: any): Promise<any>;
11
12
  }
@@ -28,3 +28,11 @@ export interface AssetContributions {
28
28
  dataPipelineEntityTypes: string[];
29
29
  actionTypes: string[];
30
30
  }
31
+ export interface ValidateOptions {
32
+ assetType: string;
33
+ packageKey?: string;
34
+ nodeKey?: string;
35
+ configuration?: string;
36
+ file?: string;
37
+ json: boolean;
38
+ }
@@ -1,3 +1,4 @@
1
+ import { ValidateOptions } from "./asset-registry.interfaces";
1
2
  import { Context } from "../../core/command/cli-context";
2
3
  export declare class AssetRegistryService {
3
4
  private api;
@@ -7,6 +8,10 @@ export declare class AssetRegistryService {
7
8
  getSchema(assetType: string, jsonResponse: boolean): Promise<void>;
8
9
  getExamples(assetType: string, jsonResponse: boolean): Promise<void>;
9
10
  getMethodology(assetType: string, jsonResponse: boolean): Promise<void>;
11
+ validate(opts: ValidateOptions): Promise<void>;
12
+ private static readonly INLINE_VALIDATION_NODE_KEY;
13
+ private buildValidatePayload;
14
+ private parseJson;
10
15
  private outputResponse;
11
16
  private logDescriptorSummary;
12
17
  private logDescriptorDetail;
@@ -5,6 +5,7 @@ declare class Module extends IModule {
5
5
  private listTypes;
6
6
  private getType;
7
7
  private getSchema;
8
+ private validate;
8
9
  private getExamples;
9
10
  private getMethodology;
10
11
  }
@@ -1,9 +1,12 @@
1
1
  import { Context } from "../../../core/command/cli-context";
2
- import { NodeTransport } from "../interfaces/node.interfaces";
2
+ import { NodeTransport, SaveNodeTransport, UpdateNodeTransport } from "../interfaces/node.interfaces";
3
3
  export declare class NodeApi {
4
4
  private httpClient;
5
5
  constructor(context: Context);
6
6
  findStagingNodeByKey(packageKey: string, nodeKey: string, withConfiguration: boolean): Promise<NodeTransport>;
7
7
  findVersionedNodeByKey(packageKey: string, nodeKey: string, version: string, withConfiguration: boolean): Promise<NodeTransport>;
8
+ createStagingNode(packageKey: string, transport: SaveNodeTransport, validateOnly: boolean): Promise<NodeTransport | void>;
9
+ updateStagingNode(packageKey: string, nodeKey: string, transport: UpdateNodeTransport, validateOnly: boolean): Promise<NodeTransport | void>;
10
+ archiveStagingNode(packageKey: string, nodeKey: string, force: boolean): Promise<void>;
8
11
  findVersionedNodesByPackage(packageKey: string, version: string, withConfiguration: boolean, limit: number, offset: number): Promise<NodeTransport[]>;
9
12
  }
@@ -19,3 +19,23 @@ export interface NodeTransport {
19
19
  schemaVersion: number;
20
20
  flavor?: string;
21
21
  }
22
+ export interface SaveNodeTransport {
23
+ key: string;
24
+ name: string;
25
+ parentNodeKey: string;
26
+ type: string;
27
+ configuration?: NodeConfiguration;
28
+ invalidConfiguration?: string;
29
+ invalidContent?: boolean;
30
+ schemaVersion?: number;
31
+ [key: string]: any;
32
+ }
33
+ export interface UpdateNodeTransport {
34
+ name: string;
35
+ parentNodeKey: string;
36
+ configuration?: NodeConfiguration;
37
+ invalidConfiguration?: string;
38
+ invalidContent?: boolean;
39
+ schemaVersion?: number;
40
+ [key: string]: any;
41
+ }
@@ -16,6 +16,9 @@ declare class Module extends IModule {
16
16
  private listVariables;
17
17
  private listAssignments;
18
18
  private findNode;
19
+ private createNode;
20
+ private updateNode;
21
+ private archiveNode;
19
22
  private listNodes;
20
23
  private diffNode;
21
24
  private listNodeDependencies;
@@ -4,5 +4,9 @@ export declare class NodeService {
4
4
  constructor(context: Context);
5
5
  findNode(packageKey: string, nodeKey: string, withConfiguration: boolean, packageVersion: string | null, jsonResponse: boolean): Promise<void>;
6
6
  listNodes(packageKey: string, packageVersion: string, limit: number, offset: number, withConfiguration: boolean, jsonResponse: boolean): Promise<void>;
7
+ createNode(packageKey: string, body: string | undefined, file: string | undefined, validateOnly: boolean, jsonResponse: boolean): Promise<void>;
8
+ updateNode(packageKey: string, nodeKey: string, body: string | undefined, file: string | undefined, validateOnly: boolean, jsonResponse: boolean): Promise<void>;
9
+ archiveNode(packageKey: string, nodeKey: string, force: boolean): Promise<void>;
10
+ private static resolveBody;
7
11
  private printNode;
8
12
  }
@@ -9,5 +9,6 @@ export declare class FileService {
9
9
  isDirectory(sourcePath: string): boolean;
10
10
  zipDirectoryInBatchExportFormat(sourceDir: string): string;
11
11
  private getSerializedFileContent;
12
+ private restrictFilePermissions;
12
13
  }
13
14
  export declare const fileService: FileService;
@@ -0,0 +1,4 @@
1
+ export declare enum FileConstants {
2
+ DEFAULT_FILE_PERMISSIONS = 384,
3
+ DEFAULT_FOLDER_PERMISSIONS = 448
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celonis/content-cli",
3
- "version": "1.9.1",
3
+ "version": "1.10.0",
4
4
  "description": "CLI Tool to help manage content in Celonis Platform",
5
5
  "main": "content-cli.js",
6
6
  "bin": {