@getuserfeedback/sdk 0.19.5 → 0.19.12
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.d.ts +12 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +8 -7
- package/dist/internal/graph-relationship-properties.d.ts +28 -0
- package/dist/internal/graph-relationship-properties.js +4 -0
- package/dist/internal/graph-relationship-properties.js.map +10 -0
- package/dist/internal/inline-flow.d.ts +11 -2
- package/dist/internal/inline-flow.js +2 -2
- package/dist/internal/inline-flow.js.map +5 -5
- package/package.json +6 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AppEventIdentity } from '@getuserfeedback/protocol/host';
|
|
2
|
+
import { AppEventJsonValue } from '@getuserfeedback/protocol';
|
|
3
|
+
|
|
4
|
+
type EventProperties = Record<string, AppEventJsonValue>;
|
|
5
|
+
|
|
6
|
+
/** One endpoint in a directed relationship observation. Use `identities` for a user without a stable user ID. */
|
|
7
|
+
type GraphEndpointIdentity = AppEventIdentity | {
|
|
8
|
+
type: `externalId.users.none.${string}`;
|
|
9
|
+
value: string;
|
|
10
|
+
};
|
|
11
|
+
type GraphRelationshipRef = {
|
|
12
|
+
collection: string;
|
|
13
|
+
id: string;
|
|
14
|
+
identities?: never;
|
|
15
|
+
} | {
|
|
16
|
+
collection: "user";
|
|
17
|
+
identities: GraphEndpointIdentity[];
|
|
18
|
+
id?: never;
|
|
19
|
+
};
|
|
20
|
+
/** A directed relationship observation recorded through the analytics pipeline. */
|
|
21
|
+
type GraphRelationship = {
|
|
22
|
+
from: GraphRelationshipRef;
|
|
23
|
+
to: GraphRelationshipRef;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
declare const toGraphRelationshipProperties: (relationship: GraphRelationship) => EventProperties;
|
|
27
|
+
|
|
28
|
+
export { toGraphRelationshipProperties };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var a=(e)=>{let r=(i)=>{let t=i.id!==void 0,o=i.identities!==void 0;if(t===o)throw Error("Graph relationship endpoint requires either id or identities.");if(typeof i.id==="string")return{collection:i.collection,id:i.id};if(Array.isArray(i.identities))return{collection:i.collection,identities:i.identities.map(({type:n,value:s})=>({type:n,value:s}))};throw Error("Graph relationship endpoint is invalid.")};return{from:r(e.from),to:r(e.to)}};export{a as toGraphRelationshipProperties};
|
|
2
|
+
|
|
3
|
+
//# debugId=FD9FF3F5E71B0AA164756E2164756E21
|
|
4
|
+
//# sourceMappingURL=graph-relationship-properties.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/internal/graph-relationship-properties.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { GraphRelationship, GraphRelationshipRef } from \"../client\";\nimport type { EventProperties } from \"./customer-occurrence-command\";\n\nexport const toGraphRelationshipProperties = (\n\trelationship: GraphRelationship,\n): EventProperties => {\n\tconst toEndpoint = (endpoint: GraphRelationshipRef): EventProperties => {\n\t\tconst hasId = endpoint.id !== undefined;\n\t\tconst hasIdentities = endpoint.identities !== undefined;\n\t\tif (hasId === hasIdentities) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Graph relationship endpoint requires either id or identities.\",\n\t\t\t);\n\t\t}\n\t\tif (typeof endpoint.id === \"string\") {\n\t\t\treturn { collection: endpoint.collection, id: endpoint.id };\n\t\t}\n\t\tif (Array.isArray(endpoint.identities)) {\n\t\t\treturn {\n\t\t\t\tcollection: endpoint.collection,\n\t\t\t\tidentities: endpoint.identities.map(({ type, value }) => ({\n\t\t\t\t\ttype,\n\t\t\t\t\tvalue,\n\t\t\t\t})),\n\t\t\t};\n\t\t}\n\t\tthrow new Error(\"Graph relationship endpoint is invalid.\");\n\t};\n\treturn {\n\t\tfrom: toEndpoint(relationship.from),\n\t\tto: toEndpoint(relationship.to),\n\t};\n};\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": "AAGO,IAAM,EAAgC,CAC5C,IACqB,CACrB,IAAM,EAAa,CAAC,IAAoD,CACvE,IAAM,EAAQ,EAAS,KAAO,OACxB,EAAgB,EAAS,aAAe,OAC9C,GAAI,IAAU,EACb,MAAU,MACT,+DACD,EAED,GAAI,OAAO,EAAS,KAAO,SAC1B,MAAO,CAAE,WAAY,EAAS,WAAY,GAAI,EAAS,EAAG,EAE3D,GAAI,MAAM,QAAQ,EAAS,UAAU,EACpC,MAAO,CACN,WAAY,EAAS,WACrB,WAAY,EAAS,WAAW,IAAI,EAAG,OAAM,YAAa,CACzD,OACA,OACD,EAAE,CACH,EAED,MAAU,MAAM,yCAAyC,GAE1D,MAAO,CACN,KAAM,EAAW,EAAa,IAAI,EAClC,GAAI,EAAW,EAAa,EAAE,CAC/B",
|
|
8
|
+
"debugId": "FD9FF3F5E71B0AA164756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InlineFlow } from '@getuserfeedback/protocol/internal/inline-flow';
|
|
2
2
|
export { InlineFlow } from '@getuserfeedback/protocol/internal/inline-flow';
|
|
3
3
|
import { AppEventJsonValue, ListInstanceFeedbackMineRequest, ListInstanceFeedbackMineResponse, CaptureInstanceFeedbackRequest, CaptureInstanceFeedbackResponse } from '@getuserfeedback/protocol';
|
|
4
|
-
import { TrackOptions, OpenRequestedDetail, ClientOptions, ResponseMetadataInput, FlowRenderState, WidgetLayoutTransitionPolicy, ContainerPolicy, ConfigureOptions, IdentifyOptions } from '@getuserfeedback/protocol/host';
|
|
4
|
+
import { TrackOptions, OpenRequestedDetail, ClientOptions, ResponseMetadataInput, FlowRenderState, WidgetLayoutTransitionPolicy, ContainerPolicy, ConfigureOptions, IdentifyOptions, AppEventIdentity } from '@getuserfeedback/protocol/host';
|
|
5
5
|
|
|
6
6
|
type EventProperties = Record<string, AppEventJsonValue>;
|
|
7
7
|
type EventOptions = TrackOptions;
|
|
@@ -38,10 +38,19 @@ type FeedbackOperations = {
|
|
|
38
38
|
fetch: (input: FetchFeedbackInput) => Promise<FetchFeedbackResult>;
|
|
39
39
|
submit: (input: FeedbackInput) => Promise<SubmitFeedbackResult>;
|
|
40
40
|
};
|
|
41
|
-
/** One endpoint in a directed relationship observation. */
|
|
41
|
+
/** One endpoint in a directed relationship observation. Use `identities` for a user without a stable user ID. */
|
|
42
|
+
type GraphEndpointIdentity = AppEventIdentity | {
|
|
43
|
+
type: `externalId.users.none.${string}`;
|
|
44
|
+
value: string;
|
|
45
|
+
};
|
|
42
46
|
type GraphRelationshipRef = {
|
|
43
47
|
collection: string;
|
|
44
48
|
id: string;
|
|
49
|
+
identities?: never;
|
|
50
|
+
} | {
|
|
51
|
+
collection: "user";
|
|
52
|
+
identities: GraphEndpointIdentity[];
|
|
53
|
+
id?: never;
|
|
45
54
|
};
|
|
46
55
|
/** A directed relationship observation recorded through the analytics pipeline. */
|
|
47
56
|
type GraphRelationship = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var W;function d(e,t,n){function r(i,a){if(!i._zod)Object.defineProperty(i,"_zod",{value:{def:a,constr:o,traits:new Set},enumerable:!1});if(i._zod.traits.has(e))return;i._zod.traits.add(e),t(i,a);let u=o.prototype,l=Object.keys(u);for(let f=0;f<l.length;f++){let p=l[f];if(!(p in i))i[p]=u[p].bind(i)}}let s=n?.Parent??Object;class c extends s{}Object.defineProperty(c,"name",{value:e});function o(i){var a;let u=n?.Parent?new c:this;r(u,i),(a=u._zod).deferred??(a.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:(i)=>{if(n?.Parent&&i instanceof n.Parent)return!0;return i?._zod?.traits?.has(e)}}),Object.defineProperty(o,"name",{value:e}),o}var ct=Symbol("zod_brand");class g extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}(W=globalThis).__zod_globalConfig??(W.__zod_globalConfig={});var N=globalThis.__zod_globalConfig;function y(e){if(e)Object.assign(N,e);return N}function J(e,t){if(typeof t==="bigint")return t.toString();return t}function Y(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function X(e){return e===null||e===void 0}function Q(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}var K=Symbol("evaluating");function v(e,t,n){let r=void 0;Object.defineProperty(e,t,{get(){if(r===K)return;if(r===void 0)r=K,r=n();return r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}var H="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ee(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function j(e,t,n){let r=new e._zod.constr(t??e._zod.def);if(!t||n?.parent)r._zod.parent=e;return r}function w(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function te(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Se={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function k(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ne(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function q(e,t){return t.map((n)=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function P(e){return typeof e==="string"?e:e?.message}function x(e,t,n){let r=e.message?e.message:P(e.inst?._zod.def?.error?.(e))??P(t?.error?.(e))??P(n.customError?.(e))??P(n.localeError?.(e))??"Invalid input",{inst:s,continue:c,input:o,...i}=e;if(i.path??(i.path=[]),i.message=r,t?.reportInput)i.input=o;return i}function re(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}var oe=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,J,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ie=d("$ZodError",oe),I=d("$ZodError",oe,{Parent:Error});var Oe=(e)=>(t,n,r,s)=>{let c=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},c);if(o instanceof Promise)throw new g;if(o.issues.length){let i=new(s?.Err??e)(o.issues.map((a)=>x(a,c,y())));throw H(i,s?.callee),i}return o.value},C=Oe(I),Pe=(e)=>async(t,n,r,s)=>{let c=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},c);if(o instanceof Promise)o=await o;if(o.issues.length){let i=new(s?.Err??e)(o.issues.map((a)=>x(a,c,y())));throw H(i,s?.callee),i}return o.value},A=Pe(I),Ce=(e)=>(t,n,r)=>{let s=r?{...r,async:!1}:{async:!1},c=t._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new g;return c.issues.length?{success:!1,error:new(e??ie)(c.issues.map((o)=>x(o,s,y())))}:{success:!0,data:c.value}},R=Ce(I),Ae=(e)=>async(t,n,r)=>{let s=r?{...r,async:!0}:{async:!0},c=t._zod.run({value:n,issues:[]},s);if(c instanceof Promise)c=await c;return c.issues.length?{success:!1,error:new e(c.issues.map((o)=>x(o,s,y())))}:{success:!0,data:c.value}},E=Ae(I);var Fe="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Te=new RegExp(`^${Fe}$`);var se=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var S=d("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])});var ue=d("$ZodCheckMinLength",(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=(r)=>{let s=r.value;return!X(s)&&s.length!==void 0}),e._zod.onattach.push((r)=>{let s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>s)r._zod.bag.minimum=t.minimum}),e._zod.check=(r)=>{let s=r.value;if(s.length>=t.minimum)return;let o=re(s);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}});var ae=d("$ZodCheckOverwrite",(e,t)=>{S.init(e,t),e._zod.check=(n)=>{n.value=t.tx(n.value)}});var le={major:4,minor:4,patch:3};var b=d("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=le;let r=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))r.unshift(e);for(let s of r)for(let c of s._zod.onattach)c(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(o,i,a)=>{let u=k(o),l;for(let f of i){if(f._zod.def.when){if(ne(o))continue;if(!f._zod.def.when(o))continue}else if(u)continue;let p=o.issues.length,m=f._zod.check(o);if(m instanceof Promise&&a?.async===!1)throw new g;if(l||m instanceof Promise)l=(l??Promise.resolve()).then(async()=>{if(await m,o.issues.length===p)return;if(!u)u=k(o,p)});else{if(o.issues.length===p)continue;if(!u)u=k(o,p)}}if(l)return l.then(()=>o);return o},c=(o,i,a)=>{if(k(o))return o.aborted=!0,o;let u=s(i,r,a);if(u instanceof Promise){if(a.async===!1)throw new g;return u.then((l)=>e._zod.parse(l,a))}return e._zod.parse(u,a)};e._zod.run=(o,i)=>{if(i.skipChecks)return e._zod.parse(o,i);if(i.direction==="backward"){let u=e._zod.parse({value:o.value,issues:[]},{...i,skipChecks:!0});if(u instanceof Promise)return u.then((l)=>c(l,o,i));return c(u,o,i)}let a=e._zod.parse(o,i);if(a instanceof Promise){if(i.async===!1)throw new g;return a.then((u)=>s(u,r,i))}return s(a,r,i)}}v(e,"~standard",()=>({validate:(s)=>{try{let c=R(e,s);return c.success?{value:c.data}:{issues:c.error?.issues}}catch(c){return E(e,s).then((o)=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),pe=d("$ZodString",(e,t)=>{b.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??se(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(s){}if(typeof n.value==="string")return n;return n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}});var fe=d("$ZodUnknown",(e,t)=>{b.init(e,t),e._zod.parse=(n)=>n}),me=d("$ZodNever",(e,t)=>{b.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function F(e,t,n,r,s,c){let o=n in r;if(e.issues.length){if(s&&c&&!o)return;t.issues.push(...q(n,e.issues))}if(!o&&!s){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}if(e.value===void 0){if(o)t.value[n]=void 0}else t.value[n]=e.value}function Ne(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let n=te(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function De(e,t,n,r,s,c){let o=[],i=s.keySet,a=s.catchall._zod,u=a.def.type,l=a.optin==="optional",f=a.optout==="optional";for(let p in t){if(p==="__proto__")continue;if(i.has(p))continue;if(u==="never"){o.push(p);continue}let m=a.run({value:t[p],issues:[]},r);if(m instanceof Promise)e.push(m.then((_)=>F(_,n,p,t,l,f)));else F(m,n,p,t,l,f)}if(o.length)n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:c});if(!e.length)return n;return Promise.all(e).then(()=>n)}var he=d("$ZodObject",(e,t)=>{if(b.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let i=t.shape;Object.defineProperty(t,"shape",{get:()=>{let a={...i};return Object.defineProperty(t,"shape",{value:a}),a}})}let r=Y(()=>Ne(t));v(e._zod,"propValues",()=>{let i=t.shape,a={};for(let u in i){let l=i[u]._zod;if(l.values){a[u]??(a[u]=new Set);for(let f of l.values)a[u].add(f)}}return a});let s=ee,c=t.catchall,o;e._zod.parse=(i,a)=>{o??(o=r.value);let u=i.value;if(!s(u))return i.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),i;i.value={};let l=[],f=o.shape;for(let p of o.keys){let m=f[p],_=m._zod.optin==="optional",G=m._zod.optout==="optional",M=m._zod.run({value:u[p],issues:[]},a);if(M instanceof Promise)l.push(M.then((Ee)=>F(Ee,i,p,u,_,G)));else F(M,i,p,u,_,G)}if(!c)return l.length?Promise.all(l).then(()=>i):i;return De(l,u,i,a,r.value,e)}});function de(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var ge=d("$ZodOptional",(e,t)=>{b.init(e,t),e._zod.optin="optional",e._zod.optout="optional",v(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),v(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Q(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){let s=n.value,c=t.innerType._zod.run(n,r);if(c instanceof Promise)return c.then((o)=>de(o,s));return de(c,s)}if(n.value===void 0)return n;return t.innerType._zod.run(n,r)}});function _e(e,t){return new e({type:"string",...w(t)})}function ve(e){return new e({type:"unknown"})}function we(e,t){return new e({type:"never",...w(t)})}function T(e,t){return new ue({check:"min_length",...w(t),minimum:e})}function be(e){return new ae({check:"overwrite",tx:e})}function L(){return be((e)=>e.trim())}var Z=d("ZodMiniType",(e,t)=>{if(!e._zod)throw Error("Uninitialized schema in ZodMiniType.");b.init(e,t),e.def=t,e.type=t.type,e.parse=(n,r)=>C(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>R(e,n,r),e.parseAsync=async(n,r)=>A(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>E(e,n,r),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]},{parent:!0}),e.with=e.check,e.clone=(n,r)=>j(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e),e.apply=(n)=>n(e)}),qe=d("ZodMiniString",(e,t)=>{pe.init(e,t),Z.init(e,t)});function U(e){return _e(qe,e)}var Be=d("ZodMiniUnknown",(e,t)=>{fe.init(e,t),Z.init(e,t)});function ye(){return ve(Be)}var Ve=d("ZodMiniNever",(e,t)=>{me.init(e,t),Z.init(e,t)});function Ge(e){return we(Ve,e)}var We=d("ZodMiniObject",(e,t)=>{he.init(e,t),Z.init(e,t),v(e,"shape",()=>t.shape)});function B(e,t){return new We({type:"object",shape:e,catchall:Ge(),...w(t)})}var Ke=d("ZodMiniOptional",(e,t)=>{ge.init(e,t),Z.init(e,t)});function O(e){return new Ke({type:"optional",innerType:e})}function xe(e,t){let n=new S({check:"custom",...w(t)});return n._zod.check=e,n}var ze=["id","organizationId","versionId","versionNumber"],Xe=B({css:O(U()),themeRuntimeArtifactId:O(U().check(L(),T(1))),themeVersionId:O(U().check(L(),T(1)))}),$e=B({definition:ye().check(xe((e)=>{if(e.value!==void 0)return;e.issues.push({code:"custom",input:e.value,message:"Inline flow definition is required.",continue:!1})})),theme:O(Xe)});var Qe=Symbol.for("@getuserfeedback/sdk/internal/inline-flow-client-bridge/1");var ke=(e)=>{let t=Reflect.get(e,Qe);if(typeof t!=="object"||t===null||!("createInlineFlowRun"in t)||typeof Reflect.get(t,"createInlineFlowRun")!=="function")throw Error("Inline flows require a compatible client created by @getuserfeedback/sdk.");return t};var di=Symbol("operation-superseded");var pi={state:"resolved",fallback:null,promise:Promise.resolve(),resolve:()=>{},reject:()=>{}};var Ie="0.19.5".trim(),et=Ie.length>0?Ie:"0.0.0-local";var tt=Symbol.for("@getuserfeedback/sdk/internal/supplied-only-local-client-options/1"),nt="@getuserfeedback/internal/bundled-docs",rt=(e)=>{let t={apiKey:nt,_loaderUrl:e.loaderUrl,_coreUrl:e.coreUrl,...e.colorScheme===void 0?{}:{colorScheme:e.colorScheme},...e.disableAutoLoad===void 0?{}:{disableAutoLoad:e.disableAutoLoad}};return Object.defineProperty(t,tt,{configurable:!1,enumerable:!1,value:!0,writable:!1}),t};var ot=/^(0|[1-9]\d*)$/,h=()=>{throw Error("Inline flow must contain only JSON values.")},V=(e,t=new Set)=>{if(e===null||typeof e==="string"||typeof e==="boolean")return e;if(typeof e==="number")return Number.isFinite(e)?e:h();if(typeof e!=="object"||t.has(e))return h();t.add(e);try{if(Array.isArray(e)){if(Object.getPrototypeOf(e)!==Array.prototype)return h();let s=Reflect.ownKeys(e);if(s.length!==e.length+1||s.some((o)=>o!=="length"&&(typeof o!=="string"||!ot.test(o)||Number(o)>=e.length)))return h();let c=[];for(let o=0;o<e.length;o+=1){let i=Object.getOwnPropertyDescriptor(e,String(o));if(!i?.enumerable||!("value"in i))return h();c.push(V(i.value,t))}return c}let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return h();let r={};for(let s of Reflect.ownKeys(e)){if(typeof s!=="string"||s==="__proto__")return h();let c=Object.getOwnPropertyDescriptor(e,s);if(!c?.enumerable||!("value"in c))return h();if(c.value===void 0)continue;Object.defineProperty(r,s,{configurable:!0,enumerable:!0,value:V(c.value,t),writable:!0})}return r}finally{t.delete(e)}},it=(e)=>{if(typeof e!=="object"||e===null||Array.isArray(e)||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)return h();return V(e)},Re=(e)=>{if(typeof e!=="object"||e===null)return e;for(let t of Object.values(e))Re(t);return Object.freeze(e)},st=(e)=>{let t=$e.parse(it(e)),n=t.definition;if(typeof n==="object"&&n!==null&&!Array.isArray(n)){let r=ze.find((s)=>(s in n));if(r)throw Error(`Inline flow definitions cannot include persisted field "${r}".`)}return Re(t)},Yi=(e,t)=>ke(e).createInlineFlowRun(st(t));export{rt as createBundledDocsClientOptions,Yi as createInlineFlow};
|
|
1
|
+
var W;function d(e,t,n){function r(i,a){if(!i._zod)Object.defineProperty(i,"_zod",{value:{def:a,constr:o,traits:new Set},enumerable:!1});if(i._zod.traits.has(e))return;i._zod.traits.add(e),t(i,a);let u=o.prototype,l=Object.keys(u);for(let f=0;f<l.length;f++){let p=l[f];if(!(p in i))i[p]=u[p].bind(i)}}let s=n?.Parent??Object;class c extends s{}Object.defineProperty(c,"name",{value:e});function o(i){var a;let u=n?.Parent?new c:this;r(u,i),(a=u._zod).deferred??(a.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:(i)=>{if(n?.Parent&&i instanceof n.Parent)return!0;return i?._zod?.traits?.has(e)}}),Object.defineProperty(o,"name",{value:e}),o}var ut=Symbol("zod_brand");class g extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}(W=globalThis).__zod_globalConfig??(W.__zod_globalConfig={});var N=globalThis.__zod_globalConfig;function y(e){if(e)Object.assign(N,e);return N}function J(e,t){if(typeof t==="bigint")return t.toString();return t}function Y(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function X(e){return e===null||e===void 0}function Q(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}var K=Symbol("evaluating");function v(e,t,n){let r=void 0;Object.defineProperty(e,t,{get(){if(r===K)return;if(r===void 0)r=K,r=n();return r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}var H="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ee(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function j(e,t,n){let r=new e._zod.constr(t??e._zod.def);if(!t||n?.parent)r._zod.parent=e;return r}function w(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function te(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Ze={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function k(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ne(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function q(e,t){return t.map((n)=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function P(e){return typeof e==="string"?e:e?.message}function x(e,t,n){let r=e.message?e.message:P(e.inst?._zod.def?.error?.(e))??P(t?.error?.(e))??P(n.customError?.(e))??P(n.localeError?.(e))??"Invalid input",{inst:s,continue:c,input:o,...i}=e;if(i.path??(i.path=[]),i.message=r,t?.reportInput)i.input=o;return i}function re(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}var oe=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,J,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ie=d("$ZodError",oe),I=d("$ZodError",oe,{Parent:Error});var Pe=(e)=>(t,n,r,s)=>{let c=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},c);if(o instanceof Promise)throw new g;if(o.issues.length){let i=new(s?.Err??e)(o.issues.map((a)=>x(a,c,y())));throw H(i,s?.callee),i}return o.value},C=Pe(I),Ce=(e)=>async(t,n,r,s)=>{let c=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},c);if(o instanceof Promise)o=await o;if(o.issues.length){let i=new(s?.Err??e)(o.issues.map((a)=>x(a,c,y())));throw H(i,s?.callee),i}return o.value},A=Ce(I),Ae=(e)=>(t,n,r)=>{let s=r?{...r,async:!1}:{async:!1},c=t._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new g;return c.issues.length?{success:!1,error:new(e??ie)(c.issues.map((o)=>x(o,s,y())))}:{success:!0,data:c.value}},R=Ae(I),Fe=(e)=>async(t,n,r)=>{let s=r?{...r,async:!0}:{async:!0},c=t._zod.run({value:n,issues:[]},s);if(c instanceof Promise)c=await c;return c.issues.length?{success:!1,error:new e(c.issues.map((o)=>x(o,s,y())))}:{success:!0,data:c.value}},E=Fe(I);var Te="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Le=new RegExp(`^${Te}$`);var se=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var S=d("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])});var ue=d("$ZodCheckMinLength",(e,t)=>{var n;S.init(e,t),(n=e._zod.def).when??(n.when=(r)=>{let s=r.value;return!X(s)&&s.length!==void 0}),e._zod.onattach.push((r)=>{let s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>s)r._zod.bag.minimum=t.minimum}),e._zod.check=(r)=>{let s=r.value;if(s.length>=t.minimum)return;let o=re(s);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}});var ae=d("$ZodCheckOverwrite",(e,t)=>{S.init(e,t),e._zod.check=(n)=>{n.value=t.tx(n.value)}});var le={major:4,minor:4,patch:3};var b=d("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=le;let r=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))r.unshift(e);for(let s of r)for(let c of s._zod.onattach)c(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(o,i,a)=>{let u=k(o),l;for(let f of i){if(f._zod.def.when){if(ne(o))continue;if(!f._zod.def.when(o))continue}else if(u)continue;let p=o.issues.length,m=f._zod.check(o);if(m instanceof Promise&&a?.async===!1)throw new g;if(l||m instanceof Promise)l=(l??Promise.resolve()).then(async()=>{if(await m,o.issues.length===p)return;if(!u)u=k(o,p)});else{if(o.issues.length===p)continue;if(!u)u=k(o,p)}}if(l)return l.then(()=>o);return o},c=(o,i,a)=>{if(k(o))return o.aborted=!0,o;let u=s(i,r,a);if(u instanceof Promise){if(a.async===!1)throw new g;return u.then((l)=>e._zod.parse(l,a))}return e._zod.parse(u,a)};e._zod.run=(o,i)=>{if(i.skipChecks)return e._zod.parse(o,i);if(i.direction==="backward"){let u=e._zod.parse({value:o.value,issues:[]},{...i,skipChecks:!0});if(u instanceof Promise)return u.then((l)=>c(l,o,i));return c(u,o,i)}let a=e._zod.parse(o,i);if(a instanceof Promise){if(i.async===!1)throw new g;return a.then((u)=>s(u,r,i))}return s(a,r,i)}}v(e,"~standard",()=>({validate:(s)=>{try{let c=R(e,s);return c.success?{value:c.data}:{issues:c.error?.issues}}catch(c){return E(e,s).then((o)=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),pe=d("$ZodString",(e,t)=>{b.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??se(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(s){}if(typeof n.value==="string")return n;return n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}});var fe=d("$ZodUnknown",(e,t)=>{b.init(e,t),e._zod.parse=(n)=>n}),me=d("$ZodNever",(e,t)=>{b.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function F(e,t,n,r,s,c){let o=n in r;if(e.issues.length){if(s&&c&&!o)return;t.issues.push(...q(n,e.issues))}if(!o&&!s){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}if(e.value===void 0){if(o)t.value[n]=void 0}else t.value[n]=e.value}function De(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let n=te(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function He(e,t,n,r,s,c){let o=[],i=s.keySet,a=s.catchall._zod,u=a.def.type,l=a.optin==="optional",f=a.optout==="optional";for(let p in t){if(p==="__proto__")continue;if(i.has(p))continue;if(u==="never"){o.push(p);continue}let m=a.run({value:t[p],issues:[]},r);if(m instanceof Promise)e.push(m.then((_)=>F(_,n,p,t,l,f)));else F(m,n,p,t,l,f)}if(o.length)n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:c});if(!e.length)return n;return Promise.all(e).then(()=>n)}var he=d("$ZodObject",(e,t)=>{if(b.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let i=t.shape;Object.defineProperty(t,"shape",{get:()=>{let a={...i};return Object.defineProperty(t,"shape",{value:a}),a}})}let r=Y(()=>De(t));v(e._zod,"propValues",()=>{let i=t.shape,a={};for(let u in i){let l=i[u]._zod;if(l.values){a[u]??(a[u]=new Set);for(let f of l.values)a[u].add(f)}}return a});let s=ee,c=t.catchall,o;e._zod.parse=(i,a)=>{o??(o=r.value);let u=i.value;if(!s(u))return i.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),i;i.value={};let l=[],f=o.shape;for(let p of o.keys){let m=f[p],_=m._zod.optin==="optional",G=m._zod.optout==="optional",M=m._zod.run({value:u[p],issues:[]},a);if(M instanceof Promise)l.push(M.then((Se)=>F(Se,i,p,u,_,G)));else F(M,i,p,u,_,G)}if(!c)return l.length?Promise.all(l).then(()=>i):i;return He(l,u,i,a,r.value,e)}});function de(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var ge=d("$ZodOptional",(e,t)=>{b.init(e,t),e._zod.optin="optional",e._zod.optout="optional",v(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),v(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Q(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){let s=n.value,c=t.innerType._zod.run(n,r);if(c instanceof Promise)return c.then((o)=>de(o,s));return de(c,s)}if(n.value===void 0)return n;return t.innerType._zod.run(n,r)}});function _e(e,t){return new e({type:"string",...w(t)})}function ve(e){return new e({type:"unknown"})}function we(e,t){return new e({type:"never",...w(t)})}function T(e,t){return new ue({check:"min_length",...w(t),minimum:e})}function be(e){return new ae({check:"overwrite",tx:e})}function L(){return be((e)=>e.trim())}var Z=d("ZodMiniType",(e,t)=>{if(!e._zod)throw Error("Uninitialized schema in ZodMiniType.");b.init(e,t),e.def=t,e.type=t.type,e.parse=(n,r)=>C(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>R(e,n,r),e.parseAsync=async(n,r)=>A(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>E(e,n,r),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]},{parent:!0}),e.with=e.check,e.clone=(n,r)=>j(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e),e.apply=(n)=>n(e)}),Be=d("ZodMiniString",(e,t)=>{pe.init(e,t),Z.init(e,t)});function U(e){return _e(Be,e)}var Ve=d("ZodMiniUnknown",(e,t)=>{fe.init(e,t),Z.init(e,t)});function ye(){return ve(Ve)}var Ge=d("ZodMiniNever",(e,t)=>{me.init(e,t),Z.init(e,t)});function We(e){return we(Ge,e)}var Ke=d("ZodMiniObject",(e,t)=>{he.init(e,t),Z.init(e,t),v(e,"shape",()=>t.shape)});function B(e,t){return new Ke({type:"object",shape:e,catchall:We(),...w(t)})}var Je=d("ZodMiniOptional",(e,t)=>{ge.init(e,t),Z.init(e,t)});function O(e){return new Je({type:"optional",innerType:e})}function xe(e,t){let n=new S({check:"custom",...w(t)});return n._zod.check=e,n}var $e=["id","organizationId","versionId","versionNumber"],Qe=B({css:O(U()),themeRuntimeArtifactId:O(U().check(L(),T(1))),themeVersionId:O(U().check(L(),T(1)))}),ze=B({definition:ye().check(xe((e)=>{if(e.value!==void 0)return;e.issues.push({code:"custom",input:e.value,message:"Inline flow definition is required.",continue:!1})})),theme:O(Qe)});var ke=Symbol.for("@getuserfeedback/sdk/internal/inline-flow-client-bridge/1"),et=(e)=>typeof e==="object"&&e!==null&&("createInlineFlowRun"in e)&&typeof e.createInlineFlowRun==="function";var Ie=(e)=>{let t=ke in e?e[ke]:void 0;if(!et(t))throw Error("Inline flows require a compatible client created by @getuserfeedback/sdk.");return t};var pi=Symbol("operation-superseded");var fi={state:"resolved",fallback:null,promise:Promise.resolve(),resolve:()=>{},reject:()=>{}};var Re="0.19.12".trim(),tt=Re.length>0?Re:"0.0.0-local";var nt=Symbol.for("@getuserfeedback/sdk/internal/supplied-only-local-client-options/1"),rt="@getuserfeedback/internal/bundled-docs",ot=(e)=>{let t={apiKey:rt,_loaderUrl:e.loaderUrl,_coreUrl:e.coreUrl,...e.colorScheme===void 0?{}:{colorScheme:e.colorScheme},...e.disableAutoLoad===void 0?{}:{disableAutoLoad:e.disableAutoLoad}};return Object.defineProperty(t,nt,{configurable:!1,enumerable:!1,value:!0,writable:!1}),t};var it=/^(0|[1-9]\d*)$/,h=()=>{throw Error("Inline flow must contain only JSON values.")},V=(e,t=new Set)=>{if(e===null||typeof e==="string"||typeof e==="boolean")return e;if(typeof e==="number")return Number.isFinite(e)?e:h();if(typeof e!=="object"||t.has(e))return h();t.add(e);try{if(Array.isArray(e)){if(Object.getPrototypeOf(e)!==Array.prototype)return h();let s=Reflect.ownKeys(e);if(s.length!==e.length+1||s.some((o)=>o!=="length"&&(typeof o!=="string"||!it.test(o)||Number(o)>=e.length)))return h();let c=[];for(let o=0;o<e.length;o+=1){let i=Object.getOwnPropertyDescriptor(e,String(o));if(!i?.enumerable||!("value"in i))return h();c.push(V(i.value,t))}return c}let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return h();let r={};for(let s of Reflect.ownKeys(e)){if(typeof s!=="string"||s==="__proto__")return h();let c=Object.getOwnPropertyDescriptor(e,s);if(!c?.enumerable||!("value"in c))return h();if(c.value===void 0)continue;Object.defineProperty(r,s,{configurable:!0,enumerable:!0,value:V(c.value,t),writable:!0})}return r}finally{t.delete(e)}},st=(e)=>{if(typeof e!=="object"||e===null||Array.isArray(e)||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)return h();let t=V(e);if(t===null||Array.isArray(t)||typeof t!=="object")return h();return t},Ee=(e)=>{if(typeof e!=="object"||e===null)return e;for(let t of Object.values(e))Ee(t);return Object.freeze(e)},ct=(e)=>{let t=ze.parse(st(e)),n=t.definition;if(typeof n==="object"&&n!==null&&!Array.isArray(n)){let r=$e.find((s)=>(s in n));if(r)throw Error(`Inline flow definitions cannot include persisted field "${r}".`)}return Ee(t)},ts=(e,t)=>Ie(e).createInlineFlowRun(ct(t));export{ot as createBundledDocsClientOptions,ts as createInlineFlow};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=2F77F559461979F164756E2164756E21
|
|
4
4
|
//# sourceMappingURL=inline-flow.js.map
|