@contrail/cli 3.6.0-alpha-8-alpha.85a73d5 → 3.6.0-alpha.5ecc188
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.
- package/README.md +26 -181
- package/dist/api/types.d.ts +0 -35
- package/dist/api/types.js +1 -49
- package/dist/auth/login.d.ts +4 -0
- package/dist/auth/login.js +136 -56
- package/dist/auth/login.spec.js +117 -3
- package/dist/auth/sign-in-error.d.ts +7 -0
- package/dist/auth/sign-in-error.js +24 -0
- package/dist/auth/sign-in-error.spec.js +22 -0
- package/dist/auth/sso.d.ts +38 -0
- package/dist/auth/sso.js +184 -0
- package/dist/auth/sso.spec.js +191 -0
- package/dist/basecommand.d.ts +3 -0
- package/dist/basecommand.js +10 -3
- package/dist/commands/app/getApiKey.js +2 -2
- package/dist/commands/login.d.ts +12 -0
- package/dist/commands/login.js +25 -0
- package/dist/common.d.ts +1 -4
- package/dist/common.js +1 -18
- package/dist/helpers/config/config.d.ts +3 -3
- package/dist/helpers/config/config.js +3 -3
- package/dist/helpers/file-helpers.d.ts +0 -1
- package/dist/helpers/file-helpers.js +3 -20
- package/dist/logger.js +1 -4
- package/node_modules/@contrail/entity-compare/package.json +3 -6
- package/node_modules/@contrail/loader/lib/common/conditional-columns.js +1 -1
- package/node_modules/@contrail/loader/lib/constants.d.ts +8 -0
- package/node_modules/@contrail/loader/lib/constants.js +9 -1
- package/node_modules/@contrail/loader/lib/entities-v2/linesheet-v2/item-processor.d.ts +4 -0
- package/node_modules/@contrail/loader/lib/entities-v2/linesheet-v2/item-processor.js +57 -0
- package/node_modules/@contrail/loader/lib/entities-v2/linesheet-v2/item-processor.spec.js +492 -34
- package/node_modules/@contrail/loader/lib/pipeline/validate.js +2 -52
- package/node_modules/@contrail/loader/lib/pipeline/validate.spec.js +0 -85
- package/node_modules/@contrail/loader/package.json +2 -2
- package/node_modules/@contrail/sdk/.github/workflows/publish-to-npm.yml +4 -1
- package/node_modules/@contrail/sdk/lib/auth/login.js +1 -1
- package/node_modules/@contrail/sdk/lib/config/config.d.ts +0 -3
- package/node_modules/@contrail/sdk/lib/config/config.js +7 -13
- package/node_modules/@contrail/sdk/lib/core/request.js +2 -6
- package/node_modules/@contrail/sdk/lib/entities/entities.client.d.ts +0 -2
- package/node_modules/@contrail/sdk/lib/entities/entities.client.js +1 -3
- package/node_modules/@contrail/sdk/lib/entities/entity.resource.registry.js +0 -1
- package/node_modules/@contrail/sdk/lib/index.d.ts +0 -1
- package/node_modules/@contrail/sdk/lib/index.js +0 -1
- package/node_modules/@contrail/sdk/package.json +1 -1
- package/oclif.manifest.json +50 -449
- package/package.json +12 -5
- package/dist/commands/entities/create.d.ts +0 -50
- package/dist/commands/entities/create.js +0 -633
- package/dist/commands/entities/create.spec.js +0 -583
- package/dist/commands/entities/delete.d.ts +0 -20
- package/dist/commands/entities/delete.js +0 -140
- package/dist/commands/entities/get.d.ts +0 -25
- package/dist/commands/entities/get.js +0 -269
- package/dist/commands/entities/grammar.spec.js +0 -79
- package/dist/commands/entities/output.spec.d.ts +0 -1
- package/dist/commands/entities/output.spec.js +0 -72
- package/dist/commands/entities/update.d.ts +0 -32
- package/dist/commands/entities/update.js +0 -161
- package/dist/helpers/entities/assortment-items.d.ts +0 -11
- package/dist/helpers/entities/assortment-items.js +0 -76
- package/dist/helpers/entities/batchFetch.d.ts +0 -8
- package/dist/helpers/entities/batchFetch.js +0 -49
- package/dist/helpers/entities/index.d.ts +0 -3
- package/dist/helpers/entities/index.js +0 -6
- package/dist/helpers/entities/items.d.ts +0 -6
- package/dist/helpers/entities/items.js +0 -56
- package/dist/helpers/entities/items.spec.d.ts +0 -1
- package/dist/helpers/entities/items.spec.js +0 -19
- package/dist/helpers/entities/project-items.d.ts +0 -2
- package/dist/helpers/entities/project-items.js +0 -44
- package/dist/helpers/propertySpecifications/dateRanges.d.ts +0 -34
- package/dist/helpers/propertySpecifications/dateRanges.js +0 -83
- package/dist/helpers/propertySpecifications/dateRanges.spec.d.ts +0 -1
- package/dist/helpers/propertySpecifications/dateRanges.spec.js +0 -91
- package/dist/helpers/propertySpecifications/propertySpecifications.d.ts +0 -39
- package/dist/helpers/propertySpecifications/propertySpecifications.js +0 -102
- package/dist/helpers/propertySpecifications/propertySpecifications.spec.d.ts +0 -1
- package/dist/helpers/propertySpecifications/propertySpecifications.spec.js +0 -387
- package/dist/logger.spec.d.ts +0 -1
- package/dist/logger.spec.js +0 -12
- package/node_modules/@contrail/sdk/lib/image-search/image-search.d.ts +0 -34
- package/node_modules/@contrail/sdk/lib/image-search/image-search.js +0 -42
- package/node_modules/@contrail/sdk/lib/image-search/index.d.ts +0 -1
- package/node_modules/@contrail/sdk/lib/image-search/index.js +0 -17
- package/node_modules/@contrail/sdk/scripts/replicate-bug.js +0 -69
- /package/dist/{commands/entities/create.spec.d.ts → auth/sign-in-error.spec.d.ts} +0 -0
- /package/dist/{commands/entities/grammar.spec.d.ts → auth/sso.spec.d.ts} +0 -0
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { InvocationContext } from '../config';
|
|
2
|
-
export declare type ImageSearchSource = {
|
|
3
|
-
contentId: string;
|
|
4
|
-
} | {
|
|
5
|
-
fileId: string;
|
|
6
|
-
} | {
|
|
7
|
-
imageBase64: string;
|
|
8
|
-
};
|
|
9
|
-
export interface ImageSearchOptions {
|
|
10
|
-
limit?: number;
|
|
11
|
-
minScore?: number;
|
|
12
|
-
hydrate?: boolean;
|
|
13
|
-
filterContentIds?: string[];
|
|
14
|
-
}
|
|
15
|
-
export interface ImageSearchResult {
|
|
16
|
-
contentId: string;
|
|
17
|
-
fileId: string;
|
|
18
|
-
contentHolderReference: string;
|
|
19
|
-
fileName: string;
|
|
20
|
-
contentType: string;
|
|
21
|
-
primaryFileUrl: string;
|
|
22
|
-
score: number;
|
|
23
|
-
contentHolder?: Record<string, unknown>;
|
|
24
|
-
}
|
|
25
|
-
export interface ImageSearchResponse {
|
|
26
|
-
results: ImageSearchResult[];
|
|
27
|
-
}
|
|
28
|
-
export declare class ImageSearch {
|
|
29
|
-
private ctx;
|
|
30
|
-
constructor(ctx?: InvocationContext);
|
|
31
|
-
searchByText(query: string, options?: ImageSearchOptions): Promise<ImageSearchResponse>;
|
|
32
|
-
searchSimilar(source: ImageSearchSource, options?: ImageSearchOptions): Promise<ImageSearchResponse>;
|
|
33
|
-
private post;
|
|
34
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ImageSearch = void 0;
|
|
13
|
-
const request_1 = require("../core/request");
|
|
14
|
-
const SEARCH_RESOURCE = '/image-search/search';
|
|
15
|
-
const SEARCH_BY_IMAGE_RESOURCE = '/image-search/search-by-image';
|
|
16
|
-
class ImageSearch {
|
|
17
|
-
constructor(ctx) {
|
|
18
|
-
this.ctx = ctx;
|
|
19
|
-
}
|
|
20
|
-
searchByText(query, options = {}) {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
return this.post(SEARCH_RESOURCE, Object.assign({ query }, options));
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
searchSimilar(source, options = {}) {
|
|
26
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
return this.post(SEARCH_BY_IMAGE_RESOURCE, Object.assign(Object.assign({}, source), options));
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
post(resource, body) {
|
|
31
|
-
var _a;
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const response = (yield request_1.Request.request(resource, {
|
|
34
|
-
method: 'POST',
|
|
35
|
-
body: JSON.stringify(body),
|
|
36
|
-
headers: { Accept: 'application/json', 'Content-Type': 'application/json' },
|
|
37
|
-
}, this.ctx));
|
|
38
|
-
return { results: (_a = response === null || response === void 0 ? void 0 : response.results) !== null && _a !== void 0 ? _a : [] };
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.ImageSearch = ImageSearch;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './image-search';
|
|
@@ -1,17 +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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./image-search"), exports);
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Replication script for ENGINE-92:
|
|
3
|
-
* Auth credentials set on one @contrail/sdk instance don't propagate to a second instance
|
|
4
|
-
* loaded in the same process (npm link / prerelease version scenarios).
|
|
5
|
-
*
|
|
6
|
-
* Run: node scripts/replicate-bug.js
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const path = require('path');
|
|
10
|
-
|
|
11
|
-
const libDir = path.resolve(__dirname, '../lib');
|
|
12
|
-
const indexModulePath = path.join(libDir, 'index.js');
|
|
13
|
-
|
|
14
|
-
// ---------- Helper: load a fresh module instance ----------
|
|
15
|
-
function loadFreshInstance() {
|
|
16
|
-
// Clear all sdk lib modules from the require cache to simulate a second npm installation.
|
|
17
|
-
// Match on the resolved absolute lib path so this works regardless of directory name or OS path separator.
|
|
18
|
-
Object.keys(require.cache).forEach((key) => {
|
|
19
|
-
if (key.startsWith(libDir)) {
|
|
20
|
-
delete require.cache[key];
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
return require(indexModulePath);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// ----------------------------------------------------------------
|
|
27
|
-
// SIMULATE the bug
|
|
28
|
-
// ----------------------------------------------------------------
|
|
29
|
-
|
|
30
|
-
console.log('\n======= ENGINE-92 Replication Script =======\n');
|
|
31
|
-
|
|
32
|
-
// Instance A = what @contrail/app-framework loads
|
|
33
|
-
const instanceA = loadFreshInstance();
|
|
34
|
-
|
|
35
|
-
// Instance B = what the app itself loads (separate npm copy)
|
|
36
|
-
const instanceB = loadFreshInstance();
|
|
37
|
-
|
|
38
|
-
const TEST_API_KEY = 'app:test-api-key-12345';
|
|
39
|
-
const TEST_ORG_SLUG = 'test-org';
|
|
40
|
-
|
|
41
|
-
// Step 1: App-framework calls setAppCredentials on its own SDK instance (A)
|
|
42
|
-
instanceA.setAppCredentials(TEST_API_KEY, TEST_ORG_SLUG);
|
|
43
|
-
|
|
44
|
-
// Step 2: App's own SDK reads config — this is what Request.getHeaders() does
|
|
45
|
-
const configFromB = instanceB.getConfig();
|
|
46
|
-
|
|
47
|
-
console.log('Credentials set via instance A (app-framework):');
|
|
48
|
-
console.log(' apiUserToken :', TEST_API_KEY);
|
|
49
|
-
console.log(' orgSlug :', TEST_ORG_SLUG);
|
|
50
|
-
console.log('');
|
|
51
|
-
console.log("Config read from instance B (app's SDK calls):");
|
|
52
|
-
console.log(' apiUserToken :', configFromB.apiUserToken ?? '(undefined)');
|
|
53
|
-
console.log(' orgSlug :', configFromB.orgSlug ?? '(undefined)');
|
|
54
|
-
console.log('');
|
|
55
|
-
|
|
56
|
-
const bugReproduced = configFromB.apiUserToken !== TEST_API_KEY;
|
|
57
|
-
|
|
58
|
-
if (bugReproduced) {
|
|
59
|
-
console.log('RESULT: BUG REPRODUCED ❌');
|
|
60
|
-
console.log(' Instance B cannot see credentials set by instance A.');
|
|
61
|
-
console.log(' This is why SDK calls fail with auth errors in event workflows.');
|
|
62
|
-
} else {
|
|
63
|
-
console.log('RESULT: Bug NOT reproduced — credentials ARE shared across instances ✅');
|
|
64
|
-
console.log(' (Either the fix is already applied, or the two instances resolved to the same module path.)');
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
console.log('\n============================================\n');
|
|
68
|
-
|
|
69
|
-
process.exit(bugReproduced ? 1 : 0);
|
|
File without changes
|
|
File without changes
|