@getuserfeedback/sdk 0.19.5 → 0.20.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.d.ts +19 -10
- package/dist/index.js +2 -2
- package/dist/index.js.map +29 -25
- package/dist/internal/customer-occurrence-command.d.ts +2 -2
- package/dist/internal/customer-occurrence-command.js +2 -2
- package/dist/internal/customer-occurrence-command.js.map +5 -4
- package/dist/internal/flow-open-request-controller.d.ts +2 -1
- package/dist/internal/flow-open-request-controller.js +2 -2
- package/dist/internal/flow-open-request-controller.js.map +3 -3
- 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 +16 -7
- package/dist/internal/inline-flow.js +2 -2
- package/dist/internal/inline-flow.js.map +6 -6
- package/dist/internal/react-container.d.ts +224 -0
- package/dist/internal/react-container.js +4 -0
- package/dist/internal/react-container.js.map +12 -0
- package/package.json +11 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AppEventJsonInputValue, AppEventOccurrenceType, PublicCommandPayload } from '@getuserfeedback/protocol';
|
|
2
2
|
import { TrackOptions } from '@getuserfeedback/protocol/host';
|
|
3
3
|
|
|
4
|
-
type EventProperties = Record<string,
|
|
4
|
+
type EventProperties = Record<string, AppEventJsonInputValue>;
|
|
5
5
|
type EventOptions = TrackOptions;
|
|
6
6
|
type CustomerOccurrenceCommand = Extract<PublicCommandPayload, {
|
|
7
7
|
kind: "track";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a=(e)=>e!==null&&typeof e==="object"&&!Array.isArray(e),f=(e)=>{if(!a(e))return!1;let t=Object.entries(e).find(([r])=>r==="externalIds")?.[1];return Array.isArray(t)&&t.length>0&&t.every(l)},l=(e)=>{if(!a(e))return!1;return typeof e.id==="string"&&typeof e.type==="string"&&e.collection==="users"&&e.encoding==="none"},i=({argument:e,commandName:t,valueArgumentName:r,callShape:o})=>{if(!f(e))return;throw Error(`${t} received externalIds in the ${r} argument. Use ${o} instead.`)};function m(e,t){if(typeof e!=="string")throw Error(`${t} must be a non-empty string`);let r=e.trim();if(r.length===0)throw Error(`${t} must be a non-empty string`);if(r.length>255)throw Error(`${t} must be at most 255 characters`);return r}function d(e){if(e===void 0)return;if(typeof e!=="string"||e.trim().length===0)throw Error("messageId must be a non-empty string");if(e.length>255)throw Error("messageId must be at most 255 characters");return e}function c(e){if(e!==null&&typeof e==="object"){let t;try{t=Date.prototype.getTime.call(e)}catch{}if(t!==void 0){if(!Number.isFinite(t))throw RangeError("Invalid Date");return Date.prototype.toISOString.call(e)}}if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r+=1){if(!Object.hasOwn(e,r))throw TypeError("Sparse arrays are not supported");t.push(c(e[r]))}return t}if(e!==null&&typeof e==="object"){let t=Object.getPrototypeOf(e),r=Reflect.ownKeys(e);if(r.includes("__proto__")||r.some((s)=>typeof s==="symbol"))throw TypeError('JSON objects cannot contain own "__proto__" or symbol keys.');let o,n;try{o=t===null||t===Object.prototype?void 0:Object.getOwnPropertyDescriptor(t,"constructor")?.value,n=typeof o==="function"?Object.getOwnPropertyDescriptor(o,"name")?.value:void 0}catch{throw TypeError("Expected a plain JSON object")}if(t!==null&&t!==Object.prototype&&!(Object.getPrototypeOf(t)===null&&typeof o==="function"&&n==="Object"))throw TypeError("Expected a plain JSON object");for(let s of r)if(!Object.getOwnPropertyDescriptor(e,s)?.enumerable)throw TypeError("Non-enumerable JSON properties are not supported");let p={};for(let s of r)if(typeof s==="string")Object.defineProperty(p,s,{value:c(Reflect.get(e,s)),enumerable:!0,configurable:!0,writable:!0});return p}return e}var u={page:"page(name, properties, { externalIds })",screen:"screen(name, properties, { externalIds })",track:"track(eventName, properties, { externalIds })"},y={page:"pageName",screen:"screenName",track:"eventName"},N=(e)=>{let t=m(e.event,y[e.type]),r=d(e.options?.messageId),o=e.properties===void 0?void 0:c(e.properties);i({argument:o,commandName:e.type,valueArgumentName:"properties",callShape:u[e.type]});let n=e.type==="track"?{kind:"track",origin:"customer",event:t}:{kind:"track",origin:"customer",type:e.type,event:t};if(o!==void 0)n.properties=o;if(r!==void 0)n.messageId=r;if(e.options?.externalIds!==void 0)n.context={externalIds:e.options.externalIds};return n};export{N as buildCustomerOccurrenceCommand};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=D28B166933FF8D0B64756E2164756E21
|
|
4
4
|
//# sourceMappingURL=customer-occurrence-command.js.map
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../protocol/dist/host/external-id-argument-guards.js", "../../../protocol/dist/internal/sdk-event-options.js", "../../src/internal/customer-occurrence-command.ts"],
|
|
3
|
+
"sources": ["../../../protocol/dist/host/external-id-argument-guards.js", "../../../protocol/dist/internal/sdk-event-options.js", "../../../protocol/dist/json-date-normalization.js", "../../src/internal/customer-occurrence-command.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"const isObjectRecord = (value) => value !== null && typeof value === \"object\" && !Array.isArray(value);\nconst hasSegmentExternalIdsProperty = (value) => {\n if (!isObjectRecord(value)) {\n return false;\n }\n const externalIds = Object.entries(value).find(([key]) => key === \"externalIds\")?.[1];\n return (Array.isArray(externalIds) &&\n externalIds.length > 0 &&\n externalIds.every(isSegmentExternalIdLike));\n};\nconst isSegmentExternalIdLike = (value) => {\n if (!isObjectRecord(value)) {\n return false;\n }\n return (typeof value.id === \"string\" &&\n typeof value.type === \"string\" &&\n value.collection === \"users\" &&\n value.encoding === \"none\");\n};\nexport const assertNoSegmentExternalIdsInValueArgument = ({ argument, commandName, valueArgumentName, callShape, }) => {\n if (!hasSegmentExternalIdsProperty(argument)) {\n return;\n }\n throw new Error(`${commandName} received externalIds in the ${valueArgumentName} argument. Use ${callShape} instead.`);\n};\n",
|
|
6
6
|
"const MAX_MESSAGE_ID_LENGTH = 255;\nconst MAX_OCCURRENCE_NAME_LENGTH = 255;\n// Governed by docs/specs/2026-08-28-sdk-customer-occurrence.md.\n/** @internal Validates and normalizes an SDK-supplied occurrence name. */\nexport function parseCustomerOccurrenceName(name, argumentName) {\n if (typeof name !== \"string\") {\n throw new Error(`${argumentName} must be a non-empty string`);\n }\n const normalized = name.trim();\n if (normalized.length === 0) {\n throw new Error(`${argumentName} must be a non-empty string`);\n }\n if (normalized.length > MAX_OCCURRENCE_NAME_LENGTH) {\n throw new Error(`${argumentName} must be at most ${MAX_OCCURRENCE_NAME_LENGTH} characters`);\n }\n return normalized;\n}\n/** @internal Validates an SDK-supplied occurrence ID without normalizing it. */\nexport function parseTrackMessageId(messageId) {\n if (messageId === undefined) {\n return undefined;\n }\n if (typeof messageId !== \"string\" || messageId.trim().length === 0) {\n throw new Error(\"messageId must be a non-empty string\");\n }\n if (messageId.length > MAX_MESSAGE_ID_LENGTH) {\n throw new Error(`messageId must be at most ${MAX_MESSAGE_ID_LENGTH} characters`);\n }\n return messageId;\n}\n",
|
|
7
|
-
"
|
|
7
|
+
"export function normalizeDateValuesInProtocolJsonValue(value) {\n if (value !== null && typeof value === \"object\") {\n let time;\n try {\n time = Date.prototype.getTime.call(value);\n }\n catch {\n // Non-Date objects continue through the JSON container checks below.\n }\n if (time !== undefined) {\n if (!Number.isFinite(time)) {\n throw new RangeError(\"Invalid Date\");\n }\n return Date.prototype.toISOString.call(value);\n }\n }\n if (Array.isArray(value)) {\n const normalized = [];\n for (let index = 0; index < value.length; index += 1) {\n if (!Object.hasOwn(value, index)) {\n throw new TypeError(\"Sparse arrays are not supported\");\n }\n normalized.push(normalizeDateValuesInProtocolJsonValue(value[index]));\n }\n return normalized;\n }\n if (value !== null && typeof value === \"object\") {\n const prototype = Object.getPrototypeOf(value);\n const ownKeys = Reflect.ownKeys(value);\n if (ownKeys.includes(\"__proto__\") ||\n ownKeys.some((key) => typeof key === \"symbol\")) {\n throw new TypeError('JSON objects cannot contain own \"__proto__\" or symbol keys.');\n }\n let objectConstructor;\n let objectConstructorName;\n try {\n objectConstructor =\n prototype === null || prototype === Object.prototype\n ? undefined\n : Object.getOwnPropertyDescriptor(prototype, \"constructor\")?.value;\n objectConstructorName =\n typeof objectConstructor === \"function\"\n ? Object.getOwnPropertyDescriptor(objectConstructor, \"name\")?.value\n : undefined;\n }\n catch {\n throw new TypeError(\"Expected a plain JSON object\");\n }\n if (prototype !== null &&\n prototype !== Object.prototype &&\n !(Object.getPrototypeOf(prototype) === null &&\n typeof objectConstructor === \"function\" &&\n objectConstructorName === \"Object\")) {\n throw new TypeError(\"Expected a plain JSON object\");\n }\n for (const key of ownKeys) {\n if (!Object.getOwnPropertyDescriptor(value, key)?.enumerable) {\n throw new TypeError(\"Non-enumerable JSON properties are not supported\");\n }\n }\n const normalized = {};\n for (const key of ownKeys) {\n if (typeof key === \"string\") {\n Object.defineProperty(normalized, key, {\n value: normalizeDateValuesInProtocolJsonValue(Reflect.get(value, key)),\n enumerable: true,\n configurable: true,\n writable: true,\n });\n }\n }\n return normalized;\n }\n return value;\n}\n// oxlint-enable anti-slop/no-unknown-returns\n",
|
|
8
|
+
"import type {\n\tAppEventJsonInputValue,\n\tAppEventOccurrenceType,\n\tPublicCommandPayload,\n} from \"@getuserfeedback/protocol\";\nimport type { TrackOptions } from \"@getuserfeedback/protocol/host\";\nimport { assertNoSegmentExternalIdsInValueArgument } from \"@getuserfeedback/protocol/host\";\nimport {\n\tparseCustomerOccurrenceName,\n\tparseTrackMessageId,\n} from \"@getuserfeedback/protocol/internal/sdk-event-options\";\nimport { normalizeDateValuesInProtocolJsonValue } from \"@getuserfeedback/protocol/json-date-normalization\";\n\nexport type EventProperties = Record<string, AppEventJsonInputValue>;\nexport type EventOptions = TrackOptions;\n\ntype CustomerOccurrenceCommand = Extract<\n\tPublicCommandPayload,\n\t{ kind: \"track\" }\n>;\n\nconst occurrenceCallShapes = {\n\tpage: \"page(name, properties, { externalIds })\",\n\tscreen: \"screen(name, properties, { externalIds })\",\n\ttrack: \"track(eventName, properties, { externalIds })\",\n} as const;\n\nconst occurrenceArgumentNames = {\n\tpage: \"pageName\",\n\tscreen: \"screenName\",\n\ttrack: \"eventName\",\n} as const;\n\nexport const buildCustomerOccurrenceCommand = (input: {\n\ttype: AppEventOccurrenceType;\n\tevent: string;\n\tproperties?: EventProperties;\n\toptions?: EventOptions;\n}): CustomerOccurrenceCommand => {\n\tconst event = parseCustomerOccurrenceName(\n\t\tinput.event,\n\t\toccurrenceArgumentNames[input.type],\n\t);\n\tconst messageId = parseTrackMessageId(input.options?.messageId);\n\tconst properties =\n\t\tinput.properties === undefined\n\t\t\t? undefined\n\t\t\t: normalizeDateValuesInProtocolJsonValue(input.properties);\n\tassertNoSegmentExternalIdsInValueArgument({\n\t\targument: properties,\n\t\tcommandName: input.type,\n\t\tvalueArgumentName: \"properties\",\n\t\tcallShape: occurrenceCallShapes[input.type],\n\t});\n\n\tconst command: CustomerOccurrenceCommand =\n\t\tinput.type === \"track\"\n\t\t\t? {\n\t\t\t\t\tkind: \"track\",\n\t\t\t\t\torigin: \"customer\",\n\t\t\t\t\tevent,\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tkind: \"track\",\n\t\t\t\t\torigin: \"customer\",\n\t\t\t\t\ttype: input.type,\n\t\t\t\t\tevent,\n\t\t\t\t};\n\tif (properties !== undefined) {\n\t\tcommand.properties = properties;\n\t}\n\tif (messageId !== undefined) {\n\t\tcommand.messageId = messageId;\n\t}\n\tif (input.options?.externalIds !== undefined) {\n\t\tcommand.context = { externalIds: input.options.externalIds };\n\t}\n\treturn command;\n};\n"
|
|
8
9
|
],
|
|
9
|
-
"mappings": "AAAA,IAAM,EAAiB,CAAC,IAAU,IAAU,MAAQ,OAAO,IAAU,UAAY,CAAC,MAAM,QAAQ,CAAK,EAC/F,EAAgC,CAAC,IAAU,CAC7C,GAAI,CAAC,EAAe,CAAK,EACrB,MAAO,GAEX,IAAM,EAAc,OAAO,QAAQ,CAAK,EAAE,KAAK,EAAE,KAAS,IAAQ,aAAa,IAAI,GACnF,OAAQ,MAAM,QAAQ,CAAW,GAC7B,EAAY,OAAS,GACrB,EAAY,MAAM,CAAuB,GAE3C,EAA0B,CAAC,IAAU,CACvC,GAAI,CAAC,EAAe,CAAK,EACrB,MAAO,GAEX,OAAQ,OAAO,EAAM,KAAO,UACxB,OAAO,EAAM,OAAS,UACtB,EAAM,aAAe,SACrB,EAAM,WAAa,QAEd,EAA4C,EAAG,WAAU,cAAa,oBAAmB,eAAiB,CACnH,GAAI,CAAC,EAA8B,CAAQ,EACvC,OAEJ,MAAU,MAAM,GAAG,iCAA2C,mBAAmC,YAAoB,GCnBlH,SAAS,CAA2B,CAAC,EAAM,EAAc,CAC5D,GAAI,OAAO,IAAS,SAChB,MAAU,MAAM,GAAG,8BAAyC,EAEhE,IAAM,EAAa,EAAK,KAAK,EAC7B,GAAI,EAAW,SAAW,EACtB,MAAU,MAAM,GAAG,8BAAyC,EAEhE,GAAI,EAAW,OAXgB,IAY3B,MAAU,MAAM,GAAG,kCAAuE,EAE9F,OAAO,EAGJ,SAAS,CAAmB,CAAC,EAAW,CAC3C,GAAI,IAAc,OACd,OAEJ,GAAI,OAAO,IAAc,UAAY,EAAU,KAAK,EAAE,SAAW,EAC7D,MAAU,MAAM,sCAAsC,EAE1D,GAAI,EAAU,OAzBY,IA0BtB,MAAU,MAAM,0CAA+D,EAEnF,OAAO,
|
|
10
|
-
"debugId": "
|
|
10
|
+
"mappings": "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",
|
|
11
|
+
"debugId": "D28B166933FF8D0B64756E2164756E21",
|
|
11
12
|
"names": []
|
|
12
13
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
type FlowOpenRequestController = {
|
|
2
2
|
/** Releases admission for a new call without cancelling the current request. */
|
|
3
3
|
clear: () => void;
|
|
4
|
+
isPending: () => boolean;
|
|
4
5
|
run: (start: () => Promise<void>) => Promise<void>;
|
|
5
6
|
};
|
|
6
7
|
/**
|
|
7
8
|
* Coalesces one pending FlowRun.open call without owning transport or flow
|
|
8
9
|
* lifecycle state.
|
|
9
10
|
*/
|
|
10
|
-
declare const createFlowOpenRequestController: () => FlowOpenRequestController;
|
|
11
|
+
declare const createFlowOpenRequestController: (onPendingChange?: () => void) => FlowOpenRequestController;
|
|
11
12
|
|
|
12
13
|
export { createFlowOpenRequestController };
|
|
13
14
|
export type { FlowOpenRequestController };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var v=(o)=>{let e=null;return{clear:()=>{if(!e)return;e=null,o?.()},isPending:()=>e!==null,run:(u)=>{if(e)return e;let n,i,t=new Promise((r,s)=>{n=r,i=s});e=t;let l;try{l=u()}catch(r){l=Promise.reject(r)}return o?.(),l.then(()=>{if(e===t)e=null,o?.();n()},(r)=>{if(e===t)e=null,o?.();i(r)}),t}}};export{v as createFlowOpenRequestController};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=7277738213383DC364756E2164756E21
|
|
4
4
|
//# sourceMappingURL=flow-open-request-controller.js.map
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/internal/flow-open-request-controller.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"export type FlowOpenRequestController = {\n\t/** Releases admission for a new call without cancelling the current request. */\n\tclear: () => void;\n\trun: (start: () => Promise<void>) => Promise<void>;\n};\n\n/**\n * Coalesces one pending FlowRun.open call without owning transport or flow\n * lifecycle state.\n */\nexport const createFlowOpenRequestController
|
|
5
|
+
"export type FlowOpenRequestController = {\n\t/** Releases admission for a new call without cancelling the current request. */\n\tclear: () => void;\n\tisPending: () => boolean;\n\trun: (start: () => Promise<void>) => Promise<void>;\n};\n\n/**\n * Coalesces one pending FlowRun.open call without owning transport or flow\n * lifecycle state.\n */\nexport const createFlowOpenRequestController = (\n\tonPendingChange?: () => void,\n): FlowOpenRequestController => {\n\tlet pendingRequest: Promise<void> | null = null;\n\n\tconst run: FlowOpenRequestController[\"run\"] = (start) => {\n\t\tif (pendingRequest) {\n\t\t\treturn pendingRequest;\n\t\t}\n\n\t\tlet resolvePendingRequest!: () => void;\n\t\tlet rejectPendingRequest!: (error: unknown) => void;\n\t\tconst sharedRequest = new Promise<void>((resolve, reject) => {\n\t\t\tresolvePendingRequest = resolve;\n\t\t\trejectPendingRequest = reject;\n\t\t});\n\t\tpendingRequest = sharedRequest;\n\n\t\tlet request: Promise<void>;\n\t\ttry {\n\t\t\trequest = start();\n\t\t} catch (error) {\n\t\t\trequest = Promise.reject(error);\n\t\t}\n\n\t\tonPendingChange?.();\n\n\t\tvoid request.then(\n\t\t\t() => {\n\t\t\t\tif (pendingRequest === sharedRequest) {\n\t\t\t\t\tpendingRequest = null;\n\t\t\t\t\tonPendingChange?.();\n\t\t\t\t}\n\t\t\t\tresolvePendingRequest();\n\t\t\t},\n\t\t\t(error) => {\n\t\t\t\tif (pendingRequest === sharedRequest) {\n\t\t\t\t\tpendingRequest = null;\n\t\t\t\t\tonPendingChange?.();\n\t\t\t\t}\n\t\t\t\trejectPendingRequest(error);\n\t\t\t},\n\t\t);\n\t\treturn sharedRequest;\n\t};\n\n\treturn {\n\t\tclear: () => {\n\t\t\tif (!pendingRequest) return;\n\t\t\tpendingRequest = null;\n\t\t\tonPendingChange?.();\n\t\t},\n\t\tisPending: () => pendingRequest !== null,\n\t\trun,\n\t};\n};\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": "AAWO,IAAM,EAAkC,CAC9C,IAC+B,CAC/B,IAAI,EAAuC,KA2C3C,MAAO,CACN,MAAO,IAAM,CACZ,GAAI,CAAC,EAAgB,OACrB,EAAiB,KACjB,IAAkB,GAEnB,UAAW,IAAM,IAAmB,KACpC,IAhD6C,CAAC,IAAU,CACxD,GAAI,EACH,OAAO,EAGR,IAAI,EACA,EACE,EAAgB,IAAI,QAAc,CAAC,EAAS,IAAW,CAC5D,EAAwB,EACxB,EAAuB,EACvB,EACD,EAAiB,EAEjB,IAAI,EACJ,GAAI,CACH,EAAU,EAAM,EACf,MAAO,EAAO,CACf,EAAU,QAAQ,OAAO,CAAK,EAqB/B,OAlBA,IAAkB,EAEb,EAAQ,KACZ,IAAM,CACL,GAAI,IAAmB,EACtB,EAAiB,KACjB,IAAkB,EAEnB,EAAsB,GAEvB,CAAC,IAAU,CACV,GAAI,IAAmB,EACtB,EAAiB,KACjB,IAAkB,EAEnB,EAAqB,CAAK,EAE5B,EACO,EAWR",
|
|
8
|
+
"debugId": "7277738213383DC364756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AppEventIdentity } from '@getuserfeedback/protocol/host';
|
|
2
|
+
import { AppEventJsonInputValue } from '@getuserfeedback/protocol';
|
|
3
|
+
|
|
4
|
+
type EventProperties = Record<string, AppEventJsonInputValue>;
|
|
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,9 +1,9 @@
|
|
|
1
1
|
import { InlineFlow } from '@getuserfeedback/protocol/internal/inline-flow';
|
|
2
2
|
export { InlineFlow } from '@getuserfeedback/protocol/internal/inline-flow';
|
|
3
|
-
import {
|
|
4
|
-
import { TrackOptions, OpenRequestedDetail, ClientOptions, ResponseMetadataInput, FlowRenderState, WidgetLayoutTransitionPolicy, ContainerPolicy, ConfigureOptions, IdentifyOptions } from '@getuserfeedback/protocol/host';
|
|
3
|
+
import { AppEventJsonInputValue, ListInstanceFeedbackMineRequest, ListInstanceFeedbackMineResponse, CaptureInstanceFeedbackRequest, CaptureInstanceFeedbackResponse } from '@getuserfeedback/protocol';
|
|
4
|
+
import { TrackOptions, OpenRequestedDetail, ClientOptions, ResponseMetadataInput, FlowRenderState, WidgetLayoutTransitionPolicy, ContainerPolicy, ConfigureOptions, IdentifyOptions, AppEventIdentity } from '@getuserfeedback/protocol/host';
|
|
5
5
|
|
|
6
|
-
type EventProperties = Record<string,
|
|
6
|
+
type EventProperties = Record<string, AppEventJsonInputValue>;
|
|
7
7
|
type EventOptions = TrackOptions;
|
|
8
8
|
|
|
9
9
|
type OpenRequestedPayload = OpenRequestedDetail;
|
|
@@ -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 = {
|
|
@@ -54,7 +63,7 @@ type GraphOperations = {
|
|
|
54
63
|
disconnect: (relationship: GraphRelationship) => Promise<void>;
|
|
55
64
|
};
|
|
56
65
|
|
|
57
|
-
/**
|
|
66
|
+
/** Current flow state (open/loading and dimensions when known). */
|
|
58
67
|
interface FlowState extends FlowRenderState {
|
|
59
68
|
/**
|
|
60
69
|
* @deprecated Stop reading this field. SDK state snapshots and subscriptions
|
|
@@ -100,7 +109,7 @@ type SubscribeFlowStateOptions = {
|
|
|
100
109
|
type FlowRun = {
|
|
101
110
|
/** The flow/survey ID this instance refers to. */
|
|
102
111
|
flowId: string;
|
|
103
|
-
/** Open the flow
|
|
112
|
+
/** Open the flow. Immediately reports loading until the open settles or close/reset clears its intent. */
|
|
104
113
|
open: (options?: OpenFlowOptions) => Promise<void>;
|
|
105
114
|
/** Prefetch the flow so it opens faster when you call `open()`. */
|
|
106
115
|
prefetch: () => Promise<void>;
|
|
@@ -143,7 +152,7 @@ type Client = {
|
|
|
143
152
|
*
|
|
144
153
|
* When using `disableAutoLoad`, call `load()` first. Calls made before `load()`
|
|
145
154
|
* resolve without applying the update. Provide the initial color scheme,
|
|
146
|
-
* default consent, and
|
|
155
|
+
* default consent, and properties to `createClient()`; configure auth after
|
|
147
156
|
* `load()`.
|
|
148
157
|
*
|
|
149
158
|
* @see https://getuserfeedback.com/docs/security-and-privacy/jwt-auth
|
|
@@ -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 J;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.")}}(J=globalThis).__zod_globalConfig??(J.__zod_globalConfig={});var N=globalThis.__zod_globalConfig;function y(e){if(e)Object.assign(N,e);return N}function X(e,t){if(typeof t==="bigint")return t.toString();return t}function Q(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function ee(e){return e===null||e===void 0}function te(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}var Y=Symbol("evaluating");function v(e,t,n){let r=void 0;Object.defineProperty(e,t,{get(){if(r===Y)return;if(r===void 0)r=Y,r=n();return r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}var H="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ne(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 re(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 I(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 oe(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 O(e){return typeof e==="string"?e:e?.message}function x(e,t,n){let r=e.message?e.message:O(e.inst?._zod.def?.error?.(e))??O(t?.error?.(e))??O(n.customError?.(e))??O(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 ie(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}var se=(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,X,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ce=d("$ZodError",se),R=d("$ZodError",se,{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(R),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(R),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??ce)(c.issues.map((o)=>x(o,s,y())))}:{success:!0,data:c.value}},E=Ae(R),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}},S=Fe(R);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 ue=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var Z=d("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])});var le=d("$ZodCheckMinLength",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=(r)=>{let s=r.value;return!ee(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=ie(s);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}});var de=d("$ZodCheckOverwrite",(e,t)=>{Z.init(e,t),e._zod.check=(n)=>{n.value=t.tx(n.value)}});var pe={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=pe;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=I(o),l;for(let f of i){if(f._zod.def.when){if(oe(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=I(o,p)});else{if(o.issues.length===p)continue;if(!u)u=I(o,p)}}if(l)return l.then(()=>o);return o},c=(o,i,a)=>{if(I(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=E(e,s);return c.success?{value:c.data}:{issues:c.error?.issues}}catch(c){return S(e,s).then((o)=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),me=d("$ZodString",(e,t)=>{b.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ue(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 he=d("$ZodUnknown",(e,t)=>{b.init(e,t),e._zod.parse=(n)=>n}),ge=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=re(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 _e=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=Q(()=>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=ne,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",W=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,_,W)));else F(M,i,p,u,_,W)}if(!c)return l.length?Promise.all(l).then(()=>i):i;return He(l,u,i,a,r.value,e)}});function fe(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var ve=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(`^(${te(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)=>fe(o,s));return fe(c,s)}if(n.value===void 0)return n;return t.innerType._zod.run(n,r)}});function we(e,t){return new e({type:"string",...w(t)})}function be(e){return new e({type:"unknown"})}function ye(e,t){return new e({type:"never",...w(t)})}function T(e,t){return new le({check:"min_length",...w(t),minimum:e})}function xe(e){return new de({check:"overwrite",tx:e})}function L(){return xe((e)=>e.trim())}var P=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)=>E(e,n,r),e.parseAsync=async(n,r)=>A(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>S(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)=>{me.init(e,t),P.init(e,t)});function U(e){return we(Be,e)}var Ve=d("ZodMiniUnknown",(e,t)=>{he.init(e,t),P.init(e,t)});function B(){return be(Ve)}var Ge=d("ZodMiniNever",(e,t)=>{ge.init(e,t),P.init(e,t)});function Ke(e){return ye(Ge,e)}var We=d("ZodMiniObject",(e,t)=>{_e.init(e,t),P.init(e,t),v(e,"shape",()=>t.shape)});function V(e,t){return new We({type:"object",shape:e,catchall:Ke(),...w(t)})}var Je=d("ZodMiniOptional",(e,t)=>{ve.init(e,t),P.init(e,t)});function k(e){return new Je({type:"optional",innerType:e})}function G(e,t){let n=new Z({check:"custom",...w(t)});return n._zod.check=e,n}var ze=["id","organizationId","versionId","versionNumber"],Qe=V({css:k(U()),themePayload:k(B()),themeRuntimeArtifactId:k(U().check(L(),T(1))),themeVersionId:k(U().check(L(),T(1)))}).check(G((e)=>{if("themePayload"in e.value&&e.value.css!==void 0)e.issues.push({code:"custom",input:e.value,message:"Inline themes cannot mix CSS and a complete payload.",continue:!1})})),$e=V({definition:B().check(G((e)=>{if(e.value!==void 0)return;e.issues.push({code:"custom",input:e.value,message:"Inline flow definition is required.",continue:!1})})),theme:k(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.20.0".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};if(e.colorScheme!==void 0)t.colorScheme=e.colorScheme;if(e.disableAutoLoad!==void 0)t.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.")},K=(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(K(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:K(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=K(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=$e.parse(st(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 Ee(t)},os=(e,t)=>Ie(e).createInlineFlowRun(ct(t));export{ot as createBundledDocsClientOptions,os as createInlineFlow};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=C9092F56A91DB85364756E2164756E21
|
|
4
4
|
//# sourceMappingURL=inline-flow.js.map
|