@teleporthq/teleport-plugin-next-workflows 0.43.4 → 0.43.7
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/__tests__/webpack-safe-handlers.test.ts +124 -0
- package/dist/cjs/auth-generator.d.ts.map +1 -1
- package/dist/cjs/auth-generator.js +16 -1
- package/dist/cjs/auth-generator.js.map +1 -1
- package/dist/cjs/nodes/account/account-compare-passwords.d.ts.map +1 -1
- package/dist/cjs/nodes/account/account-compare-passwords.js +11 -3
- package/dist/cjs/nodes/account/account-compare-passwords.js.map +1 -1
- package/dist/cjs/nodes/account/account-hash-password.d.ts.map +1 -1
- package/dist/cjs/nodes/account/account-hash-password.js +11 -3
- package/dist/cjs/nodes/account/account-hash-password.js.map +1 -1
- package/dist/cjs/nodes/account/account-login.d.ts.map +1 -1
- package/dist/cjs/nodes/account/account-login.js +18 -3
- package/dist/cjs/nodes/account/account-login.js.map +1 -1
- package/dist/cjs/nodes/account/account-logout.d.ts.map +1 -1
- package/dist/cjs/nodes/account/account-logout.js +8 -1
- package/dist/cjs/nodes/account/account-logout.js.map +1 -1
- package/dist/cjs/nodes/account/account-signup.d.ts.map +1 -1
- package/dist/cjs/nodes/account/account-signup.js +11 -3
- package/dist/cjs/nodes/account/account-signup.js.map +1 -1
- package/dist/cjs/nodes/account/account-social-login.d.ts.map +1 -1
- package/dist/cjs/nodes/account/account-social-login.js +8 -1
- package/dist/cjs/nodes/account/account-social-login.js.map +1 -1
- package/dist/cjs/nodes/ai/ai-generate-text-embedding.d.ts.map +1 -1
- package/dist/cjs/nodes/ai/ai-generate-text-embedding.js +2 -1
- package/dist/cjs/nodes/ai/ai-generate-text-embedding.js.map +1 -1
- package/dist/cjs/nodes/ai/ai-provider-utils.js +18 -15
- package/dist/cjs/nodes/ai/ai-provider-utils.js.map +1 -1
- package/dist/cjs/nodes/email/email-mailersend.d.ts.map +1 -1
- package/dist/cjs/nodes/email/email-mailersend.js +2 -1
- package/dist/cjs/nodes/email/email-mailersend.js.map +1 -1
- package/dist/cjs/nodes/email/email-mailgun.d.ts.map +1 -1
- package/dist/cjs/nodes/email/email-mailgun.js +3 -2
- package/dist/cjs/nodes/email/email-mailgun.js.map +1 -1
- package/dist/cjs/nodes/email/email-postmark.d.ts.map +1 -1
- package/dist/cjs/nodes/email/email-postmark.js +2 -1
- package/dist/cjs/nodes/email/email-postmark.js.map +1 -1
- package/dist/cjs/nodes/email/email-resend.d.ts.map +1 -1
- package/dist/cjs/nodes/email/email-resend.js +2 -1
- package/dist/cjs/nodes/email/email-resend.js.map +1 -1
- package/dist/cjs/nodes/email/email-sendgrid.d.ts.map +1 -1
- package/dist/cjs/nodes/email/email-sendgrid.js +2 -1
- package/dist/cjs/nodes/email/email-sendgrid.js.map +1 -1
- package/dist/cjs/nodes/file-storage/file-storage-delete.d.ts.map +1 -1
- package/dist/cjs/nodes/file-storage/file-storage-delete.js +7 -3
- package/dist/cjs/nodes/file-storage/file-storage-delete.js.map +1 -1
- package/dist/cjs/nodes/file-storage/file-storage-get-details.d.ts.map +1 -1
- package/dist/cjs/nodes/file-storage/file-storage-get-details.js +7 -3
- package/dist/cjs/nodes/file-storage/file-storage-get-details.js.map +1 -1
- package/dist/cjs/nodes/file-storage/file-storage-list.d.ts.map +1 -1
- package/dist/cjs/nodes/file-storage/file-storage-list.js +7 -3
- package/dist/cjs/nodes/file-storage/file-storage-list.js.map +1 -1
- package/dist/cjs/nodes/general/general-custom-js.d.ts.map +1 -1
- package/dist/cjs/nodes/general/general-custom-js.js +23 -5
- package/dist/cjs/nodes/general/general-custom-js.js.map +1 -1
- package/dist/cjs/nodes/general/general-emit-custom-event.d.ts.map +1 -1
- package/dist/cjs/nodes/general/general-emit-custom-event.js +6 -2
- package/dist/cjs/nodes/general/general-emit-custom-event.js.map +1 -1
- package/dist/cjs/nodes/integrations/integration-amplitude.js +10 -10
- package/dist/cjs/nodes/integrations/integration-amplitude.js.map +1 -1
- package/dist/cjs/nodes/integrations/integration-google-drive.js +4 -4
- package/dist/cjs/nodes/integrations/integration-google-drive.js.map +1 -1
- package/dist/cjs/nodes/integrations/integration-jira.js +2 -2
- package/dist/cjs/nodes/integrations/integration-jira.js.map +1 -1
- package/dist/cjs/nodes/integrations/integration-pandadoc.js +2 -2
- package/dist/cjs/nodes/integrations/integration-pandadoc.js.map +1 -1
- package/dist/cjs/nodes/integrations/integration-tableau.js +2 -2
- package/dist/cjs/nodes/integrations/integration-tableau.js.map +1 -1
- package/dist/cjs/nodes/payment/payment-charge-user.d.ts.map +1 -1
- package/dist/cjs/nodes/payment/payment-charge-user.js +21 -9
- package/dist/cjs/nodes/payment/payment-charge-user.js.map +1 -1
- package/dist/cjs/nodes/realtime/realtime-send-channel-event.d.ts.map +1 -1
- package/dist/cjs/nodes/realtime/realtime-send-channel-event.js +3 -2
- package/dist/cjs/nodes/realtime/realtime-send-channel-event.js.map +1 -1
- package/dist/cjs/nodes/realtime/realtime-send-channel-message.d.ts.map +1 -1
- package/dist/cjs/nodes/realtime/realtime-send-channel-message.js +3 -2
- package/dist/cjs/nodes/realtime/realtime-send-channel-message.js.map +1 -1
- package/dist/cjs/nodes/sms/sms-twilio.d.ts.map +1 -1
- package/dist/cjs/nodes/sms/sms-twilio.js +2 -1
- package/dist/cjs/nodes/sms/sms-twilio.js.map +1 -1
- package/dist/cjs/nodes/transform/transform-color.d.ts.map +1 -1
- package/dist/cjs/nodes/transform/transform-color.js +4 -3
- package/dist/cjs/nodes/transform/transform-color.js.map +1 -1
- package/dist/cjs/nodes/transform/transform-image.d.ts.map +1 -1
- package/dist/cjs/nodes/transform/transform-image.js +6 -5
- package/dist/cjs/nodes/transform/transform-image.js.map +1 -1
- package/dist/cjs/nodes/utility/utility-barcode-generate.d.ts.map +1 -1
- package/dist/cjs/nodes/utility/utility-barcode-generate.js +2 -1
- package/dist/cjs/nodes/utility/utility-barcode-generate.js.map +1 -1
- package/dist/cjs/nodes/utility/utility-encode-decode.js +6 -6
- package/dist/cjs/nodes/utility/utility-encode-decode.js.map +1 -1
- package/dist/cjs/nodes/utility/utility-generate-invoice-pdf.d.ts.map +1 -1
- package/dist/cjs/nodes/utility/utility-generate-invoice-pdf.js +3 -2
- package/dist/cjs/nodes/utility/utility-generate-invoice-pdf.js.map +1 -1
- package/dist/cjs/nodes/utility/utility-hash-data.d.ts.map +1 -1
- package/dist/cjs/nodes/utility/utility-hash-data.js +2 -1
- package/dist/cjs/nodes/utility/utility-hash-data.js.map +1 -1
- package/dist/cjs/nodes/utility/utility-markdown-to-html.d.ts.map +1 -1
- package/dist/cjs/nodes/utility/utility-markdown-to-html.js +2 -1
- package/dist/cjs/nodes/utility/utility-markdown-to-html.js.map +1 -1
- package/dist/cjs/nodes/utility/utility-ocr-extract-text.d.ts.map +1 -1
- package/dist/cjs/nodes/utility/utility-ocr-extract-text.js +2 -1
- package/dist/cjs/nodes/utility/utility-ocr-extract-text.js.map +1 -1
- package/dist/cjs/nodes/utility/utility-pdf-extract-text.d.ts.map +1 -1
- package/dist/cjs/nodes/utility/utility-pdf-extract-text.js +4 -3
- package/dist/cjs/nodes/utility/utility-pdf-extract-text.js.map +1 -1
- package/dist/cjs/nodes/utility/utility-pdf-generate.d.ts.map +1 -1
- package/dist/cjs/nodes/utility/utility-pdf-generate.js +3 -2
- package/dist/cjs/nodes/utility/utility-pdf-generate.js.map +1 -1
- package/dist/cjs/nodes/utility/utility-qr-code-generate.d.ts.map +1 -1
- package/dist/cjs/nodes/utility/utility-qr-code-generate.js +3 -2
- package/dist/cjs/nodes/utility/utility-qr-code-generate.js.map +1 -1
- package/dist/cjs/nodes/utility/utility-scrape-website.d.ts.map +1 -1
- package/dist/cjs/nodes/utility/utility-scrape-website.js +2 -1
- package/dist/cjs/nodes/utility/utility-scrape-website.js.map +1 -1
- package/dist/cjs/nodes/utility/utility-xml-parse.d.ts.map +1 -1
- package/dist/cjs/nodes/utility/utility-xml-parse.js +2 -1
- package/dist/cjs/nodes/utility/utility-xml-parse.js.map +1 -1
- package/dist/cjs/nodes/utility/utility-youtube-transcript.d.ts.map +1 -1
- package/dist/cjs/nodes/utility/utility-youtube-transcript.js +2 -1
- package/dist/cjs/nodes/utility/utility-youtube-transcript.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/auth-generator.d.ts.map +1 -1
- package/dist/esm/auth-generator.js +16 -1
- package/dist/esm/auth-generator.js.map +1 -1
- package/dist/esm/nodes/account/account-compare-passwords.d.ts.map +1 -1
- package/dist/esm/nodes/account/account-compare-passwords.js +11 -3
- package/dist/esm/nodes/account/account-compare-passwords.js.map +1 -1
- package/dist/esm/nodes/account/account-hash-password.d.ts.map +1 -1
- package/dist/esm/nodes/account/account-hash-password.js +11 -3
- package/dist/esm/nodes/account/account-hash-password.js.map +1 -1
- package/dist/esm/nodes/account/account-login.d.ts.map +1 -1
- package/dist/esm/nodes/account/account-login.js +18 -3
- package/dist/esm/nodes/account/account-login.js.map +1 -1
- package/dist/esm/nodes/account/account-logout.d.ts.map +1 -1
- package/dist/esm/nodes/account/account-logout.js +8 -1
- package/dist/esm/nodes/account/account-logout.js.map +1 -1
- package/dist/esm/nodes/account/account-signup.d.ts.map +1 -1
- package/dist/esm/nodes/account/account-signup.js +11 -3
- package/dist/esm/nodes/account/account-signup.js.map +1 -1
- package/dist/esm/nodes/account/account-social-login.d.ts.map +1 -1
- package/dist/esm/nodes/account/account-social-login.js +8 -1
- package/dist/esm/nodes/account/account-social-login.js.map +1 -1
- package/dist/esm/nodes/ai/ai-generate-text-embedding.d.ts.map +1 -1
- package/dist/esm/nodes/ai/ai-generate-text-embedding.js +2 -1
- package/dist/esm/nodes/ai/ai-generate-text-embedding.js.map +1 -1
- package/dist/esm/nodes/ai/ai-provider-utils.js +18 -15
- package/dist/esm/nodes/ai/ai-provider-utils.js.map +1 -1
- package/dist/esm/nodes/email/email-mailersend.d.ts.map +1 -1
- package/dist/esm/nodes/email/email-mailersend.js +2 -1
- package/dist/esm/nodes/email/email-mailersend.js.map +1 -1
- package/dist/esm/nodes/email/email-mailgun.d.ts.map +1 -1
- package/dist/esm/nodes/email/email-mailgun.js +3 -2
- package/dist/esm/nodes/email/email-mailgun.js.map +1 -1
- package/dist/esm/nodes/email/email-postmark.d.ts.map +1 -1
- package/dist/esm/nodes/email/email-postmark.js +2 -1
- package/dist/esm/nodes/email/email-postmark.js.map +1 -1
- package/dist/esm/nodes/email/email-resend.d.ts.map +1 -1
- package/dist/esm/nodes/email/email-resend.js +2 -1
- package/dist/esm/nodes/email/email-resend.js.map +1 -1
- package/dist/esm/nodes/email/email-sendgrid.d.ts.map +1 -1
- package/dist/esm/nodes/email/email-sendgrid.js +2 -1
- package/dist/esm/nodes/email/email-sendgrid.js.map +1 -1
- package/dist/esm/nodes/file-storage/file-storage-delete.d.ts.map +1 -1
- package/dist/esm/nodes/file-storage/file-storage-delete.js +7 -3
- package/dist/esm/nodes/file-storage/file-storage-delete.js.map +1 -1
- package/dist/esm/nodes/file-storage/file-storage-get-details.d.ts.map +1 -1
- package/dist/esm/nodes/file-storage/file-storage-get-details.js +7 -3
- package/dist/esm/nodes/file-storage/file-storage-get-details.js.map +1 -1
- package/dist/esm/nodes/file-storage/file-storage-list.d.ts.map +1 -1
- package/dist/esm/nodes/file-storage/file-storage-list.js +7 -3
- package/dist/esm/nodes/file-storage/file-storage-list.js.map +1 -1
- package/dist/esm/nodes/general/general-custom-js.d.ts.map +1 -1
- package/dist/esm/nodes/general/general-custom-js.js +23 -5
- package/dist/esm/nodes/general/general-custom-js.js.map +1 -1
- package/dist/esm/nodes/general/general-emit-custom-event.d.ts.map +1 -1
- package/dist/esm/nodes/general/general-emit-custom-event.js +6 -2
- package/dist/esm/nodes/general/general-emit-custom-event.js.map +1 -1
- package/dist/esm/nodes/integrations/integration-amplitude.js +10 -10
- package/dist/esm/nodes/integrations/integration-amplitude.js.map +1 -1
- package/dist/esm/nodes/integrations/integration-google-drive.js +4 -4
- package/dist/esm/nodes/integrations/integration-google-drive.js.map +1 -1
- package/dist/esm/nodes/integrations/integration-jira.js +2 -2
- package/dist/esm/nodes/integrations/integration-jira.js.map +1 -1
- package/dist/esm/nodes/integrations/integration-pandadoc.js +2 -2
- package/dist/esm/nodes/integrations/integration-pandadoc.js.map +1 -1
- package/dist/esm/nodes/integrations/integration-tableau.js +2 -2
- package/dist/esm/nodes/integrations/integration-tableau.js.map +1 -1
- package/dist/esm/nodes/payment/payment-charge-user.d.ts.map +1 -1
- package/dist/esm/nodes/payment/payment-charge-user.js +21 -9
- package/dist/esm/nodes/payment/payment-charge-user.js.map +1 -1
- package/dist/esm/nodes/realtime/realtime-send-channel-event.d.ts.map +1 -1
- package/dist/esm/nodes/realtime/realtime-send-channel-event.js +3 -2
- package/dist/esm/nodes/realtime/realtime-send-channel-event.js.map +1 -1
- package/dist/esm/nodes/realtime/realtime-send-channel-message.d.ts.map +1 -1
- package/dist/esm/nodes/realtime/realtime-send-channel-message.js +3 -2
- package/dist/esm/nodes/realtime/realtime-send-channel-message.js.map +1 -1
- package/dist/esm/nodes/sms/sms-twilio.d.ts.map +1 -1
- package/dist/esm/nodes/sms/sms-twilio.js +2 -1
- package/dist/esm/nodes/sms/sms-twilio.js.map +1 -1
- package/dist/esm/nodes/transform/transform-color.d.ts.map +1 -1
- package/dist/esm/nodes/transform/transform-color.js +4 -3
- package/dist/esm/nodes/transform/transform-color.js.map +1 -1
- package/dist/esm/nodes/transform/transform-image.d.ts.map +1 -1
- package/dist/esm/nodes/transform/transform-image.js +6 -5
- package/dist/esm/nodes/transform/transform-image.js.map +1 -1
- package/dist/esm/nodes/utility/utility-barcode-generate.d.ts.map +1 -1
- package/dist/esm/nodes/utility/utility-barcode-generate.js +2 -1
- package/dist/esm/nodes/utility/utility-barcode-generate.js.map +1 -1
- package/dist/esm/nodes/utility/utility-encode-decode.js +6 -6
- package/dist/esm/nodes/utility/utility-encode-decode.js.map +1 -1
- package/dist/esm/nodes/utility/utility-generate-invoice-pdf.d.ts.map +1 -1
- package/dist/esm/nodes/utility/utility-generate-invoice-pdf.js +3 -2
- package/dist/esm/nodes/utility/utility-generate-invoice-pdf.js.map +1 -1
- package/dist/esm/nodes/utility/utility-hash-data.d.ts.map +1 -1
- package/dist/esm/nodes/utility/utility-hash-data.js +2 -1
- package/dist/esm/nodes/utility/utility-hash-data.js.map +1 -1
- package/dist/esm/nodes/utility/utility-markdown-to-html.d.ts.map +1 -1
- package/dist/esm/nodes/utility/utility-markdown-to-html.js +2 -1
- package/dist/esm/nodes/utility/utility-markdown-to-html.js.map +1 -1
- package/dist/esm/nodes/utility/utility-ocr-extract-text.d.ts.map +1 -1
- package/dist/esm/nodes/utility/utility-ocr-extract-text.js +2 -1
- package/dist/esm/nodes/utility/utility-ocr-extract-text.js.map +1 -1
- package/dist/esm/nodes/utility/utility-pdf-extract-text.d.ts.map +1 -1
- package/dist/esm/nodes/utility/utility-pdf-extract-text.js +4 -3
- package/dist/esm/nodes/utility/utility-pdf-extract-text.js.map +1 -1
- package/dist/esm/nodes/utility/utility-pdf-generate.d.ts.map +1 -1
- package/dist/esm/nodes/utility/utility-pdf-generate.js +3 -2
- package/dist/esm/nodes/utility/utility-pdf-generate.js.map +1 -1
- package/dist/esm/nodes/utility/utility-qr-code-generate.d.ts.map +1 -1
- package/dist/esm/nodes/utility/utility-qr-code-generate.js +3 -2
- package/dist/esm/nodes/utility/utility-qr-code-generate.js.map +1 -1
- package/dist/esm/nodes/utility/utility-scrape-website.d.ts.map +1 -1
- package/dist/esm/nodes/utility/utility-scrape-website.js +2 -1
- package/dist/esm/nodes/utility/utility-scrape-website.js.map +1 -1
- package/dist/esm/nodes/utility/utility-xml-parse.d.ts.map +1 -1
- package/dist/esm/nodes/utility/utility-xml-parse.js +2 -1
- package/dist/esm/nodes/utility/utility-xml-parse.js.map +1 -1
- package/dist/esm/nodes/utility/utility-youtube-transcript.d.ts.map +1 -1
- package/dist/esm/nodes/utility/utility-youtube-transcript.js +2 -1
- package/dist/esm/nodes/utility/utility-youtube-transcript.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/auth-generator.ts +16 -1
- package/src/nodes/account/account-compare-passwords.ts +13 -4
- package/src/nodes/account/account-hash-password.ts +13 -4
- package/src/nodes/account/account-login.ts +19 -3
- package/src/nodes/account/account-logout.ts +9 -1
- package/src/nodes/account/account-signup.ts +12 -3
- package/src/nodes/account/account-social-login.ts +9 -1
- package/src/nodes/ai/ai-generate-text-embedding.ts +3 -1
- package/src/nodes/ai/ai-provider-utils.ts +20 -17
- package/src/nodes/email/email-mailersend.ts +3 -1
- package/src/nodes/email/email-mailgun.ts +4 -2
- package/src/nodes/email/email-postmark.ts +3 -1
- package/src/nodes/email/email-resend.ts +3 -1
- package/src/nodes/email/email-sendgrid.ts +3 -1
- package/src/nodes/file-storage/file-storage-delete.ts +7 -3
- package/src/nodes/file-storage/file-storage-get-details.ts +7 -3
- package/src/nodes/file-storage/file-storage-list.ts +7 -3
- package/src/nodes/general/general-custom-js.ts +23 -5
- package/src/nodes/general/general-emit-custom-event.ts +6 -2
- package/src/nodes/integrations/integration-amplitude.ts +10 -10
- package/src/nodes/integrations/integration-google-drive.ts +4 -4
- package/src/nodes/integrations/integration-jira.ts +2 -2
- package/src/nodes/integrations/integration-pandadoc.ts +2 -2
- package/src/nodes/integrations/integration-tableau.ts +2 -2
- package/src/nodes/payment/payment-charge-user.ts +23 -9
- package/src/nodes/realtime/realtime-send-channel-event.ts +3 -4
- package/src/nodes/realtime/realtime-send-channel-message.ts +3 -4
- package/src/nodes/sms/sms-twilio.ts +3 -1
- package/src/nodes/transform/transform-color.ts +5 -3
- package/src/nodes/transform/transform-image.ts +7 -5
- package/src/nodes/utility/utility-barcode-generate.ts +3 -1
- package/src/nodes/utility/utility-encode-decode.ts +6 -6
- package/src/nodes/utility/utility-generate-invoice-pdf.ts +4 -2
- package/src/nodes/utility/utility-hash-data.ts +3 -1
- package/src/nodes/utility/utility-markdown-to-html.ts +3 -1
- package/src/nodes/utility/utility-ocr-extract-text.ts +3 -1
- package/src/nodes/utility/utility-pdf-extract-text.ts +5 -3
- package/src/nodes/utility/utility-pdf-generate.ts +4 -2
- package/src/nodes/utility/utility-qr-code-generate.ts +5 -2
- package/src/nodes/utility/utility-scrape-website.ts +3 -1
- package/src/nodes/utility/utility-xml-parse.ts +3 -1
- package/src/nodes/utility/utility-youtube-transcript.ts +3 -1
- package/src/nodes/webpack-runtime-globals.d.ts +11 -0
|
@@ -389,8 +389,8 @@ async function integration_jira(config: any, context: Record<string, unknown>) {
|
|
|
389
389
|
blob = await (await fetch(fileContent)).blob()
|
|
390
390
|
} else if (typeof fileContent === 'string') {
|
|
391
391
|
const bin =
|
|
392
|
-
typeof Buffer !== 'undefined'
|
|
393
|
-
? Buffer.from(fileContent, 'base64')
|
|
392
|
+
typeof (globalThis as any).Buffer !== 'undefined'
|
|
393
|
+
? (globalThis as any).Buffer.from(fileContent, 'base64')
|
|
394
394
|
: Uint8Array.from(atob(fileContent), (c: string) => c.charCodeAt(0))
|
|
395
395
|
blob = new Blob([bin], { type: config.contentType || 'application/octet-stream' })
|
|
396
396
|
} else {
|
|
@@ -109,8 +109,8 @@ async function integration_pandadoc(config: any, context: Record<string, unknown
|
|
|
109
109
|
const blob = await response.blob()
|
|
110
110
|
const buffer = await blob.arrayBuffer()
|
|
111
111
|
const base64 =
|
|
112
|
-
typeof Buffer !== 'undefined'
|
|
113
|
-
? Buffer.from(buffer).toString('base64')
|
|
112
|
+
typeof (globalThis as any).Buffer !== 'undefined'
|
|
113
|
+
? (globalThis as any).Buffer.from(buffer).toString('base64')
|
|
114
114
|
: btoa(String.fromCharCode.apply(null, new Uint8Array(buffer)))
|
|
115
115
|
return { success: true, content: base64, contentType: response.headers.get('content-type') }
|
|
116
116
|
}
|
|
@@ -120,8 +120,8 @@ async function integration_tableau(config: any, context: Record<string, unknown>
|
|
|
120
120
|
return {
|
|
121
121
|
success: true,
|
|
122
122
|
content:
|
|
123
|
-
typeof Buffer !== 'undefined'
|
|
124
|
-
? Buffer.from(buf).toString('base64')
|
|
123
|
+
typeof (globalThis as any).Buffer !== 'undefined'
|
|
124
|
+
? (globalThis as any).Buffer.from(buf).toString('base64')
|
|
125
125
|
: btoa(String.fromCharCode.apply(null, new Uint8Array(buf) as any)),
|
|
126
126
|
}
|
|
127
127
|
}
|
|
@@ -40,17 +40,24 @@ const STRIPE_THREE_DECIMAL_CURRENCIES = ['BHD', 'IQD', 'JOD', 'KWD', 'LYD', 'OMR
|
|
|
40
40
|
// primary or numbered fallback is filled, scan every `process.env` key
|
|
41
41
|
// beginning with the prefix so new variants don't require a code change.
|
|
42
42
|
function resolveProviderSecret(candidates: string[], prefixScan?: string): string {
|
|
43
|
+
// Access `process` via `globalThis` rather than as a bare identifier. When
|
|
44
|
+
// the GUI generates this project it bundles the code generators through
|
|
45
|
+
// webpack, and `fn.toString()` captures whatever webpack rewrote a bare
|
|
46
|
+
// `process` into (e.g. `payment_charge_user_process`, which is undefined on
|
|
47
|
+
// the Vercel Node runtime). `globalThis.process` is a member access webpack
|
|
48
|
+
// leaves untouched, so the serialized handler stays valid on the server.
|
|
49
|
+
const env = (globalThis as any).process.env
|
|
43
50
|
for (const key of candidates) {
|
|
44
|
-
const value =
|
|
51
|
+
const value = env[key]
|
|
45
52
|
if (value && String(value).length > 0) {
|
|
46
53
|
return String(value)
|
|
47
54
|
}
|
|
48
55
|
}
|
|
49
56
|
if (prefixScan) {
|
|
50
|
-
const envKeys = Object.keys(
|
|
57
|
+
const envKeys = Object.keys(env)
|
|
51
58
|
for (const key of envKeys) {
|
|
52
59
|
if (key.indexOf(prefixScan) === 0) {
|
|
53
|
-
const value =
|
|
60
|
+
const value = env[key]
|
|
54
61
|
if (value && String(value).length > 0) {
|
|
55
62
|
return String(value)
|
|
56
63
|
}
|
|
@@ -184,7 +191,13 @@ async function chargeWithStripe(
|
|
|
184
191
|
}
|
|
185
192
|
|
|
186
193
|
try {
|
|
187
|
-
|
|
194
|
+
// Use webpack's `__non_webpack_require__` when present (the GUI bundles this
|
|
195
|
+
// handler through webpack, which rewrites a bare `require` into the
|
|
196
|
+
// browser-only `__webpack_require__`). Falls back to the real `require` in
|
|
197
|
+
// the plain tsc/dist build. See webpack-runtime-globals.d.ts.
|
|
198
|
+
const nodeRequire =
|
|
199
|
+
typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : require
|
|
200
|
+
const Stripe = nodeRequire('stripe')
|
|
188
201
|
const stripe = new Stripe(secretKey)
|
|
189
202
|
|
|
190
203
|
const sessionParams: any = {
|
|
@@ -259,7 +272,8 @@ async function paypalAuthenticate(
|
|
|
259
272
|
): Promise<{ baseUrl: string; accessToken: string } | { error: string }> {
|
|
260
273
|
const SANDBOX = 'https://api-m.sandbox.paypal.com'
|
|
261
274
|
const LIVE = 'https://api-m.paypal.com'
|
|
262
|
-
const basicAuth =
|
|
275
|
+
const basicAuth =
|
|
276
|
+
'Basic ' + (globalThis as any).Buffer.from(clientId + ':' + clientSecret).toString('base64')
|
|
263
277
|
|
|
264
278
|
async function tryAuth(baseUrl: string): Promise<{
|
|
265
279
|
accessToken?: string
|
|
@@ -289,7 +303,7 @@ async function paypalAuthenticate(
|
|
|
289
303
|
|
|
290
304
|
// Cache hit — try it first. If credentials rotated to the other env the
|
|
291
305
|
// cached URL replies invalid_client and we re-detect.
|
|
292
|
-
const cached = (
|
|
306
|
+
const cached = (globalThis as any).__paypalBaseUrlCache as string | undefined
|
|
293
307
|
if (cached === SANDBOX || cached === LIVE) {
|
|
294
308
|
const r = await tryAuth(cached)
|
|
295
309
|
if (r.accessToken) {
|
|
@@ -299,7 +313,7 @@ async function paypalAuthenticate(
|
|
|
299
313
|
return { error: 'PayPal authentication failed: ' + r.errorMessage }
|
|
300
314
|
// invalid_client on cached env → bust cache, fall through to detection.
|
|
301
315
|
}
|
|
302
|
-
;(
|
|
316
|
+
;(globalThis as any).__paypalBaseUrlCache = undefined
|
|
303
317
|
}
|
|
304
318
|
|
|
305
319
|
// Detection: sandbox first (safer default — most dev setups). On
|
|
@@ -308,7 +322,7 @@ async function paypalAuthenticate(
|
|
|
308
322
|
// live call against keys that belong to a different sandbox account.
|
|
309
323
|
const sandboxResult = await tryAuth(SANDBOX)
|
|
310
324
|
if (sandboxResult.accessToken) {
|
|
311
|
-
;(
|
|
325
|
+
;(globalThis as any).__paypalBaseUrlCache = SANDBOX
|
|
312
326
|
return { baseUrl: SANDBOX, accessToken: sandboxResult.accessToken }
|
|
313
327
|
}
|
|
314
328
|
if (!sandboxResult.invalidClient) {
|
|
@@ -317,7 +331,7 @@ async function paypalAuthenticate(
|
|
|
317
331
|
|
|
318
332
|
const liveResult = await tryAuth(LIVE)
|
|
319
333
|
if (liveResult.accessToken) {
|
|
320
|
-
;(
|
|
334
|
+
;(globalThis as any).__paypalBaseUrlCache = LIVE
|
|
321
335
|
return { baseUrl: LIVE, accessToken: liveResult.accessToken }
|
|
322
336
|
}
|
|
323
337
|
|
|
@@ -15,10 +15,9 @@ async function realtime_send_channel_event(config: any, context: Record<string,
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
try {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const apiKey =
|
|
21
|
-
typeof process !== 'undefined' && process.env ? process.env.REALTIME_SERVER_API_KEY : ''
|
|
18
|
+
const __env = (globalThis as any).process && (globalThis as any).process.env
|
|
19
|
+
const serverUrl = __env ? __env.REALTIME_SERVER_URL : ''
|
|
20
|
+
const apiKey = __env ? __env.REALTIME_SERVER_API_KEY : ''
|
|
22
21
|
|
|
23
22
|
if (!serverUrl || !apiKey) {
|
|
24
23
|
return {
|
|
@@ -12,10 +12,9 @@ async function realtime_send_channel_message(config: any, context: Record<string
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
try {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const apiKey =
|
|
18
|
-
typeof process !== 'undefined' && process.env ? process.env.REALTIME_SERVER_API_KEY : ''
|
|
15
|
+
const __env = (globalThis as any).process && (globalThis as any).process.env
|
|
16
|
+
const serverUrl = __env ? __env.REALTIME_SERVER_URL : ''
|
|
17
|
+
const apiKey = __env ? __env.REALTIME_SERVER_API_KEY : ''
|
|
19
18
|
|
|
20
19
|
if (!serverUrl || !apiKey) {
|
|
21
20
|
return {
|
|
@@ -10,7 +10,9 @@ async function sms_twilio(config: any, context: Record<string, unknown>) {
|
|
|
10
10
|
const statusCallback = config.statusCallback
|
|
11
11
|
|
|
12
12
|
try {
|
|
13
|
-
const
|
|
13
|
+
const __nodeRequire =
|
|
14
|
+
typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : require
|
|
15
|
+
const twilio = __nodeRequire('twilio')
|
|
14
16
|
const client = twilio(accountSid, authToken)
|
|
15
17
|
|
|
16
18
|
const msgPayload: Record<string, any> = {
|
|
@@ -257,7 +257,9 @@ async function transform_color(config: any, context: Record<string, unknown>) {
|
|
|
257
257
|
return { result: null, error: 'No image provided for color extraction' }
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
-
const
|
|
260
|
+
const __nodeRequire =
|
|
261
|
+
typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : require
|
|
262
|
+
const sharp = __nodeRequire('sharp')
|
|
261
263
|
|
|
262
264
|
let inputBuffer
|
|
263
265
|
if (imageBase64) {
|
|
@@ -265,14 +267,14 @@ async function transform_color(config: any, context: Record<string, unknown>) {
|
|
|
265
267
|
if (b64Data.indexOf(',') !== -1) {
|
|
266
268
|
b64Data = b64Data.split(',')[1]
|
|
267
269
|
}
|
|
268
|
-
inputBuffer = Buffer.from(b64Data, 'base64')
|
|
270
|
+
inputBuffer = (globalThis as any).Buffer.from(b64Data, 'base64')
|
|
269
271
|
} else {
|
|
270
272
|
const imgResponse = await fetch(imageUrl)
|
|
271
273
|
if (!imgResponse.ok) {
|
|
272
274
|
return { result: null, error: 'Failed to fetch image: HTTP ' + imgResponse.status }
|
|
273
275
|
}
|
|
274
276
|
const imgArrayBuffer = await imgResponse.arrayBuffer()
|
|
275
|
-
inputBuffer = Buffer.from(imgArrayBuffer)
|
|
277
|
+
inputBuffer = (globalThis as any).Buffer.from(imgArrayBuffer)
|
|
276
278
|
}
|
|
277
279
|
|
|
278
280
|
const pixelResult = await sharp(inputBuffer)
|
|
@@ -39,7 +39,9 @@ async function transform_image(config: any, context: Record<string, unknown>) {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
try {
|
|
42
|
-
const
|
|
42
|
+
const __nodeRequire =
|
|
43
|
+
typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : require
|
|
44
|
+
const sharp = __nodeRequire('sharp')
|
|
43
45
|
|
|
44
46
|
let inputBuffer
|
|
45
47
|
if (imageBase64) {
|
|
@@ -47,14 +49,14 @@ async function transform_image(config: any, context: Record<string, unknown>) {
|
|
|
47
49
|
if (b64.indexOf(',') !== -1) {
|
|
48
50
|
b64 = b64.split(',')[1]
|
|
49
51
|
}
|
|
50
|
-
inputBuffer = Buffer.from(b64, 'base64')
|
|
52
|
+
inputBuffer = (globalThis as any).Buffer.from(b64, 'base64')
|
|
51
53
|
} else {
|
|
52
54
|
const response = await fetch(imageUrl)
|
|
53
55
|
if (!response.ok) {
|
|
54
56
|
return { result: null, error: 'Failed to fetch image: HTTP ' + response.status }
|
|
55
57
|
}
|
|
56
58
|
const arrayBuffer = await response.arrayBuffer()
|
|
57
|
-
inputBuffer = Buffer.from(arrayBuffer)
|
|
59
|
+
inputBuffer = (globalThis as any).Buffer.from(arrayBuffer)
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
let pipeline
|
|
@@ -190,7 +192,7 @@ async function transform_image(config: any, context: Record<string, unknown>) {
|
|
|
190
192
|
return { result: null, error: 'Failed to fetch watermark: HTTP ' + wmResponse.status }
|
|
191
193
|
}
|
|
192
194
|
const wmArrayBuffer = await wmResponse.arrayBuffer()
|
|
193
|
-
const wmBuffer = Buffer.from(wmArrayBuffer)
|
|
195
|
+
const wmBuffer = (globalThis as any).Buffer.from(wmArrayBuffer)
|
|
194
196
|
|
|
195
197
|
const mainMeta = await sharp(inputBuffer).metadata()
|
|
196
198
|
const maxWmWidth = Math.round((mainMeta.width || 200) * 0.25)
|
|
@@ -206,7 +208,7 @@ async function transform_image(config: any, context: Record<string, unknown>) {
|
|
|
206
208
|
const wmW = wmMeta.width || maxWmWidth
|
|
207
209
|
const wmH = wmMeta.height || maxWmHeight
|
|
208
210
|
const alphaValue = Math.round(watermarkOpacity * 255)
|
|
209
|
-
const alphaBuffer = Buffer.alloc(wmW * wmH, alphaValue)
|
|
211
|
+
const alphaBuffer = (globalThis as any).Buffer.alloc(wmW * wmH, alphaValue)
|
|
210
212
|
const alphaImage = await sharp(alphaBuffer, {
|
|
211
213
|
raw: { width: wmW, height: wmH, channels: 1 },
|
|
212
214
|
})
|
|
@@ -44,7 +44,9 @@ async function utility_barcode_generate(config: any, context: Record<string, unk
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
try {
|
|
47
|
-
const
|
|
47
|
+
const __nodeRequire =
|
|
48
|
+
typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : require
|
|
49
|
+
const bwipjs = __nodeRequire('bwip-js')
|
|
48
50
|
const bcid = formatMap[format] || format.toLowerCase()
|
|
49
51
|
|
|
50
52
|
const opts: Record<string, any> = {
|
|
@@ -12,16 +12,16 @@ async function utility_encode_decode(config: any, context: Record<string, unknow
|
|
|
12
12
|
try {
|
|
13
13
|
switch (operation) {
|
|
14
14
|
case 'base64-encode':
|
|
15
|
-
result = Buffer.from(data, 'utf-8').toString('base64')
|
|
15
|
+
result = (globalThis as any).Buffer.from(data, 'utf-8').toString('base64')
|
|
16
16
|
break
|
|
17
17
|
case 'base64-decode':
|
|
18
|
-
result = Buffer.from(data, 'base64').toString('utf-8')
|
|
18
|
+
result = (globalThis as any).Buffer.from(data, 'base64').toString('utf-8')
|
|
19
19
|
break
|
|
20
20
|
case 'base64url-encode':
|
|
21
|
-
result = Buffer.from(data, 'utf-8').toString('base64url')
|
|
21
|
+
result = (globalThis as any).Buffer.from(data, 'utf-8').toString('base64url')
|
|
22
22
|
break
|
|
23
23
|
case 'base64url-decode':
|
|
24
|
-
result = Buffer.from(data, 'base64url').toString('utf-8')
|
|
24
|
+
result = (globalThis as any).Buffer.from(data, 'base64url').toString('utf-8')
|
|
25
25
|
break
|
|
26
26
|
case 'url-encode':
|
|
27
27
|
result = encodeURIComponent(data)
|
|
@@ -52,10 +52,10 @@ async function utility_encode_decode(config: any, context: Record<string, unknow
|
|
|
52
52
|
.replace(/&/g, '&')
|
|
53
53
|
break
|
|
54
54
|
case 'hex-encode':
|
|
55
|
-
result = Buffer.from(data, 'utf-8').toString('hex')
|
|
55
|
+
result = (globalThis as any).Buffer.from(data, 'utf-8').toString('hex')
|
|
56
56
|
break
|
|
57
57
|
case 'hex-decode':
|
|
58
|
-
result = Buffer.from(data, 'hex').toString('utf-8')
|
|
58
|
+
result = (globalThis as any).Buffer.from(data, 'hex').toString('utf-8')
|
|
59
59
|
break
|
|
60
60
|
case 'json-encode':
|
|
61
61
|
const jsonInput = config.data
|
|
@@ -15,7 +15,9 @@ async function utility_generate_invoice_pdf(config: any, context: Record<string,
|
|
|
15
15
|
const paymentTerms = config.paymentTerms || ''
|
|
16
16
|
|
|
17
17
|
try {
|
|
18
|
-
const
|
|
18
|
+
const __nodeRequire =
|
|
19
|
+
typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : require
|
|
20
|
+
const PDFDocument = __nodeRequire('pdfkit')
|
|
19
21
|
|
|
20
22
|
const doc = new PDFDocument({
|
|
21
23
|
size: 'A4',
|
|
@@ -29,7 +31,7 @@ async function utility_generate_invoice_pdf(config: any, context: Record<string,
|
|
|
29
31
|
|
|
30
32
|
const pdfPromise = new Promise<Buffer>(function (resolve) {
|
|
31
33
|
doc.on('end', function () {
|
|
32
|
-
resolve(Buffer.concat(chunks))
|
|
34
|
+
resolve((globalThis as any).Buffer.concat(chunks))
|
|
33
35
|
})
|
|
34
36
|
})
|
|
35
37
|
|
|
@@ -7,7 +7,9 @@ async function utility_hash_data(config: any, context: Record<string, unknown>)
|
|
|
7
7
|
const hmacKey = config.hmacKey || ''
|
|
8
8
|
|
|
9
9
|
try {
|
|
10
|
-
const
|
|
10
|
+
const __nodeRequire =
|
|
11
|
+
typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : require
|
|
12
|
+
const crypto = __nodeRequire('crypto')
|
|
11
13
|
|
|
12
14
|
const validAlgorithms: Record<string, boolean> = {
|
|
13
15
|
md5: true,
|
|
@@ -12,7 +12,9 @@ async function utility_markdown_to_html(config: any, context: Record<string, unk
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
try {
|
|
15
|
-
const
|
|
15
|
+
const __nodeRequire =
|
|
16
|
+
typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : require
|
|
17
|
+
const marked = __nodeRequire('marked')
|
|
16
18
|
const parse = marked.parse || marked
|
|
17
19
|
|
|
18
20
|
const options: Record<string, any> = {
|
|
@@ -15,7 +15,9 @@ async function utility_ocr_extract_text(config: any, context: Record<string, unk
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
try {
|
|
18
|
-
const
|
|
18
|
+
const __nodeRequire =
|
|
19
|
+
typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : require
|
|
20
|
+
const Tesseract = __nodeRequire('tesseract.js')
|
|
19
21
|
|
|
20
22
|
let source: string
|
|
21
23
|
if (imageBase64) {
|
|
@@ -10,7 +10,9 @@ async function utility_pdf_extract_text(config: any, context: Record<string, unk
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
try {
|
|
13
|
-
const
|
|
13
|
+
const __nodeRequire =
|
|
14
|
+
typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : require
|
|
15
|
+
const pdfParse = __nodeRequire('pdf-parse')
|
|
14
16
|
let buffer: Buffer
|
|
15
17
|
|
|
16
18
|
if (fileBase64) {
|
|
@@ -18,14 +20,14 @@ async function utility_pdf_extract_text(config: any, context: Record<string, unk
|
|
|
18
20
|
if (base64Data.indexOf(',') !== -1) {
|
|
19
21
|
base64Data = base64Data.split(',')[1]
|
|
20
22
|
}
|
|
21
|
-
buffer = Buffer.from(base64Data, 'base64')
|
|
23
|
+
buffer = (globalThis as any).Buffer.from(base64Data, 'base64')
|
|
22
24
|
} else {
|
|
23
25
|
const response = await fetch(fileUrl)
|
|
24
26
|
if (!response.ok) {
|
|
25
27
|
return { text: null, pages: 0, error: 'Failed to fetch PDF: HTTP ' + response.status }
|
|
26
28
|
}
|
|
27
29
|
const arrayBuffer = await response.arrayBuffer()
|
|
28
|
-
buffer = Buffer.from(arrayBuffer)
|
|
30
|
+
buffer = (globalThis as any).Buffer.from(arrayBuffer)
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
if (buffer.length === 0) {
|
|
@@ -11,7 +11,9 @@ async function utility_pdf_generate(config: any, context: Record<string, unknown
|
|
|
11
11
|
const content = config.content || []
|
|
12
12
|
|
|
13
13
|
try {
|
|
14
|
-
const
|
|
14
|
+
const __nodeRequire =
|
|
15
|
+
typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : require
|
|
16
|
+
const PDFDocument = __nodeRequire('pdfkit')
|
|
15
17
|
|
|
16
18
|
const pageSizes: Record<string, number[]> = {
|
|
17
19
|
A4: [595.28, 841.89],
|
|
@@ -43,7 +45,7 @@ async function utility_pdf_generate(config: any, context: Record<string, unknown
|
|
|
43
45
|
|
|
44
46
|
const pdfPromise = new Promise<Buffer>(function (resolve) {
|
|
45
47
|
doc.on('end', function () {
|
|
46
|
-
resolve(Buffer.concat(chunks))
|
|
48
|
+
resolve((globalThis as any).Buffer.concat(chunks))
|
|
47
49
|
})
|
|
48
50
|
})
|
|
49
51
|
|
|
@@ -19,7 +19,9 @@ async function utility_qr_code_generate(config: any, context: Record<string, unk
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
try {
|
|
22
|
-
const
|
|
22
|
+
const __nodeRequire =
|
|
23
|
+
typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : require
|
|
24
|
+
const QRCode = __nodeRequire('qrcode')
|
|
23
25
|
|
|
24
26
|
const opts: Record<string, any> = {
|
|
25
27
|
width: size,
|
|
@@ -35,7 +37,8 @@ async function utility_qr_code_generate(config: any, context: Record<string, unk
|
|
|
35
37
|
const svg = await QRCode.toString(data, { ...opts, type: 'svg' })
|
|
36
38
|
return {
|
|
37
39
|
imageUrl: null,
|
|
38
|
-
imageData:
|
|
40
|
+
imageData:
|
|
41
|
+
'data:image/svg+xml;base64,' + (globalThis as any).Buffer.from(svg).toString('base64'),
|
|
39
42
|
svg,
|
|
40
43
|
}
|
|
41
44
|
}
|
|
@@ -22,7 +22,9 @@ async function utility_scrape_website(config: any, context: Record<string, unkno
|
|
|
22
22
|
return { content: null, statusCode: 0, error: 'No URL provided' }
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const
|
|
25
|
+
const __nodeRequire =
|
|
26
|
+
typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : require
|
|
27
|
+
const cheerio = __nodeRequire('cheerio')
|
|
26
28
|
|
|
27
29
|
function getDomain(u: string) {
|
|
28
30
|
try {
|
|
@@ -12,7 +12,9 @@ async function utility_xml_parse(config: any, context: Record<string, unknown>)
|
|
|
12
12
|
config.parseTrueNumberOnly !== undefined ? config.parseTrueNumberOnly : false
|
|
13
13
|
const cdataTagName = config.cdataTagName || '__cdata'
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const __nodeRequire =
|
|
16
|
+
typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : require
|
|
17
|
+
const fxp = __nodeRequire('fast-xml-parser')
|
|
16
18
|
|
|
17
19
|
if (operation === 'generate') {
|
|
18
20
|
const input = config.input
|
|
@@ -38,7 +38,9 @@ async function utility_youtube_transcript(config: any, context: Record<string, u
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
const
|
|
41
|
+
const __nodeRequire =
|
|
42
|
+
typeof __non_webpack_require__ !== 'undefined' ? __non_webpack_require__ : require
|
|
43
|
+
const YT = __nodeRequire('youtube-transcript')
|
|
42
44
|
const TranscriptApi = YT.YoutubeTranscript || YT.default || YT
|
|
43
45
|
|
|
44
46
|
const fetchFn = TranscriptApi.fetchTranscript || TranscriptApi.getTranscript
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Workflow node handlers are authored as ordinary Node functions and then
|
|
2
|
+
// serialized into the generated project via `fn.toString()`. In the GUI the
|
|
3
|
+
// code generators run inside a browser web-worker that webpack bundles, so a
|
|
4
|
+
// bare `require(...)` inside a handler is rewritten to `__webpack_require__(N)`
|
|
5
|
+
// — which does not exist on the Vercel Node runtime. `__non_webpack_require__`
|
|
6
|
+
// is webpack's escape hatch: webpack rewrites it back to the real runtime
|
|
7
|
+
// `require`, and in the plain tsc/dist build it is simply absent (handlers
|
|
8
|
+
// guard with `typeof __non_webpack_require__ !== 'undefined' ? ... : require`).
|
|
9
|
+
//
|
|
10
|
+
// Declared here so the handler sources type-check against it.
|
|
11
|
+
declare const __non_webpack_require__: (id: string) => any
|