nango 0.72.2 → 0.72.3

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.
@@ -1,69 +0,0 @@
1
- export declare const GITHUB_API_BASE = "https://api.github.com/repos/NangoHQ/integration-templates/contents/integrations";
2
- export declare const GITHUB_RAW_BASE = "https://raw.githubusercontent.com/NangoHQ/integration-templates/main/integrations";
3
- export interface GitHubDirectoryItem {
4
- name: string;
5
- path: string;
6
- type: 'file' | 'dir' | 'symlink';
7
- target?: string;
8
- }
9
- export declare class GitHubRateLimitError extends Error {
10
- constructor(resetTime?: number);
11
- }
12
- export declare class GitHubNotFoundError extends Error {
13
- constructor(path: string);
14
- }
15
- export declare function fetchGitHubDirectory(urlPath: string, debug: boolean): Promise<GitHubDirectoryItem[]>;
16
- export interface ResolvedIntegrationFolder {
17
- folder: string;
18
- contents: GitHubDirectoryItem[] | null;
19
- }
20
- /**
21
- * Resolve a (possibly symlinked) integration folder name to its real folder in the templates repo.
22
- * Returns the directory listing too when the folder is a real directory, so the caller can reuse it
23
- * instead of fetching the same path again.
24
- */
25
- export declare function resolveIntegrationFolder(integration: string, debug: boolean): Promise<ResolvedIntegrationFolder>;
26
- /**
27
- * Rewrite the leading integration folder of a remote templates-repo path to the local folder name.
28
- * Used to write symlinked-integration files under the name the user requested while fetching their
29
- * content from the resolved target folder. No-op when remote and local folders are the same.
30
- *
31
- * Eg. localizeIntegrationPath('quickbooks/syncs/customers.ts', 'quickbooks', 'quickbooks-sandbox') => 'quickbooks-sandbox/syncs/customers.ts'
32
- */
33
- export declare function localizeIntegrationPath(remotePath: string, remoteFolder: string, localFolder: string): string;
34
- /**
35
- * Fetch file content from GitHub raw URL
36
- * Uses raw.githubusercontent.com which has higher rate limits than the API
37
- */
38
- export declare function fetchFileContent(urlPath: string, debug: boolean): Promise<string>;
39
- /**
40
- * Recursively fetch all files from a directory in the GitHub repository.
41
- * Returns file paths relative to the integrations root (e.g., "github/actions/list-repos.ts")
42
- */
43
- export declare function fetchDirectoryRecursively(dirPath: string, debug: boolean, preloadedContents?: GitHubDirectoryItem[]): Promise<{
44
- relativePath: string;
45
- isScript: boolean;
46
- }[]>;
47
- /**
48
- * Parse local imports from a TypeScript file content using Babel
49
- * Returns relative import paths (starting with ./ or ../)
50
- */
51
- export declare function parseLocalImports(content: string): string[];
52
- /**
53
- * Resolve a relative import path to an absolute path within the integration
54
- * @param importPath - The import path (e.g., '../mappers/toCompany.js')
55
- * @param fromFilePath - The file containing the import (e.g., 'hubspot/actions/create-company.ts')
56
- * @returns The resolved path (e.g., 'hubspot/mappers/toCompany.ts') or null if outside integration
57
- */
58
- export declare function resolveImportPath(importPath: string, fromFilePath: string): string | null;
59
- /**
60
- * Recursively collect all dependencies for a set of files
61
- * Also caches file content to avoid double-fetching
62
- */
63
- export declare function collectDependencies(initialFiles: {
64
- relativePath: string;
65
- isScript: boolean;
66
- }[], integration: string, debug: boolean, contentCache: Map<string, string>): Promise<{
67
- relativePath: string;
68
- isScript: boolean;
69
- }[]>;
@@ -1,266 +0,0 @@
1
- import path from 'node:path';
2
- import { parse } from '@babel/parser';
3
- import traverse from '@babel/traverse';
4
- import axios from 'axios';
5
- import { printDebug } from '../utils.js';
6
- // GitHub API for directory listings (rate limited: 60/hour unauthenticated, 5000/hour with token)
7
- export const GITHUB_API_BASE = 'https://api.github.com/repos/NangoHQ/integration-templates/contents/integrations';
8
- // Raw content URL for file downloads (no practical rate limit)
9
- export const GITHUB_RAW_BASE = 'https://raw.githubusercontent.com/NangoHQ/integration-templates/main/integrations';
10
- export class GitHubRateLimitError extends Error {
11
- constructor(resetTime) {
12
- const resetDate = resetTime ? new Date(resetTime * 1000) : null;
13
- const resetMsg = resetDate ? ` Rate limit resets at ${resetDate.toLocaleTimeString()}.` : '';
14
- super(`GitHub API rate limit exceeded.${resetMsg} Set GITHUB_TOKEN environment variable to increase the limit.`);
15
- this.name = 'GitHubRateLimitError';
16
- }
17
- }
18
- export class GitHubNotFoundError extends Error {
19
- constructor(path) {
20
- super(`Template not found: ${path}`);
21
- this.name = 'GitHubNotFoundError';
22
- }
23
- }
24
- function getGitHubHeaders() {
25
- const headers = {
26
- Accept: 'application/vnd.github.v3+json',
27
- 'User-Agent': 'nango-cli'
28
- };
29
- const token = process.env['GITHUB_TOKEN'];
30
- if (token) {
31
- headers['Authorization'] = `Bearer ${token}`;
32
- }
33
- return headers;
34
- }
35
- function mapGitHubApiError(err, urlPath) {
36
- if (axios.isAxiosError(err)) {
37
- if (err.response?.status === 403) {
38
- const resetTime = err.response.headers['x-ratelimit-reset'];
39
- return new GitHubRateLimitError(resetTime ? Number(resetTime) : undefined);
40
- }
41
- if (err.response?.status === 404) {
42
- return new GitHubNotFoundError(urlPath);
43
- }
44
- }
45
- return err instanceof Error ? err : new Error(String(err));
46
- }
47
- export async function fetchGitHubDirectory(urlPath, debug) {
48
- const url = `${GITHUB_API_BASE}/${urlPath}`;
49
- printDebug(`Fetching GitHub directory: ${url}`, debug);
50
- try {
51
- const response = await axios.get(url, {
52
- headers: getGitHubHeaders()
53
- });
54
- return response.data;
55
- }
56
- catch (err) {
57
- throw mapGitHubApiError(err, urlPath);
58
- }
59
- }
60
- /**
61
- * Resolve a (possibly symlinked) integration folder name to its real folder in the templates repo.
62
- * Returns the directory listing too when the folder is a real directory, so the caller can reuse it
63
- * instead of fetching the same path again.
64
- */
65
- export async function resolveIntegrationFolder(integration, debug) {
66
- const url = `${GITHUB_API_BASE}/${integration}`;
67
- printDebug(`Resolving integration folder: ${url}`, debug);
68
- let data;
69
- try {
70
- const response = await axios.get(url, {
71
- headers: getGitHubHeaders()
72
- });
73
- data = response.data;
74
- }
75
- catch (err) {
76
- throw mapGitHubApiError(err, integration);
77
- }
78
- if (Array.isArray(data)) {
79
- return { folder: integration, contents: data };
80
- }
81
- if (data.type === 'symlink' && typeof data.target === 'string') {
82
- const resolved = path.posix.normalize(path.posix.join(path.posix.dirname(integration), data.target));
83
- printDebug(`Integration "${integration}" is a symlink to "${resolved}"`, debug);
84
- return { folder: resolved, contents: null };
85
- }
86
- return { folder: integration, contents: null };
87
- }
88
- /**
89
- * Rewrite the leading integration folder of a remote templates-repo path to the local folder name.
90
- * Used to write symlinked-integration files under the name the user requested while fetching their
91
- * content from the resolved target folder. No-op when remote and local folders are the same.
92
- *
93
- * Eg. localizeIntegrationPath('quickbooks/syncs/customers.ts', 'quickbooks', 'quickbooks-sandbox') => 'quickbooks-sandbox/syncs/customers.ts'
94
- */
95
- export function localizeIntegrationPath(remotePath, remoteFolder, localFolder) {
96
- if (remoteFolder === localFolder) {
97
- return remotePath;
98
- }
99
- if (remotePath === remoteFolder) {
100
- return localFolder;
101
- }
102
- const prefix = `${remoteFolder}/`;
103
- if (remotePath.startsWith(prefix)) {
104
- return `${localFolder}/${remotePath.slice(prefix.length)}`;
105
- }
106
- return remotePath;
107
- }
108
- /**
109
- * Fetch file content from GitHub raw URL
110
- * Uses raw.githubusercontent.com which has higher rate limits than the API
111
- */
112
- export async function fetchFileContent(urlPath, debug) {
113
- const url = `${GITHUB_RAW_BASE}/${urlPath}`;
114
- printDebug(`Fetching file: ${url}`, debug);
115
- try {
116
- const response = await axios.get(url, {
117
- headers: { 'User-Agent': 'nango-cli' },
118
- responseType: 'text'
119
- });
120
- return response.data;
121
- }
122
- catch (err) {
123
- if (axios.isAxiosError(err)) {
124
- if (err.response?.status === 404) {
125
- throw new GitHubNotFoundError(urlPath);
126
- }
127
- if (err.response?.status === 403) {
128
- throw new GitHubRateLimitError();
129
- }
130
- }
131
- throw err;
132
- }
133
- }
134
- /**
135
- * Recursively fetch all files from a directory in the GitHub repository.
136
- * Returns file paths relative to the integrations root (e.g., "github/actions/list-repos.ts")
137
- */
138
- export async function fetchDirectoryRecursively(dirPath, debug, preloadedContents) {
139
- const files = [];
140
- const contents = preloadedContents ?? (await fetchGitHubDirectory(dirPath, debug));
141
- for (const item of contents) {
142
- if (item.type === 'dir') {
143
- const subFiles = await fetchDirectoryRecursively(item.path.replace(/^integrations\//, ''), debug);
144
- files.push(...subFiles);
145
- }
146
- else if (item.type === 'file') {
147
- const relativePath = item.path.replace(/^integrations\//, '');
148
- // Determine if this is a script (in actions/syncs folders)
149
- const isScript = /\/(actions|syncs)\/[^/]+\.ts$/.test(relativePath);
150
- files.push({ relativePath, isScript });
151
- }
152
- }
153
- return files;
154
- }
155
- /**
156
- * Parse local imports from a TypeScript file content using Babel
157
- * Returns relative import paths (starting with ./ or ../)
158
- */
159
- export function parseLocalImports(content) {
160
- const imports = [];
161
- try {
162
- const ast = parse(content, {
163
- sourceType: 'module',
164
- plugins: ['typescript']
165
- });
166
- const traverseFn = traverse.default || traverse;
167
- traverseFn(ast, {
168
- ImportDeclaration(nodePath) {
169
- const source = nodePath.node.source.value;
170
- // Only collect relative imports (starting with . or ..)
171
- if (source.startsWith('./') || source.startsWith('../')) {
172
- imports.push(source);
173
- }
174
- }
175
- });
176
- }
177
- catch {
178
- return [];
179
- }
180
- return imports;
181
- }
182
- /**
183
- * Resolve a relative import path to an absolute path within the integration
184
- * @param importPath - The import path (e.g., '../mappers/toCompany.js')
185
- * @param fromFilePath - The file containing the import (e.g., 'hubspot/actions/create-company.ts')
186
- * @returns The resolved path (e.g., 'hubspot/mappers/toCompany.ts') or null if outside integration
187
- */
188
- export function resolveImportPath(importPath, fromFilePath) {
189
- const fromDir = path.posix.dirname(fromFilePath);
190
- // Resolve the import path relative to the importing file's directory
191
- // Convert .js extension to .ts (TypeScript source)
192
- const tsPath = importPath.replace(/\.js$/, '.ts');
193
- const resolved = path.posix.normalize(path.posix.join(fromDir, tsPath));
194
- // Ensure the resolved path stays within the integration (no leading ..)
195
- if (resolved.startsWith('..')) {
196
- return null;
197
- }
198
- return resolved;
199
- }
200
- /**
201
- * Recursively collect all dependencies for a set of files
202
- * Also caches file content to avoid double-fetching
203
- */
204
- export async function collectDependencies(initialFiles, integration, debug, contentCache) {
205
- const allFiles = new Map();
206
- const processedFiles = new Set();
207
- const filesToProcess = [];
208
- for (const file of initialFiles) {
209
- allFiles.set(file.relativePath, file);
210
- if (file.relativePath.endsWith('.ts')) {
211
- filesToProcess.push(file.relativePath);
212
- }
213
- }
214
- while (filesToProcess.length > 0) {
215
- const filePath = filesToProcess.pop();
216
- if (processedFiles.has(filePath)) {
217
- continue;
218
- }
219
- processedFiles.add(filePath);
220
- let content;
221
- try {
222
- if (contentCache.has(filePath)) {
223
- content = contentCache.get(filePath);
224
- }
225
- else {
226
- content = await fetchFileContent(filePath, debug);
227
- contentCache.set(filePath, content);
228
- }
229
- }
230
- catch {
231
- printDebug(`Could not fetch ${filePath} for dependency analysis`, debug);
232
- continue;
233
- }
234
- const imports = parseLocalImports(content);
235
- printDebug(`Found ${imports.length} local imports in ${filePath}: ${imports.join(', ')}`, debug);
236
- for (const importPath of imports) {
237
- const resolvedPath = resolveImportPath(importPath, filePath);
238
- if (!resolvedPath) {
239
- printDebug(`Skipping import ${importPath} - resolves outside integration`, debug);
240
- continue;
241
- }
242
- // Check if this is a file within our integration
243
- if (!resolvedPath.startsWith(integration + '/')) {
244
- printDebug(`Skipping import ${importPath} - outside integration folder`, debug);
245
- continue;
246
- }
247
- if (allFiles.has(resolvedPath)) {
248
- continue;
249
- }
250
- // Check if file exists on GitHub
251
- try {
252
- const depContent = await fetchFileContent(resolvedPath, debug);
253
- contentCache.set(resolvedPath, depContent);
254
- // Dependencies are never scripts (they're helpers/mappers/etc.)
255
- allFiles.set(resolvedPath, { relativePath: resolvedPath, isScript: false });
256
- filesToProcess.push(resolvedPath);
257
- printDebug(`Added dependency: ${resolvedPath}`, debug);
258
- }
259
- catch {
260
- printDebug(`Dependency not found on GitHub: ${resolvedPath}`, debug);
261
- }
262
- }
263
- }
264
- return Array.from(allFiles.values());
265
- }
266
- //# sourceMappingURL=githubTemplates.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"githubTemplates.js","sourceRoot":"","sources":["../../lib/utils/githubTemplates.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,C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