@contrail/flexplm 1.3.1-alpha.7db7b62 → 1.3.1-alpha.8bc920d

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 (103) hide show
  1. package/.github/pull_request_template.md +31 -0
  2. package/.github/workflows/flexplm-lib.yml +27 -0
  3. package/.github/workflows/publish-to-npm.yml +121 -0
  4. package/CHANGELOG.md +32 -0
  5. package/lib/entity-processor/base-entity-processor.d.ts +0 -47
  6. package/lib/entity-processor/base-entity-processor.js +0 -53
  7. package/lib/entity-processor/base-entity-processor.spec.js +0 -1
  8. package/lib/index.d.ts +0 -1
  9. package/lib/index.js +0 -1
  10. package/lib/publish/base-process-publish-assortment.d.ts +0 -25
  11. package/lib/publish/base-process-publish-assortment.js +6 -60
  12. package/lib/publish/base-process-publish-assortment.spec.js +4 -22
  13. package/lib/publish/mockData.js +0 -5
  14. package/lib/transform/identifier-conversion-spec-mockData.js +6 -34
  15. package/lib/transform/identifier-conversion.d.ts +0 -36
  16. package/lib/transform/identifier-conversion.js +0 -36
  17. package/lib/transform/identifier-conversion.spec.js +0 -4
  18. package/lib/util/config-defaults.js +0 -3
  19. package/lib/util/config-defaults.spec.js +0 -9
  20. package/lib/util/data-converter-spec-mockData.js +3 -17
  21. package/lib/util/data-converter.d.ts +0 -97
  22. package/lib/util/data-converter.js +4 -127
  23. package/lib/util/data-converter.spec.js +0 -2
  24. package/lib/util/error-response-object.d.ts +0 -5
  25. package/lib/util/error-response-object.js +0 -7
  26. package/lib/util/event-short-message-status.js +0 -1
  27. package/lib/util/federation.js +0 -8
  28. package/lib/util/flexplm-connect.d.ts +0 -7
  29. package/lib/util/flexplm-connect.js +0 -14
  30. package/lib/util/logger-config.js +0 -1
  31. package/lib/util/map-util-spec-mockData.js +3 -17
  32. package/lib/util/map-utils.d.ts +0 -27
  33. package/lib/util/map-utils.js +0 -27
  34. package/lib/util/thumbnail-util.d.ts +0 -21
  35. package/lib/util/thumbnail-util.js +1 -28
  36. package/lib/util/thumbnail-util.spec.js +0 -6
  37. package/lib/util/type-conversion-utils-spec-mockData.js +3 -3
  38. package/lib/util/type-conversion-utils.d.ts +0 -139
  39. package/lib/util/type-conversion-utils.js +0 -140
  40. package/lib/util/type-defaults.d.ts +0 -58
  41. package/lib/util/type-defaults.js +0 -58
  42. package/lib/util/type-defaults.spec.js +5 -5
  43. package/lib/util/type-utils.d.ts +0 -21
  44. package/lib/util/type-utils.js +0 -23
  45. package/lib/util/type-utils.spec.js +0 -2
  46. package/package.json +6 -21
  47. package/publish.bat +5 -0
  48. package/publish.sh +5 -0
  49. package/src/entity-processor/base-entity-processor.spec.ts +460 -0
  50. package/src/entity-processor/base-entity-processor.ts +515 -0
  51. package/src/flexplm-request.ts +28 -0
  52. package/src/flexplm-utils.spec.ts +27 -0
  53. package/src/flexplm-utils.ts +29 -0
  54. package/src/index.ts +22 -0
  55. package/src/interfaces/interfaces.ts +122 -0
  56. package/src/interfaces/item-family-changes.ts +67 -0
  57. package/src/interfaces/publish-change-data.ts +43 -0
  58. package/src/publish/base-process-publish-assortment-callback.ts +50 -0
  59. package/src/publish/base-process-publish-assortment.spec.ts +1992 -0
  60. package/src/publish/base-process-publish-assortment.ts +1134 -0
  61. package/src/publish/mockData.ts +4561 -0
  62. package/src/transform/identifier-conversion-spec-mockData.ts +496 -0
  63. package/src/transform/identifier-conversion.spec.ts +354 -0
  64. package/src/transform/identifier-conversion.ts +282 -0
  65. package/src/util/config-defaults.spec.ts +350 -0
  66. package/src/util/config-defaults.ts +93 -0
  67. package/src/util/data-converter-spec-mockData.ts +231 -0
  68. package/src/util/data-converter.spec.ts +1041 -0
  69. package/src/util/data-converter.ts +764 -0
  70. package/src/util/error-response-object.spec.ts +116 -0
  71. package/src/util/error-response-object.ts +50 -0
  72. package/src/util/event-short-message-status.ts +22 -0
  73. package/src/util/federation.ts +172 -0
  74. package/src/util/flexplm-connect.spec.ts +132 -0
  75. package/src/util/flexplm-connect.ts +208 -0
  76. package/src/util/logger-config.ts +20 -0
  77. package/src/util/map-util-spec-mockData.ts +231 -0
  78. package/src/util/map-utils.spec.ts +103 -0
  79. package/src/util/map-utils.ts +41 -0
  80. package/src/util/mockData.ts +101 -0
  81. package/src/util/thumbnail-util.spec.ts +508 -0
  82. package/src/util/thumbnail-util.ts +272 -0
  83. package/src/util/type-conversion-utils-spec-mockData.ts +271 -0
  84. package/src/util/type-conversion-utils.spec.ts +968 -0
  85. package/src/util/type-conversion-utils.ts +460 -0
  86. package/src/util/type-defaults.spec.ts +669 -0
  87. package/src/util/type-defaults.ts +281 -0
  88. package/src/util/type-utils.spec.ts +227 -0
  89. package/src/util/type-utils.ts +144 -0
  90. package/tsconfig.json +24 -0
  91. package/tslint.json +57 -0
  92. package/lib/cli/commands/compile.d.ts +0 -1
  93. package/lib/cli/commands/compile.js +0 -71
  94. package/lib/cli/commands/create.d.ts +0 -1
  95. package/lib/cli/commands/create.js +0 -75
  96. package/lib/cli/commands/upload.d.ts +0 -1
  97. package/lib/cli/commands/upload.js +0 -217
  98. package/lib/cli/index.d.ts +0 -2
  99. package/lib/cli/index.js +0 -60
  100. package/lib/cli/template/mapping-template.ts.template +0 -18
  101. package/lib/interfaces/mapping-file.d.ts +0 -429
  102. package/lib/interfaces/mapping-file.js +0 -2
  103. package/scripts/copy-template.js +0 -10
