@deflectbot/deflect-sdk 1.4.4 → 1.4.5

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.
@@ -0,0 +1,2 @@
1
+ "use strict";(()=>{var p={endpoint:"https://service.yabadabado.top/pulse",projectId:"deflect-sdk",deploymentId:"688529b539803661332b3f70",service:"deflect-sdk",release:"unknown"},k={name:"deflect-js-sdk",version:p.release||"unknown",language:"javascript"},m=class{constructor(e){this.config={...p,...e,endpoint:(e?.endpoint||p.endpoint).replace(/\/$/,"")},this.enabled=!!(this.config.endpoint&&this.config.projectId&&this.config.deploymentId)}captureException(e,t={}){if(!this.enabled||typeof fetch!="function")return;let r=this.buildErrorEvent(e,t);fetch(`${this.config.endpoint}/capture`,{method:"POST",headers:{"Content-Type":"application/json",project_id:this.config.projectId},body:JSON.stringify(r),keepalive:!0}).catch(()=>{})}buildErrorEvent(e,t){let r=this.normalizeError(e),i=this.config.environment||typeof window<"u"&&window.location.hostname||"unknown",o=typeof navigator>"u"?void 0:{name:navigator.userAgent||"browser",version:navigator.appVersion},s=typeof navigator>"u"?void 0:{name:navigator.platform},a=typeof window>"u"?void 0:{model:`${window.screen.width}x${window.screen.height}`,arch:typeof navigator<"u"?navigator.platform:void 0},b=typeof window>"u"?void 0:{method:"GET",url:window.location.href,headers:typeof navigator<"u"?{"User-Agent":navigator.userAgent,...typeof document<"u"&&document.referrer?{Referer:document.referrer}:{}}:void 0};return{event_type:"error",event_id:typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(16).slice(2)+Date.now().toString(16),deployment_id:this.config.deploymentId,project_id:this.config.projectId,environment:i,service:this.config.service,timestamp:new Date().toISOString(),release:this.config.release,sdk:{...k,version:this.config.release||k.version},tags:t.tags,context:t.context,error:{level:t.level||"error",message:r.message,exception:this.buildExceptionPayload(r),request:b,runtime:o,os:s,device:a}}}normalizeError(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:"Unknown error";return new Error(t)}buildExceptionPayload(e){let t=this.parseStack(e);return{type:e.name||"Error",value:e.message,stacktrace:t.length?{frames:t}:void 0}}parseStack(e){if(!e.stack)return[];let t=[],r=e.stack.split(`
2
+ `).slice(1);for(let i of r){let o=i.trim().replace(/^at\s+/,""),s=o.includes("(")&&o.endsWith(")"),a=s?o.slice(0,o.indexOf("(")).trim():"",c=(s?o.slice(o.indexOf("(")+1,o.length-1):o).split(":"),u=c[0]||void 0,S=c.length>1?Number(c[1]):void 0,T=c.length>2?Number(c[2]):void 0;u&&t.push({filename:u,abs_path:u,function:a||void 0,lineno:Number.isFinite(S)?S:void 0,colno:Number.isFinite(T)?T:void 0,in_app:!u.includes("node_modules")})}return t}},g=m;function x(n,e,t){let r=e||"https://js.deflect.bot/main.js",i=new URL(r),o=i.searchParams;if(o.set("action_id",n),o.set("_",Date.now().toString()),t&&typeof t=="object"){for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s)){let a=t[s];o.set(s,String(a))}}return i.toString()}async function l(n,e,t){let r=x(n,e,t),i=await fetch(r,{cache:"no-store",mode:"cors",credentials:"omit"}),o=await i.text(),s=_(o);if(s)throw s;return{content:o,sessionId:i.headers.get("session_id")||void 0}}function _(n){try{let e=JSON.parse(n);if(e.success===!1||e.error){let t=e.error||"Script fetch failed",r=new Error(t);return(t==="action_does_not_exist"||t.includes("invalid action"))&&(r.isUserError=!0),r}}catch(e){if(!(e instanceof SyntaxError))throw e}return null}function w(n){let e=new Blob([n],{type:"text/javascript"});return URL.createObjectURL(e)}function E(n){return new Promise((e,t)=>{let r=document.createElement("script");r.type="module",r.src=n,r.onload=()=>e(r),r.onerror=()=>t(new Error("Script failed to load")),document.head.appendChild(r)})}function v(n,e=1e4){return new Promise((t,r)=>{let i=setInterval(()=>{typeof window<"u"&&typeof window.Deflect?.[n]=="function"&&(clearInterval(i),t())},50);setTimeout(()=>{clearInterval(i),r(new Error(`Timeout: ${n} did not become available within ${e/1e3} seconds`))},e)})}async function I(n){if(typeof window>"u"||typeof window.Deflect?.[n]!="function")throw new Error(`${n} not available on window.Deflect`);return window.Deflect[n]()}function y(n,e,t){URL.revokeObjectURL(n),e.remove(),typeof window<"u"&&window.Deflect?.[t]&&delete window.Deflect[t]}var d=2e3,F=5,h=15,f=6e4,C=class n{constructor(e,t){this.scriptCache=null;this.isWarmupInProgress=!1;this.hasWarmupError=!1;this.warmupPromise=null;this.getTokenPromise=null;this.lastErrorTime=0;this.consecutiveErrorCount=0;this.fetchCountInWindow=0;this.fetchWindowStart=0;if(!e.actionId?.trim())throw new Error("actionId is required and cannot be empty");this.validateActionId(e.actionId),this.config={prefetch:!0,...e},this.pulseReporter=t||new g(n.resolvePulseConfig()),this.config.prefetch!==!1&&!this.isTestMode()&&this.scheduleWarmup()}getActionId(){return this.config.actionId}scheduleWarmup(){typeof window>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>this.tryWarmup(),{once:!0}):setTimeout(()=>this.tryWarmup(),100))}static resolvePulseConfig(){let e=typeof window<"u"&&typeof window.Deflect=="object"&&window.Deflect?.pulseConfig&&typeof window.Deflect.pulseConfig=="object"?window.Deflect.pulseConfig:{};return{...e,environment:e.environment||(typeof window<"u"?window.location.hostname:void 0)}}reportError(e,t,r){this.pulseReporter.captureException(e,{tags:t,context:r})}isInErrorCooldown(){if(this.consecutiveErrorCount===0)return!1;let e=Math.min(d*Math.pow(2,this.consecutiveErrorCount-1),3e4);return Date.now()-this.lastErrorTime<e}isRateLimited(){let e=Date.now();return e-this.fetchWindowStart>f?(this.fetchCountInWindow=0,this.fetchWindowStart=e,!1):this.fetchCountInWindow>=h}hasExceededMaxErrors(){return this.consecutiveErrorCount>=F}recordFetchSuccess(){this.consecutiveErrorCount=0,this.lastErrorTime=0}recordFetchError(){this.consecutiveErrorCount++,this.lastErrorTime=Date.now()}incrementFetchCount(){let e=Date.now();e-this.fetchWindowStart>f&&(this.fetchCountInWindow=0,this.fetchWindowStart=e),this.fetchCountInWindow++}async tryWarmup(){this.config.prefetch===!1||this.isWarmupInProgress||this.scriptCache||this.hasWarmupError||this.isRateLimited()||this.isInErrorCooldown()||this.hasExceededMaxErrors()||(this.isWarmupInProgress=!0,this.incrementFetchCount(),this.warmupPromise=(async()=>{try{this.scriptCache=await l(this.config.actionId,this.config.scriptUrl,this.config.extraArgs),this.hasWarmupError=!1,this.recordFetchSuccess()}catch{this.hasWarmupError=!0,this.recordFetchError()}finally{this.isWarmupInProgress=!1}})(),await this.warmupPromise.catch(()=>{}))}validateActionId(e){let t=e.trim();if(!/^[a-zA-Z0-9/_-]+$/.test(t))throw new Error("Invalid actionId format: contains disallowed characters");return encodeURIComponent(t)}prefetchNextScript(){!this.hasWarmupError&&this.config.prefetch!==!1&&this.tryWarmup().catch(()=>{})}isTestMode(){if(this.config.actionId==="PULSE_TEST"||this.config.actionId==="SENTRY_TEST")throw new Error("PULSE_TEST: This is a test error to verify Pulse integration is working");return this.config.actionId==="t/FFFFFFFFFFFFF/111111111"||this.config.actionId==="t/FFFFFFFFFFFFF/000000000"}async getToken(){if(this.getTokenPromise)return this.getTokenPromise;this.getTokenPromise=this.getTokenInternal();try{return await this.getTokenPromise}finally{this.getTokenPromise=null}}async getTokenInternal(){try{if(this.isTestMode())return"TESTTOKEN";if(this.hasExceededMaxErrors())throw new Error(`Too many consecutive errors (${this.consecutiveErrorCount}). Create a new client or wait before retrying.`);if(this.isRateLimited())throw new Error(`Rate limit exceeded: ${h} requests per minute. Please wait before retrying.`);if(this.isInErrorCooldown()){let r=Math.min(d*Math.pow(2,this.consecutiveErrorCount-1),3e4)-(Date.now()-this.lastErrorTime);throw new Error(`In error cooldown. Please wait ${Math.ceil(r/1e3)} seconds before retrying.`)}let e;return this.warmupPromise&&await this.warmupPromise.catch(()=>{}),this.scriptCache&&!this.isWarmupInProgress?(e=this.scriptCache,this.scriptCache=null):(this.incrementFetchCount(),e=await l(this.config.actionId,this.config.scriptUrl,this.config.extraArgs)),this.executeScript(e)}catch(e){let t=e instanceof Error?e.message:"";t.includes("cooldown")||t.includes("Rate limit")||t.includes("Too many consecutive")||this.recordFetchError();let i=e&&typeof e=="object"&&"isUserError"in e&&e.isUserError===!0;throw this.reportError(e,{deflect_sdk_error:"true",deflect_user_error:i?"true":"false",method:"getToken",action_id:this.config.actionId,has_cache:this.scriptCache!==null?"true":"false",has_warmup_error:this.hasWarmupError?"true":"false",consecutive_errors:this.consecutiveErrorCount.toString(),stage:"call"},{actionId:this.config.actionId,hasCache:this.scriptCache!==null,hasWarmupError:this.hasWarmupError,consecutiveErrorCount:this.consecutiveErrorCount,fetchCountInWindow:this.fetchCountInWindow}),e}}async executeScript(e){e.sessionId&&typeof window<"u"&&(window.Deflect=window.Deflect||{},window.Deflect.sessionId=e.sessionId);let t=w(e.content),r=null;try{r=await E(t),await v("getChallengeToken");let i=await I("getChallengeToken");return this.recordFetchSuccess(),this.prefetchNextScript(),i}catch(i){throw this.reportError(i,{deflect_sdk_error:"true",method:"executeScript",stage:"load_or_execute",action_id:this.config.actionId},{hasCache:this.scriptCache!==null,hasWarmupError:this.hasWarmupError}),i}finally{r?y(t,r,"getChallengeToken"):URL.revokeObjectURL(t)}}async warmup(){try{return this.config.prefetch===!1?!1:(await this.tryWarmup(),this.scriptCache!==null)}catch{return!1}}clearCache(){this.scriptCache=null}resetErrorState(){this.hasWarmupError=!1,this.consecutiveErrorCount=0,this.lastErrorTime=0,this.getTokenPromise=null}getStatus(){return{actionId:this.config.actionId,isRateLimited:this.isRateLimited(),isInCooldown:this.isInErrorCooldown(),consecutiveErrors:this.consecutiveErrorCount,fetchesInWindow:this.fetchCountInWindow,canFetch:!this.isRateLimited()&&!this.isInErrorCooldown()&&!this.hasExceededMaxErrors()}}async injectToken(e){if(!e||!e.target||!(e.target instanceof HTMLFormElement))throw new Error("injectToken: must be called from a form submit event");e.preventDefault();let t=e.target,r=await this.getToken();Array.from(t.querySelectorAll('input[name="deflect_token"]')).forEach(o=>o.remove());let i=document.createElement("input");i.type="hidden",i.name="deflect_token",i.value=r,t.appendChild(i),t.submit()}},P=class{constructor(){this.config=null;this.scriptCache=null;this.isWarmupInProgress=!1;this.hasWarmupError=!1;this.warmupPromise=null;this.getTokenPromise=null;this.lastErrorTime=0;this.consecutiveErrorCount=0;this.fetchCountInWindow=0;this.fetchWindowStart=0;this.initializeGlobalState(),this.pulseReporter=new g(this.resolvePulseConfig()),this.setupAutomaticWarmup()}initializeGlobalState(){typeof window>"u"||(window.Deflect=window.Deflect||{})}setupAutomaticWarmup(){typeof window>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>this.tryWarmup()):setTimeout(()=>this.tryWarmup(),100))}resolvePulseConfig(){let e=typeof window<"u"&&typeof window.Deflect=="object"&&window.Deflect?.pulseConfig&&typeof window.Deflect.pulseConfig=="object"?window.Deflect.pulseConfig:{};return{...e,environment:e.environment||(typeof window<"u"?window.location.hostname:void 0)}}reportError(e,t,r){this.pulseReporter.captureException(e,{tags:t,context:r})}isInErrorCooldown(){if(this.consecutiveErrorCount===0)return!1;let e=Math.min(d*Math.pow(2,this.consecutiveErrorCount-1),3e4);return Date.now()-this.lastErrorTime<e}isRateLimited(){let e=Date.now();return e-this.fetchWindowStart>f?(this.fetchCountInWindow=0,this.fetchWindowStart=e,!1):this.fetchCountInWindow>=h}hasExceededMaxErrors(){return this.consecutiveErrorCount>=F}recordFetchSuccess(){this.consecutiveErrorCount=0,this.lastErrorTime=0}recordFetchError(){this.consecutiveErrorCount++,this.lastErrorTime=Date.now()}incrementFetchCount(){let e=Date.now();e-this.fetchWindowStart>f&&(this.fetchCountInWindow=0,this.fetchWindowStart=e),this.fetchCountInWindow++}async tryWarmup(){!this.config?.actionId||this.config.prefetch===!1||this.isWarmupInProgress||this.scriptCache||this.hasWarmupError||this.isRateLimited()||this.isInErrorCooldown()||this.hasExceededMaxErrors()||(this.validateActionId(this.config.actionId),this.isWarmupInProgress=!0,this.incrementFetchCount(),this.warmupPromise=(async()=>{try{this.scriptCache=await l(this.config.actionId,this.config.scriptUrl,this.config.extraArgs),this.hasWarmupError=!1,this.recordFetchSuccess()}catch{this.hasWarmupError=!0,this.recordFetchError()}finally{this.isWarmupInProgress=!1}})(),await this.warmupPromise.catch(()=>{}))}validateActionId(e){let t=e.trim();if(!/^[a-zA-Z0-9/_-]+$/.test(t))throw new Error("Invalid actionId format: contains disallowed characters");return encodeURIComponent(t)}prefetchNextScript(){!this.hasWarmupError&&this.config?.prefetch!==!1&&this.tryWarmup().catch(()=>{})}isTestMode(){if(this.config?.actionId==="PULSE_TEST"||this.config?.actionId==="SENTRY_TEST")throw new Error("PULSE_TEST: This is a test error to verify Pulse integration is working");return this.config?.actionId==="t/FFFFFFFFFFFFF/111111111"||this.config?.actionId==="t/FFFFFFFFFFFFF/000000000"}configure(e){try{if(!e.actionId?.trim())throw new Error("actionId is required and cannot be empty");if(this.validateActionId(e.actionId),this.config?.actionId===e.actionId&&this.config.prefetch===e.prefetch&&this.config.scriptUrl===e.scriptUrl)return;this.config?.actionId!==e.actionId&&(this.hasWarmupError=!1,this.consecutiveErrorCount=0,this.lastErrorTime=0),this.scriptCache=null,this.getTokenPromise=null,this.config={prefetch:!0,...e},typeof window<"u"&&(window.Deflect.actionId=e.actionId),!this.isTestMode()&&this.config.prefetch!==!1&&this.tryWarmup()}catch(t){let r=t&&typeof t=="object"&&"isUserError"in t&&t.isUserError===!0;throw this.reportError(t,{deflect_sdk_error:"true",deflect_user_error:r?"true":"false",method:"configure",action_id:e?.actionId||"unknown"},{actionId:e?.actionId,hasCache:this.scriptCache!==null,hasWarmupError:this.hasWarmupError}),t}}async getToken(){if(this.getTokenPromise)return this.getTokenPromise;this.getTokenPromise=this.getTokenInternal();try{return await this.getTokenPromise}finally{this.getTokenPromise=null}}async getTokenInternal(){try{if(!this.config?.actionId)throw new Error("Must call configure() before getToken()");if(this.validateActionId(this.config.actionId),this.isTestMode())return"TESTTOKEN";if(this.hasExceededMaxErrors())throw new Error(`Too many consecutive errors (${this.consecutiveErrorCount}). Call configure() with a new actionId or wait before retrying.`);if(this.isRateLimited())throw new Error(`Rate limit exceeded: ${h} requests per minute. Please wait before retrying.`);if(this.isInErrorCooldown()){let r=Math.min(d*Math.pow(2,this.consecutiveErrorCount-1),3e4)-(Date.now()-this.lastErrorTime);throw new Error(`In error cooldown. Please wait ${Math.ceil(r/1e3)} seconds before retrying.`)}let e;return this.warmupPromise&&await this.warmupPromise.catch(()=>{}),this.scriptCache&&!this.isWarmupInProgress?(e=this.scriptCache,this.scriptCache=null):(this.incrementFetchCount(),e=await l(this.config.actionId,this.config.scriptUrl,this.config.extraArgs)),this.executeScript(e)}catch(e){let t=e instanceof Error?e.message:"";t.includes("cooldown")||t.includes("Rate limit")||t.includes("Too many consecutive")||this.recordFetchError();let i=e&&typeof e=="object"&&"isUserError"in e&&e.isUserError===!0;throw this.reportError(e,{deflect_sdk_error:"true",deflect_user_error:i?"true":"false",method:"getToken",action_id:this.config?.actionId||"unknown",has_cache:this.scriptCache!==null?"true":"false",has_warmup_error:this.hasWarmupError?"true":"false",consecutive_errors:this.consecutiveErrorCount.toString(),stage:"call"},{actionId:this.config?.actionId,hasCache:this.scriptCache!==null,hasWarmupError:this.hasWarmupError,consecutiveErrorCount:this.consecutiveErrorCount,fetchCountInWindow:this.fetchCountInWindow}),e}}async executeScript(e){e.sessionId&&typeof window<"u"&&(window.Deflect.sessionId=e.sessionId);let t=w(e.content),r=null;try{r=await E(t),await v("getChallengeToken");let i=await I("getChallengeToken");return this.recordFetchSuccess(),this.prefetchNextScript(),i}catch(i){throw this.reportError(i,{deflect_sdk_error:"true",method:"executeScript",stage:"load_or_execute",action_id:this.config?.actionId||"unknown"},{hasCache:this.scriptCache!==null,hasWarmupError:this.hasWarmupError}),i}finally{r?y(t,r,"getChallengeToken"):URL.revokeObjectURL(t)}}async warmup(){if(!this.config?.actionId)return!1;try{return this.config.prefetch===!1?!1:(await this.tryWarmup(),this.scriptCache!==null)}catch{return!1}}clearCache(){this.scriptCache=null}resetErrorState(){this.hasWarmupError=!1,this.consecutiveErrorCount=0,this.lastErrorTime=0,this.getTokenPromise=null}getStatus(){return{isRateLimited:this.isRateLimited(),isInCooldown:this.isInErrorCooldown(),consecutiveErrors:this.consecutiveErrorCount,fetchesInWindow:this.fetchCountInWindow,canFetch:!this.isRateLimited()&&!this.isInErrorCooldown()&&!this.hasExceededMaxErrors()}}async injectToken(e){if(!e||!e.target||!(e.target instanceof HTMLFormElement))throw new Error("injectToken: must be called from a form submit event");e.preventDefault();let t=e.target,r=await this.getToken();Array.from(t.querySelectorAll('input[name="deflect_token"]')).forEach(o=>o.remove());let i=document.createElement("input");i.type="hidden",i.name="deflect_token",i.value=r,t.appendChild(i),t.submit()}createClient(e){return new C(e,this.pulseReporter)}},W=new P;typeof window<"u"&&(window.Deflect=W);var $=W;})();
@@ -0,0 +1,99 @@
1
+ export type PulseEventType = "error" | "span" | "transaction" | "log" | "metric";
2
+ export type PulseLevel = "fatal" | "error" | "warning" | "info" | "debug";
3
+ export interface PulseReporterConfig {
4
+ endpoint: string;
5
+ projectId: string;
6
+ deploymentId: string;
7
+ environment?: string;
8
+ service?: string;
9
+ release?: string;
10
+ }
11
+ export interface PulseSDKInfo {
12
+ name: string;
13
+ version: string;
14
+ language: string;
15
+ integrations?: string[];
16
+ }
17
+ export interface PulseStackFrame {
18
+ filename?: string;
19
+ abs_path?: string;
20
+ function?: string;
21
+ lineno?: number;
22
+ colno?: number;
23
+ in_app?: boolean;
24
+ context_line?: string;
25
+ }
26
+ export interface PulseExceptionPayload {
27
+ type?: string;
28
+ value?: string;
29
+ stacktrace?: {
30
+ frames: PulseStackFrame[];
31
+ };
32
+ }
33
+ export interface PulseRequestInfo {
34
+ method?: string;
35
+ url?: string;
36
+ headers?: Record<string, string>;
37
+ route?: string;
38
+ status_code?: number;
39
+ }
40
+ export interface PulseRuntimeInfo {
41
+ name?: string;
42
+ version?: string;
43
+ }
44
+ export interface PulseOSInfo {
45
+ name?: string;
46
+ version?: string;
47
+ }
48
+ export interface PulseDeviceInfo {
49
+ model?: string;
50
+ arch?: string;
51
+ }
52
+ export interface PulseErrorPayload {
53
+ level: PulseLevel;
54
+ message?: string;
55
+ exception?: PulseExceptionPayload;
56
+ culprit?: string;
57
+ request?: PulseRequestInfo;
58
+ runtime?: PulseRuntimeInfo;
59
+ os?: PulseOSInfo;
60
+ device?: PulseDeviceInfo;
61
+ }
62
+ export interface PulseEvent {
63
+ event_type: PulseEventType;
64
+ event_id: string;
65
+ deployment_id: string;
66
+ project_id: string;
67
+ environment?: string;
68
+ service?: string;
69
+ host?: string;
70
+ sdk?: PulseSDKInfo;
71
+ timestamp: string;
72
+ release?: string;
73
+ dist?: string;
74
+ deployment?: string;
75
+ tags?: Record<string, string>;
76
+ context?: Record<string, unknown>;
77
+ sample_rate?: number;
78
+ fingerprint?: string[];
79
+ ingest_key_id?: string;
80
+ payload_version?: number;
81
+ content_encoding?: string;
82
+ error?: PulseErrorPayload;
83
+ }
84
+ export interface PulseCaptureOptions {
85
+ tags?: Record<string, string>;
86
+ context?: Record<string, unknown>;
87
+ level?: PulseLevel;
88
+ }
89
+ export declare class PulseReporter {
90
+ private readonly config;
91
+ private readonly enabled;
92
+ constructor(config?: Partial<PulseReporterConfig>);
93
+ captureException(error: unknown, options?: PulseCaptureOptions): void;
94
+ private buildErrorEvent;
95
+ private normalizeError;
96
+ private buildExceptionPayload;
97
+ private parseStack;
98
+ }
99
+ export default PulseReporter;
@@ -0,0 +1,8 @@
1
+ export interface DeflectScript {
2
+ sessionId?: string;
3
+ content: string;
4
+ }
5
+ export type DeflectExtraArgs = Record<string, string | number | boolean>;
6
+ export declare function buildScriptUrl(actionId: string, scriptUrl?: string, extraArgs?: DeflectExtraArgs): string;
7
+ export declare function fetchScript(actionId: string, scriptUrl?: string, extraArgs?: DeflectExtraArgs): Promise<DeflectScript>;
8
+ export declare function parseErrorJson(content: string): Error | null;
@@ -0,0 +1,5 @@
1
+ export declare function createBlobUrl(content: string): string;
2
+ export declare function loadModuleScript(blobUrl: string): Promise<HTMLScriptElement>;
3
+ export declare function waitForGlobalFunction(fnName: string, timeout?: number): Promise<void>;
4
+ export declare function getTokenFromGlobal(fnName: string): Promise<string>;
5
+ export declare function cleanup(blobUrl: string, scriptElement: HTMLScriptElement, fnName: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deflectbot/deflect-sdk",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
4
4
  "description": "SDK for deflect.bot - Use it for seamless captcha integration on any website.",
5
5
  "main": "dist/index.min.js",
6
6
  "module": "dist/index.esm.js",