@ewyn/client 0.5.0 → 0.7.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.
- package/README.md +8 -0
- package/dist/__tests__/cli-fetch-config.test.js +14 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +74 -18
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -9
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -179,6 +179,7 @@ new Ewyn(options: EwynOptions)
|
|
|
179
179
|
- `templates` (TemplateConfig, optional): Template configuration for name-based sending
|
|
180
180
|
- `maxRetries` (number, optional): Maximum retries for retryable errors (default: 3)
|
|
181
181
|
- `timeout` (number, optional): Request timeout in milliseconds (default: 30000)
|
|
182
|
+
- `debug` (boolean, optional): Log request/retry details to stderr. Also enabled when env `DEBUG` contains `ewyn`.
|
|
182
183
|
|
|
183
184
|
#### Methods
|
|
184
185
|
|
|
@@ -211,6 +212,13 @@ Send an email using a template.
|
|
|
211
212
|
- `EwynApiError`: If the API request fails
|
|
212
213
|
- `Error`: If validation fails (missing template, missing variables, etc.)
|
|
213
214
|
|
|
215
|
+
### Debug logging
|
|
216
|
+
|
|
217
|
+
To see which step is running (useful when something fails):
|
|
218
|
+
|
|
219
|
+
- **CLI:** The `fetch-config` command logs progress to stdout (`Using config: ...`, `Fetching template config from API...`, `Wrote ...`). For extra detail (config paths, timing), set `DEBUG=ewyn` before running. On errors, use `DEBUG=ewyn` to print the full stack.
|
|
220
|
+
- **SDK:** Pass `debug: true` in the client options, or set `DEBUG=ewyn` in the environment. Requests, retries, and timeouts are then logged to stderr.
|
|
221
|
+
|
|
214
222
|
### Error Handling
|
|
215
223
|
|
|
216
224
|
The SDK throws `EwynApiError` for API errors:
|
|
@@ -65,4 +65,18 @@ describe('fetch-config CLI', () => {
|
|
|
65
65
|
const content = fs.readFileSync(outputPath, 'utf-8');
|
|
66
66
|
expect(content).toContain('"welcome"');
|
|
67
67
|
});
|
|
68
|
+
it('loads ewyn.config.ts via tsx and writes ewynTemplates.ts', async () => {
|
|
69
|
+
const configPath = path.join(tempDir, 'ewyn.config.ts');
|
|
70
|
+
fs.writeFileSync(configPath, `export default {
|
|
71
|
+
apiKey: 'test-api-key-ts',
|
|
72
|
+
};
|
|
73
|
+
`, 'utf-8');
|
|
74
|
+
await runFetchConfig(tempDir);
|
|
75
|
+
const outputPath = path.join(tempDir, 'ewynTemplates.ts');
|
|
76
|
+
expect(fs.existsSync(outputPath)).toBe(true);
|
|
77
|
+
const content = fs.readFileSync(outputPath, 'utf-8');
|
|
78
|
+
expect(content).toContain('// Generated by @ewyn/client fetch-config');
|
|
79
|
+
expect(content).toContain('export const ewynTemplates = ');
|
|
80
|
+
expect(content).toContain('"welcome"');
|
|
81
|
+
});
|
|
68
82
|
});
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AA8IA,4BAA4B;AAC5B,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyC/D"}
|
package/dist/cli.js
CHANGED
|
@@ -3,9 +3,16 @@ import fs from 'node:fs';
|
|
|
3
3
|
import { createRequire } from 'node:module';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
6
|
+
import { config as dotenvConfig } from 'dotenv';
|
|
6
7
|
const EWYN_API_BASE_URL = 'https://www.ewyn.ai/api/v1';
|
|
7
8
|
const CONFIG_NAMES = ['ewyn.config.ts', 'ewyn.config.mjs', 'ewyn.config.js'];
|
|
8
9
|
const DEFAULT_OUTPUT_FILE = 'ewynTemplates.ts';
|
|
10
|
+
const FETCH_TIMEOUT_MS = 30_000;
|
|
11
|
+
const debug = (msg) => {
|
|
12
|
+
if (process.env.DEBUG?.includes('ewyn')) {
|
|
13
|
+
console.error(`[ewyn] ${msg}`);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
9
16
|
function printUsage() {
|
|
10
17
|
console.error(`
|
|
11
18
|
Usage: ewyn <command>
|
|
@@ -35,18 +42,25 @@ function findConfigPath(cwd) {
|
|
|
35
42
|
async function loadConfig(configPath) {
|
|
36
43
|
const ext = path.extname(configPath);
|
|
37
44
|
if (ext === '.ts') {
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
const mod =
|
|
42
|
-
|
|
45
|
+
debug(`Loading TypeScript config: ${configPath}`);
|
|
46
|
+
const createRequireForUrl = createRequire(import.meta.url);
|
|
47
|
+
const { require: tsxRequire } = createRequireForUrl('tsx/cjs/api');
|
|
48
|
+
const mod = tsxRequire(configPath, fileURLToPath(import.meta.url));
|
|
49
|
+
let config = mod?.default;
|
|
50
|
+
if (config != null && typeof config?.then === 'function') {
|
|
51
|
+
config = await config;
|
|
52
|
+
}
|
|
43
53
|
if (!config || typeof config !== 'object') {
|
|
44
54
|
throw new Error(`${configPath}: expected default export to be a config object`);
|
|
45
55
|
}
|
|
46
56
|
return config;
|
|
47
57
|
}
|
|
58
|
+
debug(`Loading JS config: ${configPath}`);
|
|
48
59
|
const mod = await import(pathToFileURL(configPath).href);
|
|
49
|
-
|
|
60
|
+
let config = mod?.default;
|
|
61
|
+
if (config != null && typeof config?.then === 'function') {
|
|
62
|
+
config = await config;
|
|
63
|
+
}
|
|
50
64
|
if (!config || typeof config !== 'object') {
|
|
51
65
|
throw new Error(`${configPath}: expected default export to be a config object`);
|
|
52
66
|
}
|
|
@@ -60,12 +74,23 @@ function validateConfig(config, configPath) {
|
|
|
60
74
|
}
|
|
61
75
|
async function fetchTemplates(apiKey) {
|
|
62
76
|
const url = `${EWYN_API_BASE_URL}/templates/config`;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
77
|
+
debug(`Fetching template config from API (timeout ${FETCH_TIMEOUT_MS}ms)...`);
|
|
78
|
+
let response;
|
|
79
|
+
try {
|
|
80
|
+
response = await fetch(url, {
|
|
81
|
+
method: 'GET',
|
|
82
|
+
headers: {
|
|
83
|
+
Authorization: `Bearer ${apiKey}`,
|
|
84
|
+
},
|
|
85
|
+
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
const isTimeout = err instanceof Error &&
|
|
90
|
+
(err.name === 'TimeoutError' || err.name === 'AbortError');
|
|
91
|
+
console.error(`Error: Failed to fetch template config${isTimeout ? ` (timeout after ${FETCH_TIMEOUT_MS}ms)` : ''}: ${err instanceof Error ? err.message : String(err)}`);
|
|
92
|
+
process.exit(1);
|
|
93
|
+
}
|
|
69
94
|
if (!response.ok) {
|
|
70
95
|
const body = await response.text();
|
|
71
96
|
let details = body;
|
|
@@ -81,6 +106,7 @@ async function fetchTemplates(apiKey) {
|
|
|
81
106
|
}
|
|
82
107
|
const data = (await response.json());
|
|
83
108
|
const templates = data.templates ?? {};
|
|
109
|
+
debug(`Fetched ${Object.keys(templates).length} template(s).`);
|
|
84
110
|
return templates;
|
|
85
111
|
}
|
|
86
112
|
function serializeTemplates(templates) {
|
|
@@ -90,23 +116,47 @@ function serializeTemplates(templates) {
|
|
|
90
116
|
lines.push(json + ' as const;');
|
|
91
117
|
return lines.join('\n');
|
|
92
118
|
}
|
|
119
|
+
function loadEnvFiles(cwd) {
|
|
120
|
+
dotenvConfig({ path: path.join(cwd, '.env') });
|
|
121
|
+
dotenvConfig({ path: path.join(cwd, '.env.local') });
|
|
122
|
+
}
|
|
93
123
|
/** Exported for testing. */
|
|
94
124
|
export async function runFetchConfig(cwd) {
|
|
125
|
+
console.log('Fetching Ewyn template config...');
|
|
126
|
+
debug(`CWD: ${cwd}`);
|
|
127
|
+
loadEnvFiles(cwd);
|
|
95
128
|
const configPath = findConfigPath(cwd);
|
|
96
129
|
if (!configPath) {
|
|
97
130
|
console.error('Error: ewyn.config.ts (or ewyn.config.mjs / ewyn.config.js) not found in current directory.');
|
|
98
131
|
process.exit(1);
|
|
99
132
|
}
|
|
100
|
-
|
|
133
|
+
console.log(`Using config: ${path.relative(cwd, configPath) || configPath}`);
|
|
134
|
+
let config;
|
|
135
|
+
try {
|
|
136
|
+
config = await loadConfig(configPath);
|
|
137
|
+
}
|
|
138
|
+
catch (err) {
|
|
139
|
+
console.error(`Error: Loading config failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
140
|
+
process.exit(1);
|
|
141
|
+
}
|
|
101
142
|
validateConfig(config, configPath);
|
|
102
143
|
const outputPath = config.configurationPath
|
|
103
144
|
? path.resolve(cwd, config.configurationPath)
|
|
104
145
|
: path.join(cwd, DEFAULT_OUTPUT_FILE);
|
|
105
|
-
|
|
146
|
+
console.log('Fetching template config from API...');
|
|
147
|
+
let templates;
|
|
148
|
+
try {
|
|
149
|
+
templates = await fetchTemplates(config.apiKey);
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
console.error(`Error: API request failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
153
|
+
process.exit(1);
|
|
154
|
+
}
|
|
106
155
|
const dir = path.dirname(outputPath);
|
|
156
|
+
debug(`Writing ${outputPath}`);
|
|
107
157
|
fs.mkdirSync(dir, { recursive: true });
|
|
108
158
|
fs.writeFileSync(outputPath, serializeTemplates(templates), 'utf-8');
|
|
109
|
-
console.log(`Wrote ${outputPath}`);
|
|
159
|
+
console.log(`Wrote ${path.relative(cwd, outputPath) || outputPath}`);
|
|
110
160
|
}
|
|
111
161
|
async function main() {
|
|
112
162
|
const args = process.argv.slice(2);
|
|
@@ -126,9 +176,10 @@ async function main() {
|
|
|
126
176
|
}
|
|
127
177
|
let isMain = false;
|
|
128
178
|
try {
|
|
129
|
-
|
|
179
|
+
const arg1 = typeof process !== 'undefined' ? process.argv[1] : undefined;
|
|
180
|
+
if (arg1 && (path.isAbsolute(arg1) || arg1.includes(path.sep) || arg1.endsWith('.js'))) {
|
|
130
181
|
const ourPath = fs.realpathSync(fileURLToPath(import.meta.url));
|
|
131
|
-
const entryPath = fs.realpathSync(path.resolve(
|
|
182
|
+
const entryPath = fs.realpathSync(path.resolve(arg1));
|
|
132
183
|
isMain = entryPath === ourPath;
|
|
133
184
|
}
|
|
134
185
|
}
|
|
@@ -137,7 +188,12 @@ catch {
|
|
|
137
188
|
}
|
|
138
189
|
if (isMain) {
|
|
139
190
|
main().catch((err) => {
|
|
140
|
-
|
|
191
|
+
if (process.env.DEBUG?.includes('ewyn')) {
|
|
192
|
+
console.error(err);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
196
|
+
}
|
|
141
197
|
process.exit(1);
|
|
142
198
|
});
|
|
143
199
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,9 @@ export declare class Ewyn<TConfig extends TemplateConfig = TemplateConfig> {
|
|
|
4
4
|
private readonly templates?;
|
|
5
5
|
private readonly maxRetries;
|
|
6
6
|
private readonly timeout;
|
|
7
|
+
private readonly debug;
|
|
7
8
|
constructor(options: EwynOptions | EwynOptionsTyped<TConfig>);
|
|
9
|
+
private logDebug;
|
|
8
10
|
/**
|
|
9
11
|
* Send an email using a template
|
|
10
12
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACf,MAAM,YAAY,CAAC;AAiDpB,qBAAa,IAAI,CAAC,OAAO,SAAS,cAAc,GAAG,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jB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -50,11 +50,18 @@ export class Ewyn {
|
|
|
50
50
|
templates;
|
|
51
51
|
maxRetries;
|
|
52
52
|
timeout;
|
|
53
|
+
debug;
|
|
53
54
|
constructor(options) {
|
|
54
55
|
this.apiKey = options.apiKey;
|
|
55
56
|
this.templates = options.templates;
|
|
56
57
|
this.maxRetries = options.maxRetries ?? 3;
|
|
57
58
|
this.timeout = options.timeout ?? 30000;
|
|
59
|
+
this.debug = !!(options.debug ?? (typeof process !== 'undefined' && process.env?.DEBUG?.includes('ewyn')));
|
|
60
|
+
}
|
|
61
|
+
logDebug(msg) {
|
|
62
|
+
if (this.debug) {
|
|
63
|
+
console.error(`[ewyn] ${msg}`);
|
|
64
|
+
}
|
|
58
65
|
}
|
|
59
66
|
/**
|
|
60
67
|
* Send an email using a template
|
|
@@ -162,43 +169,49 @@ export class Ewyn {
|
|
|
162
169
|
*/
|
|
163
170
|
async requestWithRetry(path, init, attempt = 1) {
|
|
164
171
|
const url = `${EWYN_API_BASE_URL}${path}`;
|
|
165
|
-
|
|
166
|
-
const
|
|
172
|
+
this.logDebug(`Request ${init.method ?? 'GET'} ${path} (attempt ${attempt}/${this.maxRetries + 1})`);
|
|
173
|
+
const signal = typeof AbortSignal !== 'undefined' && 'timeout' in AbortSignal
|
|
174
|
+
? AbortSignal.timeout(this.timeout)
|
|
175
|
+
: (() => {
|
|
176
|
+
const controller = new AbortController();
|
|
177
|
+
setTimeout(() => controller.abort(), this.timeout);
|
|
178
|
+
return controller.signal;
|
|
179
|
+
})();
|
|
167
180
|
try {
|
|
168
181
|
const response = await fetch(url, {
|
|
169
182
|
...init,
|
|
170
|
-
signal
|
|
183
|
+
signal,
|
|
171
184
|
});
|
|
172
|
-
clearTimeout(timeoutId);
|
|
173
185
|
const data = await response.json().catch(() => ({}));
|
|
174
186
|
if (!response.ok) {
|
|
175
187
|
const error = new EwynApiError(response.status, data.code, data.details || data, data.error || data.message);
|
|
176
|
-
// Retry on retryable errors
|
|
177
188
|
if (error.isRetryable() && attempt < this.maxRetries) {
|
|
178
|
-
// Exponential backoff: 1s, 2s, 4s
|
|
179
189
|
const delay = Math.pow(2, attempt - 1) * 1000;
|
|
190
|
+
this.logDebug(`Retryable error ${response.status}, retrying in ${delay}ms...`);
|
|
180
191
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
181
192
|
return this.requestWithRetry(path, init, attempt + 1);
|
|
182
193
|
}
|
|
194
|
+
this.logDebug(`Request failed: ${response.status} ${data.error ?? data.message ?? ''}`);
|
|
183
195
|
throw error;
|
|
184
196
|
}
|
|
197
|
+
this.logDebug(`Request ${path} succeeded`);
|
|
185
198
|
return data;
|
|
186
199
|
}
|
|
187
200
|
catch (error) {
|
|
188
|
-
clearTimeout(timeoutId);
|
|
189
201
|
if (error instanceof EwynApiError) {
|
|
190
202
|
throw error;
|
|
191
203
|
}
|
|
192
|
-
// Handle network errors or timeouts
|
|
193
204
|
if (error instanceof Error && error.name === 'AbortError') {
|
|
205
|
+
this.logDebug(`Request timed out after ${this.timeout}ms`);
|
|
194
206
|
throw new EwynApiError(408, 'TIMEOUT', undefined, `Request timed out after ${this.timeout}ms`);
|
|
195
207
|
}
|
|
196
|
-
// Retry on network errors if we have attempts left
|
|
197
208
|
if (attempt < this.maxRetries) {
|
|
198
209
|
const delay = Math.pow(2, attempt - 1) * 1000;
|
|
210
|
+
this.logDebug(`Network error, retrying in ${delay}ms: ${error instanceof Error ? error.message : String(error)}`);
|
|
199
211
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
200
212
|
return this.requestWithRetry(path, init, attempt + 1);
|
|
201
213
|
}
|
|
214
|
+
this.logDebug(`Request failed after ${attempt} attempt(s): ${error instanceof Error ? error.message : String(error)}`);
|
|
202
215
|
throw new EwynApiError(500, 'NETWORK_ERROR', undefined, error instanceof Error ? error.message : 'Unknown network error');
|
|
203
216
|
}
|
|
204
217
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -106,6 +106,8 @@ export interface EwynOptionsBase {
|
|
|
106
106
|
maxRetries?: number;
|
|
107
107
|
/** Request timeout in milliseconds (default: 30000) */
|
|
108
108
|
timeout?: number;
|
|
109
|
+
/** Enable debug logging (requests, retries) to stderr. Also enabled when DEBUG env includes "ewyn". */
|
|
110
|
+
debug?: boolean;
|
|
109
111
|
}
|
|
110
112
|
/**
|
|
111
113
|
* Configuration options with typed template config
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,oDAAoD;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CACxC;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAEjE;;GAEG;AACH,KAAK,YAAY,CAAC,CAAC,SAAS,mBAAmB,IAAI;KAChD,CAAC,IAAI,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;QAAE,QAAQ,EAAE,IAAI,CAAA;KAAE,GAAG,CAAC,GAAG,KAAK;CAC5E,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEnB;;GAEG;AACH,KAAK,YAAY,CAAC,CAAC,SAAS,mBAAmB,IAAI;KAChD,CAAC,IAAI,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC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C9B,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,yIAAyI;IACzI,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ewyn/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Official TypeScript SDK for Ewyn email service with full type safety",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"node": ">=18.0.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
+
"dotenv": "^16.4.5",
|
|
35
36
|
"tsx": "^4.19.0"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|