@integry/sdk 4.5.17 → 4.5.18

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.
@@ -7011,26 +7011,14 @@ var e,t,n,i,o,s,a,l,r,d,p,c,_={},u=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|n
7011
7011
  </div>
7012
7012
  </div>
7013
7013
  `}
7014
- `}});const ap=e=>{const{tags:t,onSelect:n,...i}=e,o={FirstName:"John",LastName:"Doe",Gender:"male",Age:20,DateOfBirth:"1990-01-01",Email:"johndoe@example.com",Phone:"555-555-1234",Address:{Street:"123 Main St",City:"New York",State:"NY",PostalCode:"10001",Country:"USA"},PreferredContactMethod:"email",LastContacted:"2023-01-15",Twitter:"@johndoe",Website:"https://www.example.com",LinkedIn:"https://www.linkedin.com/in/johndoe",Bio:"John Doe is a software engineer with over 10 years of experience.",Relationship:"professional",Tags:["tech","conference","networking"],JobTitle:"Software Engineer",Company:"Example Corp.",DateCreated:"2023-04-14T12:00:00Z",DateUpdated:"2023-04-14T12:00:00Z",NextMeeting:{Date:"2023-05-01",Topic:"Project Planning",Location:"New York"},Notes:"Met at the 2022 Tech Conference in San Francisco."};return B`
7015
- <div>
7016
- ${Object.keys(o).map(((e,t,i)=>B`
7017
- <${_s}
7018
- objectKey="${e}"
7019
- keyValue="${e}"
7020
- objectData="${o[e]}"
7021
- onSelect=${n}
7022
- isRoot="${!0}"
7023
- />
7024
- `))}
7025
- </div>
7026
- `},lp={getAuthHash:async function(e,t){const n=e=>new Uint8Array([...unescape(encodeURIComponent(e))].map((e=>e.charCodeAt(0)))),i=n(t),o=n(e),s=await crypto.subtle.importKey("raw",i,{name:"HMAC",hash:"SHA-256"},!0,["sign"]),a=await crypto.subtle.sign("HMAC",s,o);return[...new Uint8Array(a)].map((e=>e.toString(16).padStart(2,"0"))).join("")}};class rp{static SDK_VERSION="4.5.17";config;apiHandler;initConfig;eventEmitter=(()=>new te)();static html=(()=>B)();static RenderModes=(()=>ae)();static TemplateFormRenderModes=(()=>oe)();static Layouts=(()=>ie)();static ViewStyles=(()=>ne)();static MarketplaceRenderModes=(()=>se)();static Helpers;authModalId="";forceRerender=!1;constructor(e){let t;const n=e.baseUrl||"https://app.integry.io",i=e;if(i.user){const{userId:e,apiKey:t,...n}=i.user;"userId"in i||(i.userId=""),"userId"in i&&(i.userId=e.toString()),i.xIntegryConfig||(i.xIntegryConfig={}),i.xIntegryConfig.appAuth||(i.xIntegryConfig.appAuth={}),i.xIntegryConfig.appAuth.extras||(i.xIntegryConfig.appAuth.extras={}),i.xIntegryConfig.appAuth.apiKey=(t||"").toString(),i.xIntegryConfig.appAuth.extras=n}const o={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:n,baseUrlv2:`${n}/v2`,baseAPIUrl:"https://api.integry.io",apiKey:i.xIntegryConfig?.appAuth?.apiKey,authId:i.xIntegryConfig?.appAuth?.authId,extras:i.xIntegryConfig?.appAuth?.extras},s=i.options||i.userConfig||{};if(i.options&&i.payloads&&(i.options.objects=e.payloads),"appKey"in i)t={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId},this.config={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId,deploymentId:i.deploymentId,userConfig:i.deploymentId?{...s,tags:s?.tags?[...s?.tags,`${i.deploymentId}`]:[`${i.deploymentId}`]}:s};else{const e=this.getAuthParamsFromUrl()||{};t={...o,...e},this.config={...o,...e,userConfig:i.userConfig}}this.authModalId=this.getRandomFlowId(6),this.apiHandler=new X(t),this.verifyAuthConfig().then((e=>{e?.config_verified?this.eventEmitter.emit("ready",{isReady:!0}):console.error("IntegrySDK: Auth config verification failed, are your auth parameters correct?")})).catch((e=>console.error(e))),this.initConfig={containerId:"",renderMode:oe.INLINE}}SDKFailedHandler=(e,t)=>{const n=e.options||e.userConfig||{},i=document.getElementById(t);throw i&&z(B`
7014
+ `}});const ap={getAuthHash:async function(e,t){const n=e=>new Uint8Array([...unescape(encodeURIComponent(e))].map((e=>e.charCodeAt(0)))),i=n(t),o=n(e),s=await crypto.subtle.importKey("raw",i,{name:"HMAC",hash:"SHA-256"},!0,["sign"]),a=await crypto.subtle.sign("HMAC",s,o);return[...new Uint8Array(a)].map((e=>e.toString(16).padStart(2,"0"))).join("")}};class lp{static SDK_VERSION="4.5.18";config;apiHandler;initConfig;eventEmitter=(()=>new te)();static html=(()=>B)();static RenderModes=(()=>ae)();static TemplateFormRenderModes=(()=>oe)();static Layouts=(()=>ie)();static ViewStyles=(()=>ne)();static MarketplaceRenderModes=(()=>se)();static Helpers;authModalId="";forceRerender=!1;constructor(e){let t;const n=e.baseUrl||"https://app.integry.io",i=e;if(i.user){const{userId:e,apiKey:t,...n}=i.user;"userId"in i||(i.userId=""),"userId"in i&&(i.userId=e.toString()),i.xIntegryConfig||(i.xIntegryConfig={}),i.xIntegryConfig.appAuth||(i.xIntegryConfig.appAuth={}),i.xIntegryConfig.appAuth.extras||(i.xIntegryConfig.appAuth.extras={}),i.xIntegryConfig.appAuth.apiKey=(t||"").toString(),i.xIntegryConfig.appAuth.extras=n}const o={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:n,baseUrlv2:`${n}/v2`,baseAPIUrl:"https://api.integry.io",apiKey:i.xIntegryConfig?.appAuth?.apiKey,authId:i.xIntegryConfig?.appAuth?.authId,extras:i.xIntegryConfig?.appAuth?.extras},s=i.options||i.userConfig||{};if(i.options&&i.payloads&&(i.options.objects=e.payloads),"appKey"in i)t={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId},this.config={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId,deploymentId:i.deploymentId,userConfig:i.deploymentId?{...s,tags:s?.tags?[...s?.tags,`${i.deploymentId}`]:[`${i.deploymentId}`]}:s};else{const e=this.getAuthParamsFromUrl()||{};t={...o,...e},this.config={...o,...e,userConfig:i.userConfig}}this.authModalId=this.getRandomFlowId(6),this.apiHandler=new X(t),this.verifyAuthConfig().then((e=>{e?.config_verified?this.eventEmitter.emit("ready",{isReady:!0}):console.error("IntegrySDK: Auth config verification failed, are your auth parameters correct?")})).catch((e=>console.error(e))),this.initConfig={containerId:"",renderMode:oe.INLINE}}SDKFailedHandler=(e,t)=>{const n=e.options||e.userConfig||{},i=document.getElementById(t);throw i&&z(B`
7027
7015
  <${Il}
7028
7016
  message="SDK failed to load"
7029
7017
  debug=${n.debug}
7030
7018
  config=${n.debug?e:null}
7031
7019
  >
7032
7020
  <//>
7033
- `,i),new Error("IntegrySDK: SDK failed to load")};getRandomFlowId=e=>{const t=[],n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<e;i+=1)t.push(n.charAt(Math.floor(52*Math.random())));return`x-integry-modal-${t.join("")}`};getAuthParamsFromUrl=()=>{const e=ge()&&new URLSearchParams(window.location.search);if(e){const t=e.get("user_id"),n=e.get("app_key"),i=e.get("hash"),o=e.get("deployment_id");if(!(t&&n&&i&&o))throw new Error(`The following auth variables are undefined: ${t?"":"userId"} ${n?"":"appKey"} ${i?"":"hash"} ${o?"":"deploymentId"}`);return{userId:t,appKey:n,hash:i,deploymentId:o}}return{userId:"",appKey:"",hash:"",deploymentId:""}};printVersion=()=>{console.info(`@integry/sdk@${rp.SDK_VERSION}`)};setupFlowFormDestination=(e,t)=>{let n=null;if(t){if(e===oe.MODAL||e===oe.INLINE)throw new Error('The `templateContainerId` property is unsupported when render mode is set to "MODAL" or "INLINE"');n=document.getElementById(t),n||console.warn(`The template form render target with id ${t} was not found`)}switch(e){case oe.MODAL:return n=document.createElement("div"),n.id=this.getRandomFlowId(8),document.body.appendChild(n),n;case oe.INLINE:return null;case oe.DETACHED:case oe.CUSTOM:return n;default:throw new Error(`Unsupported renderMode ${e} configuration, please provide one of ${JSON.stringify(Object.keys(oe))}`)}};renderFlowSetupForm=e=>{const{flowId:t,flowContainerId:n,versionId:i,viewStyle:o}=e,s=document.getElementById(n);if(!s)return void console.warn(`Integry template form render target with id ${n} was not found`);let a=Number(t),l=this.config.integrationId||e.integrationId;l||(l=Number(ye("integrationId"))),a||(a=Number(ye("flowId")));const r=he();r.setState({integrationIdToEdit:l,userConfig:this.config.userConfig,genericData:{...pe.genericData,implicitAuthEnabled:!!this.config.xIntegryConfig?.appAuth?.apiKey,deploymentId:Number(this.config.deploymentId),isAnonymous:!!this.config.xIntegryConfig?.isAnonymous,viewStyle:o||ne.COMFORTABLE,testMultipurpose:!0,customFlowSetupRender:!0}}),z(B`
7021
+ `,i),new Error("IntegrySDK: SDK failed to load")};getRandomFlowId=e=>{const t=[],n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<e;i+=1)t.push(n.charAt(Math.floor(52*Math.random())));return`x-integry-modal-${t.join("")}`};getAuthParamsFromUrl=()=>{const e=ge()&&new URLSearchParams(window.location.search);if(e){const t=e.get("user_id"),n=e.get("app_key"),i=e.get("hash"),o=e.get("deployment_id");if(!(t&&n&&i&&o))throw new Error(`The following auth variables are undefined: ${t?"":"userId"} ${n?"":"appKey"} ${i?"":"hash"} ${o?"":"deploymentId"}`);return{userId:t,appKey:n,hash:i,deploymentId:o}}return{userId:"",appKey:"",hash:"",deploymentId:""}};printVersion=()=>{console.info(`@integry/sdk@${lp.SDK_VERSION}`)};setupFlowFormDestination=(e,t)=>{let n=null;if(t){if(e===oe.MODAL||e===oe.INLINE)throw new Error('The `templateContainerId` property is unsupported when render mode is set to "MODAL" or "INLINE"');n=document.getElementById(t),n||console.warn(`The template form render target with id ${t} was not found`)}switch(e){case oe.MODAL:return n=document.createElement("div"),n.id=this.getRandomFlowId(8),document.body.appendChild(n),n;case oe.INLINE:return null;case oe.DETACHED:case oe.CUSTOM:return n;default:throw new Error(`Unsupported renderMode ${e} configuration, please provide one of ${JSON.stringify(Object.keys(oe))}`)}};renderFlowSetupForm=e=>{const{flowId:t,flowContainerId:n,versionId:i,viewStyle:o}=e,s=document.getElementById(n);if(!s)return void console.warn(`Integry template form render target with id ${n} was not found`);let a=Number(t),l=this.config.integrationId||e.integrationId;l||(l=Number(ye("integrationId"))),a||(a=Number(ye("flowId")));const r=he();r.setState({integrationIdToEdit:l,userConfig:this.config.userConfig,genericData:{...pe.genericData,implicitAuthEnabled:!!this.config.xIntegryConfig?.appAuth?.apiKey,deploymentId:Number(this.config.deploymentId),isAnonymous:!!this.config.xIntegryConfig?.isAnonymous,viewStyle:o||ne.COMFORTABLE,testMultipurpose:!0,customFlowSetupRender:!0}}),z(B`
7034
7022
  <${re.Provider}
7035
7023
  value=${{apiHandler:this.apiHandler,eventEmitter:this.eventEmitter,isPreviewMode:!1}}
7036
7024
  >
@@ -7314,10 +7302,10 @@ var e,t,n,i,o,s,a,l,r,d,p,c,_={},u=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|n
7314
7302
  isReadOnly="${!1}"
7315
7303
  selectedAuthId="${t.connectedAccountId}"
7316
7304
  accountConnected=${!0}
7317
- tagsComponent=${ap}
7305
+ tagsComponent=${t.tagsComponent}
7318
7306
  onFieldChangeCallback=${t.onFieldChangeCallback}
7319
7307
  tagsTree=${t.tagsTree}
7320
7308
  />
7321
7309
  <//>
7322
7310
  <//>
7323
- </div>`,n)}else console.warn(`Integry SDK render target with id ${t.containerId} was not found`)}})();verifyAuthConfig=()=>this.apiHandler.verifyAuthConfig({deploymentId:this.config.deploymentId});getUserVariables=async()=>{try{const e=await this.apiHandler.getUserVariables();return e?e.results:[]}catch(e){return console.error(e),[]}};destroy=()=>{try{this.eventEmitter.offAll();const e=document.getElementById(this.authModalId);e&&e.remove()}catch(e){console.error("There was an error unsubscribing from all events")}};static setFieldValue=(e,t)=>{const n=document.getElementById(e)?.querySelector("input");if(n&&n instanceof HTMLInputElement){n.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});n.dispatchEvent(e)}const i=document.getElementById(`tagify_${e}`);if(i&&i instanceof HTMLInputElement){i.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});i.dispatchEvent(e)}};getMethod=()=>"POST";getBaseAPIUrl=()=>"https://api.integry.io";getHeaders=()=>({"Content-Type":"application/json"})}export{lp as Helpers,rp as IntegryJS,B as html};
7311
+ </div>`,n)}else console.warn(`Integry SDK render target with id ${t.containerId} was not found`)}})();verifyAuthConfig=()=>this.apiHandler.verifyAuthConfig({deploymentId:this.config.deploymentId});getUserVariables=async()=>{try{const e=await this.apiHandler.getUserVariables();return e?e.results:[]}catch(e){return console.error(e),[]}};destroy=()=>{try{this.eventEmitter.offAll();const e=document.getElementById(this.authModalId);e&&e.remove()}catch(e){console.error("There was an error unsubscribing from all events")}};static setFieldValue=(e,t)=>{const n=document.getElementById(e)?.querySelector("input");if(n&&n instanceof HTMLInputElement){n.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});n.dispatchEvent(e)}const i=document.getElementById(`tagify_${e}`);if(i&&i instanceof HTMLInputElement){i.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});i.dispatchEvent(e)}};getMethod=()=>"POST";getBaseAPIUrl=()=>"https://api.integry.io";getHeaders=()=>({"Content-Type":"application/json"})}export{ap as Helpers,lp as IntegryJS,B as html};
@@ -7011,26 +7011,14 @@
7011
7011
  </div>
7012
7012
  </div>
7013
7013
  `}
