@stackone/connect-sdk 1.14.0 → 1.16.0

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/dist/index.es.mjs CHANGED
@@ -1 +1 @@
1
- import{StepFunctionsFactory as t,StepFunctionName as e,AUTHENTICATION_SCHEMA as r}from"@stackone/core";import{safeEvaluate as o}from"@stackone/expressions";import{notMissing as n,isString as i,isMissing as s}from"@stackone/utils";import{HttpClientManager as a}from"@stackone/transport";import{match as c}from"path-to-regexp";import{parse as p}from"yaml";import{z as u}from"zod";const l=async({block:r,stepFunctionName:o,params:n,buildStepFunction:i=t.build})=>{const s=i({functionName:o}).fn,a=await s({block:r,params:n}),c=o===e.MAP_FIELDS?{[e.MAP_FIELDS.toString()]:{output:{data:a.block.result},errors:a.errors,successful:a.successful}}:{};return{...a.block,steps:{...a?.block?.steps??{},...c}}},d=async({block:e,buildStepFunction:r=t.build})=>{const n=e.operation?.steps||[];let i={...e};const s=Object.keys(n);for(const t of s){const e=n[t].stepFunction,o=r({functionName:e.functionName,version:e.version,validateSchemas:!0}).fn,s=await o({block:i,params:e.params});i={...s.block,steps:{...s.block.steps,[t]:{successful:s.successful,errors:s.errors,output:s.output}}}}const a=e.operation?.result?o(e.operation.result,i):void 0;return{...i,outputs:a}},g=async({inputs:t,context:e,operation:r,credentials:o,logger:n,getHttpClient:i=async()=>a.getInstance()})=>({inputs:t,fieldConfigs:[],context:e,operation:r,credentials:o,httpClient:await i(),logger:n}),y=({category:t,connectorKey:e,connectorVersion:r,authConfigKey:o,environment:n="production",operation:i,accountSecureId:s,projectSecureId:a})=>({projectSecureId:a,accountSecureId:s,connectorKey:e,connectorVersion:r,category:t,service:"",resource:"",schema:i?.schema?.key,operationType:i?.operationType??"unknown",authenticationType:o,environment:n}),m=(t,e,r)=>{const o=r.toUpperCase();if(!t.operations)return;const n=Object.keys(t.operations),i=h(e,o,n);return i?{operation:t.operations?.[i.path],params:i.params}:void 0},f=t=>{const e=t.startsWith("/")?t.slice(1):t;return e.endsWith("/")?e.slice(0,-1):e},h=(t,e,r)=>{const o=f(t);for(const t of r)if(t.startsWith(e)){const r=t.replace(`${e} `,"").trim(),n=c(f(r))(f(o));if(!1!==n)return{path:t,params:n.params}}},b=u.object({key:u.string(),label:u.string(),type:u.string(),required:u.boolean().optional(),secret:u.boolean().optional(),placeholder:u.string().optional(),description:u.string().optional(),tooltip:u.string().optional()}),k=u.object({operationId:u.string(),categories:u.string().array(),operationType:u.string(),schema:u.string().optional(),entrypointUrl:u.string().optional(),entrypointHttpMethod:u.string().optional(),description:u.string(),inputs:u.object({name:u.string(),type:u.string(),required:u.boolean(),description:u.string(),in:u.string()}).array().optional(),fieldConfigs:u.object({targetFieldKey:u.string(),expression:u.string(),type:u.enum(["string","number","boolean","datetime_string","enum"]),isUnified:u.boolean(),enumMapper:u.object({matcher:u.string().or(u.object({matchExpression:u.string(),value:u.string()}).array())}).optional()}).array(),steps:u.object({stepId:u.string(),description:u.string(),stepFunction:u.object({functionName:u.string(),version:u.string().optional(),parameters:u.record(u.string(),u.unknown())})}).array(),result:u.string()}),I=u.object({StackOne:u.string(),info:u.object({title:u.string(),version:u.string(),key:u.string(),description:u.string().optional()}),baseUrl:u.string(),authentication:u.record(u.string(),u.object({type:u.string(),label:u.string(),authorization:r,environments:u.object({key:u.string(),name:u.string()}).array(),support:u.object({link:u.string(),description:u.string().optional()}),configFields:b.array().optional(),setupFields:b.array().optional(),testOperationsIds:u.string().array().optional()})).array().optional(),operations:k.array().optional()});function v(t){try{const e=p(t),r=I.parse(e),o={title:r.info.title,version:r.info.version,key:r.info.key,description:r.info.description},i=E(r),s={baseUrl:r.baseUrl,authentication:j(i)},a=S(r,s);return o.operations=a,o.authentication=i,n(a)&&(o.categories=F(Object.values(a))),o}catch(t){throw new Error(`Error parsing YAML file: ${t.message}`)}}const j=t=>{const e={};for(const[r,o]of Object.entries(t))if(o&&"object"==typeof o){const{setupFields:t,configFields:n,support:i,testOperationsIds:s,...a}=o;e[r]=j(a)}else e[r]=o;return e},F=t=>{const e=t.reduce(((t,e)=>{for(const r of e.categories)t.add(r);return t}),new Set);return Array.from(e)},E=t=>{const e={};for(const r of t.authentication??[]){const[t]=Object.keys(r),o=r[t].environments.reduce(((e,o)=>{const{key:n,name:i}=o,{environments:s,...a}=r[t];return e[n]={...a,envKey:n,envName:i},e}),{});e[t]=o}return e},S=(t,e)=>{const r=t.operations?.reduce(((t,r)=>{const o=(t=>t.entrypointUrl&&t.entrypointHttpMethod?`${t.entrypointHttpMethod.toUpperCase()} ${t.entrypointUrl}`:void 0)(r),n=(t=>"list"===t.operationType?`GET /${t.schema}`:`GET /${t.schema}/:id`)(r),i=(t=>"list"===t.operationType?`/${t.schema}`:`/${t.schema}/:id`)(r);return t[o??n]={id:r.operationId,categories:r.categories,description:r.description,operationType:r.operationType,entrypointUrl:r.entrypointUrl??i,entrypointHttpMethod:r.entrypointHttpMethod??"get",inputs:r.inputs,steps:r.steps.reduce(((t,o)=>(t[o.stepId]={id:o.stepId,description:o.description,stepFunction:{functionName:o.stepFunction.functionName,version:o.stepFunction.version,params:{..."request"===o.stepFunction.functionName?e:{},..."map_fields"===o.stepFunction.functionName||"typecast"===o.stepFunction.functionName?{fields:r.fieldConfigs}:{},...o.stepFunction.parameters}}},t)),{}),result:r.result},t}),{});return r},O=(t,e)=>{if(!t.inputs)return{};const r=T(t.inputs).parse(e);return{...r.headers??{},...r.query??{},...r.path??{},...r.body??{}}},w=t=>{const e={};return t.forEach((t=>{let r;switch(t.type.toLowerCase()){case"string":r=u.string();break;case"number":r=u.number();break;case"boolean":r=u.boolean();break;default:r=u.any()}e[t.name]=t.required?r:r.optional()})),u.object(e)},T=t=>{const e=t.filter((t=>"path"===t.in)),r=t.filter((t=>"query"===t.in)),o=t.filter((t=>"body"===t.in)),n=t.filter((t=>"headers"===t.in));return u.object({path:w(e).optional(),query:w(r).optional(),body:w(o).optional(),headers:w(n).optional()})};class N extends Error{constructor(t,e,r){super(r),this.name="ConnectSDKError",this.errorType=t,this.context=e,Error.captureStackTrace&&Error.captureStackTrace(this,N)}toString(){return`${this.name} [${this.errorType}]: ${this.message}`}}class C extends N{constructor(t,e){super("CONNECTOR_PARSE_ERROR",t,e),this.name="ConnectorParseError"}}class x extends N{constructor(t,e){super("MISSING_OPERATION_ERROR",t,e),this.name="MissingOperationError"}}class R extends N{constructor(t,e){super("INVALID_OPERATION_INPUTS_ERROR",t,e),this.name="InvalidOperationInputsError"}}const U=async({account:t,connector:e,category:r,path:o,method:n="get",queryParams:a,logger:c,parseConnector:p=v,getOperationFromUrlFn:u=m,parseOperationInputsFn:l=O,createBlockContextFn:f=y,createBlockFn:h=g,runStepOperationFn:b=d})=>{const k=t.authConfigKey,I=t.environment??"production",j=t.secureId,F=t.projectSecureId,E=t.credentials,S=f({category:r,connectorKey:t.providerKey,connectorVersion:t.providerVersion,authConfigKey:k,environment:I,accountSecureId:j,projectSecureId:F});let w;try{w=i(e)?p(e):e}catch{throw new C(S,"Error while parsing connector")}const T=u(w,o,n);if(s(T))throw new x(S,"No matching operation found");let N;S.operationType=T.operation.operationType,S.schema=T.operation.schema?.key;try{N=l(T.operation,{query:a,path:T.params})}catch{throw new R(S,"Error while parsing operation inputs")}const U=await h({inputs:N,context:S,operation:T.operation,credentials:E,logger:c});return await b({block:U})};export{N as ConnectSDKError,g as createBlock,l as executeStepFunction,m as getOperationFromUrl,O as parseOperationInputs,v as parseYamlConnector,U as runConnectorOperation,d as runStepOperation};
1
+ import{StepFunctionsFactory as t,StepFunctionName as e,AUTHENTICATION_SCHEMA as o}from"@stackone/core";import{safeEvaluate as n}from"@stackone/expressions";import{notMissing as r,isString as i,isMissing as s}from"@stackone/utils";import{HttpClientManager as a}from"@stackone/transport";import{match as c}from"path-to-regexp";import{parse as p}from"yaml";import{z as u}from"zod";const l=async({block:o,stepFunctionName:n,params:r,buildStepFunction:i=t.build})=>{const s=i({functionName:n}).fn,a=await s({block:o,params:r}),c=n===e.MAP_FIELDS?{[e.MAP_FIELDS.toString()]:{output:{data:a.block.result},errors:a.errors,successful:a.successful}}:{};return{...a.block,steps:{...a?.block?.steps??{},...c}}},y=async({block:e,buildStepFunction:o=t.build})=>{const r=e.operation?.steps||[];let i={...e};const s=Object.keys(r);for(const t of s){const e=r[t].stepFunction,n=o({functionName:e.functionName,version:e.version,validateSchemas:!0}).fn,s=await n({block:i,params:e.params});i={...s.block,steps:{...s.block.steps,[t]:{successful:s.successful,errors:s.errors,output:s.output}}}}const a=e.operation?.result?n(e.operation.result,i):void 0;return{...i,outputs:a}},d=async({inputs:t,context:e,operation:o,credentials:n,logger:r,getHttpClient:i=async()=>a.getInstance()})=>({inputs:t,fieldConfigs:[],context:e,operation:o,credentials:n,httpClient:await i(),logger:r}),m=({category:t,connectorKey:e,connectorVersion:o,authConfigKey:n,environment:r="production",operation:i,accountSecureId:s,projectSecureId:a})=>({projectSecureId:a,accountSecureId:s,connectorKey:e,connectorVersion:o,category:t,service:"",resource:"",schema:i?.schema?.key,operationType:i?.operationType??"unknown",authenticationType:n,environment:r}),g=(t,e,o)=>{const n=o.toUpperCase();if(!t.operations)return;const r=Object.keys(t.operations),i=_(e,n,r);return i?{operation:t.operations?.[i.path],params:i.params}:void 0},h=t=>{const e=t.startsWith("/")?t.slice(1):t;return e.endsWith("/")?e.slice(0,-1):e},_=(t,e,o)=>{const n=h(t);for(const t of o)if(t.startsWith(e)){const o=t.replace(`${e} `,"").trim(),r=c(h(o))(h(n));if(!1!==r)return{path:t,params:r.params}}},b=u.object({key:u.string(),label:u.string(),type:u.string(),required:u.boolean().optional(),secret:u.boolean().optional(),placeholder:u.string().optional(),description:u.string().optional(),tooltip:u.string().optional()}),f=u.object({operationId:u.string(),categories:u.string().array(),operationType:u.string(),schema:u.string().optional(),entrypointUrl:u.string().optional(),entrypointHttpMethod:u.string().optional(),description:u.string(),inputs:u.object({name:u.string(),type:u.string(),required:u.boolean(),description:u.string(),in:u.string()}).array().optional(),fieldConfigs:u.object({targetFieldKey:u.string(),expression:u.string(),type:u.enum(["string","number","boolean","datetime_string","enum"]),isUnified:u.boolean(),enumMapper:u.object({matcher:u.enum(["country_alpha2code_by_alpha2code","country_alpha3code_by_alpha3code","country_code_by_country_code","country_name_by_country_name","country_name_by_alpha3code","country_name_by_alpha2code","country_name_by_country_code","country_alpha3code_by_alpha2code","country_alpha3code_by_country_name","country_alpha3code_by_country_code","country_alpha2code_by_alpha3code","country_alpha2code_by_country_name","country_alpha2code_by_country_code","country_code_by_alpha2code","country_code_by_alpha3code","country_code_by_country_name","country_subdivisions_by_alpha2code","country_subdivision_code_by_subdivision_name","country_alpha2code_by_citizenship","country_subdivision_name_by_subdivision_code"]).or(u.object({matchExpression:u.string(),value:u.string()}).array())}).optional()}).array(),steps:u.object({stepId:u.string(),description:u.string(),stepFunction:u.object({functionName:u.string(),version:u.string().optional(),parameters:u.record(u.string(),u.unknown())})}).array(),result:u.string()}),k=u.object({StackOne:u.string(),info:u.object({title:u.string(),version:u.string(),key:u.string(),description:u.string().optional()}),baseUrl:u.string(),authentication:u.record(u.string(),u.object({type:u.string(),label:u.string(),authorization:o,environments:u.object({key:u.string(),name:u.string()}).array(),support:u.object({link:u.string(),description:u.string().optional()}),configFields:b.array().optional(),setupFields:b.array().optional(),testOperationsIds:u.string().array().optional()})).array().optional(),operations:f.array().optional()});function v(t){try{const e=p(t),o=k.parse(e),n={title:o.info.title,version:o.info.version,key:o.info.key,description:o.info.description},i=F(o),s={baseUrl:o.baseUrl,authentication:I(i)},a=E(o,s);return n.operations=a,n.authentication=i,r(a)&&(n.categories=j(Object.values(a))),n}catch(t){throw new Error(`Error parsing YAML file: ${t.message}`)}}const I=t=>{const e={};for(const[o,n]of Object.entries(t))if(n&&"object"==typeof n){const{setupFields:t,configFields:r,support:i,testOperationsIds:s,...a}=n;e[o]=I(a)}else e[o]=n;return e},j=t=>{const e=t.reduce(((t,e)=>{for(const o of e.categories)t.add(o);return t}),new Set);return Array.from(e)},F=t=>{const e={};for(const o of t.authentication??[]){const[t]=Object.keys(o),n=o[t].environments.reduce(((e,n)=>{const{key:r,name:i}=n,{environments:s,...a}=o[t];return e[r]={...a,envKey:r,envName:i},e}),{});e[t]=n}return e},E=(t,e)=>{const o=t.operations?.reduce(((t,o)=>{const n=(t=>t.entrypointUrl&&t.entrypointHttpMethod?`${t.entrypointHttpMethod.toUpperCase()} ${t.entrypointUrl}`:void 0)(o),r=(t=>"list"===t.operationType?`GET /${t.schema}`:`GET /${t.schema}/:id`)(o),i=(t=>"list"===t.operationType?`/${t.schema}`:`/${t.schema}/:id`)(o);return t[n??r]={id:o.operationId,categories:o.categories,description:o.description,operationType:o.operationType,entrypointUrl:o.entrypointUrl??i,entrypointHttpMethod:o.entrypointHttpMethod??"get",inputs:o.inputs,steps:o.steps.reduce(((t,n)=>(t[n.stepId]={id:n.stepId,description:n.description,stepFunction:{functionName:n.stepFunction.functionName,version:n.stepFunction.version,params:{..."request"===n.stepFunction.functionName?e:{},..."map_fields"===n.stepFunction.functionName||"typecast"===n.stepFunction.functionName?{fields:o.fieldConfigs}:{},...n.stepFunction.parameters}}},t)),{}),result:o.result},t}),{});return o},S=(t,e)=>{if(!t.inputs)return{};const o=w(t.inputs).parse(e);return{...o.headers??{},...o.query??{},...o.path??{},...o.body??{}}},O=t=>{const e={};return t.forEach((t=>{let o;switch(t.type.toLowerCase()){case"string":o=u.string();break;case"number":o=u.number();break;case"boolean":o=u.boolean();break;default:o=u.any()}e[t.name]=t.required?o:o.optional()})),u.object(e)},w=t=>{const e=t.filter((t=>"path"===t.in)),o=t.filter((t=>"query"===t.in)),n=t.filter((t=>"body"===t.in)),r=t.filter((t=>"headers"===t.in));return u.object({path:O(e).optional(),query:O(o).optional(),body:O(n).optional(),headers:O(r).optional()})};class T extends Error{constructor(t,e,o){super(o),this.name="ConnectSDKError",this.errorType=t,this.context=e,Error.captureStackTrace&&Error.captureStackTrace(this,T)}toString(){return`${this.name} [${this.errorType}]: ${this.message}`}}class N extends T{constructor(t,e){super("CONNECTOR_PARSE_ERROR",t,e),this.name="ConnectorParseError"}}class C extends T{constructor(t,e){super("MISSING_OPERATION_ERROR",t,e),this.name="MissingOperationError"}}class x extends T{constructor(t,e){super("INVALID_OPERATION_INPUTS_ERROR",t,e),this.name="InvalidOperationInputsError"}}const R=async({account:t,connector:e,category:o,path:n,method:r="get",queryParams:a,logger:c,parseConnector:p=v,getOperationFromUrlFn:u=g,parseOperationInputsFn:l=S,createBlockContextFn:h=m,createBlockFn:_=d,runStepOperationFn:b=y})=>{const f=t.authConfigKey,k=t.environment??"production",I=t.secureId,j=t.projectSecureId,F=t.credentials,E=h({category:o,connectorKey:t.providerKey,connectorVersion:t.providerVersion,authConfigKey:f,environment:k,accountSecureId:I,projectSecureId:j});let O;try{O=i(e)?p(e):e}catch{throw new N(E,"Error while parsing connector")}const w=u(O,n,r);if(s(w))throw new C(E,"No matching operation found");let T;E.operationType=w.operation.operationType,E.schema=w.operation.schema?.key;try{T=l(w.operation,{query:a,path:w.params})}catch{throw new x(E,"Error while parsing operation inputs")}const R=await _({inputs:T,context:E,operation:w.operation,credentials:F,logger:c});return await b({block:R})};export{T as ConnectSDKError,d as createBlock,l as executeStepFunction,g as getOperationFromUrl,S as parseOperationInputs,v as parseYamlConnector,R as runConnectorOperation,y as runStepOperation};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var t=require("@stackone/core"),e=require("@stackone/expressions"),r=require("@stackone/utils"),n=require("@stackone/transport"),o=require("path-to-regexp"),i=require("yaml"),s=require("zod");const a=async({block:r,buildStepFunction:n=t.StepFunctionsFactory.build})=>{const o=r.operation?.steps||[];let i={...r};const s=Object.keys(o);for(const t of s){const e=o[t].stepFunction,r=n({functionName:e.functionName,version:e.version,validateSchemas:!0}).fn,s=await r({block:i,params:e.params});i={...s.block,steps:{...s.block.steps,[t]:{successful:s.successful,errors:s.errors,output:s.output}}}}const a=r.operation?.result?e.safeEvaluate(r.operation.result,i):void 0;return{...i,outputs:a}},c=async({inputs:t,context:e,operation:r,credentials:o,logger:i,getHttpClient:s=async()=>n.HttpClientManager.getInstance()})=>({inputs:t,fieldConfigs:[],context:e,operation:r,credentials:o,httpClient:await s(),logger:i}),p=({category:t,connectorKey:e,connectorVersion:r,authConfigKey:n,environment:o="production",operation:i,accountSecureId:s,projectSecureId:a})=>({projectSecureId:a,accountSecureId:s,connectorKey:e,connectorVersion:r,category:t,service:"",resource:"",schema:i?.schema?.key,operationType:i?.operationType??"unknown",authenticationType:n,environment:o}),u=(t,e,r)=>{const n=r.toUpperCase();if(!t.operations)return;const o=Object.keys(t.operations),i=d(e,n,o);return i?{operation:t.operations?.[i.path],params:i.params}:void 0},l=t=>{const e=t.startsWith("/")?t.slice(1):t;return e.endsWith("/")?e.slice(0,-1):e},d=(t,e,r)=>{const n=l(t);for(const t of r)if(t.startsWith(e)){const r=t.replace(`${e} `,"").trim(),i=o.match(l(r))(l(n));if(!1!==i)return{path:t,params:i.params}}},g=s.z.object({key:s.z.string(),label:s.z.string(),type:s.z.string(),required:s.z.boolean().optional(),secret:s.z.boolean().optional(),placeholder:s.z.string().optional(),description:s.z.string().optional(),tooltip:s.z.string().optional()}),y=s.z.object({operationId:s.z.string(),categories:s.z.string().array(),operationType:s.z.string(),schema:s.z.string().optional(),entrypointUrl:s.z.string().optional(),entrypointHttpMethod:s.z.string().optional(),description:s.z.string(),inputs:s.z.object({name:s.z.string(),type:s.z.string(),required:s.z.boolean(),description:s.z.string(),in:s.z.string()}).array().optional(),fieldConfigs:s.z.object({targetFieldKey:s.z.string(),expression:s.z.string(),type:s.z.enum(["string","number","boolean","datetime_string","enum"]),isUnified:s.z.boolean(),enumMapper:s.z.object({matcher:s.z.string().or(s.z.object({matchExpression:s.z.string(),value:s.z.string()}).array())}).optional()}).array(),steps:s.z.object({stepId:s.z.string(),description:s.z.string(),stepFunction:s.z.object({functionName:s.z.string(),version:s.z.string().optional(),parameters:s.z.record(s.z.string(),s.z.unknown())})}).array(),result:s.z.string()}),m=s.z.object({StackOne:s.z.string(),info:s.z.object({title:s.z.string(),version:s.z.string(),key:s.z.string(),description:s.z.string().optional()}),baseUrl:s.z.string(),authentication:s.z.record(s.z.string(),s.z.object({type:s.z.string(),label:s.z.string(),authorization:t.AUTHENTICATION_SCHEMA,environments:s.z.object({key:s.z.string(),name:s.z.string()}).array(),support:s.z.object({link:s.z.string(),description:s.z.string().optional()}),configFields:g.array().optional(),setupFields:g.array().optional(),testOperationsIds:s.z.string().array().optional()})).array().optional(),operations:y.array().optional()});function z(t){try{const e=i.parse(t),n=m.parse(e),o={title:n.info.title,version:n.info.version,key:n.info.key,description:n.info.description},s=b(n),a={baseUrl:n.baseUrl,authentication:h(s)},c=k(n,a);return o.operations=c,o.authentication=s,r.notMissing(c)&&(o.categories=f(Object.values(c))),o}catch(t){throw new Error(`Error parsing YAML file: ${t.message}`)}}const h=t=>{const e={};for(const[r,n]of Object.entries(t))if(n&&"object"==typeof n){const{setupFields:t,configFields:o,support:i,testOperationsIds:s,...a}=n;e[r]=h(a)}else e[r]=n;return e},f=t=>{const e=t.reduce(((t,e)=>{for(const r of e.categories)t.add(r);return t}),new Set);return Array.from(e)},b=t=>{const e={};for(const r of t.authentication??[]){const[t]=Object.keys(r),n=r[t].environments.reduce(((e,n)=>{const{key:o,name:i}=n,{environments:s,...a}=r[t];return e[o]={...a,envKey:o,envName:i},e}),{});e[t]=n}return e},k=(t,e)=>{const r=t.operations?.reduce(((t,r)=>{const n=(t=>t.entrypointUrl&&t.entrypointHttpMethod?`${t.entrypointHttpMethod.toUpperCase()} ${t.entrypointUrl}`:void 0)(r),o=(t=>"list"===t.operationType?`GET /${t.schema}`:`GET /${t.schema}/:id`)(r),i=(t=>"list"===t.operationType?`/${t.schema}`:`/${t.schema}/:id`)(r);return t[n??o]={id:r.operationId,categories:r.categories,description:r.description,operationType:r.operationType,entrypointUrl:r.entrypointUrl??i,entrypointHttpMethod:r.entrypointHttpMethod??"get",inputs:r.inputs,steps:r.steps.reduce(((t,n)=>(t[n.stepId]={id:n.stepId,description:n.description,stepFunction:{functionName:n.stepFunction.functionName,version:n.stepFunction.version,params:{..."request"===n.stepFunction.functionName?e:{},..."map_fields"===n.stepFunction.functionName||"typecast"===n.stepFunction.functionName?{fields:r.fieldConfigs}:{},...n.stepFunction.parameters}}},t)),{}),result:r.result},t}),{});return r},F=(t,e)=>{if(!t.inputs)return{};const r=I(t.inputs).parse(e);return{...r.headers??{},...r.query??{},...r.path??{},...r.body??{}}},S=t=>{const e={};return t.forEach((t=>{let r;switch(t.type.toLowerCase()){case"string":r=s.z.string();break;case"number":r=s.z.number();break;case"boolean":r=s.z.boolean();break;default:r=s.z.any()}e[t.name]=t.required?r:r.optional()})),s.z.object(e)},I=t=>{const e=t.filter((t=>"path"===t.in)),r=t.filter((t=>"query"===t.in)),n=t.filter((t=>"body"===t.in)),o=t.filter((t=>"headers"===t.in));return s.z.object({path:S(e).optional(),query:S(r).optional(),body:S(n).optional(),headers:S(o).optional()})};class v extends Error{constructor(t,e,r){super(r),this.name="ConnectSDKError",this.errorType=t,this.context=e,Error.captureStackTrace&&Error.captureStackTrace(this,v)}toString(){return`${this.name} [${this.errorType}]: ${this.message}`}}class E extends v{constructor(t,e){super("CONNECTOR_PARSE_ERROR",t,e),this.name="ConnectorParseError"}}class O extends v{constructor(t,e){super("MISSING_OPERATION_ERROR",t,e),this.name="MissingOperationError"}}class j extends v{constructor(t,e){super("INVALID_OPERATION_INPUTS_ERROR",t,e),this.name="InvalidOperationInputsError"}}exports.ConnectSDKError=v,exports.createBlock=c,exports.executeStepFunction=async({block:e,stepFunctionName:r,params:n,buildStepFunction:o=t.StepFunctionsFactory.build})=>{const i=o({functionName:r}).fn,s=await i({block:e,params:n}),a=r===t.StepFunctionName.MAP_FIELDS?{[t.StepFunctionName.MAP_FIELDS.toString()]:{output:{data:s.block.result},errors:s.errors,successful:s.successful}}:{};return{...s.block,steps:{...s?.block?.steps??{},...a}}},exports.getOperationFromUrl=u,exports.parseOperationInputs=F,exports.parseYamlConnector=z,exports.runConnectorOperation=async({account:t,connector:e,category:n,path:o,method:i="get",queryParams:s,logger:l,parseConnector:d=z,getOperationFromUrlFn:g=u,parseOperationInputsFn:y=F,createBlockContextFn:m=p,createBlockFn:h=c,runStepOperationFn:f=a})=>{const b=t.authConfigKey,k=t.environment??"production",S=t.secureId,I=t.projectSecureId,v=t.credentials,C=m({category:n,connectorKey:t.providerKey,connectorVersion:t.providerVersion,authConfigKey:b,environment:k,accountSecureId:S,projectSecureId:I});let N;try{N=r.isString(e)?d(e):e}catch{throw new E(C,"Error while parsing connector")}const T=g(N,o,i);if(r.isMissing(T))throw new O(C,"No matching operation found");let x;C.operationType=T.operation.operationType,C.schema=T.operation.schema?.key;try{x=y(T.operation,{query:s,path:T.params})}catch{throw new j(C,"Error while parsing operation inputs")}const w=await h({inputs:x,context:C,operation:T.operation,credentials:v,logger:l});return await f({block:w})},exports.runStepOperation=a;
1
+ "use strict";var e=require("@stackone/core"),t=require("@stackone/expressions"),o=require("@stackone/utils"),n=require("@stackone/transport"),r=require("path-to-regexp"),i=require("yaml"),s=require("zod");const a=async({block:o,buildStepFunction:n=e.StepFunctionsFactory.build})=>{const r=o.operation?.steps||[];let i={...o};const s=Object.keys(r);for(const e of s){const t=r[e].stepFunction,o=n({functionName:t.functionName,version:t.version,validateSchemas:!0}).fn,s=await o({block:i,params:t.params});i={...s.block,steps:{...s.block.steps,[e]:{successful:s.successful,errors:s.errors,output:s.output}}}}const a=o.operation?.result?t.safeEvaluate(o.operation.result,i):void 0;return{...i,outputs:a}},c=async({inputs:e,context:t,operation:o,credentials:r,logger:i,getHttpClient:s=async()=>n.HttpClientManager.getInstance()})=>({inputs:e,fieldConfigs:[],context:t,operation:o,credentials:r,httpClient:await s(),logger:i}),p=({category:e,connectorKey:t,connectorVersion:o,authConfigKey:n,environment:r="production",operation:i,accountSecureId:s,projectSecureId:a})=>({projectSecureId:a,accountSecureId:s,connectorKey:t,connectorVersion:o,category:e,service:"",resource:"",schema:i?.schema?.key,operationType:i?.operationType??"unknown",authenticationType:n,environment:r}),u=(e,t,o)=>{const n=o.toUpperCase();if(!e.operations)return;const r=Object.keys(e.operations),i=y(t,n,r);return i?{operation:e.operations?.[i.path],params:i.params}:void 0},l=e=>{const t=e.startsWith("/")?e.slice(1):e;return t.endsWith("/")?t.slice(0,-1):t},y=(e,t,o)=>{const n=l(e);for(const e of o)if(e.startsWith(t)){const o=e.replace(`${t} `,"").trim(),i=r.match(l(o))(l(n));if(!1!==i)return{path:e,params:i.params}}},d=s.z.object({key:s.z.string(),label:s.z.string(),type:s.z.string(),required:s.z.boolean().optional(),secret:s.z.boolean().optional(),placeholder:s.z.string().optional(),description:s.z.string().optional(),tooltip:s.z.string().optional()}),g=s.z.object({operationId:s.z.string(),categories:s.z.string().array(),operationType:s.z.string(),schema:s.z.string().optional(),entrypointUrl:s.z.string().optional(),entrypointHttpMethod:s.z.string().optional(),description:s.z.string(),inputs:s.z.object({name:s.z.string(),type:s.z.string(),required:s.z.boolean(),description:s.z.string(),in:s.z.string()}).array().optional(),fieldConfigs:s.z.object({targetFieldKey:s.z.string(),expression:s.z.string(),type:s.z.enum(["string","number","boolean","datetime_string","enum"]),isUnified:s.z.boolean(),enumMapper:s.z.object({matcher:s.z.enum(["country_alpha2code_by_alpha2code","country_alpha3code_by_alpha3code","country_code_by_country_code","country_name_by_country_name","country_name_by_alpha3code","country_name_by_alpha2code","country_name_by_country_code","country_alpha3code_by_alpha2code","country_alpha3code_by_country_name","country_alpha3code_by_country_code","country_alpha2code_by_alpha3code","country_alpha2code_by_country_name","country_alpha2code_by_country_code","country_code_by_alpha2code","country_code_by_alpha3code","country_code_by_country_name","country_subdivisions_by_alpha2code","country_subdivision_code_by_subdivision_name","country_alpha2code_by_citizenship","country_subdivision_name_by_subdivision_code"]).or(s.z.object({matchExpression:s.z.string(),value:s.z.string()}).array())}).optional()}).array(),steps:s.z.object({stepId:s.z.string(),description:s.z.string(),stepFunction:s.z.object({functionName:s.z.string(),version:s.z.string().optional(),parameters:s.z.record(s.z.string(),s.z.unknown())})}).array(),result:s.z.string()}),h=s.z.object({StackOne:s.z.string(),info:s.z.object({title:s.z.string(),version:s.z.string(),key:s.z.string(),description:s.z.string().optional()}),baseUrl:s.z.string(),authentication:s.z.record(s.z.string(),s.z.object({type:s.z.string(),label:s.z.string(),authorization:e.AUTHENTICATION_SCHEMA,environments:s.z.object({key:s.z.string(),name:s.z.string()}).array(),support:s.z.object({link:s.z.string(),description:s.z.string().optional()}),configFields:d.array().optional(),setupFields:d.array().optional(),testOperationsIds:s.z.string().array().optional()})).array().optional(),operations:g.array().optional()});function m(e){try{const t=i.parse(e),n=h.parse(t),r={title:n.info.title,version:n.info.version,key:n.info.key,description:n.info.description},s=z(n),a={baseUrl:n.baseUrl,authentication:_(s)},c=f(n,a);return r.operations=c,r.authentication=s,o.notMissing(c)&&(r.categories=b(Object.values(c))),r}catch(e){throw new Error(`Error parsing YAML file: ${e.message}`)}}const _=e=>{const t={};for(const[o,n]of Object.entries(e))if(n&&"object"==typeof n){const{setupFields:e,configFields:r,support:i,testOperationsIds:s,...a}=n;t[o]=_(a)}else t[o]=n;return t},b=e=>{const t=e.reduce(((e,t)=>{for(const o of t.categories)e.add(o);return e}),new Set);return Array.from(t)},z=e=>{const t={};for(const o of e.authentication??[]){const[e]=Object.keys(o),n=o[e].environments.reduce(((t,n)=>{const{key:r,name:i}=n,{environments:s,...a}=o[e];return t[r]={...a,envKey:r,envName:i},t}),{});t[e]=n}return t},f=(e,t)=>{const o=e.operations?.reduce(((e,o)=>{const n=(e=>e.entrypointUrl&&e.entrypointHttpMethod?`${e.entrypointHttpMethod.toUpperCase()} ${e.entrypointUrl}`:void 0)(o),r=(e=>"list"===e.operationType?`GET /${e.schema}`:`GET /${e.schema}/:id`)(o),i=(e=>"list"===e.operationType?`/${e.schema}`:`/${e.schema}/:id`)(o);return e[n??r]={id:o.operationId,categories:o.categories,description:o.description,operationType:o.operationType,entrypointUrl:o.entrypointUrl??i,entrypointHttpMethod:o.entrypointHttpMethod??"get",inputs:o.inputs,steps:o.steps.reduce(((e,n)=>(e[n.stepId]={id:n.stepId,description:n.description,stepFunction:{functionName:n.stepFunction.functionName,version:n.stepFunction.version,params:{..."request"===n.stepFunction.functionName?t:{},..."map_fields"===n.stepFunction.functionName||"typecast"===n.stepFunction.functionName?{fields:o.fieldConfigs}:{},...n.stepFunction.parameters}}},e)),{}),result:o.result},e}),{});return o},k=(e,t)=>{if(!e.inputs)return{};const o=F(e.inputs).parse(t);return{...o.headers??{},...o.query??{},...o.path??{},...o.body??{}}},v=e=>{const t={};return e.forEach((e=>{let o;switch(e.type.toLowerCase()){case"string":o=s.z.string();break;case"number":o=s.z.number();break;case"boolean":o=s.z.boolean();break;default:o=s.z.any()}t[e.name]=e.required?o:o.optional()})),s.z.object(t)},F=e=>{const t=e.filter((e=>"path"===e.in)),o=e.filter((e=>"query"===e.in)),n=e.filter((e=>"body"===e.in)),r=e.filter((e=>"headers"===e.in));return s.z.object({path:v(t).optional(),query:v(o).optional(),body:v(n).optional(),headers:v(r).optional()})};class S extends Error{constructor(e,t,o){super(o),this.name="ConnectSDKError",this.errorType=e,this.context=t,Error.captureStackTrace&&Error.captureStackTrace(this,S)}toString(){return`${this.name} [${this.errorType}]: ${this.message}`}}class I extends S{constructor(e,t){super("CONNECTOR_PARSE_ERROR",e,t),this.name="ConnectorParseError"}}class E extends S{constructor(e,t){super("MISSING_OPERATION_ERROR",e,t),this.name="MissingOperationError"}}class O extends S{constructor(e,t){super("INVALID_OPERATION_INPUTS_ERROR",e,t),this.name="InvalidOperationInputsError"}}exports.ConnectSDKError=S,exports.createBlock=c,exports.executeStepFunction=async({block:t,stepFunctionName:o,params:n,buildStepFunction:r=e.StepFunctionsFactory.build})=>{const i=r({functionName:o}).fn,s=await i({block:t,params:n}),a=o===e.StepFunctionName.MAP_FIELDS?{[e.StepFunctionName.MAP_FIELDS.toString()]:{output:{data:s.block.result},errors:s.errors,successful:s.successful}}:{};return{...s.block,steps:{...s?.block?.steps??{},...a}}},exports.getOperationFromUrl=u,exports.parseOperationInputs=k,exports.parseYamlConnector=m,exports.runConnectorOperation=async({account:e,connector:t,category:n,path:r,method:i="get",queryParams:s,logger:l,parseConnector:y=m,getOperationFromUrlFn:d=u,parseOperationInputsFn:g=k,createBlockContextFn:h=p,createBlockFn:_=c,runStepOperationFn:b=a})=>{const z=e.authConfigKey,f=e.environment??"production",v=e.secureId,F=e.projectSecureId,S=e.credentials,j=h({category:n,connectorKey:e.providerKey,connectorVersion:e.providerVersion,authConfigKey:z,environment:f,accountSecureId:v,projectSecureId:F});let C;try{C=o.isString(t)?y(t):t}catch{throw new I(j,"Error while parsing connector")}const N=d(C,r,i);if(o.isMissing(N))throw new E(j,"No matching operation found");let T;j.operationType=N.operation.operationType,j.schema=N.operation.schema?.key;try{T=g(N.operation,{query:s,path:N.params})}catch{throw new O(j,"Error while parsing operation inputs")}const x=await _({inputs:T,context:j,operation:N.operation,credentials:S,logger:l});return await b({block:x})},exports.runStepOperation=a;
@@ -32,7 +32,7 @@ export declare const OPERATION_SCHEMA: z.ZodObject<{
32
32
  type: z.ZodEnum<["string", "number", "boolean", "datetime_string", "enum"]>;
33
33
  isUnified: z.ZodBoolean;
34
34
  enumMapper: z.ZodOptional<z.ZodObject<{
35
- matcher: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
35
+ matcher: z.ZodUnion<[z.ZodEnum<["country_alpha2code_by_alpha2code", "country_alpha3code_by_alpha3code", "country_code_by_country_code", "country_name_by_country_name", "country_name_by_alpha3code", "country_name_by_alpha2code", "country_name_by_country_code", "country_alpha3code_by_alpha2code", "country_alpha3code_by_country_name", "country_alpha3code_by_country_code", "country_alpha2code_by_alpha3code", "country_alpha2code_by_country_name", "country_alpha2code_by_country_code", "country_code_by_alpha2code", "country_code_by_alpha3code", "country_code_by_country_name", "country_subdivisions_by_alpha2code", "country_subdivision_code_by_subdivision_name", "country_alpha2code_by_citizenship", "country_subdivision_name_by_subdivision_code"]>, z.ZodArray<z.ZodObject<{
36
36
  matchExpression: z.ZodString;
37
37
  value: z.ZodString;
38
38
  }, "strip", z.ZodTypeAny, {
@@ -43,12 +43,12 @@ export declare const OPERATION_SCHEMA: z.ZodObject<{
43
43
  matchExpression: string;
44
44
  }>, "many">]>;
45
45
  }, "strip", z.ZodTypeAny, {
46
- matcher: string | {
46
+ matcher: "country_alpha2code_by_alpha2code" | "country_alpha3code_by_alpha3code" | "country_code_by_country_code" | "country_name_by_country_name" | "country_name_by_alpha3code" | "country_name_by_alpha2code" | "country_name_by_country_code" | "country_alpha3code_by_alpha2code" | "country_alpha3code_by_country_name" | "country_alpha3code_by_country_code" | "country_alpha2code_by_alpha3code" | "country_alpha2code_by_country_name" | "country_alpha2code_by_country_code" | "country_code_by_alpha2code" | "country_code_by_alpha3code" | "country_code_by_country_name" | "country_subdivisions_by_alpha2code" | "country_subdivision_code_by_subdivision_name" | "country_alpha2code_by_citizenship" | "country_subdivision_name_by_subdivision_code" | {
47
47
  value: string;
48
48
  matchExpression: string;
49
49
  }[];
50
50
  }, {
51
- matcher: string | {
51
+ matcher: "country_alpha2code_by_alpha2code" | "country_alpha3code_by_alpha3code" | "country_code_by_country_code" | "country_name_by_country_name" | "country_name_by_alpha3code" | "country_name_by_alpha2code" | "country_name_by_country_code" | "country_alpha3code_by_alpha2code" | "country_alpha3code_by_country_name" | "country_alpha3code_by_country_code" | "country_alpha2code_by_alpha3code" | "country_alpha2code_by_country_name" | "country_alpha2code_by_country_code" | "country_code_by_alpha2code" | "country_code_by_alpha3code" | "country_code_by_country_name" | "country_subdivisions_by_alpha2code" | "country_subdivision_code_by_subdivision_name" | "country_alpha2code_by_citizenship" | "country_subdivision_name_by_subdivision_code" | {
52
52
  value: string;
53
53
  matchExpression: string;
54
54
  }[];
@@ -59,7 +59,7 @@ export declare const OPERATION_SCHEMA: z.ZodObject<{
59
59
  expression: string;
60
60
  isUnified: boolean;
61
61
  enumMapper?: {
62
- matcher: string | {
62
+ matcher: "country_alpha2code_by_alpha2code" | "country_alpha3code_by_alpha3code" | "country_code_by_country_code" | "country_name_by_country_name" | "country_name_by_alpha3code" | "country_name_by_alpha2code" | "country_name_by_country_code" | "country_alpha3code_by_alpha2code" | "country_alpha3code_by_country_name" | "country_alpha3code_by_country_code" | "country_alpha2code_by_alpha3code" | "country_alpha2code_by_country_name" | "country_alpha2code_by_country_code" | "country_code_by_alpha2code" | "country_code_by_alpha3code" | "country_code_by_country_name" | "country_subdivisions_by_alpha2code" | "country_subdivision_code_by_subdivision_name" | "country_alpha2code_by_citizenship" | "country_subdivision_name_by_subdivision_code" | {
63
63
  value: string;
64
64
  matchExpression: string;
65
65
  }[];
@@ -70,7 +70,7 @@ export declare const OPERATION_SCHEMA: z.ZodObject<{
70
70
  expression: string;
71
71
  isUnified: boolean;
72
72
  enumMapper?: {
73
- matcher: string | {
73
+ matcher: "country_alpha2code_by_alpha2code" | "country_alpha3code_by_alpha3code" | "country_code_by_country_code" | "country_name_by_country_name" | "country_name_by_alpha3code" | "country_name_by_alpha2code" | "country_name_by_country_code" | "country_alpha3code_by_alpha2code" | "country_alpha3code_by_country_name" | "country_alpha3code_by_country_code" | "country_alpha2code_by_alpha3code" | "country_alpha2code_by_country_name" | "country_alpha2code_by_country_code" | "country_code_by_alpha2code" | "country_code_by_alpha3code" | "country_code_by_country_name" | "country_subdivisions_by_alpha2code" | "country_subdivision_code_by_subdivision_name" | "country_alpha2code_by_citizenship" | "country_subdivision_name_by_subdivision_code" | {
74
74
  value: string;
75
75
  matchExpression: string;
76
76
  }[];
@@ -121,7 +121,7 @@ export declare const OPERATION_SCHEMA: z.ZodObject<{
121
121
  expression: string;
122
122
  isUnified: boolean;
123
123
  enumMapper?: {
124
- matcher: string | {
124
+ matcher: "country_alpha2code_by_alpha2code" | "country_alpha3code_by_alpha3code" | "country_code_by_country_code" | "country_name_by_country_name" | "country_name_by_alpha3code" | "country_name_by_alpha2code" | "country_name_by_country_code" | "country_alpha3code_by_alpha2code" | "country_alpha3code_by_country_name" | "country_alpha3code_by_country_code" | "country_alpha2code_by_alpha3code" | "country_alpha2code_by_country_name" | "country_alpha2code_by_country_code" | "country_code_by_alpha2code" | "country_code_by_alpha3code" | "country_code_by_country_name" | "country_subdivisions_by_alpha2code" | "country_subdivision_code_by_subdivision_name" | "country_alpha2code_by_citizenship" | "country_subdivision_name_by_subdivision_code" | {
125
125
  value: string;
126
126
  matchExpression: string;
127
127
  }[];
@@ -158,7 +158,7 @@ export declare const OPERATION_SCHEMA: z.ZodObject<{
158
158
  expression: string;
159
159
  isUnified: boolean;
160
160
  enumMapper?: {
161
- matcher: string | {
161
+ matcher: "country_alpha2code_by_alpha2code" | "country_alpha3code_by_alpha3code" | "country_code_by_country_code" | "country_name_by_country_name" | "country_name_by_alpha3code" | "country_name_by_alpha2code" | "country_name_by_country_code" | "country_alpha3code_by_alpha2code" | "country_alpha3code_by_country_name" | "country_alpha3code_by_country_code" | "country_alpha2code_by_alpha3code" | "country_alpha2code_by_country_name" | "country_alpha2code_by_country_code" | "country_code_by_alpha2code" | "country_code_by_alpha3code" | "country_code_by_country_name" | "country_subdivisions_by_alpha2code" | "country_subdivision_code_by_subdivision_name" | "country_alpha2code_by_citizenship" | "country_subdivision_name_by_subdivision_code" | {
162
162
  value: string;
163
163
  matchExpression: string;
164
164
  }[];
@@ -425,7 +425,7 @@ export declare const CONNECTOR_YAML_SCHEMA: z.ZodObject<{
425
425
  type: z.ZodEnum<["string", "number", "boolean", "datetime_string", "enum"]>;
426
426
  isUnified: z.ZodBoolean;
427
427
  enumMapper: z.ZodOptional<z.ZodObject<{
428
- matcher: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
428
+ matcher: z.ZodUnion<[z.ZodEnum<["country_alpha2code_by_alpha2code", "country_alpha3code_by_alpha3code", "country_code_by_country_code", "country_name_by_country_name", "country_name_by_alpha3code", "country_name_by_alpha2code", "country_name_by_country_code", "country_alpha3code_by_alpha2code", "country_alpha3code_by_country_name", "country_alpha3code_by_country_code", "country_alpha2code_by_alpha3code", "country_alpha2code_by_country_name", "country_alpha2code_by_country_code", "country_code_by_alpha2code", "country_code_by_alpha3code", "country_code_by_country_name", "country_subdivisions_by_alpha2code", "country_subdivision_code_by_subdivision_name", "country_alpha2code_by_citizenship", "country_subdivision_name_by_subdivision_code"]>, z.ZodArray<z.ZodObject<{
429
429
  matchExpression: z.ZodString;
430
430
  value: z.ZodString;
431
431
  }, "strip", z.ZodTypeAny, {
@@ -436,12 +436,12 @@ export declare const CONNECTOR_YAML_SCHEMA: z.ZodObject<{
436
436
  matchExpression: string;
437
437
  }>, "many">]>;
438
438
  }, "strip", z.ZodTypeAny, {
439
- matcher: string | {
439
+ matcher: "country_alpha2code_by_alpha2code" | "country_alpha3code_by_alpha3code" | "country_code_by_country_code" | "country_name_by_country_name" | "country_name_by_alpha3code" | "country_name_by_alpha2code" | "country_name_by_country_code" | "country_alpha3code_by_alpha2code" | "country_alpha3code_by_country_name" | "country_alpha3code_by_country_code" | "country_alpha2code_by_alpha3code" | "country_alpha2code_by_country_name" | "country_alpha2code_by_country_code" | "country_code_by_alpha2code" | "country_code_by_alpha3code" | "country_code_by_country_name" | "country_subdivisions_by_alpha2code" | "country_subdivision_code_by_subdivision_name" | "country_alpha2code_by_citizenship" | "country_subdivision_name_by_subdivision_code" | {
440
440
  value: string;
441
441
  matchExpression: string;
442
442
  }[];
443
443
  }, {
444
- matcher: string | {
444
+ matcher: "country_alpha2code_by_alpha2code" | "country_alpha3code_by_alpha3code" | "country_code_by_country_code" | "country_name_by_country_name" | "country_name_by_alpha3code" | "country_name_by_alpha2code" | "country_name_by_country_code" | "country_alpha3code_by_alpha2code" | "country_alpha3code_by_country_name" | "country_alpha3code_by_country_code" | "country_alpha2code_by_alpha3code" | "country_alpha2code_by_country_name" | "country_alpha2code_by_country_code" | "country_code_by_alpha2code" | "country_code_by_alpha3code" | "country_code_by_country_name" | "country_subdivisions_by_alpha2code" | "country_subdivision_code_by_subdivision_name" | "country_alpha2code_by_citizenship" | "country_subdivision_name_by_subdivision_code" | {
445
445
  value: string;
446
446
  matchExpression: string;
447
447
  }[];
@@ -452,7 +452,7 @@ export declare const CONNECTOR_YAML_SCHEMA: z.ZodObject<{
452
452
  expression: string;
453
453
  isUnified: boolean;
454
454
  enumMapper?: {
455
- matcher: string | {
455
+ matcher: "country_alpha2code_by_alpha2code" | "country_alpha3code_by_alpha3code" | "country_code_by_country_code" | "country_name_by_country_name" | "country_name_by_alpha3code" | "country_name_by_alpha2code" | "country_name_by_country_code" | "country_alpha3code_by_alpha2code" | "country_alpha3code_by_country_name" | "country_alpha3code_by_country_code" | "country_alpha2code_by_alpha3code" | "country_alpha2code_by_country_name" | "country_alpha2code_by_country_code" | "country_code_by_alpha2code" | "country_code_by_alpha3code" | "country_code_by_country_name" | "country_subdivisions_by_alpha2code" | "country_subdivision_code_by_subdivision_name" | "country_alpha2code_by_citizenship" | "country_subdivision_name_by_subdivision_code" | {
456
456
  value: string;
457
457
  matchExpression: string;
458
458
  }[];
@@ -463,7 +463,7 @@ export declare const CONNECTOR_YAML_SCHEMA: z.ZodObject<{
463
463
  expression: string;
464
464
  isUnified: boolean;
465
465
  enumMapper?: {
466
- matcher: string | {
466
+ matcher: "country_alpha2code_by_alpha2code" | "country_alpha3code_by_alpha3code" | "country_code_by_country_code" | "country_name_by_country_name" | "country_name_by_alpha3code" | "country_name_by_alpha2code" | "country_name_by_country_code" | "country_alpha3code_by_alpha2code" | "country_alpha3code_by_country_name" | "country_alpha3code_by_country_code" | "country_alpha2code_by_alpha3code" | "country_alpha2code_by_country_name" | "country_alpha2code_by_country_code" | "country_code_by_alpha2code" | "country_code_by_alpha3code" | "country_code_by_country_name" | "country_subdivisions_by_alpha2code" | "country_subdivision_code_by_subdivision_name" | "country_alpha2code_by_citizenship" | "country_subdivision_name_by_subdivision_code" | {
467
467
  value: string;
468
468
  matchExpression: string;
469
469
  }[];
@@ -514,7 +514,7 @@ export declare const CONNECTOR_YAML_SCHEMA: z.ZodObject<{
514
514
  expression: string;
515
515
  isUnified: boolean;
516
516
  enumMapper?: {
517
- matcher: string | {
517
+ matcher: "country_alpha2code_by_alpha2code" | "country_alpha3code_by_alpha3code" | "country_code_by_country_code" | "country_name_by_country_name" | "country_name_by_alpha3code" | "country_name_by_alpha2code" | "country_name_by_country_code" | "country_alpha3code_by_alpha2code" | "country_alpha3code_by_country_name" | "country_alpha3code_by_country_code" | "country_alpha2code_by_alpha3code" | "country_alpha2code_by_country_name" | "country_alpha2code_by_country_code" | "country_code_by_alpha2code" | "country_code_by_alpha3code" | "country_code_by_country_name" | "country_subdivisions_by_alpha2code" | "country_subdivision_code_by_subdivision_name" | "country_alpha2code_by_citizenship" | "country_subdivision_name_by_subdivision_code" | {
518
518
  value: string;
519
519
  matchExpression: string;
520
520
  }[];
@@ -551,7 +551,7 @@ export declare const CONNECTOR_YAML_SCHEMA: z.ZodObject<{
551
551
  expression: string;
552
552
  isUnified: boolean;
553
553
  enumMapper?: {
554
- matcher: string | {
554
+ matcher: "country_alpha2code_by_alpha2code" | "country_alpha3code_by_alpha3code" | "country_code_by_country_code" | "country_name_by_country_name" | "country_name_by_alpha3code" | "country_name_by_alpha2code" | "country_name_by_country_code" | "country_alpha3code_by_alpha2code" | "country_alpha3code_by_country_name" | "country_alpha3code_by_country_code" | "country_alpha2code_by_alpha3code" | "country_alpha2code_by_country_name" | "country_alpha2code_by_country_code" | "country_code_by_alpha2code" | "country_code_by_alpha3code" | "country_code_by_country_name" | "country_subdivisions_by_alpha2code" | "country_subdivision_code_by_subdivision_name" | "country_alpha2code_by_citizenship" | "country_subdivision_name_by_subdivision_code" | {
555
555
  value: string;
556
556
  matchExpression: string;
557
557
  }[];
@@ -640,7 +640,7 @@ export declare const CONNECTOR_YAML_SCHEMA: z.ZodObject<{
640
640
  expression: string;
641
641
  isUnified: boolean;
642
642
  enumMapper?: {
643
- matcher: string | {
643
+ matcher: "country_alpha2code_by_alpha2code" | "country_alpha3code_by_alpha3code" | "country_code_by_country_code" | "country_name_by_country_name" | "country_name_by_alpha3code" | "country_name_by_alpha2code" | "country_name_by_country_code" | "country_alpha3code_by_alpha2code" | "country_alpha3code_by_country_name" | "country_alpha3code_by_country_code" | "country_alpha2code_by_alpha3code" | "country_alpha2code_by_country_name" | "country_alpha2code_by_country_code" | "country_code_by_alpha2code" | "country_code_by_alpha3code" | "country_code_by_country_name" | "country_subdivisions_by_alpha2code" | "country_subdivision_code_by_subdivision_name" | "country_alpha2code_by_citizenship" | "country_subdivision_name_by_subdivision_code" | {
644
644
  value: string;
645
645
  matchExpression: string;
646
646
  }[];
@@ -729,7 +729,7 @@ export declare const CONNECTOR_YAML_SCHEMA: z.ZodObject<{
729
729
  expression: string;
730
730
  isUnified: boolean;
731
731
  enumMapper?: {
732
- matcher: string | {
732
+ matcher: "country_alpha2code_by_alpha2code" | "country_alpha3code_by_alpha3code" | "country_code_by_country_code" | "country_name_by_country_name" | "country_name_by_alpha3code" | "country_name_by_alpha2code" | "country_name_by_country_code" | "country_alpha3code_by_alpha2code" | "country_alpha3code_by_country_name" | "country_alpha3code_by_country_code" | "country_alpha2code_by_alpha3code" | "country_alpha2code_by_country_name" | "country_alpha2code_by_country_code" | "country_code_by_alpha2code" | "country_code_by_alpha3code" | "country_code_by_country_name" | "country_subdivisions_by_alpha2code" | "country_subdivision_code_by_subdivision_name" | "country_alpha2code_by_citizenship" | "country_subdivision_name_by_subdivision_code" | {
733
733
  value: string;
734
734
  matchExpression: string;
735
735
  }[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackone/connect-sdk",
3
- "version": "1.14.0",
3
+ "version": "1.16.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.mjs",