@integry/sdk 4.5.27 → 4.5.28

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.
@@ -7010,26 +7010,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
7010
7010
  </div>
7011
7011
  </div>
7012
7012
  `}
7013
- `}});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`
7014
- <div>
7015
- ${Object.keys(o).map(((e,t,i)=>B`
7016
- <${_s}
7017
- objectKey="${e}"
7018
- keyValue="${e}"
7019
- objectData="${o[e]}"
7020
- onSelect=${n}
7021
- isRoot="${!0}"
7022
- />
7023
- `))}
7024
- </div>
7025
- `},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.27";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`
7013
+ `}});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.28";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`
7026
7014
  <${Il}
7027
7015
  message="SDK failed to load"
7028
7016
  debug=${n.debug}
7029
7017
  config=${n.debug?e:null}
7030
7018
  >
7031
7019
  <//>
7032
- `,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`
7020
+ `,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`
7033
7021
  <${re.Provider}
7034
7022
  value=${{apiHandler:this.apiHandler,eventEmitter:this.eventEmitter,isPreviewMode:!1}}
7035
7023
  >
@@ -7313,10 +7301,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
7313
7301
  isReadOnly="${!1}"
7314
7302
  selectedAuthId="${t.connectedAccountId}"
7315
7303
  accountConnected=${!0}
7316
- tagsComponent=${ap}
7304
+ tagsComponent=${t.tagsComponent}
7317
7305
  onFieldChangeCallback=${t.onFieldChangeCallback}
7318
7306
  tagsTree=${t.tagsTree}
7319
7307
  />
7320
7308
  <//>
7321
7309
  <//>
7322
- </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};
7310
+ </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};
@@ -7010,26 +7010,14 @@
7010
7010
  </div>
7011
7011
  </div>
7012
7012
  `}
7013
- `}});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`
7014
- <div>
7015
- ${Object.keys(o).map(((e,t,i)=>B`
7016
- <${_s}
7017
- objectKey="${e}"
7018
- keyValue="${e}"
7019
- objectData="${o[e]}"
7020
- onSelect=${n}
7021
- isRoot="${!0}"
7022
- />
7023
- `))}
7024
- </div>
7025
- `};class lp{static SDK_VERSION="4.5.27";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`
7013
+ `}});class ap{static SDK_VERSION="4.5.28";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`
7026
7014
  <${Il}
7027
7015
  message="SDK failed to load"
7028
7016
  debug=${n.debug}
7029
7017
  config=${n.debug?e:null}
7030
7018
  >
7031
7019
  <//>
7032
- `,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`
7020
+ `,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`
7033
7021
  <${re.Provider}
7034
7022
  value=${{apiHandler:this.apiHandler,eventEmitter:this.eventEmitter,isPreviewMode:!1}}
7035
7023
  >
@@ -7313,10 +7301,10 @@
7313
7301
  isReadOnly="${!1}"
7314
7302
  selectedAuthId="${t.connectedAccountId}"
7315
7303
  accountConnected=${!0}
7316
- tagsComponent=${ap}
7304
+ tagsComponent=${t.tagsComponent}
7317
7305
  onFieldChangeCallback=${t.onFieldChangeCallback}
7318
7306
  tagsTree=${t.tagsTree}
7319
7307
  />
7320
7308
  <//>
7321
7309
  <//>
7322
- </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}));
7310
+ </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.27",
3
+ "version": "4.5.28",
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
  />