@skedulo/mexwex-bridge 0.0.2 → 0.0.3
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.mts +33 -1
- package/dist/index.d.ts +33 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -14,6 +14,8 @@ declare const BridgeMethods: {
|
|
|
14
14
|
readonly sendExtensionMandatoryStatus: "sendExtensionMandatoryStatus";
|
|
15
15
|
readonly exit: "exit";
|
|
16
16
|
readonly collectTapToPayPayment: "collectTapToPayPayment";
|
|
17
|
+
readonly captureSignature: "captureSignature";
|
|
18
|
+
readonly addSignature: "addSignature";
|
|
17
19
|
};
|
|
18
20
|
/** Available attachment picker sources */
|
|
19
21
|
type AttachmentSource = 'camera' | 'photoLibrary' | 'files';
|
|
@@ -77,6 +79,32 @@ interface TapToPayResult {
|
|
|
77
79
|
paymentIntentId?: string;
|
|
78
80
|
error?: string;
|
|
79
81
|
}
|
|
82
|
+
/** Parameters for capturing a signature via the native signature screen */
|
|
83
|
+
interface CaptureSignatureOptions {
|
|
84
|
+
/** Show the full-name field on the native screen. Defaults to false. */
|
|
85
|
+
enableFullName?: boolean;
|
|
86
|
+
}
|
|
87
|
+
/** Result of a successful signature capture */
|
|
88
|
+
interface CaptureSignatureResult {
|
|
89
|
+
/** Local file path to the captured signature image */
|
|
90
|
+
uri: string;
|
|
91
|
+
/** Generated file name, e.g. "signature-<uuid>.png". Informational only — addSignature ignores it. */
|
|
92
|
+
fileName: string;
|
|
93
|
+
/** Full name entered by the signer. Only present when CaptureSignatureOptions.enableFullName === true. */
|
|
94
|
+
fullName?: string;
|
|
95
|
+
}
|
|
96
|
+
/** Parameters for persisting a captured signature to the native layer */
|
|
97
|
+
interface AddSignatureParams {
|
|
98
|
+
/** The captured signature to persist */
|
|
99
|
+
signature: {
|
|
100
|
+
uri: string;
|
|
101
|
+
fullName?: string;
|
|
102
|
+
};
|
|
103
|
+
/** The parent object ID to associate the signature with */
|
|
104
|
+
parentContextId: string;
|
|
105
|
+
/** Optional category name for the signature */
|
|
106
|
+
categoryName?: string;
|
|
107
|
+
}
|
|
80
108
|
|
|
81
109
|
declare global {
|
|
82
110
|
interface Window {
|
|
@@ -121,8 +149,12 @@ declare class MexBridge {
|
|
|
121
149
|
exit(): Promise<void>;
|
|
122
150
|
/** Initiate a Tap to Pay payment via Stripe Terminal on the native device */
|
|
123
151
|
collectTapToPayPayment(params: TapToPayParams): Promise<TapToPayResult>;
|
|
152
|
+
/** Open the native signature screen. Resolves with the captured signature, or null if the user cancels. */
|
|
153
|
+
captureSignature(options?: CaptureSignatureOptions): Promise<CaptureSignatureResult | null>;
|
|
154
|
+
/** Persist a captured signature to the native mobile layer */
|
|
155
|
+
addSignature(params: AddSignatureParams): Promise<any>;
|
|
124
156
|
}
|
|
125
157
|
|
|
126
158
|
declare const mexBridge: MexBridge;
|
|
127
159
|
|
|
128
|
-
export { type AddAttachmentsParams, type AttachmentMetadata, type AttachmentSource, type AttachmentsByParentIdResult, type AuthenticationInfo, BridgeMethods, type CaptureAttachmentsParams, type FormMetadata, MexBridge, type PickedFile, type TapToPayParams, type TapToPayResult, mexBridge };
|
|
160
|
+
export { type AddAttachmentsParams, type AddSignatureParams, type AttachmentMetadata, type AttachmentSource, type AttachmentsByParentIdResult, type AuthenticationInfo, BridgeMethods, type CaptureAttachmentsParams, type CaptureSignatureOptions, type CaptureSignatureResult, type FormMetadata, MexBridge, type PickedFile, type TapToPayParams, type TapToPayResult, mexBridge };
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ declare const BridgeMethods: {
|
|
|
14
14
|
readonly sendExtensionMandatoryStatus: "sendExtensionMandatoryStatus";
|
|
15
15
|
readonly exit: "exit";
|
|
16
16
|
readonly collectTapToPayPayment: "collectTapToPayPayment";
|
|
17
|
+
readonly captureSignature: "captureSignature";
|
|
18
|
+
readonly addSignature: "addSignature";
|
|
17
19
|
};
|
|
18
20
|
/** Available attachment picker sources */
|
|
19
21
|
type AttachmentSource = 'camera' | 'photoLibrary' | 'files';
|
|
@@ -77,6 +79,32 @@ interface TapToPayResult {
|
|
|
77
79
|
paymentIntentId?: string;
|
|
78
80
|
error?: string;
|
|
79
81
|
}
|
|
82
|
+
/** Parameters for capturing a signature via the native signature screen */
|
|
83
|
+
interface CaptureSignatureOptions {
|
|
84
|
+
/** Show the full-name field on the native screen. Defaults to false. */
|
|
85
|
+
enableFullName?: boolean;
|
|
86
|
+
}
|
|
87
|
+
/** Result of a successful signature capture */
|
|
88
|
+
interface CaptureSignatureResult {
|
|
89
|
+
/** Local file path to the captured signature image */
|
|
90
|
+
uri: string;
|
|
91
|
+
/** Generated file name, e.g. "signature-<uuid>.png". Informational only — addSignature ignores it. */
|
|
92
|
+
fileName: string;
|
|
93
|
+
/** Full name entered by the signer. Only present when CaptureSignatureOptions.enableFullName === true. */
|
|
94
|
+
fullName?: string;
|
|
95
|
+
}
|
|
96
|
+
/** Parameters for persisting a captured signature to the native layer */
|
|
97
|
+
interface AddSignatureParams {
|
|
98
|
+
/** The captured signature to persist */
|
|
99
|
+
signature: {
|
|
100
|
+
uri: string;
|
|
101
|
+
fullName?: string;
|
|
102
|
+
};
|
|
103
|
+
/** The parent object ID to associate the signature with */
|
|
104
|
+
parentContextId: string;
|
|
105
|
+
/** Optional category name for the signature */
|
|
106
|
+
categoryName?: string;
|
|
107
|
+
}
|
|
80
108
|
|
|
81
109
|
declare global {
|
|
82
110
|
interface Window {
|
|
@@ -121,8 +149,12 @@ declare class MexBridge {
|
|
|
121
149
|
exit(): Promise<void>;
|
|
122
150
|
/** Initiate a Tap to Pay payment via Stripe Terminal on the native device */
|
|
123
151
|
collectTapToPayPayment(params: TapToPayParams): Promise<TapToPayResult>;
|
|
152
|
+
/** Open the native signature screen. Resolves with the captured signature, or null if the user cancels. */
|
|
153
|
+
captureSignature(options?: CaptureSignatureOptions): Promise<CaptureSignatureResult | null>;
|
|
154
|
+
/** Persist a captured signature to the native mobile layer */
|
|
155
|
+
addSignature(params: AddSignatureParams): Promise<any>;
|
|
124
156
|
}
|
|
125
157
|
|
|
126
158
|
declare const mexBridge: MexBridge;
|
|
127
159
|
|
|
128
|
-
export { type AddAttachmentsParams, type AttachmentMetadata, type AttachmentSource, type AttachmentsByParentIdResult, type AuthenticationInfo, BridgeMethods, type CaptureAttachmentsParams, type FormMetadata, MexBridge, type PickedFile, type TapToPayParams, type TapToPayResult, mexBridge };
|
|
160
|
+
export { type AddAttachmentsParams, type AddSignatureParams, type AttachmentMetadata, type AttachmentSource, type AttachmentsByParentIdResult, type AuthenticationInfo, BridgeMethods, type CaptureAttachmentsParams, type CaptureSignatureOptions, type CaptureSignatureResult, type FormMetadata, MexBridge, type PickedFile, type TapToPayParams, type TapToPayResult, mexBridge };
|
package/dist/index.js
CHANGED
|
@@ -41,7 +41,9 @@ var BridgeMethods = {
|
|
|
41
41
|
getLocalizedString: "getLocalizedString",
|
|
42
42
|
sendExtensionMandatoryStatus: "sendExtensionMandatoryStatus",
|
|
43
43
|
exit: "exit",
|
|
44
|
-
collectTapToPayPayment: "collectTapToPayPayment"
|
|
44
|
+
collectTapToPayPayment: "collectTapToPayPayment",
|
|
45
|
+
captureSignature: "captureSignature",
|
|
46
|
+
addSignature: "addSignature"
|
|
45
47
|
};
|
|
46
48
|
|
|
47
49
|
// src/MexBridge.ts
|
|
@@ -152,6 +154,14 @@ var MexBridge = class {
|
|
|
152
154
|
collectTapToPayPayment(params) {
|
|
153
155
|
return this._call(BridgeMethods.collectTapToPayPayment, params, 12e4);
|
|
154
156
|
}
|
|
157
|
+
/** Open the native signature screen. Resolves with the captured signature, or null if the user cancels. */
|
|
158
|
+
captureSignature(options) {
|
|
159
|
+
return this._call(BridgeMethods.captureSignature, options, 12e4);
|
|
160
|
+
}
|
|
161
|
+
/** Persist a captured signature to the native mobile layer */
|
|
162
|
+
addSignature(params) {
|
|
163
|
+
return this._call(BridgeMethods.addSignature, params);
|
|
164
|
+
}
|
|
155
165
|
};
|
|
156
166
|
|
|
157
167
|
// src/index.ts
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/types.ts","../src/MexBridge.ts"],"sourcesContent":["export { MexBridge } from './MexBridge'\nexport { BridgeMethods } from './types'\nexport type {\n CaptureAttachmentsParams,\n AddAttachmentsParams,\n AttachmentSource,\n PickedFile,\n AttachmentMetadata,\n AttachmentsByParentIdResult,\n AuthenticationInfo,\n FormMetadata,\n TapToPayParams,\n TapToPayResult,\n} from './types'\n\n// Singleton instance for convenience\nimport { MexBridge } from './MexBridge'\nexport const mexBridge = new MexBridge()\n","/** Bridge method name constants — shared between web SDK and native handlers */\nexport const BridgeMethods = {\n getInstanceData: 'getInstanceData',\n getStaticData: 'getStaticData',\n captureAttachments: 'captureAttachments',\n addAttachments: 'addAttachments',\n removeAttachment: 'removeAttachment',\n getAttachment: 'getAttachment',\n getAttachmentsByParentId: 'getAttachmentsByParentId',\n saveInstanceData: 'saveInstanceData',\n getMetadata: 'getMetadata',\n getAuthenticationInfo: 'getAuthenticationInfo',\n getLocalizedString: 'getLocalizedString',\n sendExtensionMandatoryStatus: 'sendExtensionMandatoryStatus',\n exit: 'exit',\n collectTapToPayPayment: 'collectTapToPayPayment',\n} as const\n\n/** Available attachment picker sources */\nexport type AttachmentSource = 'camera' | 'photoLibrary' | 'files'\n\n/** Parameters for capturing attachments via native pickers */\nexport interface CaptureAttachmentsParams {\n /** Which picker sources to offer. Defaults to all three. If only one, opens directly without bottom sheet. */\n sources?: AttachmentSource[]\n}\n\n/** A file picked from a native picker (camera, photo library, or file browser) */\nexport interface PickedFile {\n uri: string\n fileName: string\n}\n\n/** Parameters for persisting captured attachments to the native layer */\nexport interface AddAttachmentsParams {\n /** The picked files to persist */\n attachments: PickedFile[]\n /** The parent object ID to associate attachments with */\n parentContextId: string\n /** Optional category name for the attachments */\n categoryName?: string\n}\n\n/** Metadata about a stored attachment (returned by getAttachment) */\nexport interface AttachmentMetadata {\n uid: string\n fileName: string\n downloadURL?: string\n status?: string\n contentType?: string\n}\n\n/** Result of getAttachmentsByParentId — matches MexAttachmentsOnParentContextChangedResult */\nexport interface AttachmentsByParentIdResult {\n attachments: AttachmentMetadata[]\n parentId: string\n}\n\n/** Authentication information for the current user */\nexport interface AuthenticationInfo {\n accessToken: string\n apiUrl: string\n userId?: string\n}\n\n/** Form metadata */\nexport interface FormMetadata {\n contextObjectId: string\n packageId: string\n formName?: string\n contextObject?: string\n user?: Record<string, any>\n job?: Record<string, any>\n timezone?: Record<string, any>\n}\n\n/** Parameters for initiating a Tap to Pay payment via Stripe Terminal */\nexport interface TapToPayParams {\n connectionToken: string\n clientSecret: string\n locationId: string\n}\n\n/** Result of a Tap to Pay payment attempt */\nexport interface TapToPayResult {\n success: boolean\n paymentIntentId?: string\n error?: string\n}\n\n/** Internal bridge message from web to RN */\nexport interface BridgeCallMessage {\n type: 'bridge_call'\n method: string\n requestId: string\n params?: any\n}\n\n/** Internal bridge response from RN to web */\nexport interface BridgeResponseMessage {\n type: 'bridge_response'\n requestId: string\n result?: any\n error?: string\n}\n","import { BridgeMethods } from './types'\nimport type { CaptureAttachmentsParams, AddAttachmentsParams, PickedFile, AttachmentMetadata, AttachmentsByParentIdResult, AuthenticationInfo, FormMetadata, BridgeResponseMessage, TapToPayParams, TapToPayResult } from './types'\n\ntype PendingCallback = {\n resolve: (value: any) => void\n reject: (reason: any) => void\n timeoutId: ReturnType<typeof setTimeout>\n}\n\ndeclare global {\n interface Window {\n ReactNativeWebView?: {\n postMessage(message: string): void\n }\n onNativeMessage?: (messageString: string) => void\n }\n}\n\nconst DEFAULT_TIMEOUT_MS = 30_000\n\nclass MexBridge {\n private _callbacks = new Map<string, PendingCallback>()\n private _initialized = false\n\n constructor() {\n this._initialize()\n }\n\n private _initialize(): void {\n if (this._initialized) return\n this._initialized = true\n\n window.onNativeMessage = (messageString: string) => {\n try {\n const message: BridgeResponseMessage = JSON.parse(messageString)\n if (message.type !== 'bridge_response' || !message.requestId) return\n\n const pending = this._callbacks.get(message.requestId)\n if (!pending) return\n\n clearTimeout(pending.timeoutId)\n this._callbacks.delete(message.requestId)\n\n if (message.error) {\n pending.reject(new Error(message.error))\n } else {\n pending.resolve(message.result)\n }\n } catch (e) {\n console.warn('[MexBridge] Failed to parse native message:', e)\n }\n }\n }\n\n private _call<T = any>(method: string, params?: any, timeoutMs = DEFAULT_TIMEOUT_MS): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n if (!window.ReactNativeWebView) {\n reject(new Error('[MexBridge] Not running inside a React Native WebView'))\n return\n }\n\n const requestId = this._generateId()\n\n const timeoutId = setTimeout(() => {\n this._callbacks.delete(requestId)\n reject(new Error(`[MexBridge] Timeout: ${method} did not respond within ${timeoutMs}ms`))\n }, timeoutMs)\n\n this._callbacks.set(requestId, { resolve, reject, timeoutId })\n\n window.ReactNativeWebView.postMessage(JSON.stringify({\n type: 'bridge_call',\n method,\n requestId,\n params,\n }))\n })\n }\n\n private _generateId(): string {\n return Math.random().toString(36).substring(2) + Date.now().toString(36)\n }\n\n /** Fetch the current form instance data */\n getInstanceData(): Promise<any> {\n return this._call(BridgeMethods.getInstanceData)\n }\n\n /** Fetch static/shared data for the form */\n getStaticData(): Promise<any> {\n return this._call(BridgeMethods.getStaticData)\n }\n\n /** Open native picker(s) for camera, photo library, or files. Returns picked files or null if cancelled. */\n captureAttachments(params?: CaptureAttachmentsParams): Promise<PickedFile[] | null> {\n return this._call<PickedFile[] | null>(BridgeMethods.captureAttachments, params)\n }\n\n /** Persist captured attachments to the native mobile layer */\n addAttachments(params: AddAttachmentsParams): Promise<any> {\n return this._call(BridgeMethods.addAttachments, params)\n }\n\n /** Remove an existing attachment by ID */\n removeAttachment(attachmentId: string): Promise<boolean> {\n return this._call<boolean>(BridgeMethods.removeAttachment, { attachmentId })\n }\n\n /** Retrieve attachment metadata by ID */\n getAttachment(attachmentId: string): Promise<AttachmentMetadata> {\n return this._call<AttachmentMetadata>(BridgeMethods.getAttachment, { attachmentId })\n }\n\n /** Get all attachments for a parent object (one-shot, not observable) */\n getAttachmentsByParentId(parentContextId: string): Promise<AttachmentsByParentIdResult> {\n return this._call<AttachmentsByParentIdResult>(BridgeMethods.getAttachmentsByParentId, { parentContextId })\n }\n\n /** Persist form data back to the engine */\n saveInstanceData(data: any): Promise<boolean> {\n return this._call<boolean>(BridgeMethods.saveInstanceData, { data })\n }\n\n /** Retrieve form metadata (form name, context, user info, etc.) */\n getMetadata(): Promise<FormMetadata> {\n return this._call<FormMetadata>(BridgeMethods.getMetadata)\n }\n\n /** Get the current user's auth token and identity */\n getAuthenticationInfo(): Promise<AuthenticationInfo> {\n return this._call<AuthenticationInfo>(BridgeMethods.getAuthenticationInfo)\n }\n\n /** Get a localized string by key from the form's locale files */\n getLocalizedString(key: string): Promise<string> {\n return this._call<string>(BridgeMethods.getLocalizedString, { key })\n }\n\n /** Signal whether the form's mandatory requirements are satisfied */\n sendExtensionMandatoryStatus(isCompleted: boolean): Promise<boolean> {\n return this._call<boolean>(BridgeMethods.sendExtensionMandatoryStatus, { isCompleted })\n }\n\n /** Exit the form and return to the native app */\n exit(): Promise<void> {\n return this._call<void>(BridgeMethods.exit)\n }\n\n /** Initiate a Tap to Pay payment via Stripe Terminal on the native device */\n collectTapToPayPayment(params: TapToPayParams): Promise<TapToPayResult> {\n return this._call<TapToPayResult>(BridgeMethods.collectTapToPayPayment, params, 120_000)\n }\n}\n\nexport { MexBridge }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCO,IAAM,gBAAgB;AAAA,EAC3B,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,0BA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,EAC3E;AAAA;AAAA,EAGA,mBAAmB,KAA8B;AAC/C,WAAO,KAAK,MAAc,cAAc,oBAAoB,EAAE,IAAI,CAAC;AAAA,EACrE;AAAA;AAAA,EAGA,6BAA6B,aAAwC;AACnE,WAAO,KAAK,MAAe,cAAc,8BAA8B,EAAE,YAAY,CAAC;AAAA,EACxF;AAAA;AAAA,EAGA,OAAsB;AACpB,WAAO,KAAK,MAAY,cAAc,IAAI;AAAA,EAC5C;AAAA;AAAA,EAGA,uBAAuB,QAAiD;AACtE,WAAO,KAAK,MAAsB,cAAc,wBAAwB,QAAQ,IAAO;AAAA,EACzF;AACF;;;AFvIO,IAAM,YAAY,IAAI,UAAU;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/types.ts","../src/MexBridge.ts"],"sourcesContent":["export { MexBridge } from './MexBridge'\nexport { BridgeMethods } from './types'\nexport type {\n CaptureAttachmentsParams,\n AddAttachmentsParams,\n AttachmentSource,\n PickedFile,\n AttachmentMetadata,\n AttachmentsByParentIdResult,\n AuthenticationInfo,\n FormMetadata,\n TapToPayParams,\n TapToPayResult,\n CaptureSignatureOptions,\n CaptureSignatureResult,\n AddSignatureParams,\n} from './types'\n\n// Singleton instance for convenience\nimport { MexBridge } from './MexBridge'\nexport const mexBridge = new MexBridge()\n","/** Bridge method name constants — shared between web SDK and native handlers */\nexport const BridgeMethods = {\n getInstanceData: 'getInstanceData',\n getStaticData: 'getStaticData',\n captureAttachments: 'captureAttachments',\n addAttachments: 'addAttachments',\n removeAttachment: 'removeAttachment',\n getAttachment: 'getAttachment',\n getAttachmentsByParentId: 'getAttachmentsByParentId',\n saveInstanceData: 'saveInstanceData',\n getMetadata: 'getMetadata',\n getAuthenticationInfo: 'getAuthenticationInfo',\n getLocalizedString: 'getLocalizedString',\n sendExtensionMandatoryStatus: 'sendExtensionMandatoryStatus',\n exit: 'exit',\n collectTapToPayPayment: 'collectTapToPayPayment',\n captureSignature: 'captureSignature',\n addSignature: 'addSignature',\n} as const\n\n/** Available attachment picker sources */\nexport type AttachmentSource = 'camera' | 'photoLibrary' | 'files'\n\n/** Parameters for capturing attachments via native pickers */\nexport interface CaptureAttachmentsParams {\n /** Which picker sources to offer. Defaults to all three. If only one, opens directly without bottom sheet. */\n sources?: AttachmentSource[]\n}\n\n/** A file picked from a native picker (camera, photo library, or file browser) */\nexport interface PickedFile {\n uri: string\n fileName: string\n}\n\n/** Parameters for persisting captured attachments to the native layer */\nexport interface AddAttachmentsParams {\n /** The picked files to persist */\n attachments: PickedFile[]\n /** The parent object ID to associate attachments with */\n parentContextId: string\n /** Optional category name for the attachments */\n categoryName?: string\n}\n\n/** Metadata about a stored attachment (returned by getAttachment) */\nexport interface AttachmentMetadata {\n uid: string\n fileName: string\n downloadURL?: string\n status?: string\n contentType?: string\n}\n\n/** Result of getAttachmentsByParentId — matches MexAttachmentsOnParentContextChangedResult */\nexport interface AttachmentsByParentIdResult {\n attachments: AttachmentMetadata[]\n parentId: string\n}\n\n/** Authentication information for the current user */\nexport interface AuthenticationInfo {\n accessToken: string\n apiUrl: string\n userId?: string\n}\n\n/** Form metadata */\nexport interface FormMetadata {\n contextObjectId: string\n packageId: string\n formName?: string\n contextObject?: string\n user?: Record<string, any>\n job?: Record<string, any>\n timezone?: Record<string, any>\n}\n\n/** Parameters for initiating a Tap to Pay payment via Stripe Terminal */\nexport interface TapToPayParams {\n connectionToken: string\n clientSecret: string\n locationId: string\n}\n\n/** Result of a Tap to Pay payment attempt */\nexport interface TapToPayResult {\n success: boolean\n paymentIntentId?: string\n error?: string\n}\n\n/** Parameters for capturing a signature via the native signature screen */\nexport interface CaptureSignatureOptions {\n /** Show the full-name field on the native screen. Defaults to false. */\n enableFullName?: boolean\n}\n\n/** Result of a successful signature capture */\nexport interface CaptureSignatureResult {\n /** Local file path to the captured signature image */\n uri: string\n /** Generated file name, e.g. \"signature-<uuid>.png\". Informational only — addSignature ignores it. */\n fileName: string\n /** Full name entered by the signer. Only present when CaptureSignatureOptions.enableFullName === true. */\n fullName?: string\n}\n\n/** Parameters for persisting a captured signature to the native layer */\nexport interface AddSignatureParams {\n /** The captured signature to persist */\n signature: {\n uri: string\n fullName?: string\n }\n /** The parent object ID to associate the signature with */\n parentContextId: string\n /** Optional category name for the signature */\n categoryName?: string\n}\n\n/** Internal bridge message from web to RN */\nexport interface BridgeCallMessage {\n type: 'bridge_call'\n method: string\n requestId: string\n params?: any\n}\n\n/** Internal bridge response from RN to web */\nexport interface BridgeResponseMessage {\n type: 'bridge_response'\n requestId: string\n result?: any\n error?: string\n}\n","import { BridgeMethods } from './types'\nimport type { CaptureAttachmentsParams, AddAttachmentsParams, PickedFile, AttachmentMetadata, AttachmentsByParentIdResult, AuthenticationInfo, FormMetadata, BridgeResponseMessage, TapToPayParams, TapToPayResult, CaptureSignatureOptions, CaptureSignatureResult, AddSignatureParams } from './types'\n\ntype PendingCallback = {\n resolve: (value: any) => void\n reject: (reason: any) => void\n timeoutId: ReturnType<typeof setTimeout>\n}\n\ndeclare global {\n interface Window {\n ReactNativeWebView?: {\n postMessage(message: string): void\n }\n onNativeMessage?: (messageString: string) => void\n }\n}\n\nconst DEFAULT_TIMEOUT_MS = 30_000\n\nclass MexBridge {\n private _callbacks = new Map<string, PendingCallback>()\n private _initialized = false\n\n constructor() {\n this._initialize()\n }\n\n private _initialize(): void {\n if (this._initialized) return\n this._initialized = true\n\n window.onNativeMessage = (messageString: string) => {\n try {\n const message: BridgeResponseMessage = JSON.parse(messageString)\n if (message.type !== 'bridge_response' || !message.requestId) return\n\n const pending = this._callbacks.get(message.requestId)\n if (!pending) return\n\n clearTimeout(pending.timeoutId)\n this._callbacks.delete(message.requestId)\n\n if (message.error) {\n pending.reject(new Error(message.error))\n } else {\n pending.resolve(message.result)\n }\n } catch (e) {\n console.warn('[MexBridge] Failed to parse native message:', e)\n }\n }\n }\n\n private _call<T = any>(method: string, params?: any, timeoutMs = DEFAULT_TIMEOUT_MS): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n if (!window.ReactNativeWebView) {\n reject(new Error('[MexBridge] Not running inside a React Native WebView'))\n return\n }\n\n const requestId = this._generateId()\n\n const timeoutId = setTimeout(() => {\n this._callbacks.delete(requestId)\n reject(new Error(`[MexBridge] Timeout: ${method} did not respond within ${timeoutMs}ms`))\n }, timeoutMs)\n\n this._callbacks.set(requestId, { resolve, reject, timeoutId })\n\n window.ReactNativeWebView.postMessage(JSON.stringify({\n type: 'bridge_call',\n method,\n requestId,\n params,\n }))\n })\n }\n\n private _generateId(): string {\n return Math.random().toString(36).substring(2) + Date.now().toString(36)\n }\n\n /** Fetch the current form instance data */\n getInstanceData(): Promise<any> {\n return this._call(BridgeMethods.getInstanceData)\n }\n\n /** Fetch static/shared data for the form */\n getStaticData(): Promise<any> {\n return this._call(BridgeMethods.getStaticData)\n }\n\n /** Open native picker(s) for camera, photo library, or files. Returns picked files or null if cancelled. */\n captureAttachments(params?: CaptureAttachmentsParams): Promise<PickedFile[] | null> {\n return this._call<PickedFile[] | null>(BridgeMethods.captureAttachments, params)\n }\n\n /** Persist captured attachments to the native mobile layer */\n addAttachments(params: AddAttachmentsParams): Promise<any> {\n return this._call(BridgeMethods.addAttachments, params)\n }\n\n /** Remove an existing attachment by ID */\n removeAttachment(attachmentId: string): Promise<boolean> {\n return this._call<boolean>(BridgeMethods.removeAttachment, { attachmentId })\n }\n\n /** Retrieve attachment metadata by ID */\n getAttachment(attachmentId: string): Promise<AttachmentMetadata> {\n return this._call<AttachmentMetadata>(BridgeMethods.getAttachment, { attachmentId })\n }\n\n /** Get all attachments for a parent object (one-shot, not observable) */\n getAttachmentsByParentId(parentContextId: string): Promise<AttachmentsByParentIdResult> {\n return this._call<AttachmentsByParentIdResult>(BridgeMethods.getAttachmentsByParentId, { parentContextId })\n }\n\n /** Persist form data back to the engine */\n saveInstanceData(data: any): Promise<boolean> {\n return this._call<boolean>(BridgeMethods.saveInstanceData, { data })\n }\n\n /** Retrieve form metadata (form name, context, user info, etc.) */\n getMetadata(): Promise<FormMetadata> {\n return this._call<FormMetadata>(BridgeMethods.getMetadata)\n }\n\n /** Get the current user's auth token and identity */\n getAuthenticationInfo(): Promise<AuthenticationInfo> {\n return this._call<AuthenticationInfo>(BridgeMethods.getAuthenticationInfo)\n }\n\n /** Get a localized string by key from the form's locale files */\n getLocalizedString(key: string): Promise<string> {\n return this._call<string>(BridgeMethods.getLocalizedString, { key })\n }\n\n /** Signal whether the form's mandatory requirements are satisfied */\n sendExtensionMandatoryStatus(isCompleted: boolean): Promise<boolean> {\n return this._call<boolean>(BridgeMethods.sendExtensionMandatoryStatus, { isCompleted })\n }\n\n /** Exit the form and return to the native app */\n exit(): Promise<void> {\n return this._call<void>(BridgeMethods.exit)\n }\n\n /** Initiate a Tap to Pay payment via Stripe Terminal on the native device */\n collectTapToPayPayment(params: TapToPayParams): Promise<TapToPayResult> {\n return this._call<TapToPayResult>(BridgeMethods.collectTapToPayPayment, params, 120_000)\n }\n\n /** Open the native signature screen. Resolves with the captured signature, or null if the user cancels. */\n captureSignature(options?: CaptureSignatureOptions): Promise<CaptureSignatureResult | null> {\n return this._call<CaptureSignatureResult | null>(BridgeMethods.captureSignature, options, 120_000)\n }\n\n /** Persist a captured signature to the native mobile layer */\n addSignature(params: AddSignatureParams): Promise<any> {\n return this._call(BridgeMethods.addSignature, params)\n }\n}\n\nexport { MexBridge }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCO,IAAM,gBAAgB;AAAA,EAC3B,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,0BAA0B;AAAA,EAC1B,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,8BAA8B;AAAA,EAC9B,MAAM;AAAA,EACN,wBAAwB;AAAA,EACxB,kBAAkB;AA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,6BAA6B,aAAwC;AACnE,WAAO,KAAK,MAAe,cAAc,8BAA8B,EAAE,YAAY,CAAC;AAAA,EACxF;AAAA;AAAA,EAGA,OAAsB;AACpB,WAAO,KAAK,MAAY,cAAc,IAAI;AAAA,EAC5C;AAAA;AAAA,EAGA,uBAAuB,QAAiD;AACtE,WAAO,KAAK,MAAsB,cAAc,wBAAwB,QAAQ,IAAO;AAAA,EACzF;AAAA;AAAA,EAGA,iBAAiB,SAA2E;AAC1F,WAAO,KAAK,MAAqC,cAAc,kBAAkB,SAAS,IAAO;AAAA,EACnG;AAAA;AAAA,EAGA,aAAa,QAA0C;AACrD,WAAO,KAAK,MAAM,cAAc,cAAc,MAAM;AAAA,EACtD;AACF;;;AF9IO,IAAM,YAAY,IAAI,UAAU;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -13,7 +13,9 @@ var BridgeMethods = {
|
|
|
13
13
|
getLocalizedString: "getLocalizedString",
|
|
14
14
|
sendExtensionMandatoryStatus: "sendExtensionMandatoryStatus",
|
|
15
15
|
exit: "exit",
|
|
16
|
-
collectTapToPayPayment: "collectTapToPayPayment"
|
|
16
|
+
collectTapToPayPayment: "collectTapToPayPayment",
|
|
17
|
+
captureSignature: "captureSignature",
|
|
18
|
+
addSignature: "addSignature"
|
|
17
19
|
};
|
|
18
20
|
|
|
19
21
|
// src/MexBridge.ts
|
|
@@ -124,6 +126,14 @@ var MexBridge = class {
|
|
|
124
126
|
collectTapToPayPayment(params) {
|
|
125
127
|
return this._call(BridgeMethods.collectTapToPayPayment, params, 12e4);
|
|
126
128
|
}
|
|
129
|
+
/** Open the native signature screen. Resolves with the captured signature, or null if the user cancels. */
|
|
130
|
+
captureSignature(options) {
|
|
131
|
+
return this._call(BridgeMethods.captureSignature, options, 12e4);
|
|
132
|
+
}
|
|
133
|
+
/** Persist a captured signature to the native mobile layer */
|
|
134
|
+
addSignature(params) {
|
|
135
|
+
return this._call(BridgeMethods.addSignature, params);
|
|
136
|
+
}
|
|
127
137
|
};
|
|
128
138
|
|
|
129
139
|
// src/index.ts
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types.ts","../src/MexBridge.ts","../src/index.ts"],"sourcesContent":["/** Bridge method name constants — shared between web SDK and native handlers */\nexport const BridgeMethods = {\n getInstanceData: 'getInstanceData',\n getStaticData: 'getStaticData',\n captureAttachments: 'captureAttachments',\n addAttachments: 'addAttachments',\n removeAttachment: 'removeAttachment',\n getAttachment: 'getAttachment',\n getAttachmentsByParentId: 'getAttachmentsByParentId',\n saveInstanceData: 'saveInstanceData',\n getMetadata: 'getMetadata',\n getAuthenticationInfo: 'getAuthenticationInfo',\n getLocalizedString: 'getLocalizedString',\n sendExtensionMandatoryStatus: 'sendExtensionMandatoryStatus',\n exit: 'exit',\n collectTapToPayPayment: 'collectTapToPayPayment',\n} as const\n\n/** Available attachment picker sources */\nexport type AttachmentSource = 'camera' | 'photoLibrary' | 'files'\n\n/** Parameters for capturing attachments via native pickers */\nexport interface CaptureAttachmentsParams {\n /** Which picker sources to offer. Defaults to all three. If only one, opens directly without bottom sheet. */\n sources?: AttachmentSource[]\n}\n\n/** A file picked from a native picker (camera, photo library, or file browser) */\nexport interface PickedFile {\n uri: string\n fileName: string\n}\n\n/** Parameters for persisting captured attachments to the native layer */\nexport interface AddAttachmentsParams {\n /** The picked files to persist */\n attachments: PickedFile[]\n /** The parent object ID to associate attachments with */\n parentContextId: string\n /** Optional category name for the attachments */\n categoryName?: string\n}\n\n/** Metadata about a stored attachment (returned by getAttachment) */\nexport interface AttachmentMetadata {\n uid: string\n fileName: string\n downloadURL?: string\n status?: string\n contentType?: string\n}\n\n/** Result of getAttachmentsByParentId — matches MexAttachmentsOnParentContextChangedResult */\nexport interface AttachmentsByParentIdResult {\n attachments: AttachmentMetadata[]\n parentId: string\n}\n\n/** Authentication information for the current user */\nexport interface AuthenticationInfo {\n accessToken: string\n apiUrl: string\n userId?: string\n}\n\n/** Form metadata */\nexport interface FormMetadata {\n contextObjectId: string\n packageId: string\n formName?: string\n contextObject?: string\n user?: Record<string, any>\n job?: Record<string, any>\n timezone?: Record<string, any>\n}\n\n/** Parameters for initiating a Tap to Pay payment via Stripe Terminal */\nexport interface TapToPayParams {\n connectionToken: string\n clientSecret: string\n locationId: string\n}\n\n/** Result of a Tap to Pay payment attempt */\nexport interface TapToPayResult {\n success: boolean\n paymentIntentId?: string\n error?: string\n}\n\n/** Internal bridge message from web to RN */\nexport interface BridgeCallMessage {\n type: 'bridge_call'\n method: string\n requestId: string\n params?: any\n}\n\n/** Internal bridge response from RN to web */\nexport interface BridgeResponseMessage {\n type: 'bridge_response'\n requestId: string\n result?: any\n error?: string\n}\n","import { BridgeMethods } from './types'\nimport type { CaptureAttachmentsParams, AddAttachmentsParams, PickedFile, AttachmentMetadata, AttachmentsByParentIdResult, AuthenticationInfo, FormMetadata, BridgeResponseMessage, TapToPayParams, TapToPayResult } from './types'\n\ntype PendingCallback = {\n resolve: (value: any) => void\n reject: (reason: any) => void\n timeoutId: ReturnType<typeof setTimeout>\n}\n\ndeclare global {\n interface Window {\n ReactNativeWebView?: {\n postMessage(message: string): void\n }\n onNativeMessage?: (messageString: string) => void\n }\n}\n\nconst DEFAULT_TIMEOUT_MS = 30_000\n\nclass MexBridge {\n private _callbacks = new Map<string, PendingCallback>()\n private _initialized = false\n\n constructor() {\n this._initialize()\n }\n\n private _initialize(): void {\n if (this._initialized) return\n this._initialized = true\n\n window.onNativeMessage = (messageString: string) => {\n try {\n const message: BridgeResponseMessage = JSON.parse(messageString)\n if (message.type !== 'bridge_response' || !message.requestId) return\n\n const pending = this._callbacks.get(message.requestId)\n if (!pending) return\n\n clearTimeout(pending.timeoutId)\n this._callbacks.delete(message.requestId)\n\n if (message.error) {\n pending.reject(new Error(message.error))\n } else {\n pending.resolve(message.result)\n }\n } catch (e) {\n console.warn('[MexBridge] Failed to parse native message:', e)\n }\n }\n }\n\n private _call<T = any>(method: string, params?: any, timeoutMs = DEFAULT_TIMEOUT_MS): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n if (!window.ReactNativeWebView) {\n reject(new Error('[MexBridge] Not running inside a React Native WebView'))\n return\n }\n\n const requestId = this._generateId()\n\n const timeoutId = setTimeout(() => {\n this._callbacks.delete(requestId)\n reject(new Error(`[MexBridge] Timeout: ${method} did not respond within ${timeoutMs}ms`))\n }, timeoutMs)\n\n this._callbacks.set(requestId, { resolve, reject, timeoutId })\n\n window.ReactNativeWebView.postMessage(JSON.stringify({\n type: 'bridge_call',\n method,\n requestId,\n params,\n }))\n })\n }\n\n private _generateId(): string {\n return Math.random().toString(36).substring(2) + Date.now().toString(36)\n }\n\n /** Fetch the current form instance data */\n getInstanceData(): Promise<any> {\n return this._call(BridgeMethods.getInstanceData)\n }\n\n /** Fetch static/shared data for the form */\n getStaticData(): Promise<any> {\n return this._call(BridgeMethods.getStaticData)\n }\n\n /** Open native picker(s) for camera, photo library, or files. Returns picked files or null if cancelled. */\n captureAttachments(params?: CaptureAttachmentsParams): Promise<PickedFile[] | null> {\n return this._call<PickedFile[] | null>(BridgeMethods.captureAttachments, params)\n }\n\n /** Persist captured attachments to the native mobile layer */\n addAttachments(params: AddAttachmentsParams): Promise<any> {\n return this._call(BridgeMethods.addAttachments, params)\n }\n\n /** Remove an existing attachment by ID */\n removeAttachment(attachmentId: string): Promise<boolean> {\n return this._call<boolean>(BridgeMethods.removeAttachment, { attachmentId })\n }\n\n /** Retrieve attachment metadata by ID */\n getAttachment(attachmentId: string): Promise<AttachmentMetadata> {\n return this._call<AttachmentMetadata>(BridgeMethods.getAttachment, { attachmentId })\n }\n\n /** Get all attachments for a parent object (one-shot, not observable) */\n getAttachmentsByParentId(parentContextId: string): Promise<AttachmentsByParentIdResult> {\n return this._call<AttachmentsByParentIdResult>(BridgeMethods.getAttachmentsByParentId, { parentContextId })\n }\n\n /** Persist form data back to the engine */\n saveInstanceData(data: any): Promise<boolean> {\n return this._call<boolean>(BridgeMethods.saveInstanceData, { data })\n }\n\n /** Retrieve form metadata (form name, context, user info, etc.) */\n getMetadata(): Promise<FormMetadata> {\n return this._call<FormMetadata>(BridgeMethods.getMetadata)\n }\n\n /** Get the current user's auth token and identity */\n getAuthenticationInfo(): Promise<AuthenticationInfo> {\n return this._call<AuthenticationInfo>(BridgeMethods.getAuthenticationInfo)\n }\n\n /** Get a localized string by key from the form's locale files */\n getLocalizedString(key: string): Promise<string> {\n return this._call<string>(BridgeMethods.getLocalizedString, { key })\n }\n\n /** Signal whether the form's mandatory requirements are satisfied */\n sendExtensionMandatoryStatus(isCompleted: boolean): Promise<boolean> {\n return this._call<boolean>(BridgeMethods.sendExtensionMandatoryStatus, { isCompleted })\n }\n\n /** Exit the form and return to the native app */\n exit(): Promise<void> {\n return this._call<void>(BridgeMethods.exit)\n }\n\n /** Initiate a Tap to Pay payment via Stripe Terminal on the native device */\n collectTapToPayPayment(params: TapToPayParams): Promise<TapToPayResult> {\n return this._call<TapToPayResult>(BridgeMethods.collectTapToPayPayment, params, 120_000)\n }\n}\n\nexport { MexBridge }\n","export { MexBridge } from './MexBridge'\nexport { BridgeMethods } from './types'\nexport type {\n CaptureAttachmentsParams,\n AddAttachmentsParams,\n AttachmentSource,\n PickedFile,\n AttachmentMetadata,\n AttachmentsByParentIdResult,\n AuthenticationInfo,\n FormMetadata,\n TapToPayParams,\n TapToPayResult,\n} from './types'\n\n// Singleton instance for convenience\nimport { MexBridge } from './MexBridge'\nexport const mexBridge = new MexBridge()\n"],"mappings":";AACO,IAAM,gBAAgB;AAAA,EAC3B,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,0BAA0B;AAAA,EAC1B,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,8BAA8B;AAAA,EAC9B,MAAM;AAAA,EACN,wBAAwB;AAC1B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E,WAAO,KAAK,MAAe,cAAc,8BAA8B,EAAE,YAAY,CAAC;AAAA,EACxF;AAAA;AAAA,EAGA,OAAsB;AACpB,WAAO,KAAK,MAAY,cAAc,IAAI;AAAA,EAC5C;AAAA;AAAA,EAGA,uBAAuB,QAAiD;AACtE,WAAO,KAAK,MAAsB,cAAc,wBAAwB,QAAQ,IAAO;AAAA,EACzF;AACF;;;ACvIO,IAAM,YAAY,IAAI,UAAU;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/types.ts","../src/MexBridge.ts","../src/index.ts"],"sourcesContent":["/** Bridge method name constants — shared between web SDK and native handlers */\nexport const BridgeMethods = {\n getInstanceData: 'getInstanceData',\n getStaticData: 'getStaticData',\n captureAttachments: 'captureAttachments',\n addAttachments: 'addAttachments',\n removeAttachment: 'removeAttachment',\n getAttachment: 'getAttachment',\n getAttachmentsByParentId: 'getAttachmentsByParentId',\n saveInstanceData: 'saveInstanceData',\n getMetadata: 'getMetadata',\n getAuthenticationInfo: 'getAuthenticationInfo',\n getLocalizedString: 'getLocalizedString',\n sendExtensionMandatoryStatus: 'sendExtensionMandatoryStatus',\n exit: 'exit',\n collectTapToPayPayment: 'collectTapToPayPayment',\n captureSignature: 'captureSignature',\n addSignature: 'addSignature',\n} as const\n\n/** Available attachment picker sources */\nexport type AttachmentSource = 'camera' | 'photoLibrary' | 'files'\n\n/** Parameters for capturing attachments via native pickers */\nexport interface CaptureAttachmentsParams {\n /** Which picker sources to offer. Defaults to all three. If only one, opens directly without bottom sheet. */\n sources?: AttachmentSource[]\n}\n\n/** A file picked from a native picker (camera, photo library, or file browser) */\nexport interface PickedFile {\n uri: string\n fileName: string\n}\n\n/** Parameters for persisting captured attachments to the native layer */\nexport interface AddAttachmentsParams {\n /** The picked files to persist */\n attachments: PickedFile[]\n /** The parent object ID to associate attachments with */\n parentContextId: string\n /** Optional category name for the attachments */\n categoryName?: string\n}\n\n/** Metadata about a stored attachment (returned by getAttachment) */\nexport interface AttachmentMetadata {\n uid: string\n fileName: string\n downloadURL?: string\n status?: string\n contentType?: string\n}\n\n/** Result of getAttachmentsByParentId — matches MexAttachmentsOnParentContextChangedResult */\nexport interface AttachmentsByParentIdResult {\n attachments: AttachmentMetadata[]\n parentId: string\n}\n\n/** Authentication information for the current user */\nexport interface AuthenticationInfo {\n accessToken: string\n apiUrl: string\n userId?: string\n}\n\n/** Form metadata */\nexport interface FormMetadata {\n contextObjectId: string\n packageId: string\n formName?: string\n contextObject?: string\n user?: Record<string, any>\n job?: Record<string, any>\n timezone?: Record<string, any>\n}\n\n/** Parameters for initiating a Tap to Pay payment via Stripe Terminal */\nexport interface TapToPayParams {\n connectionToken: string\n clientSecret: string\n locationId: string\n}\n\n/** Result of a Tap to Pay payment attempt */\nexport interface TapToPayResult {\n success: boolean\n paymentIntentId?: string\n error?: string\n}\n\n/** Parameters for capturing a signature via the native signature screen */\nexport interface CaptureSignatureOptions {\n /** Show the full-name field on the native screen. Defaults to false. */\n enableFullName?: boolean\n}\n\n/** Result of a successful signature capture */\nexport interface CaptureSignatureResult {\n /** Local file path to the captured signature image */\n uri: string\n /** Generated file name, e.g. \"signature-<uuid>.png\". Informational only — addSignature ignores it. */\n fileName: string\n /** Full name entered by the signer. Only present when CaptureSignatureOptions.enableFullName === true. */\n fullName?: string\n}\n\n/** Parameters for persisting a captured signature to the native layer */\nexport interface AddSignatureParams {\n /** The captured signature to persist */\n signature: {\n uri: string\n fullName?: string\n }\n /** The parent object ID to associate the signature with */\n parentContextId: string\n /** Optional category name for the signature */\n categoryName?: string\n}\n\n/** Internal bridge message from web to RN */\nexport interface BridgeCallMessage {\n type: 'bridge_call'\n method: string\n requestId: string\n params?: any\n}\n\n/** Internal bridge response from RN to web */\nexport interface BridgeResponseMessage {\n type: 'bridge_response'\n requestId: string\n result?: any\n error?: string\n}\n","import { BridgeMethods } from './types'\nimport type { CaptureAttachmentsParams, AddAttachmentsParams, PickedFile, AttachmentMetadata, AttachmentsByParentIdResult, AuthenticationInfo, FormMetadata, BridgeResponseMessage, TapToPayParams, TapToPayResult, CaptureSignatureOptions, CaptureSignatureResult, AddSignatureParams } from './types'\n\ntype PendingCallback = {\n resolve: (value: any) => void\n reject: (reason: any) => void\n timeoutId: ReturnType<typeof setTimeout>\n}\n\ndeclare global {\n interface Window {\n ReactNativeWebView?: {\n postMessage(message: string): void\n }\n onNativeMessage?: (messageString: string) => void\n }\n}\n\nconst DEFAULT_TIMEOUT_MS = 30_000\n\nclass MexBridge {\n private _callbacks = new Map<string, PendingCallback>()\n private _initialized = false\n\n constructor() {\n this._initialize()\n }\n\n private _initialize(): void {\n if (this._initialized) return\n this._initialized = true\n\n window.onNativeMessage = (messageString: string) => {\n try {\n const message: BridgeResponseMessage = JSON.parse(messageString)\n if (message.type !== 'bridge_response' || !message.requestId) return\n\n const pending = this._callbacks.get(message.requestId)\n if (!pending) return\n\n clearTimeout(pending.timeoutId)\n this._callbacks.delete(message.requestId)\n\n if (message.error) {\n pending.reject(new Error(message.error))\n } else {\n pending.resolve(message.result)\n }\n } catch (e) {\n console.warn('[MexBridge] Failed to parse native message:', e)\n }\n }\n }\n\n private _call<T = any>(method: string, params?: any, timeoutMs = DEFAULT_TIMEOUT_MS): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n if (!window.ReactNativeWebView) {\n reject(new Error('[MexBridge] Not running inside a React Native WebView'))\n return\n }\n\n const requestId = this._generateId()\n\n const timeoutId = setTimeout(() => {\n this._callbacks.delete(requestId)\n reject(new Error(`[MexBridge] Timeout: ${method} did not respond within ${timeoutMs}ms`))\n }, timeoutMs)\n\n this._callbacks.set(requestId, { resolve, reject, timeoutId })\n\n window.ReactNativeWebView.postMessage(JSON.stringify({\n type: 'bridge_call',\n method,\n requestId,\n params,\n }))\n })\n }\n\n private _generateId(): string {\n return Math.random().toString(36).substring(2) + Date.now().toString(36)\n }\n\n /** Fetch the current form instance data */\n getInstanceData(): Promise<any> {\n return this._call(BridgeMethods.getInstanceData)\n }\n\n /** Fetch static/shared data for the form */\n getStaticData(): Promise<any> {\n return this._call(BridgeMethods.getStaticData)\n }\n\n /** Open native picker(s) for camera, photo library, or files. Returns picked files or null if cancelled. */\n captureAttachments(params?: CaptureAttachmentsParams): Promise<PickedFile[] | null> {\n return this._call<PickedFile[] | null>(BridgeMethods.captureAttachments, params)\n }\n\n /** Persist captured attachments to the native mobile layer */\n addAttachments(params: AddAttachmentsParams): Promise<any> {\n return this._call(BridgeMethods.addAttachments, params)\n }\n\n /** Remove an existing attachment by ID */\n removeAttachment(attachmentId: string): Promise<boolean> {\n return this._call<boolean>(BridgeMethods.removeAttachment, { attachmentId })\n }\n\n /** Retrieve attachment metadata by ID */\n getAttachment(attachmentId: string): Promise<AttachmentMetadata> {\n return this._call<AttachmentMetadata>(BridgeMethods.getAttachment, { attachmentId })\n }\n\n /** Get all attachments for a parent object (one-shot, not observable) */\n getAttachmentsByParentId(parentContextId: string): Promise<AttachmentsByParentIdResult> {\n return this._call<AttachmentsByParentIdResult>(BridgeMethods.getAttachmentsByParentId, { parentContextId })\n }\n\n /** Persist form data back to the engine */\n saveInstanceData(data: any): Promise<boolean> {\n return this._call<boolean>(BridgeMethods.saveInstanceData, { data })\n }\n\n /** Retrieve form metadata (form name, context, user info, etc.) */\n getMetadata(): Promise<FormMetadata> {\n return this._call<FormMetadata>(BridgeMethods.getMetadata)\n }\n\n /** Get the current user's auth token and identity */\n getAuthenticationInfo(): Promise<AuthenticationInfo> {\n return this._call<AuthenticationInfo>(BridgeMethods.getAuthenticationInfo)\n }\n\n /** Get a localized string by key from the form's locale files */\n getLocalizedString(key: string): Promise<string> {\n return this._call<string>(BridgeMethods.getLocalizedString, { key })\n }\n\n /** Signal whether the form's mandatory requirements are satisfied */\n sendExtensionMandatoryStatus(isCompleted: boolean): Promise<boolean> {\n return this._call<boolean>(BridgeMethods.sendExtensionMandatoryStatus, { isCompleted })\n }\n\n /** Exit the form and return to the native app */\n exit(): Promise<void> {\n return this._call<void>(BridgeMethods.exit)\n }\n\n /** Initiate a Tap to Pay payment via Stripe Terminal on the native device */\n collectTapToPayPayment(params: TapToPayParams): Promise<TapToPayResult> {\n return this._call<TapToPayResult>(BridgeMethods.collectTapToPayPayment, params, 120_000)\n }\n\n /** Open the native signature screen. Resolves with the captured signature, or null if the user cancels. */\n captureSignature(options?: CaptureSignatureOptions): Promise<CaptureSignatureResult | null> {\n return this._call<CaptureSignatureResult | null>(BridgeMethods.captureSignature, options, 120_000)\n }\n\n /** Persist a captured signature to the native mobile layer */\n addSignature(params: AddSignatureParams): Promise<any> {\n return this._call(BridgeMethods.addSignature, params)\n }\n}\n\nexport { MexBridge }\n","export { MexBridge } from './MexBridge'\nexport { BridgeMethods } from './types'\nexport type {\n CaptureAttachmentsParams,\n AddAttachmentsParams,\n AttachmentSource,\n PickedFile,\n AttachmentMetadata,\n AttachmentsByParentIdResult,\n AuthenticationInfo,\n FormMetadata,\n TapToPayParams,\n TapToPayResult,\n CaptureSignatureOptions,\n CaptureSignatureResult,\n AddSignatureParams,\n} from './types'\n\n// Singleton instance for convenience\nimport { MexBridge } from './MexBridge'\nexport const mexBridge = new MexBridge()\n"],"mappings":";AACO,IAAM,gBAAgB;AAAA,EAC3B,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,0BAA0B;AAAA,EAC1B,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,8BAA8B;AAAA,EAC9B,MAAM;AAAA,EACN,wBAAwB;AAAA,EACxB,kBAAkB;AAAA,EAClB,cAAc;AAChB;;;ACAA,IAAM,qBAAqB;AAE3B,IAAM,YAAN,MAAgB;AAAA,EAId,cAAc;AAHd,SAAQ,aAAa,oBAAI,IAA6B;AACtD,SAAQ,eAAe;AAGrB,SAAK,YAAY;AAAA,EACnB;AAAA,EAEQ,cAAoB;AAC1B,QAAI,KAAK,aAAc;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