@bitblit/ratchet-node-only 4.0.1-alpha

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/bin/cli.js ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import { RatchetCliHandler } from '../lib/index.mjs';
3
+
4
+ try {
5
+ //const RatchetCliHandler = await import('../dist/cli-bootstrap/ratchet-cli-handler.js');
6
+ await new RatchetCliHandler().findAndExecuteHandler();
7
+ } catch (err) {
8
+ console.error('Error : %s', err);
9
+ process.exit(-1);
10
+ }
@@ -0,0 +1,5 @@
1
+ import { BuildInformation } from '@bitblit/ratchet-common';
2
+ export declare class RatchetNodeOnlyInfo {
3
+ private constructor();
4
+ static buildInformation(): BuildInformation;
5
+ }
@@ -0,0 +1,7 @@
1
+ import { CiRunInformation } from './ci-run-information.js';
2
+ export declare class ApplyCiEnvVariablesToFiles {
3
+ static process(fileNames: string[], cfg: CiRunInformation, buildFinder?: string, branchFinder?: string, hashFinder?: string, tagFinder?: string, timeFinder?: string): Promise<number>;
4
+ static extractFileNames(): string[];
5
+ static extractVariableConfig(inName: string): CiRunInformation;
6
+ static runFromCliArgs(args: string[]): Promise<number>;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { CiRunInformation } from './ci-run-information.js';
2
+ export declare class CiRunInformationUtil {
3
+ static readonly DEFAULT_TIME_FORMAT: string;
4
+ static readonly DEFAULT_TIME_ZONE: string;
5
+ static createTestingCiRunInformation(timezone?: string): CiRunInformation;
6
+ static createDefaultCircleCiRunInformation(timezone?: string): CiRunInformation;
7
+ static createDefaultGithubActionsRunInformation(timezone?: string): CiRunInformation;
8
+ }
@@ -0,0 +1,9 @@
1
+ export interface CiRunInformation {
2
+ buildNumber: string;
3
+ localTime: string;
4
+ branch?: string;
5
+ tag?: string;
6
+ commitHash?: string;
7
+ userName?: string;
8
+ projectName?: string;
9
+ }
@@ -0,0 +1,6 @@
1
+ import { BuildInformation } from '@bitblit/ratchet-common';
2
+ export declare abstract class AbstractRatchetCliHandler {
3
+ abstract fetchHandlerMap(): Record<string, any>;
4
+ abstract fetchVersionInfo(): BuildInformation;
5
+ findAndExecuteHandler(): Promise<void>;
6
+ }
@@ -0,0 +1,6 @@
1
+ export declare class CliRatchet {
2
+ static isCalledFromCLI(filenames: string[]): boolean;
3
+ static argsAfterCommand(filenames: string[]): string[];
4
+ static isCalledFromCLISingle(filename: string): boolean;
5
+ static indexOfCommandArgument(filename: string): number;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { BuildInformation } from '@bitblit/ratchet-common';
2
+ import { AbstractRatchetCliHandler } from './abstract-ratchet-cli-handler.js';
3
+ export declare class RatchetCliHandler extends AbstractRatchetCliHandler {
4
+ fetchHandlerMap(): Record<string, any>;
5
+ fetchVersionInfo(): BuildInformation;
6
+ }
@@ -0,0 +1,27 @@
1
+ /// <reference types="node" />
2
+ import { Options as ParseOptions } from 'csv-parse';
3
+ import { Options } from 'csv-stringify';
4
+ import { Subject } from 'rxjs';
5
+ import { Readable, Writable } from 'stream';
6
+ export declare class CsvRatchet {
7
+ static defaultParseOptions(): ParseOptions;
8
+ static defaultStringifyOptions(): Options;
9
+ static stringParse<T>(input: string, pf: ParseFunction<T>, opts?: ParseOptions): Promise<T[]>;
10
+ static streamParse<T>(readStream: Readable, pf: ParseFunction<T>, opts?: ParseOptions): Promise<T[]>;
11
+ static fileParse<T>(filename: string, pf: ParseFunction<T>): Promise<T[]>;
12
+ static generateCsvData(objectsToConvert: any[], opts?: Options): Promise<string>;
13
+ static generateComparison(file1: string, file2: string, keyField: string): Promise<ComparisonResults>;
14
+ static streamObjectsToCsv<T>(srcSubject: Subject<T>, output: Writable, inOpts?: Options): Promise<number>;
15
+ static defaultParseFunction<T>(row: any): T;
16
+ }
17
+ interface ParseFunction<T> {
18
+ (row: any): T;
19
+ }
20
+ export interface ComparisonResults {
21
+ file1OnlyKeys: string[];
22
+ file2OnlyKeys: string[];
23
+ bothFilesKeys: string[];
24
+ file1Data: Map<string, any>;
25
+ file2Data: Map<string, any>;
26
+ }
27
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface TestItem {
2
+ a: number;
3
+ b: string;
4
+ }
@@ -0,0 +1,4 @@
1
+ export declare class FilesToStaticClass {
2
+ static process(fileNames: string[], outClassName: string, outFileName?: string): Promise<string>;
3
+ static runFromCliArgs(args: string[]): Promise<string>;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
package/lib/index.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ export * from './build/ratchet-node-only-info.js';
2
+ export * from './ci/apply-ci-env-variables-to-files.js';
3
+ export * from './ci/ci-run-information-util.js';
4
+ export * from './ci/ci-run-information.js';
5
+ export * from './cli/abstract-ratchet-cli-handler.js';
6
+ export * from './cli/cli-ratchet.js';
7
+ export * from './cli/ratchet-cli-handler.js';
8
+ export * from './csv/csv-ratchet.js';
9
+ export * from './files/files-to-static-class.js';
10
+ export * from './third-party/git/git-ratchet.js';
11
+ export * from './third-party/slack/publish-ci-release-to-slack.js';