@marktoflow/integrations 2.0.4-alpha.1 → 2.0.4

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 (82) hide show
  1. package/README.md +2 -2
  2. package/dist/adapters/claude-code.d.ts +34 -0
  3. package/dist/adapters/claude-code.d.ts.map +1 -0
  4. package/dist/adapters/claude-code.js +89 -0
  5. package/dist/adapters/claude-code.js.map +1 -0
  6. package/dist/adapters/github-copilot-types.d.ts +2 -2
  7. package/dist/adapters/github-copilot-workflow.d.ts +2 -2
  8. package/dist/index.d.ts +0 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +1 -4
  11. package/dist/index.js.map +1 -1
  12. package/dist/reliability/index.d.ts +1 -3
  13. package/dist/reliability/index.d.ts.map +1 -1
  14. package/dist/reliability/index.js +1 -3
  15. package/dist/reliability/index.js.map +1 -1
  16. package/dist/reliability/wrapper.d.ts +0 -9
  17. package/dist/reliability/wrapper.d.ts.map +1 -1
  18. package/dist/reliability/wrapper.js +12 -62
  19. package/dist/reliability/wrapper.js.map +1 -1
  20. package/dist/services/base-client.d.ts.map +1 -1
  21. package/dist/services/base-client.js +3 -25
  22. package/dist/services/base-client.js.map +1 -1
  23. package/dist/services/discord.d.ts.map +1 -1
  24. package/dist/services/discord.js +0 -6
  25. package/dist/services/discord.js.map +1 -1
  26. package/dist/services/gmail.d.ts.map +1 -1
  27. package/dist/services/gmail.js +47 -65
  28. package/dist/services/gmail.js.map +1 -1
  29. package/dist/services/google-calendar.js +5 -9
  30. package/dist/services/google-calendar.js.map +1 -1
  31. package/dist/services/google-docs.js +5 -9
  32. package/dist/services/google-docs.js.map +1 -1
  33. package/dist/services/google-drive.js +5 -9
  34. package/dist/services/google-drive.js.map +1 -1
  35. package/dist/services/google-sheets.js +5 -9
  36. package/dist/services/google-sheets.js.map +1 -1
  37. package/dist/services/http.d.ts.map +1 -1
  38. package/dist/services/http.js +1 -15
  39. package/dist/services/http.js.map +1 -1
  40. package/dist/services/mailchimp.d.ts.map +1 -1
  41. package/dist/services/mailchimp.js +0 -3
  42. package/dist/services/mailchimp.js.map +1 -1
  43. package/dist/services/outlook.d.ts.map +1 -1
  44. package/dist/services/outlook.js +11 -14
  45. package/dist/services/outlook.js.map +1 -1
  46. package/dist/services/shopify.d.ts.map +1 -1
  47. package/dist/services/shopify.js +0 -3
  48. package/dist/services/shopify.js.map +1 -1
  49. package/dist/services/trello.d.ts.map +1 -1
  50. package/dist/services/trello.js +1 -7
  51. package/dist/services/trello.js.map +1 -1
  52. package/package.json +3 -6
  53. package/dist/adapters/claude-agent-hooks.d.ts +0 -176
  54. package/dist/reliability/circuit-breaker.d.ts +0 -67
  55. package/dist/reliability/circuit-breaker.d.ts.map +0 -1
  56. package/dist/reliability/circuit-breaker.js +0 -164
  57. package/dist/reliability/circuit-breaker.js.map +0 -1
  58. package/dist/reliability/rate-limiter.d.ts +0 -62
  59. package/dist/reliability/rate-limiter.d.ts.map +0 -1
  60. package/dist/reliability/rate-limiter.js +0 -194
  61. package/dist/reliability/rate-limiter.js.map +0 -1
  62. package/dist/services/github.d.ts +0 -3
  63. package/dist/services/gmail-trigger.d.ts +0 -92
  64. package/dist/services/gmail.d.ts +0 -116
  65. package/dist/services/google-calendar.d.ts +0 -220
  66. package/dist/services/google-docs.d.ts +0 -197
  67. package/dist/services/google-drive.d.ts +0 -149
  68. package/dist/services/google-sheets.d.ts +0 -165
  69. package/dist/services/http.d.ts +0 -120
  70. package/dist/services/jira.d.ts +0 -3
  71. package/dist/services/linear.d.ts +0 -163
  72. package/dist/services/mysql.d.ts +0 -91
  73. package/dist/services/outlook-trigger.d.ts +0 -121
  74. package/dist/services/outlook.d.ts +0 -237
  75. package/dist/services/postgres.d.ts +0 -83
  76. package/dist/services/rss.d.ts +0 -57
  77. package/dist/services/rss.d.ts.map +0 -1
  78. package/dist/services/rss.js +0 -190
  79. package/dist/services/rss.js.map +0 -1
  80. package/dist/services/slack-socket.d.ts +0 -18
  81. package/dist/services/slack.d.ts +0 -3
  82. package/dist/services/whatsapp.d.ts +0 -311