package/tslint.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "defaultSeverity": "error",
3
+ "extends": [
4
+ "tslint:recommended"
5
+ ],
6
+ "jsRules": {
7
+ "no-unused-expression": true
8
+ },
9
+ "rules": {
10
+ "eofline": false,
11
+ "quotemark": [
12
+ true,
13
+ "single"
14
+ ],
15
+ "no-shadowed-variable": false,
16
+ "indent": false,
17
+ "member-access": [
18
+ false
19
+ ],
20
+ "no-string-literal": false,
21
+ "ordered-imports": [
22
+ false
23
+ ],
24
+ "max-line-length": [
25
+ false,
26
+ 150
27
+ ],
28
+ "member-ordering": [
29
+ false
30
+ ],
31
+ "curly": false,
32
+ "interface-name": [
33
+ false
34
+ ],
35
+ "array-type": [
36
+ false
37
+ ],
38
+ "no-empty-interface": false,
39
+ "no-empty": false,
40
+ "arrow-parens": false,
41
+ "object-literal-sort-keys": false,
42
+ "no-unused-expression": false,
43
+ "max-classes-per-file": [
44
+ false
45
+ ],
46
+ "variable-name": [
47
+ false
48
+ ],
49
+ "one-line": [
50
+ false
51
+ ],
52
+ "one-variable-per-declaration": [
53
+ false
54
+ ]
55
+ },
56
+ "rulesDirectory": []
57
+ }
@@ -1 +0,0 @@
1
- export declare function runCompile(tsPath: string): Promise<void>;
@@ -1,71 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.runCompile = void 0;
27
- const fs = __importStar(require("fs"));
28
- const path = __importStar(require("path"));
29
- function loadTypescript() {
30
- try {
31
- return require('typescript');
32
- }
33
- catch (e) {
34
- throw new Error('compile requires the "typescript" package. Install it in your project: npm install --save-dev typescript');
35
- }
36
- }
37
- async function runCompile(tsPath) {
38
- const absPath = path.resolve(process.cwd(), tsPath);
39
- if (!fs.existsSync(absPath)) {
40
- throw new Error(`File not found: ${absPath}`);
41
- }
42
- if (!absPath.endsWith('.ts')) {
43
- throw new Error(`Expected a .ts file, got: ${absPath}`);
44
- }
45
- const ts = loadTypescript();
46
- const source = fs.readFileSync(absPath, 'utf8');
47
- const result = ts.transpileModule(source, {
48
- fileName: path.basename(absPath),
49
- compilerOptions: {
50
- module: ts.ModuleKind.CommonJS,
51
- target: ts.ScriptTarget.ES2020,
52
- esModuleInterop: true,
53
- },
54
- reportDiagnostics: true,
55
- });
56
- const diagnostics = result.diagnostics || [];
57
- if (diagnostics.length > 0) {
58
- const formatHost = {
59
- getCanonicalFileName: (f) => f,
60
- getCurrentDirectory: () => process.cwd(),
61
- getNewLine: () => '\n',
62
- };
63
- const formatted = ts.formatDiagnosticsWithColorAndContext(diagnostics, formatHost);
64
- process.stderr.write(formatted);
65
- throw new Error(`Compile failed: ${diagnostics.length} diagnostic(s)`);
66
- }
67
- const outPath = absPath.replace(/\.ts$/, '.js');
68
- fs.writeFileSync(outPath, result.outputText, 'utf8');
69
- console.log(`Compiled ${outPath}`);
70
- }
71
- exports.runCompile = runCompile;
@@ -1 +0,0 @@
1
- export declare function runCreate(): Promise<void>;
@@ -1,75 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.runCreate = void 0;
27
- const fs = __importStar(require("fs"));
28
- const path = __importStar(require("path"));
29
- const readline = __importStar(require("readline"));
30
- const TEMPLATE_FILENAME = 'mapping-template.ts.template';
31
- const PLACEHOLDER = '<ORG_NAME>';
32
- function prompt(question) {
33
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
34
- const onSigint = () => {
35
- rl.close();
36
- process.stdout.write('\n');
37
- process.exit(130);
38
- };
39
- process.once('SIGINT', onSigint);
40
- return new Promise((resolve) => {
41
- rl.question(question, (answer) => {
42
- process.removeListener('SIGINT', onSigint);
43
- rl.close();
44
- resolve(answer);
45
- });
46
- });
47
- }
48
- function findTemplate() {
49
- const candidates = [
50
- path.join(__dirname, '..', 'template', TEMPLATE_FILENAME),
51
- path.join(__dirname, '..', '..', '..', 'src', 'cli', 'template', TEMPLATE_FILENAME),
52
- ];
53
- for (const candidate of candidates) {
54
- if (fs.existsSync(candidate)) {
55
- return candidate;
56
- }
57
- }
58
- throw new Error(`Could not locate ${TEMPLATE_FILENAME}. Tried:\n ${candidates.join('\n ')}`);
59
- }
60
- async function runCreate() {
61
- const orgName = (await prompt('orgName: ')).trim();
62
- if (!orgName) {
63
- throw new Error('orgName is required');
64
- }
65
- const templatePath = findTemplate();
66
- const templateBody = fs.readFileSync(templatePath, 'utf8');
67
- const rendered = templateBody.split(PLACEHOLDER).join(orgName);
68
- const outPath = path.resolve(process.cwd(), `${orgName}-transformMapping.ts`);
69
- if (fs.existsSync(outPath)) {
70
- throw new Error(`Refusing to overwrite existing file: ${outPath}`);
71
- }
72
- fs.writeFileSync(outPath, rendered, 'utf8');
73
- console.log(`Created ${outPath}`);
74
- }
75
- exports.runCreate = runCreate;
@@ -1 +0,0 @@
1
- export declare function runUpload(args: string[]): Promise<void>;
@@ -1,217 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.runUpload = void 0;
27
- const child_process_1 = require("child_process");
28
- const fs = __importStar(require("fs"));
29
- const path = __importStar(require("path"));
30
- const readline = __importStar(require("readline"));
31
- const sdk_1 = require("@contrail/sdk");
32
- function prompt(question) {
33
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
34
- return new Promise((resolve) => {
35
- rl.question(question, (answer) => {
36
- rl.close();
37
- resolve(answer.trim());
38
- });
39
- });
40
- }
41
- function promptHidden(question) {
42
- return new Promise((resolve) => {
43
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout, terminal: true });
44
- const rlAny = rl;
45
- rlAny._writeToOutput = (str) => {
46
- if (str.includes(question)) {
47
- rlAny.output.write(str);
48
- }
49
- };
50
- rl.question(question, (answer) => {
51
- rl.close();
52
- process.stdout.write('\n');
53
- resolve(answer);
54
- });
55
- });
56
- }
57
- function parseUploadArgs(args) {
58
- let filePath;
59
- let message;
60
- let branch;
61
- let skipGit = false;
62
- for (let i = 0; i < args.length; i++) {
63
- const a = args[i];
64
- if (a === '-m') {
65
- message = args[++i];
66
- if (message === undefined) {
67
- throw new Error('-m requires a commit message argument');
68
- }
69
- }
70
- else if (a === '-b') {
71
- branch = args[++i];
72
- if (branch === undefined) {
73
- throw new Error('-b requires a branch name argument');
74
- }
75
- }
76
- else if (a === '--skip-git' || a === '--skipGit') {
77
- skipGit = true;
78
- }
79
- else if (a.startsWith('-')) {
80
- throw new Error(`Unknown option: ${a}`);
81
- }
82
- else if (!filePath) {
83
- filePath = a;
84
- }
85
- else {
86
- throw new Error(`Unexpected argument: ${a}`);
87
- }
88
- }
89
- if (!filePath) {
90
- throw new Error('upload: missing <path.js> argument');
91
- }
92
- return { filePath, message, branch, skipGit };
93
- }
94
- function runGit(args, cwd) {
95
- return (0, child_process_1.execFileSync)('git', args, { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
96
- }
97
- function tryRunGit(args, cwd) {
98
- try {
99
- const stdout = runGit(args, cwd);
100
- return { ok: true, stdout, stderr: '' };
101
- }
102
- catch (err) {
103
- return {
104
- ok: false,
105
- stdout: err && err.stdout ? err.stdout.toString() : '',
106
- stderr: err && err.stderr ? err.stderr.toString() : (err && err.message) || '',
107
- };
108
- }
109
- }
110
- function buildCommitMessage(userMessage, fileId) {
111
- const lines = userMessage.split(/\r?\n/);
112
- lines[0] = `${lines[0]} [fileId: ${fileId}]`;
113
- return lines.join('\n');
114
- }
115
- async function commitToGit(absPath, fileId, options) {
116
- const repoDir = path.dirname(absPath);
117
- const versionCheck = tryRunGit(['--version'], repoDir);
118
- if (!versionCheck.ok) {
119
- console.log('git command not available; skipping git commit.');
120
- return;
121
- }
122
- const insideRepo = tryRunGit(['rev-parse', '--is-inside-work-tree'], repoDir);
123
- if (!insideRepo.ok || insideRepo.stdout.trim() !== 'true') {
124
- console.log(`Not inside a git working tree (${repoDir}); skipping git commit.`);
125
- return;
126
- }
127
- const tracked = tryRunGit(['ls-files', '--error-unmatch', absPath], repoDir);
128
- if (!tracked.ok) {
129
- const answer = (await prompt(`File is not tracked by git: ${absPath}\nAdd it to git? (y/N): `)).toLowerCase();
130
- if (answer !== 'y' && answer !== 'yes') {
131
- console.log('Nothing was done in git.');
132
- return;
133
- }
134
- }
135
- if (options.branch) {
136
- const branchResult = tryRunGit(['checkout', '-b', options.branch], repoDir);
137
- if (!branchResult.ok) {
138
- throw new Error(`Failed to create branch "${options.branch}": ${branchResult.stderr.trim()}`);
139
- }
140
- console.log(`Created and switched to branch "${options.branch}"`);
141
- }
142
- let message = options.message;
143
- if (!message) {
144
- message = await prompt('Commit message: ');
145
- if (!message) {
146
- throw new Error('A commit message is required');
147
- }
148
- }
149
- const finalMessage = buildCommitMessage(message, fileId);
150
- const addResult = tryRunGit(['add', '--', absPath], repoDir);
151
- if (!addResult.ok) {
152
- throw new Error(`git add failed: ${addResult.stderr.trim()}`);
153
- }
154
- const commitResult = tryRunGit(['commit', '-m', finalMessage, '--', absPath], repoDir);
155
- if (!commitResult.ok) {
156
- throw new Error(`git commit failed: ${commitResult.stderr.trim() || commitResult.stdout.trim()}`);
157
- }
158
- console.log(commitResult.stdout.trim());
159
- }
160
- async function runUpload(args) {
161
- const options = parseUploadArgs(args);
162
- const absPath = path.resolve(process.cwd(), options.filePath);
163
- if (!fs.existsSync(absPath)) {
164
- throw new Error(`File not found: ${absPath}`);
165
- }
166
- if (!absPath.endsWith('.js')) {
167
- throw new Error(`Expected a .js file, got: ${absPath}`);
168
- }
169
- let email = process.env.CONTRAIL_CLI_EMAIL;
170
- let password = process.env.CONTRAIL_CLI_PASSWORD;
171
- if (!email) {
172
- email = await prompt('Email: ');
173
- }
174
- if (!password) {
175
- password = await promptHidden('Password: ');
176
- }
177
- if (!email || !password) {
178
- throw new Error('Email and password are required');
179
- }
180
- delete require.cache[absPath];
181
- const loaded = require(absPath);
182
- const mapping = loaded && loaded.mapping;
183
- if (!mapping || !mapping.orgInfo) {
184
- throw new Error(`Mapping file is missing "mapping.orgInfo" export: ${absPath}`);
185
- }
186
- const { orgName, appIdentifier } = mapping.orgInfo;
187
- if (!orgName) {
188
- throw new Error(`Mapping file is missing "mapping.orgInfo.orgName": ${absPath}`);
189
- }
190
- if (!appIdentifier) {
191
- throw new Error(`Mapping file is missing "mapping.orgInfo.appIdentifier": ${absPath}`);
192
- }
193
- await (0, sdk_1.login)({ orgSlug: orgName, email, password });
194
- console.log(`Logged in to org "${orgName}" as ${email}`);
195
- const apps = await new sdk_1.Entities().get({
196
- entityName: 'app',
197
- criteria: { identifier: appIdentifier },
198
- });
199
- if (!apps || apps.length !== 1) {
200
- throw new Error(`Expected exactly one app with identifier "${appIdentifier}" in org "${orgName}", found ${apps ? apps.length : 0}`);
201
- }
202
- const app = apps[0];
203
- const buffer = fs.readFileSync(absPath);
204
- const fileName = path.basename(absPath);
205
- const fileOwner = `app:${app.id}`;
206
- const uploadedFile = await new sdk_1.Files().createAndUploadFileFromBuffer(buffer, 'application/javascript', fileName, fileOwner);
207
- const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
208
- const responsePath = `${absPath}.uploaded-${timestamp}.json`;
209
- fs.writeFileSync(responsePath, JSON.stringify(uploadedFile, null, 2), 'utf8');
210
- console.log(`Wrote response to ${responsePath}`);
211
- console.log(`FILE ID: ${uploadedFile.id}`);
212
- if (options.skipGit) {
213
- return;
214
- }
215
- await commitToGit(absPath, uploadedFile.id, options);
216
- }
217
- exports.runUpload = runUpload;
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
package/lib/cli/index.js DELETED
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const create_1 = require("./commands/create");
5
- const compile_1 = require("./commands/compile");
6
- const upload_1 = require("./commands/upload");
7
- const USAGE = `Usage: flexplm-mapping <command> [args]
8
-
9
- Commands:
10
- create Scaffold a new mapping .ts file in the current directory
11
- compile <path.ts> Transpile a mapping .ts file to .js alongside it
12
- upload <path.js> [opts] Upload a compiled mapping .js file to VibeIQ
13
-
14
- Upload options:
15
- -m <message> Git commit message (prompted if omitted)
16
- -b <branch> Create a new git branch before committing
17
- --skip-git Skip the post-upload git commit (default: commit)
18
-
19
- Environment (upload):
20
- CONTRAIL_CLI_EMAIL VibeIQ user email
21
- CONTRAIL_CLI_PASSWORD VibeIQ user password
22
- `;
23
- async function main() {
24
- const [, , command, ...rest] = process.argv;
25
- switch (command) {
26
- case 'create':
27
- await (0, create_1.runCreate)();
28
- return;
29
- case 'compile':
30
- if (!rest[0]) {
31
- console.error('compile: missing <path.ts> argument');
32
- console.error(USAGE);
33
- process.exit(1);
34
- }
35
- await (0, compile_1.runCompile)(rest[0]);
36
- return;
37
- case 'upload':
38
- if (!rest[0]) {
39
- console.error('upload: missing <path.js> argument');
40
- console.error(USAGE);
41
- process.exit(1);
42
- }
43
- await (0, upload_1.runUpload)(rest);
44
- return;
45
- case undefined:
46
- case '-h':
47
- case '--help':
48
- case 'help':
49
- console.log(USAGE);
50
- return;
51
- default:
52
- console.error(`Unknown command: ${command}`);
53
- console.error(USAGE);
54
- process.exit(1);
55
- }
56
- }
57
- main().catch((err) => {
58
- console.error(err && err.message ? err.message : err);
59
- process.exit(1);
60
- });
@@ -1,18 +0,0 @@
1
- import type { MappingFile } from '@contrail/flexplm';
2
-
3
- export const mapping: MappingFile = {
4
- orgInfo: {
5
- appIdentifier: '@vibeiq/flexplm-connector',
6
- orgName: '<ORG_NAME>',
7
- },
8
- typeConversion: {
9
- vibe2flex: {},
10
- flex2vibe: {},
11
- },
12
- LCSSeason: { vibe2flex: {}, flex2vibe: {} },
13
- LCSProduct: { vibe2flex: {}, flex2vibe: {} },
14
- LCSSKU: { vibe2flex: {}, flex2vibe: {} },
15
- LCSProductSeasonLink: { vibe2flex: {}, flex2vibe: {} },
16
- LCSSKUSeasonLink: { vibe2flex: {}, flex2vibe: {} },
17
- LCSColor: { vibe2flex: {}, flex2vibe: {} },
18
- };