@payabli/component-contracts 0.4.0 → 0.5.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/aliases.d.ts +1 -0
- package/dist/generated.d.ts +1 -0
- package/dist/index.js +23 -1
- package/dist/onboarding/definition.d.ts +13 -0
- package/dist/onboarding/schema.d.ts +9 -0
- package/dist/registry.d.ts +2 -0
- package/dist/sdk.d.ts +2 -1
- package/package.json +1 -1
package/dist/aliases.d.ts
CHANGED
package/dist/generated.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1669,6 +1669,27 @@ function getComponentDescriptor(type) {
|
|
|
1669
1669
|
return descriptors.get(type);
|
|
1670
1670
|
}
|
|
1671
1671
|
|
|
1672
|
+
/**
|
|
1673
|
+
* Onboarding's wire contract. The boarding request owns all business data, so
|
|
1674
|
+
* the browser sends no options yet. The SDK sends this in CONFIG_SET.options
|
|
1675
|
+
* and payhub parses with this same object.
|
|
1676
|
+
*/
|
|
1677
|
+
const onboardingOptionsSchema = object({});
|
|
1678
|
+
/** Onboarding's own inbound events, beyond the base set every component shares. */
|
|
1679
|
+
const onboardingEvents = {};
|
|
1680
|
+
|
|
1681
|
+
/** Wire type → emitter event. Onboarding emits only the base events for now. */
|
|
1682
|
+
const onboardingEventSchemas = {};
|
|
1683
|
+
const onboardingDescriptor = register({
|
|
1684
|
+
type: 'onboarding',
|
|
1685
|
+
displayName: 'Onboarding',
|
|
1686
|
+
frameLabel: 'Onboarding form',
|
|
1687
|
+
embedPath: '/embed/onboarding',
|
|
1688
|
+
endsOnSuccess: false,
|
|
1689
|
+
optionsSchema: onboardingOptionsSchema,
|
|
1690
|
+
eventSchemas: onboardingEventSchemas,
|
|
1691
|
+
});
|
|
1692
|
+
|
|
1672
1693
|
/**
|
|
1673
1694
|
* PayIn's wire contract: its event schemas, options schema, and vocabulary.
|
|
1674
1695
|
* PayIn-specific on purpose — a payout component defines its own methods in
|
|
@@ -1804,6 +1825,7 @@ const payInEventSchemas = {
|
|
|
1804
1825
|
const payInDescriptor = register({
|
|
1805
1826
|
type: 'payin',
|
|
1806
1827
|
displayName: 'PayIn',
|
|
1828
|
+
frameLabel: 'Payment form',
|
|
1807
1829
|
embedPath: '/embed/payin',
|
|
1808
1830
|
endsOnSuccess: true,
|
|
1809
1831
|
optionsSchema: payinOptionsSchema,
|
|
@@ -1851,4 +1873,4 @@ const BASE_COMPONENT_EVENT_NAMES = [
|
|
|
1851
1873
|
'resize',
|
|
1852
1874
|
];
|
|
1853
1875
|
|
|
1854
|
-
export { BASE_COMPONENT_EVENT_NAMES, CARD_BRANDS, ErrorCodes, FORM_METHODS, MESSAGE_SOURCE, MESSAGE_VERSION, PAYIN_LABEL_KEYS, PAYMENT_METHODS, appearanceSchema, baseInboundEvents, componentDescriptors, componentErrorSchema, componentTypes, eventEnvelopeSchema, getComponentDescriptor, outboundMessages, parseEnvelope, parseMessage, parsePayload, payInDescriptor, payInEventSchemas, payinEvents, payinOptionsSchema, register };
|
|
1876
|
+
export { BASE_COMPONENT_EVENT_NAMES, CARD_BRANDS, ErrorCodes, FORM_METHODS, MESSAGE_SOURCE, MESSAGE_VERSION, PAYIN_LABEL_KEYS, PAYMENT_METHODS, appearanceSchema, baseInboundEvents, componentDescriptors, componentErrorSchema, componentTypes, eventEnvelopeSchema, getComponentDescriptor, onboardingDescriptor, onboardingEventSchemas, onboardingEvents, onboardingOptionsSchema, outboundMessages, parseEnvelope, parseMessage, parsePayload, payInDescriptor, payInEventSchemas, payinEvents, payinOptionsSchema, register };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Infer, InferEvents } from '../protocol/envelope.js';
|
|
2
|
+
import { onboardingEvents, onboardingOptionsSchema } from './schema.js';
|
|
3
|
+
export * from './schema.js';
|
|
4
|
+
/** The partner-facing options type is the wire schema's type. */
|
|
5
|
+
export type OnboardingOptions = Infer<typeof onboardingOptionsSchema>;
|
|
6
|
+
declare module '../registry.js' {
|
|
7
|
+
interface ComponentDefinitions {
|
|
8
|
+
onboarding: ComponentDefinition<OnboardingOptions, InferEvents<typeof onboardingEvents>>;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/** Wire type → emitter event. Onboarding emits only the base events for now. */
|
|
12
|
+
export declare const onboardingEventSchemas: {};
|
|
13
|
+
export declare const onboardingDescriptor: import("../registry.js").ComponentDescriptor<"onboarding">;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as z from 'zod/v4/mini';
|
|
2
|
+
/**
|
|
3
|
+
* Onboarding's wire contract. The boarding request owns all business data, so
|
|
4
|
+
* the browser sends no options yet. The SDK sends this in CONFIG_SET.options
|
|
5
|
+
* and payhub parses with this same object.
|
|
6
|
+
*/
|
|
7
|
+
export declare const onboardingOptionsSchema: z.ZodMiniObject<{}, z.core.$strip>;
|
|
8
|
+
/** Onboarding's own inbound events, beyond the base set every component shares. */
|
|
9
|
+
export declare const onboardingEvents: {};
|
package/dist/registry.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export type EventSchemaDescriptor<EventName extends string = string> = {
|
|
|
26
26
|
export type ComponentDescriptor<T extends ComponentType = ComponentType> = {
|
|
27
27
|
type: T;
|
|
28
28
|
displayName: string;
|
|
29
|
+
/** Accessible name of the component frame, such as "Payment form". */
|
|
30
|
+
frameLabel: string;
|
|
29
31
|
embedPath: `/embed/${string}`;
|
|
30
32
|
/** A successful submit ends this component, so the SDK destroys it after `success`. */
|
|
31
33
|
endsOnSuccess: boolean;
|
package/dist/sdk.d.ts
CHANGED
|
@@ -41,7 +41,8 @@ export interface CreateOptions<T extends ComponentType = ComponentType> {
|
|
|
41
41
|
key?: string;
|
|
42
42
|
appearance?: AppearanceOptions;
|
|
43
43
|
options?: ComponentOptions<T>;
|
|
44
|
-
|
|
44
|
+
/** Not supported by PayIn or Onboarding: the server session owns their data. */
|
|
45
|
+
prefill?: T extends 'payin' | 'onboarding' ? never : Record<string, string>;
|
|
45
46
|
locale?: string;
|
|
46
47
|
timeout?: number;
|
|
47
48
|
}
|
package/package.json
CHANGED