@contrail/cli 3.5.3-alpha.73bd011 → 3.5.3-alpha.818a5c0
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 +50 -1
- package/dist/api/org-config.d.ts +3 -0
- package/dist/api/org-config.js +26 -0
- package/dist/commands/instance/export.js +2 -0
- package/dist/commands/instance/import.js +2 -0
- package/dist/commands/org-config/export.d.ts +14 -0
- package/dist/commands/org-config/export.js +80 -0
- package/dist/commands/org-config/import.d.ts +14 -0
- package/dist/commands/org-config/import.js +73 -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 +107 -1
- package/package.json +2 -2
- 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
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ $ npm install -g @contrail/cli
|
|
|
17
17
|
$ contrail COMMAND
|
|
18
18
|
running command...
|
|
19
19
|
$ contrail (--version)
|
|
20
|
-
@contrail/cli/3.5.3-alpha.
|
|
20
|
+
@contrail/cli/3.5.3-alpha.818a5c0 linux-x64 node-v24.19.0
|
|
21
21
|
$ contrail --help [COMMAND]
|
|
22
22
|
USAGE
|
|
23
23
|
$ contrail COMMAND
|
|
@@ -61,6 +61,8 @@ To get instructions on how to set up autocomplete for your shell, run `contrail
|
|
|
61
61
|
* [`contrail load custom-entity DATAFILE CONFIGFILE`](#contrail-load-custom-entity-datafile-configfile)
|
|
62
62
|
* [`contrail load line-sheet DATAFILE CONFIGFILE`](#contrail-load-line-sheet-datafile-configfile)
|
|
63
63
|
* [`contrail load upload-and-load INCOMINGFILE CONFIGFILENAME`](#contrail-load-upload-and-load-incomingfile-configfilename)
|
|
64
|
+
* [`contrail org-config export`](#contrail-org-config-export)
|
|
65
|
+
* [`contrail org-config import ORGCONFIGFILE`](#contrail-org-config-import-orgconfigfile)
|
|
64
66
|
* [`contrail projects export PROJECTNAME`](#contrail-projects-export-projectname)
|
|
65
67
|
* [`contrail projects list`](#contrail-projects-list)
|
|
66
68
|
* [`contrail projects load TEMPLATEFILELOCATION`](#contrail-projects-load-templatefilelocation)
|
|
@@ -777,6 +779,53 @@ EXAMPLES
|
|
|
777
779
|
$ contrail load-processor upload-and-load <File Path> <Config Path>
|
|
778
780
|
```
|
|
779
781
|
|
|
782
|
+
## `contrail org-config export`
|
|
783
|
+
|
|
784
|
+
Export the org config (branding, sorting, and other org-level settings).
|
|
785
|
+
|
|
786
|
+
```
|
|
787
|
+
USAGE
|
|
788
|
+
$ contrail org-config export [-l error|warn|info|debug] [-e true|false] [-f <value>] [--overwrite]
|
|
789
|
+
|
|
790
|
+
FLAGS
|
|
791
|
+
-e, --alwaysConfirmEnv=<option> [default: true] The Environment variables
|
|
792
|
+
<options: true|false>
|
|
793
|
+
-f, --outFile=<value> [default: org-config.yml] The location for the file to be saved
|
|
794
|
+
-l, --logLevel=<option> The Log Level
|
|
795
|
+
<options: error|warn|info|debug>
|
|
796
|
+
--overwrite Replaces existing files if they exist
|
|
797
|
+
|
|
798
|
+
DESCRIPTION
|
|
799
|
+
Export the org config (branding, sorting, and other org-level settings).
|
|
800
|
+
|
|
801
|
+
EXAMPLES
|
|
802
|
+
$ contrail org-config export
|
|
803
|
+
```
|
|
804
|
+
|
|
805
|
+
## `contrail org-config import ORGCONFIGFILE`
|
|
806
|
+
|
|
807
|
+
Import the org config from an org-config.yml file
|
|
808
|
+
|
|
809
|
+
```
|
|
810
|
+
USAGE
|
|
811
|
+
$ contrail org-config import ORGCONFIGFILE [-l error|warn|info|debug] [-e true|false]
|
|
812
|
+
|
|
813
|
+
ARGUMENTS
|
|
814
|
+
ORGCONFIGFILE The .yml file containing the org config
|
|
815
|
+
|
|
816
|
+
FLAGS
|
|
817
|
+
-e, --alwaysConfirmEnv=<option> [default: true] The Environment variables
|
|
818
|
+
<options: true|false>
|
|
819
|
+
-l, --logLevel=<option> The Log Level
|
|
820
|
+
<options: error|warn|info|debug>
|
|
821
|
+
|
|
822
|
+
DESCRIPTION
|
|
823
|
+
Import the org config from an org-config.yml file
|
|
824
|
+
|
|
825
|
+
EXAMPLES
|
|
826
|
+
$ contrail org-config import <ORG_CONFIG_FILE>
|
|
827
|
+
```
|
|
828
|
+
|
|
780
829
|
## `contrail projects export PROJECTNAME`
|
|
781
830
|
|
|
782
831
|
Export a project.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createOrgConfig = exports.updateOrgConfig = exports.getOrgConfigs = void 0;
|
|
4
|
+
const sdk_1 = require("@contrail/sdk");
|
|
5
|
+
async function getOrgConfigs(options) {
|
|
6
|
+
return new sdk_1.Entities().get({
|
|
7
|
+
entityName: 'org-config',
|
|
8
|
+
...options,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
exports.getOrgConfigs = getOrgConfigs;
|
|
12
|
+
async function updateOrgConfig(id, changes) {
|
|
13
|
+
return new sdk_1.Entities().update({
|
|
14
|
+
entityName: 'org-config',
|
|
15
|
+
id,
|
|
16
|
+
object: changes,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
exports.updateOrgConfig = updateOrgConfig;
|
|
20
|
+
async function createOrgConfig(orgConfig) {
|
|
21
|
+
return new sdk_1.Entities().create({
|
|
22
|
+
entityName: 'org-config',
|
|
23
|
+
object: orgConfig,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
exports.createOrgConfig = createOrgConfig;
|
|
@@ -6,6 +6,7 @@ const core_1 = require("@oclif/core");
|
|
|
6
6
|
const getAll_1 = require("../types/getAll");
|
|
7
7
|
const export_1 = require("../users/export");
|
|
8
8
|
const export_2 = require("../groups/export");
|
|
9
|
+
const export_3 = require("../org-config/export");
|
|
9
10
|
const basecommand_1 = require("../../basecommand");
|
|
10
11
|
class ExportInstance extends basecommand_1.BaseCommand {
|
|
11
12
|
static description = 'Exports an data of an instance including types and users';
|
|
@@ -32,6 +33,7 @@ class ExportInstance extends basecommand_1.BaseCommand {
|
|
|
32
33
|
await (0, getAll_1.getAll)(this.flags.outDir, this.flags.overwrite);
|
|
33
34
|
await (0, export_1.exportUsers)(path.join(this.flags.outDir, 'users.yml'), this.flags.overwrite);
|
|
34
35
|
await (0, export_2.exportGroups)(path.join(this.flags.outDir, 'groups.yml'), this.flags.overwrite);
|
|
36
|
+
await (0, export_3.exportOrgConfig)(path.join(this.flags.outDir, 'org-config.yml'), this.flags.overwrite);
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
exports.default = ExportInstance;
|
|
@@ -8,6 +8,7 @@ const import_1 = require("../users/import");
|
|
|
8
8
|
const import_2 = require("../groups/import");
|
|
9
9
|
const uploadTypePropertyPolicies_1 = require("../types/uploadTypePropertyPolicies");
|
|
10
10
|
const uploadTypePolicies_1 = require("../types/uploadTypePolicies");
|
|
11
|
+
const import_3 = require("../org-config/import");
|
|
11
12
|
const basecommand_1 = require("../../basecommand");
|
|
12
13
|
class ImportInstance extends basecommand_1.BaseCommand {
|
|
13
14
|
static description = 'Import the data to an instance, including types and users';
|
|
@@ -30,6 +31,7 @@ class ImportInstance extends basecommand_1.BaseCommand {
|
|
|
30
31
|
await (0, import_2.uploadGroups)(path.join(this.flags.dir, 'groups.yml'));
|
|
31
32
|
await (0, uploadTypePropertyPolicies_1.uploadTypePropertyPolicies)(this.flags.dir);
|
|
32
33
|
await (0, uploadTypePolicies_1.uploadTypePolicies)(this.flags.dir);
|
|
34
|
+
await (0, import_3.uploadOrgConfig)(path.join(this.flags.dir, 'org-config.yml'));
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
exports.default = ImportInstance;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../basecommand';
|
|
2
|
+
export declare const DEFAULT_FILE_LOCATION = "org-config.yml";
|
|
3
|
+
export default class ExportOrgConfig extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
outFile: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
overwrite: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare function exportOrgConfig(fileLocation: string, overwrite: boolean): Promise<void>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exportOrgConfig = exports.DEFAULT_FILE_LOCATION = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const path = tslib_1.__importStar(require("path"));
|
|
6
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
8
|
+
const login_1 = require("../../auth/login");
|
|
9
|
+
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
10
|
+
const core_1 = require("@oclif/core");
|
|
11
|
+
const file_helpers_1 = require("../../helpers/file-helpers");
|
|
12
|
+
const org_config_1 = require("../../api/org-config");
|
|
13
|
+
const basecommand_1 = require("../../basecommand");
|
|
14
|
+
exports.DEFAULT_FILE_LOCATION = 'org-config.yml';
|
|
15
|
+
const ORG_SPECIFIC_FIELDS = [
|
|
16
|
+
'id',
|
|
17
|
+
'orgId',
|
|
18
|
+
'createdOn',
|
|
19
|
+
'updatedOn',
|
|
20
|
+
'createdById',
|
|
21
|
+
'updatedById',
|
|
22
|
+
'createdBy',
|
|
23
|
+
'updatedBy',
|
|
24
|
+
];
|
|
25
|
+
class ExportOrgConfig extends basecommand_1.BaseCommand {
|
|
26
|
+
static description = 'Export the org config (branding, sorting, and other org-level settings).';
|
|
27
|
+
static examples = [
|
|
28
|
+
`$ contrail org-config export
|
|
29
|
+
`,
|
|
30
|
+
];
|
|
31
|
+
static flags = {
|
|
32
|
+
...basecommand_1.BaseCommand.baseFlags,
|
|
33
|
+
outFile: core_1.Flags.string({
|
|
34
|
+
char: 'f',
|
|
35
|
+
description: 'The location for the file to be saved',
|
|
36
|
+
required: false,
|
|
37
|
+
default: exports.DEFAULT_FILE_LOCATION,
|
|
38
|
+
}),
|
|
39
|
+
overwrite: core_1.Flags.boolean({
|
|
40
|
+
description: 'Replaces existing files if they exist',
|
|
41
|
+
required: false,
|
|
42
|
+
default: false,
|
|
43
|
+
}),
|
|
44
|
+
};
|
|
45
|
+
async run() {
|
|
46
|
+
try {
|
|
47
|
+
await (0, login_1.authUser)();
|
|
48
|
+
this.log(`${chalk_1.default.blue.bold('START')} Getting Org Config.`);
|
|
49
|
+
await exportOrgConfig(this.flags.outFile ?? exports.DEFAULT_FILE_LOCATION, this.flags.overwrite);
|
|
50
|
+
this.log(`${chalk_1.default.yellow.bold('ORG CONFIG')} Done`);
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
this.log(`${chalk_1.default.red.bold('FAIL')} Org Config download Failed. ${e}`);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
this.log(`${chalk_1.default.green.bold('COMPLETE')} Org Config download Complete.`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.default = ExportOrgConfig;
|
|
60
|
+
async function exportOrgConfig(fileLocation, overwrite) {
|
|
61
|
+
const orgConfigs = await (0, org_config_1.getOrgConfigs)();
|
|
62
|
+
if (!Array.isArray(orgConfigs) || orgConfigs.length === 0) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const orgConfig = { ...orgConfigs[0] };
|
|
66
|
+
for (const field of ORG_SPECIFIC_FIELDS) {
|
|
67
|
+
delete orgConfig[field];
|
|
68
|
+
}
|
|
69
|
+
await saveData(orgConfig, fileLocation, overwrite);
|
|
70
|
+
}
|
|
71
|
+
exports.exportOrgConfig = exportOrgConfig;
|
|
72
|
+
async function saveData(data, fileLocation, overwrite) {
|
|
73
|
+
const yamlStr = js_yaml_1.default.dump(data);
|
|
74
|
+
const CURRENT_DIR = process.cwd();
|
|
75
|
+
const pathToWrite = path.resolve(path.join(CURRENT_DIR, fileLocation));
|
|
76
|
+
if (fs_1.default.existsSync(pathToWrite)) {
|
|
77
|
+
await (0, file_helpers_1.safeFileOverwrite)(pathToWrite, overwrite);
|
|
78
|
+
}
|
|
79
|
+
fs_1.default.writeFileSync(pathToWrite, yamlStr, 'utf8');
|
|
80
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../basecommand';
|
|
2
|
+
export default class ImportOrgConfig extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
static args: {
|
|
10
|
+
orgConfigFile: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare function uploadOrgConfig(fileLocation: string): Promise<void>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uploadOrgConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const path = tslib_1.__importStar(require("path"));
|
|
6
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
8
|
+
const login_1 = require("../../auth/login");
|
|
9
|
+
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
10
|
+
const core_1 = require("@oclif/core");
|
|
11
|
+
const org_config_1 = require("../../api/org-config");
|
|
12
|
+
const basecommand_1 = require("../../basecommand");
|
|
13
|
+
class ImportOrgConfig extends basecommand_1.BaseCommand {
|
|
14
|
+
static description = 'Import the org config from an org-config.yml file';
|
|
15
|
+
static examples = [
|
|
16
|
+
`$ contrail org-config import <ORG_CONFIG_FILE>
|
|
17
|
+
`,
|
|
18
|
+
];
|
|
19
|
+
static flags = {
|
|
20
|
+
...basecommand_1.BaseCommand.baseFlags,
|
|
21
|
+
};
|
|
22
|
+
static args = {
|
|
23
|
+
orgConfigFile: core_1.Args.string({
|
|
24
|
+
description: 'The .yml file containing the org config',
|
|
25
|
+
required: true,
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
28
|
+
async run() {
|
|
29
|
+
try {
|
|
30
|
+
await (0, login_1.authUser)();
|
|
31
|
+
this.log(`${chalk_1.default.blue.bold('START')} Uploading Org Config.`);
|
|
32
|
+
this.log(`${chalk_1.default.yellow.bold('ORG CONFIG')} Uploading`);
|
|
33
|
+
await uploadOrgConfig(this.args.orgConfigFile);
|
|
34
|
+
this.log(`${chalk_1.default.yellow.bold('ORG CONFIG')} Uploaded`);
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
this.log(`${chalk_1.default.red.bold('FAIL')} Org Config Upload Failed. ${e}`);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
this.log(`${chalk_1.default.green.bold('COMPLETE')} Org Config Upload Complete.`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.default = ImportOrgConfig;
|
|
44
|
+
function getOrgConfigFile(fileLocation) {
|
|
45
|
+
const CURRENT_DIR = process.cwd();
|
|
46
|
+
try {
|
|
47
|
+
const fullPath = path.join(CURRENT_DIR, fileLocation);
|
|
48
|
+
const doc = js_yaml_1.default.load(fs_1.default.readFileSync(fullPath, 'utf8'));
|
|
49
|
+
return doc;
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
throw new Error(`ERROR PARSING YAML: ${e}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async function uploadOrgConfig(fileLocation) {
|
|
56
|
+
const CURRENT_DIR = process.cwd();
|
|
57
|
+
if (!fs_1.default.existsSync(path.join(CURRENT_DIR, fileLocation))) {
|
|
58
|
+
console.log(`No org config file found at ${fileLocation}. Skipping.`);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const orgConfig = getOrgConfigFile(fileLocation);
|
|
62
|
+
if (!orgConfig || typeof orgConfig !== 'object') {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const existingOrgConfigs = await (0, org_config_1.getOrgConfigs)();
|
|
66
|
+
if (Array.isArray(existingOrgConfigs) && existingOrgConfigs.length > 0) {
|
|
67
|
+
await (0, org_config_1.updateOrgConfig)(existingOrgConfigs[0].id, orgConfig);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
await (0, org_config_1.createOrgConfig)(orgConfig);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.uploadOrgConfig = uploadOrgConfig;
|
|
@@ -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);
|