@jackchuka/gql-ingest 3.0.0 → 3.1.0

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.
@@ -0,0 +1,103 @@
1
+ import { z } from "zod/v4";
2
+ export declare const RetryConfigSchema: z.ZodObject<{
3
+ maxAttempts: z.ZodNumber;
4
+ baseDelay: z.ZodNumber;
5
+ maxDelay: z.ZodNumber;
6
+ exponentialBackoff: z.ZodBoolean;
7
+ retryableStatusCodes: z.ZodArray<z.ZodNumber>;
8
+ }, z.core.$strip>;
9
+ export declare const ParallelProcessingConfigSchema: z.ZodObject<{
10
+ concurrency: z.ZodNumber;
11
+ entityConcurrency: z.ZodNumber;
12
+ preserveRowOrder: z.ZodBoolean;
13
+ }, z.core.$strip>;
14
+ export declare const EntityConfigSchema: z.ZodObject<{
15
+ concurrency: z.ZodOptional<z.ZodNumber>;
16
+ preserveRowOrder: z.ZodOptional<z.ZodBoolean>;
17
+ retry: z.ZodOptional<z.ZodObject<{
18
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
19
+ baseDelay: z.ZodOptional<z.ZodNumber>;
20
+ maxDelay: z.ZodOptional<z.ZodNumber>;
21
+ exponentialBackoff: z.ZodOptional<z.ZodBoolean>;
22
+ retryableStatusCodes: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
23
+ }, z.core.$strip>>;
24
+ }, z.core.$strip>;
25
+ export declare const ConfigSchema: z.ZodObject<{
26
+ retry: z.ZodObject<{
27
+ maxAttempts: z.ZodNumber;
28
+ baseDelay: z.ZodNumber;
29
+ maxDelay: z.ZodNumber;
30
+ exponentialBackoff: z.ZodBoolean;
31
+ retryableStatusCodes: z.ZodArray<z.ZodNumber>;
32
+ }, z.core.$strip>;
33
+ parallelProcessing: z.ZodObject<{
34
+ concurrency: z.ZodNumber;
35
+ entityConcurrency: z.ZodNumber;
36
+ preserveRowOrder: z.ZodBoolean;
37
+ }, z.core.$strip>;
38
+ entityConfig: z.ZodRecord<z.ZodString, z.ZodObject<{
39
+ concurrency: z.ZodOptional<z.ZodNumber>;
40
+ preserveRowOrder: z.ZodOptional<z.ZodBoolean>;
41
+ retry: z.ZodOptional<z.ZodObject<{
42
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
43
+ baseDelay: z.ZodOptional<z.ZodNumber>;
44
+ maxDelay: z.ZodOptional<z.ZodNumber>;
45
+ exponentialBackoff: z.ZodOptional<z.ZodBoolean>;
46
+ retryableStatusCodes: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
47
+ }, z.core.$strip>>;
48
+ }, z.core.$strip>>;
49
+ entityDependencies: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
50
+ }, z.core.$strip>;
51
+ export type RetryConfig = z.infer<typeof RetryConfigSchema>;
52
+ export type ParallelProcessingConfig = z.infer<typeof ParallelProcessingConfigSchema>;
53
+ export type EntityConfig = z.infer<typeof EntityConfigSchema>;
54
+ export type Config = z.infer<typeof ConfigSchema>;
55
+ export declare const DEFAULT_RETRY_CONFIG: RetryConfig;
56
+ export declare const DEFAULT_PARALLEL_CONFIG: ParallelProcessingConfig;
57
+ export declare const CONFIG_TEMPLATE: {
58
+ schema: {
59
+ parallelProcessing: z.ZodObject<{
60
+ concurrency: z.ZodNumber;
61
+ entityConcurrency: z.ZodNumber;
62
+ preserveRowOrder: z.ZodBoolean;
63
+ }, z.core.$strip>;
64
+ retry: z.ZodObject<{
65
+ maxAttempts: z.ZodNumber;
66
+ baseDelay: z.ZodNumber;
67
+ maxDelay: z.ZodNumber;
68
+ exponentialBackoff: z.ZodBoolean;
69
+ retryableStatusCodes: z.ZodArray<z.ZodNumber>;
70
+ }, z.core.$strip>;
71
+ entityConfig: z.ZodRecord<z.ZodString, z.ZodObject<{
72
+ concurrency: z.ZodOptional<z.ZodNumber>;
73
+ preserveRowOrder: z.ZodOptional<z.ZodBoolean>;
74
+ retry: z.ZodOptional<z.ZodObject<{
75
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
76
+ baseDelay: z.ZodOptional<z.ZodNumber>;
77
+ maxDelay: z.ZodOptional<z.ZodNumber>;
78
+ exponentialBackoff: z.ZodOptional<z.ZodBoolean>;
79
+ retryableStatusCodes: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
80
+ }, z.core.$strip>>;
81
+ }, z.core.$strip>>;
82
+ entityDependencies: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
83
+ };
84
+ defaults: {
85
+ parallelProcessing: {
86
+ concurrency: number;
87
+ entityConcurrency: number;
88
+ preserveRowOrder: boolean;
89
+ };
90
+ retry: {
91
+ maxAttempts: number;
92
+ baseDelay: number;
93
+ maxDelay: number;
94
+ exponentialBackoff: boolean;
95
+ retryableStatusCodes: number[];
96
+ };
97
+ };
98
+ examples: {
99
+ entityConfig: Record<string, EntityConfig>;
100
+ entityDependencies: Record<string, string[]>;
101
+ };
102
+ };
103
+ //# sourceMappingURL=config-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-schema.d.ts","sourceRoot":"","sources":["../../src/lib/config-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,eAAO,MAAM,iBAAiB;;;;;;iBAM5B,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;iBAIzC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;iBAI7B,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;iBASvB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAGlD,eAAO,MAAM,oBAAoB,EAAE,WAMlC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,wBAIrC,CAAC;AAGF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAkBnB,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;4BAG5B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;;CAEhC,CAAC"}
@@ -1,33 +1,9 @@
1
1
  import { Logger } from "./logger";
