faros-airbyte-cdk 0.0.1

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.
Files changed (51) hide show
  1. package/README.md +5 -0
  2. package/lib/connector.d.ts +17 -0
  3. package/lib/connector.js +7 -0
  4. package/lib/connector.js.map +1 -0
  5. package/lib/destinations/destination-runner.d.ts +17 -0
  6. package/lib/destinations/destination-runner.js +151 -0
  7. package/lib/destinations/destination-runner.js.map +1 -0
  8. package/lib/destinations/destination.d.ts +13 -0
  9. package/lib/destinations/destination.js +12 -0
  10. package/lib/destinations/destination.js.map +1 -0
  11. package/lib/errors.d.ts +2 -0
  12. package/lib/errors.js +61 -0
  13. package/lib/errors.js.map +1 -0
  14. package/lib/help.d.ts +22 -0
  15. package/lib/help.js +371 -0
  16. package/lib/help.js.map +1 -0
  17. package/lib/index.d.ts +12 -0
  18. package/lib/index.js +31 -0
  19. package/lib/index.js.map +1 -0
  20. package/lib/logger.d.ts +21 -0
  21. package/lib/logger.js +100 -0
  22. package/lib/logger.js.map +1 -0
  23. package/lib/prompts.d.ts +14 -0
  24. package/lib/prompts.js +28 -0
  25. package/lib/prompts.js.map +1 -0
  26. package/lib/protocol.d.ts +189 -0
  27. package/lib/protocol.js +181 -0
  28. package/lib/protocol.js.map +1 -0
  29. package/lib/runner.d.ts +5 -0
  30. package/lib/runner.js +18 -0
  31. package/lib/runner.js.map +1 -0
  32. package/lib/sources/source-base.d.ts +59 -0
  33. package/lib/sources/source-base.js +168 -0
  34. package/lib/sources/source-base.js.map +1 -0
  35. package/lib/sources/source-runner.d.ts +17 -0
  36. package/lib/sources/source-runner.js +154 -0
  37. package/lib/sources/source-runner.js.map +1 -0
  38. package/lib/sources/source.d.ts +20 -0
  39. package/lib/sources/source.js +12 -0
  40. package/lib/sources/source.js.map +1 -0
  41. package/lib/sources/streams/stream-base.d.ts +94 -0
  42. package/lib/sources/streams/stream-base.js +139 -0
  43. package/lib/sources/streams/stream-base.js.map +1 -0
  44. package/lib/spec-loader.d.ts +4 -0
  45. package/lib/spec-loader.js +23 -0
  46. package/lib/spec-loader.js.map +1 -0
  47. package/lib/tsconfig.tsbuildinfo +1 -0
  48. package/lib/utils.d.ts +13 -0
  49. package/lib/utils.js +77 -0
  50. package/lib/utils.js.map +1 -0
  51. package/package.json +69 -0