7014
- `}});const ap=e=>{const{tags:t,onSelect:n,...i}=e,o={FirstName:"John",LastName:"Doe",Gender:"male",Age:20,DateOfBirth:"1990-01-01",Email:"johndoe@example.com",Phone:"555-555-1234",Address:{Street:"123 Main St",City:"New York",State:"NY",PostalCode:"10001",Country:"USA"},PreferredContactMethod:"email",LastContacted:"2023-01-15",Twitter:"@johndoe",Website:"https://www.example.com",LinkedIn:"https://www.linkedin.com/in/johndoe",Bio:"John Doe is a software engineer with over 10 years of experience.",Relationship:"professional",Tags:["tech","conference","networking"],JobTitle:"Software Engineer",Company:"Example Corp.",DateCreated:"2023-04-14T12:00:00Z",DateUpdated:"2023-04-14T12:00:00Z",NextMeeting:{Date:"2023-05-01",Topic:"Project Planning",Location:"New York"},Notes:"Met at the 2022 Tech Conference in San Francisco."};return B`
7015
- <div>
7016
- ${Object.keys(o).map(((e,t,i)=>B`
7017
- <${_s}
7018
- objectKey="${e}"
7019
- keyValue="${e}"
7020
- objectData="${o[e]}"
7021
- onSelect=${n}
7022
- isRoot="${!0}"
7023
- />
7024
- `))}
7025
- </div>
7026
- `};class lp{static SDK_VERSION="4.5.17";config;apiHandler;initConfig;eventEmitter=(()=>new te)();static html=(()=>B)();static RenderModes=(()=>ae)();static TemplateFormRenderModes=(()=>oe)();static Layouts=(()=>ie)();static ViewStyles=(()=>ne)();static MarketplaceRenderModes=(()=>se)();static Helpers;authModalId="";forceRerender=!1;constructor(e){let t;const n=e.baseUrl||"https://app.integry.io",i=e;if(i.user){const{userId:e,apiKey:t,...n}=i.user;"userId"in i||(i.userId=""),"userId"in i&&(i.userId=e.toString()),i.xIntegryConfig||(i.xIntegryConfig={}),i.xIntegryConfig.appAuth||(i.xIntegryConfig.appAuth={}),i.xIntegryConfig.appAuth.extras||(i.xIntegryConfig.appAuth.extras={}),i.xIntegryConfig.appAuth.apiKey=(t||"").toString(),i.xIntegryConfig.appAuth.extras=n}const o={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:n,baseUrlv2:`${n}/v2`,baseAPIUrl:"https://api.integry.io",apiKey:i.xIntegryConfig?.appAuth?.apiKey,authId:i.xIntegryConfig?.appAuth?.authId,extras:i.xIntegryConfig?.appAuth?.extras},s=i.options||i.userConfig||{};if(i.options&&i.payloads&&(i.options.objects=e.payloads),"appKey"in i)t={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId},this.config={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId,deploymentId:i.deploymentId,userConfig:i.deploymentId?{...s,tags:s?.tags?[...s?.tags,`${i.deploymentId}`]:[`${i.deploymentId}`]}:s};else{const e=this.getAuthParamsFromUrl()||{};t={...o,...e},this.config={...o,...e,userConfig:i.userConfig}}this.authModalId=this.getRandomFlowId(6),this.apiHandler=new X(t),this.verifyAuthConfig().then((e=>{e?.config_verified?this.eventEmitter.emit("ready",{isReady:!0}):console.error("IntegrySDK: Auth config verification failed, are your auth parameters correct?")})).catch((e=>console.error(e))),this.initConfig={containerId:"",renderMode:oe.INLINE}}SDKFailedHandler=(e,t)=>{const n=e.options||e.userConfig||{},i=document.getElementById(t);throw i&&z(B`
7014
+ `}});class ap{static SDK_VERSION="4.5.18";config;apiHandler;initConfig;eventEmitter=(()=>new te)();static html=(()=>B)();static RenderModes=(()=>ae)();static TemplateFormRenderModes=(()=>oe)();static Layouts=(()=>ie)();static ViewStyles=(()=>ne)();static MarketplaceRenderModes=(()=>se)();static Helpers;authModalId="";forceRerender=!1;constructor(e){let t;const n=e.baseUrl||"https://app.integry.io",i=e;if(i.user){const{userId:e,apiKey:t,...n}=i.user;"userId"in i||(i.userId=""),"userId"in i&&(i.userId=e.toString()),i.xIntegryConfig||(i.xIntegryConfig={}),i.xIntegryConfig.appAuth||(i.xIntegryConfig.appAuth={}),i.xIntegryConfig.appAuth.extras||(i.xIntegryConfig.appAuth.extras={}),i.xIntegryConfig.appAuth.apiKey=(t||"").toString(),i.xIntegryConfig.appAuth.extras=n}const o={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:n,baseUrlv2:`${n}/v2`,baseAPIUrl:"https://api.integry.io",apiKey:i.xIntegryConfig?.appAuth?.apiKey,authId:i.xIntegryConfig?.appAuth?.authId,extras:i.xIntegryConfig?.appAuth?.extras},s=i.options||i.userConfig||{};if(i.options&&i.payloads&&(i.options.objects=e.payloads),"appKey"in i)t={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId},this.config={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId,deploymentId:i.deploymentId,userConfig:i.deploymentId?{...s,tags:s?.tags?[...s?.tags,`${i.deploymentId}`]:[`${i.deploymentId}`]}:s};else{const e=this.getAuthParamsFromUrl()||{};t={...o,...e},this.config={...o,...e,userConfig:i.userConfig}}this.authModalId=this.getRandomFlowId(6),this.apiHandler=new X(t),this.verifyAuthConfig().then((e=>{e?.config_verified?this.eventEmitter.emit("ready",{isReady:!0}):console.error("IntegrySDK: Auth config verification failed, are your auth parameters correct?")})).catch((e=>console.error(e))),this.initConfig={containerId:"",renderMode:oe.INLINE}}SDKFailedHandler=(e,t)=>{const n=e.options||e.userConfig||{},i=document.getElementById(t);throw i&&z(B`
7027
7015
  <${Il}