@@ -1,149 +0,0 @@
1
- /**
2
- * Google Drive Integration
3
- *
4
- * File storage and collaboration platform.
5
- * API Docs: https://developers.google.com/drive/api
6
- */
7
- import { drive_v3 } from 'googleapis';
8
- import { SDKInitializer } from '@marktoflow/core';
9
- import { Readable } from 'stream';
10
- export interface DriveFile {
11
- id: string;
12
- name: string;
13
- mimeType: string;
14
- parents?: string[];
15
- size?: string;
16
- createdTime?: string;
17
- modifiedTime?: string;
18
- webViewLink?: string;
19
- webContentLink?: string;
20
- description?: string;
21
- starred?: boolean;
22
- trashed?: boolean;
23
- shared?: boolean;
24
- owners?: {
25
- displayName?: string;
26
- emailAddress?: string;
27
- }[];
28
- permissions?: DrivePermission[];
29
- }
30
- export interface DrivePermission {
31
- id: string;
32
- type: 'user' | 'group' | 'domain' | 'anyone';
33
- role: 'owner' | 'organizer' | 'fileOrganizer' | 'writer' | 'commenter' | 'reader';
34
- emailAddress?: string;
35
- displayName?: string;
36
- deleted?: boolean;
37
- }
38
- export interface ListFilesOptions {
39
- q?: string;
40
- pageSize?: number;
41
- pageToken?: string;
42
- orderBy?: string;
43
- spaces?: string;
44
- fields?: string;
45
- includeItemsFromAllDrives?: boolean;
46
- supportsAllDrives?: boolean;
47
- }
48
- export interface CreateFileOptions {
49
- name: string;
50
- mimeType?: string;
51
- parents?: string[];
52
- description?: string;
53
- content?: string | Buffer | Readable;
54
- contentType?: string;
55
- }
56
- export interface UpdateFileOptions {
57
- name?: string;
58
- description?: string;
59
- starred?: boolean;
60
- trashed?: boolean;
61
- parents?: string[];
62
- content?: string | Buffer | Readable;
63
- contentType?: string;
64
- }
65
- export interface ShareFileOptions {
66
- type: 'user' | 'group' | 'domain' | 'anyone';
67
- role: 'owner' | 'organizer' | 'fileOrganizer' | 'writer' | 'commenter' | 'reader';
68
- emailAddress?: string;
69
- domain?: string;
70
- allowFileDiscovery?: boolean;
71
- sendNotificationEmail?: boolean;
72
- emailMessage?: string;
73
- }
74
- /**
75
- * Google Drive actions for workflow integration
76
- */
77
- export declare class GoogleDriveActions {
78
- private drive;
79
- constructor(drive: drive_v3.Drive);
80
- /**
81
- * List files and folders
82
- */
83
- listFiles(options?: ListFilesOptions): Promise<{
84
- files: DriveFile[];
85
- nextPageToken?: string;
86
- }>;
87
- /**
88
- * Get a file by ID
89
- */
90
- getFile(fileId: string, fields?: string): Promise<DriveFile>;
91
- /**
92
- * Download file content
93
- */
94
- downloadFile(fileId: string): Promise<Buffer>;
95
- /**
96
- * Export Google Workspace file to another format
97
- */
98
- exportFile(fileId: string, mimeType: string): Promise<Buffer>;
99
- /**
100
- * Create a file or folder
101
- */
102
- createFile(options: CreateFileOptions): Promise<DriveFile>;
103
- /**
104
- * Create a folder
105
- */
106
- createFolder(name: string, parentId?: string): Promise<DriveFile>;
107
- /**
108
- * Update a file
109
- */
110
- updateFile(fileId: string, options: UpdateFileOptions): Promise<DriveFile>;
111
- /**
112
- * Delete a file
113
- */
114
- deleteFile(fileId: string): Promise<void>;
115
- /**
116
- * Copy a file
117
- */
118
- copyFile(fileId: string, name: string, parents?: string[]): Promise<DriveFile>;
119
- /**
120
- * Move a file
121
- */
122
- moveFile(fileId: string, newParentId: string): Promise<DriveFile>;
123
- /**
124
- * Share a file
125
- */
126
- shareFile(fileId: string, options: ShareFileOptions): Promise<DrivePermission>;
127
- /**
128
- * List permissions for a file
129
- */
130
- listPermissions(fileId: string): Promise<DrivePermission[]>;
131
- /**
132
- * Remove a permission
133
- */
134
- removePermission(fileId: string, permissionId: string): Promise<void>;
135
- /**
136
- * Search files
137
- */
138
- searchFiles(query: string, options?: Omit<ListFilesOptions, 'q'>): Promise<DriveFile[]>;
139
- /**
140
- * Get files in a folder
141
- */
142
- getFilesInFolder(folderId: string): Promise<DriveFile[]>;
143
- /**
144
- * Parse file from API response
145
- */
146
- private parseFile;
147
- }
148
- export declare const GoogleDriveInitializer: SDKInitializer;
149
- //# sourceMappingURL=google-drive.d.ts.map
@@ -1,165 +0,0 @@
1
- /**
2
- * Google Sheets Integration
3
- *
4
- * Spreadsheet automation platform.
5
- * API Docs: https://developers.google.com/sheets/api
6
- */
7
- import { sheets_v4 } from 'googleapis';
8
- import { SDKInitializer } from '@marktoflow/core';
9
- export interface SpreadsheetInfo {
10
- spreadsheetId: string;
11
- properties: {
12
- title: string;
13
- locale: string;
14
- autoRecalc: string;
15
- timeZone: string;
16
- };
17
- sheets: SheetInfo[];
18
- }
19
- export interface SheetInfo {
20
- sheetId: number;
21
- title: string;
22
- index: number;
23
- sheetType: string;
24
- gridProperties: {
25
- rowCount: number;
26
- columnCount: number;
27
- };
28
- }
29
- export interface CellData {
30
- row: number;
31
- column: number;
32
- value: string | number | boolean | null;
33
- formattedValue?: string;
34
- formula?: string;
35
- }
36
- export interface AppendValuesOptions {
37
- range: string;
38
- values: unknown[][];
39
- valueInputOption?: 'RAW' | 'USER_ENTERED';
40
- insertDataOption?: 'OVERWRITE' | 'INSERT_ROWS';
41
- }
42
- export interface UpdateValuesOptions {
43
- range: string;
44
- values: unknown[][];
45
- valueInputOption?: 'RAW' | 'USER_ENTERED';
46
- }
47
- export interface BatchUpdateOptions {
48
- data: {
49
- range: string;
50
- values: unknown[][];
51
- }[];
52
- valueInputOption?: 'RAW' | 'USER_ENTERED';
53
- }
54
- export interface CreateSpreadsheetOptions {
55
- title: string;
56
- sheets?: {
57
- title: string;
58
- rowCount?: number;
59
- columnCount?: number;
60
- }[];
61
- locale?: string;
62
- timeZone?: string;
63
- }
64
- export interface AddSheetOptions {
65
- title: string;
66
- rowCount?: number;
67
- columnCount?: number;
68
- index?: number;
69
- }
70
- /**
71
- * Google Sheets actions for workflow integration
72
- */
73
- export declare class GoogleSheetsActions {
74
- private sheets;
75
- constructor(sheets: sheets_v4.Sheets);
76
- /**
77
- * Get spreadsheet metadata
78
- */
79
- getSpreadsheet(spreadsheetId: string): Promise<SpreadsheetInfo>;
80
- /**
81
- * Get values from a range
82
- */
83
- getValues(spreadsheetId: string, range: string): Promise<unknown[][]>;
84
- /**
85
- * Get multiple ranges at once
86
- */
87
- batchGetValues(spreadsheetId: string, ranges: string[]): Promise<{
88
- range: string;
89
- values: unknown[][];
90
- }[]>;
91
- /**
92
- * Append values to a sheet
93
- */
94
- appendValues(spreadsheetId: string, options: AppendValuesOptions): Promise<{
95
- updatedRange: string;
96
- updatedRows: number;
97
- updatedColumns: number;
98
- }>;
99
- /**
100
- * Update values in a range
101
- */
102
- updateValues(spreadsheetId: string, options: UpdateValuesOptions): Promise<{
103
- updatedRange: string;
104
- updatedRows: number;
105
- updatedColumns: number;
106
- updatedCells: number;
107
- }>;
108
- /**
109
- * Update multiple ranges at once
110
- */
111
- batchUpdateValues(spreadsheetId: string, options: BatchUpdateOptions): Promise<{
112
- totalUpdatedRows: number;
113
- totalUpdatedColumns: number;
114
- totalUpdatedCells: number;
115
- }>;
116
- /**
117
- * Clear values in a range
118
- */
119
- clearValues(spreadsheetId: string, range: string): Promise<{
120
- clearedRange: string;
121
- }>;
122
- /**
123
- * Create a new spreadsheet
124
- */
125
- createSpreadsheet(options: CreateSpreadsheetOptions): Promise<SpreadsheetInfo>;
126
- /**
127
- * Add a new sheet to an existing spreadsheet
128
- */
129
- addSheet(spreadsheetId: string, options: AddSheetOptions): Promise<SheetInfo>;
130
- /**
131
- * Delete a sheet
132
- */
133
- deleteSheet(spreadsheetId: string, sheetId: number): Promise<void>;
134
- /**
135
- * Duplicate a sheet
136
- */
137
- duplicateSheet(spreadsheetId: string, sourceSheetId: number, newSheetName?: string): Promise<SheetInfo>;
138
- /**
139
- * Find and replace text
140
- */
141
- findReplace(spreadsheetId: string, find: string, replacement: string, options?: {
142
- sheetId?: number;
143
- allSheets?: boolean;
144
- matchCase?: boolean;
145
- matchEntireCell?: boolean;
146
- searchByRegex?: boolean;
147
- }): Promise<{
148
- occurrencesChanged: number;
149
- valuesChanged: number;
150
- }>;
151
- /**
152
- * Sort a range
153
- */
154
- sortRange(spreadsheetId: string, range: string, sortSpecs: {
155
- dimensionIndex: number;
156
- sortOrder: 'ASCENDING' | 'DESCENDING';
157
- }[]): Promise<void>;
158
- /**
159
- * Parse A1 notation into grid range
160
- * Helper method for internal use
161
- */
162
- private parseA1Notation;
163
- }
164
- export declare const GoogleSheetsInitializer: SDKInitializer;
165
- //# sourceMappingURL=google-sheets.d.ts.map
@@ -1,120 +0,0 @@
1
- /**
2
- * HTTP Integration
3
- *
4
- * Generic REST API client for calling any HTTP endpoint.
5
- * Essential for APIs without dedicated integrations.
6
- */
7
- import { SDKInitializer } from '@marktoflow/core';
8
- export interface HttpRequestOptions {
9
- method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
10
- headers?: Record<string, string>;
11
- query?: Record<string, string | number | boolean>;
12
- body?: unknown;
13
- timeout?: number;
14
- followRedirects?: boolean;
15
- validateStatus?: (status: number) => boolean;
16
- }
17
- export interface HttpResponse<T = unknown> {
18
- status: number;
19
- statusText: string;
20
- headers: Record<string, string>;
21
- data: T;
22
- ok: boolean;
23
- url: string;
24
- }
25
- export interface HttpClientConfig {
26
- baseUrl?: string;
27
- headers?: Record<string, string>;
28
- timeout?: number;
29
- auth?: {
30
- type: 'bearer' | 'basic' | 'api-key';
31
- token?: string;
32
- username?: string;
33
- password?: string;
34
- apiKey?: string;
35
- apiKeyHeader?: string;
36
- };
37
- }
38
- /**
39
- * Generic HTTP client for workflow integration
40
- */
41
- export declare class HttpClient {
42
- private baseUrl;
43
- private defaultHeaders;
44
- private defaultTimeout;
45
- constructor(config?: HttpClientConfig);
46
- /**
47
- * Make an HTTP request
48
- */
49
- request<T = unknown>(path: string, options?: HttpRequestOptions): Promise<HttpResponse<T>>;
50
- /**
51
- * GET request
52
- */
53
- get<T = unknown>(path: string, options?: Omit<HttpRequestOptions, 'method' | 'body'>): Promise<HttpResponse<T>>;
54
- /**
55
- * POST request
56
- */
57
- post<T = unknown>(path: string, body?: unknown, options?: Omit<HttpRequestOptions, 'method' | 'body'>): Promise<HttpResponse<T>>;
58
- /**
59
- * PUT request
60
- */
61
- put<T = unknown>(path: string, body?: unknown, options?: Omit<HttpRequestOptions, 'method' | 'body'>): Promise<HttpResponse<T>>;
62
- /**
63
- * PATCH request
64
- */
65
- patch<T = unknown>(path: string, body?: unknown, options?: Omit<HttpRequestOptions, 'method' | 'body'>): Promise<HttpResponse<T>>;
66
- /**
67
- * DELETE request
68
- */
69
- delete<T = unknown>(path: string, options?: Omit<HttpRequestOptions, 'method'>): Promise<HttpResponse<T>>;
70
- /**
71
- * HEAD request
72
- */
73
- head(path: string, options?: Omit<HttpRequestOptions, 'method' | 'body'>): Promise<HttpResponse<undefined>>;
74
- /**
75
- * Set a default header
76
- */
77
- setHeader(name: string, value: string): void;
78
- /**
79
- * Remove a default header
80
- */
81
- removeHeader(name: string): void;
82
- /**
83
- * Set bearer token
84
- */
85
- setBearerToken(token: string): void;
86
- /**
87
- * Set base URL
88
- */
89
- setBaseUrl(url: string): void;
90
- }
91
- /**
92
- * HTTP error with response details
93
- */
94
- export declare class HttpError extends Error {
95
- readonly status: number;
96
- readonly statusText: string;
97
- readonly headers: Record<string, string>;
98
- readonly data: unknown;
99
- readonly url: string;
100
- constructor(response: HttpResponse);
101
- }
102
- /**
103
- * Convenience function to make a one-off request
104
- */
105
- export declare function httpRequest<T = unknown>(url: string, options?: HttpRequestOptions & {
106
- headers?: Record<string, string>;
107
- }): Promise<HttpResponse<T>>;
108
- /**
109
- * GraphQL client helper
110
- */
111
- export declare class GraphQLClient {
112
- private http;
113
- constructor(endpoint: string, config?: Omit<HttpClientConfig, 'baseUrl'>);
114
- /**
115
- * Execute a GraphQL query or mutation
116
- */
117
- query<T = unknown>(query: string, variables?: Record<string, unknown>, operationName?: string): Promise<T>;
118
- }
119
- export declare const HttpInitializer: SDKInitializer;
120
- //# sourceMappingURL=http.d.ts.map
@@ -1,3 +0,0 @@
1
- import { SDKInitializer } from '@marktoflow/core';
2
- export declare const JiraInitializer: SDKInitializer;
3
- //# sourceMappingURL=jira.d.ts.map
@@ -1,163 +0,0 @@
1
- /**
2
- * Linear Integration
3
- *
4
- * Modern issue tracking for development teams.
5
- * API Docs: https://developers.linear.app/docs/graphql/working-with-the-graphql-api
6
- */
7
- import { SDKInitializer } from '@marktoflow/core';
8
- export interface LinearIssue {
9
- id: string;
10
- identifier: string;
11
- title: string;
12
- description?: string;
13
- priority: number;
14
- priorityLabel: string;
15
- state: {
16
- id: string;
17
- name: string;
18
- type: string;
19
- };
20
- assignee?: {
21
- id: string;
22
- name: string;
23
- email: string;
24
- };
25
- team: {
26
- id: string;
27
- name: string;
28
- key: string;
29
- };
30
- project?: {
31
- id: string;
32
- name: string;
33
- };
34
- labels: {
35
- id: string;
36
- name: string;
37
- color: string;
38
- }[];
39
- createdAt: string;
40
- updatedAt: string;
41
- url: string;
42
- }
43
- export interface LinearProject {
44
- id: string;
45
- name: string;
46
- description?: string;
47
- state: string;
48
- progress: number;
49
- targetDate?: string;
50
- teams: {
51
- id: string;
52
- name: string;
53
- }[];
54
- }
55
- export interface LinearTeam {
56
- id: string;
57
- name: string;
58
- key: string;
59
- description?: string;
60
- issueCount: number;
61
- }
62
- export interface CreateIssueOptions {
63
- teamId: string;
64
- title: string;
65
- description?: string;
66
- priority?: number;
67
- assigneeId?: string;
68
- labelIds?: string[];
69
- projectId?: string;
70
- stateId?: string;
71
- estimate?: number;
72
- dueDate?: string;
73
- parentId?: string;
74
- }
75
- export interface UpdateIssueOptions {
76
- title?: string;
77
- description?: string;
78
- priority?: number;
79
- assigneeId?: string;
80
- labelIds?: string[];
81
- projectId?: string;
82
- stateId?: string;
83
- estimate?: number;
84
- dueDate?: string;
85
- }
86
- export interface SearchIssuesOptions {
87
- query?: string;
88
- teamId?: string;
89
- assigneeId?: string;
90
- stateId?: string;
91
- labelIds?: string[];
92
- projectId?: string;
93
- priority?: number;
94
- first?: number;
95
- after?: string;
96
- }
97
- /**
98
- * Linear GraphQL client for workflow integration
99
- */
100
- export declare class LinearClient {
101
- private apiKey;
102
- constructor(apiKey: string);
103
- private query;
104
- /**
105
- * Get the current user
106
- */
107
- getViewer(): Promise<{
108
- id: string;
109
- name: string;
110
- email: string;
111
- }>;
112
- /**
113
- * List teams
114
- */
115
- listTeams(): Promise<LinearTeam[]>;
116
- /**
117
- * Get an issue by ID or identifier
118
- */
119
- getIssue(idOrIdentifier: string): Promise<LinearIssue>;
120
- /**
121
- * Create an issue
122
- */
123
- createIssue(options: CreateIssueOptions): Promise<LinearIssue>;
124
- /**
125
- * Update an issue
126
- */
127
- updateIssue(issueId: string, options: UpdateIssueOptions): Promise<LinearIssue>;
128
- /**
129
- * Search issues
130
- */
131
- searchIssues(options?: SearchIssuesOptions): Promise<{
132
- issues: LinearIssue[];
133
- hasMore: boolean;
134
- endCursor?: string;
135
- }>;
136
- /**
137
- * List projects
138
- */
139
- listProjects(teamId?: string): Promise<LinearProject[]>;
140
- /**
141
- * Get workflow states for a team
142
- */
143
- getWorkflowStates(teamId: string): Promise<{
144
- id: string;
145
- name: string;
146
- type: string;
147
- position: number;
148
- }[]>;
149
- /**
150
- * Add a comment to an issue
151
- */
152
- addComment(issueId: string, body: string): Promise<{
153
- id: string;
154
- body: string;
155
- createdAt: string;
156
- }>;
157
- /**
158
- * Archive an issue
159
- */
160
- archiveIssue(issueId: string): Promise<void>;
161
- }
162
- export declare const LinearInitializer: SDKInitializer;
163
- //# sourceMappingURL=linear.d.ts.map
@@ -1,91 +0,0 @@
1
- /**
2
- * MySQL Integration
3
- *
4
- * Popular open-source relational database.
5
- * API: Using mysql2 driver
6
- */
7
- import { SDKInitializer } from '@marktoflow/core';
8
- export interface MySQLConfig {
9
- host: string;
10
- port?: number;
11
- database: string;
12
- user: string;
13
- password: string;
14
- ssl?: boolean | {
15
- rejectUnauthorized?: boolean;
16
- };
17
- connectTimeout?: number;
18
- connectionLimit?: number;
19
- waitForConnections?: boolean;
20
- queueLimit?: number;
21
- }
22
- export interface QueryResult<T = unknown> {
23
- rows: T[];
24
- fields: {
25
- name: string;
26
- type: string;
27
- }[];
28
- affectedRows?: number;
29
- insertId?: number;
30
- }
31
- export interface MySQLTransaction {
32
- query<T = unknown>(sql: string, params?: unknown[]): Promise<QueryResult<T>>;
33
- commit(): Promise<void>;
34
- rollback(): Promise<void>;
35
- }
36
- /**
37
- * MySQL client wrapper for workflow integration
38
- * Note: This is a lightweight wrapper. The actual mysql2 module will be dynamically imported.
39
- */
40
- export declare class MySQLClient {
41
- private pool;
42
- private config;
43
- constructor(config: MySQLConfig);
44
- /**
45
- * Initialize the connection pool
46
- */
47
- connect(): Promise<void>;
48
- /**
49
- * Execute a SQL query
50
- */
51
- query<T = unknown>(sql: string, params?: unknown[]): Promise<QueryResult<T>>;
52
- /**
53
- * Select data from a table
54
- */
55
- select<T = Record<string, unknown>>(table: string, options?: {
56
- columns?: string[];
57
- where?: Record<string, unknown>;
58
- orderBy?: string;
59
- limit?: number;
60
- offset?: number;
61
- }): Promise<T[]>;
62
- /**
63
- * Insert data into a table
64
- */
65
- insert<T = Record<string, unknown>>(table: string, data: Record<string, unknown> | Record<string, unknown>[]): Promise<{
66
- insertId: number;
67
- affectedRows: number;
68
- }>;
69
- /**
70
- * Update data in a table
71
- */
72
- update<T = Record<string, unknown>>(table: string, data: Record<string, unknown>, where: Record<string, unknown>): Promise<{
73
- affectedRows: number;
74
- }>;
75
- /**
76
- * Delete data from a table
77
- */
78
- delete<T = Record<string, unknown>>(table: string, where: Record<string, unknown>): Promise<{
79
- affectedRows: number;
80
- }>;
81
- /**
82
- * Begin a transaction
83
- */
84
- transaction<T>(callback: (trx: MySQLTransaction) => Promise<T>): Promise<T>;
85
- /**
86
- * Close the connection pool
87
- */
88
- close(): Promise<void>;
89
- }
90
- export declare const MySQLInitializer: SDKInitializer;
91
- //# sourceMappingURL=mysql.d.ts.map