@contrail/cli 3.5.2 → 3.5.3-alpha.cc8f6c0
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 +1 -25
- package/dist/api/types.d.ts +0 -5
- package/dist/api/types.js +1 -36
- package/dist/commands/types/getAll.js +0 -18
- package/dist/commands/types/loadAll.js +0 -2
- package/dist/commands/types/mergeTypeProperties.js +0 -5
- package/dist/commands/types/uploadOptionSetHierarchies.js +0 -117
- package/dist/commands/types/uploadOptionSets.js +1 -1
- package/dist/commands/types/uploadRuleSets.js +2 -85
- package/dist/commands/types/uploadTypeOverrides.js +10 -2
- package/dist/commands/types/uploadTypePolicies.js +2 -86
- package/dist/commands/types/uploadTypePropertyPolicies.d.ts +0 -1
- package/dist/commands/types/uploadTypePropertyPolicies.js +3 -139
- package/dist/helpers/types/type-uploader.js +1 -1
- package/dist/interfaces.d.ts +0 -25
- package/dist/templates/typescript/tsup.config.ts +0 -0
- package/node_modules/@contrail/org-config-migration/.github/workflows/publish-to-npm.yml +117 -0
- package/node_modules/@contrail/org-config-migration/.husky/pre-commit +0 -0
- package/node_modules/@contrail/org-config-migration/lib/index.d.ts +3 -3
- package/node_modules/@contrail/org-config-migration/lib/index.js +19 -19
- package/node_modules/@contrail/org-config-migration/lib/interfaces.d.ts +87 -97
- package/node_modules/@contrail/org-config-migration/lib/interfaces.js +2 -2
- package/node_modules/@contrail/org-config-migration/lib/services/index.d.ts +1 -1
- package/node_modules/@contrail/org-config-migration/lib/services/index.js +17 -17
- package/node_modules/@contrail/org-config-migration/lib/services/types.d.ts +12 -17
- package/node_modules/@contrail/org-config-migration/lib/services/types.js +115 -155
- package/node_modules/@contrail/org-config-migration/lib/types/exportAll.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/types/exportAll.js +34 -40
- package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSet.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSet.js +20 -20
- package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSetHierarchies.d.ts +2 -3
- package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSetHierarchies.js +16 -47
- package/node_modules/@contrail/org-config-migration/lib/types/exportOverrides.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/types/exportOverrides.js +8 -8
- package/node_modules/@contrail/org-config-migration/lib/types/exportRuleSets.d.ts +2 -3
- package/node_modules/@contrail/org-config-migration/lib/types/exportRuleSets.js +14 -39
- package/node_modules/@contrail/org-config-migration/lib/types/exportTypePolicies.d.ts +2 -3
- package/node_modules/@contrail/org-config-migration/lib/types/exportTypePolicies.js +44 -56
- package/node_modules/@contrail/org-config-migration/lib/types/exportTypePropertyPolicies.d.ts +2 -3
- package/node_modules/@contrail/org-config-migration/lib/types/exportTypePropertyPolicies.js +44 -71
- package/node_modules/@contrail/org-config-migration/lib/types/exportTypes.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/types/exportTypes.js +85 -85
- package/node_modules/@contrail/org-config-migration/lib/types/importAll.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/types/importAll.js +386 -451
- package/node_modules/@contrail/org-config-migration/lib/types/index.d.ts +8 -9
- package/node_modules/@contrail/org-config-migration/lib/types/index.js +24 -25
- package/node_modules/@contrail/org-config-migration/lib/types/parseOptionSetHierarchy.d.ts +3 -3
- package/node_modules/@contrail/org-config-migration/lib/types/parseOptionSetHierarchy.js +210 -210
- package/node_modules/@contrail/org-config-migration/lib/users/export.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/users/export.js +40 -40
- package/node_modules/@contrail/org-config-migration/lib/users/import.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/users/import.js +41 -41
- package/node_modules/@contrail/org-config-migration/lib/users/index.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/users/index.js +18 -18
- package/node_modules/@contrail/org-config-migration/package.json +1 -1
- package/oclif.manifest.json +1 -52
- package/package.json +2 -2
- package/dist/commands/types/uploadUsageInfo.d.ts +0 -15
- package/dist/commands/types/uploadUsageInfo.js +0 -180
- package/dist/commands/types/uploadUsageInfo.spec.d.ts +0 -1
- package/dist/commands/types/uploadUsageInfo.spec.js +0 -249
- package/node_modules/@contrail/org-config-migration/lib/types/exportUsageInfo.d.ts +0 -2
- package/node_modules/@contrail/org-config-migration/lib/types/exportUsageInfo.js +0 -39
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.uploadTypePropertyPolicies = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const sdk_1 = require("@contrail/sdk");
|
|
6
6
|
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
@@ -8,12 +8,10 @@ const path = tslib_1.__importStar(require("path"));
|
|
|
8
8
|
const login_1 = require("../../auth/login");
|
|
9
9
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
10
10
|
const core_1 = require("@oclif/core");
|
|
11
|
-
const type_extractor_1 = require("../../helpers/types/type-extractor");
|
|
12
11
|
const users_1 = require("../../api/users");
|
|
13
12
|
const basecommand_1 = require("../../basecommand");
|
|
14
13
|
const logger_1 = tslib_1.__importDefault(require("../../logger"));
|
|
15
14
|
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
16
|
-
const _ = tslib_1.__importStar(require("lodash"));
|
|
17
15
|
class UploadTypePropertyPolicies extends basecommand_1.BaseCommand {
|
|
18
16
|
static description = 'Upload type property policies';
|
|
19
17
|
static examples = [
|
|
@@ -38,14 +36,12 @@ async function uploadTypePropertyPolicies(dir) {
|
|
|
38
36
|
try {
|
|
39
37
|
await (0, login_1.authUser)();
|
|
40
38
|
logger_1.default.info(`${chalk_1.default.yellow.bold('TYPE PROPERTY POLICY')} Uploading`);
|
|
41
|
-
const
|
|
39
|
+
const reducedTypePropertyPolicies = await loadTPPolicies(dir);
|
|
42
40
|
await uploadTPPolicyObjects(reducedTypePropertyPolicies);
|
|
43
|
-
await uploadTypePropertyPolicyLinks(reducedTypePropertyPolicyLinks);
|
|
44
41
|
logger_1.default.info(`${chalk_1.default.yellow.bold('TYPE PROPERTY POLICY')} Uploaded`);
|
|
45
42
|
}
|
|
46
43
|
catch (e) {
|
|
47
44
|
logger_1.default.info(`${chalk_1.default.red.bold('FAIL')} Type Property Policy Upload Failed . ${e}`);
|
|
48
|
-
//TODO make this only print if a debug flag is set
|
|
49
45
|
console.trace(e);
|
|
50
46
|
return;
|
|
51
47
|
}
|
|
@@ -54,15 +50,13 @@ async function uploadTypePropertyPolicies(dir) {
|
|
|
54
50
|
exports.uploadTypePropertyPolicies = uploadTypePropertyPolicies;
|
|
55
51
|
function loadTPPolicies(fromDir) {
|
|
56
52
|
const tpps = [];
|
|
57
|
-
let tppLinks = [];
|
|
58
53
|
const dir = path.join(fromDir, 'type-property-policies');
|
|
59
54
|
try {
|
|
60
55
|
const files = fs_1.default.readdirSync(dir);
|
|
61
56
|
for (const file of files) {
|
|
62
57
|
tpps.push(js_yaml_1.default.load(fs_1.default.readFileSync(path.join(dir, file), 'utf8')));
|
|
63
58
|
}
|
|
64
|
-
|
|
65
|
-
return [tpps, tppLinks];
|
|
59
|
+
return tpps;
|
|
66
60
|
}
|
|
67
61
|
catch (e) {
|
|
68
62
|
throw new Error(`ERROR PARSING YAML: ${e}`);
|
|
@@ -155,133 +149,3 @@ async function uploadTPPolicyObjects(reducedTypePropertyPolicies) {
|
|
|
155
149
|
}
|
|
156
150
|
}
|
|
157
151
|
}
|
|
158
|
-
async function uploadTypePropertyPolicyLinks(reducedTypePropertyPolicyLinks) {
|
|
159
|
-
const typesWithProperties = await (0, type_extractor_1.getTypes)();
|
|
160
|
-
const typeProperties = [];
|
|
161
|
-
typesWithProperties.forEach((type) => {
|
|
162
|
-
if (type.typeProperties) {
|
|
163
|
-
for (const tp of type.typeProperties) {
|
|
164
|
-
tp.typeId = type.id;
|
|
165
|
-
tp.typeSlug = type.slug;
|
|
166
|
-
typeProperties.push(tp);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
const currentTPPs = await new sdk_1.Entities().get({
|
|
171
|
-
entityName: 'type-property-policy',
|
|
172
|
-
});
|
|
173
|
-
const currentTPPLinks = await new sdk_1.Entities().get({
|
|
174
|
-
entityName: 'type-property-policy-link',
|
|
175
|
-
});
|
|
176
|
-
logger_1.default.info(`found ${currentTPPLinks.length} current type property policy links`);
|
|
177
|
-
logger_1.default.info(`found ${reducedTypePropertyPolicyLinks.length} type property policy links to load`);
|
|
178
|
-
const currentLinksHashes = {};
|
|
179
|
-
for (const currentLink of currentTPPLinks) {
|
|
180
|
-
const foundTPs = findAllOccurrences(typeProperties, (tp) => tp.id === currentLink.typePropertyId);
|
|
181
|
-
for (const foundTP of foundTPs) {
|
|
182
|
-
const foundTPP = currentTPPs.find((tpp) => tpp.id === currentLink.typePropertyPolicyId);
|
|
183
|
-
if (!foundTP || !foundTPP) {
|
|
184
|
-
logger_1.default.info(`skipping unhashable, invalid policy link: ${JSON.stringify(currentLink, null, 2)}`);
|
|
185
|
-
continue;
|
|
186
|
-
}
|
|
187
|
-
const hash = `${foundTP.typeSlug}|${foundTP.slug}|${foundTPP.identifier}`;
|
|
188
|
-
currentLinksHashes[hash] = currentLink;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
logger_1.default.debug(`current links hashes: ${JSON.stringify(currentLinksHashes, null, 2)}`);
|
|
192
|
-
const reducedLinksByHashes = {};
|
|
193
|
-
for (const loadedLink of reducedTypePropertyPolicyLinks) {
|
|
194
|
-
const hash = `${loadedLink.typeSlug}|${loadedLink.typePropertySlug}|${loadedLink.typePropertyPolicyIdentifier}`;
|
|
195
|
-
reducedLinksByHashes[hash] = loadedLink;
|
|
196
|
-
}
|
|
197
|
-
const toCreate = Object.keys(reducedLinksByHashes)
|
|
198
|
-
.filter((x) => !currentLinksHashes[x])
|
|
199
|
-
.map((x) => {
|
|
200
|
-
return {
|
|
201
|
-
[x]: reducedLinksByHashes[x],
|
|
202
|
-
};
|
|
203
|
-
})
|
|
204
|
-
.reduce((a, b) => Object.assign(a, b), {});
|
|
205
|
-
const toDelete = _.uniqBy(Object.keys(currentLinksHashes)
|
|
206
|
-
.filter((x) => !reducedLinksByHashes[x])
|
|
207
|
-
.map((x) => {
|
|
208
|
-
return {
|
|
209
|
-
[x]: currentLinksHashes[x],
|
|
210
|
-
};
|
|
211
|
-
}), 'id').reduce((a, b) => Object.assign(a, b), {});
|
|
212
|
-
logger_1.default.debug(`reduced links hashes: ${JSON.stringify(reducedLinksByHashes, null, 2)}`);
|
|
213
|
-
logger_1.default.info(`found ${Object.keys(toCreate).length} type property policy links to create`);
|
|
214
|
-
logger_1.default.info(`found ${Object.keys(toDelete).length} type property policy links to delete`);
|
|
215
|
-
logger_1.default.debug(`to create: ${JSON.stringify(toCreate, null, 2)}`);
|
|
216
|
-
logger_1.default.debug(`to delete: ${JSON.stringify(toDelete, null, 2)}`);
|
|
217
|
-
logger_1.default.debug(`current links hashes to delete: ${JSON.stringify(Object.keys(currentLinksHashes).filter((x) => !reducedLinksByHashes[x]), null, 2)}`);
|
|
218
|
-
// fs.writeFileSync('toCreate.json', JSON.stringify(toCreate, null, 2));
|
|
219
|
-
// fs.writeFileSync('toDelete.json', JSON.stringify(toDelete, null, 2));
|
|
220
|
-
// fs.writeFileSync('currentLinksHashes.json', JSON.stringify(currentLinksHashes, null, 2));
|
|
221
|
-
// fs.writeFileSync('reducedLinksByHashes.json', JSON.stringify(reducedLinksByHashes, null, 2));
|
|
222
|
-
// fs.writeFileSync(
|
|
223
|
-
// 'current_link_hashes_to_delete.json',
|
|
224
|
-
// JSON.stringify(
|
|
225
|
-
// Object.keys(currentLinksHashes).filter((x) => !reducedLinksByHashes[x]),
|
|
226
|
-
// null,
|
|
227
|
-
// 2,
|
|
228
|
-
// ),
|
|
229
|
-
// );
|
|
230
|
-
// return;
|
|
231
|
-
for (const [hash, link] of Object.entries(toCreate)) {
|
|
232
|
-
try {
|
|
233
|
-
if (!transformReducedLink(link, typeProperties, currentTPPs)) {
|
|
234
|
-
continue;
|
|
235
|
-
}
|
|
236
|
-
logger_1.default.info(`Creating: ${hash}: ${JSON.stringify(link, null, 2)}`);
|
|
237
|
-
await new sdk_1.Entities().create({
|
|
238
|
-
entityName: 'type-property-policy-link',
|
|
239
|
-
object: {
|
|
240
|
-
typePropertyPolicyId: link.typePropertyPolicyId,
|
|
241
|
-
typePropertyId: link.typePropertyId,
|
|
242
|
-
},
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
catch (err) {
|
|
246
|
-
logger_1.default.error(`Error Uploading type property policy links: ${err}`);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
for (const [hash, link] of Object.entries(toDelete)) {
|
|
250
|
-
try {
|
|
251
|
-
logger_1.default.info(`Deleting: ${hash}`);
|
|
252
|
-
await new sdk_1.Entities().delete({
|
|
253
|
-
entityName: 'type-property-policy-link',
|
|
254
|
-
id: link['id'],
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
catch (err) {
|
|
258
|
-
logger_1.default.error(`Error Deleting type property policy link: ${err}`);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
function transformReducedLink(TPPLink, typeProperties, typePropertyPolicies) {
|
|
262
|
-
const foundTP = typeProperties.find((tp) => tp.slug === TPPLink.typePropertySlug && tp.typeSlug === TPPLink.typeSlug);
|
|
263
|
-
if (!foundTP) {
|
|
264
|
-
logger_1.default.error(`Could not find type property with slug ${TPPLink.typePropertySlug} `);
|
|
265
|
-
return false;
|
|
266
|
-
}
|
|
267
|
-
TPPLink.typePropertyId = foundTP.id;
|
|
268
|
-
const foundTPP = typePropertyPolicies.find((tpp) => tpp.identifier === TPPLink.typePropertyPolicyIdentifier);
|
|
269
|
-
if (!foundTPP) {
|
|
270
|
-
logger_1.default.error(`Could not find type property policy with identifier ${TPPLink.typePropertyPolicyIdentifier} `);
|
|
271
|
-
return false;
|
|
272
|
-
}
|
|
273
|
-
TPPLink.typePropertyPolicyId = foundTPP.id;
|
|
274
|
-
return true;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
function findAllOccurrences(array, evaluator) {
|
|
278
|
-
const found = [];
|
|
279
|
-
for (let i = 0; i < array.length; i++) {
|
|
280
|
-
const element = array[i];
|
|
281
|
-
if (evaluator(element)) {
|
|
282
|
-
found.push(element);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
return found;
|
|
286
|
-
}
|
|
287
|
-
exports.findAllOccurrences = findAllOccurrences;
|
|
@@ -303,7 +303,7 @@ async function uploadReducedTypeProperties(type, currentPropertyTypes, newProper
|
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
catch (err) {
|
|
306
|
-
|
|
306
|
+
logger_1.default.error(`Error Deleting Type-Property ${currentPropertyType.slug}: ${err}`);
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
}
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -370,31 +370,6 @@ export interface ReducedOptionSet {
|
|
|
370
370
|
isArchived: boolean;
|
|
371
371
|
optionSet: any[];
|
|
372
372
|
}
|
|
373
|
-
export interface ReducedUsageInfo {
|
|
374
|
-
typeId: string;
|
|
375
|
-
typePropertyId: string;
|
|
376
|
-
typePath: string;
|
|
377
|
-
typePropertySlug: string;
|
|
378
|
-
editable: boolean;
|
|
379
|
-
used: boolean;
|
|
380
|
-
formulaFunction?: string;
|
|
381
|
-
validationFunction?: string;
|
|
382
|
-
numberFormat?: any;
|
|
383
|
-
defaultValue?: string;
|
|
384
|
-
label?: string;
|
|
385
|
-
required?: boolean;
|
|
386
|
-
searchable?: boolean;
|
|
387
|
-
isUniqueProperty?: boolean;
|
|
388
|
-
isUniquePropertyInFamily?: boolean;
|
|
389
|
-
copyBehavior?: string;
|
|
390
|
-
copyDefault?: string;
|
|
391
|
-
propertyLevel?: string;
|
|
392
|
-
isArchived: boolean;
|
|
393
|
-
isFederationProperty?: boolean;
|
|
394
|
-
carryOverBehavior?: string;
|
|
395
|
-
carryOverDefault?: string;
|
|
396
|
-
}
|
|
397
|
-
export type PersistReducedUsageInfo = Omit<ReducedUsageInfo, 'typePath' | 'typePropertySlug'>;
|
|
398
373
|
export declare enum PropertyType {
|
|
399
374
|
Text = "text",
|
|
400
375
|
String = "string",
|
|
File without changes
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
name: Publish to NPM
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: ['**']
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
check-version:
|
|
11
|
+
name: Verify version is available on npm
|
|
12
|
+
if: github.event_name == 'pull_request'
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Check version not already published
|
|
18
|
+
run: |
|
|
19
|
+
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
20
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
21
|
+
echo "Checking if ${PACKAGE_NAME}@${VERSION} exists on npm..."
|
|
22
|
+
if npm view "${PACKAGE_NAME}@${VERSION}" version 2>/dev/null; then
|
|
23
|
+
echo "::error::Version ${VERSION} is already published on npm. Bump the version in package.json before merging."
|
|
24
|
+
exit 1
|
|
25
|
+
else
|
|
26
|
+
echo "Version ${VERSION} is available."
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
check-dependencies:
|
|
30
|
+
name: Verify no private dependencies
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v4
|
|
34
|
+
|
|
35
|
+
- name: Verify no private dependencies
|
|
36
|
+
run: |
|
|
37
|
+
node -e "
|
|
38
|
+
const deps = require('./package.json').dependencies || {};
|
|
39
|
+
const { execSync } = require('child_process');
|
|
40
|
+
let failed = false;
|
|
41
|
+
for (const pkg of Object.keys(deps)) {
|
|
42
|
+
try {
|
|
43
|
+
execSync('npm view ' + pkg, { stdio: 'pipe' });
|
|
44
|
+
} catch {
|
|
45
|
+
console.error('::error::Dependency ' + pkg + ' is not publicly accessible on npm');
|
|
46
|
+
failed = true;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (failed) process.exit(1);
|
|
50
|
+
console.log('All ' + Object.keys(deps).length + ' dependencies are public.');
|
|
51
|
+
"
|
|
52
|
+
|
|
53
|
+
publish-alpha:
|
|
54
|
+
name: Publish alpha
|
|
55
|
+
needs: check-dependencies
|
|
56
|
+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
permissions:
|
|
59
|
+
id-token: write
|
|
60
|
+
contents: read
|
|
61
|
+
outputs:
|
|
62
|
+
version: ${{ steps.publish.outputs.version }}
|
|
63
|
+
steps:
|
|
64
|
+
- uses: actions/checkout@v4
|
|
65
|
+
|
|
66
|
+
- uses: actions/setup-node@v4
|
|
67
|
+
with:
|
|
68
|
+
node-version: '24'
|
|
69
|
+
registry-url: 'https://registry.npmjs.org'
|
|
70
|
+
|
|
71
|
+
- name: Install and build
|
|
72
|
+
run: npm ci && npm run build
|
|
73
|
+
|
|
74
|
+
- name: Publish alpha
|
|
75
|
+
id: publish
|
|
76
|
+
run: |
|
|
77
|
+
SHORT_SHA=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-7)
|
|
78
|
+
VERSION=$(node -p "require('./package.json').version")-alpha.${SHORT_SHA}
|
|
79
|
+
npm version $VERSION --no-git-tag-version
|
|
80
|
+
OUTPUT=$(npm publish --tag alpha 2>&1) && {
|
|
81
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
82
|
+
} || {
|
|
83
|
+
if echo "$OUTPUT" | grep -q "You cannot publish over the previously published versions"; then
|
|
84
|
+
echo "::warning::Alpha ${VERSION} already published, skipping."
|
|
85
|
+
else
|
|
86
|
+
echo "::error::Failed to publish alpha ${VERSION}"
|
|
87
|
+
echo "$OUTPUT"
|
|
88
|
+
exit 1
|
|
89
|
+
fi
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
publish-release:
|
|
93
|
+
name: Publish release
|
|
94
|
+
needs: check-dependencies
|
|
95
|
+
if: github.event_name == 'push'
|
|
96
|
+
runs-on: ubuntu-latest
|
|
97
|
+
permissions:
|
|
98
|
+
id-token: write
|
|
99
|
+
contents: read
|
|
100
|
+
outputs:
|
|
101
|
+
version: ${{ steps.publish.outputs.version }}
|
|
102
|
+
steps:
|
|
103
|
+
- uses: actions/checkout@v4
|
|
104
|
+
|
|
105
|
+
- uses: actions/setup-node@v4
|
|
106
|
+
with:
|
|
107
|
+
node-version: '24'
|
|
108
|
+
registry-url: 'https://registry.npmjs.org'
|
|
109
|
+
|
|
110
|
+
- name: Install and build
|
|
111
|
+
run: npm ci && npm run build
|
|
112
|
+
|
|
113
|
+
- name: Publish release
|
|
114
|
+
id: publish
|
|
115
|
+
run: |
|
|
116
|
+
npm publish
|
|
117
|
+
echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
|
File without changes
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './services';
|
|
3
|
-
export * from './users';
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './services';
|
|
3
|
+
export * from './users';
|
|
@@ -1,19 +1,19 @@
|
|
|
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("./types"), exports);
|
|
18
|
-
__exportStar(require("./services"), exports);
|
|
19
|
-
__exportStar(require("./users"), exports);
|
|
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("./types"), exports);
|
|
18
|
+
__exportStar(require("./services"), exports);
|
|
19
|
+
__exportStar(require("./users"), exports);
|
|
@@ -1,97 +1,87 @@
|
|
|
1
|
-
export interface ReducedType {
|
|
2
|
-
slug: string;
|
|
3
|
-
label: string;
|
|
4
|
-
typePath: string;
|
|
5
|
-
isArchived: boolean;
|
|
6
|
-
typeProperties: ReducedTypeProperty[];
|
|
7
|
-
}
|
|
8
|
-
export interface ReducedDataHolder {
|
|
9
|
-
reducedTypes?: any[];
|
|
10
|
-
reducedOptionSets?: any[];
|
|
11
|
-
reducedOptionSetHierarchies?: any[];
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
ObjectReferenceList = "object_ref_list",
|
|
89
|
-
DataGrid = "data_grid",
|
|
90
|
-
CascadingSelect = "cascading_select",
|
|
91
|
-
Sequence = "sequence",
|
|
92
|
-
Constant = "constant",
|
|
93
|
-
Composite = "composite",
|
|
94
|
-
UserList = "userList",
|
|
95
|
-
Image = "image",
|
|
96
|
-
Json = "json"
|
|
97
|
-
}
|
|
1
|
+
export interface ReducedType {
|
|
2
|
+
slug: string;
|
|
3
|
+
label: string;
|
|
4
|
+
typePath: string;
|
|
5
|
+
isArchived: boolean;
|
|
6
|
+
typeProperties: ReducedTypeProperty[];
|
|
7
|
+
}
|
|
8
|
+
export interface ReducedDataHolder {
|
|
9
|
+
reducedTypes?: any[];
|
|
10
|
+
reducedOptionSets?: any[];
|
|
11
|
+
reducedOptionSetHierarchies?: any[];
|
|
12
|
+
reducedOverrides?: any[];
|
|
13
|
+
reducedRuleSets?: any[];
|
|
14
|
+
reducedTypePropertyPolicies?: any[];
|
|
15
|
+
reducedTypePolicies?: any[];
|
|
16
|
+
}
|
|
17
|
+
export interface DataHolder {
|
|
18
|
+
types?: any[];
|
|
19
|
+
optionSets?: any[];
|
|
20
|
+
optionSetHierarchies?: any[];
|
|
21
|
+
ruleSets?: any[];
|
|
22
|
+
typePropertyPolicies?: any[];
|
|
23
|
+
typePolicies?: any[];
|
|
24
|
+
typeOverrides?: any[];
|
|
25
|
+
orgUsers?: any[];
|
|
26
|
+
groups?: any[];
|
|
27
|
+
userList?: any[];
|
|
28
|
+
}
|
|
29
|
+
export interface ReducedTypeProperty {
|
|
30
|
+
id: string;
|
|
31
|
+
isArchived: boolean;
|
|
32
|
+
propertyType: PropertyType;
|
|
33
|
+
slug: string;
|
|
34
|
+
carryOverDefault: any;
|
|
35
|
+
carryOverBehavior: string;
|
|
36
|
+
label: string;
|
|
37
|
+
editable: boolean;
|
|
38
|
+
searchable: boolean;
|
|
39
|
+
core: boolean;
|
|
40
|
+
typePropertyOptionSetSlug: string;
|
|
41
|
+
formula: string;
|
|
42
|
+
referencedTypePath: string;
|
|
43
|
+
referencedTypeRole: string;
|
|
44
|
+
typePropertyUserListId: string;
|
|
45
|
+
typePropertyUserListName: string;
|
|
46
|
+
isUniqueProperty: boolean;
|
|
47
|
+
isUniquePropertyInFamily: boolean;
|
|
48
|
+
referencedTypeRootSlug: string;
|
|
49
|
+
defaultValue: string;
|
|
50
|
+
propertyLevel: string;
|
|
51
|
+
inherited: boolean;
|
|
52
|
+
formulaFunction?: string;
|
|
53
|
+
validationFunction?: string;
|
|
54
|
+
numberFormat?: any;
|
|
55
|
+
sequenceSeedValue?: number;
|
|
56
|
+
copyBehavior?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface ReducedOptionSet {
|
|
59
|
+
name: string;
|
|
60
|
+
slug: string;
|
|
61
|
+
isArchived: boolean;
|
|
62
|
+
optionSet: any[];
|
|
63
|
+
}
|
|
64
|
+
export declare enum PropertyType {
|
|
65
|
+
Text = "text",
|
|
66
|
+
String = "string",
|
|
67
|
+
Number = "number",
|
|
68
|
+
Date = "date",
|
|
69
|
+
Boolean = "boolean",
|
|
70
|
+
MultiSelect = "multi_select",
|
|
71
|
+
SingleSelect = "choice",
|
|
72
|
+
Url = "url",
|
|
73
|
+
Currency = "currency",
|
|
74
|
+
Percent = "percent",
|
|
75
|
+
Rating = "rating",
|
|
76
|
+
Formula = "formula",
|
|
77
|
+
ObjectReference = "object_reference",
|
|
78
|
+
ObjectReferenceList = "object_ref_list",
|
|
79
|
+
DataGrid = "data_grid",
|
|
80
|
+
CascadingSelect = "cascading_select",
|
|
81
|
+
Sequence = "sequence",
|
|
82
|
+
Constant = "constant",
|
|
83
|
+
Composite = "composite",
|
|
84
|
+
UserList = "userList",
|
|
85
|
+
Image = "image",
|
|
86
|
+
Json = "json"
|
|
87
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './types';
|
|
1
|
+
export * from './types';
|
|
@@ -1,17 +1,17 @@
|
|
|
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("./types"), exports);
|
|
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("./types"), exports);
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import { EntitiesClient } from '@contrail/entity-types';
|
|
2
|
-
export declare function getTypes(client: EntitiesClient, withTypeProperties?: boolean): Promise<any[]>;
|
|
3
|
-
export declare function getOptionSets(client: EntitiesClient): Promise<any[]>;
|
|
4
|
-
export declare function getOptionSetHierarchies(client: EntitiesClient): Promise<any[]>;
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function
|
|
11
|
-
export declare function
|
|
12
|
-
export declare function
|
|
13
|
-
export declare function getOverrides(client: EntitiesClient): Promise<any[]>;
|
|
14
|
-
export declare function getOverrideCopies(client: EntitiesClient): Promise<any[]>;
|
|
15
|
-
export declare function getUserLists(client: EntitiesClient): Promise<any[]>;
|
|
16
|
-
export declare function getOrgUsers(client: EntitiesClient, options?: any): Promise<any[]>;
|
|
17
|
-
export declare function getGroups(client: EntitiesClient, options?: any): Promise<any[]>;
|
|
1
|
+
import { EntitiesClient } from '@contrail/entity-types';
|
|
2
|
+
export declare function getTypes(client: EntitiesClient, withTypeProperties?: boolean): Promise<any[]>;
|
|
3
|
+
export declare function getOptionSets(client: EntitiesClient): Promise<any[]>;
|
|
4
|
+
export declare function getOptionSetHierarchies(client: EntitiesClient): Promise<any[]>;
|
|
5
|
+
export declare function getRuleSets(client: EntitiesClient): Promise<any[]>;
|
|
6
|
+
export declare function getTypePropertyPolicies(client: EntitiesClient): Promise<any[]>;
|
|
7
|
+
export declare function getTypePolicies(client: EntitiesClient): Promise<any[]>;
|
|
8
|
+
export declare function getOverrides(client: EntitiesClient): Promise<any[]>;
|
|
9
|
+
export declare function getOverrideCopies(client: EntitiesClient): Promise<any[]>;
|
|
10
|
+
export declare function getUserLists(client: EntitiesClient): Promise<any[]>;
|
|
11
|
+
export declare function getOrgUsers(client: EntitiesClient, options?: any): Promise<any[]>;
|
|
12
|
+
export declare function getGroups(client: EntitiesClient, options?: any): Promise<any[]>;
|