7028
7016
  message="SDK failed to load"
7029
7017
  debug=${n.debug}
7030
7018
  config=${n.debug?e:null}
7031
7019
  >
7032
7020
  <//>
7033
- `,i),new Error("IntegrySDK: SDK failed to load")};getRandomFlowId=e=>{const t=[],n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<e;i+=1)t.push(n.charAt(Math.floor(52*Math.random())));return`x-integry-modal-${t.join("")}`};getAuthParamsFromUrl=()=>{const e=ge()&&new URLSearchParams(window.location.search);if(e){const t=e.get("user_id"),n=e.get("app_key"),i=e.get("hash"),o=e.get("deployment_id");if(!(t&&n&&i&&o))throw new Error(`The following auth variables are undefined: ${t?"":"userId"} ${n?"":"appKey"} ${i?"":"hash"} ${o?"":"deploymentId"}`);return{userId:t,appKey:n,hash:i,deploymentId:o}}return{userId:"",appKey:"",hash:"",deploymentId:""}};printVersion=()=>{console.info(`@integry/sdk@${lp.SDK_VERSION}`)};setupFlowFormDestination=(e,t)=>{let n=null;if(t){if(e===oe.MODAL||e===oe.INLINE)throw new Error('The `templateContainerId` property is unsupported when render mode is set to "MODAL" or "INLINE"');n=document.getElementById(t),n||console.warn(`The template form render target with id ${t} was not found`)}switch(e){case oe.MODAL:return n=document.createElement("div"),n.id=this.getRandomFlowId(8),document.body.appendChild(n),n;case oe.INLINE:return null;case oe.DETACHED:case oe.CUSTOM:return n;default:throw new Error(`Unsupported renderMode ${e} configuration, please provide one of ${JSON.stringify(Object.keys(oe))}`)}};renderFlowSetupForm=e=>{const{flowId:t,flowContainerId:n,versionId:i,viewStyle:o}=e,s=document.getElementById(n);if(!s)return void console.warn(`Integry template form render target with id ${n} was not found`);let a=Number(t),l=this.config.integrationId||e.integrationId;l||(l=Number(ye("integrationId"))),a||(a=Number(ye("flowId")));const r=he();r.setState({integrationIdToEdit:l,userConfig:this.config.userConfig,genericData:{...pe.genericData,implicitAuthEnabled:!!this.config.xIntegryConfig?.appAuth?.apiKey,deploymentId:Number(this.config.deploymentId),isAnonymous:!!this.config.xIntegryConfig?.isAnonymous,viewStyle:o||ne.COMFORTABLE,testMultipurpose:!0,customFlowSetupRender:!0}}),z(B`
7021
+ `,i),new Error("IntegrySDK: SDK failed to load")};getRandomFlowId=e=>{const t=[],n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<e;i+=1)t.push(n.charAt(Math.floor(52*Math.random())));return`x-integry-modal-${t.join("")}`};getAuthParamsFromUrl=()=>{const e=ge()&&new URLSearchParams(window.location.search);if(e){const t=e.get("user_id"),n=e.get("app_key"),i=e.get("hash"),o=e.get("deployment_id");if(!(t&&n&&i&&o))throw new Error(`The following auth variables are undefined: ${t?"":"userId"} ${n?"":"appKey"} ${i?"":"hash"} ${o?"":"deploymentId"}`);return{userId:t,appKey:n,hash:i,deploymentId:o}}return{userId:"",appKey:"",hash:"",deploymentId:""}};printVersion=()=>{console.info(`@integry/sdk@${ap.SDK_VERSION}`)};setupFlowFormDestination=(e,t)=>{let n=null;if(t){if(e===oe.MODAL||e===oe.INLINE)throw new Error('The `templateContainerId` property is unsupported when render mode is set to "MODAL" or "INLINE"');n=document.getElementById(t),n||console.warn(`The template form render target with id ${t} was not found`)}switch(e){case oe.MODAL:return n=document.createElement("div"),n.id=this.getRandomFlowId(8),document.body.appendChild(n),n;case oe.INLINE:return null;case oe.DETACHED:case oe.CUSTOM:return n;default:throw new Error(`Unsupported renderMode ${e} configuration, please provide one of ${JSON.stringify(Object.keys(oe))}`)}};renderFlowSetupForm=e=>{const{flowId:t,flowContainerId:n,versionId:i,viewStyle:o}=e,s=document.getElementById(n);if(!s)return void console.warn(`Integry template form render target with id ${n} was not found`);let a=Number(t),l=this.config.integrationId||e.integrationId;l||(l=Number(ye("integrationId"))),a||(a=Number(ye("flowId")));const r=he();r.setState({integrationIdToEdit:l,userConfig:this.config.userConfig,genericData:{...pe.genericData,implicitAuthEnabled:!!this.config.xIntegryConfig?.appAuth?.apiKey,deploymentId:Number(this.config.deploymentId),isAnonymous:!!this.config.xIntegryConfig?.isAnonymous,viewStyle:o||ne.COMFORTABLE,testMultipurpose:!0,customFlowSetupRender:!0}}),z(B`
7034
7022
  <${re.Provider}