@@ -0,0 +1,189 @@
1
+ import { Dictionary } from 'ts-essentials';
2
+ export declare enum AirbyteLogLevel {
3
+ FATAL = "FATAL",
4
+ ERROR = "ERROR",
5
+ WARN = "WARN",
6
+ INFO = "INFO",
7
+ DEBUG = "DEBUG",
8
+ TRACE = "TRACE"
9
+ }
10
+ export declare function AirbyteLogLevelOrder(level: AirbyteLogLevel): number;
11
+ export declare enum AirbyteMessageType {
12
+ CATALOG = "CATALOG",
13
+ CONNECTION_STATUS = "CONNECTION_STATUS",
14
+ LOG = "LOG",
15
+ RECORD = "RECORD",
16
+ SPEC = "SPEC",
17
+ STATE = "STATE",
18
+ TRACE = "TRACE"
19
+ }
20
+ export declare enum AirbyteConnectionStatus {
21
+ SUCCEEDED = "SUCCEEDED",
22
+ FAILED = "FAILED"
23
+ }
24
+ export declare enum AirbyteTraceFailureType {
25
+ SYSTEM_ERROR = "system_error",
26
+ CONFIG_ERROR = "config_error"
27
+ }
28
+ export interface AirbyteConfig {
29
+ }
30
+ export declare function parseAirbyteMessage(s: string): AirbyteMessage;
31
+ export interface AirbyteMessage {
32
+ readonly type: AirbyteMessageType;
33
+ }
34
+ export declare enum SyncMode {
35
+ FULL_REFRESH = "full_refresh",
36
+ INCREMENTAL = "incremental"
37
+ }
38
+ export declare enum DestinationSyncMode {
39
+ APPEND = "append",
40
+ OVERWRITE = "overwrite",
41
+ APPEND_DEDUP = "append_dedup"
42
+ }
43
+ export interface AirbyteStream {
44
+ name: string;
45
+ json_schema: Dictionary<any>;
46
+ supported_sync_modes?: SyncMode[];
47
+ source_defined_cursor?: boolean;
48
+ default_cursor_field?: string[];
49
+ source_defined_primary_key?: string[][];
50
+ namespace?: string;
51
+ }
52
+ export interface AirbyteCatalog {
53
+ streams: AirbyteStream[];
54
+ }
55
+ export declare class AirbyteCatalogMessage implements AirbyteMessage {
56
+ readonly catalog: AirbyteCatalog;
57
+ readonly type: AirbyteMessageType;
58
+ constructor(catalog: AirbyteCatalog);
59
+ }
60
+ export interface AirbyteConfiguredStream {
61
+ stream: AirbyteStream;
62
+ sync_mode: SyncMode;
63
+ cursor_field?: string[];
64
+ destination_sync_mode?: DestinationSyncMode;
65
+ primary_key?: string[][];
66
+ }
67
+ export interface AirbyteConfiguredCatalog {
68
+ streams: AirbyteConfiguredStream[];
69
+ }
70
+ export declare class AirbyteConnectionStatusMessage implements AirbyteMessage {
71
+ readonly connectionStatus: {
72
+ status: AirbyteConnectionStatus;
73
+ message?: string;
74
+ };
75
+ readonly type: AirbyteMessageType;
76
+ constructor(connectionStatus: {
77
+ status: AirbyteConnectionStatus;
78
+ message?: string;
79
+ });
80
+ }
81
+ export declare class AirbyteLog implements AirbyteMessage {
82
+ readonly log: {
83
+ level: AirbyteLogLevel;
84
+ message: string;
85
+ stack_trace: string;
86
+ };
87
+ readonly type: AirbyteMessageType;
88
+ constructor(log: {
89
+ level: AirbyteLogLevel;
90
+ message: string;
91
+ stack_trace: string;
92
+ });
93
+ static make(level: AirbyteLogLevel, message: string, stack_trace?: string): AirbyteLog;
94
+ }
95
+ export declare const AirbyteRawStreamPrefix = "_airbyte_raw_";
96
+ export declare const AirbyteRawABId = "_airbyte_ab_id";
97
+ export declare const AirbyteRawEmittedAt = "_airbyte_emitted_at";
98
+ export declare const AirbyteRawData = "_airbyte_data";
99
+ export declare class AirbyteRecord implements AirbyteMessage {
100
+ readonly record: {
101
+ stream: string;
102
+ namespace?: string;
103
+ emitted_at: number;
104
+ data: Dictionary<any>;
105
+ };
106
+ readonly type: AirbyteMessageType;
107
+ constructor(record: {
108
+ stream: string;
109
+ namespace?: string;
110
+ emitted_at: number;
111
+ data: Dictionary<any>;
112
+ });
113
+ isRaw(): boolean;
114
+ unpackRaw(): AirbyteRecord;
115
+ static make(stream: string, data: Dictionary<any>, namespace?: string): AirbyteRecord;
116
+ }
117
+ export interface AirbyteTraceError {
118
+ type: 'ERROR';
119
+ emitted_at: number;
120
+ error: {
121
+ message: string;
122
+ internal_message?: string;
123
+ stack_trace?: string;
124
+ failure_type?: AirbyteTraceFailureType;
125
+ };
126
+ }
127
+ export declare class AirbyteTrace implements AirbyteMessage {
128
+ readonly trace: {
129
+ type: 'ERROR';
130
+ emitted_at: number;
131
+ error: {
132
+ message: string;
133
+ internal_message?: string;
134
+ stack_trace?: string;
135
+ failure_type?: AirbyteTraceFailureType;
136
+ };
137
+ };
138
+ readonly type: AirbyteMessageType;
139
+ constructor(trace: {
140
+ type: 'ERROR';
141
+ emitted_at: number;
142
+ error: {
143
+ message: string;
144
+ internal_message?: string;
145
+ stack_trace?: string;
146
+ failure_type?: AirbyteTraceFailureType;
147
+ };
148
+ });
149
+ static make(err: any, failure_type?: AirbyteTraceFailureType): AirbyteTrace;
150
+ }
151
+ export interface Spec {
152
+ documentationUrl?: string;
153
+ changelogUrl?: string;
154
+ connectionSpecification: Dictionary<any>;
155
+ supportsIncremental?: boolean;
156
+ supportsNormalization?: boolean;
157
+ supportsDBT?: boolean;
158
+ supported_destination_sync_modes?: DestinationSyncMode[];
159
+ }
160
+ export declare class AirbyteSpec implements AirbyteMessage {
161
+ readonly spec: Spec;
162
+ readonly type: AirbyteMessageType;
163
+ constructor(spec: Spec);
164
+ }
165
+ export interface AirbyteState {
166
+ [stream: string]: any;
167
+ }
168
+ export interface AirbyteSourceStatusBase {
169
+ status: 'RUNNING' | 'ERRORED';
170
+ }
171
+ export interface AirbyteSourceRunningStatus extends AirbyteSourceStatusBase {
172
+ status: 'RUNNING';
173
+ message?: string;
174
+ }
175
+ export interface AirbyteSourceErrorStatus extends AirbyteSourceStatusBase {
176
+ status: 'ERRORED';
177
+ error: string;
178
+ }
179
+ export declare type AirbyteSourceStatus = AirbyteSourceErrorStatus | AirbyteSourceRunningStatus;
180
+ export declare class AirbyteStateMessage implements AirbyteMessage {
181
+ readonly state: {
182
+ data: AirbyteState;
183
+ };
184
+ readonly sourceStatus?: AirbyteSourceStatus;
185
+ readonly type: AirbyteMessageType;
186
+ constructor(state: {
187
+ data: AirbyteState;
188
+ }, sourceStatus?: AirbyteSourceStatus);
189
+ }
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AirbyteStateMessage = exports.AirbyteSpec = exports.AirbyteTrace = exports.AirbyteRecord = exports.AirbyteRawData = exports.AirbyteRawEmittedAt = exports.AirbyteRawABId = exports.AirbyteRawStreamPrefix = exports.AirbyteLog = exports.AirbyteConnectionStatusMessage = exports.AirbyteCatalogMessage = exports.DestinationSyncMode = exports.SyncMode = exports.parseAirbyteMessage = exports.AirbyteTraceFailureType = exports.AirbyteConnectionStatus = exports.AirbyteMessageType = exports.AirbyteLogLevelOrder = exports.AirbyteLogLevel = void 0;
4
+ const verror_1 = require("verror");
5
+ const errors_1 = require("./errors");
6
+ var AirbyteLogLevel;
7
+ (function (AirbyteLogLevel) {
8
+ AirbyteLogLevel["FATAL"] = "FATAL";
9
+ AirbyteLogLevel["ERROR"] = "ERROR";
10
+ AirbyteLogLevel["WARN"] = "WARN";
11
+ AirbyteLogLevel["INFO"] = "INFO";
12
+ AirbyteLogLevel["DEBUG"] = "DEBUG";
13
+ AirbyteLogLevel["TRACE"] = "TRACE";
14
+ })(AirbyteLogLevel = exports.AirbyteLogLevel || (exports.AirbyteLogLevel = {}));
15
+ function AirbyteLogLevelOrder(level) {
16
+ switch (level) {
17
+ case AirbyteLogLevel.FATAL:
18
+ return 60;
19
+ case AirbyteLogLevel.ERROR:
20
+ return 50;
21
+ case AirbyteLogLevel.WARN:
22
+ return 40;
23
+ case AirbyteLogLevel.INFO:
24
+ return 30;
25
+ case AirbyteLogLevel.DEBUG:
26
+ return 20;
27
+ case AirbyteLogLevel.TRACE:
28
+ return 10;
29
+ }
30
+ }
31
+ exports.AirbyteLogLevelOrder = AirbyteLogLevelOrder;
32
+ var AirbyteMessageType;
33
+ (function (AirbyteMessageType) {
34
+ AirbyteMessageType["CATALOG"] = "CATALOG";
35
+ AirbyteMessageType["CONNECTION_STATUS"] = "CONNECTION_STATUS";
36
+ AirbyteMessageType["LOG"] = "LOG";
37
+ AirbyteMessageType["RECORD"] = "RECORD";
38
+ AirbyteMessageType["SPEC"] = "SPEC";
39
+ AirbyteMessageType["STATE"] = "STATE";
40
+ AirbyteMessageType["TRACE"] = "TRACE";
41
+ })(AirbyteMessageType = exports.AirbyteMessageType || (exports.AirbyteMessageType = {}));
42
+ var AirbyteConnectionStatus;
43
+ (function (AirbyteConnectionStatus) {
44
+ AirbyteConnectionStatus["SUCCEEDED"] = "SUCCEEDED";
45
+ AirbyteConnectionStatus["FAILED"] = "FAILED";
46
+ })(AirbyteConnectionStatus = exports.AirbyteConnectionStatus || (exports.AirbyteConnectionStatus = {}));
47
+ var AirbyteTraceFailureType;
48
+ (function (AirbyteTraceFailureType) {
49
+ AirbyteTraceFailureType["SYSTEM_ERROR"] = "system_error";
50
+ AirbyteTraceFailureType["CONFIG_ERROR"] = "config_error";
51
+ })(AirbyteTraceFailureType = exports.AirbyteTraceFailureType || (exports.AirbyteTraceFailureType = {}));
52
+ function parseAirbyteMessage(s) {
53
+ try {
54
+ const res = JSON.parse(s);
55
+ if (!res.type) {
56
+ throw new verror_1.VError(`Message type is not set`);
57
+ }
58
+ switch (res.type) {
59
+ case AirbyteMessageType.RECORD:
60
+ return new AirbyteRecord(res.record);
61
+ case AirbyteMessageType.CATALOG:
62
+ case AirbyteMessageType.CONNECTION_STATUS:
63
+ case AirbyteMessageType.LOG:
64
+ case AirbyteMessageType.SPEC:
65
+ case AirbyteMessageType.STATE:
66
+ case AirbyteMessageType.TRACE:
67
+ return res;
68
+ default:
69
+ throw new verror_1.VError(`Unsupported message type ${res.type}`);
70
+ }
71
+ }
72
+ catch (e) {
73
+ throw new verror_1.VError(e, `Invalid Airbyte message: ${s}`);
74
+ }
75
+ }
76
+ exports.parseAirbyteMessage = parseAirbyteMessage;
77
+ var SyncMode;
78
+ (function (SyncMode) {
79
+ SyncMode["FULL_REFRESH"] = "full_refresh";
80
+ SyncMode["INCREMENTAL"] = "incremental";
81
+ })(SyncMode = exports.SyncMode || (exports.SyncMode = {}));
82
+ var DestinationSyncMode;
83
+ (function (DestinationSyncMode) {
84
+ DestinationSyncMode["APPEND"] = "append";
85
+ DestinationSyncMode["OVERWRITE"] = "overwrite";
86
+ DestinationSyncMode["APPEND_DEDUP"] = "append_dedup";
87
+ })(DestinationSyncMode = exports.DestinationSyncMode || (exports.DestinationSyncMode = {}));
88
+ class AirbyteCatalogMessage {
89
+ constructor(catalog) {
90
+ this.catalog = catalog;
91
+ this.type = AirbyteMessageType.CATALOG;
92
+ }
93
+ }
94
+ exports.AirbyteCatalogMessage = AirbyteCatalogMessage;
95
+ class AirbyteConnectionStatusMessage {
96
+ constructor(connectionStatus) {
97
+ this.connectionStatus = connectionStatus;
98
+ this.type = AirbyteMessageType.CONNECTION_STATUS;
99
+ }
100
+ }
101
+ exports.AirbyteConnectionStatusMessage = AirbyteConnectionStatusMessage;
102
+ class AirbyteLog {
103
+ constructor(log) {
104
+ this.log = log;
105
+ this.type = AirbyteMessageType.LOG;
106
+ }
107
+ static make(level, message, stack_trace) {
108
+ return new AirbyteLog({ level, message, stack_trace });
109
+ }
110
+ }
111
+ exports.AirbyteLog = AirbyteLog;
112
+ exports.AirbyteRawStreamPrefix = '_airbyte_raw_';
113
+ exports.AirbyteRawABId = '_airbyte_ab_id';
114
+ exports.AirbyteRawEmittedAt = '_airbyte_emitted_at';
115
+ exports.AirbyteRawData = '_airbyte_data';
116
+ class AirbyteRecord {
117
+ constructor(record) {
118
+ this.record = record;
119
+ this.type = AirbyteMessageType.RECORD;
120
+ }
121
+ isRaw() {
122
+ const stream = this.record.stream;
123
+ return stream && stream.startsWith(exports.AirbyteRawStreamPrefix);
124
+ }
125
+ unpackRaw() {
126
+ if (this.isRaw()) {
127
+ return new AirbyteRecord({
128
+ stream: this.record.stream.slice(exports.AirbyteRawStreamPrefix.length),
129
+ emitted_at: new Date(this.record.data[exports.AirbyteRawEmittedAt]).getTime(),
130
+ data: JSON.parse(this.record.data[exports.AirbyteRawData]),
131
+ });
132
+ }
133
+ return this;
134
+ }
135
+ static make(stream, data, namespace) {
136
+ return new AirbyteRecord({
137
+ stream,
138
+ namespace,
139
+ emitted_at: Date.now(),
140
+ data,
141
+ });
142
+ }
143
+ }
144
+ exports.AirbyteRecord = AirbyteRecord;
145
+ class AirbyteTrace {
146
+ constructor(trace) {
147
+ this.trace = trace;
148
+ this.type = AirbyteMessageType.TRACE;
149
+ }
150
+ static make(err, failure_type) {
151
+ const wrapped = (0, errors_1.wrapApiError)(err);
152
+ return new AirbyteTrace({
153
+ type: 'ERROR',
154
+ emitted_at: Date.now(),
155
+ error: {
156
+ message: wrapped.message,
157
+ stack_trace: wrapped.stack,
158
+ internal_message: wrapped.name,
159
+ failure_type,
160
+ ...wrapped,
161
+ },
162
+ });
163
+ }
164
+ }
165
+ exports.AirbyteTrace = AirbyteTrace;
166
+ class AirbyteSpec {
167
+ constructor(spec) {
168
+ this.spec = spec;
169
+ this.type = AirbyteMessageType.SPEC;
170
+ }
171
+ }
172
+ exports.AirbyteSpec = AirbyteSpec;
173
+ class AirbyteStateMessage {
174
+ constructor(state, sourceStatus) {
175
+ this.state = state;
176
+ this.sourceStatus = sourceStatus;
177
+ this.type = AirbyteMessageType.STATE;
178
+ }
179
+ }
180
+ exports.AirbyteStateMessage = AirbyteStateMessage;
181
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":";;;AACA,mCAA8B;AAE9B,qCAAsC;AAEtC,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,kCAAe,CAAA;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,CAAC;IACd,CAAC;IAED,MAAM,CAAC,IAAI,CACT,MAAc,EACd,IAAqB,EACrB,SAAkB;QAElB,OAAO,IAAI,aAAa,CAAC;YACvB,MAAM;YACN,SAAS;YACT,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;YACtB,IAAI;SACL,CAAC,CAAC;IACL,CAAC;CACF;AAvCD,sCAuCC;AAaD,MAAa,YAAY;IAEvB,YACW,KASR;QATQ,UAAK,GAAL,KAAK,CASb;QAXM,SAAI,GAAuB,kBAAkB,CAAC,KAAK,CAAC;IAY1D,CAAC;IAEJ,MAAM,CAAC,IAAI,CAAC,GAAQ,EAAE,YAAsC;QAC1D,MAAM,OAAO,GAAG,IAAA,qBAAY,EAAC,GAAG,CAAC,CAAC;QAClC,OAAO,IAAI,YAAY,CAAC;YACtB,IAAI,EAAE,OAAO;YACb,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;YACtB,KAAK,EAAE;gBACL,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,WAAW,EAAE,OAAO,CAAC,KAAK;gBAC1B,gBAAgB,EAAE,OAAO,CAAC,IAAI;gBAC9B,YAAY;gBACZ,GAAG,OAAO;aACX;SACF,CAAC,CAAC;IACL,CAAC;CACF;AA7BD,oCA6BC;AAYD,MAAa,WAAW;IAEtB,YAAqB,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;QADtB,SAAI,GAAuB,kBAAkB,CAAC,IAAI,CAAC;IAC1B,CAAC;CACpC;AAHD,kCAGC;AAwBD,MAAa,mBAAmB;IAE9B,YACW,KAA2B,EAC3B,YAAkC;QADlC,UAAK,GAAL,KAAK,CAAsB;QAC3B,iBAAY,GAAZ,YAAY,CAAsB;QAHpC,SAAI,GAAuB,kBAAkB,CAAC,KAAK,CAAC;IAI1D,CAAC;CACL;AAND,kDAMC"}
@@ -0,0 +1,5 @@
1
+ import { AirbyteLogger } from './logger';
2
+ export declare abstract class Runner {
3
+ protected readonly logger: AirbyteLogger;
4
+ constructor(logger: AirbyteLogger);
5
+ }
package/lib/runner.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Runner = void 0;
4
+ const protocol_1 = require("./protocol");
5
+ class Runner {
6
+ constructor(logger) {
7
+ this.logger = logger;
8
+ process.on('unhandledRejection', (error) => {
9
+ throw error;
10
+ });
11
+ process.on('uncaughtException', (error) => {
12
+ logger.traceError(error, protocol_1.AirbyteTraceFailureType.SYSTEM_ERROR);
13
+ process.exit(1);
14
+ });
15
+ }
16
+ }
17
+ exports.Runner = Runner;
18
+ //# sourceMappingURL=runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":";;;AACA,yCAAmD;AAEnD,MAAsB,MAAM;IAC1B,YAA+B,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;QAClD,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,KAAK,EAAE,EAAE;YACzC,MAAM,KAAK,CAAC;QACd,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;YACxC,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,kCAAuB,CAAC,YAAY,CAAC,CAAC;YAC/D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAVD,wBAUC"}
@@ -0,0 +1,59 @@
1
+ import VError from 'verror';
2
+ import { AirbyteLogger } from '../logger';
3
+ import { AirbyteCatalogMessage, AirbyteConfig, AirbyteConfiguredCatalog, AirbyteConnectionStatusMessage, AirbyteMessage, AirbyteState } from '../protocol';
4
+ import { AirbyteSource } from './source';
5
+ import { AirbyteStreamBase } from './streams/stream-base';
6
+ /**
7
+ * Airbyte Source base class providing additional boilerplate around the Check
8
+ * and Discover commands, and the logic for processing the Source's streams. The
9
+ * user needs to implement the spec() and checkConnection() methods and the
10
+ * streams.
11
+ */
12
+ export declare abstract class AirbyteSourceBase<Config extends AirbyteConfig> extends AirbyteSource<Config> {
13
+ protected readonly logger: AirbyteLogger;
14
+ constructor(logger: AirbyteLogger);
15
+ /**
16
+ * Validates the provided configuration by testing the configuration values
17
+ * against the source's technical system.
18
+ * @param config The user-provided configuration as specified by the source's
19
+ * spec. This usually contains information required to check connection e.g.
20
+ * tokens, secrets and keys etc.
21
+ * @return A tuple of (boolean, VError). If boolean is true, then the
22
+ * connection check is successful and we can connect to the underlying data
23
+ * source using the provided configuration. Otherwise, the input config cannot
24
+ * be used to connect to the underlying data source, and the VError should
25
+ * describe what went wrong. The VError message will be displayed to the user.
26
+ */
27
+ abstract checkConnection(config: Config): Promise<[boolean, VError | undefined]>;
28
+ /**
29
+ * Implements the streams of this source, for creating the source catalog
30
+ * and processing records from the source's technical system.
31
+ * @param config The user-provided configuration as specified by the source's
32
+ * spec. Any stream construction related operation should happen here.
33
+ * @return A list of the streams in this source connector.
34
+ */
35
+ abstract streams(config: Config): AirbyteStreamBase[];
36
+ /**
37
+ * Source name
38
+ */
39
+ get name(): string;
40
+ /**
41
+ * Implements the Discover operation from the Airbyte Specification. See
42
+ * https://docs.airbyte.io/architecture/airbyte-specification.
43
+ */
44
+ discover(config: Config): Promise<AirbyteCatalogMessage>;
45
+ /**
46
+ * Implements the Check Connection operation from the Airbyte Specification.
47
+ * See https://docs.airbyte.io/architecture/airbyte-specification.
48
+ */
49
+ check(config: Config): Promise<AirbyteConnectionStatusMessage>;
50
+ /**
51
+ * Implements the Read operation from the Airbyte Specification. See
52
+ * https://docs.airbyte.io/architecture/airbyte-specification.
53
+ */
54
+ read(config: Config, catalog: AirbyteConfiguredCatalog, state?: AirbyteState): AsyncGenerator<AirbyteMessage>;
55
+ private readStream;
56
+ private readIncremental;
57
+ private readFullRefresh;
58
+ private checkpointState;
59
+ }
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AirbyteSourceBase = void 0;
7
+ const lodash_1 = require("lodash");
8
+ const verror_1 = __importDefault(require("verror"));
9
+ const protocol_1 = require("../protocol");
10
+ const source_1 = require("./source");
11
+ /**
12
+ * Airbyte Source base class providing additional boilerplate around the Check
13
+ * and Discover commands, and the logic for processing the Source's streams. The
14
+ * user needs to implement the spec() and checkConnection() methods and the
15
+ * streams.
16
+ */
17
+ class AirbyteSourceBase extends source_1.AirbyteSource {
18
+ constructor(logger) {
19
+ super();
20
+ this.logger = logger;
21
+ }
22
+ /**
23
+ * Source name
24
+ */
25
+ get name() {
26
+ return this.constructor.name;
27
+ }
28
+ /**
29
+ * Implements the Discover operation from the Airbyte Specification. See
30
+ * https://docs.airbyte.io/architecture/airbyte-specification.
31
+ */
32
+ async discover(config) {
33
+ const streams = this.streams(config).map((stream) => stream.asAirbyteStream());
34
+ return new protocol_1.AirbyteCatalogMessage({ streams });
35
+ }
36
+ /**
37
+ * Implements the Check Connection operation from the Airbyte Specification.
38
+ * See https://docs.airbyte.io/architecture/airbyte-specification.
39
+ */
40
+ async check(config) {
41
+ var _a;
42
+ try {
43
+ const [succeeded, error] = await this.checkConnection(config);
44
+ if (!succeeded) {
45
+ return new protocol_1.AirbyteConnectionStatusMessage({
46
+ status: protocol_1.AirbyteConnectionStatus.FAILED,
47
+ message: error.message,
48
+ });
49
+ }
50
+ }
51
+ catch (error) {
52
+ return new protocol_1.AirbyteConnectionStatusMessage({
53
+ status: protocol_1.AirbyteConnectionStatus.FAILED,
54
+ message: (_a = error.message) !== null && _a !== void 0 ? _a : `Unknown error: ${JSON.stringify(error)}`,
55
+ });
56
+ }
57
+ return new protocol_1.AirbyteConnectionStatusMessage({
58
+ status: protocol_1.AirbyteConnectionStatus.SUCCEEDED,
59
+ });
60
+ }
61
+ /**
62
+ * Implements the Read operation from the Airbyte Specification. See
63
+ * https://docs.airbyte.io/architecture/airbyte-specification.
64
+ */
65
+ async *read(config, catalog, state) {
66
+ var _a, _b;
67
+ this.logger.info(`Syncing ${this.name}`);
68
+ const connectorState = (0, lodash_1.cloneDeep)(state !== null && state !== void 0 ? state : {});
69
+ // TODO: assert all streams exist in the connector
70
+ // get the streams once in case the connector needs to make any queries to
71
+ // generate them
72
+ const streamInstances = (0, lodash_1.keyBy)(this.streams(config), (s) => s.name);
73
+ for (const configuredStream of catalog.streams) {
74
+ const streamName = configuredStream.stream.name;
75
+ const streamInstance = streamInstances[streamName];
76
+ if (!streamInstance) {
77
+ throw new verror_1.default(`The requested stream ${streamName} was not found in the source. Available streams: ${Object.keys(streamInstances)}`);
78
+ }
79
+ try {
80
+ const generator = this.readStream(streamInstance, configuredStream, connectorState);
81
+ for await (const message of generator) {
82
+ yield message;
83
+ }
84
+ }
85
+ catch (e) {
86
+ this.logger.error(`Encountered an error while reading stream ${streamName}: ${(_a = e.message) !== null && _a !== void 0 ? _a : JSON.stringify(e)}`, e.stack);
87
+ yield new protocol_1.AirbyteStateMessage({ data: connectorState }, { status: 'ERRORED', error: (_b = e.message) !== null && _b !== void 0 ? _b : JSON.stringify(e) });
88
+ throw e;
89
+ }
90
+ }
91
+ this.logger.info(`Finished syncing ${this.name}`);
92
+ }
93
+ async *readStream(streamInstance, configuredStream, connectorState) {
94
+ const useIncremental = configuredStream.sync_mode === protocol_1.SyncMode.INCREMENTAL &&
95
+ streamInstance.supportsIncremental;
96
+ const recordGenerator = useIncremental
97
+ ? this.readIncremental(streamInstance, configuredStream, connectorState)
98
+ : this.readFullRefresh(streamInstance, configuredStream);
99
+ let recordCounter = 0;
100
+ const streamName = configuredStream.stream.name;
101
+ const mode = useIncremental ? 'incremental' : 'full';
102
+ this.logger.info(`Syncing ${streamName} stream in ${mode} mode`);
103
+ for await (const record of recordGenerator) {
104
+ if (record.type === protocol_1.AirbyteMessageType.RECORD) {
105
+ recordCounter++;
106
+ }
107
+ yield record;
108
+ }
109
+ this.logger.info(`Finished syncing ${streamName} stream. Read ${recordCounter} records`);
110
+ }
111
+ async *readIncremental(streamInstance, configuredStream, connectorState) {
112
+ var _a;
113
+ const streamName = configuredStream.stream.name;
114
+ let streamState = (_a = connectorState[streamName]) !== null && _a !== void 0 ? _a : {};
115
+ if (streamState) {
116
+ this.logger.info(`Setting initial state of ${streamName} stream to ${JSON.stringify(streamState)}`);
117
+ }
118
+ const checkpointInterval = streamInstance.stateCheckpointInterval;
119
+ if (checkpointInterval < 0) {
120
+ throw new verror_1.default(`Checkpoint interval ${checkpointInterval}of ${streamName} stream must be a positive integer`);
121
+ }
122
+ const slices = streamInstance.streamSlices(protocol_1.SyncMode.INCREMENTAL, configuredStream.cursor_field, streamState);
123
+ for await (const slice of slices) {
124
+ if (slice) {
125
+ this.logger.info(`Started processing ${streamName} stream slice ${JSON.stringify(slice)}`);
126
+ }
127
+ let recordCounter = 0;
128
+ const records = streamInstance.readRecords(protocol_1.SyncMode.INCREMENTAL, configuredStream.cursor_field, slice, streamState);
129
+ for await (const recordData of records) {
130
+ recordCounter++;
131
+ yield protocol_1.AirbyteRecord.make(streamName, recordData);
132
+ streamState = streamInstance.getUpdatedState(streamState, recordData);
133
+ if (checkpointInterval && recordCounter % checkpointInterval === 0) {
134
+ yield this.checkpointState(streamName, streamState, connectorState);
135
+ }
136
+ }
137
+ yield this.checkpointState(streamName, streamState, connectorState);
138
+ if (slice) {
139
+ this.logger.info(`Finished processing ${streamName} stream slice ${JSON.stringify(slice)}. Read ${recordCounter} records`);
140
+ }
141
+ }
142
+ this.logger.info(`Last recorded state of ${streamName} stream is ${JSON.stringify(streamState)}`);
143
+ }
144
+ async *readFullRefresh(streamInstance, configuredStream) {
145
+ const streamName = configuredStream.stream.name;
146
+ const slices = streamInstance.streamSlices(protocol_1.SyncMode.FULL_REFRESH, configuredStream.cursor_field);
147
+ for await (const slice of slices) {
148
+ if (slice) {
149
+ this.logger.info(`Started processing ${streamName} stream slice ${JSON.stringify(slice)}`);
150
+ }
151
+ let recordCounter = 0;
152
+ const records = streamInstance.readRecords(protocol_1.SyncMode.FULL_REFRESH, configuredStream.cursor_field, slice);
153
+ for await (const record of records) {
154
+ recordCounter++;
155
+ yield protocol_1.AirbyteRecord.make(configuredStream.stream.name, record);
156
+ }
157
+ if (slice) {
158
+ this.logger.info(`Finished processing ${streamName} stream slice ${JSON.stringify(slice)}. Read ${recordCounter} records`);
159
+ }
160
+ }
161
+ }
162
+ checkpointState(streamName, streamState, connectorState) {
163
+ connectorState[streamName] = streamState;
164
+ return new protocol_1.AirbyteStateMessage({ data: connectorState });
165
+ }
166
+ }
167
+ exports.AirbyteSourceBase = AirbyteSourceBase;
168
+ //# sourceMappingURL=source-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-base.js","sourceRoot":"","sources":["../../src/sources/source-base.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAwC;AACxC,oDAA4B;AAG5B,0CAaqB;AACrB,qCAAuC;AAGvC;;;;;GAKG;AACH,MAAsB,iBAEpB,SAAQ,sBAAqB;IAC7B,YAA+B,MAAqB;QAClD,KAAK,EAAE,CAAC;QADqB,WAAM,GAAN,MAAM,CAAe;IAEpD,CAAC;IA2BD;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,QAAQ,CAAC,MAAc;QAC3B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAClD,MAAM,CAAC,eAAe,EAAE,CACzB,CAAC;QACF,OAAO,IAAI,gCAAqB,CAAC,EAAC,OAAO,EAAC,CAAC,CAAC;IAC9C,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,KAAK,CAAC,MAAc;;QACxB,IAAI;YACF,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG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F,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE;YAChC,IAAI,KAAK,EAAE;gBACT,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,sBAAsB,UAAU,iBAAiB,IAAI,CAAC,SAAS,CAC7D,KAAK,CACN,EAAE,CACJ,CAAC;aACH;YACD,IAAI,aAAa,GAAG,CAAC,CAAC;YACtB,MAAM,OAAO,GAAG,cAAc,CAAC,WAAW,CACxC,mBAAQ,CAAC,YAAY,EACrB,gBAAgB,CAAC,YAAY,EAC7B,KAAK,CACN,CAAC;YACF,IAAI,KAAK,EAAE,MAAM,MAAM,IAAI,OAAO,EAAE;gBAClC,aAAa,EAAE,CAAC;gBAChB,MAAM,wBAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;aAChE;YACD,IAAI,KAAK,EAAE;gBACT,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,uBAAuB,UAAU,iBAAiB,IAAI,CAAC,SAAS,CAC9D,KAAK,CACN,UAAU,aAAa,UAAU,CACnC,CAAC;aACH;SACF;IACH,CAAC;IAEO,eAAe,CACrB,UAAkB,EAClB,WAAgB,EAChB,cAA4B;QAE5B,cAAc,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC;QACzC,OAAO,IAAI,8BAAmB,CAAC,EAAC,IAAI,EAAE,cAAc,EAAC,CAAC,CAAC;IACzD,CAAC;CACF;AAzQD,8CAyQC"}
@@ -0,0 +1,17 @@
1
+ import { Command } from 'commander';
2
+ import { AirbyteLogger } from '../logger';
3
+ import { AirbyteConfig } from '../protocol';
4
+ import { Runner } from '../runner';
5
+ import { AirbyteSource } from './source';
6
+ export declare class AirbyteSourceRunner<Config extends AirbyteConfig> extends Runner {
7
+ protected readonly logger: AirbyteLogger;
8
+ protected readonly source: AirbyteSource<Config>;
9
+ constructor(logger: AirbyteLogger, source: AirbyteSource<Config>);
10
+ mainCommand(): Command;
11
+ specCommand(): Command;
12
+ checkCommand(): Command;
13
+ discoverCommand(): Command;
14
+ readCommand(): Command;
15
+ specPrettyCommand(): Command;
16
+ airbyteLocalCLIWizardCommand(): Command;
17
+ }