@suitegeezus/suitecloud-stacker 25.2.127
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/.idea/compiler.xml +6 -0
- package/.idea/git_toolbox_blame.xml +6 -0
- package/.idea/git_toolbox_prj.xml +15 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/suitecloud-stacker.iml +9 -0
- package/.idea/vcs.xml +6 -0
- package/CONTRIBUTING.md +72 -0
- package/README.md +242 -0
- package/bin/updateModule.d.ts +6 -0
- package/bin/updateModule.js +12 -0
- package/commands/CONTRIBUTING.md +7 -0
- package/commands/accountManageauth.d.ts +93 -0
- package/commands/accountManageauth.js +228 -0
- package/commands/accountSetup.d.ts +56 -0
- package/commands/accountSetup.js +218 -0
- package/commands/customhook/compiless.d.ts +10 -0
- package/commands/customhook/compiless.js +46 -0
- package/commands/customhook/watchss.d.ts +14 -0
- package/commands/customhook/watchss.js +77 -0
- package/commands/fileImport.d.ts +31 -0
- package/commands/fileImport.js +503 -0
- package/commands/fileList.d.ts +19 -0
- package/commands/fileList.js +40 -0
- package/commands/fileUpload.d.ts +52 -0
- package/commands/fileUpload.js +355 -0
- package/commands/generic.d.ts +5 -0
- package/commands/generic.js +13 -0
- package/commands/objectImport.d.ts +32 -0
- package/commands/objectImport.js +287 -0
- package/commands/objectList.d.ts +13 -0
- package/commands/objectList.js +78 -0
- package/commands/projectCreate.d.ts +31 -0
- package/commands/projectCreate.js +506 -0
- package/commands/projectDeploy.d.ts +25 -0
- package/commands/projectDeploy.js +371 -0
- package/commands/projectPackage.d.ts +10 -0
- package/commands/projectPackage.js +32 -0
- package/commands/projectValidate.d.ts +21 -0
- package/commands/projectValidate.js +112 -0
- package/commands/sdfAcs_authmap.d.ts +15 -0
- package/commands/sdfAcs_authmap.js +26 -0
- package/commands/sdfAcs_clean.d.ts +20 -0
- package/commands/sdfAcs_clean.js +22 -0
- package/deleteManifest.cjs +11 -0
- package/demo.md +26 -0
- package/index.d.ts +284 -0
- package/lib/MakeJestTestsFromDeploy.d.ts +13 -0
- package/lib/MakeJestTestsFromDeploy.js +60 -0
- package/lib/addGitKeep.d.ts +5 -0
- package/lib/addGitKeep.js +40 -0
- package/lib/addSdfObjectDirs.d.ts +5 -0
- package/lib/addSdfObjectDirs.js +16 -0
- package/lib/callCli.d.ts +7 -0
- package/lib/callCli.js +26 -0
- package/lib/compileHelper.d.ts +44 -0
- package/lib/compileHelper.js +196 -0
- package/lib/deleteProjectJson.d.ts +6 -0
- package/lib/deleteProjectJson.js +16 -0
- package/lib/deployFileHelper.d.ts +77 -0
- package/lib/deployFileHelper.js +249 -0
- package/lib/handleRootProjectJson.d.ts +10 -0
- package/lib/handleRootProjectJson.js +30 -0
- package/lib/isProd.d.ts +9 -0
- package/lib/isProd.js +13 -0
- package/lib/logHelper.d.ts +5 -0
- package/lib/logHelper.js +13 -0
- package/lib/logger.d.ts +6 -0
- package/lib/logger.js +10 -0
- package/lib/makeDeployXml.d.ts +6 -0
- package/lib/makeDeployXml.js +30 -0
- package/lib/makeJest.d.ts +12 -0
- package/lib/makeJest.js +58 -0
- package/lib/makeManifestXml.d.ts +6 -0
- package/lib/makeManifestXml.js +21 -0
- package/lib/makeProjectJson.d.ts +6 -0
- package/lib/makeProjectJson.js +16 -0
- package/lib/onErrorHelper.d.ts +31 -0
- package/lib/onErrorHelper.js +93 -0
- package/lib/pathHelpers.d.ts +133 -0
- package/lib/pathHelpers.js +428 -0
- package/lib/pause.d.ts +6 -0
- package/lib/pause.js +10 -0
- package/lib/projectJsonHelpers.d.ts +29 -0
- package/lib/projectJsonHelpers.js +92 -0
- package/lib/promptHelpers.d.ts +77 -0
- package/lib/promptHelpers.js +195 -0
- package/lib/removeFiles.d.ts +20 -0
- package/lib/removeFiles.js +46 -0
- package/lib/sdf.d.ts +11 -0
- package/lib/sdf.js +158 -0
- package/lib/spawnSuitecloudChild.d.ts +30 -0
- package/lib/spawnSuitecloudChild.js +88 -0
- package/lib/switchAuth.d.ts +17 -0
- package/lib/switchAuth.js +23 -0
- package/lib/tempFileHelper.d.ts +29 -0
- package/lib/tempFileHelper.js +70 -0
- package/lib/updateModule.d.ts +10 -0
- package/lib/updateModule.js +79 -0
- package/lib/validators.d.ts +12 -0
- package/lib/validators.js +25 -0
- package/package.json +38 -0
- package/safeCommands.d.ts +95 -0
- package/safeCommands.js +959 -0
- package/sdf.config.js +15 -0
- package/sdf.exe.js +16 -0
- package/templates/customizations.projectroot.d.ts +74 -0
- package/templates/makeModuleTypeDef.d.ts +5 -0
- package/templates/makeModuleTypeDef.js +29 -0
- package/templates/sdfGitIgnore.txt +42 -0
- package/templates/suitecloud.config.js +17 -0
- package/templates/tsconfig.ss21.projectroot.json +64 -0
- package/types/colors.d.ts +43 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file sdf/lib/makeDeployXml.ts
|
|
4
|
+
* @author Gerald Gillespie <gerald.gillespie@fullscript.com>
|
|
5
|
+
*/
|
|
6
|
+
const fs = require("node:fs");
|
|
7
|
+
const generic = `<deploy>
|
|
8
|
+
<configuration>
|
|
9
|
+
<path>~/AccountConfiguration/*</path>
|
|
10
|
+
</configuration>
|
|
11
|
+
<files>
|
|
12
|
+
<path>~/FileCabinet/*</path>
|
|
13
|
+
</files>
|
|
14
|
+
<objects>
|
|
15
|
+
<path>~/Objects/*</path>
|
|
16
|
+
</objects>
|
|
17
|
+
<translationimports>
|
|
18
|
+
<path>~/Translations/*</path>
|
|
19
|
+
</translationimports>
|
|
20
|
+
</deploy>`;
|
|
21
|
+
const makeDeployXml = async (path) => {
|
|
22
|
+
try {
|
|
23
|
+
fs.writeFileSync(path, generic, 'utf8');
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
console.error('Error writing deploy ***************************', path);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
module.exports = makeDeployXml;
|
|
30
|
+
//# sourceMappingURL=makeDeployXml.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file sdf/lib/makeJest.ts
|
|
3
|
+
* @author Gerald Gillespie <gerald.gillespie@fullscript.com>
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @description - Makes the Jest export for your folder.
|
|
7
|
+
* It can figure out the rootDir based on the current-working-directory.
|
|
8
|
+
* @param [folder] - maybe the account . e.g. 135243 or ['26346363','src']. usually this can be calculated
|
|
9
|
+
* @param [jestRoot] - usually needed
|
|
10
|
+
* @returns {object} exports needed for your local jest config
|
|
11
|
+
*/
|
|
12
|
+
export declare const makeJest: (folder?: string, jestRoot?: string) => any;
|
package/lib/makeJest.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file sdf/lib/makeJest.ts
|
|
4
|
+
* @author Gerald Gillespie <gerald.gillespie@fullscript.com>
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.makeJest = void 0;
|
|
8
|
+
// @ts-expect-error it does not have a typedef yet
|
|
9
|
+
const SuiteCloudJestConfiguration = require("@oracle/suitecloud-unit-testing/jest-configuration/SuiteCloudJestConfiguration");
|
|
10
|
+
const nodePath = require("node:path");
|
|
11
|
+
const pathHelpers = require("./pathHelpers");
|
|
12
|
+
/**
|
|
13
|
+
* @description - Makes the Jest export for your folder.
|
|
14
|
+
* It can figure out the rootDir based on the current-working-directory.
|
|
15
|
+
* @param [folder] - maybe the account . e.g. 135243 or ['26346363','src']. usually this can be calculated
|
|
16
|
+
* @param [jestRoot] - usually needed
|
|
17
|
+
* @returns {object} exports needed for your local jest config
|
|
18
|
+
*/
|
|
19
|
+
const makeJest = (folder, jestRoot) => {
|
|
20
|
+
// this is the root of the project
|
|
21
|
+
const rootDir = jestRoot || pathHelpers.getRootOfProject();
|
|
22
|
+
const derivedFolder = pathHelpers.getDifferenceFromProjectRootToFileCabinet(process.cwd(), rootDir);
|
|
23
|
+
const effectiveFolder = folder || derivedFolder;
|
|
24
|
+
// console.log({folder,rootDir,derivedFolder, effectiveFolder}, process.cwd());
|
|
25
|
+
const { moduleNameMapper, ...rest } = SuiteCloudJestConfiguration.build({
|
|
26
|
+
/** @description - typically this is src, but it is whatever is under FileCabinet and between the root
|
|
27
|
+
__dirname.replace(/^.*\/([^\/]+)\/FileCabinet\/SuiteScripts\/.*$/,'$1' ),
|
|
28
|
+
*/
|
|
29
|
+
// symlink as a pre-test action or load this from a config
|
|
30
|
+
projectFolder: folder || derivedFolder,
|
|
31
|
+
projectType: SuiteCloudJestConfiguration.ProjectType.ACP,
|
|
32
|
+
restoreMocks: true
|
|
33
|
+
});
|
|
34
|
+
const bits = ['<rootDir>'];
|
|
35
|
+
if (effectiveFolder)
|
|
36
|
+
bits.push(effectiveFolder);
|
|
37
|
+
const mapped = nodePath.join(...bits.filter(Boolean), 'FileCabinet/SuiteScripts/$1.js');
|
|
38
|
+
// console.log({mapped});
|
|
39
|
+
// add globals for Netsuite
|
|
40
|
+
Object.assign(globalThis, {
|
|
41
|
+
debug: (a, b) => undefined,
|
|
42
|
+
audit: (a, b) => undefined,
|
|
43
|
+
error: (a, b) => undefined,
|
|
44
|
+
emergency: (a, b) => undefined,
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
rootDir,
|
|
48
|
+
testMatch: [`${folder || process.cwd()}/**/__tests__/**/*.[jt]s?(x)`, `${folder || process.cwd()}/**/?(*.)+(test).[jt]s?(x)`],
|
|
49
|
+
moduleNameMapper: {
|
|
50
|
+
// allow a leading slash or not
|
|
51
|
+
['^/?\\bSuiteScripts\\b/(.*)(.js)?$']: mapped,
|
|
52
|
+
...moduleNameMapper,
|
|
53
|
+
},
|
|
54
|
+
...rest,
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
exports.makeJest = makeJest;
|
|
58
|
+
//# sourceMappingURL=makeJest.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file sdf/lib/makeManifestXml.ts
|
|
4
|
+
* @author Gerald Gillespie <gerald.gillespie@fullscript.com>
|
|
5
|
+
*/
|
|
6
|
+
const fs = require("node:fs/promises");
|
|
7
|
+
const nodePath = require("node:path");
|
|
8
|
+
const makeManifest = async (path, folder, fileName = 'manifest.xml') => {
|
|
9
|
+
const generic = `<manifest projecttype="ACCOUNTCUSTOMIZATION">
|
|
10
|
+
<projectname>${folder}</projectname>
|
|
11
|
+
<frameworkversion>1.0</frameworkversion>
|
|
12
|
+
</manifest>`;
|
|
13
|
+
try {
|
|
14
|
+
return fs.writeFile(nodePath.join(path, fileName), generic, { encoding: 'utf-8' });
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
console.error('Error writing manifest ***************************', folder);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
module.exports = makeManifest;
|
|
21
|
+
//# sourceMappingURL=makeManifestXml.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file sdf/lib/makeProjectJson.ts
|
|
4
|
+
* @author Gerald Gillespie <gerald.gillespie@fullscript.com>
|
|
5
|
+
*/
|
|
6
|
+
const fs = require("node:fs");
|
|
7
|
+
const makeProjectJson = (path, authid, folder, debug) => {
|
|
8
|
+
const generic = JSON.stringify({
|
|
9
|
+
"defaultAuthId": authid,
|
|
10
|
+
"defaultProjectFolder": folder,
|
|
11
|
+
"debug": Boolean(debug)
|
|
12
|
+
}, null, 2);
|
|
13
|
+
return fs.writeFileSync(path, generic, { encoding: 'utf-8' });
|
|
14
|
+
};
|
|
15
|
+
module.exports = makeProjectJson;
|
|
16
|
+
//# sourceMappingURL=makeProjectJson.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file /Users/geraldgillespie/code/nsaccounts/sdf/lib/onErrorHelper
|
|
3
|
+
* @author Gerald Gillespie <gerald.gillespie@fullscript.com>
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @description - make an error message
|
|
7
|
+
* - SDF does not like `Error` objects, but we want the stack info so we require one but then we serialize it to report it later
|
|
8
|
+
* - if it detects that the error is already of the same origin then it will return that same error instead of creating a new one
|
|
9
|
+
|
|
10
|
+
* @example When calling this directly you should use the form where like this:
|
|
11
|
+
* ```ts
|
|
12
|
+
* makeError('whateverOrigin', new Error('my custom message'));
|
|
13
|
+
* ```
|
|
14
|
+
* this will log the stack for you but also pass it correctly to `onError` which requires a string;
|
|
15
|
+
* @param {string} origin - becomes the name
|
|
16
|
+
* @param {Error} [error]
|
|
17
|
+
* @returns {string} - we have to return a string for SDF `onError`
|
|
18
|
+
*/
|
|
19
|
+
export declare const makeError: (origin: string, error?: string | Error | object | unknown) => string;
|
|
20
|
+
/**
|
|
21
|
+
* @description - Will detect if the origin matches the handler. call the handler when it does
|
|
22
|
+
*
|
|
23
|
+
* The handler is your
|
|
24
|
+
* @see {SdfCommand}
|
|
25
|
+
* @param {string} origin - the name of the handler
|
|
26
|
+
* @param {string} error - the native error
|
|
27
|
+
* @param {Function} [onMatch] - async friendly callback
|
|
28
|
+
*/
|
|
29
|
+
export declare const detectOriginAndReturn: <E extends string | {
|
|
30
|
+
_defaultMessage: string;
|
|
31
|
+
}>(origin: string, error: E, onMatch?: (error: string) => Promise<E | string> | E | string) => Promise<string | E>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file /Users/geraldgillespie/code/nsaccounts/sdf/lib/onErrorHelper
|
|
4
|
+
* @author Gerald Gillespie <gerald.gillespie@fullscript.com>
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.detectOriginAndReturn = exports.makeError = void 0;
|
|
8
|
+
const promptHelper = require("./promptHelpers");
|
|
9
|
+
const printError = (error) => {
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @description - make an error message
|
|
13
|
+
* - SDF does not like `Error` objects, but we want the stack info so we require one but then we serialize it to report it later
|
|
14
|
+
* - if it detects that the error is already of the same origin then it will return that same error instead of creating a new one
|
|
15
|
+
|
|
16
|
+
* @example When calling this directly you should use the form where like this:
|
|
17
|
+
* ```ts
|
|
18
|
+
* makeError('whateverOrigin', new Error('my custom message'));
|
|
19
|
+
* ```
|
|
20
|
+
* this will log the stack for you but also pass it correctly to `onError` which requires a string;
|
|
21
|
+
* @param {string} origin - becomes the name
|
|
22
|
+
* @param {Error} [error]
|
|
23
|
+
* @returns {string} - we have to return a string for SDF `onError`
|
|
24
|
+
*/
|
|
25
|
+
const makeError = (origin, error) => {
|
|
26
|
+
if (typeof error === 'string') {
|
|
27
|
+
// check if it was a rethrown custom error
|
|
28
|
+
try {
|
|
29
|
+
JSON.parse(error);
|
|
30
|
+
// if it's JSON then it's already good
|
|
31
|
+
return error;
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
// otherwise make our own
|
|
35
|
+
const asError = new Error(error);
|
|
36
|
+
asError.name = origin.toUpperCase();
|
|
37
|
+
return (0, exports.makeError)(origin, asError);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (error === null)
|
|
41
|
+
return (0, exports.makeError)(origin, new Error('Unknown'));
|
|
42
|
+
if (typeof error === 'object' && typeof Reflect.get(error, 'message') === 'string') {
|
|
43
|
+
// we need to print it and then serialize it and recurse
|
|
44
|
+
const uniqueName = new Set();
|
|
45
|
+
uniqueName.add(origin.toUpperCase());
|
|
46
|
+
if (!Reflect.has(error, 'name'))
|
|
47
|
+
throw new Error('make Error was not called correctly');
|
|
48
|
+
uniqueName.add(Reflect.get(error, 'name').toUpperCase());
|
|
49
|
+
const name = [...uniqueName].join(':');
|
|
50
|
+
// re-name this error object
|
|
51
|
+
const custom = JSON.stringify({
|
|
52
|
+
name,
|
|
53
|
+
message: Reflect.get(error, 'message')
|
|
54
|
+
} /* no formatting */);
|
|
55
|
+
// print it for forensics
|
|
56
|
+
process.stdout.write(promptHelper.goColor('SUBTLE', '\n', name, ':', Reflect.get(error, 'stack')));
|
|
57
|
+
// only way out of the recursion;
|
|
58
|
+
return custom;
|
|
59
|
+
}
|
|
60
|
+
return (0, exports.makeError)(origin.toUpperCase(), 'unknown ' + typeof error);
|
|
61
|
+
};
|
|
62
|
+
exports.makeError = makeError;
|
|
63
|
+
/**
|
|
64
|
+
* @description - Will detect if the origin matches the handler. call the handler when it does
|
|
65
|
+
*
|
|
66
|
+
* The handler is your
|
|
67
|
+
* @see {SdfCommand}
|
|
68
|
+
* @param {string} origin - the name of the handler
|
|
69
|
+
* @param {string} error - the native error
|
|
70
|
+
* @param {Function} [onMatch] - async friendly callback
|
|
71
|
+
*/
|
|
72
|
+
const detectOriginAndReturn = async (origin, error, onMatch) => {
|
|
73
|
+
let message;
|
|
74
|
+
let name;
|
|
75
|
+
if (typeof error === 'string') {
|
|
76
|
+
({ name, message } = await Promise.resolve(error)
|
|
77
|
+
.then(() => JSON.parse(error))
|
|
78
|
+
.catch(() => {
|
|
79
|
+
// @ts-expect-error it's worht a shot e.g. "There was an error while executing... Details: { name: "blah"}
|
|
80
|
+
return JSON.parse(error.split(/\n/).pop());
|
|
81
|
+
})
|
|
82
|
+
.catch(() => ({ name: null, message: error })));
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
message = error?._defaultMessage;
|
|
86
|
+
}
|
|
87
|
+
const handlerIsRelevant = (!name || `${name}`.includes(origin.toUpperCase())) && typeof onMatch === 'function';
|
|
88
|
+
return handlerIsRelevant
|
|
89
|
+
? onMatch(message)
|
|
90
|
+
: error;
|
|
91
|
+
};
|
|
92
|
+
exports.detectOriginAndReturn = detectOriginAndReturn;
|
|
93
|
+
//# sourceMappingURL=onErrorHelper.js.map
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file /Users/geraldgillespie/code/nsaccounts/sdf/lib/pathHelpers
|
|
3
|
+
* @author Gerald Gillespie <gerald.gillespie@fullscript.com>
|
|
4
|
+
*/
|
|
5
|
+
export declare const CONSTANTS: {
|
|
6
|
+
TSCONFIG_SS21: string;
|
|
7
|
+
SDF_DEFAULT_ROOT: string;
|
|
8
|
+
SDF_TEMP_ROOT: string;
|
|
9
|
+
SDF_FILE_CABINET: string;
|
|
10
|
+
SDF_TEMP_ROOT_RGX: RegExp;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @description - have it or not
|
|
14
|
+
* @param filePath
|
|
15
|
+
* @returns {false|string}
|
|
16
|
+
*/
|
|
17
|
+
export declare const hasFile: (filePath: string | string[]) => Promise<string | false>;
|
|
18
|
+
/**
|
|
19
|
+
* ⚠️⚠️⚠️⚠️⚠️ WARNING: this gets the root of this project and not the project using this as a dependency!
|
|
20
|
+
* @returns {string} e.g. /Users/jdoe/code/nsaccounts
|
|
21
|
+
*/
|
|
22
|
+
export declare const getRootOfProject: () => string;
|
|
23
|
+
/**
|
|
24
|
+
* @description - for example:
|
|
25
|
+
* - a relative path and the current directory
|
|
26
|
+
* - the entire path and a SuiteScripts path that both have SuiteScripts in it
|
|
27
|
+
* @param path1 -- must be an absolute path
|
|
28
|
+
* @param path2 - can be a partial path, relative path or special SDK path e.g. /SuiteScripts
|
|
29
|
+
*/
|
|
30
|
+
export declare const combineOverLappingPaths: (path1: string, path2: string) => string;
|
|
31
|
+
export declare const joinPaths: (...paths: string[]) => string;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @param {string} [path]
|
|
35
|
+
* @returns {Promise<string>}
|
|
36
|
+
*/
|
|
37
|
+
export declare const getSuiteCloudConfigPath: (path?: string) => Promise<string>;
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @param {string} folder - the current place that you are. e.g process.cwd() or __dirname or whatever
|
|
41
|
+
* @param {boolean} [folderNameOnly] - where to strip off the folders e.g. 12345323
|
|
42
|
+
* @returns {string} e.g. /path/to/12346357
|
|
43
|
+
*/
|
|
44
|
+
export declare const getRootOfAccount: (folder: string, folderNameOnly?: boolean) => string;
|
|
45
|
+
/**
|
|
46
|
+
* @description - If the provided path does not contain the reference then this will scan the descendants for the first one
|
|
47
|
+
* @param path
|
|
48
|
+
* @returns {Promise<string>}
|
|
49
|
+
*/
|
|
50
|
+
export declare const getFolderHoldingFileCabinetPlus: (path: string) => Promise<string>;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @param {string} anyCabinetPathInAccount
|
|
54
|
+
* @param {string} [projectRoot]
|
|
55
|
+
* @returns {string} * @returns {string} e.g. 24365476/src
|
|
56
|
+
*/
|
|
57
|
+
export declare const getDifferenceFromProjectRootToFileCabinet: (anyCabinetPathInAccount: string, projectRoot?: string) => string;
|
|
58
|
+
/**
|
|
59
|
+
* @description - same as path.relative
|
|
60
|
+
* @param projectJsonLocation
|
|
61
|
+
* @param projectRoot
|
|
62
|
+
*/
|
|
63
|
+
export declare const getRelativeOf: (projectJsonLocation: string, projectRoot: string) => string;
|
|
64
|
+
/**
|
|
65
|
+
* @description - for common folders
|
|
66
|
+
* @param {string} type
|
|
67
|
+
* @param {string[]} extras
|
|
68
|
+
* @param {string} [target] - defaults to cwd
|
|
69
|
+
* @returns {string} - The full path
|
|
70
|
+
*
|
|
71
|
+
*/
|
|
72
|
+
export declare const getAccountDir: (type: "FileCabinet" | "SuiteScripts" | "Objects" | "Translations" | "AccountConfiguration" | "Templates" | "Web Site Hosting Files", extras: string[], target?: string) => Promise<string>;
|
|
73
|
+
export declare const removeTempDirForSdf: (projectPath: string) => Promise<string>;
|
|
74
|
+
/**
|
|
75
|
+
* @description
|
|
76
|
+
* @param {string[]} pathBits
|
|
77
|
+
*/
|
|
78
|
+
export declare const removeFile: (pathBits: string[]) => Promise<string>;
|
|
79
|
+
/**
|
|
80
|
+
* @description - makes a `temp` directory in the same account root
|
|
81
|
+
* - no need to copy anything over
|
|
82
|
+
* @param {string} projectPath
|
|
83
|
+
* @returns {Promise<string>}
|
|
84
|
+
*/
|
|
85
|
+
export declare const makeTempDirForSdf: (projectPath: string) => Promise<string>;
|
|
86
|
+
/**
|
|
87
|
+
* @description - Figures out the path
|
|
88
|
+
* - if you have a relative path then compare it against cwd
|
|
89
|
+
* - if you have an absolute path then check if it is actually a NetSuite project path
|
|
90
|
+
* -
|
|
91
|
+
*/
|
|
92
|
+
export declare const getAbsolutePath: (options: {
|
|
93
|
+
projectPath: string;
|
|
94
|
+
executionPath?: string;
|
|
95
|
+
filePath: string;
|
|
96
|
+
}) => string;
|
|
97
|
+
/**
|
|
98
|
+
* @description -
|
|
99
|
+
*/
|
|
100
|
+
export declare const getAccountFolders: (path: string) => Promise<string[]>;
|
|
101
|
+
/**
|
|
102
|
+
* Recursively find directories whose names match a series of tests at each depth.
|
|
103
|
+
* @param {string} dir - The directory to start searching from.
|
|
104
|
+
* @param {*[]} tests - Current recursion depth (default is 0).
|
|
105
|
+
* @returns {Promise<string[]>} - An array of matching directory paths.
|
|
106
|
+
*/
|
|
107
|
+
export declare const findMatchingDirectories: (dir: string, tests: Array<{
|
|
108
|
+
test: (x: string) => boolean;
|
|
109
|
+
}>) => Promise<string[]>;
|
|
110
|
+
/**
|
|
111
|
+
* @description - Get the remaining path
|
|
112
|
+
* @param {string[]} paths
|
|
113
|
+
* @param {'SuiteScripts'} type -
|
|
114
|
+
* @param {Array<function|string|RegExp>} [tests] - functions or globs or regex to apply. Only `some` has to pass.
|
|
115
|
+
* @returns {Promise<string[]>}
|
|
116
|
+
*/
|
|
117
|
+
export declare const getAllFilesRecursively: (paths: string[], type: "SuiteScripts" | "Objects" | "SuiteApps" | "SuiteBundles", tests: Array<((x: string) => boolean) | string | RegExp>) => Promise<string[]>;
|
|
118
|
+
/**
|
|
119
|
+
* @description -- you should convert first
|
|
120
|
+
* @param paths
|
|
121
|
+
*/
|
|
122
|
+
export declare const removeIllegalFileCabinetFiles: (paths: string[]) => string[];
|
|
123
|
+
/**
|
|
124
|
+
* @description - A legal object file has only one extension '.xml'
|
|
125
|
+
* And the scriptid inside matches its file name. We cannot open files here
|
|
126
|
+
* @param paths
|
|
127
|
+
*/
|
|
128
|
+
export declare const removeIllegalObjectFiles: (paths: string[]) => string[];
|
|
129
|
+
/**
|
|
130
|
+
* @description - e.g. ts to js
|
|
131
|
+
* @param paths
|
|
132
|
+
*/
|
|
133
|
+
export declare const convertFileExtensions: (paths: string[]) => string[];
|