7035
7023
  value=${{apiHandler:this.apiHandler,eventEmitter:this.eventEmitter,isPreviewMode:!1}}
7036
7024
  >
@@ -7314,10 +7302,10 @@
7314
7302
  isReadOnly="${!1}"
7315
7303
  selectedAuthId="${t.connectedAccountId}"
7316
7304
  accountConnected=${!0}
7317
- tagsComponent=${ap}
7305
+ tagsComponent=${t.tagsComponent}
7318
7306
  onFieldChangeCallback=${t.onFieldChangeCallback}
7319
7307
  tagsTree=${t.tagsTree}
7320
7308
  />
7321
7309
  <//>
7322
7310
  <//>
7323
- </div>`,n)}else console.warn(`Integry SDK render target with id ${t.containerId} was not found`)}})();verifyAuthConfig=()=>this.apiHandler.verifyAuthConfig({deploymentId:this.config.deploymentId});getUserVariables=async()=>{try{const e=await this.apiHandler.getUserVariables();return e?e.results:[]}catch(e){return console.error(e),[]}};destroy=()=>{try{this.eventEmitter.offAll();const e=document.getElementById(this.authModalId);e&&e.remove()}catch(e){console.error("There was an error unsubscribing from all events")}};static setFieldValue=(e,t)=>{const n=document.getElementById(e)?.querySelector("input");if(n&&n instanceof HTMLInputElement){n.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});n.dispatchEvent(e)}const i=document.getElementById(`tagify_${e}`);if(i&&i instanceof HTMLInputElement){i.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});i.dispatchEvent(e)}};getMethod=()=>"POST";getBaseAPIUrl=()=>"https://api.integry.io";getHeaders=()=>({"Content-Type":"application/json"})}return lp.Helpers={getAuthHash:async function(e,t){const n=e=>new Uint8Array([...unescape(encodeURIComponent(e))].map((e=>e.charCodeAt(0)))),i=n(t),o=n(e),s=await crypto.subtle.importKey("raw",i,{name:"HMAC",hash:"SHA-256"},!0,["sign"]),a=await crypto.subtle.sign("HMAC",s,o);return[...new Uint8Array(a)].map((e=>e.toString(16).padStart(2,"0"))).join("")}},lp.html=B,lp}));
7311
+ </div>`,n)}else console.warn(`Integry SDK render target with id ${t.containerId} was not found`)}})();verifyAuthConfig=()=>this.apiHandler.verifyAuthConfig({deploymentId:this.config.deploymentId});getUserVariables=async()=>{try{const e=await this.apiHandler.getUserVariables();return e?e.results:[]}catch(e){return console.error(e),[]}};destroy=()=>{try{this.eventEmitter.offAll();const e=document.getElementById(this.authModalId);e&&e.remove()}catch(e){console.error("There was an error unsubscribing from all events")}};static setFieldValue=(e,t)=>{const n=document.getElementById(e)?.querySelector("input");if(n&&n instanceof HTMLInputElement){n.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});n.dispatchEvent(e)}const i=document.getElementById(`tagify_${e}`);if(i&&i instanceof HTMLInputElement){i.value=t;const e=new KeyboardEvent("keyup",{key:"a",bubbles:!0,cancelable:!0});i.dispatchEvent(e)}};getMethod=()=>"POST";getBaseAPIUrl=()=>"https://api.integry.io";getHeaders=()=>({"Content-Type":"application/json"})}return ap.Helpers={getAuthHash:async function(e,t){const n=e=>new Uint8Array([...unescape(encodeURIComponent(e))].map((e=>e.charCodeAt(0)))),i=n(t),o=n(e),s=await crypto.subtle.importKey("raw",i,{name:"HMAC",hash:"SHA-256"},!0,["sign"]),a=await crypto.subtle.sign("HMAC",s,o);return[...new Uint8Array(a)].map((e=>e.toString(16).padStart(2,"0"))).join("")}},ap.html=B,ap}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integry/sdk",
3
- "version": "4.5.17",
3
+ "version": "4.5.18",
4
4
  "description": "Integry SDK",
5
5
  "main": "dist/umd/index.umd.js",
6
6
  "module": "dist/esm/index.csm.js",
package/src/index.ts CHANGED
@@ -2018,7 +2018,7 @@ export class IntegryJS {
2018
2018
  isReadOnly="${false}"
2019
2019
  selectedAuthId="${options.connectedAccountId}"
2020
2020
  accountConnected=${true}
2021
- tagsComponent=${TestComponent}
2021
+ tagsComponent=${options.tagsComponent}
2022
2022
  onFieldChangeCallback=${options.onFieldChangeCallback}
2023
2023
  tagsTree=${options.tagsTree}
2024
2024
  />