2
- export interface ParallelProcessingConfig {
3
- concurrency: number;
4
- entityConcurrency: number;
5
- preserveRowOrder: boolean;
6
- }
7
- export interface RetryConfig {
8
- maxAttempts: number;
9
- baseDelay: number;
10
- maxDelay: number;
11
- exponentialBackoff: boolean;
12
- retryableStatusCodes: number[];
13
- }
14
- export interface EntityConfig {
15
- concurrency?: number;
16
- preserveRowOrder?: boolean;
17
- retry?: Partial<RetryConfig>;
18
- }
19
- export interface ProcessingConfig {
20
- retry: RetryConfig;
21
- parallelProcessing: ParallelProcessingConfig;
22
- entityConfig: Record<string, EntityConfig>;
23
- entityDependencies: Record<string, string[]>;
24
- }
25
- export interface FullConfig extends ProcessingConfig {
26
- }
27
- export declare const DEFAULT_RETRY_CONFIG: RetryConfig;
28
- export declare const DEFAULT_PARALLEL_CONFIG: ParallelProcessingConfig;
29
- export declare const DEFAULT_CONFIG: ProcessingConfig;
30
- export declare function loadConfig(configDir: string, logger?: Logger): ProcessingConfig;
31
- export declare function getEntityConfig(entityName: string, globalConfig: ProcessingConfig, logger?: Logger): ParallelProcessingConfig;
32
- export declare function getRetryConfig(entityName: string, globalConfig: ProcessingConfig): RetryConfig;
2
+ import { type Config, type ParallelProcessingConfig, type RetryConfig } from "./config-schema";
3
+ export type { Config, ParallelProcessingConfig, RetryConfig, EntityConfig } from "./config-schema";
4
+ export { DEFAULT_RETRY_CONFIG, DEFAULT_PARALLEL_CONFIG } from "./config-schema";
5
+ export declare const DEFAULT_CONFIG: Config;
6
+ export declare function loadConfig(configDir: string, logger?: Logger): Config;
7
+ export declare function getEntityConfig(entityName: string, globalConfig: Config, logger?: Logger): ParallelProcessingConfig;
8
+ export declare function getRetryConfig(entityName: string, globalConfig: Config): RetryConfig;
33
9
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAC;AAE9C,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,WAAW,CAAC;IACnB,kBAAkB,EAAE,wBAAwB,CAAC;IAC7C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC3C,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,UAAW,SAAQ,gBAAgB;CAEnD;AAED,eAAO,MAAM,oBAAoB,EAAE,WAMlC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,wBAIrC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAK5B,CAAC;AAEF,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,MAAmB,GAAG,gBAAgB,CAkB3F;AAiBD,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,gBAAgB,EAC9B,MAAM,GAAE,MAAmB,GAC1B,wBAAwB,CAiB1B;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,GAAG,WAAW,CAO9F"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAC;AAC9C,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EAAE,MAAM,EAAE,wBAAwB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEnG,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAEhF,eAAO,MAAM,cAAc,EAAE,MAK5B,CAAC;AAEF,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,MAAmB,GAAG,MAAM,CAkBjF;AAiBD,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,MAAM,GAAE,MAAmB,GAC1B,wBAAwB,CAiB1B;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,WAAW,CAOpF"}
@@ -14,11 +14,13 @@ export interface Logger {
14
14
  * Used as the default logger to keep the library quiet.
15
15
  */
16
16
  export declare const noopLogger: Logger;
17
+ export interface ConsoleLoggerOptions {
18
+ prefix?: string;
19
+ }
17
20
  /**
18
- * Creates a console logger with [gql-ingest] prefix.
19
- * Used when verbose mode is enabled.
21
+ * Creates a console logger with optional prefix.
20
22
  */
21
- export declare function createConsoleLogger(): Logger;
23
+ export declare function createConsoleLogger(options?: ConsoleLoggerOptions): Logger;
22
24
  /**
23
25
  * Creates a default logger based on the verbose flag.
24
26
  * Returns no-op logger by default, console logger when verbose is true.
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACrD,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACpD,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACpD,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACtD;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,MAKxB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAO5C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,UAAQ,GAAG,MAAM,CAE3D"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACrD,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACpD,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACpD,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACtD;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,MAKxB,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB,GAAG,MAAM,CAU9E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,UAAQ,GAAG,MAAM,CAE3D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jackchuka/gql-ingest",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "A CLI tool for ingesting data from files into a GraphQL API. Supports CSV, JSON, JSONL, and YAML file formats.",
5
5
  "keywords": [
6
6
  "api",
@@ -31,11 +31,13 @@
31
31
  }
32
32
  },
33
33
  "dependencies": {
34
+ "@inquirer/prompts": "^8.2.0",
34
35
  "commander": "^14.0.0",
35
36
  "csv-parser": "^3.0.0",
36
37
  "graphql": "16.12.0",
37
38
  "graphql-request": "^7.2.0",
38
- "js-yaml": "^4.1.0"
39
+ "js-yaml": "^4.1.0",
40
+ "zod": "^4.3.5"
39
41
  },
40
42
  "devDependencies": {
41
43
  "@types/jest": "^30.0.0",